@netless/window-manager 0.4.15 → 0.4.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -1
- package/dist/AppManager.d.ts +4 -3
- package/dist/Utils/AppCreateQueue.d.ts +1 -0
- package/dist/Utils/Common.d.ts +2 -1
- package/dist/constants.d.ts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +5 -5
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +5 -5
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/AppListener.ts +4 -2
- package/src/AppManager.ts +16 -12
- package/src/AppProxy.ts +4 -2
- package/src/Utils/AppCreateQueue.ts +9 -1
- package/src/Utils/Common.ts +5 -2
- package/src/constants.ts +2 -0
- package/src/index.ts +26 -3
package/dist/index.es.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
var e,t,n=Object.defineProperty,i=Object.defineProperties,r=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,l=(e,t,i)=>t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,c=(e,t)=>{for(var n in t||(t={}))a.call(t,n)&&l(e,n,t[n]);if(s)for(var n of s(t))o.call(t,n)&&l(e,n,t[n]);return e},u=(e,t)=>i(e,r(t));import d from"p-retry";import h from"emittery";import{debounce as p,isEqual as f,omit as g,isObject as m,has as v,get as b,size as w,mapValues as y,noop as x,pick as C,isEmpty as M,isInteger as S,orderBy as I,throttle as E,isFunction as A,isNull as T}from"lodash";import{ScenePathType as k,UpdateEventKind as N,listenUpdated as P,unlistenUpdated as z,reaction as D,autorun as L,toJS as B,listenDisposed as j,unlistenDisposed as R,AnimationMode as O,isPlayer as V,isRoom as _,WhiteVersion as U,ApplianceNames as W,RoomPhase as H,InvisiblePlugin as Q,ViewMode as $}from"white-web-sdk";import{v4 as F}from"uuid";import{genUID as Z,SideEffectManager as Y}from"side-effect-manager";import{ResizeObserver as G}from"@juggle/resize-observer";import X from"video.js";(t=e||(e={})).AppMove="AppMove",t.AppFocus="AppFocus",t.AppResize="AppResize",t.AppBoxStateChange="AppBoxStateChange",t.GetAttributes="GetAttributes",t.UpdateWindowManagerWrapper="UpdateWindowManagerWrapper",t.InitReplay="InitReplay",t.WindowCreated="WindowCreated",t.SetMainViewScenePath="SetMainViewScenePath",t.SetMainViewSceneIndex="SetMainViewSceneIndex",t.SwitchViewsToFreedom="SwitchViewsToFreedom",t.MoveCamera="MoveCamera",t.MoveCameraToContain="MoveCameraToContain",t.CursorMove="CursorMove",t.RootDirRemoved="RootDirRemoved";var J,K,q,ee,te,ne,ie;(K=J||(J={})).Size="size",K.Position="position",K.SceneIndex="SceneIndex",K.ZIndex="zIndex",(ee=q||(q={})).setBoxSize="setBoxSize",ee.setBoxMinSize="setBoxMinSize",ee.destroy="destroy",(te||(te={})).StartCreate="StartCreate",(ie=ne||(ne={})).Leave="leave",ie.Normal="normal";const re=340/720,se=340/720,ae=new h;class oe{constructor(){this.list=[],this.isEmit=!1,this.invoked=()=>{this.currentInvoker=void 0,0===this.list.length&&(this.clear(),this.emitReady())},this.clear=()=>{clearInterval(this.timer),this.timer=void 0}}initInterval(){return setInterval((()=>{this.invoke()}),50)}push(e){this.list.push(e),this.invoke(),void 0===this.timer&&this.list.length>0&&(this.timer=this.initInterval())}invoke(){if(0===this.list.length)return;if(void 0!==this.currentInvoker)return;const e=this.list.shift();e&&(this.currentInvoker=e,e().then((()=>{this.invoked()})).catch((e=>{console.error(`[WindowManager]: create app error: ${e.message}`),this.invoked()})))}emitReady(){this.isEmit||ae.emit("ready"),this.isEmit=!0}destroy(){this.timer&&this.clear()}}const le=new h;let ce,ue;const de=async()=>{ce=await new Promise(((e,t)=>{const n=indexedDB.open("__WindowManagerAppCache",2);n.onerror=e=>{t(e)},n.onupgradeneeded=e=>{const t=e.target.result;t.objectStoreNames.contains("apps")||(ue=t.createObjectStore("apps",{keyPath:"kind"}),ue.createIndex("kind","kind",{unique:!0}))},n.onsuccess=()=>{const t=n.result;e(t)}}))},he=(e,t)=>{var n,i;if(ce)return n=ce,i={kind:e,sourceCode:t},new Promise(((e,t)=>{const r=n.transaction(["apps"],"readwrite").objectStore("apps").add(i);r.onsuccess=()=>e(),r.onerror=()=>t()}))},pe=async e=>{return ce?await(t=ce,n=e,new Promise(((e,i)=>{const r=t.transaction(["apps"]).objectStore("apps").index("kind").get(n);r.onerror=e=>i(e),r.onsuccess=()=>{r.result?e(r.result):e(null)}}))):null;var t,n};const fe=async e=>{const t=await pe(e);if(t)return t.sourceCode;{const t=await async function(e,t){const{timeout:n=1e4}=t,i=new AbortController,r=setTimeout((()=>i.abort()),n),s=await fetch(e,u(c({},t),{signal:i.signal,headers:{"content-type":"text/plain"}}));return clearTimeout(r),s}(e,{timeout:1e4}),n=await t.text();return await he(e,n),n}},ge=(e,t)=>{let n=Function(e+`\n;return ${t}`)();return void 0===n&&(n=window[t]),n};const me=new class{constructor(){this.kindEmitters=new Map,this.registered=new Map,this.appClassesCache=new Map,this.appClasses=new Map,this.syncRegisterApp=null,this.onSyncRegisterAppChange=e=>{this.register({kind:e.kind,src:e.src})}}setSyncRegisterApp(e){this.syncRegisterApp=e}async register(e){this.appClassesCache.delete(e.kind),this.registered.set(e.kind,e);const t=e.src;let n;if("string"==typeof t?(n=async()=>{let n=await(async(e,t,n)=>{const i=n||"NetlessApp"+t;ae.emit("loadApp",{kind:t,status:"start"});try{const n=await fe(e);if(!n||0===n.length)return void ae.emit("loadApp",{kind:t,status:"failed",reason:"script is empty."});try{const e=ge(n,i);return ae.emit("loadApp",{kind:t,status:"success"}),e}catch(r){if(r.message.includes("Can only have one anonymous define call per script file")){const e=window.define;"function"==typeof e&&e.amd&&delete e.amd;const r=ge(n,i);return ae.emit("loadApp",{kind:t,status:"success"}),r}ae.emit("loadApp",{kind:t,status:"failed",reason:r.message})}}catch(r){ae.emit("loadApp",{kind:t,status:"failed",reason:r.message})}})(t,e.kind,e.name);if(n)return n.__esModule&&(n=n.default),n;throw new Error(`[WindowManager]: load remote script failed, ${t}`)},this.syncRegisterApp&&this.syncRegisterApp({kind:e.kind,src:t,name:e.name})):n="function"==typeof t?t:async()=>t,this.appClasses.set(e.kind,(async()=>{let t=this.appClassesCache.get(e.kind);return t||(t=n(),this.appClassesCache.set(e.kind,t)),t})),e.addHooks){const t=this.createKindEmitter(e.kind);t&&e.addHooks(t)}}unregister(e){this.appClasses.delete(e),this.appClassesCache.delete(e),this.registered.delete(e);const t=this.kindEmitters.get(e);t&&(t.clearListeners(),this.kindEmitters.delete(e))}async notifyApp(e,t,n){const i=this.kindEmitters.get(e);await(null==i?void 0:i.emit(t,n))}createKindEmitter(e){if(!this.kindEmitters.has(e)){const t=new h;this.kindEmitters.set(e,t)}return this.kindEmitters.get(e)}},ve=(e,t)=>{if(e.focusScenePath!==t)return e.focusScenePath=t,e},be=(e,t)=>{if(e&&e.isWritable&&e.state.sceneState.scenePath!==t){const n="/"===t?"":t;e.setScenePath(n)}};p(((e,t)=>{e.emit("mainViewModeChange",t)}),200);const we=(e,t,n=0)=>{const i=ye(e)[t];if(!i)return;const r=i[n];if(!r)return;const s=r.name;return"/"===t?`/${s}`:`${t}/${s}`},ye=e=>e.entireScenes(),xe=e=>{const t=e.split("/");t.pop();let n=t.join("/");return""===n&&(n="/"),n},Ce=e=>{const t=e.split(".").map((e=>e.padStart(2,"0"))).join("");return parseInt(t)},Me=e=>new Promise((t=>setTimeout(t,e)));class Se{constructor(t){this.manager=t,this.displayer=this.manager.displayer,this.mainMagixEventListener=t=>{if(t.authorId!==this.displayer.observerId){const n=t.payload;switch(n.eventName){case e.AppMove:this.appMoveHandler(n.payload);break;case e.AppResize:this.appResizeHandler(n.payload);break;case e.AppBoxStateChange:this.boxStateChangeHandler(n.payload);break;case e.SetMainViewScenePath:this.setMainViewScenePathHandler(n.payload);break;case e.MoveCamera:this.moveCameraHandler(n.payload);break;case e.MoveCameraToContain:this.moveCameraToContainHandler(n.payload);break;case e.CursorMove:this.cursorMoveHandler(n.payload);break;case e.RootDirRemoved:this.rootDirRemovedHandler()}}},this.appMoveHandler=e=>{var t;null==(t=this.boxManager)||t.moveBox(e)},this.appResizeHandler=e=>{var t,n;null==(t=this.boxManager)||t.resizeBox(Object.assign(e,{skipUpdate:!0})),null==(n=this.manager.room)||n.refreshViewSize()},this.boxStateChangeHandler=e=>{ae.emit("boxStateChange",e)},this.setMainViewScenePathHandler=({nextScenePath:e})=>{ve(this.manager.mainView,e),ae.emit("mainViewScenePathChange",e)},this.moveCameraHandler=e=>{f(g(e,["animationMode"]),c({},this.manager.mainView.camera))||this.manager.mainView.moveCamera(e)},this.moveCameraToContainHandler=e=>{this.manager.mainView.moveCameraToContain(e)},this.cursorMoveHandler=e=>{le.emit("cursorMove",e)},this.rootDirRemovedHandler=()=>{this.manager.onRootDirRemoved()}}get boxManager(){return this.manager.boxManager}addListeners(){this.displayer.addMagixEventListener("__WindowManger",this.mainMagixEventListener)}removeListeners(){this.displayer.removeMagixEventListener("__WindowManger",this.mainMagixEventListener)}}class Ie extends Error{constructor(){super(...arguments),this.message="[WindowManager]: app duplicate exists and cannot be created again"}}class Ee extends Error{constructor(){super(...arguments),this.message="[WindowManager]: AppManager must be initialized"}}class Ae extends Error{constructor(e){super(`[WindowManager]: white-web-sdk version must large than ${e}`)}}class Te extends Error{constructor(){super(...arguments),this.message="[WindowManager]: kind must be a valid string"}}class ke extends Error{constructor(){super(...arguments),this.message="[WindowManager]: box need created"}}class Ne extends Error{constructor(){super(...arguments),this.message='[WindowManager]: ScenePath should start with "/"'}}class Pe extends Error{constructor(){super(...arguments),this.message="[WindowManager]: boxManager not found"}}const ze=e=>(t,n)=>{if(void 0!==t){if(P){const i=t=>{t.map((e=>e.kind)).includes(e)&&n()};return P(t,i),n(),()=>z(t,i)}return D((()=>t),(()=>{n()}),{fireImmediately:!0})}},De=(e,t,n)=>{let i=null;const r=D(e,(()=>{i&&(i(),i=null);const r=e();m(r)?(i=()=>z(r,t),P(r,t)):null==n||n(r)}),{fireImmediately:!0});return()=>{null==i||i(),r()}},Le=ze(N.Removed);ze(N.Inserted);const Be=Object.keys;function je(e){return Boolean(v(e,"__isRef"))}class Re{constructor(){this.listeners=new Set}get length(){return this.listeners.size}dispatch(e){this.listeners.forEach((t=>t(e)))}addListener(e){this.listeners.add(e)}removeListener(e){this.listeners.delete(e)}}const Oe="_WM-STORAGE_";class Ve{constructor(e,t,n){if(this._sideEffect=new Y,this._destroyed=!1,this._refMap=new WeakMap,this._lastValue=new Map,this.onStateChanged=new Re,n&&!m(n))throw new Error(`Default state for Storage ${t} is not an object.`);this._context=e,this.id=t||null,this._state={};const i=this._getRawState(this._state);null!==this.id&&this._context.getIsWritable()&&(i!==this._state&&m(i)||(b(this._context.getAttributes(),[Oe])||this._context.updateAttributes([Oe],{}),this._context.updateAttributes([Oe,this.id],this._state)),n&&this.setState(n)),Be(i).forEach((e=>{if(null!==this.id||e!==Oe)try{const t=m(i[e])?JSON.parse(JSON.stringify(i[e])):i[e];je(t)?(this._state[e]=t.v,m(t.v)&&this._refMap.set(t.v,t)):this._state[e]=t}catch(Pb){console.error(Pb)}})),this._sideEffect.addDisposer(De((()=>null===this.id?e.getAttributes():b(e.getAttributes(),[Oe,this.id])),this._updateProperties.bind(this),this.destroy.bind(this)))}get state(){return this._destroyed&&console.warn(`Accessing state on destroyed Storage "${this.id}"`),this._state}addStateChangedListener(e){return this.onStateChanged.addListener(e),()=>this.onStateChanged.removeListener(e)}ensureState(e){return this.setState(Be(e).reduce(((t,n)=>(v(this._state,n)||(t[n]=e[n]),t)),{}))}setState(e){if(this._destroyed)return void console.error(new Error(`Cannot call setState on destroyed Storage "${this.id}".`));if(!this._context.getIsWritable())return void console.error(new Error(`Cannot setState on Storage "${this.id}" without writable access`),e);const t=Be(e);t.length>0&&t.forEach((t=>{const n=e[t];var i;if(n!==this._state[t])if(void 0===n)this._lastValue.set(t,this._state[t]),delete this._state[t],this._setRawState(t,n);else{this._lastValue.set(t,this._state[t]),this._state[t]=n;let e=n;if(m(n)){let t=this._refMap.get(n);t||(i=n,t={k:Z(),v:i,__isRef:!0},this._refMap.set(n,t)),e=t}this._setRawState(t,e)}}))}emptyStorage(){w(this._state)<=0||(this._destroyed?console.error(new Error(`Cannot empty destroyed Storage "${this.id}".`)):this._context.getIsWritable()?this.setState(y(this._state,x)):console.error(new Error(`Cannot empty Storage "${this.id}" without writable access.`)))}deleteStorage(){if(null===this.id)throw new Error("Cannot delete main Storage");this._context.getIsWritable()?(this.destroy(),this._context.updateAttributes([Oe,this.id],void 0)):console.error(new Error(`Cannot delete Storage "${this.id}" without writable access.`))}get destroyed(){return this._destroyed}destroy(){this._destroyed=!0,this._sideEffect.flushAll()}_getRawState(e){var t;return null===this.id?null!=(t=this._context.getAttributes())?t:e:b(this._context.getAttributes(),[Oe,this.id],e)}_setRawState(e,t){if(null===this.id){if(e===Oe)throw new Error('Cannot set attribute internal filed "_WM-STORAGE_"');return this._context.updateAttributes([e],t)}return this._context.updateAttributes([Oe,this.id,e],t)}_updateProperties(e){var t;if(this._destroyed)console.error(new Error(`Cannot call _updateProperties on destroyed Storage "${this.id}".`));else if(e.length>0){const n={};for(let i=0;i<e.length;i++)try{const r=e[i],s=r.key;if(null===this.id&&s===Oe)continue;const a=m(r.value)?JSON.parse(JSON.stringify(r.value)):r.value;let o;switch(this._lastValue.has(s)&&(o=this._lastValue.get(s),this._lastValue.delete(s)),r.kind){case 2:v(this._state,s)&&(o=this._state[s],delete this._state[s]),n[s]={oldValue:o};break;default:{let e=a;if(je(a)){const{k:n,v:i}=a,r=this._state[s];m(r)&&(null==(t=this._refMap.get(r))?void 0:t.k)===n?e=r:(e=i,m(i)&&this._refMap.set(i,a))}e!==this._state[s]&&(o=this._state[s],this._state[s]=e),n[s]={newValue:e,oldValue:o};break}}}catch(Pb){console.error(Pb)}this.onStateChanged.dispatch(n)}}}class _e{constructor(e,t,n,i,r){this.manager=e,this.boxManager=t,this.appId=n,this.appProxy=i,this.appOptions=r,this.mobxUtils={autorun:L,reaction:D,toJS:B},this.objectUtils={listenUpdated:P,unlistenUpdated:z,listenDisposed:j,unlistenDisposed:R},this.store=this.manager.store,this.isReplay=this.manager.isReplay,this.getDisplayer=()=>this.manager.displayer,this.getAttributes=()=>this.appProxy.attributes,this.getScenes=()=>{const e=this.store.getAppAttributes(this.appId);return(null==e?void 0:e.isDynamicPPT)?this.appProxy.scenes:null==e?void 0:e.options.scenes},this.getView=()=>this.appProxy.view,this.getInitScenePath=()=>this.manager.getAppInitPath(this.appId),this.getIsWritable=()=>this.manager.canOperate,this.getBox=()=>{const e=this.boxManager.getBox(this.appId);if(e)return e;throw new ke},this.getRoom=()=>this.manager.room,this.setAttributes=e=>{this.manager.safeSetAttributes({[this.appId]:e})},this.updateAttributes=(e,t)=>{this.manager.attributes[this.appId]&&this.manager.safeUpdateAttributes([this.appId,...e],t)},this.setScenePath=async e=>{var t;this.appProxy.box&&(this.appProxy.setFullPath(e),null==(t=this.getRoom())||t.setScenePath(e))},this.mountView=e=>{const t=this.getView();t&&(t.divElement=e,setTimeout((()=>{var e;null==(e=this.getRoom())||e.refreshViewSize()}),1e3))},this.getAppOptions=()=>"function"==typeof this.appOptions?this.appOptions():this.appOptions,this.createStorage=(e,t)=>{const n=new Ve(this,e,t);return this.emitter.on("destroy",(()=>{n.destroy()})),n},this.dispatchMagixEvent=(...e)=>{var t;const n=`${this.appId}:${e[0]}`;return null==(t=this.manager.room)?void 0:t.dispatchMagixEvent(n,e[1])},this.addMagixEventListener=(e,t,n)=>{const i=`${this.appId}:${e}`;return this.manager.displayer.addMagixEventListener(i,t,n),()=>this.manager.displayer.removeMagixEventListener(i,t)},this.removeMagixEventListener=this.manager.displayer.removeMagixEventListener.bind(this.manager.displayer),this.emitter=i.appEmitter,this.isAddApp=i.isAddApp}get storage(){return this._storage||(this._storage=new Ve(this)),this._storage}}var Ue,We;(We=Ue||(Ue={})).Apps="apps",We.Focus="focus",We.State="state",We.BoxState="boxState",We.MainViewCamera="mainViewCamera",We.MainViewSize="mainViewSize",We.Broadcaster="broadcaster",We.Cursors="cursors",We.Position="position",We.CursorState="cursorState",We.FullPath="fullPath",We.Registered="registered";const He=new class{constructor(e){this.context=e,this.setAppFocus=(e,t)=>{t?this.context.safeSetAttributes({[Ue.Focus]:e}):this.context.safeSetAttributes({[Ue.Focus]:void 0})}}setContext(e){this.context=e}get attributes(){return this.context.getAttributes()}apps(){return b(this.attributes,[Ue.Apps])}get focus(){return b(this.attributes,[Ue.Focus])}getAppAttributes(e){return b(this.apps(),[e])}getAppState(e){return b(this.apps(),[e,Ue.State])}getMaximized(){return b(this.attributes,["maximized"])}getMinimized(){return b(this.attributes,["minimized"])}setupAppAttributes(e,t,n){this.attributes.apps||this.context.safeSetAttributes({apps:{}});const i=["scenePath","title"];n||i.push("scenes");const r=C(e.options,i),s={kind:e.kind,options:r,isDynamicPPT:n};"string"==typeof e.src&&(s.src=e.src),s.createdAt=Date.now(),this.context.safeUpdateAttributes([Ue.Apps,t],s),this.context.safeUpdateAttributes([Ue.Apps,t,Ue.State],{[J.Size]:{},[J.Position]:{},[J.SceneIndex]:0})}updateAppState(e,t,n){b(this.attributes,[Ue.Apps,e,Ue.State])&&this.context.safeUpdateAttributes([Ue.Apps,e,Ue.State,t],n)}cleanAppAttributes(e){this.context.safeUpdateAttributes([Ue.Apps,e],void 0),this.context.safeSetAttributes({[e]:void 0});this.attributes[Ue.Focus]===e&&this.cleanFocus()}cleanFocus(){this.context.safeSetAttributes({[Ue.Focus]:void 0})}getAppSceneIndex(e){var t;return null==(t=this.getAppState(e))?void 0:t[J.SceneIndex]}getAppScenePath(e){var t,n;return null==(n=null==(t=this.getAppAttributes(e))?void 0:t.options)?void 0:n.scenePath}getMainViewScenePath(){return this.attributes._mainScenePath}getMainViewSceneIndex(){return this.attributes._mainSceneIndex}getBoxState(){return this.attributes[Ue.BoxState]}setMainViewScenePath(e){this.context.safeSetAttributes({_mainScenePath:e})}setMainViewSceneIndex(e){this.context.safeSetAttributes({_mainSceneIndex:e})}getMainViewCamera(){return b(this.attributes,[Ue.MainViewCamera])}getMainViewSize(){return b(this.attributes,[Ue.MainViewSize])}setMainViewCamera(e){this.context.safeSetAttributes({[Ue.MainViewCamera]:c({},e)})}setMainViewSize(e){this.context.safeSetAttributes({[Ue.MainViewSize]:c({},e)})}updateCursor(e,t){b(this.attributes,[Ue.Cursors])||this.context.safeUpdateAttributes([Ue.Cursors],{}),b(this.attributes,[Ue.Cursors,e])||this.context.safeUpdateAttributes([Ue.Cursors,e],{}),this.context.safeUpdateAttributes([Ue.Cursors,e,Ue.Position],t)}updateCursorState(e,t){b(this.attributes,[Ue.Cursors,e])||this.context.safeUpdateAttributes([Ue.Cursors,e],{}),this.context.safeUpdateAttributes([Ue.Cursors,e,Ue.CursorState],t)}getCursorState(e){return b(this.attributes,[Ue.Cursors,e,Ue.CursorState])}cleanCursor(e){this.context.safeUpdateAttributes([Ue.Cursors,e],void 0)}setMainViewFocusPath(e){const t=this.getMainViewScenePath();t&&ve(e,t)}}({getAttributes:()=>{throw new Error("getAttributes not implemented")},safeSetAttributes:()=>{throw new Error("safeSetAttributes not implemented")},safeUpdateAttributes:()=>{throw new Error("safeUpdateAttributes not implemented")}}),Qe=(...e)=>{Nb.debug&&console.log("[WindowManager]:",...e)};class $e{constructor(e,t,n,i){var r;this.params=e,this.manager=t,this.boxManager=this.manager.boxManager,this.appProxies=this.manager.appProxies,this.viewManager=this.manager.viewManager,this.store=this.manager.store,this.status="normal",this.getAppInitState=e=>{var t,n;const i=this.store.getAppState(e);if(!i)return;const r=null==i?void 0:i[J.Position],s=this.store.focus,a=null==i?void 0:i[J.Size],o=null==i?void 0:i[J.SceneIndex];let l={maximized:null==(t=this.attributes)?void 0:t.maximized,minimized:null==(n=this.attributes)?void 0:n.minimized,zIndex:null==i?void 0:i.zIndex};return r&&(l=u(c({},l),{id:e,x:r.x,y:r.y})),s===e&&(l=u(c({},l),{focus:!0})),a&&(l=u(c({},l),{width:a.width,height:a.height})),o&&(l=u(c({},l),{sceneIndex:o})),l},this.appAttributesUpdateListener=e=>{var t,n,i;null==(t=this.manager.refresher)||t.add(e,(()=>L((()=>{const t=this.manager.attributes[e];t&&this.appEmitter.emit("attributesUpdate",t)})))),null==(n=this.manager.refresher)||n.add(this.stateKey,(()=>L((()=>{var t,n,i;const r=null==(t=this.appAttributes)?void 0:t.state;(null==r?void 0:r.zIndex)>0&&r.zIndex!==(null==(n=this.box)?void 0:n.zIndex)&&(null==(i=this.boxManager)||i.setZIndex(e,r.zIndex))})))),null==(i=this.manager.refresher)||i.add(`${e}-fullPath`,(()=>L((()=>{var e;const t=null==(e=this.appAttributes)?void 0:e.fullPath;this.setFocusScenePathHandler(t)}))))},this.setFocusScenePathHandler=p((e=>{var t;this.view&&e&&e!==(null==(t=this.view)?void 0:t.focusScenePath)&&ve(this.view,e)}),50),this.kind=e.kind,this.id=n,this.stateKey=`${this.id}_state`,this.appProxies.set(this.id,this),this.appEmitter=new h,this.appListener=this.makeAppEventListener(this.id),this.isAddApp=i,this.initScenes(),(null==(r=this.params.options)?void 0:r.scenePath)&&this.createView()}initScenes(){var e;const t=this.params.options;t&&(this.scenePath=t.scenePath,(null==(e=this.appAttributes)?void 0:e.isDynamicPPT)&&this.scenePath?this.scenes=ye(this.manager.displayer)[this.scenePath]:this.scenes=t.scenes)}get view(){return this.manager.viewManager.getView(this.id)}get isWritable(){var e;return this.manager.canOperate&&!(null==(e=this.box)?void 0:e.readonly)}get attributes(){return this.manager.attributes[this.id]}get appAttributes(){return this.store.getAppAttributes(this.id)}getFullScenePath(){if(this.scenePath)return b(this.appAttributes,[Ue.FullPath])||this.getFullScenePathFromScenes()}getFullScenePathFromScenes(){const e=b(this.appAttributes,["state","SceneIndex"],0),t=((e,t,n)=>{var i;if(e&&t){const r=null==(i=ye(e)[t])?void 0:i[n];if(r)return`${t}/${r.name}`}})(this.manager.room,this.scenePath,e);return t&&this.setFullPath(t),t}setFullPath(e){this.manager.safeUpdateAttributes(["apps",this.id,Ue.FullPath],e)}async baseInsertApp(e=!1){var t;const n=this.params;if(!n.kind)throw new Error("[WindowManager]: kind require");const i=await(null==(t=me.appClasses.get(n.kind))?void 0:t()),r=me.registered.get(n.kind);if(!i)throw new Error(`[WindowManager]: app load failed ${n.kind} ${n.src}`);return await this.setupApp(this.id,e,i,n.options,null==r?void 0:r.appOptions),le.emit("updateManagerRect"),{appId:this.id,app:i}}get box(){var e;return null==(e=this.boxManager)?void 0:e.getBox(this.id)}async setupApp(t,n,i,r,s){var a;if(Qe("setupApp",t,i,r),!this.boxManager)throw new Pe;const o=new _e(this.manager,this.boxManager,t,this,s);this.appContext=o;try{le.once(`${t}${e.WindowCreated}`).then((async()=>{var e;let r;n||(r=this.getAppInitState(t),null==(e=this.boxManager)||e.updateBoxState(r)),this.appEmitter.onAny(this.appListener),this.appAttributesUpdateListener(t),this.setViewFocusScenePath(),setTimeout((async()=>{const e=await i.setup(o);this.appResult=e,me.notifyApp(this.kind,"created",{appId:t,result:e}),this.afterSetupApp(r),this.fixMobileSize()}),50)})),null==(a=this.boxManager)||a.createBox({appId:t,app:i,options:r,canOperate:this.manager.canOperate,smartPosition:this.isAddApp}),this.isAddApp&&this.box&&(this.store.updateAppState(t,J.ZIndex,this.box.zIndex),this.boxManager.focusBox({appId:t},!1))}catch(l){throw console.error(l),new Error(`[WindowManager]: app setup error: ${l.message}`)}}fixMobileSize(){var e,t;const n=null==(e=this.boxManager)?void 0:e.getBox(this.id);n&&(null==(t=this.boxManager)||t.resizeBox({appId:this.id,width:n.intrinsicWidth+.001,height:n.intrinsicHeight+.001,skipUpdate:!0}))}afterSetupApp(e){var t;e&&((null==e?void 0:e.x)&&e.y||null==(t=this.boxManager)||t.setBoxInitState(this.id))}async onSeek(e){var t;this.appEmitter.emit("seek",e).catch((e=>{console.log(`[WindowManager]: emit seek error: ${e.message}`)}));const n=this.getAppInitState(this.id);null==(t=this.boxManager)||t.updateBoxState(n)}async onReconnected(){var e;this.appEmitter.emit("reconnected",void 0);const t=this.getAppInitState(this.id);await this.destroy(!0,!1,!0);const n=this.params,i=new $e(n,this.manager,this.id,this.isAddApp);await i.baseInsertApp(!0),null==(e=this.boxManager)||e.updateBoxState(t)}emitAppSceneStateChange(e){this.appEmitter.emit("sceneStateChange",e)}emitAppIsWritableChange(){this.appEmitter.emit("writableChange",this.isWritable)}makeAppEventListener(e){return(t,n)=>{var i,r,s,a;if(this.manager.canOperate)switch(t){case"setBoxSize":null==(i=this.boxManager)||i.resizeBox({appId:e,width:n.width,height:n.height,skipUpdate:!1});break;case"setBoxMinSize":null==(r=this.boxManager)||r.setBoxMinSize({appId:e,minWidth:n.minwidth,minHeight:n.minheight});break;case"setBoxTitle":null==(s=this.boxManager)||s.setBoxTitle({appId:e,title:n.title});break;case q.destroy:if("destroyed"===this.status)return;this.destroy(!0,!1,!0,null==n?void 0:n.error),(null==n?void 0:n.error)&&console.error(null==n?void 0:n.error);break;case"focus":null==(a=this.boxManager)||a.focusBox({appId:this.id}),le.emit("focus",{appId:this.id})}}}setScenePath(){if(!this.manager.canOperate)return;const e=this.getFullScenePath();this.manager.room&&e&&this.view&&be(this.manager.room,e)}setViewFocusScenePath(){const e=this.getFullScenePath();return e&&this.view&&ve(this.view,e),e}async createView(){const e=await this.viewManager.createView(this.id);return this.setViewFocusScenePath(),e}async destroy(e,t,n,i){var r,s,a,o;if("destroyed"!==this.status){this.status="destroyed";try{await me.notifyApp(this.kind,"destroy",{appId:this.id}),await this.appEmitter.emit("destroy",{error:i})}catch(u){console.error("[WindowManager]: notifyApp error",u.message,u.stack)}var l,c;this.appEmitter.clearListeners(),le.emit(`destroy-${this.id}`,{error:i}),e&&(null==(r=this.boxManager)||r.closeBox(this.id,n)),t&&(this.store.cleanAppAttributes(this.id),this.scenePath&&(l=this.manager.room,c=this.scenePath,l&&l.scenePathType(c)!==k.None&&l.removeScenes(c))),this.appProxies.delete(this.id),this.viewManager.destroyView(this.id),this.manager.appStatus.delete(this.id),null==(s=this.manager.refresher)||s.remove(this.id),null==(a=this.manager.refresher)||a.remove(this.stateKey),null==(o=this.manager.refresher)||o.remove(`${this.id}-fullPath`)}}close(){return this.destroy(!0,!0,!1)}}class Fe{constructor(e){this.displayer=e,this.views=new Map}createView(e){const t=Ze(this.displayer);return this.views.set(e,t),t}getView(e){return this.views.get(e)}destroyView(e){const t=this.views.get(e);if(t){try{t.release()}catch{}this.views.delete(e)}}setViewScenePath(e,t){const n=this.views.get(e);n&&(n.focusScenePath=t)}destroy(){this.views.forEach((e=>{try{e.release()}catch{}})),this.views.clear()}}const Ze=e=>{const t=e.views.createView();return Ye(t),t},Ye=e=>{e.setCameraBound({maxContentMode:()=>10,minContentMode:()=>.1})};class Ge{constructor(e){this.manager=e,this.started=!1,this.mainViewIsAddListener=!1,this.store=this.manager.store,this.sideEffectManager=new Y,this.cameraReaction=()=>D((()=>this.mainViewCamera),(e=>{e&&e.id!==this.manager.uid&&(this.moveCameraToContian(this.mainViewSize),this.moveCamera(e))}),{fireImmediately:!0}),this.sizeChangeHandler=p((e=>{e&&(this.moveCameraToContian(e),this.moveCamera(this.mainViewCamera))}),30),this.onCameraUpdatedByDevice=e=>{this.store.setMainViewCamera(u(c({},e),{id:this.manager.uid})),f(this.mainViewSize,u(c({},this.mainView.size),{id:this.manager.uid}))||this.setMainViewSize(this.view.size)},this.mainViewClickListener=()=>{this.mainViewClickHandler()},this.setMainViewSize=p((e=>{this.store.setMainViewSize(u(c({},e),{id:this.manager.uid}))}),50),this.onCameraOrSizeUpdated=()=>{ae.emit("cameraStateChange",this.cameraState)},this.mainView=this.createMainView(),this.moveCameraSizeByAttributes(),le.once("mainViewMounted").then((()=>{setTimeout((()=>{this.start(),this.mainViewCamera&&this.mainViewSize||this.setCameraAndSize()}),200)}));const t=()=>{this.sizeChangeHandler(this.mainViewSize)};this.sideEffectManager.add((()=>(le.on("playgroundSizeChange",t),()=>le.off("playgroundSizeChange",t))))}get mainViewCamera(){return this.store.getMainViewCamera()}get mainViewSize(){return this.store.getMainViewSize()}moveCameraSizeByAttributes(){this.moveCameraToContian(this.mainViewSize),this.moveCamera(this.mainViewCamera)}start(){var e;this.started||(this.sizeChangeHandler(this.mainViewSize),this.addMainViewListener(),this.addCameraListener(),null==(e=this.manager.refresher)||e.add(Ue.MainViewCamera,this.cameraReaction),this.started=!0)}setCameraAndSize(){this.store.setMainViewCamera(u(c({},this.mainView.camera),{id:this.manager.uid})),this.store.setMainViewSize(u(c({},this.mainView.size),{id:this.manager.uid}))}get view(){return this.mainView}get cameraState(){return c(c({},this.view.camera),this.view.size)}createMainView(){const e=Ze(this.manager.displayer),t=this.store.getMainViewScenePath();return t&&ve(e,t),e}onReconnect(){const e=this.store.getMainViewScenePath();e&&ve(this.view,e)}rebind(){const e=this.mainView.divElement,t=this.mainView.disableCameraTransform;this.stop(),this.mainView.release(),this.mainView=this.createMainView(),this.mainView.disableCameraTransform=t,this.mainView.divElement=e,this.start()}addMainViewListener(){this.mainViewIsAddListener||this.view.divElement&&(this.view.divElement.addEventListener("click",this.mainViewClickListener),this.view.divElement.addEventListener("touchend",this.mainViewClickListener),this.mainViewIsAddListener=!0)}removeMainViewListener(){this.view.divElement&&(this.view.divElement.removeEventListener("click",this.mainViewClickListener),this.view.divElement.removeEventListener("touchend",this.mainViewClickListener)),this.mainViewIsAddListener=!1}async mainViewClickHandler(){var e;this.manager.canOperate&&(this.store.cleanFocus(),null==(e=this.manager.boxManager)||e.blurAllBox())}addCameraListener(){this.view.callbacks.on("onCameraUpdatedByDevice",this.onCameraUpdatedByDevice),this.view.callbacks.on("onCameraUpdated",this.onCameraOrSizeUpdated),this.view.callbacks.on("onSizeUpdated",this.onCameraOrSizeUpdated)}removeCameraListener(){this.view.callbacks.off("onCameraUpdatedByDevice",this.onCameraUpdatedByDevice),this.view.callbacks.off("onCameraUpdated",this.onCameraOrSizeUpdated),this.view.callbacks.off("onSizeUpdated",this.onCameraOrSizeUpdated)}moveCameraToContian(e){M(e)||(this.view.moveCameraToContain({width:e.width,height:e.height,originX:-e.width/2,originY:-e.height/2,animationMode:O.Immediately}),this.scale=this.view.camera.scale)}moveCamera(e){if(!M(e)){if(f(e,this.view.camera))return;const{centerX:t,centerY:n,scale:i}=e,r=i*(this.scale||1);this.view.moveCamera({centerX:t,centerY:n,scale:r,animationMode:O.Immediately})}}stop(){var e,t;this.removeMainViewListener(),this.removeCameraListener(),null==(e=this.manager.refresher)||e.remove(Ue.MainViewCamera),null==(t=this.manager.refresher)||t.remove(Ue.MainViewSize),this.started=!1}destroy(){this.stop(),this.sideEffectManager.flushAll()}}class Xe{constructor(e){this.context=e,this.addRedoUndoListeners=e=>{if(void 0===e)this.addViewCallbacks(this.context.mainView(),this.onCanRedoStepsUpdate,this.onCanUndoStepsUpdate);else{const t=this.context.getAppProxy(e);t&&t.view&&this.addViewCallbacks(t.view,this.onCanRedoStepsUpdate,this.onCanUndoStepsUpdate)}},this.addViewCallbacks=(e,t,n)=>{t(e.canRedoSteps),n(e.canUndoSteps),e.callbacks.on("onCanRedoStepsUpdate",t),e.callbacks.on("onCanUndoStepsUpdate",n)},this.disposeViewCallbacks=e=>{e.callbacks.off("onCanRedoStepsUpdate",this.onCanRedoStepsUpdate),e.callbacks.off("onCanUndoStepsUpdate",this.onCanUndoStepsUpdate)},this.onCanRedoStepsUpdate=e=>{ae.emit("canRedoStepsChange",e)},this.onCanUndoStepsUpdate=e=>{ae.emit("canUndoStepsChange",e)},this.disposePrevFocusViewRedoUndoListeners=e=>{let t;if(void 0===e)t=this.context.mainView();else{const n=this.context.getAppProxy(e);n&&n.view&&(t=n.view)}t&&this.disposeViewCallbacks(t)},le.on("focusedChange",(e=>{this.disposePrevFocusViewRedoUndoListeners(e.prev),setTimeout((()=>{this.addRedoUndoListeners(e.focused)}),0)})),le.on("rootDirRemoved",(()=>{this.disposePrevFocusViewRedoUndoListeners(e.focus()),this.addRedoUndoListeners(e.focus())})),this.addRedoUndoListeners(e.focus())}destroy(){this.disposePrevFocusViewRedoUndoListeners(this.context.focus())}}class Je{constructor(t){this.windowManger=t,this.appProxies=new Map,this.appStatus=new Map,this.store=He,this.isReplay=this.windowManger.isReplay,this.mainViewScenesLength=0,this.callbacksNode=null,this.appCreateQueue=new oe,this.sideEffectManager=new Y,this.sceneState=null,this.onRemoveScenes=t=>{var n;if("/"===t)return this.onRootDirRemoved(),void this.dispatchInternalEvent(e.RootDirRemoved);const i=this.store.getMainViewScenePath();if(this.room&&i&&i===t){const e=null==(n=this.callbacksNode)?void 0:n.scenes[this.store.getMainViewSceneIndex()];this.setMainViewScenePath(`/${e}`||"/init")}},this.onReadonlyChanged=()=>{this.appProxies.forEach((e=>{e.emitAppIsWritableChange()}))},this.onPlayerSeekStart=async()=>{await this.closeAll()},this.onPlayerSeekDone=async e=>{await this.attributesUpdateCallback(this.attributes.apps),this.appProxies.forEach((t=>{t.onSeek(e)}))},this.createRootDirScenesCallback=()=>{let e=!1;this.callbacksNode&&(this.callbacksNode.dispose(),e=!0),this.callbacksNode=this.displayer.createScenesCallback("/",{onAddScene:this.onSceneChange,onRemoveScene:this.onSceneChange}),this.callbacksNode&&(this.updateSceneState(this.callbacksNode),this.mainViewScenesLength=this.callbacksNode.scenes.length,e&&this.emitMainViewScenesChange(this.callbacksNode.scenes.length))},this.onSceneChange=e=>{this.mainViewScenesLength=e.scenes.length,this.updateSceneState(e),this.emitMainViewScenesChange(this.mainViewScenesLength)},this.emitMainViewScenesChange=e=>{ae.emit("mainViewScenesLengthChange",e),le.emit("changePageState")},this.updateSceneState=e=>{const t=this.store.getMainViewSceneIndex()||0,n=e.scenes[t];this.sceneState={scenePath:`/${n}`,contextPath:e.path,index:t,scenes:e.scenes.map((e=>({name:e}))),sceneName:n},ae.emit("sceneStateChange",this.sceneState)},this.onMainViewIndexChange=e=>{void 0!==e&&this._prevSceneIndex!==e&&(ae.emit("mainViewSceneIndexChange",e),le.emit("changePageState"),this.callbacksNode&&this.updateSceneState(this.callbacksNode),this._prevSceneIndex=e)},this.onFocusChange=e=>{var t;this._prevFocused!==e&&(ae.emit("focusedChange",e),le.emit("focusedChange",{focused:e,prev:this._prevFocused}),this._prevFocused=e,void 0!==e&&(null==(t=this.boxManager)||t.focusBox({appId:e}),setTimeout((()=>{const t=this.appProxies.get(e);t&&me.notifyApp(t.kind,"focus",{appId:e})}),0)))},this.onRegisteredChange=e=>{e&&Object.entries(e).forEach((([e,t])=>{me.appClasses.has(e)||me.register({kind:e,src:t.src,name:t.name})}))},this.onMinimized=e=>{var t,n;(null==(t=this.boxManager)?void 0:t.minimized)!==e&&(!0===e&&(null==(n=this.boxManager)||n.blurAllBox()),setTimeout((()=>{var t;null==(t=this.boxManager)||t.setMinimized(Boolean(e))}),0))},this.onAppDelete=async e=>{const t=Object.keys(e);for(const[n,i]of this.appProxies.entries())t.includes(n)||await i.destroy(!0,!1,!0)},this.closeAll=async()=>{for(const[e,t]of this.appProxies.entries())await t.destroy(!0,!1,!0)},this.displayerStateListener=e=>{const t=e.sceneState;if(t){const e=t.scenePath;this.appProxies.forEach((n=>{n.scenePath&&e.startsWith(n.scenePath)&&(n.emitAppSceneStateChange(t),n.setFullPath(e))}))}this.appProxies.forEach((t=>{t.appEmitter.emit("roomStateChange",e)})),le.emit("observerIdChange",this.displayer.observerId)},this.displayerWritableListener=e=>{var t,n;const i=!e,r=void 0===this.windowManger.readonly||!1===this.windowManger.readonly;void 0===this.windowManger.readonly?null==(t=this.boxManager)||t.setReadonly(e):null==(n=this.boxManager)||n.setReadonly(!(i&&r)),this.appProxies.forEach((e=>{e.emitAppIsWritableChange()})),!0===i?(this.mainView.disableCameraTransform=!1,this.room&&!0===this.room.disableSerialization&&(this.room.disableSerialization=!1)):this.mainView.disableCameraTransform=!0},this.updateSceneIndex=()=>{const e=this.store.getMainViewScenePath(),t=xe(e),n=ye(this.displayer)[t];if(n.length){const i=e.replace(t,"").replace("/",""),r=n.findIndex((e=>e.name===i));S(r)&&r>=0&&this.safeSetAttributes({_mainSceneIndex:r})}},this.boxEventListener=(t,n)=>{switch(t){case"move":this.dispatchInternalEvent(e.AppMove,n),this.store.updateAppState(n.appId,J.Position,{x:n.x,y:n.y});break;case"focus":this.windowManger.safeSetAttributes({focus:n.appId});break;case"resize":n.width&&n.height&&(this.dispatchInternalEvent(e.AppResize,n),this.store.updateAppState(n.appId,J.Size,{width:n.width,height:n.height}));break;case"close":{const e=this.appProxies.get(n.appId);e&&e.destroy(!1,!0,n.error);break}case"boxStateChange":this.dispatchInternalEvent(e.AppBoxStateChange,n)}},this.displayer=t.displayer,this.store.setContext({getAttributes:()=>this.attributes,safeSetAttributes:e=>this.safeSetAttributes(e),safeUpdateAttributes:(e,t)=>this.safeUpdateAttributes(e,t)}),this.mainViewProxy=new Ge(this),this.viewManager=new Fe(this.displayer),this.appListeners=new Se(this),this.displayer.callbacks.on(this.eventName,this.displayerStateListener),this.appListeners.addListeners(),this.refresher=Tb,this.refresher.setRoom(this.room),this.refresher.setContext({emitter:le}),this.sideEffectManager.add((()=>()=>{var e,t,n;this.appCreateQueue.destroy(),this.mainViewProxy.destroy(),null==(e=this.refresher)||e.destroy(),this.viewManager.destroy(),null==(t=this.boxManager)||t.destroy(),null==(n=this.callbacksNode)||n.dispose()})),le.once("onCreated").then((()=>this.onCreated())),le.on("onReconnected",(()=>this.onReconnected())),V(this.displayer)&&(le.on("seekStart",this.onPlayerSeekStart),le.on("seek",this.onPlayerSeekDone)),le.on("removeScenes",this.onRemoveScenes),le.on("setReadonly",this.onReadonlyChanged),this.createRootDirScenesCallback(),me.setSyncRegisterApp((e=>{this.safeUpdateAttributes([Ue.Registered,e.kind],e)}))}onRootDirRemoved(){this.setMainViewScenePath("/init"),this.createRootDirScenesCallback(),this.appProxies.forEach((e=>{e.view&&this.closeApp(e.id)})),this.mainViewProxy.rebind(),le.emit("rootDirRemoved")}get eventName(){return _(this.displayer)?"onRoomStateChanged":"onPlayerStateChanged"}get attributes(){return this.windowManger.attributes}get canOperate(){return this.windowManger.canOperate}get room(){return _(this.displayer)?this.displayer:void 0}get mainView(){return this.mainViewProxy.view}get focusApp(){if(this.store.focus)return this.appProxies.get(this.store.focus)}get uid(){var e;return(null==(e=this.room)?void 0:e.uid)||""}getMainViewSceneDir(){const e=this.store.getMainViewScenePath();if(e)return xe(e);throw new Error("[WindowManager]: mainViewSceneDir not found")}async onCreated(){var e,t,n,i,r,s,a,o;if(await this.attributesUpdateCallback(this.attributes.apps),le.emit("updateManagerRect"),le.onAny(this.boxEventListener),null==(e=this.refresher)||e.add("apps",(()=>De((()=>this.attributes.apps),(()=>{this.attributesUpdateCallback(this.attributes.apps)})))),null==(t=this.refresher)||t.add("appsClose",(()=>Le(this.attributes.apps,(()=>{this.onAppDelete(this.attributes.apps)})))),null==(n=this.refresher)||n.add("maximized",(()=>L((()=>{var e;const t=this.attributes.maximized;null==(e=this.boxManager)||e.setMaximized(Boolean(t))})))),null==(i=this.refresher)||i.add("minimized",(()=>L((()=>{const e=this.attributes.minimized;this.onMinimized(e)})))),null==(r=this.refresher)||r.add("mainViewIndex",(()=>L((()=>{const e=b(this.attributes,"_mainSceneIndex");this.onMainViewIndexChange(e)})))),null==(s=this.refresher)||s.add("focusedChange",(()=>L((()=>{const e=b(this.attributes,"focus");this.onFocusChange(e)})))),null==(a=this.refresher)||a.add("registeredChange",(()=>L((()=>{const e=b(this.attributes,Ue.Registered);this.onRegisteredChange(e)})))),!this.attributes.apps||0===Object.keys(this.attributes.apps).length){const e=this.store.getMainViewScenePath();if(!e)return;this.resetScenePath(e)}this.displayerWritableListener(!(null==(o=this.room)?void 0:o.isWritable)),this.displayer.callbacks.on("onEnableWriteNowChanged",this.displayerWritableListener),this._prevFocused=this.attributes.focus,this.sideEffectManager.add((()=>{const e=new Xe({mainView:()=>this.mainViewProxy.view,focus:()=>this.attributes.focus,getAppProxy:e=>this.appProxies.get(e)});return()=>e.destroy()}))}async attributesUpdateCallback(e){if(e&&Nb.container){const n=Object.keys(e);0===n.length&&this.appCreateQueue.emitReady();const i=n.map((t=>({id:t,createdAt:e[t].createdAt})));for(const{id:r}of I(i,"createdAt","asc"))if(!this.appProxies.has(r)&&!this.appStatus.has(r)){const n=e[r];this.appStatus.set(r,te.StartCreate);try{if(!this.attributes[r])throw new Error("appAttributes is undefined");this.appCreateQueue.push((()=>this.baseInsertApp({kind:n.kind,options:n.options,isDynamicPPT:n.isDynamicPPT},r,!1))),this.focusByAttributes(e)}catch(t){console.warn("[WindowManager]: Insert App Error",t)}}}}refresh(){this.attributesUpdateCallback(this.attributes.apps)}setBoxManager(e){this.boxManager=e}resetMaximized(){var e;null==(e=this.boxManager)||e.setMaximized(Boolean(this.store.getMaximized()))}resetMinimized(){var e;null==(e=this.boxManager)||e.setMinimized(Boolean(this.store.getMinimized()))}bindMainView(e,t){const n=this.mainViewProxy.view;n.disableCameraTransform=t,n.divElement=e,n.focusScenePath||this.setMainViewFocusPath(),le.emit("mainViewMounted")}setMainViewFocusPath(e){const t=e||this.store.getMainViewScenePath();if(t){const e=ve(this.mainView,t);return(null==e?void 0:e.focusScenePath)===t}}resetScenePath(e){this.displayer.state.sceneState.scenePath!==e&&be(this.room,e)}async addApp(e,t){Qe("addApp",e);const{appId:n,needFocus:i}=await this.beforeAddApp(e,t),r=await this.baseInsertApp(e,n,!0,i);return this.afterAddApp(r),null==r?void 0:r.id}async beforeAddApp(e,t){var n,i;const r=await(async e=>{var t,n;const i=await(null==(t=me.appClasses.get(e))?void 0:t());return i&&(null==(n=i.config)?void 0:n.singleton)?e:`${e}-${F().replace("-","").slice(0,8)}`})(e.kind);this.appStatus.set(r,te.StartCreate);const s=null!=(n=e.attributes)?n:{};this.safeUpdateAttributes([r],s),this.store.setupAppAttributes(e,r,t);const a=!(null==(i=this.boxManager)?void 0:i.minimized);return a&&this.store.setAppFocus(r,!0),{appId:r,needFocus:a}}afterAddApp(e){var t,n;if(e&&e.box){const t=e.box;le.emit("move",{appId:e.id,x:null==t?void 0:t.intrinsicX,y:null==t?void 0:t.intrinsicY}),this.store.updateAppState(e.id,J.ZIndex,t.zIndex)}(null==(t=this.boxManager)?void 0:t.minimized)&&(null==(n=this.boxManager)||n.setMinimized(!1,!1))}async closeApp(e){const t=this.appProxies.get(e);t&&t.destroy(!0,!0,!1)}async baseInsertApp(e,t,n,i){if(this.appProxies.has(t))return void console.warn("[WindowManager]: app duplicate exists and cannot be created again");const r=new $e(e,this,t,n);if(r)return await r.baseInsertApp(i),this.appStatus.delete(t),r;throw this.appStatus.delete(t),new Error("[WindowManger]: initialize AppProxy failed")}safeSetAttributes(e){this.windowManger.safeSetAttributes(e)}safeUpdateAttributes(e,t){this.windowManger.safeUpdateAttributes(e,t)}async setMainViewScenePath(e){if(this.room){const t=this.displayer.scenePathType(e);if("/"!==xe(e))throw new Error('[WindowManager]: main view scenePath must in root dir "/"');if(t===k.None)throw new Error(`[WindowManager]: ${e} not valid scene`);if(t===k.Page)await this._setMainViewScenePath(e);else if(t===k.Dir){const t=we(this.displayer,e);t&&await this._setMainViewScenePath(t)}}}async _setMainViewScenePath(e){this.setMainViewFocusPath(e)&&(this.safeSetAttributes({_mainScenePath:e}),this.store.setMainViewFocusPath(this.mainView),this.updateSceneIndex(),this.dispatchSetMainViewScenePath(e))}async setMainViewSceneIndex(e){if(this.room){if(this.store.getMainViewSceneIndex()===e)return;const t=this.store.getMainViewScenePath();if(t){const n=xe(t),i=we(this.displayer,n,e);if(!i)throw new Error(`[WindowManager]: ${n}: ${e} not valid index`);this.setMainViewFocusPath(i)&&(this.store.setMainViewScenePath(i),this.safeSetAttributes({_mainSceneIndex:e}),this.dispatchSetMainViewScenePath(i))}}}dispatchSetMainViewScenePath(t){this.dispatchInternalEvent(e.SetMainViewScenePath,{nextScenePath:t}),be(this.room,t)}getAppInitPath(e){var t;const n=this.store.getAppAttributes(e);if(n)return null==(t=null==n?void 0:n.options)?void 0:t.scenePath}safeDispatchMagixEvent(e,t){this.canOperate&&this.displayer.dispatchMagixEvent(e,t)}focusByAttributes(e){var t;if(e&&Object.keys(e).length===(null==(t=this.boxManager)?void 0:t.boxSize)){const e=this.store.focus;e&&this.boxManager.focusBox({appId:e})}}async onReconnected(){const e=Array.from(this.appProxies.values()).map((e=>e.onReconnected()));this.mainViewProxy.onReconnect(),await Promise.all(e)}notifyContainerRectUpdate(e){this.appProxies.forEach((t=>{t.appEmitter.emit("containerRectUpdate",e)}))}dispatchInternalEvent(e,t){this.safeDispatchMagixEvent("__WindowManger",{eventName:e,payload:t})}destroy(){this.displayer.callbacks.off(this.eventName,this.displayerStateListener),this.displayer.callbacks.off("onEnableWriteNowChanged",this.displayerWritableListener),this.appListeners.removeListeners(),le.offAny(this.boxEventListener),le.clearListeners(),this.appProxies.size&&this.appProxies.forEach((e=>{e.destroy(!0,!1,!0)})),ae.clearListeners(),this.sideEffectManager.flushAll(),this._prevFocused=void 0,this._prevSceneIndex=void 0}}const Ke=window.ResizeObserver||G;class qe{constructor(e){this.emitter=e}static create(e,t,n,i){const r=new qe(i);return r.observePlaygroundSize(e,t,n),r}observePlaygroundSize(e,t,n){this.updateSizer(e.getBoundingClientRect(),t,n),this.containerResizeObserver=new Ke((e=>{var i;const r=null==(i=e[0])?void 0:i.contentRect;r&&(this.updateSizer(r,t,n),this.emitter.emit("playgroundSizeChange",r))})),this.containerResizeObserver.observe(e)}updateSizer({width:e,height:t},n,i){e&&t&&(t/e>Nb.containerSizeRatio?(t=e*Nb.containerSizeRatio,n.classList.toggle("netless-window-manager-sizer-horizontal",!0)):(e=t/Nb.containerSizeRatio,n.classList.toggle("netless-window-manager-sizer-horizontal",!1)),i.style.width=`${e}px`,i.style.height=`${t}px`)}disconnect(){var e;null==(e=this.containerResizeObserver)||e.disconnect()}}var et={exports:{}},tt={},nt=Object.getOwnPropertySymbols,it=Object.prototype.hasOwnProperty,rt=Object.prototype.propertyIsEnumerable;function st(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var at=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach((function(e){i[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(r){return!1}}()?Object.assign:function(e,t){for(var n,i,r=st(e),s=1;s<arguments.length;s++){for(var a in n=Object(arguments[s]))it.call(n,a)&&(r[a]=n[a]);if(nt){i=nt(n);for(var o=0;o<i.length;o++)rt.call(n,i[o])&&(r[i[o]]=n[i[o]])}}return r},ot=at,lt="function"==typeof Symbol&&Symbol.for,ct=lt?Symbol.for("react.element"):60103,ut=lt?Symbol.for("react.portal"):60106,dt=lt?Symbol.for("react.fragment"):60107,ht=lt?Symbol.for("react.strict_mode"):60108,pt=lt?Symbol.for("react.profiler"):60114,ft=lt?Symbol.for("react.provider"):60109,gt=lt?Symbol.for("react.context"):60110,mt=lt?Symbol.for("react.forward_ref"):60112,vt=lt?Symbol.for("react.suspense"):60113,bt=lt?Symbol.for("react.memo"):60115,wt=lt?Symbol.for("react.lazy"):60116,yt="function"==typeof Symbol&&Symbol.iterator;
|
1
|
+
var e,t,n=Object.defineProperty,i=Object.defineProperties,r=Object.getOwnPropertyDescriptors,s=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,l=(e,t,i)=>t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,c=(e,t)=>{for(var n in t||(t={}))a.call(t,n)&&l(e,n,t[n]);if(s)for(var n of s(t))o.call(t,n)&&l(e,n,t[n]);return e},u=(e,t)=>i(e,r(t));import d from"p-retry";import h from"emittery";import{debounce as p,isEqual as f,omit as g,isObject as m,has as v,get as b,size as w,mapValues as y,noop as x,pick as C,isEmpty as M,isInteger as S,orderBy as I,throttle as E,isFunction as A,isNull as T}from"lodash";import{ScenePathType as k,UpdateEventKind as N,listenUpdated as P,unlistenUpdated as z,reaction as D,autorun as L,toJS as B,listenDisposed as j,unlistenDisposed as R,AnimationMode as O,isPlayer as V,isRoom as _,WhiteVersion as U,ApplianceNames as W,RoomPhase as H,InvisiblePlugin as Q,ViewMode as $}from"white-web-sdk";import{v4 as F}from"uuid";import{genUID as Z,SideEffectManager as Y}from"side-effect-manager";import{ResizeObserver as G}from"@juggle/resize-observer";import X from"video.js";(t=e||(e={})).AppMove="AppMove",t.AppFocus="AppFocus",t.AppResize="AppResize",t.AppBoxStateChange="AppBoxStateChange",t.GetAttributes="GetAttributes",t.UpdateWindowManagerWrapper="UpdateWindowManagerWrapper",t.InitReplay="InitReplay",t.WindowCreated="WindowCreated",t.SetMainViewScenePath="SetMainViewScenePath",t.SetMainViewSceneIndex="SetMainViewSceneIndex",t.SwitchViewsToFreedom="SwitchViewsToFreedom",t.MoveCamera="MoveCamera",t.MoveCameraToContain="MoveCameraToContain",t.CursorMove="CursorMove",t.RootDirRemoved="RootDirRemoved";var J,K,q,ee,te,ne,ie;(K=J||(J={})).Size="size",K.Position="position",K.SceneIndex="SceneIndex",K.ZIndex="zIndex",(ee=q||(q={})).setBoxSize="setBoxSize",ee.setBoxMinSize="setBoxMinSize",ee.destroy="destroy",(te||(te={})).StartCreate="StartCreate",(ie=ne||(ne={})).Leave="leave",ie.Normal="normal";const re=340/720,se=340/720,ae=new h;class oe{constructor(){this.list=[],this.isEmit=!1,this.invoked=()=>{this.currentInvoker=void 0,0===this.list.length&&(this.clear(),this.emitReady())},this.clear=()=>{clearInterval(this.timer),this.timer=void 0}}initInterval(){return setInterval((()=>{this.invoke()}),50)}push(e){this.list.push(e),this.invoke(),void 0===this.timer&&this.list.length>0&&(this.timer=this.initInterval())}invoke(){if(0===this.list.length)return;if(void 0!==this.currentInvoker)return;const e=this.list.shift();e&&(this.currentInvoker=e,e().then((()=>{this.invoked()})).catch((e=>{console.error(`[WindowManager]: create app error: ${e.message}`),this.invoked()})))}emitReady(){this.isEmit||setTimeout((()=>{ae.emit("ready")}),50),this.isEmit=!0}empty(){this.list=[],this.clear()}destroy(){this.timer&&this.clear()}}const le=new h;let ce,ue;const de=async()=>{ce=await new Promise(((e,t)=>{const n=indexedDB.open("__WindowManagerAppCache",2);n.onerror=e=>{t(e)},n.onupgradeneeded=e=>{const t=e.target.result;t.objectStoreNames.contains("apps")||(ue=t.createObjectStore("apps",{keyPath:"kind"}),ue.createIndex("kind","kind",{unique:!0}))},n.onsuccess=()=>{const t=n.result;e(t)}}))},he=(e,t)=>{var n,i;if(ce)return n=ce,i={kind:e,sourceCode:t},new Promise(((e,t)=>{const r=n.transaction(["apps"],"readwrite").objectStore("apps").add(i);r.onsuccess=()=>e(),r.onerror=()=>t()}))},pe=async e=>{return ce?await(t=ce,n=e,new Promise(((e,i)=>{const r=t.transaction(["apps"]).objectStore("apps").index("kind").get(n);r.onerror=e=>i(e),r.onsuccess=()=>{r.result?e(r.result):e(null)}}))):null;var t,n};const fe=async e=>{const t=await pe(e);if(t)return t.sourceCode;{const t=await async function(e,t){const{timeout:n=1e4}=t,i=new AbortController,r=setTimeout((()=>i.abort()),n),s=await fetch(e,u(c({},t),{signal:i.signal,headers:{"content-type":"text/plain"}}));return clearTimeout(r),s}(e,{timeout:1e4}),n=await t.text();return await he(e,n),n}},ge=(e,t)=>{let n=Function(e+`\n;return ${t}`)();return void 0===n&&(n=window[t]),n};const me=new class{constructor(){this.kindEmitters=new Map,this.registered=new Map,this.appClassesCache=new Map,this.appClasses=new Map,this.syncRegisterApp=null,this.onSyncRegisterAppChange=e=>{this.register({kind:e.kind,src:e.src})}}setSyncRegisterApp(e){this.syncRegisterApp=e}async register(e){this.appClassesCache.delete(e.kind),this.registered.set(e.kind,e);const t=e.src;let n;if("string"==typeof t?(n=async()=>{let n=await(async(e,t,n)=>{const i=n||"NetlessApp"+t;ae.emit("loadApp",{kind:t,status:"start"});try{const n=await fe(e);if(!n||0===n.length)return void ae.emit("loadApp",{kind:t,status:"failed",reason:"script is empty."});try{const e=ge(n,i);return ae.emit("loadApp",{kind:t,status:"success"}),e}catch(r){if(r.message.includes("Can only have one anonymous define call per script file")){const e=window.define;"function"==typeof e&&e.amd&&delete e.amd;const r=ge(n,i);return ae.emit("loadApp",{kind:t,status:"success"}),r}ae.emit("loadApp",{kind:t,status:"failed",reason:r.message})}}catch(r){ae.emit("loadApp",{kind:t,status:"failed",reason:r.message})}})(t,e.kind,e.name);if(n)return n.__esModule&&(n=n.default),n;throw new Error(`[WindowManager]: load remote script failed, ${t}`)},this.syncRegisterApp&&this.syncRegisterApp({kind:e.kind,src:t,name:e.name})):n="function"==typeof t?t:async()=>t,this.appClasses.set(e.kind,(async()=>{let t=this.appClassesCache.get(e.kind);return t||(t=n(),this.appClassesCache.set(e.kind,t)),t})),e.addHooks){const t=this.createKindEmitter(e.kind);t&&e.addHooks(t)}}unregister(e){this.appClasses.delete(e),this.appClassesCache.delete(e),this.registered.delete(e);const t=this.kindEmitters.get(e);t&&(t.clearListeners(),this.kindEmitters.delete(e))}async notifyApp(e,t,n){const i=this.kindEmitters.get(e);await(null==i?void 0:i.emit(t,n))}createKindEmitter(e){if(!this.kindEmitters.has(e)){const t=new h;this.kindEmitters.set(e,t)}return this.kindEmitters.get(e)}},ve=(e,t)=>{if(e.focusScenePath!==t)return e.focusScenePath=t,e},be=(e,t)=>{if(e&&e.isWritable&&e.state.sceneState.scenePath!==t){const n="/"===t?"":t;e.setScenePath(n)}};p(((e,t)=>{e.emit("mainViewModeChange",t)}),200);const we=(e,t,n=0)=>{const i=ye(e)[t];if(!i)return;const r=i[n];if(!r)return;const s=r.name;return"/"===t?`/${s}`:`${t}/${s}`},ye=e=>e.entireScenes(),xe=(e,t,n)=>null==e?void 0:e.putScenes(t,n),Ce=e=>{const t=e.split("/");t.pop();let n=t.join("/");return""===n&&(n="/"),n},Me=e=>{const t=e.split(".").map((e=>e.padStart(2,"0"))).join("");return parseInt(t)},Se=e=>new Promise((t=>setTimeout(t,e)));class Ie{constructor(t){this.manager=t,this.displayer=this.manager.displayer,this.mainMagixEventListener=t=>{if(t.authorId!==this.displayer.observerId){const n=t.payload;switch(n.eventName){case e.AppMove:this.appMoveHandler(n.payload);break;case e.AppResize:this.appResizeHandler(n.payload);break;case e.AppBoxStateChange:this.boxStateChangeHandler(n.payload);break;case e.SetMainViewScenePath:this.setMainViewScenePathHandler(n.payload);break;case e.MoveCamera:this.moveCameraHandler(n.payload);break;case e.MoveCameraToContain:this.moveCameraToContainHandler(n.payload);break;case e.CursorMove:this.cursorMoveHandler(n.payload);break;case e.RootDirRemoved:this.rootDirRemovedHandler()}}},this.appMoveHandler=e=>{var t;null==(t=this.boxManager)||t.moveBox(e)},this.appResizeHandler=e=>{var t,n;null==(t=this.boxManager)||t.resizeBox(Object.assign(e,{skipUpdate:!0})),null==(n=this.manager.room)||n.refreshViewSize()},this.boxStateChangeHandler=e=>{ae.emit("boxStateChange",e)},this.setMainViewScenePathHandler=({nextScenePath:e})=>{ve(this.manager.mainView,e),ae.emit("mainViewScenePathChange",e)},this.moveCameraHandler=e=>{f(g(e,["animationMode"]),c({},this.manager.mainView.camera))||this.manager.mainView.moveCamera(e)},this.moveCameraToContainHandler=e=>{this.manager.mainView.moveCameraToContain(e)},this.cursorMoveHandler=e=>{le.emit("cursorMove",e)},this.rootDirRemovedHandler=()=>{this.manager.createRootDirScenesCallback(),this.manager.mainViewProxy.rebind(),le.emit("rootDirRemoved")}}get boxManager(){return this.manager.boxManager}addListeners(){this.displayer.addMagixEventListener("__WindowManger",this.mainMagixEventListener)}removeListeners(){this.displayer.removeMagixEventListener("__WindowManger",this.mainMagixEventListener)}}class Ee extends Error{constructor(){super(...arguments),this.message="[WindowManager]: app duplicate exists and cannot be created again"}}class Ae extends Error{constructor(){super(...arguments),this.message="[WindowManager]: AppManager must be initialized"}}class Te extends Error{constructor(e){super(`[WindowManager]: white-web-sdk version must large than ${e}`)}}class ke extends Error{constructor(){super(...arguments),this.message="[WindowManager]: kind must be a valid string"}}class Ne extends Error{constructor(){super(...arguments),this.message="[WindowManager]: box need created"}}class Pe extends Error{constructor(){super(...arguments),this.message='[WindowManager]: ScenePath should start with "/"'}}class ze extends Error{constructor(){super(...arguments),this.message="[WindowManager]: boxManager not found"}}const De=e=>(t,n)=>{if(void 0!==t){if(P){const i=t=>{t.map((e=>e.kind)).includes(e)&&n()};return P(t,i),n(),()=>z(t,i)}return D((()=>t),(()=>{n()}),{fireImmediately:!0})}},Le=(e,t,n)=>{let i=null;const r=D(e,(()=>{i&&(i(),i=null);const r=e();m(r)?(i=()=>z(r,t),P(r,t)):null==n||n(r)}),{fireImmediately:!0});return()=>{null==i||i(),r()}},Be=De(N.Removed);De(N.Inserted);const je=Object.keys;function Re(e){return Boolean(v(e,"__isRef"))}class Oe{constructor(){this.listeners=new Set}get length(){return this.listeners.size}dispatch(e){this.listeners.forEach((t=>t(e)))}addListener(e){this.listeners.add(e)}removeListener(e){this.listeners.delete(e)}}const Ve="_WM-STORAGE_";class _e{constructor(e,t,n){if(this._sideEffect=new Y,this._destroyed=!1,this._refMap=new WeakMap,this._lastValue=new Map,this.onStateChanged=new Oe,n&&!m(n))throw new Error(`Default state for Storage ${t} is not an object.`);this._context=e,this.id=t||null,this._state={};const i=this._getRawState(this._state);null!==this.id&&this._context.getIsWritable()&&(i!==this._state&&m(i)||(b(this._context.getAttributes(),[Ve])||this._context.updateAttributes([Ve],{}),this._context.updateAttributes([Ve,this.id],this._state)),n&&this.setState(n)),je(i).forEach((e=>{if(null!==this.id||e!==Ve)try{const t=m(i[e])?JSON.parse(JSON.stringify(i[e])):i[e];Re(t)?(this._state[e]=t.v,m(t.v)&&this._refMap.set(t.v,t)):this._state[e]=t}catch(zb){console.error(zb)}})),this._sideEffect.addDisposer(Le((()=>null===this.id?e.getAttributes():b(e.getAttributes(),[Ve,this.id])),this._updateProperties.bind(this),this.destroy.bind(this)))}get state(){return this._destroyed&&console.warn(`Accessing state on destroyed Storage "${this.id}"`),this._state}addStateChangedListener(e){return this.onStateChanged.addListener(e),()=>this.onStateChanged.removeListener(e)}ensureState(e){return this.setState(je(e).reduce(((t,n)=>(v(this._state,n)||(t[n]=e[n]),t)),{}))}setState(e){if(this._destroyed)return void console.error(new Error(`Cannot call setState on destroyed Storage "${this.id}".`));if(!this._context.getIsWritable())return void console.error(new Error(`Cannot setState on Storage "${this.id}" without writable access`),e);const t=je(e);t.length>0&&t.forEach((t=>{const n=e[t];var i;if(n!==this._state[t])if(void 0===n)this._lastValue.set(t,this._state[t]),delete this._state[t],this._setRawState(t,n);else{this._lastValue.set(t,this._state[t]),this._state[t]=n;let e=n;if(m(n)){let t=this._refMap.get(n);t||(i=n,t={k:Z(),v:i,__isRef:!0},this._refMap.set(n,t)),e=t}this._setRawState(t,e)}}))}emptyStorage(){w(this._state)<=0||(this._destroyed?console.error(new Error(`Cannot empty destroyed Storage "${this.id}".`)):this._context.getIsWritable()?this.setState(y(this._state,x)):console.error(new Error(`Cannot empty Storage "${this.id}" without writable access.`)))}deleteStorage(){if(null===this.id)throw new Error("Cannot delete main Storage");this._context.getIsWritable()?(this.destroy(),this._context.updateAttributes([Ve,this.id],void 0)):console.error(new Error(`Cannot delete Storage "${this.id}" without writable access.`))}get destroyed(){return this._destroyed}destroy(){this._destroyed=!0,this._sideEffect.flushAll()}_getRawState(e){var t;return null===this.id?null!=(t=this._context.getAttributes())?t:e:b(this._context.getAttributes(),[Ve,this.id],e)}_setRawState(e,t){if(null===this.id){if(e===Ve)throw new Error('Cannot set attribute internal filed "_WM-STORAGE_"');return this._context.updateAttributes([e],t)}return this._context.updateAttributes([Ve,this.id,e],t)}_updateProperties(e){var t;if(this._destroyed)console.error(new Error(`Cannot call _updateProperties on destroyed Storage "${this.id}".`));else if(e.length>0){const n={};for(let i=0;i<e.length;i++)try{const r=e[i],s=r.key;if(null===this.id&&s===Ve)continue;const a=m(r.value)?JSON.parse(JSON.stringify(r.value)):r.value;let o;switch(this._lastValue.has(s)&&(o=this._lastValue.get(s),this._lastValue.delete(s)),r.kind){case 2:v(this._state,s)&&(o=this._state[s],delete this._state[s]),n[s]={oldValue:o};break;default:{let e=a;if(Re(a)){const{k:n,v:i}=a,r=this._state[s];m(r)&&(null==(t=this._refMap.get(r))?void 0:t.k)===n?e=r:(e=i,m(i)&&this._refMap.set(i,a))}e!==this._state[s]&&(o=this._state[s],this._state[s]=e),n[s]={newValue:e,oldValue:o};break}}}catch(zb){console.error(zb)}this.onStateChanged.dispatch(n)}}}class Ue{constructor(e,t,n,i,r){this.manager=e,this.boxManager=t,this.appId=n,this.appProxy=i,this.appOptions=r,this.mobxUtils={autorun:L,reaction:D,toJS:B},this.objectUtils={listenUpdated:P,unlistenUpdated:z,listenDisposed:j,unlistenDisposed:R},this.store=this.manager.store,this.isReplay=this.manager.isReplay,this.getDisplayer=()=>this.manager.displayer,this.getAttributes=()=>this.appProxy.attributes,this.getScenes=()=>{const e=this.store.getAppAttributes(this.appId);return(null==e?void 0:e.isDynamicPPT)?this.appProxy.scenes:null==e?void 0:e.options.scenes},this.getView=()=>this.appProxy.view,this.getInitScenePath=()=>this.manager.getAppInitPath(this.appId),this.getIsWritable=()=>this.manager.canOperate,this.getBox=()=>{const e=this.boxManager.getBox(this.appId);if(e)return e;throw new Ne},this.getRoom=()=>this.manager.room,this.setAttributes=e=>{this.manager.safeSetAttributes({[this.appId]:e})},this.updateAttributes=(e,t)=>{this.manager.attributes[this.appId]&&this.manager.safeUpdateAttributes([this.appId,...e],t)},this.setScenePath=async e=>{var t;this.appProxy.box&&(this.appProxy.setFullPath(e),null==(t=this.getRoom())||t.setScenePath(e))},this.mountView=e=>{const t=this.getView();t&&(t.divElement=e,setTimeout((()=>{var e;null==(e=this.getRoom())||e.refreshViewSize()}),1e3))},this.getAppOptions=()=>"function"==typeof this.appOptions?this.appOptions():this.appOptions,this.createStorage=(e,t)=>{const n=new _e(this,e,t);return this.emitter.on("destroy",(()=>{n.destroy()})),n},this.dispatchMagixEvent=(...e)=>{var t;const n=`${this.appId}:${e[0]}`;return null==(t=this.manager.room)?void 0:t.dispatchMagixEvent(n,e[1])},this.addMagixEventListener=(e,t,n)=>{const i=`${this.appId}:${e}`;return this.manager.displayer.addMagixEventListener(i,t,n),()=>this.manager.displayer.removeMagixEventListener(i,t)},this.removeMagixEventListener=this.manager.displayer.removeMagixEventListener.bind(this.manager.displayer),this.emitter=i.appEmitter,this.isAddApp=i.isAddApp}get storage(){return this._storage||(this._storage=new _e(this)),this._storage}}var We,He;(He=We||(We={})).Apps="apps",He.Focus="focus",He.State="state",He.BoxState="boxState",He.MainViewCamera="mainViewCamera",He.MainViewSize="mainViewSize",He.Broadcaster="broadcaster",He.Cursors="cursors",He.Position="position",He.CursorState="cursorState",He.FullPath="fullPath",He.Registered="registered";const Qe=new class{constructor(e){this.context=e,this.setAppFocus=(e,t)=>{t?this.context.safeSetAttributes({[We.Focus]:e}):this.context.safeSetAttributes({[We.Focus]:void 0})}}setContext(e){this.context=e}get attributes(){return this.context.getAttributes()}apps(){return b(this.attributes,[We.Apps])}get focus(){return b(this.attributes,[We.Focus])}getAppAttributes(e){return b(this.apps(),[e])}getAppState(e){return b(this.apps(),[e,We.State])}getMaximized(){return b(this.attributes,["maximized"])}getMinimized(){return b(this.attributes,["minimized"])}setupAppAttributes(e,t,n){this.attributes.apps||this.context.safeSetAttributes({apps:{}});const i=["scenePath","title"];n||i.push("scenes");const r=C(e.options,i),s={kind:e.kind,options:r,isDynamicPPT:n};"string"==typeof e.src&&(s.src=e.src),s.createdAt=Date.now(),this.context.safeUpdateAttributes([We.Apps,t],s),this.context.safeUpdateAttributes([We.Apps,t,We.State],{[J.Size]:{},[J.Position]:{},[J.SceneIndex]:0})}updateAppState(e,t,n){b(this.attributes,[We.Apps,e,We.State])&&this.context.safeUpdateAttributes([We.Apps,e,We.State,t],n)}cleanAppAttributes(e){this.context.safeUpdateAttributes([We.Apps,e],void 0),this.context.safeSetAttributes({[e]:void 0});this.attributes[We.Focus]===e&&this.cleanFocus()}cleanFocus(){this.context.safeSetAttributes({[We.Focus]:void 0})}getAppSceneIndex(e){var t;return null==(t=this.getAppState(e))?void 0:t[J.SceneIndex]}getAppScenePath(e){var t,n;return null==(n=null==(t=this.getAppAttributes(e))?void 0:t.options)?void 0:n.scenePath}getMainViewScenePath(){return this.attributes._mainScenePath}getMainViewSceneIndex(){return this.attributes._mainSceneIndex}getBoxState(){return this.attributes[We.BoxState]}setMainViewScenePath(e){this.context.safeSetAttributes({_mainScenePath:e})}setMainViewSceneIndex(e){this.context.safeSetAttributes({_mainSceneIndex:e})}getMainViewCamera(){return b(this.attributes,[We.MainViewCamera])}getMainViewSize(){return b(this.attributes,[We.MainViewSize])}setMainViewCamera(e){this.context.safeSetAttributes({[We.MainViewCamera]:c({},e)})}setMainViewSize(e){this.context.safeSetAttributes({[We.MainViewSize]:c({},e)})}updateCursor(e,t){b(this.attributes,[We.Cursors])||this.context.safeUpdateAttributes([We.Cursors],{}),b(this.attributes,[We.Cursors,e])||this.context.safeUpdateAttributes([We.Cursors,e],{}),this.context.safeUpdateAttributes([We.Cursors,e,We.Position],t)}updateCursorState(e,t){b(this.attributes,[We.Cursors,e])||this.context.safeUpdateAttributes([We.Cursors,e],{}),this.context.safeUpdateAttributes([We.Cursors,e,We.CursorState],t)}getCursorState(e){return b(this.attributes,[We.Cursors,e,We.CursorState])}cleanCursor(e){this.context.safeUpdateAttributes([We.Cursors,e],void 0)}setMainViewFocusPath(e){const t=this.getMainViewScenePath();t&&ve(e,t)}}({getAttributes:()=>{throw new Error("getAttributes not implemented")},safeSetAttributes:()=>{throw new Error("safeSetAttributes not implemented")},safeUpdateAttributes:()=>{throw new Error("safeUpdateAttributes not implemented")}}),$e=(...e)=>{Pb.debug&&console.log("[WindowManager]:",...e)};class Fe{constructor(e,t,n,i){var r;this.params=e,this.manager=t,this.boxManager=this.manager.boxManager,this.appProxies=this.manager.appProxies,this.viewManager=this.manager.viewManager,this.store=this.manager.store,this.status="normal",this.getAppInitState=e=>{var t,n;const i=this.store.getAppState(e);if(!i)return;const r=null==i?void 0:i[J.Position],s=this.store.focus,a=null==i?void 0:i[J.Size],o=null==i?void 0:i[J.SceneIndex];let l={maximized:null==(t=this.attributes)?void 0:t.maximized,minimized:null==(n=this.attributes)?void 0:n.minimized,zIndex:null==i?void 0:i.zIndex};return r&&(l=u(c({},l),{id:e,x:r.x,y:r.y})),s===e&&(l=u(c({},l),{focus:!0})),a&&(l=u(c({},l),{width:a.width,height:a.height})),o&&(l=u(c({},l),{sceneIndex:o})),l},this.appAttributesUpdateListener=e=>{var t,n,i;null==(t=this.manager.refresher)||t.add(e,(()=>L((()=>{const t=this.manager.attributes[e];t&&this.appEmitter.emit("attributesUpdate",t)})))),null==(n=this.manager.refresher)||n.add(this.stateKey,(()=>L((()=>{var t,n,i;const r=null==(t=this.appAttributes)?void 0:t.state;(null==r?void 0:r.zIndex)>0&&r.zIndex!==(null==(n=this.box)?void 0:n.zIndex)&&(null==(i=this.boxManager)||i.setZIndex(e,r.zIndex))})))),null==(i=this.manager.refresher)||i.add(`${e}-fullPath`,(()=>L((()=>{var e;const t=null==(e=this.appAttributes)?void 0:e.fullPath;this.setFocusScenePathHandler(t)}))))},this.setFocusScenePathHandler=p((e=>{var t;this.view&&e&&e!==(null==(t=this.view)?void 0:t.focusScenePath)&&ve(this.view,e)}),50),this.kind=e.kind,this.id=n,this.stateKey=`${this.id}_state`,this.appProxies.set(this.id,this),this.appEmitter=new h,this.appListener=this.makeAppEventListener(this.id),this.isAddApp=i,this.initScenes(),(null==(r=this.params.options)?void 0:r.scenePath)&&this.createView()}initScenes(){var e;const t=this.params.options;t&&(this.scenePath=t.scenePath,(null==(e=this.appAttributes)?void 0:e.isDynamicPPT)&&this.scenePath?this.scenes=ye(this.manager.displayer)[this.scenePath]:this.scenes=t.scenes)}get view(){return this.manager.viewManager.getView(this.id)}get isWritable(){var e;return this.manager.canOperate&&!(null==(e=this.box)?void 0:e.readonly)}get attributes(){return this.manager.attributes[this.id]}get appAttributes(){return this.store.getAppAttributes(this.id)}getFullScenePath(){if(this.scenePath)return b(this.appAttributes,[We.FullPath])||this.getFullScenePathFromScenes()}getFullScenePathFromScenes(){const e=b(this.appAttributes,["state","SceneIndex"],0),t=((e,t,n)=>{var i;if(e&&t){const r=null==(i=ye(e)[t])?void 0:i[n];if(r)return`${t}/${r.name}`}})(this.manager.room,this.scenePath,e);return t&&this.setFullPath(t),t}setFullPath(e){this.manager.safeUpdateAttributes(["apps",this.id,We.FullPath],e)}async baseInsertApp(e=!1){var t;const n=this.params;if(!n.kind)throw new Error("[WindowManager]: kind require");const i=await(null==(t=me.appClasses.get(n.kind))?void 0:t()),r=me.registered.get(n.kind);if(!i)throw new Error(`[WindowManager]: app load failed ${n.kind} ${n.src}`);return await this.setupApp(this.id,e,i,n.options,null==r?void 0:r.appOptions),le.emit("updateManagerRect"),{appId:this.id,app:i}}get box(){var e;return null==(e=this.boxManager)?void 0:e.getBox(this.id)}async setupApp(t,n,i,r,s){var a;if($e("setupApp",t,i,r),!this.boxManager)throw new ze;const o=new Ue(this.manager,this.boxManager,t,this,s);this.appContext=o;try{le.once(`${t}${e.WindowCreated}`).then((async()=>{var e;let r;n||(r=this.getAppInitState(t),null==(e=this.boxManager)||e.updateBoxState(r)),this.appEmitter.onAny(this.appListener),this.appAttributesUpdateListener(t),this.setViewFocusScenePath(),setTimeout((async()=>{const e=await i.setup(o);this.appResult=e,me.notifyApp(this.kind,"created",{appId:t,result:e}),this.afterSetupApp(r),this.fixMobileSize()}),50)})),null==(a=this.boxManager)||a.createBox({appId:t,app:i,options:r,canOperate:this.manager.canOperate,smartPosition:this.isAddApp}),this.isAddApp&&this.box&&(this.store.updateAppState(t,J.ZIndex,this.box.zIndex),this.boxManager.focusBox({appId:t},!1))}catch(l){throw console.error(l),new Error(`[WindowManager]: app setup error: ${l.message}`)}}fixMobileSize(){var e,t;const n=null==(e=this.boxManager)?void 0:e.getBox(this.id);n&&(null==(t=this.boxManager)||t.resizeBox({appId:this.id,width:n.intrinsicWidth+.001,height:n.intrinsicHeight+.001,skipUpdate:!0}))}afterSetupApp(e){var t;e&&((null==e?void 0:e.x)&&e.y||null==(t=this.boxManager)||t.setBoxInitState(this.id))}async onSeek(e){var t;this.appEmitter.emit("seek",e).catch((e=>{console.log(`[WindowManager]: emit seek error: ${e.message}`)}));const n=this.getAppInitState(this.id);null==(t=this.boxManager)||t.updateBoxState(n)}async onReconnected(){var e;this.appEmitter.emit("reconnected",void 0);const t=this.getAppInitState(this.id);await this.destroy(!0,!1,!0);const n=this.params,i=new Fe(n,this.manager,this.id,this.isAddApp);await i.baseInsertApp(!0),null==(e=this.boxManager)||e.updateBoxState(t)}emitAppSceneStateChange(e){this.appEmitter.emit("sceneStateChange",e)}emitAppIsWritableChange(){this.appEmitter.emit("writableChange",this.isWritable)}makeAppEventListener(e){return(t,n)=>{var i,r,s,a;if(this.manager.canOperate)switch(t){case"setBoxSize":null==(i=this.boxManager)||i.resizeBox({appId:e,width:n.width,height:n.height,skipUpdate:!1});break;case"setBoxMinSize":null==(r=this.boxManager)||r.setBoxMinSize({appId:e,minWidth:n.minwidth,minHeight:n.minheight});break;case"setBoxTitle":null==(s=this.boxManager)||s.setBoxTitle({appId:e,title:n.title});break;case q.destroy:if("destroyed"===this.status)return;this.destroy(!0,!1,!0,null==n?void 0:n.error),(null==n?void 0:n.error)&&console.error(null==n?void 0:n.error);break;case"focus":null==(a=this.boxManager)||a.focusBox({appId:this.id}),le.emit("focus",{appId:this.id})}}}setScenePath(){if(!this.manager.canOperate)return;const e=this.getFullScenePath();this.manager.room&&e&&this.view&&be(this.manager.room,e)}setViewFocusScenePath(){const e=this.getFullScenePath();return console.log("setViewFocusScenePath",this.kind,this.id,e),e&&this.view&&ve(this.view,e),e}async createView(){const e=await this.viewManager.createView(this.id);return this.setViewFocusScenePath(),e}async destroy(e,t,n,i){var r,s,a,o;if("destroyed"!==this.status){this.status="destroyed";try{await me.notifyApp(this.kind,"destroy",{appId:this.id}),await this.appEmitter.emit("destroy",{error:i})}catch(u){console.error("[WindowManager]: notifyApp error",u.message,u.stack)}var l,c;this.appEmitter.clearListeners(),le.emit(`destroy-${this.id}`,{error:i}),e&&(null==(r=this.boxManager)||r.closeBox(this.id,n)),t&&(this.store.cleanAppAttributes(this.id),this.scenePath&&(console.log("put closeApp",this.scenePath),l=this.manager.room,c=this.scenePath,l&&l.scenePathType(c)!==k.None&&l.removeScenes(c))),this.appProxies.delete(this.id),this.viewManager.destroyView(this.id),this.manager.appStatus.delete(this.id),null==(s=this.manager.refresher)||s.remove(this.id),null==(a=this.manager.refresher)||a.remove(this.stateKey),null==(o=this.manager.refresher)||o.remove(`${this.id}-fullPath`)}}close(){return this.destroy(!0,!0,!1)}}class Ze{constructor(e){this.displayer=e,this.views=new Map}createView(e){const t=Ye(this.displayer);return this.views.set(e,t),t}getView(e){return this.views.get(e)}destroyView(e){const t=this.views.get(e);if(t){try{t.release()}catch{}this.views.delete(e)}}setViewScenePath(e,t){const n=this.views.get(e);n&&(n.focusScenePath=t)}destroy(){this.views.forEach((e=>{try{e.release()}catch{}})),this.views.clear()}}const Ye=e=>{const t=e.views.createView();return Ge(t),t},Ge=e=>{e.setCameraBound({maxContentMode:()=>10,minContentMode:()=>.1})};class Xe{constructor(e){this.manager=e,this.started=!1,this.mainViewIsAddListener=!1,this.store=this.manager.store,this.sideEffectManager=new Y,this.cameraReaction=()=>D((()=>this.mainViewCamera),(e=>{e&&e.id!==this.manager.uid&&(this.moveCameraToContian(this.mainViewSize),this.moveCamera(e))}),{fireImmediately:!0}),this.sizeChangeHandler=p((e=>{e&&(this.moveCameraToContian(e),this.moveCamera(this.mainViewCamera))}),30),this.onCameraUpdatedByDevice=e=>{this.store.setMainViewCamera(u(c({},e),{id:this.manager.uid})),f(this.mainViewSize,u(c({},this.mainView.size),{id:this.manager.uid}))||this.setMainViewSize(this.view.size)},this.mainViewClickListener=()=>{this.mainViewClickHandler()},this.setMainViewSize=p((e=>{this.store.setMainViewSize(u(c({},e),{id:this.manager.uid}))}),50),this.onCameraOrSizeUpdated=()=>{ae.emit("cameraStateChange",this.cameraState)},this.mainView=this.createMainView(),this.moveCameraSizeByAttributes(),le.once("mainViewMounted").then((()=>{setTimeout((()=>{this.start(),this.mainViewCamera&&this.mainViewSize||this.setCameraAndSize()}),200)}));const t=()=>{this.sizeChangeHandler(this.mainViewSize)};this.sideEffectManager.add((()=>(le.on("playgroundSizeChange",t),()=>le.off("playgroundSizeChange",t))))}get mainViewCamera(){return this.store.getMainViewCamera()}get mainViewSize(){return this.store.getMainViewSize()}moveCameraSizeByAttributes(){this.moveCameraToContian(this.mainViewSize),this.moveCamera(this.mainViewCamera)}start(){var e;this.started||(this.sizeChangeHandler(this.mainViewSize),this.addMainViewListener(),this.addCameraListener(),null==(e=this.manager.refresher)||e.add(We.MainViewCamera,this.cameraReaction),this.started=!0)}setCameraAndSize(){this.store.setMainViewCamera(u(c({},this.mainView.camera),{id:this.manager.uid})),this.store.setMainViewSize(u(c({},this.mainView.size),{id:this.manager.uid}))}get view(){return this.mainView}get cameraState(){return c(c({},this.view.camera),this.view.size)}createMainView(){const e=Ye(this.manager.displayer),t=this.store.getMainViewScenePath();return t&&ve(e,t),e}onReconnect(){const e=this.store.getMainViewScenePath();e&&ve(this.view,e)}rebind(){const e=this.mainView.divElement,t=this.mainView.disableCameraTransform;this.stop(),this.mainView.release(),this.mainView=this.createMainView(),this.mainView.disableCameraTransform=t,this.mainView.divElement=e,this.start()}addMainViewListener(){this.mainViewIsAddListener||this.view.divElement&&(this.view.divElement.addEventListener("click",this.mainViewClickListener),this.view.divElement.addEventListener("touchend",this.mainViewClickListener),this.mainViewIsAddListener=!0)}removeMainViewListener(){this.view.divElement&&(this.view.divElement.removeEventListener("click",this.mainViewClickListener),this.view.divElement.removeEventListener("touchend",this.mainViewClickListener)),this.mainViewIsAddListener=!1}async mainViewClickHandler(){var e;this.manager.canOperate&&(this.store.cleanFocus(),null==(e=this.manager.boxManager)||e.blurAllBox())}addCameraListener(){this.view.callbacks.on("onCameraUpdatedByDevice",this.onCameraUpdatedByDevice),this.view.callbacks.on("onCameraUpdated",this.onCameraOrSizeUpdated),this.view.callbacks.on("onSizeUpdated",this.onCameraOrSizeUpdated)}removeCameraListener(){this.view.callbacks.off("onCameraUpdatedByDevice",this.onCameraUpdatedByDevice),this.view.callbacks.off("onCameraUpdated",this.onCameraOrSizeUpdated),this.view.callbacks.off("onSizeUpdated",this.onCameraOrSizeUpdated)}moveCameraToContian(e){M(e)||(this.view.moveCameraToContain({width:e.width,height:e.height,originX:-e.width/2,originY:-e.height/2,animationMode:O.Immediately}),this.scale=this.view.camera.scale)}moveCamera(e){if(!M(e)){if(f(e,this.view.camera))return;const{centerX:t,centerY:n,scale:i}=e,r=i*(this.scale||1);this.view.moveCamera({centerX:t,centerY:n,scale:r,animationMode:O.Immediately})}}stop(){var e,t;this.removeMainViewListener(),this.removeCameraListener(),null==(e=this.manager.refresher)||e.remove(We.MainViewCamera),null==(t=this.manager.refresher)||t.remove(We.MainViewSize),this.started=!1}destroy(){this.stop(),this.sideEffectManager.flushAll()}}class Je{constructor(e){this.context=e,this.addRedoUndoListeners=e=>{if(void 0===e)this.addViewCallbacks(this.context.mainView(),this.onCanRedoStepsUpdate,this.onCanUndoStepsUpdate);else{const t=this.context.getAppProxy(e);t&&t.view&&this.addViewCallbacks(t.view,this.onCanRedoStepsUpdate,this.onCanUndoStepsUpdate)}},this.addViewCallbacks=(e,t,n)=>{t(e.canRedoSteps),n(e.canUndoSteps),e.callbacks.on("onCanRedoStepsUpdate",t),e.callbacks.on("onCanUndoStepsUpdate",n)},this.disposeViewCallbacks=e=>{e.callbacks.off("onCanRedoStepsUpdate",this.onCanRedoStepsUpdate),e.callbacks.off("onCanUndoStepsUpdate",this.onCanUndoStepsUpdate)},this.onCanRedoStepsUpdate=e=>{ae.emit("canRedoStepsChange",e)},this.onCanUndoStepsUpdate=e=>{ae.emit("canUndoStepsChange",e)},this.disposePrevFocusViewRedoUndoListeners=e=>{let t;if(void 0===e)t=this.context.mainView();else{const n=this.context.getAppProxy(e);n&&n.view&&(t=n.view)}t&&this.disposeViewCallbacks(t)},le.on("focusedChange",(e=>{this.disposePrevFocusViewRedoUndoListeners(e.prev),setTimeout((()=>{this.addRedoUndoListeners(e.focused)}),0)})),le.on("rootDirRemoved",(()=>{this.disposePrevFocusViewRedoUndoListeners(e.focus()),this.addRedoUndoListeners(e.focus())})),this.addRedoUndoListeners(e.focus())}destroy(){this.disposePrevFocusViewRedoUndoListeners(this.context.focus())}}class Ke{constructor(t){this.windowManger=t,this.appProxies=new Map,this.appStatus=new Map,this.store=Qe,this.isReplay=this.windowManger.isReplay,this.mainViewScenesLength=0,this.callbacksNode=null,this.appCreateQueue=new oe,this.sideEffectManager=new Y,this.sceneState=null,this.rootDirRemoving=!1,this.onRemoveScenes=async t=>{var n;if("/"===t)return await this.onRootDirRemoved(),void this.dispatchInternalEvent(e.RootDirRemoved);const i=this.store.getMainViewScenePath();if(this.room&&i&&i===t){const e=null==(n=this.callbacksNode)?void 0:n.scenes[this.store.getMainViewSceneIndex()];this.setMainViewScenePath(`/${e}`||"/init")}},this.onReadonlyChanged=()=>{this.appProxies.forEach((e=>{e.emitAppIsWritableChange()}))},this.onPlayerSeekStart=async()=>{await this.closeAll()},this.onPlayerSeekDone=async e=>{await this.attributesUpdateCallback(this.attributes.apps),this.appProxies.forEach((t=>{t.onSeek(e)}))},this.createRootDirScenesCallback=()=>{let e=!1;this.callbacksNode&&(this.callbacksNode.dispose(),e=!0),this.callbacksNode=this.displayer.createScenesCallback("/",{onAddScene:this.onSceneChange,onRemoveScene:this.onSceneChange}),this.callbacksNode&&(this.updateSceneState(this.callbacksNode),this.mainViewScenesLength=this.callbacksNode.scenes.length,e&&this.emitMainViewScenesChange(this.callbacksNode.scenes.length))},this.onSceneChange=e=>{this.mainViewScenesLength=e.scenes.length,this.updateSceneState(e),this.emitMainViewScenesChange(this.mainViewScenesLength)},this.emitMainViewScenesChange=e=>{ae.emit("mainViewScenesLengthChange",e),le.emit("changePageState")},this.updateSceneState=e=>{const t=this.store.getMainViewSceneIndex()||0,n=e.scenes[t];this.sceneState={scenePath:`/${n}`,contextPath:e.path,index:t,scenes:e.scenes.map((e=>({name:e}))),sceneName:n},ae.emit("sceneStateChange",this.sceneState)},this.onMainViewIndexChange=e=>{void 0!==e&&this._prevSceneIndex!==e&&(ae.emit("mainViewSceneIndexChange",e),le.emit("changePageState"),this.callbacksNode&&this.updateSceneState(this.callbacksNode),this._prevSceneIndex=e)},this.onFocusChange=e=>{var t;this._prevFocused!==e&&(ae.emit("focusedChange",e),le.emit("focusedChange",{focused:e,prev:this._prevFocused}),this._prevFocused=e,void 0!==e&&(null==(t=this.boxManager)||t.focusBox({appId:e}),setTimeout((()=>{const t=this.appProxies.get(e);t&&me.notifyApp(t.kind,"focus",{appId:e})}),0)))},this.onRegisteredChange=e=>{e&&Object.entries(e).forEach((([e,t])=>{me.appClasses.has(e)||me.register({kind:e,src:t.src,name:t.name})}))},this.onMinimized=e=>{var t,n;(null==(t=this.boxManager)?void 0:t.minimized)!==e&&(!0===e&&(null==(n=this.boxManager)||n.blurAllBox()),setTimeout((()=>{var t;null==(t=this.boxManager)||t.setMinimized(Boolean(e))}),0))},this.onAppDelete=async e=>{const t=Object.keys(e);for(const[n,i]of this.appProxies.entries())t.includes(n)||await i.destroy(!0,!1,!0)},this.closeAll=async()=>{for(const[e,t]of this.appProxies.entries())await t.destroy(!0,!1,!0)},this.displayerStateListener=e=>{const t=e.sceneState;if(t){const e=t.scenePath;this.appProxies.forEach((n=>{n.scenePath&&e.startsWith(n.scenePath)&&(n.emitAppSceneStateChange(t),n.setFullPath(e))}))}this.appProxies.forEach((t=>{t.appEmitter.emit("roomStateChange",e)})),le.emit("observerIdChange",this.displayer.observerId)},this.displayerWritableListener=e=>{var t,n;const i=!e,r=void 0===this.windowManger.readonly||!1===this.windowManger.readonly;void 0===this.windowManger.readonly?null==(t=this.boxManager)||t.setReadonly(e):null==(n=this.boxManager)||n.setReadonly(!(i&&r)),this.appProxies.forEach((e=>{e.emitAppIsWritableChange()})),!0===i?(this.mainView.disableCameraTransform=!1,this.room&&!0===this.room.disableSerialization&&(this.room.disableSerialization=!1)):this.mainView.disableCameraTransform=!0},this.updateSceneIndex=()=>{const e=this.store.getMainViewScenePath(),t=Ce(e),n=ye(this.displayer)[t];if(n.length){const i=e.replace(t,"").replace("/",""),r=n.findIndex((e=>e.name===i));S(r)&&r>=0&&this.safeSetAttributes({_mainSceneIndex:r})}},this.boxEventListener=(t,n)=>{switch(t){case"move":this.dispatchInternalEvent(e.AppMove,n),this.store.updateAppState(n.appId,J.Position,{x:n.x,y:n.y});break;case"focus":this.windowManger.safeSetAttributes({focus:n.appId});break;case"resize":n.width&&n.height&&(this.dispatchInternalEvent(e.AppResize,n),this.store.updateAppState(n.appId,J.Size,{width:n.width,height:n.height}));break;case"close":{const e=this.appProxies.get(n.appId);e&&e.destroy(!1,!0,n.error);break}case"boxStateChange":this.dispatchInternalEvent(e.AppBoxStateChange,n)}},this.displayer=t.displayer,this.store.setContext({getAttributes:()=>this.attributes,safeSetAttributes:e=>this.safeSetAttributes(e),safeUpdateAttributes:(e,t)=>this.safeUpdateAttributes(e,t)}),this.mainViewProxy=new Xe(this),this.viewManager=new Ze(this.displayer),this.appListeners=new Ie(this),this.displayer.callbacks.on(this.eventName,this.displayerStateListener),this.appListeners.addListeners(),this.refresher=kb,this.refresher.setRoom(this.room),this.refresher.setContext({emitter:le}),this.sideEffectManager.add((()=>()=>{var e,t,n;this.appCreateQueue.destroy(),this.mainViewProxy.destroy(),null==(e=this.refresher)||e.destroy(),this.viewManager.destroy(),null==(t=this.boxManager)||t.destroy(),null==(n=this.callbacksNode)||n.dispose()})),le.once("onCreated").then((()=>this.onCreated())),le.on("onReconnected",(()=>this.onReconnected())),V(this.displayer)&&(le.on("seekStart",this.onPlayerSeekStart),le.on("seek",this.onPlayerSeekDone)),le.on("removeScenes",this.onRemoveScenes),le.on("setReadonly",this.onReadonlyChanged),this.createRootDirScenesCallback(),me.setSyncRegisterApp((e=>{this.safeUpdateAttributes([We.Registered,e.kind],e)}))}async onRootDirRemoved(e=!0){this.rootDirRemoving=!0,this.setMainViewScenePath("/init"),this.createRootDirScenesCallback();for(const[t,n]of this.appProxies.entries())n.view&&await this.closeApp(t,e);this.mainViewProxy.rebind(),le.emit("rootDirRemoved"),this.rootDirRemoving=!1}get eventName(){return _(this.displayer)?"onRoomStateChanged":"onPlayerStateChanged"}get attributes(){return this.windowManger.attributes}get canOperate(){return this.windowManger.canOperate}get room(){return _(this.displayer)?this.displayer:void 0}get mainView(){return this.mainViewProxy.view}get focusApp(){if(this.store.focus)return this.appProxies.get(this.store.focus)}get uid(){var e;return(null==(e=this.room)?void 0:e.uid)||""}getMainViewSceneDir(){const e=this.store.getMainViewScenePath();if(e)return Ce(e);throw new Error("[WindowManager]: mainViewSceneDir not found")}async onCreated(){var e,t,n,i,r,s,a,o;if(await this.attributesUpdateCallback(this.attributes.apps),le.emit("updateManagerRect"),le.onAny(this.boxEventListener),null==(e=this.refresher)||e.add("apps",(()=>Le((()=>this.attributes.apps),(()=>{this.attributesUpdateCallback(this.attributes.apps)})))),null==(t=this.refresher)||t.add("appsClose",(()=>Be(this.attributes.apps,(()=>{this.onAppDelete(this.attributes.apps)})))),null==(n=this.refresher)||n.add("maximized",(()=>L((()=>{var e;const t=this.attributes.maximized;null==(e=this.boxManager)||e.setMaximized(Boolean(t))})))),null==(i=this.refresher)||i.add("minimized",(()=>L((()=>{const e=this.attributes.minimized;this.onMinimized(e)})))),null==(r=this.refresher)||r.add("mainViewIndex",(()=>L((()=>{const e=b(this.attributes,"_mainSceneIndex");this.onMainViewIndexChange(e)})))),null==(s=this.refresher)||s.add("focusedChange",(()=>L((()=>{const e=b(this.attributes,"focus");this.onFocusChange(e)})))),null==(a=this.refresher)||a.add("registeredChange",(()=>L((()=>{const e=b(this.attributes,We.Registered);this.onRegisteredChange(e)})))),!this.attributes.apps||0===Object.keys(this.attributes.apps).length){const e=this.store.getMainViewScenePath();if(!e)return;this.resetScenePath(e)}this.displayerWritableListener(!(null==(o=this.room)?void 0:o.isWritable)),this.displayer.callbacks.on("onEnableWriteNowChanged",this.displayerWritableListener),this._prevFocused=this.attributes.focus,this.sideEffectManager.add((()=>{const e=new Je({mainView:()=>this.mainViewProxy.view,focus:()=>this.attributes.focus,getAppProxy:e=>this.appProxies.get(e)});return()=>e.destroy()}))}async attributesUpdateCallback(e){if(e&&Pb.container){const n=Object.keys(e);0===n.length&&this.appCreateQueue.emitReady();const i=n.map((t=>({id:t,createdAt:e[t].createdAt})));for(const{id:r}of I(i,"createdAt","asc"))if(!this.appProxies.has(r)&&!this.appStatus.has(r)){const n=e[r];try{if(!this.attributes[r])throw new Error("appAttributes is undefined");this.appCreateQueue.push((()=>(this.appStatus.set(r,te.StartCreate),this.baseInsertApp({kind:n.kind,options:n.options,isDynamicPPT:n.isDynamicPPT},r,!1)))),this.focusByAttributes(e)}catch(t){console.warn("[WindowManager]: Insert App Error",t)}}}}refresh(){this.attributesUpdateCallback(this.attributes.apps)}setBoxManager(e){this.boxManager=e}resetMaximized(){var e;null==(e=this.boxManager)||e.setMaximized(Boolean(this.store.getMaximized()))}resetMinimized(){var e;null==(e=this.boxManager)||e.setMinimized(Boolean(this.store.getMinimized()))}bindMainView(e,t){const n=this.mainViewProxy.view;n.disableCameraTransform=t,n.divElement=e,n.focusScenePath||this.setMainViewFocusPath(),le.emit("mainViewMounted")}setMainViewFocusPath(e){const t=e||this.store.getMainViewScenePath();if(t){const e=ve(this.mainView,t);return(null==e?void 0:e.focusScenePath)===t}}resetScenePath(e){this.displayer.state.sceneState.scenePath!==e&&be(this.room,e)}async addApp(e,t){$e("addApp",e);const{appId:n,needFocus:i}=await this.beforeAddApp(e,t),r=await this.baseInsertApp(e,n,!0,i);return this.afterAddApp(r),null==r?void 0:r.id}async beforeAddApp(e,t){var n,i;const r=await(async e=>{var t,n;const i=await(null==(t=me.appClasses.get(e))?void 0:t());return i&&(null==(n=i.config)?void 0:n.singleton)?e:`${e}-${F().replace("-","").slice(0,8)}`})(e.kind);this.appStatus.set(r,te.StartCreate);const s=null!=(n=e.attributes)?n:{};this.safeUpdateAttributes([r],s),this.store.setupAppAttributes(e,r,t);const a=!(null==(i=this.boxManager)?void 0:i.minimized);return a&&this.store.setAppFocus(r,!0),{appId:r,needFocus:a}}afterAddApp(e){var t,n;if(e&&e.box){const t=e.box;le.emit("move",{appId:e.id,x:null==t?void 0:t.intrinsicX,y:null==t?void 0:t.intrinsicY}),this.store.updateAppState(e.id,J.ZIndex,t.zIndex)}(null==(t=this.boxManager)?void 0:t.minimized)&&(null==(n=this.boxManager)||n.setMinimized(!1,!1))}async closeApp(e,t=!0){const n=this.appProxies.get(e);n&&n.destroy(!0,t,!1)}async baseInsertApp(e,t,n,i){if(this.appProxies.has(t))return void console.warn("[WindowManager]: app duplicate exists and cannot be created again");const r=new Fe(e,this,t,n);if(r)return await r.baseInsertApp(i),this.appStatus.delete(t),r;throw this.appStatus.delete(t),new Error("[WindowManger]: initialize AppProxy failed")}safeSetAttributes(e){this.windowManger.safeSetAttributes(e)}safeUpdateAttributes(e,t){this.windowManger.safeUpdateAttributes(e,t)}async setMainViewScenePath(e){if(this.room){const t=this.displayer.scenePathType(e);if("/"!==Ce(e))throw new Error('[WindowManager]: main view scenePath must in root dir "/"');if(t===k.None)throw new Error(`[WindowManager]: ${e} not valid scene`);if(t===k.Page)await this._setMainViewScenePath(e);else if(t===k.Dir){const t=we(this.displayer,e);t&&await this._setMainViewScenePath(t)}}}async _setMainViewScenePath(e){this.setMainViewFocusPath(e)&&(this.safeSetAttributes({_mainScenePath:e}),this.store.setMainViewFocusPath(this.mainView),this.updateSceneIndex(),this.dispatchSetMainViewScenePath(e))}async setMainViewSceneIndex(e){if(this.room){if(this.store.getMainViewSceneIndex()===e)return;const t=this.store.getMainViewScenePath();if(t){const n=Ce(t),i=we(this.displayer,n,e);if(!i)throw new Error(`[WindowManager]: ${n}: ${e} not valid index`);this.setMainViewFocusPath(i)&&(this.store.setMainViewScenePath(i),this.safeSetAttributes({_mainSceneIndex:e}),this.dispatchSetMainViewScenePath(i))}}}dispatchSetMainViewScenePath(t){this.dispatchInternalEvent(e.SetMainViewScenePath,{nextScenePath:t}),be(this.room,t)}getAppInitPath(e){var t;const n=this.store.getAppAttributes(e);if(n)return null==(t=null==n?void 0:n.options)?void 0:t.scenePath}safeDispatchMagixEvent(e,t){this.canOperate&&this.displayer.dispatchMagixEvent(e,t)}focusByAttributes(e){var t;if(e&&Object.keys(e).length===(null==(t=this.boxManager)?void 0:t.boxSize)){const e=this.store.focus;e&&this.boxManager.focusBox({appId:e})}}async onReconnected(){const e=Array.from(this.appProxies.values()).map((e=>e.onReconnected()));this.mainViewProxy.onReconnect(),await Promise.all(e)}notifyContainerRectUpdate(e){this.appProxies.forEach((t=>{t.appEmitter.emit("containerRectUpdate",e)}))}dispatchInternalEvent(e,t){this.safeDispatchMagixEvent("__WindowManger",{eventName:e,payload:t})}destroy(){this.displayer.callbacks.off(this.eventName,this.displayerStateListener),this.displayer.callbacks.off("onEnableWriteNowChanged",this.displayerWritableListener),this.appListeners.removeListeners(),le.offAny(this.boxEventListener),le.clearListeners(),this.appProxies.size&&this.appProxies.forEach((e=>{e.destroy(!0,!1,!0)})),ae.clearListeners(),this.sideEffectManager.flushAll(),this._prevFocused=void 0,this._prevSceneIndex=void 0}}const qe=window.ResizeObserver||G;class et{constructor(e){this.emitter=e}static create(e,t,n,i){const r=new et(i);return r.observePlaygroundSize(e,t,n),r}observePlaygroundSize(e,t,n){this.updateSizer(e.getBoundingClientRect(),t,n),this.containerResizeObserver=new qe((e=>{var i;const r=null==(i=e[0])?void 0:i.contentRect;r&&(this.updateSizer(r,t,n),this.emitter.emit("playgroundSizeChange",r))})),this.containerResizeObserver.observe(e)}updateSizer({width:e,height:t},n,i){e&&t&&(t/e>Pb.containerSizeRatio?(t=e*Pb.containerSizeRatio,n.classList.toggle("netless-window-manager-sizer-horizontal",!0)):(e=t/Pb.containerSizeRatio,n.classList.toggle("netless-window-manager-sizer-horizontal",!1)),i.style.width=`${e}px`,i.style.height=`${t}px`)}disconnect(){var e;null==(e=this.containerResizeObserver)||e.disconnect()}}var tt={exports:{}},nt={},it=Object.getOwnPropertySymbols,rt=Object.prototype.hasOwnProperty,st=Object.prototype.propertyIsEnumerable;function at(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var ot=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach((function(e){i[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(r){return!1}}()?Object.assign:function(e,t){for(var n,i,r=at(e),s=1;s<arguments.length;s++){for(var a in n=Object(arguments[s]))rt.call(n,a)&&(r[a]=n[a]);if(it){i=it(n);for(var o=0;o<i.length;o++)st.call(n,i[o])&&(r[i[o]]=n[i[o]])}}return r},lt=ot,ct="function"==typeof Symbol&&Symbol.for,ut=ct?Symbol.for("react.element"):60103,dt=ct?Symbol.for("react.portal"):60106,ht=ct?Symbol.for("react.fragment"):60107,pt=ct?Symbol.for("react.strict_mode"):60108,ft=ct?Symbol.for("react.profiler"):60114,gt=ct?Symbol.for("react.provider"):60109,mt=ct?Symbol.for("react.context"):60110,vt=ct?Symbol.for("react.forward_ref"):60112,bt=ct?Symbol.for("react.suspense"):60113,wt=ct?Symbol.for("react.memo"):60115,yt=ct?Symbol.for("react.lazy"):60116,xt="function"==typeof Symbol&&Symbol.iterator;
|
2
2
|
/** @license React v16.14.0
|
3
3
|
* react.production.min.js
|
4
4
|
*
|
@@ -6,7 +6,7 @@ var e,t,n=Object.defineProperty,i=Object.defineProperties,r=Object.getOwnPropert
|
|
6
6
|
*
|
7
7
|
* This source code is licensed under the MIT license found in the
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
9
|
-
*/function
|
9
|
+
*/function Ct(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Mt={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},St={};function It(e,t,n){this.props=e,this.context=t,this.refs=St,this.updater=n||Mt}function Et(){}function At(e,t,n){this.props=e,this.context=t,this.refs=St,this.updater=n||Mt}It.prototype.isReactComponent={},It.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(Ct(85));this.updater.enqueueSetState(this,e,t,"setState")},It.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},Et.prototype=It.prototype;var Tt=At.prototype=new Et;Tt.constructor=At,lt(Tt,It.prototype),Tt.isPureReactComponent=!0;var kt={current:null},Nt=Object.prototype.hasOwnProperty,Pt={key:!0,ref:!0,__self:!0,__source:!0};function zt(e,t,n){var i,r={},s=null,a=null;if(null!=t)for(i in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(s=""+t.key),t)Nt.call(t,i)&&!Pt.hasOwnProperty(i)&&(r[i]=t[i]);var o=arguments.length-2;if(1===o)r.children=n;else if(1<o){for(var l=Array(o),c=0;c<o;c++)l[c]=arguments[c+2];r.children=l}if(e&&e.defaultProps)for(i in o=e.defaultProps)void 0===r[i]&&(r[i]=o[i]);return{$$typeof:ut,type:e,key:s,ref:a,props:r,_owner:kt.current}}function Dt(e){return"object"==typeof e&&null!==e&&e.$$typeof===ut}var Lt=/\/+/g,Bt=[];function jt(e,t,n,i){if(Bt.length){var r=Bt.pop();return r.result=e,r.keyPrefix=t,r.func=n,r.context=i,r.count=0,r}return{result:e,keyPrefix:t,func:n,context:i,count:0}}function Rt(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>Bt.length&&Bt.push(e)}function Ot(e,t,n,i){var r=typeof e;"undefined"!==r&&"boolean"!==r||(e=null);var s=!1;if(null===e)s=!0;else switch(r){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case ut:case dt:s=!0}}if(s)return n(i,e,""===t?"."+_t(e,0):t),1;if(s=0,t=""===t?".":t+":",Array.isArray(e))for(var a=0;a<e.length;a++){var o=t+_t(r=e[a],a);s+=Ot(r,o,n,i)}else if(null===e||"object"!=typeof e?o=null:o="function"==typeof(o=xt&&e[xt]||e["@@iterator"])?o:null,"function"==typeof o)for(e=o.call(e),a=0;!(r=e.next()).done;)s+=Ot(r=r.value,o=t+_t(r,a++),n,i);else if("object"===r)throw n=""+e,Error(Ct(31,"[object Object]"===n?"object with keys {"+Object.keys(e).join(", ")+"}":n,""));return s}function Vt(e,t,n){return null==e?0:Ot(e,"",t,n)}function _t(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,(function(e){return t[e]}))}(e.key):t.toString(36)}function Ut(e,t){e.func.call(e.context,t,e.count++)}function Wt(e,t,n){var i=e.result,r=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?Ht(e,i,n,(function(e){return e})):null!=e&&(Dt(e)&&(e=function(e,t){return{$$typeof:ut,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(e,r+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(Lt,"$&/")+"/")+n)),i.push(e))}function Ht(e,t,n,i,r){var s="";null!=n&&(s=(""+n).replace(Lt,"$&/")+"/"),Vt(e,Wt,t=jt(t,s,i,r)),Rt(t)}var Qt={current:null};function $t(){var e=Qt.current;if(null===e)throw Error(Ct(321));return e}var Ft={ReactCurrentDispatcher:Qt,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:kt,IsSomeRendererActing:{current:!1},assign:lt};nt.Children={map:function(e,t,n){if(null==e)return e;var i=[];return Ht(e,i,null,t,n),i},forEach:function(e,t,n){if(null==e)return e;Vt(e,Ut,t=jt(null,null,t,n)),Rt(t)},count:function(e){return Vt(e,(function(){return null}),null)},toArray:function(e){var t=[];return Ht(e,t,null,(function(e){return e})),t},only:function(e){if(!Dt(e))throw Error(Ct(143));return e}},nt.Component=It,nt.Fragment=ht,nt.Profiler=ft,nt.PureComponent=At,nt.StrictMode=pt,nt.Suspense=bt,nt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ft,nt.cloneElement=function(e,t,n){if(null==e)throw Error(Ct(267,e));var i=lt({},e.props),r=e.key,s=e.ref,a=e._owner;if(null!=t){if(void 0!==t.ref&&(s=t.ref,a=kt.current),void 0!==t.key&&(r=""+t.key),e.type&&e.type.defaultProps)var o=e.type.defaultProps;for(l in t)Nt.call(t,l)&&!Pt.hasOwnProperty(l)&&(i[l]=void 0===t[l]&&void 0!==o?o[l]:t[l])}var l=arguments.length-2;if(1===l)i.children=n;else if(1<l){o=Array(l);for(var c=0;c<l;c++)o[c]=arguments[c+2];i.children=o}return{$$typeof:ut,type:e.type,key:r,ref:s,props:i,_owner:a}},nt.createContext=function(e,t){return void 0===t&&(t=null),(e={$$typeof:mt,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:gt,_context:e},e.Consumer=e},nt.createElement=zt,nt.createFactory=function(e){var t=zt.bind(null,e);return t.type=e,t},nt.createRef=function(){return{current:null}},nt.forwardRef=function(e){return{$$typeof:vt,render:e}},nt.isValidElement=Dt,nt.lazy=function(e){return{$$typeof:yt,_ctor:e,_status:-1,_result:null}},nt.memo=function(e,t){return{$$typeof:wt,type:e,compare:void 0===t?null:t}},nt.useCallback=function(e,t){return $t().useCallback(e,t)},nt.useContext=function(e,t){return $t().useContext(e,t)},nt.useDebugValue=function(){},nt.useEffect=function(e,t){return $t().useEffect(e,t)},nt.useImperativeHandle=function(e,t,n){return $t().useImperativeHandle(e,t,n)},nt.useLayoutEffect=function(e,t){return $t().useLayoutEffect(e,t)},nt.useMemo=function(e,t){return $t().useMemo(e,t)},nt.useReducer=function(e,t,n){return $t().useReducer(e,t,n)},nt.useRef=function(e){return $t().useRef(e)},nt.useState=function(e){return $t().useState(e)},nt.version="16.14.0",tt.exports=nt;var Zt=tt.exports,Yt=Object.defineProperty,Gt=Object.defineProperties,Xt=Object.getOwnPropertyDescriptors,Jt=Object.getOwnPropertySymbols,Kt=Object.prototype.hasOwnProperty,qt=Object.prototype.propertyIsEnumerable,en=(e,t,n)=>t in e?Yt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,tn=(e,t)=>{for(var n in t||(t={}))Kt.call(t,n)&&en(e,n,t[n]);if(Jt)for(var n of Jt(t))qt.call(t,n)&&en(e,n,t[n]);return e},nn=(e,t)=>Gt(e,Xt(t)),rn={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,n="~";function i(){}function r(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function s(e,t,i,s,a){if("function"!=typeof i)throw new TypeError("The listener must be a function");var o=new r(i,s||e,a),l=n?n+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],o]:e._events[l].push(o):(e._events[l]=o,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new i:delete e._events[t]}function o(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),o.prototype.eventNames=function(){var e,i,r=[];if(0===this._eventsCount)return r;for(i in e=this._events)t.call(e,i)&&r.push(n?i.slice(1):i);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},o.prototype.listeners=function(e){var t=n?n+e:e,i=this._events[t];if(!i)return[];if(i.fn)return[i.fn];for(var r=0,s=i.length,a=new Array(s);r<s;r++)a[r]=i[r].fn;return a},o.prototype.listenerCount=function(e){var t=n?n+e:e,i=this._events[t];return i?i.fn?1:i.length:0},o.prototype.emit=function(e,t,i,r,s,a){var o=n?n+e:e;if(!this._events[o])return!1;var l,c,u=this._events[o],d=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),d){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,i),!0;case 4:return u.fn.call(u.context,t,i,r),!0;case 5:return u.fn.call(u.context,t,i,r,s),!0;case 6:return u.fn.call(u.context,t,i,r,s,a),!0}for(c=1,l=new Array(d-1);c<d;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var h,p=u.length;for(c=0;c<p;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),d){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,i);break;case 4:u[c].fn.call(u[c].context,t,i,r);break;default:if(!l)for(h=1,l=new Array(d-1);h<d;h++)l[h-1]=arguments[h];u[c].fn.apply(u[c].context,l)}}return!0},o.prototype.on=function(e,t,n){return s(this,e,t,n,!1)},o.prototype.once=function(e,t,n){return s(this,e,t,n,!0)},o.prototype.removeListener=function(e,t,i,r){var s=n?n+e:e;if(!this._events[s])return this;if(!t)return a(this,s),this;var o=this._events[s];if(o.fn)o.fn!==t||r&&!o.once||i&&o.context!==i||a(this,s);else{for(var l=0,c=[],u=o.length;l<u;l++)(o[l].fn!==t||r&&!o[l].once||i&&o[l].context!==i)&&c.push(o[l]);c.length?this._events[s]=1===c.length?c[0]:c:a(this,s)}return this},o.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&a(this,t)):(this._events=new i,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=n,o.EventEmitter=o,e.exports=o}(rn);var sn=rn.exports,an=function(){return(an=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};
|
10
10
|
/*! *****************************************************************************
|
11
11
|
Copyright (c) Microsoft Corporation.
|
12
12
|
|
@@ -20,7 +20,7 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
20
20
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
21
21
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
22
22
|
PERFORMANCE OF THIS SOFTWARE.
|
23
|
-
***************************************************************************** */function an(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n}var on=0,ln="undefined"!=typeof window&&void 0!==window.requestAnimationFrame?function(e){return window.requestAnimationFrame(e)}:function(e){var t=Date.now(),n=Math.max(0,16.7-(t-on));on=t+n,setTimeout((function(){return e(on)}),n)},cn=1/60*1e3,un=!0,dn=!1,hn=!1,pn={delta:0,timestamp:0},fn=["read","update","preRender","render","postRender"],gn=function(e){return dn=e},mn=fn.reduce((function(e,t){var n,i,r,s,a,o,l,c,u;return e[t]=(n=gn,i=[],r=[],s=0,a=!1,o=0,l=new WeakSet,c=new WeakSet,u={cancel:function(e){var t=r.indexOf(e);l.add(e),-1!==t&&r.splice(t,1)},process:function(e){var t,d;if(a=!0,i=(t=[r,i])[0],(r=t[1]).length=0,s=i.length)for(o=0;o<s;o++)(d=i[o])(e),!0!==c.has(d)||l.has(d)||(u.schedule(d),n(!0));a=!1},schedule:function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var o=n&&a,u=o?i:r;l.delete(e),t&&c.add(e),-1===u.indexOf(e)&&(u.push(e),o&&(s=i.length))}}),e}),{}),vn=fn.reduce((function(e,t){var n=mn[t];return e[t]=function(e,t,i){return void 0===t&&(t=!1),void 0===i&&(i=!1),dn||yn(),n.schedule(e,t,i),e},e}),{}),bn=function(e){return mn[e].process(pn)},wn=function(e){dn=!1,pn.delta=un?cn:Math.max(Math.min(e-pn.timestamp,40),1),un||(cn=pn.delta),pn.timestamp=e,hn=!0,fn.forEach(bn),hn=!1,dn&&(un=!1,ln(wn))},yn=function(){dn=!0,un=!0,hn||ln(wn)},xn=function(){return(xn=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},Cn=function(e,t){return function(n){return Math.max(Math.min(n,t),e)}},Mn=function(e){return e%1?Number(e.toFixed(5)):e},Sn=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i,In={test:function(e){return"number"==typeof e},parse:parseFloat,transform:function(e){return e}},En=xn(xn({},In),{transform:Cn(0,1)}),An=xn(xn({},In),{default:1}),Tn=function(e){return{test:function(t){return"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length},parse:parseFloat,transform:function(t){return""+t+e}}},kn=Tn("deg"),Nn=Tn("%"),Pn=Tn("px"),zn=xn(xn({},Nn),{parse:function(e){return Nn.parse(e)/100},transform:function(e){return Nn.transform(100*e)}}),Dn=Cn(0,255),Ln=function(e){return void 0!==e.red},Bn=function(e){return void 0!==e.hue},jn=function(e){return function(t){if("string"!=typeof t)return t;for(var n={},i=(s=t,s.substring(s.indexOf("(")+1,s.lastIndexOf(")"))).replace(/(,|\/)/g," ").split(/ \s*/),r=0;r<4;r++)n[e[r]]=void 0!==i[r]?parseFloat(i[r]):1;var s;return n}},Rn=xn(xn({},In),{transform:function(e){return Math.round(Dn(e))}});function On(e,t){return e.startsWith(t)&&Sn.test(e)}var Vn,_n={test:function(e){return"string"==typeof e?On(e,"rgb"):Ln(e)},parse:jn(["red","green","blue","alpha"]),transform:function(e){var t,n,i=e.red,r=e.green,s=e.blue,a=e.alpha,o=void 0===a?1:a;return"rgba("+(t={red:Rn.transform(i),green:Rn.transform(r),blue:Rn.transform(s),alpha:Mn(En.transform(o))}).red+", "+t.green+", "+t.blue+", "+(void 0===(n=t.alpha)?1:n)+")"}},Un={test:function(e){return"string"==typeof e?On(e,"hsl"):Bn(e)},parse:jn(["hue","saturation","lightness","alpha"]),transform:function(e){var t,n,i=e.hue,r=e.saturation,s=e.lightness,a=e.alpha,o=void 0===a?1:a;return"hsla("+(t={hue:Math.round(i),saturation:Nn.transform(Mn(r)),lightness:Nn.transform(Mn(s)),alpha:Mn(En.transform(o))}).hue+", "+t.saturation+", "+t.lightness+", "+(void 0===(n=t.alpha)?1:n)+")"}},Wn=xn(xn({},_n),{test:function(e){return"string"==typeof e&&On(e,"#")},parse:function(e){var t="",n="",i="";return e.length>4?(t=e.substr(1,2),n=e.substr(3,2),i=e.substr(5,2)):(t=e.substr(1,1),n=e.substr(2,1),i=e.substr(3,1),t+=t,n+=n,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:1}}}),Hn={test:function(e){return"string"==typeof e&&Sn.test(e)||Ln(e)||Bn(e)},parse:function(e){return _n.test(e)?_n.parse(e):Un.test(e)?Un.parse(e):Wn.test(e)?Wn.parse(e):e},transform:function(e){return Ln(e)?_n.transform(e):Bn(e)?Un.transform(e):e}},Qn=function(e){var t=e.onRead,n=e.onRender,i=e.uncachedValues,r=void 0===i?new Set:i,s=e.useCache,a=void 0===s||s;return function(e){void 0===e&&(e={});var i=an(e,[]),s={},o=[],l=!1;function c(e,t){e.startsWith("--")&&(i.hasCSSVariable=!0);var n=s[e];s[e]=t,s[e]!==n&&(-1===o.indexOf(e)&&o.push(e),l||(l=!0,vn.render(u.render)))}var u={get:function(e,n){return void 0===n&&(n=!1),n||!a||r.has(e)||void 0===s[e]?t(e,i):s[e]},set:function(e,t){if("string"==typeof e)c(e,t);else for(var n in e)c(n,e[n]);return this},render:function(e){return void 0===e&&(e=!1),(l||!0===e)&&(n(s,i,o),l=!1,o.length=0),this}};return u}},$n=/([a-z])([A-Z])/g,Fn=function(e){return e.replace($n,"$1-$2").toLowerCase()},Zn=new Map,Yn=new Map,Gn=["Webkit","Moz","O","ms",""],Xn=Gn.length,Jn="undefined"!=typeof document,Kn=function(e,t){return Yn.set(e,Fn(t))},qn=function(e,t){void 0===t&&(t=!1);var n,i=t?Yn:Zn;return i.has(e)||(Jn?function(e){Vn=Vn||document.createElement("div");for(var t=0;t<Xn;t++){var n=Gn[t],i=""===n,r=i?e:n+e.charAt(0).toUpperCase()+e.slice(1);if(r in Vn.style||i){if(i&&"clipPath"===e&&Yn.has(e))return;Zn.set(e,r),Kn(e,(i?"":"-")+Fn(r))}}}(e):Kn(n=e,n)),i.get(e)||e},ei=["","X","Y","Z"],ti=["translate","scale","rotate","skew","transformPerspective"].reduce((function(e,t){return ei.reduce((function(e,n){return e.push(t+n),e}),e)}),["x","y","z"]),ni=ti.reduce((function(e,t){return e[t]=!0,e}),{});function ii(e){return!0===ni[e]}function ri(e,t){return ti.indexOf(e)-ti.indexOf(t)}var si=new Set(["originX","originY","originZ"]);function ai(e){return si.has(e)}var oi=sn(sn({},In),{transform:Math.round}),li={color:Hn,backgroundColor:Hn,outlineColor:Hn,fill:Hn,stroke:Hn,borderColor:Hn,borderTopColor:Hn,borderRightColor:Hn,borderBottomColor:Hn,borderLeftColor:Hn,borderWidth:Pn,borderTopWidth:Pn,borderRightWidth:Pn,borderBottomWidth:Pn,borderLeftWidth:Pn,borderRadius:Pn,radius:Pn,borderTopLeftRadius:Pn,borderTopRightRadius:Pn,borderBottomRightRadius:Pn,borderBottomLeftRadius:Pn,width:Pn,maxWidth:Pn,height:Pn,maxHeight:Pn,size:Pn,top:Pn,right:Pn,bottom:Pn,left:Pn,padding:Pn,paddingTop:Pn,paddingRight:Pn,paddingBottom:Pn,paddingLeft:Pn,margin:Pn,marginTop:Pn,marginRight:Pn,marginBottom:Pn,marginLeft:Pn,rotate:kn,rotateX:kn,rotateY:kn,rotateZ:kn,scale:An,scaleX:An,scaleY:An,scaleZ:An,skew:kn,skewX:kn,skewY:kn,distance:Pn,translateX:Pn,translateY:Pn,translateZ:Pn,x:Pn,y:Pn,z:Pn,perspective:Pn,opacity:En,originX:zn,originY:zn,originZ:Pn,zIndex:oi,fillOpacity:En,strokeOpacity:En,numOctaves:oi},ci=function(e){return li[e]},ui=function(e,t){return t&&"number"==typeof e?t.transform(e):e},di=new Set(["scrollLeft","scrollTop"]),hi=new Set(["scrollLeft","scrollTop","transform"]),pi={x:"translateX",y:"translateY",z:"translateZ"};function fi(e){return"function"==typeof e}function gi(e){var t=void 0===e?{}:e,n=t.enableHardwareAcceleration,i=void 0===n||n,r=t.isDashCase,s=void 0===r||r,a=t.allowTransformNone,o=void 0===a||a,l={},c={},u={},d=[];return function(e){return d.length=0,function(e,t,n,i,r,s,a,o){void 0===t&&(t=!0),void 0===n&&(n={}),void 0===i&&(i={}),void 0===r&&(r={}),void 0===s&&(s=[]),void 0===a&&(a=!1),void 0===o&&(o=!0);var l=!0,c=!1,u=!1;for(var d in e){var h=e[d],p=ci(d),f=ui(h,p);ii(d)?(c=!0,i[d]=f,s.push(d),l&&(p.default&&h!==p.default||!p.default&&0!==h)&&(l=!1)):ai(d)?(r[d]=f,u=!0):hi.has(d)&&fi(f)||(n[qn(d,a)]=f)}(c||"function"==typeof e.transform)&&(n.transform=function(e,t,n,i,r,s){void 0===s&&(s=!0);var a="",o=!1;n.sort(ri);for(var l=n.length,c=0;c<l;c++){var u=n[c];a+=(pi[u]||u)+"("+t[u]+") ",o="z"===u||o}return!o&&r?a+="translateZ(0)":a=a.trim(),fi(e.transform)?a=e.transform(t,i?"":a):s&&i&&(a="none"),a}(e,i,s,l,t,o)),u&&(n.transformOrigin=(r.originX||"50%")+" "+(r.originY||"50%")+" "+(r.originZ||0))}(e,i,l,c,u,d,s,o),l}}var mi=Qn({onRead:function(e,t){var n=t.element,i=t.preparseOutput,r=ci(e);if(ii(e))return r&&r.default||0;if(di.has(e))return n[e];var s=window.getComputedStyle(n,null).getPropertyValue(qn(e,!0))||0;return i&&r&&r.test(s)&&r.parse?r.parse(s):s},onRender:function(e,t,n){var i=t.element,r=t.buildStyles,s=t.hasCSSVariable;if(Object.assign(i.style,r(e)),s)for(var a=n.length,o=0;o<a;o++){var l=n[o];l.startsWith("--")&&i.style.setProperty(l,e[l])}-1!==n.indexOf("scrollLeft")&&(i.scrollLeft=e.scrollLeft),-1!==n.indexOf("scrollTop")&&(i.scrollTop=e.scrollTop)},uncachedValues:di}),vi=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues"]),bi=function(e,t){return Pn.transform(e*t)},wi={x:0,y:0,width:0,height:0};function yi(e,t,n){return"string"==typeof e?e:Pn.transform(t+n*e)}var xi={enableHardwareAcceleration:!1,isDashCase:!1};function Ci(e,t,n){void 0===n&&(n=!0);var i={style:{}},r=gi(xi);return function(s){return function(e,t,n,i,r,s){void 0===t&&(t=wi),void 0===i&&(i=gi(xi)),void 0===r&&(r={style:{}}),void 0===s&&(s=!0);var a,o,l=e.attrX,c=e.attrY,u=e.originX,d=e.originY,h=e.pathLength,p=e.pathSpacing,f=void 0===p?1:p,g=e.pathOffset,m=void 0===g?0:g,v=i(an(e,["attrX","attrY","originX","originY","pathLength","pathSpacing","pathOffset"]));for(var b in v)"transform"===b?r.style.transform=v[b]:r[s&&!vi.has(b)?Fn(b):b]=v[b];return(void 0!==u||void 0!==d||v.transform)&&(r.style.transformOrigin=(o=void 0!==d?d:.5,yi(void 0!==u?u:.5,(a=t).x,a.width)+" "+yi(o,a.y,a.height))),void 0!==l&&(r.x=l),void 0!==c&&(r.y=c),void 0!==n&&void 0!==h&&(r[s?"stroke-dashoffset":"strokeDashoffset"]=bi(-m,n),r[s?"stroke-dasharray":"strokeDasharray"]=bi(h,n)+" "+bi(f,n)),r}(s,e,t,r,i,n)}}var Mi=Qn({onRead:function(e,t){var n=t.element;if(ii(e=vi.has(e)?e:Fn(e))){var i=ci(e);return i&&i.default||0}return n.getAttribute(e)},onRender:function(e,t){var n=t.element,i=(0,t.buildAttrs)(e);for(var r in i)"style"===r?Object.assign(n.style,i.style):n.setAttribute(r,i[r])}}),Si=Qn({useCache:!1,onRead:function(e){return"scrollTop"===e?window.pageYOffset:window.pageXOffset},onRender:function(e){var t=e.scrollTop,n=void 0===t?0:t,i=e.scrollLeft,r=void 0===i?0:i;return window.scrollTo(r,n)}}),Ii=new WeakMap;function Ei(e,t){return n="string"==typeof e?document.querySelector(e):e,i=t,Ii.has(n)?Ii.get(n):function(e,t){var n,r,s,a,o;return e===window?n=Si(e):(o=e)instanceof HTMLElement||"function"==typeof o.click?n=function(e,t){void 0===t&&(t={});var n=t.enableHardwareAcceleration,i=t.allowTransformNone,r=an(t,["enableHardwareAcceleration","allowTransformNone"]);return mi(sn({element:e,buildStyles:gi({enableHardwareAcceleration:n,allowTransformNone:i}),preparseOutput:!0},r))}(e,t):function(e){return e instanceof SVGElement||"ownerSVGElement"in e}(e)&&(s=function(e){try{return"function"==typeof(t=e).getBBox?t.getBBox():t.getBoundingClientRect()}catch(i){return{x:0,y:0,width:0,height:0}}var t}(r=e),a=function(e){return"path"===e.tagName}(r)&&r.getTotalLength?r.getTotalLength():void 0,n=Mi({element:r,buildAttrs:Ci(s,a)})),Ii.set(e,n),n}(n,i);var n,i}var Ai=function(e,t,n,i){var r=n?n.call(i,e,t):void 0;if(void 0!==r)return!!r;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var s=Object.keys(e),a=Object.keys(t);if(s.length!==a.length)return!1;for(var o=Object.prototype.hasOwnProperty.bind(t),l=0;l<s.length;l++){var c=s[l];if(!o(c))return!1;var u=e[c],d=t[c];if(!1===(r=n?n.call(i,u,d,c):void 0)||void 0===r&&u!==d)return!1}return!0};const Ti="!#%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",ki=Ti.length,Ni=Array(20),Pi=()=>{for(let e=0;e<20;e++)Ni[e]=Ti.charAt(Math.random()*ki);return Ni.join("")};class zi{constructor(){this.disposers=new Map}add(e,t=Pi()){return this.flush(t),this.disposers.set(t,e()),t}addDisposer(e,t=Pi()){return this.flush(t),this.disposers.set(t,e),t}addEventListener(e,t,n,i,r=Pi()){return this.add((()=>(e.addEventListener(t,n,i),()=>e.removeEventListener(t,n,i))),r),r}setTimeout(e,t,n=Pi()){return this.add((()=>{const i=window.setTimeout((()=>{this.remove(n),e()}),t);return()=>window.clearTimeout(i)}),n)}setInterval(e,t,n=Pi()){return this.add((()=>{const n=window.setInterval(e,t);return()=>window.clearInterval(n)}),n)}remove(e){const t=this.disposers.get(e);return this.disposers.delete(e),t}flush(e){const t=this.remove(e);if(t)try{t()}catch(n){console.error(n)}}flushAll(){this.disposers.forEach((e=>{try{e()}catch(t){console.error(t)}})),this.disposers.clear()}}var Di,Li,Bi,ji,Ri,Oi,Vi,_i,Ui,Wi,Hi=Object.defineProperty,Qi=("undefined"!=typeof require&&require,(e,t,n)=>{return s=n,(r="symbol"!=typeof t?t+"":t)in(i=e)?Hi(i,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[r]=s,n;var i,r,s});class $i{constructor(e,t){Qi(this,"_value"),Qi(this,"_beforeDestroys"),Qi(this,"_subscribers"),this._value=e,t&&(this.compare=t)}get value(){return this._value}setValue(e,t){if(!this.compare(e,this._value)){const n=this._value;this._value=e,this._subscribers&&this._subscribers.forEach((i=>i(e,n,t)))}}reaction(e){return this._subscribers||(this._subscribers=new Set),this._subscribers.add(e),()=>{this._subscribers&&this._subscribers.delete(e)}}subscribe(e,t){const n=this.reaction(e);return e(this._value,void 0,t),n}derive(e,t,n){const i=new $i(e(this.value,void 0,n),t),r=this.reaction(((t,n,r)=>{i.setValue(e(t,n,r))}));return i.addBeforeDestroy(r),i}destroy(){this._beforeDestroys&&(this._beforeDestroys.forEach((e=>e())),this._beforeDestroys.clear()),this._subscribers&&this._subscribers.clear()}addBeforeDestroy(e){return this._beforeDestroys||(this._beforeDestroys=new Set),this._beforeDestroys.add(e),()=>{this._beforeDestroys&&this._beforeDestroys.delete(e)}}compare(e,t){return e===t}}function Fi(e,t){Object.keys(t).forEach((n=>{var i,r,s,a;i=e,r=n,s=t[n],Object.defineProperties(i,{[r]:{get:()=>s.value},[`_${r}$`]:{value:s},[`set${a=r,a[0].toUpperCase()+a.slice(1)}`]:{value:(e,t)=>s.setValue(e,t)}})}))}function Zi(e){const t=t=>{const n=e.addDisposer((()=>{t.destroy()}));return t.addBeforeDestroy((()=>{e.remove(n)})),t};return{bindSideEffect:t,combine:(e,n,i,r)=>t(function(e,t,n,i){let r=e.map((e=>e.value));const s=new $i(t(r,void 0,i),n);return e.forEach(((e,n)=>{const i=e.reaction(((e,i,a)=>{const o=r.slice();o[n]=e;const l=r;r=o,s.setValue(t(o,l,a),a)}));s.addBeforeDestroy(i)})),s}(e,n,i,r)),createVal:(e,n)=>t(new $i(e,n))}}function Yi(e,t,n){return Math.min(Math.max(e,t),n)}function Gi(e){e.stopPropagation(),e.cancelable&&e.preventDefault()}function Xi(e){return e.touches?e.touches[0]:e}function Ji(){return Date.now().toString().slice(6)+Math.random().toString().slice(2,8)}(Li=Di||(Di={})).Light="light",Li.Dark="dark",Li.Auto="auto",(ji=Bi||(Bi={})).Normal="normal",ji.Minimized="minimized",ji.Maximized="maximized",(Oi=Ri||(Ri={})).DarkMode="dark_mode",Oi.PrefersColorScheme="prefers_color_scheme",Oi.Close="close",Oi.Focus="focus",Oi.Blur="blur",Oi.Move="move",Oi.Resize="resize",Oi.IntrinsicMove="intrinsic_move",Oi.IntrinsicResize="intrinsic_resize",Oi.VisualResize="visual_resize",Oi.ZIndex="z_index",Oi.State="state",Oi.Minimized="minimized",Oi.Maximized="maximized",Oi.Readonly="readonly",Oi.Destroyed="destroyed",(_i=Vi||(Vi={})).Close="close",_i.Maximize="maximize",_i.Minimize="minimize",(Wi=Ui||(Ui={})).North="n",Wi.South="s",Wi.West="w",Wi.East="e",Wi.NorthWest="nw",Wi.NorthEast="ne",Wi.SouthEast="se",Wi.SouthWest="sw";let Ki=1;function qi(){return"New Box "+Ki++}function er(e){return Boolean(e)}function tr(e){return!e}class nr{constructor({readonly:e=!1,title:t,buttons:n,onEvent:i,onDragStart:r,namespace:s="telebox",state:a=Bi.Normal}={}){this.$btns=[],this.sideEffect=new zi,this.lastTitleBarClick={timestamp:0,clientX:-100,clientY:-100},this.handleTitleBarClick=e=>{var t;if(this.readonly)return;if(0!==e.button)return;if(null==(t=e.target.dataset)?void 0:t.teleTitleBarNoDblClick)return;Gi(e);const n=Date.now();n-this.lastTitleBarClick.timestamp<=500?Math.abs(e.clientX-this.lastTitleBarClick.clientX)<=5&&Math.abs(e.clientY-this.lastTitleBarClick.clientY)<=5&&this.onEvent&&this.onEvent({type:Vi.Maximize}):this.onDragStart&&this.onDragStart(e),this.lastTitleBarClick.timestamp=n,this.lastTitleBarClick.clientX=e.clientX,this.lastTitleBarClick.clientY=e.clientY},this.lastTitleBarTouch={timestamp:0,clientX:-100,clientY:-100},this.handleTitleBarTouch=e=>{var t;if(this.readonly)return;if(null==(t=e.target.dataset)?void 0:t.teleTitleBarNoDblClick)return;Gi(e);const n=Date.now(),{clientX:i=this.lastTitleBarTouch.clientX+100,clientY:r=this.lastTitleBarTouch.clientY+100}=e.touches[0]||{};n-this.lastTitleBarTouch.timestamp<=500?Math.abs(i-this.lastTitleBarTouch.clientX)<=10&&Math.abs(r-this.lastTitleBarTouch.clientY)<=10&&this.onEvent&&this.onEvent({type:Vi.Maximize}):this.onDragStart&&this.onDragStart(e),this.lastTitleBarTouch.timestamp=n,this.lastTitleBarTouch.clientX=i,this.lastTitleBarTouch.clientY=r},this.readonly=e,this.onEvent=i,this.onDragStart=r,this.namespace=s,this.title=t,this.state=a,this.buttons=n||[{type:Vi.Minimize,iconClassName:this.wrapClassName("titlebar-icon-minimize")},{type:Vi.Maximize,iconClassName:this.wrapClassName("titlebar-icon-maximize"),isActive:e=>e===Bi.Maximized},{type:Vi.Close,iconClassName:this.wrapClassName("titlebar-icon-close")}],this.$dragArea=this.renderDragArea()}setTitle(e){this.title=e,this.$title&&(this.$title.textContent=e,this.$title.title=e)}setState(e){this.state!==e&&(this.state=e,this.buttons.forEach(((t,n)=>{t.isActive&&this.$btns[n].classList.toggle("is-active",t.isActive(e))})))}setReadonly(e){this.readonly!==e&&(this.readonly=e)}render(){if(!this.$titleBar){this.$titleBar=document.createElement("div"),this.$titleBar.className=this.wrapClassName("titlebar");const e=document.createElement("div");e.className=this.wrapClassName("title-area"),e.dataset.teleBoxHandle="dh",this.$title=document.createElement("h1"),this.$title.className=this.wrapClassName("title"),this.$title.dataset.teleBoxHandle="dh",this.title&&(this.$title.textContent=this.title,this.$title.title=this.title),e.appendChild(this.$title),e.appendChild(this.$dragArea);const t=document.createElement("div");t.className=this.wrapClassName("titlebar-btns"),this.buttons.forEach((({iconClassName:e,isActive:n},i)=>{const r=String(i),s=document.createElement("button");s.className=`${this.wrapClassName("titlebar-btn")} ${e}`,s.dataset.teleTitleBarBtnIndex=r,s.dataset.teleTitleBarNoDblClick="true",n&&s.classList.toggle("is-active",n(this.state)),this.$btns.push(s),t.appendChild(s)})),this.sideEffect.addEventListener(t,"click",(e=>{var t;if(this.readonly)return;const n=e.target,i=Number(null==(t=n.dataset)?void 0:t.teleTitleBarBtnIndex);if(!Number.isNaN(i)&&i<this.buttons.length){Gi(e);const t=this.buttons[i];this.onEvent&&this.onEvent({type:t.type,value:t.value})}})),this.$titleBar.appendChild(e),this.$titleBar.appendChild(t)}return this.$titleBar}renderDragArea(){const e=document.createElement("div");return e.className=this.wrapClassName("drag-area"),e.dataset.teleBoxHandle="dh",this.sideEffect.addEventListener(e,"mousedown",this.handleTitleBarClick),this.sideEffect.addEventListener(e,"touchstart",this.handleTitleBarTouch,{passive:!0}),e}dragHandle(){return this.$titleBar}wrapClassName(e){return`${this.namespace}-${e}`}destroy(){this.sideEffect.flushAll(),this.$titleBar&&(this.$titleBar=void 0,this.$title=void 0,this.$btns.length=0,this.onDragStart=void 0,this.onEvent=void 0)}}class ir{constructor({id:e=Ji(),title:t=qi(),prefersColorScheme:n=Di.Light,darkMode:i,visible:r=!0,width:s=.5,height:a=.5,minWidth:o=0,minHeight:l=0,x:c=.1,y:u=.1,minimized:d=!1,maximized:h=!1,readonly:p=!1,resizable:f=!0,draggable:g=!0,fence:m=!0,fixRatio:v=!1,focus:b=!1,zIndex:w=100,namespace:y="telebox",titleBar:x,content:C,footer:M,styles:S,containerRect:I={x:0,y:0,width:window.innerWidth,height:window.innerHeight},collectorRect:E}={}){this._renderSideEffect=new zi,this.handleTrackStart=e=>{var t;return null==(t=this._handleTrackStart)?void 0:t.call(this,e)},this._sideEffect=new zi,this._valSideEffectBinder=Zi(this._sideEffect);const{combine:A,createVal:T}=this._valSideEffectBinder;this.id=e,this.namespace=y,this.events=new rn,this._delegateEvents=new rn;const k=T(n);k.reaction(((e,t,n)=>{n||this.events.emit(Ri.PrefersColorScheme,e)}));const N=T(Boolean(i));null==i&&k.subscribe(((e,t,n)=>{this._sideEffect.add((()=>{if("auto"===e){const e=window.matchMedia("(prefers-color-scheme: dark)");if(e){N.setValue(e.matches,n);const t=e=>{N.setValue(e.matches,n)};return e.addListener(t),()=>e.removeListener(t)}return rr}return N.setValue("dark"===e,n),rr}),"prefers-color-scheme")})),N.reaction(((e,t,n)=>{n||this.events.emit(Ri.DarkMode,e)}));const P=T(I,Ai),z=T(E,Ai),D=T(t),L=T(r);L.reaction(((e,t,n)=>{n||e||this.events.emit(Ri.Close)}));const B=T(p);B.reaction(((e,t,n)=>{n||this.events.emit(Ri.Readonly,e)}));const j=T(f),R=T(g),O=T(m),V=T(v),_=T(w);_.reaction(((e,t,n)=>{n||this.events.emit(Ri.ZIndex,e)}));const U=T(b);U.reaction(((e,t,n)=>{n||this.events.emit(e?Ri.Focus:Ri.Blur)}));const W=T(d);W.reaction(((e,t,n)=>{n||this.events.emit(Ri.Minimized,e)}));const H=T(h);H.reaction(((e,t,n)=>{n||this.events.emit(Ri.Maximized,e)}));const Q=A([W,H],(([e,t])=>e?Bi.Minimized:t?Bi.Maximized:Bi.Normal));Q.reaction(((e,t,n)=>{n||this.events.emit(Ri.State,e)}));const $=T({width:Yi(o,0,1),height:Yi(l,0,1)},Ai),F=T({width:Yi(s,$.value.width,1),height:Yi(a,$.value.height,1)},Ai);$.reaction(((e,t,n)=>{F.setValue({width:Yi(s,e.width,1),height:Yi(a,e.height,1)},n)})),F.reaction(((e,t,n)=>{n||this.events.emit(Ri.IntrinsicResize,e)}));const Z=A([F,H],(([e,t])=>t?{width:1,height:1}:e),Ai);Z.reaction(((e,t,n)=>{n||this.events.emit(Ri.Resize,e)}));const Y=A([Z,W,P,z],(([e,t,n,i])=>t&&i?{width:i.width/e.width/n.width,height:i.height/e.height/n.height}:e),Ai);Y.reaction(((e,t,n)=>{n||this.events.emit(Ri.VisualResize,e)}));const G=T({x:Yi(c,0,1),y:Yi(u,0,1)},Ai);G.reaction(((e,t,n)=>{n||this.events.emit(Ri.IntrinsicMove,e)}));const X=A([G,F,P,z,W,H],(([e,t,n,i,r,s])=>r&&i?s?{x:(i.x+i.width/2)/n.width-.5,y:(i.y+i.height/2)/n.height-.5}:{x:(i.x+i.width/2)/n.width-t.width/2,y:(i.y+i.height/2)/n.height-t.height/2}:s?{x:0,y:0}:e),Ai);X.reaction(((e,t,n)=>{n||this.events.emit(Ri.Move,e)})),this.titleBar=x||new nr({readonly:B.value,title:D.value,namespace:this.namespace,onDragStart:e=>{var t;return null==(t=this._handleTrackStart)?void 0:t.call(this,e)},onEvent:e=>{if(this._delegateEvents.listeners.length>0)this._delegateEvents.emit(e.type);else switch(e.type){case Vi.Maximize:H.setValue(!H.value);break;case Vi.Minimize:W.setValue(!0);break;case Vi.Close:L.setValue(!1);break;default:console.error("Unsupported titleBar event:",e)}}}),B.reaction((e=>{this.titleBar.setReadonly(e)}));const J=T(C),K=T(M),q=T(S);Fi(this,{prefersColorScheme:k,darkMode:N,containerRect:P,collectorRect:z,title:D,visible:L,readonly:B,resizable:j,draggable:R,fence:O,fixRatio:V,focus:U,zIndex:_,minimized:W,maximized:H,$userContent:J,$userFooter:K,$userStyles:q}),this._state$=Q,this._minSize$=$,this._size$=Z,this._intrinsicSize$=F,this._visualSize$=Y,this._coord$=X,this._intrinsicCoord$=G,this.fixRatio&&this.transform(X.value.x,X.value.y,Z.value.width,Z.value.height,!0),this.$box=this.render()}get darkMode(){return this._darkMode$.value}get state(){return this._state$.value}setState(e,t=!1){switch(e){case Bi.Maximized:this.setMinimized(!1,t),this.setMaximized(!0,t);break;case Bi.Minimized:this.setMinimized(!0,t),this.setMaximized(!1,t);break;default:this.setMinimized(!1,t),this.setMaximized(!1,t)}return this}get minWidth(){return this._minSize$.value.width}get minHeight(){return this._minSize$.value.height}setMinWidth(e,t=!1){return this._minSize$.setValue({width:e,height:this.minHeight},t),this}setMinHeight(e,t=!1){return this._minSize$.setValue({width:this.minWidth,height:e},t),this}get intrinsicWidth(){return this._intrinsicSize$.value.width}get intrinsicHeight(){return this._intrinsicSize$.value.height}resize(e,t,n=!1){return this._intrinsicSize$.setValue({width:e,height:t},n),this}get width(){return this._size$.value.width}get height(){return this._size$.value.height}get absoluteWidth(){return this.width*this.containerRect.width}get absoluteHeight(){return this.height*this.containerRect.height}get visualWidth(){return this._visualSize$.value.width}get visualHeight(){return this._visualSize$.value.height}get intrinsicX(){return this._intrinsicCoord$.value.x}get intrinsicY(){return this._intrinsicCoord$.value.y}move(e,t,n=!1){return this._intrinsicCoord$.setValue({x:e,y:t},n),this}get x(){return this._coord$.value.x}get y(){return this._coord$.value.y}transform(e,t,n,i,r=!1){if(this.fixRatio){const e=this.intrinsicHeight/this.intrinsicWidth*n;t!==this.intrinsicY&&(t-=e-i),i=e}return t<0&&(t=0,i>this.intrinsicHeight&&(i=this.intrinsicHeight)),this._intrinsicCoord$.setValue({x:n>=this.minWidth?e:this.intrinsicX,y:i>=this.minHeight?t:this.intrinsicY},r),this._intrinsicSize$.setValue({width:Yi(n,this.minWidth,1),height:Yi(i,this.minHeight,1)},r),this}mount(e){return e.appendChild(this.render()),this}unmount(){return this.$box&&this.$box.remove(),this}mountContent(e){return this.set$userContent(e),this}unmountContent(){return this.set$userContent(void 0),this}mountFooter(e){return this.set$userFooter(e),this}unmountFooter(){return this.set$userFooter(void 0),this}getUserStyles(){return this.$userStyles}mountStyles(e){let t;return"string"==typeof e?(t=document.createElement("style"),t.textContent=e):t=e,this.set$userStyles(t),this}unmountStyles(){return this.set$userStyles(void 0),this}render(e){if(e){if(e===this.$box)return this.$box;this.$box=e}else{if(this.$box)return this.$box;this.$box=document.createElement("div")}this._renderSideEffect.flushAll(),this.$box.classList.add(this.wrapClassName("box"));const t=(e,t,n,i=er)=>this._renderSideEffect.add((()=>{const r=this.wrapClassName(n);return t.subscribe((t=>{e.classList.toggle(r,i(t))}))}));t(this.$box,this._readonly$,"readonly"),t(this.$box,this._draggable$,"no-drag",tr),t(this.$box,this._resizable$,"no-resize",tr),t(this.$box,this._focus$,"blur",tr),t(this.$box,this._darkMode$,"color-scheme-dark"),t(this.$box,this._darkMode$,"color-scheme-light",tr),this._renderSideEffect.add((()=>{const e=this.wrapClassName("minimized"),t=this.wrapClassName("maximized"),n="box-maximized-timer";return this._state$.subscribe((i=>{this.$box.classList.toggle(e,i===Bi.Minimized),i===Bi.Maximized?(this._renderSideEffect.flush(n),this.$box.classList.toggle(t,!0)):this._renderSideEffect.setTimeout((()=>{this.$box.classList.toggle(t,!1)}),0,n)}))})),this._renderSideEffect.add((()=>this._visible$.subscribe((e=>{this.$box.style.display=e?"block":"none"})))),this._renderSideEffect.add((()=>this._zIndex$.subscribe((e=>{this.$box.style.zIndex=String(e)}))));const n=Ei(this.$box);this.$box.dataset.teleBoxID=this.id,this.$box.style.width=this.absoluteWidth+"px",this.$box.style.height=this.absoluteHeight+"px";const i=this.x*this.containerRect.width+this.containerRect.x,r=this.y*this.containerRect.height+this.containerRect.y;this.$box.style.transform=`translate(${i-10}px,${r-10}px)`,this._valSideEffectBinder.combine([this._coord$,this._size$,this._minimized$,this._containerRect$,this._collectorRect$],(([e,t,n,i,r])=>{const s=t.width*i.width,a=t.height*i.height;return{width:s,height:a,x:e.x*i.width,y:e.y*i.height,scaleX:n&&r?r.width/s:1,scaleY:n&&r?r.height/a:1}}),Ai).subscribe((e=>{n.set(e)})),n.set({x:i,y:r});const s=document.createElement("div");s.className=this.wrapClassName("box-main"),this.$box.appendChild(s);const a=document.createElement("div");a.className=this.wrapClassName("titlebar-wrap"),a.appendChild(this.titleBar.render()),this.$titleBar=a;const o=document.createElement("div");o.className=this.wrapClassName("content-wrap");const l=document.createElement("div");l.className=this.wrapClassName("content")+" tele-fancy-scrollbar",this.$content=l,this._renderSideEffect.add((()=>{let e;return this._$userStyles$.subscribe((t=>{e&&e.remove(),e=t,t&&o.appendChild(t)}))})),this._renderSideEffect.add((()=>{let e;return this._$userContent$.subscribe((t=>{e&&e.remove(),e=t,t&&l.appendChild(t)}))})),o.appendChild(l);const c=document.createElement("div");return c.className=this.wrapClassName("footer-wrap"),this.$footer=c,this._renderSideEffect.add((()=>{let e;return this._$userFooter$.subscribe((t=>{e&&e.remove(),e=t,t&&c.appendChild(t)}))})),s.appendChild(a),s.appendChild(o),s.appendChild(c),this._renderResizeHandlers(),this.$box}_renderResizeHandlers(){const e=document.createElement("div");e.className=this.wrapClassName("resize-handles"),Object.values(Ui).forEach((t=>{const n=document.createElement("div");n.className=this.wrapClassName(t)+" "+this.wrapClassName("resize-handle"),n.dataset.teleBoxHandle=t,e.appendChild(n)})),this.$box.appendChild(e);const t="handle-tracking-listener",n=this.wrapClassName("transforming");let i,r,s=0,a=0,o=0,l=0,c=0,u=0;const d=e=>{if(this.state!==Bi.Normal)return;Gi(e);let{pageX:t,pageY:n}=Xi(e);n<0&&(n=0);const i=(t-c)/this.containerRect.width,d=(n-u)/this.containerRect.height;switch(r){case Ui.North:this.transform(this.x,a+d,this.width,l-d);break;case Ui.South:this.transform(this.x,this.y,this.width,l+d);break;case Ui.West:this.transform(s+i,this.y,o-i,this.height);break;case Ui.East:this.transform(this.x,this.y,o+i,this.height);break;case Ui.NorthWest:this.transform(s+i,a+d,o-i,l-d);break;case Ui.NorthEast:this.transform(this.x,a+d,o+i,l-d);break;case Ui.SouthEast:this.transform(this.x,this.y,o+i,l+d);break;case Ui.SouthWest:this.transform(s+i,this.y,o-i,l+d);break;default:if(this.fence)this.move(Yi(s+i,0,1-this.width),Yi(a+d,0,1-this.height));else{const e=20/this.containerRect.width,t=20/this.containerRect.height;this.move(Yi(s+i,e-this.width,1-e),Yi(a+d,0,1-t))}}},h=e=>{r=void 0,i&&(Gi(e),this.$box.classList.toggle(n,!1),this._sideEffect.flush(t),i.remove())},p=e=>{var p;if(this.readonly)return;if(null!=e.button&&0!==e.button)return;if(!this.draggable||r||this.state!==Bi.Normal)return;const f=e.target;if(null==(p=f.dataset)?void 0:p.teleBoxHandle){Gi(e),s=this.x,a=this.y,o=this.width,l=this.height,({pageX:c,pageY:u}=Xi(e)),r=f.dataset.teleBoxHandle,i||(i=document.createElement("div"));const p=r?this.wrapClassName(`cursor-${r}`):"";i.className=this.wrapClassName("track-mask"+(p?` ${p}`:"")),this.$box.appendChild(i),this.$box.classList.add(n),this._sideEffect.add((()=>(window.addEventListener("mousemove",d),window.addEventListener("touchmove",d,{passive:!1}),window.addEventListener("mouseup",h),window.addEventListener("touchend",h,{passive:!1}),window.addEventListener("touchcancel",h,{passive:!1}),()=>{window.removeEventListener("mousemove",d),window.removeEventListener("touchmove",d),window.removeEventListener("mouseup",h),window.removeEventListener("touchend",h),window.removeEventListener("touchcancel",h)})),t)}};this._handleTrackStart=p,this._sideEffect.addEventListener(e,"mousedown",p,{},"box-resizeHandles-mousedown"),this._sideEffect.addEventListener(e,"touchstart",p,{passive:!1},"box-resizeHandles-touchstart")}destroy(){this.$box.remove(),this.events.emit(Ri.Destroyed),this._sideEffect.flushAll(),this._renderSideEffect.flushAll(),this.events.removeAllListeners(),this._delegateEvents.removeAllListeners()}wrapClassName(e){return`${this.namespace}-${e}`}}function rr(){}var sr,ar;class or{constructor({visible:e=!0,readonly:t=!1,darkMode:n=!1,namespace:i="telebox",styles:r={},onClick:s}={}){this.handleCollectorClick=()=>{!this._readonly&&this.onClick&&this.onClick()},this._visible=e,this._readonly=t,this._darkMode=n,this.namespace=i,this.styles=r,this.onClick=s}get visible(){return this._visible}get readonly(){return this._readonly}get darkMode(){return this._darkMode}mount(e){return e.appendChild(this.render()),this}unmount(){return this.$collector&&this.$collector.remove(),this}setVisible(e){return this._visible!==e&&(this._visible=e,this.$collector&&this.$collector.classList.toggle(this.wrapClassName("collector-visible"),e)),this}setReadonly(e){return this._readonly!==e&&(this._readonly=e,this.$collector&&this.$collector.classList.toggle(this.wrapClassName("collector-readonly"),e)),this}setDarkMode(e){return this._darkMode!==e&&(this._darkMode=e,this.$collector&&(this.$collector.classList.toggle(this.wrapClassName("color-scheme-dark"),e),this.$collector.classList.toggle(this.wrapClassName("color-scheme-light"),!e))),this}setStyles(e){if(Object.assign(this.styles,e),this.$collector){const t=this.$collector;Object.keys(e).forEach((n=>{const i=e[n];null!=i&&(t.style[n]=i)}))}return this}render(){return this.$collector||(this.$collector=document.createElement("button"),this.$collector.className=this.wrapClassName("collector"),this.$collector.style.backgroundImage="url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxOCAxNiI+CiAgICA8ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxwYXRoIHN0cm9rZT0iIzdCODhBMCIgc3Ryb2tlLXdpZHRoPSIxLjQiIGQ9Ik0uNyAxLjJoMTYuNnYxMy42SC43eiIgLz4KICAgICAgICA8cGF0aCBmaWxsPSIjN0I4OEEwIiBkPSJNNCA1LjVoNnYxLjRINHpNNCA5LjVoMTB2MS40SDR6IiAvPgogICAgPC9nPgo8L3N2Zz4K')",this.$collector.addEventListener("click",this.handleCollectorClick),this._visible&&this.$collector.classList.add(this.wrapClassName("collector-visible")),this._readonly&&this.$collector.classList.add(this.wrapClassName("collector-readonly")),this.$collector.classList.add(this.wrapClassName(this._darkMode?"color-scheme-dark":"color-scheme-light")),this.setStyles(this.styles)),this.$collector}destroy(){this.$collector&&(this.$collector.removeEventListener("click",this.handleCollectorClick),this.$collector.remove(),this.$collector=void 0),this.onClick=void 0}wrapClassName(e){return`${this.namespace}-${e}`}}(ar=sr||(sr={})).Focused="focused",ar.Blurred="blurred",ar.Created="created",ar.Removed="removed",ar.State="state",ar.Maximized="maximized",ar.Minimized="minimized",ar.Move="move",ar.Resize="resize",ar.IntrinsicMove="intrinsic_move",ar.IntrinsicResize="intrinsic_resize",ar.VisualResize="visual_resize",ar.ZIndex="z_index",ar.PrefersColorScheme="prefers_color_scheme",ar.DarkMode="dark_mode";class lr extends nr{constructor(e){super(e),this.boxes=e.boxes,this.focusedBox=e.focusedBox,this.containerRect=e.containerRect,this.darkMode=e.darkMode}focusBox(e){var t;if(!this.focusedBox||this.focusedBox!==e){if(this.$titles&&this.state===Bi.Maximized){const{children:n}=this.$titles.firstElementChild;for(let i=n.length-1;i>=0;i-=1){const r=n[i],s=null==(t=r.dataset)?void 0:t.teleBoxID;s&&(e&&s===e.id?r.classList.toggle(this.wrapClassName("titles-tab-focus"),!0):this.focusedBox&&s===this.focusedBox.id&&r.classList.toggle(this.wrapClassName("titles-tab-focus"),!1))}}this.focusedBox=e}}setContainerRect(e){if(this.containerRect=e,this.$titleBar){const{x:t,y:n,width:i}=e;this.$titleBar.style.transform=`translate(${t}px, ${n}px)`,this.$titleBar.style.width=i+"px"}}setBoxes(e){this.boxes=e,this.updateTitles()}setState(e){super.setState(e),this.$titleBar&&this.$titleBar.classList.toggle(this.wrapClassName("max-titlebar-maximized"),e===Bi.Maximized),this.updateTitles()}setReadonly(e){super.setReadonly(e),this.$titleBar&&this.$titleBar.classList.toggle(this.wrapClassName("readonly"),this.readonly)}setDarkMode(e){e!==this.darkMode&&(this.darkMode=e,this.$titleBar&&(this.$titleBar.classList.toggle(this.wrapClassName("color-scheme-dark"),e),this.$titleBar.classList.toggle(this.wrapClassName("color-scheme-light"),!e)))}render(){const e=super.render(),{x:t,y:n,width:i}=this.containerRect;e.style.transform=`translate(${t}px, ${n}px)`,e.style.width=i+"px",e.classList.add(this.wrapClassName("max-titlebar")),e.classList.toggle(this.wrapClassName("max-titlebar-maximized"),this.state===Bi.Maximized),e.classList.toggle(this.wrapClassName("readonly"),this.readonly),e.classList.add(this.wrapClassName(this.darkMode?"color-scheme-dark":"color-scheme-light"));const r=document.createElement("div");return r.classList.add(this.wrapClassName("titles-area")),e.insertBefore(r,e.firstElementChild),this.updateTitles(),e}destroy(){super.destroy(),this.$titles=void 0,this.boxes.length=0,this.focusedBox=void 0}updateTitles(){this.$titleBar&&this.state===Bi.Maximized&&(this.$titleBar.classList.toggle(this.wrapClassName("max-titlebar-single-title"),1===this.boxes.length),1===this.boxes.length?this.setTitle(this.boxes[0].title):this.$titleBar.replaceChild(this.renderTitles(),this.$titleBar.firstElementChild))}renderTitles(){this.$titles=document.createElement("div"),this.$titles.className=this.wrapClassName("titles"),this.$titles.addEventListener("wheel",(e=>{e.currentTarget.scrollBy({left:e.deltaY>0?250:-250,behavior:"smooth"})}),{passive:!1});const e=document.createElement("div");return e.className=this.wrapClassName("titles-content"),this.$titles.appendChild(e),this.boxes.forEach((t=>{const n=document.createElement("button");n.className=this.wrapClassName("titles-tab"),n.textContent=t.title,n.dataset.teleBoxID=t.id,n.dataset.teleTitleBarNoDblClick="true",this.focusedBox&&t.id===this.focusedBox.id&&n.classList.add(this.wrapClassName("titles-tab-focus")),e.appendChild(n)})),this.$titles}}class cr{constructor({root:e=document.body,prefersColorScheme:t=Di.Light,minimized:n=!1,maximized:i=!1,fence:r=!0,containerRect:s={x:0,y:0,width:window.innerWidth,height:window.innerHeight},collector:a,namespace:o="telebox",readonly:l=!1}={}){this.events=new rn,this._sideEffect=new zi;const{combine:c,createVal:u}=Zi(this._sideEffect);this.root=e,this.namespace=o,this.boxes$=u([]),this.topBox$=this.boxes$.derive((e=>{if(e.length>0)return e.reduce(((e,t)=>e.zIndex>t.zIndex?e:t))}));const d=window.matchMedia("(prefers-color-scheme: dark)"),h=u(!1);d&&(h.setValue(d.matches),this._sideEffect.add((()=>{const e=e=>{h.setValue(e.matches)};return d.addListener(e),()=>d.removeListener(e)})));const p=u(t);p.reaction(((e,t,n)=>{this.boxes.forEach((t=>t.setPrefersColorScheme(e,n))),n||this.events.emit(sr.PrefersColorScheme,e)})),this._darkMode$=c([h,p],(([e,t])=>"auto"===t?e:"dark"===t)),this._darkMode$.reaction(((e,t,n)=>{this.boxes.forEach((t=>t.setDarkMode(e,n))),n||this.events.emit(sr.DarkMode,e)}));const f=u(l);f.reaction(((e,t,n)=>{this.boxes.forEach((t=>t.setReadonly(e,n)))}));const g=u(n),m=u(i);m.reaction(((e,t,n)=>{this.boxes.forEach((t=>t.setMaximized(e,n))),n||this.events.emit(sr.Maximized,e)}));const v=c([g,m],(([e,t])=>e?Bi.Minimized:t?Bi.Maximized:Bi.Normal));v.reaction(((e,t,n)=>{this.maxTitleBar.setState(e),n||this.events.emit(sr.State,e)}));const b=u(r);b.subscribe(((e,t,n)=>{this.boxes.forEach((t=>t.setFence(e,n)))}));const w=u(s,Ai);w.reaction(((e,t,n)=>{this.boxes.forEach((t=>t.setContainerRect(e,n))),this.maxTitleBar.setContainerRect(e)}));const y=u(null===a?null:a||new or({visible:n,readonly:l,namespace:o}).mount(e));y.subscribe((e=>{e&&(e.setVisible(g.value),e.setReadonly(f.value),e.setDarkMode(this._darkMode$.value),this._sideEffect.add((()=>(e.onClick=()=>{f.value||g.setValue(!1)},()=>e.destroy())),"collect-onClick"))})),f.subscribe((e=>{var t;return null==(t=y.value)?void 0:t.setReadonly(e)})),this._darkMode$.subscribe((e=>{var t;null==(t=y.value)||t.setDarkMode(e)}));const x=()=>{var e;if(null==(e=y.value)?void 0:e.$collector){const{x:e,y:t,width:n,height:i}=y.value.$collector.getBoundingClientRect(),r=this.root.getBoundingClientRect();return{x:e-r.x,y:t-r.y,width:n,height:i}}},C=u(g.value?x():void 0);C.subscribe(((e,t,n)=>{this.boxes.forEach((t=>{t.setCollectorRect(e,n)}))})),g.subscribe(((e,t,n)=>{var i,r;null==(i=y.value)||i.setVisible(e),e&&(null==(r=y.value)?void 0:r.$collector)&&C.setValue(x()),this.boxes.forEach((t=>t.setMinimized(e,n))),n||this.events.emit(sr.Minimized,e)}));const M=this.wrapClassName("titlebar-icon-close"),S=e=>{var t;if(f.value)return;const n=e.target;if(n.tagName)for(let i=n;i;i=i.parentElement){if(i.classList&&i.classList.contains(M))return;const e=null==(t=i.dataset)?void 0:t.teleBoxID;if(e){const t=this.getBox(e);if(t)return this.focusBox(t),void this.makeBoxTop(t)}}};this._sideEffect.addEventListener(window,"mousedown",S,!0),this._sideEffect.addEventListener(window,"touchstart",S,!0),this.maxTitleBar=new lr({darkMode:this.darkMode,readonly:f.value,namespace:this.namespace,state:v.value,boxes:this.boxes$.value,containerRect:w.value,onEvent:e=>{switch(e.type){case Vi.Maximize:m.setValue(!m.value);break;case Vi.Minimize:g.setValue(!0);break;case Ri.Close:this.removeTopBox(),this.focusTopBox()}}}),f.subscribe((e=>this.maxTitleBar.setReadonly(e))),this._darkMode$.subscribe((e=>{this.maxTitleBar.setDarkMode(e)})),this.boxes$.reaction((e=>{this.maxTitleBar.setBoxes(e)})),Fi(this,{prefersColorScheme:p,containerRect:w,collector:y,collectorRect:C,readonly:f,fence:b,minimized:g,maximized:m}),this._state$=v,this.root.appendChild(this.maxTitleBar.render())}get boxes(){return this.boxes$.value}get topBox(){return this.topBox$.value}get darkMode(){return this._darkMode$.value}get state(){return this._state$.value}setState(e,t=!1){switch(e){case Bi.Maximized:this.setMinimized(!1,t),this.setMaximized(!0,t);break;case Bi.Minimized:this.setMinimized(!0,t),this.setMaximized(!1,t);break;default:this.setMinimized(!1,t),this.setMaximized(!1,t)}return this}create(e={},t=!0){const n=new ir(tn(en({zIndex:this.topBox?this.topBox.zIndex+1:100},t?this.smartPosition(e):e),{darkMode:this.darkMode,prefersColorScheme:this.prefersColorScheme,maximized:this.maximized,minimized:this.minimized,fence:this.fence,namespace:this.namespace,containerRect:this.containerRect,readonly:this.readonly,collectorRect:this.collectorRect}));return n.mount(this.root),n.focus&&(this.focusBox(n),t&&this.makeBoxTop(n)),this.boxes$.setValue([...this.boxes,n]),n._delegateEvents.on(Vi.Maximize,(()=>{this.setMaximized(!this.maximized)})),n._delegateEvents.on(Vi.Minimize,(()=>{this.setMinimized(!0)})),n._delegateEvents.on(Vi.Close,(()=>{this.remove(n),this.focusTopBox()})),n._coord$.reaction(((e,t,i)=>{i||this.events.emit(sr.Move,n)})),n._size$.reaction(((e,t,i)=>{i||this.events.emit(sr.Resize,n)})),n._intrinsicCoord$.reaction(((e,t,i)=>{i||this.events.emit(sr.IntrinsicMove,n)})),n._intrinsicSize$.reaction(((e,t,i)=>{i||this.events.emit(sr.IntrinsicResize,n)})),n._visualSize$.reaction(((e,t,i)=>{i||this.events.emit(sr.VisualResize,n)})),n._zIndex$.reaction(((e,t,i)=>{if(this.boxes.length>0){const e=this.boxes.reduce(((e,t)=>e.zIndex>t.zIndex?e:t));this.topBox$.setValue(e)}i||this.events.emit(sr.ZIndex,n)})),this.events.emit(sr.Created,n),n}query(e){return e?this.boxes.filter(this.teleBoxMatcher(e)):[...this.boxes]}queryOne(e){return e?this.boxes.find(this.teleBoxMatcher(e)):this.boxes[0]}update(e,t,n=!1){const i=this.boxes.find((t=>t.id===e));if(i)return this.updateBox(i,t,n)}updateAll(e,t=!1){this.boxes.forEach((n=>{this.updateBox(n,e,t)}))}remove(e,t=!1){const n=this.getBoxIndex(e);if(n>=0){const e=this.boxes.slice(),i=e.splice(n,1);return this.boxes$.setValue(e),i.forEach((e=>e.destroy())),t||(this.boxes.length<=0&&(this.setMaximized(!1),this.setMinimized(!1)),this.events.emit(sr.Removed,i)),i[0]}}removeTopBox(){if(this.topBox)return this.remove(this.topBox)}removeAll(e=!1){const t=this.boxes$.value;return this.boxes$.setValue([]),t.forEach((e=>e.destroy())),e||(this.boxes.length<=0&&(this.setMaximized(!1),this.setMinimized(!1)),this.events.emit(sr.Removed,t)),t}destroy(e=!1){this.events.removeAllListeners(),this._sideEffect.flushAll(),this.removeAll(e),Object.keys(this).forEach((e=>{const t=this[e];t instanceof $i&&t.destroy()}))}wrapClassName(e){return`${this.namespace}-${e}`}focusBox(e,t=!1){const n=this.getBox(e);n&&(this.boxes.forEach((e=>{if(n===e){let e=!1;n.focus||(e=!0,n.setFocus(!0,t)),e&&!t&&this.events.emit(sr.Focused,n)}else e.focus&&this.blurBox(e,t)})),this.maxTitleBar.focusBox(n))}focusTopBox(){if(this.topBox&&!this.topBox.focus)return this.focusBox(this.topBox)}blurBox(e,t=!1){const n=this.getBox(e);n&&(n.focus&&(n.setFocus(!1,t),t||this.events.emit(sr.Blurred,n)),this.maxTitleBar.focusedBox===n&&this.maxTitleBar.focusBox())}blurAll(e=!1){this.boxes.forEach((t=>{t.focus&&(t.setFocus(!1,e),e||this.events.emit(sr.Blurred,t))})),this.maxTitleBar.focusedBox&&this.maxTitleBar.focusBox()}teleBoxMatcher(e){const t=Object.keys(e);return n=>t.every((t=>e[t]===n[t]))}updateBox(e,t,n=!1){null==t.x&&null==t.y||e.move(null==t.x?e.intrinsicX:t.x,null==t.y?e.intrinsicY:t.y,n),null==t.width&&null==t.height||e.resize(null==t.width?e.intrinsicWidth:t.width,null==t.height?e.intrinsicHeight:t.height,n),null!=t.title&&(e.setTitle(t.title),this.maxTitleBar.updateTitles()),null!=t.visible&&e.setVisible(t.visible,n),null!=t.minHeight&&e.setMinHeight(t.minHeight,n),null!=t.minWidth&&e.setMinWidth(t.minWidth,n),null!=t.resizable&&e.setResizable(t.resizable,n),null!=t.draggable&&e.setDraggable(t.draggable,n),null!=t.fixRatio&&e.setFixRatio(t.fixRatio,n),null!=t.zIndex&&e.setZIndex(t.zIndex,n),null!=t.content&&e.mountContent(t.content),null!=t.footer&&e.mountFooter(t.footer)}smartPosition(e={}){let{x:t,y:n}=e;const{width:i=.5,height:r=.5}=e;if(null==t){let e=20;this.topBox&&(e=this.topBox.intrinsicX*this.containerRect.width+20,e>this.containerRect.width-i*this.containerRect.width&&(e=20)),t=e/this.containerRect.width}if(null==n){let e=20;this.topBox&&(e=this.topBox.intrinsicY*this.containerRect.height+20,e>this.containerRect.height-r*this.containerRect.height&&(e=20)),n=e/this.containerRect.height}return tn(en({},e),{x:t,y:n,width:i,height:r})}makeBoxTop(e,t=!1){this.topBox&&e!==this.topBox&&e.setZIndex(this.topBox.zIndex+1,t)}getBoxIndex(e){return"string"==typeof e?this.boxes.findIndex((t=>t.id===e)):this.boxes.findIndex((t=>t===e))}getBox(e){return"string"==typeof e?this.boxes.find((t=>t.id===e)):e}}class ur{constructor(e,t){this.context=e,this.createTeleBoxManagerConfig=t;const{emitter:n,callbacks:i}=e;this.teleBoxManager=this.setupBoxManager(t),this.teleBoxManager._state$.reaction((e=>{i.emit("boxStateChange",e),n.emit("boxStateChange",e)})),this.teleBoxManager._darkMode$.reaction((e=>{i.emit("darkModeChange",e)})),this.teleBoxManager._prefersColorScheme$.reaction((e=>{i.emit("prefersColorSchemeChange",e)})),this.teleBoxManager.events.on("minimized",(e=>{if(this.context.safeSetAttributes({minimized:e}),e)this.context.cleanFocus(),this.blurAllBox();else{const e=this.getTopBox();e&&(this.context.setAppFocus(e.id),this.focusBox({appId:e.id},!1))}})),this.teleBoxManager.events.on("maximized",(e=>{this.context.safeSetAttributes({maximized:e})})),this.teleBoxManager.events.on("removed",(e=>{e.forEach((e=>{n.emit("close",{appId:e.id})}))})),this.teleBoxManager.events.on("intrinsic_move",p((e=>{n.emit("move",{appId:e.id,x:e.intrinsicX,y:e.intrinsicY})}),50)),this.teleBoxManager.events.on("intrinsic_resize",p((e=>{n.emit("resize",{appId:e.id,width:e.intrinsicWidth,height:e.intrinsicHeight})}),200)),this.teleBoxManager.events.on("focused",(e=>{e&&(this.canOperate?n.emit("focus",{appId:e.id}):this.teleBoxManager.blurBox(e.id))})),this.teleBoxManager.events.on("z_index",(e=>{this.context.updateAppState(e.id,J.ZIndex,e.zIndex)})),n.on("playgroundSizeChange",(()=>this.updateManagerRect())),n.on("updateManagerRect",(()=>this.updateManagerRect()))}get mainView(){return this.context.getMainView()}get canOperate(){return this.context.canOperate()}get boxState(){return this.teleBoxManager.state}get maximized(){return this.teleBoxManager.maximized}get minimized(){return this.teleBoxManager.minimized}get darkMode(){return this.teleBoxManager.darkMode}get prefersColorScheme(){return this.teleBoxManager.prefersColorScheme}get boxSize(){return this.teleBoxManager.boxes.length}createBox(t){var n,i,r;if(!this.teleBoxManager)return;let{minwidth:s=re,minheight:a=se}=null!=(n=t.app.config)?n:{};const{width:o,height:l}=null!=(i=t.app.config)?i:{},c=(null==(r=t.options)?void 0:r.title)||t.appId,u=this.teleBoxManager.containerRect;s>1&&(s/=u.width),a>1&&(a/=u.height);const d={title:c,minWidth:s,minHeight:a,width:o,height:l,id:t.appId};this.teleBoxManager.create(d,t.smartPosition),this.context.emitter.emit(`${t.appId}${e.WindowCreated}`)}setBoxInitState(e){const t=this.teleBoxManager.queryOne({id:e});t&&t.state===Bi.Maximized&&this.context.emitter.emit("resize",{appId:e,x:t.x,y:t.y,width:t.intrinsicWidth,height:t.intrinsicHeight})}setupBoxManager(e){const t=Nb.wrapper?Nb.wrapper:document.body,n=t.getBoundingClientRect(),i={root:t,containerRect:{x:0,y:0,width:n.width,height:n.height},fence:!1,prefersColorScheme:null==e?void 0:e.prefersColorScheme},r=new cr(i);this.teleBoxManager&&this.teleBoxManager.destroy(),this.teleBoxManager=r;const s=(null==e?void 0:e.collectorContainer)||Nb.wrapper;return s&&this.setCollectorContainer(s),r}setCollectorContainer(e){var t;const n=new or({styles:null==(t=this.createTeleBoxManagerConfig)?void 0:t.collectorStyles}).mount(e);this.teleBoxManager.setCollector(n)}getBox(e){return this.teleBoxManager.queryOne({id:e})}closeBox(e,t=!1){return this.teleBoxManager.remove(e,t)}boxIsFocus(e){const t=this.getBox(e);return null==t?void 0:t.focus}getFocusBox(){return this.teleBoxManager.query({focus:!0})[0]}getTopBox(){return this.teleBoxManager.topBox}updateBoxState(e){if(!e)return;const t=this.getBox(e.id);t&&(this.teleBoxManager.update(t.id,{x:e.x,y:e.y,width:e.width||.5,height:e.height||.5,zIndex:e.zIndex},!0),setTimeout((()=>{e.focus&&this.teleBoxManager.focusBox(t.id,!0),null!=e.maximized&&this.teleBoxManager.setMaximized(Boolean(e.maximized),!0),null!=e.minimized&&this.teleBoxManager.setMinimized(Boolean(e.minimized),!0)}),50),this.context.callbacks.emit("boxStateChange",this.teleBoxManager.state))}updateManagerRect(){var e;const t=null==(e=this.mainView.divElement)?void 0:e.getBoundingClientRect();if(t&&t.width>0&&t.height>0){const e={x:0,y:0,width:t.width,height:t.height};this.teleBoxManager.setContainerRect(e),this.context.notifyContainerRectUpdate(this.teleBoxManager.containerRect)}}moveBox({appId:e,x:t,y:n}){this.teleBoxManager.update(e,{x:t,y:n},!0)}focusBox({appId:e},t=!0){this.teleBoxManager.focusBox(e,t)}resizeBox({appId:e,width:t,height:n,skipUpdate:i}){this.teleBoxManager.update(e,{width:t,height:n},i)}setBoxMinSize(e){this.teleBoxManager.update(e.appId,{minWidth:e.minWidth,minHeight:e.minHeight},!0)}setBoxTitle(e){this.teleBoxManager.update(e.appId,{title:e.title},!0)}blurAllBox(){this.teleBoxManager.blurAll()}updateAll(e){this.teleBoxManager.updateAll(e)}setMaximized(e,t=!0){e!==this.maximized&&this.teleBoxManager.setMaximized(e,t)}setMinimized(e,t=!0){this.teleBoxManager.setMinimized(e,t)}focusTopBox(){if(this.teleBoxManager.query().length>=1){const e=this.getTopBox();e&&this.focusBox({appId:e.id},!1)}}updateBox(e,t,n=!0){this.teleBoxManager.update(e,t,n)}setReadonly(e){this.teleBoxManager.setReadonly(e)}setPrefersColorScheme(e){this.teleBoxManager.setPrefersColorScheme(e)}setZIndex(e,t,n=!0){this.teleBoxManager.update(e,{zIndex:t},n)}destroy(){this.teleBoxManager.destroy()}}function dr(){}function hr(e){return e()}function pr(){return Object.create(null)}function fr(e){e.forEach(hr)}function gr(e){return"function"==typeof e}function mr(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}let vr,br;function wr(e,t){return vr||(vr=document.createElement("a")),vr.href=t,e===vr.href}function yr(e,t){e.appendChild(t)}function xr(e,t,n){e.insertBefore(t,n||null)}function Cr(e){e.parentNode.removeChild(e)}function Mr(e){return document.createElement(e)}function Sr(e){return document.createTextNode(e)}function Ir(){return Sr(" ")}function Er(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function Ar(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function Tr(e,t,n,i){e.style.setProperty(t,n,i?"important":"")}function kr(e){br=e}const Nr=[],Pr=[],zr=[],Dr=[],Lr=Promise.resolve();let Br=!1;function jr(e){zr.push(e)}let Rr=!1;const Or=new Set;function Vr(){if(!Rr){Rr=!0;do{for(let e=0;e<Nr.length;e+=1){const t=Nr[e];kr(t),_r(t.$$)}for(kr(null),Nr.length=0;Pr.length;)Pr.pop()();for(let e=0;e<zr.length;e+=1){const t=zr[e];Or.has(t)||(Or.add(t),t())}zr.length=0}while(Nr.length);for(;Dr.length;)Dr.pop()();Br=!1,Rr=!1,Or.clear()}}function _r(e){if(null!==e.fragment){e.update(),fr(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(jr)}}const Ur=new Set;function Wr(e,t){-1===e.$$.dirty[0]&&(Nr.push(e),Br||(Br=!0,Lr.then(Vr)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function Hr(e,t,n,i,r,s,a,o=[-1]){const l=br;kr(e);const c=e.$$={fragment:null,ctx:null,props:s,update:dr,not_equal:r,bound:pr(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(l?l.$$.context:t.context||[]),callbacks:pr(),dirty:o,skip_bound:!1,root:t.target||l.$$.root};a&&a(c.root);let u=!1;if(c.ctx=n?n(e,t.props||{},((t,n,...i)=>{const s=i.length?i[0]:n;return c.ctx&&r(c.ctx[t],c.ctx[t]=s)&&(!c.skip_bound&&c.bound[t]&&c.bound[t](s),u&&Wr(e,t)),n})):[],c.update(),u=!0,fr(c.before_update),c.fragment=!!i&&i(c.ctx),t.target){if(t.hydrate){const e=(p=t.target,Array.from(p.childNodes));c.fragment&&c.fragment.l(e),e.forEach(Cr)}else c.fragment&&c.fragment.c();t.intro&&((d=e.$$.fragment)&&d.i&&(Ur.delete(d),d.i(h))),function(e,t,n,i){const{fragment:r,on_mount:s,on_destroy:a,after_update:o}=e.$$;r&&r.m(t,n),i||jr((()=>{const t=s.map(hr).filter(gr);a?a.push(...t):fr(t),e.$$.on_mount=[]})),o.forEach(jr)}(e,t.target,t.anchor,t.customElement),Vr()}var d,h,p;kr(l)}function Qr(e){let t,n,i,r,s,a,o=e[14]&&$r(e),l=e[15]&&Fr(e);return{c(){t=Mr("div"),n=Mr("div"),o&&o.c(),i=Ir(),r=Mr("span"),s=Sr(e[0]),a=Ir(),l&&l.c(),Tr(r,"overflow","hidden"),Tr(r,"white-space","nowrap"),Tr(r,"text-overflow","ellipsis"),Tr(r,"max-width","80px"),Er(n,"class",e[8]),Tr(n,"background-color",e[2]),Tr(n,"color",e[9]),Tr(n,"opacity",e[11]),Er(t,"class","netless-window-manager-cursor-name")},m(e,c){xr(e,t,c),yr(t,n),o&&o.m(n,null),yr(n,i),yr(n,r),yr(r,s),yr(n,a),l&&l.m(n,null)},p(e,t){e[14]?o?o.p(e,t):(o=$r(e),o.c(),o.m(n,i)):o&&(o.d(1),o=null),1&t&&Ar(s,e[0]),e[15]?l?l.p(e,t):(l=Fr(e),l.c(),l.m(n,null)):l&&(l.d(1),l=null),256&t&&Er(n,"class",e[8]),4&t&&Tr(n,"background-color",e[2]),512&t&&Tr(n,"color",e[9]),2048&t&&Tr(n,"opacity",e[11])},d(e){e&&Cr(t),o&&o.d(),l&&l.d()}}}function $r(e){let t,n;return{c(){t=Mr("img"),Er(t,"class","netless-window-manager-cursor-selector-avatar"),Er(t,"style",e[16]()),wr(t.src,n=e[7])||Er(t,"src",n),Er(t,"alt","avatar")},m(e,n){xr(e,t,n)},p(e,i){128&i&&!wr(t.src,n=e[7])&&Er(t,"src",n)},d(e){e&&Cr(t)}}}function Fr(e){let t,n;return{c(){t=Mr("span"),n=Sr(e[1]),Er(t,"class","netless-window-manager-cursor-tag-name"),Tr(t,"background-color",e[10])},m(e,i){xr(e,t,i),yr(t,n)},p(e,i){2&i&&Ar(n,e[1]),1024&i&&Tr(t,"background-color",e[10])},d(e){e&&Cr(t)}}}function Zr(e){let t,n,i,r,s,a,o=!e[12]&&Qr(e);return{c(){t=Mr("div"),o&&o.c(),n=Ir(),i=Mr("div"),r=Mr("img"),Er(r,"class",s="netless-window-manager-cursor-"+e[3]+"-image"),wr(r.src,a=e[6])||Er(r,"src",a),Er(r,"alt",e[3]),Er(i,"class","cursor-image-wrapper"),Er(t,"class","netless-window-manager-cursor-mid"),Tr(t,"transform","translateX("+e[4]+"px) translateY("+e[5]+"px)"),Tr(t,"display",e[13])},m(e,s){xr(e,t,s),o&&o.m(t,null),yr(t,n),yr(t,i),yr(i,r)},p(e,[i]){e[12]?o&&(o.d(1),o=null):o?o.p(e,i):(o=Qr(e),o.c(),o.m(t,n)),8&i&&s!==(s="netless-window-manager-cursor-"+e[3]+"-image")&&Er(r,"class",s),64&i&&!wr(r.src,a=e[6])&&Er(r,"src",a),8&i&&Er(r,"alt",e[3]),48&i&&Tr(t,"transform","translateX("+e[4]+"px) translateY("+e[5]+"px)"),8192&i&&Tr(t,"display",e[13])},i:dr,o:dr,d(e){e&&Cr(t),o&&o.d()}}}function Yr(e,t,n){let i,r,s,a,o,{cursorName:l}=t,{tagName:c}=t,{backgroundColor:u}=t,{appliance:d}=t,{x:h}=t,{y:p}=t,{src:f}=t,{visible:g}=t,{avatar:m}=t,{theme:v}=t,{color:b}=t,{cursorTagBackgroundColor:w}=t,{opacity:y}=t;return e.$$set=e=>{"cursorName"in e&&n(0,l=e.cursorName),"tagName"in e&&n(1,c=e.tagName),"backgroundColor"in e&&n(2,u=e.backgroundColor),"appliance"in e&&n(3,d=e.appliance),"x"in e&&n(4,h=e.x),"y"in e&&n(5,p=e.y),"src"in e&&n(6,f=e.src),"visible"in e&&n(17,g=e.visible),"avatar"in e&&n(7,m=e.avatar),"theme"in e&&n(8,v=e.theme),"color"in e&&n(9,b=e.color),"cursorTagBackgroundColor"in e&&n(10,w=e.cursorTagBackgroundColor),"opacity"in e&&n(11,y=e.opacity)},e.$$.update=()=>{1&e.$$.dirty&&(i=!M(l)),2&e.$$.dirty&&n(15,r=!M(c)),128&e.$$.dirty&&n(14,s=!M(m)),131072&e.$$.dirty&&n(13,a=g?"initial":"none"),8&e.$$.dirty&&n(12,o=d===W.laserPointer)},[l,c,u,d,h,p,f,m,v,b,w,y,o,a,s,r,()=>Object.entries({width:(i?19:28)+"px",height:(i?19:28)+"px",position:i?"initial":"absolute","border-color":i?"white":u,"margin-right":(i?4:0)+"px"}).map((([e,t])=>`${e}: ${t}`)).join(";"),g]}class Gr extends class{$destroy(){!function(e,t){const n=e.$$;null!==n.fragment&&(fr(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}(this,1),this.$destroy=dr}$on(e,t){const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}{constructor(e){super(),Hr(this,e,Yr,Zr,mr,{cursorName:0,tagName:1,backgroundColor:2,appliance:3,x:4,y:5,src:6,visible:17,avatar:7,theme:8,color:9,cursorTagBackgroundColor:10,opacity:11})}}const Xr={[W.pencil]:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAYISURBVHgB7ZpNSCtXFIBPEuvz+dMGpYUKD/sWFX+Qti6kK7Hqpm6e9q0rIoIUFUShPLV10VZx4+JZqa9v20LBhdq9fyBUCtKNPH8qYl2IOw3G38Rkek4y15y5uTOZJDOWggcOSSYzN/ebc+45554JwIM8iBCPyTEP+86T4vyMfsRN4b+nQTKIJp0vzuGvlpID7os8EQNEIBD4oKio6Bm9DwaDv/v9/n/076JgbtWUYPchwrW8qD7UnOvr6wFNkpubm+/wu7f0c7y6mrnlvQufxB0Iau7V1dX3BDA/P6/V1dVpzc3N2uLiIofK1c8VYHys/wRKBUN3/hGHqaysNOjc3FwMis6hc0FtLTHuvYLxCCZgci8uLn4wg5Gh6Fy8Jk+/NkcCAlAAuUkoW4g0B+d5tLS05O/r67O8eGxsDNra2uDy8nKsoKCAwCIQDxQa0yTxgrvCYXyTk5Ml+Orf2dlJeeHIyAigFSE/P38ELfUNqNdSkjgF5FF89jL1TU1NlQwODl5gZPujp6cHWltbUw7Koc7Pz8mkZpHPFeFrJuZeqLnoMoPoZqe0JjDP/IZgnyLUG/o8NDRkuo5Ua2pjY6MC4oFCFf1cA0oKzRSOp6enRfTaGh0d/QxBt+1CUVgnOTs7+xrHfQzGyOcKkK3QTJMnQffZ6e/v/xwttmsHqqmpKXbdycnJCxy7ABLh3FEgVZ6hZJhnFZoFFMF0d3c/w7v+dyookXBnZ2c/xvHfhriVcvXfdBRItsxjnOhYqjwjoAimq6vrCysoGofk+Ph4Esd/F/UdiFtJAGUd2DygTpp5dmBUUJ2dnc9VUALm8PDwJY7/BPU9VD8k3M4RC6kskxZMKigKIMLN9vf3p3H8DyWgfEhEOwOQD9IXOTz7EObbwsLC4YWFBRgeHrY9ECXYo6MjaGlpKWlsbPxkYGDgRW1tbSEWquVlZWXBzc3Nl1VVVa8hXiXc6ioqBqGaPDk7AACJTRZ3NS9lcUp86cJwoSQ7Pj4Op6enfxUXF3/V0NCQv7q6GsCvwrqGUG/01xAD4+VQTOxaSF43d5bBOisrGBJRCtXX17+/trb268rKSgASFgmz97KFkmo6OztWuVyPweiWGc4WRkhFRQVEIpHg8vJyQAIQVlLBROVxvBYQHsXnO8tk62ZcyN0wecLBwcEvYHSzEPscBqOLCRhLC4n9uqaA8UAWAcAKhtbQ3t7eTHl5+Y9gtAp3twhT056CDMQ7MRzIFTeTYKb1yYYVQFH9VdzsqNmYKpfTJBDX3Ixgdnd3XyHMT2AMALJlBBSPaMpNngrIsTyTCgaj288YDGakictrxizvKFNOjgSSBLS+vv6UYHDb7DgMVgsChjTEgCIKGG4ZU+EWkgNBzN1qamq+pAMTExPgFMzW1tZrhHkFyWE5KxgSszx0527RaDRmOSpRshEOU11dPQPG8CwHARHJlMnTSrwSRFIlfXt7m3V5ngJGuJtqzaQtZkFBVNJezN5ZAdmwjKo2k9tVtrcI3OXk4tPgcg7ChCDZ1URgMOu72Xa5VFHOkymQhWVU60YVmjN6wiC7k6p+S1syCACOwJBYFaexV+yhBekNPsMBO6KAEeE4BMaCU67RsoYhSbXgaT//ht709vZCaWmp6YkEbLFmVJWzas04+iBL7EKpm0J7duqu0B7+CTUpNJuyvb1NCfMj1CqI9wLKUOlOUMeG+gGFkHii4HizUF4z/KFUrPsJ8WbEIyx7nnZ0dDynME6BAuce09iFHo+GrnmGltltb2//E4wVAN82y7vOjKOZXSBhJdHNiT3TYWD8OY2PTUJkdd7MkJMnT5wZVQF2RFX6yBMUdzPMvvfqxz3sXHF+GNT9ANXit/10O1sgHkZvdQAOKvs9B5L7ARELGAAXLSTvM8QExTE+YbHe+HURhZp1aRyF4CJXClbbWwGketgkW9VsY+YaiBCVhfgE+XvxRwgZSM4jUVCDZFQ9pytmXR8hUTB2gnidx4XffVWydN0yQjwmx/jkAZJBrIBI5J7ZvQGZWUgVSuU/EqmOAzicKNMVu816DdRWUV1/7xAP8n+SfwF3Du3NF2sYhwAAAABJRU5ErkJggg==",[W.selector]:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADEAAAAxCAYAAABznEEcAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAZoSURBVHgB7VlLSCRXFL3ljNEhEXTGhMQJmOjCz8ZNVLKICz9xIYhCNi7UgINkGEk2En8hW5cBUQNxo05GAoKikuCAmvGzGMdPcCUGjDPxD/4Vv/3JvWW97luvq7ur+hMZ8MKlqrteNfe8e965970GuLVbC5kpJr53+hjHx9yY3TUxJgLMAQG4ITARfp5T4Mri4uL9q6urnxwOxz/oY5eXl1/Pzs7e195X2FX4jZsIhAK7gx5ps9m6nGj9/f3OtbU1pzAE0318fPwVjYHrrN7R3AjU/wpOBwA9Cmf/9ejoqDMtLU31iooKGdA+ATo4OMiXAEWAHhBAGEApXj4rPAik0vPt7e0vCgoKPH4gMzMTSktLIS8vD2JiYgABvcHMTZyennbHxsaOg3udOJmLzwqEYB0ZgRCZENm4u7e39yQuLq65srISZmZmvP5Ybm4u5OfnQ0lJyXWUCAgzNLS+vt6SnJz8WgvYwV5xSlcRgyVg3ha2Dkxzc3MvfZmVlQW+bGxsDBobGyE7O1u94uJPjIqKqklKSvrbbrfPnp+ff7e8vJwMnlSTKWfJjDKhywJo6wLp0YcZ+dyIUr7s4cOHLsrRlQwBTSBFuzc2NiZYhjjVAIyzZBqEwgCQv0OOM/gNzuiP/ijlDxBRjgClpqa6AF1cXDydmpoaLCws3JcAGYHyC4JMzoKaibKysvienp6FtrY2IA/WCFB5ebkqCHSvARo8Ozt7igIxwIJ2gJ+seFMnDoIyEUV+dHT0G3qWVUr5M043DdAB0m2IKZwAYpgZX+qkywR6NFbuR0iDxmAoZRUQKRxSLTMnJ8eIaqqSeVMnIYUOdu+sq6vrp4f+VCoYo8khZaNs01VRlERUu2/BrWAA7sl2Anink1Ao18JGjyY/PDx8hq1GZqgp5c2mp6chMjLy2b179x7hRzvoqeUUwXIzqq4O5nZsNUaEbIbLqPLTou/s7FTvT05OpsA9sXJG1AVsZDwjutqBIN6gUlWjxod8XRBNKXgsrqpqYZfwEqX9h8TExD7wbFm8LmzxHQ0QHSlXKZVSqFC/hkqlaKapTaGgCQTK7PHW1lb/wsLC86KiokkccoV+qV1tcE0pO7AWxmhTxBszDzqRr66ujqanp2cRpQLNBgUsCh8BwQ54bn5+/s+mpqa+4eHhfS1gb52vwuP0trPjhSZCBtLQ0NA3MDDQQIFYAUHBYhuvzjpVbJr1lZWVP3p7e19UVVXNgHumXYrI4uBx6Yqevz02b0FcRQ8CoBQF3dXVpQLZ3d39C7n+ora29vfJyclDYFnWgFyxK3cxhss/+KoT/N6DVkQpKypFGUCp3Ozo6HgSHx//GLW/BwHsg57zl5pzADajwLn52mPL1ZHPloMoRYPMFL6EhAR18e7s7MxVV1fPsAAp4Avteq7dC/c1+wKI4g+EfGzDM+EYHBw8RDrNiA2QL6upqVGvKJ2/gHu2L1nA5wwEB2YDfSYMO1x/px0cgEc2zBY+eo67u6H29vZ/wU2VC8l58JxKNjDOgojNEp08aFVfX++3l6JMEdDx8fEB0FNIBsDXBc8ArwuW1EkeI1RKdLWmCx+1DhkZGRvR0dFfSsHKxYtnW0iqvJAN9xNm6MR/QO5sfapUSkqKmqW5ubmfwVgyZdpw/vPZl2kUEAinBMSUStG+gwra0NDQSynQKyloIxnlewafjDFLJzLRBJqiFMnqyMgIbG5uDuD996Dnv8iAPOMAPmbcm5lVJwA/vZRMKZGZlpaWVtAvUL4GZMqE1fjRJrUd76LHoX+InlhcXPwZnWW2tra6jjrpiBM3UK/weQr6J+gfodMh9HtwncG7YLA3CMSsLmxx5WuDCt8B7vZeicInTjCWlpb6wc15mfey7oc9E8LElpVmMgb9AXoC+qcTExOPKRu4NlTHs6Q10GfhgfYOvRsJQZ76BWMKuDtaolQs+gfoH6Mn436gDg+e+5BKXUQx/C5Je/a+NpbeiQJPKgUdlNXx/BCBKxVdxW5Q0I3XBqFKRhU4KLtjYawi3csuTKdc4FnIXNvKUJkVEGRG20QZAAUpA5DbaYAQLmQzfzxyk/ffdnCD4NWVnGdE7kQBQvQHC5lVEDxgMaM29lkxGCNLKrDnIbFAMkFmBIaDkHstU41coGZ1TZD5UjReCGUAYbNgdNqoXZB/T67yYbFAMiGML3BhYeH8rb0t9h/zgcTBcTNGiQAAAABJRU5ErkJggg==",[W.eraser]:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAgrSURBVHgB7ZprTBRXFIDP7gIt8lQppTwE5V0KaAn6o1pqNGkDDTEmTUhsgKRp+gNJw68CFkLbVC2QkDS+gD8KJdWmARvbFBNNWpuIRGPFWBXQRMPDqIki+KLATs+ZnTvcvXtnX8w2beJJToaduTP3fHPOPffcOwC8kP+2WCDwIvahGFxTuN8KmNSZmULPNjLeqF9F8rdPkIEGEn+r+vjx46LQ0NA8/Dsader58+e/h4WFDWntFO7ot6fMFAt3JLWi2lCDpqamCux2+2+KROj82NhYGrXT2lu5Z/DP/deFByElA4Pv3LlTiHY/nJ6eVnbv3q1s2bJFyc7OVrZu3arU1dUp4+PjxPUQoT+g9tp9PkMFgpo9kxljHRoaWp2Xl3duYmIiurKyEvDoclNCQgIcPnxYPc7MzHwcGRnZhaft4Ag7O9fUbRhaITCie4lgcnNzT7qDIaHz27dvh+vXr0NEREQneqoCHKFnAR+8ZCaQGGq2CxcurCGYycnJZHcwTNAzUFFRoUJFRUV1IFQ5OKBsXB9uxSwgl0TQ3d29Yt26dccwoyVXV1d7hGEiQmGi2AzOUHx/hob4K2yuYS9G987s7OwPISEh7xPM6dOnwVfBsIMjR45AZmbmo5s3b76Xnp7+J55egMVxBSAZT0v1ED+76yn66dOnLQSzd+9ev2BIyFP0MjBco1JTU/sxfFeDazp3cYgZHmKqdoaGNISHh9fv378fSJcqlPV6e3sBJ+I/goOD34VFL0k95Y+HxPHCYGxmw5DQ2NuzZw8EBQVtunXr1jvgwUP+hhz/QDXMMCNVE8zx48dNg2FCz6QQjI2N/RA8VBFmANnu3btXihnpG8pM9fX1EAi5du0aeWkVOAMBCF7yN+R0z4yOjq6NiYlpp9CgdBtIwXpPH6vgDKWLt0CygtM6MDCwBuUYZSKaOCksAiVY9wFOBePgDOOytPAGSKzNVCCC2bBhw69YdK7ypgpYimzbtk2dl7CM+hFcveOUHDylbTFO1YdhFbByx44dA1QFUP0VSJj4+Hjo6+sDq9U6iEmHKvFZTedQ50GYbN15SITVlwNlZWUnLRZL8s6dOwMOQ9UCTtKTra2ttdppt9V2kMF5cbmsjxuM43bMNrmUzc6fP6+GQiDGDoOJi4ubwb4qm5ubafyIE6nLxGqTPEsGo1cBOGNX0TyDYafC0CyOaxcVziyh53Z2dkJycvLMvn37PmpoaBgFR4jxYSbWdVIgI89Iq4CjR48CZjlYv369+tssqI6ODsjPz4f+/v668vLycxrEHHfkYdwC8SB6mGEV8Cl64cuuri5oa2tTG+EyGjZu3AiXLl1qefDgwV8lJSUFZkDV1tZCcXExXLx4sbWoqKgPFj0zx8GI9ZwO5W4M6ekZYeqpaqbqmaSqqkpNpcPDw4dwzfM9nrLduHEjEs+X0XV/Sx96LnqE1kLtBQUF3eDwCO8dGQyzV5rl+JyuegfXI29jRotiRlKnpFghHMzKyjqotVXS0tLacKPjF3bdHxjSq1evduAkepAD+ZsDYlC8V5w8ZBVg+PPq2MGMlkInqE4joTf45MmT4YyMjAPcA+ltLSQlJX2BafxnX6HI29QeK44TOTk57mCYZ0QoJ8OBM4yB6dkNkwGlSygsLFQvYtYB3BTMxFL+M+0eFgZqp4mJiU2+QKGX1fGIk/QIrn0aYXGsyDxjmAyMhO2jhaCGoUbX1NSkLSwsPMJqV8Fspu6lIZS6OYhjiOLwdU7fQM1HfRPD7wS1obZ0j0xpb4726Z49ezaJf2/S7s9ATUGNR41BjdJseRnke3WGwhrRTS9pD1mOGoeG15BxOOfoxuCkp0Ih6NeaEaSZGlieJyiCoc1FgsGldokGk8nBvAKOrWIGQ5uPsm0tt0BWDiicAaGuGhkZ+YqMw9StGzU4OKhCnT179hNsswY1FTXdE5QEJhc1S3tGogazXLOBwQSBl3tzIhQPtAL1VQJCTcNx8y1vHIUghSKFZE9PT7H2dlM1b+Wgrr1y5Uq77J75+fnplpaWMg2ch4nlYEI5z7hdensDpI4hrYNErcMMXJ32koG4ztf3pultz83NjWG99Ra2WQ0OL2VjZjwgeufUqVOqV8+cOdPIwdBLSNJeHg8TAh5WqJ6EfSmgt7IMNRJ1JThiOlnrOAMHshprmMKdoGSCpb9s3B3SYLIFGIqICJB7xisYi+RvfiypXw40DWGdlJaWRmMd141hk8V2OWm7ieYTXhBc3+BgaZyqAISjOYxSMVvXsBTNlzdiNQDgRao2AtK3pjggpmrqbGpqSsLPIN/dv38/gaBwUjTshMHcvn27JyUlpRmc5xpPMD599LIYnLNyUKKndKjGxsakXbt2deMCLIE8IVvs0YRM1fjdu3d/wrXN5+BcnzEgvor2uN3rjzAYMp5lPEoQlE5fA0fWo8GfhlCbKVFQ1pKNIfzcOHH58mWqaimVUwJI0+6n59D4pIlzmdZPMPiZzXjDjX47Le5g0Uu8x2zgPqWyKpjVe7x3+AUbq9NYjQbgp2dsBud5o8TP7d5kHAWcQchQfoEmLgn8HjOiBIF7o5hI1x6CEbLNP3bdqYAF44JzyWLzcN1i8DcT/o3awbm8Fz3DAy2A62INwPV/E3wWdx5inmBHuwChCBD6R2JwHge80TIQRQLjt7e8DTkGZgfX8cUMZTDAteFDkveaIlzjX9ySQs8X18r2t2VHUURPKoICmDR+eCO9aSdmOIub3/w9RgpgUpiJhvraXpa6jZKHGEqyusw0GLFzX+5RhN/8kYnMSNMMfyH/V/kHST6OYVElTPAAAAAASUVORK5CYII=",[W.shape]:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDBweCIgaGVpZ2h0PSI0MHB4IiB2aWV3Qm94PSIwIDAgNDAgNDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDYwLjEgKDg4MTMzKSAtIGh0dHBzOi8vc2tldGNoLmNvbSAtLT4KICAgIDx0aXRsZT5zaGFwZS1jdXJzb3I8L3RpdGxlPgogICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+CiAgICA8ZGVmcz4KICAgICAgICA8cGF0aCBkPSJNMjAsMjEuNSBDMjAuMjQ1NDU5OSwyMS41IDIwLjQ0OTYwODQsMjEuNjc2ODc1MiAyMC40OTE5NDQzLDIxLjkxMDEyNDQgTDIwLjUsMjIgTDIwLjUsMjcgQzIwLjUsMjcuMjc2MTQyNCAyMC4yNzYxNDI0LDI3LjUgMjAsMjcuNSBDMTkuNzU0NTQwMSwyNy41IDE5LjU1MDM5MTYsMjcuMzIzMTI0OCAxOS41MDgwNTU3LDI3LjA4OTg3NTYgTDE5LjUsMjcgTDE5LjUsMjIgQzE5LjUsMjEuNzIzODU3NiAxOS43MjM4NTc2LDIxLjUgMjAsMjEuNSBaIE0yNywxOS41IEMyNy4yNzYxNDI0LDE5LjUgMjcuNSwxOS43MjM4NTc2IDI3LjUsMjAgQzI3LjUsMjAuMjQ1NDU5OSAyNy4zMjMxMjQ4LDIwLjQ0OTYwODQgMjcuMDg5ODc1NiwyMC40OTE5NDQzIEwyNywyMC41IEwyMiwyMC41IEMyMS43MjM4NTc2LDIwLjUgMjEuNSwyMC4yNzYxNDI0IDIxLjUsMjAgQzIxLjUsMTkuNzU0NTQwMSAyMS42NzY4NzUyLDE5LjU1MDM5MTYgMjEuOTEwMTI0NCwxOS41MDgwNTU3IEwyMiwxOS41IEwyNywxOS41IFogTTE4LDE5LjUgQzE4LjI3NjE0MjQsMTkuNSAxOC41LDE5LjcyMzg1NzYgMTguNSwyMCBDMTguNSwyMC4yNDU0NTk5IDE4LjMyMzEyNDgsMjAuNDQ5NjA4NCAxOC4wODk4NzU2LDIwLjQ5MTk0NDMgTDE4LDIwLjUgTDEzLDIwLjUgQzEyLjcyMzg1NzYsMjAuNSAxMi41LDIwLjI3NjE0MjQgMTIuNSwyMCBDMTIuNSwxOS43NTQ1NDAxIDEyLjY3Njg3NTIsMTkuNTUwMzkxNiAxMi45MTAxMjQ0LDE5LjUwODA1NTcgTDEzLDE5LjUgTDE4LDE5LjUgWiBNMjAsMTIuNSBDMjAuMjQ1NDU5OSwxMi41IDIwLjQ0OTYwODQsMTIuNjc2ODc1MiAyMC40OTE5NDQzLDEyLjkxMDEyNDQgTDIwLjUsMTMgTDIwLjUsMTggQzIwLjUsMTguMjc2MTQyNCAyMC4yNzYxNDI0LDE4LjUgMjAsMTguNSBDMTkuNzU0NTQwMSwxOC41IDE5LjU1MDM5MTYsMTguMzIzMTI0OCAxOS41MDgwNTU3LDE4LjA4OTg3NTYgTDE5LjUsMTggTDE5LjUsMTMgQzE5LjUsMTIuNzIzODU3NiAxOS43MjM4NTc2LDEyLjUgMjAsMTIuNSBaIiBpZD0icGF0aC0xIj48L3BhdGg+CiAgICAgICAgPGZpbHRlciB4PSItNjQuNiUiIHk9Ii01OS41JSIgd2lkdGg9IjIyOS4zJSIgaGVpZ2h0PSIyNDYuMSUiIGZpbHRlclVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgaWQ9ImZpbHRlci0yIj4KICAgICAgICAgICAgPGZlTW9ycGhvbG9neSByYWRpdXM9IjEiIG9wZXJhdG9yPSJkaWxhdGUiIGluPSJTb3VyY2VBbHBoYSIgcmVzdWx0PSJzaGFkb3dTcHJlYWRPdXRlcjEiPjwvZmVNb3JwaG9sb2d5PgogICAgICAgICAgICA8ZmVPZmZzZXQgZHg9IjAiIGR5PSIyIiBpbj0ic2hhZG93U3ByZWFkT3V0ZXIxIiByZXN1bHQ9InNoYWRvd09mZnNldE91dGVyMSI+PC9mZU9mZnNldD4KICAgICAgICAgICAgPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iMyIgaW49InNoYWRvd09mZnNldE91dGVyMSIgcmVzdWx0PSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlR2F1c3NpYW5CbHVyPgogICAgICAgICAgICA8ZmVDb21wb3NpdGUgaW49InNoYWRvd0JsdXJPdXRlcjEiIGluMj0iU291cmNlQWxwaGEiIG9wZXJhdG9yPSJvdXQiIHJlc3VsdD0ic2hhZG93Qmx1ck91dGVyMSI+PC9mZUNvbXBvc2l0ZT4KICAgICAgICAgICAgPGZlQ29sb3JNYXRyaXggdmFsdWVzPSIwIDAgMCAwIDAgICAwIDAgMCAwIDAgICAwIDAgMCAwIDAgIDAgMCAwIDAuMTYgMCIgdHlwZT0ibWF0cml4IiBpbj0ic2hhZG93Qmx1ck91dGVyMSI+PC9mZUNvbG9yTWF0cml4PgogICAgICAgIDwvZmlsdGVyPgogICAgPC9kZWZzPgogICAgPGcgaWQ9Iumhtemdoi00IiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iV2hpdGVib2FyZC1HdWlkZWxpbmVzIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMzQ0LjAwMDAwMCwgLTc1MS4wMDAwMDApIj4KICAgICAgICAgICAgPGcgaWQ9InNoYXBlLWN1cnNvciIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMzQ0LjAwMDAwMCwgNzUxLjAwMDAwMCkiPgogICAgICAgICAgICAgICAgPHJlY3QgaWQ9IuefqeW9ouWkh+S7vS00NCIgZmlsbD0iI0ZGRkZGRiIgb3BhY2l0eT0iMC4wMSIgeD0iMCIgeT0iMCIgd2lkdGg9IjQwIiBoZWlnaHQ9IjQwIiByeD0iMiI+PC9yZWN0PgogICAgICAgICAgICAgICAgPGcgaWQ9IuW9oueKtue7k+WQiCIgZmlsbC1ydWxlPSJub256ZXJvIj4KICAgICAgICAgICAgICAgICAgICA8dXNlIGZpbGw9ImJsYWNrIiBmaWxsLW9wYWNpdHk9IjEiIGZpbHRlcj0idXJsKCNmaWx0ZXItMikiIHhsaW5rOmhyZWY9IiNwYXRoLTEiPjwvdXNlPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIHN0cm9rZT0iI0ZGRkZGRiIgc3Ryb2tlLXdpZHRoPSIxIiBkPSJNMjAsMjEgQzIwLjQ4NTQxMDMsMjEgMjAuODk4MDg1LDIxLjM0Nzk5OTMgMjAuOTg5OTQ3OSwyMS44NjU0ODc3IEwyMSwyMiBMMjEsMjcgQzIxLDI3LjU1MjI4NDcgMjAuNTUyMjg0NywyOCAyMCwyOCBDMTkuNTE0NTg5NywyOCAxOS4xMDE5MTUsMjcuNjUyMDAwNyAxOS4wMTAwNTIxLDI3LjEzNDUxMjMgTDE5LDI3IEwxOSwyMiBDMTksMjEuNDQ3NzE1MyAxOS40NDc3MTUzLDIxIDIwLDIxIFogTTI3LDE5IEMyNy41NTIyODQ3LDE5IDI4LDE5LjQ0NzcxNTMgMjgsMjAgQzI4LDIwLjQ4NTQxMDMgMjcuNjUyMDAwNywyMC44OTgwODUgMjcuMTM0NTEyMywyMC45ODk5NDc5IEwyNywyMSBMMjIsMjEgQzIxLjQ0NzcxNTMsMjEgMjEsMjAuNTUyMjg0NyAyMSwyMCBDMjEsMTkuNTE0NTg5NyAyMS4zNDc5OTkzLDE5LjEwMTkxNSAyMS44NjU0ODc3LDE5LjAxMDA1MjEgTDIyLDE5IEwyNywxOSBaIE0xOCwxOSBDMTguNTUyMjg0NywxOSAxOSwxOS40NDc3MTUzIDE5LDIwIEMxOSwyMC40ODU0MTAzIDE4LjY1MjAwMDcsMjAuODk4MDg1IDE4LjEzNDUxMjMsMjAuOTg5OTQ3OSBMMTgsMjEgTDEzLDIxIEMxMi40NDc3MTUzLDIxIDEyLDIwLjU1MjI4NDcgMTIsMjAgQzEyLDE5LjUxNDU4OTcgMTIuMzQ3OTk5MywxOS4xMDE5MTUgMTIuODY1NDg3NywxOS4wMTAwNTIxIEwxMywxOSBMMTgsMTkgWiBNMjAsMTIgQzIwLjQ4NTQxMDMsMTIgMjAuODk4MDg1LDEyLjM0Nzk5OTMgMjAuOTg5OTQ3OSwxMi44NjU0ODc3IEwyMSwxMyBMMjEsMTggQzIxLDE4LjU1MjI4NDcgMjAuNTUyMjg0NywxOSAyMCwxOSBDMTkuNTE0NTg5NywxOSAxOS4xMDE5MTUsMTguNjUyMDAwNyAxOS4wMTAwNTIxLDE4LjEzNDUxMjMgTDE5LDE4IEwxOSwxMyBDMTksMTIuNDQ3NzE1MyAxOS40NDc3MTUzLDEyIDIwLDEyIFoiIGZpbGw9IiMyMTIzMjQiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PC9wYXRoPgogICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICAgICAgPHJlY3QgaWQ9IuefqeW9oiIgZmlsbD0iI0ZGRkZGRiIgeD0iMTguNSIgeT0iMTciIHdpZHRoPSIzIiBoZWlnaHQ9IjYiPjwvcmVjdD4KICAgICAgICAgICAgICAgIDxyZWN0IGlkPSLnn6nlvaIiIGZpbGw9IiNGRkZGRkYiIHg9IjE3IiB5PSIxOC41IiB3aWR0aD0iNiIgaGVpZ2h0PSIzIj48L3JlY3Q+CiAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMjAsMjEuNSBDMjAuMjQ1NDU5OSwyMS41IDIwLjQ0OTYwODQsMjEuNjc2ODc1MiAyMC40OTE5NDQzLDIxLjkxMDEyNDQgTDIwLjUsMjIgTDIwLjUsMjcgQzIwLjUsMjcuMjc2MTQyNCAyMC4yNzYxNDI0LDI3LjUgMjAsMjcuNSBDMTkuNzU0NTQwMSwyNy41IDE5LjU1MDM5MTYsMjcuMzIzMTI0OCAxOS41MDgwNTU3LDI3LjA4OTg3NTYgTDE5LjUsMjcgTDE5LjUsMjIgQzE5LjUsMjEuNzIzODU3NiAxOS43MjM4NTc2LDIxLjUgMjAsMjEuNSBaIE0yNywxOS41IEMyNy4yNzYxNDI0LDE5LjUgMjcuNSwxOS43MjM4NTc2IDI3LjUsMjAgQzI3LjUsMjAuMjQ1NDU5OSAyNy4zMjMxMjQ4LDIwLjQ0OTYwODQgMjcuMDg5ODc1NiwyMC40OTE5NDQzIEwyNywyMC41IEwyMiwyMC41IEMyMS43MjM4NTc2LDIwLjUgMjEuNSwyMC4yNzYxNDI0IDIxLjUsMjAgQzIxLjUsMTkuNzU0NTQwMSAyMS42NzY4NzUyLDE5LjU1MDM5MTYgMjEuOTEwMTI0NCwxOS41MDgwNTU3IEwyMiwxOS41IEwyNywxOS41IFogTTE4LDE5LjUgQzE4LjI3NjE0MjQsMTkuNSAxOC41LDE5LjcyMzg1NzYgMTguNSwyMCBDMTguNSwyMC4yNDU0NTk5IDE4LjMyMzEyNDgsMjAuNDQ5NjA4NCAxOC4wODk4NzU2LDIwLjQ5MTk0NDMgTDE4LDIwLjUgTDEzLDIwLjUgQzEyLjcyMzg1NzYsMjAuNSAxMi41LDIwLjI3NjE0MjQgMTIuNSwyMCBDMTIuNSwxOS43NTQ1NDAxIDEyLjY3Njg3NTIsMTkuNTUwMzkxNiAxMi45MTAxMjQ0LDE5LjUwODA1NTcgTDEzLDE5LjUgTDE4LDE5LjUgWiBNMjAsMTIuNSBDMjAuMjQ1NDU5OSwxMi41IDIwLjQ0OTYwODQsMTIuNjc2ODc1MiAyMC40OTE5NDQzLDEyLjkxMDEyNDQgTDIwLjUsMTMgTDIwLjUsMTggQzIwLjUsMTguMjc2MTQyNCAyMC4yNzYxNDI0LDE4LjUgMjAsMTguNSBDMTkuNzU0NTQwMSwxOC41IDE5LjU1MDM5MTYsMTguMzIzMTI0OCAxOS41MDgwNTU3LDE4LjA4OTg3NTYgTDE5LjUsMTggTDE5LjUsMTMgQzE5LjUsMTIuNzIzODU3NiAxOS43MjM4NTc2LDEyLjUgMjAsMTIuNSBaIiBpZD0i5b2i54q257uT5ZCIIiBmaWxsPSIjMjEyMzI0IiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+",[W.text]:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDdweCIgaGVpZ2h0PSI0MHB4IiB2aWV3Qm94PSIwIDAgNDcgNDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDYwLjEgKDg4MTMzKSAtIGh0dHBzOi8vc2tldGNoLmNvbSAtLT4KICAgIDx0aXRsZT50ZXh0LWN1cnNvcjwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPgogICAgICAgIDxwYXRoIGQ9Ik0xNiwyNi41IEMxNS43MjM4NTc2LDI2LjUgMTUuNSwyNi4yNzYxNDI0IDE1LjUsMjYgQzE1LjUsMjUuNzU0NTQwMSAxNS42NzY4NzUyLDI1LjU1MDM5MTYgMTUuOTEwMTI0NCwyNS41MDgwNTU3IEwxNiwyNS41IEwxOS41LDI1LjUgTDE5LjUsMTQuNSBMMTYsMTQuNSBDMTUuNzIzODU3NiwxNC41IDE1LjUsMTQuMjc2MTQyNCAxNS41LDE0IEMxNS41LDEzLjc1NDU0MDEgMTUuNjc2ODc1MiwxMy41NTAzOTE2IDE1LjkxMDEyNDQsMTMuNTA4MDU1NyBMMTYsMTMuNSBMMjQsMTMuNSBDMjQuMjc2MTQyNCwxMy41IDI0LjUsMTMuNzIzODU3NiAyNC41LDE0IEMyNC41LDE0LjI0NTQ1OTkgMjQuMzIzMTI0OCwxNC40NDk2MDg0IDI0LjA4OTg3NTYsMTQuNDkxOTQ0MyBMMjQsMTQuNSBMMjAuNSwxNC41IEwyMC41LDI1LjUgTDI0LDI1LjUgQzI0LjI3NjE0MjQsMjUuNSAyNC41LDI1LjcyMzg1NzYgMjQuNSwyNiBDMjQuNSwyNi4yNDU0NTk5IDI0LjMyMzEyNDgsMjYuNDQ5NjA4NCAyNC4wODk4NzU2LDI2LjQ5MTk0NDMgTDI0LDI2LjUgTDE2LDI2LjUgWiIgaWQ9InBhdGgtMSI+PC9wYXRoPgogICAgICAgIDxmaWx0ZXIgeD0iLTI4NC4wJSIgeT0iLTgxLjUlIiB3aWR0aD0iNjY4LjElIiBoZWlnaHQ9IjI5My45JSIgZmlsdGVyVW5pdHM9Im9iamVjdEJvdW5kaW5nQm94IiBpZD0iZmlsdGVyLTIiPgogICAgICAgICAgICA8ZmVNb3JwaG9sb2d5IHJhZGl1cz0iMSIgb3BlcmF0b3I9ImRpbGF0ZSIgaW49IlNvdXJjZUFscGhhIiByZXN1bHQ9InNoYWRvd1NwcmVhZE91dGVyMSI+PC9mZU1vcnBob2xvZ3k+CiAgICAgICAgICAgIDxmZU9mZnNldCBkeD0iMCIgZHk9IjIiIGluPSJzaGFkb3dTcHJlYWRPdXRlcjEiIHJlc3VsdD0ic2hhZG93T2Zmc2V0T3V0ZXIxIj48L2ZlT2Zmc2V0PgogICAgICAgICAgICA8ZmVHYXVzc2lhbkJsdXIgc3RkRGV2aWF0aW9uPSIzIiBpbj0ic2hhZG93T2Zmc2V0T3V0ZXIxIiByZXN1bHQ9InNoYWRvd0JsdXJPdXRlcjEiPjwvZmVHYXVzc2lhbkJsdXI+CiAgICAgICAgICAgIDxmZUNvbXBvc2l0ZSBpbj0ic2hhZG93Qmx1ck91dGVyMSIgaW4yPSJTb3VyY2VBbHBoYSIgb3BlcmF0b3I9Im91dCIgcmVzdWx0PSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlQ29tcG9zaXRlPgogICAgICAgICAgICA8ZmVDb2xvck1hdHJpeCB2YWx1ZXM9IjAgMCAwIDAgMCAgIDAgMCAwIDAgMCAgIDAgMCAwIDAgMCAgMCAwIDAgMC4xNiAwIiB0eXBlPSJtYXRyaXgiIGluPSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlQ29sb3JNYXRyaXg+CiAgICAgICAgPC9maWx0ZXI+CiAgICA8L2RlZnM+CiAgICA8ZyBpZD0i6aG16Z2iLTQiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSJXaGl0ZWJvYXJkLUd1aWRlbGluZXMiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0zODguMDAwMDAwLCAtNjcyLjAwMDAwMCkiPgogICAgICAgICAgICA8ZyBpZD0idGV4dC1jdXJzb3IiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDM5Mi4wMDAwMDAsIDY3Mi4wMDAwMDApIj4KICAgICAgICAgICAgICAgIDxyZWN0IGlkPSLnn6nlvaLlpIfku70tNDAiIGZpbGw9IiNGRkZGRkYiIG9wYWNpdHk9IjAuMDEiIHg9IjAiIHk9IjAiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgcng9IjIiPjwvcmVjdD4KICAgICAgICAgICAgICAgIDxnIGlkPSLlvaLnirbnu5PlkIgiIGZpbGwtcnVsZT0ibm9uemVybyI+CiAgICAgICAgICAgICAgICAgICAgPHVzZSBmaWxsPSJibGFjayIgZmlsbC1vcGFjaXR5PSIxIiBmaWx0ZXI9InVybCgjZmlsdGVyLTIpIiB4bGluazpocmVmPSIjcGF0aC0xIj48L3VzZT4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBzdHJva2U9IiNGRkZGRkYiIHN0cm9rZS13aWR0aD0iMSIgZD0iTTE5LDI1IEwxOSwxNSBMMTYsMTUgQzE1LjQ0NzcxNTMsMTUgMTUsMTQuNTUyMjg0NyAxNSwxNCBDMTUsMTMuNTE0NTg5NyAxNS4zNDc5OTkzLDEzLjEwMTkxNSAxNS44NjU0ODc3LDEzLjAxMDA1MjEgTDE2LDEzIEwyNCwxMyBDMjQuNTUyMjg0NywxMyAyNSwxMy40NDc3MTUzIDI1LDE0IEMyNSwxNC40ODU0MTAzIDI0LjY1MjAwMDcsMTQuODk4MDg1IDI0LjEzNDUxMjMsMTQuOTg5OTQ3OSBMMjQsMTUgTDIxLDE1IEwyMSwyNSBMMjQsMjUgQzI0LjU1MjI4NDcsMjUgMjUsMjUuNDQ3NzE1MyAyNSwyNiBDMjUsMjYuNDg1NDEwMyAyNC42NTIwMDA3LDI2Ljg5ODA4NSAyNC4xMzQ1MTIzLDI2Ljk4OTk0NzkgTDI0LDI3IEwxNiwyNyBDMTUuNDQ3NzE1MywyNyAxNSwyNi41NTIyODQ3IDE1LDI2IEMxNSwyNS41MTQ1ODk3IDE1LjM0Nzk5OTMsMjUuMTAxOTE1IDE1Ljg2NTQ4NzcsMjUuMDEwMDUyMSBMMTYsMjUgTDE5LDI1IFoiIGZpbGw9IiMyMTIzMjQiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PC9wYXRoPgogICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICA8L2c+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4=",[W.laserPointer]:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjhweCIgaGVpZ2h0PSIyOHB4IiB2aWV3Qm94PSIwIDAgMjggMjgiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDU1LjEgKDc4MTM2KSAtIGh0dHBzOi8vc2tldGNoYXBwLmNvbSAtLT4KICAgIDx0aXRsZT7nvJbnu4QgMjwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPgogICAgICAgIDxmaWx0ZXIgeD0iLTEyMC4wJSIgeT0iLTEyMC4wJSIgd2lkdGg9IjM0MC4wJSIgaGVpZ2h0PSIzNDAuMCUiIGZpbHRlclVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgaWQ9ImZpbHRlci0xIj4KICAgICAgICAgICAgPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iNCIgaW49IlNvdXJjZUdyYXBoaWMiPjwvZmVHYXVzc2lhbkJsdXI+CiAgICAgICAgPC9maWx0ZXI+CiAgICA8L2RlZnM+CiAgICA8ZyBpZD0i6aG16Z2iMSIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPGcgaWQ9Iue8lue7hC0yIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg5LjAwMDAwMCwgOS4wMDAwMDApIiBmaWxsPSIjRkYwMTAwIj4KICAgICAgICAgICAgPGNpcmNsZSBpZD0i5qSt5ZyG5b2iIiBmaWx0ZXI9InVybCgjZmlsdGVyLTEpIiBjeD0iNSIgY3k9IjUiIHI9IjUiPjwvY2lyY2xlPgogICAgICAgICAgICA8cGF0aCBkPSJNNSw4IEM2LjY1Njg1NDI1LDggOCw2LjY1Njg1NDI1IDgsNSBDOCwzLjM0MzE0NTc1IDYuNjU2ODU0MjUsMiA1LDIgQzMuMzQzMTQ1NzUsMiAyLDMuMzQzMTQ1NzUgMiw1IEMyLDYuNjU2ODU0MjUgMy4zNDMxNDU3NSw4IDUsOCBaIE01LDYuMjg1NzE0MjkgQzQuMjg5OTE5NjEsNi4yODU3MTQyOSAzLjcxNDI4NTcxLDUuNzEwMDgwMzkgMy43MTQyODU3MSw1IEMzLjcxNDI4NTcxLDQuMjg5OTE5NjEgNC4yODk5MTk2MSwzLjcxNDI4NTcxIDUsMy43MTQyODU3MSBDNS43MTAwODAzOSwzLjcxNDI4NTcxIDYuMjg1NzE0MjksNC4yODk5MTk2MSA2LjI4NTcxNDI5LDUgQzYuMjg1NzE0MjksNS43MTAwODAzOSA1LjcxMDA4MDM5LDYuMjg1NzE0MjkgNSw2LjI4NTcxNDI5IFoiIGlkPSLmpK3lnIblvaIiIGZpbGwtcnVsZT0ibm9uemVybyI+PC9wYXRoPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+"};class Jr{constructor(e,t,n,i){this.manager=e,this.memberId=t,this.cursorManager=n,this.wrapper=i,this.move=e=>{var t;if("main"===e.type){const t=this.cursorManager.wrapperRect;this.component&&t&&(this.autoHidden(),this.moveCursor(e,t,this.manager.mainView))}else{const n=this.cursorManager.focusView,i=null==(t=null==n?void 0:n.divElement)?void 0:t.getBoundingClientRect(),r=null==n?void 0:n.camera;n&&i&&r&&this.component&&(this.autoHidden(),this.moveCursor(e,i,n))}},this.leave=()=>{this.hide()},this.updateMember(),this.createCursor(),this.autoHidden()}moveCursor(e,t,n){var i,r;const{x:s,y:a,type:o}=e,l=null==n?void 0:n.screen.convertPointToScreen(s,a);if(l){let e=l.x-2,n=l.y-18;if("app"===o){const i=this.cursorManager.wrapperRect;i&&(e=e+t.x-i.x,n=n+t.y-i.y)}l.x<0||l.x>t.width||l.y<0||l.y>t.height?null==(i=this.component)||i.$set({visible:!1,x:e,y:n}):null==(r=this.component)||r.$set({visible:!0,x:e,y:n})}}get memberApplianceName(){var e,t;return null==(t=null==(e=this.member)?void 0:e.memberState)?void 0:t.currentApplianceName}get memberColor(){var e,t;return`rgb(${null==(t=null==(e=this.member)?void 0:e.memberState)?void 0:t.strokeColor.join(",")})`}get payload(){var e;return null==(e=this.member)?void 0:e.payload}get memberCursorName(){var e,t;return(null==(e=this.payload)?void 0:e.nickName)||(null==(t=this.payload)?void 0:t.cursorName)||this.memberId}get memberTheme(){var e;return(null==(e=this.payload)?void 0:e.theme)?"netless-window-manager-cursor-inner-mellow":"netless-window-manager-cursor-inner"}get memberCursorTextColor(){var e;return(null==(e=this.payload)?void 0:e.cursorTextColor)||"#FFFFFF"}get memberCursorTagBackgroundColor(){var e;return(null==(e=this.payload)?void 0:e.cursorTagBackgroundColor)||this.memberColor}get memberAvatar(){var e;return null==(e=this.payload)?void 0:e.avatar}get memberOpacity(){return this.memberCursorName||this.memberAvatar?1:0}get memberTagName(){var e;return null==(e=this.payload)?void 0:e.cursorTagName}autoHidden(){this.timer&&clearTimeout(this.timer),this.timer=window.setTimeout((()=>{this.hide()}),1e4)}async createCursor(){this.member&&this.wrapper&&(this.component=new Gr({target:this.wrapper,props:this.initProps()}))}initProps(){return{x:0,y:0,appliance:this.memberApplianceName,avatar:this.memberAvatar,src:this.getIcon(),visible:!1,backgroundColor:this.memberColor,cursorName:this.memberCursorName,theme:this.memberTheme,color:this.memberCursorTextColor,cursorTagBackgroundColor:this.memberCursorTagBackgroundColor,opacity:this.memberOpacity,tagName:this.memberTagName}}getIcon(){if(this.member){return Xr[this.memberApplianceName||W.shape]||Xr[W.shape]}}updateMember(){return this.member=((e,t)=>{const n=null==e?void 0:e.state.roomMembers;return null==n?void 0:n.find((e=>{var n;return(null==(n=e.payload)?void 0:n.uid)===t}))})(this.manager.room,this.memberId),this.updateComponent(),this.member}updateComponent(){var e;null==(e=this.component)||e.$set(g(this.initProps(),["x","y"]))}destroy(){this.component&&this.component.$destroy(),this.cursorManager.cursorInstances.delete(this.memberId),this.timer&&clearTimeout(this.timer)}hide(){this.component&&(this.component.$set({visible:!1}),this.destroy())}}class Kr{constructor(e,t){var n;this.manager=e,this.enableCursor=t,this.cursorInstances=new Map,this.sideEffectManager=new Y,this.store=this.manager.store,this.onCursorMove=e=>{const t=this.initCursorInstance(e.uid);if(e.state===ne.Leave)t.leave();else{const n=t.updateMember();this.canMoveCursor(n)&&t.move(e.position)}},this.initCursorInstance=e=>{let t=this.cursorInstances.get(e);return t||(t=new Jr(this.manager,e,this,Nb.wrapper),this.cursorInstances.set(e,t)),t},this.mouseMoveListener=E((e=>{("touch"!==e.pointerType||e.isPrimary)&&this.updateCursor(this.getType(e),e.clientX,e.clientY)}),16),this.getPoint=(e,t,n)=>{var i;const r=null==(i=null==e?void 0:e.divElement)?void 0:i.getBoundingClientRect();if(r){return null==e?void 0:e.convertToPointInWorld({x:t-r.x,y:n-r.y})}},this.getType=e=>{var t;const n=e.target,i=this.manager.focusApp;switch(n.parentElement){case this.mainViewElement:return{type:"main"};case null==(t=null==i?void 0:i.view)?void 0:t.divElement:return{type:"app"};default:return{type:"main"}}},this.mouseLeaveListener=()=>{this.hideCursor(this.manager.uid)},this.roomMembers=null==(n=this.manager.room)?void 0:n.state.roomMembers;const i=Nb.wrapper;i&&this.setupWrapper(i),this.sideEffectManager.add((()=>le.on("cursorMove",this.onCursorMove))),this.sideEffectManager.add((()=>le.on("playgroundSizeChange",(()=>this.updateContainerRect()))))}canMoveCursor(e){const t=(null==e?void 0:e.memberState.currentApplianceName)===W.laserPointer;return this.enableCursor||t}setupWrapper(e){this.sideEffectManager.add((()=>(e.addEventListener("pointerenter",this.mouseMoveListener),e.addEventListener("pointermove",this.mouseMoveListener),e.addEventListener("pointerleave",this.mouseLeaveListener),()=>{e.removeEventListener("pointerenter",this.mouseMoveListener),e.removeEventListener("pointermove",this.mouseMoveListener),e.removeEventListener("pointerleave",this.mouseLeaveListener)}))),this.wrapperRect=e.getBoundingClientRect()}setMainViewDivElement(e){this.mainViewElement=e}get boxState(){return this.store.getBoxState()}get focusView(){var e;return null==(e=this.manager.focusApp)?void 0:e.view}updateCursor(t,n,i){if(this.wrapperRect&&this.manager.canOperate){const r="main"===t.type?this.manager.mainView:this.focusView,s=this.getPoint(r,n,i);s&&this.manager.dispatchInternalEvent(e.CursorMove,{uid:this.manager.uid,position:{x:s.x,y:s.y,type:t.type}})}}updateContainerRect(){var e,t;this.containerRect=null==(e=Nb.container)?void 0:e.getBoundingClientRect(),this.wrapperRect=null==(t=Nb.wrapper)?void 0:t.getBoundingClientRect()}deleteCursor(e){this.store.cleanCursor(e);const t=this.cursorInstances.get(e);t&&t.destroy()}hideCursor(e){const t=this.cursorInstances.get(e);t&&t.hide()}destroy(){this.sideEffectManager.flushAll(),this.cursorInstances.size&&(this.cursorInstances.forEach((e=>{e.destroy()})),this.cursorInstances.clear())}}class qr{constructor(e){this.manager=e,le.on("changePageState",(()=>{ae.emit("pageStateChange",this.toObject())}))}get index(){var e;return(null==(e=this.manager)?void 0:e.store.getMainViewSceneIndex())||0}get length(){var e;return(null==(e=this.manager)?void 0:e.mainViewScenesLength)||0}toObject(){return{index:this.index,length:this.length}}}const es=e=>{const t=e.removeScenes;e.removeScenes=n=>{const i=t.call(e,n);return le.emit("removeScenes",n),i}},ts=e=>{const t=e.seekToProgressTime;e.seekToProgressTime=async function(n){await le.emit("seekStart");const i=await t.call(e,n);return le.emit("seek",n),i}};var ns=Object.defineProperty,is=Object.defineProperties,rs=Object.getOwnPropertyDescriptors,ss=Object.getOwnPropertySymbols,as=Object.prototype.hasOwnProperty,os=Object.prototype.propertyIsEnumerable,ls=(e,t,n)=>t in e?ns(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,cs=(e,t)=>{for(var n in t||(t={}))as.call(t,n)&&ls(e,n,t[n]);if(ss)for(var n of ss(t))os.call(t,n)&&ls(e,n,t[n]);return e},us=(e,t)=>is(e,rs(t));const ds=(e,t,n,i)=>{if("length"===n||"prototype"===n)return;if("arguments"===n||"caller"===n)return;const r=Object.getOwnPropertyDescriptor(e,n),s=Object.getOwnPropertyDescriptor(t,n);!hs(r,s)&&i||Object.defineProperty(e,n,s)},hs=function(e,t){return void 0===e||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},ps=(e,t)=>`/* Wrapped ${e}*/\n${t}`,fs=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),gs=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name");function ms(e,t,{ignoreNonConfigurable:n=!1}={}){const{name:i}=e;for(const r of Reflect.ownKeys(t))ds(e,t,r,n);return((e,t)=>{const n=Object.getPrototypeOf(t);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)})(e,t),((e,t,n)=>{const i=""===n?"":`with ${n.trim()}() `,r=ps.bind(null,i,t.toString());Object.defineProperty(r,"name",gs),Object.defineProperty(e,"toString",us(cs({},fs),{value:r}))})(e,t,i),e}const vs=(e,t={})=>{if("function"!=typeof e)throw new TypeError(`Expected the first argument to be a function, got \`${typeof e}\``);const{wait:n=0,maxWait:i=Number.Infinity,before:r=!1,after:s=!0}=t;if(!r&&!s)throw new Error("Both `before` and `after` are false, function wouldn't be called.");let a,o,l;const c=function(...t){const c=this,u=()=>{o=void 0,a&&(clearTimeout(a),a=void 0),s&&(l=e.apply(c,t))},d=r&&!a;return clearTimeout(a),a=setTimeout((()=>{a=void 0,o&&(clearTimeout(o),o=void 0),s&&(l=e.apply(c,t))}),n),i>0&&i!==Number.Infinity&&!o&&(o=setTimeout(u,i)),d&&(l=e.apply(c,t)),l};return ms(c,e),c.cancel=()=>{a&&(clearTimeout(a),a=void 0),o&&(clearTimeout(o),o=void 0)},c},bs="!#%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",ws=bs.length,ys=Array(20),xs=()=>{for(let e=0;e<20;e++)ys[e]=bs.charAt(Math.random()*ws);return ys.join("")};class Cs{constructor(){this.disposers=new Map}add(e,t=xs()){return this.flush(t),this.disposers.set(t,e()),t}addDisposer(e,t=xs()){return this.flush(t),this.disposers.set(t,e),t}addEventListener(e,t,n,i,r=xs()){return this.add((()=>(e.addEventListener(t,n,i),()=>e.removeEventListener(t,n,i))),r),r}setTimeout(e,t,n=xs()){return this.add((()=>{const i=window.setTimeout((()=>{this.remove(n),e()}),t);return()=>window.clearTimeout(i)}),n)}setInterval(e,t,n=xs()){return this.add((()=>{const n=window.setInterval(e,t);return()=>window.clearInterval(n)}),n)}remove(e){const t=this.disposers.get(e);return this.disposers.delete(e),t}flush(e){const t=this.remove(e);if(t)try{t()}catch(n){console.error(n)}}flushAll(){this.disposers.forEach((e=>{try{e()}catch(t){console.error(t)}})),this.disposers.clear()}}var Ms,Ss,Is=[],Es="ResizeObserver loop completed with undelivered notifications.";(Ss=Ms||(Ms={})).BORDER_BOX="border-box",Ss.CONTENT_BOX="content-box",Ss.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box";var As,Ts=function(e){return Object.freeze(e)},ks=function(e,t){this.inlineSize=e,this.blockSize=t,Ts(this)},Ns=function(){function e(e,t,n,i){return this.x=e,this.y=t,this.width=n,this.height=i,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Ts(this)}return e.prototype.toJSON=function(){var e=this;return{x:e.x,y:e.y,top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),Ps=function(e){return e instanceof SVGElement&&"getBBox"in e},zs=function(e){if(Ps(e)){var t=e.getBBox(),n=t.width,i=t.height;return!n&&!i}var r=e,s=r.offsetWidth,a=r.offsetHeight;return!(s||a||e.getClientRects().length)},Ds=function(e){var t,n;if(e instanceof Element)return!0;var i=null===(n=null===(t=e)||void 0===t?void 0:t.ownerDocument)||void 0===n?void 0:n.defaultView;return!!(i&&e instanceof i.Element)},Ls="undefined"!=typeof window?window:{},Bs=new WeakMap,js=/auto|scroll/,Rs=/^tb|vertical/,Os=/msie|trident/i.test(Ls.navigator&&Ls.navigator.userAgent),Vs=function(e){return parseFloat(e||"0")},_s=function(e,t,n){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=!1),new ks((n?t:e)||0,(n?e:t)||0)},Us=Ts({devicePixelContentBoxSize:_s(),borderBoxSize:_s(),contentBoxSize:_s(),contentRect:new Ns(0,0,0,0)}),Ws=function(e,t){if(void 0===t&&(t=!1),Bs.has(e)&&!t)return Bs.get(e);if(zs(e))return Bs.set(e,Us),Us;var n=getComputedStyle(e),i=Ps(e)&&e.ownerSVGElement&&e.getBBox(),r=!Os&&"border-box"===n.boxSizing,s=Rs.test(n.writingMode||""),a=!i&&js.test(n.overflowY||""),o=!i&&js.test(n.overflowX||""),l=i?0:Vs(n.paddingTop),c=i?0:Vs(n.paddingRight),u=i?0:Vs(n.paddingBottom),d=i?0:Vs(n.paddingLeft),h=i?0:Vs(n.borderTopWidth),p=i?0:Vs(n.borderRightWidth),f=i?0:Vs(n.borderBottomWidth),g=d+c,m=l+u,v=(i?0:Vs(n.borderLeftWidth))+p,b=h+f,w=o?e.offsetHeight-b-e.clientHeight:0,y=a?e.offsetWidth-v-e.clientWidth:0,x=r?g+v:0,C=r?m+b:0,M=i?i.width:Vs(n.width)-x-y,S=i?i.height:Vs(n.height)-C-w,I=M+g+y+v,E=S+m+w+b,A=Ts({devicePixelContentBoxSize:_s(Math.round(M*devicePixelRatio),Math.round(S*devicePixelRatio),s),borderBoxSize:_s(I,E,s),contentBoxSize:_s(M,S,s),contentRect:new Ns(d,l,M,S)});return Bs.set(e,A),A},Hs=function(e,t,n){var i=Ws(e,n),r=i.borderBoxSize,s=i.contentBoxSize,a=i.devicePixelContentBoxSize;switch(t){case Ms.DEVICE_PIXEL_CONTENT_BOX:return a;case Ms.BORDER_BOX:return r;default:return s}},Qs=function(e){var t=Ws(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=Ts([t.borderBoxSize]),this.contentBoxSize=Ts([t.contentBoxSize]),this.devicePixelContentBoxSize=Ts([t.devicePixelContentBoxSize])},$s=function(e){if(zs(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},Fs=function(){var e=1/0,t=[];Is.forEach((function(n){if(0!==n.activeTargets.length){var i=[];n.activeTargets.forEach((function(t){var n=new Qs(t.target),r=$s(t.target);i.push(n),t.lastReportedSize=Hs(t.target,t.observedBox),r<e&&(e=r)})),t.push((function(){n.callback.call(n.observer,i,n.observer)})),n.activeTargets.splice(0,n.activeTargets.length)}}));for(var n=0,i=t;n<i.length;n++){(0,i[n])()}return e},Zs=function(e){Is.forEach((function(t){t.activeTargets.splice(0,t.activeTargets.length),t.skippedTargets.splice(0,t.skippedTargets.length),t.observationTargets.forEach((function(n){n.isActive()&&($s(n.target)>e?t.activeTargets.push(n):t.skippedTargets.push(n))}))}))},Ys=function(){var e,t=0;for(Zs(t);Is.some((function(e){return e.activeTargets.length>0}));)t=Fs(),Zs(t);return Is.some((function(e){return e.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?e=new ErrorEvent("error",{message:Es}):((e=document.createEvent("Event")).initEvent("error",!1,!1),e.message=Es),window.dispatchEvent(e)),t>0},Gs=[],Xs=function(e){if(!As){var t=0,n=document.createTextNode("");new MutationObserver((function(){return Gs.splice(0).forEach((function(e){return e()}))})).observe(n,{characterData:!0}),As=function(){n.textContent=""+(t?t--:t++)}}Gs.push(e),As()},Js=0,Ks={attributes:!0,characterData:!0,childList:!0,subtree:!0},qs=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],ea=function(e){return void 0===e&&(e=0),Date.now()+e},ta=!1,na=new(function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t=this;if(void 0===e&&(e=250),!ta){ta=!0;var n,i=ea(e);n=function(){var n=!1;try{n=Ys()}finally{if(ta=!1,e=i-ea(),!Js)return;n?t.run(1e3):e>0?t.run(e):t.start()}},Xs((function(){requestAnimationFrame(n)}))}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,Ks)};document.body?t():Ls.addEventListener("DOMContentLoaded",t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),qs.forEach((function(t){return Ls.addEventListener(t,e.listener,!0)})))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),qs.forEach((function(t){return Ls.removeEventListener(t,e.listener,!0)})),this.stopped=!0)},e}()),ia=function(e){!Js&&e>0&&na.start(),!(Js+=e)&&na.stop()},ra=function(){function e(e,t){this.target=e,this.observedBox=t||Ms.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e,t=Hs(this.target,this.observedBox,!0);return e=this.target,Ps(e)||function(e){switch(e.tagName){case"INPUT":if("image"!==e.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(e)||"inline"!==getComputedStyle(e).display||(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),sa=function(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t},aa=new WeakMap,oa=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},la=function(){function e(){}return e.connect=function(e,t){var n=new sa(e,t);aa.set(e,n)},e.observe=function(e,t,n){var i=aa.get(e),r=0===i.observationTargets.length;oa(i.observationTargets,t)<0&&(r&&Is.push(i),i.observationTargets.push(new ra(t,n&&n.box)),ia(1),na.schedule())},e.unobserve=function(e,t){var n=aa.get(e),i=oa(n.observationTargets,t),r=1===n.observationTargets.length;i>=0&&(r&&Is.splice(Is.indexOf(n),1),n.observationTargets.splice(i,1),ia(-1))},e.disconnect=function(e){var t=this,n=aa.get(e);n.observationTargets.slice().forEach((function(n){return t.unobserve(e,n.target)})),n.activeTargets.splice(0,n.activeTargets.length)},e}(),ca=function(){function e(e){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof e)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");la.connect(this,e)}return e.prototype.observe=function(e,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Ds(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");la.observe(this,e,t)},e.prototype.unobserve=function(e){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Ds(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");la.unobserve(this,e)},e.prototype.disconnect=function(){la.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();const ua="undefined"!=typeof window,da=ua&&!("onscroll"in window)||"undefined"!=typeof navigator&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),ha=ua&&"IntersectionObserver"in window,pa=ua&&"classList"in document.createElement("p"),fa=ua&&window.devicePixelRatio>1,ga={elements_selector:".lazy",container:da||ua?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1},ma=e=>Object.assign({},ga,e),va=function(e,t){let n;const i="LazyLoad::Initialized",r=new e(t);try{n=new CustomEvent(i,{detail:{instance:r}})}catch(s){n=document.createEvent("CustomEvent"),n.initCustomEvent(i,!1,!1,{instance:r})}window.dispatchEvent(n)},ba="src",wa="llOriginalAttrs",ya=(e,t)=>e.getAttribute("data-"+t),xa=e=>ya(e,"ll-status"),Ca=(e,t)=>((e,t,n)=>{var i="data-"+t;null!==n?e.setAttribute(i,n):e.removeAttribute(i)})(e,"ll-status",t),Ma=e=>Ca(e,null),Sa=e=>null===xa(e),Ia=e=>"native"===xa(e),Ea=["loading","loaded","applied","error"],Aa=(e,t,n,i)=>{e&&(void 0===i?void 0===n?e(t):e(t,n):e(t,n,i))},Ta=(e,t)=>{pa?e.classList.add(t):e.className+=(e.className?" ":"")+t},ka=(e,t)=>{pa?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\s+)"+t+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},Na=e=>e.llTempImage,Pa=(e,t)=>{if(!t)return;const n=t._observer;n&&n.unobserve(e)},za=(e,t)=>{e&&(e.loadingCount+=t)},Da=(e,t)=>{e&&(e.toLoadCount=t)},La=e=>{let t=[];for(let n,i=0;n=e.children[i];i+=1)"SOURCE"===n.tagName&&t.push(n);return t},Ba=(e,t)=>{const n=e.parentNode;if(!n||"PICTURE"!==n.tagName)return;La(n).forEach(t)},ja=(e,t)=>{La(e).forEach(t)},Ra=[ba],Oa=[ba,"poster"],Va=[ba,"srcset","sizes"],_a=e=>!!e[wa],Ua=e=>e[wa],Wa=e=>delete e[wa],Ha=(e,t)=>{if(_a(e))return;const n={};t.forEach((t=>{n[t]=e.getAttribute(t)})),e[wa]=n},Qa=(e,t)=>{if(!_a(e))return;const n=Ua(e);t.forEach((t=>{((e,t,n)=>{n?e.setAttribute(t,n):e.removeAttribute(t)})(e,t,n[t])}))},$a=(e,t,n)=>{Ta(e,t.class_loading),Ca(e,"loading"),n&&(za(n,1),Aa(t.callback_loading,e,n))},Fa=(e,t,n)=>{n&&e.setAttribute(t,n)},Za=(e,t)=>{Fa(e,"sizes",ya(e,t.data_sizes)),Fa(e,"srcset",ya(e,t.data_srcset)),Fa(e,ba,ya(e,t.data_src))},Ya=(e,t,n)=>{const i=ya(e,t.data_bg_multi),r=ya(e,t.data_bg_multi_hidpi),s=fa&&r?r:i;s&&(e.style.backgroundImage=s,((e,t,n)=>{Ta(e,t.class_applied),Ca(e,"applied"),n&&(t.unobserve_completed&&Pa(e,t),Aa(t.callback_applied,e,n))})(e,t,n))},Ga={IMG:(e,t)=>{Ba(e,(e=>{Ha(e,Va),Za(e,t)})),Ha(e,Va),Za(e,t)},IFRAME:(e,t)=>{Ha(e,Ra),Fa(e,ba,ya(e,t.data_src))},VIDEO:(e,t)=>{ja(e,(e=>{Ha(e,Ra),Fa(e,ba,ya(e,t.data_src))})),Ha(e,Oa),Fa(e,"poster",ya(e,t.data_poster)),Fa(e,ba,ya(e,t.data_src)),e.load()}},Xa=["IMG","IFRAME","VIDEO"],Ja=(e,t)=>{!t||(e=>e.loadingCount>0)(t)||(e=>e.toLoadCount>0)(t)||Aa(e.callback_finish,t)},Ka=(e,t,n)=>{e.addEventListener(t,n),e.llEvLisnrs[t]=n},qa=(e,t,n)=>{e.removeEventListener(t,n)},eo=e=>!!e.llEvLisnrs,to=e=>{if(!eo(e))return;const t=e.llEvLisnrs;for(let n in t){const i=t[n];qa(e,n,i)}delete e.llEvLisnrs},no=(e,t,n)=>{(e=>{delete e.llTempImage})(e),za(n,-1),(e=>{e&&(e.toLoadCount-=1)})(n),ka(e,t.class_loading),t.unobserve_completed&&Pa(e,n)},io=(e,t,n)=>{const i=Na(e)||e;if(eo(i))return;((e,t,n)=>{eo(e)||(e.llEvLisnrs={});const i="VIDEO"===e.tagName?"loadeddata":"load";Ka(e,i,t),Ka(e,"error",n)})(i,(r=>{((e,t,n,i)=>{const r=Ia(t);no(t,n,i),Ta(t,n.class_loaded),Ca(t,"loaded"),Aa(n.callback_loaded,t,i),r||Ja(n,i)})(0,e,t,n),to(i)}),(r=>{((e,t,n,i)=>{const r=Ia(t);no(t,n,i),Ta(t,n.class_error),Ca(t,"error"),Aa(n.callback_error,t,i),r||Ja(n,i)})(0,e,t,n),to(i)}))},ro=(e,t,n)=>{(e=>{e.llTempImage=document.createElement("IMG")})(e),io(e,t,n),(e=>{_a(e)||(e[wa]={backgroundImage:e.style.backgroundImage})})(e),((e,t,n)=>{const i=ya(e,t.data_bg),r=ya(e,t.data_bg_hidpi),s=fa&&r?r:i;s&&(e.style.backgroundImage=`url("${s}")`,Na(e).setAttribute(ba,s),$a(e,t,n))})(e,t,n),Ya(e,t,n)},so=(e,t,n)=>{io(e,t,n),((e,t,n)=>{const i=Ga[e.tagName];i&&(i(e,t),$a(e,t,n))})(e,t,n)},ao=(e,t,n)=>{(e=>Xa.indexOf(e.tagName)>-1)(e)?so(e,t,n):ro(e,t,n)},oo=(e,t,n)=>{e.setAttribute("loading","lazy"),io(e,t,n),((e,t)=>{const n=Ga[e.tagName];n&&n(e,t)})(e,t),Ca(e,"native")},lo=e=>{e.removeAttribute(ba),e.removeAttribute("srcset"),e.removeAttribute("sizes")},co=e=>{Ba(e,(e=>{Qa(e,Va)})),Qa(e,Va)},uo={IMG:co,IFRAME:e=>{Qa(e,Ra)},VIDEO:e=>{ja(e,(e=>{Qa(e,Ra)})),Qa(e,Oa),e.load()}},ho=e=>{const t=uo[e.tagName];t?t(e):(e=>{if(!_a(e))return;const t=Ua(e);e.style.backgroundImage=t.backgroundImage})(e)},po=(e,t)=>{ho(e),((e,t)=>{Sa(e)||Ia(e)||(ka(e,t.class_entered),ka(e,t.class_exited),ka(e,t.class_applied),ka(e,t.class_loading),ka(e,t.class_loaded),ka(e,t.class_error))})(e,t),Ma(e),Wa(e)},fo=(e,t,n,i)=>{n.cancel_on_exit&&(e=>"loading"===xa(e))(e)&&"IMG"===e.tagName&&(to(e),(e=>{Ba(e,(e=>{lo(e)})),lo(e)})(e),co(e),ka(e,n.class_loading),za(i,-1),Ma(e),Aa(n.callback_cancel,e,t,i))},go=(e,t,n,i)=>{const r=(e=>Ea.indexOf(xa(e))>=0)(e);Ca(e,"entered"),Ta(e,n.class_entered),ka(e,n.class_exited),((e,t,n)=>{t.unobserve_entered&&Pa(e,n)})(e,n,i),Aa(n.callback_enter,e,t,i),r||ao(e,n,i)},mo=["IMG","IFRAME","VIDEO"],vo=e=>e.use_native&&"loading"in HTMLImageElement.prototype,bo=(e,t,n)=>{e.forEach((e=>(e=>e.isIntersecting||e.intersectionRatio>0)(e)?go(e.target,e,t,n):((e,t,n,i)=>{Sa(e)||(Ta(e,n.class_exited),fo(e,t,n,i),Aa(n.callback_exit,e,t,i))})(e.target,e,t,n)))},wo=(e,t)=>{ha&&!vo(e)&&(t._observer=new IntersectionObserver((n=>{bo(n,e,t)}),(e=>({root:e.container===document?null:e.container,rootMargin:e.thresholds||e.threshold+"px"}))(e)))},yo=e=>Array.prototype.slice.call(e),xo=e=>e.container.querySelectorAll(e.elements_selector),Co=e=>(e=>"error"===xa(e))(e),Mo=(e,t)=>(e=>yo(e).filter(Sa))(e||xo(t)),So=(e,t)=>{var n;(n=xo(e),yo(n).filter(Co)).forEach((t=>{ka(t,e.class_error),Ma(t)})),t.update()},Io=function(e,t){const n=ma(e);this._settings=n,this.loadingCount=0,wo(n,this),((e,t)=>{ua&&window.addEventListener("online",(()=>{So(e,t)}))})(n,this),this.update(t)};Io.prototype={update:function(e){const t=this._settings,n=Mo(e,t);var i,r;(Da(this,n.length),!da&&ha)?vo(t)?((e,t,n)=>{e.forEach((e=>{-1!==mo.indexOf(e.tagName)&&oo(e,t,n)})),Da(n,0)})(n,t,this):(i=this._observer,r=n,(e=>{e.disconnect()})(i),((e,t)=>{t.forEach((t=>{e.observe(t)}))})(i,r)):this.loadAll(n)},destroy:function(){this._observer&&this._observer.disconnect(),xo(this._settings).forEach((e=>{Wa(e)})),delete this._observer,delete this._settings,delete this.loadingCount,delete this.toLoadCount},loadAll:function(e){const t=this._settings;Mo(e,t).forEach((e=>{Pa(e,this),ao(e,t,this)}))},restoreAll:function(){const e=this._settings;xo(e).forEach((t=>{po(t,e)}))}},Io.load=(e,t)=>{const n=ma(t);ao(e,n)},Io.resetStatus=e=>{Ma(e)},ua&&((e,t)=>{if(t)if(t.length)for(let n,i=0;n=t[i];i+=1)va(e,n);else va(e,t)})(Io,window.lazyLoadOptions);class Eo{constructor({readonly:e,box:t,pages:n,onNewPageIndex:i,onPlay:r}){if(this.pageIndex=0,this.namespace="netless-app-docs-viewer",this.isShowPreview=!1,this.isSmallBox=!1,this.sideEffect=new Cs,n.length<=0)throw new Error("[DocsViewer] Empty pages.");this.readonly=e,this.box=t,this.pages=n,this.onNewPageIndex=i,this.onPlay=r,this.render()}mount(){this.box.mountContent(this.$content),this.box.mountFooter(this.$footer),this.sideEffect.add((()=>{const e=new Io({container:this.$preview,elements_selector:`.${this.wrapClassName("preview-page>img")}`});return()=>e.destroy()}),"preview-lazyload")}unmount(){this.$content.remove(),this.$footer.remove()}setReadonly(e){this.readonly!==e&&(this.readonly=e,this.$content.classList.toggle(this.wrapClassName("readonly"),e),this.$footer.classList.toggle(this.wrapClassName("readonly"),e),this.$pageNumberInput.disabled=e)}destroy(){this.sideEffect.flushAll(),this.unmount()}setPageIndex(e){Number.isNaN(e)||(this.pageIndex=e,this.$pageNumberInput.value=String(e+1))}setSmallBox(e){this.isSmallBox!==e&&(this.isSmallBox=e,this.$footer.classList.toggle(this.wrapClassName("float-footer"),e))}render(){return this.renderContent(),this.renderFooter(),this.$content}renderContent(){if(!this.$content){const e=document.createElement("div");e.className=this.wrapClassName("content"),this.$content=e,this.readonly&&e.classList.add(this.wrapClassName("readonly")),e.appendChild(this.renderPreviewMask()),e.appendChild(this.renderPreview())}return this.$content}renderPreview(){if(!this.$preview){const e=document.createElement("div");e.className=this.wrapClassName("preview")+" tele-fancy-scrollbar",this.$preview=e;const t=this.wrapClassName("preview-page"),n=this.wrapClassName("preview-page-name");this.pages.forEach(((i,r)=>{var s;const a=null!=(s=i.thumbnail)?s:i.src.startsWith("ppt")?void 0:i.src;if(!a)return;const o=String(r),l=document.createElement("a");l.className=t+" "+this.wrapClassName(`preview-page-${r}`),l.setAttribute("href","#"),l.dataset.pageIndex=o;const c=document.createElement("span");c.className=n,c.textContent=String(r+1),c.dataset.pageIndex=o;const u=document.createElement("img");u.width=i.width,u.height=i.height,u.dataset.src=a,u.dataset.pageIndex=o,l.appendChild(u),l.appendChild(c),e.appendChild(l)})),this.sideEffect.addEventListener(e,"click",(e=>{var t;if(this.readonly)return;const n=null==(t=e.target.dataset)?void 0:t.pageIndex;n&&(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),this.onNewPageIndex(Number(n)),this.togglePreview(!1))}))}return this.$preview}renderPreviewMask(){return this.$previewMask||(this.$previewMask=document.createElement("div"),this.$previewMask.className=this.wrapClassName("preview-mask"),this.sideEffect.addEventListener(this.$previewMask,"click",(e=>{this.readonly||e.target===this.$previewMask&&this.togglePreview(!1)}))),this.$previewMask}renderFooter(){if(!this.$footer){const e=document.createElement("div");if(e.className=this.wrapClassName("footer"),this.$footer=e,this.readonly&&e.classList.add(this.wrapClassName("readonly")),this.isSmallBox&&e.classList.add(this.wrapClassName("float-footer")),this.pages.some((e=>e.thumbnail||!e.src.startsWith("ppt")))){const e=this.renderFooterBtn("btn-sidebar",function(e){const t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");n.setAttribute("class",`${e}-footer-icon-sidebar`),n.setAttribute("viewBox","0 0 64 64");const i=document.createElementNS(t,"path");return i.setAttribute("fill","currentColor"),i.setAttribute("d","M50 8H14c-3.309 0-6 2.691-6 6v36c0 3.309 2.691 6 6 6h36c3.309 0 6-2.691 6-6V14c0-3.309-2.691-6-6-6zM12 50V14c0-1.103.897-2 2-2h8v40h-8c-1.103 0-2-.897-2-2zm40 0c0 1.103-.897 2-2 2H26V12h24c1.103 0 2 .897 2 2z"),n.appendChild(i),n}(this.namespace));this.sideEffect.addEventListener(e,"click",(()=>{this.readonly||this.togglePreview()})),this.$footer.appendChild(e)}const t=document.createElement("div");t.className=this.wrapClassName("page-jumps");const n=this.renderFooterBtn("btn-page-back",function(e){const t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");n.setAttribute("class",`${e}-footer-icon-arrow-left`),n.setAttribute("viewBox","0 0 500 500");const i=document.createElementNS(t,"path");return i.setAttribute("fill","currentColor"),i.setAttribute("d","M177.81 249.959L337.473 90.295c2.722-2.865 2.651-7.378-.143-10.1-2.793-2.65-7.163-2.65-9.956 0l-164.75 164.75c-2.793 2.793-2.793 7.306 0 10.1l164.75 164.75c2.865 2.722 7.378 2.65 10.099-.143 2.651-2.794 2.651-7.163 0-9.957L177.809 249.959z"),n.appendChild(i),n}(this.namespace));if(this.sideEffect.addEventListener(n,"click",(()=>{this.readonly||this.onNewPageIndex(this.pageIndex-1)})),t.appendChild(n),this.onPlay){const e=this.renderFooterBtn("btn-page-play",function(e){const t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");n.setAttribute("class",`${e}-footer-icon-play`),n.setAttribute("viewBox","0 0 500 500");const i=document.createElementNS(t,"path");return i.setAttribute("fill","currentColor"),i.setAttribute("d","M418.158 257.419L174.663 413.33c-6.017 3.919-15.708 3.772-21.291-.29-2.791-2.018-4.295-4.483-4.295-7.084V94.109c0-5.65 6.883-10.289 15.271-10.289 4.298 0 8.391 1.307 11.181 3.332l242.629 155.484c6.016 3.917 6.451 10.292.649 14.491-.216.154-.432.154-.649.292zM170.621 391.288l223.116-141.301L170.71 107.753l-.089 283.535z"),n.appendChild(i),n}(this.namespace),function(e){const t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");n.setAttribute("class",`${e}-footer-icon-pause`),n.setAttribute("viewBox","0 0 500 500");const i=document.createElementNS(t,"path");return i.setAttribute("fill","currentColor"),i.setAttribute("d","M312.491 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261zM165.257 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261z"),n.appendChild(i),n}(this.namespace)),n=()=>{this.sideEffect.setTimeout((()=>{e.classList.toggle(this.wrapClassName("footer-btn-playing"),!1)}),500,"returnPlay")};this.sideEffect.addEventListener(e,"click",(()=>{this.readonly||(e.classList.toggle(this.wrapClassName("footer-btn-playing"),!0),this.onPlay&&this.onPlay(),n())})),t.appendChild(e)}const i=this.renderFooterBtn("btn-page-next",function(e){const t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");n.setAttribute("class",`${e}-footer-icon-arrow-right`),n.setAttribute("viewBox","0 0 500 500");const i=document.createElementNS(t,"path");return i.setAttribute("fill","currentColor"),i.setAttribute("d","M322.19 250.041L162.527 409.705c-2.722 2.865-2.651 7.378.143 10.1 2.793 2.65 7.163 2.65 9.956 0l164.75-164.75c2.793-2.793 2.793-7.306 0-10.1l-164.75-164.75c-2.865-2.722-7.378-2.65-10.099.143-2.651 2.794-2.651 7.163 0 9.957l159.664 159.736z"),n.appendChild(i),n}(this.namespace));this.sideEffect.addEventListener(i,"click",(()=>{this.readonly||this.onNewPageIndex(this.pageIndex+1)})),t.appendChild(i);const r=document.createElement("div");r.className=this.wrapClassName("page-number");const s=document.createElement("input");s.className=this.wrapClassName("page-number-input"),s.value=String(this.pageIndex+1),this.readonly&&(s.disabled=!0),this.$pageNumberInput=s,this.sideEffect.addEventListener(s,"focus",(()=>{s.select()})),this.sideEffect.addEventListener(s,"change",(()=>{this.readonly||s.value&&this.onNewPageIndex(Number(s.value)-1)}));const a=document.createElement("span");a.textContent=" / "+this.pages.length,r.appendChild(s),r.appendChild(a),this.$footer.appendChild(t),this.$footer.appendChild(r)}return this.$footer}renderFooterBtn(e,t,n){const i=document.createElement("button");return i.className=this.wrapClassName("footer-btn")+" "+this.wrapClassName(e),i.appendChild(t),n&&i.appendChild(n),i}togglePreview(e){if(this.isShowPreview=null!=e?e:!this.isShowPreview,this.$content.classList.toggle(this.wrapClassName("preview-active"),this.isShowPreview),this.isShowPreview){const e=this.$preview.querySelector("."+this.wrapClassName(`preview-page-${this.pageIndex}`));e&&this.$preview.scrollTo({top:e.offsetTop-16})}}wrapClassName(e){return`${this.namespace}-${e}`}}function Ao(e,t,n){return Math.min(Math.max(e,t),n)}function To(e){return e.touches?e.touches[0]:e}function ko(e){e.stopPropagation(),e.cancelable&&e.preventDefault()}class No{constructor(e){var t,n,i;this.velocity=0,this.paused=!0,this._animationFrameID=null,this._loopTimestamp=0,this.looper=e=>{if(this.paused)return;let t=Math.floor((e-this._loopTimestamp)/1e3*60)+1;for(this._loopTimestamp=e;t-- >0;)this.stepper();this.onStep(this.current,this),this.paused||this.current===this.target||window.requestAnimationFrame(this.looper)},this.current=null!=(t=e.start)?t:0,this.target=this.current,this.stiffness=null!=(n=e.stiffness)?n:170,this.damping=null!=(i=e.damping)?i:26,this.onStep=e.onStep}stepTo(e,t){this.paused&&null!=t&&(this.current=t),this.paused=!1,this.target=e,this.onStep(this.current,this),this._loopTimestamp=Date.now(),window.requestAnimationFrame(this.looper)}pause(){this.paused=!0}destroy(){this.pause()}stepper(){const e=-this.stiffness*(this.current-this.target),t=-this.damping*this.velocity,n=this.velocity+(e+t)/60,i=this.current+n/60;Math.abs(n-0)<.01&&Math.abs(i-this.target)<.01?(this.current=this.target,this.velocity=0):(this.current=i,this.velocity=n)}}class Po{constructor(e,t,n,i){this.scale=1,this.lastVisit=Date.now(),this.pageOffsetY=0,this.pageOffsetX=0,this.visible=!0,this.index=e,this.page=t,this.scale=n,this.pageOffsetX=(i-t.width)/2;const r=document.createElement("div");r.className="page-renderer-page",r.dataset.index=`${e}`,r.style.width=t.width*n+"px",r.style.height=t.height*n+"px",t.thumbnail&&(r.style.backgroundImage=`url("${t.thumbnail}")`);const s=document.createElement("img");s.className="page-renderer-page-img",s.width=t.width,s.height=t.height,s.src=t.src,r.appendChild(s),this.$page=r}translateY(e){Math.abs(e-this.pageOffsetY)>=.001&&(this.pageOffsetY=e,this.$page.style.transform=`translate(${this.pageOffsetX*this.scale}px, ${this.pageOffsetY*this.scale}px)`)}setScale(e){Math.abs(e-this.scale)>=.001&&(this.scale=e,this.$page.style.width=this.page.width*this.scale+"px",this.$page.style.height=this.page.height*this.scale+"px",this.$page.style.transform=`translate(${this.pageOffsetX*this.scale}px, ${this.pageOffsetY*this.scale}px)`)}setVisible(e){e!==this.visible&&(this.visible=e,this.$page.style.opacity=e?"1":"0")}}const zo=window.requestIdleCallback||(e=>window.setTimeout(e,5e3)),Do=window.cancelIdleCallback||window.clearTimeout;class Lo{constructor(e,t,n){this.pages=e,this.pagesIntrinsicWidth=t,this.scale=n,this.els=new Map,this.maxElCount=200,this.gcTimer=null,this.gc=()=>{if(this.gcTimer=null,this.els.size>this.maxElCount){const e=[...this.els.values()].sort(((e,t)=>t.lastVisit-e.lastVisit));for(let t=Math.floor(this.maxElCount/4);t<e.length;t++)this.els.delete(e[t].index)}}}getEl(e){let t=this.els.get(e);return t||(t=new Po(e,this.pages[e],this.scale,this.pagesIntrinsicWidth),this.els.set(e,t)),t.lastVisit=Date.now(),this.els.size>this.maxElCount&&null===this.gcTimer&&(this.gcTimer=zo(this.gc)),t}setScale(e){e!==this.scale&&(this.scale=e,this.els.forEach((t=>t.setScale(e))))}destroy(){this.els.clear(),null!==this.gcTimer&&(Do(this.gcTimer),this.gcTimer=null)}}class Bo{constructor(e){this._hwaTimeout=NaN,this._turnOffHWA=()=>{window.clearTimeout(this._hwaTimeout),this._hwaTimeout=NaN,this.$pages.classList.toggle("is-hwa",!1)},this.pagesScrollTop=e.pagesScrollTop||0,this.containerWidth=e.containerWidth||1,this.containerHeight=e.containerHeight||1,this.pages=e.pages.map((e=>{if(e.thumbnail)return e;try{const t=new URL(e.src);return t.searchParams.set("x-oss-process","image/resize,l_50"),us(cs({},e),{thumbnail:t.toString()})}catch(Pb){return console.error(Pb),e}}));const t=Array(this.pages.length);let n=1/0,i=0;this.pagesIntrinsicHeight=this.pages.reduce(((e,r,s)=>(t[s]=e,r.width>i&&(i=r.width),r.height<=n&&(n=r.height),e+r.height)),0),this.pagesIntrinsicWidth=i,this.pagesMinHeight=n,this.pagesIntrinsicYs=t,this.scale=this._calcScale(),this.threshold=this._calcThreshold(),this.onPageIndexChanged=e.onPageIndexChanged,this.pageScrollIndex=0,0!==this.pagesScrollTop&&(this.pageScrollIndex=this.findScrollPageIndex(),this.onPageIndexChanged&&this.pageScrollIndex>0&&this.onPageIndexChanged(this.pageScrollIndex)),this.pageElManager=new Lo(this.pages,i,this.scale),this.$pages=this.renderPages()}setContainerSize(e,t){e>0&&t>0&&(e===this.containerWidth&&t===this.containerHeight||(this.containerWidth=e,this.containerHeight=t,this.$pages.style.width=`${this.containerWidth}px`,this.$pages.style.height=`${this.containerHeight}px`,this.scale=this._calcScale(),this.threshold=this._calcThreshold(),this.pageElManager.setScale(this.scale),this.$pages.parentElement&&this.pagesScrollTo(this.pagesScrollTop,!0)))}renderPages(){const e=document.createElement("div");return e.className="page-renderer-pages-container",e.style.width=`${this.containerWidth}px`,e.style.height=`${this.containerHeight}px`,e}pagesScrollTo(e,t){if(e=Ao(e,0,this.pagesIntrinsicHeight-this.containerHeight/this.scale),t||Math.abs(e-this.pagesScrollTop)>=.001){this._turnOnHWA(),this.pagesScrollTop=e;const t=this.findScrollPageIndex(),n=Math.max(t-this.threshold,0),i=Math.min(t+this.threshold,this.pages.length-1);for(let e=0;e<this.$pages.children.length;e++){const t=this.$pages.children[e],r=Number(t.dataset.index);r>=n&&r<=i||(t.remove(),e--)}for(let e=n;e<=i;e++){const t=this.pageElManager.getEl(e);t.$page.parentElement!==this.$pages&&this.$pages.appendChild(t.$page),t.translateY(this.pagesIntrinsicYs[e]-this.pagesScrollTop)}t!==this.pageScrollIndex&&(this.pageScrollIndex=t,this.onPageIndexChanged&&this.onPageIndexChanged(t))}}findScrollPageIndex(){for(let e=0;e<this.pagesIntrinsicYs.length;e++)if(this.pagesIntrinsicYs[e]+this.pages[e].height-this.pagesScrollTop>=.001)return e;return this.pagesIntrinsicYs.length-1}mount(e){e.appendChild(this.$pages),this.pagesScrollTo(this.pagesScrollTop,!0)}unmount(){this.$pages.remove()}destroy(){this.unmount(),this.onPageIndexChanged=void 0,this.pageElManager.destroy(),this._hwaTimeout&&(window.clearTimeout(this._hwaTimeout),this._hwaTimeout=NaN)}_calcScale(){return this.containerWidth/this.pagesIntrinsicWidth||1}_calcThreshold(){return Ao(Math.ceil(this.containerHeight/this.scale/this.pagesMinHeight/2),1,this.pages.length)}_turnOnHWA(){this._hwaTimeout?window.clearTimeout(this._hwaTimeout):this.$pages.classList.toggle("is-hwa",!0),this._hwaTimeout=window.setTimeout(this._turnOffHWA,1e3)}}class jo{constructor(e){this.sideEffect=new Cs,this.pagesScrollTop=e.pagesScrollTop||0,this.containerWidth=e.containerWidth||1,this.containerHeight=e.containerHeight||1,this.pagesWidth=e.pagesWidth||1,this.pagesHeight=e.pagesHeight||1,this.scale=this._calcScale(),this.scrollbarMinHeight=e.scrollbarMinHeight||30,this.scrollbarHeight=this._calcScrollbarHeight(),this.readonly=e.readonly,this.wrapClassName=e.wrapClassName,this.onDragScroll=e.onDragScroll,this.$scrollbar=this.renderScrollbar()}mount(e){e.appendChild(this.$scrollbar),this.pagesScrollTo(this.pagesScrollTop,!0)}unmount(){this.$scrollbar.remove()}setReadonly(e){this.readonly=e}setContainerSize(e,t){e>0&&t>0&&(e===this.containerWidth&&t===this.containerHeight||(this.containerWidth=e,this.containerHeight=t,this.scale=this._calcScale(),this._updateScrollbarHeight(),this.$scrollbar.parentElement&&this.pagesScrollTo(this.pagesScrollTop,!0)))}pagesScrollTo(e,t){if(e=Ao(e,0,this.pagesHeight-this.containerHeight/this.scale),t||Math.abs(e-this.pagesScrollTop)>=.001){this.pagesScrollTop=e;const t=this.pagesScrollTop*this.scale/(this.pagesHeight*this.scale-this.containerHeight)*(this.containerHeight-this.scrollbarHeight);window.requestAnimationFrame?window.requestAnimationFrame((()=>{this.$scrollbar.style.transform=`translateY(${t}px)`})):this.$scrollbar.style.transform=`translateY(${t}px)`}}destroy(){this.unmount(),this.onDragScroll=void 0,this.sideEffect.flushAll()}renderScrollbar(){const e=document.createElement("button");e.className=this.wrapClassName("scrollbar"),e.style.minHeight=`${this.scrollbarMinHeight}px`,e.style.height=`${this.scrollbarHeight}px`;const t=t=>{if(this.readonly)return;if(null!=t.button&&0!==t.button)return;ko(t);const n=this.wrapClassName("scrollbar-dragging");e.classList.toggle(n,!0);const i=this.pagesScrollTop,{clientY:r}=To(t),s=e=>{if(this.readonly)return;const{clientY:t}=To(e),n=(t-r)/this.scale;Math.abs(n)>0&&this.onDragScroll&&this.onDragScroll(i+n*(this.pagesHeight*this.scale/this.containerHeight))},a=()=>{e.classList.toggle(n,!1),window.removeEventListener("mousemove",s,!0),window.removeEventListener("touchmove",s,!0),window.removeEventListener("mouseup",a,!0),window.removeEventListener("touchend",a,!0),window.removeEventListener("touchcancel",a,!0)};window.addEventListener("mousemove",s,!0),window.addEventListener("touchmove",s,!0),window.addEventListener("mouseup",a,!0),window.addEventListener("touchend",a,!0),window.addEventListener("touchcancel",a,!0)};return this.sideEffect.addEventListener(e,"mousedown",t),this.sideEffect.addEventListener(e,"touchstart",t),e}_calcScale(){return this.containerWidth/this.pagesWidth||1}_calcScrollbarHeight(){return Ao(this.containerHeight/(this.pagesHeight*this.scale)*this.containerHeight,this.scrollbarMinHeight,this.containerHeight)}_updateScrollbarHeight(){const e=this._calcScrollbarHeight();Math.abs(e-this.scrollbarHeight)>.001&&(this.scrollbarHeight=e,this.$scrollbar.style.height=`${e}px`)}}const Ro=window.ResizeObserver||ca;class Oo{constructor({whiteboardView:e,readonly:t,box:n,pages:i,pageScrollTop:r=0,mountWhiteboard:s,onUserScroll:a}){this.sideEffect=new Cs,this.userScrolling=!1,this.onNewPageIndex=e=>{this.scrollToPage(e)},this.whiteboardView=e,this.readonly=t,this.box=n,this.pages=i,this.mountWhiteboard=s,this._onUserScroll=a;const o=this.debounce((()=>{this.userScrolling=!1,this._onUserScroll&&this._onUserScroll(this.pageRenderer.pagesScrollTop)}),{wait:80},"debounce-updateUserScroll");this.updateUserScroll=()=>{this.userScrolling=!0,o()},this.viewer=new Eo({readonly:t,box:n,pages:i,onNewPageIndex:this.onNewPageIndex});const{width:l,height:c}=this.whiteboardView.size;this.pageRenderer=new Bo({pagesScrollTop:r,pages:this.pages,containerWidth:l,containerHeight:c,onPageIndexChanged:this.viewer.setPageIndex.bind(this.viewer)}),this.scrollbar=new jo({pagesScrollTop:this.pageRenderer.pagesScrollTop,containerWidth:l,containerHeight:c,pagesWidth:this.pageRenderer.pagesIntrinsicWidth,pagesHeight:this.pageRenderer.pagesIntrinsicHeight,readonly:this.readonly,wrapClassName:this.wrapClassName.bind(this),onDragScroll:e=>{this.pageScrollTo(e),this.updateUserScroll()}}),this.pageScrollStepper=new No({start:this.pageRenderer.pagesScrollTop,onStep:e=>{this.pageScrollTo(e)}}),this.render()}mount(){this.viewer.mount(),this.setupScrollListener();const e=this.debounce(this.renderRatioHeight.bind(this),{wait:80});return this.sideEffect.add((()=>{const t=new Ro(e);return t.observe(this.viewer.$content),()=>t.disconnect()})),this.sideEffect.setTimeout((()=>{this.userScrolling||this.pageScrollTo(this.pageRenderer.pagesScrollTop)}),100),this}unmount(){return this.viewer.unmount(),this}setReadonly(e){this.readonly!==e&&(this.readonly=e,this.viewer.setReadonly(e),this.scrollbar.setReadonly(e))}destroy(){this.sideEffect.flushAll(),this.pageScrollStepper.destroy(),this._onUserScroll=void 0,this.unmount(),this.viewer.destroy(),this.pageRenderer.destroy(),this.scrollbar.destroy()}syncPageScrollTop(e){!this.userScrolling&&e>=0&&Math.abs(this.pageRenderer.pagesScrollTop-e)>.01&&this.pageScrollStepper.stepTo(e,this.pageRenderer.pagesScrollTop)}render(){this.pageRenderer.mount(this.viewer.$content),this.viewer.$content.appendChild(this.renderWhiteboardView()),this.scrollbar.mount(this.viewer.$content),this.renderRatioHeight()}renderRatioHeight(){const e=this.box.absoluteHeight,t=e<=640;if(this.viewer.setSmallBox(t),t){const t=26/640,n=26/e,i=26/640,r=0,s=Math.max((t+i-(n+r))/2,0);if(this.box.$titleBar){const e=n+s;this.box.$titleBar.style.height=100*e+"%"}if(this.box.$footer){const e=r+s;this.box.$footer.style.height=100*e+"%"}}else{if(this.box.$titleBar){const t=Math.max(26/640,26/e);this.box.$titleBar.style.height=100*t+"%"}if(this.box.$footer){const t=Math.max(26/640,26/e);this.box.$footer.style.height=100*t+"%"}}}renderWhiteboardView(){return this.$whiteboardView||(this.$whiteboardView=document.createElement("div"),this.$whiteboardView.className=this.wrapClassName("wb-view"),this.mountWhiteboard(this.$whiteboardView),this.sideEffect.addEventListener(this.$whiteboardView,"wheel",(e=>{ko(e),this.readonly||(this.pageScrollTo(this.pageRenderer.pagesScrollTop+e.deltaY),this.updateUserScroll())}),{passive:!1,capture:!0}),this.sideEffect.addEventListener(this.$whiteboardView,"touchmove",(e=>{this.readonly||e.touches.length<=1||this.updateUserScroll()}),{passive:!0,capture:!0})),this.$whiteboardView}scrollTopPageToEl(e){return e*this.pageRenderer.scale}scrollTopElToPage(e){return e/this.pageRenderer.scale}elScrollTo(e){this.pageScrollTo(this.scrollTopElToPage(e))}pageScrollTo(e){const t=this.scrollTopElToPage(this.whiteboardView.size.height/2);this.whiteboardView.moveCamera({centerY:Ao(e+t,t,this.pageRenderer.pagesIntrinsicHeight-t),animationMode:"immediately"})}scrollToPage(e){if(!this.readonly&&!Number.isNaN(e)){const t=this.pageRenderer.pagesIntrinsicYs[e];t>=0&&(this.pageScrollTo(t+5/this.pageRenderer.scale),this.updateUserScroll())}}setupScrollListener(){this.sideEffect.add((()=>{const e=e=>{const{width:t,height:n}=this.whiteboardView.size;if(t<=0||n<=0)return;const i=e.centerY-this.pageRenderer.containerHeight/this.pageRenderer.scale/2;this.pageRenderer.pagesScrollTo(i),this.scrollbar.pagesScrollTo(i)};return this.whiteboardView.callbacks.on("onCameraUpdated",e),()=>this.whiteboardView.callbacks.off("onCameraUpdated",e)})),this.sideEffect.add((()=>{const e=({width:e,height:t})=>{if(e<=0||t<=0)return;this.pageRenderer.setContainerSize(e,t),this.scrollbar.setContainerSize(e,t);const{pagesIntrinsicWidth:n,pagesIntrinsicHeight:i}=this.pageRenderer;this.whiteboardView.moveCameraToContain({originX:0,originY:this.pageRenderer.pagesScrollTop,width:n,height:t/this.pageRenderer.scale,animationMode:"immediately"}),this.whiteboardView.setCameraBound({damping:1,maxContentMode:()=>this.pageRenderer.scale,minContentMode:()=>this.pageRenderer.scale,centerX:n/2,centerY:i/2,width:n,height:i})};return this.whiteboardView.callbacks.on("onSizeUpdated",e),()=>{this.whiteboardView.callbacks.off("onSizeUpdated",e)}}),"whiteboard-size-update"),this.sideEffect.addEventListener(window,"keyup",(e=>{if(this.readonly||!this.box.focus||this.box.minimized)return;let t=null;switch(e.key){case"PageDown":t=this.pageRenderer.pagesScrollTop+this.pageRenderer.containerHeight/this.pageRenderer.scale;break;case"PageUp":t=this.pageRenderer.pagesScrollTop-this.pageRenderer.containerHeight/this.pageRenderer.scale;break;case"ArrowDown":t=this.pageRenderer.pagesScrollTop+this.pageRenderer.containerHeight/4/this.pageRenderer.scale;break;case"ArrowUp":t=this.pageRenderer.pagesScrollTop-this.pageRenderer.containerHeight/4/this.pageRenderer.scale}null!==t&&(this._onUserScroll?this._onUserScroll(t):(this.pageScrollTo(t),this.updateUserScroll()))}),{capture:!0})}debounce(e,t,n){const i=vs(e,t);return this.sideEffect.addDisposer((()=>i.cancel()),n),i}wrapClassName(e){return"netless-app-docs-viewer-static-"+e}}class Vo{constructor({context:e,whiteboardView:t,box:n,pages:i}){this.sideEffect=new Cs,this.onPlayPPT=()=>{const e=this.context.getRoom();e&&e.pptNextStep()},this._scaleDocsToFitImpl=()=>{const e=this.pages[this.getPageIndex()];e&&this.whiteboardView.moveCameraToContain({originX:-e.width/2,originY:-e.height/2,width:e.width,height:e.height,animationMode:"immediately"})},this._scaleDocsToFitDebounced=()=>{this.sideEffect.setTimeout(this._scaleDocsToFitImpl,1e3,"_scaleDocsToFitDebounced")},this.scaleDocsToFit=()=>{this._scaleDocsToFitImpl(),this._scaleDocsToFitDebounced()},this.onNewPageIndex=e=>{this.jumpToPage(e,!0)},this.context=e,this.whiteboardView=t,this.box=n,this.pages=i,this.displayer=e.getDisplayer(),this.viewer=new Eo({readonly:!e.getIsWritable(),box:n,pages:i,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlayPPT}),this.render(),this.sideEffect.add((()=>{const e=e=>{this.viewer.setReadonly(!e)};return this.context.emitter.on("writableChange",e),()=>this.context.emitter.off("writableChange",e)})),this.sideEffect.add((()=>{const e=e=>{this.jumpToPage(e.index)};return this.context.emitter.on("sceneStateChange",e),()=>this.context.emitter.off("sceneStateChange",e)}))}mount(){this.viewer.mount();const e=this.getPageIndex();return 0!==e&&this.jumpToPage(e),this.scaleDocsToFit(),this.sideEffect.add((()=>(this.whiteboardView.callbacks.on("onSizeUpdated",this.scaleDocsToFit),()=>{this.whiteboardView.callbacks.off("onSizeUpdated",this.scaleDocsToFit)}))),this}unmount(){return this.viewer.unmount(),this}destroy(){this.sideEffect.flushAll(),this.unmount(),this.viewer.destroy()}getPageIndex(){return this.displayer.state.sceneState.index}jumpToPage(e,t){var n,i;if((e=Ao(e,0,this.pages.length-1))!==this.getPageIndex()&&this.context.getIsWritable()){const t=this.context.getInitScenePath(),r=null==(i=null==(n=this.context.getScenes())?void 0:n[e])?void 0:i.name;t&&r&&this.context.setScenePath(`${t}/${r}`),this.scaleDocsToFit()}if(e!==this.viewer.pageIndex&&this.viewer.setPageIndex(e),t){const t=this.context.getRoom();if(t){const n=t.state.globalState.__pptState;t.setGlobalState({__pptState:n&&{uuid:n.uuid,pageIndex:e,disableAutoPlay:n.disableAutoPlay}})}}}render(){this.viewer.$content.appendChild(this.renderMask()),this.viewer.$content.appendChild(this.renderWhiteboardView()),this.sideEffect.addEventListener(window,"keydown",(e=>{var t;if(this.box.focus)switch(e.key){case"ArrowUp":case"ArrowLeft":this.jumpToPage(this.getPageIndex()-1,!0);break;case"ArrowRight":case"ArrowDown":null==(t=this.context.getRoom())||t.pptNextStep()}}))}renderMask(){if(!this.$mask){const e=document.createElement("div");e.className=this.wrapClassName("mask"),this.$mask=e;document.createElement("button").className=this.wrapClassName("back");document.createElement("button").className=this.wrapClassName("next")}return this.$mask}renderWhiteboardView(){return this.$whiteboardView||(this.$whiteboardView=document.createElement("div"),this.$whiteboardView.className=this.wrapClassName("wb-view"),this.sideEffect.addEventListener(this.$whiteboardView,"click",(e=>{var t;const n=this.context.getRoom();if(n&&"clicker"===n.state.memberState.currentApplianceName){for(let n=e.target;n;n=n.parentElement)if(null==(t=n.classList)?void 0:t.contains("ppt-event-source"))return;n.pptNextStep()}})),this.context.mountView(this.$whiteboardView)),this.$whiteboardView}wrapClassName(e){return"netless-app-docs-viewer-dynamic-"+e}}const _o={kind:"DocsViewer",setup(e){const t=e.getBox(),n=e.getScenes();if(!n)throw new Error("[Docs Viewer]: scenes not found.");const i=e.getView();if(!i)throw new Error("[Docs Viewer]: no whiteboard view.");const r=n.map((({ppt:e})=>e?{width:e.width,height:e.height,src:e.src,thumbnail:e.previewURL}:null)).filter((e=>Boolean(e)));if(r.length<=0)throw new Error("[Docs Viewer]: empty scenes.");t.mountStyles(".netless-app-docs-viewer-content{position:relative;height:100%;overflow:hidden}.netless-app-docs-viewer-preview-mask{display:none;position:absolute;z-index:200;top:0;left:0;width:100%;height:100%}.netless-app-docs-viewer-preview{display:flex;flex-direction:column;align-items:center;position:absolute;z-index:300;top:0;left:0;width:33%;max-width:200px;height:100%;padding-top:10px;transform:translate(-100%);background:rgba(237,237,240,.9);box-shadow:inset -1px 0 #0000001c;transition:transform .4s}.netless-app-docs-viewer-preview-active .netless-app-docs-viewer-preview-mask{display:block}.netless-app-docs-viewer-preview-active .netless-app-docs-viewer-preview{transform:translate(0)}.netless-app-docs-viewer-preview-page{position:relative;display:block;width:55%;margin-bottom:10px;font-size:0;color:transparent;outline:none;border:7px solid transparent;border-radius:4px;transition:border-color .3s;user-select:none}.netless-app-docs-viewer-preview-page:hover,.netless-app-docs-viewer-preview-page.netless-app-docs-viewer-preview-page-active{border-color:#444e601a}.netless-app-docs-viewer-preview-page>img{width:100%;height:auto;box-sizing:border-box;border:1px solid rgba(0,0,0,.5);border-radius:1px;background-color:#fff;box-shadow:0 2px 8px #0000004d}.netless-app-docs-viewer-preview-page-name{position:absolute;top:1px;left:-10px;transform:translate(-100%);text-align:right;font-size:12px;color:#5f5f5f;user-select:none}.netless-app-docs-viewer-footer{box-sizing:border-box;height:26px;display:flex;align-items:center;padding:0 16px;border-top:1px solid #eeeef7;color:#191919}.netless-app-docs-viewer-float-footer{width:100%;min-height:26px;position:absolute;left:0;bottom:0;z-index:2000;background:rgba(249,249,252,.9);transition:opacity .4s}.netless-app-docs-viewer-footer-btn{box-sizing:border-box;width:26px;height:26px;font-size:0;margin:0;padding:3px;border:none;border-radius:1px;outline:none;color:currentColor;background:transparent;transition:background .4s;cursor:pointer;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-docs-viewer-footer-btn:hover{background:rgba(237,237,240,.9)}@media (hover: none){.netless-app-docs-viewer-footer-btn:hover{background:transparent!important}}.netless-app-docs-viewer-footer-btn>svg{width:100%;height:100%}.netless-app-docs-viewer-footer-btn>svg:nth-of-type(2){display:none}.netless-app-docs-viewer-footer-btn.netless-app-docs-viewer-footer-btn-playing>svg:nth-of-type(1){display:none}.netless-app-docs-viewer-footer-btn.netless-app-docs-viewer-footer-btn-playing>svg:nth-of-type(2){display:initial}.netless-app-docs-viewer-footer-btn~.netless-app-docs-viewer-footer-btn{margin-left:15px}.netless-app-docs-viewer-page-jumps{flex:1;display:flex;justify-content:center;align-items:center}.netless-app-docs-viewer-page-number{margin-left:auto;font-size:13px;user-select:none;white-space:nowrap;word-break:keep-all}.netless-app-docs-viewer-page-number-input{border:none;outline:none;width:3em;margin:0;padding:0 2px;text-align:right;font-size:13px;line-height:1;font-weight:400;font-family:inherit;border-radius:2px;color:currentColor;background:transparent;transition:background .4s;user-select:text;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-docs-viewer-page-number-input:hover,.netless-app-docs-viewer-page-number-input:focus,.netless-app-docs-viewer-page-number-input:active{background:#fff;box-shadow:#63636333 0 2px 8px}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-footer-btn{cursor:not-allowed}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-footer-btn:hover{background:transparent}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-page-number-input{cursor:not-allowed}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-page-number-input:hover,.netless-app-docs-viewer-readonly .netless-app-docs-viewer-page-number-input:focus,.netless-app-docs-viewer-readonly .netless-app-docs-viewer-page-number-input:active{background:transparent;box-shadow:none}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-page-number-input:disabled{color:inherit}.netless-app-docs-viewer-readonly.netless-app-docs-viewer-float-footer{display:none}.telebox-color-scheme-dark .netless-app-docs-viewer-page-number-input{color:#a6a6a8}.telebox-color-scheme-dark .netless-app-docs-viewer-page-number-input:active,.telebox-color-scheme-dark .netless-app-docs-viewer-page-number-input:focus,.telebox-color-scheme-dark .netless-app-docs-viewer-page-number-input:hover{color:#222}.telebox-color-scheme-dark .netless-app-docs-viewer-footer{color:#a6a6a8;background:#2d2d33;border-top:none}.telebox-color-scheme-dark .netless-app-docs-viewer-footer-btn:hover{background:#212126}.telebox-color-scheme-dark .netless-app-docs-viewer-preview{background:rgba(50,50,50,.9)}.netless-app-docs-viewer-static-scrollbar{position:absolute;top:0;right:0;z-index:2147483647;width:8px;min-height:30px;margin:0;padding:0;border:none;outline:none;border-radius:4px;background:rgba(68,78,96,.4);box-shadow:1px 1px 8px #ffffffb3;opacity:0;transition:background .4s,opacity .4s 3s,transform .2s;user-select:none}.netless-app-docs-viewer-static-scrollbar.netless-app-docs-viewer-static-scrollbar-dragging{background:rgba(68,78,96,.6);opacity:1;transition:background .4s,opacity .4s 3s!important}.netless-app-docs-viewer-static-scrollbar:hover,.netless-app-docs-viewer-static-scrollbar:focus{background:rgba(68,78,96,.5)}.netless-app-docs-viewer-static-scrollbar:active{background:rgba(68,78,96,.6)}.netless-app-docs-viewer-content:hover .netless-app-docs-viewer-static-scrollbar{opacity:1;transition:background .4s,opacity .4s,transform .2s}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-static-scrollbar{display:none}.netless-app-docs-viewer-static-pages:hover .netless-app-docs-viewer-static-scrollbar{opacity:1;transition:background .4s,opacity .4s,transform .2s}.page-renderer-pages-container{position:relative;overflow:hidden}.page-renderer-page{position:absolute;top:0;left:0;background-position:center;background-size:cover;background-repeat:no-repeat}.page-renderer-pages-container.is-hwa .page-renderer-page{will-change:transform}.page-renderer-page-img{display:block;width:100%;height:auto;user-select:none}.netless-app-docs-viewer-static-pages{overflow:hidden;position:relative;height:100%;user-select:none}.netless-app-docs-viewer-static-page{display:block;width:100%;height:auto;user-select:none}.netless-app-docs-viewer-static-wb-view,.netless-app-docs-viewer-dynamic-wb-view{position:absolute;top:0;left:0;width:100%;height:100%;z-index:100;overflow:hidden}.netless-app-docs-viewer-dynamic-wb-view .cursor-clicker .ppt-event-source{cursor:pointer}\n"),r[0].src.startsWith("ppt")?function(e,t,n,i){t.disableCameraTransform=!0;const r=new Vo({context:e,whiteboardView:t,box:n,pages:i}).mount();e.mountView(r.$whiteboardView),e.isAddApp&&t.callbacks.once("onSizeUpdated",(({width:t,height:r})=>{if(i.length>0&&"maximized"!==n.state){const{width:s,height:a}=i[0],o=a/s*t-r;0!==o&&e.getIsWritable()&&e.emitter.emit("setBoxSize",{width:n.width,height:n.height+o/n.containerRect.height})}}))}(e,i,t,r):function(e,t,n,i){var r;t.disableCameraTransform=!e.getIsWritable();const s=new Oo({whiteboardView:t,readonly:!e.getIsWritable(),box:n,pages:i,pageScrollTop:null==(r=e.getAttributes())?void 0:r.pageScrollTop,mountWhiteboard:e.mountView.bind(e),onUserScroll:t=>{var i;(null==(i=e.getAttributes())?void 0:i.pageScrollTop)===t||n.readonly||e.updateAttributes(["pageScrollTop"],t)}}).mount();e.emitter.on("attributesUpdate",(e=>{e&&null!=e.pageScrollTop&&s.syncPageScrollTop(e.pageScrollTop)})),e.emitter.on("writableChange",(e=>{s.setReadonly(!e),t.disableCameraTransform=!e}))}(e,i,t,r)}};var Uo={exports:{}},Wo={},Ho={exports:{}},Qo={};
|
23
|
+
***************************************************************************** */function on(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]])}return n}var ln=0,cn="undefined"!=typeof window&&void 0!==window.requestAnimationFrame?function(e){return window.requestAnimationFrame(e)}:function(e){var t=Date.now(),n=Math.max(0,16.7-(t-ln));ln=t+n,setTimeout((function(){return e(ln)}),n)},un=1/60*1e3,dn=!0,hn=!1,pn=!1,fn={delta:0,timestamp:0},gn=["read","update","preRender","render","postRender"],mn=function(e){return hn=e},vn=gn.reduce((function(e,t){var n,i,r,s,a,o,l,c,u;return e[t]=(n=mn,i=[],r=[],s=0,a=!1,o=0,l=new WeakSet,c=new WeakSet,u={cancel:function(e){var t=r.indexOf(e);l.add(e),-1!==t&&r.splice(t,1)},process:function(e){var t,d;if(a=!0,i=(t=[r,i])[0],(r=t[1]).length=0,s=i.length)for(o=0;o<s;o++)(d=i[o])(e),!0!==c.has(d)||l.has(d)||(u.schedule(d),n(!0));a=!1},schedule:function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var o=n&&a,u=o?i:r;l.delete(e),t&&c.add(e),-1===u.indexOf(e)&&(u.push(e),o&&(s=i.length))}}),e}),{}),bn=gn.reduce((function(e,t){var n=vn[t];return e[t]=function(e,t,i){return void 0===t&&(t=!1),void 0===i&&(i=!1),hn||xn(),n.schedule(e,t,i),e},e}),{}),wn=function(e){return vn[e].process(fn)},yn=function(e){hn=!1,fn.delta=dn?un:Math.max(Math.min(e-fn.timestamp,40),1),dn||(un=fn.delta),fn.timestamp=e,pn=!0,gn.forEach(wn),pn=!1,hn&&(dn=!1,cn(yn))},xn=function(){hn=!0,dn=!0,pn||cn(yn)},Cn=function(){return(Cn=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},Mn=function(e,t){return function(n){return Math.max(Math.min(n,t),e)}},Sn=function(e){return e%1?Number(e.toFixed(5)):e},In=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i,En={test:function(e){return"number"==typeof e},parse:parseFloat,transform:function(e){return e}},An=Cn(Cn({},En),{transform:Mn(0,1)}),Tn=Cn(Cn({},En),{default:1}),kn=function(e){return{test:function(t){return"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length},parse:parseFloat,transform:function(t){return""+t+e}}},Nn=kn("deg"),Pn=kn("%"),zn=kn("px"),Dn=Cn(Cn({},Pn),{parse:function(e){return Pn.parse(e)/100},transform:function(e){return Pn.transform(100*e)}}),Ln=Mn(0,255),Bn=function(e){return void 0!==e.red},jn=function(e){return void 0!==e.hue},Rn=function(e){return function(t){if("string"!=typeof t)return t;for(var n={},i=(s=t,s.substring(s.indexOf("(")+1,s.lastIndexOf(")"))).replace(/(,|\/)/g," ").split(/ \s*/),r=0;r<4;r++)n[e[r]]=void 0!==i[r]?parseFloat(i[r]):1;var s;return n}},On=Cn(Cn({},En),{transform:function(e){return Math.round(Ln(e))}});function Vn(e,t){return e.startsWith(t)&&In.test(e)}var _n,Un={test:function(e){return"string"==typeof e?Vn(e,"rgb"):Bn(e)},parse:Rn(["red","green","blue","alpha"]),transform:function(e){var t,n,i=e.red,r=e.green,s=e.blue,a=e.alpha,o=void 0===a?1:a;return"rgba("+(t={red:On.transform(i),green:On.transform(r),blue:On.transform(s),alpha:Sn(An.transform(o))}).red+", "+t.green+", "+t.blue+", "+(void 0===(n=t.alpha)?1:n)+")"}},Wn={test:function(e){return"string"==typeof e?Vn(e,"hsl"):jn(e)},parse:Rn(["hue","saturation","lightness","alpha"]),transform:function(e){var t,n,i=e.hue,r=e.saturation,s=e.lightness,a=e.alpha,o=void 0===a?1:a;return"hsla("+(t={hue:Math.round(i),saturation:Pn.transform(Sn(r)),lightness:Pn.transform(Sn(s)),alpha:Sn(An.transform(o))}).hue+", "+t.saturation+", "+t.lightness+", "+(void 0===(n=t.alpha)?1:n)+")"}},Hn=Cn(Cn({},Un),{test:function(e){return"string"==typeof e&&Vn(e,"#")},parse:function(e){var t="",n="",i="";return e.length>4?(t=e.substr(1,2),n=e.substr(3,2),i=e.substr(5,2)):(t=e.substr(1,1),n=e.substr(2,1),i=e.substr(3,1),t+=t,n+=n,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:1}}}),Qn={test:function(e){return"string"==typeof e&&In.test(e)||Bn(e)||jn(e)},parse:function(e){return Un.test(e)?Un.parse(e):Wn.test(e)?Wn.parse(e):Hn.test(e)?Hn.parse(e):e},transform:function(e){return Bn(e)?Un.transform(e):jn(e)?Wn.transform(e):e}},$n=function(e){var t=e.onRead,n=e.onRender,i=e.uncachedValues,r=void 0===i?new Set:i,s=e.useCache,a=void 0===s||s;return function(e){void 0===e&&(e={});var i=on(e,[]),s={},o=[],l=!1;function c(e,t){e.startsWith("--")&&(i.hasCSSVariable=!0);var n=s[e];s[e]=t,s[e]!==n&&(-1===o.indexOf(e)&&o.push(e),l||(l=!0,bn.render(u.render)))}var u={get:function(e,n){return void 0===n&&(n=!1),n||!a||r.has(e)||void 0===s[e]?t(e,i):s[e]},set:function(e,t){if("string"==typeof e)c(e,t);else for(var n in e)c(n,e[n]);return this},render:function(e){return void 0===e&&(e=!1),(l||!0===e)&&(n(s,i,o),l=!1,o.length=0),this}};return u}},Fn=/([a-z])([A-Z])/g,Zn=function(e){return e.replace(Fn,"$1-$2").toLowerCase()},Yn=new Map,Gn=new Map,Xn=["Webkit","Moz","O","ms",""],Jn=Xn.length,Kn="undefined"!=typeof document,qn=function(e,t){return Gn.set(e,Zn(t))},ei=function(e,t){void 0===t&&(t=!1);var n,i=t?Gn:Yn;return i.has(e)||(Kn?function(e){_n=_n||document.createElement("div");for(var t=0;t<Jn;t++){var n=Xn[t],i=""===n,r=i?e:n+e.charAt(0).toUpperCase()+e.slice(1);if(r in _n.style||i){if(i&&"clipPath"===e&&Gn.has(e))return;Yn.set(e,r),qn(e,(i?"":"-")+Zn(r))}}}(e):qn(n=e,n)),i.get(e)||e},ti=["","X","Y","Z"],ni=["translate","scale","rotate","skew","transformPerspective"].reduce((function(e,t){return ti.reduce((function(e,n){return e.push(t+n),e}),e)}),["x","y","z"]),ii=ni.reduce((function(e,t){return e[t]=!0,e}),{});function ri(e){return!0===ii[e]}function si(e,t){return ni.indexOf(e)-ni.indexOf(t)}var ai=new Set(["originX","originY","originZ"]);function oi(e){return ai.has(e)}var li=an(an({},En),{transform:Math.round}),ci={color:Qn,backgroundColor:Qn,outlineColor:Qn,fill:Qn,stroke:Qn,borderColor:Qn,borderTopColor:Qn,borderRightColor:Qn,borderBottomColor:Qn,borderLeftColor:Qn,borderWidth:zn,borderTopWidth:zn,borderRightWidth:zn,borderBottomWidth:zn,borderLeftWidth:zn,borderRadius:zn,radius:zn,borderTopLeftRadius:zn,borderTopRightRadius:zn,borderBottomRightRadius:zn,borderBottomLeftRadius:zn,width:zn,maxWidth:zn,height:zn,maxHeight:zn,size:zn,top:zn,right:zn,bottom:zn,left:zn,padding:zn,paddingTop:zn,paddingRight:zn,paddingBottom:zn,paddingLeft:zn,margin:zn,marginTop:zn,marginRight:zn,marginBottom:zn,marginLeft:zn,rotate:Nn,rotateX:Nn,rotateY:Nn,rotateZ:Nn,scale:Tn,scaleX:Tn,scaleY:Tn,scaleZ:Tn,skew:Nn,skewX:Nn,skewY:Nn,distance:zn,translateX:zn,translateY:zn,translateZ:zn,x:zn,y:zn,z:zn,perspective:zn,opacity:An,originX:Dn,originY:Dn,originZ:zn,zIndex:li,fillOpacity:An,strokeOpacity:An,numOctaves:li},ui=function(e){return ci[e]},di=function(e,t){return t&&"number"==typeof e?t.transform(e):e},hi=new Set(["scrollLeft","scrollTop"]),pi=new Set(["scrollLeft","scrollTop","transform"]),fi={x:"translateX",y:"translateY",z:"translateZ"};function gi(e){return"function"==typeof e}function mi(e){var t=void 0===e?{}:e,n=t.enableHardwareAcceleration,i=void 0===n||n,r=t.isDashCase,s=void 0===r||r,a=t.allowTransformNone,o=void 0===a||a,l={},c={},u={},d=[];return function(e){return d.length=0,function(e,t,n,i,r,s,a,o){void 0===t&&(t=!0),void 0===n&&(n={}),void 0===i&&(i={}),void 0===r&&(r={}),void 0===s&&(s=[]),void 0===a&&(a=!1),void 0===o&&(o=!0);var l=!0,c=!1,u=!1;for(var d in e){var h=e[d],p=ui(d),f=di(h,p);ri(d)?(c=!0,i[d]=f,s.push(d),l&&(p.default&&h!==p.default||!p.default&&0!==h)&&(l=!1)):oi(d)?(r[d]=f,u=!0):pi.has(d)&&gi(f)||(n[ei(d,a)]=f)}(c||"function"==typeof e.transform)&&(n.transform=function(e,t,n,i,r,s){void 0===s&&(s=!0);var a="",o=!1;n.sort(si);for(var l=n.length,c=0;c<l;c++){var u=n[c];a+=(fi[u]||u)+"("+t[u]+") ",o="z"===u||o}return!o&&r?a+="translateZ(0)":a=a.trim(),gi(e.transform)?a=e.transform(t,i?"":a):s&&i&&(a="none"),a}(e,i,s,l,t,o)),u&&(n.transformOrigin=(r.originX||"50%")+" "+(r.originY||"50%")+" "+(r.originZ||0))}(e,i,l,c,u,d,s,o),l}}var vi=$n({onRead:function(e,t){var n=t.element,i=t.preparseOutput,r=ui(e);if(ri(e))return r&&r.default||0;if(hi.has(e))return n[e];var s=window.getComputedStyle(n,null).getPropertyValue(ei(e,!0))||0;return i&&r&&r.test(s)&&r.parse?r.parse(s):s},onRender:function(e,t,n){var i=t.element,r=t.buildStyles,s=t.hasCSSVariable;if(Object.assign(i.style,r(e)),s)for(var a=n.length,o=0;o<a;o++){var l=n[o];l.startsWith("--")&&i.style.setProperty(l,e[l])}-1!==n.indexOf("scrollLeft")&&(i.scrollLeft=e.scrollLeft),-1!==n.indexOf("scrollTop")&&(i.scrollTop=e.scrollTop)},uncachedValues:hi}),bi=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues"]),wi=function(e,t){return zn.transform(e*t)},yi={x:0,y:0,width:0,height:0};function xi(e,t,n){return"string"==typeof e?e:zn.transform(t+n*e)}var Ci={enableHardwareAcceleration:!1,isDashCase:!1};function Mi(e,t,n){void 0===n&&(n=!0);var i={style:{}},r=mi(Ci);return function(s){return function(e,t,n,i,r,s){void 0===t&&(t=yi),void 0===i&&(i=mi(Ci)),void 0===r&&(r={style:{}}),void 0===s&&(s=!0);var a,o,l=e.attrX,c=e.attrY,u=e.originX,d=e.originY,h=e.pathLength,p=e.pathSpacing,f=void 0===p?1:p,g=e.pathOffset,m=void 0===g?0:g,v=i(on(e,["attrX","attrY","originX","originY","pathLength","pathSpacing","pathOffset"]));for(var b in v)"transform"===b?r.style.transform=v[b]:r[s&&!bi.has(b)?Zn(b):b]=v[b];return(void 0!==u||void 0!==d||v.transform)&&(r.style.transformOrigin=(o=void 0!==d?d:.5,xi(void 0!==u?u:.5,(a=t).x,a.width)+" "+xi(o,a.y,a.height))),void 0!==l&&(r.x=l),void 0!==c&&(r.y=c),void 0!==n&&void 0!==h&&(r[s?"stroke-dashoffset":"strokeDashoffset"]=wi(-m,n),r[s?"stroke-dasharray":"strokeDasharray"]=wi(h,n)+" "+wi(f,n)),r}(s,e,t,r,i,n)}}var Si=$n({onRead:function(e,t){var n=t.element;if(ri(e=bi.has(e)?e:Zn(e))){var i=ui(e);return i&&i.default||0}return n.getAttribute(e)},onRender:function(e,t){var n=t.element,i=(0,t.buildAttrs)(e);for(var r in i)"style"===r?Object.assign(n.style,i.style):n.setAttribute(r,i[r])}}),Ii=$n({useCache:!1,onRead:function(e){return"scrollTop"===e?window.pageYOffset:window.pageXOffset},onRender:function(e){var t=e.scrollTop,n=void 0===t?0:t,i=e.scrollLeft,r=void 0===i?0:i;return window.scrollTo(r,n)}}),Ei=new WeakMap;function Ai(e,t){return n="string"==typeof e?document.querySelector(e):e,i=t,Ei.has(n)?Ei.get(n):function(e,t){var n,r,s,a,o;return e===window?n=Ii(e):(o=e)instanceof HTMLElement||"function"==typeof o.click?n=function(e,t){void 0===t&&(t={});var n=t.enableHardwareAcceleration,i=t.allowTransformNone,r=on(t,["enableHardwareAcceleration","allowTransformNone"]);return vi(an({element:e,buildStyles:mi({enableHardwareAcceleration:n,allowTransformNone:i}),preparseOutput:!0},r))}(e,t):function(e){return e instanceof SVGElement||"ownerSVGElement"in e}(e)&&(s=function(e){try{return"function"==typeof(t=e).getBBox?t.getBBox():t.getBoundingClientRect()}catch(i){return{x:0,y:0,width:0,height:0}}var t}(r=e),a=function(e){return"path"===e.tagName}(r)&&r.getTotalLength?r.getTotalLength():void 0,n=Si({element:r,buildAttrs:Mi(s,a)})),Ei.set(e,n),n}(n,i);var n,i}var Ti=function(e,t,n,i){var r=n?n.call(i,e,t):void 0;if(void 0!==r)return!!r;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var s=Object.keys(e),a=Object.keys(t);if(s.length!==a.length)return!1;for(var o=Object.prototype.hasOwnProperty.bind(t),l=0;l<s.length;l++){var c=s[l];if(!o(c))return!1;var u=e[c],d=t[c];if(!1===(r=n?n.call(i,u,d,c):void 0)||void 0===r&&u!==d)return!1}return!0};const ki="!#%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",Ni=ki.length,Pi=Array(20),zi=()=>{for(let e=0;e<20;e++)Pi[e]=ki.charAt(Math.random()*Ni);return Pi.join("")};class Di{constructor(){this.disposers=new Map}add(e,t=zi()){return this.flush(t),this.disposers.set(t,e()),t}addDisposer(e,t=zi()){return this.flush(t),this.disposers.set(t,e),t}addEventListener(e,t,n,i,r=zi()){return this.add((()=>(e.addEventListener(t,n,i),()=>e.removeEventListener(t,n,i))),r),r}setTimeout(e,t,n=zi()){return this.add((()=>{const i=window.setTimeout((()=>{this.remove(n),e()}),t);return()=>window.clearTimeout(i)}),n)}setInterval(e,t,n=zi()){return this.add((()=>{const n=window.setInterval(e,t);return()=>window.clearInterval(n)}),n)}remove(e){const t=this.disposers.get(e);return this.disposers.delete(e),t}flush(e){const t=this.remove(e);if(t)try{t()}catch(n){console.error(n)}}flushAll(){this.disposers.forEach((e=>{try{e()}catch(t){console.error(t)}})),this.disposers.clear()}}var Li,Bi,ji,Ri,Oi,Vi,_i,Ui,Wi,Hi,Qi=Object.defineProperty,$i=("undefined"!=typeof require&&require,(e,t,n)=>{return s=n,(r="symbol"!=typeof t?t+"":t)in(i=e)?Qi(i,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[r]=s,n;var i,r,s});class Fi{constructor(e,t){$i(this,"_value"),$i(this,"_beforeDestroys"),$i(this,"_subscribers"),this._value=e,t&&(this.compare=t)}get value(){return this._value}setValue(e,t){if(!this.compare(e,this._value)){const n=this._value;this._value=e,this._subscribers&&this._subscribers.forEach((i=>i(e,n,t)))}}reaction(e){return this._subscribers||(this._subscribers=new Set),this._subscribers.add(e),()=>{this._subscribers&&this._subscribers.delete(e)}}subscribe(e,t){const n=this.reaction(e);return e(this._value,void 0,t),n}derive(e,t,n){const i=new Fi(e(this.value,void 0,n),t),r=this.reaction(((t,n,r)=>{i.setValue(e(t,n,r))}));return i.addBeforeDestroy(r),i}destroy(){this._beforeDestroys&&(this._beforeDestroys.forEach((e=>e())),this._beforeDestroys.clear()),this._subscribers&&this._subscribers.clear()}addBeforeDestroy(e){return this._beforeDestroys||(this._beforeDestroys=new Set),this._beforeDestroys.add(e),()=>{this._beforeDestroys&&this._beforeDestroys.delete(e)}}compare(e,t){return e===t}}function Zi(e,t){Object.keys(t).forEach((n=>{var i,r,s,a;i=e,r=n,s=t[n],Object.defineProperties(i,{[r]:{get:()=>s.value},[`_${r}$`]:{value:s},[`set${a=r,a[0].toUpperCase()+a.slice(1)}`]:{value:(e,t)=>s.setValue(e,t)}})}))}function Yi(e){const t=t=>{const n=e.addDisposer((()=>{t.destroy()}));return t.addBeforeDestroy((()=>{e.remove(n)})),t};return{bindSideEffect:t,combine:(e,n,i,r)=>t(function(e,t,n,i){let r=e.map((e=>e.value));const s=new Fi(t(r,void 0,i),n);return e.forEach(((e,n)=>{const i=e.reaction(((e,i,a)=>{const o=r.slice();o[n]=e;const l=r;r=o,s.setValue(t(o,l,a),a)}));s.addBeforeDestroy(i)})),s}(e,n,i,r)),createVal:(e,n)=>t(new Fi(e,n))}}function Gi(e,t,n){return Math.min(Math.max(e,t),n)}function Xi(e){e.stopPropagation(),e.cancelable&&e.preventDefault()}function Ji(e){return e.touches?e.touches[0]:e}function Ki(){return Date.now().toString().slice(6)+Math.random().toString().slice(2,8)}(Bi=Li||(Li={})).Light="light",Bi.Dark="dark",Bi.Auto="auto",(Ri=ji||(ji={})).Normal="normal",Ri.Minimized="minimized",Ri.Maximized="maximized",(Vi=Oi||(Oi={})).DarkMode="dark_mode",Vi.PrefersColorScheme="prefers_color_scheme",Vi.Close="close",Vi.Focus="focus",Vi.Blur="blur",Vi.Move="move",Vi.Resize="resize",Vi.IntrinsicMove="intrinsic_move",Vi.IntrinsicResize="intrinsic_resize",Vi.VisualResize="visual_resize",Vi.ZIndex="z_index",Vi.State="state",Vi.Minimized="minimized",Vi.Maximized="maximized",Vi.Readonly="readonly",Vi.Destroyed="destroyed",(Ui=_i||(_i={})).Close="close",Ui.Maximize="maximize",Ui.Minimize="minimize",(Hi=Wi||(Wi={})).North="n",Hi.South="s",Hi.West="w",Hi.East="e",Hi.NorthWest="nw",Hi.NorthEast="ne",Hi.SouthEast="se",Hi.SouthWest="sw";let qi=1;function er(){return"New Box "+qi++}function tr(e){return Boolean(e)}function nr(e){return!e}class ir{constructor({readonly:e=!1,title:t,buttons:n,onEvent:i,onDragStart:r,namespace:s="telebox",state:a=ji.Normal}={}){this.$btns=[],this.sideEffect=new Di,this.lastTitleBarClick={timestamp:0,clientX:-100,clientY:-100},this.handleTitleBarClick=e=>{var t;if(this.readonly)return;if(0!==e.button)return;if(null==(t=e.target.dataset)?void 0:t.teleTitleBarNoDblClick)return;Xi(e);const n=Date.now();n-this.lastTitleBarClick.timestamp<=500?Math.abs(e.clientX-this.lastTitleBarClick.clientX)<=5&&Math.abs(e.clientY-this.lastTitleBarClick.clientY)<=5&&this.onEvent&&this.onEvent({type:_i.Maximize}):this.onDragStart&&this.onDragStart(e),this.lastTitleBarClick.timestamp=n,this.lastTitleBarClick.clientX=e.clientX,this.lastTitleBarClick.clientY=e.clientY},this.lastTitleBarTouch={timestamp:0,clientX:-100,clientY:-100},this.handleTitleBarTouch=e=>{var t;if(this.readonly)return;if(null==(t=e.target.dataset)?void 0:t.teleTitleBarNoDblClick)return;Xi(e);const n=Date.now(),{clientX:i=this.lastTitleBarTouch.clientX+100,clientY:r=this.lastTitleBarTouch.clientY+100}=e.touches[0]||{};n-this.lastTitleBarTouch.timestamp<=500?Math.abs(i-this.lastTitleBarTouch.clientX)<=10&&Math.abs(r-this.lastTitleBarTouch.clientY)<=10&&this.onEvent&&this.onEvent({type:_i.Maximize}):this.onDragStart&&this.onDragStart(e),this.lastTitleBarTouch.timestamp=n,this.lastTitleBarTouch.clientX=i,this.lastTitleBarTouch.clientY=r},this.readonly=e,this.onEvent=i,this.onDragStart=r,this.namespace=s,this.title=t,this.state=a,this.buttons=n||[{type:_i.Minimize,iconClassName:this.wrapClassName("titlebar-icon-minimize")},{type:_i.Maximize,iconClassName:this.wrapClassName("titlebar-icon-maximize"),isActive:e=>e===ji.Maximized},{type:_i.Close,iconClassName:this.wrapClassName("titlebar-icon-close")}],this.$dragArea=this.renderDragArea()}setTitle(e){this.title=e,this.$title&&(this.$title.textContent=e,this.$title.title=e)}setState(e){this.state!==e&&(this.state=e,this.buttons.forEach(((t,n)=>{t.isActive&&this.$btns[n].classList.toggle("is-active",t.isActive(e))})))}setReadonly(e){this.readonly!==e&&(this.readonly=e)}render(){if(!this.$titleBar){this.$titleBar=document.createElement("div"),this.$titleBar.className=this.wrapClassName("titlebar");const e=document.createElement("div");e.className=this.wrapClassName("title-area"),e.dataset.teleBoxHandle="dh",this.$title=document.createElement("h1"),this.$title.className=this.wrapClassName("title"),this.$title.dataset.teleBoxHandle="dh",this.title&&(this.$title.textContent=this.title,this.$title.title=this.title),e.appendChild(this.$title),e.appendChild(this.$dragArea);const t=document.createElement("div");t.className=this.wrapClassName("titlebar-btns"),this.buttons.forEach((({iconClassName:e,isActive:n},i)=>{const r=String(i),s=document.createElement("button");s.className=`${this.wrapClassName("titlebar-btn")} ${e}`,s.dataset.teleTitleBarBtnIndex=r,s.dataset.teleTitleBarNoDblClick="true",n&&s.classList.toggle("is-active",n(this.state)),this.$btns.push(s),t.appendChild(s)})),this.sideEffect.addEventListener(t,"click",(e=>{var t;if(this.readonly)return;const n=e.target,i=Number(null==(t=n.dataset)?void 0:t.teleTitleBarBtnIndex);if(!Number.isNaN(i)&&i<this.buttons.length){Xi(e);const t=this.buttons[i];this.onEvent&&this.onEvent({type:t.type,value:t.value})}})),this.$titleBar.appendChild(e),this.$titleBar.appendChild(t)}return this.$titleBar}renderDragArea(){const e=document.createElement("div");return e.className=this.wrapClassName("drag-area"),e.dataset.teleBoxHandle="dh",this.sideEffect.addEventListener(e,"mousedown",this.handleTitleBarClick),this.sideEffect.addEventListener(e,"touchstart",this.handleTitleBarTouch,{passive:!0}),e}dragHandle(){return this.$titleBar}wrapClassName(e){return`${this.namespace}-${e}`}destroy(){this.sideEffect.flushAll(),this.$titleBar&&(this.$titleBar=void 0,this.$title=void 0,this.$btns.length=0,this.onDragStart=void 0,this.onEvent=void 0)}}class rr{constructor({id:e=Ki(),title:t=er(),prefersColorScheme:n=Li.Light,darkMode:i,visible:r=!0,width:s=.5,height:a=.5,minWidth:o=0,minHeight:l=0,x:c=.1,y:u=.1,minimized:d=!1,maximized:h=!1,readonly:p=!1,resizable:f=!0,draggable:g=!0,fence:m=!0,fixRatio:v=!1,focus:b=!1,zIndex:w=100,namespace:y="telebox",titleBar:x,content:C,footer:M,styles:S,containerRect:I={x:0,y:0,width:window.innerWidth,height:window.innerHeight},collectorRect:E}={}){this._renderSideEffect=new Di,this.handleTrackStart=e=>{var t;return null==(t=this._handleTrackStart)?void 0:t.call(this,e)},this._sideEffect=new Di,this._valSideEffectBinder=Yi(this._sideEffect);const{combine:A,createVal:T}=this._valSideEffectBinder;this.id=e,this.namespace=y,this.events=new sn,this._delegateEvents=new sn;const k=T(n);k.reaction(((e,t,n)=>{n||this.events.emit(Oi.PrefersColorScheme,e)}));const N=T(Boolean(i));null==i&&k.subscribe(((e,t,n)=>{this._sideEffect.add((()=>{if("auto"===e){const e=window.matchMedia("(prefers-color-scheme: dark)");if(e){N.setValue(e.matches,n);const t=e=>{N.setValue(e.matches,n)};return e.addListener(t),()=>e.removeListener(t)}return sr}return N.setValue("dark"===e,n),sr}),"prefers-color-scheme")})),N.reaction(((e,t,n)=>{n||this.events.emit(Oi.DarkMode,e)}));const P=T(I,Ti),z=T(E,Ti),D=T(t),L=T(r);L.reaction(((e,t,n)=>{n||e||this.events.emit(Oi.Close)}));const B=T(p);B.reaction(((e,t,n)=>{n||this.events.emit(Oi.Readonly,e)}));const j=T(f),R=T(g),O=T(m),V=T(v),_=T(w);_.reaction(((e,t,n)=>{n||this.events.emit(Oi.ZIndex,e)}));const U=T(b);U.reaction(((e,t,n)=>{n||this.events.emit(e?Oi.Focus:Oi.Blur)}));const W=T(d);W.reaction(((e,t,n)=>{n||this.events.emit(Oi.Minimized,e)}));const H=T(h);H.reaction(((e,t,n)=>{n||this.events.emit(Oi.Maximized,e)}));const Q=A([W,H],(([e,t])=>e?ji.Minimized:t?ji.Maximized:ji.Normal));Q.reaction(((e,t,n)=>{n||this.events.emit(Oi.State,e)}));const $=T({width:Gi(o,0,1),height:Gi(l,0,1)},Ti),F=T({width:Gi(s,$.value.width,1),height:Gi(a,$.value.height,1)},Ti);$.reaction(((e,t,n)=>{F.setValue({width:Gi(s,e.width,1),height:Gi(a,e.height,1)},n)})),F.reaction(((e,t,n)=>{n||this.events.emit(Oi.IntrinsicResize,e)}));const Z=A([F,H],(([e,t])=>t?{width:1,height:1}:e),Ti);Z.reaction(((e,t,n)=>{n||this.events.emit(Oi.Resize,e)}));const Y=A([Z,W,P,z],(([e,t,n,i])=>t&&i?{width:i.width/e.width/n.width,height:i.height/e.height/n.height}:e),Ti);Y.reaction(((e,t,n)=>{n||this.events.emit(Oi.VisualResize,e)}));const G=T({x:Gi(c,0,1),y:Gi(u,0,1)},Ti);G.reaction(((e,t,n)=>{n||this.events.emit(Oi.IntrinsicMove,e)}));const X=A([G,F,P,z,W,H],(([e,t,n,i,r,s])=>r&&i?s?{x:(i.x+i.width/2)/n.width-.5,y:(i.y+i.height/2)/n.height-.5}:{x:(i.x+i.width/2)/n.width-t.width/2,y:(i.y+i.height/2)/n.height-t.height/2}:s?{x:0,y:0}:e),Ti);X.reaction(((e,t,n)=>{n||this.events.emit(Oi.Move,e)})),this.titleBar=x||new ir({readonly:B.value,title:D.value,namespace:this.namespace,onDragStart:e=>{var t;return null==(t=this._handleTrackStart)?void 0:t.call(this,e)},onEvent:e=>{if(this._delegateEvents.listeners.length>0)this._delegateEvents.emit(e.type);else switch(e.type){case _i.Maximize:H.setValue(!H.value);break;case _i.Minimize:W.setValue(!0);break;case _i.Close:L.setValue(!1);break;default:console.error("Unsupported titleBar event:",e)}}}),B.reaction((e=>{this.titleBar.setReadonly(e)}));const J=T(C),K=T(M),q=T(S);Zi(this,{prefersColorScheme:k,darkMode:N,containerRect:P,collectorRect:z,title:D,visible:L,readonly:B,resizable:j,draggable:R,fence:O,fixRatio:V,focus:U,zIndex:_,minimized:W,maximized:H,$userContent:J,$userFooter:K,$userStyles:q}),this._state$=Q,this._minSize$=$,this._size$=Z,this._intrinsicSize$=F,this._visualSize$=Y,this._coord$=X,this._intrinsicCoord$=G,this.fixRatio&&this.transform(X.value.x,X.value.y,Z.value.width,Z.value.height,!0),this.$box=this.render()}get darkMode(){return this._darkMode$.value}get state(){return this._state$.value}setState(e,t=!1){switch(e){case ji.Maximized:this.setMinimized(!1,t),this.setMaximized(!0,t);break;case ji.Minimized:this.setMinimized(!0,t),this.setMaximized(!1,t);break;default:this.setMinimized(!1,t),this.setMaximized(!1,t)}return this}get minWidth(){return this._minSize$.value.width}get minHeight(){return this._minSize$.value.height}setMinWidth(e,t=!1){return this._minSize$.setValue({width:e,height:this.minHeight},t),this}setMinHeight(e,t=!1){return this._minSize$.setValue({width:this.minWidth,height:e},t),this}get intrinsicWidth(){return this._intrinsicSize$.value.width}get intrinsicHeight(){return this._intrinsicSize$.value.height}resize(e,t,n=!1){return this._intrinsicSize$.setValue({width:e,height:t},n),this}get width(){return this._size$.value.width}get height(){return this._size$.value.height}get absoluteWidth(){return this.width*this.containerRect.width}get absoluteHeight(){return this.height*this.containerRect.height}get visualWidth(){return this._visualSize$.value.width}get visualHeight(){return this._visualSize$.value.height}get intrinsicX(){return this._intrinsicCoord$.value.x}get intrinsicY(){return this._intrinsicCoord$.value.y}move(e,t,n=!1){return this._intrinsicCoord$.setValue({x:e,y:t},n),this}get x(){return this._coord$.value.x}get y(){return this._coord$.value.y}transform(e,t,n,i,r=!1){if(this.fixRatio){const e=this.intrinsicHeight/this.intrinsicWidth*n;t!==this.intrinsicY&&(t-=e-i),i=e}return t<0&&(t=0,i>this.intrinsicHeight&&(i=this.intrinsicHeight)),this._intrinsicCoord$.setValue({x:n>=this.minWidth?e:this.intrinsicX,y:i>=this.minHeight?t:this.intrinsicY},r),this._intrinsicSize$.setValue({width:Gi(n,this.minWidth,1),height:Gi(i,this.minHeight,1)},r),this}mount(e){return e.appendChild(this.render()),this}unmount(){return this.$box&&this.$box.remove(),this}mountContent(e){return this.set$userContent(e),this}unmountContent(){return this.set$userContent(void 0),this}mountFooter(e){return this.set$userFooter(e),this}unmountFooter(){return this.set$userFooter(void 0),this}getUserStyles(){return this.$userStyles}mountStyles(e){let t;return"string"==typeof e?(t=document.createElement("style"),t.textContent=e):t=e,this.set$userStyles(t),this}unmountStyles(){return this.set$userStyles(void 0),this}render(e){if(e){if(e===this.$box)return this.$box;this.$box=e}else{if(this.$box)return this.$box;this.$box=document.createElement("div")}this._renderSideEffect.flushAll(),this.$box.classList.add(this.wrapClassName("box"));const t=(e,t,n,i=tr)=>this._renderSideEffect.add((()=>{const r=this.wrapClassName(n);return t.subscribe((t=>{e.classList.toggle(r,i(t))}))}));t(this.$box,this._readonly$,"readonly"),t(this.$box,this._draggable$,"no-drag",nr),t(this.$box,this._resizable$,"no-resize",nr),t(this.$box,this._focus$,"blur",nr),t(this.$box,this._darkMode$,"color-scheme-dark"),t(this.$box,this._darkMode$,"color-scheme-light",nr),this._renderSideEffect.add((()=>{const e=this.wrapClassName("minimized"),t=this.wrapClassName("maximized"),n="box-maximized-timer";return this._state$.subscribe((i=>{this.$box.classList.toggle(e,i===ji.Minimized),i===ji.Maximized?(this._renderSideEffect.flush(n),this.$box.classList.toggle(t,!0)):this._renderSideEffect.setTimeout((()=>{this.$box.classList.toggle(t,!1)}),0,n)}))})),this._renderSideEffect.add((()=>this._visible$.subscribe((e=>{this.$box.style.display=e?"block":"none"})))),this._renderSideEffect.add((()=>this._zIndex$.subscribe((e=>{this.$box.style.zIndex=String(e)}))));const n=Ai(this.$box);this.$box.dataset.teleBoxID=this.id,this.$box.style.width=this.absoluteWidth+"px",this.$box.style.height=this.absoluteHeight+"px";const i=this.x*this.containerRect.width+this.containerRect.x,r=this.y*this.containerRect.height+this.containerRect.y;this.$box.style.transform=`translate(${i-10}px,${r-10}px)`,this._valSideEffectBinder.combine([this._coord$,this._size$,this._minimized$,this._containerRect$,this._collectorRect$],(([e,t,n,i,r])=>{const s=t.width*i.width,a=t.height*i.height;return{width:s,height:a,x:e.x*i.width,y:e.y*i.height,scaleX:n&&r?r.width/s:1,scaleY:n&&r?r.height/a:1}}),Ti).subscribe((e=>{n.set(e)})),n.set({x:i,y:r});const s=document.createElement("div");s.className=this.wrapClassName("box-main"),this.$box.appendChild(s);const a=document.createElement("div");a.className=this.wrapClassName("titlebar-wrap"),a.appendChild(this.titleBar.render()),this.$titleBar=a;const o=document.createElement("div");o.className=this.wrapClassName("content-wrap");const l=document.createElement("div");l.className=this.wrapClassName("content")+" tele-fancy-scrollbar",this.$content=l,this._renderSideEffect.add((()=>{let e;return this._$userStyles$.subscribe((t=>{e&&e.remove(),e=t,t&&o.appendChild(t)}))})),this._renderSideEffect.add((()=>{let e;return this._$userContent$.subscribe((t=>{e&&e.remove(),e=t,t&&l.appendChild(t)}))})),o.appendChild(l);const c=document.createElement("div");return c.className=this.wrapClassName("footer-wrap"),this.$footer=c,this._renderSideEffect.add((()=>{let e;return this._$userFooter$.subscribe((t=>{e&&e.remove(),e=t,t&&c.appendChild(t)}))})),s.appendChild(a),s.appendChild(o),s.appendChild(c),this._renderResizeHandlers(),this.$box}_renderResizeHandlers(){const e=document.createElement("div");e.className=this.wrapClassName("resize-handles"),Object.values(Wi).forEach((t=>{const n=document.createElement("div");n.className=this.wrapClassName(t)+" "+this.wrapClassName("resize-handle"),n.dataset.teleBoxHandle=t,e.appendChild(n)})),this.$box.appendChild(e);const t="handle-tracking-listener",n=this.wrapClassName("transforming");let i,r,s=0,a=0,o=0,l=0,c=0,u=0;const d=e=>{if(this.state!==ji.Normal)return;Xi(e);let{pageX:t,pageY:n}=Ji(e);n<0&&(n=0);const i=(t-c)/this.containerRect.width,d=(n-u)/this.containerRect.height;switch(r){case Wi.North:this.transform(this.x,a+d,this.width,l-d);break;case Wi.South:this.transform(this.x,this.y,this.width,l+d);break;case Wi.West:this.transform(s+i,this.y,o-i,this.height);break;case Wi.East:this.transform(this.x,this.y,o+i,this.height);break;case Wi.NorthWest:this.transform(s+i,a+d,o-i,l-d);break;case Wi.NorthEast:this.transform(this.x,a+d,o+i,l-d);break;case Wi.SouthEast:this.transform(this.x,this.y,o+i,l+d);break;case Wi.SouthWest:this.transform(s+i,this.y,o-i,l+d);break;default:if(this.fence)this.move(Gi(s+i,0,1-this.width),Gi(a+d,0,1-this.height));else{const e=20/this.containerRect.width,t=20/this.containerRect.height;this.move(Gi(s+i,e-this.width,1-e),Gi(a+d,0,1-t))}}},h=e=>{r=void 0,i&&(Xi(e),this.$box.classList.toggle(n,!1),this._sideEffect.flush(t),i.remove())},p=e=>{var p;if(this.readonly)return;if(null!=e.button&&0!==e.button)return;if(!this.draggable||r||this.state!==ji.Normal)return;const f=e.target;if(null==(p=f.dataset)?void 0:p.teleBoxHandle){Xi(e),s=this.x,a=this.y,o=this.width,l=this.height,({pageX:c,pageY:u}=Ji(e)),r=f.dataset.teleBoxHandle,i||(i=document.createElement("div"));const p=r?this.wrapClassName(`cursor-${r}`):"";i.className=this.wrapClassName("track-mask"+(p?` ${p}`:"")),this.$box.appendChild(i),this.$box.classList.add(n),this._sideEffect.add((()=>(window.addEventListener("mousemove",d),window.addEventListener("touchmove",d,{passive:!1}),window.addEventListener("mouseup",h),window.addEventListener("touchend",h,{passive:!1}),window.addEventListener("touchcancel",h,{passive:!1}),()=>{window.removeEventListener("mousemove",d),window.removeEventListener("touchmove",d),window.removeEventListener("mouseup",h),window.removeEventListener("touchend",h),window.removeEventListener("touchcancel",h)})),t)}};this._handleTrackStart=p,this._sideEffect.addEventListener(e,"mousedown",p,{},"box-resizeHandles-mousedown"),this._sideEffect.addEventListener(e,"touchstart",p,{passive:!1},"box-resizeHandles-touchstart")}destroy(){this.$box.remove(),this.events.emit(Oi.Destroyed),this._sideEffect.flushAll(),this._renderSideEffect.flushAll(),this.events.removeAllListeners(),this._delegateEvents.removeAllListeners()}wrapClassName(e){return`${this.namespace}-${e}`}}function sr(){}var ar,or;class lr{constructor({visible:e=!0,readonly:t=!1,darkMode:n=!1,namespace:i="telebox",styles:r={},onClick:s}={}){this.handleCollectorClick=()=>{!this._readonly&&this.onClick&&this.onClick()},this._visible=e,this._readonly=t,this._darkMode=n,this.namespace=i,this.styles=r,this.onClick=s}get visible(){return this._visible}get readonly(){return this._readonly}get darkMode(){return this._darkMode}mount(e){return e.appendChild(this.render()),this}unmount(){return this.$collector&&this.$collector.remove(),this}setVisible(e){return this._visible!==e&&(this._visible=e,this.$collector&&this.$collector.classList.toggle(this.wrapClassName("collector-visible"),e)),this}setReadonly(e){return this._readonly!==e&&(this._readonly=e,this.$collector&&this.$collector.classList.toggle(this.wrapClassName("collector-readonly"),e)),this}setDarkMode(e){return this._darkMode!==e&&(this._darkMode=e,this.$collector&&(this.$collector.classList.toggle(this.wrapClassName("color-scheme-dark"),e),this.$collector.classList.toggle(this.wrapClassName("color-scheme-light"),!e))),this}setStyles(e){if(Object.assign(this.styles,e),this.$collector){const t=this.$collector;Object.keys(e).forEach((n=>{const i=e[n];null!=i&&(t.style[n]=i)}))}return this}render(){return this.$collector||(this.$collector=document.createElement("button"),this.$collector.className=this.wrapClassName("collector"),this.$collector.style.backgroundImage="url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxOCAxNiI+CiAgICA8ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxwYXRoIHN0cm9rZT0iIzdCODhBMCIgc3Ryb2tlLXdpZHRoPSIxLjQiIGQ9Ik0uNyAxLjJoMTYuNnYxMy42SC43eiIgLz4KICAgICAgICA8cGF0aCBmaWxsPSIjN0I4OEEwIiBkPSJNNCA1LjVoNnYxLjRINHpNNCA5LjVoMTB2MS40SDR6IiAvPgogICAgPC9nPgo8L3N2Zz4K')",this.$collector.addEventListener("click",this.handleCollectorClick),this._visible&&this.$collector.classList.add(this.wrapClassName("collector-visible")),this._readonly&&this.$collector.classList.add(this.wrapClassName("collector-readonly")),this.$collector.classList.add(this.wrapClassName(this._darkMode?"color-scheme-dark":"color-scheme-light")),this.setStyles(this.styles)),this.$collector}destroy(){this.$collector&&(this.$collector.removeEventListener("click",this.handleCollectorClick),this.$collector.remove(),this.$collector=void 0),this.onClick=void 0}wrapClassName(e){return`${this.namespace}-${e}`}}(or=ar||(ar={})).Focused="focused",or.Blurred="blurred",or.Created="created",or.Removed="removed",or.State="state",or.Maximized="maximized",or.Minimized="minimized",or.Move="move",or.Resize="resize",or.IntrinsicMove="intrinsic_move",or.IntrinsicResize="intrinsic_resize",or.VisualResize="visual_resize",or.ZIndex="z_index",or.PrefersColorScheme="prefers_color_scheme",or.DarkMode="dark_mode";class cr extends ir{constructor(e){super(e),this.boxes=e.boxes,this.focusedBox=e.focusedBox,this.containerRect=e.containerRect,this.darkMode=e.darkMode}focusBox(e){var t;if(!this.focusedBox||this.focusedBox!==e){if(this.$titles&&this.state===ji.Maximized){const{children:n}=this.$titles.firstElementChild;for(let i=n.length-1;i>=0;i-=1){const r=n[i],s=null==(t=r.dataset)?void 0:t.teleBoxID;s&&(e&&s===e.id?r.classList.toggle(this.wrapClassName("titles-tab-focus"),!0):this.focusedBox&&s===this.focusedBox.id&&r.classList.toggle(this.wrapClassName("titles-tab-focus"),!1))}}this.focusedBox=e}}setContainerRect(e){if(this.containerRect=e,this.$titleBar){const{x:t,y:n,width:i}=e;this.$titleBar.style.transform=`translate(${t}px, ${n}px)`,this.$titleBar.style.width=i+"px"}}setBoxes(e){this.boxes=e,this.updateTitles()}setState(e){super.setState(e),this.$titleBar&&this.$titleBar.classList.toggle(this.wrapClassName("max-titlebar-maximized"),e===ji.Maximized),this.updateTitles()}setReadonly(e){super.setReadonly(e),this.$titleBar&&this.$titleBar.classList.toggle(this.wrapClassName("readonly"),this.readonly)}setDarkMode(e){e!==this.darkMode&&(this.darkMode=e,this.$titleBar&&(this.$titleBar.classList.toggle(this.wrapClassName("color-scheme-dark"),e),this.$titleBar.classList.toggle(this.wrapClassName("color-scheme-light"),!e)))}render(){const e=super.render(),{x:t,y:n,width:i}=this.containerRect;e.style.transform=`translate(${t}px, ${n}px)`,e.style.width=i+"px",e.classList.add(this.wrapClassName("max-titlebar")),e.classList.toggle(this.wrapClassName("max-titlebar-maximized"),this.state===ji.Maximized),e.classList.toggle(this.wrapClassName("readonly"),this.readonly),e.classList.add(this.wrapClassName(this.darkMode?"color-scheme-dark":"color-scheme-light"));const r=document.createElement("div");return r.classList.add(this.wrapClassName("titles-area")),e.insertBefore(r,e.firstElementChild),this.updateTitles(),e}destroy(){super.destroy(),this.$titles=void 0,this.boxes.length=0,this.focusedBox=void 0}updateTitles(){this.$titleBar&&this.state===ji.Maximized&&(this.$titleBar.classList.toggle(this.wrapClassName("max-titlebar-single-title"),1===this.boxes.length),1===this.boxes.length?this.setTitle(this.boxes[0].title):this.$titleBar.replaceChild(this.renderTitles(),this.$titleBar.firstElementChild))}renderTitles(){this.$titles=document.createElement("div"),this.$titles.className=this.wrapClassName("titles"),this.$titles.addEventListener("wheel",(e=>{e.currentTarget.scrollBy({left:e.deltaY>0?250:-250,behavior:"smooth"})}),{passive:!1});const e=document.createElement("div");return e.className=this.wrapClassName("titles-content"),this.$titles.appendChild(e),this.boxes.forEach((t=>{const n=document.createElement("button");n.className=this.wrapClassName("titles-tab"),n.textContent=t.title,n.dataset.teleBoxID=t.id,n.dataset.teleTitleBarNoDblClick="true",this.focusedBox&&t.id===this.focusedBox.id&&n.classList.add(this.wrapClassName("titles-tab-focus")),e.appendChild(n)})),this.$titles}}class ur{constructor({root:e=document.body,prefersColorScheme:t=Li.Light,minimized:n=!1,maximized:i=!1,fence:r=!0,containerRect:s={x:0,y:0,width:window.innerWidth,height:window.innerHeight},collector:a,namespace:o="telebox",readonly:l=!1}={}){this.events=new sn,this._sideEffect=new Di;const{combine:c,createVal:u}=Yi(this._sideEffect);this.root=e,this.namespace=o,this.boxes$=u([]),this.topBox$=this.boxes$.derive((e=>{if(e.length>0)return e.reduce(((e,t)=>e.zIndex>t.zIndex?e:t))}));const d=window.matchMedia("(prefers-color-scheme: dark)"),h=u(!1);d&&(h.setValue(d.matches),this._sideEffect.add((()=>{const e=e=>{h.setValue(e.matches)};return d.addListener(e),()=>d.removeListener(e)})));const p=u(t);p.reaction(((e,t,n)=>{this.boxes.forEach((t=>t.setPrefersColorScheme(e,n))),n||this.events.emit(ar.PrefersColorScheme,e)})),this._darkMode$=c([h,p],(([e,t])=>"auto"===t?e:"dark"===t)),this._darkMode$.reaction(((e,t,n)=>{this.boxes.forEach((t=>t.setDarkMode(e,n))),n||this.events.emit(ar.DarkMode,e)}));const f=u(l);f.reaction(((e,t,n)=>{this.boxes.forEach((t=>t.setReadonly(e,n)))}));const g=u(n),m=u(i);m.reaction(((e,t,n)=>{this.boxes.forEach((t=>t.setMaximized(e,n))),n||this.events.emit(ar.Maximized,e)}));const v=c([g,m],(([e,t])=>e?ji.Minimized:t?ji.Maximized:ji.Normal));v.reaction(((e,t,n)=>{this.maxTitleBar.setState(e),n||this.events.emit(ar.State,e)}));const b=u(r);b.subscribe(((e,t,n)=>{this.boxes.forEach((t=>t.setFence(e,n)))}));const w=u(s,Ti);w.reaction(((e,t,n)=>{this.boxes.forEach((t=>t.setContainerRect(e,n))),this.maxTitleBar.setContainerRect(e)}));const y=u(null===a?null:a||new lr({visible:n,readonly:l,namespace:o}).mount(e));y.subscribe((e=>{e&&(e.setVisible(g.value),e.setReadonly(f.value),e.setDarkMode(this._darkMode$.value),this._sideEffect.add((()=>(e.onClick=()=>{f.value||g.setValue(!1)},()=>e.destroy())),"collect-onClick"))})),f.subscribe((e=>{var t;return null==(t=y.value)?void 0:t.setReadonly(e)})),this._darkMode$.subscribe((e=>{var t;null==(t=y.value)||t.setDarkMode(e)}));const x=()=>{var e;if(null==(e=y.value)?void 0:e.$collector){const{x:e,y:t,width:n,height:i}=y.value.$collector.getBoundingClientRect(),r=this.root.getBoundingClientRect();return{x:e-r.x,y:t-r.y,width:n,height:i}}},C=u(g.value?x():void 0);C.subscribe(((e,t,n)=>{this.boxes.forEach((t=>{t.setCollectorRect(e,n)}))})),g.subscribe(((e,t,n)=>{var i,r;null==(i=y.value)||i.setVisible(e),e&&(null==(r=y.value)?void 0:r.$collector)&&C.setValue(x()),this.boxes.forEach((t=>t.setMinimized(e,n))),n||this.events.emit(ar.Minimized,e)}));const M=this.wrapClassName("titlebar-icon-close"),S=e=>{var t;if(f.value)return;const n=e.target;if(n.tagName)for(let i=n;i;i=i.parentElement){if(i.classList&&i.classList.contains(M))return;const e=null==(t=i.dataset)?void 0:t.teleBoxID;if(e){const t=this.getBox(e);if(t)return this.focusBox(t),void this.makeBoxTop(t)}}};this._sideEffect.addEventListener(window,"mousedown",S,!0),this._sideEffect.addEventListener(window,"touchstart",S,!0),this.maxTitleBar=new cr({darkMode:this.darkMode,readonly:f.value,namespace:this.namespace,state:v.value,boxes:this.boxes$.value,containerRect:w.value,onEvent:e=>{switch(e.type){case _i.Maximize:m.setValue(!m.value);break;case _i.Minimize:g.setValue(!0);break;case Oi.Close:this.removeTopBox(),this.focusTopBox()}}}),f.subscribe((e=>this.maxTitleBar.setReadonly(e))),this._darkMode$.subscribe((e=>{this.maxTitleBar.setDarkMode(e)})),this.boxes$.reaction((e=>{this.maxTitleBar.setBoxes(e)})),Zi(this,{prefersColorScheme:p,containerRect:w,collector:y,collectorRect:C,readonly:f,fence:b,minimized:g,maximized:m}),this._state$=v,this.root.appendChild(this.maxTitleBar.render())}get boxes(){return this.boxes$.value}get topBox(){return this.topBox$.value}get darkMode(){return this._darkMode$.value}get state(){return this._state$.value}setState(e,t=!1){switch(e){case ji.Maximized:this.setMinimized(!1,t),this.setMaximized(!0,t);break;case ji.Minimized:this.setMinimized(!0,t),this.setMaximized(!1,t);break;default:this.setMinimized(!1,t),this.setMaximized(!1,t)}return this}create(e={},t=!0){const n=new rr(nn(tn({zIndex:this.topBox?this.topBox.zIndex+1:100},t?this.smartPosition(e):e),{darkMode:this.darkMode,prefersColorScheme:this.prefersColorScheme,maximized:this.maximized,minimized:this.minimized,fence:this.fence,namespace:this.namespace,containerRect:this.containerRect,readonly:this.readonly,collectorRect:this.collectorRect}));return n.mount(this.root),n.focus&&(this.focusBox(n),t&&this.makeBoxTop(n)),this.boxes$.setValue([...this.boxes,n]),n._delegateEvents.on(_i.Maximize,(()=>{this.setMaximized(!this.maximized)})),n._delegateEvents.on(_i.Minimize,(()=>{this.setMinimized(!0)})),n._delegateEvents.on(_i.Close,(()=>{this.remove(n),this.focusTopBox()})),n._coord$.reaction(((e,t,i)=>{i||this.events.emit(ar.Move,n)})),n._size$.reaction(((e,t,i)=>{i||this.events.emit(ar.Resize,n)})),n._intrinsicCoord$.reaction(((e,t,i)=>{i||this.events.emit(ar.IntrinsicMove,n)})),n._intrinsicSize$.reaction(((e,t,i)=>{i||this.events.emit(ar.IntrinsicResize,n)})),n._visualSize$.reaction(((e,t,i)=>{i||this.events.emit(ar.VisualResize,n)})),n._zIndex$.reaction(((e,t,i)=>{if(this.boxes.length>0){const e=this.boxes.reduce(((e,t)=>e.zIndex>t.zIndex?e:t));this.topBox$.setValue(e)}i||this.events.emit(ar.ZIndex,n)})),this.events.emit(ar.Created,n),n}query(e){return e?this.boxes.filter(this.teleBoxMatcher(e)):[...this.boxes]}queryOne(e){return e?this.boxes.find(this.teleBoxMatcher(e)):this.boxes[0]}update(e,t,n=!1){const i=this.boxes.find((t=>t.id===e));if(i)return this.updateBox(i,t,n)}updateAll(e,t=!1){this.boxes.forEach((n=>{this.updateBox(n,e,t)}))}remove(e,t=!1){const n=this.getBoxIndex(e);if(n>=0){const e=this.boxes.slice(),i=e.splice(n,1);return this.boxes$.setValue(e),i.forEach((e=>e.destroy())),t||(this.boxes.length<=0&&(this.setMaximized(!1),this.setMinimized(!1)),this.events.emit(ar.Removed,i)),i[0]}}removeTopBox(){if(this.topBox)return this.remove(this.topBox)}removeAll(e=!1){const t=this.boxes$.value;return this.boxes$.setValue([]),t.forEach((e=>e.destroy())),e||(this.boxes.length<=0&&(this.setMaximized(!1),this.setMinimized(!1)),this.events.emit(ar.Removed,t)),t}destroy(e=!1){this.events.removeAllListeners(),this._sideEffect.flushAll(),this.removeAll(e),Object.keys(this).forEach((e=>{const t=this[e];t instanceof Fi&&t.destroy()}))}wrapClassName(e){return`${this.namespace}-${e}`}focusBox(e,t=!1){const n=this.getBox(e);n&&(this.boxes.forEach((e=>{if(n===e){let e=!1;n.focus||(e=!0,n.setFocus(!0,t)),e&&!t&&this.events.emit(ar.Focused,n)}else e.focus&&this.blurBox(e,t)})),this.maxTitleBar.focusBox(n))}focusTopBox(){if(this.topBox&&!this.topBox.focus)return this.focusBox(this.topBox)}blurBox(e,t=!1){const n=this.getBox(e);n&&(n.focus&&(n.setFocus(!1,t),t||this.events.emit(ar.Blurred,n)),this.maxTitleBar.focusedBox===n&&this.maxTitleBar.focusBox())}blurAll(e=!1){this.boxes.forEach((t=>{t.focus&&(t.setFocus(!1,e),e||this.events.emit(ar.Blurred,t))})),this.maxTitleBar.focusedBox&&this.maxTitleBar.focusBox()}teleBoxMatcher(e){const t=Object.keys(e);return n=>t.every((t=>e[t]===n[t]))}updateBox(e,t,n=!1){null==t.x&&null==t.y||e.move(null==t.x?e.intrinsicX:t.x,null==t.y?e.intrinsicY:t.y,n),null==t.width&&null==t.height||e.resize(null==t.width?e.intrinsicWidth:t.width,null==t.height?e.intrinsicHeight:t.height,n),null!=t.title&&(e.setTitle(t.title),this.maxTitleBar.updateTitles()),null!=t.visible&&e.setVisible(t.visible,n),null!=t.minHeight&&e.setMinHeight(t.minHeight,n),null!=t.minWidth&&e.setMinWidth(t.minWidth,n),null!=t.resizable&&e.setResizable(t.resizable,n),null!=t.draggable&&e.setDraggable(t.draggable,n),null!=t.fixRatio&&e.setFixRatio(t.fixRatio,n),null!=t.zIndex&&e.setZIndex(t.zIndex,n),null!=t.content&&e.mountContent(t.content),null!=t.footer&&e.mountFooter(t.footer)}smartPosition(e={}){let{x:t,y:n}=e;const{width:i=.5,height:r=.5}=e;if(null==t){let e=20;this.topBox&&(e=this.topBox.intrinsicX*this.containerRect.width+20,e>this.containerRect.width-i*this.containerRect.width&&(e=20)),t=e/this.containerRect.width}if(null==n){let e=20;this.topBox&&(e=this.topBox.intrinsicY*this.containerRect.height+20,e>this.containerRect.height-r*this.containerRect.height&&(e=20)),n=e/this.containerRect.height}return nn(tn({},e),{x:t,y:n,width:i,height:r})}makeBoxTop(e,t=!1){this.topBox&&e!==this.topBox&&e.setZIndex(this.topBox.zIndex+1,t)}getBoxIndex(e){return"string"==typeof e?this.boxes.findIndex((t=>t.id===e)):this.boxes.findIndex((t=>t===e))}getBox(e){return"string"==typeof e?this.boxes.find((t=>t.id===e)):e}}class dr{constructor(e,t){this.context=e,this.createTeleBoxManagerConfig=t;const{emitter:n,callbacks:i}=e;this.teleBoxManager=this.setupBoxManager(t),this.teleBoxManager._state$.reaction((e=>{i.emit("boxStateChange",e),n.emit("boxStateChange",e)})),this.teleBoxManager._darkMode$.reaction((e=>{i.emit("darkModeChange",e)})),this.teleBoxManager._prefersColorScheme$.reaction((e=>{i.emit("prefersColorSchemeChange",e)})),this.teleBoxManager.events.on("minimized",(e=>{if(this.context.safeSetAttributes({minimized:e}),e)this.context.cleanFocus(),this.blurAllBox();else{const e=this.getTopBox();e&&(this.context.setAppFocus(e.id),this.focusBox({appId:e.id},!1))}})),this.teleBoxManager.events.on("maximized",(e=>{this.context.safeSetAttributes({maximized:e})})),this.teleBoxManager.events.on("removed",(e=>{e.forEach((e=>{n.emit("close",{appId:e.id})}))})),this.teleBoxManager.events.on("intrinsic_move",p((e=>{n.emit("move",{appId:e.id,x:e.intrinsicX,y:e.intrinsicY})}),50)),this.teleBoxManager.events.on("intrinsic_resize",p((e=>{n.emit("resize",{appId:e.id,width:e.intrinsicWidth,height:e.intrinsicHeight})}),200)),this.teleBoxManager.events.on("focused",(e=>{e&&(this.canOperate?n.emit("focus",{appId:e.id}):this.teleBoxManager.blurBox(e.id))})),this.teleBoxManager.events.on("z_index",(e=>{this.context.updateAppState(e.id,J.ZIndex,e.zIndex)})),n.on("playgroundSizeChange",(()=>this.updateManagerRect())),n.on("updateManagerRect",(()=>this.updateManagerRect()))}get mainView(){return this.context.getMainView()}get canOperate(){return this.context.canOperate()}get boxState(){return this.teleBoxManager.state}get maximized(){return this.teleBoxManager.maximized}get minimized(){return this.teleBoxManager.minimized}get darkMode(){return this.teleBoxManager.darkMode}get prefersColorScheme(){return this.teleBoxManager.prefersColorScheme}get boxSize(){return this.teleBoxManager.boxes.length}createBox(t){var n,i,r;if(!this.teleBoxManager)return;let{minwidth:s=re,minheight:a=se}=null!=(n=t.app.config)?n:{};const{width:o,height:l}=null!=(i=t.app.config)?i:{},c=(null==(r=t.options)?void 0:r.title)||t.appId,u=this.teleBoxManager.containerRect;s>1&&(s/=u.width),a>1&&(a/=u.height);const d={title:c,minWidth:s,minHeight:a,width:o,height:l,id:t.appId};this.teleBoxManager.create(d,t.smartPosition),this.context.emitter.emit(`${t.appId}${e.WindowCreated}`)}setBoxInitState(e){const t=this.teleBoxManager.queryOne({id:e});t&&t.state===ji.Maximized&&this.context.emitter.emit("resize",{appId:e,x:t.x,y:t.y,width:t.intrinsicWidth,height:t.intrinsicHeight})}setupBoxManager(e){const t=Pb.wrapper?Pb.wrapper:document.body,n=t.getBoundingClientRect(),i={root:t,containerRect:{x:0,y:0,width:n.width,height:n.height},fence:!1,prefersColorScheme:null==e?void 0:e.prefersColorScheme},r=new ur(i);this.teleBoxManager&&this.teleBoxManager.destroy(),this.teleBoxManager=r;const s=(null==e?void 0:e.collectorContainer)||Pb.wrapper;return s&&this.setCollectorContainer(s),r}setCollectorContainer(e){var t;const n=new lr({styles:null==(t=this.createTeleBoxManagerConfig)?void 0:t.collectorStyles}).mount(e);this.teleBoxManager.setCollector(n)}getBox(e){return this.teleBoxManager.queryOne({id:e})}closeBox(e,t=!1){return this.teleBoxManager.remove(e,t)}boxIsFocus(e){const t=this.getBox(e);return null==t?void 0:t.focus}getFocusBox(){return this.teleBoxManager.query({focus:!0})[0]}getTopBox(){return this.teleBoxManager.topBox}updateBoxState(e){if(!e)return;const t=this.getBox(e.id);t&&(this.teleBoxManager.update(t.id,{x:e.x,y:e.y,width:e.width||.5,height:e.height||.5,zIndex:e.zIndex},!0),setTimeout((()=>{e.focus&&this.teleBoxManager.focusBox(t.id,!0),null!=e.maximized&&this.teleBoxManager.setMaximized(Boolean(e.maximized),!0),null!=e.minimized&&this.teleBoxManager.setMinimized(Boolean(e.minimized),!0)}),50),this.context.callbacks.emit("boxStateChange",this.teleBoxManager.state))}updateManagerRect(){var e;const t=null==(e=this.mainView.divElement)?void 0:e.getBoundingClientRect();if(t&&t.width>0&&t.height>0){const e={x:0,y:0,width:t.width,height:t.height};this.teleBoxManager.setContainerRect(e),this.context.notifyContainerRectUpdate(this.teleBoxManager.containerRect)}}moveBox({appId:e,x:t,y:n}){this.teleBoxManager.update(e,{x:t,y:n},!0)}focusBox({appId:e},t=!0){this.teleBoxManager.focusBox(e,t)}resizeBox({appId:e,width:t,height:n,skipUpdate:i}){this.teleBoxManager.update(e,{width:t,height:n},i)}setBoxMinSize(e){this.teleBoxManager.update(e.appId,{minWidth:e.minWidth,minHeight:e.minHeight},!0)}setBoxTitle(e){this.teleBoxManager.update(e.appId,{title:e.title},!0)}blurAllBox(){this.teleBoxManager.blurAll()}updateAll(e){this.teleBoxManager.updateAll(e)}setMaximized(e,t=!0){e!==this.maximized&&this.teleBoxManager.setMaximized(e,t)}setMinimized(e,t=!0){this.teleBoxManager.setMinimized(e,t)}focusTopBox(){if(this.teleBoxManager.query().length>=1){const e=this.getTopBox();e&&this.focusBox({appId:e.id},!1)}}updateBox(e,t,n=!0){this.teleBoxManager.update(e,t,n)}setReadonly(e){this.teleBoxManager.setReadonly(e)}setPrefersColorScheme(e){this.teleBoxManager.setPrefersColorScheme(e)}setZIndex(e,t,n=!0){this.teleBoxManager.update(e,{zIndex:t},n)}destroy(){this.teleBoxManager.destroy()}}function hr(){}function pr(e){return e()}function fr(){return Object.create(null)}function gr(e){e.forEach(pr)}function mr(e){return"function"==typeof e}function vr(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}let br,wr;function yr(e,t){return br||(br=document.createElement("a")),br.href=t,e===br.href}function xr(e,t){e.appendChild(t)}function Cr(e,t,n){e.insertBefore(t,n||null)}function Mr(e){e.parentNode.removeChild(e)}function Sr(e){return document.createElement(e)}function Ir(e){return document.createTextNode(e)}function Er(){return Ir(" ")}function Ar(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function Tr(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function kr(e,t,n,i){e.style.setProperty(t,n,i?"important":"")}function Nr(e){wr=e}const Pr=[],zr=[],Dr=[],Lr=[],Br=Promise.resolve();let jr=!1;function Rr(e){Dr.push(e)}let Or=!1;const Vr=new Set;function _r(){if(!Or){Or=!0;do{for(let e=0;e<Pr.length;e+=1){const t=Pr[e];Nr(t),Ur(t.$$)}for(Nr(null),Pr.length=0;zr.length;)zr.pop()();for(let e=0;e<Dr.length;e+=1){const t=Dr[e];Vr.has(t)||(Vr.add(t),t())}Dr.length=0}while(Pr.length);for(;Lr.length;)Lr.pop()();jr=!1,Or=!1,Vr.clear()}}function Ur(e){if(null!==e.fragment){e.update(),gr(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(Rr)}}const Wr=new Set;function Hr(e,t){-1===e.$$.dirty[0]&&(Pr.push(e),jr||(jr=!0,Br.then(_r)),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function Qr(e,t,n,i,r,s,a,o=[-1]){const l=wr;Nr(e);const c=e.$$={fragment:null,ctx:null,props:s,update:hr,not_equal:r,bound:fr(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(l?l.$$.context:t.context||[]),callbacks:fr(),dirty:o,skip_bound:!1,root:t.target||l.$$.root};a&&a(c.root);let u=!1;if(c.ctx=n?n(e,t.props||{},((t,n,...i)=>{const s=i.length?i[0]:n;return c.ctx&&r(c.ctx[t],c.ctx[t]=s)&&(!c.skip_bound&&c.bound[t]&&c.bound[t](s),u&&Hr(e,t)),n})):[],c.update(),u=!0,gr(c.before_update),c.fragment=!!i&&i(c.ctx),t.target){if(t.hydrate){const e=(p=t.target,Array.from(p.childNodes));c.fragment&&c.fragment.l(e),e.forEach(Mr)}else c.fragment&&c.fragment.c();t.intro&&((d=e.$$.fragment)&&d.i&&(Wr.delete(d),d.i(h))),function(e,t,n,i){const{fragment:r,on_mount:s,on_destroy:a,after_update:o}=e.$$;r&&r.m(t,n),i||Rr((()=>{const t=s.map(pr).filter(mr);a?a.push(...t):gr(t),e.$$.on_mount=[]})),o.forEach(Rr)}(e,t.target,t.anchor,t.customElement),_r()}var d,h,p;Nr(l)}function $r(e){let t,n,i,r,s,a,o=e[14]&&Fr(e),l=e[15]&&Zr(e);return{c(){t=Sr("div"),n=Sr("div"),o&&o.c(),i=Er(),r=Sr("span"),s=Ir(e[0]),a=Er(),l&&l.c(),kr(r,"overflow","hidden"),kr(r,"white-space","nowrap"),kr(r,"text-overflow","ellipsis"),kr(r,"max-width","80px"),Ar(n,"class",e[8]),kr(n,"background-color",e[2]),kr(n,"color",e[9]),kr(n,"opacity",e[11]),Ar(t,"class","netless-window-manager-cursor-name")},m(e,c){Cr(e,t,c),xr(t,n),o&&o.m(n,null),xr(n,i),xr(n,r),xr(r,s),xr(n,a),l&&l.m(n,null)},p(e,t){e[14]?o?o.p(e,t):(o=Fr(e),o.c(),o.m(n,i)):o&&(o.d(1),o=null),1&t&&Tr(s,e[0]),e[15]?l?l.p(e,t):(l=Zr(e),l.c(),l.m(n,null)):l&&(l.d(1),l=null),256&t&&Ar(n,"class",e[8]),4&t&&kr(n,"background-color",e[2]),512&t&&kr(n,"color",e[9]),2048&t&&kr(n,"opacity",e[11])},d(e){e&&Mr(t),o&&o.d(),l&&l.d()}}}function Fr(e){let t,n;return{c(){t=Sr("img"),Ar(t,"class","netless-window-manager-cursor-selector-avatar"),Ar(t,"style",e[16]()),yr(t.src,n=e[7])||Ar(t,"src",n),Ar(t,"alt","avatar")},m(e,n){Cr(e,t,n)},p(e,i){128&i&&!yr(t.src,n=e[7])&&Ar(t,"src",n)},d(e){e&&Mr(t)}}}function Zr(e){let t,n;return{c(){t=Sr("span"),n=Ir(e[1]),Ar(t,"class","netless-window-manager-cursor-tag-name"),kr(t,"background-color",e[10])},m(e,i){Cr(e,t,i),xr(t,n)},p(e,i){2&i&&Tr(n,e[1]),1024&i&&kr(t,"background-color",e[10])},d(e){e&&Mr(t)}}}function Yr(e){let t,n,i,r,s,a,o=!e[12]&&$r(e);return{c(){t=Sr("div"),o&&o.c(),n=Er(),i=Sr("div"),r=Sr("img"),Ar(r,"class",s="netless-window-manager-cursor-"+e[3]+"-image"),yr(r.src,a=e[6])||Ar(r,"src",a),Ar(r,"alt",e[3]),Ar(i,"class","cursor-image-wrapper"),Ar(t,"class","netless-window-manager-cursor-mid"),kr(t,"transform","translateX("+e[4]+"px) translateY("+e[5]+"px)"),kr(t,"display",e[13])},m(e,s){Cr(e,t,s),o&&o.m(t,null),xr(t,n),xr(t,i),xr(i,r)},p(e,[i]){e[12]?o&&(o.d(1),o=null):o?o.p(e,i):(o=$r(e),o.c(),o.m(t,n)),8&i&&s!==(s="netless-window-manager-cursor-"+e[3]+"-image")&&Ar(r,"class",s),64&i&&!yr(r.src,a=e[6])&&Ar(r,"src",a),8&i&&Ar(r,"alt",e[3]),48&i&&kr(t,"transform","translateX("+e[4]+"px) translateY("+e[5]+"px)"),8192&i&&kr(t,"display",e[13])},i:hr,o:hr,d(e){e&&Mr(t),o&&o.d()}}}function Gr(e,t,n){let i,r,s,a,o,{cursorName:l}=t,{tagName:c}=t,{backgroundColor:u}=t,{appliance:d}=t,{x:h}=t,{y:p}=t,{src:f}=t,{visible:g}=t,{avatar:m}=t,{theme:v}=t,{color:b}=t,{cursorTagBackgroundColor:w}=t,{opacity:y}=t;return e.$$set=e=>{"cursorName"in e&&n(0,l=e.cursorName),"tagName"in e&&n(1,c=e.tagName),"backgroundColor"in e&&n(2,u=e.backgroundColor),"appliance"in e&&n(3,d=e.appliance),"x"in e&&n(4,h=e.x),"y"in e&&n(5,p=e.y),"src"in e&&n(6,f=e.src),"visible"in e&&n(17,g=e.visible),"avatar"in e&&n(7,m=e.avatar),"theme"in e&&n(8,v=e.theme),"color"in e&&n(9,b=e.color),"cursorTagBackgroundColor"in e&&n(10,w=e.cursorTagBackgroundColor),"opacity"in e&&n(11,y=e.opacity)},e.$$.update=()=>{1&e.$$.dirty&&(i=!M(l)),2&e.$$.dirty&&n(15,r=!M(c)),128&e.$$.dirty&&n(14,s=!M(m)),131072&e.$$.dirty&&n(13,a=g?"initial":"none"),8&e.$$.dirty&&n(12,o=d===W.laserPointer)},[l,c,u,d,h,p,f,m,v,b,w,y,o,a,s,r,()=>Object.entries({width:(i?19:28)+"px",height:(i?19:28)+"px",position:i?"initial":"absolute","border-color":i?"white":u,"margin-right":(i?4:0)+"px"}).map((([e,t])=>`${e}: ${t}`)).join(";"),g]}class Xr extends class{$destroy(){!function(e,t){const n=e.$$;null!==n.fragment&&(gr(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}(this,1),this.$destroy=hr}$on(e,t){const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}{constructor(e){super(),Qr(this,e,Gr,Yr,vr,{cursorName:0,tagName:1,backgroundColor:2,appliance:3,x:4,y:5,src:6,visible:17,avatar:7,theme:8,color:9,cursorTagBackgroundColor:10,opacity:11})}}const Jr={[W.pencil]:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAYISURBVHgB7ZpNSCtXFIBPEuvz+dMGpYUKD/sWFX+Qti6kK7Hqpm6e9q0rIoIUFUShPLV10VZx4+JZqa9v20LBhdq9fyBUCtKNPH8qYl2IOw3G38Rkek4y15y5uTOZJDOWggcOSSYzN/ebc+45554JwIM8iBCPyTEP+86T4vyMfsRN4b+nQTKIJp0vzuGvlpID7os8EQNEIBD4oKio6Bm9DwaDv/v9/n/076JgbtWUYPchwrW8qD7UnOvr6wFNkpubm+/wu7f0c7y6mrnlvQufxB0Iau7V1dX3BDA/P6/V1dVpzc3N2uLiIofK1c8VYHys/wRKBUN3/hGHqaysNOjc3FwMis6hc0FtLTHuvYLxCCZgci8uLn4wg5Gh6Fy8Jk+/NkcCAlAAuUkoW4g0B+d5tLS05O/r67O8eGxsDNra2uDy8nKsoKCAwCIQDxQa0yTxgrvCYXyTk5Ml+Orf2dlJeeHIyAigFSE/P38ELfUNqNdSkjgF5FF89jL1TU1NlQwODl5gZPujp6cHWltbUw7Koc7Pz8mkZpHPFeFrJuZeqLnoMoPoZqe0JjDP/IZgnyLUG/o8NDRkuo5Ua2pjY6MC4oFCFf1cA0oKzRSOp6enRfTaGh0d/QxBt+1CUVgnOTs7+xrHfQzGyOcKkK3QTJMnQffZ6e/v/xwttmsHqqmpKXbdycnJCxy7ABLh3FEgVZ6hZJhnFZoFFMF0d3c/w7v+dyookXBnZ2c/xvHfhriVcvXfdBRItsxjnOhYqjwjoAimq6vrCysoGofk+Ph4Esd/F/UdiFtJAGUd2DygTpp5dmBUUJ2dnc9VUALm8PDwJY7/BPU9VD8k3M4RC6kskxZMKigKIMLN9vf3p3H8DyWgfEhEOwOQD9IXOTz7EObbwsLC4YWFBRgeHrY9ECXYo6MjaGlpKWlsbPxkYGDgRW1tbSEWquVlZWXBzc3Nl1VVVa8hXiXc6ioqBqGaPDk7AACJTRZ3NS9lcUp86cJwoSQ7Pj4Op6enfxUXF3/V0NCQv7q6GsCvwrqGUG/01xAD4+VQTOxaSF43d5bBOisrGBJRCtXX17+/trb268rKSgASFgmz97KFkmo6OztWuVyPweiWGc4WRkhFRQVEIpHg8vJyQAIQVlLBROVxvBYQHsXnO8tk62ZcyN0wecLBwcEvYHSzEPscBqOLCRhLC4n9uqaA8UAWAcAKhtbQ3t7eTHl5+Y9gtAp3twhT056CDMQ7MRzIFTeTYKb1yYYVQFH9VdzsqNmYKpfTJBDX3Ixgdnd3XyHMT2AMALJlBBSPaMpNngrIsTyTCgaj288YDGakictrxizvKFNOjgSSBLS+vv6UYHDb7DgMVgsChjTEgCIKGG4ZU+EWkgNBzN1qamq+pAMTExPgFMzW1tZrhHkFyWE5KxgSszx0527RaDRmOSpRshEOU11dPQPG8CwHARHJlMnTSrwSRFIlfXt7m3V5ngJGuJtqzaQtZkFBVNJezN5ZAdmwjKo2k9tVtrcI3OXk4tPgcg7ChCDZ1URgMOu72Xa5VFHOkymQhWVU60YVmjN6wiC7k6p+S1syCACOwJBYFaexV+yhBekNPsMBO6KAEeE4BMaCU67RsoYhSbXgaT//ht709vZCaWmp6YkEbLFmVJWzas04+iBL7EKpm0J7duqu0B7+CTUpNJuyvb1NCfMj1CqI9wLKUOlOUMeG+gGFkHii4HizUF4z/KFUrPsJ8WbEIyx7nnZ0dDynME6BAuce09iFHo+GrnmGltltb2//E4wVAN82y7vOjKOZXSBhJdHNiT3TYWD8OY2PTUJkdd7MkJMnT5wZVQF2RFX6yBMUdzPMvvfqxz3sXHF+GNT9ANXit/10O1sgHkZvdQAOKvs9B5L7ARELGAAXLSTvM8QExTE+YbHe+HURhZp1aRyF4CJXClbbWwGketgkW9VsY+YaiBCVhfgE+XvxRwgZSM4jUVCDZFQ9pytmXR8hUTB2gnidx4XffVWydN0yQjwmx/jkAZJBrIBI5J7ZvQGZWUgVSuU/EqmOAzicKNMVu816DdRWUV1/7xAP8n+SfwF3Du3NF2sYhwAAAABJRU5ErkJggg==",[W.selector]:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADEAAAAxCAYAAABznEEcAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAZoSURBVHgB7VlLSCRXFL3ljNEhEXTGhMQJmOjCz8ZNVLKICz9xIYhCNi7UgINkGEk2En8hW5cBUQNxo05GAoKikuCAmvGzGMdPcCUGjDPxD/4Vv/3JvWW97luvq7ur+hMZ8MKlqrteNfe8e965970GuLVbC5kpJr53+hjHx9yY3TUxJgLMAQG4ITARfp5T4Mri4uL9q6urnxwOxz/oY5eXl1/Pzs7e195X2FX4jZsIhAK7gx5ps9m6nGj9/f3OtbU1pzAE0318fPwVjYHrrN7R3AjU/wpOBwA9Cmf/9ejoqDMtLU31iooKGdA+ATo4OMiXAEWAHhBAGEApXj4rPAik0vPt7e0vCgoKPH4gMzMTSktLIS8vD2JiYgABvcHMTZyennbHxsaOg3udOJmLzwqEYB0ZgRCZENm4u7e39yQuLq65srISZmZmvP5Ybm4u5OfnQ0lJyXWUCAgzNLS+vt6SnJz8WgvYwV5xSlcRgyVg3ha2Dkxzc3MvfZmVlQW+bGxsDBobGyE7O1u94uJPjIqKqklKSvrbbrfPnp+ff7e8vJwMnlSTKWfJjDKhywJo6wLp0YcZ+dyIUr7s4cOHLsrRlQwBTSBFuzc2NiZYhjjVAIyzZBqEwgCQv0OOM/gNzuiP/ijlDxBRjgClpqa6AF1cXDydmpoaLCws3JcAGYHyC4JMzoKaibKysvienp6FtrY2IA/WCFB5ebkqCHSvARo8Ozt7igIxwIJ2gJ+seFMnDoIyEUV+dHT0G3qWVUr5M043DdAB0m2IKZwAYpgZX+qkywR6NFbuR0iDxmAoZRUQKRxSLTMnJ8eIaqqSeVMnIYUOdu+sq6vrp4f+VCoYo8khZaNs01VRlERUu2/BrWAA7sl2Anink1Ao18JGjyY/PDx8hq1GZqgp5c2mp6chMjLy2b179x7hRzvoqeUUwXIzqq4O5nZsNUaEbIbLqPLTou/s7FTvT05OpsA9sXJG1AVsZDwjutqBIN6gUlWjxod8XRBNKXgsrqpqYZfwEqX9h8TExD7wbFm8LmzxHQ0QHSlXKZVSqFC/hkqlaKapTaGgCQTK7PHW1lb/wsLC86KiokkccoV+qV1tcE0pO7AWxmhTxBszDzqRr66ujqanp2cRpQLNBgUsCh8BwQ54bn5+/s+mpqa+4eHhfS1gb52vwuP0trPjhSZCBtLQ0NA3MDDQQIFYAUHBYhuvzjpVbJr1lZWVP3p7e19UVVXNgHumXYrI4uBx6Yqevz02b0FcRQ8CoBQF3dXVpQLZ3d39C7n+ora29vfJyclDYFnWgFyxK3cxhss/+KoT/N6DVkQpKypFGUCp3Ozo6HgSHx//GLW/BwHsg57zl5pzADajwLn52mPL1ZHPloMoRYPMFL6EhAR18e7s7MxVV1fPsAAp4Avteq7dC/c1+wKI4g+EfGzDM+EYHBw8RDrNiA2QL6upqVGvKJ2/gHu2L1nA5wwEB2YDfSYMO1x/px0cgEc2zBY+eo67u6H29vZ/wU2VC8l58JxKNjDOgojNEp08aFVfX++3l6JMEdDx8fEB0FNIBsDXBc8ArwuW1EkeI1RKdLWmCx+1DhkZGRvR0dFfSsHKxYtnW0iqvJAN9xNm6MR/QO5sfapUSkqKmqW5ubmfwVgyZdpw/vPZl2kUEAinBMSUStG+gwra0NDQSynQKyloIxnlewafjDFLJzLRBJqiFMnqyMgIbG5uDuD996Dnv8iAPOMAPmbcm5lVJwA/vZRMKZGZlpaWVtAvUL4GZMqE1fjRJrUd76LHoX+InlhcXPwZnWW2tra6jjrpiBM3UK/weQr6J+gfodMh9HtwncG7YLA3CMSsLmxx5WuDCt8B7vZeicInTjCWlpb6wc15mfey7oc9E8LElpVmMgb9AXoC+qcTExOPKRu4NlTHs6Q10GfhgfYOvRsJQZ76BWMKuDtaolQs+gfoH6Mn436gDg+e+5BKXUQx/C5Je/a+NpbeiQJPKgUdlNXx/BCBKxVdxW5Q0I3XBqFKRhU4KLtjYawi3csuTKdc4FnIXNvKUJkVEGRG20QZAAUpA5DbaYAQLmQzfzxyk/ffdnCD4NWVnGdE7kQBQvQHC5lVEDxgMaM29lkxGCNLKrDnIbFAMkFmBIaDkHstU41coGZ1TZD5UjReCGUAYbNgdNqoXZB/T67yYbFAMiGML3BhYeH8rb0t9h/zgcTBcTNGiQAAAABJRU5ErkJggg==",[W.eraser]:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAgrSURBVHgB7ZprTBRXFIDP7gIt8lQppTwE5V0KaAn6o1pqNGkDDTEmTUhsgKRp+gNJw68CFkLbVC2QkDS+gD8KJdWmARvbFBNNWpuIRGPFWBXQRMPDqIki+KLATs+ZnTvcvXtnX8w2beJJToaduTP3fHPOPffcOwC8kP+2WCDwIvahGFxTuN8KmNSZmULPNjLeqF9F8rdPkIEGEn+r+vjx46LQ0NA8/Dsader58+e/h4WFDWntFO7ot6fMFAt3JLWi2lCDpqamCux2+2+KROj82NhYGrXT2lu5Z/DP/deFByElA4Pv3LlTiHY/nJ6eVnbv3q1s2bJFyc7OVrZu3arU1dUp4+PjxPUQoT+g9tp9PkMFgpo9kxljHRoaWp2Xl3duYmIiurKyEvDoclNCQgIcPnxYPc7MzHwcGRnZhaft4Ag7O9fUbRhaITCie4lgcnNzT7qDIaHz27dvh+vXr0NEREQneqoCHKFnAR+8ZCaQGGq2CxcurCGYycnJZHcwTNAzUFFRoUJFRUV1IFQ5OKBsXB9uxSwgl0TQ3d29Yt26dccwoyVXV1d7hGEiQmGi2AzOUHx/hob4K2yuYS9G987s7OwPISEh7xPM6dOnwVfBsIMjR45AZmbmo5s3b76Xnp7+J55egMVxBSAZT0v1ED+76yn66dOnLQSzd+9ev2BIyFP0MjBco1JTU/sxfFeDazp3cYgZHmKqdoaGNISHh9fv378fSJcqlPV6e3sBJ+I/goOD34VFL0k95Y+HxPHCYGxmw5DQ2NuzZw8EBQVtunXr1jvgwUP+hhz/QDXMMCNVE8zx48dNg2FCz6QQjI2N/RA8VBFmANnu3btXihnpG8pM9fX1EAi5du0aeWkVOAMBCF7yN+R0z4yOjq6NiYlpp9CgdBtIwXpPH6vgDKWLt0CygtM6MDCwBuUYZSKaOCksAiVY9wFOBePgDOOytPAGSKzNVCCC2bBhw69YdK7ypgpYimzbtk2dl7CM+hFcveOUHDylbTFO1YdhFbByx44dA1QFUP0VSJj4+Hjo6+sDq9U6iEmHKvFZTedQ50GYbN15SITVlwNlZWUnLRZL8s6dOwMOQ9UCTtKTra2ttdppt9V2kMF5cbmsjxuM43bMNrmUzc6fP6+GQiDGDoOJi4ubwb4qm5ubafyIE6nLxGqTPEsGo1cBOGNX0TyDYafC0CyOaxcVziyh53Z2dkJycvLMvn37PmpoaBgFR4jxYSbWdVIgI89Iq4CjR48CZjlYv369+tssqI6ODsjPz4f+/v668vLycxrEHHfkYdwC8SB6mGEV8Cl64cuuri5oa2tTG+EyGjZu3AiXLl1qefDgwV8lJSUFZkDV1tZCcXExXLx4sbWoqKgPFj0zx8GI9ZwO5W4M6ekZYeqpaqbqmaSqqkpNpcPDw4dwzfM9nrLduHEjEs+X0XV/Sx96LnqE1kLtBQUF3eDwCO8dGQyzV5rl+JyuegfXI29jRotiRlKnpFghHMzKyjqotVXS0tLacKPjF3bdHxjSq1evduAkepAD+ZsDYlC8V5w8ZBVg+PPq2MGMlkInqE4joTf45MmT4YyMjAPcA+ltLSQlJX2BafxnX6HI29QeK44TOTk57mCYZ0QoJ8OBM4yB6dkNkwGlSygsLFQvYtYB3BTMxFL+M+0eFgZqp4mJiU2+QKGX1fGIk/QIrn0aYXGsyDxjmAyMhO2jhaCGoUbX1NSkLSwsPMJqV8Fspu6lIZS6OYhjiOLwdU7fQM1HfRPD7wS1obZ0j0xpb4726Z49ezaJf2/S7s9ATUGNR41BjdJseRnke3WGwhrRTS9pD1mOGoeG15BxOOfoxuCkp0Ih6NeaEaSZGlieJyiCoc1FgsGldokGk8nBvAKOrWIGQ5uPsm0tt0BWDiicAaGuGhkZ+YqMw9StGzU4OKhCnT179hNsswY1FTXdE5QEJhc1S3tGogazXLOBwQSBl3tzIhQPtAL1VQJCTcNx8y1vHIUghSKFZE9PT7H2dlM1b+Wgrr1y5Uq77J75+fnplpaWMg2ch4nlYEI5z7hdensDpI4hrYNErcMMXJ32koG4ztf3pultz83NjWG99Ra2WQ0OL2VjZjwgeufUqVOqV8+cOdPIwdBLSNJeHg8TAh5WqJ6EfSmgt7IMNRJ1JThiOlnrOAMHshprmMKdoGSCpb9s3B3SYLIFGIqICJB7xisYi+RvfiypXw40DWGdlJaWRmMd141hk8V2OWm7ieYTXhBc3+BgaZyqAISjOYxSMVvXsBTNlzdiNQDgRao2AtK3pjggpmrqbGpqSsLPIN/dv38/gaBwUjTshMHcvn27JyUlpRmc5xpPMD599LIYnLNyUKKndKjGxsakXbt2deMCLIE8IVvs0YRM1fjdu3d/wrXN5+BcnzEgvor2uN3rjzAYMp5lPEoQlE5fA0fWo8GfhlCbKVFQ1pKNIfzcOHH58mWqaimVUwJI0+6n59D4pIlzmdZPMPiZzXjDjX47Le5g0Uu8x2zgPqWyKpjVe7x3+AUbq9NYjQbgp2dsBud5o8TP7d5kHAWcQchQfoEmLgn8HjOiBIF7o5hI1x6CEbLNP3bdqYAF44JzyWLzcN1i8DcT/o3awbm8Fz3DAy2A62INwPV/E3wWdx5inmBHuwChCBD6R2JwHge80TIQRQLjt7e8DTkGZgfX8cUMZTDAteFDkveaIlzjX9ySQs8X18r2t2VHUURPKoICmDR+eCO9aSdmOIub3/w9RgpgUpiJhvraXpa6jZKHGEqyusw0GLFzX+5RhN/8kYnMSNMMfyH/V/kHST6OYVElTPAAAAAASUVORK5CYII=",[W.shape]:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDBweCIgaGVpZ2h0PSI0MHB4IiB2aWV3Qm94PSIwIDAgNDAgNDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDYwLjEgKDg4MTMzKSAtIGh0dHBzOi8vc2tldGNoLmNvbSAtLT4KICAgIDx0aXRsZT5zaGFwZS1jdXJzb3I8L3RpdGxlPgogICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+CiAgICA8ZGVmcz4KICAgICAgICA8cGF0aCBkPSJNMjAsMjEuNSBDMjAuMjQ1NDU5OSwyMS41IDIwLjQ0OTYwODQsMjEuNjc2ODc1MiAyMC40OTE5NDQzLDIxLjkxMDEyNDQgTDIwLjUsMjIgTDIwLjUsMjcgQzIwLjUsMjcuMjc2MTQyNCAyMC4yNzYxNDI0LDI3LjUgMjAsMjcuNSBDMTkuNzU0NTQwMSwyNy41IDE5LjU1MDM5MTYsMjcuMzIzMTI0OCAxOS41MDgwNTU3LDI3LjA4OTg3NTYgTDE5LjUsMjcgTDE5LjUsMjIgQzE5LjUsMjEuNzIzODU3NiAxOS43MjM4NTc2LDIxLjUgMjAsMjEuNSBaIE0yNywxOS41IEMyNy4yNzYxNDI0LDE5LjUgMjcuNSwxOS43MjM4NTc2IDI3LjUsMjAgQzI3LjUsMjAuMjQ1NDU5OSAyNy4zMjMxMjQ4LDIwLjQ0OTYwODQgMjcuMDg5ODc1NiwyMC40OTE5NDQzIEwyNywyMC41IEwyMiwyMC41IEMyMS43MjM4NTc2LDIwLjUgMjEuNSwyMC4yNzYxNDI0IDIxLjUsMjAgQzIxLjUsMTkuNzU0NTQwMSAyMS42NzY4NzUyLDE5LjU1MDM5MTYgMjEuOTEwMTI0NCwxOS41MDgwNTU3IEwyMiwxOS41IEwyNywxOS41IFogTTE4LDE5LjUgQzE4LjI3NjE0MjQsMTkuNSAxOC41LDE5LjcyMzg1NzYgMTguNSwyMCBDMTguNSwyMC4yNDU0NTk5IDE4LjMyMzEyNDgsMjAuNDQ5NjA4NCAxOC4wODk4NzU2LDIwLjQ5MTk0NDMgTDE4LDIwLjUgTDEzLDIwLjUgQzEyLjcyMzg1NzYsMjAuNSAxMi41LDIwLjI3NjE0MjQgMTIuNSwyMCBDMTIuNSwxOS43NTQ1NDAxIDEyLjY3Njg3NTIsMTkuNTUwMzkxNiAxMi45MTAxMjQ0LDE5LjUwODA1NTcgTDEzLDE5LjUgTDE4LDE5LjUgWiBNMjAsMTIuNSBDMjAuMjQ1NDU5OSwxMi41IDIwLjQ0OTYwODQsMTIuNjc2ODc1MiAyMC40OTE5NDQzLDEyLjkxMDEyNDQgTDIwLjUsMTMgTDIwLjUsMTggQzIwLjUsMTguMjc2MTQyNCAyMC4yNzYxNDI0LDE4LjUgMjAsMTguNSBDMTkuNzU0NTQwMSwxOC41IDE5LjU1MDM5MTYsMTguMzIzMTI0OCAxOS41MDgwNTU3LDE4LjA4OTg3NTYgTDE5LjUsMTggTDE5LjUsMTMgQzE5LjUsMTIuNzIzODU3NiAxOS43MjM4NTc2LDEyLjUgMjAsMTIuNSBaIiBpZD0icGF0aC0xIj48L3BhdGg+CiAgICAgICAgPGZpbHRlciB4PSItNjQuNiUiIHk9Ii01OS41JSIgd2lkdGg9IjIyOS4zJSIgaGVpZ2h0PSIyNDYuMSUiIGZpbHRlclVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgaWQ9ImZpbHRlci0yIj4KICAgICAgICAgICAgPGZlTW9ycGhvbG9neSByYWRpdXM9IjEiIG9wZXJhdG9yPSJkaWxhdGUiIGluPSJTb3VyY2VBbHBoYSIgcmVzdWx0PSJzaGFkb3dTcHJlYWRPdXRlcjEiPjwvZmVNb3JwaG9sb2d5PgogICAgICAgICAgICA8ZmVPZmZzZXQgZHg9IjAiIGR5PSIyIiBpbj0ic2hhZG93U3ByZWFkT3V0ZXIxIiByZXN1bHQ9InNoYWRvd09mZnNldE91dGVyMSI+PC9mZU9mZnNldD4KICAgICAgICAgICAgPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iMyIgaW49InNoYWRvd09mZnNldE91dGVyMSIgcmVzdWx0PSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlR2F1c3NpYW5CbHVyPgogICAgICAgICAgICA8ZmVDb21wb3NpdGUgaW49InNoYWRvd0JsdXJPdXRlcjEiIGluMj0iU291cmNlQWxwaGEiIG9wZXJhdG9yPSJvdXQiIHJlc3VsdD0ic2hhZG93Qmx1ck91dGVyMSI+PC9mZUNvbXBvc2l0ZT4KICAgICAgICAgICAgPGZlQ29sb3JNYXRyaXggdmFsdWVzPSIwIDAgMCAwIDAgICAwIDAgMCAwIDAgICAwIDAgMCAwIDAgIDAgMCAwIDAuMTYgMCIgdHlwZT0ibWF0cml4IiBpbj0ic2hhZG93Qmx1ck91dGVyMSI+PC9mZUNvbG9yTWF0cml4PgogICAgICAgIDwvZmlsdGVyPgogICAgPC9kZWZzPgogICAgPGcgaWQ9Iumhtemdoi00IiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iV2hpdGVib2FyZC1HdWlkZWxpbmVzIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMzQ0LjAwMDAwMCwgLTc1MS4wMDAwMDApIj4KICAgICAgICAgICAgPGcgaWQ9InNoYXBlLWN1cnNvciIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMzQ0LjAwMDAwMCwgNzUxLjAwMDAwMCkiPgogICAgICAgICAgICAgICAgPHJlY3QgaWQ9IuefqeW9ouWkh+S7vS00NCIgZmlsbD0iI0ZGRkZGRiIgb3BhY2l0eT0iMC4wMSIgeD0iMCIgeT0iMCIgd2lkdGg9IjQwIiBoZWlnaHQ9IjQwIiByeD0iMiI+PC9yZWN0PgogICAgICAgICAgICAgICAgPGcgaWQ9IuW9oueKtue7k+WQiCIgZmlsbC1ydWxlPSJub256ZXJvIj4KICAgICAgICAgICAgICAgICAgICA8dXNlIGZpbGw9ImJsYWNrIiBmaWxsLW9wYWNpdHk9IjEiIGZpbHRlcj0idXJsKCNmaWx0ZXItMikiIHhsaW5rOmhyZWY9IiNwYXRoLTEiPjwvdXNlPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIHN0cm9rZT0iI0ZGRkZGRiIgc3Ryb2tlLXdpZHRoPSIxIiBkPSJNMjAsMjEgQzIwLjQ4NTQxMDMsMjEgMjAuODk4MDg1LDIxLjM0Nzk5OTMgMjAuOTg5OTQ3OSwyMS44NjU0ODc3IEwyMSwyMiBMMjEsMjcgQzIxLDI3LjU1MjI4NDcgMjAuNTUyMjg0NywyOCAyMCwyOCBDMTkuNTE0NTg5NywyOCAxOS4xMDE5MTUsMjcuNjUyMDAwNyAxOS4wMTAwNTIxLDI3LjEzNDUxMjMgTDE5LDI3IEwxOSwyMiBDMTksMjEuNDQ3NzE1MyAxOS40NDc3MTUzLDIxIDIwLDIxIFogTTI3LDE5IEMyNy41NTIyODQ3LDE5IDI4LDE5LjQ0NzcxNTMgMjgsMjAgQzI4LDIwLjQ4NTQxMDMgMjcuNjUyMDAwNywyMC44OTgwODUgMjcuMTM0NTEyMywyMC45ODk5NDc5IEwyNywyMSBMMjIsMjEgQzIxLjQ0NzcxNTMsMjEgMjEsMjAuNTUyMjg0NyAyMSwyMCBDMjEsMTkuNTE0NTg5NyAyMS4zNDc5OTkzLDE5LjEwMTkxNSAyMS44NjU0ODc3LDE5LjAxMDA1MjEgTDIyLDE5IEwyNywxOSBaIE0xOCwxOSBDMTguNTUyMjg0NywxOSAxOSwxOS40NDc3MTUzIDE5LDIwIEMxOSwyMC40ODU0MTAzIDE4LjY1MjAwMDcsMjAuODk4MDg1IDE4LjEzNDUxMjMsMjAuOTg5OTQ3OSBMMTgsMjEgTDEzLDIxIEMxMi40NDc3MTUzLDIxIDEyLDIwLjU1MjI4NDcgMTIsMjAgQzEyLDE5LjUxNDU4OTcgMTIuMzQ3OTk5MywxOS4xMDE5MTUgMTIuODY1NDg3NywxOS4wMTAwNTIxIEwxMywxOSBMMTgsMTkgWiBNMjAsMTIgQzIwLjQ4NTQxMDMsMTIgMjAuODk4MDg1LDEyLjM0Nzk5OTMgMjAuOTg5OTQ3OSwxMi44NjU0ODc3IEwyMSwxMyBMMjEsMTggQzIxLDE4LjU1MjI4NDcgMjAuNTUyMjg0NywxOSAyMCwxOSBDMTkuNTE0NTg5NywxOSAxOS4xMDE5MTUsMTguNjUyMDAwNyAxOS4wMTAwNTIxLDE4LjEzNDUxMjMgTDE5LDE4IEwxOSwxMyBDMTksMTIuNDQ3NzE1MyAxOS40NDc3MTUzLDEyIDIwLDEyIFoiIGZpbGw9IiMyMTIzMjQiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PC9wYXRoPgogICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICAgICAgPHJlY3QgaWQ9IuefqeW9oiIgZmlsbD0iI0ZGRkZGRiIgeD0iMTguNSIgeT0iMTciIHdpZHRoPSIzIiBoZWlnaHQ9IjYiPjwvcmVjdD4KICAgICAgICAgICAgICAgIDxyZWN0IGlkPSLnn6nlvaIiIGZpbGw9IiNGRkZGRkYiIHg9IjE3IiB5PSIxOC41IiB3aWR0aD0iNiIgaGVpZ2h0PSIzIj48L3JlY3Q+CiAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMjAsMjEuNSBDMjAuMjQ1NDU5OSwyMS41IDIwLjQ0OTYwODQsMjEuNjc2ODc1MiAyMC40OTE5NDQzLDIxLjkxMDEyNDQgTDIwLjUsMjIgTDIwLjUsMjcgQzIwLjUsMjcuMjc2MTQyNCAyMC4yNzYxNDI0LDI3LjUgMjAsMjcuNSBDMTkuNzU0NTQwMSwyNy41IDE5LjU1MDM5MTYsMjcuMzIzMTI0OCAxOS41MDgwNTU3LDI3LjA4OTg3NTYgTDE5LjUsMjcgTDE5LjUsMjIgQzE5LjUsMjEuNzIzODU3NiAxOS43MjM4NTc2LDIxLjUgMjAsMjEuNSBaIE0yNywxOS41IEMyNy4yNzYxNDI0LDE5LjUgMjcuNSwxOS43MjM4NTc2IDI3LjUsMjAgQzI3LjUsMjAuMjQ1NDU5OSAyNy4zMjMxMjQ4LDIwLjQ0OTYwODQgMjcuMDg5ODc1NiwyMC40OTE5NDQzIEwyNywyMC41IEwyMiwyMC41IEMyMS43MjM4NTc2LDIwLjUgMjEuNSwyMC4yNzYxNDI0IDIxLjUsMjAgQzIxLjUsMTkuNzU0NTQwMSAyMS42NzY4NzUyLDE5LjU1MDM5MTYgMjEuOTEwMTI0NCwxOS41MDgwNTU3IEwyMiwxOS41IEwyNywxOS41IFogTTE4LDE5LjUgQzE4LjI3NjE0MjQsMTkuNSAxOC41LDE5LjcyMzg1NzYgMTguNSwyMCBDMTguNSwyMC4yNDU0NTk5IDE4LjMyMzEyNDgsMjAuNDQ5NjA4NCAxOC4wODk4NzU2LDIwLjQ5MTk0NDMgTDE4LDIwLjUgTDEzLDIwLjUgQzEyLjcyMzg1NzYsMjAuNSAxMi41LDIwLjI3NjE0MjQgMTIuNSwyMCBDMTIuNSwxOS43NTQ1NDAxIDEyLjY3Njg3NTIsMTkuNTUwMzkxNiAxMi45MTAxMjQ0LDE5LjUwODA1NTcgTDEzLDE5LjUgTDE4LDE5LjUgWiBNMjAsMTIuNSBDMjAuMjQ1NDU5OSwxMi41IDIwLjQ0OTYwODQsMTIuNjc2ODc1MiAyMC40OTE5NDQzLDEyLjkxMDEyNDQgTDIwLjUsMTMgTDIwLjUsMTggQzIwLjUsMTguMjc2MTQyNCAyMC4yNzYxNDI0LDE4LjUgMjAsMTguNSBDMTkuNzU0NTQwMSwxOC41IDE5LjU1MDM5MTYsMTguMzIzMTI0OCAxOS41MDgwNTU3LDE4LjA4OTg3NTYgTDE5LjUsMTggTDE5LjUsMTMgQzE5LjUsMTIuNzIzODU3NiAxOS43MjM4NTc2LDEyLjUgMjAsMTIuNSBaIiBpZD0i5b2i54q257uT5ZCIIiBmaWxsPSIjMjEyMzI0IiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+",[W.text]:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDdweCIgaGVpZ2h0PSI0MHB4IiB2aWV3Qm94PSIwIDAgNDcgNDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDYwLjEgKDg4MTMzKSAtIGh0dHBzOi8vc2tldGNoLmNvbSAtLT4KICAgIDx0aXRsZT50ZXh0LWN1cnNvcjwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPgogICAgICAgIDxwYXRoIGQ9Ik0xNiwyNi41IEMxNS43MjM4NTc2LDI2LjUgMTUuNSwyNi4yNzYxNDI0IDE1LjUsMjYgQzE1LjUsMjUuNzU0NTQwMSAxNS42NzY4NzUyLDI1LjU1MDM5MTYgMTUuOTEwMTI0NCwyNS41MDgwNTU3IEwxNiwyNS41IEwxOS41LDI1LjUgTDE5LjUsMTQuNSBMMTYsMTQuNSBDMTUuNzIzODU3NiwxNC41IDE1LjUsMTQuMjc2MTQyNCAxNS41LDE0IEMxNS41LDEzLjc1NDU0MDEgMTUuNjc2ODc1MiwxMy41NTAzOTE2IDE1LjkxMDEyNDQsMTMuNTA4MDU1NyBMMTYsMTMuNSBMMjQsMTMuNSBDMjQuMjc2MTQyNCwxMy41IDI0LjUsMTMuNzIzODU3NiAyNC41LDE0IEMyNC41LDE0LjI0NTQ1OTkgMjQuMzIzMTI0OCwxNC40NDk2MDg0IDI0LjA4OTg3NTYsMTQuNDkxOTQ0MyBMMjQsMTQuNSBMMjAuNSwxNC41IEwyMC41LDI1LjUgTDI0LDI1LjUgQzI0LjI3NjE0MjQsMjUuNSAyNC41LDI1LjcyMzg1NzYgMjQuNSwyNiBDMjQuNSwyNi4yNDU0NTk5IDI0LjMyMzEyNDgsMjYuNDQ5NjA4NCAyNC4wODk4NzU2LDI2LjQ5MTk0NDMgTDI0LDI2LjUgTDE2LDI2LjUgWiIgaWQ9InBhdGgtMSI+PC9wYXRoPgogICAgICAgIDxmaWx0ZXIgeD0iLTI4NC4wJSIgeT0iLTgxLjUlIiB3aWR0aD0iNjY4LjElIiBoZWlnaHQ9IjI5My45JSIgZmlsdGVyVW5pdHM9Im9iamVjdEJvdW5kaW5nQm94IiBpZD0iZmlsdGVyLTIiPgogICAgICAgICAgICA8ZmVNb3JwaG9sb2d5IHJhZGl1cz0iMSIgb3BlcmF0b3I9ImRpbGF0ZSIgaW49IlNvdXJjZUFscGhhIiByZXN1bHQ9InNoYWRvd1NwcmVhZE91dGVyMSI+PC9mZU1vcnBob2xvZ3k+CiAgICAgICAgICAgIDxmZU9mZnNldCBkeD0iMCIgZHk9IjIiIGluPSJzaGFkb3dTcHJlYWRPdXRlcjEiIHJlc3VsdD0ic2hhZG93T2Zmc2V0T3V0ZXIxIj48L2ZlT2Zmc2V0PgogICAgICAgICAgICA8ZmVHYXVzc2lhbkJsdXIgc3RkRGV2aWF0aW9uPSIzIiBpbj0ic2hhZG93T2Zmc2V0T3V0ZXIxIiByZXN1bHQ9InNoYWRvd0JsdXJPdXRlcjEiPjwvZmVHYXVzc2lhbkJsdXI+CiAgICAgICAgICAgIDxmZUNvbXBvc2l0ZSBpbj0ic2hhZG93Qmx1ck91dGVyMSIgaW4yPSJTb3VyY2VBbHBoYSIgb3BlcmF0b3I9Im91dCIgcmVzdWx0PSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlQ29tcG9zaXRlPgogICAgICAgICAgICA8ZmVDb2xvck1hdHJpeCB2YWx1ZXM9IjAgMCAwIDAgMCAgIDAgMCAwIDAgMCAgIDAgMCAwIDAgMCAgMCAwIDAgMC4xNiAwIiB0eXBlPSJtYXRyaXgiIGluPSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlQ29sb3JNYXRyaXg+CiAgICAgICAgPC9maWx0ZXI+CiAgICA8L2RlZnM+CiAgICA8ZyBpZD0i6aG16Z2iLTQiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSJXaGl0ZWJvYXJkLUd1aWRlbGluZXMiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0zODguMDAwMDAwLCAtNjcyLjAwMDAwMCkiPgogICAgICAgICAgICA8ZyBpZD0idGV4dC1jdXJzb3IiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDM5Mi4wMDAwMDAsIDY3Mi4wMDAwMDApIj4KICAgICAgICAgICAgICAgIDxyZWN0IGlkPSLnn6nlvaLlpIfku70tNDAiIGZpbGw9IiNGRkZGRkYiIG9wYWNpdHk9IjAuMDEiIHg9IjAiIHk9IjAiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgcng9IjIiPjwvcmVjdD4KICAgICAgICAgICAgICAgIDxnIGlkPSLlvaLnirbnu5PlkIgiIGZpbGwtcnVsZT0ibm9uemVybyI+CiAgICAgICAgICAgICAgICAgICAgPHVzZSBmaWxsPSJibGFjayIgZmlsbC1vcGFjaXR5PSIxIiBmaWx0ZXI9InVybCgjZmlsdGVyLTIpIiB4bGluazpocmVmPSIjcGF0aC0xIj48L3VzZT4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBzdHJva2U9IiNGRkZGRkYiIHN0cm9rZS13aWR0aD0iMSIgZD0iTTE5LDI1IEwxOSwxNSBMMTYsMTUgQzE1LjQ0NzcxNTMsMTUgMTUsMTQuNTUyMjg0NyAxNSwxNCBDMTUsMTMuNTE0NTg5NyAxNS4zNDc5OTkzLDEzLjEwMTkxNSAxNS44NjU0ODc3LDEzLjAxMDA1MjEgTDE2LDEzIEwyNCwxMyBDMjQuNTUyMjg0NywxMyAyNSwxMy40NDc3MTUzIDI1LDE0IEMyNSwxNC40ODU0MTAzIDI0LjY1MjAwMDcsMTQuODk4MDg1IDI0LjEzNDUxMjMsMTQuOTg5OTQ3OSBMMjQsMTUgTDIxLDE1IEwyMSwyNSBMMjQsMjUgQzI0LjU1MjI4NDcsMjUgMjUsMjUuNDQ3NzE1MyAyNSwyNiBDMjUsMjYuNDg1NDEwMyAyNC42NTIwMDA3LDI2Ljg5ODA4NSAyNC4xMzQ1MTIzLDI2Ljk4OTk0NzkgTDI0LDI3IEwxNiwyNyBDMTUuNDQ3NzE1MywyNyAxNSwyNi41NTIyODQ3IDE1LDI2IEMxNSwyNS41MTQ1ODk3IDE1LjM0Nzk5OTMsMjUuMTAxOTE1IDE1Ljg2NTQ4NzcsMjUuMDEwMDUyMSBMMTYsMjUgTDE5LDI1IFoiIGZpbGw9IiMyMTIzMjQiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PC9wYXRoPgogICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICA8L2c+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4=",[W.laserPointer]:"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjhweCIgaGVpZ2h0PSIyOHB4IiB2aWV3Qm94PSIwIDAgMjggMjgiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDU1LjEgKDc4MTM2KSAtIGh0dHBzOi8vc2tldGNoYXBwLmNvbSAtLT4KICAgIDx0aXRsZT7nvJbnu4QgMjwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPgogICAgICAgIDxmaWx0ZXIgeD0iLTEyMC4wJSIgeT0iLTEyMC4wJSIgd2lkdGg9IjM0MC4wJSIgaGVpZ2h0PSIzNDAuMCUiIGZpbHRlclVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgaWQ9ImZpbHRlci0xIj4KICAgICAgICAgICAgPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iNCIgaW49IlNvdXJjZUdyYXBoaWMiPjwvZmVHYXVzc2lhbkJsdXI+CiAgICAgICAgPC9maWx0ZXI+CiAgICA8L2RlZnM+CiAgICA8ZyBpZD0i6aG16Z2iMSIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPGcgaWQ9Iue8lue7hC0yIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg5LjAwMDAwMCwgOS4wMDAwMDApIiBmaWxsPSIjRkYwMTAwIj4KICAgICAgICAgICAgPGNpcmNsZSBpZD0i5qSt5ZyG5b2iIiBmaWx0ZXI9InVybCgjZmlsdGVyLTEpIiBjeD0iNSIgY3k9IjUiIHI9IjUiPjwvY2lyY2xlPgogICAgICAgICAgICA8cGF0aCBkPSJNNSw4IEM2LjY1Njg1NDI1LDggOCw2LjY1Njg1NDI1IDgsNSBDOCwzLjM0MzE0NTc1IDYuNjU2ODU0MjUsMiA1LDIgQzMuMzQzMTQ1NzUsMiAyLDMuMzQzMTQ1NzUgMiw1IEMyLDYuNjU2ODU0MjUgMy4zNDMxNDU3NSw4IDUsOCBaIE01LDYuMjg1NzE0MjkgQzQuMjg5OTE5NjEsNi4yODU3MTQyOSAzLjcxNDI4NTcxLDUuNzEwMDgwMzkgMy43MTQyODU3MSw1IEMzLjcxNDI4NTcxLDQuMjg5OTE5NjEgNC4yODk5MTk2MSwzLjcxNDI4NTcxIDUsMy43MTQyODU3MSBDNS43MTAwODAzOSwzLjcxNDI4NTcxIDYuMjg1NzE0MjksNC4yODk5MTk2MSA2LjI4NTcxNDI5LDUgQzYuMjg1NzE0MjksNS43MTAwODAzOSA1LjcxMDA4MDM5LDYuMjg1NzE0MjkgNSw2LjI4NTcxNDI5IFoiIGlkPSLmpK3lnIblvaIiIGZpbGwtcnVsZT0ibm9uemVybyI+PC9wYXRoPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+"};class Kr{constructor(e,t,n,i){this.manager=e,this.memberId=t,this.cursorManager=n,this.wrapper=i,this.move=e=>{var t;if("main"===e.type){const t=this.cursorManager.wrapperRect;this.component&&t&&(this.autoHidden(),this.moveCursor(e,t,this.manager.mainView))}else{const n=this.cursorManager.focusView,i=null==(t=null==n?void 0:n.divElement)?void 0:t.getBoundingClientRect(),r=null==n?void 0:n.camera;n&&i&&r&&this.component&&(this.autoHidden(),this.moveCursor(e,i,n))}},this.leave=()=>{this.hide()},this.updateMember(),this.createCursor(),this.autoHidden()}moveCursor(e,t,n){var i,r;const{x:s,y:a,type:o}=e,l=null==n?void 0:n.screen.convertPointToScreen(s,a);if(l){let e=l.x-2,n=l.y-18;if("app"===o){const i=this.cursorManager.wrapperRect;i&&(e=e+t.x-i.x,n=n+t.y-i.y)}l.x<0||l.x>t.width||l.y<0||l.y>t.height?null==(i=this.component)||i.$set({visible:!1,x:e,y:n}):null==(r=this.component)||r.$set({visible:!0,x:e,y:n})}}get memberApplianceName(){var e,t;return null==(t=null==(e=this.member)?void 0:e.memberState)?void 0:t.currentApplianceName}get memberColor(){var e,t;return`rgb(${null==(t=null==(e=this.member)?void 0:e.memberState)?void 0:t.strokeColor.join(",")})`}get payload(){var e;return null==(e=this.member)?void 0:e.payload}get memberCursorName(){var e,t;return(null==(e=this.payload)?void 0:e.nickName)||(null==(t=this.payload)?void 0:t.cursorName)||this.memberId}get memberTheme(){var e;return(null==(e=this.payload)?void 0:e.theme)?"netless-window-manager-cursor-inner-mellow":"netless-window-manager-cursor-inner"}get memberCursorTextColor(){var e;return(null==(e=this.payload)?void 0:e.cursorTextColor)||"#FFFFFF"}get memberCursorTagBackgroundColor(){var e;return(null==(e=this.payload)?void 0:e.cursorTagBackgroundColor)||this.memberColor}get memberAvatar(){var e;return null==(e=this.payload)?void 0:e.avatar}get memberOpacity(){return this.memberCursorName||this.memberAvatar?1:0}get memberTagName(){var e;return null==(e=this.payload)?void 0:e.cursorTagName}autoHidden(){this.timer&&clearTimeout(this.timer),this.timer=window.setTimeout((()=>{this.hide()}),1e4)}async createCursor(){this.member&&this.wrapper&&(this.component=new Xr({target:this.wrapper,props:this.initProps()}))}initProps(){return{x:0,y:0,appliance:this.memberApplianceName,avatar:this.memberAvatar,src:this.getIcon(),visible:!1,backgroundColor:this.memberColor,cursorName:this.memberCursorName,theme:this.memberTheme,color:this.memberCursorTextColor,cursorTagBackgroundColor:this.memberCursorTagBackgroundColor,opacity:this.memberOpacity,tagName:this.memberTagName}}getIcon(){if(this.member){return Jr[this.memberApplianceName||W.shape]||Jr[W.shape]}}updateMember(){return this.member=((e,t)=>{const n=null==e?void 0:e.state.roomMembers;return null==n?void 0:n.find((e=>{var n;return(null==(n=e.payload)?void 0:n.uid)===t}))})(this.manager.room,this.memberId),this.updateComponent(),this.member}updateComponent(){var e;null==(e=this.component)||e.$set(g(this.initProps(),["x","y"]))}destroy(){this.component&&this.component.$destroy(),this.cursorManager.cursorInstances.delete(this.memberId),this.timer&&clearTimeout(this.timer)}hide(){this.component&&(this.component.$set({visible:!1}),this.destroy())}}class qr{constructor(e,t){var n;this.manager=e,this.enableCursor=t,this.cursorInstances=new Map,this.sideEffectManager=new Y,this.store=this.manager.store,this.onCursorMove=e=>{const t=this.initCursorInstance(e.uid);if(e.state===ne.Leave)t.leave();else{const n=t.updateMember();this.canMoveCursor(n)&&t.move(e.position)}},this.initCursorInstance=e=>{let t=this.cursorInstances.get(e);return t||(t=new Kr(this.manager,e,this,Pb.wrapper),this.cursorInstances.set(e,t)),t},this.mouseMoveListener=E((e=>{("touch"!==e.pointerType||e.isPrimary)&&this.updateCursor(this.getType(e),e.clientX,e.clientY)}),16),this.getPoint=(e,t,n)=>{var i;const r=null==(i=null==e?void 0:e.divElement)?void 0:i.getBoundingClientRect();if(r){return null==e?void 0:e.convertToPointInWorld({x:t-r.x,y:n-r.y})}},this.getType=e=>{var t;const n=e.target,i=this.manager.focusApp;switch(n.parentElement){case this.mainViewElement:return{type:"main"};case null==(t=null==i?void 0:i.view)?void 0:t.divElement:return{type:"app"};default:return{type:"main"}}},this.mouseLeaveListener=()=>{this.hideCursor(this.manager.uid)},this.roomMembers=null==(n=this.manager.room)?void 0:n.state.roomMembers;const i=Pb.wrapper;i&&this.setupWrapper(i),this.sideEffectManager.add((()=>le.on("cursorMove",this.onCursorMove))),this.sideEffectManager.add((()=>le.on("playgroundSizeChange",(()=>this.updateContainerRect()))))}canMoveCursor(e){const t=(null==e?void 0:e.memberState.currentApplianceName)===W.laserPointer;return this.enableCursor||t}setupWrapper(e){this.sideEffectManager.add((()=>(e.addEventListener("pointerenter",this.mouseMoveListener),e.addEventListener("pointermove",this.mouseMoveListener),e.addEventListener("pointerleave",this.mouseLeaveListener),()=>{e.removeEventListener("pointerenter",this.mouseMoveListener),e.removeEventListener("pointermove",this.mouseMoveListener),e.removeEventListener("pointerleave",this.mouseLeaveListener)}))),this.wrapperRect=e.getBoundingClientRect()}setMainViewDivElement(e){this.mainViewElement=e}get boxState(){return this.store.getBoxState()}get focusView(){var e;return null==(e=this.manager.focusApp)?void 0:e.view}updateCursor(t,n,i){if(this.wrapperRect&&this.manager.canOperate){const r="main"===t.type?this.manager.mainView:this.focusView,s=this.getPoint(r,n,i);s&&this.manager.dispatchInternalEvent(e.CursorMove,{uid:this.manager.uid,position:{x:s.x,y:s.y,type:t.type}})}}updateContainerRect(){var e,t;this.containerRect=null==(e=Pb.container)?void 0:e.getBoundingClientRect(),this.wrapperRect=null==(t=Pb.wrapper)?void 0:t.getBoundingClientRect()}deleteCursor(e){this.store.cleanCursor(e);const t=this.cursorInstances.get(e);t&&t.destroy()}hideCursor(e){const t=this.cursorInstances.get(e);t&&t.hide()}destroy(){this.sideEffectManager.flushAll(),this.cursorInstances.size&&(this.cursorInstances.forEach((e=>{e.destroy()})),this.cursorInstances.clear())}}class es{constructor(e){this.manager=e,le.on("changePageState",(()=>{ae.emit("pageStateChange",this.toObject())}))}get index(){var e;return(null==(e=this.manager)?void 0:e.store.getMainViewSceneIndex())||0}get length(){var e;return(null==(e=this.manager)?void 0:e.mainViewScenesLength)||0}toObject(){return{index:this.index,length:this.length}}}const ts=e=>{const t=e.removeScenes;e.removeScenes=n=>{const i=t.call(e,n);return le.emit("removeScenes",n),i}},ns=e=>{const t=e.seekToProgressTime;e.seekToProgressTime=async function(n){await le.emit("seekStart");const i=await t.call(e,n);return le.emit("seek",n),i}};var is=Object.defineProperty,rs=Object.defineProperties,ss=Object.getOwnPropertyDescriptors,as=Object.getOwnPropertySymbols,os=Object.prototype.hasOwnProperty,ls=Object.prototype.propertyIsEnumerable,cs=(e,t,n)=>t in e?is(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,us=(e,t)=>{for(var n in t||(t={}))os.call(t,n)&&cs(e,n,t[n]);if(as)for(var n of as(t))ls.call(t,n)&&cs(e,n,t[n]);return e},ds=(e,t)=>rs(e,ss(t));const hs=(e,t,n,i)=>{if("length"===n||"prototype"===n)return;if("arguments"===n||"caller"===n)return;const r=Object.getOwnPropertyDescriptor(e,n),s=Object.getOwnPropertyDescriptor(t,n);!ps(r,s)&&i||Object.defineProperty(e,n,s)},ps=function(e,t){return void 0===e||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},fs=(e,t)=>`/* Wrapped ${e}*/\n${t}`,gs=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),ms=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name");function vs(e,t,{ignoreNonConfigurable:n=!1}={}){const{name:i}=e;for(const r of Reflect.ownKeys(t))hs(e,t,r,n);return((e,t)=>{const n=Object.getPrototypeOf(t);n!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,n)})(e,t),((e,t,n)=>{const i=""===n?"":`with ${n.trim()}() `,r=fs.bind(null,i,t.toString());Object.defineProperty(r,"name",ms),Object.defineProperty(e,"toString",ds(us({},gs),{value:r}))})(e,t,i),e}const bs=(e,t={})=>{if("function"!=typeof e)throw new TypeError(`Expected the first argument to be a function, got \`${typeof e}\``);const{wait:n=0,maxWait:i=Number.Infinity,before:r=!1,after:s=!0}=t;if(!r&&!s)throw new Error("Both `before` and `after` are false, function wouldn't be called.");let a,o,l;const c=function(...t){const c=this,u=()=>{o=void 0,a&&(clearTimeout(a),a=void 0),s&&(l=e.apply(c,t))},d=r&&!a;return clearTimeout(a),a=setTimeout((()=>{a=void 0,o&&(clearTimeout(o),o=void 0),s&&(l=e.apply(c,t))}),n),i>0&&i!==Number.Infinity&&!o&&(o=setTimeout(u,i)),d&&(l=e.apply(c,t)),l};return vs(c,e),c.cancel=()=>{a&&(clearTimeout(a),a=void 0),o&&(clearTimeout(o),o=void 0)},c},ws="!#%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",ys=ws.length,xs=Array(20),Cs=()=>{for(let e=0;e<20;e++)xs[e]=ws.charAt(Math.random()*ys);return xs.join("")};class Ms{constructor(){this.disposers=new Map}add(e,t=Cs()){return this.flush(t),this.disposers.set(t,e()),t}addDisposer(e,t=Cs()){return this.flush(t),this.disposers.set(t,e),t}addEventListener(e,t,n,i,r=Cs()){return this.add((()=>(e.addEventListener(t,n,i),()=>e.removeEventListener(t,n,i))),r),r}setTimeout(e,t,n=Cs()){return this.add((()=>{const i=window.setTimeout((()=>{this.remove(n),e()}),t);return()=>window.clearTimeout(i)}),n)}setInterval(e,t,n=Cs()){return this.add((()=>{const n=window.setInterval(e,t);return()=>window.clearInterval(n)}),n)}remove(e){const t=this.disposers.get(e);return this.disposers.delete(e),t}flush(e){const t=this.remove(e);if(t)try{t()}catch(n){console.error(n)}}flushAll(){this.disposers.forEach((e=>{try{e()}catch(t){console.error(t)}})),this.disposers.clear()}}var Ss,Is,Es=[],As="ResizeObserver loop completed with undelivered notifications.";(Is=Ss||(Ss={})).BORDER_BOX="border-box",Is.CONTENT_BOX="content-box",Is.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box";var Ts,ks=function(e){return Object.freeze(e)},Ns=function(e,t){this.inlineSize=e,this.blockSize=t,ks(this)},Ps=function(){function e(e,t,n,i){return this.x=e,this.y=t,this.width=n,this.height=i,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,ks(this)}return e.prototype.toJSON=function(){var e=this;return{x:e.x,y:e.y,top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.width,height:e.height}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),zs=function(e){return e instanceof SVGElement&&"getBBox"in e},Ds=function(e){if(zs(e)){var t=e.getBBox(),n=t.width,i=t.height;return!n&&!i}var r=e,s=r.offsetWidth,a=r.offsetHeight;return!(s||a||e.getClientRects().length)},Ls=function(e){var t,n;if(e instanceof Element)return!0;var i=null===(n=null===(t=e)||void 0===t?void 0:t.ownerDocument)||void 0===n?void 0:n.defaultView;return!!(i&&e instanceof i.Element)},Bs="undefined"!=typeof window?window:{},js=new WeakMap,Rs=/auto|scroll/,Os=/^tb|vertical/,Vs=/msie|trident/i.test(Bs.navigator&&Bs.navigator.userAgent),_s=function(e){return parseFloat(e||"0")},Us=function(e,t,n){return void 0===e&&(e=0),void 0===t&&(t=0),void 0===n&&(n=!1),new Ns((n?t:e)||0,(n?e:t)||0)},Ws=ks({devicePixelContentBoxSize:Us(),borderBoxSize:Us(),contentBoxSize:Us(),contentRect:new Ps(0,0,0,0)}),Hs=function(e,t){if(void 0===t&&(t=!1),js.has(e)&&!t)return js.get(e);if(Ds(e))return js.set(e,Ws),Ws;var n=getComputedStyle(e),i=zs(e)&&e.ownerSVGElement&&e.getBBox(),r=!Vs&&"border-box"===n.boxSizing,s=Os.test(n.writingMode||""),a=!i&&Rs.test(n.overflowY||""),o=!i&&Rs.test(n.overflowX||""),l=i?0:_s(n.paddingTop),c=i?0:_s(n.paddingRight),u=i?0:_s(n.paddingBottom),d=i?0:_s(n.paddingLeft),h=i?0:_s(n.borderTopWidth),p=i?0:_s(n.borderRightWidth),f=i?0:_s(n.borderBottomWidth),g=d+c,m=l+u,v=(i?0:_s(n.borderLeftWidth))+p,b=h+f,w=o?e.offsetHeight-b-e.clientHeight:0,y=a?e.offsetWidth-v-e.clientWidth:0,x=r?g+v:0,C=r?m+b:0,M=i?i.width:_s(n.width)-x-y,S=i?i.height:_s(n.height)-C-w,I=M+g+y+v,E=S+m+w+b,A=ks({devicePixelContentBoxSize:Us(Math.round(M*devicePixelRatio),Math.round(S*devicePixelRatio),s),borderBoxSize:Us(I,E,s),contentBoxSize:Us(M,S,s),contentRect:new Ps(d,l,M,S)});return js.set(e,A),A},Qs=function(e,t,n){var i=Hs(e,n),r=i.borderBoxSize,s=i.contentBoxSize,a=i.devicePixelContentBoxSize;switch(t){case Ss.DEVICE_PIXEL_CONTENT_BOX:return a;case Ss.BORDER_BOX:return r;default:return s}},$s=function(e){var t=Hs(e);this.target=e,this.contentRect=t.contentRect,this.borderBoxSize=ks([t.borderBoxSize]),this.contentBoxSize=ks([t.contentBoxSize]),this.devicePixelContentBoxSize=ks([t.devicePixelContentBoxSize])},Fs=function(e){if(Ds(e))return 1/0;for(var t=0,n=e.parentNode;n;)t+=1,n=n.parentNode;return t},Zs=function(){var e=1/0,t=[];Es.forEach((function(n){if(0!==n.activeTargets.length){var i=[];n.activeTargets.forEach((function(t){var n=new $s(t.target),r=Fs(t.target);i.push(n),t.lastReportedSize=Qs(t.target,t.observedBox),r<e&&(e=r)})),t.push((function(){n.callback.call(n.observer,i,n.observer)})),n.activeTargets.splice(0,n.activeTargets.length)}}));for(var n=0,i=t;n<i.length;n++){(0,i[n])()}return e},Ys=function(e){Es.forEach((function(t){t.activeTargets.splice(0,t.activeTargets.length),t.skippedTargets.splice(0,t.skippedTargets.length),t.observationTargets.forEach((function(n){n.isActive()&&(Fs(n.target)>e?t.activeTargets.push(n):t.skippedTargets.push(n))}))}))},Gs=function(){var e,t=0;for(Ys(t);Es.some((function(e){return e.activeTargets.length>0}));)t=Zs(),Ys(t);return Es.some((function(e){return e.skippedTargets.length>0}))&&("function"==typeof ErrorEvent?e=new ErrorEvent("error",{message:As}):((e=document.createEvent("Event")).initEvent("error",!1,!1),e.message=As),window.dispatchEvent(e)),t>0},Xs=[],Js=function(e){if(!Ts){var t=0,n=document.createTextNode("");new MutationObserver((function(){return Xs.splice(0).forEach((function(e){return e()}))})).observe(n,{characterData:!0}),Ts=function(){n.textContent=""+(t?t--:t++)}}Xs.push(e),Ts()},Ks=0,qs={attributes:!0,characterData:!0,childList:!0,subtree:!0},ea=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],ta=function(e){return void 0===e&&(e=0),Date.now()+e},na=!1,ia=new(function(){function e(){var e=this;this.stopped=!0,this.listener=function(){return e.schedule()}}return e.prototype.run=function(e){var t=this;if(void 0===e&&(e=250),!na){na=!0;var n,i=ta(e);n=function(){var n=!1;try{n=Gs()}finally{if(na=!1,e=i-ta(),!Ks)return;n?t.run(1e3):e>0?t.run(e):t.start()}},Js((function(){requestAnimationFrame(n)}))}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var e=this,t=function(){return e.observer&&e.observer.observe(document.body,qs)};document.body?t():Bs.addEventListener("DOMContentLoaded",t)},e.prototype.start=function(){var e=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),ea.forEach((function(t){return Bs.addEventListener(t,e.listener,!0)})))},e.prototype.stop=function(){var e=this;this.stopped||(this.observer&&this.observer.disconnect(),ea.forEach((function(t){return Bs.removeEventListener(t,e.listener,!0)})),this.stopped=!0)},e}()),ra=function(e){!Ks&&e>0&&ia.start(),!(Ks+=e)&&ia.stop()},sa=function(){function e(e,t){this.target=e,this.observedBox=t||Ss.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var e,t=Qs(this.target,this.observedBox,!0);return e=this.target,zs(e)||function(e){switch(e.tagName){case"INPUT":if("image"!==e.type)break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1}(e)||"inline"!==getComputedStyle(e).display||(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),aa=function(e,t){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=e,this.callback=t},oa=new WeakMap,la=function(e,t){for(var n=0;n<e.length;n+=1)if(e[n].target===t)return n;return-1},ca=function(){function e(){}return e.connect=function(e,t){var n=new aa(e,t);oa.set(e,n)},e.observe=function(e,t,n){var i=oa.get(e),r=0===i.observationTargets.length;la(i.observationTargets,t)<0&&(r&&Es.push(i),i.observationTargets.push(new sa(t,n&&n.box)),ra(1),ia.schedule())},e.unobserve=function(e,t){var n=oa.get(e),i=la(n.observationTargets,t),r=1===n.observationTargets.length;i>=0&&(r&&Es.splice(Es.indexOf(n),1),n.observationTargets.splice(i,1),ra(-1))},e.disconnect=function(e){var t=this,n=oa.get(e);n.observationTargets.slice().forEach((function(n){return t.unobserve(e,n.target)})),n.activeTargets.splice(0,n.activeTargets.length)},e}(),ua=function(){function e(e){if(0===arguments.length)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if("function"!=typeof e)throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");ca.connect(this,e)}return e.prototype.observe=function(e,t){if(0===arguments.length)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Ls(e))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");ca.observe(this,e,t)},e.prototype.unobserve=function(e){if(0===arguments.length)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Ls(e))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");ca.unobserve(this,e)},e.prototype.disconnect=function(){ca.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();const da="undefined"!=typeof window,ha=da&&!("onscroll"in window)||"undefined"!=typeof navigator&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),pa=da&&"IntersectionObserver"in window,fa=da&&"classList"in document.createElement("p"),ga=da&&window.devicePixelRatio>1,ma={elements_selector:".lazy",container:ha||da?document:null,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",data_bg_hidpi:"bg-hidpi",data_bg_multi:"bg-multi",data_bg_multi_hidpi:"bg-multi-hidpi",data_poster:"poster",class_applied:"applied",class_loading:"loading",class_loaded:"loaded",class_error:"error",class_entered:"entered",class_exited:"exited",unobserve_completed:!0,unobserve_entered:!1,cancel_on_exit:!0,callback_enter:null,callback_exit:null,callback_applied:null,callback_loading:null,callback_loaded:null,callback_error:null,callback_finish:null,callback_cancel:null,use_native:!1},va=e=>Object.assign({},ma,e),ba=function(e,t){let n;const i="LazyLoad::Initialized",r=new e(t);try{n=new CustomEvent(i,{detail:{instance:r}})}catch(s){n=document.createEvent("CustomEvent"),n.initCustomEvent(i,!1,!1,{instance:r})}window.dispatchEvent(n)},wa="src",ya="llOriginalAttrs",xa=(e,t)=>e.getAttribute("data-"+t),Ca=e=>xa(e,"ll-status"),Ma=(e,t)=>((e,t,n)=>{var i="data-"+t;null!==n?e.setAttribute(i,n):e.removeAttribute(i)})(e,"ll-status",t),Sa=e=>Ma(e,null),Ia=e=>null===Ca(e),Ea=e=>"native"===Ca(e),Aa=["loading","loaded","applied","error"],Ta=(e,t,n,i)=>{e&&(void 0===i?void 0===n?e(t):e(t,n):e(t,n,i))},ka=(e,t)=>{fa?e.classList.add(t):e.className+=(e.className?" ":"")+t},Na=(e,t)=>{fa?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\s+)"+t+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},Pa=e=>e.llTempImage,za=(e,t)=>{if(!t)return;const n=t._observer;n&&n.unobserve(e)},Da=(e,t)=>{e&&(e.loadingCount+=t)},La=(e,t)=>{e&&(e.toLoadCount=t)},Ba=e=>{let t=[];for(let n,i=0;n=e.children[i];i+=1)"SOURCE"===n.tagName&&t.push(n);return t},ja=(e,t)=>{const n=e.parentNode;if(!n||"PICTURE"!==n.tagName)return;Ba(n).forEach(t)},Ra=(e,t)=>{Ba(e).forEach(t)},Oa=[wa],Va=[wa,"poster"],_a=[wa,"srcset","sizes"],Ua=e=>!!e[ya],Wa=e=>e[ya],Ha=e=>delete e[ya],Qa=(e,t)=>{if(Ua(e))return;const n={};t.forEach((t=>{n[t]=e.getAttribute(t)})),e[ya]=n},$a=(e,t)=>{if(!Ua(e))return;const n=Wa(e);t.forEach((t=>{((e,t,n)=>{n?e.setAttribute(t,n):e.removeAttribute(t)})(e,t,n[t])}))},Fa=(e,t,n)=>{ka(e,t.class_loading),Ma(e,"loading"),n&&(Da(n,1),Ta(t.callback_loading,e,n))},Za=(e,t,n)=>{n&&e.setAttribute(t,n)},Ya=(e,t)=>{Za(e,"sizes",xa(e,t.data_sizes)),Za(e,"srcset",xa(e,t.data_srcset)),Za(e,wa,xa(e,t.data_src))},Ga=(e,t,n)=>{const i=xa(e,t.data_bg_multi),r=xa(e,t.data_bg_multi_hidpi),s=ga&&r?r:i;s&&(e.style.backgroundImage=s,((e,t,n)=>{ka(e,t.class_applied),Ma(e,"applied"),n&&(t.unobserve_completed&&za(e,t),Ta(t.callback_applied,e,n))})(e,t,n))},Xa={IMG:(e,t)=>{ja(e,(e=>{Qa(e,_a),Ya(e,t)})),Qa(e,_a),Ya(e,t)},IFRAME:(e,t)=>{Qa(e,Oa),Za(e,wa,xa(e,t.data_src))},VIDEO:(e,t)=>{Ra(e,(e=>{Qa(e,Oa),Za(e,wa,xa(e,t.data_src))})),Qa(e,Va),Za(e,"poster",xa(e,t.data_poster)),Za(e,wa,xa(e,t.data_src)),e.load()}},Ja=["IMG","IFRAME","VIDEO"],Ka=(e,t)=>{!t||(e=>e.loadingCount>0)(t)||(e=>e.toLoadCount>0)(t)||Ta(e.callback_finish,t)},qa=(e,t,n)=>{e.addEventListener(t,n),e.llEvLisnrs[t]=n},eo=(e,t,n)=>{e.removeEventListener(t,n)},to=e=>!!e.llEvLisnrs,no=e=>{if(!to(e))return;const t=e.llEvLisnrs;for(let n in t){const i=t[n];eo(e,n,i)}delete e.llEvLisnrs},io=(e,t,n)=>{(e=>{delete e.llTempImage})(e),Da(n,-1),(e=>{e&&(e.toLoadCount-=1)})(n),Na(e,t.class_loading),t.unobserve_completed&&za(e,n)},ro=(e,t,n)=>{const i=Pa(e)||e;if(to(i))return;((e,t,n)=>{to(e)||(e.llEvLisnrs={});const i="VIDEO"===e.tagName?"loadeddata":"load";qa(e,i,t),qa(e,"error",n)})(i,(r=>{((e,t,n,i)=>{const r=Ea(t);io(t,n,i),ka(t,n.class_loaded),Ma(t,"loaded"),Ta(n.callback_loaded,t,i),r||Ka(n,i)})(0,e,t,n),no(i)}),(r=>{((e,t,n,i)=>{const r=Ea(t);io(t,n,i),ka(t,n.class_error),Ma(t,"error"),Ta(n.callback_error,t,i),r||Ka(n,i)})(0,e,t,n),no(i)}))},so=(e,t,n)=>{(e=>{e.llTempImage=document.createElement("IMG")})(e),ro(e,t,n),(e=>{Ua(e)||(e[ya]={backgroundImage:e.style.backgroundImage})})(e),((e,t,n)=>{const i=xa(e,t.data_bg),r=xa(e,t.data_bg_hidpi),s=ga&&r?r:i;s&&(e.style.backgroundImage=`url("${s}")`,Pa(e).setAttribute(wa,s),Fa(e,t,n))})(e,t,n),Ga(e,t,n)},ao=(e,t,n)=>{ro(e,t,n),((e,t,n)=>{const i=Xa[e.tagName];i&&(i(e,t),Fa(e,t,n))})(e,t,n)},oo=(e,t,n)=>{(e=>Ja.indexOf(e.tagName)>-1)(e)?ao(e,t,n):so(e,t,n)},lo=(e,t,n)=>{e.setAttribute("loading","lazy"),ro(e,t,n),((e,t)=>{const n=Xa[e.tagName];n&&n(e,t)})(e,t),Ma(e,"native")},co=e=>{e.removeAttribute(wa),e.removeAttribute("srcset"),e.removeAttribute("sizes")},uo=e=>{ja(e,(e=>{$a(e,_a)})),$a(e,_a)},ho={IMG:uo,IFRAME:e=>{$a(e,Oa)},VIDEO:e=>{Ra(e,(e=>{$a(e,Oa)})),$a(e,Va),e.load()}},po=e=>{const t=ho[e.tagName];t?t(e):(e=>{if(!Ua(e))return;const t=Wa(e);e.style.backgroundImage=t.backgroundImage})(e)},fo=(e,t)=>{po(e),((e,t)=>{Ia(e)||Ea(e)||(Na(e,t.class_entered),Na(e,t.class_exited),Na(e,t.class_applied),Na(e,t.class_loading),Na(e,t.class_loaded),Na(e,t.class_error))})(e,t),Sa(e),Ha(e)},go=(e,t,n,i)=>{n.cancel_on_exit&&(e=>"loading"===Ca(e))(e)&&"IMG"===e.tagName&&(no(e),(e=>{ja(e,(e=>{co(e)})),co(e)})(e),uo(e),Na(e,n.class_loading),Da(i,-1),Sa(e),Ta(n.callback_cancel,e,t,i))},mo=(e,t,n,i)=>{const r=(e=>Aa.indexOf(Ca(e))>=0)(e);Ma(e,"entered"),ka(e,n.class_entered),Na(e,n.class_exited),((e,t,n)=>{t.unobserve_entered&&za(e,n)})(e,n,i),Ta(n.callback_enter,e,t,i),r||oo(e,n,i)},vo=["IMG","IFRAME","VIDEO"],bo=e=>e.use_native&&"loading"in HTMLImageElement.prototype,wo=(e,t,n)=>{e.forEach((e=>(e=>e.isIntersecting||e.intersectionRatio>0)(e)?mo(e.target,e,t,n):((e,t,n,i)=>{Ia(e)||(ka(e,n.class_exited),go(e,t,n,i),Ta(n.callback_exit,e,t,i))})(e.target,e,t,n)))},yo=(e,t)=>{pa&&!bo(e)&&(t._observer=new IntersectionObserver((n=>{wo(n,e,t)}),(e=>({root:e.container===document?null:e.container,rootMargin:e.thresholds||e.threshold+"px"}))(e)))},xo=e=>Array.prototype.slice.call(e),Co=e=>e.container.querySelectorAll(e.elements_selector),Mo=e=>(e=>"error"===Ca(e))(e),So=(e,t)=>(e=>xo(e).filter(Ia))(e||Co(t)),Io=(e,t)=>{var n;(n=Co(e),xo(n).filter(Mo)).forEach((t=>{Na(t,e.class_error),Sa(t)})),t.update()},Eo=function(e,t){const n=va(e);this._settings=n,this.loadingCount=0,yo(n,this),((e,t)=>{da&&window.addEventListener("online",(()=>{Io(e,t)}))})(n,this),this.update(t)};Eo.prototype={update:function(e){const t=this._settings,n=So(e,t);var i,r;(La(this,n.length),!ha&&pa)?bo(t)?((e,t,n)=>{e.forEach((e=>{-1!==vo.indexOf(e.tagName)&&lo(e,t,n)})),La(n,0)})(n,t,this):(i=this._observer,r=n,(e=>{e.disconnect()})(i),((e,t)=>{t.forEach((t=>{e.observe(t)}))})(i,r)):this.loadAll(n)},destroy:function(){this._observer&&this._observer.disconnect(),Co(this._settings).forEach((e=>{Ha(e)})),delete this._observer,delete this._settings,delete this.loadingCount,delete this.toLoadCount},loadAll:function(e){const t=this._settings;So(e,t).forEach((e=>{za(e,this),oo(e,t,this)}))},restoreAll:function(){const e=this._settings;Co(e).forEach((t=>{fo(t,e)}))}},Eo.load=(e,t)=>{const n=va(t);oo(e,n)},Eo.resetStatus=e=>{Sa(e)},da&&((e,t)=>{if(t)if(t.length)for(let n,i=0;n=t[i];i+=1)ba(e,n);else ba(e,t)})(Eo,window.lazyLoadOptions);class Ao{constructor({readonly:e,box:t,pages:n,onNewPageIndex:i,onPlay:r}){if(this.pageIndex=0,this.namespace="netless-app-docs-viewer",this.isShowPreview=!1,this.isSmallBox=!1,this.sideEffect=new Ms,n.length<=0)throw new Error("[DocsViewer] Empty pages.");this.readonly=e,this.box=t,this.pages=n,this.onNewPageIndex=i,this.onPlay=r,this.render()}mount(){this.box.mountContent(this.$content),this.box.mountFooter(this.$footer),this.sideEffect.add((()=>{const e=new Eo({container:this.$preview,elements_selector:`.${this.wrapClassName("preview-page>img")}`});return()=>e.destroy()}),"preview-lazyload")}unmount(){this.$content.remove(),this.$footer.remove()}setReadonly(e){this.readonly!==e&&(this.readonly=e,this.$content.classList.toggle(this.wrapClassName("readonly"),e),this.$footer.classList.toggle(this.wrapClassName("readonly"),e),this.$pageNumberInput.disabled=e)}destroy(){this.sideEffect.flushAll(),this.unmount()}setPageIndex(e){Number.isNaN(e)||(this.pageIndex=e,this.$pageNumberInput.value=String(e+1))}setSmallBox(e){this.isSmallBox!==e&&(this.isSmallBox=e,this.$footer.classList.toggle(this.wrapClassName("float-footer"),e))}render(){return this.renderContent(),this.renderFooter(),this.$content}renderContent(){if(!this.$content){const e=document.createElement("div");e.className=this.wrapClassName("content"),this.$content=e,this.readonly&&e.classList.add(this.wrapClassName("readonly")),e.appendChild(this.renderPreviewMask()),e.appendChild(this.renderPreview())}return this.$content}renderPreview(){if(!this.$preview){const e=document.createElement("div");e.className=this.wrapClassName("preview")+" tele-fancy-scrollbar",this.$preview=e;const t=this.wrapClassName("preview-page"),n=this.wrapClassName("preview-page-name");this.pages.forEach(((i,r)=>{var s;const a=null!=(s=i.thumbnail)?s:i.src.startsWith("ppt")?void 0:i.src;if(!a)return;const o=String(r),l=document.createElement("a");l.className=t+" "+this.wrapClassName(`preview-page-${r}`),l.setAttribute("href","#"),l.dataset.pageIndex=o;const c=document.createElement("span");c.className=n,c.textContent=String(r+1),c.dataset.pageIndex=o;const u=document.createElement("img");u.width=i.width,u.height=i.height,u.dataset.src=a,u.dataset.pageIndex=o,l.appendChild(u),l.appendChild(c),e.appendChild(l)})),this.sideEffect.addEventListener(e,"click",(e=>{var t;if(this.readonly)return;const n=null==(t=e.target.dataset)?void 0:t.pageIndex;n&&(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),this.onNewPageIndex(Number(n)),this.togglePreview(!1))}))}return this.$preview}renderPreviewMask(){return this.$previewMask||(this.$previewMask=document.createElement("div"),this.$previewMask.className=this.wrapClassName("preview-mask"),this.sideEffect.addEventListener(this.$previewMask,"click",(e=>{this.readonly||e.target===this.$previewMask&&this.togglePreview(!1)}))),this.$previewMask}renderFooter(){if(!this.$footer){const e=document.createElement("div");if(e.className=this.wrapClassName("footer"),this.$footer=e,this.readonly&&e.classList.add(this.wrapClassName("readonly")),this.isSmallBox&&e.classList.add(this.wrapClassName("float-footer")),this.pages.some((e=>e.thumbnail||!e.src.startsWith("ppt")))){const e=this.renderFooterBtn("btn-sidebar",function(e){const t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");n.setAttribute("class",`${e}-footer-icon-sidebar`),n.setAttribute("viewBox","0 0 64 64");const i=document.createElementNS(t,"path");return i.setAttribute("fill","currentColor"),i.setAttribute("d","M50 8H14c-3.309 0-6 2.691-6 6v36c0 3.309 2.691 6 6 6h36c3.309 0 6-2.691 6-6V14c0-3.309-2.691-6-6-6zM12 50V14c0-1.103.897-2 2-2h8v40h-8c-1.103 0-2-.897-2-2zm40 0c0 1.103-.897 2-2 2H26V12h24c1.103 0 2 .897 2 2z"),n.appendChild(i),n}(this.namespace));this.sideEffect.addEventListener(e,"click",(()=>{this.readonly||this.togglePreview()})),this.$footer.appendChild(e)}const t=document.createElement("div");t.className=this.wrapClassName("page-jumps");const n=this.renderFooterBtn("btn-page-back",function(e){const t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");n.setAttribute("class",`${e}-footer-icon-arrow-left`),n.setAttribute("viewBox","0 0 500 500");const i=document.createElementNS(t,"path");return i.setAttribute("fill","currentColor"),i.setAttribute("d","M177.81 249.959L337.473 90.295c2.722-2.865 2.651-7.378-.143-10.1-2.793-2.65-7.163-2.65-9.956 0l-164.75 164.75c-2.793 2.793-2.793 7.306 0 10.1l164.75 164.75c2.865 2.722 7.378 2.65 10.099-.143 2.651-2.794 2.651-7.163 0-9.957L177.809 249.959z"),n.appendChild(i),n}(this.namespace));if(this.sideEffect.addEventListener(n,"click",(()=>{this.readonly||this.onNewPageIndex(this.pageIndex-1)})),t.appendChild(n),this.onPlay){const e=this.renderFooterBtn("btn-page-play",function(e){const t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");n.setAttribute("class",`${e}-footer-icon-play`),n.setAttribute("viewBox","0 0 500 500");const i=document.createElementNS(t,"path");return i.setAttribute("fill","currentColor"),i.setAttribute("d","M418.158 257.419L174.663 413.33c-6.017 3.919-15.708 3.772-21.291-.29-2.791-2.018-4.295-4.483-4.295-7.084V94.109c0-5.65 6.883-10.289 15.271-10.289 4.298 0 8.391 1.307 11.181 3.332l242.629 155.484c6.016 3.917 6.451 10.292.649 14.491-.216.154-.432.154-.649.292zM170.621 391.288l223.116-141.301L170.71 107.753l-.089 283.535z"),n.appendChild(i),n}(this.namespace),function(e){const t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");n.setAttribute("class",`${e}-footer-icon-pause`),n.setAttribute("viewBox","0 0 500 500");const i=document.createElementNS(t,"path");return i.setAttribute("fill","currentColor"),i.setAttribute("d","M312.491 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261zM165.257 78.261c0-6.159 4.893-11.213 11.04-11.213 6.158 0 11.211 5.054 11.211 11.213v343.478c0 6.159-5.053 11.213-11.211 11.213-6.147 0-11.04-5.054-11.04-11.213V78.261z"),n.appendChild(i),n}(this.namespace)),n=()=>{this.sideEffect.setTimeout((()=>{e.classList.toggle(this.wrapClassName("footer-btn-playing"),!1)}),500,"returnPlay")};this.sideEffect.addEventListener(e,"click",(()=>{this.readonly||(e.classList.toggle(this.wrapClassName("footer-btn-playing"),!0),this.onPlay&&this.onPlay(),n())})),t.appendChild(e)}const i=this.renderFooterBtn("btn-page-next",function(e){const t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");n.setAttribute("class",`${e}-footer-icon-arrow-right`),n.setAttribute("viewBox","0 0 500 500");const i=document.createElementNS(t,"path");return i.setAttribute("fill","currentColor"),i.setAttribute("d","M322.19 250.041L162.527 409.705c-2.722 2.865-2.651 7.378.143 10.1 2.793 2.65 7.163 2.65 9.956 0l164.75-164.75c2.793-2.793 2.793-7.306 0-10.1l-164.75-164.75c-2.865-2.722-7.378-2.65-10.099.143-2.651 2.794-2.651 7.163 0 9.957l159.664 159.736z"),n.appendChild(i),n}(this.namespace));this.sideEffect.addEventListener(i,"click",(()=>{this.readonly||this.onNewPageIndex(this.pageIndex+1)})),t.appendChild(i);const r=document.createElement("div");r.className=this.wrapClassName("page-number");const s=document.createElement("input");s.className=this.wrapClassName("page-number-input"),s.value=String(this.pageIndex+1),this.readonly&&(s.disabled=!0),this.$pageNumberInput=s,this.sideEffect.addEventListener(s,"focus",(()=>{s.select()})),this.sideEffect.addEventListener(s,"change",(()=>{this.readonly||s.value&&this.onNewPageIndex(Number(s.value)-1)}));const a=document.createElement("span");a.textContent=" / "+this.pages.length,r.appendChild(s),r.appendChild(a),this.$footer.appendChild(t),this.$footer.appendChild(r)}return this.$footer}renderFooterBtn(e,t,n){const i=document.createElement("button");return i.className=this.wrapClassName("footer-btn")+" "+this.wrapClassName(e),i.appendChild(t),n&&i.appendChild(n),i}togglePreview(e){if(this.isShowPreview=null!=e?e:!this.isShowPreview,this.$content.classList.toggle(this.wrapClassName("preview-active"),this.isShowPreview),this.isShowPreview){const e=this.$preview.querySelector("."+this.wrapClassName(`preview-page-${this.pageIndex}`));e&&this.$preview.scrollTo({top:e.offsetTop-16})}}wrapClassName(e){return`${this.namespace}-${e}`}}function To(e,t,n){return Math.min(Math.max(e,t),n)}function ko(e){return e.touches?e.touches[0]:e}function No(e){e.stopPropagation(),e.cancelable&&e.preventDefault()}class Po{constructor(e){var t,n,i;this.velocity=0,this.paused=!0,this._animationFrameID=null,this._loopTimestamp=0,this.looper=e=>{if(this.paused)return;let t=Math.floor((e-this._loopTimestamp)/1e3*60)+1;for(this._loopTimestamp=e;t-- >0;)this.stepper();this.onStep(this.current,this),this.paused||this.current===this.target||window.requestAnimationFrame(this.looper)},this.current=null!=(t=e.start)?t:0,this.target=this.current,this.stiffness=null!=(n=e.stiffness)?n:170,this.damping=null!=(i=e.damping)?i:26,this.onStep=e.onStep}stepTo(e,t){this.paused&&null!=t&&(this.current=t),this.paused=!1,this.target=e,this.onStep(this.current,this),this._loopTimestamp=Date.now(),window.requestAnimationFrame(this.looper)}pause(){this.paused=!0}destroy(){this.pause()}stepper(){const e=-this.stiffness*(this.current-this.target),t=-this.damping*this.velocity,n=this.velocity+(e+t)/60,i=this.current+n/60;Math.abs(n-0)<.01&&Math.abs(i-this.target)<.01?(this.current=this.target,this.velocity=0):(this.current=i,this.velocity=n)}}class zo{constructor(e,t,n,i){this.scale=1,this.lastVisit=Date.now(),this.pageOffsetY=0,this.pageOffsetX=0,this.visible=!0,this.index=e,this.page=t,this.scale=n,this.pageOffsetX=(i-t.width)/2;const r=document.createElement("div");r.className="page-renderer-page",r.dataset.index=`${e}`,r.style.width=t.width*n+"px",r.style.height=t.height*n+"px",t.thumbnail&&(r.style.backgroundImage=`url("${t.thumbnail}")`);const s=document.createElement("img");s.className="page-renderer-page-img",s.width=t.width,s.height=t.height,s.src=t.src,r.appendChild(s),this.$page=r}translateY(e){Math.abs(e-this.pageOffsetY)>=.001&&(this.pageOffsetY=e,this.$page.style.transform=`translate(${this.pageOffsetX*this.scale}px, ${this.pageOffsetY*this.scale}px)`)}setScale(e){Math.abs(e-this.scale)>=.001&&(this.scale=e,this.$page.style.width=this.page.width*this.scale+"px",this.$page.style.height=this.page.height*this.scale+"px",this.$page.style.transform=`translate(${this.pageOffsetX*this.scale}px, ${this.pageOffsetY*this.scale}px)`)}setVisible(e){e!==this.visible&&(this.visible=e,this.$page.style.opacity=e?"1":"0")}}const Do=window.requestIdleCallback||(e=>window.setTimeout(e,5e3)),Lo=window.cancelIdleCallback||window.clearTimeout;class Bo{constructor(e,t,n){this.pages=e,this.pagesIntrinsicWidth=t,this.scale=n,this.els=new Map,this.maxElCount=200,this.gcTimer=null,this.gc=()=>{if(this.gcTimer=null,this.els.size>this.maxElCount){const e=[...this.els.values()].sort(((e,t)=>t.lastVisit-e.lastVisit));for(let t=Math.floor(this.maxElCount/4);t<e.length;t++)this.els.delete(e[t].index)}}}getEl(e){let t=this.els.get(e);return t||(t=new zo(e,this.pages[e],this.scale,this.pagesIntrinsicWidth),this.els.set(e,t)),t.lastVisit=Date.now(),this.els.size>this.maxElCount&&null===this.gcTimer&&(this.gcTimer=Do(this.gc)),t}setScale(e){e!==this.scale&&(this.scale=e,this.els.forEach((t=>t.setScale(e))))}destroy(){this.els.clear(),null!==this.gcTimer&&(Lo(this.gcTimer),this.gcTimer=null)}}class jo{constructor(e){this._hwaTimeout=NaN,this._turnOffHWA=()=>{window.clearTimeout(this._hwaTimeout),this._hwaTimeout=NaN,this.$pages.classList.toggle("is-hwa",!1)},this.pagesScrollTop=e.pagesScrollTop||0,this.containerWidth=e.containerWidth||1,this.containerHeight=e.containerHeight||1,this.pages=e.pages.map((e=>{if(e.thumbnail)return e;try{const t=new URL(e.src);return t.searchParams.set("x-oss-process","image/resize,l_50"),ds(us({},e),{thumbnail:t.toString()})}catch(zb){return console.error(zb),e}}));const t=Array(this.pages.length);let n=1/0,i=0;this.pagesIntrinsicHeight=this.pages.reduce(((e,r,s)=>(t[s]=e,r.width>i&&(i=r.width),r.height<=n&&(n=r.height),e+r.height)),0),this.pagesIntrinsicWidth=i,this.pagesMinHeight=n,this.pagesIntrinsicYs=t,this.scale=this._calcScale(),this.threshold=this._calcThreshold(),this.onPageIndexChanged=e.onPageIndexChanged,this.pageScrollIndex=0,0!==this.pagesScrollTop&&(this.pageScrollIndex=this.findScrollPageIndex(),this.onPageIndexChanged&&this.pageScrollIndex>0&&this.onPageIndexChanged(this.pageScrollIndex)),this.pageElManager=new Bo(this.pages,i,this.scale),this.$pages=this.renderPages()}setContainerSize(e,t){e>0&&t>0&&(e===this.containerWidth&&t===this.containerHeight||(this.containerWidth=e,this.containerHeight=t,this.$pages.style.width=`${this.containerWidth}px`,this.$pages.style.height=`${this.containerHeight}px`,this.scale=this._calcScale(),this.threshold=this._calcThreshold(),this.pageElManager.setScale(this.scale),this.$pages.parentElement&&this.pagesScrollTo(this.pagesScrollTop,!0)))}renderPages(){const e=document.createElement("div");return e.className="page-renderer-pages-container",e.style.width=`${this.containerWidth}px`,e.style.height=`${this.containerHeight}px`,e}pagesScrollTo(e,t){if(e=To(e,0,this.pagesIntrinsicHeight-this.containerHeight/this.scale),t||Math.abs(e-this.pagesScrollTop)>=.001){this._turnOnHWA(),this.pagesScrollTop=e;const t=this.findScrollPageIndex(),n=Math.max(t-this.threshold,0),i=Math.min(t+this.threshold,this.pages.length-1);for(let e=0;e<this.$pages.children.length;e++){const t=this.$pages.children[e],r=Number(t.dataset.index);r>=n&&r<=i||(t.remove(),e--)}for(let e=n;e<=i;e++){const t=this.pageElManager.getEl(e);t.$page.parentElement!==this.$pages&&this.$pages.appendChild(t.$page),t.translateY(this.pagesIntrinsicYs[e]-this.pagesScrollTop)}t!==this.pageScrollIndex&&(this.pageScrollIndex=t,this.onPageIndexChanged&&this.onPageIndexChanged(t))}}findScrollPageIndex(){for(let e=0;e<this.pagesIntrinsicYs.length;e++)if(this.pagesIntrinsicYs[e]+this.pages[e].height-this.pagesScrollTop>=.001)return e;return this.pagesIntrinsicYs.length-1}mount(e){e.appendChild(this.$pages),this.pagesScrollTo(this.pagesScrollTop,!0)}unmount(){this.$pages.remove()}destroy(){this.unmount(),this.onPageIndexChanged=void 0,this.pageElManager.destroy(),this._hwaTimeout&&(window.clearTimeout(this._hwaTimeout),this._hwaTimeout=NaN)}_calcScale(){return this.containerWidth/this.pagesIntrinsicWidth||1}_calcThreshold(){return To(Math.ceil(this.containerHeight/this.scale/this.pagesMinHeight/2),1,this.pages.length)}_turnOnHWA(){this._hwaTimeout?window.clearTimeout(this._hwaTimeout):this.$pages.classList.toggle("is-hwa",!0),this._hwaTimeout=window.setTimeout(this._turnOffHWA,1e3)}}class Ro{constructor(e){this.sideEffect=new Ms,this.pagesScrollTop=e.pagesScrollTop||0,this.containerWidth=e.containerWidth||1,this.containerHeight=e.containerHeight||1,this.pagesWidth=e.pagesWidth||1,this.pagesHeight=e.pagesHeight||1,this.scale=this._calcScale(),this.scrollbarMinHeight=e.scrollbarMinHeight||30,this.scrollbarHeight=this._calcScrollbarHeight(),this.readonly=e.readonly,this.wrapClassName=e.wrapClassName,this.onDragScroll=e.onDragScroll,this.$scrollbar=this.renderScrollbar()}mount(e){e.appendChild(this.$scrollbar),this.pagesScrollTo(this.pagesScrollTop,!0)}unmount(){this.$scrollbar.remove()}setReadonly(e){this.readonly=e}setContainerSize(e,t){e>0&&t>0&&(e===this.containerWidth&&t===this.containerHeight||(this.containerWidth=e,this.containerHeight=t,this.scale=this._calcScale(),this._updateScrollbarHeight(),this.$scrollbar.parentElement&&this.pagesScrollTo(this.pagesScrollTop,!0)))}pagesScrollTo(e,t){if(e=To(e,0,this.pagesHeight-this.containerHeight/this.scale),t||Math.abs(e-this.pagesScrollTop)>=.001){this.pagesScrollTop=e;const t=this.pagesScrollTop*this.scale/(this.pagesHeight*this.scale-this.containerHeight)*(this.containerHeight-this.scrollbarHeight);window.requestAnimationFrame?window.requestAnimationFrame((()=>{this.$scrollbar.style.transform=`translateY(${t}px)`})):this.$scrollbar.style.transform=`translateY(${t}px)`}}destroy(){this.unmount(),this.onDragScroll=void 0,this.sideEffect.flushAll()}renderScrollbar(){const e=document.createElement("button");e.className=this.wrapClassName("scrollbar"),e.style.minHeight=`${this.scrollbarMinHeight}px`,e.style.height=`${this.scrollbarHeight}px`;const t=t=>{if(this.readonly)return;if(null!=t.button&&0!==t.button)return;No(t);const n=this.wrapClassName("scrollbar-dragging");e.classList.toggle(n,!0);const i=this.pagesScrollTop,{clientY:r}=ko(t),s=e=>{if(this.readonly)return;const{clientY:t}=ko(e),n=(t-r)/this.scale;Math.abs(n)>0&&this.onDragScroll&&this.onDragScroll(i+n*(this.pagesHeight*this.scale/this.containerHeight))},a=()=>{e.classList.toggle(n,!1),window.removeEventListener("mousemove",s,!0),window.removeEventListener("touchmove",s,!0),window.removeEventListener("mouseup",a,!0),window.removeEventListener("touchend",a,!0),window.removeEventListener("touchcancel",a,!0)};window.addEventListener("mousemove",s,!0),window.addEventListener("touchmove",s,!0),window.addEventListener("mouseup",a,!0),window.addEventListener("touchend",a,!0),window.addEventListener("touchcancel",a,!0)};return this.sideEffect.addEventListener(e,"mousedown",t),this.sideEffect.addEventListener(e,"touchstart",t),e}_calcScale(){return this.containerWidth/this.pagesWidth||1}_calcScrollbarHeight(){return To(this.containerHeight/(this.pagesHeight*this.scale)*this.containerHeight,this.scrollbarMinHeight,this.containerHeight)}_updateScrollbarHeight(){const e=this._calcScrollbarHeight();Math.abs(e-this.scrollbarHeight)>.001&&(this.scrollbarHeight=e,this.$scrollbar.style.height=`${e}px`)}}const Oo=window.ResizeObserver||ua;class Vo{constructor({whiteboardView:e,readonly:t,box:n,pages:i,pageScrollTop:r=0,mountWhiteboard:s,onUserScroll:a}){this.sideEffect=new Ms,this.userScrolling=!1,this.onNewPageIndex=e=>{this.scrollToPage(e)},this.whiteboardView=e,this.readonly=t,this.box=n,this.pages=i,this.mountWhiteboard=s,this._onUserScroll=a;const o=this.debounce((()=>{this.userScrolling=!1,this._onUserScroll&&this._onUserScroll(this.pageRenderer.pagesScrollTop)}),{wait:80},"debounce-updateUserScroll");this.updateUserScroll=()=>{this.userScrolling=!0,o()},this.viewer=new Ao({readonly:t,box:n,pages:i,onNewPageIndex:this.onNewPageIndex});const{width:l,height:c}=this.whiteboardView.size;this.pageRenderer=new jo({pagesScrollTop:r,pages:this.pages,containerWidth:l,containerHeight:c,onPageIndexChanged:this.viewer.setPageIndex.bind(this.viewer)}),this.scrollbar=new Ro({pagesScrollTop:this.pageRenderer.pagesScrollTop,containerWidth:l,containerHeight:c,pagesWidth:this.pageRenderer.pagesIntrinsicWidth,pagesHeight:this.pageRenderer.pagesIntrinsicHeight,readonly:this.readonly,wrapClassName:this.wrapClassName.bind(this),onDragScroll:e=>{this.pageScrollTo(e),this.updateUserScroll()}}),this.pageScrollStepper=new Po({start:this.pageRenderer.pagesScrollTop,onStep:e=>{this.pageScrollTo(e)}}),this.render()}mount(){this.viewer.mount(),this.setupScrollListener();const e=this.debounce(this.renderRatioHeight.bind(this),{wait:80});return this.sideEffect.add((()=>{const t=new Oo(e);return t.observe(this.viewer.$content),()=>t.disconnect()})),this.sideEffect.setTimeout((()=>{this.userScrolling||this.pageScrollTo(this.pageRenderer.pagesScrollTop)}),100),this}unmount(){return this.viewer.unmount(),this}setReadonly(e){this.readonly!==e&&(this.readonly=e,this.viewer.setReadonly(e),this.scrollbar.setReadonly(e))}destroy(){this.sideEffect.flushAll(),this.pageScrollStepper.destroy(),this._onUserScroll=void 0,this.unmount(),this.viewer.destroy(),this.pageRenderer.destroy(),this.scrollbar.destroy()}syncPageScrollTop(e){!this.userScrolling&&e>=0&&Math.abs(this.pageRenderer.pagesScrollTop-e)>.01&&this.pageScrollStepper.stepTo(e,this.pageRenderer.pagesScrollTop)}render(){this.pageRenderer.mount(this.viewer.$content),this.viewer.$content.appendChild(this.renderWhiteboardView()),this.scrollbar.mount(this.viewer.$content),this.renderRatioHeight()}renderRatioHeight(){const e=this.box.absoluteHeight,t=e<=640;if(this.viewer.setSmallBox(t),t){const t=26/640,n=26/e,i=26/640,r=0,s=Math.max((t+i-(n+r))/2,0);if(this.box.$titleBar){const e=n+s;this.box.$titleBar.style.height=100*e+"%"}if(this.box.$footer){const e=r+s;this.box.$footer.style.height=100*e+"%"}}else{if(this.box.$titleBar){const t=Math.max(26/640,26/e);this.box.$titleBar.style.height=100*t+"%"}if(this.box.$footer){const t=Math.max(26/640,26/e);this.box.$footer.style.height=100*t+"%"}}}renderWhiteboardView(){return this.$whiteboardView||(this.$whiteboardView=document.createElement("div"),this.$whiteboardView.className=this.wrapClassName("wb-view"),this.mountWhiteboard(this.$whiteboardView),this.sideEffect.addEventListener(this.$whiteboardView,"wheel",(e=>{No(e),this.readonly||(this.pageScrollTo(this.pageRenderer.pagesScrollTop+e.deltaY),this.updateUserScroll())}),{passive:!1,capture:!0}),this.sideEffect.addEventListener(this.$whiteboardView,"touchmove",(e=>{this.readonly||e.touches.length<=1||this.updateUserScroll()}),{passive:!0,capture:!0})),this.$whiteboardView}scrollTopPageToEl(e){return e*this.pageRenderer.scale}scrollTopElToPage(e){return e/this.pageRenderer.scale}elScrollTo(e){this.pageScrollTo(this.scrollTopElToPage(e))}pageScrollTo(e){const t=this.scrollTopElToPage(this.whiteboardView.size.height/2);this.whiteboardView.moveCamera({centerY:To(e+t,t,this.pageRenderer.pagesIntrinsicHeight-t),animationMode:"immediately"})}scrollToPage(e){if(!this.readonly&&!Number.isNaN(e)){const t=this.pageRenderer.pagesIntrinsicYs[e];t>=0&&(this.pageScrollTo(t+5/this.pageRenderer.scale),this.updateUserScroll())}}setupScrollListener(){this.sideEffect.add((()=>{const e=e=>{const{width:t,height:n}=this.whiteboardView.size;if(t<=0||n<=0)return;const i=e.centerY-this.pageRenderer.containerHeight/this.pageRenderer.scale/2;this.pageRenderer.pagesScrollTo(i),this.scrollbar.pagesScrollTo(i)};return this.whiteboardView.callbacks.on("onCameraUpdated",e),()=>this.whiteboardView.callbacks.off("onCameraUpdated",e)})),this.sideEffect.add((()=>{const e=({width:e,height:t})=>{if(e<=0||t<=0)return;this.pageRenderer.setContainerSize(e,t),this.scrollbar.setContainerSize(e,t);const{pagesIntrinsicWidth:n,pagesIntrinsicHeight:i}=this.pageRenderer;this.whiteboardView.moveCameraToContain({originX:0,originY:this.pageRenderer.pagesScrollTop,width:n,height:t/this.pageRenderer.scale,animationMode:"immediately"}),this.whiteboardView.setCameraBound({damping:1,maxContentMode:()=>this.pageRenderer.scale,minContentMode:()=>this.pageRenderer.scale,centerX:n/2,centerY:i/2,width:n,height:i})};return this.whiteboardView.callbacks.on("onSizeUpdated",e),()=>{this.whiteboardView.callbacks.off("onSizeUpdated",e)}}),"whiteboard-size-update"),this.sideEffect.addEventListener(window,"keyup",(e=>{if(this.readonly||!this.box.focus||this.box.minimized)return;let t=null;switch(e.key){case"PageDown":t=this.pageRenderer.pagesScrollTop+this.pageRenderer.containerHeight/this.pageRenderer.scale;break;case"PageUp":t=this.pageRenderer.pagesScrollTop-this.pageRenderer.containerHeight/this.pageRenderer.scale;break;case"ArrowDown":t=this.pageRenderer.pagesScrollTop+this.pageRenderer.containerHeight/4/this.pageRenderer.scale;break;case"ArrowUp":t=this.pageRenderer.pagesScrollTop-this.pageRenderer.containerHeight/4/this.pageRenderer.scale}null!==t&&(this._onUserScroll?this._onUserScroll(t):(this.pageScrollTo(t),this.updateUserScroll()))}),{capture:!0})}debounce(e,t,n){const i=bs(e,t);return this.sideEffect.addDisposer((()=>i.cancel()),n),i}wrapClassName(e){return"netless-app-docs-viewer-static-"+e}}class _o{constructor({context:e,whiteboardView:t,box:n,pages:i}){this.sideEffect=new Ms,this.onPlayPPT=()=>{const e=this.context.getRoom();e&&e.pptNextStep()},this._scaleDocsToFitImpl=()=>{const e=this.pages[this.getPageIndex()];e&&this.whiteboardView.moveCameraToContain({originX:-e.width/2,originY:-e.height/2,width:e.width,height:e.height,animationMode:"immediately"})},this._scaleDocsToFitDebounced=()=>{this.sideEffect.setTimeout(this._scaleDocsToFitImpl,1e3,"_scaleDocsToFitDebounced")},this.scaleDocsToFit=()=>{this._scaleDocsToFitImpl(),this._scaleDocsToFitDebounced()},this.onNewPageIndex=e=>{this.jumpToPage(e,!0)},this.context=e,this.whiteboardView=t,this.box=n,this.pages=i,this.displayer=e.getDisplayer(),this.viewer=new Ao({readonly:!e.getIsWritable(),box:n,pages:i,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlayPPT}),this.render(),this.sideEffect.add((()=>{const e=e=>{this.viewer.setReadonly(!e)};return this.context.emitter.on("writableChange",e),()=>this.context.emitter.off("writableChange",e)})),this.sideEffect.add((()=>{const e=e=>{this.jumpToPage(e.index)};return this.context.emitter.on("sceneStateChange",e),()=>this.context.emitter.off("sceneStateChange",e)}))}mount(){this.viewer.mount();const e=this.getPageIndex();return 0!==e&&this.jumpToPage(e),this.scaleDocsToFit(),this.sideEffect.add((()=>(this.whiteboardView.callbacks.on("onSizeUpdated",this.scaleDocsToFit),()=>{this.whiteboardView.callbacks.off("onSizeUpdated",this.scaleDocsToFit)}))),this}unmount(){return this.viewer.unmount(),this}destroy(){this.sideEffect.flushAll(),this.unmount(),this.viewer.destroy()}getPageIndex(){return this.displayer.state.sceneState.index}jumpToPage(e,t){var n,i;if((e=To(e,0,this.pages.length-1))!==this.getPageIndex()&&this.context.getIsWritable()){const t=this.context.getInitScenePath(),r=null==(i=null==(n=this.context.getScenes())?void 0:n[e])?void 0:i.name;t&&r&&this.context.setScenePath(`${t}/${r}`),this.scaleDocsToFit()}if(e!==this.viewer.pageIndex&&this.viewer.setPageIndex(e),t){const t=this.context.getRoom();if(t){const n=t.state.globalState.__pptState;t.setGlobalState({__pptState:n&&{uuid:n.uuid,pageIndex:e,disableAutoPlay:n.disableAutoPlay}})}}}render(){this.viewer.$content.appendChild(this.renderMask()),this.viewer.$content.appendChild(this.renderWhiteboardView()),this.sideEffect.addEventListener(window,"keydown",(e=>{var t;if(this.box.focus)switch(e.key){case"ArrowUp":case"ArrowLeft":this.jumpToPage(this.getPageIndex()-1,!0);break;case"ArrowRight":case"ArrowDown":null==(t=this.context.getRoom())||t.pptNextStep()}}))}renderMask(){if(!this.$mask){const e=document.createElement("div");e.className=this.wrapClassName("mask"),this.$mask=e;document.createElement("button").className=this.wrapClassName("back");document.createElement("button").className=this.wrapClassName("next")}return this.$mask}renderWhiteboardView(){return this.$whiteboardView||(this.$whiteboardView=document.createElement("div"),this.$whiteboardView.className=this.wrapClassName("wb-view"),this.sideEffect.addEventListener(this.$whiteboardView,"click",(e=>{var t;const n=this.context.getRoom();if(n&&"clicker"===n.state.memberState.currentApplianceName){for(let n=e.target;n;n=n.parentElement)if(null==(t=n.classList)?void 0:t.contains("ppt-event-source"))return;n.pptNextStep()}})),this.context.mountView(this.$whiteboardView)),this.$whiteboardView}wrapClassName(e){return"netless-app-docs-viewer-dynamic-"+e}}const Uo={kind:"DocsViewer",setup(e){const t=e.getBox(),n=e.getScenes();if(!n)throw new Error("[Docs Viewer]: scenes not found.");const i=e.getView();if(!i)throw new Error("[Docs Viewer]: no whiteboard view.");const r=n.map((({ppt:e})=>e?{width:e.width,height:e.height,src:e.src,thumbnail:e.previewURL}:null)).filter((e=>Boolean(e)));if(r.length<=0)throw new Error("[Docs Viewer]: empty scenes.");t.mountStyles(".netless-app-docs-viewer-content{position:relative;height:100%;overflow:hidden}.netless-app-docs-viewer-preview-mask{display:none;position:absolute;z-index:200;top:0;left:0;width:100%;height:100%}.netless-app-docs-viewer-preview{display:flex;flex-direction:column;align-items:center;position:absolute;z-index:300;top:0;left:0;width:33%;max-width:200px;height:100%;padding-top:10px;transform:translate(-100%);background:rgba(237,237,240,.9);box-shadow:inset -1px 0 #0000001c;transition:transform .4s}.netless-app-docs-viewer-preview-active .netless-app-docs-viewer-preview-mask{display:block}.netless-app-docs-viewer-preview-active .netless-app-docs-viewer-preview{transform:translate(0)}.netless-app-docs-viewer-preview-page{position:relative;display:block;width:55%;margin-bottom:10px;font-size:0;color:transparent;outline:none;border:7px solid transparent;border-radius:4px;transition:border-color .3s;user-select:none}.netless-app-docs-viewer-preview-page:hover,.netless-app-docs-viewer-preview-page.netless-app-docs-viewer-preview-page-active{border-color:#444e601a}.netless-app-docs-viewer-preview-page>img{width:100%;height:auto;box-sizing:border-box;border:1px solid rgba(0,0,0,.5);border-radius:1px;background-color:#fff;box-shadow:0 2px 8px #0000004d}.netless-app-docs-viewer-preview-page-name{position:absolute;top:1px;left:-10px;transform:translate(-100%);text-align:right;font-size:12px;color:#5f5f5f;user-select:none}.netless-app-docs-viewer-footer{box-sizing:border-box;height:26px;display:flex;align-items:center;padding:0 16px;border-top:1px solid #eeeef7;color:#191919}.netless-app-docs-viewer-float-footer{width:100%;min-height:26px;position:absolute;left:0;bottom:0;z-index:2000;background:rgba(249,249,252,.9);transition:opacity .4s}.netless-app-docs-viewer-footer-btn{box-sizing:border-box;width:26px;height:26px;font-size:0;margin:0;padding:3px;border:none;border-radius:1px;outline:none;color:currentColor;background:transparent;transition:background .4s;cursor:pointer;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-docs-viewer-footer-btn:hover{background:rgba(237,237,240,.9)}@media (hover: none){.netless-app-docs-viewer-footer-btn:hover{background:transparent!important}}.netless-app-docs-viewer-footer-btn>svg{width:100%;height:100%}.netless-app-docs-viewer-footer-btn>svg:nth-of-type(2){display:none}.netless-app-docs-viewer-footer-btn.netless-app-docs-viewer-footer-btn-playing>svg:nth-of-type(1){display:none}.netless-app-docs-viewer-footer-btn.netless-app-docs-viewer-footer-btn-playing>svg:nth-of-type(2){display:initial}.netless-app-docs-viewer-footer-btn~.netless-app-docs-viewer-footer-btn{margin-left:15px}.netless-app-docs-viewer-page-jumps{flex:1;display:flex;justify-content:center;align-items:center}.netless-app-docs-viewer-page-number{margin-left:auto;font-size:13px;user-select:none;white-space:nowrap;word-break:keep-all}.netless-app-docs-viewer-page-number-input{border:none;outline:none;width:3em;margin:0;padding:0 2px;text-align:right;font-size:13px;line-height:1;font-weight:400;font-family:inherit;border-radius:2px;color:currentColor;background:transparent;transition:background .4s;user-select:text;-webkit-tap-highlight-color:rgba(0,0,0,0)}.netless-app-docs-viewer-page-number-input:hover,.netless-app-docs-viewer-page-number-input:focus,.netless-app-docs-viewer-page-number-input:active{background:#fff;box-shadow:#63636333 0 2px 8px}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-footer-btn{cursor:not-allowed}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-footer-btn:hover{background:transparent}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-page-number-input{cursor:not-allowed}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-page-number-input:hover,.netless-app-docs-viewer-readonly .netless-app-docs-viewer-page-number-input:focus,.netless-app-docs-viewer-readonly .netless-app-docs-viewer-page-number-input:active{background:transparent;box-shadow:none}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-page-number-input:disabled{color:inherit}.netless-app-docs-viewer-readonly.netless-app-docs-viewer-float-footer{display:none}.telebox-color-scheme-dark .netless-app-docs-viewer-page-number-input{color:#a6a6a8}.telebox-color-scheme-dark .netless-app-docs-viewer-page-number-input:active,.telebox-color-scheme-dark .netless-app-docs-viewer-page-number-input:focus,.telebox-color-scheme-dark .netless-app-docs-viewer-page-number-input:hover{color:#222}.telebox-color-scheme-dark .netless-app-docs-viewer-footer{color:#a6a6a8;background:#2d2d33;border-top:none}.telebox-color-scheme-dark .netless-app-docs-viewer-footer-btn:hover{background:#212126}.telebox-color-scheme-dark .netless-app-docs-viewer-preview{background:rgba(50,50,50,.9)}.netless-app-docs-viewer-static-scrollbar{position:absolute;top:0;right:0;z-index:2147483647;width:8px;min-height:30px;margin:0;padding:0;border:none;outline:none;border-radius:4px;background:rgba(68,78,96,.4);box-shadow:1px 1px 8px #ffffffb3;opacity:0;transition:background .4s,opacity .4s 3s,transform .2s;user-select:none}.netless-app-docs-viewer-static-scrollbar.netless-app-docs-viewer-static-scrollbar-dragging{background:rgba(68,78,96,.6);opacity:1;transition:background .4s,opacity .4s 3s!important}.netless-app-docs-viewer-static-scrollbar:hover,.netless-app-docs-viewer-static-scrollbar:focus{background:rgba(68,78,96,.5)}.netless-app-docs-viewer-static-scrollbar:active{background:rgba(68,78,96,.6)}.netless-app-docs-viewer-content:hover .netless-app-docs-viewer-static-scrollbar{opacity:1;transition:background .4s,opacity .4s,transform .2s}.netless-app-docs-viewer-readonly .netless-app-docs-viewer-static-scrollbar{display:none}.netless-app-docs-viewer-static-pages:hover .netless-app-docs-viewer-static-scrollbar{opacity:1;transition:background .4s,opacity .4s,transform .2s}.page-renderer-pages-container{position:relative;overflow:hidden}.page-renderer-page{position:absolute;top:0;left:0;background-position:center;background-size:cover;background-repeat:no-repeat}.page-renderer-pages-container.is-hwa .page-renderer-page{will-change:transform}.page-renderer-page-img{display:block;width:100%;height:auto;user-select:none}.netless-app-docs-viewer-static-pages{overflow:hidden;position:relative;height:100%;user-select:none}.netless-app-docs-viewer-static-page{display:block;width:100%;height:auto;user-select:none}.netless-app-docs-viewer-static-wb-view,.netless-app-docs-viewer-dynamic-wb-view{position:absolute;top:0;left:0;width:100%;height:100%;z-index:100;overflow:hidden}.netless-app-docs-viewer-dynamic-wb-view .cursor-clicker .ppt-event-source{cursor:pointer}\n"),r[0].src.startsWith("ppt")?function(e,t,n,i){t.disableCameraTransform=!0;const r=new _o({context:e,whiteboardView:t,box:n,pages:i}).mount();e.mountView(r.$whiteboardView),e.isAddApp&&t.callbacks.once("onSizeUpdated",(({width:t,height:r})=>{if(i.length>0&&"maximized"!==n.state){const{width:s,height:a}=i[0],o=a/s*t-r;0!==o&&e.getIsWritable()&&e.emitter.emit("setBoxSize",{width:n.width,height:n.height+o/n.containerRect.height})}}))}(e,i,t,r):function(e,t,n,i){var r;t.disableCameraTransform=!e.getIsWritable();const s=new Vo({whiteboardView:t,readonly:!e.getIsWritable(),box:n,pages:i,pageScrollTop:null==(r=e.getAttributes())?void 0:r.pageScrollTop,mountWhiteboard:e.mountView.bind(e),onUserScroll:t=>{var i;(null==(i=e.getAttributes())?void 0:i.pageScrollTop)===t||n.readonly||e.updateAttributes(["pageScrollTop"],t)}}).mount();e.emitter.on("attributesUpdate",(e=>{e&&null!=e.pageScrollTop&&s.syncPageScrollTop(e.pageScrollTop)})),e.emitter.on("writableChange",(e=>{s.setReadonly(!e),t.disableCameraTransform=!e}))}(e,i,t,r)}};var Wo={exports:{}},Ho={},Qo={exports:{}},$o={};
|
24
24
|
/** @license React v0.19.1
|
25
25
|
* scheduler.production.min.js
|
26
26
|
*
|
@@ -29,7 +29,7 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
29
29
|
* This source code is licensed under the MIT license found in the
|
30
30
|
* LICENSE file in the root directory of this source tree.
|
31
31
|
*/
|
32
|
-
!function(e){var t,n,i,r,s;if("undefined"==typeof window||"function"!=typeof MessageChannel){var a=null,o=null,l=function(){if(null!==a)try{var t=e.unstable_now();a(!0,t),a=null}catch(n){throw setTimeout(l,0),n}},c=Date.now();e.unstable_now=function(){return Date.now()-c},t=function(e){null!==a?setTimeout(t,0,e):(a=e,setTimeout(l,0))},n=function(e,t){o=setTimeout(e,t)},i=function(){clearTimeout(o)},r=function(){return!1},s=e.unstable_forceFrameRate=function(){}}else{var u=window.performance,d=window.Date,h=window.setTimeout,p=window.clearTimeout;if("undefined"!=typeof console){var f=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof f&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"==typeof u&&"function"==typeof u.now)e.unstable_now=function(){return u.now()};else{var g=d.now();e.unstable_now=function(){return d.now()-g}}var m=!1,v=null,b=-1,w=5,y=0;r=function(){return e.unstable_now()>=y},s=function(){},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported"):w=0<e?Math.floor(1e3/e):5};var x=new MessageChannel,C=x.port2;x.port1.onmessage=function(){if(null!==v){var t=e.unstable_now();y=t+w;try{v(!0,t)?C.postMessage(null):(m=!1,v=null)}catch(n){throw C.postMessage(null),n}}else m=!1},t=function(e){v=e,m||(m=!0,C.postMessage(null))},n=function(t,n){b=h((function(){t(e.unstable_now())}),n)},i=function(){p(b),b=-1}}function M(e,t){var n=e.length;e.push(t);e:for(;;){var i=n-1>>>1,r=e[i];if(!(void 0!==r&&0<E(r,t)))break e;e[i]=t,e[n]=r,n=i}}function S(e){return void 0===(e=e[0])?null:e}function I(e){var t=e[0];if(void 0!==t){var n=e.pop();if(n!==t){e[0]=n;e:for(var i=0,r=e.length;i<r;){var s=2*(i+1)-1,a=e[s],o=s+1,l=e[o];if(void 0!==a&&0>E(a,n))void 0!==l&&0>E(l,a)?(e[i]=l,e[o]=n,i=o):(e[i]=a,e[s]=n,i=s);else{if(!(void 0!==l&&0>E(l,n)))break e;e[i]=l,e[o]=n,i=o}}}return t}return null}function E(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var A=[],T=[],k=1,N=null,P=3,z=!1,D=!1,L=!1;function B(e){for(var t=S(T);null!==t;){if(null===t.callback)I(T);else{if(!(t.startTime<=e))break;I(T),t.sortIndex=t.expirationTime,M(A,t)}t=S(T)}}function j(e){if(L=!1,B(e),!D)if(null!==S(A))D=!0,t(R);else{var i=S(T);null!==i&&n(j,i.startTime-e)}}function R(t,s){D=!1,L&&(L=!1,i()),z=!0;var a=P;try{for(B(s),N=S(A);null!==N&&(!(N.expirationTime>s)||t&&!r());){var o=N.callback;if(null!==o){N.callback=null,P=N.priorityLevel;var l=o(N.expirationTime<=s);s=e.unstable_now(),"function"==typeof l?N.callback=l:N===S(A)&&I(A),B(s)}else I(A);N=S(A)}if(null!==N)var c=!0;else{var u=S(T);null!==u&&n(j,u.startTime-s),c=!1}return c}finally{N=null,P=a,z=!1}}function O(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var V=s;e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){D||z||(D=!0,t(R))},e.unstable_getCurrentPriorityLevel=function(){return P},e.unstable_getFirstCallbackNode=function(){return S(A)},e.unstable_next=function(e){switch(P){case 1:case 2:case 3:var t=3;break;default:t=P}var n=P;P=t;try{return e()}finally{P=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=V,e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=P;P=e;try{return t()}finally{P=n}},e.unstable_scheduleCallback=function(r,s,a){var o=e.unstable_now();if("object"==typeof a&&null!==a){var l=a.delay;l="number"==typeof l&&0<l?o+l:o,a="number"==typeof a.timeout?a.timeout:O(r)}else a=O(r),l=o;return r={id:k++,callback:s,priorityLevel:r,startTime:l,expirationTime:a=l+a,sortIndex:-1},l>o?(r.sortIndex=l,M(T,r),null===S(A)&&r===S(T)&&(L?i():L=!0,n(j,l-o))):(r.sortIndex=a,M(A,r),D||z||(D=!0,t(R))),r},e.unstable_shouldYield=function(){var t=e.unstable_now();B(t);var n=S(A);return n!==N&&null!==N&&null!==n&&null!==n.callback&&n.startTime<=t&&n.expirationTime<N.expirationTime||r()},e.unstable_wrapCallback=function(e){var t=P;return function(){var n=P;P=t;try{return e.apply(this,arguments)}finally{P=n}}}}(
|
32
|
+
!function(e){var t,n,i,r,s;if("undefined"==typeof window||"function"!=typeof MessageChannel){var a=null,o=null,l=function(){if(null!==a)try{var t=e.unstable_now();a(!0,t),a=null}catch(n){throw setTimeout(l,0),n}},c=Date.now();e.unstable_now=function(){return Date.now()-c},t=function(e){null!==a?setTimeout(t,0,e):(a=e,setTimeout(l,0))},n=function(e,t){o=setTimeout(e,t)},i=function(){clearTimeout(o)},r=function(){return!1},s=e.unstable_forceFrameRate=function(){}}else{var u=window.performance,d=window.Date,h=window.setTimeout,p=window.clearTimeout;if("undefined"!=typeof console){var f=window.cancelAnimationFrame;"function"!=typeof window.requestAnimationFrame&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),"function"!=typeof f&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if("object"==typeof u&&"function"==typeof u.now)e.unstable_now=function(){return u.now()};else{var g=d.now();e.unstable_now=function(){return d.now()-g}}var m=!1,v=null,b=-1,w=5,y=0;r=function(){return e.unstable_now()>=y},s=function(){},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported"):w=0<e?Math.floor(1e3/e):5};var x=new MessageChannel,C=x.port2;x.port1.onmessage=function(){if(null!==v){var t=e.unstable_now();y=t+w;try{v(!0,t)?C.postMessage(null):(m=!1,v=null)}catch(n){throw C.postMessage(null),n}}else m=!1},t=function(e){v=e,m||(m=!0,C.postMessage(null))},n=function(t,n){b=h((function(){t(e.unstable_now())}),n)},i=function(){p(b),b=-1}}function M(e,t){var n=e.length;e.push(t);e:for(;;){var i=n-1>>>1,r=e[i];if(!(void 0!==r&&0<E(r,t)))break e;e[i]=t,e[n]=r,n=i}}function S(e){return void 0===(e=e[0])?null:e}function I(e){var t=e[0];if(void 0!==t){var n=e.pop();if(n!==t){e[0]=n;e:for(var i=0,r=e.length;i<r;){var s=2*(i+1)-1,a=e[s],o=s+1,l=e[o];if(void 0!==a&&0>E(a,n))void 0!==l&&0>E(l,a)?(e[i]=l,e[o]=n,i=o):(e[i]=a,e[s]=n,i=s);else{if(!(void 0!==l&&0>E(l,n)))break e;e[i]=l,e[o]=n,i=o}}}return t}return null}function E(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}var A=[],T=[],k=1,N=null,P=3,z=!1,D=!1,L=!1;function B(e){for(var t=S(T);null!==t;){if(null===t.callback)I(T);else{if(!(t.startTime<=e))break;I(T),t.sortIndex=t.expirationTime,M(A,t)}t=S(T)}}function j(e){if(L=!1,B(e),!D)if(null!==S(A))D=!0,t(R);else{var i=S(T);null!==i&&n(j,i.startTime-e)}}function R(t,s){D=!1,L&&(L=!1,i()),z=!0;var a=P;try{for(B(s),N=S(A);null!==N&&(!(N.expirationTime>s)||t&&!r());){var o=N.callback;if(null!==o){N.callback=null,P=N.priorityLevel;var l=o(N.expirationTime<=s);s=e.unstable_now(),"function"==typeof l?N.callback=l:N===S(A)&&I(A),B(s)}else I(A);N=S(A)}if(null!==N)var c=!0;else{var u=S(T);null!==u&&n(j,u.startTime-s),c=!1}return c}finally{N=null,P=a,z=!1}}function O(e){switch(e){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var V=s;e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){D||z||(D=!0,t(R))},e.unstable_getCurrentPriorityLevel=function(){return P},e.unstable_getFirstCallbackNode=function(){return S(A)},e.unstable_next=function(e){switch(P){case 1:case 2:case 3:var t=3;break;default:t=P}var n=P;P=t;try{return e()}finally{P=n}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=V,e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=P;P=e;try{return t()}finally{P=n}},e.unstable_scheduleCallback=function(r,s,a){var o=e.unstable_now();if("object"==typeof a&&null!==a){var l=a.delay;l="number"==typeof l&&0<l?o+l:o,a="number"==typeof a.timeout?a.timeout:O(r)}else a=O(r),l=o;return r={id:k++,callback:s,priorityLevel:r,startTime:l,expirationTime:a=l+a,sortIndex:-1},l>o?(r.sortIndex=l,M(T,r),null===S(A)&&r===S(T)&&(L?i():L=!0,n(j,l-o))):(r.sortIndex=a,M(A,r),D||z||(D=!0,t(R))),r},e.unstable_shouldYield=function(){var t=e.unstable_now();B(t);var n=S(A);return n!==N&&null!==N&&null!==n&&null!==n.callback&&n.startTime<=t&&n.expirationTime<N.expirationTime||r()},e.unstable_wrapCallback=function(e){var t=P;return function(){var n=P;P=t;try{return e.apply(this,arguments)}finally{P=n}}}}($o),Qo.exports=$o;
|
33
33
|
/** @license React v16.14.0
|
34
34
|
* react-dom.production.min.js
|
35
35
|
*
|
@@ -38,5 +38,5 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
38
38
|
* This source code is licensed under the MIT license found in the
|
39
39
|
* LICENSE file in the root directory of this source tree.
|
40
40
|
*/
|
41
|
-
var $o=et.exports,Fo=at,Zo=Ho.exports;function Yo(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!$o)throw Error(Yo(227));function Go(e,t,n,i,r,s,a,o,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(u){this.onError(u)}}var Xo=!1,Jo=null,Ko=!1,qo=null,el={onError:function(e){Xo=!0,Jo=e}};function tl(e,t,n,i,r,s,a,o,l){Xo=!1,Jo=null,Go.apply(el,arguments)}var nl=null,il=null,rl=null;function sl(e,t,n){var i=e.type||"unknown-event";e.currentTarget=rl(n),function(e,t,n,i,r,s,a,o,l){if(tl.apply(this,arguments),Xo){if(!Xo)throw Error(Yo(198));var c=Jo;Xo=!1,Jo=null,Ko||(Ko=!0,qo=c)}}(i,t,void 0,e),e.currentTarget=null}var al=null,ol={};function ll(){if(al)for(var e in ol){var t=ol[e],n=al.indexOf(e);if(!(-1<n))throw Error(Yo(96,e));if(!ul[n]){if(!t.extractEvents)throw Error(Yo(97,e));for(var i in ul[n]=t,n=t.eventTypes){var r=void 0,s=n[i],a=t,o=i;if(dl.hasOwnProperty(o))throw Error(Yo(99,o));dl[o]=s;var l=s.phasedRegistrationNames;if(l){for(r in l)l.hasOwnProperty(r)&&cl(l[r],a,o);r=!0}else s.registrationName?(cl(s.registrationName,a,o),r=!0):r=!1;if(!r)throw Error(Yo(98,i,e))}}}}function cl(e,t,n){if(hl[e])throw Error(Yo(100,e));hl[e]=t,pl[e]=t.eventTypes[n].dependencies}var ul=[],dl={},hl={},pl={};function fl(e){var t,n=!1;for(t in e)if(e.hasOwnProperty(t)){var i=e[t];if(!ol.hasOwnProperty(t)||ol[t]!==i){if(ol[t])throw Error(Yo(102,t));ol[t]=i,n=!0}}n&&ll()}var gl=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),ml=null,vl=null,bl=null;function wl(e){if(e=il(e)){if("function"!=typeof ml)throw Error(Yo(280));var t=e.stateNode;t&&(t=nl(t),ml(e.stateNode,e.type,t))}}function yl(e){vl?bl?bl.push(e):bl=[e]:vl=e}function xl(){if(vl){var e=vl,t=bl;if(bl=vl=null,wl(e),t)for(e=0;e<t.length;e++)wl(t[e])}}function Cl(e,t){return e(t)}function Ml(e,t,n,i,r){return e(t,n,i,r)}function Sl(){}var Il=Cl,El=!1,Al=!1;function Tl(){null===vl&&null===bl||(Sl(),xl())}function kl(e,t,n){if(Al)return e(t,n);Al=!0;try{return Il(e,t,n)}finally{Al=!1,Tl()}}var Nl=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Pl=Object.prototype.hasOwnProperty,zl={},Dl={};function Ll(e,t,n,i,r,s){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=i,this.attributeNamespace=r,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s}var Bl={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){Bl[e]=new Ll(e,0,!1,e,null,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];Bl[t]=new Ll(t,1,!1,e[1],null,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){Bl[e]=new Ll(e,2,!1,e.toLowerCase(),null,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){Bl[e]=new Ll(e,2,!1,e,null,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){Bl[e]=new Ll(e,3,!1,e.toLowerCase(),null,!1)})),["checked","multiple","muted","selected"].forEach((function(e){Bl[e]=new Ll(e,3,!0,e,null,!1)})),["capture","download"].forEach((function(e){Bl[e]=new Ll(e,4,!1,e,null,!1)})),["cols","rows","size","span"].forEach((function(e){Bl[e]=new Ll(e,6,!1,e,null,!1)})),["rowSpan","start"].forEach((function(e){Bl[e]=new Ll(e,5,!1,e.toLowerCase(),null,!1)}));var jl=/[\-:]([a-z])/g;function Rl(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(jl,Rl);Bl[t]=new Ll(t,1,!1,e,null,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(jl,Rl);Bl[t]=new Ll(t,1,!1,e,"http://www.w3.org/1999/xlink",!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(jl,Rl);Bl[t]=new Ll(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1)})),["tabIndex","crossOrigin"].forEach((function(e){Bl[e]=new Ll(e,1,!1,e.toLowerCase(),null,!1)})),Bl.xlinkHref=new Ll("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0),["src","href","action","formAction"].forEach((function(e){Bl[e]=new Ll(e,1,!1,e.toLowerCase(),null,!0)}));var Ol=$o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function Vl(e,t,n,i){var r=Bl.hasOwnProperty(t)?Bl[t]:null;(null!==r?0===r.type:!i&&(2<t.length&&("o"===t[0]||"O"===t[0])&&("n"===t[1]||"N"===t[1])))||(function(e,t,n,i){if(null==t||function(e,t,n,i){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!i&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,i))return!0;if(i)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,r,i)&&(n=null),i||null===r?function(e){return!!Pl.call(Dl,e)||!Pl.call(zl,e)&&(Nl.test(e)?Dl[e]=!0:(zl[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):r.mustUseProperty?e[r.propertyName]=null===n?3!==r.type&&"":n:(t=r.attributeName,i=r.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(r=r.type)||4===r&&!0===n?"":""+n,i?e.setAttributeNS(i,t,n):e.setAttribute(t,n))))}Ol.hasOwnProperty("ReactCurrentDispatcher")||(Ol.ReactCurrentDispatcher={current:null}),Ol.hasOwnProperty("ReactCurrentBatchConfig")||(Ol.ReactCurrentBatchConfig={suspense:null});var _l=/^(.*)[\\\/]/,Ul="function"==typeof Symbol&&Symbol.for,Wl=Ul?Symbol.for("react.element"):60103,Hl=Ul?Symbol.for("react.portal"):60106,Ql=Ul?Symbol.for("react.fragment"):60107,$l=Ul?Symbol.for("react.strict_mode"):60108,Fl=Ul?Symbol.for("react.profiler"):60114,Zl=Ul?Symbol.for("react.provider"):60109,Yl=Ul?Symbol.for("react.context"):60110,Gl=Ul?Symbol.for("react.concurrent_mode"):60111,Xl=Ul?Symbol.for("react.forward_ref"):60112,Jl=Ul?Symbol.for("react.suspense"):60113,Kl=Ul?Symbol.for("react.suspense_list"):60120,ql=Ul?Symbol.for("react.memo"):60115,ec=Ul?Symbol.for("react.lazy"):60116,tc=Ul?Symbol.for("react.block"):60121,nc="function"==typeof Symbol&&Symbol.iterator;function ic(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=nc&&e[nc]||e["@@iterator"])?e:null}function rc(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case Ql:return"Fragment";case Hl:return"Portal";case Fl:return"Profiler";case $l:return"StrictMode";case Jl:return"Suspense";case Kl:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case Yl:return"Context.Consumer";case Zl:return"Context.Provider";case Xl:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case ql:return rc(e.type);case tc:return rc(e.render);case ec:if(e=1===e._status?e._result:null)return rc(e)}return null}function sc(e){var t="";do{e:switch(e.tag){case 3:case 4:case 6:case 7:case 10:case 9:var n="";break e;default:var i=e._debugOwner,r=e._debugSource,s=rc(e.type);n=null,i&&(n=rc(i.type)),i=s,s="",r?s=" (at "+r.fileName.replace(_l,"")+":"+r.lineNumber+")":n&&(s=" (created by "+n+")"),n="\n in "+(i||"Unknown")+s}t+=n,e=e.return}while(e);return t}function ac(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function oc(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function lc(e){e._valueTracker||(e._valueTracker=function(e){var t=oc(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var r=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(e){i=""+e,s.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(e){i=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function cc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=oc(e)?e.checked?"true":"false":e.value),(e=i)!==n&&(t.setValue(e),!0)}function uc(e,t){var n=t.checked;return Fo({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function dc(e,t){var n=null==t.defaultValue?"":t.defaultValue,i=null!=t.checked?t.checked:t.defaultChecked;n=ac(null!=t.value?t.value:n),e._wrapperState={initialChecked:i,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function hc(e,t){null!=(t=t.checked)&&Vl(e,"checked",t,!1)}function pc(e,t){hc(e,t);var n=ac(t.value),i=t.type;if(null!=n)"number"===i?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===i||"reset"===i)return void e.removeAttribute("value");t.hasOwnProperty("value")?gc(e,t.type,n):t.hasOwnProperty("defaultValue")&&gc(e,t.type,ac(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function fc(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var i=t.type;if(!("submit"!==i&&"reset"!==i||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function gc(e,t,n){"number"===t&&e.ownerDocument.activeElement===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}function mc(e,t){return e=Fo({children:void 0},t),(t=function(e){var t="";return $o.Children.forEach(e,(function(e){null!=e&&(t+=e)})),t}(t.children))&&(e.children=t),e}function vc(e,t,n,i){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&i&&(e[n].defaultSelected=!0)}else{for(n=""+ac(n),t=null,r=0;r<e.length;r++){if(e[r].value===n)return e[r].selected=!0,void(i&&(e[r].defaultSelected=!0));null!==t||e[r].disabled||(t=e[r])}null!==t&&(t.selected=!0)}}function bc(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(Yo(91));return Fo({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function wc(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(Yo(92));if(Array.isArray(n)){if(!(1>=n.length))throw Error(Yo(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:ac(n)}}function yc(e,t){var n=ac(t.value),i=ac(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=i&&(e.defaultValue=""+i)}function xc(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}var Cc="http://www.w3.org/1999/xhtml",Mc="http://www.w3.org/2000/svg";function Sc(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ic(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?Sc(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var Ec,Ac,Tc=(Ac=function(e,t){if(e.namespaceURI!==Mc||"innerHTML"in e)e.innerHTML=t;else{for((Ec=Ec||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ec.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,i){MSApp.execUnsafeLocalFunction((function(){return Ac(e,t)}))}:Ac);function kc(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}function Nc(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Pc={animationend:Nc("Animation","AnimationEnd"),animationiteration:Nc("Animation","AnimationIteration"),animationstart:Nc("Animation","AnimationStart"),transitionend:Nc("Transition","TransitionEnd")},zc={},Dc={};function Lc(e){if(zc[e])return zc[e];if(!Pc[e])return e;var t,n=Pc[e];for(t in n)if(n.hasOwnProperty(t)&&t in Dc)return zc[e]=n[t];return e}gl&&(Dc=document.createElement("div").style,"AnimationEvent"in window||(delete Pc.animationend.animation,delete Pc.animationiteration.animation,delete Pc.animationstart.animation),"TransitionEvent"in window||delete Pc.transitionend.transition);var Bc=Lc("animationend"),jc=Lc("animationiteration"),Rc=Lc("animationstart"),Oc=Lc("transitionend"),Vc="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),_c=new("function"==typeof WeakMap?WeakMap:Map);function Uc(e){var t=_c.get(e);return void 0===t&&(t=new Map,_c.set(e,t)),t}function Wc(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!=(1026&(t=e).effectTag)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function Hc(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function Qc(e){if(Wc(e)!==e)throw Error(Yo(188))}function $c(e){if(!(e=function(e){var t=e.alternate;if(!t){if(null===(t=Wc(e)))throw Error(Yo(188));return t!==e?null:e}for(var n=e,i=t;;){var r=n.return;if(null===r)break;var s=r.alternate;if(null===s){if(null!==(i=r.return)){n=i;continue}break}if(r.child===s.child){for(s=r.child;s;){if(s===n)return Qc(r),e;if(s===i)return Qc(r),t;s=s.sibling}throw Error(Yo(188))}if(n.return!==i.return)n=r,i=s;else{for(var a=!1,o=r.child;o;){if(o===n){a=!0,n=r,i=s;break}if(o===i){a=!0,i=r,n=s;break}o=o.sibling}if(!a){for(o=s.child;o;){if(o===n){a=!0,n=s,i=r;break}if(o===i){a=!0,i=s,n=r;break}o=o.sibling}if(!a)throw Error(Yo(189))}}if(n.alternate!==i)throw Error(Yo(190))}if(3!==n.tag)throw Error(Yo(188));return n.stateNode.current===n?e:t}(e)))return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function Fc(e,t){if(null==t)throw Error(Yo(30));return null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}function Zc(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}var Yc=null;function Gc(e){if(e){var t=e._dispatchListeners,n=e._dispatchInstances;if(Array.isArray(t))for(var i=0;i<t.length&&!e.isPropagationStopped();i++)sl(e,t[i],n[i]);else t&&sl(e,t,n);e._dispatchListeners=null,e._dispatchInstances=null,e.isPersistent()||e.constructor.release(e)}}function Xc(e){if(null!==e&&(Yc=Fc(Yc,e)),e=Yc,Yc=null,e){if(Zc(e,Gc),Yc)throw Error(Yo(95));if(Ko)throw e=qo,Ko=!1,qo=null,e}}function Jc(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}function Kc(e){if(!gl)return!1;var t=(e="on"+e)in document;return t||((t=document.createElement("div")).setAttribute(e,"return;"),t="function"==typeof t[e]),t}var qc=[];function eu(e){e.topLevelType=null,e.nativeEvent=null,e.targetInst=null,e.ancestors.length=0,10>qc.length&&qc.push(e)}function tu(e,t,n,i){if(qc.length){var r=qc.pop();return r.topLevelType=e,r.eventSystemFlags=i,r.nativeEvent=t,r.targetInst=n,r}return{topLevelType:e,eventSystemFlags:i,nativeEvent:t,targetInst:n,ancestors:[]}}function nu(e){var t=e.targetInst,n=t;do{if(!n){e.ancestors.push(n);break}var i=n;if(3===i.tag)i=i.stateNode.containerInfo;else{for(;i.return;)i=i.return;i=3!==i.tag?null:i.stateNode.containerInfo}if(!i)break;5!==(t=n.tag)&&6!==t||e.ancestors.push(n),n=md(i)}while(n);for(n=0;n<e.ancestors.length;n++){t=e.ancestors[n];var r=Jc(e.nativeEvent);i=e.topLevelType;var s=e.nativeEvent,a=e.eventSystemFlags;0===n&&(a|=64);for(var o=null,l=0;l<ul.length;l++){var c=ul[l];c&&(c=c.extractEvents(i,t,s,r,a))&&(o=Fc(o,c))}Xc(o)}}function iu(e,t,n){if(!n.has(e)){switch(e){case"scroll":Ru(t,"scroll",!0);break;case"focus":case"blur":Ru(t,"focus",!0),Ru(t,"blur",!0),n.set("blur",null),n.set("focus",null);break;case"cancel":case"close":Kc(e)&&Ru(t,e,!0);break;case"invalid":case"submit":case"reset":break;default:-1===Vc.indexOf(e)&&ju(e,t)}n.set(e,null)}}var ru,su,au,ou=!1,lu=[],cu=null,uu=null,du=null,hu=new Map,pu=new Map,fu=[],gu="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput close cancel copy cut paste click change contextmenu reset submit".split(" "),mu="focus blur dragenter dragleave mouseover mouseout pointerover pointerout gotpointercapture lostpointercapture".split(" ");function vu(e,t,n,i,r){return{blockedOn:e,topLevelType:t,eventSystemFlags:32|n,nativeEvent:r,container:i}}function bu(e,t){switch(e){case"focus":case"blur":cu=null;break;case"dragenter":case"dragleave":uu=null;break;case"mouseover":case"mouseout":du=null;break;case"pointerover":case"pointerout":hu.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":pu.delete(t.pointerId)}}function wu(e,t,n,i,r,s){return null===e||e.nativeEvent!==s?(e=vu(t,n,i,r,s),null!==t&&(null!==(t=vd(t))&&su(t)),e):(e.eventSystemFlags|=i,e)}function yu(e){var t=md(e.target);if(null!==t){var n=Wc(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=Hc(n)))return e.blockedOn=t,void Zo.unstable_runWithPriority(e.priority,(function(){au(n)}))}else if(3===t&&n.stateNode.hydrate)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function xu(e){if(null!==e.blockedOn)return!1;var t=Uu(e.topLevelType,e.eventSystemFlags,e.container,e.nativeEvent);if(null!==t){var n=vd(t);return null!==n&&su(n),e.blockedOn=t,!1}return!0}function Cu(e,t,n){xu(e)&&n.delete(t)}function Mu(){for(ou=!1;0<lu.length;){var e=lu[0];if(null!==e.blockedOn){null!==(e=vd(e.blockedOn))&&ru(e);break}var t=Uu(e.topLevelType,e.eventSystemFlags,e.container,e.nativeEvent);null!==t?e.blockedOn=t:lu.shift()}null!==cu&&xu(cu)&&(cu=null),null!==uu&&xu(uu)&&(uu=null),null!==du&&xu(du)&&(du=null),hu.forEach(Cu),pu.forEach(Cu)}function Su(e,t){e.blockedOn===t&&(e.blockedOn=null,ou||(ou=!0,Zo.unstable_scheduleCallback(Zo.unstable_NormalPriority,Mu)))}function Iu(e){function t(t){return Su(t,e)}if(0<lu.length){Su(lu[0],e);for(var n=1;n<lu.length;n++){var i=lu[n];i.blockedOn===e&&(i.blockedOn=null)}}for(null!==cu&&Su(cu,e),null!==uu&&Su(uu,e),null!==du&&Su(du,e),hu.forEach(t),pu.forEach(t),n=0;n<fu.length;n++)(i=fu[n]).blockedOn===e&&(i.blockedOn=null);for(;0<fu.length&&null===(n=fu[0]).blockedOn;)yu(n),null===n.blockedOn&&fu.shift()}var Eu={},Au=new Map,Tu=new Map,ku=["abort","abort",Bc,"animationEnd",jc,"animationIteration",Rc,"animationStart","canplay","canPlay","canplaythrough","canPlayThrough","durationchange","durationChange","emptied","emptied","encrypted","encrypted","ended","ended","error","error","gotpointercapture","gotPointerCapture","load","load","loadeddata","loadedData","loadedmetadata","loadedMetadata","loadstart","loadStart","lostpointercapture","lostPointerCapture","playing","playing","progress","progress","seeking","seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",Oc,"transitionEnd","waiting","waiting"];function Nu(e,t){for(var n=0;n<e.length;n+=2){var i=e[n],r=e[n+1],s="on"+(r[0].toUpperCase()+r.slice(1));s={phasedRegistrationNames:{bubbled:s,captured:s+"Capture"},dependencies:[i],eventPriority:t},Tu.set(i,t),Au.set(i,s),Eu[r]=s}}Nu("blur blur cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focus focus input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),0),Nu("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1),Nu(ku,2);for(var Pu="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),zu=0;zu<Pu.length;zu++)Tu.set(Pu[zu],0);var Du=Zo.unstable_UserBlockingPriority,Lu=Zo.unstable_runWithPriority,Bu=!0;function ju(e,t){Ru(t,e,!1)}function Ru(e,t,n){var i=Tu.get(t);switch(void 0===i?2:i){case 0:i=Ou.bind(null,t,1,e);break;case 1:i=Vu.bind(null,t,1,e);break;default:i=_u.bind(null,t,1,e)}n?e.addEventListener(t,i,!0):e.addEventListener(t,i,!1)}function Ou(e,t,n,i){El||Sl();var r=_u,s=El;El=!0;try{Ml(r,e,t,n,i)}finally{(El=s)||Tl()}}function Vu(e,t,n,i){Lu(Du,_u.bind(null,e,t,n,i))}function _u(e,t,n,i){if(Bu)if(0<lu.length&&-1<gu.indexOf(e))e=vu(null,e,t,n,i),lu.push(e);else{var r=Uu(e,t,n,i);if(null===r)bu(e,i);else if(-1<gu.indexOf(e))e=vu(r,e,t,n,i),lu.push(e);else if(!function(e,t,n,i,r){switch(t){case"focus":return cu=wu(cu,e,t,n,i,r),!0;case"dragenter":return uu=wu(uu,e,t,n,i,r),!0;case"mouseover":return du=wu(du,e,t,n,i,r),!0;case"pointerover":var s=r.pointerId;return hu.set(s,wu(hu.get(s)||null,e,t,n,i,r)),!0;case"gotpointercapture":return s=r.pointerId,pu.set(s,wu(pu.get(s)||null,e,t,n,i,r)),!0}return!1}(r,e,t,n,i)){bu(e,i),e=tu(e,i,null,t);try{kl(nu,e)}finally{eu(e)}}}}function Uu(e,t,n,i){if(null!==(n=md(n=Jc(i)))){var r=Wc(n);if(null===r)n=null;else{var s=r.tag;if(13===s){if(null!==(n=Hc(r)))return n;n=null}else if(3===s){if(r.stateNode.hydrate)return 3===r.tag?r.stateNode.containerInfo:null;n=null}else r!==n&&(n=null)}}e=tu(e,i,n,t);try{kl(nu,e)}finally{eu(e)}return null}var Wu={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Hu=["Webkit","ms","Moz","O"];function Qu(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||Wu.hasOwnProperty(e)&&Wu[e]?(""+t).trim():t+"px"}function $u(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var i=0===n.indexOf("--"),r=Qu(n,t[n],i);"float"===n&&(n="cssFloat"),i?e.setProperty(n,r):e[n]=r}}Object.keys(Wu).forEach((function(e){Hu.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Wu[t]=Wu[e]}))}));var Fu=Fo({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Zu(e,t){if(t){if(Fu[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(Yo(137,e,""));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(Yo(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(Yo(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(Yo(62,""))}}function Yu(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Gu=Cc;function Xu(e,t){var n=Uc(e=9===e.nodeType||11===e.nodeType?e:e.ownerDocument);t=pl[t];for(var i=0;i<t.length;i++)iu(t[i],e,n)}function Ju(){}function Ku(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function qu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ed(e,t){var n,i=qu(e);for(e=0;i;){if(3===i.nodeType){if(n=e+i.textContent.length,e<=t&&n>=t)return{node:i,offset:t-e};e=n}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=qu(i)}}function td(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?td(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function nd(){for(var e=window,t=Ku();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(i){n=!1}if(!n)break;t=Ku((e=t.contentWindow).document)}return t}function id(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var rd=null,sd=null;function ad(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function od(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var ld="function"==typeof setTimeout?setTimeout:void 0,cd="function"==typeof clearTimeout?clearTimeout:void 0;function ud(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function dd(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var hd=Math.random().toString(36).slice(2),pd="__reactInternalInstance$"+hd,fd="__reactEventHandlers$"+hd,gd="__reactContainere$"+hd;function md(e){var t=e[pd];if(t)return t;for(var n=e.parentNode;n;){if(t=n[gd]||n[pd]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=dd(e);null!==e;){if(n=e[pd])return n;e=dd(e)}return t}n=(e=n).parentNode}return null}function vd(e){return!(e=e[pd]||e[gd])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function bd(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(Yo(33))}function wd(e){return e[fd]||null}function yd(e){do{e=e.return}while(e&&5!==e.tag);return e||null}function xd(e,t){var n=e.stateNode;if(!n)return null;var i=nl(n);if(!i)return null;n=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(i=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!i;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(Yo(231,t,typeof n));return n}function Cd(e,t,n){(t=xd(e,n.dispatchConfig.phasedRegistrationNames[t]))&&(n._dispatchListeners=Fc(n._dispatchListeners,t),n._dispatchInstances=Fc(n._dispatchInstances,e))}function Md(e){if(e&&e.dispatchConfig.phasedRegistrationNames){for(var t=e._targetInst,n=[];t;)n.push(t),t=yd(t);for(t=n.length;0<t--;)Cd(n[t],"captured",e);for(t=0;t<n.length;t++)Cd(n[t],"bubbled",e)}}function Sd(e,t,n){e&&n&&n.dispatchConfig.registrationName&&(t=xd(e,n.dispatchConfig.registrationName))&&(n._dispatchListeners=Fc(n._dispatchListeners,t),n._dispatchInstances=Fc(n._dispatchInstances,e))}function Id(e){e&&e.dispatchConfig.registrationName&&Sd(e._targetInst,null,e)}function Ed(e){Zc(e,Md)}var Ad=null,Td=null,kd=null;function Nd(){if(kd)return kd;var e,t,n=Td,i=n.length,r="value"in Ad?Ad.value:Ad.textContent,s=r.length;for(e=0;e<i&&n[e]===r[e];e++);var a=i-e;for(t=1;t<=a&&n[i-t]===r[s-t];t++);return kd=r.slice(e,1<t?1-t:void 0)}function Pd(){return!0}function zd(){return!1}function Dd(e,t,n,i){for(var r in this.dispatchConfig=e,this._targetInst=t,this.nativeEvent=n,e=this.constructor.Interface)e.hasOwnProperty(r)&&((t=e[r])?this[r]=t(n):"target"===r?this.target=i:this[r]=n[r]);return this.isDefaultPrevented=(null!=n.defaultPrevented?n.defaultPrevented:!1===n.returnValue)?Pd:zd,this.isPropagationStopped=zd,this}function Ld(e,t,n,i){if(this.eventPool.length){var r=this.eventPool.pop();return this.call(r,e,t,n,i),r}return new this(e,t,n,i)}function Bd(e){if(!(e instanceof this))throw Error(Yo(279));e.destructor(),10>this.eventPool.length&&this.eventPool.push(e)}function jd(e){e.eventPool=[],e.getPooled=Ld,e.release=Bd}Fo(Dd.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=Pd)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=Pd)},persist:function(){this.isPersistent=Pd},isPersistent:zd,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=zd,this._dispatchInstances=this._dispatchListeners=null}}),Dd.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null},Dd.extend=function(e){function t(){}function n(){return i.apply(this,arguments)}var i=this;t.prototype=i.prototype;var r=new t;return Fo(r,n.prototype),n.prototype=r,n.prototype.constructor=n,n.Interface=Fo({},i.Interface,e),n.extend=i.extend,jd(n),n},jd(Dd);var Rd=Dd.extend({data:null}),Od=Dd.extend({data:null}),Vd=[9,13,27,32],_d=gl&&"CompositionEvent"in window,Ud=null;gl&&"documentMode"in document&&(Ud=document.documentMode);var Wd=gl&&"TextEvent"in window&&!Ud,Hd=gl&&(!_d||Ud&&8<Ud&&11>=Ud),Qd=String.fromCharCode(32),$d={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},Fd=!1;function Zd(e,t){switch(e){case"keyup":return-1!==Vd.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function Yd(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Gd=!1;var Xd={eventTypes:$d,extractEvents:function(e,t,n,i){var r;if(_d)e:{switch(e){case"compositionstart":var s=$d.compositionStart;break e;case"compositionend":s=$d.compositionEnd;break e;case"compositionupdate":s=$d.compositionUpdate;break e}s=void 0}else Gd?Zd(e,n)&&(s=$d.compositionEnd):"keydown"===e&&229===n.keyCode&&(s=$d.compositionStart);return s?(Hd&&"ko"!==n.locale&&(Gd||s!==$d.compositionStart?s===$d.compositionEnd&&Gd&&(r=Nd()):(Td="value"in(Ad=i)?Ad.value:Ad.textContent,Gd=!0)),s=Rd.getPooled(s,t,n,i),r?s.data=r:null!==(r=Yd(n))&&(s.data=r),Ed(s),r=s):r=null,(e=Wd?function(e,t){switch(e){case"compositionend":return Yd(t);case"keypress":return 32!==t.which?null:(Fd=!0,Qd);case"textInput":return(e=t.data)===Qd&&Fd?null:e;default:return null}}(e,n):function(e,t){if(Gd)return"compositionend"===e||!_d&&Zd(e,t)?(e=Nd(),kd=Td=Ad=null,Gd=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Hd&&"ko"!==t.locale?null:t.data;default:return null}}(e,n))?((t=Od.getPooled($d.beforeInput,t,n,i)).data=e,Ed(t)):t=null,null===r?t:null===t?r:[r,t]}},Jd={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Kd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Jd[e.type]:"textarea"===t}var qd={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:"blur change click focus input keydown keyup selectionchange".split(" ")}};function eh(e,t,n){return(e=Dd.getPooled(qd.change,e,t,n)).type="change",yl(n),Ed(e),e}var th=null,nh=null;function ih(e){Xc(e)}function rh(e){if(cc(bd(e)))return e}function sh(e,t){if("change"===e)return t}var ah=!1;function oh(){th&&(th.detachEvent("onpropertychange",lh),nh=th=null)}function lh(e){if("value"===e.propertyName&&rh(nh))if(e=eh(nh,e,Jc(e)),El)Xc(e);else{El=!0;try{Cl(ih,e)}finally{El=!1,Tl()}}}function ch(e,t,n){"focus"===e?(oh(),nh=n,(th=t).attachEvent("onpropertychange",lh)):"blur"===e&&oh()}function uh(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return rh(nh)}function dh(e,t){if("click"===e)return rh(t)}function hh(e,t){if("input"===e||"change"===e)return rh(t)}gl&&(ah=Kc("input")&&(!document.documentMode||9<document.documentMode));var ph={eventTypes:qd,_isInputEventSupported:ah,extractEvents:function(e,t,n,i){var r=t?bd(t):window,s=r.nodeName&&r.nodeName.toLowerCase();if("select"===s||"input"===s&&"file"===r.type)var a=sh;else if(Kd(r))if(ah)a=hh;else{a=uh;var o=ch}else(s=r.nodeName)&&"input"===s.toLowerCase()&&("checkbox"===r.type||"radio"===r.type)&&(a=dh);if(a&&(a=a(e,t)))return eh(a,n,i);o&&o(e,r,t),"blur"===e&&(e=r._wrapperState)&&e.controlled&&"number"===r.type&&gc(r,"number",r.value)}},fh=Dd.extend({view:null,detail:null}),gh={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function mh(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=gh[e])&&!!t[e]}function vh(){return mh}var bh=0,wh=0,yh=!1,xh=!1,Ch=fh.extend({screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:vh,button:null,buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)},movementX:function(e){if("movementX"in e)return e.movementX;var t=bh;return bh=e.screenX,yh?"mousemove"===e.type?e.screenX-t:0:(yh=!0,0)},movementY:function(e){if("movementY"in e)return e.movementY;var t=wh;return wh=e.screenY,xh?"mousemove"===e.type?e.screenY-t:0:(xh=!0,0)}}),Mh=Ch.extend({pointerId:null,width:null,height:null,pressure:null,tangentialPressure:null,tiltX:null,tiltY:null,twist:null,pointerType:null,isPrimary:null}),Sh={mouseEnter:{registrationName:"onMouseEnter",dependencies:["mouseout","mouseover"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["mouseout","mouseover"]},pointerEnter:{registrationName:"onPointerEnter",dependencies:["pointerout","pointerover"]},pointerLeave:{registrationName:"onPointerLeave",dependencies:["pointerout","pointerover"]}},Ih={eventTypes:Sh,extractEvents:function(e,t,n,i,r){var s="mouseover"===e||"pointerover"===e,a="mouseout"===e||"pointerout"===e;if(s&&0==(32&r)&&(n.relatedTarget||n.fromElement)||!a&&!s)return null;(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,a)?(a=t,null!==(t=(t=n.relatedTarget||n.toElement)?md(t):null)&&(t!==Wc(t)||5!==t.tag&&6!==t.tag)&&(t=null)):a=null;if(a===t)return null;if("mouseout"===e||"mouseover"===e)var o=Ch,l=Sh.mouseLeave,c=Sh.mouseEnter,u="mouse";else"pointerout"!==e&&"pointerover"!==e||(o=Mh,l=Sh.pointerLeave,c=Sh.pointerEnter,u="pointer");if(e=null==a?s:bd(a),s=null==t?s:bd(t),(l=o.getPooled(l,a,n,i)).type=u+"leave",l.target=e,l.relatedTarget=s,(n=o.getPooled(c,t,n,i)).type=u+"enter",n.target=s,n.relatedTarget=e,u=t,(i=a)&&u)e:{for(c=u,a=0,e=o=i;e;e=yd(e))a++;for(e=0,t=c;t;t=yd(t))e++;for(;0<a-e;)o=yd(o),a--;for(;0<e-a;)c=yd(c),e--;for(;a--;){if(o===c||o===c.alternate)break e;o=yd(o),c=yd(c)}o=null}else o=null;for(c=o,o=[];i&&i!==c&&(null===(a=i.alternate)||a!==c);)o.push(i),i=yd(i);for(i=[];u&&u!==c&&(null===(a=u.alternate)||a!==c);)i.push(u),u=yd(u);for(u=0;u<o.length;u++)Sd(o[u],"bubbled",l);for(u=i.length;0<u--;)Sd(i[u],"captured",n);return 0==(64&r)?[l]:[l,n]}};var Eh="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},Ah=Object.prototype.hasOwnProperty;function Th(e,t){if(Eh(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++)if(!Ah.call(t,n[i])||!Eh(e[n[i]],t[n[i]]))return!1;return!0}var kh=gl&&"documentMode"in document&&11>=document.documentMode,Nh={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},Ph=null,zh=null,Dh=null,Lh=!1;function Bh(e,t){var n=t.window===t?t.document:9===t.nodeType?t:t.ownerDocument;return Lh||null==Ph||Ph!==Ku(n)?null:("selectionStart"in(n=Ph)&&id(n)?n={start:n.selectionStart,end:n.selectionEnd}:n={anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},Dh&&Th(Dh,n)?null:(Dh=n,(e=Dd.getPooled(Nh.select,zh,e,t)).type="select",e.target=Ph,Ed(e),e))}var jh={eventTypes:Nh,extractEvents:function(e,t,n,i,r,s){if(!(s=!(r=s||(i.window===i?i.document:9===i.nodeType?i:i.ownerDocument)))){e:{r=Uc(r),s=pl.onSelect;for(var a=0;a<s.length;a++)if(!r.has(s[a])){r=!1;break e}r=!0}s=!r}if(s)return null;switch(r=t?bd(t):window,e){case"focus":(Kd(r)||"true"===r.contentEditable)&&(Ph=r,zh=t,Dh=null);break;case"blur":Dh=zh=Ph=null;break;case"mousedown":Lh=!0;break;case"contextmenu":case"mouseup":case"dragend":return Lh=!1,Bh(n,i);case"selectionchange":if(kh)break;case"keydown":case"keyup":return Bh(n,i)}return null}},Rh=Dd.extend({animationName:null,elapsedTime:null,pseudoElement:null}),Oh=Dd.extend({clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Vh=fh.extend({relatedTarget:null});function _h(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}var Uh={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Wh={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Hh=fh.extend({key:function(e){if(e.key){var t=Uh[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=_h(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?Wh[e.keyCode]||"Unidentified":""},location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:vh,charCode:function(e){return"keypress"===e.type?_h(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?_h(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),Qh=Ch.extend({dataTransfer:null}),$h=fh.extend({touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:vh}),Fh=Dd.extend({propertyName:null,elapsedTime:null,pseudoElement:null}),Zh=Ch.extend({deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null}),Yh={eventTypes:Eu,extractEvents:function(e,t,n,i){var r=Au.get(e);if(!r)return null;switch(e){case"keypress":if(0===_h(n))return null;case"keydown":case"keyup":e=Hh;break;case"blur":case"focus":e=Vh;break;case"click":if(2===n.button)return null;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":e=Ch;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":e=Qh;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":e=$h;break;case Bc:case jc:case Rc:e=Rh;break;case Oc:e=Fh;break;case"scroll":e=fh;break;case"wheel":e=Zh;break;case"copy":case"cut":case"paste":e=Oh;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":e=Mh;break;default:e=Dd}return Ed(t=e.getPooled(r,t,n,i)),t}};if(al)throw Error(Yo(101));al=Array.prototype.slice.call("ResponderEventPlugin SimpleEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin".split(" ")),ll(),nl=wd,il=vd,rl=bd,fl({SimpleEventPlugin:Yh,EnterLeaveEventPlugin:Ih,ChangeEventPlugin:ph,SelectEventPlugin:jh,BeforeInputEventPlugin:Xd});var Gh=[],Xh=-1;function Jh(e){0>Xh||(e.current=Gh[Xh],Gh[Xh]=null,Xh--)}function Kh(e,t){Xh++,Gh[Xh]=e.current,e.current=t}var qh={},ep={current:qh},tp={current:!1},np=qh;function ip(e,t){var n=e.type.contextTypes;if(!n)return qh;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var r,s={};for(r in n)s[r]=t[r];return i&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function rp(e){return null!=(e=e.childContextTypes)}function sp(){Jh(tp),Jh(ep)}function ap(e,t,n){if(ep.current!==qh)throw Error(Yo(168));Kh(ep,t),Kh(tp,n)}function op(e,t,n){var i=e.stateNode;if(e=t.childContextTypes,"function"!=typeof i.getChildContext)return n;for(var r in i=i.getChildContext())if(!(r in e))throw Error(Yo(108,rc(t)||"Unknown",r));return Fo({},n,{},i)}function lp(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||qh,np=ep.current,Kh(ep,e),Kh(tp,tp.current),!0}function cp(e,t,n){var i=e.stateNode;if(!i)throw Error(Yo(169));n?(e=op(e,t,np),i.__reactInternalMemoizedMergedChildContext=e,Jh(tp),Jh(ep),Kh(ep,e)):Jh(tp),Kh(tp,n)}var up=Zo.unstable_runWithPriority,dp=Zo.unstable_scheduleCallback,hp=Zo.unstable_cancelCallback,pp=Zo.unstable_requestPaint,fp=Zo.unstable_now,gp=Zo.unstable_getCurrentPriorityLevel,mp=Zo.unstable_ImmediatePriority,vp=Zo.unstable_UserBlockingPriority,bp=Zo.unstable_NormalPriority,wp=Zo.unstable_LowPriority,yp=Zo.unstable_IdlePriority,xp={},Cp=Zo.unstable_shouldYield,Mp=void 0!==pp?pp:function(){},Sp=null,Ip=null,Ep=!1,Ap=fp(),Tp=1e4>Ap?fp:function(){return fp()-Ap};function kp(){switch(gp()){case mp:return 99;case vp:return 98;case bp:return 97;case wp:return 96;case yp:return 95;default:throw Error(Yo(332))}}function Np(e){switch(e){case 99:return mp;case 98:return vp;case 97:return bp;case 96:return wp;case 95:return yp;default:throw Error(Yo(332))}}function Pp(e,t){return e=Np(e),up(e,t)}function zp(e,t,n){return e=Np(e),dp(e,t,n)}function Dp(e){return null===Sp?(Sp=[e],Ip=dp(mp,Bp)):Sp.push(e),xp}function Lp(){if(null!==Ip){var e=Ip;Ip=null,hp(e)}Bp()}function Bp(){if(!Ep&&null!==Sp){Ep=!0;var e=0;try{var t=Sp;Pp(99,(function(){for(;e<t.length;e++){var n=t[e];do{n=n(!0)}while(null!==n)}})),Sp=null}catch(n){throw null!==Sp&&(Sp=Sp.slice(e+1)),dp(mp,Lp),n}finally{Ep=!1}}}function jp(e,t,n){return 1073741821-(1+((1073741821-e+t/10)/(n/=10)|0))*n}function Rp(e,t){if(e&&e.defaultProps)for(var n in t=Fo({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}var Op={current:null},Vp=null,_p=null,Up=null;function Wp(){Up=_p=Vp=null}function Hp(e){var t=Op.current;Jh(Op),e.type._context._currentValue=t}function Qp(e,t){for(;null!==e;){var n=e.alternate;if(e.childExpirationTime<t)e.childExpirationTime=t,null!==n&&n.childExpirationTime<t&&(n.childExpirationTime=t);else{if(!(null!==n&&n.childExpirationTime<t))break;n.childExpirationTime=t}e=e.return}}function $p(e,t){Vp=e,Up=_p=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(e.expirationTime>=t&&(wg=!0),e.firstContext=null)}function Fp(e,t){if(Up!==e&&!1!==t&&0!==t)if("number"==typeof t&&1073741823!==t||(Up=e,t=1073741823),t={context:e,observedBits:t,next:null},null===_p){if(null===Vp)throw Error(Yo(308));_p=t,Vp.dependencies={expirationTime:0,firstContext:t,responders:null}}else _p=_p.next=t;return e._currentValue}var Zp=!1;function Yp(e){e.updateQueue={baseState:e.memoizedState,baseQueue:null,shared:{pending:null},effects:null}}function Gp(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,baseQueue:e.baseQueue,shared:e.shared,effects:e.effects})}function Xp(e,t){return(e={expirationTime:e,suspenseConfig:t,tag:0,payload:null,callback:null,next:null}).next=e}function Jp(e,t){if(null!==(e=e.updateQueue)){var n=(e=e.shared).pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}}function Kp(e,t){var n=e.alternate;null!==n&&Gp(n,e),null===(n=(e=e.updateQueue).baseQueue)?(e.baseQueue=t.next=t,t.next=t):(t.next=n.next,n.next=t)}function qp(e,t,n,i){var r=e.updateQueue;Zp=!1;var s=r.baseQueue,a=r.shared.pending;if(null!==a){if(null!==s){var o=s.next;s.next=a.next,a.next=o}s=a,r.shared.pending=null,null!==(o=e.alternate)&&(null!==(o=o.updateQueue)&&(o.baseQueue=a))}if(null!==s){o=s.next;var l=r.baseState,c=0,u=null,d=null,h=null;if(null!==o)for(var p=o;;){if((a=p.expirationTime)<i){var f={expirationTime:p.expirationTime,suspenseConfig:p.suspenseConfig,tag:p.tag,payload:p.payload,callback:p.callback,next:null};null===h?(d=h=f,u=l):h=h.next=f,a>c&&(c=a)}else{null!==h&&(h=h.next={expirationTime:1073741823,suspenseConfig:p.suspenseConfig,tag:p.tag,payload:p.payload,callback:p.callback,next:null}),Xm(a,p.suspenseConfig);e:{var g=e,m=p;switch(a=t,f=n,m.tag){case 1:if("function"==typeof(g=m.payload)){l=g.call(f,l,a);break e}l=g;break e;case 3:g.effectTag=-4097&g.effectTag|64;case 0:if(null==(a="function"==typeof(g=m.payload)?g.call(f,l,a):g))break e;l=Fo({},l,a);break e;case 2:Zp=!0}}null!==p.callback&&(e.effectTag|=32,null===(a=r.effects)?r.effects=[p]:a.push(p))}if(null===(p=p.next)||p===o){if(null===(a=r.shared.pending))break;p=s.next=a.next,a.next=o,r.baseQueue=s=a,r.shared.pending=null}}null===h?u=l:h.next=d,r.baseState=u,r.baseQueue=h,Jm(c),e.expirationTime=c,e.memoizedState=l}}function ef(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var i=e[t],r=i.callback;if(null!==r){if(i.callback=null,i=r,r=n,"function"!=typeof i)throw Error(Yo(191,i));i.call(r)}}}var tf=Ol.ReactCurrentBatchConfig,nf=(new $o.Component).refs;function rf(e,t,n,i){n=null==(n=n(i,t=e.memoizedState))?t:Fo({},t,n),e.memoizedState=n,0===e.expirationTime&&(e.updateQueue.baseState=n)}var sf={isMounted:function(e){return!!(e=e._reactInternalFiber)&&Wc(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternalFiber;var i=Rm(),r=tf.suspense;(r=Xp(i=Om(i,e,r),r)).payload=t,null!=n&&(r.callback=n),Jp(e,r),Vm(e,i)},enqueueReplaceState:function(e,t,n){e=e._reactInternalFiber;var i=Rm(),r=tf.suspense;(r=Xp(i=Om(i,e,r),r)).tag=1,r.payload=t,null!=n&&(r.callback=n),Jp(e,r),Vm(e,i)},enqueueForceUpdate:function(e,t){e=e._reactInternalFiber;var n=Rm(),i=tf.suspense;(i=Xp(n=Om(n,e,i),i)).tag=2,null!=t&&(i.callback=t),Jp(e,i),Vm(e,n)}};function af(e,t,n,i,r,s,a){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(i,s,a):!t.prototype||!t.prototype.isPureReactComponent||(!Th(n,i)||!Th(r,s))}function of(e,t,n){var i=!1,r=qh,s=t.contextType;return"object"==typeof s&&null!==s?s=Fp(s):(r=rp(t)?np:ep.current,s=(i=null!=(i=t.contextTypes))?ip(e,r):qh),t=new t(n,s),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=sf,e.stateNode=t,t._reactInternalFiber=e,i&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=r,e.__reactInternalMemoizedMaskedChildContext=s),t}function lf(e,t,n,i){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,i),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,i),t.state!==e&&sf.enqueueReplaceState(t,t.state,null)}function cf(e,t,n,i){var r=e.stateNode;r.props=n,r.state=e.memoizedState,r.refs=nf,Yp(e);var s=t.contextType;"object"==typeof s&&null!==s?r.context=Fp(s):(s=rp(t)?np:ep.current,r.context=ip(e,s)),qp(e,n,r,i),r.state=e.memoizedState,"function"==typeof(s=t.getDerivedStateFromProps)&&(rf(e,t,s,n),r.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof r.getSnapshotBeforeUpdate||"function"!=typeof r.UNSAFE_componentWillMount&&"function"!=typeof r.componentWillMount||(t=r.state,"function"==typeof r.componentWillMount&&r.componentWillMount(),"function"==typeof r.UNSAFE_componentWillMount&&r.UNSAFE_componentWillMount(),t!==r.state&&sf.enqueueReplaceState(r,r.state,null),qp(e,n,r,i),r.state=e.memoizedState),"function"==typeof r.componentDidMount&&(e.effectTag|=4)}var uf=Array.isArray;function df(e,t,n){if(null!==(e=n.ref)&&"function"!=typeof e&&"object"!=typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(Yo(309));var i=n.stateNode}if(!i)throw Error(Yo(147,e));var r=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===r?t.ref:((t=function(e){var t=i.refs;t===nf&&(t=i.refs={}),null===e?delete t[r]:t[r]=e})._stringRef=r,t)}if("string"!=typeof e)throw Error(Yo(284));if(!n._owner)throw Error(Yo(290,e))}return e}function hf(e,t){if("textarea"!==e.type)throw Error(Yo(31,"[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t,""))}function pf(e){function t(t,n){if(e){var i=t.lastEffect;null!==i?(i.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n,n.nextEffect=null,n.effectTag=8}}function n(n,i){if(!e)return null;for(;null!==i;)t(n,i),i=i.sibling;return null}function i(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function r(e,t){return(e=vv(e,t)).index=0,e.sibling=null,e}function s(t,n,i){return t.index=i,e?null!==(i=t.alternate)?(i=i.index)<n?(t.effectTag=2,n):i:(t.effectTag=2,n):n}function a(t){return e&&null===t.alternate&&(t.effectTag=2),t}function o(e,t,n,i){return null===t||6!==t.tag?((t=yv(n,e.mode,i)).return=e,t):((t=r(t,n)).return=e,t)}function l(e,t,n,i){return null!==t&&t.elementType===n.type?((i=r(t,n.props)).ref=df(e,t,n),i.return=e,i):((i=bv(n.type,n.key,n.props,null,e.mode,i)).ref=df(e,t,n),i.return=e,i)}function c(e,t,n,i){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=xv(n,e.mode,i)).return=e,t):((t=r(t,n.children||[])).return=e,t)}function u(e,t,n,i,s){return null===t||7!==t.tag?((t=wv(n,e.mode,i,s)).return=e,t):((t=r(t,n)).return=e,t)}function d(e,t,n){if("string"==typeof t||"number"==typeof t)return(t=yv(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case Wl:return(n=bv(t.type,t.key,t.props,null,e.mode,n)).ref=df(e,null,t),n.return=e,n;case Hl:return(t=xv(t,e.mode,n)).return=e,t}if(uf(t)||ic(t))return(t=wv(t,e.mode,n,null)).return=e,t;hf(e,t)}return null}function h(e,t,n,i){var r=null!==t?t.key:null;if("string"==typeof n||"number"==typeof n)return null!==r?null:o(e,t,""+n,i);if("object"==typeof n&&null!==n){switch(n.$$typeof){case Wl:return n.key===r?n.type===Ql?u(e,t,n.props.children,i,r):l(e,t,n,i):null;case Hl:return n.key===r?c(e,t,n,i):null}if(uf(n)||ic(n))return null!==r?null:u(e,t,n,i,null);hf(e,n)}return null}function p(e,t,n,i,r){if("string"==typeof i||"number"==typeof i)return o(t,e=e.get(n)||null,""+i,r);if("object"==typeof i&&null!==i){switch(i.$$typeof){case Wl:return e=e.get(null===i.key?n:i.key)||null,i.type===Ql?u(t,e,i.props.children,r,i.key):l(t,e,i,r);case Hl:return c(t,e=e.get(null===i.key?n:i.key)||null,i,r)}if(uf(i)||ic(i))return u(t,e=e.get(n)||null,i,r,null);hf(t,i)}return null}return function(o,l,c,u){var f="object"==typeof c&&null!==c&&c.type===Ql&&null===c.key;f&&(c=c.props.children);var g="object"==typeof c&&null!==c;if(g)switch(c.$$typeof){case Wl:e:{for(g=c.key,f=l;null!==f;){if(f.key===g){switch(f.tag){case 7:if(c.type===Ql){n(o,f.sibling),(l=r(f,c.props.children)).return=o,o=l;break e}break;default:if(f.elementType===c.type){n(o,f.sibling),(l=r(f,c.props)).ref=df(o,f,c),l.return=o,o=l;break e}}n(o,f);break}t(o,f),f=f.sibling}c.type===Ql?((l=wv(c.props.children,o.mode,u,c.key)).return=o,o=l):((u=bv(c.type,c.key,c.props,null,o.mode,u)).ref=df(o,l,c),u.return=o,o=u)}return a(o);case Hl:e:{for(f=c.key;null!==l;){if(l.key===f){if(4===l.tag&&l.stateNode.containerInfo===c.containerInfo&&l.stateNode.implementation===c.implementation){n(o,l.sibling),(l=r(l,c.children||[])).return=o,o=l;break e}n(o,l);break}t(o,l),l=l.sibling}(l=xv(c,o.mode,u)).return=o,o=l}return a(o)}if("string"==typeof c||"number"==typeof c)return c=""+c,null!==l&&6===l.tag?(n(o,l.sibling),(l=r(l,c)).return=o,o=l):(n(o,l),(l=yv(c,o.mode,u)).return=o,o=l),a(o);if(uf(c))return function(r,a,o,l){for(var c=null,u=null,f=a,g=a=0,m=null;null!==f&&g<o.length;g++){f.index>g?(m=f,f=null):m=f.sibling;var v=h(r,f,o[g],l);if(null===v){null===f&&(f=m);break}e&&f&&null===v.alternate&&t(r,f),a=s(v,a,g),null===u?c=v:u.sibling=v,u=v,f=m}if(g===o.length)return n(r,f),c;if(null===f){for(;g<o.length;g++)null!==(f=d(r,o[g],l))&&(a=s(f,a,g),null===u?c=f:u.sibling=f,u=f);return c}for(f=i(r,f);g<o.length;g++)null!==(m=p(f,r,g,o[g],l))&&(e&&null!==m.alternate&&f.delete(null===m.key?g:m.key),a=s(m,a,g),null===u?c=m:u.sibling=m,u=m);return e&&f.forEach((function(e){return t(r,e)})),c}(o,l,c,u);if(ic(c))return function(r,a,o,l){var c=ic(o);if("function"!=typeof c)throw Error(Yo(150));if(null==(o=c.call(o)))throw Error(Yo(151));for(var u=c=null,f=a,g=a=0,m=null,v=o.next();null!==f&&!v.done;g++,v=o.next()){f.index>g?(m=f,f=null):m=f.sibling;var b=h(r,f,v.value,l);if(null===b){null===f&&(f=m);break}e&&f&&null===b.alternate&&t(r,f),a=s(b,a,g),null===u?c=b:u.sibling=b,u=b,f=m}if(v.done)return n(r,f),c;if(null===f){for(;!v.done;g++,v=o.next())null!==(v=d(r,v.value,l))&&(a=s(v,a,g),null===u?c=v:u.sibling=v,u=v);return c}for(f=i(r,f);!v.done;g++,v=o.next())null!==(v=p(f,r,g,v.value,l))&&(e&&null!==v.alternate&&f.delete(null===v.key?g:v.key),a=s(v,a,g),null===u?c=v:u.sibling=v,u=v);return e&&f.forEach((function(e){return t(r,e)})),c}(o,l,c,u);if(g&&hf(o,c),void 0===c&&!f)switch(o.tag){case 1:case 0:throw o=o.type,Error(Yo(152,o.displayName||o.name||"Component"))}return n(o,l)}}var ff=pf(!0),gf=pf(!1),mf={},vf={current:mf},bf={current:mf},wf={current:mf};function yf(e){if(e===mf)throw Error(Yo(174));return e}function xf(e,t){switch(Kh(wf,t),Kh(bf,e),Kh(vf,mf),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ic(null,"");break;default:t=Ic(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}Jh(vf),Kh(vf,t)}function Cf(){Jh(vf),Jh(bf),Jh(wf)}function Mf(e){yf(wf.current);var t=yf(vf.current),n=Ic(t,e.type);t!==n&&(Kh(bf,e),Kh(vf,n))}function Sf(e){bf.current===e&&(Jh(vf),Jh(bf))}var If={current:0};function Ef(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(64&t.effectTag))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function Af(e,t){return{responder:e,props:t}}var Tf=Ol.ReactCurrentDispatcher,kf=Ol.ReactCurrentBatchConfig,Nf=0,Pf=null,zf=null,Df=null,Lf=!1;function Bf(){throw Error(Yo(321))}function jf(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Eh(e[n],t[n]))return!1;return!0}function Rf(e,t,n,i,r,s){if(Nf=s,Pf=t,t.memoizedState=null,t.updateQueue=null,t.expirationTime=0,Tf.current=null===e||null===e.memoizedState?ag:og,e=n(i,r),t.expirationTime===Nf){s=0;do{if(t.expirationTime=0,!(25>s))throw Error(Yo(301));s+=1,Df=zf=null,t.updateQueue=null,Tf.current=lg,e=n(i,r)}while(t.expirationTime===Nf)}if(Tf.current=sg,t=null!==zf&&null!==zf.next,Nf=0,Df=zf=Pf=null,Lf=!1,t)throw Error(Yo(300));return e}function Of(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===Df?Pf.memoizedState=Df=e:Df=Df.next=e,Df}function Vf(){if(null===zf){var e=Pf.alternate;e=null!==e?e.memoizedState:null}else e=zf.next;var t=null===Df?Pf.memoizedState:Df.next;if(null!==t)Df=t,zf=e;else{if(null===e)throw Error(Yo(310));e={memoizedState:(zf=e).memoizedState,baseState:zf.baseState,baseQueue:zf.baseQueue,queue:zf.queue,next:null},null===Df?Pf.memoizedState=Df=e:Df=Df.next=e}return Df}function _f(e,t){return"function"==typeof t?t(e):t}function Uf(e){var t=Vf(),n=t.queue;if(null===n)throw Error(Yo(311));n.lastRenderedReducer=e;var i=zf,r=i.baseQueue,s=n.pending;if(null!==s){if(null!==r){var a=r.next;r.next=s.next,s.next=a}i.baseQueue=r=s,n.pending=null}if(null!==r){r=r.next,i=i.baseState;var o=a=s=null,l=r;do{var c=l.expirationTime;if(c<Nf){var u={expirationTime:l.expirationTime,suspenseConfig:l.suspenseConfig,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null};null===o?(a=o=u,s=i):o=o.next=u,c>Pf.expirationTime&&(Pf.expirationTime=c,Jm(c))}else null!==o&&(o=o.next={expirationTime:1073741823,suspenseConfig:l.suspenseConfig,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null}),Xm(c,l.suspenseConfig),i=l.eagerReducer===e?l.eagerState:e(i,l.action);l=l.next}while(null!==l&&l!==r);null===o?s=i:o.next=a,Eh(i,t.memoizedState)||(wg=!0),t.memoizedState=i,t.baseState=s,t.baseQueue=o,n.lastRenderedState=i}return[t.memoizedState,n.dispatch]}function Wf(e){var t=Vf(),n=t.queue;if(null===n)throw Error(Yo(311));n.lastRenderedReducer=e;var i=n.dispatch,r=n.pending,s=t.memoizedState;if(null!==r){n.pending=null;var a=r=r.next;do{s=e(s,a.action),a=a.next}while(a!==r);Eh(s,t.memoizedState)||(wg=!0),t.memoizedState=s,null===t.baseQueue&&(t.baseState=s),n.lastRenderedState=s}return[s,i]}function Hf(e){var t=Of();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:_f,lastRenderedState:e}).dispatch=rg.bind(null,Pf,e),[t.memoizedState,e]}function Qf(e,t,n,i){return e={tag:e,create:t,destroy:n,deps:i,next:null},null===(t=Pf.updateQueue)?(t={lastEffect:null},Pf.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(i=n.next,n.next=e,e.next=i,t.lastEffect=e),e}function $f(){return Vf().memoizedState}function Ff(e,t,n,i){var r=Of();Pf.effectTag|=e,r.memoizedState=Qf(1|t,n,void 0,void 0===i?null:i)}function Zf(e,t,n,i){var r=Vf();i=void 0===i?null:i;var s=void 0;if(null!==zf){var a=zf.memoizedState;if(s=a.destroy,null!==i&&jf(i,a.deps))return void Qf(t,n,s,i)}Pf.effectTag|=e,r.memoizedState=Qf(1|t,n,s,i)}function Yf(e,t){return Ff(516,4,e,t)}function Gf(e,t){return Zf(516,4,e,t)}function Xf(e,t){return Zf(4,2,e,t)}function Jf(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Kf(e,t,n){return n=null!=n?n.concat([e]):null,Zf(4,2,Jf.bind(null,t,e),n)}function qf(){}function eg(e,t){return Of().memoizedState=[e,void 0===t?null:t],e}function tg(e,t){var n=Vf();t=void 0===t?null:t;var i=n.memoizedState;return null!==i&&null!==t&&jf(t,i[1])?i[0]:(n.memoizedState=[e,t],e)}function ng(e,t){var n=Vf();t=void 0===t?null:t;var i=n.memoizedState;return null!==i&&null!==t&&jf(t,i[1])?i[0]:(e=e(),n.memoizedState=[e,t],e)}function ig(e,t,n){var i=kp();Pp(98>i?98:i,(function(){e(!0)})),Pp(97<i?97:i,(function(){var i=kf.suspense;kf.suspense=void 0===t?null:t;try{e(!1),n()}finally{kf.suspense=i}}))}function rg(e,t,n){var i=Rm(),r=tf.suspense;r={expirationTime:i=Om(i,e,r),suspenseConfig:r,action:n,eagerReducer:null,eagerState:null,next:null};var s=t.pending;if(null===s?r.next=r:(r.next=s.next,s.next=r),t.pending=r,s=e.alternate,e===Pf||null!==s&&s===Pf)Lf=!0,r.expirationTime=Nf,Pf.expirationTime=Nf;else{if(0===e.expirationTime&&(null===s||0===s.expirationTime)&&null!==(s=t.lastRenderedReducer))try{var a=t.lastRenderedState,o=s(a,n);if(r.eagerReducer=s,r.eagerState=o,Eh(o,a))return}catch(l){}Vm(e,i)}}var sg={readContext:Fp,useCallback:Bf,useContext:Bf,useEffect:Bf,useImperativeHandle:Bf,useLayoutEffect:Bf,useMemo:Bf,useReducer:Bf,useRef:Bf,useState:Bf,useDebugValue:Bf,useResponder:Bf,useDeferredValue:Bf,useTransition:Bf},ag={readContext:Fp,useCallback:eg,useContext:Fp,useEffect:Yf,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,Ff(4,2,Jf.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ff(4,2,e,t)},useMemo:function(e,t){var n=Of();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var i=Of();return t=void 0!==n?n(t):t,i.memoizedState=i.baseState=t,e=(e=i.queue={pending:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=rg.bind(null,Pf,e),[i.memoizedState,e]},useRef:function(e){return e={current:e},Of().memoizedState=e},useState:Hf,useDebugValue:qf,useResponder:Af,useDeferredValue:function(e,t){var n=Hf(e),i=n[0],r=n[1];return Yf((function(){var n=kf.suspense;kf.suspense=void 0===t?null:t;try{r(e)}finally{kf.suspense=n}}),[e,t]),i},useTransition:function(e){var t=Hf(!1),n=t[0];return t=t[1],[eg(ig.bind(null,t,e),[t,e]),n]}},og={readContext:Fp,useCallback:tg,useContext:Fp,useEffect:Gf,useImperativeHandle:Kf,useLayoutEffect:Xf,useMemo:ng,useReducer:Uf,useRef:$f,useState:function(){return Uf(_f)},useDebugValue:qf,useResponder:Af,useDeferredValue:function(e,t){var n=Uf(_f),i=n[0],r=n[1];return Gf((function(){var n=kf.suspense;kf.suspense=void 0===t?null:t;try{r(e)}finally{kf.suspense=n}}),[e,t]),i},useTransition:function(e){var t=Uf(_f),n=t[0];return t=t[1],[tg(ig.bind(null,t,e),[t,e]),n]}},lg={readContext:Fp,useCallback:tg,useContext:Fp,useEffect:Gf,useImperativeHandle:Kf,useLayoutEffect:Xf,useMemo:ng,useReducer:Wf,useRef:$f,useState:function(){return Wf(_f)},useDebugValue:qf,useResponder:Af,useDeferredValue:function(e,t){var n=Wf(_f),i=n[0],r=n[1];return Gf((function(){var n=kf.suspense;kf.suspense=void 0===t?null:t;try{r(e)}finally{kf.suspense=n}}),[e,t]),i},useTransition:function(e){var t=Wf(_f),n=t[0];return t=t[1],[tg(ig.bind(null,t,e),[t,e]),n]}},cg=null,ug=null,dg=!1;function hg(e,t){var n=gv(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.effectTag=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function pg(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,!0);case 13:default:return!1}}function fg(e){if(dg){var t=ug;if(t){var n=t;if(!pg(e,t)){if(!(t=ud(n.nextSibling))||!pg(e,t))return e.effectTag=-1025&e.effectTag|2,dg=!1,void(cg=e);hg(cg,n)}cg=e,ug=ud(t.firstChild)}else e.effectTag=-1025&e.effectTag|2,dg=!1,cg=e}}function gg(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;cg=e}function mg(e){if(e!==cg)return!1;if(!dg)return gg(e),dg=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!od(t,e.memoizedProps))for(t=ug;t;)hg(e,t),t=ud(t.nextSibling);if(gg(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(Yo(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){ug=ud(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}ug=null}}else ug=cg?ud(e.stateNode.nextSibling):null;return!0}function vg(){ug=cg=null,dg=!1}var bg=Ol.ReactCurrentOwner,wg=!1;function yg(e,t,n,i){t.child=null===e?gf(t,null,n,i):ff(t,e.child,n,i)}function xg(e,t,n,i,r){n=n.render;var s=t.ref;return $p(t,r),i=Rf(e,t,n,i,s,r),null===e||wg?(t.effectTag|=1,yg(e,t,i,r),t.child):(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=r&&(e.expirationTime=0),Rg(e,t,r))}function Cg(e,t,n,i,r,s){if(null===e){var a=n.type;return"function"!=typeof a||mv(a)||void 0!==a.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=bv(n.type,null,i,null,t.mode,s)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,Mg(e,t,a,i,r,s))}return a=e.child,r<s&&(r=a.memoizedProps,(n=null!==(n=n.compare)?n:Th)(r,i)&&e.ref===t.ref)?Rg(e,t,s):(t.effectTag|=1,(e=vv(a,i)).ref=t.ref,e.return=t,t.child=e)}function Mg(e,t,n,i,r,s){return null!==e&&Th(e.memoizedProps,i)&&e.ref===t.ref&&(wg=!1,r<s)?(t.expirationTime=e.expirationTime,Rg(e,t,s)):Ig(e,t,n,i,s)}function Sg(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.effectTag|=128)}function Ig(e,t,n,i,r){var s=rp(n)?np:ep.current;return s=ip(t,s),$p(t,r),n=Rf(e,t,n,i,s,r),null===e||wg?(t.effectTag|=1,yg(e,t,n,r),t.child):(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=r&&(e.expirationTime=0),Rg(e,t,r))}function Eg(e,t,n,i,r){if(rp(n)){var s=!0;lp(t)}else s=!1;if($p(t,r),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),of(t,n,i),cf(t,n,i,r),i=!0;else if(null===e){var a=t.stateNode,o=t.memoizedProps;a.props=o;var l=a.context,c=n.contextType;"object"==typeof c&&null!==c?c=Fp(c):c=ip(t,c=rp(n)?np:ep.current);var u=n.getDerivedStateFromProps,d="function"==typeof u||"function"==typeof a.getSnapshotBeforeUpdate;d||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(o!==i||l!==c)&&lf(t,a,i,c),Zp=!1;var h=t.memoizedState;a.state=h,qp(t,i,a,r),l=t.memoizedState,o!==i||h!==l||tp.current||Zp?("function"==typeof u&&(rf(t,n,u,i),l=t.memoizedState),(o=Zp||af(t,n,o,i,h,l,c))?(d||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(t.effectTag|=4)):("function"==typeof a.componentDidMount&&(t.effectTag|=4),t.memoizedProps=i,t.memoizedState=l),a.props=i,a.state=l,a.context=c,i=o):("function"==typeof a.componentDidMount&&(t.effectTag|=4),i=!1)}else a=t.stateNode,Gp(e,t),o=t.memoizedProps,a.props=t.type===t.elementType?o:Rp(t.type,o),l=a.context,"object"==typeof(c=n.contextType)&&null!==c?c=Fp(c):c=ip(t,c=rp(n)?np:ep.current),(d="function"==typeof(u=n.getDerivedStateFromProps)||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(o!==i||l!==c)&&lf(t,a,i,c),Zp=!1,l=t.memoizedState,a.state=l,qp(t,i,a,r),h=t.memoizedState,o!==i||l!==h||tp.current||Zp?("function"==typeof u&&(rf(t,n,u,i),h=t.memoizedState),(u=Zp||af(t,n,o,i,l,h,c))?(d||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(i,h,c),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(i,h,c)),"function"==typeof a.componentDidUpdate&&(t.effectTag|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.effectTag|=256)):("function"!=typeof a.componentDidUpdate||o===e.memoizedProps&&l===e.memoizedState||(t.effectTag|=4),"function"!=typeof a.getSnapshotBeforeUpdate||o===e.memoizedProps&&l===e.memoizedState||(t.effectTag|=256),t.memoizedProps=i,t.memoizedState=h),a.props=i,a.state=h,a.context=c,i=u):("function"!=typeof a.componentDidUpdate||o===e.memoizedProps&&l===e.memoizedState||(t.effectTag|=4),"function"!=typeof a.getSnapshotBeforeUpdate||o===e.memoizedProps&&l===e.memoizedState||(t.effectTag|=256),i=!1);return Ag(e,t,n,i,s,r)}function Ag(e,t,n,i,r,s){Sg(e,t);var a=0!=(64&t.effectTag);if(!i&&!a)return r&&cp(t,n,!1),Rg(e,t,s);i=t.stateNode,bg.current=t;var o=a&&"function"!=typeof n.getDerivedStateFromError?null:i.render();return t.effectTag|=1,null!==e&&a?(t.child=ff(t,e.child,null,s),t.child=ff(t,null,o,s)):yg(e,t,o,s),t.memoizedState=i.state,r&&cp(t,n,!0),t.child}function Tg(e){var t=e.stateNode;t.pendingContext?ap(0,t.pendingContext,t.pendingContext!==t.context):t.context&&ap(0,t.context,!1),xf(e,t.containerInfo)}var kg,Ng,Pg,zg={dehydrated:null,retryTime:0};function Dg(e,t,n){var i,r=t.mode,s=t.pendingProps,a=If.current,o=!1;if((i=0!=(64&t.effectTag))||(i=0!=(2&a)&&(null===e||null!==e.memoizedState)),i?(o=!0,t.effectTag&=-65):null!==e&&null===e.memoizedState||void 0===s.fallback||!0===s.unstable_avoidThisFallback||(a|=1),Kh(If,1&a),null===e){if(void 0!==s.fallback&&fg(t),o){if(o=s.fallback,(s=wv(null,r,0,null)).return=t,0==(2&t.mode))for(e=null!==t.memoizedState?t.child.child:t.child,s.child=e;null!==e;)e.return=s,e=e.sibling;return(n=wv(o,r,n,null)).return=t,s.sibling=n,t.memoizedState=zg,t.child=s,n}return r=s.children,t.memoizedState=null,t.child=gf(t,null,r,n)}if(null!==e.memoizedState){if(r=(e=e.child).sibling,o){if(s=s.fallback,(n=vv(e,e.pendingProps)).return=t,0==(2&t.mode)&&(o=null!==t.memoizedState?t.child.child:t.child)!==e.child)for(n.child=o;null!==o;)o.return=n,o=o.sibling;return(r=vv(r,s)).return=t,n.sibling=r,n.childExpirationTime=0,t.memoizedState=zg,t.child=n,r}return n=ff(t,e.child,s.children,n),t.memoizedState=null,t.child=n}if(e=e.child,o){if(o=s.fallback,(s=wv(null,r,0,null)).return=t,s.child=e,null!==e&&(e.return=s),0==(2&t.mode))for(e=null!==t.memoizedState?t.child.child:t.child,s.child=e;null!==e;)e.return=s,e=e.sibling;return(n=wv(o,r,n,null)).return=t,s.sibling=n,n.effectTag|=2,s.childExpirationTime=0,t.memoizedState=zg,t.child=s,n}return t.memoizedState=null,t.child=ff(t,e,s.children,n)}function Lg(e,t){e.expirationTime<t&&(e.expirationTime=t);var n=e.alternate;null!==n&&n.expirationTime<t&&(n.expirationTime=t),Qp(e.return,t)}function Bg(e,t,n,i,r,s){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:n,tailExpiration:0,tailMode:r,lastEffect:s}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=i,a.tail=n,a.tailExpiration=0,a.tailMode=r,a.lastEffect=s)}function jg(e,t,n){var i=t.pendingProps,r=i.revealOrder,s=i.tail;if(yg(e,t,i.children,n),0!=(2&(i=If.current)))i=1&i|2,t.effectTag|=64;else{if(null!==e&&0!=(64&e.effectTag))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Lg(e,n);else if(19===e.tag)Lg(e,n);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}i&=1}if(Kh(If,i),0==(2&t.mode))t.memoizedState=null;else switch(r){case"forwards":for(n=t.child,r=null;null!==n;)null!==(e=n.alternate)&&null===Ef(e)&&(r=n),n=n.sibling;null===(n=r)?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),Bg(t,!1,r,n,s,t.lastEffect);break;case"backwards":for(n=null,r=t.child,t.child=null;null!==r;){if(null!==(e=r.alternate)&&null===Ef(e)){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}Bg(t,!0,n,null,s,t.lastEffect);break;case"together":Bg(t,!1,null,null,void 0,t.lastEffect);break;default:t.memoizedState=null}return t.child}function Rg(e,t,n){null!==e&&(t.dependencies=e.dependencies);var i=t.expirationTime;if(0!==i&&Jm(i),t.childExpirationTime<n)return null;if(null!==e&&t.child!==e.child)throw Error(Yo(153));if(null!==t.child){for(n=vv(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=vv(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function Og(e,t){switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var i=null;null!==n;)null!==n.alternate&&(i=n),n=n.sibling;null===i?t||null===e.tail?e.tail=null:e.tail.sibling=null:i.sibling=null}}function Vg(e,t,n){var i=t.pendingProps;switch(t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:return rp(t.type)&&sp(),null;case 3:return Cf(),Jh(tp),Jh(ep),(n=t.stateNode).pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||!mg(t)||(t.effectTag|=4),null;case 5:Sf(t),n=yf(wf.current);var r=t.type;if(null!==e&&null!=t.stateNode)Ng(e,t,r,i,n),e.ref!==t.ref&&(t.effectTag|=128);else{if(!i){if(null===t.stateNode)throw Error(Yo(166));return null}if(e=yf(vf.current),mg(t)){i=t.stateNode,r=t.type;var s=t.memoizedProps;switch(i[pd]=t,i[fd]=s,r){case"iframe":case"object":case"embed":ju("load",i);break;case"video":case"audio":for(e=0;e<Vc.length;e++)ju(Vc[e],i);break;case"source":ju("error",i);break;case"img":case"image":case"link":ju("error",i),ju("load",i);break;case"form":ju("reset",i),ju("submit",i);break;case"details":ju("toggle",i);break;case"input":dc(i,s),ju("invalid",i),Xu(n,"onChange");break;case"select":i._wrapperState={wasMultiple:!!s.multiple},ju("invalid",i),Xu(n,"onChange");break;case"textarea":wc(i,s),ju("invalid",i),Xu(n,"onChange")}for(var a in Zu(r,s),e=null,s)if(s.hasOwnProperty(a)){var o=s[a];"children"===a?"string"==typeof o?i.textContent!==o&&(e=["children",o]):"number"==typeof o&&i.textContent!==""+o&&(e=["children",""+o]):hl.hasOwnProperty(a)&&null!=o&&Xu(n,a)}switch(r){case"input":lc(i),fc(i,s,!0);break;case"textarea":lc(i),xc(i);break;case"select":case"option":break;default:"function"==typeof s.onClick&&(i.onclick=Ju)}n=e,t.updateQueue=n,null!==n&&(t.effectTag|=4)}else{switch(a=9===n.nodeType?n:n.ownerDocument,e===Gu&&(e=Sc(r)),e===Gu?"script"===r?((e=a.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof i.is?e=a.createElement(r,{is:i.is}):(e=a.createElement(r),"select"===r&&(a=e,i.multiple?a.multiple=!0:i.size&&(a.size=i.size))):e=a.createElementNS(e,r),e[pd]=t,e[fd]=i,kg(e,t),t.stateNode=e,a=Yu(r,i),r){case"iframe":case"object":case"embed":ju("load",e),o=i;break;case"video":case"audio":for(o=0;o<Vc.length;o++)ju(Vc[o],e);o=i;break;case"source":ju("error",e),o=i;break;case"img":case"image":case"link":ju("error",e),ju("load",e),o=i;break;case"form":ju("reset",e),ju("submit",e),o=i;break;case"details":ju("toggle",e),o=i;break;case"input":dc(e,i),o=uc(e,i),ju("invalid",e),Xu(n,"onChange");break;case"option":o=mc(e,i);break;case"select":e._wrapperState={wasMultiple:!!i.multiple},o=Fo({},i,{value:void 0}),ju("invalid",e),Xu(n,"onChange");break;case"textarea":wc(e,i),o=bc(e,i),ju("invalid",e),Xu(n,"onChange");break;default:o=i}Zu(r,o);var l=o;for(s in l)if(l.hasOwnProperty(s)){var c=l[s];"style"===s?$u(e,c):"dangerouslySetInnerHTML"===s?null!=(c=c?c.__html:void 0)&&Tc(e,c):"children"===s?"string"==typeof c?("textarea"!==r||""!==c)&&kc(e,c):"number"==typeof c&&kc(e,""+c):"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&"autoFocus"!==s&&(hl.hasOwnProperty(s)?null!=c&&Xu(n,s):null!=c&&Vl(e,s,c,a))}switch(r){case"input":lc(e),fc(e,i,!1);break;case"textarea":lc(e),xc(e);break;case"option":null!=i.value&&e.setAttribute("value",""+ac(i.value));break;case"select":e.multiple=!!i.multiple,null!=(n=i.value)?vc(e,!!i.multiple,n,!1):null!=i.defaultValue&&vc(e,!!i.multiple,i.defaultValue,!0);break;default:"function"==typeof o.onClick&&(e.onclick=Ju)}ad(r,i)&&(t.effectTag|=4)}null!==t.ref&&(t.effectTag|=128)}return null;case 6:if(e&&null!=t.stateNode)Pg(0,t,e.memoizedProps,i);else{if("string"!=typeof i&&null===t.stateNode)throw Error(Yo(166));n=yf(wf.current),yf(vf.current),mg(t)?(n=t.stateNode,i=t.memoizedProps,n[pd]=t,n.nodeValue!==i&&(t.effectTag|=4)):((n=(9===n.nodeType?n:n.ownerDocument).createTextNode(i))[pd]=t,t.stateNode=n)}return null;case 13:return Jh(If),i=t.memoizedState,0!=(64&t.effectTag)?(t.expirationTime=n,t):(n=null!==i,i=!1,null===e?void 0!==t.memoizedProps.fallback&&mg(t):(i=null!==(r=e.memoizedState),n||null===r||null!==(r=e.child.sibling)&&(null!==(s=t.firstEffect)?(t.firstEffect=r,r.nextEffect=s):(t.firstEffect=t.lastEffect=r,r.nextEffect=null),r.effectTag=8)),n&&!i&&0!=(2&t.mode)&&(null===e&&!0!==t.memoizedProps.unstable_avoidThisFallback||0!=(1&If.current)?bm===dm&&(bm=hm):(bm!==dm&&bm!==hm||(bm=pm),0!==Mm&&null!==gm&&(Sv(gm,vm),Iv(gm,Mm)))),(n||i)&&(t.effectTag|=4),null);case 4:return Cf(),null;case 10:return Hp(t),null;case 17:return rp(t.type)&&sp(),null;case 19:if(Jh(If),null===(i=t.memoizedState))return null;if(r=0!=(64&t.effectTag),null===(s=i.rendering)){if(r)Og(i,!1);else if(bm!==dm||null!==e&&0!=(64&e.effectTag))for(s=t.child;null!==s;){if(null!==(e=Ef(s))){for(t.effectTag|=64,Og(i,!1),null!==(r=e.updateQueue)&&(t.updateQueue=r,t.effectTag|=4),null===i.lastEffect&&(t.firstEffect=null),t.lastEffect=i.lastEffect,i=t.child;null!==i;)s=n,(r=i).effectTag&=2,r.nextEffect=null,r.firstEffect=null,r.lastEffect=null,null===(e=r.alternate)?(r.childExpirationTime=0,r.expirationTime=s,r.child=null,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null):(r.childExpirationTime=e.childExpirationTime,r.expirationTime=e.expirationTime,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,s=e.dependencies,r.dependencies=null===s?null:{expirationTime:s.expirationTime,firstContext:s.firstContext,responders:s.responders}),i=i.sibling;return Kh(If,1&If.current|2),t.child}s=s.sibling}}else{if(!r)if(null!==(e=Ef(s))){if(t.effectTag|=64,r=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.effectTag|=4),Og(i,!0),null===i.tail&&"hidden"===i.tailMode&&!s.alternate)return null!==(t=t.lastEffect=i.lastEffect)&&(t.nextEffect=null),null}else 2*Tp()-i.renderingStartTime>i.tailExpiration&&1<n&&(t.effectTag|=64,r=!0,Og(i,!1),t.expirationTime=t.childExpirationTime=n-1);i.isBackwards?(s.sibling=t.child,t.child=s):(null!==(n=i.last)?n.sibling=s:t.child=s,i.last=s)}return null!==i.tail?(0===i.tailExpiration&&(i.tailExpiration=Tp()+500),n=i.tail,i.rendering=n,i.tail=n.sibling,i.lastEffect=t.lastEffect,i.renderingStartTime=Tp(),n.sibling=null,t=If.current,Kh(If,r?1&t|2:1&t),n):null}throw Error(Yo(156,t.tag))}function _g(e){switch(e.tag){case 1:rp(e.type)&&sp();var t=e.effectTag;return 4096&t?(e.effectTag=-4097&t|64,e):null;case 3:if(Cf(),Jh(tp),Jh(ep),0!=(64&(t=e.effectTag)))throw Error(Yo(285));return e.effectTag=-4097&t|64,e;case 5:return Sf(e),null;case 13:return Jh(If),4096&(t=e.effectTag)?(e.effectTag=-4097&t|64,e):null;case 19:return Jh(If),null;case 4:return Cf(),null;case 10:return Hp(e),null;default:return null}}function Ug(e,t){return{value:e,source:t,stack:sc(t)}}kg=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Ng=function(e,t,n,i,r){var s=e.memoizedProps;if(s!==i){var a,o,l=t.stateNode;switch(yf(vf.current),e=null,n){case"input":s=uc(l,s),i=uc(l,i),e=[];break;case"option":s=mc(l,s),i=mc(l,i),e=[];break;case"select":s=Fo({},s,{value:void 0}),i=Fo({},i,{value:void 0}),e=[];break;case"textarea":s=bc(l,s),i=bc(l,i),e=[];break;default:"function"!=typeof s.onClick&&"function"==typeof i.onClick&&(l.onclick=Ju)}for(a in Zu(n,i),n=null,s)if(!i.hasOwnProperty(a)&&s.hasOwnProperty(a)&&null!=s[a])if("style"===a)for(o in l=s[a])l.hasOwnProperty(o)&&(n||(n={}),n[o]="");else"dangerouslySetInnerHTML"!==a&&"children"!==a&&"suppressContentEditableWarning"!==a&&"suppressHydrationWarning"!==a&&"autoFocus"!==a&&(hl.hasOwnProperty(a)?e||(e=[]):(e=e||[]).push(a,null));for(a in i){var c=i[a];if(l=null!=s?s[a]:void 0,i.hasOwnProperty(a)&&c!==l&&(null!=c||null!=l))if("style"===a)if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(n||(n={}),n[o]=c[o])}else n||(e||(e=[]),e.push(a,n)),n=c;else"dangerouslySetInnerHTML"===a?(c=c?c.__html:void 0,l=l?l.__html:void 0,null!=c&&l!==c&&(e=e||[]).push(a,c)):"children"===a?l===c||"string"!=typeof c&&"number"!=typeof c||(e=e||[]).push(a,""+c):"suppressContentEditableWarning"!==a&&"suppressHydrationWarning"!==a&&(hl.hasOwnProperty(a)?(null!=c&&Xu(r,a),e||l===c||(e=[])):(e=e||[]).push(a,c))}n&&(e=e||[]).push("style",n),r=e,(t.updateQueue=r)&&(t.effectTag|=4)}},Pg=function(e,t,n,i){n!==i&&(t.effectTag|=4)};var Wg="function"==typeof WeakSet?WeakSet:Set;function Hg(e,t){var n=t.source,i=t.stack;null===i&&null!==n&&(i=sc(n)),null!==n&&rc(n.type),t=t.value,null!==e&&1===e.tag&&rc(e.type);try{console.error(t)}catch(Pb){setTimeout((function(){throw Pb}))}}function Qg(e){var t=e.ref;if(null!==t)if("function"==typeof t)try{t(null)}catch(n){cv(e,n)}else t.current=null}function $g(e,t){switch(t.tag){case 0:case 11:case 15:case 22:return;case 1:if(256&t.effectTag&&null!==e){var n=e.memoizedProps,i=e.memoizedState;t=(e=t.stateNode).getSnapshotBeforeUpdate(t.elementType===t.type?n:Rp(t.type,n),i),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:case 5:case 6:case 4:case 17:return}throw Error(Yo(163))}function Fg(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var i=n.destroy;n.destroy=void 0,void 0!==i&&i()}n=n.next}while(n!==t)}}function Zg(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var i=n.create;n.destroy=i()}n=n.next}while(n!==t)}}function Yg(e,t,n){switch(n.tag){case 0:case 11:case 15:case 22:return void Zg(3,n);case 1:if(e=n.stateNode,4&n.effectTag)if(null===t)e.componentDidMount();else{var i=n.elementType===n.type?t.memoizedProps:Rp(n.type,t.memoizedProps);e.componentDidUpdate(i,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate)}return void(null!==(t=n.updateQueue)&&ef(n,t,e));case 3:if(null!==(t=n.updateQueue)){if(e=null,null!==n.child)switch(n.child.tag){case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode}ef(n,t,e)}return;case 5:return e=n.stateNode,void(null===t&&4&n.effectTag&&ad(n.type,n.memoizedProps)&&e.focus());case 6:case 4:case 12:return;case 13:return void(null===n.memoizedState&&(n=n.alternate,null!==n&&(n=n.memoizedState,null!==n&&(n=n.dehydrated,null!==n&&Iu(n)))));case 19:case 17:case 20:case 21:return}throw Error(Yo(163))}function Gg(e,t,n){switch("function"==typeof pv&&pv(t),t.tag){case 0:case 11:case 14:case 15:case 22:if(null!==(e=t.updateQueue)&&null!==(e=e.lastEffect)){var i=e.next;Pp(97<n?97:n,(function(){var e=i;do{var n=e.destroy;if(void 0!==n){var r=t;try{n()}catch(s){cv(r,s)}}e=e.next}while(e!==i)}))}break;case 1:Qg(t),"function"==typeof(n=t.stateNode).componentWillUnmount&&function(e,t){try{t.props=e.memoizedProps,t.state=e.memoizedState,t.componentWillUnmount()}catch(n){cv(e,n)}}(t,n);break;case 5:Qg(t);break;case 4:tm(e,t,n)}}function Xg(e){var t=e.alternate;e.return=null,e.child=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.alternate=null,e.firstEffect=null,e.lastEffect=null,e.pendingProps=null,e.memoizedProps=null,e.stateNode=null,null!==t&&Xg(t)}function Jg(e){return 5===e.tag||3===e.tag||4===e.tag}function Kg(e){e:{for(var t=e.return;null!==t;){if(Jg(t)){var n=t;break e}t=t.return}throw Error(Yo(160))}switch(t=n.stateNode,n.tag){case 5:var i=!1;break;case 3:case 4:t=t.containerInfo,i=!0;break;default:throw Error(Yo(161))}16&n.effectTag&&(kc(t,""),n.effectTag&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||Jg(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag&&18!==n.tag;){if(2&n.effectTag)continue t;if(null===n.child||4===n.tag)continue t;n.child.return=n,n=n.child}if(!(2&n.effectTag)){n=n.stateNode;break e}}i?qg(e,n,t):em(e,n,t)}function qg(e,t,n){var i=e.tag,r=5===i||6===i;if(r)e=r?e.stateNode:e.stateNode.instance,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Ju));else if(4!==i&&null!==(e=e.child))for(qg(e,t,n),e=e.sibling;null!==e;)qg(e,t,n),e=e.sibling}function em(e,t,n){var i=e.tag,r=5===i||6===i;if(r)e=r?e.stateNode:e.stateNode.instance,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==i&&null!==(e=e.child))for(em(e,t,n),e=e.sibling;null!==e;)em(e,t,n),e=e.sibling}function tm(e,t,n){for(var i,r,s=t,a=!1;;){if(!a){a=s.return;e:for(;;){if(null===a)throw Error(Yo(160));switch(i=a.stateNode,a.tag){case 5:r=!1;break e;case 3:case 4:i=i.containerInfo,r=!0;break e}a=a.return}a=!0}if(5===s.tag||6===s.tag){e:for(var o=e,l=s,c=n,u=l;;)if(Gg(o,u,c),null!==u.child&&4!==u.tag)u.child.return=u,u=u.child;else{if(u===l)break e;for(;null===u.sibling;){if(null===u.return||u.return===l)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}r?(o=i,l=s.stateNode,8===o.nodeType?o.parentNode.removeChild(l):o.removeChild(l)):i.removeChild(s.stateNode)}else if(4===s.tag){if(null!==s.child){i=s.stateNode.containerInfo,r=!0,s.child.return=s,s=s.child;continue}}else if(Gg(e,s,n),null!==s.child){s.child.return=s,s=s.child;continue}if(s===t)break;for(;null===s.sibling;){if(null===s.return||s.return===t)return;4===(s=s.return).tag&&(a=!1)}s.sibling.return=s.return,s=s.sibling}}function nm(e,t){switch(t.tag){case 0:case 11:case 14:case 15:case 22:return void Fg(3,t);case 1:return;case 5:var n=t.stateNode;if(null!=n){var i=t.memoizedProps,r=null!==e?e.memoizedProps:i;e=t.type;var s=t.updateQueue;if(t.updateQueue=null,null!==s){for(n[fd]=i,"input"===e&&"radio"===i.type&&null!=i.name&&hc(n,i),Yu(e,r),t=Yu(e,i),r=0;r<s.length;r+=2){var a=s[r],o=s[r+1];"style"===a?$u(n,o):"dangerouslySetInnerHTML"===a?Tc(n,o):"children"===a?kc(n,o):Vl(n,a,o,t)}switch(e){case"input":pc(n,i);break;case"textarea":yc(n,i);break;case"select":t=n._wrapperState.wasMultiple,n._wrapperState.wasMultiple=!!i.multiple,null!=(e=i.value)?vc(n,!!i.multiple,e,!1):t!==!!i.multiple&&(null!=i.defaultValue?vc(n,!!i.multiple,i.defaultValue,!0):vc(n,!!i.multiple,i.multiple?[]:"",!1))}}}return;case 6:if(null===t.stateNode)throw Error(Yo(162));return void(t.stateNode.nodeValue=t.memoizedProps);case 3:return void((t=t.stateNode).hydrate&&(t.hydrate=!1,Iu(t.containerInfo)));case 12:return;case 13:if(n=t,null===t.memoizedState?i=!1:(i=!0,n=t.child,Im=Tp()),null!==n)e:for(e=n;;){if(5===e.tag)s=e.stateNode,i?"function"==typeof(s=s.style).setProperty?s.setProperty("display","none","important"):s.display="none":(s=e.stateNode,r=null!=(r=e.memoizedProps.style)&&r.hasOwnProperty("display")?r.display:null,s.style.display=Qu("display",r));else if(6===e.tag)e.stateNode.nodeValue=i?"":e.memoizedProps;else{if(13===e.tag&&null!==e.memoizedState&&null===e.memoizedState.dehydrated){(s=e.child.sibling).return=e,e=s;continue}if(null!==e.child){e.child.return=e,e=e.child;continue}}if(e===n)break;for(;null===e.sibling;){if(null===e.return||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}return void im(t);case 19:return void im(t);case 17:return}throw Error(Yo(163))}function im(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Wg),t.forEach((function(t){var i=dv.bind(null,e,t);n.has(t)||(n.add(t),t.then(i,i))}))}}var rm="function"==typeof WeakMap?WeakMap:Map;function sm(e,t,n){(n=Xp(n,null)).tag=3,n.payload={element:null};var i=t.value;return n.callback=function(){Am||(Am=!0,Tm=i),Hg(e,t)},n}function am(e,t,n){(n=Xp(n,null)).tag=3;var i=e.type.getDerivedStateFromError;if("function"==typeof i){var r=t.value;n.payload=function(){return Hg(e,t),i(r)}}var s=e.stateNode;return null!==s&&"function"==typeof s.componentDidCatch&&(n.callback=function(){"function"!=typeof i&&(null===km?km=new Set([this]):km.add(this),Hg(e,t));var n=t.stack;this.componentDidCatch(t.value,{componentStack:null!==n?n:""})}),n}var om,lm=Math.ceil,cm=Ol.ReactCurrentDispatcher,um=Ol.ReactCurrentOwner,dm=0,hm=3,pm=4,fm=0,gm=null,mm=null,vm=0,bm=dm,wm=null,ym=1073741823,xm=1073741823,Cm=null,Mm=0,Sm=!1,Im=0,Em=null,Am=!1,Tm=null,km=null,Nm=!1,Pm=null,zm=90,Dm=null,Lm=0,Bm=null,jm=0;function Rm(){return 0!=(48&fm)?1073741821-(Tp()/10|0):0!==jm?jm:jm=1073741821-(Tp()/10|0)}function Om(e,t,n){if(0==(2&(t=t.mode)))return 1073741823;var i=kp();if(0==(4&t))return 99===i?1073741823:1073741822;if(0!=(16&fm))return vm;if(null!==n)e=jp(e,0|n.timeoutMs||5e3,250);else switch(i){case 99:e=1073741823;break;case 98:e=jp(e,150,100);break;case 97:case 96:e=jp(e,5e3,250);break;case 95:e=2;break;default:throw Error(Yo(326))}return null!==gm&&e===vm&&--e,e}function Vm(e,t){if(50<Lm)throw Lm=0,Bm=null,Error(Yo(185));if(null!==(e=_m(e,t))){var n=kp();1073741823===t?0!=(8&fm)&&0==(48&fm)?Qm(e):(Wm(e),0===fm&&Lp()):Wm(e),0==(4&fm)||98!==n&&99!==n||(null===Dm?Dm=new Map([[e,t]]):(void 0===(n=Dm.get(e))||n>t)&&Dm.set(e,t))}}function _m(e,t){e.expirationTime<t&&(e.expirationTime=t);var n=e.alternate;null!==n&&n.expirationTime<t&&(n.expirationTime=t);var i=e.return,r=null;if(null===i&&3===e.tag)r=e.stateNode;else for(;null!==i;){if(n=i.alternate,i.childExpirationTime<t&&(i.childExpirationTime=t),null!==n&&n.childExpirationTime<t&&(n.childExpirationTime=t),null===i.return&&3===i.tag){r=i.stateNode;break}i=i.return}return null!==r&&(gm===r&&(Jm(t),bm===pm&&Sv(r,vm)),Iv(r,t)),r}function Um(e){var t=e.lastExpiredTime;if(0!==t)return t;if(!Mv(e,t=e.firstPendingTime))return t;var n=e.lastPingedTime;return 2>=(e=n>(e=e.nextKnownPendingLevel)?n:e)&&t!==e?0:e}function Wm(e){if(0!==e.lastExpiredTime)e.callbackExpirationTime=1073741823,e.callbackPriority=99,e.callbackNode=Dp(Qm.bind(null,e));else{var t=Um(e),n=e.callbackNode;if(0===t)null!==n&&(e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90);else{var i=Rm();if(1073741823===t?i=99:1===t||2===t?i=95:i=0>=(i=10*(1073741821-t)-10*(1073741821-i))?99:250>=i?98:5250>=i?97:95,null!==n){var r=e.callbackPriority;if(e.callbackExpirationTime===t&&r>=i)return;n!==xp&&hp(n)}e.callbackExpirationTime=t,e.callbackPriority=i,t=1073741823===t?Dp(Qm.bind(null,e)):zp(i,Hm.bind(null,e),{timeout:10*(1073741821-t)-Tp()}),e.callbackNode=t}}}function Hm(e,t){if(jm=0,t)return Ev(e,t=Rm()),Wm(e),null;var n=Um(e);if(0!==n){if(t=e.callbackNode,0!=(48&fm))throw Error(Yo(327));if(av(),e===gm&&n===vm||Zm(e,n),null!==mm){var i=fm;fm|=16;for(var r=Gm();;)try{qm();break}catch(o){Ym(e,o)}if(Wp(),fm=i,cm.current=r,1===bm)throw t=wm,Zm(e,n),Sv(e,n),Wm(e),t;if(null===mm)switch(r=e.finishedWork=e.current.alternate,e.finishedExpirationTime=n,i=bm,gm=null,i){case dm:case 1:throw Error(Yo(345));case 2:Ev(e,2<n?2:n);break;case hm:if(Sv(e,n),n===(i=e.lastSuspendedTime)&&(e.nextKnownPendingLevel=nv(r)),1073741823===ym&&10<(r=Im+500-Tp())){if(Sm){var s=e.lastPingedTime;if(0===s||s>=n){e.lastPingedTime=n,Zm(e,n);break}}if(0!==(s=Um(e))&&s!==n)break;if(0!==i&&i!==n){e.lastPingedTime=i;break}e.timeoutHandle=ld(iv.bind(null,e),r);break}iv(e);break;case pm:if(Sv(e,n),n===(i=e.lastSuspendedTime)&&(e.nextKnownPendingLevel=nv(r)),Sm&&(0===(r=e.lastPingedTime)||r>=n)){e.lastPingedTime=n,Zm(e,n);break}if(0!==(r=Um(e))&&r!==n)break;if(0!==i&&i!==n){e.lastPingedTime=i;break}if(1073741823!==xm?i=10*(1073741821-xm)-Tp():1073741823===ym?i=0:(i=10*(1073741821-ym)-5e3,0>(i=(r=Tp())-i)&&(i=0),(n=10*(1073741821-n)-r)<(i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*lm(i/1960))-i)&&(i=n)),10<i){e.timeoutHandle=ld(iv.bind(null,e),i);break}iv(e);break;case 5:if(1073741823!==ym&&null!==Cm){s=ym;var a=Cm;if(0>=(i=0|a.busyMinDurationMs)?i=0:(r=0|a.busyDelayMs,i=(s=Tp()-(10*(1073741821-s)-(0|a.timeoutMs||5e3)))<=r?0:r+i-s),10<i){Sv(e,n),e.timeoutHandle=ld(iv.bind(null,e),i);break}}iv(e);break;default:throw Error(Yo(329))}if(Wm(e),e.callbackNode===t)return Hm.bind(null,e)}}return null}function Qm(e){var t=e.lastExpiredTime;if(t=0!==t?t:1073741823,0!=(48&fm))throw Error(Yo(327));if(av(),e===gm&&t===vm||Zm(e,t),null!==mm){var n=fm;fm|=16;for(var i=Gm();;)try{Km();break}catch(Pb){Ym(e,Pb)}if(Wp(),fm=n,cm.current=i,1===bm)throw n=wm,Zm(e,t),Sv(e,t),Wm(e),n;if(null!==mm)throw Error(Yo(261));e.finishedWork=e.current.alternate,e.finishedExpirationTime=t,gm=null,iv(e),Wm(e)}return null}function $m(e,t){var n=fm;fm|=1;try{return e(t)}finally{0===(fm=n)&&Lp()}}function Fm(e,t){var n=fm;fm&=-2,fm|=8;try{return e(t)}finally{0===(fm=n)&&Lp()}}function Zm(e,t){e.finishedWork=null,e.finishedExpirationTime=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,cd(n)),null!==mm)for(n=mm.return;null!==n;){var i=n;switch(i.tag){case 1:null!=(i=i.type.childContextTypes)&&sp();break;case 3:Cf(),Jh(tp),Jh(ep);break;case 5:Sf(i);break;case 4:Cf();break;case 13:case 19:Jh(If);break;case 10:Hp(i)}n=n.return}gm=e,mm=vv(e.current,null),vm=t,bm=dm,wm=null,xm=ym=1073741823,Cm=null,Mm=0,Sm=!1}function Ym(e,t){for(;;){try{if(Wp(),Tf.current=sg,Lf)for(var n=Pf.memoizedState;null!==n;){var i=n.queue;null!==i&&(i.pending=null),n=n.next}if(Nf=0,Df=zf=Pf=null,Lf=!1,null===mm||null===mm.return)return bm=1,wm=t,mm=null;e:{var r=e,s=mm.return,a=mm,o=t;if(t=vm,a.effectTag|=2048,a.firstEffect=a.lastEffect=null,null!==o&&"object"==typeof o&&"function"==typeof o.then){var l=o;if(0==(2&a.mode)){var c=a.alternate;c?(a.updateQueue=c.updateQueue,a.memoizedState=c.memoizedState,a.expirationTime=c.expirationTime):(a.updateQueue=null,a.memoizedState=null)}var u=0!=(1&If.current),d=s;do{var h;if(h=13===d.tag){var p=d.memoizedState;if(null!==p)h=null!==p.dehydrated;else{var f=d.memoizedProps;h=void 0!==f.fallback&&(!0!==f.unstable_avoidThisFallback||!u)}}if(h){var g=d.updateQueue;if(null===g){var m=new Set;m.add(l),d.updateQueue=m}else g.add(l);if(0==(2&d.mode)){if(d.effectTag|=64,a.effectTag&=-2981,1===a.tag)if(null===a.alternate)a.tag=17;else{var v=Xp(1073741823,null);v.tag=2,Jp(a,v)}a.expirationTime=1073741823;break e}o=void 0,a=t;var b=r.pingCache;if(null===b?(b=r.pingCache=new rm,o=new Set,b.set(l,o)):void 0===(o=b.get(l))&&(o=new Set,b.set(l,o)),!o.has(a)){o.add(a);var w=uv.bind(null,r,l,a);l.then(w,w)}d.effectTag|=4096,d.expirationTime=t;break e}d=d.return}while(null!==d);o=Error((rc(a.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display."+sc(a))}5!==bm&&(bm=2),o=Ug(o,a),d=s;do{switch(d.tag){case 3:l=o,d.effectTag|=4096,d.expirationTime=t,Kp(d,sm(d,l,t));break e;case 1:l=o;var y=d.type,x=d.stateNode;if(0==(64&d.effectTag)&&("function"==typeof y.getDerivedStateFromError||null!==x&&"function"==typeof x.componentDidCatch&&(null===km||!km.has(x)))){d.effectTag|=4096,d.expirationTime=t,Kp(d,am(d,l,t));break e}}d=d.return}while(null!==d)}mm=tv(mm)}catch(C){t=C;continue}break}}function Gm(){var e=cm.current;return cm.current=sg,null===e?sg:e}function Xm(e,t){e<ym&&2<e&&(ym=e),null!==t&&e<xm&&2<e&&(xm=e,Cm=t)}function Jm(e){e>Mm&&(Mm=e)}function Km(){for(;null!==mm;)mm=ev(mm)}function qm(){for(;null!==mm&&!Cp();)mm=ev(mm)}function ev(e){var t=om(e.alternate,e,vm);return e.memoizedProps=e.pendingProps,null===t&&(t=tv(e)),um.current=null,t}function tv(e){mm=e;do{var t=mm.alternate;if(e=mm.return,0==(2048&mm.effectTag)){if(t=Vg(t,mm,vm),1===vm||1!==mm.childExpirationTime){for(var n=0,i=mm.child;null!==i;){var r=i.expirationTime,s=i.childExpirationTime;r>n&&(n=r),s>n&&(n=s),i=i.sibling}mm.childExpirationTime=n}if(null!==t)return t;null!==e&&0==(2048&e.effectTag)&&(null===e.firstEffect&&(e.firstEffect=mm.firstEffect),null!==mm.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=mm.firstEffect),e.lastEffect=mm.lastEffect),1<mm.effectTag&&(null!==e.lastEffect?e.lastEffect.nextEffect=mm:e.firstEffect=mm,e.lastEffect=mm))}else{if(null!==(t=_g(mm)))return t.effectTag&=2047,t;null!==e&&(e.firstEffect=e.lastEffect=null,e.effectTag|=2048)}if(null!==(t=mm.sibling))return t;mm=e}while(null!==mm);return bm===dm&&(bm=5),null}function nv(e){var t=e.expirationTime;return t>(e=e.childExpirationTime)?t:e}function iv(e){var t=kp();return Pp(99,rv.bind(null,e,t)),null}function rv(e,t){do{av()}while(null!==Pm);if(0!=(48&fm))throw Error(Yo(327));var n=e.finishedWork,i=e.finishedExpirationTime;if(null===n)return null;if(e.finishedWork=null,e.finishedExpirationTime=0,n===e.current)throw Error(Yo(177));e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90,e.nextKnownPendingLevel=0;var r=nv(n);if(e.firstPendingTime=r,i<=e.lastSuspendedTime?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:i<=e.firstSuspendedTime&&(e.firstSuspendedTime=i-1),i<=e.lastPingedTime&&(e.lastPingedTime=0),i<=e.lastExpiredTime&&(e.lastExpiredTime=0),e===gm&&(mm=gm=null,vm=0),1<n.effectTag?null!==n.lastEffect?(n.lastEffect.nextEffect=n,r=n.firstEffect):r=n:r=n.firstEffect,null!==r){var s=fm;fm|=32,um.current=null,rd=Bu;var a=nd();if(id(a)){if("selectionStart"in a)var o={start:a.selectionStart,end:a.selectionEnd};else e:{var l=(o=(o=a.ownerDocument)&&o.defaultView||window).getSelection&&o.getSelection();if(l&&0!==l.rangeCount){o=l.anchorNode;var c=l.anchorOffset,u=l.focusNode;l=l.focusOffset;try{o.nodeType,u.nodeType}catch(I){o=null;break e}var d=0,h=-1,p=-1,f=0,g=0,m=a,v=null;t:for(;;){for(var b;m!==o||0!==c&&3!==m.nodeType||(h=d+c),m!==u||0!==l&&3!==m.nodeType||(p=d+l),3===m.nodeType&&(d+=m.nodeValue.length),null!==(b=m.firstChild);)v=m,m=b;for(;;){if(m===a)break t;if(v===o&&++f===c&&(h=d),v===u&&++g===l&&(p=d),null!==(b=m.nextSibling))break;v=(m=v).parentNode}m=b}o=-1===h||-1===p?null:{start:h,end:p}}else o=null}o=o||{start:0,end:0}}else o=null;sd={activeElementDetached:null,focusedElem:a,selectionRange:o},Bu=!1,Em=r;do{try{sv()}catch(I){if(null===Em)throw Error(Yo(330));cv(Em,I),Em=Em.nextEffect}}while(null!==Em);Em=r;do{try{for(a=e,o=t;null!==Em;){var w=Em.effectTag;if(16&w&&kc(Em.stateNode,""),128&w){var y=Em.alternate;if(null!==y){var x=y.ref;null!==x&&("function"==typeof x?x(null):x.current=null)}}switch(1038&w){case 2:Kg(Em),Em.effectTag&=-3;break;case 6:Kg(Em),Em.effectTag&=-3,nm(Em.alternate,Em);break;case 1024:Em.effectTag&=-1025;break;case 1028:Em.effectTag&=-1025,nm(Em.alternate,Em);break;case 4:nm(Em.alternate,Em);break;case 8:tm(a,c=Em,o),Xg(c)}Em=Em.nextEffect}}catch(I){if(null===Em)throw Error(Yo(330));cv(Em,I),Em=Em.nextEffect}}while(null!==Em);if(x=sd,y=nd(),w=x.focusedElem,o=x.selectionRange,y!==w&&w&&w.ownerDocument&&td(w.ownerDocument.documentElement,w)){null!==o&&id(w)&&(y=o.start,void 0===(x=o.end)&&(x=y),"selectionStart"in w?(w.selectionStart=y,w.selectionEnd=Math.min(x,w.value.length)):(x=(y=w.ownerDocument||document)&&y.defaultView||window).getSelection&&(x=x.getSelection(),c=w.textContent.length,a=Math.min(o.start,c),o=void 0===o.end?a:Math.min(o.end,c),!x.extend&&a>o&&(c=o,o=a,a=c),c=ed(w,a),u=ed(w,o),c&&u&&(1!==x.rangeCount||x.anchorNode!==c.node||x.anchorOffset!==c.offset||x.focusNode!==u.node||x.focusOffset!==u.offset)&&((y=y.createRange()).setStart(c.node,c.offset),x.removeAllRanges(),a>o?(x.addRange(y),x.extend(u.node,u.offset)):(y.setEnd(u.node,u.offset),x.addRange(y))))),y=[];for(x=w;x=x.parentNode;)1===x.nodeType&&y.push({element:x,left:x.scrollLeft,top:x.scrollTop});for("function"==typeof w.focus&&w.focus(),w=0;w<y.length;w++)(x=y[w]).element.scrollLeft=x.left,x.element.scrollTop=x.top}Bu=!!rd,sd=rd=null,e.current=n,Em=r;do{try{for(w=e;null!==Em;){var C=Em.effectTag;if(36&C&&Yg(w,Em.alternate,Em),128&C){y=void 0;var M=Em.ref;if(null!==M){var S=Em.stateNode;switch(Em.tag){case 5:y=S;break;default:y=S}"function"==typeof M?M(y):M.current=y}}Em=Em.nextEffect}}catch(I){if(null===Em)throw Error(Yo(330));cv(Em,I),Em=Em.nextEffect}}while(null!==Em);Em=null,Mp(),fm=s}else e.current=n;if(Nm)Nm=!1,Pm=e,zm=t;else for(Em=r;null!==Em;)t=Em.nextEffect,Em.nextEffect=null,Em=t;if(0===(t=e.firstPendingTime)&&(km=null),1073741823===t?e===Bm?Lm++:(Lm=0,Bm=e):Lm=0,"function"==typeof hv&&hv(n.stateNode,i),Wm(e),Am)throw Am=!1,e=Tm,Tm=null,e;return 0!=(8&fm)||Lp(),null}function sv(){for(;null!==Em;){var e=Em.effectTag;0!=(256&e)&&$g(Em.alternate,Em),0==(512&e)||Nm||(Nm=!0,zp(97,(function(){return av(),null}))),Em=Em.nextEffect}}function av(){if(90!==zm){var e=97<zm?97:zm;return zm=90,Pp(e,ov)}}function ov(){if(null===Pm)return!1;var e=Pm;if(Pm=null,0!=(48&fm))throw Error(Yo(331));var t=fm;for(fm|=32,e=e.current.firstEffect;null!==e;){try{var n=e;if(0!=(512&n.effectTag))switch(n.tag){case 0:case 11:case 15:case 22:Fg(5,n),Zg(5,n)}}catch(i){if(null===e)throw Error(Yo(330));cv(e,i)}n=e.nextEffect,e.nextEffect=null,e=n}return fm=t,Lp(),!0}function lv(e,t,n){Jp(e,t=sm(e,t=Ug(n,t),1073741823)),null!==(e=_m(e,1073741823))&&Wm(e)}function cv(e,t){if(3===e.tag)lv(e,e,t);else for(var n=e.return;null!==n;){if(3===n.tag){lv(n,e,t);break}if(1===n.tag){var i=n.stateNode;if("function"==typeof n.type.getDerivedStateFromError||"function"==typeof i.componentDidCatch&&(null===km||!km.has(i))){Jp(n,e=am(n,e=Ug(t,e),1073741823)),null!==(n=_m(n,1073741823))&&Wm(n);break}}n=n.return}}function uv(e,t,n){var i=e.pingCache;null!==i&&i.delete(t),gm===e&&vm===n?bm===pm||bm===hm&&1073741823===ym&&Tp()-Im<500?Zm(e,vm):Sm=!0:Mv(e,n)&&(0!==(t=e.lastPingedTime)&&t<n||(e.lastPingedTime=n,Wm(e)))}function dv(e,t){var n=e.stateNode;null!==n&&n.delete(t),0===(t=0)&&(t=Om(t=Rm(),e,null)),null!==(e=_m(e,t))&&Wm(e)}om=function(e,t,n){var i=t.expirationTime;if(null!==e){var r=t.pendingProps;if(e.memoizedProps!==r||tp.current)wg=!0;else{if(i<n){switch(wg=!1,t.tag){case 3:Tg(t),vg();break;case 5:if(Mf(t),4&t.mode&&1!==n&&r.hidden)return t.expirationTime=t.childExpirationTime=1,null;break;case 1:rp(t.type)&&lp(t);break;case 4:xf(t,t.stateNode.containerInfo);break;case 10:i=t.memoizedProps.value,r=t.type._context,Kh(Op,r._currentValue),r._currentValue=i;break;case 13:if(null!==t.memoizedState)return 0!==(i=t.child.childExpirationTime)&&i>=n?Dg(e,t,n):(Kh(If,1&If.current),null!==(t=Rg(e,t,n))?t.sibling:null);Kh(If,1&If.current);break;case 19:if(i=t.childExpirationTime>=n,0!=(64&e.effectTag)){if(i)return jg(e,t,n);t.effectTag|=64}if(null!==(r=t.memoizedState)&&(r.rendering=null,r.tail=null),Kh(If,If.current),!i)return null}return Rg(e,t,n)}wg=!1}}else wg=!1;switch(t.expirationTime=0,t.tag){case 2:if(i=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,r=ip(t,ep.current),$p(t,n),r=Rf(null,t,i,e,r,n),t.effectTag|=1,"object"==typeof r&&null!==r&&"function"==typeof r.render&&void 0===r.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,rp(i)){var s=!0;lp(t)}else s=!1;t.memoizedState=null!==r.state&&void 0!==r.state?r.state:null,Yp(t);var a=i.getDerivedStateFromProps;"function"==typeof a&&rf(t,i,a,e),r.updater=sf,t.stateNode=r,r._reactInternalFiber=t,cf(t,i,e,n),t=Ag(null,t,i,!0,s,n)}else t.tag=0,yg(null,t,r,n),t=t.child;return t;case 16:e:{if(r=t.elementType,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,function(e){if(-1===e._status){e._status=0;var t=e._ctor;t=t(),e._result=t,t.then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)}))}}(r),1!==r._status)throw r._result;switch(r=r._result,t.type=r,s=t.tag=function(e){if("function"==typeof e)return mv(e)?1:0;if(null!=e){if((e=e.$$typeof)===Xl)return 11;if(e===ql)return 14}return 2}(r),e=Rp(r,e),s){case 0:t=Ig(null,t,r,e,n);break e;case 1:t=Eg(null,t,r,e,n);break e;case 11:t=xg(null,t,r,e,n);break e;case 14:t=Cg(null,t,r,Rp(r.type,e),i,n);break e}throw Error(Yo(306,r,""))}return t;case 0:return i=t.type,r=t.pendingProps,Ig(e,t,i,r=t.elementType===i?r:Rp(i,r),n);case 1:return i=t.type,r=t.pendingProps,Eg(e,t,i,r=t.elementType===i?r:Rp(i,r),n);case 3:if(Tg(t),i=t.updateQueue,null===e||null===i)throw Error(Yo(282));if(i=t.pendingProps,r=null!==(r=t.memoizedState)?r.element:null,Gp(e,t),qp(t,i,null,n),(i=t.memoizedState.element)===r)vg(),t=Rg(e,t,n);else{if((r=t.stateNode.hydrate)&&(ug=ud(t.stateNode.containerInfo.firstChild),cg=t,r=dg=!0),r)for(n=gf(t,null,i,n),t.child=n;n;)n.effectTag=-3&n.effectTag|1024,n=n.sibling;else yg(e,t,i,n),vg();t=t.child}return t;case 5:return Mf(t),null===e&&fg(t),i=t.type,r=t.pendingProps,s=null!==e?e.memoizedProps:null,a=r.children,od(i,r)?a=null:null!==s&&od(i,s)&&(t.effectTag|=16),Sg(e,t),4&t.mode&&1!==n&&r.hidden?(t.expirationTime=t.childExpirationTime=1,t=null):(yg(e,t,a,n),t=t.child),t;case 6:return null===e&&fg(t),null;case 13:return Dg(e,t,n);case 4:return xf(t,t.stateNode.containerInfo),i=t.pendingProps,null===e?t.child=ff(t,null,i,n):yg(e,t,i,n),t.child;case 11:return i=t.type,r=t.pendingProps,xg(e,t,i,r=t.elementType===i?r:Rp(i,r),n);case 7:return yg(e,t,t.pendingProps,n),t.child;case 8:case 12:return yg(e,t,t.pendingProps.children,n),t.child;case 10:e:{i=t.type._context,r=t.pendingProps,a=t.memoizedProps,s=r.value;var o=t.type._context;if(Kh(Op,o._currentValue),o._currentValue=s,null!==a)if(o=a.value,0===(s=Eh(o,s)?0:0|("function"==typeof i._calculateChangedBits?i._calculateChangedBits(o,s):1073741823))){if(a.children===r.children&&!tp.current){t=Rg(e,t,n);break e}}else for(null!==(o=t.child)&&(o.return=t);null!==o;){var l=o.dependencies;if(null!==l){a=o.child;for(var c=l.firstContext;null!==c;){if(c.context===i&&0!=(c.observedBits&s)){1===o.tag&&((c=Xp(n,null)).tag=2,Jp(o,c)),o.expirationTime<n&&(o.expirationTime=n),null!==(c=o.alternate)&&c.expirationTime<n&&(c.expirationTime=n),Qp(o.return,n),l.expirationTime<n&&(l.expirationTime=n);break}c=c.next}}else a=10===o.tag&&o.type===t.type?null:o.child;if(null!==a)a.return=o;else for(a=o;null!==a;){if(a===t){a=null;break}if(null!==(o=a.sibling)){o.return=a.return,a=o;break}a=a.return}o=a}yg(e,t,r.children,n),t=t.child}return t;case 9:return r=t.type,i=(s=t.pendingProps).children,$p(t,n),i=i(r=Fp(r,s.unstable_observedBits)),t.effectTag|=1,yg(e,t,i,n),t.child;case 14:return s=Rp(r=t.type,t.pendingProps),Cg(e,t,r,s=Rp(r.type,s),i,n);case 15:return Mg(e,t,t.type,t.pendingProps,i,n);case 17:return i=t.type,r=t.pendingProps,r=t.elementType===i?r:Rp(i,r),null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),t.tag=1,rp(i)?(e=!0,lp(t)):e=!1,$p(t,n),of(t,i,r),cf(t,i,r,n),Ag(null,t,i,!0,e,n);case 19:return jg(e,t,n)}throw Error(Yo(156,t.tag))};var hv=null,pv=null;function fv(e,t,n,i){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.effectTag=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childExpirationTime=this.expirationTime=0,this.alternate=null}function gv(e,t,n,i){return new fv(e,t,n,i)}function mv(e){return!(!(e=e.prototype)||!e.isReactComponent)}function vv(e,t){var n=e.alternate;return null===n?((n=gv(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.effectTag=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childExpirationTime=e.childExpirationTime,n.expirationTime=e.expirationTime,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{expirationTime:t.expirationTime,firstContext:t.firstContext,responders:t.responders},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function bv(e,t,n,i,r,s){var a=2;if(i=e,"function"==typeof e)mv(e)&&(a=1);else if("string"==typeof e)a=5;else e:switch(e){case Ql:return wv(n.children,r,s,t);case Gl:a=8,r|=7;break;case $l:a=8,r|=1;break;case Fl:return(e=gv(12,n,t,8|r)).elementType=Fl,e.type=Fl,e.expirationTime=s,e;case Jl:return(e=gv(13,n,t,r)).type=Jl,e.elementType=Jl,e.expirationTime=s,e;case Kl:return(e=gv(19,n,t,r)).elementType=Kl,e.expirationTime=s,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case Zl:a=10;break e;case Yl:a=9;break e;case Xl:a=11;break e;case ql:a=14;break e;case ec:a=16,i=null;break e;case tc:a=22;break e}throw Error(Yo(130,null==e?e:typeof e,""))}return(t=gv(a,n,t,r)).elementType=e,t.type=i,t.expirationTime=s,t}function wv(e,t,n,i){return(e=gv(7,e,i,t)).expirationTime=n,e}function yv(e,t,n){return(e=gv(6,e,null,t)).expirationTime=n,e}function xv(e,t,n){return(t=gv(4,null!==e.children?e.children:[],e.key,t)).expirationTime=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Cv(e,t,n){this.tag=t,this.current=null,this.containerInfo=e,this.pingCache=this.pendingChildren=null,this.finishedExpirationTime=0,this.finishedWork=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=n,this.callbackNode=null,this.callbackPriority=90,this.lastExpiredTime=this.lastPingedTime=this.nextKnownPendingLevel=this.lastSuspendedTime=this.firstSuspendedTime=this.firstPendingTime=0}function Mv(e,t){var n=e.firstSuspendedTime;return e=e.lastSuspendedTime,0!==n&&n>=t&&e<=t}function Sv(e,t){var n=e.firstSuspendedTime,i=e.lastSuspendedTime;n<t&&(e.firstSuspendedTime=t),(i>t||0===n)&&(e.lastSuspendedTime=t),t<=e.lastPingedTime&&(e.lastPingedTime=0),t<=e.lastExpiredTime&&(e.lastExpiredTime=0)}function Iv(e,t){t>e.firstPendingTime&&(e.firstPendingTime=t);var n=e.firstSuspendedTime;0!==n&&(t>=n?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:t>=e.lastSuspendedTime&&(e.lastSuspendedTime=t+1),t>e.nextKnownPendingLevel&&(e.nextKnownPendingLevel=t))}function Ev(e,t){var n=e.lastExpiredTime;(0===n||n>t)&&(e.lastExpiredTime=t)}function Av(e,t,n,i){var r=t.current,s=Rm(),a=tf.suspense;s=Om(s,r,a);e:if(n){t:{if(Wc(n=n._reactInternalFiber)!==n||1!==n.tag)throw Error(Yo(170));var o=n;do{switch(o.tag){case 3:o=o.stateNode.context;break t;case 1:if(rp(o.type)){o=o.stateNode.__reactInternalMemoizedMergedChildContext;break t}}o=o.return}while(null!==o);throw Error(Yo(171))}if(1===n.tag){var l=n.type;if(rp(l)){n=op(n,l,o);break e}}n=o}else n=qh;return null===t.context?t.context=n:t.pendingContext=n,(t=Xp(s,a)).payload={element:e},null!==(i=void 0===i?null:i)&&(t.callback=i),Jp(r,t),Vm(r,s),s}function Tv(e){if(!(e=e.current).child)return null;switch(e.child.tag){case 5:default:return e.child.stateNode}}function kv(e,t){null!==(e=e.memoizedState)&&null!==e.dehydrated&&e.retryTime<t&&(e.retryTime=t)}function Nv(e,t){kv(e,t),(e=e.alternate)&&kv(e,t)}function Pv(e,t,n){var i=new Cv(e,t,n=null!=n&&!0===n.hydrate),r=gv(3,null,null,2===t?7:1===t?3:0);i.current=r,r.stateNode=i,Yp(r),e[gd]=i.current,n&&0!==t&&function(e,t){var n=Uc(t);gu.forEach((function(e){iu(e,t,n)})),mu.forEach((function(e){iu(e,t,n)}))}(0,9===e.nodeType?e:e.ownerDocument),this._internalRoot=i}function zv(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Dv(e,t,n,i,r){var s=n._reactRootContainer;if(s){var a=s._internalRoot;if("function"==typeof r){var o=r;r=function(){var e=Tv(a);o.call(e)}}Av(t,a,e,r)}else{if(s=n._reactRootContainer=function(e,t){if(t||(t=!(!(t=e?9===e.nodeType?e.documentElement:e.firstChild:null)||1!==t.nodeType||!t.hasAttribute("data-reactroot"))),!t)for(var n;n=e.lastChild;)e.removeChild(n);return new Pv(e,0,t?{hydrate:!0}:void 0)}(n,i),a=s._internalRoot,"function"==typeof r){var l=r;r=function(){var e=Tv(a);l.call(e)}}Fm((function(){Av(t,a,e,r)}))}return Tv(a)}function Lv(e,t,n){var i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:Hl,key:null==i?null:""+i,children:e,containerInfo:t,implementation:n}}function Bv(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!zv(t))throw Error(Yo(200));return Lv(e,t,null,n)}Pv.prototype.render=function(e){Av(e,this._internalRoot,null,null)},Pv.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;Av(null,e,null,(function(){t[gd]=null}))},ru=function(e){if(13===e.tag){var t=jp(Rm(),150,100);Vm(e,t),Nv(e,t)}},su=function(e){13===e.tag&&(Vm(e,3),Nv(e,3))},au=function(e){if(13===e.tag){var t=Rm();Vm(e,t=Om(t,e,null)),Nv(e,t)}},ml=function(e,t,n){switch(t){case"input":if(pc(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var r=wd(i);if(!r)throw Error(Yo(90));cc(i),pc(i,r)}}}break;case"textarea":yc(e,n);break;case"select":null!=(t=n.value)&&vc(e,!!n.multiple,t,!1)}},Cl=$m,Ml=function(e,t,n,i,r){var s=fm;fm|=4;try{return Pp(98,e.bind(null,t,n,i,r))}finally{0===(fm=s)&&Lp()}},Sl=function(){0==(49&fm)&&(function(){if(null!==Dm){var e=Dm;Dm=null,e.forEach((function(e,t){Ev(t,e),Wm(t)})),Lp()}}(),av())},Il=function(e,t){var n=fm;fm|=2;try{return e(t)}finally{0===(fm=n)&&Lp()}};var jv={Events:[vd,bd,wd,fl,dl,Ed,function(e){Zc(e,Id)},yl,xl,_u,Xc,av,{current:!1}]};!function(e){var t=e.findFiberByHostInstance;(function(e){if("undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)return!0;try{var n=t.inject(e);hv=function(e){try{t.onCommitFiberRoot(n,e,void 0,64==(64&e.current.effectTag))}catch(Pb){}},pv=function(e){try{t.onCommitFiberUnmount(n,e)}catch(Pb){}}}catch(i){}})(Fo({},e,{overrideHookState:null,overrideProps:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ol.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=$c(e))?null:e.stateNode},findFiberByHostInstance:function(e){return t?t(e):null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null}))}({findFiberByHostInstance:md,bundleType:0,version:"16.14.0",rendererPackageName:"react-dom"}),Wo.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=jv,Wo.createPortal=Bv,Wo.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternalFiber;if(void 0===t){if("function"==typeof e.render)throw Error(Yo(188));throw Error(Yo(268,Object.keys(e)))}return e=null===(e=$c(t))?null:e.stateNode},Wo.flushSync=function(e,t){if(0!=(48&fm))throw Error(Yo(187));var n=fm;fm|=1;try{return Pp(99,e.bind(null,t))}finally{fm=n,Lp()}},Wo.hydrate=function(e,t,n){if(!zv(t))throw Error(Yo(200));return Dv(null,e,t,!0,n)},Wo.render=function(e,t,n){if(!zv(t))throw Error(Yo(200));return Dv(null,e,t,!1,n)},Wo.unmountComponentAtNode=function(e){if(!zv(e))throw Error(Yo(40));return!!e._reactRootContainer&&(Fm((function(){Dv(null,null,e,!1,(function(){e._reactRootContainer=null,e[gd]=null}))})),!0)},Wo.unstable_batchedUpdates=$m,Wo.unstable_createPortal=function(e,t){return Bv(e,t,2<arguments.length&&void 0!==arguments[2]?arguments[2]:null)},Wo.unstable_renderSubtreeIntoContainer=function(e,t,n,i){if(!zv(n))throw Error(Yo(200));if(null==e||void 0===e._reactInternalFiber)throw Error(Yo(38));return Dv(e,t,n,!1,i)},Wo.version="16.14.0",function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),Uo.exports=Wo;var Rv=Uo.exports,Ov=Object.defineProperty,Vv=Object.defineProperties,_v=Object.getOwnPropertyDescriptors,Uv=Object.getOwnPropertySymbols,Wv=Object.prototype.hasOwnProperty,Hv=Object.prototype.propertyIsEnumerable,Qv=(e,t,n)=>t in e?Ov(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,$v=(e,t)=>{for(var n in t||(t={}))Wv.call(t,n)&&Qv(e,n,t[n]);if(Uv)for(var n of Uv(t))Hv.call(t,n)&&Qv(e,n,t[n]);return e};const Fv={src:"",currentTime:0,hostTime:0,muted:!1,paused:!0,volume:1},Zv={currentTimeMaxError:1,syncInterval:1e3,retryInterval:15e3,verbose:!1,log:console.log.bind(console)};let Yv=Zv;function Gv(e,t){if(e.paused)return e.currentTime;const n=(i=t).player?i.player.beginTimestamp+i.player.progressTime:i.room?i.room.calibrationTimestamp:void 0;var i;return n?e.currentTime+(n-e.hostTime)/1e3:e.currentTime}const Xv=navigator.userAgent.includes("Safari"),Jv=[".aac",".mid",".midi",".mp3",".ogg",".oga",".wav",".weba"];var Kv="object"==typeof global&&global&&global.Object===Object&&global,qv="object"==typeof self&&self&&self.Object===Object&&self,eb=Kv||qv||Function("return this")(),tb=eb.Symbol,nb=Object.prototype,ib=nb.hasOwnProperty,rb=nb.toString,sb=tb?tb.toStringTag:void 0,ab=Object.prototype.toString,ob=tb?tb.toStringTag:void 0;var lb=/\s/,cb=/^\s+/;function ub(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var db=/^[-+]0x[0-9a-f]+$/i,hb=/^0b[01]+$/i,pb=/^0o[0-7]+$/i,fb=parseInt;function gb(e){if("number"==typeof e)return e;if("symbol"==typeof(t=e)||null!=(n=t)&&"object"==typeof n&&"[object Symbol]"==function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":ob&&ob in Object(e)?function(e){var t=ib.call(e,sb),n=e[sb];try{e[sb]=void 0;var i=!0}catch(s){}var r=rb.call(e);return i&&(t?e[sb]=n:delete e[sb]),r}(e):(t=e,ab.call(t));var t}(t))return NaN;var t,n;if(ub(e)){var i="function"==typeof e.valueOf?e.valueOf():e;e=ub(i)?i+"":i}if("string"!=typeof e)return 0===e?e:+e;e=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&lb.test(e.charAt(t)););return t}(e)+1).replace(cb,""):e}(e);var r=hb.test(e);return r||pb.test(e)?fb(e.slice(2),r?2:8):db.test(e)?NaN:+e}var mb=function(){return eb.Date.now()},vb=Math.max,bb=Math.min;function wb(e,t,n){var i,r,s,a,o,l,c=0,u=!1,d=!1,h=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var n=i,s=r;return i=r=void 0,c=t,a=e.apply(s,n)}function f(e){return c=e,o=setTimeout(m,t),u?p(e):a}function g(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-c>=s}function m(){var e,n,i=mb();if(g(i))return v(i);o=setTimeout(m,(n=t-((e=i)-l),d?bb(n,s-(e-c)):n))}function v(e){return o=void 0,h&&i?p(e):(i=r=void 0,a)}function b(){var e=mb(),n=g(e);if(i=arguments,r=this,l=e,n){if(void 0===o)return f(l);if(d)return clearTimeout(o),o=setTimeout(m,t),p(l)}return void 0===o&&(o=setTimeout(m,t)),a}return t=gb(t)||0,ub(n)&&(u=!!n.leading,s=(d="maxWait"in n)?vb(gb(n.maxWait)||0,t):s,h="trailing"in n?!!n.trailing:h),b.cancel=function(){void 0!==o&&clearTimeout(o),c=0,i=l=r=o=void 0},b.flush=function(){return void 0===o?a:v(mb())},b}class yb extends et.exports.Component{constructor(e){super(e),this.seeking=!1,this.mobileSeeking=!1,this.track=null,this.hoverTime=null,this.offset=0,this.secondsPrefix="00:00:",this.minutesPrefix="00:",this.seekPause=!1,this.handleTouchSeeking=e=>{let t=0;for(let n=0;n<e.changedTouches.length;n++)t=e.changedTouches[n].pageX;t=t<0?0:t,this.mobileSeeking&&this.changeCurrentTimePosition(t)},this.handleSeeking=e=>{this.seeking&&this.changeCurrentTimePosition(e.pageX)},this.setTrackWidthState=()=>{this.track&&this.setState({trackWidth:this.track.offsetWidth})},this.handleTrackHover=(e,t)=>{if(this.track){const n=this.props.scale||1;let i;i=e?0:(t.pageX-this.track.getBoundingClientRect().left)/n,this.setState({seekHoverPosition:i,trackWidth:this.track.offsetWidth})}},this.mouseSeekingHandler=e=>{this.setSeeking(!1,e),this.onMouseUp()},this.setSeeking=(e,t)=>{t.preventDefault(),this.handleSeeking(t),this.seeking=e,this.setState({seekHoverPosition:e?this.state.seekHoverPosition:0})},this.mobileTouchSeekingHandler=()=>{this.setMobileSeeking(!1)},this.setMobileSeeking=e=>{this.mobileSeeking=e,this.setState({seekHoverPosition:e?this.state.seekHoverPosition:0})},this.renderBufferProgress=()=>{if(this.props.buffered){const e=$v($v({},this.getPositionStyle(this.props.buffered)),this.props.bufferColor&&{backgroundColor:this.props.bufferColor});return Ft.createElement("div",{className:"buffered",style:e})}return null},this.renderProgress=()=>{const e=$v($v({},this.getPositionStyle(this.props.current)),this.props.sliderColor&&{backgroundColor:this.props.sliderColor});return Ft.createElement("div",{className:"connect",style:e})},this.renderHoverProgress=()=>{const e=$v($v({},this.getSeekHoverPosition()),this.props.sliderHoverColor&&{backgroundColor:this.props.sliderHoverColor});return Ft.createElement("div",{className:"seek-hover",style:e})},this.renderThumb=()=>Ft.createElement("div",{className:this.isThumbActive()?"thumb active":"thumb",style:this.getThumbHandlerPosition()},Ft.createElement("div",{style:{backgroundColor:this.props.thumbColor},className:"handler"})),this.onMouseDown=e=>{var t,n;this.props.pause&&!this.props.paused&&(this.props.pause(),this.seekPause=!0),this.setSeeking(!0,e),null==(n=(t=this.props).onSeekStart)||n.call(t)},this.onMouseUp=()=>{var e,t;this.props.play&&this.seekPause&&(this.props.play(),this.seekPause=!1),null==(t=(e=this.props).onSeekEnd)||t.call(e)},this.props.secondsPrefix&&(this.secondsPrefix=this.props.secondsPrefix),this.props.minutesPrefix&&(this.minutesPrefix=this.props.minutesPrefix),this.state={ready:!1,trackWidth:0,seekHoverPosition:0}}componentDidMount(){this.setTrackWidthState(),window.addEventListener("resize",this.setTrackWidthState),window.addEventListener("mousemove",this.handleSeeking),window.addEventListener("mouseup",this.mouseSeekingHandler),window.addEventListener("touchmove",this.handleTouchSeeking),window.addEventListener("touchend",this.mobileTouchSeekingHandler)}componentWillUnmount(){window.removeEventListener("resize",this.setTrackWidthState),window.removeEventListener("mousemove",this.handleSeeking),window.removeEventListener("mouseup",this.mouseSeekingHandler),window.removeEventListener("touchmove",this.handleTouchSeeking),window.removeEventListener("touchend",this.mobileTouchSeekingHandler)}changeCurrentTimePosition(e){if(this.track){const t=this.props.scale||1;let n=(e-this.track.getBoundingClientRect().left)/t;n=Math.min(this.state.trackWidth,Math.max(0,n)),this.setState({seekHoverPosition:n});const i=+(n/this.state.trackWidth*this.props.total).toFixed(0);this.props.onChange(i)}}getPositionStyle(e){return{transform:`scaleX(${100*e/this.props.total/100})`}}getThumbHandlerPosition(){return{transform:`translateX(${this.state.trackWidth/(this.props.total/this.props.current)}px)`}}getSeekHoverPosition(){return{transform:`scaleX(${100*this.state.seekHoverPosition/this.state.trackWidth/100})`}}getHoverTimePosition(){let e=0;return this.hoverTime&&(e=this.state.seekHoverPosition-this.hoverTime.offsetWidth/2,this.props.limitTimeTooltipBySides&&(e<0?e=0:e+this.hoverTime.offsetWidth>this.state.trackWidth&&(e=this.state.trackWidth-this.hoverTime.offsetWidth))),{transform:`translateX(${e}px)`}}secondsToTime(e){e=Math.round(e+this.offset);const t=Math.floor(e/3600),n=e%3600,i=Math.floor(n/60),r=Math.ceil(n%60);return{hh:t.toString(),mm:i<10?"0"+i:i.toString(),ss:r<10?"0"+r:r.toString()}}getHoverTime(){const e=100*this.state.seekHoverPosition/this.state.trackWidth,t=Math.floor(+e*(this.props.total/100)),n=this.secondsToTime(t);return this.props.total+this.offset<60?this.secondsPrefix+n.ss:this.props.total+this.offset<3600?this.minutesPrefix+n.mm+":"+n.ss:n.hh+":"+n.mm+":"+n.ss}isThumbActive(){return this.state.seekHoverPosition>0||this.seeking}drawHoverTime(){return this.props.hideHoverTime?null:Ft.createElement("div",{className:this.isThumbActive()?"hover-time active":"hover-time",style:this.getHoverTimePosition(),ref:e=>this.hoverTime=e},this.getHoverTime())}render(){return Ft.createElement("div",{className:"seek-slider"},Ft.createElement("div",{className:"track",ref:e=>this.track=e,onMouseMove:e=>this.handleTrackHover(!1,e),onMouseLeave:e=>this.handleTrackHover(!0,e),onMouseDown:this.onMouseDown,onTouchStart:e=>{this.setMobileSeeking(!0),this.onMouseDown(e)},onMouseUp:this.onMouseUp,onTouchEnd:this.onMouseUp},Ft.createElement("div",{className:"main"},this.renderBufferProgress(),this.renderHoverProgress(),this.renderProgress())),this.drawHoverTime(),this.renderThumb())}}class xb extends et.exports.Component{constructor(e){super(e),this.stageVolume=0,this.updateVolumeTimer=0,this.onVolumeSeeking=!1,this.onClickOperationButton=()=>{const{paused:e}=this.props;e?this.props.play():this.props.pause()},this.operationButton=()=>{const{paused:e}=this.props;return e?Ft.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNOCA1LjE0djE0bDExLTdsLTExLTd6IiBmaWxsPSIjZmZmIj48L3BhdGg+PC9zdmc+Cg=="}):Ft.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTQgMTloNFY1aC00TTYgMTloNFY1SDZ2MTR6IiBmaWxsPSIjZmZmIj48L3BhdGg+PC9zdmc+Cg=="})},this.operationVolumeButton=()=>this.props.volume>.9?Ft.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTQgMy4yM3YyLjA2YzIuODkuODYgNSAzLjU0IDUgNi43MXMtMi4xMSA1Ljg0LTUgNi43djIuMDdjNC0uOTEgNy00LjQ5IDctOC43N2MwLTQuMjgtMy03Ljg2LTctOC43N00xNi41IDEyYzAtMS43Ny0xLTMuMjktMi41LTQuMDNWMTZjMS41LS43MSAyLjUtMi4yNCAyLjUtNE0zIDl2Nmg0bDUgNVY0TDcgOUgzeiIgZmlsbD0iI2ZmZiI+PC9wYXRoPjwvc3ZnPgo="}):0===this.props.volume?Ft.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNNyA5djZoNGw1IDVWNGwtNSA1SDd6IiBmaWxsPSIjZmZmIj48L3BhdGg+PC9zdmc+Cg=="}):Ft.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNNSA5djZoNGw1IDVWNEw5IDltOS41IDNjMC0xLjc3LTEtMy4yOS0yLjUtNC4wM1YxNmMxLjUtLjcxIDIuNS0yLjI0IDIuNS00eiIgZmlsbD0iI2ZmZiI+PC9wYXRoPjwvc3ZnPgo="}),this.handleClickVolume=()=>{0===this.props.volume?0!==this.stageVolume?this.props.setVolume(this.stageVolume):this.props.setVolume(1):(this.stageVolume=this.props.volume,this.props.setVolume(0))},this.onChange=e=>{this.setState({currentTime:e}),e&&this.changeTime(e)},this.changeTime=wb((e=>{this.props.setCurrentTime(e)}),50),this.onVolumeChange=e=>{this.changeVolume(e),this.setState({seekVolume:e/100})},this.changeVolume=wb((e=>{this.props.setVolume(e/100)}),50),this.onVolumeSeekStart=()=>{this.onVolumeSeeking=!0},this.onVolumeSeekEnd=wb((()=>{this.onVolumeSeeking=!1}),500),this.onProgressSeekStart=()=>this.setState({isPlayerSeeking:!0}),this.onProgressSeekEnd=wb((()=>{this.setState({isPlayerSeeking:!1})}),500),this.state={isPlayerSeeking:!1,isVolumeHover:!1,seekVolume:1,visible:!0,currentTime:0},this.stageVolume=e.volume}componentDidMount(){this.updateVolumeTimer=setInterval((()=>{this.onVolumeSeeking||this.setState({seekVolume:this.props.volume}),this.state.isPlayerSeeking||this.setState({currentTime:this.props.currentTime})}),100)}componentWillUnmount(){this.updateVolumeTimer&&clearInterval(this.updateVolumeTimer)}render(){const{duration:e,currentTime:t}=this.props;return Ft.createElement("div",{className:"player-controller",style:{opacity:this.props.visible?"1":"0"}},Ft.createElement("div",{className:"player-controller-progress"},Ft.createElement(yb,{total:e,current:this.state.currentTime,onChange:this.onChange,buffered:this.props.buffered,bufferColor:"rgba(255,255,255,0.3)",hideHoverTime:!0,limitTimeTooltipBySides:!0,onSeekStart:this.onProgressSeekStart,onSeekEnd:this.onProgressSeekEnd,play:this.props.play,pause:this.props.pause,paused:this.props.paused,scale:this.props.scale})),Ft.createElement("div",{className:"player-controller-actions"},Ft.createElement("div",{className:"player-controller-actions-left"},Ft.createElement("div",{onClick:this.onClickOperationButton,className:"player-controller-play"},this.operationButton()),Ft.createElement("div",{className:"player-volume-box",onMouseEnter:()=>this.setState({isVolumeHover:!0}),onMouseLeave:()=>this.setState({isVolumeHover:!1})},Ft.createElement("div",{onClick:this.handleClickVolume,className:"player-volume"},this.operationVolumeButton()),Ft.createElement("div",{className:"player-volume-slider"},Ft.createElement(yb,{total:100,current:100*this.state.seekVolume,onChange:this.onVolumeChange,onSeekStart:this.onVolumeSeekStart,onSeekEnd:this.onVolumeSeekEnd,scale:this.props.scale,limitTimeTooltipBySides:!0,hideHoverTime:!0})))),Ft.createElement("div",{className:"player-mid-box-time"},Cb(Math.floor(t/1e3))," /"," ",Cb(Math.floor(e/1e3)))))}}function Cb(e){const t=e%60,n=(e-t)/60;if(n>=60){const e=n%60;return`${Mb((n-e)/60)}:${Mb(e)}:${Mb(t)}`}return`${Mb(n)}:${Mb(t)}`}function Mb(e){return e<=9?`0${e}`:`${e}`}class Sb extends et.exports.Component{constructor(){super(...arguments),this.putAttributes=e=>{const{context:t}=this.props,n=t.getAttributes()||{};for(const i in e)n[i]!==e[i]&&t.updateAttributes([i],e[i])}}render(){const{context:e}=this.props,t=e.getRoom(),n=t?void 0:e.getDisplayer(),i=this.putAttributes;return Ft.createElement(Ib,{room:t,player:n,context:e,plugin:{putAttributes:i}})}}class Ib extends et.exports.Component{constructor(e){super(e),this.alertMask=null,this.container=Ft.createRef(),this.controllerHiddenTimer=0,this.syncPlayerTimer=0,this.retryCount=0,this.decreaseRetryTimer=0,this.noSoundSyncCount=0,this.showController=()=>{this.setState({controllerVisible:!0}),this.debounceHidingController()},this.play=()=>{var e;const t=null==(e=this.props.room)?void 0:e.calibrationTimestamp;this.debug(">>> play",{paused:!1,hostTime:t}),this.isEnabled()&&this.props.plugin.putAttributes({paused:!1,hostTime:t})},this.pause=()=>{const e=Gv(this.getAttributes(),this.props);this.debug(">>> pause",{paused:!0,currentTime:e}),this.isEnabled()&&this.props.plugin.putAttributes({paused:!0,currentTime:e})},this.setVolume=e=>{this.debug(">>> volume",{volume:e}),this.isEnabled()&&this.props.plugin.putAttributes({volume:e}),this.isEnabled()&&this.props.plugin.putAttributes({volume:e,muted:0===e})},this.setCurrentTime=e=>{var t;const n=null==(t=this.props.room)?void 0:t.calibrationTimestamp;this.debug(">>> seek",{currentTime:e/1e3,hostTime:n}),this.isEnabled()&&this.props.plugin.putAttributes({currentTime:e/1e3,hostTime:n})},this.resetPlayer=()=>{var e;null==(e=this.player)||e.autoplay(!1),this.state.NoSound||(this.debug(">>> ended",{paused:!0,currentTime:0}),this.isEnabled()&&this.props.plugin.putAttributes({paused:!0,currentTime:0}))},this.syncPlayerWithAttributes=()=>{var e;const t=this.getAttributes();if(!t)return;const n=this.player;if(!n)return;if(this.state.NoSound&&(this.noSoundSyncCount+=1)%8!=0)return;n.paused()!==t.paused&&(this.debug("<<< paused -> %o",t.paused),t.paused?n.pause():null==(e=n.play())||e.catch(this.catchPlayFail)),n.muted()!==t.muted&&(this.debug("<<< muted -> %o",t.muted),n.muted(t.muted)),n.volume()!==t.volume&&(this.debug("<<< volume -> %o",t.volume),n.volume(t.volume));const i=Gv(t,this.props);let r=Yv.currentTimeMaxError;this.state.NoSound&&(r*=3),i>n.duration()?this.resetPlayer():Math.abs(n.currentTime()-i)>r&&(this.debug("<<< currentTime -> %o",i),n.currentTime(i))},this.debounceHidingController=()=>{this.controllerHiddenTimer&&(clearTimeout(this.controllerHiddenTimer),this.controllerHiddenTimer=0),this.controllerHiddenTimer=setTimeout((()=>{this.setState({controllerVisible:!1}),this.controllerHiddenTimer=0}),3e3)},this.decreaseRetryCount=()=>{this.player&&this.retryCount>0&&(this.retryCount=this.retryCount-1)},this.catchPlayFail=e=>{var t,n;const i=String(e);if(Xv&&i.includes("NotAllowedError")||i.includes("interact"))null==(t=this.player)||t.autoplay("any"),this.setState({NoSound:!0});else{const t=null==(n=this.player)?void 0:n.error();t&&(this.retryCount<=3?(this.initPlayer(),this.retryCount=this.retryCount+1):(this.debug("catch videojs media error",t),this.setState({MediaError:!0}))),this.debug("catch error",e)}},this.fixPlayFail=()=>{this.debug("try to fix play state"),this.setState({NoSound:!1});const{muted:e,volume:t}=this.getAttributes();this.player&&(this.player.muted(e),this.player.volume(t))},this.initPlayer=async()=>{var e;null==(e=this.player)||e.dispose(),this.player=void 0,this.debug("creating elements ...");const{type:t,src:n,poster:i}=this.getAttributes(),r=document.createElement("div");r.setAttribute("data-vjs-player","");const s=document.createElement("video");s.className="video-js",i&&(s.poster=i),s.setAttribute("playsInline",""),s.setAttribute("webkit-playsinline","");const a=document.createElement("source");new URL(n).pathname.endsWith(".m3u8")?a.type="application/x-mpegURL":s.src=n,a.src=n,t&&(a.type=t),s.appendChild(a),r.appendChild(s),this.container.current.appendChild(r),await new Promise((e=>(window.requestAnimationFrame||window.setTimeout)(e))),this.debug("initializing videojs() ...");const o=X(s);this.player=o,window.player=o,o.one("loadedmetadata",this.gracefullyUpdate),o.on("ready",(()=>{var e;null==(e=Yv.onPlayer)||e.call(Yv,o),o.on("timeupdate",this.gracefullyUpdate),o.on("volumechange",this.gracefullyUpdate),o.on("seeked",this.gracefullyUpdate),o.on("play",this.gracefullyUpdate),o.on("pause",this.gracefullyUpdate),o.on("ended",this.resetPlayer)})),o.on("error",this.catchPlayFail),this.setState({MediaError:!1})},this.gracefullyUpdate=()=>this.setState({updater:!this.state.updater}),this.setupAlert=e=>{e&&(e.addEventListener("touchstart",this.fixPlayFail),e.addEventListener("click",this.fixPlayFail)),this.alertMask=e},this.setupReload=e=>{e&&(e.addEventListener("touchstart",this.initPlayer),e.addEventListener("click",this.initPlayer))},this.state={NoSound:!1,MediaError:!1,updater:!1,controllerVisible:!1},e.room&&function(e){if(!e.calibrationTimestamp)throw new Error("@netless/app-media-player@0.1.0-alpha.5 requires white-web-sdk@^2.13.8 to work properly.")}(e.room)}getAttributes(){const{context:e}=this.props;let t=e.getAttributes();if(t){if(t=$v($v({},Fv),t),this.player){let e=Gv(t,this.props),i=this.player.duration();!t.paused&&e>i&&(n=$v({},t),t=Vv(n,_v({currentTime:0,paused:!0})),this.resetPlayer())}var n;return t}}isShowingPoster(){const e=this.getAttributes();return!(null==e?void 0:e.src)||Jv.some((t=>e.src.endsWith(t)))}render(){var e,t;if(!this.props.room&&!this.props.player)return null;const n=this.getAttributes();if(!n)return null;const i=1e3*((null==(e=this.player)?void 0:e.duration())||1e3),r=(null==(t=this.player)?void 0:t.bufferedPercent())||0;return Ft.createElement("div",{className:this.isEnabled()?"vjs-p":"vjs-p disabled",onMouseEnter:this.showController,onMouseMove:this.showController},Ft.createElement("div",{className:"video-js-plugin-player",ref:this.container}),this.isShowingPoster()&&Ft.createElement("div",{className:"video-js-plugin-poster"},n.poster&&Ft.createElement("img",{src:n.poster,alt:"",draggable:!1})),Ft.createElement(xb,{duration:i,volume:n.volume,setVolume:this.setVolume,paused:n.paused,play:this.play,pause:this.pause,currentTime:1e3*Gv(n,this.props),setCurrentTime:this.setCurrentTime,buffered:i*r,visible:!0}),this.state.NoSound&&Ft.createElement("div",{ref:this.setupAlert,className:"videojs-plugin-muted-alert"}),this.state.MediaError&&Ft.createElement("div",{className:"videojs-plugin-recovery-mode"},Ft.createElement("button",{ref:this.setupReload},"Reload Player")))}debug(e,...t){Yv.verbose&&Yv.log(`[MediaPlayer] ${e}`,...t)}componentDidMount(){this.debug("app version =","0.1.0-alpha.5"),this.debug("video.js version =",X.VERSION),this.initPlayer(),this.props.context.emitter.on("attributesUpdate",this.syncPlayerWithAttributes),this.syncPlayerTimer=setInterval(this.syncPlayerWithAttributes,Yv.syncInterval),this.decreaseRetryTimer=setInterval(this.decreaseRetryCount,Yv.retryInterval)}componentWillUnmount(){var e;this.debug("unmount"),this.props.context.emitter.off("attributesUpdate",this.syncPlayerWithAttributes),null==(e=this.player)||e.dispose(),clearInterval(this.syncPlayerTimer),clearInterval(this.decreaseRetryTimer)}isEnabled(){return this.props.context.getIsWritable()}}const Eb={kind:"MediaPlayer",setup(e){let t=e.getAttributes();if(!t||!t.src)return e.emitter.emit("destroy",{error:new Error("[MediaPlayer]: Missing 'attributes'.'src'.")});t=$v($v({},Fv),t);const n=e.getBox();n.mountStyles('.vjs-p{display:flex;flex-grow:1}.vjs-p *{pointer-events:auto}.vjs-p.disabled *{pointer-events:none}.vjs-p .video-js-plugin-poster{position:absolute;top:0;left:0;right:0;bottom:0;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgQAAACACAYAAAB0vHFxAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAACBKADAAQAAAABAAAAgAAAAACE3oPTAAAKXUlEQVR4Ae3dYW4ktxEG0LW9FwkC2McycokAOUGAXMLwtQwYvomdP4akHUnNnm6SVUU+/xqpe8ji+yiDWz3a/e7L5v/98se//3pL8K9//O+7t19Hv85eX7RP9vnllz2h4/rkd+wz+ir/0cLfjv/9t1/6igABAgQIENhRwIFgx9StmQABAgQIPAg4EDyA+JIAAQIECOwo8HXHRVvzPIHRzwBHjz9PKudMo31Hj59TdZ2qsueXvb5sO0GHIFsi6iFAgAABAgECOgQB6KbsJ5Dtt0L6rWyPkeRXO+fs+WWvL1v6OgTZElEPAQIECBAIENAhCEA3ZT8Bzwj7WUaMJL8I9X5zZs8ve339kugzkg5BH0ejECBAgACB0gIOBKXjUzwBAgQIEOgj4EDQx9EoBAgQIECgtIADQen4FE+AAAECBPoIOBD0cTQKAQIECBAoLeC3DErHp/iWgE8Zt4RyX5df7nxa1Y3Ob/T4rfWtdl2HYLVErYcAAQIECFwQWL5DsPoJcvX1XdjTpd4iv1JxvStWfu9IfCORwLP7U4cgUXhKIUCAAAECUQIOBFHy5iVAgAABAokEHAgShaEUAgQIECAQJXD7MwTPPqOIWujVeUevb/T4V9ftfecE5HfOKetd8suajLoiBHQIItTNSYAAAQIEkgnc7hAkW0/3ckb/e9qjx+8OYsBvBOT3DUe5L+RXLjIFDxTQIRiIa2gCBAgQIFBFoNkh2P0Z2+j1jx4/+0asvv7q9d/dH9XXX73+3fO7u/7W+3fbHzoErR3hOgECBAgQ2ECg2SHwjG2DXRC4xOj9tdufAHpHLb/eonPHk9+xd7TPcXX9r+oQ9Dc1IgECBAgQKCfgQFAuMgUTIECAAIH+Ag4E/U2NSIAAAQIEygk0P0MQvaLsz3hb9bWu840WOJ5ffsc+2a/KL3tC6jsSmL1/dQiO0nCNAAECBAhsItDsEMw+oTzrHl1f61OorevPrvfZ+6N9WvVmr09+xwnKr7ZP9vyOdcdfze7Tuz4dgvF7ygwECBAgQCC9QLNDkH0F0X+C45NdoHZ99rf8aguofqRA7/8/6BCMTMvYBAgQIECgiED5DkHvZyhFcjtdJp/TVClvlF/KWE4XJb/TVG68INB7f+kQXAjBWwgQIECAwGoCDgSrJWo9BAgQIEDggoADwQU0byFAgAABAqsJfO39DGI1IOuJFbA/Y/3vzi6/u4Kx7189v7vru/v+2HTfz65D8N7EdwgQIECAwHYCw3/LYLUT1HY7pLFg+TaAkl+WX/KAGuXJrwEUfLlaPjoEwRvG9AQIECBAIIPA8A5B779JKQOaGl4F5PtqUfGV/Cqm9lqz/F4tMr6qlo8OQcZdpCYCBAgQIDBZYHiHoNozlMn+5aeTb+0I5Se/2gK5q6/286VDkHs/qY4AAQIECEwRcCCYwmwSAgQIECCQW8CBIHc+qiNAgAABAlMEhn+GYMoqTEKAAAEC7wSqPcN+twDfmCqgQzCV22QECBAgQCCnQHiHoPoJtlV/63rObfFaVfX6X1dy7VX19Vev/1pqr++qvv7q9b8m4dVHAtny1SH4KCXfI0CAAAECmwmEdwiq/U1Om+2PL/Kpnbj85FdbYO3qs/186hCsvd+sjgABAgQInBJwIDjF5CYCBAgQILC2gAPB2vlaHQECBAgQOCUQ/hmCbJ+yPKW20U3yqR22/ORXW2Dt6qN/Ph/n1yFYe79ZHQECBAgQOCXgQHCKyU0ECBAgQGBtAQeCtfO1OgIECBAgcErAgeAUk5sIECBAgMDaAg4Ea+drdQQIECBA4JTA1+///OGnoztd52N/fC7g58PPx+e748sX+8P+qLQ/dAiO0nKNAAECBAhsIuBAsEnQlkmAAAECBI4EHAiOdFwjQIAAAQKbCDgQbBK0ZRIgQIAAgSMBB4IjHdcIECBAgMAmAuH/lsHP//zvb5tYl1ymfErG9lK0/F4oSr6QX8nYThcdne/j/DoEp6NzIwECBAgQWFfAgWDdbK2MAAECBAicFnAgOE3lRgIECBAgsK5A+GcIfv39Pz++5X18pvH2mtfzBeQz37znjPLrqTl/LPnNN585Y7Z8dQhmpm8uAgQIECCQVCC8Q1C9I9Cqv3U96b54Kat6/S8Lufii+vqr138xtpe3VV9/9fpfgvDiQ4Fs+eoQfBiTbxIgQIAAgb0EwjsEe3FbLQECBOYJZPsT6LyVm+mKgA7BFTXvIUCAAAECiwk4ECwWqOUQIECAAIErAg4EV9S8hwABAgQILCYw/DMEnmEttmMeliPfB5BiX8qvWGAP5crvASTZl9Xy0SFItoGUQ4AAAQIEIgSGdwiy/U1MEcgrzynf2unKT361BXJXX+3nS4cg935SHQECBAgQmCIwvENQ7RnKFPWFJpFv7TDlJ7/aArmrr/bzpUOQez+pjgABAgQITBH4Wu0EM0XFJGkE7M80UVwqRH6X2NK8afX87q7v7vvTBP13IToE2RJRDwECBAgQCBBwIAhANyUBAgQIEMgm4ECQLRH1ECBAgACBAIHhv2Uwek2rPcPp7cWnt+jc8eQ317v3bPLrLWq8twK995cOwVtdrwkQIECAwKYC5TsE1f4mqNn7jM9s8b7zya+v5+zR5DdbfK/5eu8vHYK99o/VEiBAgACBDwWaHYLezyg+rOLGN6Pra53QWtdvLP3UW6N9WkVmr09+xwnKr7ZP9vyOdcdfze7Tuz4dgvF7ygwECBAgQCC9QLNDEL2C3ieg3utp1de63rueZ8fLXt+z6+l9f3af7PX1zuPZ8bL7ZK/vWW/39xWYvT90CPrmZzQCBAgQIFBSwIGgZGyKJkCAAAECfQUcCPp6Go0AAQIECJQUaH6GIPpT1iVVFX1aIHp/zX5GdxqmyI3yKxLUJ2XK7xOYv78d7XNcXf+rOgT9TY1IgAABAgTKCTQ7BLv/CWr0+kePn31HVl9/9frv7o/q669e/+753V1/6/277Q8dgtaOcJ0AAQIECGwg0OwQbGBwuMTRz5BGj3+4OBdvC8jvNmHoAPIL5Td5MgEdgmSBKIcAAQIECEQI3O4QrP6MZfT6Ro8fsal2mlN+tdOWX+38VN9XQIegr6fRCBAgQIBASQEHgpKxKZoAAQIECPQVcCDo62k0AgQIECBQUuD2Zwiyr3r1Z4Srry/7/rpbn/zuCsa+X36x/mY/Fnh2f+oQHHu6SoAAAQIEthBYvkOwRYoW+anAsyfkTwdyIURAfiHs3SYdnd/o8btBFBlIh6BIUMokQIAAAQIjBRwIRuoamwABAgQIFBFwICgSlDIJECBAgMBIAQeCkbrGJkCAAAECRQQcCIoEpUwCBAgQIDBSwG8ZjNQ19nABnzIeTjx0AvkN5R0+ePb8stc3PKAnJ9AheBLM7QQIECBAYEUBHYIVU91oTf49+9phy09+IwXsr+d0dQie83I3AQIECBBYUkCHYMlY8yxq9DO80ePnkYypZLTv6PFj1PaZNXt+2evLtlN0CLIloh4CBAgQIBAg4EAQgG5KAgQIECCQTcCBIFsi6iFAgAABAgEC/wdVfx9UuC8B6AAAAABJRU5ErkJggg==);background-repeat:repeat-x;background-position:0 50%;display:flex;align-items:center;justify-content:center}.vjs-p .video-js-plugin-poster img{box-shadow:0 0 5px 10px #0006}.vjs-p .player-controller,.vjs-p .videojs-plugin-muted-alert{pointer-events:auto}.vjs-p.disabled .videojs-plugin-close-icon,.vjs-p.disabled .player-controller{pointer-events:none}.vjs-p .video-js-plugin-player{position:absolute;top:0;left:0;right:0;bottom:0}.video-js,[data-vjs-player]{width:100%;height:100%}.vjs-p .videojs-plugin-muted-alert{pointer-events:auto;cursor:pointer;position:absolute;top:0;left:0;right:0;bottom:0;z-index:43}.vjs-p .videojs-plugin-muted-alert:before{pointer-events:auto;cursor:pointer;position:absolute;top:0;left:0;right:0;bottom:0;z-index:43;content:"\\f104";background:rgba(0,0,0,.3);font-family:VideoJS;font-size:2em;display:flex;align-items:center;justify-content:center;color:#fff}.vjs-p .videojs-plugin-recovery-mode{pointer-events:auto;cursor:pointer;position:absolute;top:0;left:0;right:0;bottom:0;z-index:44}.vjs-p .videojs-plugin-recovery-mode button{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.vjs-p .seek-slider{position:relative;width:100%}.vjs-p .seek-slider:focus{outline:none}.vjs-p .seek-slider .track{padding:10px 0;cursor:pointer;outline:none}.vjs-p .seek-slider .track:focus{border:0;outline:none}.vjs-p .seek-slider .track .main{width:100%;height:3px;background-color:#ffffff4d;border-radius:30px;position:absolute;left:0;top:8.5px;transition:transform .4s;outline:none}.vjs-p .seek-slider .track .main:focus{border:0;outline:none}.vjs-p .seek-slider .track .main .buffered{position:absolute;background-color:#ffffff4d;width:100%;height:100%;transform:scaleX(.8);z-index:2;transform-origin:0 0}.vjs-p .seek-slider .track .main .seek-hover{position:absolute;background-color:#ffffff80;width:100%;height:100%;z-index:1;transform:scaleX(.6);transform-origin:0 0;opacity:0;transition:opacity .4s}.vjs-p .seek-slider .track .main .connect{position:absolute;background-color:#fff;width:100%;height:100%;z-index:3;left:0;transform:scaleX(.13);transform-origin:0 0}.vjs-p .seek-slider .track.active .main{transform:scaleY(2)}.vjs-p .seek-slider .thumb{pointer-events:none;position:absolute;width:12px;height:12px;left:-6px;top:4px;z-index:4;transform:translate(100px)}.vjs-p .seek-slider .thumb .handler{border-radius:100%;width:100%;height:100%;background-color:#fff;opacity:0;transform:scale(.4);cursor:pointer;transition:transform .2s;pointer-events:none}.vjs-p .seek-slider .thumb.active .handler{opacity:1;transform:scale(1)}.vjs-p .seek-slider .hover-time{position:absolute;background-color:#0000004d;line-height:18px;font-size:16px;color:#ddd;top:-25px;left:0;padding:5px 10px;border-radius:5px;box-shadow:0 0 5px #0000004d;opacity:0;transform:translate(150px);pointer-events:none}.vjs-p .seek-slider .hover-time.active{opacity:1}.vjs-p .seek-slider:hover .track .main .seek-hover{opacity:1}.vjs-p .player-controller{position:absolute;z-index:100;bottom:0px;left:0;width:100%;display:flex;flex-direction:column;justify-content:center;align-items:stretch;height:64px;background-image:linear-gradient(0deg,#000,transparent);transition:opacity .2s;color:#fff}.vjs-p .player-menu-box{display:flex;align-items:center;justify-content:center;flex-direction:column;margin-bottom:40px}.vjs-p .player-menu-cell{width:100%;text-align:center;font-size:12px;color:#7a7b7c}.vjs-p .player-multiple-play{width:64px;height:120px}.vjs-p .player-controller-actions-left{display:flex;justify-content:center;align-items:center;flex-shrink:0}.vjs-p .player-right-box{font-size:14px;color:#7a7b7c;cursor:pointer;margin-right:12px}.vjs-p .player-controller-actions{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding-left:8px;padding-right:8px;margin-top:2px}.vjs-p .player-mid-box-time{font-size:9px;display:flex;justify-content:center;align-items:center;color:#fff;flex-shrink:0;margin-right:8px;font-family:monospace}.vjs-p .player-controller-play{display:flex;align-items:center;justify-content:center;cursor:pointer;padding-right:4px}.vjs-p .player-controller-progress{width:calc(100% - 28px);margin-left:14px;display:flex;align-items:center;justify-content:center;margin-top:8px}.vjs-p .player-volume{display:flex;align-items:center;justify-content:center;cursor:pointer;margin-right:16px;margin-left:8px}.vjs-p .player-volume-slider{width:60px;margin-right:12px;display:flex;align-items:center}.vjs-p .player-volume-box{display:flex;flex-direction:row}.netless-app-media-player-container{display:flex;position:relative;height:100%}\n');const i=document.createElement("div");i.classList.add("netless-app-media-player-container"),Rv.render(Ft.createElement(Sb,{context:e}),i),n.mountContent(i),e.emitter.on("destroy",(()=>{console.log("[MediaPlayer]: destroy"),Rv.unmountComponentAtNode(i)}))}},Ab={DocsViewer:_o.kind,MediaPlayer:Eb.kind};const Tb=new class{constructor(e){this.ctx=e,this.reactors=new Map,this.disposers=new Map,this.onPhaseChanged=e=>{e===H.Connected&&this.phase===H.Reconnecting&&this.onReconnected(),this.phase=e},this.onReconnected=p((()=>{Qe("onReconnected refresh reactors"),this.releaseDisposers(),this.reactors.forEach(((e,t)=>{A(e)&&this.disposers.set(t,e())})),this.ctx.emitter.emit("onReconnected",void 0)}),3e3)}setRoom(e){this.room=e,this.phase=null==e?void 0:e.phase,null==e||e.callbacks.off("onPhaseChanged",this.onPhaseChanged),null==e||e.callbacks.on("onPhaseChanged",this.onPhaseChanged)}setContext(e){this.ctx=e}releaseDisposers(){this.disposers.forEach((e=>{A(e)&&e()})),this.disposers.clear()}add(e,t){A(t)&&(this.reactors.set(e,t),this.disposers.set(e,t()))}remove(e){this.reactors.has(e)&&this.reactors.delete(e);const t=this.disposers.get(e);t&&(A(t)&&t(),this.disposers.delete(e))}hasReactor(e){return this.reactors.has(e)}destroy(){var e;null==(e=this.room)||e.callbacks.off("onPhaseChanged",this.onPhaseChanged),this.releaseDisposers()}}({emitter:le}),kb=class extends Q{constructor(e){super(e),this.version="0.4.15",this.dependencies={dependencies:{"@juggle/resize-observer":"^3.3.1","@netless/telebox-insider":"0.2.26",emittery:"^0.9.2",lodash:"^4.17.21","p-retry":"^4.6.1","side-effect-manager":"^0.1.5",uuid:"^7.0.3","video.js":">=7"},peerDependencies:{"white-web-sdk":"^2.16.0"},devDependencies:{"@netless/app-docs-viewer":"^0.2.8","@netless/app-media-player":"0.1.0-beta.5","@rollup/plugin-commonjs":"^20.0.0","@rollup/plugin-node-resolve":"^13.0.4","@rollup/plugin-url":"^6.1.0","@sveltejs/vite-plugin-svelte":"^1.0.0-next.22","@tsconfig/svelte":"^2.0.1","@types/debug":"^4.1.7","@types/lodash-es":"^4.17.4","@types/uuid":"^8.3.1","@typescript-eslint/eslint-plugin":"^4.30.0","@typescript-eslint/parser":"^4.30.0",cypress:"^8.7.0",dotenv:"^10.0.0",eslint:"^7.32.0","eslint-config-prettier":"^8.3.0","eslint-plugin-svelte3":"^3.2.0",less:"^4.1.1",prettier:"^2.3.2","prettier-plugin-svelte":"^2.4.0","rollup-plugin-analyzer":"^4.0.0","rollup-plugin-styles":"^3.14.1",svelte:"^3.42.4",typescript:"^4.5.5",vite:"^2.5.3","white-web-sdk":"2.16.10"}},this.emitter=ae,this.viewMode=$.Broadcaster,this.isReplay=V(this.displayer),this.containerSizeRatio=kb.containerSizeRatio,kb.displayer=e.displayer,window.NETLESS_DEPS={dependencies:{"@juggle/resize-observer":"^3.3.1","@netless/telebox-insider":"0.2.26",emittery:"^0.9.2",lodash:"^4.17.21","p-retry":"^4.6.1","side-effect-manager":"^0.1.5",uuid:"^7.0.3","video.js":">=7"},peerDependencies:{"white-web-sdk":"^2.16.0"},devDependencies:{"@netless/app-docs-viewer":"^0.2.8","@netless/app-media-player":"0.1.0-beta.5","@rollup/plugin-commonjs":"^20.0.0","@rollup/plugin-node-resolve":"^13.0.4","@rollup/plugin-url":"^6.1.0","@sveltejs/vite-plugin-svelte":"^1.0.0-next.22","@tsconfig/svelte":"^2.0.1","@types/debug":"^4.1.7","@types/lodash-es":"^4.17.4","@types/uuid":"^8.3.1","@typescript-eslint/eslint-plugin":"^4.30.0","@typescript-eslint/parser":"^4.30.0",cypress:"^8.7.0",dotenv:"^10.0.0",eslint:"^7.32.0","eslint-config-prettier":"^8.3.0","eslint-plugin-svelte3":"^3.2.0",less:"^4.1.1",prettier:"^2.3.2","prettier-plugin-svelte":"^2.4.0","rollup-plugin-analyzer":"^4.0.0","rollup-plugin-styles":"^3.14.1",svelte:"^3.42.4",typescript:"^4.5.5",vite:"^2.5.3","white-web-sdk":"2.16.10"}}}static async mount(e){const t=e.room;kb.container=e.container;const n=e.containerSizeRatio,i=e.debug,r=e.cursor;let s;if(kb.params=e,kb.displayer=e.room,(()=>{if(Ce(U)<Ce("2.16.1"))throw new Ae("2.16.1")})(),_(t)){if(t.phase!==H.Connected)throw new Error("[WindowManager]: Room only Connected can be mount");t.phase===H.Connected&&t.isWritable&&(t.disableSerialization=!1),s=await this.initManager(t)}if(kb.isCreated)throw new Error("[WindowManager]: Already created cannot be created again");if(this.debug=Boolean(i),Qe("Already insert room",s),_(this.displayer)){if(!s)throw new Error("[WindowManager]: init InvisiblePlugin failed")}else await d((async e=>{if(s=await t.getInvisiblePlugin(kb.kind),!s)throw Qe(`manager is empty. retrying ${e}`),new Error}),{retries:10});if(!s)throw new Error("[WindowManager]: create manager failed");n&&(kb.containerSizeRatio=n),await s.ensureAttributes(),s.appManager=new Je(s),s._pageState=new qr(s.appManager),s.cursorManager=new Kr(s.appManager,Boolean(r)),n&&(s.containerSizeRatio=n),e.container&&s.bindContainer(e.container),((e,t)=>{if(V(e))ts(e);else{if(e=e,Object.getOwnPropertyDescriptor(e,"disableCameraTransform"))return;Object.defineProperty(e,"disableCameraTransform",{get:()=>t.mainView.disableCameraTransform,set(e){t.mainView.disableCameraTransform=e}}),Object.defineProperty(e,"canUndoSteps",{get:()=>t.canUndoSteps}),Object.defineProperty(e,"canRedoSteps",{get:()=>t.canRedoSteps}),e.moveCamera=e=>t.moveCamera(e),e.moveCameraToContain=(...e)=>t.moveCameraToContain(...e),e.convertToPointInWorld=(...e)=>t.mainView.convertToPointInWorld(...e),e.setCameraBound=(...e)=>t.mainView.setCameraBound(...e),e.scenePreview=(...e)=>t.mainView.scenePreview(...e),e.fillSceneSnapshot=(...e)=>t.mainView.fillSceneSnapshot(...e),e.generateScreenshot=(...e)=>t.mainView.generateScreenshot(...e),e.setMemberState=(...e)=>t.mainView.setMemberState(...e),e.redo=()=>t.redo(),e.undo=()=>t.undo(),e.cleanCurrentScene=()=>t.cleanCurrentScene(),e.delete=()=>t.delete(),e.copy=()=>t.copy(),e.paste=()=>t.paste(),e.duplicate=()=>t.duplicate(),e.insertImage=(...e)=>t.insertImage(...e),e.completeImageUpload=(...e)=>t.completeImageUpload(...e),e.insertText=(...e)=>t.insertText(...e),e.lockImage=(...e)=>t.lockImage(...e),e.lockImages=(...e)=>t.lockImages(...e),es(e)}})(t,s),le.emit("onCreated"),kb.isCreated=!0;try{await de()}catch(a){console.warn("[WindowManager]: indexedDB open failed"),console.log(a)}return s}static async initManager(e){let t=e.getInvisiblePlugin(kb.kind);if(!t&&_(e))if(!1===e.isWritable){try{await e.setWritable(!0)}catch(n){throw new Error("[WindowManger]: room must be switched to be writable")}t=await e.createInvisiblePlugin(kb,{}),t.ensureAttributes(),await Me(500),await e.setWritable(!1)}else t=await e.createInvisiblePlugin(kb,{});return t}static initContainer(e,t,n,i){kb.container||(kb.container=t);const{playground:r,wrapper:s,sizer:a,mainViewElement:o}=(e=>{const t=document.createElement("div");t.className="netless-window-manager-playground";const n=document.createElement("div");n.className="netless-window-manager-sizer";const i=document.createElement("div");i.className="netless-window-manager-wrapper";const r=document.createElement("div");return r.className="netless-window-manager-main-view",t.appendChild(n),n.appendChild(i),i.appendChild(r),e.appendChild(t),Nb.wrapper=i,{playground:t,wrapper:i,sizer:n,mainViewElement:r}})(t);if(kb.playground=r,n&&a.classList.add("netless-window-manager-chess-sizer"),i){const e=document.createElement("style");e.textContent=i,r.appendChild(e)}return e.containerResizeObserver=qe.create(r,a,s,le),kb.wrapper=s,o}static get registered(){return me.registered}bindContainer(e){var t,n,i,r,s,a,o,l,c,u;if(kb.isCreated&&kb.container)kb.container.firstChild&&e.appendChild(kb.container.firstChild);else if(kb.params){const i=kb.params,r=kb.initContainer(this,e,i.chessboard,i.overwriteStyles),s=(o=this,l=ae,c=le,u={collectorContainer:i.collectorContainer,collectorStyles:i.collectorStyles,prefersColorScheme:i.prefersColorScheme},new ur({safeSetAttributes:e=>o.safeSetAttributes(e),getMainView:()=>o.mainView,updateAppState:(...e)=>{var t;return null==(t=o.appManager)?void 0:t.store.updateAppState(...e)},canOperate:()=>o.canOperate,notifyContainerRectUpdate:e=>{var t;return null==(t=o.appManager)?void 0:t.notifyContainerRectUpdate(e)},cleanFocus:()=>{var e;return null==(e=o.appManager)?void 0:e.store.cleanFocus()},setAppFocus:e=>{var t;return null==(t=o.appManager)?void 0:t.store.setAppFocus(e,!0)},callbacks:l,emitter:c},u));this.boxManager=s,null==(t=this.appManager)||t.setBoxManager(s),this.bindMainView(r,i.disableCameraTransform),kb.wrapper&&(null==(n=this.cursorManager)||n.setupWrapper(kb.wrapper))}le.emit("updateManagerRect"),null==(i=this.appManager)||i.refresh(),null==(r=this.appManager)||r.resetMaximized(),null==(s=this.appManager)||s.resetMinimized(),null==(a=this.appManager)||a.displayerWritableListener(!this.room.isWritable),kb.container=e}bindCollectorContainer(e){kb.isCreated&&this.boxManager?this.boxManager.setCollectorContainer(e):kb.params&&(kb.params.collectorContainer=e)}static register(e){return me.register(e)}static unregister(e){return me.unregister(e)}async addApp(e){var t,n,i,r;if(this.appManager){if(!e.kind||"string"!=typeof e.kind)throw new Te;const s=await(null==(t=me.appClasses.get(e.kind))?void 0:t());if(s&&(null==(n=s.config)?void 0:n.singleton)&&this.appManager.appProxies.has(e.kind))throw new Ie;const a=this.setupScenePath(e,this.appManager);if(void 0===a)return;(null==(i=null==e?void 0:e.options)?void 0:i.scenePath)&&(e.options.scenePath=(r=e.options.scenePath).endsWith("/")?r.slice(0,-1):r);return await this.appManager.addApp(e,Boolean(a))}throw new Ee}setupScenePath(e,t){var n,i,r;let s=!1;if(e.options){const{scenePath:a,scenes:o}=e.options;if(a){if(!(e=>e.startsWith("/"))(a))throw new Ne;const e=Object.keys(this.apps||{});for(const n of e){const e=t.store.getAppScenePath(n);if(e&&e===a){if(console.warn(`[WindowManager]: ScenePath ${a} Already opened`),this.boxManager){const e=this.boxManager.getTopBox();e&&this.boxManager.setZIndex(n,e.zIndex+1,!1)}return}}}a&&o&&o.length>0&&(this.isDynamicPPT(o)?(s=!0,ye(this.displayer)[a]||null==(n=this.room)||n.putScenes(a,o)):ye(this.displayer)[a]||null==(i=this.room)||i.putScenes(a,[{name:o[0].name}])),a&&void 0===o&&(null==(r=this.room)||r.putScenes(a,[{}]))}return s}async setMainViewScenePath(e){this.appManager&&await this.appManager.setMainViewScenePath(e)}async setMainViewSceneIndex(e){this.appManager&&await this.appManager.setMainViewSceneIndex(e)}async nextPage(){if(this.appManager){const e=this.mainViewSceneIndex+1;return e>=this.mainViewScenesLength?(console.warn("[WindowManager]: current page is the last page"),!1):(await this.appManager.setMainViewSceneIndex(e),!0)}return!1}async prevPage(){if(this.appManager){const e=this.mainViewSceneIndex-1;return e<0?(console.warn("[WindowManager]: current page is the first page"),!1):(await this.appManager.setMainViewSceneIndex(e),!0)}return!1}async addPage(e){if(this.appManager){const t=null==e?void 0:e.after,n=null==e?void 0:e.scene;if(t){const e=this.mainViewSceneIndex+1;this.room.putScenes("/",[n||{}],e)}else this.room.putScenes("/",[n||{}])}}getMainViewScenePath(){var e;return null==(e=this.appManager)?void 0:e.store.getMainViewScenePath()}getMainViewSceneIndex(){var e;return null==(e=this.appManager)?void 0:e.store.getMainViewSceneIndex()}setReadonly(e){var t;this.readonly=e,null==(t=this.boxManager)||t.setReadonly(e),le.emit("setReadonly",e)}switchMainViewToWriter(){var e;return null==(e=this.appManager)?void 0:e.mainViewProxy.mainViewClickHandler()}onAppDestroy(e,t){((e,t)=>{le.once(e).then(t)})(`destroy-${e}`,t)}setViewMode(e){var t,n,i;e===$.Broadcaster&&(this.canOperate&&(null==(t=this.appManager)||t.mainViewProxy.setCameraAndSize()),null==(n=this.appManager)||n.mainViewProxy.start()),e===$.Freedom&&(null==(i=this.appManager)||i.mainViewProxy.stop()),this.viewMode=e}setBoxState(e){if(this.canOperate)switch(e){case"normal":this.setMaximized(!1),this.setMinimized(!1);break;case"maximized":this.setMaximized(!0),this.setMinimized(!1);break;case"minimized":this.setMinimized(!0)}}setMaximized(e){var t;this.canOperate&&(null==(t=this.boxManager)||t.setMaximized(e,!1))}setMinimized(e){var t;this.canOperate&&(null==(t=this.boxManager)||t.setMinimized(e,!1))}get mainView(){if(this.appManager)return this.appManager.mainViewProxy.view;throw new Ee}get camera(){if(this.appManager)return this.appManager.mainViewProxy.view.camera;throw new Ee}get cameraState(){if(this.appManager)return this.appManager.mainViewProxy.cameraState;throw new Ee}get apps(){var e;return null==(e=this.appManager)?void 0:e.store.apps()}get boxState(){var e;if(this.appManager)return null==(e=this.appManager.boxManager)?void 0:e.boxState;throw new Ee}get darkMode(){var e,t;return Boolean(null==(t=null==(e=this.appManager)?void 0:e.boxManager)?void 0:t.darkMode)}get prefersColorScheme(){var e;if(this.appManager)return null==(e=this.appManager.boxManager)?void 0:e.prefersColorScheme;throw new Ee}get focused(){return this.attributes.focus}get focusedView(){var e,t;return(null==(t=null==(e=this.appManager)?void 0:e.focusApp)?void 0:t.view)||this.mainView}get mainViewSceneIndex(){var e;return(null==(e=this._pageState)?void 0:e.index)||0}get mainViewSceneDir(){var e;if(this.appManager)return null==(e=this.appManager)?void 0:e.getMainViewSceneDir();throw new Ee}get topApp(){var e,t;return null==(t=null==(e=this.boxManager)?void 0:e.getTopBox())?void 0:t.id}get mainViewScenesLength(){var e;return(null==(e=this._pageState)?void 0:e.length)||0}get canRedoSteps(){var e;return(null==(e=this.focusedView)?void 0:e.canRedoSteps)||0}get canUndoSteps(){var e;return(null==(e=this.focusedView)?void 0:e.canUndoSteps)||0}get sceneState(){if(this.appManager)return this.appManager.sceneState;throw new Ee}get pageState(){if(this._pageState)return this._pageState.toObject();throw new Ee}queryAll(){var e;return Array.from((null==(e=this.appManager)?void 0:e.appProxies.values())||[])}queryOne(e){var t;return null==(t=this.appManager)?void 0:t.appProxies.get(e)}async closeApp(e){var t;return null==(t=this.appManager)?void 0:t.closeApp(e)}moveCamera(t){var n;const i=g(t,["animationMode"]),r=c({},this.mainView.camera);f(c(c({},r),i),r)||(this.mainView.moveCamera(t),null==(n=this.appManager)||n.dispatchInternalEvent(e.MoveCamera,t),setTimeout((()=>{var e;null==(e=this.appManager)||e.mainViewProxy.setCameraAndSize()}),500))}moveCameraToContain(t){var n;this.mainView.moveCameraToContain(t),null==(n=this.appManager)||n.dispatchInternalEvent(e.MoveCameraToContain,t),setTimeout((()=>{var e;null==(e=this.appManager)||e.mainViewProxy.setCameraAndSize()}),500)}convertToPointInWorld(e){return this.mainView.convertToPointInWorld(e)}setCameraBound(e){this.mainView.setCameraBound(e)}onDestroy(){this._destroy()}destroy(){this._destroy()}_destroy(){var e,t,n,i;null==(e=this.containerResizeObserver)||e.disconnect(),null==(t=this.appManager)||t.destroy(),null==(n=this.cursorManager)||n.destroy(),kb.container=void 0,kb.wrapper=void 0,kb.isCreated=!1,kb.playground&&(null==(i=kb.playground.parentNode)||i.removeChild(kb.playground)),kb.params=void 0,Qe("Destroyed")}bindMainView(e,t){var n;this.appManager&&(this.appManager.bindMainView(e,Boolean(t)),null==(n=this.cursorManager)||n.setMainViewDivElement(e))}get canOperate(){return!!_(this.displayer)&&(this.displayer.isWritable&&this.displayer.phase===H.Connected)}get room(){return this.displayer}safeSetAttributes(e){this.canOperate&&this.setAttributes(e)}safeUpdateAttributes(e,t){this.canOperate&&this.updateAttributes(e,t)}setPrefersColorScheme(e){var t,n;null==(n=null==(t=this.appManager)?void 0:t.boxManager)||n.setPrefersColorScheme(e)}cleanCurrentScene(){var e;null==(e=this.focusedView)||e.cleanCurrentScene()}redo(){var e;return(null==(e=this.focusedView)?void 0:e.redo())||0}undo(){var e;return(null==(e=this.focusedView)?void 0:e.undo())||0}delete(){var e;null==(e=this.focusedView)||e.delete()}copy(){var e;null==(e=this.focusedView)||e.copy()}paste(){var e;null==(e=this.focusedView)||e.paste()}duplicate(){var e;null==(e=this.focusedView)||e.duplicate()}insertText(e,t,n){var i;return(null==(i=this.focusedView)?void 0:i.insertText(e,t,n))||""}insertImage(e){var t;return null==(t=this.focusedView)?void 0:t.insertImage(e)}completeImageUpload(e,t){var n;return null==(n=this.focusedView)?void 0:n.completeImageUpload(e,t)}lockImage(e,t){var n;return null==(n=this.focusedView)?void 0:n.lockImage(e,t)}lockImages(e){var t;return null==(t=this.focusedView)?void 0:t.lockImages(e)}isDynamicPPT(e){var t,n;const i=null==(n=null==(t=e[0])?void 0:t.ppt)?void 0:n.src;return null==i?void 0:i.startsWith("pptx://")}async ensureAttributes(){T(this.attributes)&&await Me(50),m(this.attributes)&&(this.attributes[Ue.Apps]||this.safeSetAttributes({[Ue.Apps]:{}}),this.attributes[Ue.Cursors]||this.safeSetAttributes({[Ue.Cursors]:{}}),this.attributes._mainScenePath||this.safeSetAttributes({_mainScenePath:"/init"}),this.attributes._mainSceneIndex||this.safeSetAttributes({_mainSceneIndex:0}),this.attributes[Ue.Registered]||this.safeSetAttributes({[Ue.Registered]:{}}))}};let Nb=kb;var Pb;Nb.kind="WindowManager",Nb.debug=!1,Nb.containerSizeRatio=9/16,Nb.isCreated=!1,Nb.debug&&(Pb={verbose:!0},Yv=$v($v({},Zv),Pb)),Nb.register({kind:_o.kind,src:_o}),Nb.register({kind:Eb.kind,src:Eb});export{Ab as BuiltinApps,Nb as WindowManager,Tb as reconnectRefresher};
|
41
|
+
var Fo=tt.exports,Zo=ot,Yo=Qo.exports;function Go(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}if(!Fo)throw Error(Go(227));function Xo(e,t,n,i,r,s,a,o,l){var c=Array.prototype.slice.call(arguments,3);try{t.apply(n,c)}catch(u){this.onError(u)}}var Jo=!1,Ko=null,qo=!1,el=null,tl={onError:function(e){Jo=!0,Ko=e}};function nl(e,t,n,i,r,s,a,o,l){Jo=!1,Ko=null,Xo.apply(tl,arguments)}var il=null,rl=null,sl=null;function al(e,t,n){var i=e.type||"unknown-event";e.currentTarget=sl(n),function(e,t,n,i,r,s,a,o,l){if(nl.apply(this,arguments),Jo){if(!Jo)throw Error(Go(198));var c=Ko;Jo=!1,Ko=null,qo||(qo=!0,el=c)}}(i,t,void 0,e),e.currentTarget=null}var ol=null,ll={};function cl(){if(ol)for(var e in ll){var t=ll[e],n=ol.indexOf(e);if(!(-1<n))throw Error(Go(96,e));if(!dl[n]){if(!t.extractEvents)throw Error(Go(97,e));for(var i in dl[n]=t,n=t.eventTypes){var r=void 0,s=n[i],a=t,o=i;if(hl.hasOwnProperty(o))throw Error(Go(99,o));hl[o]=s;var l=s.phasedRegistrationNames;if(l){for(r in l)l.hasOwnProperty(r)&&ul(l[r],a,o);r=!0}else s.registrationName?(ul(s.registrationName,a,o),r=!0):r=!1;if(!r)throw Error(Go(98,i,e))}}}}function ul(e,t,n){if(pl[e])throw Error(Go(100,e));pl[e]=t,fl[e]=t.eventTypes[n].dependencies}var dl=[],hl={},pl={},fl={};function gl(e){var t,n=!1;for(t in e)if(e.hasOwnProperty(t)){var i=e[t];if(!ll.hasOwnProperty(t)||ll[t]!==i){if(ll[t])throw Error(Go(102,t));ll[t]=i,n=!0}}n&&cl()}var ml=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement),vl=null,bl=null,wl=null;function yl(e){if(e=rl(e)){if("function"!=typeof vl)throw Error(Go(280));var t=e.stateNode;t&&(t=il(t),vl(e.stateNode,e.type,t))}}function xl(e){bl?wl?wl.push(e):wl=[e]:bl=e}function Cl(){if(bl){var e=bl,t=wl;if(wl=bl=null,yl(e),t)for(e=0;e<t.length;e++)yl(t[e])}}function Ml(e,t){return e(t)}function Sl(e,t,n,i,r){return e(t,n,i,r)}function Il(){}var El=Ml,Al=!1,Tl=!1;function kl(){null===bl&&null===wl||(Il(),Cl())}function Nl(e,t,n){if(Tl)return e(t,n);Tl=!0;try{return El(e,t,n)}finally{Tl=!1,kl()}}var Pl=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,zl=Object.prototype.hasOwnProperty,Dl={},Ll={};function Bl(e,t,n,i,r,s){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=i,this.attributeNamespace=r,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s}var jl={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){jl[e]=new Bl(e,0,!1,e,null,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];jl[t]=new Bl(t,1,!1,e[1],null,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){jl[e]=new Bl(e,2,!1,e.toLowerCase(),null,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){jl[e]=new Bl(e,2,!1,e,null,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){jl[e]=new Bl(e,3,!1,e.toLowerCase(),null,!1)})),["checked","multiple","muted","selected"].forEach((function(e){jl[e]=new Bl(e,3,!0,e,null,!1)})),["capture","download"].forEach((function(e){jl[e]=new Bl(e,4,!1,e,null,!1)})),["cols","rows","size","span"].forEach((function(e){jl[e]=new Bl(e,6,!1,e,null,!1)})),["rowSpan","start"].forEach((function(e){jl[e]=new Bl(e,5,!1,e.toLowerCase(),null,!1)}));var Rl=/[\-:]([a-z])/g;function Ol(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(Rl,Ol);jl[t]=new Bl(t,1,!1,e,null,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(Rl,Ol);jl[t]=new Bl(t,1,!1,e,"http://www.w3.org/1999/xlink",!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(Rl,Ol);jl[t]=new Bl(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1)})),["tabIndex","crossOrigin"].forEach((function(e){jl[e]=new Bl(e,1,!1,e.toLowerCase(),null,!1)})),jl.xlinkHref=new Bl("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0),["src","href","action","formAction"].forEach((function(e){jl[e]=new Bl(e,1,!1,e.toLowerCase(),null,!0)}));var Vl=Fo.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _l(e,t,n,i){var r=jl.hasOwnProperty(t)?jl[t]:null;(null!==r?0===r.type:!i&&(2<t.length&&("o"===t[0]||"O"===t[0])&&("n"===t[1]||"N"===t[1])))||(function(e,t,n,i){if(null==t||function(e,t,n,i){if(null!==n&&0===n.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!i&&(null!==n?!n.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,n,i))return!0;if(i)return!1;if(null!==n)switch(n.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,n,r,i)&&(n=null),i||null===r?function(e){return!!zl.call(Ll,e)||!zl.call(Dl,e)&&(Pl.test(e)?Ll[e]=!0:(Dl[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):r.mustUseProperty?e[r.propertyName]=null===n?3!==r.type&&"":n:(t=r.attributeName,i=r.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(r=r.type)||4===r&&!0===n?"":""+n,i?e.setAttributeNS(i,t,n):e.setAttribute(t,n))))}Vl.hasOwnProperty("ReactCurrentDispatcher")||(Vl.ReactCurrentDispatcher={current:null}),Vl.hasOwnProperty("ReactCurrentBatchConfig")||(Vl.ReactCurrentBatchConfig={suspense:null});var Ul=/^(.*)[\\\/]/,Wl="function"==typeof Symbol&&Symbol.for,Hl=Wl?Symbol.for("react.element"):60103,Ql=Wl?Symbol.for("react.portal"):60106,$l=Wl?Symbol.for("react.fragment"):60107,Fl=Wl?Symbol.for("react.strict_mode"):60108,Zl=Wl?Symbol.for("react.profiler"):60114,Yl=Wl?Symbol.for("react.provider"):60109,Gl=Wl?Symbol.for("react.context"):60110,Xl=Wl?Symbol.for("react.concurrent_mode"):60111,Jl=Wl?Symbol.for("react.forward_ref"):60112,Kl=Wl?Symbol.for("react.suspense"):60113,ql=Wl?Symbol.for("react.suspense_list"):60120,ec=Wl?Symbol.for("react.memo"):60115,tc=Wl?Symbol.for("react.lazy"):60116,nc=Wl?Symbol.for("react.block"):60121,ic="function"==typeof Symbol&&Symbol.iterator;function rc(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=ic&&e[ic]||e["@@iterator"])?e:null}function sc(e){if(null==e)return null;if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case $l:return"Fragment";case Ql:return"Portal";case Zl:return"Profiler";case Fl:return"StrictMode";case Kl:return"Suspense";case ql:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case Gl:return"Context.Consumer";case Yl:return"Context.Provider";case Jl:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(""!==t?"ForwardRef("+t+")":"ForwardRef");case ec:return sc(e.type);case nc:return sc(e.render);case tc:if(e=1===e._status?e._result:null)return sc(e)}return null}function ac(e){var t="";do{e:switch(e.tag){case 3:case 4:case 6:case 7:case 10:case 9:var n="";break e;default:var i=e._debugOwner,r=e._debugSource,s=sc(e.type);n=null,i&&(n=sc(i.type)),i=s,s="",r?s=" (at "+r.fileName.replace(Ul,"")+":"+r.lineNumber+")":n&&(s=" (created by "+n+")"),n="\n in "+(i||"Unknown")+s}t+=n,e=e.return}while(e);return t}function oc(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function lc(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function cc(e){e._valueTracker||(e._valueTracker=function(e){var t=lc(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),i=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var r=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(e){i=""+e,s.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return i},setValue:function(e){i=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function uc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),i="";return e&&(i=lc(e)?e.checked?"true":"false":e.value),(e=i)!==n&&(t.setValue(e),!0)}function dc(e,t){var n=t.checked;return Zo({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function hc(e,t){var n=null==t.defaultValue?"":t.defaultValue,i=null!=t.checked?t.checked:t.defaultChecked;n=oc(null!=t.value?t.value:n),e._wrapperState={initialChecked:i,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function pc(e,t){null!=(t=t.checked)&&_l(e,"checked",t,!1)}function fc(e,t){pc(e,t);var n=oc(t.value),i=t.type;if(null!=n)"number"===i?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if("submit"===i||"reset"===i)return void e.removeAttribute("value");t.hasOwnProperty("value")?mc(e,t.type,n):t.hasOwnProperty("defaultValue")&&mc(e,t.type,oc(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function gc(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var i=t.type;if(!("submit"!==i&&"reset"!==i||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}""!==(n=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==n&&(e.name=n)}function mc(e,t,n){"number"===t&&e.ownerDocument.activeElement===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}function vc(e,t){return e=Zo({children:void 0},t),(t=function(e){var t="";return Fo.Children.forEach(e,(function(e){null!=e&&(t+=e)})),t}(t.children))&&(e.children=t),e}function bc(e,t,n,i){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&i&&(e[n].defaultSelected=!0)}else{for(n=""+oc(n),t=null,r=0;r<e.length;r++){if(e[r].value===n)return e[r].selected=!0,void(i&&(e[r].defaultSelected=!0));null!==t||e[r].disabled||(t=e[r])}null!==t&&(t.selected=!0)}}function wc(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(Go(91));return Zo({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function yc(e,t){var n=t.value;if(null==n){if(n=t.children,t=t.defaultValue,null!=n){if(null!=t)throw Error(Go(92));if(Array.isArray(n)){if(!(1>=n.length))throw Error(Go(93));n=n[0]}t=n}null==t&&(t=""),n=t}e._wrapperState={initialValue:oc(n)}}function xc(e,t){var n=oc(t.value),i=oc(t.defaultValue);null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&e.defaultValue!==n&&(e.defaultValue=n)),null!=i&&(e.defaultValue=""+i)}function Cc(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}var Mc="http://www.w3.org/1999/xhtml",Sc="http://www.w3.org/2000/svg";function Ic(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Ec(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?Ic(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var Ac,Tc,kc=(Tc=function(e,t){if(e.namespaceURI!==Sc||"innerHTML"in e)e.innerHTML=t;else{for((Ac=Ac||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ac.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,i){MSApp.execUnsafeLocalFunction((function(){return Tc(e,t)}))}:Tc);function Nc(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}function Pc(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var zc={animationend:Pc("Animation","AnimationEnd"),animationiteration:Pc("Animation","AnimationIteration"),animationstart:Pc("Animation","AnimationStart"),transitionend:Pc("Transition","TransitionEnd")},Dc={},Lc={};function Bc(e){if(Dc[e])return Dc[e];if(!zc[e])return e;var t,n=zc[e];for(t in n)if(n.hasOwnProperty(t)&&t in Lc)return Dc[e]=n[t];return e}ml&&(Lc=document.createElement("div").style,"AnimationEvent"in window||(delete zc.animationend.animation,delete zc.animationiteration.animation,delete zc.animationstart.animation),"TransitionEvent"in window||delete zc.transitionend.transition);var jc=Bc("animationend"),Rc=Bc("animationiteration"),Oc=Bc("animationstart"),Vc=Bc("transitionend"),_c="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Uc=new("function"==typeof WeakMap?WeakMap:Map);function Wc(e){var t=Uc.get(e);return void 0===t&&(t=new Map,Uc.set(e,t)),t}function Hc(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!=(1026&(t=e).effectTag)&&(n=t.return),e=t.return}while(e)}return 3===t.tag?n:null}function Qc(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function $c(e){if(Hc(e)!==e)throw Error(Go(188))}function Fc(e){if(!(e=function(e){var t=e.alternate;if(!t){if(null===(t=Hc(e)))throw Error(Go(188));return t!==e?null:e}for(var n=e,i=t;;){var r=n.return;if(null===r)break;var s=r.alternate;if(null===s){if(null!==(i=r.return)){n=i;continue}break}if(r.child===s.child){for(s=r.child;s;){if(s===n)return $c(r),e;if(s===i)return $c(r),t;s=s.sibling}throw Error(Go(188))}if(n.return!==i.return)n=r,i=s;else{for(var a=!1,o=r.child;o;){if(o===n){a=!0,n=r,i=s;break}if(o===i){a=!0,i=r,n=s;break}o=o.sibling}if(!a){for(o=s.child;o;){if(o===n){a=!0,n=s,i=r;break}if(o===i){a=!0,i=s,n=r;break}o=o.sibling}if(!a)throw Error(Go(189))}}if(n.alternate!==i)throw Error(Go(190))}if(3!==n.tag)throw Error(Go(188));return n.stateNode.current===n?e:t}(e)))return null;for(var t=e;;){if(5===t.tag||6===t.tag)return t;if(t.child)t.child.return=t,t=t.child;else{if(t===e)break;for(;!t.sibling;){if(!t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}}return null}function Zc(e,t){if(null==t)throw Error(Go(30));return null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}function Yc(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}var Gc=null;function Xc(e){if(e){var t=e._dispatchListeners,n=e._dispatchInstances;if(Array.isArray(t))for(var i=0;i<t.length&&!e.isPropagationStopped();i++)al(e,t[i],n[i]);else t&&al(e,t,n);e._dispatchListeners=null,e._dispatchInstances=null,e.isPersistent()||e.constructor.release(e)}}function Jc(e){if(null!==e&&(Gc=Zc(Gc,e)),e=Gc,Gc=null,e){if(Yc(e,Xc),Gc)throw Error(Go(95));if(qo)throw e=el,qo=!1,el=null,e}}function Kc(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}function qc(e){if(!ml)return!1;var t=(e="on"+e)in document;return t||((t=document.createElement("div")).setAttribute(e,"return;"),t="function"==typeof t[e]),t}var eu=[];function tu(e){e.topLevelType=null,e.nativeEvent=null,e.targetInst=null,e.ancestors.length=0,10>eu.length&&eu.push(e)}function nu(e,t,n,i){if(eu.length){var r=eu.pop();return r.topLevelType=e,r.eventSystemFlags=i,r.nativeEvent=t,r.targetInst=n,r}return{topLevelType:e,eventSystemFlags:i,nativeEvent:t,targetInst:n,ancestors:[]}}function iu(e){var t=e.targetInst,n=t;do{if(!n){e.ancestors.push(n);break}var i=n;if(3===i.tag)i=i.stateNode.containerInfo;else{for(;i.return;)i=i.return;i=3!==i.tag?null:i.stateNode.containerInfo}if(!i)break;5!==(t=n.tag)&&6!==t||e.ancestors.push(n),n=vd(i)}while(n);for(n=0;n<e.ancestors.length;n++){t=e.ancestors[n];var r=Kc(e.nativeEvent);i=e.topLevelType;var s=e.nativeEvent,a=e.eventSystemFlags;0===n&&(a|=64);for(var o=null,l=0;l<dl.length;l++){var c=dl[l];c&&(c=c.extractEvents(i,t,s,r,a))&&(o=Zc(o,c))}Jc(o)}}function ru(e,t,n){if(!n.has(e)){switch(e){case"scroll":Ou(t,"scroll",!0);break;case"focus":case"blur":Ou(t,"focus",!0),Ou(t,"blur",!0),n.set("blur",null),n.set("focus",null);break;case"cancel":case"close":qc(e)&&Ou(t,e,!0);break;case"invalid":case"submit":case"reset":break;default:-1===_c.indexOf(e)&&Ru(e,t)}n.set(e,null)}}var su,au,ou,lu=!1,cu=[],uu=null,du=null,hu=null,pu=new Map,fu=new Map,gu=[],mu="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput close cancel copy cut paste click change contextmenu reset submit".split(" "),vu="focus blur dragenter dragleave mouseover mouseout pointerover pointerout gotpointercapture lostpointercapture".split(" ");function bu(e,t,n,i,r){return{blockedOn:e,topLevelType:t,eventSystemFlags:32|n,nativeEvent:r,container:i}}function wu(e,t){switch(e){case"focus":case"blur":uu=null;break;case"dragenter":case"dragleave":du=null;break;case"mouseover":case"mouseout":hu=null;break;case"pointerover":case"pointerout":pu.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":fu.delete(t.pointerId)}}function yu(e,t,n,i,r,s){return null===e||e.nativeEvent!==s?(e=bu(t,n,i,r,s),null!==t&&(null!==(t=bd(t))&&au(t)),e):(e.eventSystemFlags|=i,e)}function xu(e){var t=vd(e.target);if(null!==t){var n=Hc(t);if(null!==n)if(13===(t=n.tag)){if(null!==(t=Qc(n)))return e.blockedOn=t,void Yo.unstable_runWithPriority(e.priority,(function(){ou(n)}))}else if(3===t&&n.stateNode.hydrate)return void(e.blockedOn=3===n.tag?n.stateNode.containerInfo:null)}e.blockedOn=null}function Cu(e){if(null!==e.blockedOn)return!1;var t=Wu(e.topLevelType,e.eventSystemFlags,e.container,e.nativeEvent);if(null!==t){var n=bd(t);return null!==n&&au(n),e.blockedOn=t,!1}return!0}function Mu(e,t,n){Cu(e)&&n.delete(t)}function Su(){for(lu=!1;0<cu.length;){var e=cu[0];if(null!==e.blockedOn){null!==(e=bd(e.blockedOn))&&su(e);break}var t=Wu(e.topLevelType,e.eventSystemFlags,e.container,e.nativeEvent);null!==t?e.blockedOn=t:cu.shift()}null!==uu&&Cu(uu)&&(uu=null),null!==du&&Cu(du)&&(du=null),null!==hu&&Cu(hu)&&(hu=null),pu.forEach(Mu),fu.forEach(Mu)}function Iu(e,t){e.blockedOn===t&&(e.blockedOn=null,lu||(lu=!0,Yo.unstable_scheduleCallback(Yo.unstable_NormalPriority,Su)))}function Eu(e){function t(t){return Iu(t,e)}if(0<cu.length){Iu(cu[0],e);for(var n=1;n<cu.length;n++){var i=cu[n];i.blockedOn===e&&(i.blockedOn=null)}}for(null!==uu&&Iu(uu,e),null!==du&&Iu(du,e),null!==hu&&Iu(hu,e),pu.forEach(t),fu.forEach(t),n=0;n<gu.length;n++)(i=gu[n]).blockedOn===e&&(i.blockedOn=null);for(;0<gu.length&&null===(n=gu[0]).blockedOn;)xu(n),null===n.blockedOn&&gu.shift()}var Au={},Tu=new Map,ku=new Map,Nu=["abort","abort",jc,"animationEnd",Rc,"animationIteration",Oc,"animationStart","canplay","canPlay","canplaythrough","canPlayThrough","durationchange","durationChange","emptied","emptied","encrypted","encrypted","ended","ended","error","error","gotpointercapture","gotPointerCapture","load","load","loadeddata","loadedData","loadedmetadata","loadedMetadata","loadstart","loadStart","lostpointercapture","lostPointerCapture","playing","playing","progress","progress","seeking","seeking","stalled","stalled","suspend","suspend","timeupdate","timeUpdate",Vc,"transitionEnd","waiting","waiting"];function Pu(e,t){for(var n=0;n<e.length;n+=2){var i=e[n],r=e[n+1],s="on"+(r[0].toUpperCase()+r.slice(1));s={phasedRegistrationNames:{bubbled:s,captured:s+"Capture"},dependencies:[i],eventPriority:t},ku.set(i,t),Tu.set(i,s),Au[r]=s}}Pu("blur blur cancel cancel click click close close contextmenu contextMenu copy copy cut cut auxclick auxClick dblclick doubleClick dragend dragEnd dragstart dragStart drop drop focus focus input input invalid invalid keydown keyDown keypress keyPress keyup keyUp mousedown mouseDown mouseup mouseUp paste paste pause pause play play pointercancel pointerCancel pointerdown pointerDown pointerup pointerUp ratechange rateChange reset reset seeked seeked submit submit touchcancel touchCancel touchend touchEnd touchstart touchStart volumechange volumeChange".split(" "),0),Pu("drag drag dragenter dragEnter dragexit dragExit dragleave dragLeave dragover dragOver mousemove mouseMove mouseout mouseOut mouseover mouseOver pointermove pointerMove pointerout pointerOut pointerover pointerOver scroll scroll toggle toggle touchmove touchMove wheel wheel".split(" "),1),Pu(Nu,2);for(var zu="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),Du=0;Du<zu.length;Du++)ku.set(zu[Du],0);var Lu=Yo.unstable_UserBlockingPriority,Bu=Yo.unstable_runWithPriority,ju=!0;function Ru(e,t){Ou(t,e,!1)}function Ou(e,t,n){var i=ku.get(t);switch(void 0===i?2:i){case 0:i=Vu.bind(null,t,1,e);break;case 1:i=_u.bind(null,t,1,e);break;default:i=Uu.bind(null,t,1,e)}n?e.addEventListener(t,i,!0):e.addEventListener(t,i,!1)}function Vu(e,t,n,i){Al||Il();var r=Uu,s=Al;Al=!0;try{Sl(r,e,t,n,i)}finally{(Al=s)||kl()}}function _u(e,t,n,i){Bu(Lu,Uu.bind(null,e,t,n,i))}function Uu(e,t,n,i){if(ju)if(0<cu.length&&-1<mu.indexOf(e))e=bu(null,e,t,n,i),cu.push(e);else{var r=Wu(e,t,n,i);if(null===r)wu(e,i);else if(-1<mu.indexOf(e))e=bu(r,e,t,n,i),cu.push(e);else if(!function(e,t,n,i,r){switch(t){case"focus":return uu=yu(uu,e,t,n,i,r),!0;case"dragenter":return du=yu(du,e,t,n,i,r),!0;case"mouseover":return hu=yu(hu,e,t,n,i,r),!0;case"pointerover":var s=r.pointerId;return pu.set(s,yu(pu.get(s)||null,e,t,n,i,r)),!0;case"gotpointercapture":return s=r.pointerId,fu.set(s,yu(fu.get(s)||null,e,t,n,i,r)),!0}return!1}(r,e,t,n,i)){wu(e,i),e=nu(e,i,null,t);try{Nl(iu,e)}finally{tu(e)}}}}function Wu(e,t,n,i){if(null!==(n=vd(n=Kc(i)))){var r=Hc(n);if(null===r)n=null;else{var s=r.tag;if(13===s){if(null!==(n=Qc(r)))return n;n=null}else if(3===s){if(r.stateNode.hydrate)return 3===r.tag?r.stateNode.containerInfo:null;n=null}else r!==n&&(n=null)}}e=nu(e,i,n,t);try{Nl(iu,e)}finally{tu(e)}return null}var Hu={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Qu=["Webkit","ms","Moz","O"];function $u(e,t,n){return null==t||"boolean"==typeof t||""===t?"":n||"number"!=typeof t||0===t||Hu.hasOwnProperty(e)&&Hu[e]?(""+t).trim():t+"px"}function Fu(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var i=0===n.indexOf("--"),r=$u(n,t[n],i);"float"===n&&(n="cssFloat"),i?e.setProperty(n,r):e[n]=r}}Object.keys(Hu).forEach((function(e){Qu.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Hu[t]=Hu[e]}))}));var Zu=Zo({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Yu(e,t){if(t){if(Zu[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(Go(137,e,""));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(Go(60));if("object"!=typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(Go(61))}if(null!=t.style&&"object"!=typeof t.style)throw Error(Go(62,""))}}function Gu(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Xu=Mc;function Ju(e,t){var n=Wc(e=9===e.nodeType||11===e.nodeType?e:e.ownerDocument);t=fl[t];for(var i=0;i<t.length;i++)ru(t[i],e,n)}function Ku(){}function qu(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function ed(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function td(e,t){var n,i=ed(e);for(e=0;i;){if(3===i.nodeType){if(n=e+i.textContent.length,e<=t&&n>=t)return{node:i,offset:t-e};e=n}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=ed(i)}}function nd(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?nd(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function id(){for(var e=window,t=qu();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(i){n=!1}if(!n)break;t=qu((e=t.contentWindow).document)}return t}function rd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var sd=null,ad=null;function od(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function ld(e,t){return"textarea"===e||"option"===e||"noscript"===e||"string"==typeof t.children||"number"==typeof t.children||"object"==typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var cd="function"==typeof setTimeout?setTimeout:void 0,ud="function"==typeof clearTimeout?clearTimeout:void 0;function dd(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break}return e}function hd(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var n=e.data;if("$"===n||"$!"===n||"$?"===n){if(0===t)return e;t--}else"/$"===n&&t++}e=e.previousSibling}return null}var pd=Math.random().toString(36).slice(2),fd="__reactInternalInstance$"+pd,gd="__reactEventHandlers$"+pd,md="__reactContainere$"+pd;function vd(e){var t=e[fd];if(t)return t;for(var n=e.parentNode;n;){if(t=n[md]||n[fd]){if(n=t.alternate,null!==t.child||null!==n&&null!==n.child)for(e=hd(e);null!==e;){if(n=e[fd])return n;e=hd(e)}return t}n=(e=n).parentNode}return null}function bd(e){return!(e=e[fd]||e[md])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function wd(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(Go(33))}function yd(e){return e[gd]||null}function xd(e){do{e=e.return}while(e&&5!==e.tag);return e||null}function Cd(e,t){var n=e.stateNode;if(!n)return null;var i=il(n);if(!i)return null;n=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(i=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!i;break e;default:e=!1}if(e)return null;if(n&&"function"!=typeof n)throw Error(Go(231,t,typeof n));return n}function Md(e,t,n){(t=Cd(e,n.dispatchConfig.phasedRegistrationNames[t]))&&(n._dispatchListeners=Zc(n._dispatchListeners,t),n._dispatchInstances=Zc(n._dispatchInstances,e))}function Sd(e){if(e&&e.dispatchConfig.phasedRegistrationNames){for(var t=e._targetInst,n=[];t;)n.push(t),t=xd(t);for(t=n.length;0<t--;)Md(n[t],"captured",e);for(t=0;t<n.length;t++)Md(n[t],"bubbled",e)}}function Id(e,t,n){e&&n&&n.dispatchConfig.registrationName&&(t=Cd(e,n.dispatchConfig.registrationName))&&(n._dispatchListeners=Zc(n._dispatchListeners,t),n._dispatchInstances=Zc(n._dispatchInstances,e))}function Ed(e){e&&e.dispatchConfig.registrationName&&Id(e._targetInst,null,e)}function Ad(e){Yc(e,Sd)}var Td=null,kd=null,Nd=null;function Pd(){if(Nd)return Nd;var e,t,n=kd,i=n.length,r="value"in Td?Td.value:Td.textContent,s=r.length;for(e=0;e<i&&n[e]===r[e];e++);var a=i-e;for(t=1;t<=a&&n[i-t]===r[s-t];t++);return Nd=r.slice(e,1<t?1-t:void 0)}function zd(){return!0}function Dd(){return!1}function Ld(e,t,n,i){for(var r in this.dispatchConfig=e,this._targetInst=t,this.nativeEvent=n,e=this.constructor.Interface)e.hasOwnProperty(r)&&((t=e[r])?this[r]=t(n):"target"===r?this.target=i:this[r]=n[r]);return this.isDefaultPrevented=(null!=n.defaultPrevented?n.defaultPrevented:!1===n.returnValue)?zd:Dd,this.isPropagationStopped=Dd,this}function Bd(e,t,n,i){if(this.eventPool.length){var r=this.eventPool.pop();return this.call(r,e,t,n,i),r}return new this(e,t,n,i)}function jd(e){if(!(e instanceof this))throw Error(Go(279));e.destructor(),10>this.eventPool.length&&this.eventPool.push(e)}function Rd(e){e.eventPool=[],e.getPooled=Bd,e.release=jd}Zo(Ld.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=zd)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=zd)},persist:function(){this.isPersistent=zd},isPersistent:Dd,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=Dd,this._dispatchInstances=this._dispatchListeners=null}}),Ld.Interface={type:null,target:null,currentTarget:function(){return null},eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null},Ld.extend=function(e){function t(){}function n(){return i.apply(this,arguments)}var i=this;t.prototype=i.prototype;var r=new t;return Zo(r,n.prototype),n.prototype=r,n.prototype.constructor=n,n.Interface=Zo({},i.Interface,e),n.extend=i.extend,Rd(n),n},Rd(Ld);var Od=Ld.extend({data:null}),Vd=Ld.extend({data:null}),_d=[9,13,27,32],Ud=ml&&"CompositionEvent"in window,Wd=null;ml&&"documentMode"in document&&(Wd=document.documentMode);var Hd=ml&&"TextEvent"in window&&!Wd,Qd=ml&&(!Ud||Wd&&8<Wd&&11>=Wd),$d=String.fromCharCode(32),Fd={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},Zd=!1;function Yd(e,t){switch(e){case"keyup":return-1!==_d.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function Gd(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Xd=!1;var Jd={eventTypes:Fd,extractEvents:function(e,t,n,i){var r;if(Ud)e:{switch(e){case"compositionstart":var s=Fd.compositionStart;break e;case"compositionend":s=Fd.compositionEnd;break e;case"compositionupdate":s=Fd.compositionUpdate;break e}s=void 0}else Xd?Yd(e,n)&&(s=Fd.compositionEnd):"keydown"===e&&229===n.keyCode&&(s=Fd.compositionStart);return s?(Qd&&"ko"!==n.locale&&(Xd||s!==Fd.compositionStart?s===Fd.compositionEnd&&Xd&&(r=Pd()):(kd="value"in(Td=i)?Td.value:Td.textContent,Xd=!0)),s=Od.getPooled(s,t,n,i),r?s.data=r:null!==(r=Gd(n))&&(s.data=r),Ad(s),r=s):r=null,(e=Hd?function(e,t){switch(e){case"compositionend":return Gd(t);case"keypress":return 32!==t.which?null:(Zd=!0,$d);case"textInput":return(e=t.data)===$d&&Zd?null:e;default:return null}}(e,n):function(e,t){if(Xd)return"compositionend"===e||!Ud&&Yd(e,t)?(e=Pd(),Nd=kd=Td=null,Xd=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Qd&&"ko"!==t.locale?null:t.data;default:return null}}(e,n))?((t=Vd.getPooled(Fd.beforeInput,t,n,i)).data=e,Ad(t)):t=null,null===r?t:null===t?r:[r,t]}},Kd={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function qd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!Kd[e.type]:"textarea"===t}var eh={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:"blur change click focus input keydown keyup selectionchange".split(" ")}};function th(e,t,n){return(e=Ld.getPooled(eh.change,e,t,n)).type="change",xl(n),Ad(e),e}var nh=null,ih=null;function rh(e){Jc(e)}function sh(e){if(uc(wd(e)))return e}function ah(e,t){if("change"===e)return t}var oh=!1;function lh(){nh&&(nh.detachEvent("onpropertychange",ch),ih=nh=null)}function ch(e){if("value"===e.propertyName&&sh(ih))if(e=th(ih,e,Kc(e)),Al)Jc(e);else{Al=!0;try{Ml(rh,e)}finally{Al=!1,kl()}}}function uh(e,t,n){"focus"===e?(lh(),ih=n,(nh=t).attachEvent("onpropertychange",ch)):"blur"===e&&lh()}function dh(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return sh(ih)}function hh(e,t){if("click"===e)return sh(t)}function ph(e,t){if("input"===e||"change"===e)return sh(t)}ml&&(oh=qc("input")&&(!document.documentMode||9<document.documentMode));var fh={eventTypes:eh,_isInputEventSupported:oh,extractEvents:function(e,t,n,i){var r=t?wd(t):window,s=r.nodeName&&r.nodeName.toLowerCase();if("select"===s||"input"===s&&"file"===r.type)var a=ah;else if(qd(r))if(oh)a=ph;else{a=dh;var o=uh}else(s=r.nodeName)&&"input"===s.toLowerCase()&&("checkbox"===r.type||"radio"===r.type)&&(a=hh);if(a&&(a=a(e,t)))return th(a,n,i);o&&o(e,r,t),"blur"===e&&(e=r._wrapperState)&&e.controlled&&"number"===r.type&&mc(r,"number",r.value)}},gh=Ld.extend({view:null,detail:null}),mh={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function vh(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=mh[e])&&!!t[e]}function bh(){return vh}var wh=0,yh=0,xh=!1,Ch=!1,Mh=gh.extend({screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:bh,button:null,buttons:null,relatedTarget:function(e){return e.relatedTarget||(e.fromElement===e.srcElement?e.toElement:e.fromElement)},movementX:function(e){if("movementX"in e)return e.movementX;var t=wh;return wh=e.screenX,xh?"mousemove"===e.type?e.screenX-t:0:(xh=!0,0)},movementY:function(e){if("movementY"in e)return e.movementY;var t=yh;return yh=e.screenY,Ch?"mousemove"===e.type?e.screenY-t:0:(Ch=!0,0)}}),Sh=Mh.extend({pointerId:null,width:null,height:null,pressure:null,tangentialPressure:null,tiltX:null,tiltY:null,twist:null,pointerType:null,isPrimary:null}),Ih={mouseEnter:{registrationName:"onMouseEnter",dependencies:["mouseout","mouseover"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["mouseout","mouseover"]},pointerEnter:{registrationName:"onPointerEnter",dependencies:["pointerout","pointerover"]},pointerLeave:{registrationName:"onPointerLeave",dependencies:["pointerout","pointerover"]}},Eh={eventTypes:Ih,extractEvents:function(e,t,n,i,r){var s="mouseover"===e||"pointerover"===e,a="mouseout"===e||"pointerout"===e;if(s&&0==(32&r)&&(n.relatedTarget||n.fromElement)||!a&&!s)return null;(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,a)?(a=t,null!==(t=(t=n.relatedTarget||n.toElement)?vd(t):null)&&(t!==Hc(t)||5!==t.tag&&6!==t.tag)&&(t=null)):a=null;if(a===t)return null;if("mouseout"===e||"mouseover"===e)var o=Mh,l=Ih.mouseLeave,c=Ih.mouseEnter,u="mouse";else"pointerout"!==e&&"pointerover"!==e||(o=Sh,l=Ih.pointerLeave,c=Ih.pointerEnter,u="pointer");if(e=null==a?s:wd(a),s=null==t?s:wd(t),(l=o.getPooled(l,a,n,i)).type=u+"leave",l.target=e,l.relatedTarget=s,(n=o.getPooled(c,t,n,i)).type=u+"enter",n.target=s,n.relatedTarget=e,u=t,(i=a)&&u)e:{for(c=u,a=0,e=o=i;e;e=xd(e))a++;for(e=0,t=c;t;t=xd(t))e++;for(;0<a-e;)o=xd(o),a--;for(;0<e-a;)c=xd(c),e--;for(;a--;){if(o===c||o===c.alternate)break e;o=xd(o),c=xd(c)}o=null}else o=null;for(c=o,o=[];i&&i!==c&&(null===(a=i.alternate)||a!==c);)o.push(i),i=xd(i);for(i=[];u&&u!==c&&(null===(a=u.alternate)||a!==c);)i.push(u),u=xd(u);for(u=0;u<o.length;u++)Id(o[u],"bubbled",l);for(u=i.length;0<u--;)Id(i[u],"captured",n);return 0==(64&r)?[l]:[l,n]}};var Ah="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},Th=Object.prototype.hasOwnProperty;function kh(e,t){if(Ah(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(i=0;i<n.length;i++)if(!Th.call(t,n[i])||!Ah(e[n[i]],t[n[i]]))return!1;return!0}var Nh=ml&&"documentMode"in document&&11>=document.documentMode,Ph={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},zh=null,Dh=null,Lh=null,Bh=!1;function jh(e,t){var n=t.window===t?t.document:9===t.nodeType?t:t.ownerDocument;return Bh||null==zh||zh!==qu(n)?null:("selectionStart"in(n=zh)&&rd(n)?n={start:n.selectionStart,end:n.selectionEnd}:n={anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},Lh&&kh(Lh,n)?null:(Lh=n,(e=Ld.getPooled(Ph.select,Dh,e,t)).type="select",e.target=zh,Ad(e),e))}var Rh={eventTypes:Ph,extractEvents:function(e,t,n,i,r,s){if(!(s=!(r=s||(i.window===i?i.document:9===i.nodeType?i:i.ownerDocument)))){e:{r=Wc(r),s=fl.onSelect;for(var a=0;a<s.length;a++)if(!r.has(s[a])){r=!1;break e}r=!0}s=!r}if(s)return null;switch(r=t?wd(t):window,e){case"focus":(qd(r)||"true"===r.contentEditable)&&(zh=r,Dh=t,Lh=null);break;case"blur":Lh=Dh=zh=null;break;case"mousedown":Bh=!0;break;case"contextmenu":case"mouseup":case"dragend":return Bh=!1,jh(n,i);case"selectionchange":if(Nh)break;case"keydown":case"keyup":return jh(n,i)}return null}},Oh=Ld.extend({animationName:null,elapsedTime:null,pseudoElement:null}),Vh=Ld.extend({clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),_h=gh.extend({relatedTarget:null});function Uh(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}var Wh={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Hh={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Qh=gh.extend({key:function(e){if(e.key){var t=Wh[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=Uh(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?Hh[e.keyCode]||"Unidentified":""},location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:bh,charCode:function(e){return"keypress"===e.type?Uh(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?Uh(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),$h=Mh.extend({dataTransfer:null}),Fh=gh.extend({touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:bh}),Zh=Ld.extend({propertyName:null,elapsedTime:null,pseudoElement:null}),Yh=Mh.extend({deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:null,deltaMode:null}),Gh={eventTypes:Au,extractEvents:function(e,t,n,i){var r=Tu.get(e);if(!r)return null;switch(e){case"keypress":if(0===Uh(n))return null;case"keydown":case"keyup":e=Qh;break;case"blur":case"focus":e=_h;break;case"click":if(2===n.button)return null;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":e=Mh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":e=$h;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":e=Fh;break;case jc:case Rc:case Oc:e=Oh;break;case Vc:e=Zh;break;case"scroll":e=gh;break;case"wheel":e=Yh;break;case"copy":case"cut":case"paste":e=Vh;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":e=Sh;break;default:e=Ld}return Ad(t=e.getPooled(r,t,n,i)),t}};if(ol)throw Error(Go(101));ol=Array.prototype.slice.call("ResponderEventPlugin SimpleEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin".split(" ")),cl(),il=yd,rl=bd,sl=wd,gl({SimpleEventPlugin:Gh,EnterLeaveEventPlugin:Eh,ChangeEventPlugin:fh,SelectEventPlugin:Rh,BeforeInputEventPlugin:Jd});var Xh=[],Jh=-1;function Kh(e){0>Jh||(e.current=Xh[Jh],Xh[Jh]=null,Jh--)}function qh(e,t){Jh++,Xh[Jh]=e.current,e.current=t}var ep={},tp={current:ep},np={current:!1},ip=ep;function rp(e,t){var n=e.type.contextTypes;if(!n)return ep;var i=e.stateNode;if(i&&i.__reactInternalMemoizedUnmaskedChildContext===t)return i.__reactInternalMemoizedMaskedChildContext;var r,s={};for(r in n)s[r]=t[r];return i&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function sp(e){return null!=(e=e.childContextTypes)}function ap(){Kh(np),Kh(tp)}function op(e,t,n){if(tp.current!==ep)throw Error(Go(168));qh(tp,t),qh(np,n)}function lp(e,t,n){var i=e.stateNode;if(e=t.childContextTypes,"function"!=typeof i.getChildContext)return n;for(var r in i=i.getChildContext())if(!(r in e))throw Error(Go(108,sc(t)||"Unknown",r));return Zo({},n,{},i)}function cp(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ep,ip=tp.current,qh(tp,e),qh(np,np.current),!0}function up(e,t,n){var i=e.stateNode;if(!i)throw Error(Go(169));n?(e=lp(e,t,ip),i.__reactInternalMemoizedMergedChildContext=e,Kh(np),Kh(tp),qh(tp,e)):Kh(np),qh(np,n)}var dp=Yo.unstable_runWithPriority,hp=Yo.unstable_scheduleCallback,pp=Yo.unstable_cancelCallback,fp=Yo.unstable_requestPaint,gp=Yo.unstable_now,mp=Yo.unstable_getCurrentPriorityLevel,vp=Yo.unstable_ImmediatePriority,bp=Yo.unstable_UserBlockingPriority,wp=Yo.unstable_NormalPriority,yp=Yo.unstable_LowPriority,xp=Yo.unstable_IdlePriority,Cp={},Mp=Yo.unstable_shouldYield,Sp=void 0!==fp?fp:function(){},Ip=null,Ep=null,Ap=!1,Tp=gp(),kp=1e4>Tp?gp:function(){return gp()-Tp};function Np(){switch(mp()){case vp:return 99;case bp:return 98;case wp:return 97;case yp:return 96;case xp:return 95;default:throw Error(Go(332))}}function Pp(e){switch(e){case 99:return vp;case 98:return bp;case 97:return wp;case 96:return yp;case 95:return xp;default:throw Error(Go(332))}}function zp(e,t){return e=Pp(e),dp(e,t)}function Dp(e,t,n){return e=Pp(e),hp(e,t,n)}function Lp(e){return null===Ip?(Ip=[e],Ep=hp(vp,jp)):Ip.push(e),Cp}function Bp(){if(null!==Ep){var e=Ep;Ep=null,pp(e)}jp()}function jp(){if(!Ap&&null!==Ip){Ap=!0;var e=0;try{var t=Ip;zp(99,(function(){for(;e<t.length;e++){var n=t[e];do{n=n(!0)}while(null!==n)}})),Ip=null}catch(n){throw null!==Ip&&(Ip=Ip.slice(e+1)),hp(vp,Bp),n}finally{Ap=!1}}}function Rp(e,t,n){return 1073741821-(1+((1073741821-e+t/10)/(n/=10)|0))*n}function Op(e,t){if(e&&e.defaultProps)for(var n in t=Zo({},t),e=e.defaultProps)void 0===t[n]&&(t[n]=e[n]);return t}var Vp={current:null},_p=null,Up=null,Wp=null;function Hp(){Wp=Up=_p=null}function Qp(e){var t=Vp.current;Kh(Vp),e.type._context._currentValue=t}function $p(e,t){for(;null!==e;){var n=e.alternate;if(e.childExpirationTime<t)e.childExpirationTime=t,null!==n&&n.childExpirationTime<t&&(n.childExpirationTime=t);else{if(!(null!==n&&n.childExpirationTime<t))break;n.childExpirationTime=t}e=e.return}}function Fp(e,t){_p=e,Wp=Up=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(e.expirationTime>=t&&(yg=!0),e.firstContext=null)}function Zp(e,t){if(Wp!==e&&!1!==t&&0!==t)if("number"==typeof t&&1073741823!==t||(Wp=e,t=1073741823),t={context:e,observedBits:t,next:null},null===Up){if(null===_p)throw Error(Go(308));Up=t,_p.dependencies={expirationTime:0,firstContext:t,responders:null}}else Up=Up.next=t;return e._currentValue}var Yp=!1;function Gp(e){e.updateQueue={baseState:e.memoizedState,baseQueue:null,shared:{pending:null},effects:null}}function Xp(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,baseQueue:e.baseQueue,shared:e.shared,effects:e.effects})}function Jp(e,t){return(e={expirationTime:e,suspenseConfig:t,tag:0,payload:null,callback:null,next:null}).next=e}function Kp(e,t){if(null!==(e=e.updateQueue)){var n=(e=e.shared).pending;null===n?t.next=t:(t.next=n.next,n.next=t),e.pending=t}}function qp(e,t){var n=e.alternate;null!==n&&Xp(n,e),null===(n=(e=e.updateQueue).baseQueue)?(e.baseQueue=t.next=t,t.next=t):(t.next=n.next,n.next=t)}function ef(e,t,n,i){var r=e.updateQueue;Yp=!1;var s=r.baseQueue,a=r.shared.pending;if(null!==a){if(null!==s){var o=s.next;s.next=a.next,a.next=o}s=a,r.shared.pending=null,null!==(o=e.alternate)&&(null!==(o=o.updateQueue)&&(o.baseQueue=a))}if(null!==s){o=s.next;var l=r.baseState,c=0,u=null,d=null,h=null;if(null!==o)for(var p=o;;){if((a=p.expirationTime)<i){var f={expirationTime:p.expirationTime,suspenseConfig:p.suspenseConfig,tag:p.tag,payload:p.payload,callback:p.callback,next:null};null===h?(d=h=f,u=l):h=h.next=f,a>c&&(c=a)}else{null!==h&&(h=h.next={expirationTime:1073741823,suspenseConfig:p.suspenseConfig,tag:p.tag,payload:p.payload,callback:p.callback,next:null}),Jm(a,p.suspenseConfig);e:{var g=e,m=p;switch(a=t,f=n,m.tag){case 1:if("function"==typeof(g=m.payload)){l=g.call(f,l,a);break e}l=g;break e;case 3:g.effectTag=-4097&g.effectTag|64;case 0:if(null==(a="function"==typeof(g=m.payload)?g.call(f,l,a):g))break e;l=Zo({},l,a);break e;case 2:Yp=!0}}null!==p.callback&&(e.effectTag|=32,null===(a=r.effects)?r.effects=[p]:a.push(p))}if(null===(p=p.next)||p===o){if(null===(a=r.shared.pending))break;p=s.next=a.next,a.next=o,r.baseQueue=s=a,r.shared.pending=null}}null===h?u=l:h.next=d,r.baseState=u,r.baseQueue=h,Km(c),e.expirationTime=c,e.memoizedState=l}}function tf(e,t,n){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var i=e[t],r=i.callback;if(null!==r){if(i.callback=null,i=r,r=n,"function"!=typeof i)throw Error(Go(191,i));i.call(r)}}}var nf=Vl.ReactCurrentBatchConfig,rf=(new Fo.Component).refs;function sf(e,t,n,i){n=null==(n=n(i,t=e.memoizedState))?t:Zo({},t,n),e.memoizedState=n,0===e.expirationTime&&(e.updateQueue.baseState=n)}var af={isMounted:function(e){return!!(e=e._reactInternalFiber)&&Hc(e)===e},enqueueSetState:function(e,t,n){e=e._reactInternalFiber;var i=Om(),r=nf.suspense;(r=Jp(i=Vm(i,e,r),r)).payload=t,null!=n&&(r.callback=n),Kp(e,r),_m(e,i)},enqueueReplaceState:function(e,t,n){e=e._reactInternalFiber;var i=Om(),r=nf.suspense;(r=Jp(i=Vm(i,e,r),r)).tag=1,r.payload=t,null!=n&&(r.callback=n),Kp(e,r),_m(e,i)},enqueueForceUpdate:function(e,t){e=e._reactInternalFiber;var n=Om(),i=nf.suspense;(i=Jp(n=Vm(n,e,i),i)).tag=2,null!=t&&(i.callback=t),Kp(e,i),_m(e,n)}};function of(e,t,n,i,r,s,a){return"function"==typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(i,s,a):!t.prototype||!t.prototype.isPureReactComponent||(!kh(n,i)||!kh(r,s))}function lf(e,t,n){var i=!1,r=ep,s=t.contextType;return"object"==typeof s&&null!==s?s=Zp(s):(r=sp(t)?ip:tp.current,s=(i=null!=(i=t.contextTypes))?rp(e,r):ep),t=new t(n,s),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=af,e.stateNode=t,t._reactInternalFiber=e,i&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=r,e.__reactInternalMemoizedMaskedChildContext=s),t}function cf(e,t,n,i){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,i),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,i),t.state!==e&&af.enqueueReplaceState(t,t.state,null)}function uf(e,t,n,i){var r=e.stateNode;r.props=n,r.state=e.memoizedState,r.refs=rf,Gp(e);var s=t.contextType;"object"==typeof s&&null!==s?r.context=Zp(s):(s=sp(t)?ip:tp.current,r.context=rp(e,s)),ef(e,n,r,i),r.state=e.memoizedState,"function"==typeof(s=t.getDerivedStateFromProps)&&(sf(e,t,s,n),r.state=e.memoizedState),"function"==typeof t.getDerivedStateFromProps||"function"==typeof r.getSnapshotBeforeUpdate||"function"!=typeof r.UNSAFE_componentWillMount&&"function"!=typeof r.componentWillMount||(t=r.state,"function"==typeof r.componentWillMount&&r.componentWillMount(),"function"==typeof r.UNSAFE_componentWillMount&&r.UNSAFE_componentWillMount(),t!==r.state&&af.enqueueReplaceState(r,r.state,null),ef(e,n,r,i),r.state=e.memoizedState),"function"==typeof r.componentDidMount&&(e.effectTag|=4)}var df=Array.isArray;function hf(e,t,n){if(null!==(e=n.ref)&&"function"!=typeof e&&"object"!=typeof e){if(n._owner){if(n=n._owner){if(1!==n.tag)throw Error(Go(309));var i=n.stateNode}if(!i)throw Error(Go(147,e));var r=""+e;return null!==t&&null!==t.ref&&"function"==typeof t.ref&&t.ref._stringRef===r?t.ref:((t=function(e){var t=i.refs;t===rf&&(t=i.refs={}),null===e?delete t[r]:t[r]=e})._stringRef=r,t)}if("string"!=typeof e)throw Error(Go(284));if(!n._owner)throw Error(Go(290,e))}return e}function pf(e,t){if("textarea"!==e.type)throw Error(Go(31,"[object Object]"===Object.prototype.toString.call(t)?"object with keys {"+Object.keys(t).join(", ")+"}":t,""))}function ff(e){function t(t,n){if(e){var i=t.lastEffect;null!==i?(i.nextEffect=n,t.lastEffect=n):t.firstEffect=t.lastEffect=n,n.nextEffect=null,n.effectTag=8}}function n(n,i){if(!e)return null;for(;null!==i;)t(n,i),i=i.sibling;return null}function i(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function r(e,t){return(e=bv(e,t)).index=0,e.sibling=null,e}function s(t,n,i){return t.index=i,e?null!==(i=t.alternate)?(i=i.index)<n?(t.effectTag=2,n):i:(t.effectTag=2,n):n}function a(t){return e&&null===t.alternate&&(t.effectTag=2),t}function o(e,t,n,i){return null===t||6!==t.tag?((t=xv(n,e.mode,i)).return=e,t):((t=r(t,n)).return=e,t)}function l(e,t,n,i){return null!==t&&t.elementType===n.type?((i=r(t,n.props)).ref=hf(e,t,n),i.return=e,i):((i=wv(n.type,n.key,n.props,null,e.mode,i)).ref=hf(e,t,n),i.return=e,i)}function c(e,t,n,i){return null===t||4!==t.tag||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?((t=Cv(n,e.mode,i)).return=e,t):((t=r(t,n.children||[])).return=e,t)}function u(e,t,n,i,s){return null===t||7!==t.tag?((t=yv(n,e.mode,i,s)).return=e,t):((t=r(t,n)).return=e,t)}function d(e,t,n){if("string"==typeof t||"number"==typeof t)return(t=xv(""+t,e.mode,n)).return=e,t;if("object"==typeof t&&null!==t){switch(t.$$typeof){case Hl:return(n=wv(t.type,t.key,t.props,null,e.mode,n)).ref=hf(e,null,t),n.return=e,n;case Ql:return(t=Cv(t,e.mode,n)).return=e,t}if(df(t)||rc(t))return(t=yv(t,e.mode,n,null)).return=e,t;pf(e,t)}return null}function h(e,t,n,i){var r=null!==t?t.key:null;if("string"==typeof n||"number"==typeof n)return null!==r?null:o(e,t,""+n,i);if("object"==typeof n&&null!==n){switch(n.$$typeof){case Hl:return n.key===r?n.type===$l?u(e,t,n.props.children,i,r):l(e,t,n,i):null;case Ql:return n.key===r?c(e,t,n,i):null}if(df(n)||rc(n))return null!==r?null:u(e,t,n,i,null);pf(e,n)}return null}function p(e,t,n,i,r){if("string"==typeof i||"number"==typeof i)return o(t,e=e.get(n)||null,""+i,r);if("object"==typeof i&&null!==i){switch(i.$$typeof){case Hl:return e=e.get(null===i.key?n:i.key)||null,i.type===$l?u(t,e,i.props.children,r,i.key):l(t,e,i,r);case Ql:return c(t,e=e.get(null===i.key?n:i.key)||null,i,r)}if(df(i)||rc(i))return u(t,e=e.get(n)||null,i,r,null);pf(t,i)}return null}return function(o,l,c,u){var f="object"==typeof c&&null!==c&&c.type===$l&&null===c.key;f&&(c=c.props.children);var g="object"==typeof c&&null!==c;if(g)switch(c.$$typeof){case Hl:e:{for(g=c.key,f=l;null!==f;){if(f.key===g){switch(f.tag){case 7:if(c.type===$l){n(o,f.sibling),(l=r(f,c.props.children)).return=o,o=l;break e}break;default:if(f.elementType===c.type){n(o,f.sibling),(l=r(f,c.props)).ref=hf(o,f,c),l.return=o,o=l;break e}}n(o,f);break}t(o,f),f=f.sibling}c.type===$l?((l=yv(c.props.children,o.mode,u,c.key)).return=o,o=l):((u=wv(c.type,c.key,c.props,null,o.mode,u)).ref=hf(o,l,c),u.return=o,o=u)}return a(o);case Ql:e:{for(f=c.key;null!==l;){if(l.key===f){if(4===l.tag&&l.stateNode.containerInfo===c.containerInfo&&l.stateNode.implementation===c.implementation){n(o,l.sibling),(l=r(l,c.children||[])).return=o,o=l;break e}n(o,l);break}t(o,l),l=l.sibling}(l=Cv(c,o.mode,u)).return=o,o=l}return a(o)}if("string"==typeof c||"number"==typeof c)return c=""+c,null!==l&&6===l.tag?(n(o,l.sibling),(l=r(l,c)).return=o,o=l):(n(o,l),(l=xv(c,o.mode,u)).return=o,o=l),a(o);if(df(c))return function(r,a,o,l){for(var c=null,u=null,f=a,g=a=0,m=null;null!==f&&g<o.length;g++){f.index>g?(m=f,f=null):m=f.sibling;var v=h(r,f,o[g],l);if(null===v){null===f&&(f=m);break}e&&f&&null===v.alternate&&t(r,f),a=s(v,a,g),null===u?c=v:u.sibling=v,u=v,f=m}if(g===o.length)return n(r,f),c;if(null===f){for(;g<o.length;g++)null!==(f=d(r,o[g],l))&&(a=s(f,a,g),null===u?c=f:u.sibling=f,u=f);return c}for(f=i(r,f);g<o.length;g++)null!==(m=p(f,r,g,o[g],l))&&(e&&null!==m.alternate&&f.delete(null===m.key?g:m.key),a=s(m,a,g),null===u?c=m:u.sibling=m,u=m);return e&&f.forEach((function(e){return t(r,e)})),c}(o,l,c,u);if(rc(c))return function(r,a,o,l){var c=rc(o);if("function"!=typeof c)throw Error(Go(150));if(null==(o=c.call(o)))throw Error(Go(151));for(var u=c=null,f=a,g=a=0,m=null,v=o.next();null!==f&&!v.done;g++,v=o.next()){f.index>g?(m=f,f=null):m=f.sibling;var b=h(r,f,v.value,l);if(null===b){null===f&&(f=m);break}e&&f&&null===b.alternate&&t(r,f),a=s(b,a,g),null===u?c=b:u.sibling=b,u=b,f=m}if(v.done)return n(r,f),c;if(null===f){for(;!v.done;g++,v=o.next())null!==(v=d(r,v.value,l))&&(a=s(v,a,g),null===u?c=v:u.sibling=v,u=v);return c}for(f=i(r,f);!v.done;g++,v=o.next())null!==(v=p(f,r,g,v.value,l))&&(e&&null!==v.alternate&&f.delete(null===v.key?g:v.key),a=s(v,a,g),null===u?c=v:u.sibling=v,u=v);return e&&f.forEach((function(e){return t(r,e)})),c}(o,l,c,u);if(g&&pf(o,c),void 0===c&&!f)switch(o.tag){case 1:case 0:throw o=o.type,Error(Go(152,o.displayName||o.name||"Component"))}return n(o,l)}}var gf=ff(!0),mf=ff(!1),vf={},bf={current:vf},wf={current:vf},yf={current:vf};function xf(e){if(e===vf)throw Error(Go(174));return e}function Cf(e,t){switch(qh(yf,t),qh(wf,e),qh(bf,vf),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Ec(null,"");break;default:t=Ec(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}Kh(bf),qh(bf,t)}function Mf(){Kh(bf),Kh(wf),Kh(yf)}function Sf(e){xf(yf.current);var t=xf(bf.current),n=Ec(t,e.type);t!==n&&(qh(wf,e),qh(bf,n))}function If(e){wf.current===e&&(Kh(bf),Kh(wf))}var Ef={current:0};function Af(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(64&t.effectTag))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function Tf(e,t){return{responder:e,props:t}}var kf=Vl.ReactCurrentDispatcher,Nf=Vl.ReactCurrentBatchConfig,Pf=0,zf=null,Df=null,Lf=null,Bf=!1;function jf(){throw Error(Go(321))}function Rf(e,t){if(null===t)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Ah(e[n],t[n]))return!1;return!0}function Of(e,t,n,i,r,s){if(Pf=s,zf=t,t.memoizedState=null,t.updateQueue=null,t.expirationTime=0,kf.current=null===e||null===e.memoizedState?og:lg,e=n(i,r),t.expirationTime===Pf){s=0;do{if(t.expirationTime=0,!(25>s))throw Error(Go(301));s+=1,Lf=Df=null,t.updateQueue=null,kf.current=cg,e=n(i,r)}while(t.expirationTime===Pf)}if(kf.current=ag,t=null!==Df&&null!==Df.next,Pf=0,Lf=Df=zf=null,Bf=!1,t)throw Error(Go(300));return e}function Vf(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===Lf?zf.memoizedState=Lf=e:Lf=Lf.next=e,Lf}function _f(){if(null===Df){var e=zf.alternate;e=null!==e?e.memoizedState:null}else e=Df.next;var t=null===Lf?zf.memoizedState:Lf.next;if(null!==t)Lf=t,Df=e;else{if(null===e)throw Error(Go(310));e={memoizedState:(Df=e).memoizedState,baseState:Df.baseState,baseQueue:Df.baseQueue,queue:Df.queue,next:null},null===Lf?zf.memoizedState=Lf=e:Lf=Lf.next=e}return Lf}function Uf(e,t){return"function"==typeof t?t(e):t}function Wf(e){var t=_f(),n=t.queue;if(null===n)throw Error(Go(311));n.lastRenderedReducer=e;var i=Df,r=i.baseQueue,s=n.pending;if(null!==s){if(null!==r){var a=r.next;r.next=s.next,s.next=a}i.baseQueue=r=s,n.pending=null}if(null!==r){r=r.next,i=i.baseState;var o=a=s=null,l=r;do{var c=l.expirationTime;if(c<Pf){var u={expirationTime:l.expirationTime,suspenseConfig:l.suspenseConfig,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null};null===o?(a=o=u,s=i):o=o.next=u,c>zf.expirationTime&&(zf.expirationTime=c,Km(c))}else null!==o&&(o=o.next={expirationTime:1073741823,suspenseConfig:l.suspenseConfig,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null}),Jm(c,l.suspenseConfig),i=l.eagerReducer===e?l.eagerState:e(i,l.action);l=l.next}while(null!==l&&l!==r);null===o?s=i:o.next=a,Ah(i,t.memoizedState)||(yg=!0),t.memoizedState=i,t.baseState=s,t.baseQueue=o,n.lastRenderedState=i}return[t.memoizedState,n.dispatch]}function Hf(e){var t=_f(),n=t.queue;if(null===n)throw Error(Go(311));n.lastRenderedReducer=e;var i=n.dispatch,r=n.pending,s=t.memoizedState;if(null!==r){n.pending=null;var a=r=r.next;do{s=e(s,a.action),a=a.next}while(a!==r);Ah(s,t.memoizedState)||(yg=!0),t.memoizedState=s,null===t.baseQueue&&(t.baseState=s),n.lastRenderedState=s}return[s,i]}function Qf(e){var t=Vf();return"function"==typeof e&&(e=e()),t.memoizedState=t.baseState=e,e=(e=t.queue={pending:null,dispatch:null,lastRenderedReducer:Uf,lastRenderedState:e}).dispatch=sg.bind(null,zf,e),[t.memoizedState,e]}function $f(e,t,n,i){return e={tag:e,create:t,destroy:n,deps:i,next:null},null===(t=zf.updateQueue)?(t={lastEffect:null},zf.updateQueue=t,t.lastEffect=e.next=e):null===(n=t.lastEffect)?t.lastEffect=e.next=e:(i=n.next,n.next=e,e.next=i,t.lastEffect=e),e}function Ff(){return _f().memoizedState}function Zf(e,t,n,i){var r=Vf();zf.effectTag|=e,r.memoizedState=$f(1|t,n,void 0,void 0===i?null:i)}function Yf(e,t,n,i){var r=_f();i=void 0===i?null:i;var s=void 0;if(null!==Df){var a=Df.memoizedState;if(s=a.destroy,null!==i&&Rf(i,a.deps))return void $f(t,n,s,i)}zf.effectTag|=e,r.memoizedState=$f(1|t,n,s,i)}function Gf(e,t){return Zf(516,4,e,t)}function Xf(e,t){return Yf(516,4,e,t)}function Jf(e,t){return Yf(4,2,e,t)}function Kf(e,t){return"function"==typeof t?(e=e(),t(e),function(){t(null)}):null!=t?(e=e(),t.current=e,function(){t.current=null}):void 0}function qf(e,t,n){return n=null!=n?n.concat([e]):null,Yf(4,2,Kf.bind(null,t,e),n)}function eg(){}function tg(e,t){return Vf().memoizedState=[e,void 0===t?null:t],e}function ng(e,t){var n=_f();t=void 0===t?null:t;var i=n.memoizedState;return null!==i&&null!==t&&Rf(t,i[1])?i[0]:(n.memoizedState=[e,t],e)}function ig(e,t){var n=_f();t=void 0===t?null:t;var i=n.memoizedState;return null!==i&&null!==t&&Rf(t,i[1])?i[0]:(e=e(),n.memoizedState=[e,t],e)}function rg(e,t,n){var i=Np();zp(98>i?98:i,(function(){e(!0)})),zp(97<i?97:i,(function(){var i=Nf.suspense;Nf.suspense=void 0===t?null:t;try{e(!1),n()}finally{Nf.suspense=i}}))}function sg(e,t,n){var i=Om(),r=nf.suspense;r={expirationTime:i=Vm(i,e,r),suspenseConfig:r,action:n,eagerReducer:null,eagerState:null,next:null};var s=t.pending;if(null===s?r.next=r:(r.next=s.next,s.next=r),t.pending=r,s=e.alternate,e===zf||null!==s&&s===zf)Bf=!0,r.expirationTime=Pf,zf.expirationTime=Pf;else{if(0===e.expirationTime&&(null===s||0===s.expirationTime)&&null!==(s=t.lastRenderedReducer))try{var a=t.lastRenderedState,o=s(a,n);if(r.eagerReducer=s,r.eagerState=o,Ah(o,a))return}catch(l){}_m(e,i)}}var ag={readContext:Zp,useCallback:jf,useContext:jf,useEffect:jf,useImperativeHandle:jf,useLayoutEffect:jf,useMemo:jf,useReducer:jf,useRef:jf,useState:jf,useDebugValue:jf,useResponder:jf,useDeferredValue:jf,useTransition:jf},og={readContext:Zp,useCallback:tg,useContext:Zp,useEffect:Gf,useImperativeHandle:function(e,t,n){return n=null!=n?n.concat([e]):null,Zf(4,2,Kf.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Zf(4,2,e,t)},useMemo:function(e,t){var n=Vf();return t=void 0===t?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var i=Vf();return t=void 0!==n?n(t):t,i.memoizedState=i.baseState=t,e=(e=i.queue={pending:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t}).dispatch=sg.bind(null,zf,e),[i.memoizedState,e]},useRef:function(e){return e={current:e},Vf().memoizedState=e},useState:Qf,useDebugValue:eg,useResponder:Tf,useDeferredValue:function(e,t){var n=Qf(e),i=n[0],r=n[1];return Gf((function(){var n=Nf.suspense;Nf.suspense=void 0===t?null:t;try{r(e)}finally{Nf.suspense=n}}),[e,t]),i},useTransition:function(e){var t=Qf(!1),n=t[0];return t=t[1],[tg(rg.bind(null,t,e),[t,e]),n]}},lg={readContext:Zp,useCallback:ng,useContext:Zp,useEffect:Xf,useImperativeHandle:qf,useLayoutEffect:Jf,useMemo:ig,useReducer:Wf,useRef:Ff,useState:function(){return Wf(Uf)},useDebugValue:eg,useResponder:Tf,useDeferredValue:function(e,t){var n=Wf(Uf),i=n[0],r=n[1];return Xf((function(){var n=Nf.suspense;Nf.suspense=void 0===t?null:t;try{r(e)}finally{Nf.suspense=n}}),[e,t]),i},useTransition:function(e){var t=Wf(Uf),n=t[0];return t=t[1],[ng(rg.bind(null,t,e),[t,e]),n]}},cg={readContext:Zp,useCallback:ng,useContext:Zp,useEffect:Xf,useImperativeHandle:qf,useLayoutEffect:Jf,useMemo:ig,useReducer:Hf,useRef:Ff,useState:function(){return Hf(Uf)},useDebugValue:eg,useResponder:Tf,useDeferredValue:function(e,t){var n=Hf(Uf),i=n[0],r=n[1];return Xf((function(){var n=Nf.suspense;Nf.suspense=void 0===t?null:t;try{r(e)}finally{Nf.suspense=n}}),[e,t]),i},useTransition:function(e){var t=Hf(Uf),n=t[0];return t=t[1],[ng(rg.bind(null,t,e),[t,e]),n]}},ug=null,dg=null,hg=!1;function pg(e,t){var n=mv(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.effectTag=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function fg(e,t){switch(e.tag){case 5:var n=e.type;return null!==(t=1!==t.nodeType||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,!0);case 13:default:return!1}}function gg(e){if(hg){var t=dg;if(t){var n=t;if(!fg(e,t)){if(!(t=dd(n.nextSibling))||!fg(e,t))return e.effectTag=-1025&e.effectTag|2,hg=!1,void(ug=e);pg(ug,n)}ug=e,dg=dd(t.firstChild)}else e.effectTag=-1025&e.effectTag|2,hg=!1,ug=e}}function mg(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;ug=e}function vg(e){if(e!==ug)return!1;if(!hg)return mg(e),hg=!0,!1;var t=e.type;if(5!==e.tag||"head"!==t&&"body"!==t&&!ld(t,e.memoizedProps))for(t=dg;t;)pg(e,t),t=dd(t.nextSibling);if(mg(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(Go(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var n=e.data;if("/$"===n){if(0===t){dg=dd(e.nextSibling);break e}t--}else"$"!==n&&"$!"!==n&&"$?"!==n||t++}e=e.nextSibling}dg=null}}else dg=ug?dd(e.stateNode.nextSibling):null;return!0}function bg(){dg=ug=null,hg=!1}var wg=Vl.ReactCurrentOwner,yg=!1;function xg(e,t,n,i){t.child=null===e?mf(t,null,n,i):gf(t,e.child,n,i)}function Cg(e,t,n,i,r){n=n.render;var s=t.ref;return Fp(t,r),i=Of(e,t,n,i,s,r),null===e||yg?(t.effectTag|=1,xg(e,t,i,r),t.child):(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=r&&(e.expirationTime=0),Og(e,t,r))}function Mg(e,t,n,i,r,s){if(null===e){var a=n.type;return"function"!=typeof a||vv(a)||void 0!==a.defaultProps||null!==n.compare||void 0!==n.defaultProps?((e=wv(n.type,null,i,null,t.mode,s)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=a,Sg(e,t,a,i,r,s))}return a=e.child,r<s&&(r=a.memoizedProps,(n=null!==(n=n.compare)?n:kh)(r,i)&&e.ref===t.ref)?Og(e,t,s):(t.effectTag|=1,(e=bv(a,i)).ref=t.ref,e.return=t,t.child=e)}function Sg(e,t,n,i,r,s){return null!==e&&kh(e.memoizedProps,i)&&e.ref===t.ref&&(yg=!1,r<s)?(t.expirationTime=e.expirationTime,Og(e,t,s)):Eg(e,t,n,i,s)}function Ig(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.effectTag|=128)}function Eg(e,t,n,i,r){var s=sp(n)?ip:tp.current;return s=rp(t,s),Fp(t,r),n=Of(e,t,n,i,s,r),null===e||yg?(t.effectTag|=1,xg(e,t,n,r),t.child):(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=r&&(e.expirationTime=0),Og(e,t,r))}function Ag(e,t,n,i,r){if(sp(n)){var s=!0;cp(t)}else s=!1;if(Fp(t,r),null===t.stateNode)null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),lf(t,n,i),uf(t,n,i,r),i=!0;else if(null===e){var a=t.stateNode,o=t.memoizedProps;a.props=o;var l=a.context,c=n.contextType;"object"==typeof c&&null!==c?c=Zp(c):c=rp(t,c=sp(n)?ip:tp.current);var u=n.getDerivedStateFromProps,d="function"==typeof u||"function"==typeof a.getSnapshotBeforeUpdate;d||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(o!==i||l!==c)&&cf(t,a,i,c),Yp=!1;var h=t.memoizedState;a.state=h,ef(t,i,a,r),l=t.memoizedState,o!==i||h!==l||np.current||Yp?("function"==typeof u&&(sf(t,n,u,i),l=t.memoizedState),(o=Yp||of(t,n,o,i,h,l,c))?(d||"function"!=typeof a.UNSAFE_componentWillMount&&"function"!=typeof a.componentWillMount||("function"==typeof a.componentWillMount&&a.componentWillMount(),"function"==typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"==typeof a.componentDidMount&&(t.effectTag|=4)):("function"==typeof a.componentDidMount&&(t.effectTag|=4),t.memoizedProps=i,t.memoizedState=l),a.props=i,a.state=l,a.context=c,i=o):("function"==typeof a.componentDidMount&&(t.effectTag|=4),i=!1)}else a=t.stateNode,Xp(e,t),o=t.memoizedProps,a.props=t.type===t.elementType?o:Op(t.type,o),l=a.context,"object"==typeof(c=n.contextType)&&null!==c?c=Zp(c):c=rp(t,c=sp(n)?ip:tp.current),(d="function"==typeof(u=n.getDerivedStateFromProps)||"function"==typeof a.getSnapshotBeforeUpdate)||"function"!=typeof a.UNSAFE_componentWillReceiveProps&&"function"!=typeof a.componentWillReceiveProps||(o!==i||l!==c)&&cf(t,a,i,c),Yp=!1,l=t.memoizedState,a.state=l,ef(t,i,a,r),h=t.memoizedState,o!==i||l!==h||np.current||Yp?("function"==typeof u&&(sf(t,n,u,i),h=t.memoizedState),(u=Yp||of(t,n,o,i,l,h,c))?(d||"function"!=typeof a.UNSAFE_componentWillUpdate&&"function"!=typeof a.componentWillUpdate||("function"==typeof a.componentWillUpdate&&a.componentWillUpdate(i,h,c),"function"==typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(i,h,c)),"function"==typeof a.componentDidUpdate&&(t.effectTag|=4),"function"==typeof a.getSnapshotBeforeUpdate&&(t.effectTag|=256)):("function"!=typeof a.componentDidUpdate||o===e.memoizedProps&&l===e.memoizedState||(t.effectTag|=4),"function"!=typeof a.getSnapshotBeforeUpdate||o===e.memoizedProps&&l===e.memoizedState||(t.effectTag|=256),t.memoizedProps=i,t.memoizedState=h),a.props=i,a.state=h,a.context=c,i=u):("function"!=typeof a.componentDidUpdate||o===e.memoizedProps&&l===e.memoizedState||(t.effectTag|=4),"function"!=typeof a.getSnapshotBeforeUpdate||o===e.memoizedProps&&l===e.memoizedState||(t.effectTag|=256),i=!1);return Tg(e,t,n,i,s,r)}function Tg(e,t,n,i,r,s){Ig(e,t);var a=0!=(64&t.effectTag);if(!i&&!a)return r&&up(t,n,!1),Og(e,t,s);i=t.stateNode,wg.current=t;var o=a&&"function"!=typeof n.getDerivedStateFromError?null:i.render();return t.effectTag|=1,null!==e&&a?(t.child=gf(t,e.child,null,s),t.child=gf(t,null,o,s)):xg(e,t,o,s),t.memoizedState=i.state,r&&up(t,n,!0),t.child}function kg(e){var t=e.stateNode;t.pendingContext?op(0,t.pendingContext,t.pendingContext!==t.context):t.context&&op(0,t.context,!1),Cf(e,t.containerInfo)}var Ng,Pg,zg,Dg={dehydrated:null,retryTime:0};function Lg(e,t,n){var i,r=t.mode,s=t.pendingProps,a=Ef.current,o=!1;if((i=0!=(64&t.effectTag))||(i=0!=(2&a)&&(null===e||null!==e.memoizedState)),i?(o=!0,t.effectTag&=-65):null!==e&&null===e.memoizedState||void 0===s.fallback||!0===s.unstable_avoidThisFallback||(a|=1),qh(Ef,1&a),null===e){if(void 0!==s.fallback&&gg(t),o){if(o=s.fallback,(s=yv(null,r,0,null)).return=t,0==(2&t.mode))for(e=null!==t.memoizedState?t.child.child:t.child,s.child=e;null!==e;)e.return=s,e=e.sibling;return(n=yv(o,r,n,null)).return=t,s.sibling=n,t.memoizedState=Dg,t.child=s,n}return r=s.children,t.memoizedState=null,t.child=mf(t,null,r,n)}if(null!==e.memoizedState){if(r=(e=e.child).sibling,o){if(s=s.fallback,(n=bv(e,e.pendingProps)).return=t,0==(2&t.mode)&&(o=null!==t.memoizedState?t.child.child:t.child)!==e.child)for(n.child=o;null!==o;)o.return=n,o=o.sibling;return(r=bv(r,s)).return=t,n.sibling=r,n.childExpirationTime=0,t.memoizedState=Dg,t.child=n,r}return n=gf(t,e.child,s.children,n),t.memoizedState=null,t.child=n}if(e=e.child,o){if(o=s.fallback,(s=yv(null,r,0,null)).return=t,s.child=e,null!==e&&(e.return=s),0==(2&t.mode))for(e=null!==t.memoizedState?t.child.child:t.child,s.child=e;null!==e;)e.return=s,e=e.sibling;return(n=yv(o,r,n,null)).return=t,s.sibling=n,n.effectTag|=2,s.childExpirationTime=0,t.memoizedState=Dg,t.child=s,n}return t.memoizedState=null,t.child=gf(t,e,s.children,n)}function Bg(e,t){e.expirationTime<t&&(e.expirationTime=t);var n=e.alternate;null!==n&&n.expirationTime<t&&(n.expirationTime=t),$p(e.return,t)}function jg(e,t,n,i,r,s){var a=e.memoizedState;null===a?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:n,tailExpiration:0,tailMode:r,lastEffect:s}:(a.isBackwards=t,a.rendering=null,a.renderingStartTime=0,a.last=i,a.tail=n,a.tailExpiration=0,a.tailMode=r,a.lastEffect=s)}function Rg(e,t,n){var i=t.pendingProps,r=i.revealOrder,s=i.tail;if(xg(e,t,i.children,n),0!=(2&(i=Ef.current)))i=1&i|2,t.effectTag|=64;else{if(null!==e&&0!=(64&e.effectTag))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&Bg(e,n);else if(19===e.tag)Bg(e,n);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}i&=1}if(qh(Ef,i),0==(2&t.mode))t.memoizedState=null;else switch(r){case"forwards":for(n=t.child,r=null;null!==n;)null!==(e=n.alternate)&&null===Af(e)&&(r=n),n=n.sibling;null===(n=r)?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),jg(t,!1,r,n,s,t.lastEffect);break;case"backwards":for(n=null,r=t.child,t.child=null;null!==r;){if(null!==(e=r.alternate)&&null===Af(e)){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}jg(t,!0,n,null,s,t.lastEffect);break;case"together":jg(t,!1,null,null,void 0,t.lastEffect);break;default:t.memoizedState=null}return t.child}function Og(e,t,n){null!==e&&(t.dependencies=e.dependencies);var i=t.expirationTime;if(0!==i&&Km(i),t.childExpirationTime<n)return null;if(null!==e&&t.child!==e.child)throw Error(Go(153));if(null!==t.child){for(n=bv(e=t.child,e.pendingProps),t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=bv(e,e.pendingProps)).return=t;n.sibling=null}return t.child}function Vg(e,t){switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;null!==t;)null!==t.alternate&&(n=t),t=t.sibling;null===n?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var i=null;null!==n;)null!==n.alternate&&(i=n),n=n.sibling;null===i?t||null===e.tail?e.tail=null:e.tail.sibling=null:i.sibling=null}}function _g(e,t,n){var i=t.pendingProps;switch(t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return null;case 1:return sp(t.type)&&ap(),null;case 3:return Mf(),Kh(np),Kh(tp),(n=t.stateNode).pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||!vg(t)||(t.effectTag|=4),null;case 5:If(t),n=xf(yf.current);var r=t.type;if(null!==e&&null!=t.stateNode)Pg(e,t,r,i,n),e.ref!==t.ref&&(t.effectTag|=128);else{if(!i){if(null===t.stateNode)throw Error(Go(166));return null}if(e=xf(bf.current),vg(t)){i=t.stateNode,r=t.type;var s=t.memoizedProps;switch(i[fd]=t,i[gd]=s,r){case"iframe":case"object":case"embed":Ru("load",i);break;case"video":case"audio":for(e=0;e<_c.length;e++)Ru(_c[e],i);break;case"source":Ru("error",i);break;case"img":case"image":case"link":Ru("error",i),Ru("load",i);break;case"form":Ru("reset",i),Ru("submit",i);break;case"details":Ru("toggle",i);break;case"input":hc(i,s),Ru("invalid",i),Ju(n,"onChange");break;case"select":i._wrapperState={wasMultiple:!!s.multiple},Ru("invalid",i),Ju(n,"onChange");break;case"textarea":yc(i,s),Ru("invalid",i),Ju(n,"onChange")}for(var a in Yu(r,s),e=null,s)if(s.hasOwnProperty(a)){var o=s[a];"children"===a?"string"==typeof o?i.textContent!==o&&(e=["children",o]):"number"==typeof o&&i.textContent!==""+o&&(e=["children",""+o]):pl.hasOwnProperty(a)&&null!=o&&Ju(n,a)}switch(r){case"input":cc(i),gc(i,s,!0);break;case"textarea":cc(i),Cc(i);break;case"select":case"option":break;default:"function"==typeof s.onClick&&(i.onclick=Ku)}n=e,t.updateQueue=n,null!==n&&(t.effectTag|=4)}else{switch(a=9===n.nodeType?n:n.ownerDocument,e===Xu&&(e=Ic(r)),e===Xu?"script"===r?((e=a.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"==typeof i.is?e=a.createElement(r,{is:i.is}):(e=a.createElement(r),"select"===r&&(a=e,i.multiple?a.multiple=!0:i.size&&(a.size=i.size))):e=a.createElementNS(e,r),e[fd]=t,e[gd]=i,Ng(e,t),t.stateNode=e,a=Gu(r,i),r){case"iframe":case"object":case"embed":Ru("load",e),o=i;break;case"video":case"audio":for(o=0;o<_c.length;o++)Ru(_c[o],e);o=i;break;case"source":Ru("error",e),o=i;break;case"img":case"image":case"link":Ru("error",e),Ru("load",e),o=i;break;case"form":Ru("reset",e),Ru("submit",e),o=i;break;case"details":Ru("toggle",e),o=i;break;case"input":hc(e,i),o=dc(e,i),Ru("invalid",e),Ju(n,"onChange");break;case"option":o=vc(e,i);break;case"select":e._wrapperState={wasMultiple:!!i.multiple},o=Zo({},i,{value:void 0}),Ru("invalid",e),Ju(n,"onChange");break;case"textarea":yc(e,i),o=wc(e,i),Ru("invalid",e),Ju(n,"onChange");break;default:o=i}Yu(r,o);var l=o;for(s in l)if(l.hasOwnProperty(s)){var c=l[s];"style"===s?Fu(e,c):"dangerouslySetInnerHTML"===s?null!=(c=c?c.__html:void 0)&&kc(e,c):"children"===s?"string"==typeof c?("textarea"!==r||""!==c)&&Nc(e,c):"number"==typeof c&&Nc(e,""+c):"suppressContentEditableWarning"!==s&&"suppressHydrationWarning"!==s&&"autoFocus"!==s&&(pl.hasOwnProperty(s)?null!=c&&Ju(n,s):null!=c&&_l(e,s,c,a))}switch(r){case"input":cc(e),gc(e,i,!1);break;case"textarea":cc(e),Cc(e);break;case"option":null!=i.value&&e.setAttribute("value",""+oc(i.value));break;case"select":e.multiple=!!i.multiple,null!=(n=i.value)?bc(e,!!i.multiple,n,!1):null!=i.defaultValue&&bc(e,!!i.multiple,i.defaultValue,!0);break;default:"function"==typeof o.onClick&&(e.onclick=Ku)}od(r,i)&&(t.effectTag|=4)}null!==t.ref&&(t.effectTag|=128)}return null;case 6:if(e&&null!=t.stateNode)zg(0,t,e.memoizedProps,i);else{if("string"!=typeof i&&null===t.stateNode)throw Error(Go(166));n=xf(yf.current),xf(bf.current),vg(t)?(n=t.stateNode,i=t.memoizedProps,n[fd]=t,n.nodeValue!==i&&(t.effectTag|=4)):((n=(9===n.nodeType?n:n.ownerDocument).createTextNode(i))[fd]=t,t.stateNode=n)}return null;case 13:return Kh(Ef),i=t.memoizedState,0!=(64&t.effectTag)?(t.expirationTime=n,t):(n=null!==i,i=!1,null===e?void 0!==t.memoizedProps.fallback&&vg(t):(i=null!==(r=e.memoizedState),n||null===r||null!==(r=e.child.sibling)&&(null!==(s=t.firstEffect)?(t.firstEffect=r,r.nextEffect=s):(t.firstEffect=t.lastEffect=r,r.nextEffect=null),r.effectTag=8)),n&&!i&&0!=(2&t.mode)&&(null===e&&!0!==t.memoizedProps.unstable_avoidThisFallback||0!=(1&Ef.current)?wm===hm&&(wm=pm):(wm!==hm&&wm!==pm||(wm=fm),0!==Sm&&null!==mm&&(Iv(mm,bm),Ev(mm,Sm)))),(n||i)&&(t.effectTag|=4),null);case 4:return Mf(),null;case 10:return Qp(t),null;case 17:return sp(t.type)&&ap(),null;case 19:if(Kh(Ef),null===(i=t.memoizedState))return null;if(r=0!=(64&t.effectTag),null===(s=i.rendering)){if(r)Vg(i,!1);else if(wm!==hm||null!==e&&0!=(64&e.effectTag))for(s=t.child;null!==s;){if(null!==(e=Af(s))){for(t.effectTag|=64,Vg(i,!1),null!==(r=e.updateQueue)&&(t.updateQueue=r,t.effectTag|=4),null===i.lastEffect&&(t.firstEffect=null),t.lastEffect=i.lastEffect,i=t.child;null!==i;)s=n,(r=i).effectTag&=2,r.nextEffect=null,r.firstEffect=null,r.lastEffect=null,null===(e=r.alternate)?(r.childExpirationTime=0,r.expirationTime=s,r.child=null,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null):(r.childExpirationTime=e.childExpirationTime,r.expirationTime=e.expirationTime,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,s=e.dependencies,r.dependencies=null===s?null:{expirationTime:s.expirationTime,firstContext:s.firstContext,responders:s.responders}),i=i.sibling;return qh(Ef,1&Ef.current|2),t.child}s=s.sibling}}else{if(!r)if(null!==(e=Af(s))){if(t.effectTag|=64,r=!0,null!==(n=e.updateQueue)&&(t.updateQueue=n,t.effectTag|=4),Vg(i,!0),null===i.tail&&"hidden"===i.tailMode&&!s.alternate)return null!==(t=t.lastEffect=i.lastEffect)&&(t.nextEffect=null),null}else 2*kp()-i.renderingStartTime>i.tailExpiration&&1<n&&(t.effectTag|=64,r=!0,Vg(i,!1),t.expirationTime=t.childExpirationTime=n-1);i.isBackwards?(s.sibling=t.child,t.child=s):(null!==(n=i.last)?n.sibling=s:t.child=s,i.last=s)}return null!==i.tail?(0===i.tailExpiration&&(i.tailExpiration=kp()+500),n=i.tail,i.rendering=n,i.tail=n.sibling,i.lastEffect=t.lastEffect,i.renderingStartTime=kp(),n.sibling=null,t=Ef.current,qh(Ef,r?1&t|2:1&t),n):null}throw Error(Go(156,t.tag))}function Ug(e){switch(e.tag){case 1:sp(e.type)&&ap();var t=e.effectTag;return 4096&t?(e.effectTag=-4097&t|64,e):null;case 3:if(Mf(),Kh(np),Kh(tp),0!=(64&(t=e.effectTag)))throw Error(Go(285));return e.effectTag=-4097&t|64,e;case 5:return If(e),null;case 13:return Kh(Ef),4096&(t=e.effectTag)?(e.effectTag=-4097&t|64,e):null;case 19:return Kh(Ef),null;case 4:return Mf(),null;case 10:return Qp(e),null;default:return null}}function Wg(e,t){return{value:e,source:t,stack:ac(t)}}Ng=function(e,t){for(var n=t.child;null!==n;){if(5===n.tag||6===n.tag)e.appendChild(n.stateNode);else if(4!==n.tag&&null!==n.child){n.child.return=n,n=n.child;continue}if(n===t)break;for(;null===n.sibling;){if(null===n.return||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},Pg=function(e,t,n,i,r){var s=e.memoizedProps;if(s!==i){var a,o,l=t.stateNode;switch(xf(bf.current),e=null,n){case"input":s=dc(l,s),i=dc(l,i),e=[];break;case"option":s=vc(l,s),i=vc(l,i),e=[];break;case"select":s=Zo({},s,{value:void 0}),i=Zo({},i,{value:void 0}),e=[];break;case"textarea":s=wc(l,s),i=wc(l,i),e=[];break;default:"function"!=typeof s.onClick&&"function"==typeof i.onClick&&(l.onclick=Ku)}for(a in Yu(n,i),n=null,s)if(!i.hasOwnProperty(a)&&s.hasOwnProperty(a)&&null!=s[a])if("style"===a)for(o in l=s[a])l.hasOwnProperty(o)&&(n||(n={}),n[o]="");else"dangerouslySetInnerHTML"!==a&&"children"!==a&&"suppressContentEditableWarning"!==a&&"suppressHydrationWarning"!==a&&"autoFocus"!==a&&(pl.hasOwnProperty(a)?e||(e=[]):(e=e||[]).push(a,null));for(a in i){var c=i[a];if(l=null!=s?s[a]:void 0,i.hasOwnProperty(a)&&c!==l&&(null!=c||null!=l))if("style"===a)if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(n||(n={}),n[o]=c[o])}else n||(e||(e=[]),e.push(a,n)),n=c;else"dangerouslySetInnerHTML"===a?(c=c?c.__html:void 0,l=l?l.__html:void 0,null!=c&&l!==c&&(e=e||[]).push(a,c)):"children"===a?l===c||"string"!=typeof c&&"number"!=typeof c||(e=e||[]).push(a,""+c):"suppressContentEditableWarning"!==a&&"suppressHydrationWarning"!==a&&(pl.hasOwnProperty(a)?(null!=c&&Ju(r,a),e||l===c||(e=[])):(e=e||[]).push(a,c))}n&&(e=e||[]).push("style",n),r=e,(t.updateQueue=r)&&(t.effectTag|=4)}},zg=function(e,t,n,i){n!==i&&(t.effectTag|=4)};var Hg="function"==typeof WeakSet?WeakSet:Set;function Qg(e,t){var n=t.source,i=t.stack;null===i&&null!==n&&(i=ac(n)),null!==n&&sc(n.type),t=t.value,null!==e&&1===e.tag&&sc(e.type);try{console.error(t)}catch(zb){setTimeout((function(){throw zb}))}}function $g(e){var t=e.ref;if(null!==t)if("function"==typeof t)try{t(null)}catch(n){uv(e,n)}else t.current=null}function Fg(e,t){switch(t.tag){case 0:case 11:case 15:case 22:return;case 1:if(256&t.effectTag&&null!==e){var n=e.memoizedProps,i=e.memoizedState;t=(e=t.stateNode).getSnapshotBeforeUpdate(t.elementType===t.type?n:Op(t.type,n),i),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:case 5:case 6:case 4:case 17:return}throw Error(Go(163))}function Zg(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var i=n.destroy;n.destroy=void 0,void 0!==i&&i()}n=n.next}while(n!==t)}}function Yg(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var n=t=t.next;do{if((n.tag&e)===e){var i=n.create;n.destroy=i()}n=n.next}while(n!==t)}}function Gg(e,t,n){switch(n.tag){case 0:case 11:case 15:case 22:return void Yg(3,n);case 1:if(e=n.stateNode,4&n.effectTag)if(null===t)e.componentDidMount();else{var i=n.elementType===n.type?t.memoizedProps:Op(n.type,t.memoizedProps);e.componentDidUpdate(i,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate)}return void(null!==(t=n.updateQueue)&&tf(n,t,e));case 3:if(null!==(t=n.updateQueue)){if(e=null,null!==n.child)switch(n.child.tag){case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode}tf(n,t,e)}return;case 5:return e=n.stateNode,void(null===t&&4&n.effectTag&&od(n.type,n.memoizedProps)&&e.focus());case 6:case 4:case 12:return;case 13:return void(null===n.memoizedState&&(n=n.alternate,null!==n&&(n=n.memoizedState,null!==n&&(n=n.dehydrated,null!==n&&Eu(n)))));case 19:case 17:case 20:case 21:return}throw Error(Go(163))}function Xg(e,t,n){switch("function"==typeof fv&&fv(t),t.tag){case 0:case 11:case 14:case 15:case 22:if(null!==(e=t.updateQueue)&&null!==(e=e.lastEffect)){var i=e.next;zp(97<n?97:n,(function(){var e=i;do{var n=e.destroy;if(void 0!==n){var r=t;try{n()}catch(s){uv(r,s)}}e=e.next}while(e!==i)}))}break;case 1:$g(t),"function"==typeof(n=t.stateNode).componentWillUnmount&&function(e,t){try{t.props=e.memoizedProps,t.state=e.memoizedState,t.componentWillUnmount()}catch(n){uv(e,n)}}(t,n);break;case 5:$g(t);break;case 4:nm(e,t,n)}}function Jg(e){var t=e.alternate;e.return=null,e.child=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.alternate=null,e.firstEffect=null,e.lastEffect=null,e.pendingProps=null,e.memoizedProps=null,e.stateNode=null,null!==t&&Jg(t)}function Kg(e){return 5===e.tag||3===e.tag||4===e.tag}function qg(e){e:{for(var t=e.return;null!==t;){if(Kg(t)){var n=t;break e}t=t.return}throw Error(Go(160))}switch(t=n.stateNode,n.tag){case 5:var i=!1;break;case 3:case 4:t=t.containerInfo,i=!0;break;default:throw Error(Go(161))}16&n.effectTag&&(Nc(t,""),n.effectTag&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||Kg(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag&&18!==n.tag;){if(2&n.effectTag)continue t;if(null===n.child||4===n.tag)continue t;n.child.return=n,n=n.child}if(!(2&n.effectTag)){n=n.stateNode;break e}}i?em(e,n,t):tm(e,n,t)}function em(e,t,n){var i=e.tag,r=5===i||6===i;if(r)e=r?e.stateNode:e.stateNode.instance,t?8===n.nodeType?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(8===n.nodeType?(t=n.parentNode).insertBefore(e,n):(t=n).appendChild(e),null!=(n=n._reactRootContainer)||null!==t.onclick||(t.onclick=Ku));else if(4!==i&&null!==(e=e.child))for(em(e,t,n),e=e.sibling;null!==e;)em(e,t,n),e=e.sibling}function tm(e,t,n){var i=e.tag,r=5===i||6===i;if(r)e=r?e.stateNode:e.stateNode.instance,t?n.insertBefore(e,t):n.appendChild(e);else if(4!==i&&null!==(e=e.child))for(tm(e,t,n),e=e.sibling;null!==e;)tm(e,t,n),e=e.sibling}function nm(e,t,n){for(var i,r,s=t,a=!1;;){if(!a){a=s.return;e:for(;;){if(null===a)throw Error(Go(160));switch(i=a.stateNode,a.tag){case 5:r=!1;break e;case 3:case 4:i=i.containerInfo,r=!0;break e}a=a.return}a=!0}if(5===s.tag||6===s.tag){e:for(var o=e,l=s,c=n,u=l;;)if(Xg(o,u,c),null!==u.child&&4!==u.tag)u.child.return=u,u=u.child;else{if(u===l)break e;for(;null===u.sibling;){if(null===u.return||u.return===l)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}r?(o=i,l=s.stateNode,8===o.nodeType?o.parentNode.removeChild(l):o.removeChild(l)):i.removeChild(s.stateNode)}else if(4===s.tag){if(null!==s.child){i=s.stateNode.containerInfo,r=!0,s.child.return=s,s=s.child;continue}}else if(Xg(e,s,n),null!==s.child){s.child.return=s,s=s.child;continue}if(s===t)break;for(;null===s.sibling;){if(null===s.return||s.return===t)return;4===(s=s.return).tag&&(a=!1)}s.sibling.return=s.return,s=s.sibling}}function im(e,t){switch(t.tag){case 0:case 11:case 14:case 15:case 22:return void Zg(3,t);case 1:return;case 5:var n=t.stateNode;if(null!=n){var i=t.memoizedProps,r=null!==e?e.memoizedProps:i;e=t.type;var s=t.updateQueue;if(t.updateQueue=null,null!==s){for(n[gd]=i,"input"===e&&"radio"===i.type&&null!=i.name&&pc(n,i),Gu(e,r),t=Gu(e,i),r=0;r<s.length;r+=2){var a=s[r],o=s[r+1];"style"===a?Fu(n,o):"dangerouslySetInnerHTML"===a?kc(n,o):"children"===a?Nc(n,o):_l(n,a,o,t)}switch(e){case"input":fc(n,i);break;case"textarea":xc(n,i);break;case"select":t=n._wrapperState.wasMultiple,n._wrapperState.wasMultiple=!!i.multiple,null!=(e=i.value)?bc(n,!!i.multiple,e,!1):t!==!!i.multiple&&(null!=i.defaultValue?bc(n,!!i.multiple,i.defaultValue,!0):bc(n,!!i.multiple,i.multiple?[]:"",!1))}}}return;case 6:if(null===t.stateNode)throw Error(Go(162));return void(t.stateNode.nodeValue=t.memoizedProps);case 3:return void((t=t.stateNode).hydrate&&(t.hydrate=!1,Eu(t.containerInfo)));case 12:return;case 13:if(n=t,null===t.memoizedState?i=!1:(i=!0,n=t.child,Em=kp()),null!==n)e:for(e=n;;){if(5===e.tag)s=e.stateNode,i?"function"==typeof(s=s.style).setProperty?s.setProperty("display","none","important"):s.display="none":(s=e.stateNode,r=null!=(r=e.memoizedProps.style)&&r.hasOwnProperty("display")?r.display:null,s.style.display=$u("display",r));else if(6===e.tag)e.stateNode.nodeValue=i?"":e.memoizedProps;else{if(13===e.tag&&null!==e.memoizedState&&null===e.memoizedState.dehydrated){(s=e.child.sibling).return=e,e=s;continue}if(null!==e.child){e.child.return=e,e=e.child;continue}}if(e===n)break;for(;null===e.sibling;){if(null===e.return||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}return void rm(t);case 19:return void rm(t);case 17:return}throw Error(Go(163))}function rm(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var n=e.stateNode;null===n&&(n=e.stateNode=new Hg),t.forEach((function(t){var i=hv.bind(null,e,t);n.has(t)||(n.add(t),t.then(i,i))}))}}var sm="function"==typeof WeakMap?WeakMap:Map;function am(e,t,n){(n=Jp(n,null)).tag=3,n.payload={element:null};var i=t.value;return n.callback=function(){Tm||(Tm=!0,km=i),Qg(e,t)},n}function om(e,t,n){(n=Jp(n,null)).tag=3;var i=e.type.getDerivedStateFromError;if("function"==typeof i){var r=t.value;n.payload=function(){return Qg(e,t),i(r)}}var s=e.stateNode;return null!==s&&"function"==typeof s.componentDidCatch&&(n.callback=function(){"function"!=typeof i&&(null===Nm?Nm=new Set([this]):Nm.add(this),Qg(e,t));var n=t.stack;this.componentDidCatch(t.value,{componentStack:null!==n?n:""})}),n}var lm,cm=Math.ceil,um=Vl.ReactCurrentDispatcher,dm=Vl.ReactCurrentOwner,hm=0,pm=3,fm=4,gm=0,mm=null,vm=null,bm=0,wm=hm,ym=null,xm=1073741823,Cm=1073741823,Mm=null,Sm=0,Im=!1,Em=0,Am=null,Tm=!1,km=null,Nm=null,Pm=!1,zm=null,Dm=90,Lm=null,Bm=0,jm=null,Rm=0;function Om(){return 0!=(48&gm)?1073741821-(kp()/10|0):0!==Rm?Rm:Rm=1073741821-(kp()/10|0)}function Vm(e,t,n){if(0==(2&(t=t.mode)))return 1073741823;var i=Np();if(0==(4&t))return 99===i?1073741823:1073741822;if(0!=(16&gm))return bm;if(null!==n)e=Rp(e,0|n.timeoutMs||5e3,250);else switch(i){case 99:e=1073741823;break;case 98:e=Rp(e,150,100);break;case 97:case 96:e=Rp(e,5e3,250);break;case 95:e=2;break;default:throw Error(Go(326))}return null!==mm&&e===bm&&--e,e}function _m(e,t){if(50<Bm)throw Bm=0,jm=null,Error(Go(185));if(null!==(e=Um(e,t))){var n=Np();1073741823===t?0!=(8&gm)&&0==(48&gm)?$m(e):(Hm(e),0===gm&&Bp()):Hm(e),0==(4&gm)||98!==n&&99!==n||(null===Lm?Lm=new Map([[e,t]]):(void 0===(n=Lm.get(e))||n>t)&&Lm.set(e,t))}}function Um(e,t){e.expirationTime<t&&(e.expirationTime=t);var n=e.alternate;null!==n&&n.expirationTime<t&&(n.expirationTime=t);var i=e.return,r=null;if(null===i&&3===e.tag)r=e.stateNode;else for(;null!==i;){if(n=i.alternate,i.childExpirationTime<t&&(i.childExpirationTime=t),null!==n&&n.childExpirationTime<t&&(n.childExpirationTime=t),null===i.return&&3===i.tag){r=i.stateNode;break}i=i.return}return null!==r&&(mm===r&&(Km(t),wm===fm&&Iv(r,bm)),Ev(r,t)),r}function Wm(e){var t=e.lastExpiredTime;if(0!==t)return t;if(!Sv(e,t=e.firstPendingTime))return t;var n=e.lastPingedTime;return 2>=(e=n>(e=e.nextKnownPendingLevel)?n:e)&&t!==e?0:e}function Hm(e){if(0!==e.lastExpiredTime)e.callbackExpirationTime=1073741823,e.callbackPriority=99,e.callbackNode=Lp($m.bind(null,e));else{var t=Wm(e),n=e.callbackNode;if(0===t)null!==n&&(e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90);else{var i=Om();if(1073741823===t?i=99:1===t||2===t?i=95:i=0>=(i=10*(1073741821-t)-10*(1073741821-i))?99:250>=i?98:5250>=i?97:95,null!==n){var r=e.callbackPriority;if(e.callbackExpirationTime===t&&r>=i)return;n!==Cp&&pp(n)}e.callbackExpirationTime=t,e.callbackPriority=i,t=1073741823===t?Lp($m.bind(null,e)):Dp(i,Qm.bind(null,e),{timeout:10*(1073741821-t)-kp()}),e.callbackNode=t}}}function Qm(e,t){if(Rm=0,t)return Av(e,t=Om()),Hm(e),null;var n=Wm(e);if(0!==n){if(t=e.callbackNode,0!=(48&gm))throw Error(Go(327));if(ov(),e===mm&&n===bm||Ym(e,n),null!==vm){var i=gm;gm|=16;for(var r=Xm();;)try{ev();break}catch(o){Gm(e,o)}if(Hp(),gm=i,um.current=r,1===wm)throw t=ym,Ym(e,n),Iv(e,n),Hm(e),t;if(null===vm)switch(r=e.finishedWork=e.current.alternate,e.finishedExpirationTime=n,i=wm,mm=null,i){case hm:case 1:throw Error(Go(345));case 2:Av(e,2<n?2:n);break;case pm:if(Iv(e,n),n===(i=e.lastSuspendedTime)&&(e.nextKnownPendingLevel=iv(r)),1073741823===xm&&10<(r=Em+500-kp())){if(Im){var s=e.lastPingedTime;if(0===s||s>=n){e.lastPingedTime=n,Ym(e,n);break}}if(0!==(s=Wm(e))&&s!==n)break;if(0!==i&&i!==n){e.lastPingedTime=i;break}e.timeoutHandle=cd(rv.bind(null,e),r);break}rv(e);break;case fm:if(Iv(e,n),n===(i=e.lastSuspendedTime)&&(e.nextKnownPendingLevel=iv(r)),Im&&(0===(r=e.lastPingedTime)||r>=n)){e.lastPingedTime=n,Ym(e,n);break}if(0!==(r=Wm(e))&&r!==n)break;if(0!==i&&i!==n){e.lastPingedTime=i;break}if(1073741823!==Cm?i=10*(1073741821-Cm)-kp():1073741823===xm?i=0:(i=10*(1073741821-xm)-5e3,0>(i=(r=kp())-i)&&(i=0),(n=10*(1073741821-n)-r)<(i=(120>i?120:480>i?480:1080>i?1080:1920>i?1920:3e3>i?3e3:4320>i?4320:1960*cm(i/1960))-i)&&(i=n)),10<i){e.timeoutHandle=cd(rv.bind(null,e),i);break}rv(e);break;case 5:if(1073741823!==xm&&null!==Mm){s=xm;var a=Mm;if(0>=(i=0|a.busyMinDurationMs)?i=0:(r=0|a.busyDelayMs,i=(s=kp()-(10*(1073741821-s)-(0|a.timeoutMs||5e3)))<=r?0:r+i-s),10<i){Iv(e,n),e.timeoutHandle=cd(rv.bind(null,e),i);break}}rv(e);break;default:throw Error(Go(329))}if(Hm(e),e.callbackNode===t)return Qm.bind(null,e)}}return null}function $m(e){var t=e.lastExpiredTime;if(t=0!==t?t:1073741823,0!=(48&gm))throw Error(Go(327));if(ov(),e===mm&&t===bm||Ym(e,t),null!==vm){var n=gm;gm|=16;for(var i=Xm();;)try{qm();break}catch(zb){Gm(e,zb)}if(Hp(),gm=n,um.current=i,1===wm)throw n=ym,Ym(e,t),Iv(e,t),Hm(e),n;if(null!==vm)throw Error(Go(261));e.finishedWork=e.current.alternate,e.finishedExpirationTime=t,mm=null,rv(e),Hm(e)}return null}function Fm(e,t){var n=gm;gm|=1;try{return e(t)}finally{0===(gm=n)&&Bp()}}function Zm(e,t){var n=gm;gm&=-2,gm|=8;try{return e(t)}finally{0===(gm=n)&&Bp()}}function Ym(e,t){e.finishedWork=null,e.finishedExpirationTime=0;var n=e.timeoutHandle;if(-1!==n&&(e.timeoutHandle=-1,ud(n)),null!==vm)for(n=vm.return;null!==n;){var i=n;switch(i.tag){case 1:null!=(i=i.type.childContextTypes)&&ap();break;case 3:Mf(),Kh(np),Kh(tp);break;case 5:If(i);break;case 4:Mf();break;case 13:case 19:Kh(Ef);break;case 10:Qp(i)}n=n.return}mm=e,vm=bv(e.current,null),bm=t,wm=hm,ym=null,Cm=xm=1073741823,Mm=null,Sm=0,Im=!1}function Gm(e,t){for(;;){try{if(Hp(),kf.current=ag,Bf)for(var n=zf.memoizedState;null!==n;){var i=n.queue;null!==i&&(i.pending=null),n=n.next}if(Pf=0,Lf=Df=zf=null,Bf=!1,null===vm||null===vm.return)return wm=1,ym=t,vm=null;e:{var r=e,s=vm.return,a=vm,o=t;if(t=bm,a.effectTag|=2048,a.firstEffect=a.lastEffect=null,null!==o&&"object"==typeof o&&"function"==typeof o.then){var l=o;if(0==(2&a.mode)){var c=a.alternate;c?(a.updateQueue=c.updateQueue,a.memoizedState=c.memoizedState,a.expirationTime=c.expirationTime):(a.updateQueue=null,a.memoizedState=null)}var u=0!=(1&Ef.current),d=s;do{var h;if(h=13===d.tag){var p=d.memoizedState;if(null!==p)h=null!==p.dehydrated;else{var f=d.memoizedProps;h=void 0!==f.fallback&&(!0!==f.unstable_avoidThisFallback||!u)}}if(h){var g=d.updateQueue;if(null===g){var m=new Set;m.add(l),d.updateQueue=m}else g.add(l);if(0==(2&d.mode)){if(d.effectTag|=64,a.effectTag&=-2981,1===a.tag)if(null===a.alternate)a.tag=17;else{var v=Jp(1073741823,null);v.tag=2,Kp(a,v)}a.expirationTime=1073741823;break e}o=void 0,a=t;var b=r.pingCache;if(null===b?(b=r.pingCache=new sm,o=new Set,b.set(l,o)):void 0===(o=b.get(l))&&(o=new Set,b.set(l,o)),!o.has(a)){o.add(a);var w=dv.bind(null,r,l,a);l.then(w,w)}d.effectTag|=4096,d.expirationTime=t;break e}d=d.return}while(null!==d);o=Error((sc(a.type)||"A React component")+" suspended while rendering, but no fallback UI was specified.\n\nAdd a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display."+ac(a))}5!==wm&&(wm=2),o=Wg(o,a),d=s;do{switch(d.tag){case 3:l=o,d.effectTag|=4096,d.expirationTime=t,qp(d,am(d,l,t));break e;case 1:l=o;var y=d.type,x=d.stateNode;if(0==(64&d.effectTag)&&("function"==typeof y.getDerivedStateFromError||null!==x&&"function"==typeof x.componentDidCatch&&(null===Nm||!Nm.has(x)))){d.effectTag|=4096,d.expirationTime=t,qp(d,om(d,l,t));break e}}d=d.return}while(null!==d)}vm=nv(vm)}catch(C){t=C;continue}break}}function Xm(){var e=um.current;return um.current=ag,null===e?ag:e}function Jm(e,t){e<xm&&2<e&&(xm=e),null!==t&&e<Cm&&2<e&&(Cm=e,Mm=t)}function Km(e){e>Sm&&(Sm=e)}function qm(){for(;null!==vm;)vm=tv(vm)}function ev(){for(;null!==vm&&!Mp();)vm=tv(vm)}function tv(e){var t=lm(e.alternate,e,bm);return e.memoizedProps=e.pendingProps,null===t&&(t=nv(e)),dm.current=null,t}function nv(e){vm=e;do{var t=vm.alternate;if(e=vm.return,0==(2048&vm.effectTag)){if(t=_g(t,vm,bm),1===bm||1!==vm.childExpirationTime){for(var n=0,i=vm.child;null!==i;){var r=i.expirationTime,s=i.childExpirationTime;r>n&&(n=r),s>n&&(n=s),i=i.sibling}vm.childExpirationTime=n}if(null!==t)return t;null!==e&&0==(2048&e.effectTag)&&(null===e.firstEffect&&(e.firstEffect=vm.firstEffect),null!==vm.lastEffect&&(null!==e.lastEffect&&(e.lastEffect.nextEffect=vm.firstEffect),e.lastEffect=vm.lastEffect),1<vm.effectTag&&(null!==e.lastEffect?e.lastEffect.nextEffect=vm:e.firstEffect=vm,e.lastEffect=vm))}else{if(null!==(t=Ug(vm)))return t.effectTag&=2047,t;null!==e&&(e.firstEffect=e.lastEffect=null,e.effectTag|=2048)}if(null!==(t=vm.sibling))return t;vm=e}while(null!==vm);return wm===hm&&(wm=5),null}function iv(e){var t=e.expirationTime;return t>(e=e.childExpirationTime)?t:e}function rv(e){var t=Np();return zp(99,sv.bind(null,e,t)),null}function sv(e,t){do{ov()}while(null!==zm);if(0!=(48&gm))throw Error(Go(327));var n=e.finishedWork,i=e.finishedExpirationTime;if(null===n)return null;if(e.finishedWork=null,e.finishedExpirationTime=0,n===e.current)throw Error(Go(177));e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90,e.nextKnownPendingLevel=0;var r=iv(n);if(e.firstPendingTime=r,i<=e.lastSuspendedTime?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:i<=e.firstSuspendedTime&&(e.firstSuspendedTime=i-1),i<=e.lastPingedTime&&(e.lastPingedTime=0),i<=e.lastExpiredTime&&(e.lastExpiredTime=0),e===mm&&(vm=mm=null,bm=0),1<n.effectTag?null!==n.lastEffect?(n.lastEffect.nextEffect=n,r=n.firstEffect):r=n:r=n.firstEffect,null!==r){var s=gm;gm|=32,dm.current=null,sd=ju;var a=id();if(rd(a)){if("selectionStart"in a)var o={start:a.selectionStart,end:a.selectionEnd};else e:{var l=(o=(o=a.ownerDocument)&&o.defaultView||window).getSelection&&o.getSelection();if(l&&0!==l.rangeCount){o=l.anchorNode;var c=l.anchorOffset,u=l.focusNode;l=l.focusOffset;try{o.nodeType,u.nodeType}catch(I){o=null;break e}var d=0,h=-1,p=-1,f=0,g=0,m=a,v=null;t:for(;;){for(var b;m!==o||0!==c&&3!==m.nodeType||(h=d+c),m!==u||0!==l&&3!==m.nodeType||(p=d+l),3===m.nodeType&&(d+=m.nodeValue.length),null!==(b=m.firstChild);)v=m,m=b;for(;;){if(m===a)break t;if(v===o&&++f===c&&(h=d),v===u&&++g===l&&(p=d),null!==(b=m.nextSibling))break;v=(m=v).parentNode}m=b}o=-1===h||-1===p?null:{start:h,end:p}}else o=null}o=o||{start:0,end:0}}else o=null;ad={activeElementDetached:null,focusedElem:a,selectionRange:o},ju=!1,Am=r;do{try{av()}catch(I){if(null===Am)throw Error(Go(330));uv(Am,I),Am=Am.nextEffect}}while(null!==Am);Am=r;do{try{for(a=e,o=t;null!==Am;){var w=Am.effectTag;if(16&w&&Nc(Am.stateNode,""),128&w){var y=Am.alternate;if(null!==y){var x=y.ref;null!==x&&("function"==typeof x?x(null):x.current=null)}}switch(1038&w){case 2:qg(Am),Am.effectTag&=-3;break;case 6:qg(Am),Am.effectTag&=-3,im(Am.alternate,Am);break;case 1024:Am.effectTag&=-1025;break;case 1028:Am.effectTag&=-1025,im(Am.alternate,Am);break;case 4:im(Am.alternate,Am);break;case 8:nm(a,c=Am,o),Jg(c)}Am=Am.nextEffect}}catch(I){if(null===Am)throw Error(Go(330));uv(Am,I),Am=Am.nextEffect}}while(null!==Am);if(x=ad,y=id(),w=x.focusedElem,o=x.selectionRange,y!==w&&w&&w.ownerDocument&&nd(w.ownerDocument.documentElement,w)){null!==o&&rd(w)&&(y=o.start,void 0===(x=o.end)&&(x=y),"selectionStart"in w?(w.selectionStart=y,w.selectionEnd=Math.min(x,w.value.length)):(x=(y=w.ownerDocument||document)&&y.defaultView||window).getSelection&&(x=x.getSelection(),c=w.textContent.length,a=Math.min(o.start,c),o=void 0===o.end?a:Math.min(o.end,c),!x.extend&&a>o&&(c=o,o=a,a=c),c=td(w,a),u=td(w,o),c&&u&&(1!==x.rangeCount||x.anchorNode!==c.node||x.anchorOffset!==c.offset||x.focusNode!==u.node||x.focusOffset!==u.offset)&&((y=y.createRange()).setStart(c.node,c.offset),x.removeAllRanges(),a>o?(x.addRange(y),x.extend(u.node,u.offset)):(y.setEnd(u.node,u.offset),x.addRange(y))))),y=[];for(x=w;x=x.parentNode;)1===x.nodeType&&y.push({element:x,left:x.scrollLeft,top:x.scrollTop});for("function"==typeof w.focus&&w.focus(),w=0;w<y.length;w++)(x=y[w]).element.scrollLeft=x.left,x.element.scrollTop=x.top}ju=!!sd,ad=sd=null,e.current=n,Am=r;do{try{for(w=e;null!==Am;){var C=Am.effectTag;if(36&C&&Gg(w,Am.alternate,Am),128&C){y=void 0;var M=Am.ref;if(null!==M){var S=Am.stateNode;switch(Am.tag){case 5:y=S;break;default:y=S}"function"==typeof M?M(y):M.current=y}}Am=Am.nextEffect}}catch(I){if(null===Am)throw Error(Go(330));uv(Am,I),Am=Am.nextEffect}}while(null!==Am);Am=null,Sp(),gm=s}else e.current=n;if(Pm)Pm=!1,zm=e,Dm=t;else for(Am=r;null!==Am;)t=Am.nextEffect,Am.nextEffect=null,Am=t;if(0===(t=e.firstPendingTime)&&(Nm=null),1073741823===t?e===jm?Bm++:(Bm=0,jm=e):Bm=0,"function"==typeof pv&&pv(n.stateNode,i),Hm(e),Tm)throw Tm=!1,e=km,km=null,e;return 0!=(8&gm)||Bp(),null}function av(){for(;null!==Am;){var e=Am.effectTag;0!=(256&e)&&Fg(Am.alternate,Am),0==(512&e)||Pm||(Pm=!0,Dp(97,(function(){return ov(),null}))),Am=Am.nextEffect}}function ov(){if(90!==Dm){var e=97<Dm?97:Dm;return Dm=90,zp(e,lv)}}function lv(){if(null===zm)return!1;var e=zm;if(zm=null,0!=(48&gm))throw Error(Go(331));var t=gm;for(gm|=32,e=e.current.firstEffect;null!==e;){try{var n=e;if(0!=(512&n.effectTag))switch(n.tag){case 0:case 11:case 15:case 22:Zg(5,n),Yg(5,n)}}catch(i){if(null===e)throw Error(Go(330));uv(e,i)}n=e.nextEffect,e.nextEffect=null,e=n}return gm=t,Bp(),!0}function cv(e,t,n){Kp(e,t=am(e,t=Wg(n,t),1073741823)),null!==(e=Um(e,1073741823))&&Hm(e)}function uv(e,t){if(3===e.tag)cv(e,e,t);else for(var n=e.return;null!==n;){if(3===n.tag){cv(n,e,t);break}if(1===n.tag){var i=n.stateNode;if("function"==typeof n.type.getDerivedStateFromError||"function"==typeof i.componentDidCatch&&(null===Nm||!Nm.has(i))){Kp(n,e=om(n,e=Wg(t,e),1073741823)),null!==(n=Um(n,1073741823))&&Hm(n);break}}n=n.return}}function dv(e,t,n){var i=e.pingCache;null!==i&&i.delete(t),mm===e&&bm===n?wm===fm||wm===pm&&1073741823===xm&&kp()-Em<500?Ym(e,bm):Im=!0:Sv(e,n)&&(0!==(t=e.lastPingedTime)&&t<n||(e.lastPingedTime=n,Hm(e)))}function hv(e,t){var n=e.stateNode;null!==n&&n.delete(t),0===(t=0)&&(t=Vm(t=Om(),e,null)),null!==(e=Um(e,t))&&Hm(e)}lm=function(e,t,n){var i=t.expirationTime;if(null!==e){var r=t.pendingProps;if(e.memoizedProps!==r||np.current)yg=!0;else{if(i<n){switch(yg=!1,t.tag){case 3:kg(t),bg();break;case 5:if(Sf(t),4&t.mode&&1!==n&&r.hidden)return t.expirationTime=t.childExpirationTime=1,null;break;case 1:sp(t.type)&&cp(t);break;case 4:Cf(t,t.stateNode.containerInfo);break;case 10:i=t.memoizedProps.value,r=t.type._context,qh(Vp,r._currentValue),r._currentValue=i;break;case 13:if(null!==t.memoizedState)return 0!==(i=t.child.childExpirationTime)&&i>=n?Lg(e,t,n):(qh(Ef,1&Ef.current),null!==(t=Og(e,t,n))?t.sibling:null);qh(Ef,1&Ef.current);break;case 19:if(i=t.childExpirationTime>=n,0!=(64&e.effectTag)){if(i)return Rg(e,t,n);t.effectTag|=64}if(null!==(r=t.memoizedState)&&(r.rendering=null,r.tail=null),qh(Ef,Ef.current),!i)return null}return Og(e,t,n)}yg=!1}}else yg=!1;switch(t.expirationTime=0,t.tag){case 2:if(i=t.type,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,r=rp(t,tp.current),Fp(t,n),r=Of(null,t,i,e,r,n),t.effectTag|=1,"object"==typeof r&&null!==r&&"function"==typeof r.render&&void 0===r.$$typeof){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,sp(i)){var s=!0;cp(t)}else s=!1;t.memoizedState=null!==r.state&&void 0!==r.state?r.state:null,Gp(t);var a=i.getDerivedStateFromProps;"function"==typeof a&&sf(t,i,a,e),r.updater=af,t.stateNode=r,r._reactInternalFiber=t,uf(t,i,e,n),t=Tg(null,t,i,!0,s,n)}else t.tag=0,xg(null,t,r,n),t=t.child;return t;case 16:e:{if(r=t.elementType,null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,function(e){if(-1===e._status){e._status=0;var t=e._ctor;t=t(),e._result=t,t.then((function(t){0===e._status&&(t=t.default,e._status=1,e._result=t)}),(function(t){0===e._status&&(e._status=2,e._result=t)}))}}(r),1!==r._status)throw r._result;switch(r=r._result,t.type=r,s=t.tag=function(e){if("function"==typeof e)return vv(e)?1:0;if(null!=e){if((e=e.$$typeof)===Jl)return 11;if(e===ec)return 14}return 2}(r),e=Op(r,e),s){case 0:t=Eg(null,t,r,e,n);break e;case 1:t=Ag(null,t,r,e,n);break e;case 11:t=Cg(null,t,r,e,n);break e;case 14:t=Mg(null,t,r,Op(r.type,e),i,n);break e}throw Error(Go(306,r,""))}return t;case 0:return i=t.type,r=t.pendingProps,Eg(e,t,i,r=t.elementType===i?r:Op(i,r),n);case 1:return i=t.type,r=t.pendingProps,Ag(e,t,i,r=t.elementType===i?r:Op(i,r),n);case 3:if(kg(t),i=t.updateQueue,null===e||null===i)throw Error(Go(282));if(i=t.pendingProps,r=null!==(r=t.memoizedState)?r.element:null,Xp(e,t),ef(t,i,null,n),(i=t.memoizedState.element)===r)bg(),t=Og(e,t,n);else{if((r=t.stateNode.hydrate)&&(dg=dd(t.stateNode.containerInfo.firstChild),ug=t,r=hg=!0),r)for(n=mf(t,null,i,n),t.child=n;n;)n.effectTag=-3&n.effectTag|1024,n=n.sibling;else xg(e,t,i,n),bg();t=t.child}return t;case 5:return Sf(t),null===e&&gg(t),i=t.type,r=t.pendingProps,s=null!==e?e.memoizedProps:null,a=r.children,ld(i,r)?a=null:null!==s&&ld(i,s)&&(t.effectTag|=16),Ig(e,t),4&t.mode&&1!==n&&r.hidden?(t.expirationTime=t.childExpirationTime=1,t=null):(xg(e,t,a,n),t=t.child),t;case 6:return null===e&&gg(t),null;case 13:return Lg(e,t,n);case 4:return Cf(t,t.stateNode.containerInfo),i=t.pendingProps,null===e?t.child=gf(t,null,i,n):xg(e,t,i,n),t.child;case 11:return i=t.type,r=t.pendingProps,Cg(e,t,i,r=t.elementType===i?r:Op(i,r),n);case 7:return xg(e,t,t.pendingProps,n),t.child;case 8:case 12:return xg(e,t,t.pendingProps.children,n),t.child;case 10:e:{i=t.type._context,r=t.pendingProps,a=t.memoizedProps,s=r.value;var o=t.type._context;if(qh(Vp,o._currentValue),o._currentValue=s,null!==a)if(o=a.value,0===(s=Ah(o,s)?0:0|("function"==typeof i._calculateChangedBits?i._calculateChangedBits(o,s):1073741823))){if(a.children===r.children&&!np.current){t=Og(e,t,n);break e}}else for(null!==(o=t.child)&&(o.return=t);null!==o;){var l=o.dependencies;if(null!==l){a=o.child;for(var c=l.firstContext;null!==c;){if(c.context===i&&0!=(c.observedBits&s)){1===o.tag&&((c=Jp(n,null)).tag=2,Kp(o,c)),o.expirationTime<n&&(o.expirationTime=n),null!==(c=o.alternate)&&c.expirationTime<n&&(c.expirationTime=n),$p(o.return,n),l.expirationTime<n&&(l.expirationTime=n);break}c=c.next}}else a=10===o.tag&&o.type===t.type?null:o.child;if(null!==a)a.return=o;else for(a=o;null!==a;){if(a===t){a=null;break}if(null!==(o=a.sibling)){o.return=a.return,a=o;break}a=a.return}o=a}xg(e,t,r.children,n),t=t.child}return t;case 9:return r=t.type,i=(s=t.pendingProps).children,Fp(t,n),i=i(r=Zp(r,s.unstable_observedBits)),t.effectTag|=1,xg(e,t,i,n),t.child;case 14:return s=Op(r=t.type,t.pendingProps),Mg(e,t,r,s=Op(r.type,s),i,n);case 15:return Sg(e,t,t.type,t.pendingProps,i,n);case 17:return i=t.type,r=t.pendingProps,r=t.elementType===i?r:Op(i,r),null!==e&&(e.alternate=null,t.alternate=null,t.effectTag|=2),t.tag=1,sp(i)?(e=!0,cp(t)):e=!1,Fp(t,n),lf(t,i,r),uf(t,i,r,n),Tg(null,t,i,!0,e,n);case 19:return Rg(e,t,n)}throw Error(Go(156,t.tag))};var pv=null,fv=null;function gv(e,t,n,i){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.effectTag=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childExpirationTime=this.expirationTime=0,this.alternate=null}function mv(e,t,n,i){return new gv(e,t,n,i)}function vv(e){return!(!(e=e.prototype)||!e.isReactComponent)}function bv(e,t){var n=e.alternate;return null===n?((n=mv(e.tag,t,e.key,e.mode)).elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.effectTag=0,n.nextEffect=null,n.firstEffect=null,n.lastEffect=null),n.childExpirationTime=e.childExpirationTime,n.expirationTime=e.expirationTime,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=null===t?null:{expirationTime:t.expirationTime,firstContext:t.firstContext,responders:t.responders},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function wv(e,t,n,i,r,s){var a=2;if(i=e,"function"==typeof e)vv(e)&&(a=1);else if("string"==typeof e)a=5;else e:switch(e){case $l:return yv(n.children,r,s,t);case Xl:a=8,r|=7;break;case Fl:a=8,r|=1;break;case Zl:return(e=mv(12,n,t,8|r)).elementType=Zl,e.type=Zl,e.expirationTime=s,e;case Kl:return(e=mv(13,n,t,r)).type=Kl,e.elementType=Kl,e.expirationTime=s,e;case ql:return(e=mv(19,n,t,r)).elementType=ql,e.expirationTime=s,e;default:if("object"==typeof e&&null!==e)switch(e.$$typeof){case Yl:a=10;break e;case Gl:a=9;break e;case Jl:a=11;break e;case ec:a=14;break e;case tc:a=16,i=null;break e;case nc:a=22;break e}throw Error(Go(130,null==e?e:typeof e,""))}return(t=mv(a,n,t,r)).elementType=e,t.type=i,t.expirationTime=s,t}function yv(e,t,n,i){return(e=mv(7,e,i,t)).expirationTime=n,e}function xv(e,t,n){return(e=mv(6,e,null,t)).expirationTime=n,e}function Cv(e,t,n){return(t=mv(4,null!==e.children?e.children:[],e.key,t)).expirationTime=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Mv(e,t,n){this.tag=t,this.current=null,this.containerInfo=e,this.pingCache=this.pendingChildren=null,this.finishedExpirationTime=0,this.finishedWork=null,this.timeoutHandle=-1,this.pendingContext=this.context=null,this.hydrate=n,this.callbackNode=null,this.callbackPriority=90,this.lastExpiredTime=this.lastPingedTime=this.nextKnownPendingLevel=this.lastSuspendedTime=this.firstSuspendedTime=this.firstPendingTime=0}function Sv(e,t){var n=e.firstSuspendedTime;return e=e.lastSuspendedTime,0!==n&&n>=t&&e<=t}function Iv(e,t){var n=e.firstSuspendedTime,i=e.lastSuspendedTime;n<t&&(e.firstSuspendedTime=t),(i>t||0===n)&&(e.lastSuspendedTime=t),t<=e.lastPingedTime&&(e.lastPingedTime=0),t<=e.lastExpiredTime&&(e.lastExpiredTime=0)}function Ev(e,t){t>e.firstPendingTime&&(e.firstPendingTime=t);var n=e.firstSuspendedTime;0!==n&&(t>=n?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:t>=e.lastSuspendedTime&&(e.lastSuspendedTime=t+1),t>e.nextKnownPendingLevel&&(e.nextKnownPendingLevel=t))}function Av(e,t){var n=e.lastExpiredTime;(0===n||n>t)&&(e.lastExpiredTime=t)}function Tv(e,t,n,i){var r=t.current,s=Om(),a=nf.suspense;s=Vm(s,r,a);e:if(n){t:{if(Hc(n=n._reactInternalFiber)!==n||1!==n.tag)throw Error(Go(170));var o=n;do{switch(o.tag){case 3:o=o.stateNode.context;break t;case 1:if(sp(o.type)){o=o.stateNode.__reactInternalMemoizedMergedChildContext;break t}}o=o.return}while(null!==o);throw Error(Go(171))}if(1===n.tag){var l=n.type;if(sp(l)){n=lp(n,l,o);break e}}n=o}else n=ep;return null===t.context?t.context=n:t.pendingContext=n,(t=Jp(s,a)).payload={element:e},null!==(i=void 0===i?null:i)&&(t.callback=i),Kp(r,t),_m(r,s),s}function kv(e){if(!(e=e.current).child)return null;switch(e.child.tag){case 5:default:return e.child.stateNode}}function Nv(e,t){null!==(e=e.memoizedState)&&null!==e.dehydrated&&e.retryTime<t&&(e.retryTime=t)}function Pv(e,t){Nv(e,t),(e=e.alternate)&&Nv(e,t)}function zv(e,t,n){var i=new Mv(e,t,n=null!=n&&!0===n.hydrate),r=mv(3,null,null,2===t?7:1===t?3:0);i.current=r,r.stateNode=i,Gp(r),e[md]=i.current,n&&0!==t&&function(e,t){var n=Wc(t);mu.forEach((function(e){ru(e,t,n)})),vu.forEach((function(e){ru(e,t,n)}))}(0,9===e.nodeType?e:e.ownerDocument),this._internalRoot=i}function Dv(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function Lv(e,t,n,i,r){var s=n._reactRootContainer;if(s){var a=s._internalRoot;if("function"==typeof r){var o=r;r=function(){var e=kv(a);o.call(e)}}Tv(t,a,e,r)}else{if(s=n._reactRootContainer=function(e,t){if(t||(t=!(!(t=e?9===e.nodeType?e.documentElement:e.firstChild:null)||1!==t.nodeType||!t.hasAttribute("data-reactroot"))),!t)for(var n;n=e.lastChild;)e.removeChild(n);return new zv(e,0,t?{hydrate:!0}:void 0)}(n,i),a=s._internalRoot,"function"==typeof r){var l=r;r=function(){var e=kv(a);l.call(e)}}Zm((function(){Tv(t,a,e,r)}))}return kv(a)}function Bv(e,t,n){var i=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:Ql,key:null==i?null:""+i,children:e,containerInfo:t,implementation:n}}function jv(e,t){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Dv(t))throw Error(Go(200));return Bv(e,t,null,n)}zv.prototype.render=function(e){Tv(e,this._internalRoot,null,null)},zv.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;Tv(null,e,null,(function(){t[md]=null}))},su=function(e){if(13===e.tag){var t=Rp(Om(),150,100);_m(e,t),Pv(e,t)}},au=function(e){13===e.tag&&(_m(e,3),Pv(e,3))},ou=function(e){if(13===e.tag){var t=Om();_m(e,t=Vm(t,e,null)),Pv(e,t)}},vl=function(e,t,n){switch(t){case"input":if(fc(e,n),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var i=n[t];if(i!==e&&i.form===e.form){var r=yd(i);if(!r)throw Error(Go(90));uc(i),fc(i,r)}}}break;case"textarea":xc(e,n);break;case"select":null!=(t=n.value)&&bc(e,!!n.multiple,t,!1)}},Ml=Fm,Sl=function(e,t,n,i,r){var s=gm;gm|=4;try{return zp(98,e.bind(null,t,n,i,r))}finally{0===(gm=s)&&Bp()}},Il=function(){0==(49&gm)&&(function(){if(null!==Lm){var e=Lm;Lm=null,e.forEach((function(e,t){Av(t,e),Hm(t)})),Bp()}}(),ov())},El=function(e,t){var n=gm;gm|=2;try{return e(t)}finally{0===(gm=n)&&Bp()}};var Rv={Events:[bd,wd,yd,gl,hl,Ad,function(e){Yc(e,Ed)},xl,Cl,Uu,Jc,ov,{current:!1}]};!function(e){var t=e.findFiberByHostInstance;(function(e){if("undefined"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__)return!1;var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)return!0;try{var n=t.inject(e);pv=function(e){try{t.onCommitFiberRoot(n,e,void 0,64==(64&e.current.effectTag))}catch(zb){}},fv=function(e){try{t.onCommitFiberUnmount(n,e)}catch(zb){}}}catch(i){}})(Zo({},e,{overrideHookState:null,overrideProps:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Vl.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=Fc(e))?null:e.stateNode},findFiberByHostInstance:function(e){return t?t(e):null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null}))}({findFiberByHostInstance:vd,bundleType:0,version:"16.14.0",rendererPackageName:"react-dom"}),Ho.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Rv,Ho.createPortal=jv,Ho.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternalFiber;if(void 0===t){if("function"==typeof e.render)throw Error(Go(188));throw Error(Go(268,Object.keys(e)))}return e=null===(e=Fc(t))?null:e.stateNode},Ho.flushSync=function(e,t){if(0!=(48&gm))throw Error(Go(187));var n=gm;gm|=1;try{return zp(99,e.bind(null,t))}finally{gm=n,Bp()}},Ho.hydrate=function(e,t,n){if(!Dv(t))throw Error(Go(200));return Lv(null,e,t,!0,n)},Ho.render=function(e,t,n){if(!Dv(t))throw Error(Go(200));return Lv(null,e,t,!1,n)},Ho.unmountComponentAtNode=function(e){if(!Dv(e))throw Error(Go(40));return!!e._reactRootContainer&&(Zm((function(){Lv(null,null,e,!1,(function(){e._reactRootContainer=null,e[md]=null}))})),!0)},Ho.unstable_batchedUpdates=Fm,Ho.unstable_createPortal=function(e,t){return jv(e,t,2<arguments.length&&void 0!==arguments[2]?arguments[2]:null)},Ho.unstable_renderSubtreeIntoContainer=function(e,t,n,i){if(!Dv(n))throw Error(Go(200));if(null==e||void 0===e._reactInternalFiber)throw Error(Go(38));return Lv(e,t,n,!1,i)},Ho.version="16.14.0",function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),Wo.exports=Ho;var Ov=Wo.exports,Vv=Object.defineProperty,_v=Object.defineProperties,Uv=Object.getOwnPropertyDescriptors,Wv=Object.getOwnPropertySymbols,Hv=Object.prototype.hasOwnProperty,Qv=Object.prototype.propertyIsEnumerable,$v=(e,t,n)=>t in e?Vv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Fv=(e,t)=>{for(var n in t||(t={}))Hv.call(t,n)&&$v(e,n,t[n]);if(Wv)for(var n of Wv(t))Qv.call(t,n)&&$v(e,n,t[n]);return e};const Zv={src:"",currentTime:0,hostTime:0,muted:!1,paused:!0,volume:1},Yv={currentTimeMaxError:1,syncInterval:1e3,retryInterval:15e3,verbose:!1,log:console.log.bind(console)};let Gv=Yv;function Xv(e,t){if(e.paused)return e.currentTime;const n=(i=t).player?i.player.beginTimestamp+i.player.progressTime:i.room?i.room.calibrationTimestamp:void 0;var i;return n?e.currentTime+(n-e.hostTime)/1e3:e.currentTime}const Jv=navigator.userAgent.includes("Safari"),Kv=[".aac",".mid",".midi",".mp3",".ogg",".oga",".wav",".weba"];var qv="object"==typeof global&&global&&global.Object===Object&&global,eb="object"==typeof self&&self&&self.Object===Object&&self,tb=qv||eb||Function("return this")(),nb=tb.Symbol,ib=Object.prototype,rb=ib.hasOwnProperty,sb=ib.toString,ab=nb?nb.toStringTag:void 0,ob=Object.prototype.toString,lb=nb?nb.toStringTag:void 0;var cb=/\s/,ub=/^\s+/;function db(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}var hb=/^[-+]0x[0-9a-f]+$/i,pb=/^0b[01]+$/i,fb=/^0o[0-7]+$/i,gb=parseInt;function mb(e){if("number"==typeof e)return e;if("symbol"==typeof(t=e)||null!=(n=t)&&"object"==typeof n&&"[object Symbol]"==function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":lb&&lb in Object(e)?function(e){var t=rb.call(e,ab),n=e[ab];try{e[ab]=void 0;var i=!0}catch(s){}var r=sb.call(e);return i&&(t?e[ab]=n:delete e[ab]),r}(e):(t=e,ob.call(t));var t}(t))return NaN;var t,n;if(db(e)){var i="function"==typeof e.valueOf?e.valueOf():e;e=db(i)?i+"":i}if("string"!=typeof e)return 0===e?e:+e;e=function(e){return e?e.slice(0,function(e){for(var t=e.length;t--&&cb.test(e.charAt(t)););return t}(e)+1).replace(ub,""):e}(e);var r=pb.test(e);return r||fb.test(e)?gb(e.slice(2),r?2:8):hb.test(e)?NaN:+e}var vb=function(){return tb.Date.now()},bb=Math.max,wb=Math.min;function yb(e,t,n){var i,r,s,a,o,l,c=0,u=!1,d=!1,h=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var n=i,s=r;return i=r=void 0,c=t,a=e.apply(s,n)}function f(e){return c=e,o=setTimeout(m,t),u?p(e):a}function g(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-c>=s}function m(){var e,n,i=vb();if(g(i))return v(i);o=setTimeout(m,(n=t-((e=i)-l),d?wb(n,s-(e-c)):n))}function v(e){return o=void 0,h&&i?p(e):(i=r=void 0,a)}function b(){var e=vb(),n=g(e);if(i=arguments,r=this,l=e,n){if(void 0===o)return f(l);if(d)return clearTimeout(o),o=setTimeout(m,t),p(l)}return void 0===o&&(o=setTimeout(m,t)),a}return t=mb(t)||0,db(n)&&(u=!!n.leading,s=(d="maxWait"in n)?bb(mb(n.maxWait)||0,t):s,h="trailing"in n?!!n.trailing:h),b.cancel=function(){void 0!==o&&clearTimeout(o),c=0,i=l=r=o=void 0},b.flush=function(){return void 0===o?a:v(vb())},b}class xb extends tt.exports.Component{constructor(e){super(e),this.seeking=!1,this.mobileSeeking=!1,this.track=null,this.hoverTime=null,this.offset=0,this.secondsPrefix="00:00:",this.minutesPrefix="00:",this.seekPause=!1,this.handleTouchSeeking=e=>{let t=0;for(let n=0;n<e.changedTouches.length;n++)t=e.changedTouches[n].pageX;t=t<0?0:t,this.mobileSeeking&&this.changeCurrentTimePosition(t)},this.handleSeeking=e=>{this.seeking&&this.changeCurrentTimePosition(e.pageX)},this.setTrackWidthState=()=>{this.track&&this.setState({trackWidth:this.track.offsetWidth})},this.handleTrackHover=(e,t)=>{if(this.track){const n=this.props.scale||1;let i;i=e?0:(t.pageX-this.track.getBoundingClientRect().left)/n,this.setState({seekHoverPosition:i,trackWidth:this.track.offsetWidth})}},this.mouseSeekingHandler=e=>{this.setSeeking(!1,e),this.onMouseUp()},this.setSeeking=(e,t)=>{t.preventDefault(),this.handleSeeking(t),this.seeking=e,this.setState({seekHoverPosition:e?this.state.seekHoverPosition:0})},this.mobileTouchSeekingHandler=()=>{this.setMobileSeeking(!1)},this.setMobileSeeking=e=>{this.mobileSeeking=e,this.setState({seekHoverPosition:e?this.state.seekHoverPosition:0})},this.renderBufferProgress=()=>{if(this.props.buffered){const e=Fv(Fv({},this.getPositionStyle(this.props.buffered)),this.props.bufferColor&&{backgroundColor:this.props.bufferColor});return Zt.createElement("div",{className:"buffered",style:e})}return null},this.renderProgress=()=>{const e=Fv(Fv({},this.getPositionStyle(this.props.current)),this.props.sliderColor&&{backgroundColor:this.props.sliderColor});return Zt.createElement("div",{className:"connect",style:e})},this.renderHoverProgress=()=>{const e=Fv(Fv({},this.getSeekHoverPosition()),this.props.sliderHoverColor&&{backgroundColor:this.props.sliderHoverColor});return Zt.createElement("div",{className:"seek-hover",style:e})},this.renderThumb=()=>Zt.createElement("div",{className:this.isThumbActive()?"thumb active":"thumb",style:this.getThumbHandlerPosition()},Zt.createElement("div",{style:{backgroundColor:this.props.thumbColor},className:"handler"})),this.onMouseDown=e=>{var t,n;this.props.pause&&!this.props.paused&&(this.props.pause(),this.seekPause=!0),this.setSeeking(!0,e),null==(n=(t=this.props).onSeekStart)||n.call(t)},this.onMouseUp=()=>{var e,t;this.props.play&&this.seekPause&&(this.props.play(),this.seekPause=!1),null==(t=(e=this.props).onSeekEnd)||t.call(e)},this.props.secondsPrefix&&(this.secondsPrefix=this.props.secondsPrefix),this.props.minutesPrefix&&(this.minutesPrefix=this.props.minutesPrefix),this.state={ready:!1,trackWidth:0,seekHoverPosition:0}}componentDidMount(){this.setTrackWidthState(),window.addEventListener("resize",this.setTrackWidthState),window.addEventListener("mousemove",this.handleSeeking),window.addEventListener("mouseup",this.mouseSeekingHandler),window.addEventListener("touchmove",this.handleTouchSeeking),window.addEventListener("touchend",this.mobileTouchSeekingHandler)}componentWillUnmount(){window.removeEventListener("resize",this.setTrackWidthState),window.removeEventListener("mousemove",this.handleSeeking),window.removeEventListener("mouseup",this.mouseSeekingHandler),window.removeEventListener("touchmove",this.handleTouchSeeking),window.removeEventListener("touchend",this.mobileTouchSeekingHandler)}changeCurrentTimePosition(e){if(this.track){const t=this.props.scale||1;let n=(e-this.track.getBoundingClientRect().left)/t;n=Math.min(this.state.trackWidth,Math.max(0,n)),this.setState({seekHoverPosition:n});const i=+(n/this.state.trackWidth*this.props.total).toFixed(0);this.props.onChange(i)}}getPositionStyle(e){return{transform:`scaleX(${100*e/this.props.total/100})`}}getThumbHandlerPosition(){return{transform:`translateX(${this.state.trackWidth/(this.props.total/this.props.current)}px)`}}getSeekHoverPosition(){return{transform:`scaleX(${100*this.state.seekHoverPosition/this.state.trackWidth/100})`}}getHoverTimePosition(){let e=0;return this.hoverTime&&(e=this.state.seekHoverPosition-this.hoverTime.offsetWidth/2,this.props.limitTimeTooltipBySides&&(e<0?e=0:e+this.hoverTime.offsetWidth>this.state.trackWidth&&(e=this.state.trackWidth-this.hoverTime.offsetWidth))),{transform:`translateX(${e}px)`}}secondsToTime(e){e=Math.round(e+this.offset);const t=Math.floor(e/3600),n=e%3600,i=Math.floor(n/60),r=Math.ceil(n%60);return{hh:t.toString(),mm:i<10?"0"+i:i.toString(),ss:r<10?"0"+r:r.toString()}}getHoverTime(){const e=100*this.state.seekHoverPosition/this.state.trackWidth,t=Math.floor(+e*(this.props.total/100)),n=this.secondsToTime(t);return this.props.total+this.offset<60?this.secondsPrefix+n.ss:this.props.total+this.offset<3600?this.minutesPrefix+n.mm+":"+n.ss:n.hh+":"+n.mm+":"+n.ss}isThumbActive(){return this.state.seekHoverPosition>0||this.seeking}drawHoverTime(){return this.props.hideHoverTime?null:Zt.createElement("div",{className:this.isThumbActive()?"hover-time active":"hover-time",style:this.getHoverTimePosition(),ref:e=>this.hoverTime=e},this.getHoverTime())}render(){return Zt.createElement("div",{className:"seek-slider"},Zt.createElement("div",{className:"track",ref:e=>this.track=e,onMouseMove:e=>this.handleTrackHover(!1,e),onMouseLeave:e=>this.handleTrackHover(!0,e),onMouseDown:this.onMouseDown,onTouchStart:e=>{this.setMobileSeeking(!0),this.onMouseDown(e)},onMouseUp:this.onMouseUp,onTouchEnd:this.onMouseUp},Zt.createElement("div",{className:"main"},this.renderBufferProgress(),this.renderHoverProgress(),this.renderProgress())),this.drawHoverTime(),this.renderThumb())}}class Cb extends tt.exports.Component{constructor(e){super(e),this.stageVolume=0,this.updateVolumeTimer=0,this.onVolumeSeeking=!1,this.onClickOperationButton=()=>{const{paused:e}=this.props;e?this.props.play():this.props.pause()},this.operationButton=()=>{const{paused:e}=this.props;return e?Zt.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNOCA1LjE0djE0bDExLTdsLTExLTd6IiBmaWxsPSIjZmZmIj48L3BhdGg+PC9zdmc+Cg=="}):Zt.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTQgMTloNFY1aC00TTYgMTloNFY1SDZ2MTR6IiBmaWxsPSIjZmZmIj48L3BhdGg+PC9zdmc+Cg=="})},this.operationVolumeButton=()=>this.props.volume>.9?Zt.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTQgMy4yM3YyLjA2YzIuODkuODYgNSAzLjU0IDUgNi43MXMtMi4xMSA1Ljg0LTUgNi43djIuMDdjNC0uOTEgNy00LjQ5IDctOC43N2MwLTQuMjgtMy03Ljg2LTctOC43N00xNi41IDEyYzAtMS43Ny0xLTMuMjktMi41LTQuMDNWMTZjMS41LS43MSAyLjUtMi4yNCAyLjUtNE0zIDl2Nmg0bDUgNVY0TDcgOUgzeiIgZmlsbD0iI2ZmZiI+PC9wYXRoPjwvc3ZnPgo="}):0===this.props.volume?Zt.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNNyA5djZoNGw1IDVWNGwtNSA1SDd6IiBmaWxsPSIjZmZmIj48L3BhdGg+PC9zdmc+Cg=="}):Zt.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNNSA5djZoNGw1IDVWNEw5IDltOS41IDNjMC0xLjc3LTEtMy4yOS0yLjUtNC4wM1YxNmMxLjUtLjcxIDIuNS0yLjI0IDIuNS00eiIgZmlsbD0iI2ZmZiI+PC9wYXRoPjwvc3ZnPgo="}),this.handleClickVolume=()=>{0===this.props.volume?0!==this.stageVolume?this.props.setVolume(this.stageVolume):this.props.setVolume(1):(this.stageVolume=this.props.volume,this.props.setVolume(0))},this.onChange=e=>{this.setState({currentTime:e}),e&&this.changeTime(e)},this.changeTime=yb((e=>{this.props.setCurrentTime(e)}),50),this.onVolumeChange=e=>{this.changeVolume(e),this.setState({seekVolume:e/100})},this.changeVolume=yb((e=>{this.props.setVolume(e/100)}),50),this.onVolumeSeekStart=()=>{this.onVolumeSeeking=!0},this.onVolumeSeekEnd=yb((()=>{this.onVolumeSeeking=!1}),500),this.onProgressSeekStart=()=>this.setState({isPlayerSeeking:!0}),this.onProgressSeekEnd=yb((()=>{this.setState({isPlayerSeeking:!1})}),500),this.state={isPlayerSeeking:!1,isVolumeHover:!1,seekVolume:1,visible:!0,currentTime:0},this.stageVolume=e.volume}componentDidMount(){this.updateVolumeTimer=setInterval((()=>{this.onVolumeSeeking||this.setState({seekVolume:this.props.volume}),this.state.isPlayerSeeking||this.setState({currentTime:this.props.currentTime})}),100)}componentWillUnmount(){this.updateVolumeTimer&&clearInterval(this.updateVolumeTimer)}render(){const{duration:e,currentTime:t}=this.props;return Zt.createElement("div",{className:"player-controller",style:{opacity:this.props.visible?"1":"0"}},Zt.createElement("div",{className:"player-controller-progress"},Zt.createElement(xb,{total:e,current:this.state.currentTime,onChange:this.onChange,buffered:this.props.buffered,bufferColor:"rgba(255,255,255,0.3)",hideHoverTime:!0,limitTimeTooltipBySides:!0,onSeekStart:this.onProgressSeekStart,onSeekEnd:this.onProgressSeekEnd,play:this.props.play,pause:this.props.pause,paused:this.props.paused,scale:this.props.scale})),Zt.createElement("div",{className:"player-controller-actions"},Zt.createElement("div",{className:"player-controller-actions-left"},Zt.createElement("div",{onClick:this.onClickOperationButton,className:"player-controller-play"},this.operationButton()),Zt.createElement("div",{className:"player-volume-box",onMouseEnter:()=>this.setState({isVolumeHover:!0}),onMouseLeave:()=>this.setState({isVolumeHover:!1})},Zt.createElement("div",{onClick:this.handleClickVolume,className:"player-volume"},this.operationVolumeButton()),Zt.createElement("div",{className:"player-volume-slider"},Zt.createElement(xb,{total:100,current:100*this.state.seekVolume,onChange:this.onVolumeChange,onSeekStart:this.onVolumeSeekStart,onSeekEnd:this.onVolumeSeekEnd,scale:this.props.scale,limitTimeTooltipBySides:!0,hideHoverTime:!0})))),Zt.createElement("div",{className:"player-mid-box-time"},Mb(Math.floor(t/1e3))," /"," ",Mb(Math.floor(e/1e3)))))}}function Mb(e){const t=e%60,n=(e-t)/60;if(n>=60){const e=n%60;return`${Sb((n-e)/60)}:${Sb(e)}:${Sb(t)}`}return`${Sb(n)}:${Sb(t)}`}function Sb(e){return e<=9?`0${e}`:`${e}`}class Ib extends tt.exports.Component{constructor(){super(...arguments),this.putAttributes=e=>{const{context:t}=this.props,n=t.getAttributes()||{};for(const i in e)n[i]!==e[i]&&t.updateAttributes([i],e[i])}}render(){const{context:e}=this.props,t=e.getRoom(),n=t?void 0:e.getDisplayer(),i=this.putAttributes;return Zt.createElement(Eb,{room:t,player:n,context:e,plugin:{putAttributes:i}})}}class Eb extends tt.exports.Component{constructor(e){super(e),this.alertMask=null,this.container=Zt.createRef(),this.controllerHiddenTimer=0,this.syncPlayerTimer=0,this.retryCount=0,this.decreaseRetryTimer=0,this.noSoundSyncCount=0,this.showController=()=>{this.setState({controllerVisible:!0}),this.debounceHidingController()},this.play=()=>{var e;const t=null==(e=this.props.room)?void 0:e.calibrationTimestamp;this.debug(">>> play",{paused:!1,hostTime:t}),this.isEnabled()&&this.props.plugin.putAttributes({paused:!1,hostTime:t})},this.pause=()=>{const e=Xv(this.getAttributes(),this.props);this.debug(">>> pause",{paused:!0,currentTime:e}),this.isEnabled()&&this.props.plugin.putAttributes({paused:!0,currentTime:e})},this.setVolume=e=>{this.debug(">>> volume",{volume:e}),this.isEnabled()&&this.props.plugin.putAttributes({volume:e}),this.isEnabled()&&this.props.plugin.putAttributes({volume:e,muted:0===e})},this.setCurrentTime=e=>{var t;const n=null==(t=this.props.room)?void 0:t.calibrationTimestamp;this.debug(">>> seek",{currentTime:e/1e3,hostTime:n}),this.isEnabled()&&this.props.plugin.putAttributes({currentTime:e/1e3,hostTime:n})},this.resetPlayer=()=>{var e;null==(e=this.player)||e.autoplay(!1),this.state.NoSound||(this.debug(">>> ended",{paused:!0,currentTime:0}),this.isEnabled()&&this.props.plugin.putAttributes({paused:!0,currentTime:0}))},this.syncPlayerWithAttributes=()=>{var e;const t=this.getAttributes();if(!t)return;const n=this.player;if(!n)return;if(this.state.NoSound&&(this.noSoundSyncCount+=1)%8!=0)return;n.paused()!==t.paused&&(this.debug("<<< paused -> %o",t.paused),t.paused?n.pause():null==(e=n.play())||e.catch(this.catchPlayFail)),n.muted()!==t.muted&&(this.debug("<<< muted -> %o",t.muted),n.muted(t.muted)),n.volume()!==t.volume&&(this.debug("<<< volume -> %o",t.volume),n.volume(t.volume));const i=Xv(t,this.props);let r=Gv.currentTimeMaxError;this.state.NoSound&&(r*=3),i>n.duration()?this.resetPlayer():Math.abs(n.currentTime()-i)>r&&(this.debug("<<< currentTime -> %o",i),n.currentTime(i))},this.debounceHidingController=()=>{this.controllerHiddenTimer&&(clearTimeout(this.controllerHiddenTimer),this.controllerHiddenTimer=0),this.controllerHiddenTimer=setTimeout((()=>{this.setState({controllerVisible:!1}),this.controllerHiddenTimer=0}),3e3)},this.decreaseRetryCount=()=>{this.player&&this.retryCount>0&&(this.retryCount=this.retryCount-1)},this.catchPlayFail=e=>{var t,n;const i=String(e);if(Jv&&i.includes("NotAllowedError")||i.includes("interact"))null==(t=this.player)||t.autoplay("any"),this.setState({NoSound:!0});else{const t=null==(n=this.player)?void 0:n.error();t&&(this.retryCount<=3?(this.initPlayer(),this.retryCount=this.retryCount+1):(this.debug("catch videojs media error",t),this.setState({MediaError:!0}))),this.debug("catch error",e)}},this.fixPlayFail=()=>{this.debug("try to fix play state"),this.setState({NoSound:!1});const{muted:e,volume:t}=this.getAttributes();this.player&&(this.player.muted(e),this.player.volume(t))},this.initPlayer=async()=>{var e;null==(e=this.player)||e.dispose(),this.player=void 0,this.debug("creating elements ...");const{type:t,src:n,poster:i}=this.getAttributes(),r=document.createElement("div");r.setAttribute("data-vjs-player","");const s=document.createElement("video");s.className="video-js",i&&(s.poster=i),s.setAttribute("playsInline",""),s.setAttribute("webkit-playsinline","");const a=document.createElement("source");new URL(n).pathname.endsWith(".m3u8")?a.type="application/x-mpegURL":s.src=n,a.src=n,t&&(a.type=t),s.appendChild(a),r.appendChild(s),this.container.current.appendChild(r),await new Promise((e=>(window.requestAnimationFrame||window.setTimeout)(e))),this.debug("initializing videojs() ...");const o=X(s);this.player=o,window.player=o,o.one("loadedmetadata",this.gracefullyUpdate),o.on("ready",(()=>{var e;null==(e=Gv.onPlayer)||e.call(Gv,o),o.on("timeupdate",this.gracefullyUpdate),o.on("volumechange",this.gracefullyUpdate),o.on("seeked",this.gracefullyUpdate),o.on("play",this.gracefullyUpdate),o.on("pause",this.gracefullyUpdate),o.on("ended",this.resetPlayer)})),o.on("error",this.catchPlayFail),this.setState({MediaError:!1})},this.gracefullyUpdate=()=>this.setState({updater:!this.state.updater}),this.setupAlert=e=>{e&&(e.addEventListener("touchstart",this.fixPlayFail),e.addEventListener("click",this.fixPlayFail)),this.alertMask=e},this.setupReload=e=>{e&&(e.addEventListener("touchstart",this.initPlayer),e.addEventListener("click",this.initPlayer))},this.state={NoSound:!1,MediaError:!1,updater:!1,controllerVisible:!1},e.room&&function(e){if(!e.calibrationTimestamp)throw new Error("@netless/app-media-player@0.1.0-alpha.5 requires white-web-sdk@^2.13.8 to work properly.")}(e.room)}getAttributes(){const{context:e}=this.props;let t=e.getAttributes();if(t){if(t=Fv(Fv({},Zv),t),this.player){let e=Xv(t,this.props),i=this.player.duration();!t.paused&&e>i&&(n=Fv({},t),t=_v(n,Uv({currentTime:0,paused:!0})),this.resetPlayer())}var n;return t}}isShowingPoster(){const e=this.getAttributes();return!(null==e?void 0:e.src)||Kv.some((t=>e.src.endsWith(t)))}render(){var e,t;if(!this.props.room&&!this.props.player)return null;const n=this.getAttributes();if(!n)return null;const i=1e3*((null==(e=this.player)?void 0:e.duration())||1e3),r=(null==(t=this.player)?void 0:t.bufferedPercent())||0;return Zt.createElement("div",{className:this.isEnabled()?"vjs-p":"vjs-p disabled",onMouseEnter:this.showController,onMouseMove:this.showController},Zt.createElement("div",{className:"video-js-plugin-player",ref:this.container}),this.isShowingPoster()&&Zt.createElement("div",{className:"video-js-plugin-poster"},n.poster&&Zt.createElement("img",{src:n.poster,alt:"",draggable:!1})),Zt.createElement(Cb,{duration:i,volume:n.volume,setVolume:this.setVolume,paused:n.paused,play:this.play,pause:this.pause,currentTime:1e3*Xv(n,this.props),setCurrentTime:this.setCurrentTime,buffered:i*r,visible:!0}),this.state.NoSound&&Zt.createElement("div",{ref:this.setupAlert,className:"videojs-plugin-muted-alert"}),this.state.MediaError&&Zt.createElement("div",{className:"videojs-plugin-recovery-mode"},Zt.createElement("button",{ref:this.setupReload},"Reload Player")))}debug(e,...t){Gv.verbose&&Gv.log(`[MediaPlayer] ${e}`,...t)}componentDidMount(){this.debug("app version =","0.1.0-alpha.5"),this.debug("video.js version =",X.VERSION),this.initPlayer(),this.props.context.emitter.on("attributesUpdate",this.syncPlayerWithAttributes),this.syncPlayerTimer=setInterval(this.syncPlayerWithAttributes,Gv.syncInterval),this.decreaseRetryTimer=setInterval(this.decreaseRetryCount,Gv.retryInterval)}componentWillUnmount(){var e;this.debug("unmount"),this.props.context.emitter.off("attributesUpdate",this.syncPlayerWithAttributes),null==(e=this.player)||e.dispose(),clearInterval(this.syncPlayerTimer),clearInterval(this.decreaseRetryTimer)}isEnabled(){return this.props.context.getIsWritable()}}const Ab={kind:"MediaPlayer",setup(e){let t=e.getAttributes();if(!t||!t.src)return e.emitter.emit("destroy",{error:new Error("[MediaPlayer]: Missing 'attributes'.'src'.")});t=Fv(Fv({},Zv),t);const n=e.getBox();n.mountStyles('.vjs-p{display:flex;flex-grow:1}.vjs-p *{pointer-events:auto}.vjs-p.disabled *{pointer-events:none}.vjs-p .video-js-plugin-poster{position:absolute;top:0;left:0;right:0;bottom:0;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgQAAACACAYAAAB0vHFxAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAACBKADAAQAAAABAAAAgAAAAACE3oPTAAAKXUlEQVR4Ae3dYW4ktxEG0LW9FwkC2McycokAOUGAXMLwtQwYvomdP4akHUnNnm6SVUU+/xqpe8ji+yiDWz3a/e7L5v/98se//3pL8K9//O+7t19Hv85eX7RP9vnllz2h4/rkd+wz+ir/0cLfjv/9t1/6igABAgQIENhRwIFgx9StmQABAgQIPAg4EDyA+JIAAQIECOwo8HXHRVvzPIHRzwBHjz9PKudMo31Hj59TdZ2qsueXvb5sO0GHIFsi6iFAgAABAgECOgQB6KbsJ5Dtt0L6rWyPkeRXO+fs+WWvL1v6OgTZElEPAQIECBAIENAhCEA3ZT8Bzwj7WUaMJL8I9X5zZs8ve339kugzkg5BH0ejECBAgACB0gIOBKXjUzwBAgQIEOgj4EDQx9EoBAgQIECgtIADQen4FE+AAAECBPoIOBD0cTQKAQIECBAoLeC3DErHp/iWgE8Zt4RyX5df7nxa1Y3Ob/T4rfWtdl2HYLVErYcAAQIECFwQWL5DsPoJcvX1XdjTpd4iv1JxvStWfu9IfCORwLP7U4cgUXhKIUCAAAECUQIOBFHy5iVAgAABAokEHAgShaEUAgQIECAQJXD7MwTPPqOIWujVeUevb/T4V9ftfecE5HfOKetd8suajLoiBHQIItTNSYAAAQIEkgnc7hAkW0/3ckb/e9qjx+8OYsBvBOT3DUe5L+RXLjIFDxTQIRiIa2gCBAgQIFBFoNkh2P0Z2+j1jx4/+0asvv7q9d/dH9XXX73+3fO7u/7W+3fbHzoErR3hOgECBAgQ2ECg2SHwjG2DXRC4xOj9tdufAHpHLb/eonPHk9+xd7TPcXX9r+oQ9Dc1IgECBAgQKCfgQFAuMgUTIECAAIH+Ag4E/U2NSIAAAQIEygk0P0MQvaLsz3hb9bWu840WOJ5ffsc+2a/KL3tC6jsSmL1/dQiO0nCNAAECBAhsItDsEMw+oTzrHl1f61OorevPrvfZ+6N9WvVmr09+xwnKr7ZP9vyOdcdfze7Tuz4dgvF7ygwECBAgQCC9QLNDkH0F0X+C45NdoHZ99rf8aguofqRA7/8/6BCMTMvYBAgQIECgiED5DkHvZyhFcjtdJp/TVClvlF/KWE4XJb/TVG68INB7f+kQXAjBWwgQIECAwGoCDgSrJWo9BAgQIEDggoADwQU0byFAgAABAqsJfO39DGI1IOuJFbA/Y/3vzi6/u4Kx7189v7vru/v+2HTfz65D8N7EdwgQIECAwHYCw3/LYLUT1HY7pLFg+TaAkl+WX/KAGuXJrwEUfLlaPjoEwRvG9AQIECBAIIPA8A5B779JKQOaGl4F5PtqUfGV/Cqm9lqz/F4tMr6qlo8OQcZdpCYCBAgQIDBZYHiHoNozlMn+5aeTb+0I5Se/2gK5q6/286VDkHs/qY4AAQIECEwRcCCYwmwSAgQIECCQW8CBIHc+qiNAgAABAlMEhn+GYMoqTEKAAAEC7wSqPcN+twDfmCqgQzCV22QECBAgQCCnQHiHoPoJtlV/63rObfFaVfX6X1dy7VX19Vev/1pqr++qvv7q9b8m4dVHAtny1SH4KCXfI0CAAAECmwmEdwiq/U1Om+2PL/Kpnbj85FdbYO3qs/186hCsvd+sjgABAgQInBJwIDjF5CYCBAgQILC2gAPB2vlaHQECBAgQOCUQ/hmCbJ+yPKW20U3yqR22/ORXW2Dt6qN/Ph/n1yFYe79ZHQECBAgQOCXgQHCKyU0ECBAgQGBtAQeCtfO1OgIECBAgcErAgeAUk5sIECBAgMDaAg4Ea+drdQQIECBA4JTA1+///OGnoztd52N/fC7g58PPx+e748sX+8P+qLQ/dAiO0nKNAAECBAhsIuBAsEnQlkmAAAECBI4EHAiOdFwjQIAAAQKbCDgQbBK0ZRIgQIAAgSMBB4IjHdcIECBAgMAmAuH/lsHP//zvb5tYl1ymfErG9lK0/F4oSr6QX8nYThcdne/j/DoEp6NzIwECBAgQWFfAgWDdbK2MAAECBAicFnAgOE3lRgIECBAgsK5A+GcIfv39Pz++5X18pvH2mtfzBeQz37znjPLrqTl/LPnNN585Y7Z8dQhmpm8uAgQIECCQVCC8Q1C9I9Cqv3U96b54Kat6/S8Lufii+vqr138xtpe3VV9/9fpfgvDiQ4Fs+eoQfBiTbxIgQIAAgb0EwjsEe3FbLQECBOYJZPsT6LyVm+mKgA7BFTXvIUCAAAECiwk4ECwWqOUQIECAAIErAg4EV9S8hwABAgQILCYw/DMEnmEttmMeliPfB5BiX8qvWGAP5crvASTZl9Xy0SFItoGUQ4AAAQIEIgSGdwiy/U1MEcgrzynf2unKT361BXJXX+3nS4cg935SHQECBAgQmCIwvENQ7RnKFPWFJpFv7TDlJ7/aArmrr/bzpUOQez+pjgABAgQITBH4Wu0EM0XFJGkE7M80UVwqRH6X2NK8afX87q7v7vvTBP13IToE2RJRDwECBAgQCBBwIAhANyUBAgQIEMgm4ECQLRH1ECBAgACBAIHhv2Uwek2rPcPp7cWnt+jc8eQ317v3bPLrLWq8twK995cOwVtdrwkQIECAwKYC5TsE1f4mqNn7jM9s8b7zya+v5+zR5DdbfK/5eu8vHYK99o/VEiBAgACBDwWaHYLezyg+rOLGN6Pra53QWtdvLP3UW6N9WkVmr09+xwnKr7ZP9vyOdcdfze7Tuz4dgvF7ygwECBAgQCC9QLNDEL2C3ieg3utp1de63rueZ8fLXt+z6+l9f3af7PX1zuPZ8bL7ZK/vWW/39xWYvT90CPrmZzQCBAgQIFBSwIGgZGyKJkCAAAECfQUcCPp6Go0AAQIECJQUaH6GIPpT1iVVFX1aIHp/zX5GdxqmyI3yKxLUJ2XK7xOYv78d7XNcXf+rOgT9TY1IgAABAgTKCTQ7BLv/CWr0+kePn31HVl9/9frv7o/q669e/+753V1/6/277Q8dgtaOcJ0AAQIECGwg0OwQbGBwuMTRz5BGj3+4OBdvC8jvNmHoAPIL5Td5MgEdgmSBKIcAAQIECEQI3O4QrP6MZfT6Ro8fsal2mlN+tdOWX+38VN9XQIegr6fRCBAgQIBASQEHgpKxKZoAAQIECPQVcCDo62k0AgQIECBQUuD2Zwiyr3r1Z4Srry/7/rpbn/zuCsa+X36x/mY/Fnh2f+oQHHu6SoAAAQIEthBYvkOwRYoW+anAsyfkTwdyIURAfiHs3SYdnd/o8btBFBlIh6BIUMokQIAAAQIjBRwIRuoamwABAgQIFBFwICgSlDIJECBAgMBIAQeCkbrGJkCAAAECRQQcCIoEpUwCBAgQIDBSwG8ZjNQ19nABnzIeTjx0AvkN5R0+ePb8stc3PKAnJ9AheBLM7QQIECBAYEUBHYIVU91oTf49+9phy09+IwXsr+d0dQie83I3AQIECBBYUkCHYMlY8yxq9DO80ePnkYypZLTv6PFj1PaZNXt+2evLtlN0CLIloh4CBAgQIBAg4EAQgG5KAgQIECCQTcCBIFsi6iFAgAABAgEC/wdVfx9UuC8B6AAAAABJRU5ErkJggg==);background-repeat:repeat-x;background-position:0 50%;display:flex;align-items:center;justify-content:center}.vjs-p .video-js-plugin-poster img{box-shadow:0 0 5px 10px #0006}.vjs-p .player-controller,.vjs-p .videojs-plugin-muted-alert{pointer-events:auto}.vjs-p.disabled .videojs-plugin-close-icon,.vjs-p.disabled .player-controller{pointer-events:none}.vjs-p .video-js-plugin-player{position:absolute;top:0;left:0;right:0;bottom:0}.video-js,[data-vjs-player]{width:100%;height:100%}.vjs-p .videojs-plugin-muted-alert{pointer-events:auto;cursor:pointer;position:absolute;top:0;left:0;right:0;bottom:0;z-index:43}.vjs-p .videojs-plugin-muted-alert:before{pointer-events:auto;cursor:pointer;position:absolute;top:0;left:0;right:0;bottom:0;z-index:43;content:"\\f104";background:rgba(0,0,0,.3);font-family:VideoJS;font-size:2em;display:flex;align-items:center;justify-content:center;color:#fff}.vjs-p .videojs-plugin-recovery-mode{pointer-events:auto;cursor:pointer;position:absolute;top:0;left:0;right:0;bottom:0;z-index:44}.vjs-p .videojs-plugin-recovery-mode button{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.vjs-p .seek-slider{position:relative;width:100%}.vjs-p .seek-slider:focus{outline:none}.vjs-p .seek-slider .track{padding:10px 0;cursor:pointer;outline:none}.vjs-p .seek-slider .track:focus{border:0;outline:none}.vjs-p .seek-slider .track .main{width:100%;height:3px;background-color:#ffffff4d;border-radius:30px;position:absolute;left:0;top:8.5px;transition:transform .4s;outline:none}.vjs-p .seek-slider .track .main:focus{border:0;outline:none}.vjs-p .seek-slider .track .main .buffered{position:absolute;background-color:#ffffff4d;width:100%;height:100%;transform:scaleX(.8);z-index:2;transform-origin:0 0}.vjs-p .seek-slider .track .main .seek-hover{position:absolute;background-color:#ffffff80;width:100%;height:100%;z-index:1;transform:scaleX(.6);transform-origin:0 0;opacity:0;transition:opacity .4s}.vjs-p .seek-slider .track .main .connect{position:absolute;background-color:#fff;width:100%;height:100%;z-index:3;left:0;transform:scaleX(.13);transform-origin:0 0}.vjs-p .seek-slider .track.active .main{transform:scaleY(2)}.vjs-p .seek-slider .thumb{pointer-events:none;position:absolute;width:12px;height:12px;left:-6px;top:4px;z-index:4;transform:translate(100px)}.vjs-p .seek-slider .thumb .handler{border-radius:100%;width:100%;height:100%;background-color:#fff;opacity:0;transform:scale(.4);cursor:pointer;transition:transform .2s;pointer-events:none}.vjs-p .seek-slider .thumb.active .handler{opacity:1;transform:scale(1)}.vjs-p .seek-slider .hover-time{position:absolute;background-color:#0000004d;line-height:18px;font-size:16px;color:#ddd;top:-25px;left:0;padding:5px 10px;border-radius:5px;box-shadow:0 0 5px #0000004d;opacity:0;transform:translate(150px);pointer-events:none}.vjs-p .seek-slider .hover-time.active{opacity:1}.vjs-p .seek-slider:hover .track .main .seek-hover{opacity:1}.vjs-p .player-controller{position:absolute;z-index:100;bottom:0px;left:0;width:100%;display:flex;flex-direction:column;justify-content:center;align-items:stretch;height:64px;background-image:linear-gradient(0deg,#000,transparent);transition:opacity .2s;color:#fff}.vjs-p .player-menu-box{display:flex;align-items:center;justify-content:center;flex-direction:column;margin-bottom:40px}.vjs-p .player-menu-cell{width:100%;text-align:center;font-size:12px;color:#7a7b7c}.vjs-p .player-multiple-play{width:64px;height:120px}.vjs-p .player-controller-actions-left{display:flex;justify-content:center;align-items:center;flex-shrink:0}.vjs-p .player-right-box{font-size:14px;color:#7a7b7c;cursor:pointer;margin-right:12px}.vjs-p .player-controller-actions{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding-left:8px;padding-right:8px;margin-top:2px}.vjs-p .player-mid-box-time{font-size:9px;display:flex;justify-content:center;align-items:center;color:#fff;flex-shrink:0;margin-right:8px;font-family:monospace}.vjs-p .player-controller-play{display:flex;align-items:center;justify-content:center;cursor:pointer;padding-right:4px}.vjs-p .player-controller-progress{width:calc(100% - 28px);margin-left:14px;display:flex;align-items:center;justify-content:center;margin-top:8px}.vjs-p .player-volume{display:flex;align-items:center;justify-content:center;cursor:pointer;margin-right:16px;margin-left:8px}.vjs-p .player-volume-slider{width:60px;margin-right:12px;display:flex;align-items:center}.vjs-p .player-volume-box{display:flex;flex-direction:row}.netless-app-media-player-container{display:flex;position:relative;height:100%}\n');const i=document.createElement("div");i.classList.add("netless-app-media-player-container"),Ov.render(Zt.createElement(Ib,{context:e}),i),n.mountContent(i),e.emitter.on("destroy",(()=>{console.log("[MediaPlayer]: destroy"),Ov.unmountComponentAtNode(i)}))}},Tb={DocsViewer:Uo.kind,MediaPlayer:Ab.kind};const kb=new class{constructor(e){this.ctx=e,this.reactors=new Map,this.disposers=new Map,this.onPhaseChanged=e=>{e===H.Connected&&this.phase===H.Reconnecting&&this.onReconnected(),this.phase=e},this.onReconnected=p((()=>{$e("onReconnected refresh reactors"),this.releaseDisposers(),this.reactors.forEach(((e,t)=>{A(e)&&this.disposers.set(t,e())})),this.ctx.emitter.emit("onReconnected",void 0)}),3e3)}setRoom(e){this.room=e,this.phase=null==e?void 0:e.phase,null==e||e.callbacks.off("onPhaseChanged",this.onPhaseChanged),null==e||e.callbacks.on("onPhaseChanged",this.onPhaseChanged)}setContext(e){this.ctx=e}releaseDisposers(){this.disposers.forEach((e=>{A(e)&&e()})),this.disposers.clear()}add(e,t){A(t)&&(this.reactors.set(e,t),this.disposers.set(e,t()))}remove(e){this.reactors.has(e)&&this.reactors.delete(e);const t=this.disposers.get(e);t&&(A(t)&&t(),this.disposers.delete(e))}hasReactor(e){return this.reactors.has(e)}destroy(){var e;null==(e=this.room)||e.callbacks.off("onPhaseChanged",this.onPhaseChanged),this.releaseDisposers()}}({emitter:le}),Nb=class extends Q{constructor(e){super(e),this.version="0.4.16",this.dependencies={dependencies:{"@juggle/resize-observer":"^3.3.1","@netless/telebox-insider":"0.2.26",emittery:"^0.9.2",lodash:"^4.17.21","p-retry":"^4.6.1","side-effect-manager":"^0.1.5",uuid:"^7.0.3","video.js":">=7"},peerDependencies:{"white-web-sdk":"^2.16.0"},devDependencies:{"@netless/app-docs-viewer":"^0.2.8","@netless/app-media-player":"0.1.0-beta.5","@rollup/plugin-commonjs":"^20.0.0","@rollup/plugin-node-resolve":"^13.0.4","@rollup/plugin-url":"^6.1.0","@sveltejs/vite-plugin-svelte":"^1.0.0-next.22","@tsconfig/svelte":"^2.0.1","@types/debug":"^4.1.7","@types/lodash-es":"^4.17.4","@types/uuid":"^8.3.1","@typescript-eslint/eslint-plugin":"^4.30.0","@typescript-eslint/parser":"^4.30.0",cypress:"^8.7.0",dotenv:"^10.0.0",eslint:"^7.32.0","eslint-config-prettier":"^8.3.0","eslint-plugin-svelte3":"^3.2.0",less:"^4.1.1",prettier:"^2.3.2","prettier-plugin-svelte":"^2.4.0","rollup-plugin-analyzer":"^4.0.0","rollup-plugin-styles":"^3.14.1",svelte:"^3.42.4",typescript:"^4.5.5",vite:"^2.5.3","white-web-sdk":"2.16.10"}},this.emitter=ae,this.viewMode=$.Broadcaster,this.isReplay=V(this.displayer),this.containerSizeRatio=Nb.containerSizeRatio,Nb.displayer=e.displayer,window.NETLESS_DEPS={dependencies:{"@juggle/resize-observer":"^3.3.1","@netless/telebox-insider":"0.2.26",emittery:"^0.9.2",lodash:"^4.17.21","p-retry":"^4.6.1","side-effect-manager":"^0.1.5",uuid:"^7.0.3","video.js":">=7"},peerDependencies:{"white-web-sdk":"^2.16.0"},devDependencies:{"@netless/app-docs-viewer":"^0.2.8","@netless/app-media-player":"0.1.0-beta.5","@rollup/plugin-commonjs":"^20.0.0","@rollup/plugin-node-resolve":"^13.0.4","@rollup/plugin-url":"^6.1.0","@sveltejs/vite-plugin-svelte":"^1.0.0-next.22","@tsconfig/svelte":"^2.0.1","@types/debug":"^4.1.7","@types/lodash-es":"^4.17.4","@types/uuid":"^8.3.1","@typescript-eslint/eslint-plugin":"^4.30.0","@typescript-eslint/parser":"^4.30.0",cypress:"^8.7.0",dotenv:"^10.0.0",eslint:"^7.32.0","eslint-config-prettier":"^8.3.0","eslint-plugin-svelte3":"^3.2.0",less:"^4.1.1",prettier:"^2.3.2","prettier-plugin-svelte":"^2.4.0","rollup-plugin-analyzer":"^4.0.0","rollup-plugin-styles":"^3.14.1",svelte:"^3.42.4",typescript:"^4.5.5",vite:"^2.5.3","white-web-sdk":"2.16.10"}}}static async mount(e){const t=e.room;Nb.container=e.container;const n=e.containerSizeRatio,i=e.debug,r=e.cursor;let s;if(Nb.params=e,Nb.displayer=e.room,(()=>{if(Me(U)<Me("2.16.1"))throw new Te("2.16.1")})(),_(t)){if(t.phase!==H.Connected)throw new Error("[WindowManager]: Room only Connected can be mount");t.phase===H.Connected&&t.isWritable&&(t.disableSerialization=!1),s=await this.initManager(t)}if(Nb.isCreated)throw new Error("[WindowManager]: Already created cannot be created again");if(this.debug=Boolean(i),$e("Already insert room",s),_(this.displayer)){if(!s)throw new Error("[WindowManager]: init InvisiblePlugin failed")}else await d((async e=>{if(s=await t.getInvisiblePlugin(Nb.kind),!s)throw $e(`manager is empty. retrying ${e}`),new Error}),{retries:10});if(!s)throw new Error("[WindowManager]: create manager failed");n&&(Nb.containerSizeRatio=n),await s.ensureAttributes(),s.appManager=new Ke(s),s._pageState=new es(s.appManager),s.cursorManager=new qr(s.appManager,Boolean(r)),n&&(s.containerSizeRatio=n),e.container&&s.bindContainer(e.container),((e,t)=>{if(V(e))ns(e);else{if(e=e,Object.getOwnPropertyDescriptor(e,"disableCameraTransform"))return;Object.defineProperty(e,"disableCameraTransform",{get:()=>t.mainView.disableCameraTransform,set(e){t.mainView.disableCameraTransform=e}}),Object.defineProperty(e,"canUndoSteps",{get:()=>t.canUndoSteps}),Object.defineProperty(e,"canRedoSteps",{get:()=>t.canRedoSteps}),e.moveCamera=e=>t.moveCamera(e),e.moveCameraToContain=(...e)=>t.moveCameraToContain(...e),e.convertToPointInWorld=(...e)=>t.mainView.convertToPointInWorld(...e),e.setCameraBound=(...e)=>t.mainView.setCameraBound(...e),e.scenePreview=(...e)=>t.mainView.scenePreview(...e),e.fillSceneSnapshot=(...e)=>t.mainView.fillSceneSnapshot(...e),e.generateScreenshot=(...e)=>t.mainView.generateScreenshot(...e),e.setMemberState=(...e)=>t.mainView.setMemberState(...e),e.redo=()=>t.redo(),e.undo=()=>t.undo(),e.cleanCurrentScene=()=>t.cleanCurrentScene(),e.delete=()=>t.delete(),e.copy=()=>t.copy(),e.paste=()=>t.paste(),e.duplicate=()=>t.duplicate(),e.insertImage=(...e)=>t.insertImage(...e),e.completeImageUpload=(...e)=>t.completeImageUpload(...e),e.insertText=(...e)=>t.insertText(...e),e.lockImage=(...e)=>t.lockImage(...e),e.lockImages=(...e)=>t.lockImages(...e),ts(e)}})(t,s),le.emit("onCreated"),Nb.isCreated=!0;try{await de()}catch(a){console.warn("[WindowManager]: indexedDB open failed"),console.log(a)}return s}static async initManager(e){let t=e.getInvisiblePlugin(Nb.kind);if(!t&&_(e))if(!1===e.isWritable){try{await e.setWritable(!0)}catch(n){throw new Error("[WindowManger]: room must be switched to be writable")}t=await e.createInvisiblePlugin(Nb,{}),t.ensureAttributes(),await Se(500),await e.setWritable(!1)}else t=await e.createInvisiblePlugin(Nb,{});return t}static initContainer(e,t,n,i){Nb.container||(Nb.container=t);const{playground:r,wrapper:s,sizer:a,mainViewElement:o}=(e=>{const t=document.createElement("div");t.className="netless-window-manager-playground";const n=document.createElement("div");n.className="netless-window-manager-sizer";const i=document.createElement("div");i.className="netless-window-manager-wrapper";const r=document.createElement("div");return r.className="netless-window-manager-main-view",t.appendChild(n),n.appendChild(i),i.appendChild(r),e.appendChild(t),Pb.wrapper=i,{playground:t,wrapper:i,sizer:n,mainViewElement:r}})(t);if(Nb.playground=r,n&&a.classList.add("netless-window-manager-chess-sizer"),i){const e=document.createElement("style");e.textContent=i,r.appendChild(e)}return e.containerResizeObserver=et.create(r,a,s,le),Nb.wrapper=s,o}static get registered(){return me.registered}bindContainer(e){var t,n,i,r,s,a,o,l,c,u;if(Nb.isCreated&&Nb.container)Nb.container.firstChild&&e.appendChild(Nb.container.firstChild);else if(Nb.params){const i=Nb.params,r=Nb.initContainer(this,e,i.chessboard,i.overwriteStyles),s=(o=this,l=ae,c=le,u={collectorContainer:i.collectorContainer,collectorStyles:i.collectorStyles,prefersColorScheme:i.prefersColorScheme},new dr({safeSetAttributes:e=>o.safeSetAttributes(e),getMainView:()=>o.mainView,updateAppState:(...e)=>{var t;return null==(t=o.appManager)?void 0:t.store.updateAppState(...e)},canOperate:()=>o.canOperate,notifyContainerRectUpdate:e=>{var t;return null==(t=o.appManager)?void 0:t.notifyContainerRectUpdate(e)},cleanFocus:()=>{var e;return null==(e=o.appManager)?void 0:e.store.cleanFocus()},setAppFocus:e=>{var t;return null==(t=o.appManager)?void 0:t.store.setAppFocus(e,!0)},callbacks:l,emitter:c},u));this.boxManager=s,null==(t=this.appManager)||t.setBoxManager(s),this.bindMainView(r,i.disableCameraTransform),Nb.wrapper&&(null==(n=this.cursorManager)||n.setupWrapper(Nb.wrapper))}le.emit("updateManagerRect"),null==(i=this.appManager)||i.refresh(),null==(r=this.appManager)||r.resetMaximized(),null==(s=this.appManager)||s.resetMinimized(),null==(a=this.appManager)||a.displayerWritableListener(!this.room.isWritable),Nb.container=e}bindCollectorContainer(e){Nb.isCreated&&this.boxManager?this.boxManager.setCollectorContainer(e):Nb.params&&(Nb.params.collectorContainer=e)}static register(e){return me.register(e)}static unregister(e){return me.unregister(e)}async addApp(e){if(this.appManager)return this.appManager.rootDirRemoving?new Promise(((t,n)=>{le.once("rootDirRemoved").then((async()=>{try{const n=await this._addApp(e);t(n)}catch(i){n(i.message)}}))})):this._addApp(e);throw new Ae}async _addApp(e){var t,n,i,r;if(this.appManager){if(!e.kind||"string"!=typeof e.kind)throw new ke;const s=await(null==(t=me.appClasses.get(e.kind))?void 0:t());if(s&&(null==(n=s.config)?void 0:n.singleton)&&this.appManager.appProxies.has(e.kind))throw new Ee;const a=this.setupScenePath(e,this.appManager);if(void 0===a)return;(null==(i=null==e?void 0:e.options)?void 0:i.scenePath)&&(e.options.scenePath=(r=e.options.scenePath).endsWith("/")?r.slice(0,-1):r);return await this.appManager.addApp(e,Boolean(a))}throw new Ae}setupScenePath(e,t){let n=!1;if(e.options){const{scenePath:i,scenes:r}=e.options;if(i){if(!(e=>e.startsWith("/"))(i))throw new Pe;const e=Object.keys(this.apps||{});for(const n of e){const e=t.store.getAppScenePath(n);if(e&&e===i){if(console.warn(`[WindowManager]: ScenePath ${i} Already opened`),this.boxManager){const e=this.boxManager.getTopBox();e&&this.boxManager.setZIndex(n,e.zIndex+1,!1)}return}}}i&&r&&r.length>0&&(this.isDynamicPPT(r)?(n=!0,ye(this.displayer)[i]||xe(this.room,i,r)):ye(this.displayer)[i]||xe(this.room,i,[{name:r[0].name}])),i&&void 0===r&&xe(this.room,i,[{}])}return n}async setMainViewScenePath(e){this.appManager&&await this.appManager.setMainViewScenePath(e)}async setMainViewSceneIndex(e){this.appManager&&await this.appManager.setMainViewSceneIndex(e)}async nextPage(){if(this.appManager){const e=this.mainViewSceneIndex+1;return e>=this.mainViewScenesLength?(console.warn("[WindowManager]: current page is the last page"),!1):(await this.appManager.setMainViewSceneIndex(e),!0)}return!1}async prevPage(){if(this.appManager){const e=this.mainViewSceneIndex-1;return e<0?(console.warn("[WindowManager]: current page is the first page"),!1):(await this.appManager.setMainViewSceneIndex(e),!0)}return!1}async addPage(e){if(this.appManager){const t=null==e?void 0:e.after,n=null==e?void 0:e.scene;if(t){const e=this.mainViewSceneIndex+1;this.room.putScenes("/",[n||{}],e)}else this.room.putScenes("/",[n||{}])}}getMainViewScenePath(){var e;return null==(e=this.appManager)?void 0:e.store.getMainViewScenePath()}getMainViewSceneIndex(){var e;return null==(e=this.appManager)?void 0:e.store.getMainViewSceneIndex()}setReadonly(e){var t;this.readonly=e,null==(t=this.boxManager)||t.setReadonly(e),le.emit("setReadonly",e)}switchMainViewToWriter(){var e;return null==(e=this.appManager)?void 0:e.mainViewProxy.mainViewClickHandler()}onAppDestroy(e,t){((e,t)=>{le.once(e).then(t)})(`destroy-${e}`,t)}setViewMode(e){var t,n,i;e===$.Broadcaster&&(this.canOperate&&(null==(t=this.appManager)||t.mainViewProxy.setCameraAndSize()),null==(n=this.appManager)||n.mainViewProxy.start()),e===$.Freedom&&(null==(i=this.appManager)||i.mainViewProxy.stop()),this.viewMode=e}setBoxState(e){if(this.canOperate)switch(e){case"normal":this.setMaximized(!1),this.setMinimized(!1);break;case"maximized":this.setMaximized(!0),this.setMinimized(!1);break;case"minimized":this.setMinimized(!0)}}setMaximized(e){var t;this.canOperate&&(null==(t=this.boxManager)||t.setMaximized(e,!1))}setMinimized(e){var t;this.canOperate&&(null==(t=this.boxManager)||t.setMinimized(e,!1))}get mainView(){if(this.appManager)return this.appManager.mainViewProxy.view;throw new Ae}get camera(){if(this.appManager)return this.appManager.mainViewProxy.view.camera;throw new Ae}get cameraState(){if(this.appManager)return this.appManager.mainViewProxy.cameraState;throw new Ae}get apps(){var e;return null==(e=this.appManager)?void 0:e.store.apps()}get boxState(){var e;if(this.appManager)return null==(e=this.appManager.boxManager)?void 0:e.boxState;throw new Ae}get darkMode(){var e,t;return Boolean(null==(t=null==(e=this.appManager)?void 0:e.boxManager)?void 0:t.darkMode)}get prefersColorScheme(){var e;if(this.appManager)return null==(e=this.appManager.boxManager)?void 0:e.prefersColorScheme;throw new Ae}get focused(){return this.attributes.focus}get focusedView(){var e,t;return(null==(t=null==(e=this.appManager)?void 0:e.focusApp)?void 0:t.view)||this.mainView}get mainViewSceneIndex(){var e;return(null==(e=this._pageState)?void 0:e.index)||0}get mainViewSceneDir(){var e;if(this.appManager)return null==(e=this.appManager)?void 0:e.getMainViewSceneDir();throw new Ae}get topApp(){var e,t;return null==(t=null==(e=this.boxManager)?void 0:e.getTopBox())?void 0:t.id}get mainViewScenesLength(){var e;return(null==(e=this._pageState)?void 0:e.length)||0}get canRedoSteps(){var e;return(null==(e=this.focusedView)?void 0:e.canRedoSteps)||0}get canUndoSteps(){var e;return(null==(e=this.focusedView)?void 0:e.canUndoSteps)||0}get sceneState(){if(this.appManager)return this.appManager.sceneState;throw new Ae}get pageState(){if(this._pageState)return this._pageState.toObject();throw new Ae}queryAll(){var e;return Array.from((null==(e=this.appManager)?void 0:e.appProxies.values())||[])}queryOne(e){var t;return null==(t=this.appManager)?void 0:t.appProxies.get(e)}async closeApp(e){var t;return null==(t=this.appManager)?void 0:t.closeApp(e)}moveCamera(t){var n;const i=g(t,["animationMode"]),r=c({},this.mainView.camera);f(c(c({},r),i),r)||(this.mainView.moveCamera(t),null==(n=this.appManager)||n.dispatchInternalEvent(e.MoveCamera,t),setTimeout((()=>{var e;null==(e=this.appManager)||e.mainViewProxy.setCameraAndSize()}),500))}moveCameraToContain(t){var n;this.mainView.moveCameraToContain(t),null==(n=this.appManager)||n.dispatchInternalEvent(e.MoveCameraToContain,t),setTimeout((()=>{var e;null==(e=this.appManager)||e.mainViewProxy.setCameraAndSize()}),500)}convertToPointInWorld(e){return this.mainView.convertToPointInWorld(e)}setCameraBound(e){this.mainView.setCameraBound(e)}onDestroy(){this._destroy()}destroy(){this._destroy()}_destroy(){var e,t,n,i;null==(e=this.containerResizeObserver)||e.disconnect(),null==(t=this.appManager)||t.destroy(),null==(n=this.cursorManager)||n.destroy(),Nb.container=void 0,Nb.wrapper=void 0,Nb.isCreated=!1,Nb.playground&&(null==(i=Nb.playground.parentNode)||i.removeChild(Nb.playground)),Nb.params=void 0,$e("Destroyed")}bindMainView(e,t){var n;this.appManager&&(this.appManager.bindMainView(e,Boolean(t)),null==(n=this.cursorManager)||n.setMainViewDivElement(e))}get canOperate(){return!!_(this.displayer)&&(this.displayer.isWritable&&this.displayer.phase===H.Connected)}get room(){return this.displayer}safeSetAttributes(e){this.canOperate&&this.setAttributes(e)}safeUpdateAttributes(e,t){this.canOperate&&this.updateAttributes(e,t)}setPrefersColorScheme(e){var t,n;null==(n=null==(t=this.appManager)?void 0:t.boxManager)||n.setPrefersColorScheme(e)}cleanCurrentScene(){var e;null==(e=this.focusedView)||e.cleanCurrentScene()}redo(){var e;return(null==(e=this.focusedView)?void 0:e.redo())||0}undo(){var e;return(null==(e=this.focusedView)?void 0:e.undo())||0}delete(){var e;null==(e=this.focusedView)||e.delete()}copy(){var e;null==(e=this.focusedView)||e.copy()}paste(){var e;null==(e=this.focusedView)||e.paste()}duplicate(){var e;null==(e=this.focusedView)||e.duplicate()}insertText(e,t,n){var i;return(null==(i=this.focusedView)?void 0:i.insertText(e,t,n))||""}insertImage(e){var t;return null==(t=this.focusedView)?void 0:t.insertImage(e)}completeImageUpload(e,t){var n;return null==(n=this.focusedView)?void 0:n.completeImageUpload(e,t)}lockImage(e,t){var n;return null==(n=this.focusedView)?void 0:n.lockImage(e,t)}lockImages(e){var t;return null==(t=this.focusedView)?void 0:t.lockImages(e)}isDynamicPPT(e){var t,n;const i=null==(n=null==(t=e[0])?void 0:t.ppt)?void 0:n.src;return null==i?void 0:i.startsWith("pptx://")}async ensureAttributes(){T(this.attributes)&&await Se(50),m(this.attributes)&&(this.attributes[We.Apps]||this.safeSetAttributes({[We.Apps]:{}}),this.attributes[We.Cursors]||this.safeSetAttributes({[We.Cursors]:{}}),this.attributes._mainScenePath||this.safeSetAttributes({_mainScenePath:"/init"}),this.attributes._mainSceneIndex||this.safeSetAttributes({_mainSceneIndex:0}),this.attributes[We.Registered]||this.safeSetAttributes({[We.Registered]:{}}))}};let Pb=Nb;var zb;Pb.kind="WindowManager",Pb.debug=!1,Pb.containerSizeRatio=9/16,Pb.isCreated=!1,Pb.debug&&(zb={verbose:!0},Gv=Fv(Fv({},Yv),zb)),Pb.register({kind:Uo.kind,src:Uo}),Pb.register({kind:Ab.kind,src:Ab});export{Tb as BuiltinApps,Pb as WindowManager,kb as reconnectRefresher};
|
42
42
|
//# sourceMappingURL=index.es.js.map
|