try{let e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`1c39d1be-d886-4ba8-aece-a169904c64c2`,e._sentryDebugIdIdentifier=`sentry-dbid-1c39d1be-d886-4ba8-aece-a169904c64c2`)}catch{}import"./rolldown-runtime-nx40z1zs.js";import{Ll as e,Ml as t}from"./entry.client-mpghtlrl.js";var n=`webos-virtual-keyboard-handler`,r=5,i=class{isListening=!1;start(){this.isListening||typeof document>`u`||typeof window>`u`||(window.webOSSystem?.setWindowProperty(`cloudgame_active`,`true`),this.abortController=new AbortController,document.addEventListener(`keyboardStateChange`,this.onKeyboardStateChange,{signal:this.abortController.signal}),this.isListening=!0)}destroy(){this.isListening&&=(this.abortController?.abort(),this.abortController=void 0,t.releasePollingMode(n),window.webOSSystem?.setWindowProperty(`cloudgame_active`,`true`),!1)}onKeyboardStateChange=()=>{globalThis.keyboardStateEvent&&globalThis.keyboardStateEvent.visibility?(t.requestPollingMode(n,`none`,r),window.webOSSystem?.setWindowProperty(`cloudgame_active`,`false`)):(t.releasePollingMode(n),window.webOSSystem?.setWindowProperty(`cloudgame_active`,`true`),e(`b`))}},a=class{isListening=!1;start(){this.isListening||typeof document>`u`||typeof window>`u`||(this.abortController=new AbortController,document.addEventListener(`wheel`,this.onWheel,{signal:this.abortController.signal,passive:!0}),this.isListening=!0)}destroy(){this.isListening&&=(this.abortController?.abort(),this.abortController=void 0,!1)}onWheel=e=>{window.scrollBy(e.deltaX,e.deltaY)}},o=class{virtualKeyboardHandler=new i;wheelHandler=new a;onAppStart(){this.virtualKeyboardHandler.start(),this.wheelHandler.start()}hasQuitSupport(){return typeof window<`u`&&typeof window.close==`function`}quitApp(){this.virtualKeyboardHandler.destroy(),this.wheelHandler.destroy(),typeof window<`u`&&typeof window.close==`function`&&window.close()}};export{o as WebOSApplicationLifecycleAdaptor};