@netless/window-manager 1.0.0-canary.30 → 1.0.0-canary.33

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/dist/index.cjs.js CHANGED
@@ -1,5 +1,5 @@
1
- "use strict";var qf=Object.defineProperty,eg=Object.defineProperties;var tg=Object.getOwnPropertyDescriptors;var nu=Object.getOwnPropertySymbols;var ig=Object.prototype.hasOwnProperty,ng=Object.prototype.propertyIsEnumerable;var ru=(e,t,i)=>t in e?qf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,H=(e,t)=>{for(var i in t||(t={}))ig.call(t,i)&&ru(e,i,t[i]);if(nu)for(var i of nu(t))ng.call(t,i)&&ru(e,i,t[i]);return e},gt=(e,t)=>eg(e,tg(t));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var rg=require("p-retry"),sg=require("emittery"),A=require("lodash"),M=require("white-web-sdk"),og=require("uuid"),Oe=require("side-effect-manager"),b=require("value-enhancer"),od=require("@juggle/resize-observer"),ag=require("video.js");function Da(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var lg=Da(rg),Gt=Da(sg),su=Da(ag),Y=(e=>(e.AppMove="AppMove",e.AppFocus="AppFocus",e.AppResize="AppResize",e.AppBoxStateChange="AppBoxStateChange",e.GetAttributes="GetAttributes",e.UpdateWindowManagerWrapper="UpdateWindowManagerWrapper",e.WindowCreated="WindowCreated",e.SetMainViewScenePath="SetMainViewScenePath",e.SetMainViewSceneIndex="SetMainViewSceneIndex",e.SetAppFocusIndex="SetAppFocusIndex",e.SwitchViewsToFreedom="SwitchViewsToFreedom",e.CursorMove="CursorMove",e.RootDirRemoved="RootDirRemoved",e.Refresh="Refresh",e.InitMainViewCamera="InitMainViewCamera",e.InvokeAttributesUpdateCallback="InvokeAttributesUpdateCallback",e))(Y||{});const Ao="__WindowManger",Xs="__WindowMangerEnsureReconnected__";var Ge=(e=>(e.Size="size",e.Position="position",e.SceneIndex="SceneIndex",e.ZIndex="zIndex",e.Visible="visible",e.Ratio="ratio",e.StageRatio="stageRatio",e.Draggable="draggable",e.Resizable="resizable",e))(Ge||{}),ad=(e=>(e.setBoxSize="setBoxSize",e.setBoxMinSize="setBoxMinSize",e.destroy="destroy",e))(ad||{}),Eo=(e=>(e.StartCreate="StartCreate",e))(Eo||{}),ld=(e=>(e.Leave="leave",e.Normal="normal",e))(ld||{});const ou="2.16.1",ug=340/720,cg=340/720,dg=9/16,je="/",ud="/init",cd=50,au=500,ie=new Gt.default;class hg{constructor(){this.list=[],this.isEmit=!1,this.invoked=()=>{this.currentInvoker=void 0,this.list.length===0&&(this.clear(),this.emitReady())},this.clear=()=>{clearInterval(this.timer),this.timer=void 0}}initInterval(){return setInterval(()=>{this.invoke()},50)}push(t){this.list.push(t),this.invoke(),this.timer===void 0&&this.list.length>0&&(this.timer=this.initInterval())}invoke(){if(this.list.length===0||this.currentInvoker!==void 0)return;const t=this.list.shift();t&&(this.currentInvoker=t,t().then(()=>{this.invoked()}).catch(i=>{console.error(`[WindowManager]: create app error: ${i.message}`),this.invoked()}))}emitReady(){this.isEmit||setTimeout(()=>{ie.emit("ready")},cd),this.isEmit=!0}empty(){this.list=[],this.clear()}destroy(){this.timer&&this.clear()}}const j=new Gt.default,pg="__WindowManagerAppCache";let jn,lu;const fg=async()=>{jn=await vg()},gg=(e,t)=>{if(!!jn)return yg(jn,{kind:e,sourceCode:t})},mg=async e=>jn?await wg(jn,e):null;function vg(){return new Promise((e,t)=>{const i=indexedDB.open(pg,2);i.onerror=n=>{t(n)},i.onupgradeneeded=n=>{const r=n.target.result;r.objectStoreNames.contains("apps")||(lu=r.createObjectStore("apps",{keyPath:"kind"}),lu.createIndex("kind","kind",{unique:!0}))},i.onsuccess=()=>{const n=i.result;e(n)}})}function wg(e,t){return new Promise((i,n)=>{const s=e.transaction(["apps"]).objectStore("apps").index("kind").get(t);s.onerror=o=>n(o),s.onsuccess=()=>{s.result?i(s.result):i(null)}})}function yg(e,t){return new Promise((i,n)=>{const r=e.transaction(["apps"],"readwrite").objectStore("apps").add(t);r.onsuccess=()=>i(),r.onerror=()=>n()})}const xg="NetlessApp",Sg=1e4,Cg=async e=>{const t=await mg(e);if(t)return t.sourceCode;{const n=await(await Mg(e,{timeout:Sg})).text();return await gg(e,n),n}},uu=(e,t)=>{let i=Function(e+`
2
- ;return ${t}`)();return typeof i=="undefined"&&(i=window[t]),i},bg=async(e,t,i)=>{const n=i||xg+t;ie.emit("loadApp",{kind:t,status:"start"});try{const r=await Cg(e);if(!r||r.length===0){ie.emit("loadApp",{kind:t,status:"failed",reason:"script is empty."});return}try{const s=uu(r,n);return ie.emit("loadApp",{kind:t,status:"success"}),s}catch(s){if(s.message.includes("Can only have one anonymous define call per script file")){const o=window.define;typeof o=="function"&&o.amd&&delete o.amd;const a=uu(r,n);return ie.emit("loadApp",{kind:t,status:"success"}),a}ie.emit("loadApp",{kind:t,status:"failed",reason:s.message})}}catch(r){ie.emit("loadApp",{kind:t,status:"failed",reason:r.message})}};async function Mg(e,t){const{timeout:i=1e4}=t,n=new AbortController,r=setTimeout(()=>n.abort(),i),s=await fetch(e,gt(H({},t),{signal:n.signal,headers:{"content-type":"text/plain"}}));return clearTimeout(r),s}class Ig{constructor(){this.kindEmitters=new Map,this.registered=new Map,this.appClassesCache=new Map,this.appClasses=new Map,this.syncRegisterApp=null,this.onSyncRegisterAppChange=t=>{this.register({kind:t.kind,src:t.src})}}setSyncRegisterApp(t){this.syncRegisterApp=t}async register(t){this.appClassesCache.delete(t.kind),this.registered.set(t.kind,t);const i=t.src;let n;if(typeof i=="string"?(n=async()=>{let r=await bg(i,t.kind,t.name);if(r)return r.__esModule&&(r=r.default),r;throw new Error(`[WindowManager]: load remote script failed, ${i}`)},this.syncRegisterApp&&this.syncRegisterApp({kind:t.kind,src:i,name:t.name})):typeof i=="function"?n=i:n=async()=>i,this.appClasses.set(t.kind,async()=>{let r=this.appClassesCache.get(t.kind);return r||(r=n(),this.appClassesCache.set(t.kind,r)),r}),t.addHooks){const r=this.createKindEmitter(t.kind);r&&t.addHooks(r)}}unregister(t){this.appClasses.delete(t),this.appClassesCache.delete(t),this.registered.delete(t);const i=this.kindEmitters.get(t);i&&(i.clearListeners(),this.kindEmitters.delete(t))}async notifyApp(t,i,n){const r=this.kindEmitters.get(t);await(r==null?void 0:r.emit(i,n))}createKindEmitter(t){if(!this.kindEmitters.has(t)){const i=new Gt.default;this.kindEmitters.set(t,i)}return this.kindEmitters.get(t)}}const Ae=new Ig,Ag=async e=>{var i,n;const t=await((i=Ae.appClasses.get(e))==null?void 0:i());return t&&((n=t.config)==null?void 0:n.singleton)?e:`${e}-${og.v4().replace("-","").slice(0,8)}`},mi=(e,t)=>{if(!e.didRelease&&e.focusScenePath!==t)return e.focusScenePath=t,e},cu=e=>{e.didRelease||e.release()},Vn=(e,t)=>{if(e&&e.isWritable&&e.state.sceneState.scenePath!==t){const i=t==="/"?"":t;e.setScenePath(i)}},Eg=(e,t,i)=>{var n;if(e&&t){const s=(n=vi(e)[t])==null?void 0:n[i];if(s)return`${t}/${s.name}`}},To=(e,t,i)=>{e&&e.scenePathType(t)!==M.ScenePathType.None&&e.removeScenes(t,i)},Tg=(e,t)=>{j.once(e).then(t)};A.debounce((e,t)=>{e.emit("mainViewModeChange",t)},200);const kg=(e,t,i=0)=>{const n=vi(e)[t];if(!n)return;const r=n[i];if(!r)return;const s=r.name;return t===je?`/${s}`:`${t}/${s}`},vi=e=>e.entireScenes(),ji=(e,t,i,n)=>e==null?void 0:e.putScenes(t,i,n),Ng=e=>e.startsWith("/"),Js=e=>{const t=e.split("/");t.pop();let i=t.join("/");return i===""&&(i="/"),i},Pg=e=>e.endsWith("/")?e.slice(0,-1):e,du=e=>{const t=e.split(".").map(i=>i.padStart(2,"0")).join("");return parseInt(t)},Fr=e=>new Promise(t=>setTimeout(t,e)),zg=e=>e.split("").reduce((i,n)=>(n===je&&(i+=1),i),0)===1;class Dg{constructor(t){this.manager=t,this.displayer=this.manager.displayer,this.mainMagixEventListener=i=>{if(i.authorId!==this.displayer.observerId){const n=i.payload;switch(n.eventName){case Y.AppMove:{this.appMoveHandler(n.payload);break}case Y.AppResize:{this.appResizeHandler(n.payload);break}case Y.AppBoxStateChange:{this.boxStateChangeHandler(n.payload);break}case Y.SetMainViewScenePath:{this.setMainViewScenePathHandler(n.payload);break}case Y.CursorMove:{this.cursorMoveHandler(n.payload);break}case Y.RootDirRemoved:{this.rootDirRemovedHandler();break}case Y.Refresh:{this.refreshHandler();break}case Y.InitMainViewCamera:{this.initMainViewCameraHandler();break}case Y.SetAppFocusIndex:{this.setAppFocusViewIndexHandler(n.payload);break}case Y.InvokeAttributesUpdateCallback:{this.manager.attributesUpdateCallback(this.manager.attributes.apps);break}}}},this.appMoveHandler=i=>{var n;(n=this.boxManager)==null||n.moveBox(i)},this.appResizeHandler=i=>{var n,r;(n=this.boxManager)==null||n.resizeBox(Object.assign(i,{skipUpdate:!0})),(r=this.manager.room)==null||r.refreshViewSize()},this.boxStateChangeHandler=i=>{ie.emit("boxStateChange",i)},this.setMainViewScenePathHandler=({nextScenePath:i})=>{mi(this.manager.mainView,i),ie.emit("mainViewScenePathChange",i)},this.cursorMoveHandler=i=>{j.emit("cursorMove",i)},this.rootDirRemovedHandler=()=>{this.manager.createRootDirScenesCallback(),this.manager.mainViewProxy.rebind(),j.emit("rootDirRemoved")},this.refreshHandler=()=>{this.manager.windowManger._refresh()},this.initMainViewCameraHandler=()=>{this.manager.mainViewProxy.addCameraReaction()},this.setAppFocusViewIndexHandler=i=>{if(i.type==="main")this.manager.setSceneIndexWithoutSync(i.index);else if(i.type==="app"&&i.appID){const n=this.manager.appProxies.get(i.appID);n&&n.setSceneIndexWithoutSync(i.index)}}}get boxManager(){return this.manager.boxManager}addListeners(){this.displayer.addMagixEventListener(Ao,this.mainMagixEventListener)}removeListeners(){this.displayer.removeMagixEventListener(Ao,this.mainMagixEventListener)}}class dd extends Error{constructor(){super(...arguments);this.message="[WindowManager]: app duplicate exists and cannot be created again"}}class jg extends Error{constructor(t){super(`[WindowManager]: app ${t} need register or provide src`)}}class ze extends Error{constructor(){super(...arguments);this.message="[WindowManager]: AppManager must be initialized"}}class hd extends Error{constructor(t){super(`[WindowManager]: white-web-sdk version must large than ${t}`)}}class pd extends Error{constructor(){super(...arguments);this.message="[WindowManager]: kind must be a valid string"}}class fd extends Error{constructor(){super(...arguments);this.message="[WindowManager]: box need created"}}class gd extends Error{constructor(){super(...arguments);this.message='[WindowManager]: ScenePath should start with "/"'}}class md extends Error{constructor(){super(...arguments);this.message="[WindowManager]: boxManager not found"}}class vd extends Error{constructor(){super(...arguments);this.message="[WindowManager]: room phase only Connected can be bindContainer"}}const wd=e=>(t,i)=>{if(t!==void 0)if(M.listenUpdated){const n=r=>{r.map(o=>o.kind).includes(e)&&i()};return M.listenUpdated(t,n),i(),()=>M.unlistenUpdated(t,n)}else return M.reaction(()=>t,()=>{i()},{fireImmediately:!0})},yd=(e,t,i)=>{let n=null;const r=M.reaction(e,()=>{n&&(n(),n=null);const s=e();A.isObject(s)?(n=()=>M.unlistenUpdated(s,t),M.listenUpdated(s,t)):i==null||i(s)},{fireImmediately:!0});return()=>{n==null||n(),r()}},Vg=wd(M.UpdateEventKind.Removed);wd(M.UpdateEventKind.Inserted);const Ks=Object.keys;function hu(e){return Boolean(A.has(e,"__isRef"))}function Lg(e){return{k:Oe.genUID(),v:e,__isRef:!0}}class Rg{constructor(){this.listeners=new Set}get length(){return this.listeners.size}dispatch(t){this.listeners.forEach(i=>i(t))}addListener(t){this.listeners.add(t)}removeListener(t){this.listeners.delete(t)}}const Qe="_WM-STORAGE_";class pu{constructor(t,i,n){if(this._sideEffect=new Oe.SideEffectManager,this._destroyed=!1,this._refMap=new WeakMap,this._lastValue=new Map,this.onStateChanged=new Rg,n&&!A.isObject(n))throw new Error(`Default state for Storage ${i} is not an object.`);this._context=t,this.id=i||null,this._state={};const r=this._getRawState(this._state);this._context.isWritable&&(this.id===null?t.isAddApp&&n&&this.setState(n):(r===this._state||!A.isObject(r))&&(A.get(this._context.getAttributes(),[Qe])||this._context.updateAttributes([Qe],{}),this._context.updateAttributes([Qe,this.id],this._state),n&&this.setState(n))),Ks(r).forEach(s=>{if(!(this.id===null&&s===Qe))try{const o=A.isObject(r[s])?JSON.parse(JSON.stringify(r[s])):r[s];hu(o)?(this._state[s]=o.v,A.isObject(o.v)&&this._refMap.set(o.v,o)):this._state[s]=o}catch(o){console.error(o)}}),this._sideEffect.addDisposer(yd(()=>this.id===null?t.getAttributes():A.get(t.getAttributes(),[Qe,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(t){return this.onStateChanged.addListener(t),()=>this.onStateChanged.removeListener(t)}ensureState(t){return this.setState(Ks(t).reduce((i,n)=>(A.has(this._state,n)||(i[n]=t[n]),i),{}))}setState(t){if(this._destroyed){console.error(new Error(`Cannot call setState on destroyed Storage "${this.id}".`));return}if(!this._context.isWritable){console.error(new Error(`Cannot setState on Storage "${this.id}" without writable access`),t);return}const i=Ks(t);i.length>0&&i.forEach(n=>{const r=t[n];if(r!==this._state[n])if(r===void 0)this._lastValue.set(n,this._state[n]),delete this._state[n],this._setRawState(n,r);else{this._lastValue.set(n,this._state[n]),this._state[n]=r;let s=r;if(A.isObject(r)){let o=this._refMap.get(r);o||(o=Lg(r),this._refMap.set(r,o)),s=o}this._setRawState(n,s)}})}emptyStorage(){if(!(A.size(this._state)<=0)){if(this._destroyed){console.error(new Error(`Cannot empty destroyed Storage "${this.id}".`));return}if(!this._context.isWritable){console.error(new Error(`Cannot empty Storage "${this.id}" without writable access.`));return}this.setState(A.mapValues(this._state,A.noop))}}deleteStorage(){if(this.id===null)throw new Error("Cannot delete main Storage");if(!this._context.isWritable){console.error(new Error(`Cannot delete Storage "${this.id}" without writable access.`));return}this.destroy(),this._context.updateAttributes([Qe,this.id],void 0)}get destroyed(){return this._destroyed}destroy(){this._destroyed=!0,this._sideEffect.flushAll()}_getRawState(t){var i;return this.id===null?(i=this._context.getAttributes())!=null?i:t:A.get(this._context.getAttributes(),[Qe,this.id],t)}_setRawState(t,i){if(this.id===null){if(t===Qe)throw new Error(`Cannot set attribute internal filed "${Qe}"`);return this._context.updateAttributes([t],i)}else return this._context.updateAttributes([Qe,this.id,t],i)}_updateProperties(t){var i;if(this._destroyed){console.error(new Error(`Cannot call _updateProperties on destroyed Storage "${this.id}".`));return}if(t.length>0){const n={};for(let r=0;r<t.length;r++)try{const s=t[r],o=s.key;if(this.id===null&&o===Qe)continue;const a=A.isObject(s.value)?JSON.parse(JSON.stringify(s.value)):s.value;let l;switch(this._lastValue.has(o)&&(l=this._lastValue.get(o),this._lastValue.delete(o)),s.kind){case 2:{A.has(this._state,o)&&(l=this._state[o],delete this._state[o]),n[o]={oldValue:l};break}default:{let u=a;if(hu(a)){const{k:h,v:p}=a,w=this._state[o];A.isObject(w)&&((i=this._refMap.get(w))==null?void 0:i.k)===h?u=w:(u=p,A.isObject(p)&&this._refMap.set(p,a))}u!==this._state[o]&&(l=this._state[o],this._state[o]=u),n[o]={newValue:u,oldValue:l};break}}}catch(s){console.error(s)}this.onStateChanged.dispatch(n)}}}class Bg{constructor(t,i,n,r){this.view=t,this.appContext=i,this.appProxy=n,this.ensureSize=r,this.nextPage=async()=>{const u=this.pageState.index+1;return this.jumpPage(u)},this.prevPage=async()=>{const u=this.pageState.index-1;return this.jumpPage(u)},this.jumpPage=async u=>u<0||u>=this.pageState.length?(console.warn(`[WindowManager]: index ${u} out of range`),!1):(this.appProxy.setSceneIndex(u),!0),this.addPage=async u=>{const h=u==null?void 0:u.after,p=u==null?void 0:u.scene,w=this.appProxy.scenePath;if(!!w)if(h){const S=this.pageState.index+1;ji(this.appContext.room,w,[p||{}],S)}else ji(this.appContext.room,w,[p||{}])},this.removePage=async u=>{const h=u===void 0?this.pageState.index:u;return this.pageState.length===1?(console.warn("[WindowManager]: can not remove the last page"),!1):h<0||h>=this.pageState.length?(console.warn(`[WindowManager]: page index ${u} out of range`),!1):this.appProxy.removeSceneByIndex(h)};const s=new b.Val(n.pageState),o=new b.Val(n.size$.value),a=u=>A.pick(u,["centerX","centerY","scale"]),l=new b.Val(a(this.view.camera));this.baseRect$=o,this.pageState$=s,this.baseCamera$=l,this.appProxy.sideEffectManager.add(()=>[n.appEmitter.on("pageStateChange",u=>s.setValue(u)),n.camera$.subscribe(u=>{u&&l.setValue(a(u))}),n.size$.subscribe(u=>{u&&o.setValue(A.pick(u,["width","height"]))})]),t.disableCameraTransform=!0}get pageState(){return this.pageState$.value}moveCamera(t){this.appProxy.moveCamera(t)}setBaseRect(t){this.appProxy.updateSize(t.width,t.height)}}const jt=(...e)=>{me.debug&&console.log("[WindowManager]:",...e)},Og=(e,t)=>{const i=document.createElement("div");i.className="netless-window-manager-playground";const n=document.createElement("div");return n.className="netless-window-manager-main-view",t.appendChild(n),e.appendChild(i),{playground:i,mainViewElement:n}},_g=()=>{if(du(M.WhiteVersion)<du(ou))throw new hd(ou)},xd=(e,t)=>{const i=e==null?void 0:e.state.roomMembers;return i==null?void 0:i.find(n=>{var r;return((r=n.payload)==null?void 0:r.uid)===t})},fu=e=>e.map(t=>{var i;return H({uid:((i=t.payload)==null?void 0:i.uid)||""},M.toJS(t))}),gu=async e=>{try{return await e.createInvisiblePlugin(me,{})}catch(t){if(t.message==='invisible plugin "WindowManager" exits')return await Fr(200),e.getInvisiblePlugin(me.kind);jt("createInvisiblePlugin failed",t)}};class $g{constructor(t,i,n,r){this.manager=t,this.appId=i,this.appProxy=n,this.appOptions=r,this.mobxUtils={autorun:M.autorun,reaction:M.reaction,toJS:M.toJS},this.objectUtils={listenUpdated:M.listenUpdated,unlistenUpdated:M.unlistenUpdated,listenDisposed:M.listenDisposed,unlistenDisposed:M.unlistenDisposed},this.store=this.manager.store,this.isReplay=this.manager.isReplay,this.getAttributes=()=>this.appProxy.attributes,this.getScenes=()=>{const s=this.store.getAppAttributes(this.appId);return s!=null&&s.isDynamicPPT?this.appProxy.scenes:s==null?void 0:s.options.scenes},this.createWhiteBoardView=s=>{if(this.whiteBoardView)return this.whiteBoardView;let o=this.view;o||(o=this.appProxy.createAppDir()),s&&A.isBoolean(s.syncCamera)&&this.appProxy.syncCamera$.setValue(s.syncCamera);const a=document.createElement("div");return this._viewWrapper=a,a.className="window-manager-view-wrapper",this.box.$main.appendChild(a),o.divElement=a,this.appProxy.fireMemberStateChange(),this.isAddApp&&this.ensurePageSize(s==null?void 0:s.size),this.whiteBoardView=new Bg(o,this,this.appProxy,this.ensurePageSize),this.appProxy.sideEffectManager.add(()=>[this.box._stageRect$.subscribe(l=>{a.style.left=`${l.x}px`,a.style.top=`${l.y}px`,a.style.width=`${l.width}px`,a.style.height=`${l.height}px`}),()=>()=>{this.whiteBoardView=void 0}]),this.appProxy.whiteBoardViewCreated$.setValue(!0),this.whiteBoardView},this.ensurePageSize=s=>{var l;if(!A.isNumber(s)||!this.appProxy.scenePath||this.appProxy.pageState.length>=s)return;if(s<=0||s>=au)throw Error(`[WindowManager]: size ${s} muse be in range [1, ${au}]`);const o=s-this.appProxy.pageState.length,a=new Array(o).fill({});(l=this.room)==null||l.putScenes(this.appProxy.scenePath,a)},this.getInitScenePath=()=>this.appProxy.scenePath,this.setAttributes=s=>{this.manager.safeSetAttributes({[this.appId]:s})},this.updateAttributes=(s,o)=>{this.manager.attributes[this.appId]&&this.manager.safeUpdateAttributes([this.appId,...s],o)},this.setScenePath=async s=>{var o;!this.appProxy.box||(this.appProxy.setFullPath(s),(o=this.room)==null||o.setScenePath(s))},this.getAppOptions=()=>typeof this.appOptions=="function"?this.appOptions():this.appOptions,this.createStorage=(s,o)=>{const a=new pu(this,s,o);return this.emitter.on("destroy",()=>{a.destroy()}),a},this.dispatchMagixEvent=(...s)=>{var a;const o=`${this.appId}:${s[0]}`;return(a=this.manager.room)==null?void 0:a.dispatchMagixEvent(o,s[1])},this.addMagixEventListener=(s,o,a)=>{const l=`${this.appId}:${s}`;return this.manager.displayer.addMagixEventListener(l,o,a),()=>this.manager.displayer.removeMagixEventListener(l,o)},this.removeMagixEventListener=this.manager.displayer.removeMagixEventListener.bind(this.manager.displayer),this.emitter=n.appEmitter,this.isAddApp=n.isAddApp}get displayer(){return this.manager.displayer}get destroyed(){return this.appProxy.status==="destroyed"}get view(){return this.appProxy.view}get isWritable(){return this.manager.canOperate&&!this.destroyed}get box(){const t=this.appProxy.box$.value;if(t)return t;throw new fd}get room(){return this.manager.room}get members(){return this.manager.members$.value}get currentMember(){const t=xd(this.room,this.manager.uid);if(!t)throw new Error(`Member ${this.manager.uid} not found.`);return H({uid:this.manager.uid},t)}get storage(){return this._storage||(this._storage=new pu(this)),this._storage}}class Ug{constructor(t){this.params=t,this.sceneNode=null,this.createSceneNode=r=>(this.scenePath=r,this.sceneNode&&this.sceneNode.dispose(),this.sceneNode=this.params.displayer.createScenesCallback(r,{onAddScene:this.onSceneChange,onRemoveScene:this.onSceneChange}),this.sceneNode),this.onSceneChange=()=>{this.params.notifyPageStateChange()};const{displayer:i,scenePath:n}=this.params;this.view=this.params.view,n&&(this.scenePath=n,this.sceneNode=i.createScenesCallback(n,{onAddScene:this.onSceneChange,onRemoveScene:this.onSceneChange}))}setView(t){this.view=t}getFullPath(t){var n;const i=(n=this.sceneNode)==null?void 0:n.scenes;if(this.scenePath&&i){const r=i[t];if(r)return`${this.scenePath}/${r}`}}toObject(){var t,i;return{index:((t=this.view)==null?void 0:t.focusSceneIndex)||0,length:((i=this.sceneNode)==null?void 0:i.scenes.length)||0}}destroy(){var t;(t=this.sceneNode)==null||t.dispose()}}class Wg{constructor(t){this.saveCamera=t,this.setRect=i=>{this.rect=i,this.remoteCamera&&this.remoteSize&&this.onRemoteUpdate(this.remoteCamera,this.remoteSize)},this.onRemoteUpdate=A.throttle((i,n)=>{if(this.remoteCamera=i,this.remoteSize=n,this.remoteSize&&this.rect){const r=this.rect.width/n.width,s=this.rect.height/n.height,a={scale:i.scale*Math.min(r,s),animationMode:M.AnimationMode.Continuous};i.centerX!==null&&(a.centerX=i.centerX),i.centerY!==null&&(a.centerY=i.centerY),this.moveCamera(a)}},10)}setView(t){this.view=t}onRemoteSizeUpdate(t){this.remoteSize=t;const i=!A.isEqual(A.pick(this.rect,["width","height"]),A.pick(t,["width","height"]));if(this.rect&&this.remoteCamera&&i){const n=this.rect.width/t.width,r=this.remoteCamera.scale*n;this.moveCamera({scale:r})}}onLocalCameraUpdate(t){this.saveCamera(t),this.remoteCamera=t}moveCamera(t){var i;(i=this.view)==null||i.moveCamera(gt(H({},t),{animationMode:M.AnimationMode.Continuous}))}}class Sd{constructor(t){this.context=t,this.sem=new Oe.SideEffectManager,this.bindView=n=>{!n||(this.synchronizer.setView(n),this.sem.flush("view"),this.sem.add(()=>(n.callbacks.on("onCameraUpdatedByDevice",this.onCameraUpdatedByDevice),()=>n.callbacks.off("onCameraUpdatedByDevice",this.onCameraUpdatedByDevice)),"view"))},this.onCameraUpdatedByDevice=n=>{if(!n)return;this.synchronizer.onLocalCameraUpdate(gt(H({},n),{id:this.context.uid}));const r=this.context.stageRect$.value;if(r){const s={width:r.width,height:r.height,id:this.context.uid};A.isEqual(s,this.context.size$.value)||this.context.storeSize(s)}},this.synchronizer=new Wg(n=>{this.context.camera$.setValue(n,!0),!(this.context.viewMode$&&this.context.viewMode$.value===M.ViewMode.Freedom)&&this.context.storeCamera(n)}),this.bindView(this.context.view$.value),this.sem.add(()=>[this.context.view$.subscribe(n=>{const r=this.context.camera$.value;r&&this.context.size$.value&&(n==null||n.moveCamera({scale:1,animationMode:M.AnimationMode.Immediately}),this.synchronizer.onRemoteUpdate(r,this.context.size$.value)),this.bindView(n)}),this.context.camera$.subscribe((n,r)=>{const s=this.context.size$.value;n&&s&&!r&&this.synchronizer.onRemoteUpdate(n,s)}),this.context.size$.subscribe(n=>{n&&this.synchronizer.onRemoteSizeUpdate(n)}),this.context.stageRect$.reaction(n=>{n&&this.synchronizer.setRect(n)})]);const i=b.combine([this.context.camera$,this.context.size$]);i.reaction(([n,r])=>{n&&r&&(this.synchronizer.onRemoteUpdate(n,r),i.destroy())})}destroy(){this.sem.flushAll()}}const yt=new Gt.default,ja=(e,t)=>{let i=0;const n=t.length-1;return e===t.index?e===n?i=e-1:i=t.index+1:i=t.index,i};var oe=(e=>(e.Apps="apps",e.Focus="focus",e.State="state",e.BoxState="boxState",e.MainViewCamera="mainViewCamera",e.MainViewSize="mainViewSize",e.Broadcaster="broadcaster",e.Cursors="cursors",e.Position="position",e.CursorState="cursorState",e.FullPath="fullPath",e.Registered="registered",e.Camera="camera",e.Size="size",e))(oe||{});class Hg{constructor(t){this.context=t,this.setAppFocus=(i,n)=>{n?this.context.safeSetAttributes({focus:i}):this.context.safeSetAttributes({focus:void 0})}}setContext(t){this.context=t}get attributes(){return this.context.getAttributes()}apps(){return A.get(this.attributes,["apps"])}get focus(){return A.get(this.attributes,["focus"])}getAppAttributes(t){return A.get(this.apps(),[t])}getAppState(t){return A.get(this.apps(),[t,"state"])}getMaximized(){return A.get(this.attributes,["maximized"])}getMinimized(){return A.get(this.attributes,["minimized"])}setupAppAttributes(t,i,n){this.attributes.apps||this.context.safeSetAttributes({apps:{}});const s=["scenePath","title"];n||s.push("scenes");const o=A.pick(t.options,s),a={kind:t.kind,options:o,isDynamicPPT:n,setup:!1};typeof t.src=="string"&&(a.src=t.src),a.createdAt=Date.now(),this.context.safeUpdateAttributes(["apps",i],a),this.context.safeUpdateAttributes(["apps",i,"state"],{[Ge.Size]:{},[Ge.Position]:{},[Ge.SceneIndex]:0})}updateAppState(t,i,n){A.get(this.attributes,["apps",t,"state"])&&this.context.safeUpdateAttributes(["apps",t,"state",i],n)}updateAppAttributes(t,i,n){this.context.safeUpdateAttributes(["apps",t,i],n)}cleanAppAttributes(t){this.context.safeUpdateAttributes(["apps",t],void 0),this.context.safeSetAttributes({[t]:void 0}),this.attributes.focus===t&&this.cleanFocus()}cleanFocus(){this.context.safeSetAttributes({focus:void 0})}getAppSceneIndex(t){var i;return(i=this.getAppState(t))==null?void 0:i[Ge.SceneIndex]}getAppScenePath(t){var i,n;return(n=(i=this.getAppAttributes(t))==null?void 0:i.options)==null?void 0:n.scenePath}getMainViewScenePath(){return this.attributes._mainScenePath}getMainViewSceneIndex(){return this.attributes._mainSceneIndex}getBoxState(){return this.attributes.boxState}setMainViewScenePath(t){this.context.safeSetAttributes({_mainScenePath:t})}setMainViewSceneIndex(t){this.context.safeSetAttributes({_mainSceneIndex:t})}getMainViewCamera(){return A.get(this.attributes,["mainViewCamera"])}getMainViewSize(){return A.get(this.attributes,["mainViewSize"])}setMainViewCamera(t){this.context.safeSetAttributes({mainViewCamera:H({},t)})}setMainViewSize(t){this.context.safeSetAttributes({mainViewSize:H({},t)})}setMainViewCameraAndSize(t,i){this.context.safeSetAttributes({mainViewCamera:H({},t),mainViewSize:H({},i)})}updateCursor(t,i){A.get(this.attributes,["cursors"])||this.context.safeUpdateAttributes(["cursors"],{}),A.get(this.attributes,["cursors",t])||this.context.safeUpdateAttributes(["cursors",t],{}),this.context.safeUpdateAttributes(["cursors",t,"position"],i)}updateCursorState(t,i){A.get(this.attributes,["cursors",t])||this.context.safeUpdateAttributes(["cursors",t],{}),this.context.safeUpdateAttributes(["cursors",t,"cursorState"],i)}getCursorState(t){return A.get(this.attributes,["cursors",t,"cursorState"])}cleanCursor(t){this.context.safeUpdateAttributes(["cursors",t],void 0)}setMainViewFocusPath(t){const i=this.getMainViewScenePath();i&&mi(t,i)}}const Fg=new Hg({getAttributes:()=>{throw new Error("getAttributes not implemented")},safeSetAttributes:()=>{throw new Error("safeSetAttributes not implemented")},safeUpdateAttributes:()=>{throw new Error("safeUpdateAttributes not implemented")}});class Va{constructor(t,i,n,r){var s;this.params=t,this.manager=i,this.boxManager=this.manager.boxManager,this.appProxies=this.manager.appProxies,this.viewManager=this.manager.viewManager,this.store=this.manager.store,this.uid=this.manager.uid,this.status="normal",this.sideEffectManager=new Oe.SideEffectManager,this.valManager=new b.ValManager,this.fullPath$=this.valManager.attach(new b.Val(void 0)),this.camera$=this.valManager.attach(new b.Val(void 0)),this.size$=this.valManager.attach(new b.Val(void 0)),this.box$=this.valManager.attach(new b.Val(void 0)),this.view$=this.valManager.attach(new b.Val(void 0)),this.syncCamera$=this.valManager.attach(new b.Val(!0)),this.whiteBoardViewCreated$=this.valManager.attach(new b.Val(!1)),this.fireMemberStateChange=()=>{this.manager.room&&this.onMemberStateChange(this.manager.room.state.memberState)},this.onMemberStateChange=o=>{var l,u;o.currentApplianceName==="clicker"?(l=this.appContext)!=null&&l._viewWrapper&&(this.appContext._viewWrapper.style.pointerEvents="none"):(u=this.appContext)!=null&&u._viewWrapper&&(this.appContext._viewWrapper.style.pointerEvents="auto")},this.computedInitialRect=o=>{var l;const a=(l=this.manager.boxManager)==null?void 0:l.stageRect;if(a){const{width:u,height:h}=a,p=o.height/o.width;return h<480?{width:480/p,height:480}:{width:u*.65,height:h*.65}}},this.getAppInitState=o=>{var S,I;const a=this.store.getAppState(o);if(!a)return;const l=this.store.focus,u=(S=this.attributes)==null?void 0:S.maximized,h=(I=this.attributes)==null?void 0:I.minimized;let p={maximized:u,minimized:h,id:o};const w=A.omitBy(a,A.isUndefined);return l===o&&(p=gt(H({},p),{focus:!0})),Object.assign(p,w)},this.appAttributesUpdateListener=o=>{this.sideEffectManager.add(()=>[this.manager.refresher.add(o,()=>M.autorun(()=>{const a=this.manager.attributes[o];a&&this.appEmitter.emit("attributesUpdate",a)})),this.manager.refresher.add(this.stateKey,()=>M.autorun(()=>{var l,u,h;const a=(l=this.appAttributes)==null?void 0:l.state;(a==null?void 0:a.zIndex)>0&&a.zIndex!==((u=this.box)==null?void 0:u.zIndex)&&((h=this.boxManager)==null||h.setZIndex(o,a.zIndex))})),this.manager.refresher.add(`${o}-fullPath`,()=>M.autorun(()=>{var l;const a=(l=this.appAttributes)==null?void 0:l.fullPath;this.setFocusScenePathHandler(a),this.fullPath$.value!==a&&(this.notifyPageStateChange(),this.fullPath$.setValue(a))}))])},this.setFocusScenePathHandler=A.debounce(o=>{var a;this.view&&o&&o!==((a=this.view)==null?void 0:a.focusScenePath)&&mi(this.view,o)},50),this.notifyPageStateChange=A.debounce(()=>{this.pageState&&this.appEmitter.emit("pageStateChange",this.pageState)},50),this.storeCamera=o=>{this.store.updateAppAttributes(this.id,oe.Camera,o)},this.storeSize=o=>{this.store.updateAppAttributes(this.id,oe.Size,o)},this.updateSize=(o,a)=>{const l={id:this.manager.uid,width:o,height:a};this.store.updateAppAttributes(this.id,oe.Size,l),this.size$.setValue(l)},this.moveCamera=o=>{if(!this.camera$.value)return;const a=gt(H(H({},this.camera$.value),o),{id:this.uid});this.storeCamera(a),this.camera$.setValue(a)},this.addCameraReaction=()=>{this.sideEffectManager.add(()=>this.manager.refresher.add(`${this.id}-camera`,()=>M.reaction(()=>{var o;return(o=this.appAttributes)==null?void 0:o.camera},o=>{if(o){const a=M.toJS(o);A.isEqual(a,this.camera$.value)||this.camera$.setValue(a)}})),"camera")},this.addSizeReaction=()=>{this.sideEffectManager.add(()=>this.manager.refresher.add(`${this.id}-size`,()=>M.reaction(()=>{var o;return(o=this.appAttributes)==null?void 0:o.size},o=>{if(o){const a=M.toJS(o);A.isEqual(a,this.size$.value)||this.size$.setValue(a)}})),"size")},this.onFocus=()=>{this.setScenePath()},this.setupDone=()=>{this.store.updateAppAttributes(this.id,"setup",!0),this.manager.dispatchInternalEvent(Y.InvokeAttributesUpdateCallback)},this.kind=t.kind,this.id=n,this.appScenePath=`/${this.id}-app-dir`,this.stateKey=`${this.id}_state`,this.appProxies.set(this.id,this),this.appEmitter=new Gt.default,this.appListener=this.makeAppEventListener(this.id),this.isAddApp=r,this.initScenes(),(s=this.params.options)!=null&&s.scenePath&&this.createView(),this.scenePath||(this.scenePath=this.appScenePath),this._pageState=new Ug({displayer:this.manager.displayer,scenePath:this.scenePath,view:this.view,notifyPageStateChange:this.notifyPageStateChange}),this.sideEffectManager.add(()=>()=>this._pageState.destroy()),this.camera$.setValue(M.toJS(this.appAttributes.camera)),this.size$.setValue(M.toJS(this.appAttributes.size)),this.addCameraReaction(),this.addSizeReaction(),this.sideEffectManager.add(()=>j.on("memberStateChange",this.onMemberStateChange)),this.sideEffectManager.add(()=>[this.syncCamera$.reaction(o=>{o||this.viewSync&&(this.viewSync.destroy(),this.viewSync=void 0,this.sideEffectManager.flush("camera"),this.sideEffectManager.flush("size"))}),this.whiteBoardViewCreated$.reaction(o=>{if(o&&this.box){if(!this.syncCamera$.value)return;b.combine([this.box$,this.view$]).subscribe(([a,l])=>{if(a&&l){if(this.camera$.value||(this.storeCamera({centerX:null,centerY:null,scale:1,id:this.uid}),this.camera$.setValue(M.toJS(this.appAttributes.camera))),!this.size$.value&&a.stageRect){const u=this.computedInitialRect(a.stageRect),h=(u==null?void 0:u.width)||a.stageRect.width,p=(u==null?void 0:u.height)||a.stageRect.height;this.storeSize({id:this.uid,width:h,height:p}),this.size$.setValue(M.toJS(this.appAttributes.size))}this.viewSync=new Sd({uid:this.uid,view$:this.view$,camera$:this.camera$,size$:this.size$,stageRect$:a._stageRect$,storeCamera:this.storeCamera,storeSize:this.storeSize}),this.sideEffectManager.add(()=>()=>{var u;return(u=this.viewSync)==null?void 0:u.destroy()}),this.whiteBoardViewCreated$.destroy()}})}}),this.manager.members$.reaction(o=>{this.appEmitter.emit("roomMembersChange",o)})])}createAppDir(){const t=this.scenePath||this.appScenePath;this._pageState.createSceneNode(t)||(ji(this.manager.room,t,[{name:"1"}]),this._pageState.createSceneNode(t),this.setSceneIndex(0)),this.scenes=vi(this.manager.displayer)[t];const n=this.createView();return this._pageState.setView(n),n}initScenes(){var i;const t=this.params.options;t&&(this.scenePath=t.scenePath,((i=this.appAttributes)==null?void 0:i.isDynamicPPT)&&this.scenePath?this.scenes=vi(this.manager.displayer)[this.scenePath]:this.scenes=t.scenes)}get view(){return this.view$.value}get viewIndex(){var t;return(t=this.view)==null?void 0:t.focusSceneIndex}get isWritable(){var t;return this.manager.canOperate&&!((t=this.box)!=null&&t.readonly)}get attributes(){return this.manager.attributes[this.id]}get appAttributes(){return this.store.getAppAttributes(this.id)}getFullScenePath(){if(this.scenePath)return A.get(this.appAttributes,[oe.FullPath])||this.getFullScenePathFromScenes()}getFullScenePathFromScenes(){const t=A.get(this.appAttributes,["state","SceneIndex"],0),i=Eg(this.manager.room,this.scenePath,t);return i&&this.setFullPath(i),i}setFullPath(t){this.store.updateAppAttributes(this.id,oe.FullPath,t)}async baseInsertApp(t=!1){var s;const i=this.params;if(!i.kind)throw new Error("[WindowManager]: kind require");const n=await((s=Ae.appClasses.get(i.kind))==null?void 0:s()),r=Ae.registered.get(i.kind);if(n)await this.setupApp(this.id,t,n,i.options,r==null?void 0:r.appOptions);else throw new Error(`[WindowManager]: app load failed ${i.kind} ${i.src}`);return j.emit("updateManagerRect"),{appId:this.id,app:n}}get box(){return this.box$.value}async setupApp(t,i,n,r,s){var a;if(jt("setupApp",t,n,r),!this.boxManager)throw new md;const o=new $g(this.manager,t,this,s);this.appContext=o;try{j.once(`${t}${Y.WindowCreated}`).then(async()=>{var p;let h;i||(h=this.getAppInitState(t),(p=this.boxManager)==null||p.updateBoxState(h)),this.appEmitter.onAny(this.appListener),this.appAttributesUpdateListener(t),this.setViewFocusScenePath(),setTimeout(async()=>{const w=await n.setup(o);this.appResult=w,Ae.notifyApp(this.kind,"created",{appId:t,result:w}),this.fixMobileSize(),this.setupDone()},cd)});const l=(a=this.boxManager)==null?void 0:a.createBox({appId:t,app:n,options:r,canOperate:this.manager.canOperate,smartPosition:this.isAddApp}),u=Ae.registered.get(this.kind);u!=null&&u.contentStyles&&(l==null||l.mountUserStyles(u.contentStyles)),this.box$.setValue(l),this.isAddApp&&this.box&&(this.store.updateAppState(t,Ge.ZIndex,this.box.zIndex),this.store.updateAppState(t,Ge.Size,{width:this.box.intrinsicWidth,height:this.box.intrinsicHeight}),this.boxManager.focusBox({appId:t},!1))}catch(l){throw console.error(l),new Error(`[WindowManager]: app setup error: ${l.message}`)}}fixMobileSize(){var i,n;const t=(i=this.boxManager)==null?void 0:i.getBox(this.id);t&&(t.minimized||(n=this.boxManager)==null||n.resizeBox({appId:this.id,width:t.intrinsicWidth+.001,height:t.intrinsicHeight+.001,skipUpdate:!0}))}async onSeek(t){var n;this.appEmitter.emit("seek",t).catch(r=>{console.log(`[WindowManager]: emit seek error: ${r.message}`)});const i=this.getAppInitState(this.id);(n=this.boxManager)==null||n.updateBoxState(i)}async onReconnected(){var s;if(!Boolean(this.manager.attributes.apps[this.id])){await this.destroy(!0,!1,!0);return}this.appEmitter.emit("reconnected",void 0);const i=this.getAppInitState(this.id);await this.destroy(!0,!1,!0);const n=this.params;await new Va(n,this.manager,this.id,this.isAddApp).baseInsertApp(!0),(s=this.boxManager)==null||s.updateBoxState(i)}async onRemoveScene(t){if(this.scenePath&&t.startsWith(this.scenePath+"/")){let i=this.pageState.index,n=this._pageState.getFullPath(i);n||(i=0,n=this._pageState.getFullPath(i)),n&&this.setFullPath(n),this.setViewFocusScenePath(),this.view&&(this.view.focusSceneIndex=i)}}emitAppSceneStateChange(t){this.appEmitter.emit("sceneStateChange",t)}emitAppIsWritableChange(){this.appEmitter.emit("writableChange",this.isWritable)}makeAppEventListener(t){return(i,n)=>{var r,s,o,a;if(!!this.manager.canOperate)switch(i){case"setBoxSize":{(r=this.boxManager)==null||r.resizeBox({appId:t,width:n.width,height:n.height,skipUpdate:!1});break}case"setBoxMinSize":{(s=this.boxManager)==null||s.setBoxMinSize({appId:t,minWidth:n.minwidth,minHeight:n.minheight});break}case"setBoxTitle":{(o=this.boxManager)==null||o.setBoxTitle({appId:t,title:n.title});break}case ad.destroy:{if(this.status==="destroyed")return;this.destroy(!0,!1,!0,n==null?void 0:n.error),n!=null&&n.error&&console.error(n==null?void 0:n.error);break}case"focus":{(a=this.boxManager)==null||a.focusBox({appId:this.id}),yt.emit("focus",{appId:this.id});break}}}}setScenePath(){if(!this.manager.canOperate)return;const t=this.getFullScenePath();this.manager.room&&t&&this.view&&Vn(this.manager.room,t)}setViewFocusScenePath(){if(this.status==="destroyed")return;const t=this.getFullScenePath();return t&&this.view&&mi(this.view,t),t}createView(){const t=this.viewManager.createView(this.id);return this.view$.setValue(t),this.setViewFocusScenePath(),t}get pageState(){return this._pageState.toObject()}async removeSceneByIndex(t){const i=this._pageState.getFullPath(t);if(i&&this.pageState){const n=ja(t,this.pageState);return this.setSceneIndexWithoutSync(n),this.manager.dispatchInternalEvent(Y.SetAppFocusIndex,{type:"app",appID:this.id,index:n}),setTimeout(()=>{To(this.manager.room,i,t)},100),!0}else return!1}setSceneIndexWithoutSync(t){this.view&&(this.view.focusSceneIndex=t)}setSceneIndex(t){if(this.view){this.view.focusSceneIndex=t;const i=this._pageState.getFullPath(t);i&&(this.setFullPath(i),Vn(this.manager.room,i))}}async destroy(t,i,n,r){var s;if(this.status!=="destroyed"){this.status="destroyed";try{await Ae.notifyApp(this.kind,"destroy",{appId:this.id}),ie.emit("appClose",{appId:this.id,kind:this.kind,error:r}),await this.appEmitter.emit("destroy",{error:r})}catch(o){console.error("[WindowManager]: notifyApp error",o.message,o.stack)}this.appEmitter.clearListeners(),this.sideEffectManager.flushAll(),j.emit(`destroy-${this.id}`,{error:r}),t&&((s=this.boxManager)==null||s.closeBox(this.id,n)),i&&(this.store.cleanAppAttributes(this.id),this.scenePath&&To(this.manager.room,this.scenePath)),this.appProxies.delete(this.id),this.viewManager.destroyView(this.id),this.manager.appStatus.delete(this.id),this.valManager.destroy()}}close(){return this.destroy(!0,!0,!1)}}class Qg{constructor(t){this.displayer=t,this.views=new Map}createView(t){const i=Cd(this.displayer);return this.views.set(t,i),i}getView(t){return this.views.get(t)}destroyView(t){const i=this.views.get(t);if(i){try{i.release()}catch{}this.views.delete(t)}}setViewScenePath(t,i){const n=this.views.get(t);n&&(n.focusScenePath=i)}destroy(){this.views.forEach(t=>{try{t.release()}catch{}}),this.views.clear()}}const Cd=e=>{const t=e.views.createView();return Zg(t),t},Zg=e=>{e.setCameraBound({maxContentMode:()=>10,minContentMode:()=>.1})};class Yg{constructor(t){this.manager=t,this.started=!1,this.mainViewIsAddListener=!1,this.store=this.manager.store,this.sideEffectManager=new Oe.SideEffectManager,this.camera$=new b.Val(void 0),this.size$=new b.Val(void 0),this.view$=new b.Val(void 0),this.createViewSync=()=>{var i;this.manager.boxManager&&!this.viewSync&&(this.viewSync=new Sd({uid:this.manager.uid,view$:this.view$,camera$:this.camera$,size$:this.size$,stageRect$:(i=this.manager.boxManager)==null?void 0:i.stageRect$,viewMode$:this.manager.windowManger.viewMode$,storeCamera:this.storeCamera,storeSize:this.storeSize}))},this.startListenWritableChange=()=>{this.sideEffectManager.add(()=>j.on("writableChange",i=>{i&&this.ensureCameraAndSize()}))},this.addCameraReaction=()=>{this.manager.refresher.add(oe.MainViewCamera,this.cameraReaction),this.manager.refresher.add(oe.MainViewSize,this.sizeReaction)},this.storeCurrentCamera=()=>{const i=this.view.camera;this.storeCamera(H({id:this.manager.uid},i))},this.storeCurrentSize=()=>{var n;const i=(n=this.manager.boxManager)==null?void 0:n.stageRect;i&&this.storeSize({id:this.manager.uid,width:i.width,height:i.height})},this.storeCamera=i=>{this.store.setMainViewCamera(i)},this.storeSize=i=>{this.store.setMainViewSize(i)},this.cameraReaction=()=>M.reaction(()=>this.mainViewCamera,i=>{if(i){const n=M.toJS(i);A.isEqual(n,this.camera$.value)||this.camera$.setValue(n)}},{fireImmediately:!0}),this.sizeReaction=()=>M.reaction(()=>this.mainViewSize,i=>{if(i){const n=M.toJS(i);A.isEqual(n,this.size$.value)||this.size$.setValue(n)}},{fireImmediately:!0}),this.mainViewClickListener=()=>{this.mainViewClickHandler()},this.setMainViewSize=A.debounce(i=>{this.store.setMainViewSize(gt(H({},i),{id:this.manager.uid}))},50),this.onCameraOrSizeUpdated=()=>{ie.emit("cameraStateChange",this.cameraState)},this.mainView=this.createMainView(),j.once("mainViewMounted").then(()=>{this.addMainViewListener(),this.start(),this.ensureCameraAndSize(),this.startListenWritableChange()}),this.sideEffectManager.add(()=>[j.on("startReconnect",()=>{cu(this.mainView)})]),this.createViewSync(),this.sideEffectManager.add(()=>j.on("focusedChange",({focused:i})=>{if(i===void 0){const n=this.store.getMainViewScenePath();n&&Vn(this.manager.room,n)}}))}ensureCameraAndSize(){var t;if(!this.mainViewCamera||!this.mainViewSize){this.manager.dispatchInternalEvent(Y.InitMainViewCamera),this.storeCamera(H({id:this.manager.uid},this.view.camera));const i=(t=this.manager.boxManager)==null?void 0:t.stageRect;i&&!this.mainViewSize&&this.storeSize({id:this.manager.uid,width:i.width,height:i.height})}}get mainViewCamera(){return this.store.getMainViewCamera()}get mainViewSize(){return this.store.getMainViewSize()}get didRelease(){return A.get(this.view,["didRelease"])}start(){this.started||(this.addCameraListener(),this.addCameraReaction(),this.started=!0)}get view(){return this.mainView}get cameraState(){return H(H({},this.view.camera),this.view.size)}createMainView(){const t=Cd(this.manager.displayer),i=this.store.getMainViewScenePath();return i&&mi(t,i),this.view$.setValue(t),t}onReconnect(){if(this.didRelease)this.rebind();else{const t=this.store.getMainViewScenePath();this.setFocusScenePath(t)}}setFocusScenePath(t){if(t)return mi(this.view,t)}rebind(){const t=this.mainView.divElement,i=this.mainView.disableCameraTransform,n=H({},this.mainView.camera);this.stop(),cu(this.mainView),this.removeMainViewListener(),this.mainView=this.createMainView(),this.mainView.disableCameraTransform=i,this.mainView.divElement=t,this.mainView.moveCamera(gt(H({},n),{animationMode:M.AnimationMode.Immediately})),this.addMainViewListener(),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 t;!this.manager.canOperate||(this.store.cleanFocus(),(t=this.manager.boxManager)==null||t.blurAllBox())}addCameraListener(){this.view.callbacks.on("onCameraUpdated",this.onCameraOrSizeUpdated),this.view.callbacks.on("onSizeUpdated",this.onCameraOrSizeUpdated)}removeCameraListener(){this.view.callbacks.off("onCameraUpdated",this.onCameraOrSizeUpdated),this.view.callbacks.off("onSizeUpdated",this.onCameraOrSizeUpdated)}stop(){this.removeCameraListener(),this.manager.refresher.remove(oe.MainViewCamera),this.manager.refresher.remove(oe.MainViewSize),this.started=!1}destroy(){this.camera$.destroy(),this.size$.destroy(),this.view$.destroy(),this.removeMainViewListener(),this.stop(),this.sideEffectManager.flushAll()}}class Gg{constructor(t){this.context=t,this.addRedoUndoListeners=i=>{if(i===void 0)this.addViewCallbacks(this.context.mainView(),this.onCanRedoStepsUpdate,this.onCanUndoStepsUpdate);else{const n=this.context.getAppProxy(i);n&&n.view&&this.addViewCallbacks(n.view,this.onCanRedoStepsUpdate,this.onCanUndoStepsUpdate)}},this.addViewCallbacks=(i,n,r)=>{n(i.canRedoSteps),r(i.canUndoSteps),i.callbacks.on("onCanRedoStepsUpdate",n),i.callbacks.on("onCanUndoStepsUpdate",r)},this.disposeViewCallbacks=i=>{i.callbacks.off("onCanRedoStepsUpdate",this.onCanRedoStepsUpdate),i.callbacks.off("onCanUndoStepsUpdate",this.onCanUndoStepsUpdate)},this.onCanRedoStepsUpdate=i=>{ie.emit("canRedoStepsChange",i)},this.onCanUndoStepsUpdate=i=>{ie.emit("canUndoStepsChange",i)},this.disposePrevFocusViewRedoUndoListeners=i=>{let n;if(i===void 0)n=this.context.mainView();else{const r=this.context.getAppProxy(i);r&&r.view&&(n=r.view)}n&&this.disposeViewCallbacks(n)},j.on("focusedChange",i=>{this.disposePrevFocusViewRedoUndoListeners(i.prev),setTimeout(()=>{this.addRedoUndoListeners(i.focused)},0)}),j.on("rootDirRemoved",()=>{this.disposePrevFocusViewRedoUndoListeners(t.focus()),this.addRedoUndoListeners(t.focus())}),this.addRedoUndoListeners(t.focus())}destroy(){this.disposePrevFocusViewRedoUndoListeners(this.context.focus())}}class Xg{constructor(t){this.windowManger=t,this.appProxies=new Map,this.appStatus=new Map,this.store=Fg,this.isReplay=this.windowManger.isReplay,this.mainViewScenesLength=0,this.callbacksNode=null,this.appCreateQueue=new hg,this.sceneIndex$=new b.Val(void 0),this.focused$=new b.Val(void 0),this.members$=new b.Val([]),this.sideEffectManager=new Oe.SideEffectManager,this.sceneState=null,this.rootDirRemoving=!1,this.onRemoveScenes=async i=>{var r,s;const{scenePath:n}=i;if(n===je){await this.onRootDirRemoved(),this.dispatchInternalEvent(Y.RootDirRemoved);return}if(zg(n)){let o=this.mainView.focusSceneIndex||0,a=(r=this.callbacksNode)==null?void 0:r.scenes[o];a||(o=0,a=(s=this.callbacksNode)==null?void 0:s.scenes[o]),a&&await this.setMainViewScenePath(`${je}${a}`),await this.setMainViewSceneIndex(o)}else this.appProxies.forEach(o=>{o.onRemoveScene(n)})},this.onReadonlyChanged=()=>{this.appProxies.forEach(i=>{i.emitAppIsWritableChange()})},this.onPlayerSeekStart=async()=>{await this.closeAll()},this.onPlayerSeekDone=async i=>{await this.attributesUpdateCallback(this.attributes.apps),this.appProxies.forEach(n=>{n.onSeek(i)})},this.createRootDirScenesCallback=()=>{let i=!1;this.callbacksNode&&(this.callbacksNode.dispose(),i=!0),this.callbacksNode=this.displayer.createScenesCallback(je,{onAddScene:this.onSceneChange,onRemoveScene:async(n,r)=>{await this.onSceneChange(n),j.emit("rootDirSceneRemoved",r)}}),this.callbacksNode&&(this.updateSceneState(this.callbacksNode),this.mainViewScenesLength=this.callbacksNode.scenes.length,i&&this.emitMainViewScenesChange(this.callbacksNode.scenes.length))},this.removeSceneByIndex=async i=>{var s;const n=ja(i,this.windowManger.pageState);this.setSceneIndexWithoutSync(n),this.dispatchInternalEvent(Y.SetAppFocusIndex,{type:"main",index:n});const r=(s=this.callbacksNode)==null?void 0:s.scenes[i];return setTimeout(()=>{r&&To(this.room,`${je}${r}`,i)},100),new Promise((o,a)=>{j.once("rootDirSceneRemoved").then(l=>{l===r&&o(!0)}).catch(l=>{console.log(`[WindowManager]: removePage error: ${l}`),a(!1)})})},this.setSceneIndexWithoutSync=i=>{var r;const n=(r=this.callbacksNode)==null?void 0:r.scenes[i];n&&this.mainViewProxy.setFocusScenePath(`${je}${n}`)},this.onSceneChange=i=>(this.mainViewScenesLength=i.scenes.length,this.updateSceneState(i),this.emitMainViewScenesChange(this.mainViewScenesLength)),this.emitMainViewScenesChange=i=>Promise.all([ie.emit("mainViewScenesLengthChange",i),j.emit("changePageState")]),this.updateSceneState=i=>{const n=this.store.getMainViewSceneIndex()||0;let r=i.scenes[n];r||(r=i.scenes[this.mainView.focusSceneIndex||0]),this.sceneState={scenePath:`${je}${r}`,contextPath:i.path,index:n,scenes:i.scenes.map(s=>({name:s})),sceneName:r},ie.emit("sceneStateChange",this.sceneState)},this.onBoxMove=i=>{this.dispatchInternalEvent(Y.AppMove,i),this.store.updateAppState(i.appId,Ge.Position,{x:i.x,y:i.y})},this.onBoxResize=i=>{i.width&&i.height&&(this.dispatchInternalEvent(Y.AppResize,i),this.store.updateAppState(i.appId,Ge.Size,{width:i.width,height:i.height}))},this.onBoxFocus=i=>{this.windowManger.safeSetAttributes({focus:i.appId})},this.onBoxClose=i=>{const n=this.appProxies.get(i.appId);n&&n.destroy(!1,!0,!0,i.error)},this.onBoxStateChange=i=>{this.dispatchInternalEvent(Y.AppBoxStateChange,i)},this.addAppsChangeListener=()=>{this.refresher.add("apps",()=>yd(()=>this.attributes.apps,()=>{this.attributesUpdateCallback(this.attributes.apps)}))},this.addAppCloseListener=()=>{var i;(i=this.refresher)==null||i.add("appsClose",()=>Vg(this.attributes.apps,()=>{this.onAppDelete(this.attributes.apps)}))},this.onMainViewIndexChange=i=>{i!==void 0&&this.sceneIndex$.value!==i&&(ie.emit("mainViewSceneIndexChange",i),j.emit("changePageState"),this.callbacksNode&&this.updateSceneState(this.callbacksNode),this.sceneIndex$.setValue(i))},this.onFocusChange=i=>{var n;this.focused$.value!==i&&(ie.emit("focusedChange",i),j.emit("focusedChange",{focused:i,prev:this.focused$.value}),this.focused$.setValue(i),i!==void 0&&((n=this.boxManager)==null||n.focusBox({appId:i}),setTimeout(()=>{const r=this.appProxies.get(i);r&&(r.onFocus(),Ae.notifyApp(r.kind,"focus",{appId:i}))},0)))},this.attributesUpdateCallback=A.debounce(i=>this._attributesUpdateCallback(i),100),this.onRegisteredChange=i=>{!i||Object.entries(i).forEach(([n,r])=>{Ae.appClasses.has(n)||Ae.register({kind:n,src:r.src,name:r.name})})},this.onMinimized=i=>{var n,r;((n=this.boxManager)==null?void 0:n.minimized)!==i&&(i===!0&&((r=this.boxManager)==null||r.blurAllBox()),setTimeout(()=>{var s;(s=this.boxManager)==null||s.setMinimized(Boolean(i))},0))},this.onAppDelete=async i=>{const n=Object.keys(i);for(const[r,s]of this.appProxies.entries())n.includes(r)||await s.destroy(!0,!1,!0)},this.closeAll=async()=>{for(const[i,n]of this.appProxies.entries())await n.destroy(!0,!1,!0)},this.displayerStateListener=i=>{const n=i.sceneState;if(n){const r=n.scenePath;this.appProxies.forEach(s=>{s.scenePath&&r.startsWith(s.scenePath)&&(s.emitAppSceneStateChange(n),s.setFullPath(r))})}this.appProxies.forEach(r=>{r.appEmitter.emit("roomStateChange",i)}),i.roomMembers&&this.members$.setValue(fu(i.roomMembers)),j.emit("observerIdChange",this.displayer.observerId),i.memberState&&j.emit("memberStateChange",M.toJS(i.memberState))},this.displayerWritableListener=i=>{var s,o;const n=!i,r=this.windowManger.readonly===void 0||!this.windowManger.readonly;this.windowManger.readonly===void 0?(s=this.boxManager)==null||s.setReadonly(i):(o=this.boxManager)==null||o.setReadonly(!(n&&r)),this.appProxies.forEach(a=>{a.emitAppIsWritableChange()}),n&&this.room&&this.room.disableSerialization===!0&&(this.room.disableSerialization=!1),j.emit("writableChange",n)},this.updateSceneIndex=()=>{const i=this.store.getMainViewScenePath(),n=Js(i),r=vi(this.displayer)[n];if(r.length){const s=i.replace(n,"").replace("/",""),o=r.findIndex(a=>a.name===s);A.isInteger(o)&&o>=0&&this.safeSetAttributes({_mainSceneIndex:o})}},this.updateRootDirRemoving=i=>{this.rootDirRemoving=i},this.displayer=t.displayer,this.store.setContext({getAttributes:()=>this.attributes,safeSetAttributes:i=>this.safeSetAttributes(i),safeUpdateAttributes:(i,n)=>this.safeUpdateAttributes(i,n)}),this.mainViewProxy=new Yg(this),this.viewManager=new Qg(this.displayer),this.appListeners=new Dg(this),this.displayer.callbacks.on(this.eventName,this.displayerStateListener),this.appListeners.addListeners(),this.refresher=Uf,this.refresher.setRoom(this.room),this.refresher.setContext({emitter:j}),this.sideEffectManager.add(()=>()=>{var i,n,r;this.appCreateQueue.destroy(),this.mainViewProxy.destroy(),(i=this.refresher)==null||i.destroy(),this.viewManager.destroy(),(n=this.boxManager)==null||n.destroy(),(r=this.callbacksNode)==null||r.dispose()}),j.once("onCreated").then(()=>this.onCreated()),j.on("onReconnected",()=>this.onReconnected()),M.isPlayer(this.displayer)&&(j.on("seekStart",this.onPlayerSeekStart),j.on("seek",this.onPlayerSeekDone)),j.on("removeScenes",this.onRemoveScenes),j.on("setReadonly",this.onReadonlyChanged),this.createRootDirScenesCallback(),Ae.setSyncRegisterApp(i=>{this.safeUpdateAttributes([oe.Registered,i.kind],i)}),this.members$.setValue(fu(this.displayer.state.roomMembers))}async onRootDirRemoved(t=!0){await this.setMainViewScenePath(ud),this.createRootDirScenesCallback();for(const[i,n]of this.appProxies.entries())n.view&&await this.closeApp(i,t);this.mainViewProxy.rebind(),await j.emit("rootDirRemoved"),this.updateRootDirRemoving(!1)}get eventName(){return M.isRoom(this.displayer)?"onRoomStateChanged":"onPlayerStateChanged"}get attributes(){return this.windowManger.attributes}get canOperate(){return this.windowManger.canOperate}get room(){return M.isRoom(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 t;return((t=this.room)==null?void 0:t.uid)||""}getMainViewSceneDir(){const t=this.store.getMainViewScenePath();if(t)return Js(t);throw new Error("[WindowManager]: mainViewSceneDir not found")}async onCreated(){var t;if(await this.attributesUpdateCallback(this.attributes.apps),j.emit("updateManagerRect"),yt.on("move",this.onBoxMove),yt.on("resize",this.onBoxResize),yt.on("focus",this.onBoxFocus),yt.on("close",this.onBoxClose),yt.on("boxStateChange",this.onBoxStateChange),this.addAppsChangeListener(),this.addAppCloseListener(),this.refresher.add("maximized",()=>M.autorun(()=>{var n;const i=this.attributes.maximized;(n=this.boxManager)==null||n.setMaximized(Boolean(i))})),this.refresher.add("minimized",()=>M.autorun(()=>{const i=this.attributes.minimized;this.onMinimized(i)})),this.refresher.add("mainViewIndex",()=>M.autorun(()=>{const i=A.get(this.attributes,"_mainSceneIndex");this.onMainViewIndexChange(i)})),this.refresher.add("focusedChange",()=>M.autorun(()=>{const i=A.get(this.attributes,"focus");this.onFocusChange(i)})),this.refresher.add("registeredChange",()=>M.autorun(()=>{const i=A.get(this.attributes,oe.Registered);this.onRegisteredChange(i)})),!this.attributes.apps||Object.keys(this.attributes.apps).length===0){const i=this.store.getMainViewScenePath();if(!i)return;this.resetScenePath(i)}this.displayerWritableListener(!((t=this.room)!=null&&t.isWritable)),this.displayer.callbacks.on("onEnableWriteNowChanged",this.displayerWritableListener),this.focused$.setValue(this.attributes.focus),this.sideEffectManager.add(()=>{const i=new Gg({mainView:()=>this.mainViewProxy.view,focus:()=>this.attributes.focus,getAppProxy:n=>this.appProxies.get(n)});return()=>i.destroy()})}async _attributesUpdateCallback(t){if(t&&me.container){const i=Object.keys(t);i.length===0&&this.appCreateQueue.emitReady();const n=i.map(r=>t[r].setup?{id:r,createdAt:t[r].createdAt}:{});for(const{id:r}of A.orderBy(n,"createdAt","asc"))if(r&&!this.appProxies.has(r)&&!this.appStatus.has(r)){const s=t[r];try{if(!this.attributes[r])throw new Error("appAttributes is undefined");this.appCreateQueue.push(()=>(this.appStatus.set(r,Eo.StartCreate),this.baseInsertApp({kind:s.kind,options:s.options,isDynamicPPT:s.isDynamicPPT},r,!1))),this.focusByAttributes(t)}catch(o){console.warn("[WindowManager]: Insert App Error",o)}}}}refresh(){this.attributesUpdateCallback(this.attributes.apps)}setBoxManager(t){this.boxManager=t,this.mainViewProxy.createViewSync()}resetMaximized(){var t;(t=this.boxManager)==null||t.setMaximized(Boolean(this.store.getMaximized()))}resetMinimized(){var t;(t=this.boxManager)==null||t.setMinimized(Boolean(this.store.getMinimized()))}bindMainView(t,i){const n=this.mainViewProxy.view;n.disableCameraTransform=i,Fr(30).then(()=>{n.divElement=t,j.emit("mainViewMounted")}),n.focusScenePath||this.setMainViewFocusPath()}setMainViewFocusPath(t){var n;const i=t||this.store.getMainViewScenePath();if(i)return mi(this.mainView,i),((n=this.mainView)==null?void 0:n.focusScenePath)===i}resetScenePath(t){this.displayer.state.sceneState.scenePath!==t&&Vn(this.room,t)}async addApp(t,i){jt("addApp",t);const{appId:n,needFocus:r}=await this.beforeAddApp(t,i),s=await this.baseInsertApp(t,n,!0,r);return this.afterAddApp(s),s==null?void 0:s.id}async beforeAddApp(t,i){var o,a;const n=await Ag(t.kind);this.appStatus.set(n,Eo.StartCreate);const r=(o=t.attributes)!=null?o:{};this.safeUpdateAttributes([n],r),this.store.setupAppAttributes(t,n,i);const s=!((a=this.boxManager)!=null&&a.minimized);return s&&this.store.setAppFocus(n,!0),{appId:n,needFocus:s}}afterAddApp(t){var i,n;if(t&&t.box){const r=t.box;yt.emit("move",{appId:t.id,x:r==null?void 0:r.intrinsicX,y:r==null?void 0:r.intrinsicY}),this.store.updateAppState(t.id,Ge.ZIndex,r.zIndex)}(i=this.boxManager)!=null&&i.minimized&&((n=this.boxManager)==null||n.setMinimized(!1,!1))}async closeApp(t,i=!0){const n=this.appProxies.get(t);n&&n.destroy(!0,i,!1)}async baseInsertApp(t,i,n,r){if(this.appProxies.has(i)){console.warn("[WindowManager]: app duplicate exists and cannot be created again");return}const s=new Va(t,this,i,n);if(s)return await s.baseInsertApp(r),this.appStatus.delete(i),s;throw this.appStatus.delete(i),new Error("[WindowManger]: initialize AppProxy failed")}safeSetAttributes(t){this.windowManger.safeSetAttributes(t)}safeUpdateAttributes(t,i){this.windowManger.safeUpdateAttributes(t,i)}async setMainViewScenePath(t){if(this.room){const i=this.displayer.scenePathType(t);if(Js(t)!==je)throw new Error('[WindowManager]: main view scenePath must in root dir "/"');if(i===M.ScenePathType.None)throw new Error(`[WindowManager]: ${t} not valid scene`);if(i===M.ScenePathType.Page)await this._setMainViewScenePath(t);else if(i===M.ScenePathType.Dir){const r=kg(this.displayer,t);r&&await this._setMainViewScenePath(r)}}}async _setMainViewScenePath(t){this.setMainViewFocusPath(t)&&(this.safeSetAttributes({_mainScenePath:t}),this.store.setMainViewFocusPath(this.mainView),this.updateSceneIndex(),this.dispatchSetMainViewScenePath(t))}async setMainViewSceneIndex(t){var i;if(this.room){if(this.store.getMainViewSceneIndex()===t)return;const n=(i=this.callbacksNode)==null?void 0:i.scenes[t],r=`${je}${n}`;if(n)this.setMainViewFocusPath(r)&&(this.store.setMainViewScenePath(r),this.safeSetAttributes({_mainSceneIndex:t}),this.dispatchSetMainViewScenePath(r));else throw new Error(`[WindowManager]: ${t} not valid index`)}}dispatchSetMainViewScenePath(t){this.dispatchInternalEvent(Y.SetMainViewScenePath,{nextScenePath:t}),Vn(this.room,t)}getAppInitPath(t){var n;const i=this.store.getAppAttributes(t);if(i)return(n=i==null?void 0:i.options)==null?void 0:n.scenePath}safeDispatchMagixEvent(t,i){this.canOperate&&this.displayer.dispatchMagixEvent(t,i)}focusByAttributes(t){var i;if(t&&Object.keys(t).length===((i=this.boxManager)==null?void 0:i.boxSize)){const n=this.store.focus;n&&this.boxManager.focusBox({appId:n})}}async onReconnected(){this.attributesUpdateCallback(this.attributes.apps);const i=Array.from(this.appProxies.values()).map(n=>n.onReconnected());this.mainViewProxy.onReconnect(),await Promise.all(i)}notifyContainerRectUpdate(t){this.appProxies.forEach(i=>{i.appEmitter.emit("containerRectUpdate",t)})}dispatchInternalEvent(t,i){this.safeDispatchMagixEvent(Ao,{eventName:t,payload:i})}destroy(){this.displayer.callbacks.off(this.eventName,this.displayerStateListener),this.displayer.callbacks.off("onEnableWriteNowChanged",this.displayerWritableListener),this.appListeners.removeListeners(),yt.clearListeners(),j.clearListeners(),this.appProxies.size&&this.appProxies.forEach(t=>{t.destroy(!0,!1,!0)}),ie.clearListeners(),this.sideEffectManager.flushAll(),this.sceneIndex$.destroy(),this.focused$.destroy(),this.members$.destroy()}}/*! *****************************************************************************
1
+ "use strict";var qf=Object.defineProperty,eg=Object.defineProperties;var tg=Object.getOwnPropertyDescriptors;var nu=Object.getOwnPropertySymbols;var ig=Object.prototype.hasOwnProperty,ng=Object.prototype.propertyIsEnumerable;var ru=(e,t,i)=>t in e?qf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,H=(e,t)=>{for(var i in t||(t={}))ig.call(t,i)&&ru(e,i,t[i]);if(nu)for(var i of nu(t))ng.call(t,i)&&ru(e,i,t[i]);return e},ft=(e,t)=>eg(e,tg(t));Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var rg=require("p-retry"),sg=require("emittery"),A=require("lodash"),I=require("white-web-sdk"),og=require("uuid"),Re=require("side-effect-manager"),M=require("value-enhancer"),od=require("@juggle/resize-observer"),ag=require("video.js");function Da(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var lg=Da(rg),Zt=Da(sg),su=Da(ag),Z=(e=>(e.AppMove="AppMove",e.AppFocus="AppFocus",e.AppResize="AppResize",e.AppBoxStateChange="AppBoxStateChange",e.GetAttributes="GetAttributes",e.UpdateWindowManagerWrapper="UpdateWindowManagerWrapper",e.WindowCreated="WindowCreated",e.SetMainViewScenePath="SetMainViewScenePath",e.SetMainViewSceneIndex="SetMainViewSceneIndex",e.SetAppFocusIndex="SetAppFocusIndex",e.SwitchViewsToFreedom="SwitchViewsToFreedom",e.CursorMove="CursorMove",e.RootDirRemoved="RootDirRemoved",e.Refresh="Refresh",e.InitMainViewCamera="InitMainViewCamera",e.InvokeAttributesUpdateCallback="InvokeAttributesUpdateCallback",e))(Z||{});const Ao="__WindowManger",Xs="__WindowMangerEnsureReconnected__";var Xe=(e=>(e.Size="size",e.Position="position",e.SceneIndex="SceneIndex",e.ZIndex="zIndex",e.Visible="visible",e.Ratio="ratio",e.StageRatio="stageRatio",e.Draggable="draggable",e.Resizable="resizable",e))(Xe||{}),ad=(e=>(e.setBoxSize="setBoxSize",e.setBoxMinSize="setBoxMinSize",e.destroy="destroy",e))(ad||{}),Eo=(e=>(e.StartCreate="StartCreate",e))(Eo||{}),ld=(e=>(e.Leave="leave",e.Normal="normal",e))(ld||{});const ou="2.16.1",ug=340/720,cg=340/720,dg=9/16,ze="/",ud="/init",cd=50,au=500,te=new Zt.default;class hg{constructor(){this.list=[],this.isEmit=!1,this.invoked=()=>{this.currentInvoker=void 0,this.list.length===0&&(this.clear(),this.emitReady())},this.clear=()=>{clearInterval(this.timer),this.timer=void 0}}initInterval(){return setInterval(()=>{this.invoke()},50)}push(t){this.list.push(t),this.invoke(),this.timer===void 0&&this.list.length>0&&(this.timer=this.initInterval())}invoke(){if(this.list.length===0||this.currentInvoker!==void 0)return;const t=this.list.shift();t&&(this.currentInvoker=t,t().then(()=>{this.invoked()}).catch(i=>{console.error(`[WindowManager]: create app error: ${i.message}`),this.invoked()}))}emitReady(){this.isEmit||setTimeout(()=>{te.emit("ready")},cd),this.isEmit=!0}empty(){this.list=[],this.clear()}destroy(){this.timer&&this.clear()}}const j=new Zt.default,pg="__WindowManagerAppCache";let jn,lu;const fg=async()=>{jn=await vg()},gg=(e,t)=>{if(!!jn)return yg(jn,{kind:e,sourceCode:t})},mg=async e=>jn?await wg(jn,e):null;function vg(){return new Promise((e,t)=>{const i=indexedDB.open(pg,2);i.onerror=n=>{t(n)},i.onupgradeneeded=n=>{const r=n.target.result;r.objectStoreNames.contains("apps")||(lu=r.createObjectStore("apps",{keyPath:"kind"}),lu.createIndex("kind","kind",{unique:!0}))},i.onsuccess=()=>{const n=i.result;e(n)}})}function wg(e,t){return new Promise((i,n)=>{const s=e.transaction(["apps"]).objectStore("apps").index("kind").get(t);s.onerror=o=>n(o),s.onsuccess=()=>{s.result?i(s.result):i(null)}})}function yg(e,t){return new Promise((i,n)=>{const r=e.transaction(["apps"],"readwrite").objectStore("apps").add(t);r.onsuccess=()=>i(),r.onerror=()=>n()})}const xg="NetlessApp",Sg=1e4,Cg=async e=>{const t=await mg(e);if(t)return t.sourceCode;{const n=await(await Mg(e,{timeout:Sg})).text();return await gg(e,n),n}},uu=(e,t)=>{let i=Function(e+`
2
+ ;return ${t}`)();return typeof i=="undefined"&&(i=window[t]),i},bg=async(e,t,i)=>{const n=i||xg+t;te.emit("loadApp",{kind:t,status:"start"});try{const r=await Cg(e);if(!r||r.length===0){te.emit("loadApp",{kind:t,status:"failed",reason:"script is empty."});return}try{const s=uu(r,n);return te.emit("loadApp",{kind:t,status:"success"}),s}catch(s){if(s.message.includes("Can only have one anonymous define call per script file")){const o=window.define;typeof o=="function"&&o.amd&&delete o.amd;const a=uu(r,n);return te.emit("loadApp",{kind:t,status:"success"}),a}te.emit("loadApp",{kind:t,status:"failed",reason:s.message})}}catch(r){te.emit("loadApp",{kind:t,status:"failed",reason:r.message})}};async function Mg(e,t){const{timeout:i=1e4}=t,n=new AbortController,r=setTimeout(()=>n.abort(),i),s=await fetch(e,ft(H({},t),{signal:n.signal,headers:{"content-type":"text/plain"}}));return clearTimeout(r),s}class Ig{constructor(){this.kindEmitters=new Map,this.registered=new Map,this.appClassesCache=new Map,this.appClasses=new Map,this.syncRegisterApp=null,this.onSyncRegisterAppChange=t=>{this.register({kind:t.kind,src:t.src})}}setSyncRegisterApp(t){this.syncRegisterApp=t}async register(t){this.appClassesCache.delete(t.kind),this.registered.set(t.kind,t);const i=t.src;let n;if(typeof i=="string"?(n=async()=>{let r=await bg(i,t.kind,t.name);if(r)return r.__esModule&&(r=r.default),r;throw new Error(`[WindowManager]: load remote script failed, ${i}`)},this.syncRegisterApp&&this.syncRegisterApp({kind:t.kind,src:i,name:t.name})):typeof i=="function"?n=i:n=async()=>i,this.appClasses.set(t.kind,async()=>{let r=this.appClassesCache.get(t.kind);return r||(r=n(),this.appClassesCache.set(t.kind,r)),r}),t.addHooks){const r=this.createKindEmitter(t.kind);r&&t.addHooks(r)}}unregister(t){this.appClasses.delete(t),this.appClassesCache.delete(t),this.registered.delete(t);const i=this.kindEmitters.get(t);i&&(i.clearListeners(),this.kindEmitters.delete(t))}async notifyApp(t,i,n){const r=this.kindEmitters.get(t);await(r==null?void 0:r.emit(i,n))}createKindEmitter(t){if(!this.kindEmitters.has(t)){const i=new Zt.default;this.kindEmitters.set(t,i)}return this.kindEmitters.get(t)}}const Me=new Ig,Ag=async e=>{var i,n;const t=await((i=Me.appClasses.get(e))==null?void 0:i());return t&&((n=t.config)==null?void 0:n.singleton)?e:`${e}-${og.v4().replace("-","").slice(0,8)}`},gi=(e,t)=>{if(!e.didRelease&&e.focusScenePath!==t)return e.focusScenePath=t,e},cu=e=>{e.didRelease||e.release()},Ln=(e,t)=>{if(e&&e.isWritable&&e.state.sceneState.scenePath!==t){const i=t==="/"?"":t;e.setScenePath(i)}},Eg=(e,t,i)=>{var n;if(e&&t){const s=(n=mi(e)[t])==null?void 0:n[i];if(s)return`${t}/${s.name}`}},To=(e,t,i)=>{e&&e.scenePathType(t)!==I.ScenePathType.None&&e.removeScenes(t,i)},Tg=(e,t)=>{j.once(e).then(t)};A.debounce((e,t)=>{e.emit("mainViewModeChange",t)},200);const kg=(e,t,i=0)=>{const n=mi(e)[t];if(!n)return;const r=n[i];if(!r)return;const s=r.name;return t===ze?`/${s}`:`${t}/${s}`},mi=e=>e.entireScenes(),ji=(e,t,i,n)=>e==null?void 0:e.putScenes(t,i,n),Ng=e=>e.startsWith("/"),Js=e=>{const t=e.split("/");t.pop();let i=t.join("/");return i===""&&(i="/"),i},Pg=e=>e.endsWith("/")?e.slice(0,-1):e,du=e=>{const t=e.split(".").map(i=>i.padStart(2,"0")).join("");return parseInt(t)},Fr=e=>new Promise(t=>setTimeout(t,e)),zg=e=>e.split("").reduce((i,n)=>(n===ze&&(i+=1),i),0)===1;class Dg{constructor(t){this.manager=t,this.displayer=this.manager.displayer,this.mainMagixEventListener=i=>{if(i.authorId!==this.displayer.observerId){const n=i.payload;switch(n.eventName){case Z.AppMove:{this.appMoveHandler(n.payload);break}case Z.AppResize:{this.appResizeHandler(n.payload);break}case Z.AppBoxStateChange:{this.boxStateChangeHandler(n.payload);break}case Z.SetMainViewScenePath:{this.setMainViewScenePathHandler(n.payload);break}case Z.CursorMove:{this.cursorMoveHandler(n.payload);break}case Z.RootDirRemoved:{this.rootDirRemovedHandler();break}case Z.Refresh:{this.refreshHandler();break}case Z.InitMainViewCamera:{this.initMainViewCameraHandler();break}case Z.SetAppFocusIndex:{this.setAppFocusViewIndexHandler(n.payload);break}case Z.InvokeAttributesUpdateCallback:{this.manager.attributesUpdateCallback(this.manager.attributes.apps);break}}}},this.appMoveHandler=i=>{var n;(n=this.boxManager)==null||n.moveBox(i)},this.appResizeHandler=i=>{var n,r;(n=this.boxManager)==null||n.resizeBox(Object.assign(i,{skipUpdate:!0})),(r=this.manager.room)==null||r.refreshViewSize()},this.boxStateChangeHandler=i=>{te.emit("boxStateChange",i)},this.setMainViewScenePathHandler=({nextScenePath:i})=>{gi(this.manager.mainView,i),te.emit("mainViewScenePathChange",i)},this.cursorMoveHandler=i=>{j.emit("cursorMove",i)},this.rootDirRemovedHandler=()=>{this.manager.createRootDirScenesCallback(),this.manager.mainViewProxy.rebind(),j.emit("rootDirRemoved")},this.refreshHandler=()=>{this.manager.windowManger._refresh()},this.initMainViewCameraHandler=()=>{this.manager.mainViewProxy.addCameraReaction()},this.setAppFocusViewIndexHandler=i=>{if(i.type==="main")this.manager.setSceneIndexWithoutSync(i.index);else if(i.type==="app"&&i.appID){const n=this.manager.appProxies.get(i.appID);n&&n.setSceneIndexWithoutSync(i.index)}}}get boxManager(){return this.manager.boxManager}addListeners(){this.displayer.addMagixEventListener(Ao,this.mainMagixEventListener)}removeListeners(){this.displayer.removeMagixEventListener(Ao,this.mainMagixEventListener)}}class dd extends Error{constructor(){super(...arguments);this.message="[WindowManager]: app duplicate exists and cannot be created again"}}class jg extends Error{constructor(t){super(`[WindowManager]: app ${t} need register or provide src`)}}class Ce extends Error{constructor(){super(...arguments);this.message="[WindowManager]: AppManager must be initialized"}}class hd extends Error{constructor(t){super(`[WindowManager]: white-web-sdk version must large than ${t}`)}}class pd extends Error{constructor(){super(...arguments);this.message="[WindowManager]: kind must be a valid string"}}class fd extends Error{constructor(){super(...arguments);this.message="[WindowManager]: box need created"}}class gd extends Error{constructor(){super(...arguments);this.message='[WindowManager]: ScenePath should start with "/"'}}class md extends Error{constructor(){super(...arguments);this.message="[WindowManager]: boxManager not found"}}class vd extends Error{constructor(){super(...arguments);this.message="[WindowManager]: room phase only Connected can be bindContainer"}}const wd=e=>(t,i)=>{if(t!==void 0)if(I.listenUpdated){const n=r=>{r.map(o=>o.kind).includes(e)&&i()};return I.listenUpdated(t,n),i(),()=>I.unlistenUpdated(t,n)}else return I.reaction(()=>t,()=>{i()},{fireImmediately:!0})},yd=(e,t,i)=>{let n=null;const r=I.reaction(e,()=>{n&&(n(),n=null);const s=e();A.isObject(s)?(n=()=>I.unlistenUpdated(s,t),I.listenUpdated(s,t)):i==null||i(s)},{fireImmediately:!0});return()=>{n==null||n(),r()}},Lg=wd(I.UpdateEventKind.Removed);wd(I.UpdateEventKind.Inserted);const Ks=Object.keys;function hu(e){return Boolean(A.has(e,"__isRef"))}function Vg(e){return{k:Re.genUID(),v:e,__isRef:!0}}class Rg{constructor(){this.listeners=new Set}get length(){return this.listeners.size}dispatch(t){this.listeners.forEach(i=>i(t))}addListener(t){this.listeners.add(t)}removeListener(t){this.listeners.delete(t)}}const Ze="_WM-STORAGE_";class pu{constructor(t,i,n){if(this._sideEffect=new Re.SideEffectManager,this._destroyed=!1,this._refMap=new WeakMap,this._lastValue=new Map,this.onStateChanged=new Rg,n&&!A.isObject(n))throw new Error(`Default state for Storage ${i} is not an object.`);this._context=t,this.id=i||null,this._state={};const r=this._getRawState(this._state);this._context.isWritable&&(this.id===null?t.isAddApp&&n&&this.setState(n):(r===this._state||!A.isObject(r))&&(A.get(this._context.getAttributes(),[Ze])||this._context.updateAttributes([Ze],{}),this._context.updateAttributes([Ze,this.id],this._state),n&&this.setState(n))),Ks(r).forEach(s=>{if(!(this.id===null&&s===Ze))try{const o=A.isObject(r[s])?JSON.parse(JSON.stringify(r[s])):r[s];hu(o)?(this._state[s]=o.v,A.isObject(o.v)&&this._refMap.set(o.v,o)):this._state[s]=o}catch(o){console.error(o)}}),this._sideEffect.addDisposer(yd(()=>this.id===null?t.getAttributes():A.get(t.getAttributes(),[Ze,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(t){return this.onStateChanged.addListener(t),()=>this.onStateChanged.removeListener(t)}ensureState(t){return this.setState(Ks(t).reduce((i,n)=>(A.has(this._state,n)||(i[n]=t[n]),i),{}))}setState(t){if(this._destroyed){console.error(new Error(`Cannot call setState on destroyed Storage "${this.id}".`));return}if(!this._context.isWritable){console.error(new Error(`Cannot setState on Storage "${this.id}" without writable access`),t);return}const i=Ks(t);i.length>0&&i.forEach(n=>{const r=t[n];if(r!==this._state[n])if(r===void 0)this._lastValue.set(n,this._state[n]),delete this._state[n],this._setRawState(n,r);else{this._lastValue.set(n,this._state[n]),this._state[n]=r;let s=r;if(A.isObject(r)){let o=this._refMap.get(r);o||(o=Vg(r),this._refMap.set(r,o)),s=o}this._setRawState(n,s)}})}emptyStorage(){if(!(A.size(this._state)<=0)){if(this._destroyed){console.error(new Error(`Cannot empty destroyed Storage "${this.id}".`));return}if(!this._context.isWritable){console.error(new Error(`Cannot empty Storage "${this.id}" without writable access.`));return}this.setState(A.mapValues(this._state,A.noop))}}deleteStorage(){if(this.id===null)throw new Error("Cannot delete main Storage");if(!this._context.isWritable){console.error(new Error(`Cannot delete Storage "${this.id}" without writable access.`));return}this.destroy(),this._context.updateAttributes([Ze,this.id],void 0)}get destroyed(){return this._destroyed}destroy(){this._destroyed=!0,this._sideEffect.flushAll()}_getRawState(t){var i;return this.id===null?(i=this._context.getAttributes())!=null?i:t:A.get(this._context.getAttributes(),[Ze,this.id],t)}_setRawState(t,i){if(this.id===null){if(t===Ze)throw new Error(`Cannot set attribute internal filed "${Ze}"`);return this._context.updateAttributes([t],i)}else return this._context.updateAttributes([Ze,this.id,t],i)}_updateProperties(t){var i;if(this._destroyed){console.error(new Error(`Cannot call _updateProperties on destroyed Storage "${this.id}".`));return}if(t.length>0){const n={};for(let r=0;r<t.length;r++)try{const s=t[r],o=s.key;if(this.id===null&&o===Ze)continue;const a=A.isObject(s.value)?JSON.parse(JSON.stringify(s.value)):s.value;let l;switch(this._lastValue.has(o)&&(l=this._lastValue.get(o),this._lastValue.delete(o)),s.kind){case 2:{A.has(this._state,o)&&(l=this._state[o],delete this._state[o]),n[o]={oldValue:l};break}default:{let u=a;if(hu(a)){const{k:h,v:p}=a,w=this._state[o];A.isObject(w)&&((i=this._refMap.get(w))==null?void 0:i.k)===h?u=w:(u=p,A.isObject(p)&&this._refMap.set(p,a))}u!==this._state[o]&&(l=this._state[o],this._state[o]=u),n[o]={newValue:u,oldValue:l};break}}}catch(s){console.error(s)}this.onStateChanged.dispatch(n)}}}class Bg{constructor(t,i,n,r){this.view=t,this.appContext=i,this.appProxy=n,this.ensureSize=r,this.nextPage=async()=>{const u=this.pageState.index+1;return this.jumpPage(u)},this.prevPage=async()=>{const u=this.pageState.index-1;return this.jumpPage(u)},this.jumpPage=async u=>u<0||u>=this.pageState.length?(console.warn(`[WindowManager]: index ${u} out of range`),!1):(this.appProxy.setSceneIndex(u),!0),this.addPage=async u=>{const h=u==null?void 0:u.after,p=u==null?void 0:u.scene,w=this.appProxy.scenePath;if(!!w)if(h){const C=this.pageState.index+1;ji(this.appContext.room,w,[p||{}],C)}else ji(this.appContext.room,w,[p||{}])},this.removePage=async u=>{const h=u===void 0?this.pageState.index:u;return this.pageState.length===1?(console.warn("[WindowManager]: can not remove the last page"),!1):h<0||h>=this.pageState.length?(console.warn(`[WindowManager]: page index ${u} out of range`),!1):this.appProxy.removeSceneByIndex(h)};const s=new M.Val(n.pageState),o=new M.Val(n.size$.value),a=u=>A.pick(u,["centerX","centerY","scale"]),l=new M.Val(a(this.view.camera));this.baseRect$=o,this.pageState$=s,this.baseCamera$=l,this.appProxy.sideEffectManager.add(()=>[n.appEmitter.on("pageStateChange",u=>s.setValue(u)),n.camera$.subscribe(u=>{u&&l.setValue(a(u))}),n.size$.subscribe(u=>{u&&o.setValue(A.pick(u,["width","height"]))})]),t.disableCameraTransform=!0}get pageState(){return this.pageState$.value}moveCamera(t){this.appProxy.moveCamera(t)}setBaseRect(t){this.appProxy.updateSize(t.width,t.height)}}const zt=(...e)=>{ge.debug&&console.log("[WindowManager]:",...e)},Og=(e,t)=>{const i=document.createElement("div");i.className="netless-window-manager-playground";const n=document.createElement("div");return n.className="netless-window-manager-main-view",t.appendChild(n),e.appendChild(i),{playground:i,mainViewElement:n}},_g=()=>{if(du(I.WhiteVersion)<du(ou))throw new hd(ou)},xd=(e,t)=>{const i=e==null?void 0:e.state.roomMembers;return i==null?void 0:i.find(n=>{var r;return((r=n.payload)==null?void 0:r.uid)===t})},fu=e=>e.map(t=>{var i;return H({uid:((i=t.payload)==null?void 0:i.uid)||""},I.toJS(t))}),gu=async e=>{try{return await e.createInvisiblePlugin(ge,{})}catch(t){if(t.message==='invisible plugin "WindowManager" exits')return await Fr(200),e.getInvisiblePlugin(ge.kind);zt("createInvisiblePlugin failed",t)}};class $g{constructor(t,i,n,r){this.manager=t,this.appId=i,this.appProxy=n,this.appOptions=r,this.mobxUtils={autorun:I.autorun,reaction:I.reaction,toJS:I.toJS},this.objectUtils={listenUpdated:I.listenUpdated,unlistenUpdated:I.unlistenUpdated,listenDisposed:I.listenDisposed,unlistenDisposed:I.unlistenDisposed},this.store=this.manager.store,this.isReplay=this.manager.isReplay,this.getAttributes=()=>this.appProxy.attributes,this.getScenes=()=>{const s=this.store.getAppAttributes(this.appId);return s!=null&&s.isDynamicPPT?this.appProxy.scenes:s==null?void 0:s.options.scenes},this.createWhiteBoardView=s=>{if(this.whiteBoardView)return this.whiteBoardView;let o=this.view;o||(o=this.appProxy.createAppDir()),s&&A.isBoolean(s.syncCamera)&&this.appProxy.syncCamera$.setValue(s.syncCamera);const a=document.createElement("div");return this._viewWrapper=a,a.className="window-manager-view-wrapper",this.box.$main.appendChild(a),o.divElement=a,this.appProxy.fireMemberStateChange(),this.isAddApp&&this.ensurePageSize(s==null?void 0:s.size),this.whiteBoardView=new Bg(o,this,this.appProxy,this.ensurePageSize),this.appProxy.sideEffectManager.add(()=>[this.box._stageRect$.subscribe(l=>{a.style.left=`${l.x}px`,a.style.top=`${l.y}px`,a.style.width=`${l.width}px`,a.style.height=`${l.height}px`}),()=>()=>{this.whiteBoardView=void 0}]),this.appProxy.whiteBoardViewCreated$.setValue(!0),this.whiteBoardView},this.ensurePageSize=s=>{var l;if(!A.isNumber(s)||!this.appProxy.scenePath||this.appProxy.pageState.length>=s)return;if(s<=0||s>=au)throw Error(`[WindowManager]: size ${s} muse be in range [1, ${au}]`);const o=s-this.appProxy.pageState.length,a=new Array(o).fill({});(l=this.room)==null||l.putScenes(this.appProxy.scenePath,a)},this.getInitScenePath=()=>this.appProxy.scenePath,this.setAttributes=s=>{this.manager.safeSetAttributes({[this.appId]:s})},this.updateAttributes=(s,o)=>{this.manager.attributes[this.appId]&&this.manager.safeUpdateAttributes([this.appId,...s],o)},this.setScenePath=async s=>{var o;!this.appProxy.box||(this.appProxy.setFullPath(s),(o=this.room)==null||o.setScenePath(s))},this.getAppOptions=()=>typeof this.appOptions=="function"?this.appOptions():this.appOptions,this.createStorage=(s,o)=>{const a=new pu(this,s,o);return this.emitter.on("destroy",()=>{a.destroy()}),a},this.dispatchMagixEvent=(...s)=>{var a;const o=`${this.appId}:${s[0]}`;return(a=this.manager.room)==null?void 0:a.dispatchMagixEvent(o,s[1])},this.addMagixEventListener=(s,o,a)=>{const l=`${this.appId}:${s}`;return this.manager.displayer.addMagixEventListener(l,o,a),()=>this.manager.displayer.removeMagixEventListener(l,o)},this.removeMagixEventListener=this.manager.displayer.removeMagixEventListener.bind(this.manager.displayer),this.emitter=n.appEmitter,this.isAddApp=n.isAddApp}get displayer(){return this.manager.displayer}get destroyed(){return this.appProxy.status==="destroyed"}get view(){return this.appProxy.view}get isWritable(){return this.manager.canOperate&&!this.destroyed}get box(){const t=this.appProxy.box$.value;if(t)return t;throw new fd}get room(){return this.manager.room}get members(){return this.manager.members$.value}get currentMember(){const t=xd(this.room,this.manager.uid);if(!t)throw new Error(`Member ${this.manager.uid} not found.`);return H({uid:this.manager.uid},t)}get storage(){return this._storage||(this._storage=new pu(this)),this._storage}}class Ug{constructor(t){this.params=t,this.sceneNode=null,this.createSceneNode=r=>(this.scenePath=r,this.sceneNode&&this.sceneNode.dispose(),this.sceneNode=this.params.displayer.createScenesCallback(r,{onAddScene:this.onSceneChange,onRemoveScene:this.onSceneChange}),this.sceneNode),this.onSceneChange=()=>{this.params.notifyPageStateChange()};const{displayer:i,scenePath:n}=this.params;this.view=this.params.view,n&&(this.scenePath=n,this.sceneNode=i.createScenesCallback(n,{onAddScene:this.onSceneChange,onRemoveScene:this.onSceneChange}))}setView(t){this.view=t}getFullPath(t){var n;const i=(n=this.sceneNode)==null?void 0:n.scenes;if(this.scenePath&&i){const r=i[t];if(r)return`${this.scenePath}/${r}`}}toObject(){var t,i;return{index:((t=this.view)==null?void 0:t.focusSceneIndex)||0,length:((i=this.sceneNode)==null?void 0:i.scenes.length)||0}}destroy(){var t;(t=this.sceneNode)==null||t.dispose()}}class Wg{constructor(t){this.saveCamera=t,this.setRect=i=>{this.rect=i,this.remoteCamera&&this.remoteSize&&this.onRemoteUpdate(this.remoteCamera,this.remoteSize)},this.onRemoteUpdate=A.throttle((i,n)=>{if(this.remoteCamera=i,this.remoteSize=n,this.remoteSize&&this.rect){const r=this.rect.width/n.width,s=this.rect.height/n.height,a={scale:i.scale*Math.min(r,s),animationMode:I.AnimationMode.Continuous};i.centerX!==null&&(a.centerX=i.centerX),i.centerY!==null&&(a.centerY=i.centerY),this.moveCamera(a)}},10)}setView(t){this.view=t}onRemoteSizeUpdate(t){this.remoteSize=t;const i=!A.isEqual(A.pick(this.rect,["width","height"]),A.pick(t,["width","height"]));if(this.rect&&this.remoteCamera&&i){const n=this.rect.width/t.width,r=this.remoteCamera.scale*n;this.moveCamera({scale:r})}}onLocalCameraUpdate(t){this.saveCamera(t),this.remoteCamera=t}moveCamera(t){var i;(i=this.view)==null||i.moveCamera(ft(H({},t),{animationMode:I.AnimationMode.Continuous}))}}class Sd{constructor(t){this.context=t,this.sem=new Re.SideEffectManager,this.bindView=n=>{!n||(this.synchronizer.setView(n),this.sem.flush("view"),this.sem.add(()=>(n.callbacks.on("onCameraUpdatedByDevice",this.onCameraUpdatedByDevice),()=>n.callbacks.off("onCameraUpdatedByDevice",this.onCameraUpdatedByDevice)),"view"))},this.onCameraUpdatedByDevice=n=>{if(!n)return;this.synchronizer.onLocalCameraUpdate(ft(H({},n),{id:this.context.uid}));const r=this.context.stageRect$.value;if(r){const s={width:r.width,height:r.height,id:this.context.uid};A.isEqual(s,this.context.size$.value)||this.context.storeSize(s)}},this.synchronizer=new Wg(n=>{this.context.camera$.setValue(n,!0),!(this.context.viewMode$&&this.context.viewMode$.value===I.ViewMode.Freedom)&&this.context.storeCamera(n)}),this.bindView(this.context.view$.value),this.sem.add(()=>[this.context.view$.subscribe(n=>{const r=this.context.camera$.value;r&&this.context.size$.value&&(n==null||n.moveCamera({scale:1,animationMode:I.AnimationMode.Immediately}),this.synchronizer.onRemoteUpdate(r,this.context.size$.value)),this.bindView(n)}),this.context.camera$.subscribe((n,r)=>{const s=this.context.size$.value;n&&s&&!r&&this.synchronizer.onRemoteUpdate(n,s)}),this.context.size$.subscribe(n=>{n&&this.synchronizer.onRemoteSizeUpdate(n)}),this.context.stageRect$.subscribe(n=>{n&&this.synchronizer.setRect(n)})]);const i=M.combine([this.context.camera$,this.context.size$]);i.reaction(([n,r])=>{n&&r&&(this.synchronizer.onRemoteUpdate(n,r),i.destroy())})}destroy(){this.sem.flushAll()}}const wt=new Zt.default,ja=(e,t)=>{let i=0;const n=t.length-1;return e===t.index?e===n?i=e-1:i=t.index+1:i=t.index,i};var re=(e=>(e.Apps="apps",e.Focus="focus",e.State="state",e.BoxState="boxState",e.MainViewCamera="mainViewCamera",e.MainViewSize="mainViewSize",e.Broadcaster="broadcaster",e.Cursors="cursors",e.Position="position",e.CursorState="cursorState",e.FullPath="fullPath",e.Registered="registered",e.Camera="camera",e.Size="size",e))(re||{});class Hg{constructor(t){this.context=t,this.setAppFocus=(i,n)=>{n?this.context.safeSetAttributes({focus:i}):this.context.safeSetAttributes({focus:void 0})}}setContext(t){this.context=t}get attributes(){return this.context.getAttributes()}apps(){return A.get(this.attributes,["apps"])}get focus(){return A.get(this.attributes,["focus"])}getAppAttributes(t){return A.get(this.apps(),[t])}getAppState(t){return A.get(this.apps(),[t,"state"])}getMaximized(){return A.get(this.attributes,["maximized"])}getMinimized(){return A.get(this.attributes,["minimized"])}setupAppAttributes(t,i,n){this.attributes.apps||this.context.safeSetAttributes({apps:{}});const s=["scenePath","title"];n||s.push("scenes");const o=A.pick(t.options,s),a={kind:t.kind,options:o,isDynamicPPT:n,setup:!1};typeof t.src=="string"&&(a.src=t.src),a.createdAt=Date.now(),this.context.safeUpdateAttributes(["apps",i],a),this.context.safeUpdateAttributes(["apps",i,"state"],{[Xe.Size]:{},[Xe.Position]:{},[Xe.SceneIndex]:0})}updateAppState(t,i,n){A.get(this.attributes,["apps",t,"state"])&&this.context.safeUpdateAttributes(["apps",t,"state",i],n)}updateAppAttributes(t,i,n){this.context.safeUpdateAttributes(["apps",t,i],n)}cleanAppAttributes(t){this.context.safeUpdateAttributes(["apps",t],void 0),this.context.safeSetAttributes({[t]:void 0}),this.attributes.focus===t&&this.cleanFocus()}cleanFocus(){this.context.safeSetAttributes({focus:void 0})}getAppSceneIndex(t){var i;return(i=this.getAppState(t))==null?void 0:i[Xe.SceneIndex]}getAppScenePath(t){var i,n;return(n=(i=this.getAppAttributes(t))==null?void 0:i.options)==null?void 0:n.scenePath}getMainViewScenePath(){return this.attributes._mainScenePath}getMainViewSceneIndex(){return this.attributes._mainSceneIndex}getBoxState(){return this.attributes.boxState}setMainViewScenePath(t){this.context.safeSetAttributes({_mainScenePath:t})}setMainViewSceneIndex(t){this.context.safeSetAttributes({_mainSceneIndex:t})}getMainViewCamera(){return A.get(this.attributes,["mainViewCamera"])}getMainViewSize(){return A.get(this.attributes,["mainViewSize"])}setMainViewCamera(t){this.context.safeSetAttributes({mainViewCamera:H({},t)})}setMainViewSize(t){this.context.safeSetAttributes({mainViewSize:H({},t)})}setMainViewCameraAndSize(t,i){this.context.safeSetAttributes({mainViewCamera:H({},t),mainViewSize:H({},i)})}updateCursor(t,i){A.get(this.attributes,["cursors"])||this.context.safeUpdateAttributes(["cursors"],{}),A.get(this.attributes,["cursors",t])||this.context.safeUpdateAttributes(["cursors",t],{}),this.context.safeUpdateAttributes(["cursors",t,"position"],i)}updateCursorState(t,i){A.get(this.attributes,["cursors",t])||this.context.safeUpdateAttributes(["cursors",t],{}),this.context.safeUpdateAttributes(["cursors",t,"cursorState"],i)}getCursorState(t){return A.get(this.attributes,["cursors",t,"cursorState"])}cleanCursor(t){this.context.safeUpdateAttributes(["cursors",t],void 0)}setMainViewFocusPath(t){const i=this.getMainViewScenePath();i&&gi(t,i)}}const Fg=new Hg({getAttributes:()=>{throw new Error("getAttributes not implemented")},safeSetAttributes:()=>{throw new Error("safeSetAttributes not implemented")},safeUpdateAttributes:()=>{throw new Error("safeUpdateAttributes not implemented")}});class La{constructor(t,i,n,r){var s;this.params=t,this.manager=i,this.boxManager=this.manager.boxManager,this.appProxies=this.manager.appProxies,this.viewManager=this.manager.viewManager,this.store=this.manager.store,this.uid=this.manager.uid,this.status="normal",this.sideEffectManager=new Re.SideEffectManager,this.valManager=new M.ValManager,this.fullPath$=this.valManager.attach(new M.Val(void 0)),this.camera$=this.valManager.attach(new M.Val(void 0)),this.size$=this.valManager.attach(new M.Val(void 0)),this.box$=this.valManager.attach(new M.Val(void 0)),this.view$=this.valManager.attach(new M.Val(void 0)),this.syncCamera$=this.valManager.attach(new M.Val(!0)),this.whiteBoardViewCreated$=this.valManager.attach(new M.Val(!1)),this.fireMemberStateChange=()=>{this.manager.room&&this.onMemberStateChange(this.manager.room.state.memberState)},this.onMemberStateChange=o=>{var l,u;o.currentApplianceName==="clicker"?(l=this.appContext)!=null&&l._viewWrapper&&(this.appContext._viewWrapper.style.pointerEvents="none"):(u=this.appContext)!=null&&u._viewWrapper&&(this.appContext._viewWrapper.style.pointerEvents="auto")},this.computedInitialRect=o=>{var l;const a=(l=this.manager.boxManager)==null?void 0:l.stageRect;if(a){const{width:u,height:h}=a,p=o.height/o.width;return h<480?{width:480/p,height:480}:{width:u*.65,height:h*.65}}},this.getAppInitState=o=>{var C,E;const a=this.store.getAppState(o);if(!a)return;const l=this.store.focus,u=(C=this.attributes)==null?void 0:C.maximized,h=(E=this.attributes)==null?void 0:E.minimized;let p={maximized:u,minimized:h,id:o};const w=A.omitBy(a,A.isUndefined);return l===o&&(p=ft(H({},p),{focus:!0})),Object.assign(p,w)},this.appAttributesUpdateListener=o=>{this.sideEffectManager.add(()=>[this.manager.refresher.add(o,()=>I.autorun(()=>{const a=this.manager.attributes[o];a&&this.appEmitter.emit("attributesUpdate",a)})),this.manager.refresher.add(this.stateKey,()=>I.autorun(()=>{var l,u,h;const a=(l=this.appAttributes)==null?void 0:l.state;(a==null?void 0:a.zIndex)>0&&a.zIndex!==((u=this.box)==null?void 0:u.zIndex)&&((h=this.boxManager)==null||h.setZIndex(o,a.zIndex))})),this.manager.refresher.add(`${o}-fullPath`,()=>I.autorun(()=>{var l;const a=(l=this.appAttributes)==null?void 0:l.fullPath;this.setFocusScenePathHandler(a),this.fullPath$.value!==a&&(this.notifyPageStateChange(),this.fullPath$.setValue(a))}))])},this.setFocusScenePathHandler=A.debounce(o=>{var a;this.view&&o&&o!==((a=this.view)==null?void 0:a.focusScenePath)&&gi(this.view,o)},50),this.notifyPageStateChange=A.debounce(()=>{this.pageState&&this.appEmitter.emit("pageStateChange",this.pageState)},50),this.storeCamera=o=>{this.store.updateAppAttributes(this.id,re.Camera,o)},this.storeSize=o=>{this.store.updateAppAttributes(this.id,re.Size,o)},this.updateSize=(o,a)=>{const l={id:this.manager.uid,width:o,height:a};this.store.updateAppAttributes(this.id,re.Size,l),this.size$.setValue(l)},this.moveCamera=o=>{if(!this.camera$.value)return;const a=ft(H(H({},this.camera$.value),o),{id:this.uid});this.storeCamera(a),this.camera$.setValue(a)},this.addCameraReaction=()=>{this.sideEffectManager.add(()=>this.manager.refresher.add(`${this.id}-camera`,()=>I.reaction(()=>{var o;return(o=this.appAttributes)==null?void 0:o.camera},o=>{if(o){const a=I.toJS(o);A.isEqual(a,this.camera$.value)||this.camera$.setValue(a)}})),"camera")},this.addSizeReaction=()=>{this.sideEffectManager.add(()=>this.manager.refresher.add(`${this.id}-size`,()=>I.reaction(()=>{var o;return(o=this.appAttributes)==null?void 0:o.size},o=>{if(o){const a=I.toJS(o);A.isEqual(a,this.size$.value)||this.size$.setValue(a)}})),"size")},this.onFocus=()=>{this.setScenePath()},this.setupDone=()=>{this.store.updateAppAttributes(this.id,"setup",!0),this.manager.dispatchInternalEvent(Z.InvokeAttributesUpdateCallback)},this.kind=t.kind,this.id=n,this.appScenePath=`/${this.id}-app-dir`,this.stateKey=`${this.id}_state`,this.appProxies.set(this.id,this),this.appEmitter=new Zt.default,this.appListener=this.makeAppEventListener(this.id),this.isAddApp=r,this.initScenes(),(s=this.params.options)!=null&&s.scenePath&&this.createView(),this.scenePath||(this.scenePath=this.appScenePath),this._pageState=new Ug({displayer:this.manager.displayer,scenePath:this.scenePath,view:this.view,notifyPageStateChange:this.notifyPageStateChange}),this.sideEffectManager.add(()=>()=>this._pageState.destroy()),this.camera$.setValue(I.toJS(this.appAttributes.camera)),this.size$.setValue(I.toJS(this.appAttributes.size)),this.addCameraReaction(),this.addSizeReaction(),this.sideEffectManager.add(()=>j.on("memberStateChange",this.onMemberStateChange)),this.sideEffectManager.add(()=>[this.syncCamera$.reaction(o=>{o||this.viewSync&&(this.viewSync.destroy(),this.viewSync=void 0,this.sideEffectManager.flush("camera"),this.sideEffectManager.flush("size"))}),this.whiteBoardViewCreated$.reaction(o=>{if(o&&this.box){if(!this.syncCamera$.value)return;M.combine([this.box$,this.view$]).subscribe(([a,l])=>{if(a&&l){if(this.camera$.value||(this.storeCamera({centerX:null,centerY:null,scale:1,id:this.uid}),this.camera$.setValue(I.toJS(this.appAttributes.camera))),!this.size$.value&&a.stageRect){const u=this.computedInitialRect(a.stageRect),h=(u==null?void 0:u.width)||a.stageRect.width,p=(u==null?void 0:u.height)||a.stageRect.height;this.storeSize({id:this.uid,width:h,height:p}),this.size$.setValue(I.toJS(this.appAttributes.size))}this.viewSync=new Sd({uid:this.uid,view$:this.view$,camera$:this.camera$,size$:this.size$,stageRect$:a._stageRect$,storeCamera:this.storeCamera,storeSize:this.storeSize}),this.sideEffectManager.add(()=>()=>{var u;return(u=this.viewSync)==null?void 0:u.destroy()}),this.whiteBoardViewCreated$.destroy()}})}}),this.manager.members$.reaction(o=>{this.appEmitter.emit("roomMembersChange",o)})])}createAppDir(){const t=this.scenePath||this.appScenePath;this._pageState.createSceneNode(t)||(ji(this.manager.room,t,[{name:"1"}]),this._pageState.createSceneNode(t),this.setSceneIndex(0)),this.scenes=mi(this.manager.displayer)[t];const n=this.createView();return this._pageState.setView(n),n}initScenes(){var i;const t=this.params.options;t&&(this.scenePath=t.scenePath,((i=this.appAttributes)==null?void 0:i.isDynamicPPT)&&this.scenePath?this.scenes=mi(this.manager.displayer)[this.scenePath]:this.scenes=t.scenes)}get view(){return this.view$.value}get viewIndex(){var t;return(t=this.view)==null?void 0:t.focusSceneIndex}get isWritable(){var t;return this.manager.canOperate&&!((t=this.box)!=null&&t.readonly)}get attributes(){return this.manager.attributes[this.id]}get appAttributes(){return this.store.getAppAttributes(this.id)}getFullScenePath(){if(this.scenePath)return A.get(this.appAttributes,[re.FullPath])||this.getFullScenePathFromScenes()}getFullScenePathFromScenes(){const t=A.get(this.appAttributes,["state","SceneIndex"],0),i=Eg(this.manager.room,this.scenePath,t);return i&&this.setFullPath(i),i}setFullPath(t){this.store.updateAppAttributes(this.id,re.FullPath,t)}async baseInsertApp(t=!1){var s;const i=this.params;if(!i.kind)throw new Error("[WindowManager]: kind require");const n=await((s=Me.appClasses.get(i.kind))==null?void 0:s()),r=Me.registered.get(i.kind);if(n)await this.setupApp(this.id,t,n,i.options,r==null?void 0:r.appOptions);else throw new Error(`[WindowManager]: app load failed ${i.kind} ${i.src}`);return j.emit("updateManagerRect"),{appId:this.id,app:n}}get box(){return this.box$.value}async setupApp(t,i,n,r,s){var a;if(zt("setupApp",t,n,r),!this.boxManager)throw new md;const o=new $g(this.manager,t,this,s);this.appContext=o;try{j.once(`${t}${Z.WindowCreated}`).then(async()=>{var p;let h;i||(h=this.getAppInitState(t),(p=this.boxManager)==null||p.updateBoxState(h)),this.appEmitter.onAny(this.appListener),this.appAttributesUpdateListener(t),this.setViewFocusScenePath(),setTimeout(async()=>{const w=await n.setup(o);this.appResult=w,Me.notifyApp(this.kind,"created",{appId:t,result:w}),this.fixMobileSize(),this.isAddApp&&this.setupDone()},cd)});const l=(a=this.boxManager)==null?void 0:a.createBox({appId:t,app:n,options:r,canOperate:this.manager.canOperate,smartPosition:this.isAddApp}),u=Me.registered.get(this.kind);u!=null&&u.contentStyles&&(l==null||l.mountUserStyles(u.contentStyles)),this.box$.setValue(l),this.isAddApp&&this.box&&(this.store.updateAppState(t,Xe.ZIndex,this.box.zIndex),this.store.updateAppState(t,Xe.Size,{width:this.box.intrinsicWidth,height:this.box.intrinsicHeight}),this.boxManager.focusBox({appId:t},!1))}catch(l){throw console.error(l),new Error(`[WindowManager]: app setup error: ${l.message}`)}}fixMobileSize(){var i,n;const t=(i=this.boxManager)==null?void 0:i.getBox(this.id);t&&(t.minimized||(n=this.boxManager)==null||n.resizeBox({appId:this.id,width:t.intrinsicWidth+.001,height:t.intrinsicHeight+.001,skipUpdate:!0}))}async onSeek(t){var n;this.appEmitter.emit("seek",t).catch(r=>{console.log(`[WindowManager]: emit seek error: ${r.message}`)});const i=this.getAppInitState(this.id);(n=this.boxManager)==null||n.updateBoxState(i)}async onReconnected(){var s;if(!Boolean(this.manager.attributes.apps[this.id])){await this.destroy(!0,!1,!0);return}this.appEmitter.emit("reconnected",void 0);const i=this.getAppInitState(this.id);await this.destroy(!0,!1,!0);const n=this.params;await new La(n,this.manager,this.id,this.isAddApp).baseInsertApp(!0),(s=this.boxManager)==null||s.updateBoxState(i)}async onRemoveScene(t){if(this.scenePath&&t.startsWith(this.scenePath+"/")){let i=this.pageState.index,n=this._pageState.getFullPath(i);n||(i=0,n=this._pageState.getFullPath(i)),n&&this.setFullPath(n),this.setViewFocusScenePath(),this.view&&(this.view.focusSceneIndex=i)}}emitAppSceneStateChange(t){this.appEmitter.emit("sceneStateChange",t)}emitAppIsWritableChange(){this.appEmitter.emit("writableChange",this.isWritable)}makeAppEventListener(t){return(i,n)=>{var r,s,o,a;if(!!this.manager.canOperate)switch(i){case"setBoxSize":{(r=this.boxManager)==null||r.resizeBox({appId:t,width:n.width,height:n.height,skipUpdate:!1});break}case"setBoxMinSize":{(s=this.boxManager)==null||s.setBoxMinSize({appId:t,minWidth:n.minwidth,minHeight:n.minheight});break}case"setBoxTitle":{(o=this.boxManager)==null||o.setBoxTitle({appId:t,title:n.title});break}case ad.destroy:{if(this.status==="destroyed")return;this.destroy(!0,!1,!0,n==null?void 0:n.error),n!=null&&n.error&&console.error(n==null?void 0:n.error);break}case"focus":{(a=this.boxManager)==null||a.focusBox({appId:this.id}),wt.emit("focus",{appId:this.id});break}}}}setScenePath(){if(!this.manager.canOperate)return;const t=this.getFullScenePath();this.manager.room&&t&&this.view&&Ln(this.manager.room,t)}setViewFocusScenePath(){if(this.status==="destroyed")return;const t=this.getFullScenePath();return t&&this.view&&gi(this.view,t),t}createView(){const t=this.viewManager.createView(this.id);return this.view$.setValue(t),this.setViewFocusScenePath(),t}get pageState(){return this._pageState.toObject()}async removeSceneByIndex(t){const i=this._pageState.getFullPath(t);if(i&&this.pageState){const n=ja(t,this.pageState);return this.setSceneIndexWithoutSync(n),this.manager.dispatchInternalEvent(Z.SetAppFocusIndex,{type:"app",appID:this.id,index:n}),setTimeout(()=>{To(this.manager.room,i,t)},100),!0}else return!1}setSceneIndexWithoutSync(t){this.view&&(this.view.focusSceneIndex=t)}setSceneIndex(t){if(this.view){this.view.focusSceneIndex=t;const i=this._pageState.getFullPath(t);i&&(this.setFullPath(i),Ln(this.manager.room,i))}}async destroy(t,i,n,r){var s;if(this.status!=="destroyed"){this.status="destroyed";try{await Me.notifyApp(this.kind,"destroy",{appId:this.id}),te.emit("appClose",{appId:this.id,kind:this.kind,error:r}),await this.appEmitter.emit("destroy",{error:r})}catch(o){console.error("[WindowManager]: notifyApp error",o.message,o.stack)}this.appEmitter.clearListeners(),this.sideEffectManager.flushAll(),j.emit(`destroy-${this.id}`,{error:r}),t&&((s=this.boxManager)==null||s.closeBox(this.id,n)),i&&(this.store.cleanAppAttributes(this.id),this.scenePath&&To(this.manager.room,this.scenePath)),this.appProxies.delete(this.id),this.viewManager.destroyView(this.id),this.manager.appStatus.delete(this.id),this.valManager.destroy()}}close(){return this.destroy(!0,!0,!1)}}class Qg{constructor(t){this.displayer=t,this.views=new Map}createView(t){const i=Cd(this.displayer);return this.views.set(t,i),i}getView(t){return this.views.get(t)}destroyView(t){const i=this.views.get(t);if(i){try{i.release()}catch{}this.views.delete(t)}}setViewScenePath(t,i){const n=this.views.get(t);n&&(n.focusScenePath=i)}destroy(){this.views.forEach(t=>{try{t.release()}catch{}}),this.views.clear()}}const Cd=e=>{const t=e.views.createView();return Zg(t),t},Zg=e=>{e.setCameraBound({maxContentMode:()=>10,minContentMode:()=>.1})};class Yg{constructor(t){this.manager=t,this.started=!1,this.mainViewIsAddListener=!1,this.store=this.manager.store,this.sideEffectManager=new Re.SideEffectManager,this.camera$=new M.Val(void 0),this.size$=new M.Val(void 0),this.view$=new M.Val(void 0),this.createViewSync=()=>{var i;this.manager.boxManager&&!this.viewSync&&(this.viewSync=new Sd({uid:this.manager.uid,view$:this.view$,camera$:this.camera$,size$:this.size$,stageRect$:(i=this.manager.boxManager)==null?void 0:i.stageRect$,viewMode$:this.manager.windowManger.viewMode$,storeCamera:this.storeCamera,storeSize:this.storeSize}))},this.startListenWritableChange=()=>{this.sideEffectManager.add(()=>j.on("writableChange",i=>{i&&this.ensureCameraAndSize()}))},this.addCameraReaction=()=>{this.manager.refresher.add(re.MainViewCamera,this.cameraReaction),this.manager.refresher.add(re.MainViewSize,this.sizeReaction)},this.storeCurrentCamera=()=>{const i=this.view.camera;this.storeCamera(H({id:this.manager.uid},i))},this.storeCurrentSize=()=>{var n;const i=(n=this.manager.boxManager)==null?void 0:n.stageRect;i&&this.storeSize({id:this.manager.uid,width:i.width,height:i.height})},this.storeCamera=i=>{this.store.setMainViewCamera(i)},this.storeSize=i=>{this.store.setMainViewSize(i)},this.cameraReaction=()=>I.reaction(()=>this.mainViewCamera,i=>{if(i){const n=I.toJS(i);A.isEqual(n,this.camera$.value)||this.camera$.setValue(n)}},{fireImmediately:!0}),this.sizeReaction=()=>I.reaction(()=>this.mainViewSize,i=>{if(i){const n=I.toJS(i);A.isEqual(n,this.size$.value)||this.size$.setValue(n)}},{fireImmediately:!0}),this.mainViewClickListener=()=>{this.mainViewClickHandler()},this.setMainViewSize=A.debounce(i=>{this.store.setMainViewSize(ft(H({},i),{id:this.manager.uid}))},50),this.onCameraOrSizeUpdated=()=>{te.emit("cameraStateChange",this.cameraState)},this.mainView=this.createMainView(),j.once("mainViewMounted").then(()=>{this.addMainViewListener(),this.start(),this.ensureCameraAndSize(),this.startListenWritableChange()}),this.sideEffectManager.add(()=>[j.on("startReconnect",()=>{cu(this.mainView)})]),this.createViewSync(),this.sideEffectManager.add(()=>j.on("focusedChange",({focused:i})=>{if(i===void 0){const n=this.store.getMainViewScenePath();n&&Ln(this.manager.room,n)}}))}ensureCameraAndSize(){var t;if(!this.mainViewCamera||!this.mainViewSize){this.manager.dispatchInternalEvent(Z.InitMainViewCamera),this.storeCamera(H({id:this.manager.uid},this.view.camera));const i=(t=this.manager.boxManager)==null?void 0:t.stageRect;i&&!this.mainViewSize&&this.storeSize({id:this.manager.uid,width:i.width,height:i.height})}}get mainViewCamera(){return this.store.getMainViewCamera()}get mainViewSize(){return this.store.getMainViewSize()}get didRelease(){return A.get(this.view,["didRelease"])}start(){this.started||(this.addCameraListener(),this.addCameraReaction(),this.started=!0)}get view(){return this.mainView}get cameraState(){return H(H({},this.view.camera),this.view.size)}createMainView(){const t=Cd(this.manager.displayer),i=this.store.getMainViewScenePath();return i&&gi(t,i),this.view$.setValue(t),t}onReconnect(){if(this.didRelease)this.rebind();else{const t=this.store.getMainViewScenePath();this.setFocusScenePath(t)}}setFocusScenePath(t){if(t)return gi(this.view,t)}rebind(){const t=this.mainView.divElement,i=this.mainView.disableCameraTransform,n=H({},this.mainView.camera);this.stop(),cu(this.mainView),this.removeMainViewListener(),this.mainView=this.createMainView(),this.mainView.disableCameraTransform=i,this.mainView.divElement=t,this.mainView.moveCamera(ft(H({},n),{animationMode:I.AnimationMode.Immediately})),this.addMainViewListener(),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 t;!this.manager.canOperate||(this.store.cleanFocus(),(t=this.manager.boxManager)==null||t.blurAllBox())}addCameraListener(){this.view.callbacks.on("onCameraUpdated",this.onCameraOrSizeUpdated),this.view.callbacks.on("onSizeUpdated",this.onCameraOrSizeUpdated)}removeCameraListener(){this.view.callbacks.off("onCameraUpdated",this.onCameraOrSizeUpdated),this.view.callbacks.off("onSizeUpdated",this.onCameraOrSizeUpdated)}stop(){this.removeCameraListener(),this.manager.refresher.remove(re.MainViewCamera),this.manager.refresher.remove(re.MainViewSize),this.started=!1}destroy(){this.camera$.destroy(),this.size$.destroy(),this.view$.destroy(),this.removeMainViewListener(),this.stop(),this.sideEffectManager.flushAll()}}class Gg{constructor(t){this.context=t,this.addRedoUndoListeners=i=>{if(i===void 0)this.addViewCallbacks(this.context.mainView(),this.onCanRedoStepsUpdate,this.onCanUndoStepsUpdate);else{const n=this.context.getAppProxy(i);n&&n.view&&this.addViewCallbacks(n.view,this.onCanRedoStepsUpdate,this.onCanUndoStepsUpdate)}},this.addViewCallbacks=(i,n,r)=>{n(i.canRedoSteps),r(i.canUndoSteps),i.callbacks.on("onCanRedoStepsUpdate",n),i.callbacks.on("onCanUndoStepsUpdate",r)},this.disposeViewCallbacks=i=>{i.callbacks.off("onCanRedoStepsUpdate",this.onCanRedoStepsUpdate),i.callbacks.off("onCanUndoStepsUpdate",this.onCanUndoStepsUpdate)},this.onCanRedoStepsUpdate=i=>{te.emit("canRedoStepsChange",i)},this.onCanUndoStepsUpdate=i=>{te.emit("canUndoStepsChange",i)},this.disposePrevFocusViewRedoUndoListeners=i=>{let n;if(i===void 0)n=this.context.mainView();else{const r=this.context.getAppProxy(i);r&&r.view&&(n=r.view)}n&&this.disposeViewCallbacks(n)},j.on("focusedChange",i=>{this.disposePrevFocusViewRedoUndoListeners(i.prev),setTimeout(()=>{this.addRedoUndoListeners(i.focused)},0)}),j.on("rootDirRemoved",()=>{this.disposePrevFocusViewRedoUndoListeners(t.focus()),this.addRedoUndoListeners(t.focus())}),this.addRedoUndoListeners(t.focus())}destroy(){this.disposePrevFocusViewRedoUndoListeners(this.context.focus())}}class Xg{constructor(t){this.windowManger=t,this.appProxies=new Map,this.appStatus=new Map,this.store=Fg,this.isReplay=this.windowManger.isReplay,this.mainViewScenesLength=0,this.callbacksNode=null,this.appCreateQueue=new hg,this.sceneIndex$=new M.Val(void 0),this.focused$=new M.Val(void 0),this.members$=new M.Val([]),this.sideEffectManager=new Re.SideEffectManager,this.sceneState=null,this.rootDirRemoving=!1,this.onRemoveScenes=async i=>{var r,s;const{scenePath:n}=i;if(n===ze){await this.onRootDirRemoved(),this.dispatchInternalEvent(Z.RootDirRemoved);return}if(zg(n)){let o=this.mainView.focusSceneIndex||0,a=(r=this.callbacksNode)==null?void 0:r.scenes[o];a||(o=0,a=(s=this.callbacksNode)==null?void 0:s.scenes[o]),a&&await this.setMainViewScenePath(`${ze}${a}`),await this.setMainViewSceneIndex(o)}else this.appProxies.forEach(o=>{o.onRemoveScene(n)})},this.onReadonlyChanged=()=>{this.appProxies.forEach(i=>{i.emitAppIsWritableChange()})},this.onPlayerSeekStart=async()=>{await this.closeAll()},this.onPlayerSeekDone=async i=>{await this.attributesUpdateCallback(this.attributes.apps),this.appProxies.forEach(n=>{n.onSeek(i)})},this.createRootDirScenesCallback=()=>{let i=!1;this.callbacksNode&&(this.callbacksNode.dispose(),i=!0),this.callbacksNode=this.displayer.createScenesCallback(ze,{onAddScene:this.onSceneChange,onRemoveScene:async(n,r)=>{await this.onSceneChange(n),j.emit("rootDirSceneRemoved",r)}}),this.callbacksNode&&(this.updateSceneState(this.callbacksNode),this.mainViewScenesLength=this.callbacksNode.scenes.length,i&&this.emitMainViewScenesChange(this.callbacksNode.scenes.length))},this.removeSceneByIndex=async i=>{var s;const n=ja(i,this.windowManger.pageState);this.setSceneIndexWithoutSync(n),this.dispatchInternalEvent(Z.SetAppFocusIndex,{type:"main",index:n});const r=(s=this.callbacksNode)==null?void 0:s.scenes[i];return setTimeout(()=>{r&&To(this.room,`${ze}${r}`,i)},100),new Promise((o,a)=>{j.once("rootDirSceneRemoved").then(l=>{l===r&&o(!0)}).catch(l=>{console.log(`[WindowManager]: removePage error: ${l}`),a(!1)})})},this.setSceneIndexWithoutSync=i=>{var r;const n=(r=this.callbacksNode)==null?void 0:r.scenes[i];n&&this.mainViewProxy.setFocusScenePath(`${ze}${n}`)},this.onSceneChange=i=>(this.mainViewScenesLength=i.scenes.length,this.updateSceneState(i),this.emitMainViewScenesChange(this.mainViewScenesLength)),this.emitMainViewScenesChange=i=>Promise.all([te.emit("mainViewScenesLengthChange",i),j.emit("changePageState")]),this.updateSceneState=i=>{const n=this.store.getMainViewSceneIndex()||0;let r=i.scenes[n];r||(r=i.scenes[this.mainView.focusSceneIndex||0]),this.sceneState={scenePath:`${ze}${r}`,contextPath:i.path,index:n,scenes:i.scenes.map(s=>({name:s})),sceneName:r},te.emit("sceneStateChange",this.sceneState)},this.onBoxMove=i=>{this.dispatchInternalEvent(Z.AppMove,i),this.store.updateAppState(i.appId,Xe.Position,{x:i.x,y:i.y})},this.onBoxResize=i=>{i.width&&i.height&&(this.dispatchInternalEvent(Z.AppResize,i),this.store.updateAppState(i.appId,Xe.Size,{width:i.width,height:i.height}))},this.onBoxFocus=i=>{this.windowManger.safeSetAttributes({focus:i.appId})},this.onBoxClose=i=>{const n=this.appProxies.get(i.appId);n&&n.destroy(!1,!0,!0,i.error)},this.onBoxStateChange=i=>{this.dispatchInternalEvent(Z.AppBoxStateChange,i)},this.addAppsChangeListener=()=>{this.refresher.add("apps",()=>yd(()=>this.attributes.apps,()=>{this.attributesUpdateCallback(this.attributes.apps)}))},this.addAppCloseListener=()=>{var i;(i=this.refresher)==null||i.add("appsClose",()=>Lg(this.attributes.apps,()=>{this.onAppDelete(this.attributes.apps)}))},this.onMainViewIndexChange=i=>{i!==void 0&&this.sceneIndex$.value!==i&&(te.emit("mainViewSceneIndexChange",i),j.emit("changePageState"),this.callbacksNode&&this.updateSceneState(this.callbacksNode),this.sceneIndex$.setValue(i))},this.onFocusChange=i=>{var n;this.focused$.value!==i&&(te.emit("focusedChange",i),j.emit("focusedChange",{focused:i,prev:this.focused$.value}),this.focused$.setValue(i),i!==void 0&&((n=this.boxManager)==null||n.focusBox({appId:i}),setTimeout(()=>{const r=this.appProxies.get(i);r&&(r.onFocus(),Me.notifyApp(r.kind,"focus",{appId:i}))},0)))},this.attributesUpdateCallback=A.debounce(i=>this._attributesUpdateCallback(i),100),this.onRegisteredChange=i=>{!i||Object.entries(i).forEach(([n,r])=>{Me.appClasses.has(n)||Me.register({kind:n,src:r.src,name:r.name})})},this.onMinimized=i=>{var n,r;((n=this.boxManager)==null?void 0:n.minimized)!==i&&(i===!0&&((r=this.boxManager)==null||r.blurAllBox()),setTimeout(()=>{var s;(s=this.boxManager)==null||s.setMinimized(Boolean(i))},0))},this.onAppDelete=async i=>{const n=Object.keys(i);for(const[r,s]of this.appProxies.entries())n.includes(r)||await s.destroy(!0,!1,!0)},this.closeAll=async()=>{for(const[i,n]of this.appProxies.entries())await n.destroy(!0,!1,!0)},this.displayerStateListener=i=>{const n=i.sceneState;if(n){const r=n.scenePath;this.appProxies.forEach(s=>{s.scenePath&&r.startsWith(s.scenePath)&&(s.emitAppSceneStateChange(n),s.setFullPath(r))})}this.appProxies.forEach(r=>{r.appEmitter.emit("roomStateChange",i)}),i.roomMembers&&this.members$.setValue(fu(i.roomMembers)),j.emit("observerIdChange",this.displayer.observerId),i.memberState&&j.emit("memberStateChange",I.toJS(i.memberState))},this.displayerWritableListener=i=>{var s,o;const n=!i,r=this.windowManger.readonly===void 0||!this.windowManger.readonly;this.windowManger.readonly===void 0?(s=this.boxManager)==null||s.setReadonly(i):(o=this.boxManager)==null||o.setReadonly(!(n&&r)),this.appProxies.forEach(a=>{a.emitAppIsWritableChange()}),n&&this.room&&this.room.disableSerialization===!0&&(this.room.disableSerialization=!1),j.emit("writableChange",n)},this.updateSceneIndex=()=>{const i=this.store.getMainViewScenePath(),n=Js(i),r=mi(this.displayer)[n];if(r.length){const s=i.replace(n,"").replace("/",""),o=r.findIndex(a=>a.name===s);A.isInteger(o)&&o>=0&&this.safeSetAttributes({_mainSceneIndex:o})}},this.updateRootDirRemoving=i=>{this.rootDirRemoving=i},this.displayer=t.displayer,this.store.setContext({getAttributes:()=>this.attributes,safeSetAttributes:i=>this.safeSetAttributes(i),safeUpdateAttributes:(i,n)=>this.safeUpdateAttributes(i,n)}),this.mainViewProxy=new Yg(this),this.viewManager=new Qg(this.displayer),this.appListeners=new Dg(this),this.displayer.callbacks.on(this.eventName,this.displayerStateListener),this.appListeners.addListeners(),this.refresher=Uf,this.refresher.setRoom(this.room),this.refresher.setContext({emitter:j}),this.sideEffectManager.add(()=>()=>{var i,n,r;this.appCreateQueue.destroy(),this.mainViewProxy.destroy(),(i=this.refresher)==null||i.destroy(),this.viewManager.destroy(),(n=this.boxManager)==null||n.destroy(),(r=this.callbacksNode)==null||r.dispose()}),j.once("onCreated").then(()=>this.onCreated()),j.on("onReconnected",()=>this.onReconnected()),I.isPlayer(this.displayer)&&(j.on("seekStart",this.onPlayerSeekStart),j.on("seek",this.onPlayerSeekDone)),j.on("removeScenes",this.onRemoveScenes),j.on("setReadonly",this.onReadonlyChanged),this.createRootDirScenesCallback(),Me.setSyncRegisterApp(i=>{this.safeUpdateAttributes([re.Registered,i.kind],i)}),this.members$.setValue(fu(this.displayer.state.roomMembers))}async onRootDirRemoved(t=!0){await this.setMainViewScenePath(ud),this.createRootDirScenesCallback();for(const[i,n]of this.appProxies.entries())n.view&&await this.closeApp(i,t);this.mainViewProxy.rebind(),await j.emit("rootDirRemoved"),this.updateRootDirRemoving(!1)}get eventName(){return I.isRoom(this.displayer)?"onRoomStateChanged":"onPlayerStateChanged"}get attributes(){return this.windowManger.attributes}get canOperate(){return this.windowManger.canOperate}get room(){return I.isRoom(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 t;return((t=this.room)==null?void 0:t.uid)||""}getMainViewSceneDir(){const t=this.store.getMainViewScenePath();if(t)return Js(t);throw new Error("[WindowManager]: mainViewSceneDir not found")}async onCreated(){var t;if(await this.attributesUpdateCallback(this.attributes.apps),j.emit("updateManagerRect"),wt.on("move",this.onBoxMove),wt.on("resize",this.onBoxResize),wt.on("focus",this.onBoxFocus),wt.on("close",this.onBoxClose),wt.on("boxStateChange",this.onBoxStateChange),this.addAppsChangeListener(),this.addAppCloseListener(),this.refresher.add("maximized",()=>I.autorun(()=>{var n;const i=this.attributes.maximized;(n=this.boxManager)==null||n.setMaximized(Boolean(i))})),this.refresher.add("minimized",()=>I.autorun(()=>{const i=this.attributes.minimized;this.onMinimized(i)})),this.refresher.add("mainViewIndex",()=>I.autorun(()=>{const i=A.get(this.attributes,"_mainSceneIndex");this.onMainViewIndexChange(i)})),this.refresher.add("focusedChange",()=>I.autorun(()=>{const i=A.get(this.attributes,"focus");this.onFocusChange(i)})),this.refresher.add("registeredChange",()=>I.autorun(()=>{const i=A.get(this.attributes,re.Registered);this.onRegisteredChange(i)})),!this.attributes.apps||Object.keys(this.attributes.apps).length===0){const i=this.store.getMainViewScenePath();if(!i)return;this.resetScenePath(i)}this.displayerWritableListener(!((t=this.room)!=null&&t.isWritable)),this.displayer.callbacks.on("onEnableWriteNowChanged",this.displayerWritableListener),this.focused$.setValue(this.attributes.focus),this.sideEffectManager.add(()=>{const i=new Gg({mainView:()=>this.mainViewProxy.view,focus:()=>this.attributes.focus,getAppProxy:n=>this.appProxies.get(n)});return()=>i.destroy()})}async _attributesUpdateCallback(t){if(t&&ge.container){const i=Object.keys(t);i.length===0&&this.appCreateQueue.emitReady();const n=i.map(r=>t[r].setup?{id:r,createdAt:t[r].createdAt}:{});for(const{id:r}of A.orderBy(n,"createdAt","asc"))if(r&&!this.appProxies.has(r)&&!this.appStatus.has(r)){const s=t[r];try{if(!this.attributes[r])throw new Error("appAttributes is undefined");this.appCreateQueue.push(()=>(this.appStatus.set(r,Eo.StartCreate),this.baseInsertApp({kind:s.kind,options:s.options,isDynamicPPT:s.isDynamicPPT},r,!1))),this.focusByAttributes(t)}catch(o){console.warn("[WindowManager]: Insert App Error",o)}}}}refresh(){this.attributesUpdateCallback(this.attributes.apps)}setBoxManager(t){this.boxManager=t,this.mainViewProxy.createViewSync()}resetMaximized(){var t;(t=this.boxManager)==null||t.setMaximized(Boolean(this.store.getMaximized()))}resetMinimized(){var t;(t=this.boxManager)==null||t.setMinimized(Boolean(this.store.getMinimized()))}bindMainView(t,i){const n=this.mainViewProxy.view;n.disableCameraTransform=i,Fr(30).then(()=>{n.divElement=t,j.emit("mainViewMounted")}),n.focusScenePath||this.setMainViewFocusPath()}setMainViewFocusPath(t){var n;const i=t||this.store.getMainViewScenePath();if(i)return gi(this.mainView,i),((n=this.mainView)==null?void 0:n.focusScenePath)===i}resetScenePath(t){this.displayer.state.sceneState.scenePath!==t&&Ln(this.room,t)}async addApp(t,i){zt("addApp",t);const{appId:n,needFocus:r}=await this.beforeAddApp(t,i),s=await this.baseInsertApp(t,n,!0,r);return this.afterAddApp(s),s==null?void 0:s.id}async beforeAddApp(t,i){var o,a;const n=await Ag(t.kind);this.appStatus.set(n,Eo.StartCreate);const r=(o=t.attributes)!=null?o:{};this.safeUpdateAttributes([n],r),this.store.setupAppAttributes(t,n,i);const s=!((a=this.boxManager)!=null&&a.minimized);return s&&this.store.setAppFocus(n,!0),{appId:n,needFocus:s}}afterAddApp(t){var i,n;if(t&&t.box){const r=t.box;wt.emit("move",{appId:t.id,x:r==null?void 0:r.intrinsicX,y:r==null?void 0:r.intrinsicY}),this.store.updateAppState(t.id,Xe.ZIndex,r.zIndex)}(i=this.boxManager)!=null&&i.minimized&&((n=this.boxManager)==null||n.setMinimized(!1,!1))}async closeApp(t,i=!0){const n=this.appProxies.get(t);n&&n.destroy(!0,i,!1)}async baseInsertApp(t,i,n,r){if(this.appProxies.has(i)){console.warn("[WindowManager]: app duplicate exists and cannot be created again");return}const s=new La(t,this,i,n);if(s)return await s.baseInsertApp(r),this.appStatus.delete(i),s;throw this.appStatus.delete(i),new Error("[WindowManger]: initialize AppProxy failed")}safeSetAttributes(t){this.windowManger.safeSetAttributes(t)}safeUpdateAttributes(t,i){this.windowManger.safeUpdateAttributes(t,i)}async setMainViewScenePath(t){if(this.room){const i=this.displayer.scenePathType(t);if(Js(t)!==ze)throw new Error('[WindowManager]: main view scenePath must in root dir "/"');if(i===I.ScenePathType.None)throw new Error(`[WindowManager]: ${t} not valid scene`);if(i===I.ScenePathType.Page)await this._setMainViewScenePath(t);else if(i===I.ScenePathType.Dir){const r=kg(this.displayer,t);r&&await this._setMainViewScenePath(r)}}}async _setMainViewScenePath(t){this.setMainViewFocusPath(t)&&(this.safeSetAttributes({_mainScenePath:t}),this.store.setMainViewFocusPath(this.mainView),this.updateSceneIndex(),this.dispatchSetMainViewScenePath(t))}async setMainViewSceneIndex(t){var i;if(this.room){if(this.store.getMainViewSceneIndex()===t)return;const n=(i=this.callbacksNode)==null?void 0:i.scenes[t],r=`${ze}${n}`;if(n)this.setMainViewFocusPath(r)&&(this.store.setMainViewScenePath(r),this.safeSetAttributes({_mainSceneIndex:t}),this.dispatchSetMainViewScenePath(r));else throw new Error(`[WindowManager]: ${t} not valid index`)}}dispatchSetMainViewScenePath(t){this.dispatchInternalEvent(Z.SetMainViewScenePath,{nextScenePath:t}),Ln(this.room,t)}getAppInitPath(t){var n;const i=this.store.getAppAttributes(t);if(i)return(n=i==null?void 0:i.options)==null?void 0:n.scenePath}safeDispatchMagixEvent(t,i){this.canOperate&&this.displayer.dispatchMagixEvent(t,i)}focusByAttributes(t){var i;if(t&&Object.keys(t).length===((i=this.boxManager)==null?void 0:i.boxSize)){const n=this.store.focus;n&&this.boxManager.focusBox({appId:n})}}async onReconnected(){this.attributesUpdateCallback(this.attributes.apps);const i=Array.from(this.appProxies.values()).map(n=>n.onReconnected());this.mainViewProxy.onReconnect(),await Promise.all(i)}notifyContainerRectUpdate(t){this.appProxies.forEach(i=>{i.appEmitter.emit("containerRectUpdate",t)})}dispatchInternalEvent(t,i){this.safeDispatchMagixEvent(Ao,{eventName:t,payload:i})}destroy(){this.displayer.callbacks.off(this.eventName,this.displayerStateListener),this.displayer.callbacks.off("onEnableWriteNowChanged",this.displayerWritableListener),this.appListeners.removeListeners(),wt.clearListeners(),j.clearListeners(),this.appProxies.size&&this.appProxies.forEach(t=>{t.destroy(!0,!1,!0)}),te.clearListeners(),this.sideEffectManager.flushAll(),this.sceneIndex$.destroy(),this.focused$.destroy(),this.members$.destroy()}}/*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
5
5
  Permission to use, copy, modify, and/or distribute this software for any
@@ -12,7 +12,7 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */var Se=function(){return Se=Object.assign||function(t){for(var i,n=1,r=arguments.length;n<r;n++){i=arguments[n];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s])}return t},Se.apply(this,arguments)};function La(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(i[n[r]]=e[n[r]]);return i}var qs=0,bd=typeof window!="undefined"&&window.requestAnimationFrame!==void 0?function(e){return window.requestAnimationFrame(e)}:function(e){var t=Date.now(),i=Math.max(0,16.7-(t-qs));qs=t+i,setTimeout(function(){return e(qs)},i)},Jg=function(e){var t=[],i=[],n=0,r=!1,s=0,o=new WeakSet,a=new WeakSet,l={cancel:function(u){var h=i.indexOf(u);o.add(u),h!==-1&&i.splice(h,1)},process:function(u){var h;if(r=!0,h=[i,t],t=h[0],i=h[1],i.length=0,n=t.length,n){var p;for(s=0;s<n;s++)p=t[s],p(u),a.has(p)===!0&&!o.has(p)&&(l.schedule(p),e(!0))}r=!1},schedule:function(u,h,p){h===void 0&&(h=!1),p===void 0&&(p=!1);var w=p&&r,S=w?t:i;o.delete(u),h&&a.add(u),S.indexOf(u)===-1&&(S.push(u),w&&(n=t.length))}};return l},Kg=40,mu=1/60*1e3,Ar=!0,Ln=!1,ko=!1,fn={delta:0,timestamp:0},Ra=["read","update","preRender","render","postRender"],qg=function(e){return Ln=e},Md=Ra.reduce(function(e,t){return e[t]=Jg(qg),e},{}),em=Ra.reduce(function(e,t){var i=Md[t];return e[t]=function(n,r,s){return r===void 0&&(r=!1),s===void 0&&(s=!1),Ln||im(),i.schedule(n,r,s),n},e},{}),tm=function(e){return Md[e].process(fn)},Id=function(e){Ln=!1,fn.delta=Ar?mu:Math.max(Math.min(e-fn.timestamp,Kg),1),Ar||(mu=fn.delta),fn.timestamp=e,ko=!0,Ra.forEach(tm),ko=!1,Ln&&(Ar=!1,bd(Id))},im=function(){Ln=!0,Ar=!0,ko||bd(Id)},Ad=function(e,t){return function(i){return Math.max(Math.min(i,t),e)}},Er=function(e){return e%1?Number(e.toFixed(5)):e},Ed=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i,As={test:function(e){return typeof e=="number"},parse:parseFloat,transform:function(e){return e}},yn=Se(Se({},As),{transform:Ad(0,1)}),lr=Se(Se({},As),{default:1}),Ba=function(e){return{test:function(t){return typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1},parse:parseFloat,transform:function(t){return""+t+e}}},ti=Ba("deg"),xn=Ba("%"),L=Ba("px"),vu=Se(Se({},xn),{parse:function(e){return xn.parse(e)/100},transform:function(e){return xn.transform(e*100)}}),nm=function(e){return e.substring(e.indexOf("(")+1,e.lastIndexOf(")"))},rm=Ad(0,255),No=function(e){return e.red!==void 0},Po=function(e){return e.hue!==void 0};function sm(e){return nm(e).replace(/(,|\/)/g," ").split(/ \s*/)}var Td=function(e){return function(t){if(typeof t!="string")return t;for(var i={},n=sm(t),r=0;r<4;r++)i[e[r]]=n[r]!==void 0?parseFloat(n[r]):1;return i}},om=function(e){var t=e.red,i=e.green,n=e.blue,r=e.alpha,s=r===void 0?1:r;return"rgba("+t+", "+i+", "+n+", "+s+")"},am=function(e){var t=e.hue,i=e.saturation,n=e.lightness,r=e.alpha,s=r===void 0?1:r;return"hsla("+t+", "+i+", "+n+", "+s+")"},eo=Se(Se({},As),{transform:function(e){return Math.round(rm(e))}});function Oa(e,t){return e.startsWith(t)&&Ed.test(e)}var Tr={test:function(e){return typeof e=="string"?Oa(e,"rgb"):No(e)},parse:Td(["red","green","blue","alpha"]),transform:function(e){var t=e.red,i=e.green,n=e.blue,r=e.alpha,s=r===void 0?1:r;return om({red:eo.transform(t),green:eo.transform(i),blue:eo.transform(n),alpha:Er(yn.transform(s))})}},to={test:function(e){return typeof e=="string"?Oa(e,"hsl"):Po(e)},parse:Td(["hue","saturation","lightness","alpha"]),transform:function(e){var t=e.hue,i=e.saturation,n=e.lightness,r=e.alpha,s=r===void 0?1:r;return am({hue:Math.round(t),saturation:xn.transform(Er(i)),lightness:xn.transform(Er(n)),alpha:Er(yn.transform(s))})}},wu=Se(Se({},Tr),{test:function(e){return typeof e=="string"&&Oa(e,"#")},parse:function(e){var t="",i="",n="";return e.length>4?(t=e.substr(1,2),i=e.substr(3,2),n=e.substr(5,2)):(t=e.substr(1,1),i=e.substr(2,1),n=e.substr(3,1),t+=t,i+=i,n+=n),{red:parseInt(t,16),green:parseInt(i,16),blue:parseInt(n,16),alpha:1}}}),tt={test:function(e){return typeof e=="string"&&Ed.test(e)||No(e)||Po(e)},parse:function(e){return Tr.test(e)?Tr.parse(e):to.test(e)?to.parse(e):wu.test(e)?wu.parse(e):e},transform:function(e){return No(e)?Tr.transform(e):Po(e)?to.transform(e):e}},_a=function(e){var t=e.onRead,i=e.onRender,n=e.uncachedValues,r=n===void 0?new Set:n,s=e.useCache,o=s===void 0?!0:s;return function(a){a===void 0&&(a={});var l=La(a,[]),u={},h=[],p=!1;function w(I,E){I.startsWith("--")&&(l.hasCSSVariable=!0);var c=u[I];u[I]=E,u[I]!==c&&(h.indexOf(I)===-1&&h.push(I),p||(p=!0,em.render(S.render)))}var S={get:function(I,E){E===void 0&&(E=!1);var c=!E&&o&&!r.has(I)&&u[I]!==void 0;return c?u[I]:t(I,l)},set:function(I,E){if(typeof I=="string")w(I,E);else for(var c in I)w(c,I[c]);return this},render:function(I){return I===void 0&&(I=!1),(p||I===!0)&&(i(u,l,h),p=!1,h.length=0),this}};return S}},lm=/([a-z])([A-Z])/g,um="$1-$2",Es=function(e){return e.replace(lm,um).toLowerCase()},kd=new Map,$a=new Map,Nd=["Webkit","Moz","O","ms",""],cm=Nd.length,dm=typeof document!="undefined",io,Pd=function(e,t){return $a.set(e,Es(t))},hm=function(e){io=io||document.createElement("div");for(var t=0;t<cm;t++){var i=Nd[t],n=i==="",r=n?e:i+e.charAt(0).toUpperCase()+e.slice(1);if(r in io.style||n){if(n&&e==="clipPath"&&$a.has(e))return;kd.set(e,r),Pd(e,(n?"":"-")+Es(r))}}},pm=function(e){return Pd(e,e)},zd=function(e,t){t===void 0&&(t=!1);var i=t?$a:kd;return i.has(e)||(dm?hm(e):pm(e)),i.get(e)||e},fm=["","X","Y","Z"],gm=["translate","scale","rotate","skew","transformPerspective"],zo=gm.reduce(function(e,t){return fm.reduce(function(i,n){return i.push(t+n),i},e)},["x","y","z"]),mm=zo.reduce(function(e,t){return e[t]=!0,e},{});function Ua(e){return mm[e]===!0}function vm(e,t){return zo.indexOf(e)-zo.indexOf(t)}var wm=new Set(["originX","originY","originZ"]);function ym(e){return wm.has(e)}var yu=Se(Se({},As),{transform:Math.round}),xm={color:tt,backgroundColor:tt,outlineColor:tt,fill:tt,stroke:tt,borderColor:tt,borderTopColor:tt,borderRightColor:tt,borderBottomColor:tt,borderLeftColor:tt,borderWidth:L,borderTopWidth:L,borderRightWidth:L,borderBottomWidth:L,borderLeftWidth:L,borderRadius:L,radius:L,borderTopLeftRadius:L,borderTopRightRadius:L,borderBottomRightRadius:L,borderBottomLeftRadius:L,width:L,maxWidth:L,height:L,maxHeight:L,size:L,top:L,right:L,bottom:L,left:L,padding:L,paddingTop:L,paddingRight:L,paddingBottom:L,paddingLeft:L,margin:L,marginTop:L,marginRight:L,marginBottom:L,marginLeft:L,rotate:ti,rotateX:ti,rotateY:ti,rotateZ:ti,scale:lr,scaleX:lr,scaleY:lr,scaleZ:lr,skew:ti,skewX:ti,skewY:ti,distance:L,translateX:L,translateY:L,translateZ:L,x:L,y:L,z:L,perspective:L,opacity:yn,originX:vu,originY:vu,originZ:L,zIndex:yu,fillOpacity:yn,strokeOpacity:yn,numOctaves:yu},Wa=function(e){return xm[e]},Sm=function(e,t){return t&&typeof e=="number"?t.transform(e):e},Sn="scrollLeft",Cn="scrollTop",Dd=new Set([Sn,Cn]),Cm=new Set([Sn,Cn,"transform"]),bm={x:"translateX",y:"translateY",z:"translateZ"};function jd(e){return typeof e=="function"}function Mm(e,t,i,n,r,s){s===void 0&&(s=!0);var o="",a=!1;i.sort(vm);for(var l=i.length,u=0;u<l;u++){var h=i[u];o+=(bm[h]||h)+"("+t[h]+") ",a=h==="z"?!0:a}return!a&&r?o+="translateZ(0)":o=o.trim(),jd(e.transform)?o=e.transform(t,n?"":o):s&&n&&(o="none"),o}function Im(e,t,i,n,r,s,o,a){t===void 0&&(t=!0),i===void 0&&(i={}),n===void 0&&(n={}),r===void 0&&(r={}),s===void 0&&(s=[]),o===void 0&&(o=!1),a===void 0&&(a=!0);var l=!0,u=!1,h=!1;for(var p in e){var w=e[p],S=Wa(p),I=Sm(w,S);Ua(p)?(u=!0,n[p]=I,s.push(p),l&&(S.default&&w!==S.default||!S.default&&w!==0)&&(l=!1)):ym(p)?(r[p]=I,h=!0):(!Cm.has(p)||!jd(I))&&(i[zd(p,o)]=I)}return(u||typeof e.transform=="function")&&(i.transform=Mm(e,n,s,l,t,a)),h&&(i.transformOrigin=(r.originX||"50%")+" "+(r.originY||"50%")+" "+(r.originZ||0)),i}function Ha(e){var t=e===void 0?{}:e,i=t.enableHardwareAcceleration,n=i===void 0?!0:i,r=t.isDashCase,s=r===void 0?!0:r,o=t.allowTransformNone,a=o===void 0?!0:o,l={},u={},h={},p=[];return function(w){return p.length=0,Im(w,n,l,u,h,p,s,a),l}}function Am(e,t){var i=t.element,n=t.preparseOutput,r=Wa(e);if(Ua(e))return r&&r.default||0;if(Dd.has(e))return i[e];var s=window.getComputedStyle(i,null).getPropertyValue(zd(e,!0))||0;return n&&r&&r.test(s)&&r.parse?r.parse(s):s}function Em(e,t,i){var n=t.element,r=t.buildStyles,s=t.hasCSSVariable;if(Object.assign(n.style,r(e)),s)for(var o=i.length,a=0;a<o;a++){var l=i[a];l.startsWith("--")&&n.style.setProperty(l,e[l])}i.indexOf(Sn)!==-1&&(n[Sn]=e[Sn]),i.indexOf(Cn)!==-1&&(n[Cn]=e[Cn])}var Tm=_a({onRead:Am,onRender:Em,uncachedValues:Dd});function km(e,t){t===void 0&&(t={});var i=t.enableHardwareAcceleration,n=t.allowTransformNone,r=La(t,["enableHardwareAcceleration","allowTransformNone"]);return Tm(Se({element:e,buildStyles:Ha({enableHardwareAcceleration:i,allowTransformNone:n}),preparseOutput:!0},r))}var Vd=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues"]),xu=.5,Ld=function(){return{style:{}}},no=function(e,t){return L.transform(e*t)},Nm={x:0,y:0,width:0,height:0};function Su(e,t,i){return typeof e=="string"?e:L.transform(t+i*e)}function Pm(e,t,i){return Su(t,e.x,e.width)+" "+Su(i,e.y,e.height)}var Rd={enableHardwareAcceleration:!1,isDashCase:!1};function zm(e,t,i,n,r,s){t===void 0&&(t=Nm),n===void 0&&(n=Ha(Rd)),r===void 0&&(r=Ld()),s===void 0&&(s=!0);var o=e.attrX,a=e.attrY,l=e.originX,u=e.originY,h=e.pathLength,p=e.pathSpacing,w=p===void 0?1:p,S=e.pathOffset,I=S===void 0?0:S,E=La(e,["attrX","attrY","originX","originY","pathLength","pathSpacing","pathOffset"]),c=n(E);for(var d in c)if(d==="transform")r.style.transform=c[d];else{var f=s&&!Vd.has(d)?Es(d):d;r[f]=c[d]}return(l!==void 0||u!==void 0||c.transform)&&(r.style.transformOrigin=Pm(t,l!==void 0?l:xu,u!==void 0?u:xu)),o!==void 0&&(r.x=o),a!==void 0&&(r.y=a),i!==void 0&&h!==void 0&&(r[s?"stroke-dashoffset":"strokeDashoffset"]=no(-I,i),r[s?"stroke-dasharray":"strokeDasharray"]=no(h,i)+" "+no(w,i)),r}function Dm(e,t,i){i===void 0&&(i=!0);var n=Ld(),r=Ha(Rd);return function(s){return zm(s,e,t,r,n,i)}}var jm=function(e){return typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()},Vm=function(e){try{return jm(e)}catch{return{x:0,y:0,width:0,height:0}}},Lm=function(e){return e.tagName==="path"},Rm=_a({onRead:function(e,t){var i=t.element;if(e=Vd.has(e)?e:Es(e),Ua(e)){var n=Wa(e);return n&&n.default||0}else return i.getAttribute(e)},onRender:function(e,t){var i=t.element,n=t.buildAttrs,r=n(e);for(var s in r)s==="style"?Object.assign(i.style,r.style):i.setAttribute(s,r[s])}}),Bm=function(e){var t=Vm(e),i=Lm(e)&&e.getTotalLength?e.getTotalLength():void 0;return Rm({element:e,buildAttrs:Dm(t,i)})},Om=_a({useCache:!1,onRead:function(e){return e==="scrollTop"?window.pageYOffset:window.pageXOffset},onRender:function(e){var t=e.scrollTop,i=t===void 0?0:t,n=e.scrollLeft,r=n===void 0?0:n;return window.scrollTo(r,i)}}),Do=new WeakMap,_m=function(e){return e instanceof HTMLElement||typeof e.click=="function"},$m=function(e){return e instanceof SVGElement||"ownerSVGElement"in e},Um=function(e,t){var i;return e===window?i=Om(e):_m(e)?i=km(e,t):$m(e)&&(i=Bm(e)),Do.set(e,i),i},Wm=function(e,t){return Do.has(e)?Do.get(e):Um(e,t)};function Hm(e,t){var i=typeof e=="string"?document.querySelector(e):e;return Wm(i,t)}var Ze=function(t,i,n,r){var s=n?n.call(r,t,i):void 0;if(s!==void 0)return!!s;if(t===i)return!0;if(typeof t!="object"||!t||typeof i!="object"||!i)return!1;var o=Object.keys(t),a=Object.keys(i);if(o.length!==a.length)return!1;for(var l=Object.prototype.hasOwnProperty.bind(i),u=0;u<o.length;u++){var h=o[u];if(!l(h))return!1;var p=t[h],w=i[h];if(s=n?n.call(r,p,w,h):void 0,s===!1||s===void 0&&p!==w)return!1}return!0},Fm=(()=>`.tele-fancy-scrollbar {
15
+ ***************************************************************************** */var ye=function(){return ye=Object.assign||function(t){for(var i,n=1,r=arguments.length;n<r;n++){i=arguments[n];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s])}return t},ye.apply(this,arguments)};function Va(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(i[n[r]]=e[n[r]]);return i}var qs=0,bd=typeof window!="undefined"&&window.requestAnimationFrame!==void 0?function(e){return window.requestAnimationFrame(e)}:function(e){var t=Date.now(),i=Math.max(0,16.7-(t-qs));qs=t+i,setTimeout(function(){return e(qs)},i)},Jg=function(e){var t=[],i=[],n=0,r=!1,s=0,o=new WeakSet,a=new WeakSet,l={cancel:function(u){var h=i.indexOf(u);o.add(u),h!==-1&&i.splice(h,1)},process:function(u){var h;if(r=!0,h=[i,t],t=h[0],i=h[1],i.length=0,n=t.length,n){var p;for(s=0;s<n;s++)p=t[s],p(u),a.has(p)===!0&&!o.has(p)&&(l.schedule(p),e(!0))}r=!1},schedule:function(u,h,p){h===void 0&&(h=!1),p===void 0&&(p=!1);var w=p&&r,C=w?t:i;o.delete(u),h&&a.add(u),C.indexOf(u)===-1&&(C.push(u),w&&(n=t.length))}};return l},Kg=40,mu=1/60*1e3,Ar=!0,Vn=!1,ko=!1,fn={delta:0,timestamp:0},Ra=["read","update","preRender","render","postRender"],qg=function(e){return Vn=e},Md=Ra.reduce(function(e,t){return e[t]=Jg(qg),e},{}),em=Ra.reduce(function(e,t){var i=Md[t];return e[t]=function(n,r,s){return r===void 0&&(r=!1),s===void 0&&(s=!1),Vn||im(),i.schedule(n,r,s),n},e},{}),tm=function(e){return Md[e].process(fn)},Id=function(e){Vn=!1,fn.delta=Ar?mu:Math.max(Math.min(e-fn.timestamp,Kg),1),Ar||(mu=fn.delta),fn.timestamp=e,ko=!0,Ra.forEach(tm),ko=!1,Vn&&(Ar=!1,bd(Id))},im=function(){Vn=!0,Ar=!0,ko||bd(Id)},Ad=function(e,t){return function(i){return Math.max(Math.min(i,t),e)}},Er=function(e){return e%1?Number(e.toFixed(5)):e},Ed=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i,As={test:function(e){return typeof e=="number"},parse:parseFloat,transform:function(e){return e}},yn=ye(ye({},As),{transform:Ad(0,1)}),lr=ye(ye({},As),{default:1}),Ba=function(e){return{test:function(t){return typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1},parse:parseFloat,transform:function(t){return""+t+e}}},ei=Ba("deg"),xn=Ba("%"),V=Ba("px"),vu=ye(ye({},xn),{parse:function(e){return xn.parse(e)/100},transform:function(e){return xn.transform(e*100)}}),nm=function(e){return e.substring(e.indexOf("(")+1,e.lastIndexOf(")"))},rm=Ad(0,255),No=function(e){return e.red!==void 0},Po=function(e){return e.hue!==void 0};function sm(e){return nm(e).replace(/(,|\/)/g," ").split(/ \s*/)}var Td=function(e){return function(t){if(typeof t!="string")return t;for(var i={},n=sm(t),r=0;r<4;r++)i[e[r]]=n[r]!==void 0?parseFloat(n[r]):1;return i}},om=function(e){var t=e.red,i=e.green,n=e.blue,r=e.alpha,s=r===void 0?1:r;return"rgba("+t+", "+i+", "+n+", "+s+")"},am=function(e){var t=e.hue,i=e.saturation,n=e.lightness,r=e.alpha,s=r===void 0?1:r;return"hsla("+t+", "+i+", "+n+", "+s+")"},eo=ye(ye({},As),{transform:function(e){return Math.round(rm(e))}});function Oa(e,t){return e.startsWith(t)&&Ed.test(e)}var Tr={test:function(e){return typeof e=="string"?Oa(e,"rgb"):No(e)},parse:Td(["red","green","blue","alpha"]),transform:function(e){var t=e.red,i=e.green,n=e.blue,r=e.alpha,s=r===void 0?1:r;return om({red:eo.transform(t),green:eo.transform(i),blue:eo.transform(n),alpha:Er(yn.transform(s))})}},to={test:function(e){return typeof e=="string"?Oa(e,"hsl"):Po(e)},parse:Td(["hue","saturation","lightness","alpha"]),transform:function(e){var t=e.hue,i=e.saturation,n=e.lightness,r=e.alpha,s=r===void 0?1:r;return am({hue:Math.round(t),saturation:xn.transform(Er(i)),lightness:xn.transform(Er(n)),alpha:Er(yn.transform(s))})}},wu=ye(ye({},Tr),{test:function(e){return typeof e=="string"&&Oa(e,"#")},parse:function(e){var t="",i="",n="";return e.length>4?(t=e.substr(1,2),i=e.substr(3,2),n=e.substr(5,2)):(t=e.substr(1,1),i=e.substr(2,1),n=e.substr(3,1),t+=t,i+=i,n+=n),{red:parseInt(t,16),green:parseInt(i,16),blue:parseInt(n,16),alpha:1}}}),et={test:function(e){return typeof e=="string"&&Ed.test(e)||No(e)||Po(e)},parse:function(e){return Tr.test(e)?Tr.parse(e):to.test(e)?to.parse(e):wu.test(e)?wu.parse(e):e},transform:function(e){return No(e)?Tr.transform(e):Po(e)?to.transform(e):e}},_a=function(e){var t=e.onRead,i=e.onRender,n=e.uncachedValues,r=n===void 0?new Set:n,s=e.useCache,o=s===void 0?!0:s;return function(a){a===void 0&&(a={});var l=Va(a,[]),u={},h=[],p=!1;function w(E,T){E.startsWith("--")&&(l.hasCSSVariable=!0);var c=u[E];u[E]=T,u[E]!==c&&(h.indexOf(E)===-1&&h.push(E),p||(p=!0,em.render(C.render)))}var C={get:function(E,T){T===void 0&&(T=!1);var c=!T&&o&&!r.has(E)&&u[E]!==void 0;return c?u[E]:t(E,l)},set:function(E,T){if(typeof E=="string")w(E,T);else for(var c in E)w(c,E[c]);return this},render:function(E){return E===void 0&&(E=!1),(p||E===!0)&&(i(u,l,h),p=!1,h.length=0),this}};return C}},lm=/([a-z])([A-Z])/g,um="$1-$2",Es=function(e){return e.replace(lm,um).toLowerCase()},kd=new Map,$a=new Map,Nd=["Webkit","Moz","O","ms",""],cm=Nd.length,dm=typeof document!="undefined",io,Pd=function(e,t){return $a.set(e,Es(t))},hm=function(e){io=io||document.createElement("div");for(var t=0;t<cm;t++){var i=Nd[t],n=i==="",r=n?e:i+e.charAt(0).toUpperCase()+e.slice(1);if(r in io.style||n){if(n&&e==="clipPath"&&$a.has(e))return;kd.set(e,r),Pd(e,(n?"":"-")+Es(r))}}},pm=function(e){return Pd(e,e)},zd=function(e,t){t===void 0&&(t=!1);var i=t?$a:kd;return i.has(e)||(dm?hm(e):pm(e)),i.get(e)||e},fm=["","X","Y","Z"],gm=["translate","scale","rotate","skew","transformPerspective"],zo=gm.reduce(function(e,t){return fm.reduce(function(i,n){return i.push(t+n),i},e)},["x","y","z"]),mm=zo.reduce(function(e,t){return e[t]=!0,e},{});function Ua(e){return mm[e]===!0}function vm(e,t){return zo.indexOf(e)-zo.indexOf(t)}var wm=new Set(["originX","originY","originZ"]);function ym(e){return wm.has(e)}var yu=ye(ye({},As),{transform:Math.round}),xm={color:et,backgroundColor:et,outlineColor:et,fill:et,stroke:et,borderColor:et,borderTopColor:et,borderRightColor:et,borderBottomColor:et,borderLeftColor:et,borderWidth:V,borderTopWidth:V,borderRightWidth:V,borderBottomWidth:V,borderLeftWidth:V,borderRadius:V,radius:V,borderTopLeftRadius:V,borderTopRightRadius:V,borderBottomRightRadius:V,borderBottomLeftRadius:V,width:V,maxWidth:V,height:V,maxHeight:V,size:V,top:V,right:V,bottom:V,left:V,padding:V,paddingTop:V,paddingRight:V,paddingBottom:V,paddingLeft:V,margin:V,marginTop:V,marginRight:V,marginBottom:V,marginLeft:V,rotate:ei,rotateX:ei,rotateY:ei,rotateZ:ei,scale:lr,scaleX:lr,scaleY:lr,scaleZ:lr,skew:ei,skewX:ei,skewY:ei,distance:V,translateX:V,translateY:V,translateZ:V,x:V,y:V,z:V,perspective:V,opacity:yn,originX:vu,originY:vu,originZ:V,zIndex:yu,fillOpacity:yn,strokeOpacity:yn,numOctaves:yu},Wa=function(e){return xm[e]},Sm=function(e,t){return t&&typeof e=="number"?t.transform(e):e},Sn="scrollLeft",Cn="scrollTop",Dd=new Set([Sn,Cn]),Cm=new Set([Sn,Cn,"transform"]),bm={x:"translateX",y:"translateY",z:"translateZ"};function jd(e){return typeof e=="function"}function Mm(e,t,i,n,r,s){s===void 0&&(s=!0);var o="",a=!1;i.sort(vm);for(var l=i.length,u=0;u<l;u++){var h=i[u];o+=(bm[h]||h)+"("+t[h]+") ",a=h==="z"?!0:a}return!a&&r?o+="translateZ(0)":o=o.trim(),jd(e.transform)?o=e.transform(t,n?"":o):s&&n&&(o="none"),o}function Im(e,t,i,n,r,s,o,a){t===void 0&&(t=!0),i===void 0&&(i={}),n===void 0&&(n={}),r===void 0&&(r={}),s===void 0&&(s=[]),o===void 0&&(o=!1),a===void 0&&(a=!0);var l=!0,u=!1,h=!1;for(var p in e){var w=e[p],C=Wa(p),E=Sm(w,C);Ua(p)?(u=!0,n[p]=E,s.push(p),l&&(C.default&&w!==C.default||!C.default&&w!==0)&&(l=!1)):ym(p)?(r[p]=E,h=!0):(!Cm.has(p)||!jd(E))&&(i[zd(p,o)]=E)}return(u||typeof e.transform=="function")&&(i.transform=Mm(e,n,s,l,t,a)),h&&(i.transformOrigin=(r.originX||"50%")+" "+(r.originY||"50%")+" "+(r.originZ||0)),i}function Ha(e){var t=e===void 0?{}:e,i=t.enableHardwareAcceleration,n=i===void 0?!0:i,r=t.isDashCase,s=r===void 0?!0:r,o=t.allowTransformNone,a=o===void 0?!0:o,l={},u={},h={},p=[];return function(w){return p.length=0,Im(w,n,l,u,h,p,s,a),l}}function Am(e,t){var i=t.element,n=t.preparseOutput,r=Wa(e);if(Ua(e))return r&&r.default||0;if(Dd.has(e))return i[e];var s=window.getComputedStyle(i,null).getPropertyValue(zd(e,!0))||0;return n&&r&&r.test(s)&&r.parse?r.parse(s):s}function Em(e,t,i){var n=t.element,r=t.buildStyles,s=t.hasCSSVariable;if(Object.assign(n.style,r(e)),s)for(var o=i.length,a=0;a<o;a++){var l=i[a];l.startsWith("--")&&n.style.setProperty(l,e[l])}i.indexOf(Sn)!==-1&&(n[Sn]=e[Sn]),i.indexOf(Cn)!==-1&&(n[Cn]=e[Cn])}var Tm=_a({onRead:Am,onRender:Em,uncachedValues:Dd});function km(e,t){t===void 0&&(t={});var i=t.enableHardwareAcceleration,n=t.allowTransformNone,r=Va(t,["enableHardwareAcceleration","allowTransformNone"]);return Tm(ye({element:e,buildStyles:Ha({enableHardwareAcceleration:i,allowTransformNone:n}),preparseOutput:!0},r))}var Ld=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues"]),xu=.5,Vd=function(){return{style:{}}},no=function(e,t){return V.transform(e*t)},Nm={x:0,y:0,width:0,height:0};function Su(e,t,i){return typeof e=="string"?e:V.transform(t+i*e)}function Pm(e,t,i){return Su(t,e.x,e.width)+" "+Su(i,e.y,e.height)}var Rd={enableHardwareAcceleration:!1,isDashCase:!1};function zm(e,t,i,n,r,s){t===void 0&&(t=Nm),n===void 0&&(n=Ha(Rd)),r===void 0&&(r=Vd()),s===void 0&&(s=!0);var o=e.attrX,a=e.attrY,l=e.originX,u=e.originY,h=e.pathLength,p=e.pathSpacing,w=p===void 0?1:p,C=e.pathOffset,E=C===void 0?0:C,T=Va(e,["attrX","attrY","originX","originY","pathLength","pathSpacing","pathOffset"]),c=n(T);for(var d in c)if(d==="transform")r.style.transform=c[d];else{var f=s&&!Ld.has(d)?Es(d):d;r[f]=c[d]}return(l!==void 0||u!==void 0||c.transform)&&(r.style.transformOrigin=Pm(t,l!==void 0?l:xu,u!==void 0?u:xu)),o!==void 0&&(r.x=o),a!==void 0&&(r.y=a),i!==void 0&&h!==void 0&&(r[s?"stroke-dashoffset":"strokeDashoffset"]=no(-E,i),r[s?"stroke-dasharray":"strokeDasharray"]=no(h,i)+" "+no(w,i)),r}function Dm(e,t,i){i===void 0&&(i=!0);var n=Vd(),r=Ha(Rd);return function(s){return zm(s,e,t,r,n,i)}}var jm=function(e){return typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()},Lm=function(e){try{return jm(e)}catch{return{x:0,y:0,width:0,height:0}}},Vm=function(e){return e.tagName==="path"},Rm=_a({onRead:function(e,t){var i=t.element;if(e=Ld.has(e)?e:Es(e),Ua(e)){var n=Wa(e);return n&&n.default||0}else return i.getAttribute(e)},onRender:function(e,t){var i=t.element,n=t.buildAttrs,r=n(e);for(var s in r)s==="style"?Object.assign(i.style,r.style):i.setAttribute(s,r[s])}}),Bm=function(e){var t=Lm(e),i=Vm(e)&&e.getTotalLength?e.getTotalLength():void 0;return Rm({element:e,buildAttrs:Dm(t,i)})},Om=_a({useCache:!1,onRead:function(e){return e==="scrollTop"?window.pageYOffset:window.pageXOffset},onRender:function(e){var t=e.scrollTop,i=t===void 0?0:t,n=e.scrollLeft,r=n===void 0?0:n;return window.scrollTo(r,i)}}),Do=new WeakMap,_m=function(e){return e instanceof HTMLElement||typeof e.click=="function"},$m=function(e){return e instanceof SVGElement||"ownerSVGElement"in e},Um=function(e,t){var i;return e===window?i=Om(e):_m(e)?i=km(e,t):$m(e)&&(i=Bm(e)),Do.set(e,i),i},Wm=function(e,t){return Do.has(e)?Do.get(e):Um(e,t)};function Hm(e,t){var i=typeof e=="string"?document.querySelector(e):e;return Wm(i,t)}var Ye=function(t,i,n,r){var s=n?n.call(r,t,i):void 0;if(s!==void 0)return!!s;if(t===i)return!0;if(typeof t!="object"||!t||typeof i!="object"||!i)return!1;var o=Object.keys(t),a=Object.keys(i);if(o.length!==a.length)return!1;for(var l=Object.prototype.hasOwnProperty.bind(i),u=0;u<o.length;u++){var h=o[u];if(!l(h))return!1;var p=t[h],w=i[h];if(s=n?n.call(r,p,w,h):void 0,s===!1||s===void 0&&p!==w)return!1}return!0},Fm=(()=>`.tele-fancy-scrollbar {
16
16
  overscroll-behavior: contain;
17
17
  overflow: auto;
18
18
  overflow-y: scroll;
@@ -59,7 +59,7 @@ PERFORMANCE OF THIS SOFTWARE.
59
59
  }
60
60
  .telebox-body-wrap {
61
61
  color: #191919;
62
- color: var(--tele-box-color, #191919);
62
+ color: var(--tele-boxColor, #191919);
63
63
  flex: 1;
64
64
  width: 100%;
65
65
  overflow: hidden;
@@ -73,25 +73,25 @@ PERFORMANCE OF THIS SOFTWARE.
73
73
  height: 100%;
74
74
  position: relative;
75
75
  background-color: #f9f9f9;
76
- background-color: var(--tele-manager-container-background, #f9f9f9);
76
+ background-color: var(--tele-boxContainerBackground, #f9f9f9);
77
77
  }
78
78
  .telebox-box-stage {
79
79
  position: absolute;
80
80
  z-index: 1;
81
81
  overflow: hidden;
82
82
  background-color: #fff;
83
- background-color: var(--tele-manager-stage-background, #fff);
83
+ background-color: var(--tele-boxStageBackground, #fff);
84
84
  box-shadow: 0px 0px 16px rgba(0, 0, 0, 0.08);
85
- box-shadow: var(--tele-manager-stage-shadow, 0px 0px 16px rgba(0, 0, 0, 0.08));
85
+ box-shadow: var(--tele-boxStageShadow, 0px 0px 16px rgba(0, 0, 0, 0.08));
86
86
  }
87
87
  .telebox-footer-wrap {
88
88
  flex-shrink: 0;
89
89
  display: flex;
90
90
  flex-direction: column;
91
91
  color: #191919;
92
- color: var(--tele-box-footer-color, #191919);
92
+ color: var(--tele-boxFooterColor, #191919);
93
93
  background-color: #fff;
94
- background-color: var(--tele-box-footer-background, #fff);
94
+ background-color: var(--tele-boxFooterBackground, #fff);
95
95
  }
96
96
  .telebox-footer-wrap::before {
97
97
  content: "";
@@ -103,26 +103,26 @@ PERFORMANCE OF THIS SOFTWARE.
103
103
  }
104
104
  .telebox-color-scheme-dark .telebox-body-wrap {
105
105
  color: #e9e9e9;
106
- color: var(--tele-box-color-dark, #e9e9e9);
106
+ color: var(--tele-boxColor, #e9e9e9);
107
107
  }
108
108
  .telebox-color-scheme-dark .telebox-content {
109
109
  background-color: #25282e;
110
- background-color: var(--tele-manager-container-background-dark, #25282e);
110
+ background-color: var(--tele-boxContainerBackground, #25282e);
111
111
  }
112
112
  .telebox-color-scheme-dark .telebox-box-stage {
113
113
  background-color: #272a30;
114
- background-color: var(--tele-manager-stage-background-dark, #272a30);
114
+ background-color: var(--tele-boxStageBackground, #272a30);
115
115
  box-shadow: 0px 0px 16px rgba(0, 0, 0, 0.24);
116
- box-shadow: var(--tele-manager-stage-shadow-dark, 0px 0px 16px rgba(0, 0, 0, 0.24));
116
+ box-shadow: var(--tele-boxStageShadow, 0px 0px 16px rgba(0, 0, 0, 0.24));
117
117
  }
118
118
  .telebox-color-scheme-dark .telebox-footer-wrap {
119
119
  color: #e9e9e9;
120
- color: var(--tele-box-footer-color-dark, #e9e9e9);
120
+ color: var(--tele-boxFooterColor, #e9e9e9);
121
121
  background-color: #383b42;
122
- background-color: var(--tele-box-footer-background-dark, #383b42);
123
- }`)(),Bd=(e=>(e.Light="light",e.Dark="dark",e.Auto="auto",e))(Bd||{}),ce=(e=>(e.Normal="normal",e.Minimized="minimized",e.Maximized="maximized",e))(ce||{}),Ie=(e=>(e.DarkMode="dark_mode",e.PrefersColorScheme="prefers_color_scheme",e.Close="close",e.Focus="focus",e.Blur="blur",e.IntrinsicMove="intrinsic_move",e.IntrinsicResize="intrinsic_resize",e.ZIndex="z_index",e.State="state",e.Minimized="minimized",e.Maximized="maximized",e.Readonly="readonly",e.Destroyed="destroyed",e))(Ie||{}),st=(e=>(e.Close="close",e.Maximize="maximize",e.Minimize="minimize",e))(st||{}),nt=(e=>(e.North="n",e.South="s",e.West="w",e.East="e",e.NorthWest="nw",e.NorthEast="ne",e.SouthEast="se",e.SouthWest="sw",e))(nt||{});const ro="dh";function Ai(e,t,i){return Math.min(Math.max(e,t),i)}function bn(e){e.stopPropagation(),e.cancelable&&e.preventDefault()}let Qm=1;function Zm(){return`New Box ${Qm++}`}class Od{constructor({readonly$:t,state$:i,title$:n,buttons:r,onEvent:s,onDragStart:o,namespace:a="telebox"}){this.sideEffect=new Oe.SideEffectManager,this.lastTitleBarClick={timestamp:0,clientX:-100,clientY:-100},this.handleTitleBarClick=l=>{var u;if(!l.isPrimary||this.readonly$.value||l.button!==0||(u=l.target.dataset)!=null&&u.teleTitleBarNoDblClick)return;bn(l);const h=Date.now();h-this.lastTitleBarClick.timestamp<=500?Math.abs(l.clientX-this.lastTitleBarClick.clientX)<=5&&Math.abs(l.clientY-this.lastTitleBarClick.clientY)<=5&&this.onEvent&&this.onEvent({type:st.Maximize}):this.onDragStart&&this.onDragStart(l),this.lastTitleBarClick.timestamp=h,this.lastTitleBarClick.clientX=l.clientX,this.lastTitleBarClick.clientY=l.clientY},this.readonly$=t,this.state$=i,this.title$=n,this.onEvent=s,this.onDragStart=o,this.namespace=a,this.buttons=r||[{type:st.Minimize,iconClassName:this.wrapClassName("titlebar-icon-minimize")},{type:st.Maximize,iconClassName:this.wrapClassName("titlebar-icon-maximize"),isActive:l=>l===ce.Maximized},{type:st.Close,iconClassName:this.wrapClassName("titlebar-icon-close")}],this.$dragArea=this.renderDragArea()}render(){if(!this.$titleBar){this.$titleBar=document.createElement("div"),this.$titleBar.className=this.wrapClassName("titlebar");const t=document.createElement("div");t.className=this.wrapClassName("title-area"),t.dataset.teleBoxHandle=ro;const i=document.createElement("h1");i.className=this.wrapClassName("title"),i.dataset.teleBoxHandle=ro,t.appendChild(i),t.appendChild(this.$dragArea);const n=document.createElement("div");n.className=this.wrapClassName("titlebar-btns"),this.buttons.forEach(({iconClassName:r},s)=>{const o=String(s),a=document.createElement("button");a.className=`${this.wrapClassName("titlebar-btn")} ${r}`,a.dataset.teleTitleBarBtnIndex=o,a.dataset.teleTitleBarNoDblClick="true",n.appendChild(a)}),this.sideEffect.addDisposer(this.title$.subscribe(r=>{i.textContent=r,i.title=r}),"render-title"),this.sideEffect.addDisposer(this.state$.subscribe(r=>{this.buttons.forEach((s,o)=>{var a;s.isActive&&((a=n.children[o])==null||a.classList.toggle("is-active",s.isActive(r)))})}),"render-state-btns"),this.sideEffect.addEventListener(n,"pointerup",r=>{var s;if(!r.isPrimary||this.readonly$.value)return;const o=r.target,a=Number((s=o.dataset)==null?void 0:s.teleTitleBarBtnIndex);if(!Number.isNaN(a)&&a<this.buttons.length){bn(r);const l=this.buttons[a];this.onEvent&&this.onEvent({type:l.type,value:l.value})}},{},"render-btns-container-click"),this.$titleBar.appendChild(t),this.$titleBar.appendChild(n)}return this.$titleBar}renderDragArea(){const t=document.createElement("div");return t.className=this.wrapClassName("drag-area"),t.dataset.teleBoxHandle=ro,this.sideEffect.addEventListener(t,"pointerdown",this.handleTitleBarClick),t}dragHandle(){return this.$titleBar}wrapClassName(t){return`${this.namespace}-${t}`}destroy(){this.sideEffect.flushAll(),this.$titleBar&&(this.$titleBar=void 0,this.onDragStart=void 0,this.onEvent=void 0)}}function _d([e,t]){if(t<=0||e.width<=0||e.height<=0)return e;const i=e.width*t;if(i===e.height)return e;if(i<e.height)return{x:0,y:(e.height-i)/2,width:e.width,height:i};const n=e.height/t;return{x:(e.width-n)/2,y:0,width:n,height:e.height}}const Ym=window.ResizeObserver||od.ResizeObserver;class Gm{constructor({id:t=Oe.genUID(),title:i=Zm(),namespace:n="telebox",visible:r=!0,width:s=.5,height:o=.5,minWidth:a=0,minHeight:l=0,x:u=.1,y:h=.1,resizable:p=!0,draggable:w=!0,boxRatio:S=-1,focus:I=!1,zIndex:E=100,stageRatio:c=null,enableShadowDOM:d=!0,titleBar:f,content:g,stage:m,footer:y,styles:v,userStyles:T,bodyStyle:D=null,stageStyle:k=null,darkMode$:X,fence$:J,minimized$:re,maximized$:pt,readonly$:Q,root:q,rootRect$:Tt,managerStageRect$:we,managerStageRatio$:qe,defaultBoxBodyStyle$:kt,defaultBoxStageStyle$:z,collectorRect$:U}){this.events=new Gt.default,this._delegateEvents=new Gt.default,this.handleTrackStart=$=>{var F;return(F=this._handleTrackStart)==null?void 0:F.call(this,$)},this._sideEffect=new Oe.SideEffectManager,this.id=t,this.namespace=n,this.enableShadowDOM=d;const ye=new b.ValManager;this._sideEffect.addDisposer(()=>ye.destroy());const Me=new b.Val(i),C=new b.Val(r),P=new b.Val(p),O=new b.Val(w),Z=new b.Val(S),ee=new b.Val(E),et=new b.Val(I),Fe=b.combine([re,pt],([$,F])=>$?ce.Minimized:F?ce.Maximized:ce.Normal),ft=new b.Val({width:Ai(a,0,1),height:Ai(l,0,1)},{compare:Ze}),Nt=b.combine([ft,we],([$,F])=>({width:$.width*F.width,height:$.height*F.height}),{compare:Ze}),ar=new b.Val({width:s,height:o},{compare:Ze});this._sideEffect.addDisposer(ft.reaction(($,F)=>{ar.setValue({width:Math.max(s,$.width),height:Math.max(o,$.height)},F)}));const Ys=new b.Val({x:u,y:h},{compare:Ze}),Gs=b.combine([ar,we],([$,F])=>({width:F.width*$.width,height:F.height*$.height}),{compare:Ze}),tn=b.combine([Ys,we],([$,F])=>({x:$.x*F.width,y:$.y*F.height}),{compare:Ze}),Wf=new b.Val(D),Hf=new b.Val(k),Ff=new b.Val(null),tu=new b.Val(we.value,{compare:Ze}),iu=new b.Val(c),Qf=b.combine([iu,qe],([$,F])=>$!=null?$:F),Zf=b.combine([tu,Qf],_d,{compare:Ze}),Yf={darkMode:X,fence:J,minimized:re,maximized:pt,readonly:Q,rootRect:Tt,managerStageRect:we,managerStageRatio:qe,defaultBoxBodyStyle:kt,defaultBoxStageStyle:z,collectorRect:U};b.withReadonlyValueEnhancer(this,Yf);const Gf={zIndex:ee,focus:et,state:Fe,minSize:ft,pxMinSize:Nt,intrinsicSize:ar,intrinsicCoord:Ys,pxIntrinsicSize:Gs,pxIntrinsicCoord:tn,bodyRect:tu,stageRect:Zf};b.withReadonlyValueEnhancer(this,Gf,ye);const Xf={title:Me,visible:C,resizable:P,draggable:O,boxRatio:Z,stageRatio:iu,bodyStyle:Wf,stageStyle:Hf};b.withValueEnhancer(this,Xf,ye),this.titleBar=f||new Od({readonly$:Q,state$:Fe,title$:Me,namespace:this.namespace,onDragStart:$=>{var F;return(F=this._handleTrackStart)==null?void 0:F.call(this,$)},onEvent:$=>this._delegateEvents.emit($.type)}),this._sideEffect.addDisposer(Z.subscribe($=>{$>0&&this.transform(tn.value.x,tn.value.y,Gs.value.width,Gs.value.height)})),this._sideEffect.addDisposer(J.subscribe($=>{$&&this.move(tn.value.x,tn.value.y)})),this.$box=this._render(),Ff.setValue(this.$content.parentElement),g&&this.mountContent(g),m&&this.mountStage(m),y&&this.mountFooter(y),v&&this.mountStyles(v),T&&this.mountUserStyles(T),q.appendChild(this.$box);const Pt=($,F)=>{this._sideEffect.addDisposer($.reaction((Jf,Kf)=>{Kf||this.events.emit(F,Jf)}))};Pt(X,Ie.DarkMode),Pt(Q,Ie.Readonly),Pt(ee,Ie.ZIndex),Pt(re,Ie.Minimized),Pt(pt,Ie.Maximized),Pt(Fe,Ie.State),Pt(ar,Ie.IntrinsicResize),Pt(Ys,Ie.IntrinsicMove),this._sideEffect.addDisposer([C.reaction(($,F)=>{!F&&!$&&this.events.emit(Ie.Close)}),et.reaction(($,F)=>{F||this.events.emit($?Ie.Focus:Ie.Blur)})])}get minWidth(){return this._minSize$.value.width}get minHeight(){return this._minSize$.value.height}setMinWidth(t,i=!1){this._minSize$.setValue({width:t,height:this.minHeight},i)}setMinHeight(t,i=!1){this._minSize$.setValue({width:this.minWidth,height:t},i)}resize(t,i,n=!1){this._intrinsicSize$.setValue({width:Math.max(t,this.minWidth),height:Math.max(i,this.minHeight)},n)}get intrinsicX(){return this._intrinsicCoord$.value.x}get intrinsicY(){return this._intrinsicCoord$.value.y}get intrinsicWidth(){return this._intrinsicSize$.value.width}get intrinsicHeight(){return this._intrinsicSize$.value.height}move(t,i,n=!1){let r,s;const o=this.managerStageRect,a=this.pxIntrinsicSize;this.fence?(r=Ai(t,0,o.width-a.width),s=Ai(i,0,o.height-a.height)):(r=Ai(t,-(a.width-120),0+o.width-20),s=Ai(i,0,0+o.height-20)),this._intrinsicCoord$.setValue({x:r/o.width,y:s/o.height},n)}transform(t,i,n,r,s=!1){const o=this.managerStageRect;if(n=Math.max(n,this.pxMinSize.width),r=Math.max(r,this.pxMinSize.height),this.boxRatio>0){const a=this.boxRatio*n;i!==this.pxIntrinsicCoord.y&&(i-=a-r),r=a}i<0&&(i=0,r=this.pxIntrinsicSize.height),this.move(t,i,s),this._intrinsicSize$.setValue({width:n/o.width,height:r/o.height},s)}mountContent(t){var i;(i=this.$authorContent)==null||i.remove(),this.$authorContent=t,this.$content.appendChild(t)}unmountContent(){this.$authorContent&&(this.$authorContent.remove(),this.$authorContent=void 0)}mountStage(t){var i;(i=this.$authorStage)==null||i.remove(),this.$authorStage=t,this.$stage||(this.$stage=this._renderStage()),this.$stage.appendChild(t),this.$stage.parentElement||this.$body.appendChild(this.$stage)}unmountStage(){var t;this.$authorStage&&(this.$authorStage.remove(),this.$authorStage=void 0),(t=this.$stage)==null||t.remove()}mountFooter(t){var i;(i=this.$authorFooter)==null||i.remove(),this.$authorFooter=t,this.$footer.appendChild(t)}unmountFooter(){this.$authorFooter&&(this.$authorFooter.remove(),this.$authorFooter=void 0)}mountStyles(t){this.$styles.textContent=t}unmountStyles(){this.$styles.textContent=""}mountUserStyles(t){this.$userStyles.textContent=t}unmountUserStyles(){this.$userStyles.textContent=""}_render(){if(this.$box)return this.$box;const t=(c,d)=>this._sideEffect.addDisposer([this._readonly$.subscribe(f=>c.classList.toggle(this.wrapClassName("readonly"),f)),this._draggable$.subscribe(f=>c.classList.toggle(this.wrapClassName("no-drag"),!f)),this._resizable$.subscribe(f=>c.classList.toggle(this.wrapClassName("no-resize"),!f)),this._focus$.subscribe(f=>c.classList.toggle(this.wrapClassName("blur"),!f)),this._darkMode$.subscribe(f=>{c.classList.toggle(this.wrapClassName("color-scheme-dark"),f),c.classList.toggle(this.wrapClassName("color-scheme-light"),!f)})],d);this.$box=document.createElement("div"),this.$box.classList.add(this.wrapClassName("box")),t(this.$box,"bind-box-state"),this._sideEffect.add(()=>{const c=this.wrapClassName("minimized"),d=this.wrapClassName("maximized"),f="box-maximized-timer";return this._state$.subscribe(g=>{this.$box.classList.toggle(c,g===ce.Minimized),g===ce.Maximized?(this._sideEffect.flush(f),this.$box.classList.toggle(d,!0)):this._sideEffect.setTimeout(()=>{this.$box.classList.toggle(d,!1)},0,f)})}),this._sideEffect.addDisposer(this._visible$.subscribe(c=>{this.$box.style.display=c?"block":"none"})),this._sideEffect.addDisposer(this._zIndex$.subscribe(c=>{this.$box.style.zIndex=String(c)})),this.$box.dataset.teleBoxID=this.id;const i=Hm(this.$box),n=b.combine([this._maximized$,this._minimized$,this._pxIntrinsicSize$,this._pxIntrinsicCoord$,this._collectorRect$,this._rootRect$,this._managerStageRect$],([c,d,f,g,m,y,v])=>{const T=c?{x:-v.x,y:-v.y,width:y.width,height:y.height,scaleX:1,scaleY:1}:{x:g.x,y:g.y,width:f.width,height:f.height,scaleX:1,scaleY:1};if(d&&m){const{width:D,height:k}=c?this.rootRect:f;T.x=m.x-D/2+m.width/2-v.x,T.y=m.y-k/2+m.height/2-v.y,T.scaleX=m.width/D,T.scaleY=m.height/k}return T},{compare:Ze}),r=n.value;this.$box.style.width=r.width+"px",this.$box.style.height=r.height+"px",this.$box.style.transform=`translate(${r.x-10}px,${r.y-10}px)`,this._sideEffect.addDisposer(n.subscribe(c=>{i.set(c)}));const s=document.createElement("div");s.className=this.wrapClassName("box-main"),this.$box.appendChild(s);const o=document.createElement("div");o.className=this.wrapClassName("titlebar-wrap"),o.appendChild(this.titleBar.render()),this.$titleBar=o;const a=document.createElement("div");a.className=this.wrapClassName("body-wrap"),this.$body=a;const l=document.createElement("style");this.$styles=l,a.appendChild(l);const u=document.createElement("style");this.$userStyles=u,a.appendChild(u);const h=document.createElement("div");h.className=this.wrapClassName("content")+" tele-fancy-scrollbar",this.$content=h,this._sideEffect.addDisposer(b.combine([this._bodyStyle$,this._defaultBoxBodyStyle$],([c,d])=>c!=null?c:d).subscribe(c=>h.style.cssText=c||"")),a.appendChild(h);const p=document.createElement("div");p.className=this.wrapClassName("footer-wrap"),this.$footer=p,s.appendChild(o);const w=document.createElement("div");w.className=this.wrapClassName("main"),this.$main=w,s.appendChild(w);const S=document.createElement("div");S.className=this.wrapClassName("quarantine-outer"),w.appendChild(S);const I=document.createElement("div");if(I.className=this.wrapClassName("quarantine"),I.appendChild(a),I.appendChild(p),this.enableShadowDOM){t(I,"bind-quarantine-state");const c=document.createElement("style");c.textContent=Fm,I.insertBefore(c,I.firstChild),S.attachShadow({mode:"open"}).appendChild(I)}else S.appendChild(I);this._renderResizeHandlers();const E=()=>{const c=a.getBoundingClientRect();this._bodyRect$.setValue({x:0,y:0,width:c.width,height:c.height})};return this._sideEffect.add(()=>{const c=new Ym(()=>{this.minimized||E()});return c.observe(a),()=>c.disconnect()}),this._sideEffect.addDisposer(this._minimized$.reaction(c=>{c||this._sideEffect.setTimeout(E,400,"minimized-content-rect-fix")})),this.$box}_renderStage(){const t=document.createElement("div");t.className=this.wrapClassName("box-stage");const i=n=>{t.style.top=n.y+"px",t.style.left=n.x+"px",t.style.width=n.width+"px",t.style.height=n.height+"px"};return this._sideEffect.addDisposer([b.combine([this._stageStyle$,this._defaultBoxStageStyle$],([n,r])=>n!=null?n:r).subscribe(n=>{t.style.cssText=n||"",i(this._stageRect$.value)}),this._stageRect$.subscribe(i)],"box-stage-styles"),t}_renderResizeHandlers(){const t=document.createElement("div");t.className=this.wrapClassName("resize-handles"),Object.values(nt).forEach(E=>{const c=document.createElement("div");c.className=this.wrapClassName(E)+" "+this.wrapClassName("resize-handle"),c.dataset.teleBoxHandle=E,t.appendChild(c)}),this.$box.appendChild(t);const i="handle-tracking-listener",n=this.wrapClassName("transforming");let r,s=0,o=0,a=0,l=0,u=0,h=0,p;const w=E=>{if(!E.isPrimary||this.state!==ce.Normal)return;bn(E);let{pageX:c,pageY:d}=E;d<0&&(d=0);const f=c-u,g=d-h;let{x:m,y}=this.pxIntrinsicCoord,{width:v,height:T}=this.pxIntrinsicSize;switch(p){case nt.North:{y=o+g,T=l-g;break}case nt.South:{T=l+g;break}case nt.West:{m=s+f,v=a-f;break}case nt.East:{v=a+f;break}case nt.NorthWest:{m=s+f,y=o+g,v=a-f,T=l-g;break}case nt.NorthEast:{y=o+g,v=a+f,T=l-g;break}case nt.SouthEast:{v=a+f,T=l+g;break}case nt.SouthWest:{m=s+f,v=a-f,T=l+g;break}default:{this.move(s+f,o+g);return}}this.transform(m,y,v,T)},S=E=>{!E.isPrimary||(p=void 0,r&&(bn(E),this.$box.classList.toggle(n,!1),this._sideEffect.flush(i),r.remove()))},I=E=>{var c;if(!E.isPrimary||this.readonly||E.button!=null&&E.button!==0||!this.draggable||p||this.state!==ce.Normal)return;const d=E.target;if((c=d.dataset)!=null&&c.teleBoxHandle){bn(E),{x:s,y:o}=this.pxIntrinsicCoord,{width:a,height:l}=this.pxIntrinsicSize,{pageX:u,pageY:h}=E,p=d.dataset.teleBoxHandle,r||(r=document.createElement("div"));const f=p?this.wrapClassName(`cursor-${p}`):"";r.className=this.wrapClassName(`track-mask${f?` ${f}`:""}`),this.$box.appendChild(r),this.$box.classList.add(n),this._sideEffect.add(()=>(window.addEventListener("pointermove",w,{passive:!1}),window.addEventListener("pointerup",S,{passive:!1}),window.addEventListener("pointercancel",S,{passive:!1}),()=>{window.removeEventListener("pointermove",w),window.removeEventListener("pointerup",S),window.removeEventListener("pointercancel",S)}),i)}};this._handleTrackStart=I,this._sideEffect.addEventListener(t,"pointerdown",I,{},"box-resizeHandles-pointerdown")}async destroy(){this.$box.remove(),this._sideEffect.flushAll(),this._sideEffect.flushAll(),await this.events.emit(Ie.Destroyed),this.events.clearListeners(),this._delegateEvents.clearListeners()}wrapClassName(t){return`${this.namespace}-${t}`}}var Xm="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxOCAxNiI+CiAgICA8ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxwYXRoIHN0cm9rZT0iIzdCODhBMCIgc3Ryb2tlLXdpZHRoPSIxLjQiIGQ9Ik0uNyAxLjJoMTYuNnYxMy42SC43eiIgLz4KICAgICAgICA8cGF0aCBmaWxsPSIjN0I4OEEwIiBkPSJNNCA1LjVoNnYxLjRINHpNNCA5LjVoMTB2MS40SDR6IiAvPgogICAgPC9nPgo8L3N2Zz4K";class Jm{constructor({minimized$:t,readonly$:i,darkMode$:n,namespace:r="telebox",styles:s={},root$:o}){this._sideEffect=new Oe.SideEffectManager,this.namespace=r;const a=new b.ValManager;this._sideEffect.addDisposer(()=>a.destroy());const l=new b.Val(void 0),u=b.derive(t),h=new b.Val(s),p=new b.Val(document.createElement("button")),w={styles:h,$collector:p};b.withValueEnhancer(this,w,a);const S={root:o};b.withReadonlyValueEnhancer(this,S);const I={rect:l,visible:u};b.withReadonlyValueEnhancer(this,I,a),p.value.className=this.wrapClassName("collector"),p.value.style.backgroundImage=`url('${Xm}')`,this._sideEffect.addDisposer(p.subscribe(E=>{this._sideEffect.addEventListener(E,"pointerup",c=>{c.isPrimary&&!i.value&&t.setValue(!1)},{},"telebox-collector-click"),this._sideEffect.addDisposer([u.subscribe(c=>{E.classList.toggle(this.wrapClassName("collector-visible"),c)}),i.subscribe(c=>{E.classList.toggle(this.wrapClassName("collector-readonly"),c)}),n.subscribe(c=>{E.classList.toggle(this.wrapClassName("color-scheme-dark"),c),E.classList.toggle(this.wrapClassName("color-scheme-light"),!c)}),h.subscribe(c=>{Object.keys(c).forEach(d=>{const f=c[d];f!=null&&(E.style[d]=f)})}),o.subscribe(c=>{c&&c.appendChild(E)}),b.combine([t,o]).subscribe(([c,d])=>{if(c&&d){const{x:f,y:g,width:m,height:y}=E.getBoundingClientRect(),v=d.getBoundingClientRect();l.setValue({x:f-v.x,y:g-v.y,width:m,height:y})}})],"telebox-collector-el")}))}destroy(){this._sideEffect.flushAll()}wrapClassName(t){return`${this.namespace}-${t}`}}var xe=(e=>(e.Focused="focused",e.Blurred="blurred",e.Created="created",e.Removed="removed",e.State="state",e.Maximized="maximized",e.Minimized="minimized",e.IntrinsicMove="intrinsic_move",e.IntrinsicResize="intrinsic_resize",e.ZIndex="z_index",e.PrefersColorScheme="prefers_color_scheme",e.DarkMode="dark_mode",e))(xe||{});class Km extends Od{constructor(t){super(t);this.boxes$=t.boxes$,this.rootRect$=t.rootRect$,this.darkMode$=t.darkMode$,t.root.appendChild(this.render())}focusBox(t){var i;if(!(this.focusedBox&&this.focusedBox===t)){if(this.$titles&&this.state$.value===ce.Maximized){const{children:n}=this.$titles.firstElementChild;for(let r=n.length-1;r>=0;r-=1){const s=n[r],o=(i=s.dataset)==null?void 0:i.teleBoxID;o&&(t&&o===t.id?s.classList.toggle(this.wrapClassName("titles-tab-focus"),!0):this.focusedBox&&o===this.focusedBox.id&&s.classList.toggle(this.wrapClassName("titles-tab-focus"),!1))}}this.focusedBox=t}}render(){if(this.$titleBar)return this.$titleBar;const t=super.render();t.classList.add(this.wrapClassName("max-titlebar")),this.sideEffect.addDisposer([this.state$.subscribe(n=>{t.classList.toggle(this.wrapClassName("max-titlebar-maximized"),n===ce.Maximized)}),this.readonly$.subscribe(n=>{t.classList.toggle(this.wrapClassName("readonly"),n)}),b.combine([this.state$,this.boxes$]).subscribe(([n,r])=>{n===ce.Maximized&&(t.classList.toggle(this.wrapClassName("max-titlebar-single-title"),r.length===1),r.length!==1&&t.replaceChild(this.renderTitles(),t.firstElementChild))})],"max-render");const i=document.createElement("div");return i.classList.add(this.wrapClassName("titles-area")),t.insertBefore(i,t.firstElementChild),t}destroy(){super.destroy(),this.$titles=void 0,this.focusedBox=void 0}renderTitles(){this.$titles=document.createElement("div"),this.$titles.className=this.wrapClassName("titles"),this.sideEffect.addEventListener(this.$titles,"wheel",n=>{n.currentTarget.scrollBy({left:n.deltaY>0?250:-250,behavior:"smooth"})},{passive:!1},"max-render-wheel-titles");const t=document.createElement("div");t.className=this.wrapClassName("titles-content"),this.$titles.appendChild(t);const i=this.boxes$.value.map(n=>{const r=document.createElement("button");return r.className=this.wrapClassName("titles-tab"),r.textContent=n.title,r.dataset.teleBoxID=n.id,r.dataset.teleTitleBarNoDblClick="true",this.focusedBox&&n.id===this.focusedBox.id&&r.classList.add(this.wrapClassName("titles-tab-focus")),t.appendChild(r),n._title$.reaction(s=>r.textContent=s)});return this.sideEffect.addDisposer(()=>i.forEach(n=>n()),"max-render-tab-titles"),this.$titles}}const qm=window.ResizeObserver||od.ResizeObserver;class ev{constructor({root:t=null,prefersColorScheme:i=Bd.Light,minimized:n=!1,maximized:r=!1,fence:s=!0,collector:o,namespace:a="telebox",readonly:l=!1,stageRatio:u=-1,containerStyle:h="",stageStyle:p="",defaultBoxBodyStyle:w=null,defaultBoxStageStyle:S=null}={}){this.events=new Gt.default,this._sideEffect=new Oe.SideEffectManager,this.namespace=a;const I=new b.ValManager;this._sideEffect.addDisposer(()=>I.destroy());const E=new b.Val(t),c=new b.Val(l),d=new b.Val(n),f=new b.Val(r),g=new b.Val(s),m=new b.Val(h),y=new b.Val(p),v=new b.Val(u),T=new b.Val(w),D=new b.Val(S),k=new b.Val({x:0,y:0,width:window.innerWidth,height:window.innerHeight},{compare:Ze});this._sideEffect.addDisposer(E.subscribe(z=>{this._sideEffect.add(()=>{if(!z)return()=>{};const U=new qm(()=>{const ye=z.getBoundingClientRect();k.setValue({x:0,y:0,width:ye.width,height:ye.height})});return U.observe(z),()=>U.disconnect()},"calc-root-rect")}));const X=b.combine([k,v],_d,{compare:Ze});this.boxes$=new b.Val([]),this.topBox$=new b.Val(void 0),this._sideEffect.addDisposer(this.boxes$.subscribe(z=>{if(z.length>0){const U=z.reduce((ye,Me)=>ye.zIndex>Me.zIndex?ye:Me);this.topBox$.setValue(U)}else this.topBox$.setValue(void 0)}));const J=window.matchMedia("(prefers-color-scheme: dark)"),re=new b.Val(!1);J&&(re.setValue(J.matches),this._sideEffect.add(()=>{const z=U=>{re.setValue(U.matches)};return J.addEventListener("change",z),()=>J.removeEventListener("change",z)}));const pt=new b.Val(i);this._sideEffect.addDisposer(pt.reaction((z,U)=>{U||this.events.emit(xe.PrefersColorScheme,z)}));const Q=b.combine([re,pt],([z,U])=>U==="auto"?z:U==="dark"),q=b.combine([d,f],([z,U])=>z?ce.Minimized:U?ce.Maximized:ce.Normal);this.collector=o!=null?o:new Jm({minimized$:d,readonly$:c,darkMode$:Q,namespace:a,root$:E});const Tt={darkMode:Q,state:q,root:E,rootRect:k,stageRect:X};b.withReadonlyValueEnhancer(this,Tt,I);const we={prefersColorScheme:pt,readonly:c,fence:g,minimized:d,maximized:f,stageRatio:v,containerStyle:m,stageStyle:y,defaultBoxBodyStyle:T,defaultBoxStageStyle:D};b.withValueEnhancer(this,we,I);const qe=this.wrapClassName("titlebar-icon-close"),kt=z=>{var U;if(!z.isPrimary||c.value)return;const ye=z.target;if(!!ye.tagName)for(let Me=ye;Me;Me=Me.parentElement){if(Me.classList&&Me.classList.contains(qe))return;const C=(U=Me.dataset)==null?void 0:U.teleBoxID;if(C){const P=this.getBox(C);if(P){this.focusBox(P),this.makeBoxTop(P);return}}}};this._sideEffect.addEventListener(window,"pointerdown",kt,!0),this.$container=document.createElement("div"),this.$container.className=this.wrapClassName("manager-container"),this.$stage=document.createElement("div"),this.$stage.className=this.wrapClassName("manager-stage"),this.$container.appendChild(this.$stage),this._sideEffect.addDisposer([Q.subscribe(z=>{this.$container.classList.toggle(this.wrapClassName("color-scheme-dark"),z),this.$container.classList.toggle(this.wrapClassName("color-scheme-light"),!z)}),f.subscribe(z=>{this.$container.classList.toggle("is-maximized",z)}),d.subscribe(z=>{this.$container.classList.toggle("is-minimized",z)}),m.subscribe(z=>{this.$container.style.cssText=z}),y.subscribe(z=>{this.$stage.style.cssText=z,this.$stage.style.width=X.value.width+"px",this.$stage.style.height=X.value.height+"px"}),X.subscribe(z=>{this.$stage.style.width=z.width+"px",this.$stage.style.height=z.height+"px"}),E.subscribe(z=>{z?z.appendChild(this.$container):this.$container.parentElement&&this.$container.remove()})]),this.titleBar=new Km({namespace:this.namespace,title$:b.derive(this.topBox$,z=>(z==null?void 0:z.title)||""),boxes$:this.boxes$,darkMode$:Q,readonly$:c,state$:q,rootRect$:k,root:this.$container,onEvent:z=>{switch(z.type){case st.Maximize:{f.setValue(!f.value);break}case st.Minimize:{d.setValue(!0);break}case Ie.Close:{this.removeTopBox(),this.focusTopBox();break}}}}),this._sideEffect.addDisposer([q.reaction((z,U)=>{U||this.events.emit(xe.State,z)}),f.reaction((z,U)=>{U||this.events.emit(xe.Maximized,z)}),d.reaction((z,U)=>{U||this.events.emit(xe.Minimized,z)}),Q.reaction((z,U)=>{U||this.events.emit(xe.DarkMode,z)})])}get boxes(){return this.boxes$.value}get topBox(){return this.topBox$.value}setState(t,i=!1){switch(t){case ce.Maximized:{this.setMinimized(!1,i),this.setMaximized(!0,i);break}case ce.Minimized:{this.setMinimized(!0,i),this.setMaximized(!1,i);break}default:{this.setMinimized(!1,i),this.setMaximized(!1,i);break}}return this}create(t={},i=!0){const n=new Gm(gt(H(H({zIndex:this.topBox?this.topBox.zIndex+1:100},t),i?this.smartPosition(t):{}),{namespace:this.namespace,root:this.$stage,darkMode$:this._darkMode$,maximized$:this._maximized$,minimized$:this._minimized$,fence$:this._fence$,rootRect$:this._rootRect$,managerStageRect$:this._stageRect$,managerStageRatio$:this._stageRatio$,readonly$:this._readonly$,collectorRect$:this.collector._rect$,defaultBoxBodyStyle$:this._defaultBoxBodyStyle$,defaultBoxStageStyle$:this._defaultBoxStageStyle$}));return n.focus&&(this.focusBox(n),i&&this.makeBoxTop(n)),this.boxes$.setValue([...this.boxes,n]),this._sideEffect.addDisposer([n._delegateEvents.on(st.Maximize,()=>{this.setMaximized(!this.maximized)}),n._delegateEvents.on(st.Minimize,()=>{this.setMinimized(!0)}),n._delegateEvents.on(st.Close,()=>{this.remove(n),this.focusTopBox()}),n._intrinsicCoord$.reaction((r,s)=>{s||this.events.emit(xe.IntrinsicMove,n)}),n._intrinsicSize$.reaction((r,s)=>{s||this.events.emit(xe.IntrinsicResize,n)}),n._zIndex$.reaction((r,s)=>{if(this.boxes.length>0){const o=this.boxes.reduce((a,l)=>a.zIndex>l.zIndex?a:l);this.topBox$.setValue(o)}s||this.events.emit(xe.ZIndex,n)})]),this.events.emit(xe.Created,n),n}query(t){return t?this.boxes.filter(this.teleBoxMatcher(t)):[...this.boxes]}queryOne(t){return t?this.boxes.find(this.teleBoxMatcher(t)):this.boxes[0]}update(t,i,n=!1){const r=this.boxes.find(s=>s.id===t);if(r)return this.updateBox(r,i,n)}updateAll(t,i=!1){this.boxes.forEach(n=>{this.updateBox(n,t,i)})}remove(t,i=!1){const n=this.getBoxIndex(t);if(n>=0){const r=this.boxes.slice(),s=r.splice(n,1);return this.boxes$.setValue(r),s.forEach(o=>o.destroy()),i||(this.boxes.length<=0&&(this.setMaximized(!1),this.setMinimized(!1)),this.events.emit(xe.Removed,s)),s[0]}}removeTopBox(){if(this.topBox)return this.remove(this.topBox)}removeAll(t=!1){const i=this.boxes$.value;return this.boxes$.setValue([]),i.forEach(n=>n.destroy()),t||(this.boxes.length<=0&&(this.setMaximized(!1),this.setMinimized(!1)),this.events.emit(xe.Removed,i)),i}mount(t){this._root$.setValue(t)}unmount(){this._root$.setValue(null)}destroy(t=!1){this.events.clearListeners(),this._sideEffect.flushAll(),this.removeAll(t),this.collector.destroy(),this.titleBar.destroy()}wrapClassName(t){return`${this.namespace}-${t}`}focusBox(t,i=!1){const n=this.getBox(t);n&&(this.boxes.forEach(r=>{if(n===r){let s=!1;n.focus||(s=!0,n._focus$.setValue(!0,i)),s&&!i&&this.events.emit(xe.Focused,n)}else r.focus&&this.blurBox(r,i)}),this.titleBar.focusBox(n))}focusTopBox(){if(this.topBox&&!this.topBox.focus)return this.focusBox(this.topBox)}blurBox(t,i=!1){const n=this.getBox(t);n&&(n.focus&&(n._focus$.setValue(!1,i),i||this.events.emit(xe.Blurred,n)),this.titleBar.focusedBox===n&&this.titleBar.focusBox())}blurAll(t=!1){this.boxes.forEach(i=>{i.focus&&(i._focus$.setValue(!1,t),t||this.events.emit(xe.Blurred,i))}),this.titleBar.focusedBox&&this.titleBar.focusBox()}teleBoxMatcher(t){const i=Object.keys(t);return n=>i.every(r=>t[r]===n[r])}updateBox(t,i,n=!1){var r,s,o,a,l,u;(i.x!=null||i.y!=null)&&t._intrinsicCoord$.setValue({x:(r=i.x)!=null?r:t.intrinsicX,y:(s=i.y)!=null?s:t.intrinsicY},n),(i.width!=null||i.height!=null)&&t._intrinsicSize$.setValue({width:(o=i.width)!=null?o:t.intrinsicWidth,height:(a=i.height)!=null?a:t.intrinsicHeight},n),i.title!=null&&t._title$.setValue(i.title),i.visible!=null&&t._visible$.setValue(i.visible,n),i.resizable!=null&&t._resizable$.setValue(i.resizable,n),i.draggable!=null&&t._draggable$.setValue(i.draggable,n),i.boxRatio!=null&&t._boxRatio$.setValue(i.boxRatio,n),i.zIndex!=null&&t._zIndex$.setValue(i.zIndex,n),i.stageRatio!==void 0&&t.setStageRatio(i.stageRatio,n),i.content!=null&&t.mountContent(i.content),i.footer!=null&&t.mountFooter(i.footer),(i.minHeight!=null||i.minWidth!=null)&&t._minSize$.setValue({width:(l=i.minWidth)!=null?l:t.minWidth,height:(u=i.minHeight)!=null?u:t.minHeight},n)}smartPosition(t){let{x:i,y:n}=t;const{width:r=.5,height:s=.5}=t,o=this.stageRect,a=this.topBox;if(i==null){let l=20;if(a){const u=a.pxIntrinsicCoord.x+20,h=r*o.width;u+h<=o.width&&(l=u)}i=l/o.width}if(n==null){let l=20;if(a){const u=a.pxIntrinsicCoord.y+20,h=s*o.height;u+h<=o.height&&(l=u)}n=l/o.height}return{x:i,y:n,width:r,height:s}}makeBoxTop(t,i=!1){this.topBox&&t!==this.topBox&&t._zIndex$.setValue(this.topBox.zIndex+1,i)}getBoxIndex(t){return typeof t=="string"?this.boxes.findIndex(i=>i.id===t):this.boxes.findIndex(i=>i===t)}getBox(t){return typeof t=="string"?this.boxes.find(i=>i.id===t):t}}const tv=(e,t,i,n,r)=>new iv({safeSetAttributes:s=>e.safeSetAttributes(s),updateAppState:(...s)=>{var o;return(o=e.appManager)==null?void 0:o.store.updateAppState(...s)},canOperate:()=>e.canOperate,notifyContainerRectUpdate:s=>{var o;return(o=e.appManager)==null?void 0:o.notifyContainerRectUpdate(s)},cleanFocus:()=>{var s;return(s=e.appManager)==null?void 0:s.store.cleanFocus()},setAppFocus:s=>{var o;return(o=e.appManager)==null?void 0:o.store.setAppFocus(s,!0)},callbacks:t,emitter:i,boxEmitter:n},r);class iv{constructor(t,i){this.context=t,this.sideEffectManager=new Oe.SideEffectManager;const{emitter:n,callbacks:r,boxEmitter:s}=t;this.teleBoxManager=this.setupBoxManager(i),this.sideEffectManager.add(()=>[this.teleBoxManager.onValChanged("state",o=>{r.emit("boxStateChange",o),n.emit("boxStateChange",o)}),this.teleBoxManager.onValChanged("darkMode",o=>{r.emit("darkModeChange",o)}),this.teleBoxManager.onValChanged("prefersColorScheme",o=>{r.emit("prefersColorSchemeChange",o)}),this.teleBoxManager.onValChanged("minimized",(o,a)=>{if(!a)if(this.context.safeSetAttributes({minimized:o}),o)this.context.cleanFocus(),this.blurAllBox();else{const l=this.getTopBox();l&&(this.context.setAppFocus(l.id),this.focusBox({appId:l.id},!1))}}),this.teleBoxManager.onValChanged("maximized",(o,a)=>{a||this.context.safeSetAttributes({maximized:o})}),this.teleBoxManager.events.on("removed",o=>{o.forEach(a=>{s.emit("close",{appId:a.id})})}),this.teleBoxManager.events.on("intrinsic_move",A.debounce(o=>{s.emit("move",{appId:o.id,x:o.intrinsicX,y:o.intrinsicY})},50)),this.teleBoxManager.events.on("intrinsic_resize",A.debounce(o=>{s.emit("resize",{appId:o.id,width:o.intrinsicWidth,height:o.intrinsicHeight})},200)),this.teleBoxManager.events.on("focused",o=>{o&&(this.canOperate?s.emit("focus",{appId:o.id}):this.teleBoxManager.blurBox(o.id))}),this.teleBoxManager.events.on("z_index",o=>{this.context.updateAppState(o.id,Ge.ZIndex,o.zIndex)}),n.on("containerSizeRatioUpdate",o=>{this.teleBoxManager._stageRatio$.setValue(o)})])}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}get stageRect(){return this.teleBoxManager.stageRect}get stageRect$(){return this.teleBoxManager._stageRect$}createBox(t){var p,w,S;if(!this.teleBoxManager)return;let{minwidth:i=ug,minheight:n=cg,enableShadowDOM:r=!0}=(p=t.app.config)!=null?p:{};const{width:s,height:o}=(w=t.app.config)!=null?w:{},a=((S=t.options)==null?void 0:S.title)||t.appId,l=this.teleBoxManager.rootRect;i>1&&(i=i/l.width),n>1&&(n=n/l.height);const u={title:a,minWidth:i,minHeight:n,width:s,height:o,id:t.appId,enableShadowDOM:r},h=this.teleBoxManager.create(u,t.smartPosition);return this.context.emitter.emit(`${t.appId}${Y.WindowCreated}`),h}setupBoxManager(t){const i=me.playground,n={stageRatio:t==null?void 0:t.stageRatio,root:i,fence:!1,prefersColorScheme:t==null?void 0:t.prefersColorScheme};t!=null&&t.containerStyle&&(n.containerStyle=t.containerStyle),t!=null&&t.stageStyle&&(n.stageStyle=t.stageStyle);const r=new ev(n);this.teleBoxManager&&this.teleBoxManager.destroy(),this.teleBoxManager=r;const s=t==null?void 0:t.collectorContainer;return s&&this.teleBoxManager.collector.set$collector(s),t!=null&&t.collectorStyles&&this.teleBoxManager.collector.setStyles(t.collectorStyles),r}getBox(t){return this.teleBoxManager.queryOne({id:t})}closeBox(t,i=!1){return this.teleBoxManager.remove(t,i)}boxIsFocus(t){const i=this.getBox(t);return i==null?void 0:i.focus}getFocusBox(){return this.teleBoxManager.query({focus:!0})[0]}getTopBox(){return this.teleBoxManager.topBox}updateBoxState(t){if(!t)return;const i=this.getBox(t.id);i&&(t.size&&i._intrinsicSize$.setValue(t.size,!0),t.position&&i._intrinsicCoord$.setValue(t.position,!0),t.zIndex&&i._zIndex$.setValue(t.zIndex,!0),setTimeout(()=>{t.focus&&this.teleBoxManager.focusBox(i.id,!0),t.maximized!=null&&this.teleBoxManager.setMaximized(Boolean(t.maximized),!0),t.minimized!=null&&this.teleBoxManager.setMinimized(Boolean(t.minimized),!0)},50),this.context.callbacks.emit("boxStateChange",this.teleBoxManager.state))}moveBox({appId:t,x:i,y:n}){const r=this.getBox(t);r&&r._intrinsicCoord$.setValue({x:i,y:n},!0)}focusBox({appId:t},i=!0){this.teleBoxManager.focusBox(t,i)}resizeBox({appId:t,width:i,height:n,skipUpdate:r}){const s=this.getBox(t);s&&s._intrinsicSize$.setValue({width:i,height:n},r)}setBoxMinSize(t){this.teleBoxManager.update(t.appId,{minWidth:t.minWidth,minHeight:t.minHeight},!0)}setBoxTitle(t){this.teleBoxManager.update(t.appId,{title:t.title},!0)}blurAllBox(){this.teleBoxManager.blurAll()}updateAll(t){this.teleBoxManager.updateAll(t)}setMaximized(t,i=!0){t!==this.maximized&&this.teleBoxManager.setMaximized(t,i)}setMinimized(t,i=!0){this.teleBoxManager.setMinimized(t,i)}focusTopBox(){if(this.teleBoxManager.query().length>=1){const i=this.getTopBox();i&&this.focusBox({appId:i.id},!1)}}updateBox(t,i,n=!0){this.teleBoxManager.update(t,i,n)}setReadonly(t){this.teleBoxManager.setReadonly(t)}setPrefersColorScheme(t){this.teleBoxManager.setPrefersColorScheme(t)}setZIndex(t,i,n=!0){this.teleBoxManager.update(t,{zIndex:i},n)}setRoot(t){this.teleBoxManager._root$.setValue(t)}setCollector(t){this.teleBoxManager.collector.set$collector(t)}destroy(){this.sideEffectManager.flushAll(),this.teleBoxManager.destroy()}}function Qr(){}function $d(e){return e()}function Cu(){return Object.create(null)}function Ts(e){e.forEach($d)}function nv(e){return typeof e=="function"}function rv(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let ur;function Zr(e,t){return ur||(ur=document.createElement("a")),ur.href=t,e===ur.href}function sv(e){return Object.keys(e).length===0}function St(e,t){e.appendChild(t)}function ks(e,t,i){e.insertBefore(t,i||null)}function Yn(e){e.parentNode.removeChild(e)}function _t(e){return document.createElement(e)}function Fa(e){return document.createTextNode(e)}function jo(){return Fa(" ")}function ue(e,t,i){i==null?e.removeAttribute(t):e.getAttribute(t)!==i&&e.setAttribute(t,i)}function ov(e){return Array.from(e.childNodes)}function Ud(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function pe(e,t,i,n){i===null?e.style.removeProperty(t):e.style.setProperty(t,i,n?"important":"")}let Qa;function Mn(e){Qa=e}const gn=[],bu=[],kr=[],Mu=[],av=Promise.resolve();let Vo=!1;function lv(){Vo||(Vo=!0,av.then(Wd))}function Lo(e){kr.push(e)}const so=new Set;let cr=0;function Wd(){const e=Qa;do{for(;cr<gn.length;){const t=gn[cr];cr++,Mn(t),uv(t.$$)}for(Mn(null),gn.length=0,cr=0;bu.length;)bu.pop()();for(let t=0;t<kr.length;t+=1){const i=kr[t];so.has(i)||(so.add(i),i())}kr.length=0}while(gn.length);for(;Mu.length;)Mu.pop()();Vo=!1,so.clear(),Mn(e)}function uv(e){if(e.fragment!==null){e.update(),Ts(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(Lo)}}const cv=new Set;function dv(e,t){e&&e.i&&(cv.delete(e),e.i(t))}function hv(e,t,i,n){const{fragment:r,on_mount:s,on_destroy:o,after_update:a}=e.$$;r&&r.m(t,i),n||Lo(()=>{const l=s.map($d).filter(nv);o?o.push(...l):Ts(l),e.$$.on_mount=[]}),a.forEach(Lo)}function pv(e,t){const i=e.$$;i.fragment!==null&&(Ts(i.on_destroy),i.fragment&&i.fragment.d(t),i.on_destroy=i.fragment=null,i.ctx=[])}function fv(e,t){e.$$.dirty[0]===-1&&(gn.push(e),lv(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function gv(e,t,i,n,r,s,o,a=[-1]){const l=Qa;Mn(e);const u=e.$$={fragment:null,ctx:null,props:s,update:Qr,not_equal:r,bound:Cu(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(l?l.$$.context:[])),callbacks:Cu(),dirty:a,skip_bound:!1,root:t.target||l.$$.root};o&&o(u.root);let h=!1;if(u.ctx=i?i(e,t.props||{},(p,w,...S)=>{const I=S.length?S[0]:w;return u.ctx&&r(u.ctx[p],u.ctx[p]=I)&&(!u.skip_bound&&u.bound[p]&&u.bound[p](I),h&&fv(e,p)),w}):[],u.update(),h=!0,Ts(u.before_update),u.fragment=n?n(u.ctx):!1,t.target){if(t.hydrate){const p=ov(t.target);u.fragment&&u.fragment.l(p),p.forEach(Yn)}else u.fragment&&u.fragment.c();t.intro&&dv(e.$$.fragment),hv(e,t.target,t.anchor,t.customElement),Wd()}Mn(l)}class mv{$destroy(){pv(this,1),this.$destroy=Qr}$on(t,i){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(i),()=>{const r=n.indexOf(i);r!==-1&&n.splice(r,1)}}$set(t){this.$$set&&!sv(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function Iu(e){let t,i,n,r,s,o,a=e[14]&&Au(e),l=e[15]&&Eu(e);return{c(){t=_t("div"),i=_t("div"),a&&a.c(),n=jo(),r=_t("span"),s=Fa(e[0]),o=jo(),l&&l.c(),pe(r,"overflow","hidden"),pe(r,"white-space","nowrap"),pe(r,"text-overflow","ellipsis"),pe(r,"max-width","80px"),ue(i,"class",e[8]),pe(i,"background-color",e[2]),pe(i,"color",e[9]),pe(i,"opacity",e[11]),ue(t,"class","netless-window-manager-cursor-name")},m(u,h){ks(u,t,h),St(t,i),a&&a.m(i,null),St(i,n),St(i,r),St(r,s),St(i,o),l&&l.m(i,null)},p(u,h){u[14]?a?a.p(u,h):(a=Au(u),a.c(),a.m(i,n)):a&&(a.d(1),a=null),h&1&&Ud(s,u[0]),u[15]?l?l.p(u,h):(l=Eu(u),l.c(),l.m(i,null)):l&&(l.d(1),l=null),h&256&&ue(i,"class",u[8]),h&4&&pe(i,"background-color",u[2]),h&512&&pe(i,"color",u[9]),h&2048&&pe(i,"opacity",u[11])},d(u){u&&Yn(t),a&&a.d(),l&&l.d()}}}function Au(e){let t,i;return{c(){t=_t("img"),ue(t,"class","netless-window-manager-cursor-selector-avatar"),ue(t,"style",e[16]()),Zr(t.src,i=e[7])||ue(t,"src",i),ue(t,"alt","avatar")},m(n,r){ks(n,t,r)},p(n,r){r&128&&!Zr(t.src,i=n[7])&&ue(t,"src",i)},d(n){n&&Yn(t)}}}function Eu(e){let t,i;return{c(){t=_t("span"),i=Fa(e[1]),ue(t,"class","netless-window-manager-cursor-tag-name"),pe(t,"background-color",e[10])},m(n,r){ks(n,t,r),St(t,i)},p(n,r){r&2&&Ud(i,n[1]),r&1024&&pe(t,"background-color",n[10])},d(n){n&&Yn(t)}}}function vv(e){let t,i,n,r,s,o,a=!e[12]&&Iu(e);return{c(){t=_t("div"),a&&a.c(),i=jo(),n=_t("div"),r=_t("img"),ue(r,"class",s="netless-window-manager-cursor-"+e[3]+"-image"),Zr(r.src,o=e[6])||ue(r,"src",o),ue(r,"alt",e[3]),ue(n,"class","cursor-image-wrapper"),ue(t,"class","netless-window-manager-cursor-mid"),pe(t,"transform","translateX("+e[4]+"px) translateY("+e[5]+"px)"),pe(t,"display",e[13])},m(l,u){ks(l,t,u),a&&a.m(t,null),St(t,i),St(t,n),St(n,r)},p(l,[u]){l[12]?a&&(a.d(1),a=null):a?a.p(l,u):(a=Iu(l),a.c(),a.m(t,i)),u&8&&s!==(s="netless-window-manager-cursor-"+l[3]+"-image")&&ue(r,"class",s),u&64&&!Zr(r.src,o=l[6])&&ue(r,"src",o),u&8&&ue(r,"alt",l[3]),u&48&&pe(t,"transform","translateX("+l[4]+"px) translateY("+l[5]+"px)"),u&8192&&pe(t,"display",l[13])},i:Qr,o:Qr,d(l){l&&Yn(t),a&&a.d()}}}function wv(e,t,i){let n,r,s,o,a,{cursorName:l}=t,{tagName:u}=t,{backgroundColor:h}=t,{appliance:p}=t,{x:w}=t,{y:S}=t,{src:I}=t,{visible:E}=t,{avatar:c}=t,{theme:d}=t,{color:f}=t,{cursorTagBackgroundColor:g}=t,{opacity:m}=t;const y=()=>Object.entries({width:(n?19:28)+"px",height:(n?19:28)+"px",position:n?"initial":"absolute","border-color":n?"white":h,"margin-right":(n?4:0)+"px"}).map(([v,T])=>`${v}: ${T}`).join(";");return e.$$set=v=>{"cursorName"in v&&i(0,l=v.cursorName),"tagName"in v&&i(1,u=v.tagName),"backgroundColor"in v&&i(2,h=v.backgroundColor),"appliance"in v&&i(3,p=v.appliance),"x"in v&&i(4,w=v.x),"y"in v&&i(5,S=v.y),"src"in v&&i(6,I=v.src),"visible"in v&&i(17,E=v.visible),"avatar"in v&&i(7,c=v.avatar),"theme"in v&&i(8,d=v.theme),"color"in v&&i(9,f=v.color),"cursorTagBackgroundColor"in v&&i(10,g=v.cursorTagBackgroundColor),"opacity"in v&&i(11,m=v.opacity)},e.$$.update=()=>{e.$$.dirty&1&&(n=!A.isEmpty(l)),e.$$.dirty&2&&i(15,r=!A.isEmpty(u)),e.$$.dirty&128&&i(14,s=!A.isEmpty(c)),e.$$.dirty&131072&&i(13,o=E?"initial":"none"),e.$$.dirty&8&&i(12,a=p===M.ApplianceNames.laserPointer)},[l,u,h,p,w,S,I,c,d,f,g,m,a,o,s,r,y,E]}class yv extends mv{constructor(t){super();gv(this,t,wv,vv,rv,{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})}}class xv{constructor(t,i,n,r){this.manager=t,this.memberId=i,this.cursorManager=n,this.wrapper=r,this.move=s=>{var o;if(s.type==="main"){const a=this.cursorManager.wrapperRect;this.component&&a&&(this.autoHidden(),this.moveCursor(s,a,this.manager.mainView))}else{const a=this.cursorManager.focusView,l=(o=a==null?void 0:a.divElement)==null?void 0:o.getBoundingClientRect(),u=a==null?void 0:a.camera;a&&l&&u&&this.component&&(this.autoHidden(),this.moveCursor(s,l,a))}},this.leave=()=>{this.hide()},this.updateMember(),this.createCursor(),this.autoHidden()}moveCursor(t,i,n){var l,u;const{x:r,y:s,type:o}=t,a=n==null?void 0:n.screen.convertPointToScreen(r,s);if(a){let h=a.x-2,p=a.y-18;if(o==="app"){const w=this.cursorManager.playgroundRect;w&&(h=h+i.x-w.x,p=p+i.y-w.y)}else h=h+i.x,p=p+i.y;a.x<0||a.x>i.width||a.y<0||a.y>i.height?(l=this.component)==null||l.$set({visible:!1,x:h,y:p}):(u=this.component)==null||u.$set({visible:!0,x:h,y:p})}}get memberApplianceName(){var t,i;return(i=(t=this.member)==null?void 0:t.memberState)==null?void 0:i.currentApplianceName}get memberColor(){var i,n;return`rgb(${(n=(i=this.member)==null?void 0:i.memberState)==null?void 0:n.strokeColor.join(",")})`}get payload(){var t;return(t=this.member)==null?void 0:t.payload}get memberCursorName(){var t,i;return((t=this.payload)==null?void 0:t.nickName)||((i=this.payload)==null?void 0:i.cursorName)||this.memberId}get memberTheme(){var t;return(t=this.payload)!=null&&t.theme?"netless-window-manager-cursor-inner-mellow":"netless-window-manager-cursor-inner"}get memberCursorTextColor(){var t;return((t=this.payload)==null?void 0:t.cursorTextColor)||"#FFFFFF"}get memberCursorTagBackgroundColor(){var t;return((t=this.payload)==null?void 0:t.cursorTagBackgroundColor)||this.memberColor}get memberAvatar(){var t;return(t=this.payload)==null?void 0:t.avatar}get memberOpacity(){return!this.memberCursorName&&!this.memberAvatar?0:1}get memberTagName(){var t;return(t=this.payload)==null?void 0:t.cursorTagName}autoHidden(){this.timer&&clearTimeout(this.timer),this.timer=window.setTimeout(()=>{this.hide()},1e3*10)}async createCursor(){this.member&&this.wrapper&&(this.component=new yv({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){const t=this.cursorManager.applianceIcons;return t[this.memberApplianceName||M.ApplianceNames.shape]||t[M.ApplianceNames.shape]}}updateMember(){return this.member=xd(this.manager.room,this.memberId),this.updateComponent(),this.member}updateComponent(){var t;(t=this.component)==null||t.$set(A.omit(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())}}var Sv="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==",Cv="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==",bv="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=",Mv="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDBweCIgaGVpZ2h0PSI0MHB4IiB2aWV3Qm94PSIwIDAgNDAgNDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDYwLjEgKDg4MTMzKSAtIGh0dHBzOi8vc2tldGNoLmNvbSAtLT4KICAgIDx0aXRsZT5zaGFwZS1jdXJzb3I8L3RpdGxlPgogICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+CiAgICA8ZGVmcz4KICAgICAgICA8cGF0aCBkPSJNMjAsMjEuNSBDMjAuMjQ1NDU5OSwyMS41IDIwLjQ0OTYwODQsMjEuNjc2ODc1MiAyMC40OTE5NDQzLDIxLjkxMDEyNDQgTDIwLjUsMjIgTDIwLjUsMjcgQzIwLjUsMjcuMjc2MTQyNCAyMC4yNzYxNDI0LDI3LjUgMjAsMjcuNSBDMTkuNzU0NTQwMSwyNy41IDE5LjU1MDM5MTYsMjcuMzIzMTI0OCAxOS41MDgwNTU3LDI3LjA4OTg3NTYgTDE5LjUsMjcgTDE5LjUsMjIgQzE5LjUsMjEuNzIzODU3NiAxOS43MjM4NTc2LDIxLjUgMjAsMjEuNSBaIE0yNywxOS41IEMyNy4yNzYxNDI0LDE5LjUgMjcuNSwxOS43MjM4NTc2IDI3LjUsMjAgQzI3LjUsMjAuMjQ1NDU5OSAyNy4zMjMxMjQ4LDIwLjQ0OTYwODQgMjcuMDg5ODc1NiwyMC40OTE5NDQzIEwyNywyMC41IEwyMiwyMC41IEMyMS43MjM4NTc2LDIwLjUgMjEuNSwyMC4yNzYxNDI0IDIxLjUsMjAgQzIxLjUsMTkuNzU0NTQwMSAyMS42NzY4NzUyLDE5LjU1MDM5MTYgMjEuOTEwMTI0NCwxOS41MDgwNTU3IEwyMiwxOS41IEwyNywxOS41IFogTTE4LDE5LjUgQzE4LjI3NjE0MjQsMTkuNSAxOC41LDE5LjcyMzg1NzYgMTguNSwyMCBDMTguNSwyMC4yNDU0NTk5IDE4LjMyMzEyNDgsMjAuNDQ5NjA4NCAxOC4wODk4NzU2LDIwLjQ5MTk0NDMgTDE4LDIwLjUgTDEzLDIwLjUgQzEyLjcyMzg1NzYsMjAuNSAxMi41LDIwLjI3NjE0MjQgMTIuNSwyMCBDMTIuNSwxOS43NTQ1NDAxIDEyLjY3Njg3NTIsMTkuNTUwMzkxNiAxMi45MTAxMjQ0LDE5LjUwODA1NTcgTDEzLDE5LjUgTDE4LDE5LjUgWiBNMjAsMTIuNSBDMjAuMjQ1NDU5OSwxMi41IDIwLjQ0OTYwODQsMTIuNjc2ODc1MiAyMC40OTE5NDQzLDEyLjkxMDEyNDQgTDIwLjUsMTMgTDIwLjUsMTggQzIwLjUsMTguMjc2MTQyNCAyMC4yNzYxNDI0LDE4LjUgMjAsMTguNSBDMTkuNzU0NTQwMSwxOC41IDE5LjU1MDM5MTYsMTguMzIzMTI0OCAxOS41MDgwNTU3LDE4LjA4OTg3NTYgTDE5LjUsMTggTDE5LjUsMTMgQzE5LjUsMTIuNzIzODU3NiAxOS43MjM4NTc2LDEyLjUgMjAsMTIuNSBaIiBpZD0icGF0aC0xIj48L3BhdGg+CiAgICAgICAgPGZpbHRlciB4PSItNjQuNiUiIHk9Ii01OS41JSIgd2lkdGg9IjIyOS4zJSIgaGVpZ2h0PSIyNDYuMSUiIGZpbHRlclVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgaWQ9ImZpbHRlci0yIj4KICAgICAgICAgICAgPGZlTW9ycGhvbG9neSByYWRpdXM9IjEiIG9wZXJhdG9yPSJkaWxhdGUiIGluPSJTb3VyY2VBbHBoYSIgcmVzdWx0PSJzaGFkb3dTcHJlYWRPdXRlcjEiPjwvZmVNb3JwaG9sb2d5PgogICAgICAgICAgICA8ZmVPZmZzZXQgZHg9IjAiIGR5PSIyIiBpbj0ic2hhZG93U3ByZWFkT3V0ZXIxIiByZXN1bHQ9InNoYWRvd09mZnNldE91dGVyMSI+PC9mZU9mZnNldD4KICAgICAgICAgICAgPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iMyIgaW49InNoYWRvd09mZnNldE91dGVyMSIgcmVzdWx0PSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlR2F1c3NpYW5CbHVyPgogICAgICAgICAgICA8ZmVDb21wb3NpdGUgaW49InNoYWRvd0JsdXJPdXRlcjEiIGluMj0iU291cmNlQWxwaGEiIG9wZXJhdG9yPSJvdXQiIHJlc3VsdD0ic2hhZG93Qmx1ck91dGVyMSI+PC9mZUNvbXBvc2l0ZT4KICAgICAgICAgICAgPGZlQ29sb3JNYXRyaXggdmFsdWVzPSIwIDAgMCAwIDAgICAwIDAgMCAwIDAgICAwIDAgMCAwIDAgIDAgMCAwIDAuMTYgMCIgdHlwZT0ibWF0cml4IiBpbj0ic2hhZG93Qmx1ck91dGVyMSI+PC9mZUNvbG9yTWF0cml4PgogICAgICAgIDwvZmlsdGVyPgogICAgPC9kZWZzPgogICAgPGcgaWQ9Iumhtemdoi00IiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iV2hpdGVib2FyZC1HdWlkZWxpbmVzIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMzQ0LjAwMDAwMCwgLTc1MS4wMDAwMDApIj4KICAgICAgICAgICAgPGcgaWQ9InNoYXBlLWN1cnNvciIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMzQ0LjAwMDAwMCwgNzUxLjAwMDAwMCkiPgogICAgICAgICAgICAgICAgPHJlY3QgaWQ9IuefqeW9ouWkh+S7vS00NCIgZmlsbD0iI0ZGRkZGRiIgb3BhY2l0eT0iMC4wMSIgeD0iMCIgeT0iMCIgd2lkdGg9IjQwIiBoZWlnaHQ9IjQwIiByeD0iMiI+PC9yZWN0PgogICAgICAgICAgICAgICAgPGcgaWQ9IuW9oueKtue7k+WQiCIgZmlsbC1ydWxlPSJub256ZXJvIj4KICAgICAgICAgICAgICAgICAgICA8dXNlIGZpbGw9ImJsYWNrIiBmaWxsLW9wYWNpdHk9IjEiIGZpbHRlcj0idXJsKCNmaWx0ZXItMikiIHhsaW5rOmhyZWY9IiNwYXRoLTEiPjwvdXNlPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIHN0cm9rZT0iI0ZGRkZGRiIgc3Ryb2tlLXdpZHRoPSIxIiBkPSJNMjAsMjEgQzIwLjQ4NTQxMDMsMjEgMjAuODk4MDg1LDIxLjM0Nzk5OTMgMjAuOTg5OTQ3OSwyMS44NjU0ODc3IEwyMSwyMiBMMjEsMjcgQzIxLDI3LjU1MjI4NDcgMjAuNTUyMjg0NywyOCAyMCwyOCBDMTkuNTE0NTg5NywyOCAxOS4xMDE5MTUsMjcuNjUyMDAwNyAxOS4wMTAwNTIxLDI3LjEzNDUxMjMgTDE5LDI3IEwxOSwyMiBDMTksMjEuNDQ3NzE1MyAxOS40NDc3MTUzLDIxIDIwLDIxIFogTTI3LDE5IEMyNy41NTIyODQ3LDE5IDI4LDE5LjQ0NzcxNTMgMjgsMjAgQzI4LDIwLjQ4NTQxMDMgMjcuNjUyMDAwNywyMC44OTgwODUgMjcuMTM0NTEyMywyMC45ODk5NDc5IEwyNywyMSBMMjIsMjEgQzIxLjQ0NzcxNTMsMjEgMjEsMjAuNTUyMjg0NyAyMSwyMCBDMjEsMTkuNTE0NTg5NyAyMS4zNDc5OTkzLDE5LjEwMTkxNSAyMS44NjU0ODc3LDE5LjAxMDA1MjEgTDIyLDE5IEwyNywxOSBaIE0xOCwxOSBDMTguNTUyMjg0NywxOSAxOSwxOS40NDc3MTUzIDE5LDIwIEMxOSwyMC40ODU0MTAzIDE4LjY1MjAwMDcsMjAuODk4MDg1IDE4LjEzNDUxMjMsMjAuOTg5OTQ3OSBMMTgsMjEgTDEzLDIxIEMxMi40NDc3MTUzLDIxIDEyLDIwLjU1MjI4NDcgMTIsMjAgQzEyLDE5LjUxNDU4OTcgMTIuMzQ3OTk5MywxOS4xMDE5MTUgMTIuODY1NDg3NywxOS4wMTAwNTIxIEwxMywxOSBMMTgsMTkgWiBNMjAsMTIgQzIwLjQ4NTQxMDMsMTIgMjAuODk4MDg1LDEyLjM0Nzk5OTMgMjAuOTg5OTQ3OSwxMi44NjU0ODc3IEwyMSwxMyBMMjEsMTggQzIxLDE4LjU1MjI4NDcgMjAuNTUyMjg0NywxOSAyMCwxOSBDMTkuNTE0NTg5NywxOSAxOS4xMDE5MTUsMTguNjUyMDAwNyAxOS4wMTAwNTIxLDE4LjEzNDUxMjMgTDE5LDE4IEwxOSwxMyBDMTksMTIuNDQ3NzE1MyAxOS40NDc3MTUzLDEyIDIwLDEyIFoiIGZpbGw9IiMyMTIzMjQiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PC9wYXRoPgogICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICAgICAgPHJlY3QgaWQ9IuefqeW9oiIgZmlsbD0iI0ZGRkZGRiIgeD0iMTguNSIgeT0iMTciIHdpZHRoPSIzIiBoZWlnaHQ9IjYiPjwvcmVjdD4KICAgICAgICAgICAgICAgIDxyZWN0IGlkPSLnn6nlvaIiIGZpbGw9IiNGRkZGRkYiIHg9IjE3IiB5PSIxOC41IiB3aWR0aD0iNiIgaGVpZ2h0PSIzIj48L3JlY3Q+CiAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMjAsMjEuNSBDMjAuMjQ1NDU5OSwyMS41IDIwLjQ0OTYwODQsMjEuNjc2ODc1MiAyMC40OTE5NDQzLDIxLjkxMDEyNDQgTDIwLjUsMjIgTDIwLjUsMjcgQzIwLjUsMjcuMjc2MTQyNCAyMC4yNzYxNDI0LDI3LjUgMjAsMjcuNSBDMTkuNzU0NTQwMSwyNy41IDE5LjU1MDM5MTYsMjcuMzIzMTI0OCAxOS41MDgwNTU3LDI3LjA4OTg3NTYgTDE5LjUsMjcgTDE5LjUsMjIgQzE5LjUsMjEuNzIzODU3NiAxOS43MjM4NTc2LDIxLjUgMjAsMjEuNSBaIE0yNywxOS41IEMyNy4yNzYxNDI0LDE5LjUgMjcuNSwxOS43MjM4NTc2IDI3LjUsMjAgQzI3LjUsMjAuMjQ1NDU5OSAyNy4zMjMxMjQ4LDIwLjQ0OTYwODQgMjcuMDg5ODc1NiwyMC40OTE5NDQzIEwyNywyMC41IEwyMiwyMC41IEMyMS43MjM4NTc2LDIwLjUgMjEuNSwyMC4yNzYxNDI0IDIxLjUsMjAgQzIxLjUsMTkuNzU0NTQwMSAyMS42NzY4NzUyLDE5LjU1MDM5MTYgMjEuOTEwMTI0NCwxOS41MDgwNTU3IEwyMiwxOS41IEwyNywxOS41IFogTTE4LDE5LjUgQzE4LjI3NjE0MjQsMTkuNSAxOC41LDE5LjcyMzg1NzYgMTguNSwyMCBDMTguNSwyMC4yNDU0NTk5IDE4LjMyMzEyNDgsMjAuNDQ5NjA4NCAxOC4wODk4NzU2LDIwLjQ5MTk0NDMgTDE4LDIwLjUgTDEzLDIwLjUgQzEyLjcyMzg1NzYsMjAuNSAxMi41LDIwLjI3NjE0MjQgMTIuNSwyMCBDMTIuNSwxOS43NTQ1NDAxIDEyLjY3Njg3NTIsMTkuNTUwMzkxNiAxMi45MTAxMjQ0LDE5LjUwODA1NTcgTDEzLDE5LjUgTDE4LDE5LjUgWiBNMjAsMTIuNSBDMjAuMjQ1NDU5OSwxMi41IDIwLjQ0OTYwODQsMTIuNjc2ODc1MiAyMC40OTE5NDQzLDEyLjkxMDEyNDQgTDIwLjUsMTMgTDIwLjUsMTggQzIwLjUsMTguMjc2MTQyNCAyMC4yNzYxNDI0LDE4LjUgMjAsMTguNSBDMTkuNzU0NTQwMSwxOC41IDE5LjU1MDM5MTYsMTguMzIzMTI0OCAxOS41MDgwNTU3LDE4LjA4OTg3NTYgTDE5LjUsMTggTDE5LjUsMTMgQzE5LjUsMTIuNzIzODU3NiAxOS43MjM4NTc2LDEyLjUgMjAsMTIuNSBaIiBpZD0i5b2i54q257uT5ZCIIiBmaWxsPSIjMjEyMzI0IiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+",Iv="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDdweCIgaGVpZ2h0PSI0MHB4IiB2aWV3Qm94PSIwIDAgNDcgNDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDYwLjEgKDg4MTMzKSAtIGh0dHBzOi8vc2tldGNoLmNvbSAtLT4KICAgIDx0aXRsZT50ZXh0LWN1cnNvcjwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPgogICAgICAgIDxwYXRoIGQ9Ik0xNiwyNi41IEMxNS43MjM4NTc2LDI2LjUgMTUuNSwyNi4yNzYxNDI0IDE1LjUsMjYgQzE1LjUsMjUuNzU0NTQwMSAxNS42NzY4NzUyLDI1LjU1MDM5MTYgMTUuOTEwMTI0NCwyNS41MDgwNTU3IEwxNiwyNS41IEwxOS41LDI1LjUgTDE5LjUsMTQuNSBMMTYsMTQuNSBDMTUuNzIzODU3NiwxNC41IDE1LjUsMTQuMjc2MTQyNCAxNS41LDE0IEMxNS41LDEzLjc1NDU0MDEgMTUuNjc2ODc1MiwxMy41NTAzOTE2IDE1LjkxMDEyNDQsMTMuNTA4MDU1NyBMMTYsMTMuNSBMMjQsMTMuNSBDMjQuMjc2MTQyNCwxMy41IDI0LjUsMTMuNzIzODU3NiAyNC41LDE0IEMyNC41LDE0LjI0NTQ1OTkgMjQuMzIzMTI0OCwxNC40NDk2MDg0IDI0LjA4OTg3NTYsMTQuNDkxOTQ0MyBMMjQsMTQuNSBMMjAuNSwxNC41IEwyMC41LDI1LjUgTDI0LDI1LjUgQzI0LjI3NjE0MjQsMjUuNSAyNC41LDI1LjcyMzg1NzYgMjQuNSwyNiBDMjQuNSwyNi4yNDU0NTk5IDI0LjMyMzEyNDgsMjYuNDQ5NjA4NCAyNC4wODk4NzU2LDI2LjQ5MTk0NDMgTDI0LDI2LjUgTDE2LDI2LjUgWiIgaWQ9InBhdGgtMSI+PC9wYXRoPgogICAgICAgIDxmaWx0ZXIgeD0iLTI4NC4wJSIgeT0iLTgxLjUlIiB3aWR0aD0iNjY4LjElIiBoZWlnaHQ9IjI5My45JSIgZmlsdGVyVW5pdHM9Im9iamVjdEJvdW5kaW5nQm94IiBpZD0iZmlsdGVyLTIiPgogICAgICAgICAgICA8ZmVNb3JwaG9sb2d5IHJhZGl1cz0iMSIgb3BlcmF0b3I9ImRpbGF0ZSIgaW49IlNvdXJjZUFscGhhIiByZXN1bHQ9InNoYWRvd1NwcmVhZE91dGVyMSI+PC9mZU1vcnBob2xvZ3k+CiAgICAgICAgICAgIDxmZU9mZnNldCBkeD0iMCIgZHk9IjIiIGluPSJzaGFkb3dTcHJlYWRPdXRlcjEiIHJlc3VsdD0ic2hhZG93T2Zmc2V0T3V0ZXIxIj48L2ZlT2Zmc2V0PgogICAgICAgICAgICA8ZmVHYXVzc2lhbkJsdXIgc3RkRGV2aWF0aW9uPSIzIiBpbj0ic2hhZG93T2Zmc2V0T3V0ZXIxIiByZXN1bHQ9InNoYWRvd0JsdXJPdXRlcjEiPjwvZmVHYXVzc2lhbkJsdXI+CiAgICAgICAgICAgIDxmZUNvbXBvc2l0ZSBpbj0ic2hhZG93Qmx1ck91dGVyMSIgaW4yPSJTb3VyY2VBbHBoYSIgb3BlcmF0b3I9Im91dCIgcmVzdWx0PSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlQ29tcG9zaXRlPgogICAgICAgICAgICA8ZmVDb2xvck1hdHJpeCB2YWx1ZXM9IjAgMCAwIDAgMCAgIDAgMCAwIDAgMCAgIDAgMCAwIDAgMCAgMCAwIDAgMC4xNiAwIiB0eXBlPSJtYXRyaXgiIGluPSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlQ29sb3JNYXRyaXg+CiAgICAgICAgPC9maWx0ZXI+CiAgICA8L2RlZnM+CiAgICA8ZyBpZD0i6aG16Z2iLTQiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSJXaGl0ZWJvYXJkLUd1aWRlbGluZXMiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0zODguMDAwMDAwLCAtNjcyLjAwMDAwMCkiPgogICAgICAgICAgICA8ZyBpZD0idGV4dC1jdXJzb3IiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDM5Mi4wMDAwMDAsIDY3Mi4wMDAwMDApIj4KICAgICAgICAgICAgICAgIDxyZWN0IGlkPSLnn6nlvaLlpIfku70tNDAiIGZpbGw9IiNGRkZGRkYiIG9wYWNpdHk9IjAuMDEiIHg9IjAiIHk9IjAiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgcng9IjIiPjwvcmVjdD4KICAgICAgICAgICAgICAgIDxnIGlkPSLlvaLnirbnu5PlkIgiIGZpbGwtcnVsZT0ibm9uemVybyI+CiAgICAgICAgICAgICAgICAgICAgPHVzZSBmaWxsPSJibGFjayIgZmlsbC1vcGFjaXR5PSIxIiBmaWx0ZXI9InVybCgjZmlsdGVyLTIpIiB4bGluazpocmVmPSIjcGF0aC0xIj48L3VzZT4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBzdHJva2U9IiNGRkZGRkYiIHN0cm9rZS13aWR0aD0iMSIgZD0iTTE5LDI1IEwxOSwxNSBMMTYsMTUgQzE1LjQ0NzcxNTMsMTUgMTUsMTQuNTUyMjg0NyAxNSwxNCBDMTUsMTMuNTE0NTg5NyAxNS4zNDc5OTkzLDEzLjEwMTkxNSAxNS44NjU0ODc3LDEzLjAxMDA1MjEgTDE2LDEzIEwyNCwxMyBDMjQuNTUyMjg0NywxMyAyNSwxMy40NDc3MTUzIDI1LDE0IEMyNSwxNC40ODU0MTAzIDI0LjY1MjAwMDcsMTQuODk4MDg1IDI0LjEzNDUxMjMsMTQuOTg5OTQ3OSBMMjQsMTUgTDIxLDE1IEwyMSwyNSBMMjQsMjUgQzI0LjU1MjI4NDcsMjUgMjUsMjUuNDQ3NzE1MyAyNSwyNiBDMjUsMjYuNDg1NDEwMyAyNC42NTIwMDA3LDI2Ljg5ODA4NSAyNC4xMzQ1MTIzLDI2Ljk4OTk0NzkgTDI0LDI3IEwxNiwyNyBDMTUuNDQ3NzE1MywyNyAxNSwyNi41NTIyODQ3IDE1LDI2IEMxNSwyNS41MTQ1ODk3IDE1LjM0Nzk5OTMsMjUuMTAxOTE1IDE1Ljg2NTQ4NzcsMjUuMDEwMDUyMSBMMTYsMjUgTDE5LDI1IFoiIGZpbGw9IiMyMTIzMjQiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PC9wYXRoPgogICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICA8L2c+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4=",Av="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjhweCIgaGVpZ2h0PSIyOHB4IiB2aWV3Qm94PSIwIDAgMjggMjgiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDU1LjEgKDc4MTM2KSAtIGh0dHBzOi8vc2tldGNoYXBwLmNvbSAtLT4KICAgIDx0aXRsZT7nvJbnu4QgMjwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPgogICAgICAgIDxmaWx0ZXIgeD0iLTEyMC4wJSIgeT0iLTEyMC4wJSIgd2lkdGg9IjM0MC4wJSIgaGVpZ2h0PSIzNDAuMCUiIGZpbHRlclVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgaWQ9ImZpbHRlci0xIj4KICAgICAgICAgICAgPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iNCIgaW49IlNvdXJjZUdyYXBoaWMiPjwvZmVHYXVzc2lhbkJsdXI+CiAgICAgICAgPC9maWx0ZXI+CiAgICA8L2RlZnM+CiAgICA8ZyBpZD0i6aG16Z2iMSIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPGcgaWQ9Iue8lue7hC0yIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg5LjAwMDAwMCwgOS4wMDAwMDApIiBmaWxsPSIjRkYwMTAwIj4KICAgICAgICAgICAgPGNpcmNsZSBpZD0i5qSt5ZyG5b2iIiBmaWx0ZXI9InVybCgjZmlsdGVyLTEpIiBjeD0iNSIgY3k9IjUiIHI9IjUiPjwvY2lyY2xlPgogICAgICAgICAgICA8cGF0aCBkPSJNNSw4IEM2LjY1Njg1NDI1LDggOCw2LjY1Njg1NDI1IDgsNSBDOCwzLjM0MzE0NTc1IDYuNjU2ODU0MjUsMiA1LDIgQzMuMzQzMTQ1NzUsMiAyLDMuMzQzMTQ1NzUgMiw1IEMyLDYuNjU2ODU0MjUgMy4zNDMxNDU3NSw4IDUsOCBaIE01LDYuMjg1NzE0MjkgQzQuMjg5OTE5NjEsNi4yODU3MTQyOSAzLjcxNDI4NTcxLDUuNzEwMDgwMzkgMy43MTQyODU3MSw1IEMzLjcxNDI4NTcxLDQuMjg5OTE5NjEgNC4yODk5MTk2MSwzLjcxNDI4NTcxIDUsMy43MTQyODU3MSBDNS43MTAwODAzOSwzLjcxNDI4NTcxIDYuMjg1NzE0MjksNC4yODk5MTk2MSA2LjI4NTcxNDI5LDUgQzYuMjg1NzE0MjksNS43MTAwODAzOSA1LjcxMDA4MDM5LDYuMjg1NzE0MjkgNSw2LjI4NTcxNDI5IFoiIGlkPSLmpK3lnIblvaIiIGZpbGwtcnVsZT0ibm9uemVybyI+PC9wYXRoPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+";const Tu={[M.ApplianceNames.pencil]:Sv,[M.ApplianceNames.selector]:Cv,[M.ApplianceNames.eraser]:bv,[M.ApplianceNames.shape]:Mv,[M.ApplianceNames.text]:Iv,[M.ApplianceNames.laserPointer]:Av};class Ev{constructor(t,i,n){var s;this.manager=t,this.enableCursor=i,this.cursorInstances=new Map,this.sideEffectManager=new Oe.SideEffectManager,this.store=this.manager.store,this.applianceIcons=Tu,this.onCursorMove=o=>{const a=this.initCursorInstance(o.uid);if(o.state===ld.Leave)a.leave();else{const l=a.updateMember();this.canMoveCursor(l)&&a.move(o.position)}},this.initCursorInstance=o=>{let a=this.cursorInstances.get(o);return a||(a=new xv(this.manager,o,this,me.playground),this.cursorInstances.set(o,a)),a},this.mouseMoveListener=A.throttle(o=>{o.pointerType==="touch"&&!o.isPrimary||this.updateCursor(this.getType(o),o.clientX,o.clientY)},16),this.getPoint=(o,a,l)=>{var h;const u=(h=o==null?void 0:o.divElement)==null?void 0:h.getBoundingClientRect();if(u)return o==null?void 0:o.convertToPointInWorld({x:a-u.x,y:l-u.y})},this.getType=o=>{var u;const a=o.target,l=this.manager.focusApp;switch(a.parentElement){case this.mainViewElement:return{type:"main"};case((u=l==null?void 0:l.view)==null?void 0:u.divElement):return{type:"app"};default:return{type:"main"}}},this.mouseLeaveListener=()=>{this.hideCursor(this.manager.uid)},this.roomMembers=(s=this.manager.room)==null?void 0:s.state.roomMembers;const r=me.playground;r&&this.setupWrapper(r),this.sideEffectManager.add(()=>j.on("cursorMove",this.onCursorMove)),this.sideEffectManager.add(()=>j.on("playgroundSizeChange",()=>this.updateContainerRect())),n&&(this.applianceIcons=H(H({},Tu),n))}canMoveCursor(t){const i=(t==null?void 0:t.memberState.currentApplianceName)===M.ApplianceNames.laserPointer;return this.enableCursor||i}setupWrapper(t){this.sideEffectManager.add(()=>(t.addEventListener("pointerenter",this.mouseMoveListener),t.addEventListener("pointermove",this.mouseMoveListener),t.addEventListener("pointerleave",this.mouseLeaveListener),()=>{t.removeEventListener("pointerenter",this.mouseMoveListener),t.removeEventListener("pointermove",this.mouseMoveListener),t.removeEventListener("pointerleave",this.mouseLeaveListener)}))}setMainViewDivElement(t){this.mainViewElement=t}get boxState(){return this.store.getBoxState()}get focusView(){var t;return(t=this.manager.focusApp)==null?void 0:t.view}updateCursor(t,i,n){if(this.wrapperRect&&this.manager.canOperate){const r=t.type==="main"?this.manager.mainView:this.focusView,s=this.getPoint(r,i,n);s&&this.manager.dispatchInternalEvent(Y.CursorMove,{uid:this.manager.uid,position:{x:s.x,y:s.y,type:t.type}})}}updateContainerRect(){var t,i;this.wrapperRect=(t=this.manager.boxManager)==null?void 0:t.teleBoxManager.stageRect,this.playgroundRect=(i=me.playground)==null?void 0:i.getBoundingClientRect()}deleteCursor(t){this.store.cleanCursor(t);const i=this.cursorInstances.get(t);i&&i.destroy()}hideCursor(t){const i=this.cursorInstances.get(t);i&&i.hide()}destroy(){this.sideEffectManager.flushAll(),this.cursorInstances.size&&(this.cursorInstances.forEach(t=>{t.destroy()}),this.cursorInstances.clear())}}class Tv{constructor(t){this.manager=t,j.on("changePageState",()=>{ie.emit("pageStateChange",this.toObject())})}get index(){var t;return((t=this.manager)==null?void 0:t.store.getMainViewSceneIndex())||0}get length(){var t;return((t=this.manager)==null?void 0:t.mainViewScenesLength)||0}toObject(){return{index:this.index>=this.length?this.length-1:this.index,length:this.length}}}class kv{constructor(t){this.ctx=t,this.reactors=new Map,this.disposers=new Map,this.onPhaseChanged=i=>{var n,r;i===M.RoomPhase.Reconnecting&&this.ctx.emitter.emit("startReconnect"),i===M.RoomPhase.Connected&&this.phase===M.RoomPhase.Reconnecting&&((n=this.room)!=null&&n.isWritable?(r=this.room)==null||r.dispatchMagixEvent(Xs,{}):this.onReconnected()),this.phase=i},this.onReconnected=A.debounce(()=>{this._onReconnected()},1e3),this._onReconnected=()=>{jt("onReconnected refresh reactors"),this.releaseDisposers(),this.reactors.forEach((i,n)=>{A.isFunction(i)&&this.disposers.set(n,i())}),this.ctx.emitter.emit("onReconnected")}}setRoom(t){this.room=t,this.phase=t==null?void 0:t.phase,t&&(t.callbacks.off("onPhaseChanged",this.onPhaseChanged),t.callbacks.on("onPhaseChanged",this.onPhaseChanged),t.addMagixEventListener(Xs,i=>{i.authorId===t.observerId&&this.onReconnected()},{fireSelfEventAfterCommit:!0}))}setContext(t){this.ctx=t}releaseDisposers(){this.disposers.forEach(t=>{A.isFunction(t)&&t()}),this.disposers.clear()}refresh(){this._onReconnected()}add(t,i){const n=this.disposers.get(t);return n&&A.isFunction(n)&&n(),A.isFunction(i)&&(this.reactors.set(t,i),this.disposers.set(t,i())),()=>this.remove(t)}remove(t){this.reactors.has(t)&&this.reactors.delete(t);const i=this.disposers.get(t);i&&(A.isFunction(i)&&i(),this.disposers.delete(t))}hasReactor(t){return this.reactors.has(t)}destroy(){var t,i;(t=this.room)==null||t.callbacks.off("onPhaseChanged",this.onPhaseChanged),(i=this.room)==null||i.removeMagixEventListener(Xs,this.onReconnected),this.releaseDisposers()}}const Nv=(e,t)=>{if(M.isPlayer(e))zv(e);else{if(e=e,Object.getOwnPropertyDescriptor(e,"disableCameraTransform"))return;Object.defineProperty(e,"disableCameraTransform",{get(){return t.mainView.disableCameraTransform},set(n){t.mainView.disableCameraTransform=n}}),Object.defineProperty(e,"canUndoSteps",{get(){return t.canUndoSteps}}),Object.defineProperty(e,"canRedoSteps",{get(){return t.canRedoSteps}}),e.moveCamera=n=>t.moveCamera(n),e.moveCameraToContain=(...n)=>t.moveCameraToContain(...n),e.convertToPointInWorld=(...n)=>t.mainView.convertToPointInWorld(...n),e.setCameraBound=(...n)=>t.mainView.setCameraBound(...n),e.scenePreview=(...n)=>t.mainView.scenePreview(...n),e.fillSceneSnapshot=(...n)=>t.mainView.fillSceneSnapshot(...n),e.generateScreenshot=(...n)=>t.mainView.generateScreenshot(...n),e.setMemberState=(...n)=>t.mainView.setMemberState(...n),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=(...n)=>t.insertImage(...n),e.completeImageUpload=(...n)=>t.completeImageUpload(...n),e.insertText=(...n)=>t.insertText(...n),e.lockImage=(...n)=>t.lockImage(...n),e.lockImages=(...n)=>t.lockImages(...n),Pv(e,t),e.dynamicPpt.slideStateAdapter.pptHandler||(e.dynamicPpt.slideStateAdapter.pptHandler=t.createPPTHandler())}},Pv=(e,t)=>{const i=e.removeScenes;e.removeScenes=(n,r)=>{var o;n===je&&((o=t.appManager)==null||o.updateRootDirRemoving(!0));const s=i.call(e,n);return j.emit("removeScenes",{scenePath:n,index:r}),s}},zv=e=>{const t=e.seekToProgressTime;async function i(n){await j.emit("seekStart");const r=await t.call(e,n);return j.emit("seek",n),r}e.seekToProgressTime=i};var Dv=Object.defineProperty,jv=Object.defineProperties,Vv=Object.getOwnPropertyDescriptors,ku=Object.getOwnPropertySymbols,Lv=Object.prototype.hasOwnProperty,Rv=Object.prototype.propertyIsEnumerable,Nu=(e,t,i)=>t in e?Dv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Hd=(e,t)=>{for(var i in t||(t={}))Lv.call(t,i)&&Nu(e,i,t[i]);if(ku)for(var i of ku(t))Rv.call(t,i)&&Nu(e,i,t[i]);return e},Fd=(e,t)=>jv(e,Vv(t)),Bv=`.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}
122
+ background-color: var(--tele-boxFooterBackground, #383b42);
123
+ }`)(),Bd=(e=>(e.Light="light",e.Dark="dark",e.Auto="auto",e))(Bd||{}),ue=(e=>(e.Normal="normal",e.Minimized="minimized",e.Maximized="maximized",e))(ue||{}),be=(e=>(e.DarkMode="dark_mode",e.PrefersColorScheme="prefers_color_scheme",e.Close="close",e.Focus="focus",e.Blur="blur",e.IntrinsicMove="intrinsic_move",e.IntrinsicResize="intrinsic_resize",e.ZIndex="z_index",e.State="state",e.Minimized="minimized",e.Maximized="maximized",e.Readonly="readonly",e.Destroyed="destroyed",e))(be||{}),rt=(e=>(e.Close="close",e.Maximize="maximize",e.Minimize="minimize",e))(rt||{}),it=(e=>(e.North="n",e.South="s",e.West="w",e.East="e",e.NorthWest="nw",e.NorthEast="ne",e.SouthEast="se",e.SouthWest="sw",e))(it||{});const ro="dh";function Ai(e,t,i){return Math.min(Math.max(e,t),i)}function bn(e){e.stopPropagation(),e.cancelable&&e.preventDefault()}let Qm=1;function Zm(){return`New Box ${Qm++}`}class Od{constructor({readonly$:t,state$:i,title$:n,buttons:r,onEvent:s,onDragStart:o,namespace:a="telebox"}){this.sideEffect=new Re.SideEffectManager,this.lastTitleBarClick={timestamp:0,clientX:-100,clientY:-100},this.handleTitleBarClick=l=>{var u;if(!l.isPrimary||this.readonly$.value||l.button!==0||(u=l.target.dataset)!=null&&u.teleTitleBarNoDblClick)return;bn(l);const h=Date.now();h-this.lastTitleBarClick.timestamp<=500?Math.abs(l.clientX-this.lastTitleBarClick.clientX)<=5&&Math.abs(l.clientY-this.lastTitleBarClick.clientY)<=5&&this.onEvent&&this.onEvent({type:rt.Maximize}):this.onDragStart&&this.onDragStart(l),this.lastTitleBarClick.timestamp=h,this.lastTitleBarClick.clientX=l.clientX,this.lastTitleBarClick.clientY=l.clientY},this.readonly$=t,this.state$=i,this.title$=n,this.onEvent=s,this.onDragStart=o,this.namespace=a,this.buttons=r||[{type:rt.Minimize,iconClassName:this.wrapClassName("titlebar-icon-minimize")},{type:rt.Maximize,iconClassName:this.wrapClassName("titlebar-icon-maximize"),isActive:l=>l===ue.Maximized},{type:rt.Close,iconClassName:this.wrapClassName("titlebar-icon-close")}],this.$dragArea=this.renderDragArea()}render(){if(!this.$titleBar){this.$titleBar=document.createElement("div"),this.$titleBar.className=this.wrapClassName("titlebar");const t=document.createElement("div");t.className=this.wrapClassName("title-area"),t.dataset.teleBoxHandle=ro;const i=document.createElement("h1");i.className=this.wrapClassName("title"),i.dataset.teleBoxHandle=ro,t.appendChild(i),t.appendChild(this.$dragArea);const n=document.createElement("div");n.className=this.wrapClassName("titlebar-btns"),this.buttons.forEach(({iconClassName:r},s)=>{const o=String(s),a=document.createElement("button");a.className=`${this.wrapClassName("titlebar-btn")} ${r}`,a.dataset.teleTitleBarBtnIndex=o,a.dataset.teleTitleBarNoDblClick="true",n.appendChild(a)}),this.sideEffect.addDisposer(this.title$.subscribe(r=>{i.textContent=r,i.title=r}),"render-title"),this.sideEffect.addDisposer(this.state$.subscribe(r=>{this.buttons.forEach((s,o)=>{var a;s.isActive&&((a=n.children[o])==null||a.classList.toggle("is-active",s.isActive(r)))})}),"render-state-btns"),this.sideEffect.addEventListener(n,"click",r=>{var s;if(this.readonly$.value)return;const o=r.target,a=Number((s=o.dataset)==null?void 0:s.teleTitleBarBtnIndex);if(!Number.isNaN(a)&&a<this.buttons.length){bn(r);const l=this.buttons[a];this.onEvent&&this.onEvent({type:l.type,value:l.value})}},{},"render-btns-container-click"),this.$titleBar.appendChild(t),this.$titleBar.appendChild(n)}return this.$titleBar}renderDragArea(){const t=document.createElement("div");return t.className=this.wrapClassName("drag-area"),t.dataset.teleBoxHandle=ro,this.sideEffect.addEventListener(t,"pointerdown",this.handleTitleBarClick),t}dragHandle(){return this.$titleBar}wrapClassName(t){return`${this.namespace}-${t}`}destroy(){this.sideEffect.flushAll(),this.$titleBar&&(this.$titleBar=void 0,this.onDragStart=void 0,this.onEvent=void 0)}}function _d([e,t]){if(t<=0||e.width<=0||e.height<=0)return e;const i=e.width*t;if(i===e.height)return e;if(i<e.height)return{x:0,y:(e.height-i)/2,width:e.width,height:i};const n=e.height/t;return{x:(e.width-n)/2,y:0,width:n,height:e.height}}const Ym=window.ResizeObserver||od.ResizeObserver;class Gm{constructor({id:t=Re.genUID(),title:i=Zm(),namespace:n="telebox",visible:r=!0,width:s=.5,height:o=.5,minWidth:a=0,minHeight:l=0,x:u=.1,y:h=.1,resizable:p=!0,draggable:w=!0,boxRatio:C=-1,focus:E=!1,zIndex:T=100,stageRatio:c=null,enableShadowDOM:d=!0,titleBar:f,content:g,stage:m,footer:x,styles:y,userStyles:N,bodyStyle:D=null,stageStyle:P=null,darkMode$:J,fence$:q,minimized$:ee,maximized$:Fe,readonly$:Q,root:G,rootRect$:Qe,managerStageRect$:ae,managerStageRatio$:Oe,defaultBoxBodyStyle$:_e,defaultBoxStageStyle$:ht,collectorRect$:qt}){this.events=new Zt.default,this._delegateEvents=new Zt.default,this.handleTrackStart=U=>{var F;return(F=this._handleTrackStart)==null?void 0:F.call(this,U)},this._sideEffect=new Re.SideEffectManager,this.id=t,this.namespace=n,this.enableShadowDOM=d;const Et=new M.ValManager;this._sideEffect.addDisposer(()=>Et.destroy());const Ii=new M.Val(i),b=new M.Val(r),v=new M.Val(p),k=new M.Val(w),_=new M.Val(C),$=new M.Val(T),ke=new M.Val(E),ve=M.combine([ee,Fe],([U,F])=>U?ue.Minimized:F?ue.Maximized:ue.Normal),pt=new M.Val({width:Ai(a,0,1),height:Ai(l,0,1)},{compare:Ye}),Tt=M.combine([pt,ae],([U,F])=>({width:U.width*F.width,height:U.height*F.height}),{compare:Ye}),ar=new M.Val({width:s,height:o},{compare:Ye});this._sideEffect.addDisposer(pt.reaction((U,F)=>{ar.setValue({width:Math.max(s,U.width),height:Math.max(o,U.height)},F)}));const Ys=new M.Val({x:u,y:h},{compare:Ye}),Gs=M.combine([ar,ae],([U,F])=>({width:F.width*U.width,height:F.height*U.height}),{compare:Ye}),tn=M.combine([Ys,ae],([U,F])=>({x:U.x*F.width,y:U.y*F.height}),{compare:Ye}),Wf=new M.Val(D),Hf=new M.Val(P),Ff=new M.Val(null),tu=new M.Val(ae.value,{compare:Ye}),iu=new M.Val(c),Qf=M.combine([iu,Oe],([U,F])=>U!=null?U:F),Zf=M.combine([tu,Qf],_d,{compare:Ye}),Yf={darkMode:J,fence:q,minimized:ee,maximized:Fe,readonly:Q,rootRect:Qe,managerStageRect:ae,managerStageRatio:Oe,defaultBoxBodyStyle:_e,defaultBoxStageStyle:ht,collectorRect:qt};M.withReadonlyValueEnhancer(this,Yf);const Gf={zIndex:$,focus:ke,state:ve,minSize:pt,pxMinSize:Tt,intrinsicSize:ar,intrinsicCoord:Ys,pxIntrinsicSize:Gs,pxIntrinsicCoord:tn,bodyRect:tu,stageRect:Zf};M.withReadonlyValueEnhancer(this,Gf,Et);const Xf={title:Ii,visible:b,resizable:v,draggable:k,boxRatio:_,stageRatio:iu,bodyStyle:Wf,stageStyle:Hf};M.withValueEnhancer(this,Xf,Et),this.titleBar=f||new Od({readonly$:Q,state$:ve,title$:Ii,namespace:this.namespace,onDragStart:U=>{var F;return(F=this._handleTrackStart)==null?void 0:F.call(this,U)},onEvent:U=>this._delegateEvents.emit(U.type)}),this._sideEffect.addDisposer(_.subscribe(U=>{U>0&&this.transform(tn.value.x,tn.value.y,Gs.value.width,Gs.value.height)})),this._sideEffect.addDisposer(q.subscribe(U=>{U&&this.move(tn.value.x,tn.value.y)})),this.$box=this._render(),Ff.setValue(this.$content.parentElement),g&&this.mountContent(g),m&&this.mountStage(m),x&&this.mountFooter(x),y&&this.mountStyles(y),N&&this.mountUserStyles(N),G.appendChild(this.$box);const kt=(U,F)=>{this._sideEffect.addDisposer(U.reaction((Jf,Kf)=>{Kf||this.events.emit(F,Jf)}))};kt(J,be.DarkMode),kt(Q,be.Readonly),kt($,be.ZIndex),kt(ee,be.Minimized),kt(Fe,be.Maximized),kt(ve,be.State),kt(ar,be.IntrinsicResize),kt(Ys,be.IntrinsicMove),this._sideEffect.addDisposer([b.reaction((U,F)=>{!F&&!U&&this.events.emit(be.Close)}),ke.reaction((U,F)=>{F||this.events.emit(U?be.Focus:be.Blur)})])}get minWidth(){return this._minSize$.value.width}get minHeight(){return this._minSize$.value.height}setMinWidth(t,i=!1){this._minSize$.setValue({width:t,height:this.minHeight},i)}setMinHeight(t,i=!1){this._minSize$.setValue({width:this.minWidth,height:t},i)}resize(t,i,n=!1){this._intrinsicSize$.setValue({width:Math.max(t,this.minWidth),height:Math.max(i,this.minHeight)},n)}get intrinsicX(){return this._intrinsicCoord$.value.x}get intrinsicY(){return this._intrinsicCoord$.value.y}get intrinsicWidth(){return this._intrinsicSize$.value.width}get intrinsicHeight(){return this._intrinsicSize$.value.height}move(t,i,n=!1){let r,s;const o=this.managerStageRect,a=this.pxIntrinsicSize;this.fence?(r=Ai(t,0,o.width-a.width),s=Ai(i,0,o.height-a.height)):(r=Ai(t,-(a.width-120),0+o.width-20),s=Ai(i,0,0+o.height-20)),this._intrinsicCoord$.setValue({x:r/o.width,y:s/o.height},n)}transform(t,i,n,r,s=!1){const o=this.managerStageRect;if(n=Math.max(n,this.pxMinSize.width),r=Math.max(r,this.pxMinSize.height),this.boxRatio>0){const a=this.boxRatio*n;i!==this.pxIntrinsicCoord.y&&(i-=a-r),r=a}i<0&&(i=0,r=this.pxIntrinsicSize.height),this.move(t,i,s),this._intrinsicSize$.setValue({width:n/o.width,height:r/o.height},s)}mountContent(t){var i;(i=this.$authorContent)==null||i.remove(),this.$authorContent=t,this.$content.appendChild(t)}unmountContent(){this.$authorContent&&(this.$authorContent.remove(),this.$authorContent=void 0)}mountStage(t){var i;(i=this.$authorStage)==null||i.remove(),this.$authorStage=t,this.$stage||(this.$stage=this._renderStage()),this.$stage.appendChild(t),this.$stage.parentElement||this.$body.appendChild(this.$stage)}unmountStage(){var t;this.$authorStage&&(this.$authorStage.remove(),this.$authorStage=void 0),(t=this.$stage)==null||t.remove()}mountFooter(t){var i;(i=this.$authorFooter)==null||i.remove(),this.$authorFooter=t,this.$footer.appendChild(t)}unmountFooter(){this.$authorFooter&&(this.$authorFooter.remove(),this.$authorFooter=void 0)}mountStyles(t){this.$styles.textContent=t}unmountStyles(){this.$styles.textContent=""}mountUserStyles(t){this.$userStyles.textContent=t}unmountUserStyles(){this.$userStyles.textContent=""}_render(){if(this.$box)return this.$box;const t=(c,d)=>this._sideEffect.addDisposer([this._readonly$.subscribe(f=>c.classList.toggle(this.wrapClassName("readonly"),f)),this._draggable$.subscribe(f=>c.classList.toggle(this.wrapClassName("no-drag"),!f)),this._resizable$.subscribe(f=>c.classList.toggle(this.wrapClassName("no-resize"),!f)),this._focus$.subscribe(f=>c.classList.toggle(this.wrapClassName("blur"),!f)),this._darkMode$.subscribe(f=>{c.classList.toggle(this.wrapClassName("color-scheme-dark"),f),c.classList.toggle(this.wrapClassName("color-scheme-light"),!f)})],d);this.$box=document.createElement("div"),this.$box.classList.add(this.wrapClassName("box")),t(this.$box,"bind-box-state"),this._sideEffect.add(()=>{const c=this.wrapClassName("minimized"),d=this.wrapClassName("maximized"),f="box-maximized-timer";return this._state$.subscribe(g=>{this.$box.classList.toggle(c,g===ue.Minimized),g===ue.Maximized?(this._sideEffect.flush(f),this.$box.classList.toggle(d,!0)):this._sideEffect.setTimeout(()=>{this.$box.classList.toggle(d,!1)},0,f)})}),this._sideEffect.addDisposer(this._visible$.subscribe(c=>{this.$box.style.display=c?"block":"none"})),this._sideEffect.addDisposer(this._zIndex$.subscribe(c=>{this.$box.style.zIndex=String(c)})),this.$box.dataset.teleBoxID=this.id;const i=Hm(this.$box),n=M.combine([this._maximized$,this._minimized$,this._pxIntrinsicSize$,this._pxIntrinsicCoord$,this._collectorRect$,this._rootRect$,this._managerStageRect$],([c,d,f,g,m,x,y])=>{const N=c?{x:-y.x,y:-y.y,width:x.width,height:x.height,scaleX:1,scaleY:1}:{x:g.x,y:g.y,width:f.width,height:f.height,scaleX:1,scaleY:1};if(d&&m){const{width:D,height:P}=c?this.rootRect:f;N.x=m.x-D/2+m.width/2-y.x,N.y=m.y-P/2+m.height/2-y.y,N.scaleX=m.width/D,N.scaleY=m.height/P}return N},{compare:Ye}),r=n.value;this.$box.style.width=r.width+"px",this.$box.style.height=r.height+"px",this.$box.style.transform=`translate(${r.x-10}px,${r.y-10}px)`,this._sideEffect.addDisposer(n.subscribe(c=>{i.set(c)}));const s=document.createElement("div");s.className=this.wrapClassName("box-main"),this.$box.appendChild(s);const o=document.createElement("div");o.className=this.wrapClassName("titlebar-wrap"),o.appendChild(this.titleBar.render()),this.$titleBar=o;const a=document.createElement("div");a.className=this.wrapClassName("body-wrap"),this.$body=a;const l=document.createElement("style");this.$styles=l,a.appendChild(l);const u=document.createElement("style");this.$userStyles=u,a.appendChild(u);const h=document.createElement("div");h.className=this.wrapClassName("content")+" tele-fancy-scrollbar",this.$content=h,this._sideEffect.addDisposer(M.combine([this._bodyStyle$,this._defaultBoxBodyStyle$],([c,d])=>c!=null?c:d).subscribe(c=>h.style.cssText=c||"")),a.appendChild(h);const p=document.createElement("div");p.className=this.wrapClassName("footer-wrap"),this.$footer=p,s.appendChild(o);const w=document.createElement("div");w.className=this.wrapClassName("main"),this.$main=w,s.appendChild(w);const C=document.createElement("div");C.className=this.wrapClassName("quarantine-outer"),w.appendChild(C);const E=document.createElement("div");if(E.className=this.wrapClassName("quarantine"),E.appendChild(a),E.appendChild(p),this.enableShadowDOM){t(E,"bind-quarantine-state");const c=document.createElement("style");c.textContent=Fm,E.insertBefore(c,E.firstChild),C.attachShadow({mode:"open"}).appendChild(E)}else C.appendChild(E);this._renderResizeHandlers();const T=()=>{const c=a.getBoundingClientRect();this._bodyRect$.setValue({x:0,y:0,width:c.width,height:c.height})};return this._sideEffect.add(()=>{const c=new Ym(()=>{this.minimized||T()});return c.observe(a),()=>c.disconnect()}),this._sideEffect.addDisposer(this._minimized$.reaction(c=>{c||this._sideEffect.setTimeout(T,400,"minimized-content-rect-fix")})),this.$box}_renderStage(){const t=document.createElement("div");t.className=this.wrapClassName("box-stage");const i=n=>{t.style.top=n.y+"px",t.style.left=n.x+"px",t.style.width=n.width+"px",t.style.height=n.height+"px"};return this._sideEffect.addDisposer([M.combine([this._stageStyle$,this._defaultBoxStageStyle$],([n,r])=>n!=null?n:r).subscribe(n=>{t.style.cssText=n||"",i(this._stageRect$.value)}),this._stageRect$.subscribe(i)],"box-stage-styles"),t}_renderResizeHandlers(){const t=document.createElement("div");t.className=this.wrapClassName("resize-handles"),Object.values(it).forEach(T=>{const c=document.createElement("div");c.className=this.wrapClassName(T)+" "+this.wrapClassName("resize-handle"),c.dataset.teleBoxHandle=T,t.appendChild(c)}),this.$box.appendChild(t);const i="handle-tracking-listener",n=this.wrapClassName("transforming");let r,s=0,o=0,a=0,l=0,u=0,h=0,p;const w=T=>{if(!T.isPrimary||this.state!==ue.Normal)return;bn(T);let{pageX:c,pageY:d}=T;d<0&&(d=0);const f=c-u,g=d-h;let{x:m,y:x}=this.pxIntrinsicCoord,{width:y,height:N}=this.pxIntrinsicSize;switch(p){case it.North:{x=o+g,N=l-g;break}case it.South:{N=l+g;break}case it.West:{m=s+f,y=a-f;break}case it.East:{y=a+f;break}case it.NorthWest:{m=s+f,x=o+g,y=a-f,N=l-g;break}case it.NorthEast:{x=o+g,y=a+f,N=l-g;break}case it.SouthEast:{y=a+f,N=l+g;break}case it.SouthWest:{m=s+f,y=a-f,N=l+g;break}default:{this.move(s+f,o+g);return}}this.transform(m,x,y,N)},C=T=>{!T.isPrimary||(p=void 0,r&&(bn(T),this.$box.classList.toggle(n,!1),this._sideEffect.flush(i),r.remove()))},E=T=>{var c;if(!T.isPrimary||this.readonly||T.button!=null&&T.button!==0||!this.draggable||p||this.state!==ue.Normal)return;const d=T.target;if((c=d.dataset)!=null&&c.teleBoxHandle){bn(T),{x:s,y:o}=this.pxIntrinsicCoord,{width:a,height:l}=this.pxIntrinsicSize,{pageX:u,pageY:h}=T,p=d.dataset.teleBoxHandle,r||(r=document.createElement("div"));const f=p?this.wrapClassName(`cursor-${p}`):"";r.className=this.wrapClassName(`track-mask${f?` ${f}`:""}`),this.$box.appendChild(r),this.$box.classList.add(n),this._sideEffect.add(()=>(window.addEventListener("pointermove",w,{passive:!1}),window.addEventListener("pointerup",C,{passive:!1}),window.addEventListener("pointercancel",C,{passive:!1}),()=>{window.removeEventListener("pointermove",w),window.removeEventListener("pointerup",C),window.removeEventListener("pointercancel",C)}),i)}};this._handleTrackStart=E,this._sideEffect.addEventListener(t,"pointerdown",E,{},"box-resizeHandles-pointerdown")}async destroy(){this.$box.remove(),this._sideEffect.flushAll(),this._sideEffect.flushAll(),await this.events.emit(be.Destroyed),this.events.clearListeners(),this._delegateEvents.clearListeners()}wrapClassName(t){return`${this.namespace}-${t}`}}var Xm="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxOCAxNiI+CiAgICA8ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxwYXRoIHN0cm9rZT0iIzdCODhBMCIgc3Ryb2tlLXdpZHRoPSIxLjQiIGQ9Ik0uNyAxLjJoMTYuNnYxMy42SC43eiIgLz4KICAgICAgICA8cGF0aCBmaWxsPSIjN0I4OEEwIiBkPSJNNCA1LjVoNnYxLjRINHpNNCA5LjVoMTB2MS40SDR6IiAvPgogICAgPC9nPgo8L3N2Zz4K";class Jm{constructor({minimized$:t,readonly$:i,darkMode$:n,namespace:r="telebox",styles:s={},root:o,onClick:a}){this._sideEffect=new Re.SideEffectManager,this.namespace=r;const l=new M.ValManager;this._sideEffect.addDisposer(()=>l.destroy());const u=new M.Val(void 0),h=M.derive(t),p=new M.Val(s),w=new M.Val(document.createElement("button")),C={styles:p,$collector:w};M.withValueEnhancer(this,C,l);const E={rect:u,visible:h};M.withReadonlyValueEnhancer(this,E,l),w.value.className=this.wrapClassName("collector"),w.value.style.backgroundImage=`url('${Xm}')`,this._sideEffect.addDisposer(w.subscribe(T=>{this._sideEffect.add(()=>(o.appendChild(T),()=>T.remove()),"telebox-collector-mount"),this._sideEffect.addEventListener(T,"click",()=>{i.value||a==null||a()},{},"telebox-collector-click"),this._sideEffect.addDisposer([h.subscribe(c=>{T.classList.toggle(this.wrapClassName("collector-visible"),c)}),i.subscribe(c=>{T.classList.toggle(this.wrapClassName("collector-readonly"),c)}),n.subscribe(c=>{T.classList.toggle(this.wrapClassName("color-scheme-dark"),c),T.classList.toggle(this.wrapClassName("color-scheme-light"),!c)}),p.subscribe(c=>{Object.keys(c).forEach(d=>{const f=c[d];f!=null&&(T.style[d]=f)})}),t.subscribe(c=>{if(c){const{x:d,y:f,width:g,height:m}=T.getBoundingClientRect(),x=o.getBoundingClientRect();u.setValue({x:d-x.x,y:f-x.y,width:g,height:m})}})],"telebox-collector-el")}))}destroy(){this._sideEffect.flushAll()}wrapClassName(t){return`${this.namespace}-${t}`}}var we=(e=>(e.Focused="focused",e.Blurred="blurred",e.Created="created",e.Removed="removed",e.State="state",e.Maximized="maximized",e.Minimized="minimized",e.IntrinsicMove="intrinsic_move",e.IntrinsicResize="intrinsic_resize",e.ZIndex="z_index",e.PrefersColorScheme="prefers_color_scheme",e.DarkMode="dark_mode",e))(we||{});class Km extends Od{constructor(t){super(t);this.boxes$=t.boxes$,this.rootRect$=t.rootRect$,this.darkMode$=t.darkMode$,t.root.appendChild(this.render())}focusBox(t){var i;if(!(this.focusedBox&&this.focusedBox===t)){if(this.$titles&&this.state$.value===ue.Maximized){const{children:n}=this.$titles.firstElementChild;for(let r=n.length-1;r>=0;r-=1){const s=n[r],o=(i=s.dataset)==null?void 0:i.teleBoxID;o&&(t&&o===t.id?s.classList.toggle(this.wrapClassName("titles-tab-focus"),!0):this.focusedBox&&o===this.focusedBox.id&&s.classList.toggle(this.wrapClassName("titles-tab-focus"),!1))}}this.focusedBox=t}}render(){if(this.$titleBar)return this.$titleBar;const t=super.render();t.classList.add(this.wrapClassName("max-titlebar")),this.sideEffect.addDisposer([this.state$.subscribe(n=>{t.classList.toggle(this.wrapClassName("max-titlebar-maximized"),n===ue.Maximized)}),this.readonly$.subscribe(n=>{t.classList.toggle(this.wrapClassName("readonly"),n)}),M.combine([this.state$,this.boxes$]).subscribe(([n,r])=>{n===ue.Maximized&&(t.classList.toggle(this.wrapClassName("max-titlebar-single-title"),r.length===1),r.length!==1&&t.replaceChild(this.renderTitles(),t.firstElementChild))})],"max-render");const i=document.createElement("div");return i.classList.add(this.wrapClassName("titles-area")),t.insertBefore(i,t.firstElementChild),t}destroy(){super.destroy(),this.$titles=void 0,this.focusedBox=void 0}renderTitles(){this.$titles=document.createElement("div"),this.$titles.className=this.wrapClassName("titles"),this.sideEffect.addEventListener(this.$titles,"wheel",n=>{n.currentTarget.scrollBy({left:n.deltaY>0?250:-250,behavior:"smooth"})},{passive:!1},"max-render-wheel-titles");const t=document.createElement("div");t.className=this.wrapClassName("titles-content"),this.$titles.appendChild(t);const i=this.boxes$.value.map(n=>{const r=document.createElement("button");return r.className=this.wrapClassName("titles-tab"),r.textContent=n.title,r.dataset.teleBoxID=n.id,r.dataset.teleTitleBarNoDblClick="true",this.focusedBox&&n.id===this.focusedBox.id&&r.classList.add(this.wrapClassName("titles-tab-focus")),t.appendChild(r),n._title$.reaction(s=>r.textContent=s)});return this.sideEffect.addDisposer(()=>i.forEach(n=>n()),"max-render-tab-titles"),this.$titles}}const qm=window.ResizeObserver||od.ResizeObserver;class ev{constructor({root:t=null,fullscreen:i=!1,prefersColorScheme:n=Bd.Light,minimized:r=!1,maximized:s=!1,fence:o=!0,collector:a,namespace:l="telebox",readonly:u=!1,stageRatio:h=-1,containerStyle:p="",stageStyle:w="",defaultBoxBodyStyle:C=null,defaultBoxStageStyle:E=null,theme:T={}}={}){this.events=new Zt.default,this._sideEffect=new Re.SideEffectManager,this.namespace=l;const c=new M.ValManager;this._sideEffect.addDisposer(()=>c.destroy());const d=new M.Val(t),f=new M.Val(u),g=new M.Val(o),m=new M.Val(p),x=new M.Val(w),y=new M.Val(h),N=new M.Val(C),D=new M.Val(E),P=new M.Val(i),J=new M.Val(r),q=new M.Val(s),ee=M.combine([q,P],([v,k])=>k?!0:v),Fe=M.combine([J,P],([v,k])=>k?!1:v);this.setMaximized=(v,k)=>q.setValue(v,k),this.setMinimized=(v,k)=>J.setValue(v,k);const Q=new M.Val({x:0,y:0,width:window.innerWidth,height:window.innerHeight},{compare:Ye});this._sideEffect.addDisposer(d.subscribe(v=>{this._sideEffect.add(()=>{if(!v)return()=>{};const k=new qm(()=>{const _=v.getBoundingClientRect();Q.setValue({x:0,y:0,width:_.width,height:_.height})});return k.observe(v),()=>k.disconnect()},"calc-root-rect")}));const G=M.combine([Q,y],_d,{compare:Ye});this.boxes$=new M.Val([]),this.topBox$=new M.Val(void 0),this._sideEffect.addDisposer(this.boxes$.subscribe(v=>{if(v.length>0){const k=v.reduce((_,$)=>_.zIndex>$.zIndex?_:$);this.topBox$.setValue(k)}else this.topBox$.setValue(void 0)}));const Qe=window.matchMedia("(prefers-color-scheme: dark)"),ae=new M.Val(!1);Qe&&(ae.setValue(Qe.matches),this._sideEffect.add(()=>{const v=k=>{ae.setValue(k.matches)};return Qe.addEventListener("change",v),()=>Qe.removeEventListener("change",v)}));const Oe=new M.Val(n);this._sideEffect.addDisposer(Oe.reaction((v,k)=>{k||this.events.emit(we.PrefersColorScheme,v)}));const _e=M.combine([ae,Oe],([v,k])=>k==="auto"?v:k==="dark"),ht=M.combine([Fe,ee],([v,k])=>v?ue.Minimized:k?ue.Maximized:ue.Normal),qt={darkMode:_e,state:ht,root:d,rootRect:Q,stageRect:G,minimized:Fe,maximized:ee};M.withReadonlyValueEnhancer(this,qt,c);const Et={fullscreen:P,prefersColorScheme:Oe,readonly:f,fence:g,stageRatio:y,containerStyle:m,stageStyle:x,defaultBoxBodyStyle:N,defaultBoxStageStyle:D};M.withValueEnhancer(this,Et,c);const Ii=this.wrapClassName("titlebar-icon-close"),b=v=>{var k;if(!v.isPrimary||f.value)return;const _=v.target;if(!!_.tagName)for(let $=_;$;$=$.parentElement){if($.classList&&$.classList.contains(Ii))return;const ke=(k=$.dataset)==null?void 0:k.teleBoxID;if(ke){const ve=this.getBox(ke);if(ve){this.focusBox(ve),this.makeBoxTop(ve);return}}}};this._sideEffect.addEventListener(window,"pointerdown",b,!0),this.$container=document.createElement("div"),this.$container.className=this.wrapClassName("manager-container"),this.setTheme(T),this.$stage=document.createElement("div"),this.$stage.className=this.wrapClassName("manager-stage"),this.$container.appendChild(this.$stage),this._sideEffect.addDisposer([_e.subscribe(v=>{this.$container.classList.toggle(this.wrapClassName("color-scheme-dark"),v),this.$container.classList.toggle(this.wrapClassName("color-scheme-light"),!v)}),P.subscribe(v=>{this.$container.classList.toggle(this.wrapClassName("is-fullscreen"),Boolean(v))}),M.combine([this.boxes$,P],([v,k])=>k==="no-titlebar"||k===!0&&v.length<=1).subscribe(v=>{this.$container.classList.toggle(this.wrapClassName("hide-fullscreen-titlebar"),v)}),ee.subscribe(v=>{this.$container.classList.toggle(this.wrapClassName("is-maximized"),v)}),Fe.subscribe(v=>{this.$container.classList.toggle(this.wrapClassName("is-minimized"),v)}),m.subscribe(v=>{this.$container.style.cssText=v}),x.subscribe(v=>{this.$stage.style.cssText=v,this.$stage.style.width=G.value.width+"px",this.$stage.style.height=G.value.height+"px"}),G.subscribe(v=>{this.$stage.style.width=v.width+"px",this.$stage.style.height=v.height+"px"}),d.subscribe(v=>{v?v.appendChild(this.$container):this.$container.parentElement&&this.$container.remove()})]),this.collector=a!=null?a:new Jm({minimized$:Fe,readonly$:f,darkMode$:_e,namespace:l,root:this.$container,onClick:()=>J.setValue(!1)}),this.titleBar=new Km({namespace:this.namespace,title$:M.derive(this.topBox$,v=>(v==null?void 0:v.title)||""),boxes$:this.boxes$,darkMode$:_e,readonly$:f,state$:ht,rootRect$:Q,root:this.$container,onEvent:v=>{switch(v.type){case rt.Maximize:{this.setMaximized(!ee.value);break}case rt.Minimize:{this.setMinimized(!0);break}case be.Close:{this.removeTopBox(),this.focusTopBox();break}}}}),this._sideEffect.addDisposer([ht.reaction((v,k)=>{k||this.events.emit(we.State,v)}),ee.reaction((v,k)=>{k||this.events.emit(we.Maximized,v)}),Fe.reaction((v,k)=>{k||this.events.emit(we.Minimized,v)}),_e.reaction((v,k)=>{k||this.events.emit(we.DarkMode,v)})])}get boxes(){return this.boxes$.value}get topBox(){return this.topBox$.value}setState(t,i=!1){switch(t){case ue.Maximized:{this.setMinimized(!1,i),this.setMaximized(!0,i);break}case ue.Minimized:{this.setMinimized(!0,i),this.setMaximized(!1,i);break}default:{this.setMinimized(!1,i),this.setMaximized(!1,i);break}}return this}create(t={},i=!0){const n=new Gm(ft(H(H({zIndex:this.topBox?this.topBox.zIndex+1:100},t),i?this.smartPosition(t):{}),{namespace:this.namespace,root:this.$stage,darkMode$:this._darkMode$,maximized$:this._maximized$,minimized$:this._minimized$,fence$:this._fence$,rootRect$:this._rootRect$,managerStageRect$:this._stageRect$,managerStageRatio$:this._stageRatio$,readonly$:this._readonly$,collectorRect$:this.collector._rect$,defaultBoxBodyStyle$:this._defaultBoxBodyStyle$,defaultBoxStageStyle$:this._defaultBoxStageStyle$}));return n.focus&&(this.focusBox(n),i&&this.makeBoxTop(n)),this.boxes$.setValue([...this.boxes,n]),this._sideEffect.addDisposer([n._delegateEvents.on(rt.Maximize,()=>{this.setMaximized(!this.maximized)}),n._delegateEvents.on(rt.Minimize,()=>{this.setMinimized(!0)}),n._delegateEvents.on(rt.Close,()=>{this.remove(n),this.focusTopBox()}),n._intrinsicCoord$.reaction((r,s)=>{s||this.events.emit(we.IntrinsicMove,n)}),n._intrinsicSize$.reaction((r,s)=>{s||this.events.emit(we.IntrinsicResize,n)}),n._zIndex$.reaction((r,s)=>{if(this.boxes.length>0){const o=this.boxes.reduce((a,l)=>a.zIndex>l.zIndex?a:l);this.topBox$.setValue(o)}s||this.events.emit(we.ZIndex,n)})]),this.events.emit(we.Created,n),n}query(t){return t?this.boxes.filter(this.teleBoxMatcher(t)):[...this.boxes]}queryOne(t){return t?this.boxes.find(this.teleBoxMatcher(t)):this.boxes[0]}update(t,i,n=!1){const r=this.boxes.find(s=>s.id===t);if(r)return this.updateBox(r,i,n)}updateAll(t,i=!1){this.boxes.forEach(n=>{this.updateBox(n,t,i)})}remove(t,i=!1){const n=this.getBoxIndex(t);if(n>=0){const r=this.boxes.slice(),s=r.splice(n,1);return this.boxes$.setValue(r),s.forEach(o=>o.destroy()),i||(this.boxes.length<=0&&(this.setMaximized(!1),this.setMinimized(!1)),this.events.emit(we.Removed,s)),s[0]}}removeTopBox(){if(this.topBox)return this.remove(this.topBox)}removeAll(t=!1){const i=this.boxes$.value;return this.boxes$.setValue([]),i.forEach(n=>n.destroy()),t||(this.boxes.length<=0&&(this.setMaximized(!1),this.setMinimized(!1)),this.events.emit(we.Removed,i)),i}setTheme(t){Object.keys(t).forEach(i=>{var n;this.$container.style.setProperty(`--tele-${i}`,(n=t[i])!=null?n:null)})}mount(t){this._root$.setValue(t)}unmount(){this._root$.setValue(null)}destroy(t=!1){this.events.clearListeners(),this._sideEffect.flushAll(),this.removeAll(t),this.collector.destroy(),this.titleBar.destroy()}wrapClassName(t){return`${this.namespace}-${t}`}focusBox(t,i=!1){const n=this.getBox(t);n&&(this.boxes.forEach(r=>{if(n===r){let s=!1;n.focus||(s=!0,n._focus$.setValue(!0,i)),s&&!i&&this.events.emit(we.Focused,n)}else r.focus&&this.blurBox(r,i)}),this.titleBar.focusBox(n))}focusTopBox(){if(this.topBox&&!this.topBox.focus)return this.focusBox(this.topBox)}blurBox(t,i=!1){const n=this.getBox(t);n&&(n.focus&&(n._focus$.setValue(!1,i),i||this.events.emit(we.Blurred,n)),this.titleBar.focusedBox===n&&this.titleBar.focusBox())}blurAll(t=!1){this.boxes.forEach(i=>{i.focus&&(i._focus$.setValue(!1,t),t||this.events.emit(we.Blurred,i))}),this.titleBar.focusedBox&&this.titleBar.focusBox()}teleBoxMatcher(t){const i=Object.keys(t);return n=>i.every(r=>t[r]===n[r])}updateBox(t,i,n=!1){var r,s,o,a,l,u;(i.x!=null||i.y!=null)&&t._intrinsicCoord$.setValue({x:(r=i.x)!=null?r:t.intrinsicX,y:(s=i.y)!=null?s:t.intrinsicY},n),(i.width!=null||i.height!=null)&&t._intrinsicSize$.setValue({width:(o=i.width)!=null?o:t.intrinsicWidth,height:(a=i.height)!=null?a:t.intrinsicHeight},n),i.title!=null&&t._title$.setValue(i.title),i.visible!=null&&t._visible$.setValue(i.visible,n),i.resizable!=null&&t._resizable$.setValue(i.resizable,n),i.draggable!=null&&t._draggable$.setValue(i.draggable,n),i.boxRatio!=null&&t._boxRatio$.setValue(i.boxRatio,n),i.zIndex!=null&&t._zIndex$.setValue(i.zIndex,n),i.stageRatio!==void 0&&t.setStageRatio(i.stageRatio,n),i.content!=null&&t.mountContent(i.content),i.footer!=null&&t.mountFooter(i.footer),(i.minHeight!=null||i.minWidth!=null)&&t._minSize$.setValue({width:(l=i.minWidth)!=null?l:t.minWidth,height:(u=i.minHeight)!=null?u:t.minHeight},n)}smartPosition(t){let{x:i,y:n}=t;const{width:r=.5,height:s=.5}=t,o=this.stageRect,a=this.topBox;if(i==null){let l=20;if(a){const u=a.pxIntrinsicCoord.x+20,h=r*o.width;u+h<=o.width&&(l=u)}i=l/o.width}if(n==null){let l=20;if(a){const u=a.pxIntrinsicCoord.y+20,h=s*o.height;u+h<=o.height&&(l=u)}n=l/o.height}return{x:i,y:n,width:r,height:s}}makeBoxTop(t,i=!1){this.topBox&&t!==this.topBox&&t._zIndex$.setValue(this.topBox.zIndex+1,i)}getBoxIndex(t){return typeof t=="string"?this.boxes.findIndex(i=>i.id===t):this.boxes.findIndex(i=>i===t)}getBox(t){return typeof t=="string"?this.boxes.find(i=>i.id===t):t}}const tv=(e,t,i,n,r)=>new iv({safeSetAttributes:s=>e.safeSetAttributes(s),updateAppState:(...s)=>{var o;return(o=e.appManager)==null?void 0:o.store.updateAppState(...s)},canOperate:()=>e.canOperate,notifyContainerRectUpdate:s=>{var o;return(o=e.appManager)==null?void 0:o.notifyContainerRectUpdate(s)},cleanFocus:()=>{var s;return(s=e.appManager)==null?void 0:s.store.cleanFocus()},setAppFocus:s=>{var o;return(o=e.appManager)==null?void 0:o.store.setAppFocus(s,!0)},callbacks:t,emitter:i,boxEmitter:n},r);class iv{constructor(t,i){this.context=t,this.sideEffectManager=new Re.SideEffectManager;const{emitter:n,callbacks:r,boxEmitter:s}=t;this.teleBoxManager=this.setupBoxManager(i),this.sideEffectManager.add(()=>[this.teleBoxManager.onValChanged("state",o=>{r.emit("boxStateChange",o),n.emit("boxStateChange",o)}),this.teleBoxManager.onValChanged("darkMode",o=>{r.emit("darkModeChange",o)}),this.teleBoxManager.onValChanged("prefersColorScheme",o=>{r.emit("prefersColorSchemeChange",o)}),this.teleBoxManager.onValChanged("minimized",(o,a)=>{if(!a)if(this.context.safeSetAttributes({minimized:o}),o)this.context.cleanFocus(),this.blurAllBox();else{const l=this.getTopBox();l&&(this.context.setAppFocus(l.id),this.focusBox({appId:l.id},!1))}}),this.teleBoxManager.onValChanged("maximized",(o,a)=>{a||this.context.safeSetAttributes({maximized:o})}),this.teleBoxManager.events.on("removed",o=>{o.forEach(a=>{s.emit("close",{appId:a.id})})}),this.teleBoxManager.events.on("intrinsic_move",A.debounce(o=>{s.emit("move",{appId:o.id,x:o.intrinsicX,y:o.intrinsicY})},50)),this.teleBoxManager.events.on("intrinsic_resize",A.debounce(o=>{s.emit("resize",{appId:o.id,width:o.intrinsicWidth,height:o.intrinsicHeight})},200)),this.teleBoxManager.events.on("focused",o=>{o&&(this.canOperate?s.emit("focus",{appId:o.id}):this.teleBoxManager.blurBox(o.id))}),this.teleBoxManager.events.on("z_index",o=>{this.context.updateAppState(o.id,Xe.ZIndex,o.zIndex)}),n.on("containerSizeRatioUpdate",o=>{this.teleBoxManager._stageRatio$.setValue(o)})])}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}get stageRect(){return this.teleBoxManager.stageRect}get stageRect$(){return this.teleBoxManager._stageRect$}createBox(t){var p,w,C;if(!this.teleBoxManager)return;let{minwidth:i=ug,minheight:n=cg,enableShadowDOM:r=!0}=(p=t.app.config)!=null?p:{};const{width:s,height:o}=(w=t.app.config)!=null?w:{},a=((C=t.options)==null?void 0:C.title)||t.appId,l=this.teleBoxManager.rootRect;i>1&&(i=i/l.width),n>1&&(n=n/l.height);const u={title:a,minWidth:i,minHeight:n,width:s,height:o,id:t.appId,enableShadowDOM:r},h=this.teleBoxManager.create(u,t.smartPosition);return this.context.emitter.emit(`${t.appId}${Z.WindowCreated}`),h}setupBoxManager(t){const i=ge.playground,n={stageRatio:t==null?void 0:t.stageRatio,root:i,fence:!1,prefersColorScheme:t==null?void 0:t.prefersColorScheme};t!=null&&t.containerStyle&&(n.containerStyle=t.containerStyle),t!=null&&t.stageStyle&&(n.stageStyle=t.stageStyle),t!=null&&t.fullscreen&&(n.fullscreen=t.fullscreen);const r=new ev(n);this.teleBoxManager&&this.teleBoxManager.destroy(),this.teleBoxManager=r;const s=t==null?void 0:t.collectorContainer;return s&&this.teleBoxManager.collector.set$collector(s),t!=null&&t.collectorStyles&&this.teleBoxManager.collector.setStyles(t.collectorStyles),r}getBox(t){return this.teleBoxManager.queryOne({id:t})}closeBox(t,i=!1){return this.teleBoxManager.remove(t,i)}boxIsFocus(t){const i=this.getBox(t);return i==null?void 0:i.focus}getFocusBox(){return this.teleBoxManager.query({focus:!0})[0]}getTopBox(){return this.teleBoxManager.topBox}updateBoxState(t){if(!t)return;const i=this.getBox(t.id);i&&(t.size&&i._intrinsicSize$.setValue(t.size,!0),t.position&&i._intrinsicCoord$.setValue(t.position,!0),t.zIndex&&i._zIndex$.setValue(t.zIndex,!0),setTimeout(()=>{t.focus&&this.teleBoxManager.focusBox(i.id,!0),t.maximized!=null&&this.teleBoxManager.setMaximized(Boolean(t.maximized),!0),t.minimized!=null&&this.teleBoxManager.setMinimized(Boolean(t.minimized),!0)},50),this.context.callbacks.emit("boxStateChange",this.teleBoxManager.state))}moveBox({appId:t,x:i,y:n}){const r=this.getBox(t);r&&r._intrinsicCoord$.setValue({x:i,y:n},!0)}focusBox({appId:t},i=!0){this.teleBoxManager.focusBox(t,i)}resizeBox({appId:t,width:i,height:n,skipUpdate:r}){const s=this.getBox(t);s&&s._intrinsicSize$.setValue({width:i,height:n},r)}setBoxMinSize(t){this.teleBoxManager.update(t.appId,{minWidth:t.minWidth,minHeight:t.minHeight},!0)}setBoxTitle(t){this.teleBoxManager.update(t.appId,{title:t.title},!0)}blurAllBox(){this.teleBoxManager.blurAll()}updateAll(t){this.teleBoxManager.updateAll(t)}setMaximized(t,i=!0){t!==this.maximized&&this.teleBoxManager.setMaximized(t,i)}setMinimized(t,i=!0){this.teleBoxManager.setMinimized(t,i)}focusTopBox(){if(this.teleBoxManager.query().length>=1){const i=this.getTopBox();i&&this.focusBox({appId:i.id},!1)}}updateBox(t,i,n=!0){this.teleBoxManager.update(t,i,n)}setReadonly(t){this.teleBoxManager.setReadonly(t)}setPrefersColorScheme(t){this.teleBoxManager.setPrefersColorScheme(t)}setZIndex(t,i,n=!0){this.teleBoxManager.update(t,{zIndex:i},n)}setRoot(t){this.teleBoxManager._root$.setValue(t)}setCollector(t){this.teleBoxManager.collector.set$collector(t)}destroy(){this.sideEffectManager.flushAll(),this.teleBoxManager.destroy()}}function Qr(){}function $d(e){return e()}function Cu(){return Object.create(null)}function Ts(e){e.forEach($d)}function nv(e){return typeof e=="function"}function rv(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let ur;function Zr(e,t){return ur||(ur=document.createElement("a")),ur.href=t,e===ur.href}function sv(e){return Object.keys(e).length===0}function xt(e,t){e.appendChild(t)}function ks(e,t,i){e.insertBefore(t,i||null)}function Yn(e){e.parentNode.removeChild(e)}function Bt(e){return document.createElement(e)}function Fa(e){return document.createTextNode(e)}function jo(){return Fa(" ")}function le(e,t,i){i==null?e.removeAttribute(t):e.getAttribute(t)!==i&&e.setAttribute(t,i)}function ov(e){return Array.from(e.childNodes)}function Ud(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function he(e,t,i,n){i===null?e.style.removeProperty(t):e.style.setProperty(t,i,n?"important":"")}let Qa;function Mn(e){Qa=e}const gn=[],bu=[],kr=[],Mu=[],av=Promise.resolve();let Lo=!1;function lv(){Lo||(Lo=!0,av.then(Wd))}function Vo(e){kr.push(e)}const so=new Set;let cr=0;function Wd(){const e=Qa;do{for(;cr<gn.length;){const t=gn[cr];cr++,Mn(t),uv(t.$$)}for(Mn(null),gn.length=0,cr=0;bu.length;)bu.pop()();for(let t=0;t<kr.length;t+=1){const i=kr[t];so.has(i)||(so.add(i),i())}kr.length=0}while(gn.length);for(;Mu.length;)Mu.pop()();Lo=!1,so.clear(),Mn(e)}function uv(e){if(e.fragment!==null){e.update(),Ts(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(Vo)}}const cv=new Set;function dv(e,t){e&&e.i&&(cv.delete(e),e.i(t))}function hv(e,t,i,n){const{fragment:r,on_mount:s,on_destroy:o,after_update:a}=e.$$;r&&r.m(t,i),n||Vo(()=>{const l=s.map($d).filter(nv);o?o.push(...l):Ts(l),e.$$.on_mount=[]}),a.forEach(Vo)}function pv(e,t){const i=e.$$;i.fragment!==null&&(Ts(i.on_destroy),i.fragment&&i.fragment.d(t),i.on_destroy=i.fragment=null,i.ctx=[])}function fv(e,t){e.$$.dirty[0]===-1&&(gn.push(e),lv(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function gv(e,t,i,n,r,s,o,a=[-1]){const l=Qa;Mn(e);const u=e.$$={fragment:null,ctx:null,props:s,update:Qr,not_equal:r,bound:Cu(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(l?l.$$.context:[])),callbacks:Cu(),dirty:a,skip_bound:!1,root:t.target||l.$$.root};o&&o(u.root);let h=!1;if(u.ctx=i?i(e,t.props||{},(p,w,...C)=>{const E=C.length?C[0]:w;return u.ctx&&r(u.ctx[p],u.ctx[p]=E)&&(!u.skip_bound&&u.bound[p]&&u.bound[p](E),h&&fv(e,p)),w}):[],u.update(),h=!0,Ts(u.before_update),u.fragment=n?n(u.ctx):!1,t.target){if(t.hydrate){const p=ov(t.target);u.fragment&&u.fragment.l(p),p.forEach(Yn)}else u.fragment&&u.fragment.c();t.intro&&dv(e.$$.fragment),hv(e,t.target,t.anchor,t.customElement),Wd()}Mn(l)}class mv{$destroy(){pv(this,1),this.$destroy=Qr}$on(t,i){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(i),()=>{const r=n.indexOf(i);r!==-1&&n.splice(r,1)}}$set(t){this.$$set&&!sv(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function Iu(e){let t,i,n,r,s,o,a=e[14]&&Au(e),l=e[15]&&Eu(e);return{c(){t=Bt("div"),i=Bt("div"),a&&a.c(),n=jo(),r=Bt("span"),s=Fa(e[0]),o=jo(),l&&l.c(),he(r,"overflow","hidden"),he(r,"white-space","nowrap"),he(r,"text-overflow","ellipsis"),he(r,"max-width","80px"),le(i,"class",e[8]),he(i,"background-color",e[2]),he(i,"color",e[9]),he(i,"opacity",e[11]),le(t,"class","netless-window-manager-cursor-name")},m(u,h){ks(u,t,h),xt(t,i),a&&a.m(i,null),xt(i,n),xt(i,r),xt(r,s),xt(i,o),l&&l.m(i,null)},p(u,h){u[14]?a?a.p(u,h):(a=Au(u),a.c(),a.m(i,n)):a&&(a.d(1),a=null),h&1&&Ud(s,u[0]),u[15]?l?l.p(u,h):(l=Eu(u),l.c(),l.m(i,null)):l&&(l.d(1),l=null),h&256&&le(i,"class",u[8]),h&4&&he(i,"background-color",u[2]),h&512&&he(i,"color",u[9]),h&2048&&he(i,"opacity",u[11])},d(u){u&&Yn(t),a&&a.d(),l&&l.d()}}}function Au(e){let t,i;return{c(){t=Bt("img"),le(t,"class","netless-window-manager-cursor-selector-avatar"),le(t,"style",e[16]()),Zr(t.src,i=e[7])||le(t,"src",i),le(t,"alt","avatar")},m(n,r){ks(n,t,r)},p(n,r){r&128&&!Zr(t.src,i=n[7])&&le(t,"src",i)},d(n){n&&Yn(t)}}}function Eu(e){let t,i;return{c(){t=Bt("span"),i=Fa(e[1]),le(t,"class","netless-window-manager-cursor-tag-name"),he(t,"background-color",e[10])},m(n,r){ks(n,t,r),xt(t,i)},p(n,r){r&2&&Ud(i,n[1]),r&1024&&he(t,"background-color",n[10])},d(n){n&&Yn(t)}}}function vv(e){let t,i,n,r,s,o,a=!e[12]&&Iu(e);return{c(){t=Bt("div"),a&&a.c(),i=jo(),n=Bt("div"),r=Bt("img"),le(r,"class",s="netless-window-manager-cursor-"+e[3]+"-image"),Zr(r.src,o=e[6])||le(r,"src",o),le(r,"alt",e[3]),le(n,"class","cursor-image-wrapper"),le(t,"class","netless-window-manager-cursor-mid"),he(t,"transform","translateX("+e[4]+"px) translateY("+e[5]+"px)"),he(t,"display",e[13])},m(l,u){ks(l,t,u),a&&a.m(t,null),xt(t,i),xt(t,n),xt(n,r)},p(l,[u]){l[12]?a&&(a.d(1),a=null):a?a.p(l,u):(a=Iu(l),a.c(),a.m(t,i)),u&8&&s!==(s="netless-window-manager-cursor-"+l[3]+"-image")&&le(r,"class",s),u&64&&!Zr(r.src,o=l[6])&&le(r,"src",o),u&8&&le(r,"alt",l[3]),u&48&&he(t,"transform","translateX("+l[4]+"px) translateY("+l[5]+"px)"),u&8192&&he(t,"display",l[13])},i:Qr,o:Qr,d(l){l&&Yn(t),a&&a.d()}}}function wv(e,t,i){let n,r,s,o,a,{cursorName:l}=t,{tagName:u}=t,{backgroundColor:h}=t,{appliance:p}=t,{x:w}=t,{y:C}=t,{src:E}=t,{visible:T}=t,{avatar:c}=t,{theme:d}=t,{color:f}=t,{cursorTagBackgroundColor:g}=t,{opacity:m}=t;const x=()=>Object.entries({width:(n?19:28)+"px",height:(n?19:28)+"px",position:n?"initial":"absolute","border-color":n?"white":h,"margin-right":(n?4:0)+"px"}).map(([y,N])=>`${y}: ${N}`).join(";");return e.$$set=y=>{"cursorName"in y&&i(0,l=y.cursorName),"tagName"in y&&i(1,u=y.tagName),"backgroundColor"in y&&i(2,h=y.backgroundColor),"appliance"in y&&i(3,p=y.appliance),"x"in y&&i(4,w=y.x),"y"in y&&i(5,C=y.y),"src"in y&&i(6,E=y.src),"visible"in y&&i(17,T=y.visible),"avatar"in y&&i(7,c=y.avatar),"theme"in y&&i(8,d=y.theme),"color"in y&&i(9,f=y.color),"cursorTagBackgroundColor"in y&&i(10,g=y.cursorTagBackgroundColor),"opacity"in y&&i(11,m=y.opacity)},e.$$.update=()=>{e.$$.dirty&1&&(n=!A.isEmpty(l)),e.$$.dirty&2&&i(15,r=!A.isEmpty(u)),e.$$.dirty&128&&i(14,s=!A.isEmpty(c)),e.$$.dirty&131072&&i(13,o=T?"initial":"none"),e.$$.dirty&8&&i(12,a=p===I.ApplianceNames.laserPointer)},[l,u,h,p,w,C,E,c,d,f,g,m,a,o,s,r,x,T]}class yv extends mv{constructor(t){super();gv(this,t,wv,vv,rv,{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})}}class xv{constructor(t,i,n,r){this.manager=t,this.memberId=i,this.cursorManager=n,this.wrapper=r,this.move=s=>{var o,a;if(s.type==="main"){const l=(o=this.manager.boxManager)==null?void 0:o.stageRect;this.component&&l&&(this.autoHidden(),this.moveCursor(s,l,this.manager.mainView))}else{const l=this.cursorManager.focusView,u=(a=l==null?void 0:l.divElement)==null?void 0:a.getBoundingClientRect(),h=l==null?void 0:l.camera;l&&u&&h&&this.component&&(this.autoHidden(),this.moveCursor(s,u,l))}},this.leave=()=>{this.hide()},this.updateMember(),this.createCursor(),this.autoHidden()}moveCursor(t,i,n){var l,u;const{x:r,y:s,type:o}=t,a=n==null?void 0:n.screen.convertPointToScreen(r,s);if(a){let h=a.x-2,p=a.y-18;if(o==="app"){const w=this.cursorManager.playgroundRect;w&&(h=h+i.x-w.x,p=p+i.y-w.y)}else h=h+i.x,p=p+i.y;a.x<0||a.x>i.width||a.y<0||a.y>i.height?(l=this.component)==null||l.$set({visible:!1,x:h,y:p}):(u=this.component)==null||u.$set({visible:!0,x:h,y:p})}}get memberApplianceName(){var t,i;return(i=(t=this.member)==null?void 0:t.memberState)==null?void 0:i.currentApplianceName}get memberColor(){var i,n;return`rgb(${(n=(i=this.member)==null?void 0:i.memberState)==null?void 0:n.strokeColor.join(",")})`}get payload(){var t;return(t=this.member)==null?void 0:t.payload}get memberCursorName(){var t,i;return((t=this.payload)==null?void 0:t.nickName)||((i=this.payload)==null?void 0:i.cursorName)||this.memberId}get memberTheme(){var t;return(t=this.payload)!=null&&t.theme?"netless-window-manager-cursor-inner-mellow":"netless-window-manager-cursor-inner"}get memberCursorTextColor(){var t;return((t=this.payload)==null?void 0:t.cursorTextColor)||"#FFFFFF"}get memberCursorTagBackgroundColor(){var t;return((t=this.payload)==null?void 0:t.cursorTagBackgroundColor)||this.memberColor}get memberAvatar(){var t;return(t=this.payload)==null?void 0:t.avatar}get memberOpacity(){return!this.memberCursorName&&!this.memberAvatar?0:1}get memberTagName(){var t;return(t=this.payload)==null?void 0:t.cursorTagName}autoHidden(){this.timer&&clearTimeout(this.timer),this.timer=window.setTimeout(()=>{this.hide()},1e3*10)}async createCursor(){this.member&&this.wrapper&&(this.component=new yv({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){const t=this.cursorManager.applianceIcons;return t[this.memberApplianceName||I.ApplianceNames.shape]||t[I.ApplianceNames.shape]}}updateMember(){return this.member=xd(this.manager.room,this.memberId),this.updateComponent(),this.member}updateComponent(){var t;(t=this.component)==null||t.$set(A.omit(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())}}var Sv="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==",Cv="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==",bv="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=",Mv="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDBweCIgaGVpZ2h0PSI0MHB4IiB2aWV3Qm94PSIwIDAgNDAgNDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDYwLjEgKDg4MTMzKSAtIGh0dHBzOi8vc2tldGNoLmNvbSAtLT4KICAgIDx0aXRsZT5zaGFwZS1jdXJzb3I8L3RpdGxlPgogICAgPGRlc2M+Q3JlYXRlZCB3aXRoIFNrZXRjaC48L2Rlc2M+CiAgICA8ZGVmcz4KICAgICAgICA8cGF0aCBkPSJNMjAsMjEuNSBDMjAuMjQ1NDU5OSwyMS41IDIwLjQ0OTYwODQsMjEuNjc2ODc1MiAyMC40OTE5NDQzLDIxLjkxMDEyNDQgTDIwLjUsMjIgTDIwLjUsMjcgQzIwLjUsMjcuMjc2MTQyNCAyMC4yNzYxNDI0LDI3LjUgMjAsMjcuNSBDMTkuNzU0NTQwMSwyNy41IDE5LjU1MDM5MTYsMjcuMzIzMTI0OCAxOS41MDgwNTU3LDI3LjA4OTg3NTYgTDE5LjUsMjcgTDE5LjUsMjIgQzE5LjUsMjEuNzIzODU3NiAxOS43MjM4NTc2LDIxLjUgMjAsMjEuNSBaIE0yNywxOS41IEMyNy4yNzYxNDI0LDE5LjUgMjcuNSwxOS43MjM4NTc2IDI3LjUsMjAgQzI3LjUsMjAuMjQ1NDU5OSAyNy4zMjMxMjQ4LDIwLjQ0OTYwODQgMjcuMDg5ODc1NiwyMC40OTE5NDQzIEwyNywyMC41IEwyMiwyMC41IEMyMS43MjM4NTc2LDIwLjUgMjEuNSwyMC4yNzYxNDI0IDIxLjUsMjAgQzIxLjUsMTkuNzU0NTQwMSAyMS42NzY4NzUyLDE5LjU1MDM5MTYgMjEuOTEwMTI0NCwxOS41MDgwNTU3IEwyMiwxOS41IEwyNywxOS41IFogTTE4LDE5LjUgQzE4LjI3NjE0MjQsMTkuNSAxOC41LDE5LjcyMzg1NzYgMTguNSwyMCBDMTguNSwyMC4yNDU0NTk5IDE4LjMyMzEyNDgsMjAuNDQ5NjA4NCAxOC4wODk4NzU2LDIwLjQ5MTk0NDMgTDE4LDIwLjUgTDEzLDIwLjUgQzEyLjcyMzg1NzYsMjAuNSAxMi41LDIwLjI3NjE0MjQgMTIuNSwyMCBDMTIuNSwxOS43NTQ1NDAxIDEyLjY3Njg3NTIsMTkuNTUwMzkxNiAxMi45MTAxMjQ0LDE5LjUwODA1NTcgTDEzLDE5LjUgTDE4LDE5LjUgWiBNMjAsMTIuNSBDMjAuMjQ1NDU5OSwxMi41IDIwLjQ0OTYwODQsMTIuNjc2ODc1MiAyMC40OTE5NDQzLDEyLjkxMDEyNDQgTDIwLjUsMTMgTDIwLjUsMTggQzIwLjUsMTguMjc2MTQyNCAyMC4yNzYxNDI0LDE4LjUgMjAsMTguNSBDMTkuNzU0NTQwMSwxOC41IDE5LjU1MDM5MTYsMTguMzIzMTI0OCAxOS41MDgwNTU3LDE4LjA4OTg3NTYgTDE5LjUsMTggTDE5LjUsMTMgQzE5LjUsMTIuNzIzODU3NiAxOS43MjM4NTc2LDEyLjUgMjAsMTIuNSBaIiBpZD0icGF0aC0xIj48L3BhdGg+CiAgICAgICAgPGZpbHRlciB4PSItNjQuNiUiIHk9Ii01OS41JSIgd2lkdGg9IjIyOS4zJSIgaGVpZ2h0PSIyNDYuMSUiIGZpbHRlclVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgaWQ9ImZpbHRlci0yIj4KICAgICAgICAgICAgPGZlTW9ycGhvbG9neSByYWRpdXM9IjEiIG9wZXJhdG9yPSJkaWxhdGUiIGluPSJTb3VyY2VBbHBoYSIgcmVzdWx0PSJzaGFkb3dTcHJlYWRPdXRlcjEiPjwvZmVNb3JwaG9sb2d5PgogICAgICAgICAgICA8ZmVPZmZzZXQgZHg9IjAiIGR5PSIyIiBpbj0ic2hhZG93U3ByZWFkT3V0ZXIxIiByZXN1bHQ9InNoYWRvd09mZnNldE91dGVyMSI+PC9mZU9mZnNldD4KICAgICAgICAgICAgPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iMyIgaW49InNoYWRvd09mZnNldE91dGVyMSIgcmVzdWx0PSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlR2F1c3NpYW5CbHVyPgogICAgICAgICAgICA8ZmVDb21wb3NpdGUgaW49InNoYWRvd0JsdXJPdXRlcjEiIGluMj0iU291cmNlQWxwaGEiIG9wZXJhdG9yPSJvdXQiIHJlc3VsdD0ic2hhZG93Qmx1ck91dGVyMSI+PC9mZUNvbXBvc2l0ZT4KICAgICAgICAgICAgPGZlQ29sb3JNYXRyaXggdmFsdWVzPSIwIDAgMCAwIDAgICAwIDAgMCAwIDAgICAwIDAgMCAwIDAgIDAgMCAwIDAuMTYgMCIgdHlwZT0ibWF0cml4IiBpbj0ic2hhZG93Qmx1ck91dGVyMSI+PC9mZUNvbG9yTWF0cml4PgogICAgICAgIDwvZmlsdGVyPgogICAgPC9kZWZzPgogICAgPGcgaWQ9Iumhtemdoi00IiBzdHJva2U9Im5vbmUiIHN0cm9rZS13aWR0aD0iMSIgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj4KICAgICAgICA8ZyBpZD0iV2hpdGVib2FyZC1HdWlkZWxpbmVzIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgtMzQ0LjAwMDAwMCwgLTc1MS4wMDAwMDApIj4KICAgICAgICAgICAgPGcgaWQ9InNoYXBlLWN1cnNvciIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMzQ0LjAwMDAwMCwgNzUxLjAwMDAwMCkiPgogICAgICAgICAgICAgICAgPHJlY3QgaWQ9IuefqeW9ouWkh+S7vS00NCIgZmlsbD0iI0ZGRkZGRiIgb3BhY2l0eT0iMC4wMSIgeD0iMCIgeT0iMCIgd2lkdGg9IjQwIiBoZWlnaHQ9IjQwIiByeD0iMiI+PC9yZWN0PgogICAgICAgICAgICAgICAgPGcgaWQ9IuW9oueKtue7k+WQiCIgZmlsbC1ydWxlPSJub256ZXJvIj4KICAgICAgICAgICAgICAgICAgICA8dXNlIGZpbGw9ImJsYWNrIiBmaWxsLW9wYWNpdHk9IjEiIGZpbHRlcj0idXJsKCNmaWx0ZXItMikiIHhsaW5rOmhyZWY9IiNwYXRoLTEiPjwvdXNlPgogICAgICAgICAgICAgICAgICAgIDxwYXRoIHN0cm9rZT0iI0ZGRkZGRiIgc3Ryb2tlLXdpZHRoPSIxIiBkPSJNMjAsMjEgQzIwLjQ4NTQxMDMsMjEgMjAuODk4MDg1LDIxLjM0Nzk5OTMgMjAuOTg5OTQ3OSwyMS44NjU0ODc3IEwyMSwyMiBMMjEsMjcgQzIxLDI3LjU1MjI4NDcgMjAuNTUyMjg0NywyOCAyMCwyOCBDMTkuNTE0NTg5NywyOCAxOS4xMDE5MTUsMjcuNjUyMDAwNyAxOS4wMTAwNTIxLDI3LjEzNDUxMjMgTDE5LDI3IEwxOSwyMiBDMTksMjEuNDQ3NzE1MyAxOS40NDc3MTUzLDIxIDIwLDIxIFogTTI3LDE5IEMyNy41NTIyODQ3LDE5IDI4LDE5LjQ0NzcxNTMgMjgsMjAgQzI4LDIwLjQ4NTQxMDMgMjcuNjUyMDAwNywyMC44OTgwODUgMjcuMTM0NTEyMywyMC45ODk5NDc5IEwyNywyMSBMMjIsMjEgQzIxLjQ0NzcxNTMsMjEgMjEsMjAuNTUyMjg0NyAyMSwyMCBDMjEsMTkuNTE0NTg5NyAyMS4zNDc5OTkzLDE5LjEwMTkxNSAyMS44NjU0ODc3LDE5LjAxMDA1MjEgTDIyLDE5IEwyNywxOSBaIE0xOCwxOSBDMTguNTUyMjg0NywxOSAxOSwxOS40NDc3MTUzIDE5LDIwIEMxOSwyMC40ODU0MTAzIDE4LjY1MjAwMDcsMjAuODk4MDg1IDE4LjEzNDUxMjMsMjAuOTg5OTQ3OSBMMTgsMjEgTDEzLDIxIEMxMi40NDc3MTUzLDIxIDEyLDIwLjU1MjI4NDcgMTIsMjAgQzEyLDE5LjUxNDU4OTcgMTIuMzQ3OTk5MywxOS4xMDE5MTUgMTIuODY1NDg3NywxOS4wMTAwNTIxIEwxMywxOSBMMTgsMTkgWiBNMjAsMTIgQzIwLjQ4NTQxMDMsMTIgMjAuODk4MDg1LDEyLjM0Nzk5OTMgMjAuOTg5OTQ3OSwxMi44NjU0ODc3IEwyMSwxMyBMMjEsMTggQzIxLDE4LjU1MjI4NDcgMjAuNTUyMjg0NywxOSAyMCwxOSBDMTkuNTE0NTg5NywxOSAxOS4xMDE5MTUsMTguNjUyMDAwNyAxOS4wMTAwNTIxLDE4LjEzNDUxMjMgTDE5LDE4IEwxOSwxMyBDMTksMTIuNDQ3NzE1MyAxOS40NDc3MTUzLDEyIDIwLDEyIFoiIGZpbGw9IiMyMTIzMjQiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PC9wYXRoPgogICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICAgICAgPHJlY3QgaWQ9IuefqeW9oiIgZmlsbD0iI0ZGRkZGRiIgeD0iMTguNSIgeT0iMTciIHdpZHRoPSIzIiBoZWlnaHQ9IjYiPjwvcmVjdD4KICAgICAgICAgICAgICAgIDxyZWN0IGlkPSLnn6nlvaIiIGZpbGw9IiNGRkZGRkYiIHg9IjE3IiB5PSIxOC41IiB3aWR0aD0iNiIgaGVpZ2h0PSIzIj48L3JlY3Q+CiAgICAgICAgICAgICAgICA8cGF0aCBkPSJNMjAsMjEuNSBDMjAuMjQ1NDU5OSwyMS41IDIwLjQ0OTYwODQsMjEuNjc2ODc1MiAyMC40OTE5NDQzLDIxLjkxMDEyNDQgTDIwLjUsMjIgTDIwLjUsMjcgQzIwLjUsMjcuMjc2MTQyNCAyMC4yNzYxNDI0LDI3LjUgMjAsMjcuNSBDMTkuNzU0NTQwMSwyNy41IDE5LjU1MDM5MTYsMjcuMzIzMTI0OCAxOS41MDgwNTU3LDI3LjA4OTg3NTYgTDE5LjUsMjcgTDE5LjUsMjIgQzE5LjUsMjEuNzIzODU3NiAxOS43MjM4NTc2LDIxLjUgMjAsMjEuNSBaIE0yNywxOS41IEMyNy4yNzYxNDI0LDE5LjUgMjcuNSwxOS43MjM4NTc2IDI3LjUsMjAgQzI3LjUsMjAuMjQ1NDU5OSAyNy4zMjMxMjQ4LDIwLjQ0OTYwODQgMjcuMDg5ODc1NiwyMC40OTE5NDQzIEwyNywyMC41IEwyMiwyMC41IEMyMS43MjM4NTc2LDIwLjUgMjEuNSwyMC4yNzYxNDI0IDIxLjUsMjAgQzIxLjUsMTkuNzU0NTQwMSAyMS42NzY4NzUyLDE5LjU1MDM5MTYgMjEuOTEwMTI0NCwxOS41MDgwNTU3IEwyMiwxOS41IEwyNywxOS41IFogTTE4LDE5LjUgQzE4LjI3NjE0MjQsMTkuNSAxOC41LDE5LjcyMzg1NzYgMTguNSwyMCBDMTguNSwyMC4yNDU0NTk5IDE4LjMyMzEyNDgsMjAuNDQ5NjA4NCAxOC4wODk4NzU2LDIwLjQ5MTk0NDMgTDE4LDIwLjUgTDEzLDIwLjUgQzEyLjcyMzg1NzYsMjAuNSAxMi41LDIwLjI3NjE0MjQgMTIuNSwyMCBDMTIuNSwxOS43NTQ1NDAxIDEyLjY3Njg3NTIsMTkuNTUwMzkxNiAxMi45MTAxMjQ0LDE5LjUwODA1NTcgTDEzLDE5LjUgTDE4LDE5LjUgWiBNMjAsMTIuNSBDMjAuMjQ1NDU5OSwxMi41IDIwLjQ0OTYwODQsMTIuNjc2ODc1MiAyMC40OTE5NDQzLDEyLjkxMDEyNDQgTDIwLjUsMTMgTDIwLjUsMTggQzIwLjUsMTguMjc2MTQyNCAyMC4yNzYxNDI0LDE4LjUgMjAsMTguNSBDMTkuNzU0NTQwMSwxOC41IDE5LjU1MDM5MTYsMTguMzIzMTI0OCAxOS41MDgwNTU3LDE4LjA4OTg3NTYgTDE5LjUsMTggTDE5LjUsMTMgQzE5LjUsMTIuNzIzODU3NiAxOS43MjM4NTc2LDEyLjUgMjAsMTIuNSBaIiBpZD0i5b2i54q257uT5ZCIIiBmaWxsPSIjMjEyMzI0IiBmaWxsLXJ1bGU9Im5vbnplcm8iPjwvcGF0aD4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+",Iv="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iNDdweCIgaGVpZ2h0PSI0MHB4IiB2aWV3Qm94PSIwIDAgNDcgNDAiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDYwLjEgKDg4MTMzKSAtIGh0dHBzOi8vc2tldGNoLmNvbSAtLT4KICAgIDx0aXRsZT50ZXh0LWN1cnNvcjwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPgogICAgICAgIDxwYXRoIGQ9Ik0xNiwyNi41IEMxNS43MjM4NTc2LDI2LjUgMTUuNSwyNi4yNzYxNDI0IDE1LjUsMjYgQzE1LjUsMjUuNzU0NTQwMSAxNS42NzY4NzUyLDI1LjU1MDM5MTYgMTUuOTEwMTI0NCwyNS41MDgwNTU3IEwxNiwyNS41IEwxOS41LDI1LjUgTDE5LjUsMTQuNSBMMTYsMTQuNSBDMTUuNzIzODU3NiwxNC41IDE1LjUsMTQuMjc2MTQyNCAxNS41LDE0IEMxNS41LDEzLjc1NDU0MDEgMTUuNjc2ODc1MiwxMy41NTAzOTE2IDE1LjkxMDEyNDQsMTMuNTA4MDU1NyBMMTYsMTMuNSBMMjQsMTMuNSBDMjQuMjc2MTQyNCwxMy41IDI0LjUsMTMuNzIzODU3NiAyNC41LDE0IEMyNC41LDE0LjI0NTQ1OTkgMjQuMzIzMTI0OCwxNC40NDk2MDg0IDI0LjA4OTg3NTYsMTQuNDkxOTQ0MyBMMjQsMTQuNSBMMjAuNSwxNC41IEwyMC41LDI1LjUgTDI0LDI1LjUgQzI0LjI3NjE0MjQsMjUuNSAyNC41LDI1LjcyMzg1NzYgMjQuNSwyNiBDMjQuNSwyNi4yNDU0NTk5IDI0LjMyMzEyNDgsMjYuNDQ5NjA4NCAyNC4wODk4NzU2LDI2LjQ5MTk0NDMgTDI0LDI2LjUgTDE2LDI2LjUgWiIgaWQ9InBhdGgtMSI+PC9wYXRoPgogICAgICAgIDxmaWx0ZXIgeD0iLTI4NC4wJSIgeT0iLTgxLjUlIiB3aWR0aD0iNjY4LjElIiBoZWlnaHQ9IjI5My45JSIgZmlsdGVyVW5pdHM9Im9iamVjdEJvdW5kaW5nQm94IiBpZD0iZmlsdGVyLTIiPgogICAgICAgICAgICA8ZmVNb3JwaG9sb2d5IHJhZGl1cz0iMSIgb3BlcmF0b3I9ImRpbGF0ZSIgaW49IlNvdXJjZUFscGhhIiByZXN1bHQ9InNoYWRvd1NwcmVhZE91dGVyMSI+PC9mZU1vcnBob2xvZ3k+CiAgICAgICAgICAgIDxmZU9mZnNldCBkeD0iMCIgZHk9IjIiIGluPSJzaGFkb3dTcHJlYWRPdXRlcjEiIHJlc3VsdD0ic2hhZG93T2Zmc2V0T3V0ZXIxIj48L2ZlT2Zmc2V0PgogICAgICAgICAgICA8ZmVHYXVzc2lhbkJsdXIgc3RkRGV2aWF0aW9uPSIzIiBpbj0ic2hhZG93T2Zmc2V0T3V0ZXIxIiByZXN1bHQ9InNoYWRvd0JsdXJPdXRlcjEiPjwvZmVHYXVzc2lhbkJsdXI+CiAgICAgICAgICAgIDxmZUNvbXBvc2l0ZSBpbj0ic2hhZG93Qmx1ck91dGVyMSIgaW4yPSJTb3VyY2VBbHBoYSIgb3BlcmF0b3I9Im91dCIgcmVzdWx0PSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlQ29tcG9zaXRlPgogICAgICAgICAgICA8ZmVDb2xvck1hdHJpeCB2YWx1ZXM9IjAgMCAwIDAgMCAgIDAgMCAwIDAgMCAgIDAgMCAwIDAgMCAgMCAwIDAgMC4xNiAwIiB0eXBlPSJtYXRyaXgiIGluPSJzaGFkb3dCbHVyT3V0ZXIxIj48L2ZlQ29sb3JNYXRyaXg+CiAgICAgICAgPC9maWx0ZXI+CiAgICA8L2RlZnM+CiAgICA8ZyBpZD0i6aG16Z2iLTQiIHN0cm9rZT0ibm9uZSIgc3Ryb2tlLXdpZHRoPSIxIiBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPgogICAgICAgIDxnIGlkPSJXaGl0ZWJvYXJkLUd1aWRlbGluZXMiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0zODguMDAwMDAwLCAtNjcyLjAwMDAwMCkiPgogICAgICAgICAgICA8ZyBpZD0idGV4dC1jdXJzb3IiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDM5Mi4wMDAwMDAsIDY3Mi4wMDAwMDApIj4KICAgICAgICAgICAgICAgIDxyZWN0IGlkPSLnn6nlvaLlpIfku70tNDAiIGZpbGw9IiNGRkZGRkYiIG9wYWNpdHk9IjAuMDEiIHg9IjAiIHk9IjAiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgcng9IjIiPjwvcmVjdD4KICAgICAgICAgICAgICAgIDxnIGlkPSLlvaLnirbnu5PlkIgiIGZpbGwtcnVsZT0ibm9uemVybyI+CiAgICAgICAgICAgICAgICAgICAgPHVzZSBmaWxsPSJibGFjayIgZmlsbC1vcGFjaXR5PSIxIiBmaWx0ZXI9InVybCgjZmlsdGVyLTIpIiB4bGluazpocmVmPSIjcGF0aC0xIj48L3VzZT4KICAgICAgICAgICAgICAgICAgICA8cGF0aCBzdHJva2U9IiNGRkZGRkYiIHN0cm9rZS13aWR0aD0iMSIgZD0iTTE5LDI1IEwxOSwxNSBMMTYsMTUgQzE1LjQ0NzcxNTMsMTUgMTUsMTQuNTUyMjg0NyAxNSwxNCBDMTUsMTMuNTE0NTg5NyAxNS4zNDc5OTkzLDEzLjEwMTkxNSAxNS44NjU0ODc3LDEzLjAxMDA1MjEgTDE2LDEzIEwyNCwxMyBDMjQuNTUyMjg0NywxMyAyNSwxMy40NDc3MTUzIDI1LDE0IEMyNSwxNC40ODU0MTAzIDI0LjY1MjAwMDcsMTQuODk4MDg1IDI0LjEzNDUxMjMsMTQuOTg5OTQ3OSBMMjQsMTUgTDIxLDE1IEwyMSwyNSBMMjQsMjUgQzI0LjU1MjI4NDcsMjUgMjUsMjUuNDQ3NzE1MyAyNSwyNiBDMjUsMjYuNDg1NDEwMyAyNC42NTIwMDA3LDI2Ljg5ODA4NSAyNC4xMzQ1MTIzLDI2Ljk4OTk0NzkgTDI0LDI3IEwxNiwyNyBDMTUuNDQ3NzE1MywyNyAxNSwyNi41NTIyODQ3IDE1LDI2IEMxNSwyNS41MTQ1ODk3IDE1LjM0Nzk5OTMsMjUuMTAxOTE1IDE1Ljg2NTQ4NzcsMjUuMDEwMDUyMSBMMTYsMjUgTDE5LDI1IFoiIGZpbGw9IiMyMTIzMjQiIGZpbGwtcnVsZT0iZXZlbm9kZCI+PC9wYXRoPgogICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICA8L2c+CiAgICAgICAgPC9nPgogICAgPC9nPgo8L3N2Zz4=",Av="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB3aWR0aD0iMjhweCIgaGVpZ2h0PSIyOHB4IiB2aWV3Qm94PSIwIDAgMjggMjgiIHZlcnNpb249IjEuMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgICA8IS0tIEdlbmVyYXRvcjogU2tldGNoIDU1LjEgKDc4MTM2KSAtIGh0dHBzOi8vc2tldGNoYXBwLmNvbSAtLT4KICAgIDx0aXRsZT7nvJbnu4QgMjwvdGl0bGU+CiAgICA8ZGVzYz5DcmVhdGVkIHdpdGggU2tldGNoLjwvZGVzYz4KICAgIDxkZWZzPgogICAgICAgIDxmaWx0ZXIgeD0iLTEyMC4wJSIgeT0iLTEyMC4wJSIgd2lkdGg9IjM0MC4wJSIgaGVpZ2h0PSIzNDAuMCUiIGZpbHRlclVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgaWQ9ImZpbHRlci0xIj4KICAgICAgICAgICAgPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iNCIgaW49IlNvdXJjZUdyYXBoaWMiPjwvZmVHYXVzc2lhbkJsdXI+CiAgICAgICAgPC9maWx0ZXI+CiAgICA8L2RlZnM+CiAgICA8ZyBpZD0i6aG16Z2iMSIgc3Ryb2tlPSJub25lIiBzdHJva2Utd2lkdGg9IjEiIGZpbGw9Im5vbmUiIGZpbGwtcnVsZT0iZXZlbm9kZCI+CiAgICAgICAgPGcgaWQ9Iue8lue7hC0yIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSg5LjAwMDAwMCwgOS4wMDAwMDApIiBmaWxsPSIjRkYwMTAwIj4KICAgICAgICAgICAgPGNpcmNsZSBpZD0i5qSt5ZyG5b2iIiBmaWx0ZXI9InVybCgjZmlsdGVyLTEpIiBjeD0iNSIgY3k9IjUiIHI9IjUiPjwvY2lyY2xlPgogICAgICAgICAgICA8cGF0aCBkPSJNNSw4IEM2LjY1Njg1NDI1LDggOCw2LjY1Njg1NDI1IDgsNSBDOCwzLjM0MzE0NTc1IDYuNjU2ODU0MjUsMiA1LDIgQzMuMzQzMTQ1NzUsMiAyLDMuMzQzMTQ1NzUgMiw1IEMyLDYuNjU2ODU0MjUgMy4zNDMxNDU3NSw4IDUsOCBaIE01LDYuMjg1NzE0MjkgQzQuMjg5OTE5NjEsNi4yODU3MTQyOSAzLjcxNDI4NTcxLDUuNzEwMDgwMzkgMy43MTQyODU3MSw1IEMzLjcxNDI4NTcxLDQuMjg5OTE5NjEgNC4yODk5MTk2MSwzLjcxNDI4NTcxIDUsMy43MTQyODU3MSBDNS43MTAwODAzOSwzLjcxNDI4NTcxIDYuMjg1NzE0MjksNC4yODk5MTk2MSA2LjI4NTcxNDI5LDUgQzYuMjg1NzE0MjksNS43MTAwODAzOSA1LjcxMDA4MDM5LDYuMjg1NzE0MjkgNSw2LjI4NTcxNDI5IFoiIGlkPSLmpK3lnIblvaIiIGZpbGwtcnVsZT0ibm9uemVybyI+PC9wYXRoPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+";const Tu={[I.ApplianceNames.pencil]:Sv,[I.ApplianceNames.selector]:Cv,[I.ApplianceNames.eraser]:bv,[I.ApplianceNames.shape]:Mv,[I.ApplianceNames.text]:Iv,[I.ApplianceNames.laserPointer]:Av};class Ev{constructor(t,i,n){var s;this.manager=t,this.enableCursor=i,this.cursorInstances=new Map,this.sideEffectManager=new Re.SideEffectManager,this.store=this.manager.store,this.applianceIcons=Tu,this.onCursorMove=o=>{const a=this.initCursorInstance(o.uid);if(o.state===ld.Leave)a.leave();else{const l=a.updateMember();this.canMoveCursor(l)&&a.move(o.position)}},this.initCursorInstance=o=>{let a=this.cursorInstances.get(o);return a||(a=new xv(this.manager,o,this,ge.playground),this.cursorInstances.set(o,a)),a},this.mouseMoveListener=A.throttle(o=>{o.pointerType==="touch"&&!o.isPrimary||this.updateCursor(this.getType(o),o.clientX,o.clientY)},48),this.getPoint=(o,a,l)=>{var h;const u=(h=o==null?void 0:o.divElement)==null?void 0:h.getBoundingClientRect();if(u)return o==null?void 0:o.convertToPointInWorld({x:a-u.x,y:l-u.y})},this.getType=o=>{var u;const a=o.target,l=this.manager.focusApp;switch(a.parentElement){case this.mainViewElement:return{type:"main"};case((u=l==null?void 0:l.view)==null?void 0:u.divElement):return{type:"app"};default:return{type:"main"}}},this.mouseLeaveListener=()=>{this.hideCursor(this.manager.uid)},this.roomMembers=(s=this.manager.room)==null?void 0:s.state.roomMembers;const r=ge.playground;r&&this.setupWrapper(r),this.sideEffectManager.add(()=>j.on("cursorMove",this.onCursorMove)),this.sideEffectManager.add(()=>j.on("playgroundSizeChange",()=>this.updateContainerRect())),n&&(this.applianceIcons=H(H({},Tu),n))}canMoveCursor(t){const i=(t==null?void 0:t.memberState.currentApplianceName)===I.ApplianceNames.laserPointer;return this.enableCursor||i}setupWrapper(t){this.sideEffectManager.add(()=>(t.addEventListener("pointerenter",this.mouseMoveListener),t.addEventListener("pointermove",this.mouseMoveListener),t.addEventListener("pointerleave",this.mouseLeaveListener),()=>{t.removeEventListener("pointerenter",this.mouseMoveListener),t.removeEventListener("pointermove",this.mouseMoveListener),t.removeEventListener("pointerleave",this.mouseLeaveListener)})),this.updateContainerRect()}setMainViewDivElement(t){this.mainViewElement=t}get boxState(){return this.store.getBoxState()}get focusView(){var t;return(t=this.manager.focusApp)==null?void 0:t.view}updateCursor(t,i,n){if(this.wrapperRect&&this.manager.canOperate){const r=t.type==="main"?this.manager.mainView:this.focusView,s=this.getPoint(r,i,n);s&&this.manager.dispatchInternalEvent(Z.CursorMove,{uid:this.manager.uid,position:{x:s.x,y:s.y,type:t.type}})}}updateContainerRect(){var t,i;this.wrapperRect=(t=this.manager.boxManager)==null?void 0:t.stageRect,this.playgroundRect=(i=ge.playground)==null?void 0:i.getBoundingClientRect()}deleteCursor(t){this.store.cleanCursor(t);const i=this.cursorInstances.get(t);i&&i.destroy()}hideCursor(t){const i=this.cursorInstances.get(t);i&&i.hide()}destroy(){this.sideEffectManager.flushAll(),this.cursorInstances.size&&(this.cursorInstances.forEach(t=>{t.destroy()}),this.cursorInstances.clear())}}class Tv{constructor(t){this.manager=t,j.on("changePageState",()=>{te.emit("pageStateChange",this.toObject())})}get index(){var t;return((t=this.manager)==null?void 0:t.store.getMainViewSceneIndex())||0}get length(){var t;return((t=this.manager)==null?void 0:t.mainViewScenesLength)||0}toObject(){return{index:this.index>=this.length?this.length-1:this.index,length:this.length}}}class kv{constructor(t){this.ctx=t,this.reactors=new Map,this.disposers=new Map,this.onPhaseChanged=i=>{var n,r;i===I.RoomPhase.Reconnecting&&this.ctx.emitter.emit("startReconnect"),i===I.RoomPhase.Connected&&this.phase===I.RoomPhase.Reconnecting&&((n=this.room)!=null&&n.isWritable?(r=this.room)==null||r.dispatchMagixEvent(Xs,{}):this.onReconnected()),this.phase=i},this.onReconnected=A.debounce(()=>{this._onReconnected()},1e3),this._onReconnected=()=>{zt("onReconnected refresh reactors"),this.releaseDisposers(),this.reactors.forEach((i,n)=>{A.isFunction(i)&&this.disposers.set(n,i())}),this.ctx.emitter.emit("onReconnected")}}setRoom(t){this.room=t,this.phase=t==null?void 0:t.phase,t&&(t.callbacks.off("onPhaseChanged",this.onPhaseChanged),t.callbacks.on("onPhaseChanged",this.onPhaseChanged),t.addMagixEventListener(Xs,i=>{i.authorId===t.observerId&&this.onReconnected()},{fireSelfEventAfterCommit:!0}))}setContext(t){this.ctx=t}releaseDisposers(){this.disposers.forEach(t=>{A.isFunction(t)&&t()}),this.disposers.clear()}refresh(){this._onReconnected()}add(t,i){const n=this.disposers.get(t);return n&&A.isFunction(n)&&n(),A.isFunction(i)&&(this.reactors.set(t,i),this.disposers.set(t,i())),()=>this.remove(t)}remove(t){this.reactors.has(t)&&this.reactors.delete(t);const i=this.disposers.get(t);i&&(A.isFunction(i)&&i(),this.disposers.delete(t))}hasReactor(t){return this.reactors.has(t)}destroy(){var t,i;(t=this.room)==null||t.callbacks.off("onPhaseChanged",this.onPhaseChanged),(i=this.room)==null||i.removeMagixEventListener(Xs,this.onReconnected),this.releaseDisposers()}}const Nv=(e,t)=>{if(I.isPlayer(e))zv(e);else{if(e=e,Object.getOwnPropertyDescriptor(e,"disableCameraTransform"))return;Object.defineProperty(e,"disableCameraTransform",{get(){return t.mainView.disableCameraTransform},set(n){t.mainView.disableCameraTransform=n}}),Object.defineProperty(e,"canUndoSteps",{get(){return t.canUndoSteps}}),Object.defineProperty(e,"canRedoSteps",{get(){return t.canRedoSteps}}),e.moveCamera=n=>t.moveCamera(n),e.moveCameraToContain=(...n)=>t.moveCameraToContain(...n),e.convertToPointInWorld=(...n)=>t.mainView.convertToPointInWorld(...n),e.setCameraBound=(...n)=>t.mainView.setCameraBound(...n),e.scenePreview=(...n)=>t.mainView.scenePreview(...n),e.fillSceneSnapshot=(...n)=>t.mainView.fillSceneSnapshot(...n),e.generateScreenshot=(...n)=>t.mainView.generateScreenshot(...n),e.setMemberState=(...n)=>t.mainView.setMemberState(...n),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=(...n)=>t.insertImage(...n),e.completeImageUpload=(...n)=>t.completeImageUpload(...n),e.insertText=(...n)=>t.insertText(...n),e.lockImage=(...n)=>t.lockImage(...n),e.lockImages=(...n)=>t.lockImages(...n),Pv(e,t),e.dynamicPpt.slideStateAdapter.pptHandler||(e.dynamicPpt.slideStateAdapter.pptHandler=t.createPPTHandler())}},Pv=(e,t)=>{const i=e.removeScenes;e.removeScenes=(n,r)=>{var o;n===ze&&((o=t.appManager)==null||o.updateRootDirRemoving(!0));const s=i.call(e,n);return j.emit("removeScenes",{scenePath:n,index:r}),s}},zv=e=>{const t=e.seekToProgressTime;async function i(n){await j.emit("seekStart");const r=await t.call(e,n);return j.emit("seek",n),r}e.seekToProgressTime=i};var Dv=Object.defineProperty,jv=Object.defineProperties,Lv=Object.getOwnPropertyDescriptors,ku=Object.getOwnPropertySymbols,Vv=Object.prototype.hasOwnProperty,Rv=Object.prototype.propertyIsEnumerable,Nu=(e,t,i)=>t in e?Dv(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Hd=(e,t)=>{for(var i in t||(t={}))Vv.call(t,i)&&Nu(e,i,t[i]);if(ku)for(var i of ku(t))Rv.call(t,i)&&Nu(e,i,t[i]);return e},Fd=(e,t)=>jv(e,Lv(t)),Bv=`.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}
124
124
  `;const Ov=(e,t,i,n)=>{if(i==="length"||i==="prototype"||i==="arguments"||i==="caller")return;const r=Object.getOwnPropertyDescriptor(e,i),s=Object.getOwnPropertyDescriptor(t,i);!_v(r,s)&&n||Object.defineProperty(e,i,s)},_v=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},$v=(e,t)=>{const i=Object.getPrototypeOf(t);i!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,i)},Uv=(e,t)=>`/* Wrapped ${e}*/
125
- ${t}`,Wv=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Hv=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Fv=(e,t,i)=>{const n=i===""?"":`with ${i.trim()}() `,r=Uv.bind(null,n,t.toString());Object.defineProperty(r,"name",Hv),Object.defineProperty(e,"toString",Fd(Hd({},Wv),{value:r}))};function Qv(e,t,{ignoreNonConfigurable:i=!1}={}){const{name:n}=e;for(const r of Reflect.ownKeys(t))Ov(e,t,r,i);return $v(e,t),Fv(e,t,n),e}const Zv=(e,t={})=>{if(typeof e!="function")throw new TypeError(`Expected the first argument to be a function, got \`${typeof e}\``);const{wait:i=0,maxWait:n=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 o,a,l;const u=function(...h){const p=this,w=()=>{o=void 0,a&&(clearTimeout(a),a=void 0),s&&(l=e.apply(p,h))},S=()=>{a=void 0,o&&(clearTimeout(o),o=void 0),s&&(l=e.apply(p,h))},I=r&&!o;return clearTimeout(o),o=setTimeout(w,i),n>0&&n!==Number.Infinity&&!a&&(a=setTimeout(S,n)),I&&(l=e.apply(p,h)),l};return Qv(u,e),u.cancel=()=>{o&&(clearTimeout(o),o=void 0),a&&(clearTimeout(a),a=void 0)},u},Qd="!#%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",Yv=Qd.length,Pu=Array(20),nn=()=>{for(let e=0;e<20;e++)Pu[e]=Qd.charAt(Math.random()*Yv);return Pu.join("")};class Ns{constructor(){this.disposers=new Map}add(t,i=nn()){return this.flush(i),this.disposers.set(i,t()),i}addDisposer(t,i=nn()){return this.flush(i),this.disposers.set(i,t),i}addEventListener(t,i,n,r,s=nn()){return this.add(()=>(t.addEventListener(i,n,r),()=>t.removeEventListener(i,n,r)),s),s}setTimeout(t,i,n=nn()){return this.add(()=>{const r=window.setTimeout(()=>{this.remove(n),t()},i);return()=>window.clearTimeout(r)},n)}setInterval(t,i,n=nn()){return this.add(()=>{const r=window.setInterval(t,i);return()=>window.clearInterval(r)},n)}remove(t){const i=this.disposers.get(t);return this.disposers.delete(t),i}flush(t){const i=this.remove(t);if(i)try{i()}catch(n){console.error(n)}}flushAll(){this.disposers.forEach(t=>{try{t()}catch(i){console.error(i)}}),this.disposers.clear()}}var ui=[],Gv=function(){return ui.some(function(e){return e.activeTargets.length>0})},Xv=function(){return ui.some(function(e){return e.skippedTargets.length>0})},zu="ResizeObserver loop completed with undelivered notifications.",Jv=function(){var e;typeof ErrorEvent=="function"?e=new ErrorEvent("error",{message:zu}):(e=document.createEvent("Event"),e.initEvent("error",!1,!1),e.message=zu),window.dispatchEvent(e)},Rn;(function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(Rn||(Rn={}));var ci=function(e){return Object.freeze(e)},Kv=function(){function e(t,i){this.inlineSize=t,this.blockSize=i,ci(this)}return e}(),Zd=function(){function e(t,i,n,r){return this.x=t,this.y=i,this.width=n,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,ci(this)}return e.prototype.toJSON=function(){var t=this,i=t.x,n=t.y,r=t.top,s=t.right,o=t.bottom,a=t.left,l=t.width,u=t.height;return{x:i,y:n,top:r,right:s,bottom:o,left:a,width:l,height:u}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),Za=function(e){return e instanceof SVGElement&&"getBBox"in e},Yd=function(e){if(Za(e)){var t=e.getBBox(),i=t.width,n=t.height;return!i&&!n}var r=e,s=r.offsetWidth,o=r.offsetHeight;return!(s||o||e.getClientRects().length)},Du=function(e){var t,i;if(e instanceof Element)return!0;var n=(i=(t=e)===null||t===void 0?void 0:t.ownerDocument)===null||i===void 0?void 0:i.defaultView;return!!(n&&e instanceof n.Element)},qv=function(e){switch(e.tagName){case"INPUT":if(e.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},In=typeof window!="undefined"?window:{},dr=new WeakMap,ju=/auto|scroll/,ew=/^tb|vertical/,tw=/msie|trident/i.test(In.navigator&&In.navigator.userAgent),it=function(e){return parseFloat(e||"0")},Vi=function(e,t,i){return e===void 0&&(e=0),t===void 0&&(t=0),i===void 0&&(i=!1),new Kv((i?t:e)||0,(i?e:t)||0)},Vu=ci({devicePixelContentBoxSize:Vi(),borderBoxSize:Vi(),contentBoxSize:Vi(),contentRect:new Zd(0,0,0,0)}),Gd=function(e,t){if(t===void 0&&(t=!1),dr.has(e)&&!t)return dr.get(e);if(Yd(e))return dr.set(e,Vu),Vu;var i=getComputedStyle(e),n=Za(e)&&e.ownerSVGElement&&e.getBBox(),r=!tw&&i.boxSizing==="border-box",s=ew.test(i.writingMode||""),o=!n&&ju.test(i.overflowY||""),a=!n&&ju.test(i.overflowX||""),l=n?0:it(i.paddingTop),u=n?0:it(i.paddingRight),h=n?0:it(i.paddingBottom),p=n?0:it(i.paddingLeft),w=n?0:it(i.borderTopWidth),S=n?0:it(i.borderRightWidth),I=n?0:it(i.borderBottomWidth),E=n?0:it(i.borderLeftWidth),c=p+u,d=l+h,f=E+S,g=w+I,m=a?e.offsetHeight-g-e.clientHeight:0,y=o?e.offsetWidth-f-e.clientWidth:0,v=r?c+f:0,T=r?d+g:0,D=n?n.width:it(i.width)-v-y,k=n?n.height:it(i.height)-T-m,X=D+c+y+f,J=k+d+m+g,re=ci({devicePixelContentBoxSize:Vi(Math.round(D*devicePixelRatio),Math.round(k*devicePixelRatio),s),borderBoxSize:Vi(X,J,s),contentBoxSize:Vi(D,k,s),contentRect:new Zd(p,l,D,k)});return dr.set(e,re),re},Xd=function(e,t,i){var n=Gd(e,i),r=n.borderBoxSize,s=n.contentBoxSize,o=n.devicePixelContentBoxSize;switch(t){case Rn.DEVICE_PIXEL_CONTENT_BOX:return o;case Rn.BORDER_BOX:return r;default:return s}},iw=function(){function e(t){var i=Gd(t);this.target=t,this.contentRect=i.contentRect,this.borderBoxSize=ci([i.borderBoxSize]),this.contentBoxSize=ci([i.contentBoxSize]),this.devicePixelContentBoxSize=ci([i.devicePixelContentBoxSize])}return e}(),Jd=function(e){if(Yd(e))return 1/0;for(var t=0,i=e.parentNode;i;)t+=1,i=i.parentNode;return t},nw=function(){var e=1/0,t=[];ui.forEach(function(o){if(o.activeTargets.length!==0){var a=[];o.activeTargets.forEach(function(u){var h=new iw(u.target),p=Jd(u.target);a.push(h),u.lastReportedSize=Xd(u.target,u.observedBox),p<e&&(e=p)}),t.push(function(){o.callback.call(o.observer,a,o.observer)}),o.activeTargets.splice(0,o.activeTargets.length)}});for(var i=0,n=t;i<n.length;i++){var r=n[i];r()}return e},Lu=function(e){ui.forEach(function(i){i.activeTargets.splice(0,i.activeTargets.length),i.skippedTargets.splice(0,i.skippedTargets.length),i.observationTargets.forEach(function(r){r.isActive()&&(Jd(r.target)>e?i.activeTargets.push(r):i.skippedTargets.push(r))})})},rw=function(){var e=0;for(Lu(e);Gv();)e=nw(),Lu(e);return Xv()&&Jv(),e>0},oo,Kd=[],sw=function(){return Kd.splice(0).forEach(function(e){return e()})},ow=function(e){if(!oo){var t=0,i=document.createTextNode(""),n={characterData:!0};new MutationObserver(function(){return sw()}).observe(i,n),oo=function(){i.textContent=""+(t?t--:t++)}}Kd.push(e),oo()},aw=function(e){ow(function(){requestAnimationFrame(e)})},Nr=0,lw=function(){return!!Nr},uw=250,cw={attributes:!0,characterData:!0,childList:!0,subtree:!0},Ru=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Bu=function(e){return e===void 0&&(e=0),Date.now()+e},ao=!1,dw=function(){function e(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return e.prototype.run=function(t){var i=this;if(t===void 0&&(t=uw),!ao){ao=!0;var n=Bu(t);aw(function(){var r=!1;try{r=rw()}finally{if(ao=!1,t=n-Bu(),!lw())return;r?i.run(1e3):t>0?i.run(t):i.start()}})}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var t=this,i=function(){return t.observer&&t.observer.observe(document.body,cw)};document.body?i():In.addEventListener("DOMContentLoaded",i)},e.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Ru.forEach(function(i){return In.addEventListener(i,t.listener,!0)}))},e.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),Ru.forEach(function(i){return In.removeEventListener(i,t.listener,!0)}),this.stopped=!0)},e}(),Ro=new dw,Ou=function(e){!Nr&&e>0&&Ro.start(),Nr+=e,!Nr&&Ro.stop()},hw=function(e){return!Za(e)&&!qv(e)&&getComputedStyle(e).display==="inline"},pw=function(){function e(t,i){this.target=t,this.observedBox=i||Rn.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var t=Xd(this.target,this.observedBox,!0);return hw(this.target)&&(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),fw=function(){function e(t,i){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=i}return e}(),hr=new WeakMap,_u=function(e,t){for(var i=0;i<e.length;i+=1)if(e[i].target===t)return i;return-1},pr=function(){function e(){}return e.connect=function(t,i){var n=new fw(t,i);hr.set(t,n)},e.observe=function(t,i,n){var r=hr.get(t),s=r.observationTargets.length===0;_u(r.observationTargets,i)<0&&(s&&ui.push(r),r.observationTargets.push(new pw(i,n&&n.box)),Ou(1),Ro.schedule())},e.unobserve=function(t,i){var n=hr.get(t),r=_u(n.observationTargets,i),s=n.observationTargets.length===1;r>=0&&(s&&ui.splice(ui.indexOf(n),1),n.observationTargets.splice(r,1),Ou(-1))},e.disconnect=function(t){var i=this,n=hr.get(t);n.observationTargets.slice().forEach(function(r){return i.unobserve(t,r.target)}),n.activeTargets.splice(0,n.activeTargets.length)},e}(),gw=function(){function e(t){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof t!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");pr.connect(this,t)}return e.prototype.observe=function(t,i){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Du(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");pr.observe(this,t,i)},e.prototype.unobserve=function(t){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Du(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");pr.unobserve(this,t)},e.prototype.disconnect=function(){pr.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();function mw(e){const t="http://www.w3.org/2000/svg",i=document.createElementNS(t,"svg");i.setAttribute("class",`${e}-footer-icon-sidebar`),i.setAttribute("viewBox","0 0 64 64");const n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.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"),i.appendChild(n),i}function vw(e){const t="http://www.w3.org/2000/svg",i=document.createElementNS(t,"svg");i.setAttribute("class",`${e}-footer-icon-arrow-left`),i.setAttribute("viewBox","0 0 500 500");const n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.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"),i.appendChild(n),i}function ww(e){const t="http://www.w3.org/2000/svg",i=document.createElementNS(t,"svg");i.setAttribute("class",`${e}-footer-icon-arrow-right`),i.setAttribute("viewBox","0 0 500 500");const n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.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"),i.appendChild(n),i}function yw(e){const t="http://www.w3.org/2000/svg",i=document.createElementNS(t,"svg");i.setAttribute("class",`${e}-footer-icon-play`),i.setAttribute("viewBox","0 0 500 500");const n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.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"),i.appendChild(n),i}function xw(e){const t="http://www.w3.org/2000/svg",i=document.createElementNS(t,"svg");i.setAttribute("class",`${e}-footer-icon-pause`),i.setAttribute("viewBox","0 0 500 500");const n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.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"),i.appendChild(n),i}const Ci=typeof window!="undefined",qd=Ci&&!("onscroll"in window)||typeof navigator!="undefined"&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),eh=Ci&&"IntersectionObserver"in window,th=Ci&&"classList"in document.createElement("p"),ih=Ci&&window.devicePixelRatio>1,Sw={elements_selector:".lazy",container:qd||Ci?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},nh=e=>Object.assign({},Sw,e),$u=function(e,t){let i;const n="LazyLoad::Initialized",r=new e(t);try{i=new CustomEvent(n,{detail:{instance:r}})}catch{i=document.createEvent("CustomEvent"),i.initCustomEvent(n,!1,!1,{instance:r})}window.dispatchEvent(i)},Cw=(e,t)=>{if(!!t)if(!t.length)$u(e,t);else for(let i=0,n;n=t[i];i+=1)$u(e,n)},At="src",Ya="srcset",Ga="sizes",rh="poster",Gn="llOriginalAttrs",sh="data",Xa="loading",oh="loaded",ah="applied",bw="entered",Ja="error",lh="native",uh="data-",ch="ll-status",Le=(e,t)=>e.getAttribute(uh+t),Mw=(e,t,i)=>{var n=uh+t;if(i===null){e.removeAttribute(n);return}e.setAttribute(n,i)},Xn=e=>Le(e,ch),bi=(e,t)=>Mw(e,ch,t),Ps=e=>bi(e,null),Ka=e=>Xn(e)===null,Iw=e=>Xn(e)===Xa,Aw=e=>Xn(e)===Ja,qa=e=>Xn(e)===lh,Ew=[Xa,oh,ah,Ja],Tw=e=>Ew.indexOf(Xn(e))>=0,qt=(e,t,i,n)=>{if(!!e){if(n!==void 0){e(t,i,n);return}if(i!==void 0){e(t,i);return}e(t)}},Ji=(e,t)=>{if(th){e.classList.add(t);return}e.className+=(e.className?" ":"")+t},rt=(e,t)=>{if(th){e.classList.remove(t);return}e.className=e.className.replace(new RegExp("(^|\\s+)"+t+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},kw=e=>{e.llTempImage=document.createElement("IMG")},Nw=e=>{delete e.llTempImage},dh=e=>e.llTempImage,zs=(e,t)=>{if(!t)return;const i=t._observer;!i||i.unobserve(e)},Pw=e=>{e.disconnect()},zw=(e,t,i)=>{t.unobserve_entered&&zs(e,i)},el=(e,t)=>{!e||(e.loadingCount+=t)},Dw=e=>{!e||(e.toLoadCount-=1)},hh=(e,t)=>{!e||(e.toLoadCount=t)},jw=e=>e.loadingCount>0,Vw=e=>e.toLoadCount>0,ph=e=>{let t=[];for(let i=0,n;n=e.children[i];i+=1)n.tagName==="SOURCE"&&t.push(n);return t},tl=(e,t)=>{const i=e.parentNode;if(!i||i.tagName!=="PICTURE")return;ph(i).forEach(t)},fh=(e,t)=>{ph(e).forEach(t)},Ds=[At],gh=[At,rh],Yr=[At,Ya,Ga],mh=[sh],js=e=>!!e[Gn],vh=e=>e[Gn],wh=e=>delete e[Gn],Ui=(e,t)=>{if(js(e))return;const i={};t.forEach(n=>{i[n]=e.getAttribute(n)}),e[Gn]=i},Lw=e=>{js(e)||(e[Gn]={backgroundImage:e.style.backgroundImage})},Rw=(e,t,i)=>{if(!i){e.removeAttribute(t);return}e.setAttribute(t,i)},Wi=(e,t)=>{if(!js(e))return;const i=vh(e);t.forEach(n=>{Rw(e,n,i[n])})},Bw=e=>{if(!js(e))return;const t=vh(e);e.style.backgroundImage=t.backgroundImage},Ow=(e,t,i)=>{Ji(e,t.class_applied),bi(e,ah),i&&(t.unobserve_completed&&zs(e,t),qt(t.callback_applied,e,i))},yh=(e,t,i)=>{Ji(e,t.class_loading),bi(e,Xa),i&&(el(i,1),qt(t.callback_loading,e,i))},$t=(e,t,i)=>{!i||e.setAttribute(t,i)},Uu=(e,t)=>{$t(e,Ga,Le(e,t.data_sizes)),$t(e,Ya,Le(e,t.data_srcset)),$t(e,At,Le(e,t.data_src))},_w=(e,t)=>{tl(e,i=>{Ui(i,Yr),Uu(i,t)}),Ui(e,Yr),Uu(e,t)},$w=(e,t)=>{Ui(e,Ds),$t(e,At,Le(e,t.data_src))},Uw=(e,t)=>{fh(e,i=>{Ui(i,Ds),$t(i,At,Le(i,t.data_src))}),Ui(e,gh),$t(e,rh,Le(e,t.data_poster)),$t(e,At,Le(e,t.data_src)),e.load()},Ww=(e,t)=>{Ui(e,mh),$t(e,sh,Le(e,t.data_src))},Hw=(e,t,i)=>{const n=Le(e,t.data_bg),r=Le(e,t.data_bg_hidpi),s=ih&&r?r:n;!s||(e.style.backgroundImage=`url("${s}")`,dh(e).setAttribute(At,s),yh(e,t,i))},Fw=(e,t,i)=>{const n=Le(e,t.data_bg_multi),r=Le(e,t.data_bg_multi_hidpi),s=ih&&r?r:n;!s||(e.style.backgroundImage=s,Ow(e,t,i))},xh={IMG:_w,IFRAME:$w,VIDEO:Uw,OBJECT:Ww},Qw=(e,t)=>{const i=xh[e.tagName];!i||i(e,t)},Zw=(e,t,i)=>{const n=xh[e.tagName];!n||(n(e,t),yh(e,t,i))},Yw=["IMG","IFRAME","VIDEO","OBJECT"],Gw=e=>Yw.indexOf(e.tagName)>-1,Sh=(e,t)=>{t&&!jw(t)&&!Vw(t)&&qt(e.callback_finish,t)},Wu=(e,t,i)=>{e.addEventListener(t,i),e.llEvLisnrs[t]=i},Xw=(e,t,i)=>{e.removeEventListener(t,i)},il=e=>!!e.llEvLisnrs,Jw=(e,t,i)=>{il(e)||(e.llEvLisnrs={});const n=e.tagName==="VIDEO"?"loadeddata":"load";Wu(e,n,t),Wu(e,"error",i)},Bo=e=>{if(!il(e))return;const t=e.llEvLisnrs;for(let i in t){const n=t[i];Xw(e,i,n)}delete e.llEvLisnrs},Ch=(e,t,i)=>{Nw(e),el(i,-1),Dw(i),rt(e,t.class_loading),t.unobserve_completed&&zs(e,i)},Kw=(e,t,i,n)=>{const r=qa(t);Ch(t,i,n),Ji(t,i.class_loaded),bi(t,oh),qt(i.callback_loaded,t,n),r||Sh(i,n)},qw=(e,t,i,n)=>{const r=qa(t);Ch(t,i,n),Ji(t,i.class_error),bi(t,Ja),qt(i.callback_error,t,n),r||Sh(i,n)},nl=(e,t,i)=>{const n=dh(e)||e;if(il(n))return;Jw(n,o=>{Kw(o,e,t,i),Bo(n)},o=>{qw(o,e,t,i),Bo(n)})},ey=(e,t,i)=>{kw(e),nl(e,t,i),Lw(e),Hw(e,t,i),Fw(e,t,i)},ty=(e,t,i)=>{nl(e,t,i),Zw(e,t,i)},rl=(e,t,i)=>{Gw(e)?ty(e,t,i):ey(e,t,i)},iy=(e,t,i)=>{e.setAttribute("loading","lazy"),nl(e,t,i),Qw(e,t),bi(e,lh)},Hu=e=>{e.removeAttribute(At),e.removeAttribute(Ya),e.removeAttribute(Ga)},ny=e=>{tl(e,t=>{Hu(t)}),Hu(e)},bh=e=>{tl(e,t=>{Wi(t,Yr)}),Wi(e,Yr)},ry=e=>{fh(e,t=>{Wi(t,Ds)}),Wi(e,gh),e.load()},sy=e=>{Wi(e,Ds)},oy=e=>{Wi(e,mh)},ay={IMG:bh,IFRAME:sy,VIDEO:ry,OBJECT:oy},ly=e=>{const t=ay[e.tagName];if(!t){Bw(e);return}t(e)},uy=(e,t)=>{Ka(e)||qa(e)||(rt(e,t.class_entered),rt(e,t.class_exited),rt(e,t.class_applied),rt(e,t.class_loading),rt(e,t.class_loaded),rt(e,t.class_error))},cy=(e,t)=>{ly(e),uy(e,t),Ps(e),wh(e)},dy=(e,t,i,n)=>{!i.cancel_on_exit||!Iw(e)||e.tagName==="IMG"&&(Bo(e),ny(e),bh(e),rt(e,i.class_loading),el(n,-1),Ps(e),qt(i.callback_cancel,e,t,n))},hy=(e,t,i,n)=>{const r=Tw(e);bi(e,bw),Ji(e,i.class_entered),rt(e,i.class_exited),zw(e,i,n),qt(i.callback_enter,e,t,n),!r&&rl(e,i,n)},py=(e,t,i,n)=>{Ka(e)||(Ji(e,i.class_exited),dy(e,t,i,n),qt(i.callback_exit,e,t,n))},fy=["IMG","IFRAME","VIDEO"],Mh=e=>e.use_native&&"loading"in HTMLImageElement.prototype,gy=(e,t,i)=>{e.forEach(n=>{fy.indexOf(n.tagName)!==-1&&iy(n,t,i)}),hh(i,0)},my=e=>e.isIntersecting||e.intersectionRatio>0,vy=e=>({root:e.container===document?null:e.container,rootMargin:e.thresholds||e.threshold+"px"}),wy=(e,t,i)=>{e.forEach(n=>my(n)?hy(n.target,n,t,i):py(n.target,n,t,i))},yy=(e,t)=>{t.forEach(i=>{e.observe(i)})},xy=(e,t)=>{Pw(e),yy(e,t)},Sy=(e,t)=>{!eh||Mh(e)||(t._observer=new IntersectionObserver(i=>{wy(i,e,t)},vy(e)))},Ih=e=>Array.prototype.slice.call(e),Gr=e=>e.container.querySelectorAll(e.elements_selector),Cy=e=>Ih(e).filter(Ka),by=e=>Aw(e),My=e=>Ih(e).filter(by),Fu=(e,t)=>Cy(e||Gr(t)),Iy=(e,t)=>{My(Gr(e)).forEach(n=>{rt(n,e.class_error),Ps(n)}),t.update()},Ay=(e,t)=>{!Ci||window.addEventListener("online",()=>{Iy(e,t)})},Jn=function(e,t){const i=nh(e);this._settings=i,this.loadingCount=0,Sy(i,this),Ay(i,this),this.update(t)};Jn.prototype={update:function(e){const t=this._settings,i=Fu(e,t);if(hh(this,i.length),qd||!eh){this.loadAll(i);return}if(Mh(t)){gy(i,t,this);return}xy(this._observer,i)},destroy:function(){this._observer&&this._observer.disconnect(),Gr(this._settings).forEach(e=>{wh(e)}),delete this._observer,delete this._settings,delete this.loadingCount,delete this.toLoadCount},loadAll:function(e){const t=this._settings;Fu(e,t).forEach(n=>{zs(n,this),rl(n,t,this)})},restoreAll:function(){const e=this._settings;Gr(e).forEach(t=>{cy(t,e)})}};Jn.load=(e,t)=>{const i=nh(t);rl(e,i)};Jn.resetStatus=e=>{Ps(e)};Ci&&Cw(Jn,window.lazyLoadOptions);class Ah{constructor({readonly:t,box:i,pages:n,onNewPageIndex:r,onPlay:s}){if(this.pageIndex=0,this.namespace="netless-app-docs-viewer",this.isShowPreview=!1,this.isSmallBox=!1,this.sideEffect=new Ns,n.length<=0)throw new Error("[DocsViewer] Empty pages.");this.readonly=t,this.box=i,this.pages=n,this.onNewPageIndex=r,this.onPlay=s,this.render()}mount(){this.box.mountContent(this.$content),this.box.mountFooter(this.$footer),this.sideEffect.add(()=>{const t=new Jn({container:this.$preview,elements_selector:`.${this.wrapClassName("preview-page>img")}`});return()=>t.destroy()},"preview-lazyload")}unmount(){this.$content.remove(),this.$footer.remove()}setReadonly(t){this.readonly!==t&&(this.readonly=t,this.$content.classList.toggle(this.wrapClassName("readonly"),t),this.$footer.classList.toggle(this.wrapClassName("readonly"),t),this.$pageNumberInput.disabled=t)}destroy(){this.sideEffect.flushAll(),this.unmount()}setPageIndex(t){Number.isNaN(t)||(this.pageIndex=t,this.$pageNumberInput.value=String(t+1))}setSmallBox(t){this.isSmallBox!==t&&(this.isSmallBox=t,this.$footer.classList.toggle(this.wrapClassName("float-footer"),t))}render(){return this.renderContent(),this.renderFooter(),this.$content}renderContent(){if(!this.$content){const t=document.createElement("div");t.className=this.wrapClassName("content"),this.$content=t,this.readonly&&t.classList.add(this.wrapClassName("readonly")),t.appendChild(this.renderPreviewMask()),t.appendChild(this.renderPreview())}return this.$content}renderPreview(){if(!this.$preview){const t=document.createElement("div");t.className=this.wrapClassName("preview")+" tele-fancy-scrollbar",this.$preview=t;const i=this.wrapClassName("preview-page"),n=this.wrapClassName("preview-page-name");this.pages.forEach((r,s)=>{var o;const a=(o=r.thumbnail)!=null?o:r.src.startsWith("ppt")?void 0:r.src;if(!a)return;const l=String(s),u=document.createElement("a");u.className=i+" "+this.wrapClassName(`preview-page-${s}`),u.setAttribute("href","#"),u.dataset.pageIndex=l;const h=document.createElement("span");h.className=n,h.textContent=String(s+1),h.dataset.pageIndex=l;const p=document.createElement("img");p.width=r.width,p.height=r.height,p.dataset.src=a,p.dataset.pageIndex=l,u.appendChild(p),u.appendChild(h),t.appendChild(u)}),this.sideEffect.addEventListener(t,"click",r=>{var s;if(this.readonly)return;const o=(s=r.target.dataset)==null?void 0:s.pageIndex;o&&(r.preventDefault(),r.stopPropagation(),r.stopImmediatePropagation(),this.onNewPageIndex(Number(o)),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",t=>{this.readonly||t.target===this.$previewMask&&this.togglePreview(!1)})),this.$previewMask}renderFooter(){if(!this.$footer){const t=document.createElement("div");if(t.className=this.wrapClassName("footer"),this.$footer=t,this.readonly&&t.classList.add(this.wrapClassName("readonly")),this.isSmallBox&&t.classList.add(this.wrapClassName("float-footer")),this.pages.some(l=>l.thumbnail||!l.src.startsWith("ppt"))){const l=this.renderFooterBtn("btn-sidebar",mw(this.namespace));this.sideEffect.addEventListener(l,"click",()=>{this.readonly||this.togglePreview()}),this.$footer.appendChild(l)}const i=document.createElement("div");i.className=this.wrapClassName("page-jumps");const n=this.renderFooterBtn("btn-page-back",vw(this.namespace));if(this.sideEffect.addEventListener(n,"click",()=>{this.readonly||this.onNewPageIndex(this.pageIndex-1)}),i.appendChild(n),this.onPlay){const l=this.renderFooterBtn("btn-page-play",yw(this.namespace),xw(this.namespace)),u=()=>{this.sideEffect.setTimeout(()=>{l.classList.toggle(this.wrapClassName("footer-btn-playing"),!1)},500,"returnPlay")};this.sideEffect.addEventListener(l,"click",()=>{this.readonly||(l.classList.toggle(this.wrapClassName("footer-btn-playing"),!0),this.onPlay&&this.onPlay(),u())}),i.appendChild(l)}const r=this.renderFooterBtn("btn-page-next",ww(this.namespace));this.sideEffect.addEventListener(r,"click",()=>{this.readonly||this.onNewPageIndex(this.pageIndex+1)}),i.appendChild(r);const s=document.createElement("div");s.className=this.wrapClassName("page-number");const o=document.createElement("input");o.className=this.wrapClassName("page-number-input"),o.value=String(this.pageIndex+1),this.readonly&&(o.disabled=!0),this.$pageNumberInput=o,this.sideEffect.addEventListener(o,"focus",()=>{o.select()}),this.sideEffect.addEventListener(o,"change",()=>{this.readonly||o.value&&this.onNewPageIndex(Number(o.value)-1)});const a=document.createElement("span");a.textContent=" / "+this.pages.length,s.appendChild(o),s.appendChild(a),this.$footer.appendChild(i),this.$footer.appendChild(s)}return this.$footer}renderFooterBtn(t,i,n){const r=document.createElement("button");return r.className=this.wrapClassName("footer-btn")+" "+this.wrapClassName(t),r.appendChild(i),n&&r.appendChild(n),r}togglePreview(t){if(this.isShowPreview=t!=null?t:!this.isShowPreview,this.$content.classList.toggle(this.wrapClassName("preview-active"),this.isShowPreview),this.isShowPreview){const i=this.$preview.querySelector("."+this.wrapClassName(`preview-page-${this.pageIndex}`));i&&this.$preview.scrollTo({top:i.offsetTop-16})}}wrapClassName(t){return`${this.namespace}-${t}`}}function Hi(e,t,i){return Math.min(Math.max(e,t),i)}function Qu(e){return e.touches?e.touches[0]:e}function Eh(e){e.stopPropagation(),e.cancelable&&e.preventDefault()}class Ey{constructor(t){var i,n,r;this.velocity=0,this.paused=!0,this._animationFrameID=null,this._loopTimestamp=0,this.looper=s=>{if(this.paused)return;let o=Math.floor((s-this._loopTimestamp)/1e3*60)+1;for(this._loopTimestamp=s;o-- >0;)this.stepper();this.onStep(this.current,this),!this.paused&&this.current!==this.target&&window.requestAnimationFrame(this.looper)},this.current=(i=t.start)!=null?i:0,this.target=this.current,this.stiffness=(n=t.stiffness)!=null?n:170,this.damping=(r=t.damping)!=null?r:26,this.onStep=t.onStep}stepTo(t,i){this.paused&&i!=null&&(this.current=i),this.paused=!1,this.target=t,this.onStep(this.current,this),this._loopTimestamp=Date.now(),window.requestAnimationFrame(this.looper)}pause(){this.paused=!0}destroy(){this.pause()}stepper(){const t=-this.stiffness*(this.current-this.target),i=-this.damping*this.velocity,n=this.velocity+(t+i)/60,r=this.current+n/60;Math.abs(n-0)<.01&&Math.abs(r-this.target)<.01?(this.current=this.target,this.velocity=0):(this.current=r,this.velocity=n)}}class Ty{constructor(t,i,n,r){this.scale=1,this.lastVisit=Date.now(),this.pageOffsetY=0,this.pageOffsetX=0,this.visible=!0,this.index=t,this.page=i,this.scale=n,this.pageOffsetX=(r-i.width)/2;const s=document.createElement("div");s.className="page-renderer-page",s.dataset.index=`${t}`,s.style.width=`${i.width*n}px`,s.style.height=`${i.height*n}px`,i.thumbnail&&(s.style.backgroundImage=`url("${i.thumbnail}")`);const o=document.createElement("img");o.className="page-renderer-page-img",o.width=i.width,o.height=i.height,o.src=i.src,s.appendChild(o),this.$page=s}translateY(t){Math.abs(t-this.pageOffsetY)>=.001&&(this.pageOffsetY=t,this.$page.style.transform=`translate(${this.pageOffsetX*this.scale}px, ${this.pageOffsetY*this.scale}px)`)}setScale(t){Math.abs(t-this.scale)>=.001&&(this.scale=t,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(t){t!==this.visible&&(this.visible=t,this.$page.style.opacity=t?"1":"0")}}const ky=window.requestIdleCallback||(e=>window.setTimeout(e,5e3)),Ny=window.cancelIdleCallback||window.clearTimeout;class Py{constructor(t,i,n){this.pages=t,this.pagesIntrinsicWidth=i,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 r=[...this.els.values()].sort((s,o)=>o.lastVisit-s.lastVisit);for(let s=Math.floor(this.maxElCount/4);s<r.length;s++)this.els.delete(r[s].index)}}}getEl(t){let i=this.els.get(t);return i||(i=new Ty(t,this.pages[t],this.scale,this.pagesIntrinsicWidth),this.els.set(t,i)),i.lastVisit=Date.now(),this.els.size>this.maxElCount&&this.gcTimer===null&&(this.gcTimer=ky(this.gc)),i}setScale(t){t!==this.scale&&(this.scale=t,this.els.forEach(i=>i.setScale(t)))}destroy(){this.els.clear(),this.gcTimer!==null&&(Ny(this.gcTimer),this.gcTimer=null)}}class zy{constructor(t){this._hwaTimeout=NaN,this._turnOffHWA=()=>{window.clearTimeout(this._hwaTimeout),this._hwaTimeout=NaN,this.$pages.classList.toggle("is-hwa",!1)},this.pagesScrollTop=t.pagesScrollTop||0,this.containerWidth=t.containerWidth||1,this.containerHeight=t.containerHeight||1,this.pages=t.pages.map(s=>{if(s.thumbnail)return s;try{const o=new URL(s.src);return o.searchParams.set("x-oss-process","image/resize,l_50"),Fd(Hd({},s),{thumbnail:o.toString()})}catch(o){return console.error(o),s}});const i=Array(this.pages.length);let n=1/0,r=0;this.pagesIntrinsicHeight=this.pages.reduce((s,o,a)=>(i[a]=s,o.width>r&&(r=o.width),o.height<=n&&(n=o.height),s+o.height),0),this.pagesIntrinsicWidth=r,this.pagesMinHeight=n,this.pagesIntrinsicYs=i,this.scale=this._calcScale(),this.threshold=this._calcThreshold(),this.onPageIndexChanged=t.onPageIndexChanged,this.pageScrollIndex=0,this.pagesScrollTop!==0&&(this.pageScrollIndex=this.findScrollPageIndex(),this.onPageIndexChanged&&this.pageScrollIndex>0&&this.onPageIndexChanged(this.pageScrollIndex)),this.pageElManager=new Py(this.pages,r,this.scale),this.$pages=this.renderPages()}setContainerSize(t,i){t>0&&i>0&&(t!==this.containerWidth||i!==this.containerHeight)&&(this.containerWidth=t,this.containerHeight=i,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 t=document.createElement("div");return t.className="page-renderer-pages-container",t.style.width=`${this.containerWidth}px`,t.style.height=`${this.containerHeight}px`,t}pagesScrollTo(t,i){if(t=Hi(t,0,this.pagesIntrinsicHeight-this.containerHeight/this.scale),i||Math.abs(t-this.pagesScrollTop)>=.001){this._turnOnHWA(),this.pagesScrollTop=t;const n=this.findScrollPageIndex(),r=Math.max(n-this.threshold,0),s=Math.min(n+this.threshold,this.pages.length-1);for(let o=0;o<this.$pages.children.length;o++){const a=this.$pages.children[o],l=Number(a.dataset.index);l>=r&&l<=s||(a.remove(),o--)}for(let o=r;o<=s;o++){const a=this.pageElManager.getEl(o);a.$page.parentElement!==this.$pages&&this.$pages.appendChild(a.$page),a.translateY(this.pagesIntrinsicYs[o]-this.pagesScrollTop)}n!==this.pageScrollIndex&&(this.pageScrollIndex=n,this.onPageIndexChanged&&this.onPageIndexChanged(n))}}findScrollPageIndex(){for(let t=0;t<this.pagesIntrinsicYs.length;t++)if(this.pagesIntrinsicYs[t]+this.pages[t].height-this.pagesScrollTop>=.001)return t;return this.pagesIntrinsicYs.length-1}mount(t){t.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 Hi(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)}}const Dy=30;class jy{constructor(t){this.sideEffect=new Ns,this.pagesScrollTop=t.pagesScrollTop||0,this.containerWidth=t.containerWidth||1,this.containerHeight=t.containerHeight||1,this.pagesWidth=t.pagesWidth||1,this.pagesHeight=t.pagesHeight||1,this.scale=this._calcScale(),this.scrollbarMinHeight=t.scrollbarMinHeight||Dy,this.scrollbarHeight=this._calcScrollbarHeight(),this.readonly=t.readonly,this.wrapClassName=t.wrapClassName,this.onDragScroll=t.onDragScroll,this.$scrollbar=this.renderScrollbar()}mount(t){t.appendChild(this.$scrollbar),this.pagesScrollTo(this.pagesScrollTop,!0)}unmount(){this.$scrollbar.remove()}setReadonly(t){this.readonly=t}setContainerSize(t,i){t>0&&i>0&&(t!==this.containerWidth||i!==this.containerHeight)&&(this.containerWidth=t,this.containerHeight=i,this.scale=this._calcScale(),this._updateScrollbarHeight(),this.$scrollbar.parentElement&&this.pagesScrollTo(this.pagesScrollTop,!0))}pagesScrollTo(t,i){if(t=Hi(t,0,this.pagesHeight-this.containerHeight/this.scale),i||Math.abs(t-this.pagesScrollTop)>=.001){this.pagesScrollTop=t;const n=this.pagesScrollTop*this.scale,r=this.pagesHeight*this.scale,s=n/(r-this.containerHeight)*(this.containerHeight-this.scrollbarHeight);window.requestAnimationFrame?window.requestAnimationFrame(()=>{this.$scrollbar.style.transform=`translateY(${s}px)`}):this.$scrollbar.style.transform=`translateY(${s}px)`}}destroy(){this.unmount(),this.onDragScroll=void 0,this.sideEffect.flushAll()}renderScrollbar(){const t=document.createElement("button");t.className=this.wrapClassName("scrollbar"),t.style.minHeight=`${this.scrollbarMinHeight}px`,t.style.height=`${this.scrollbarHeight}px`;const i=n=>{if(this.readonly||n.button!=null&&n.button!==0)return;Eh(n);const r=this.wrapClassName("scrollbar-dragging");t.classList.toggle(r,!0);const s=this.pagesScrollTop,{clientY:o}=Qu(n),a=u=>{if(this.readonly)return;const{clientY:h}=Qu(u),p=(h-o)/this.scale;Math.abs(p)>0&&this.onDragScroll&&this.onDragScroll(s+p*(this.pagesHeight*this.scale/this.containerHeight))},l=()=>{t.classList.toggle(r,!1),window.removeEventListener("mousemove",a,!0),window.removeEventListener("touchmove",a,!0),window.removeEventListener("mouseup",l,!0),window.removeEventListener("touchend",l,!0),window.removeEventListener("touchcancel",l,!0)};window.addEventListener("mousemove",a,!0),window.addEventListener("touchmove",a,!0),window.addEventListener("mouseup",l,!0),window.addEventListener("touchend",l,!0),window.addEventListener("touchcancel",l,!0)};return this.sideEffect.addEventListener(t,"mousedown",i),this.sideEffect.addEventListener(t,"touchstart",i),t}_calcScale(){return this.containerWidth/this.pagesWidth||1}_calcScrollbarHeight(){return Hi(this.containerHeight/(this.pagesHeight*this.scale)*this.containerHeight,this.scrollbarMinHeight,this.containerHeight)}_updateScrollbarHeight(){const t=this._calcScrollbarHeight();Math.abs(t-this.scrollbarHeight)>.001&&(this.scrollbarHeight=t,this.$scrollbar.style.height=`${t}px`)}}const Vy=window.ResizeObserver||gw,rn=640;class Ly{constructor({whiteboardView:t,readonly:i,box:n,pages:r,pageScrollTop:s=0,mountWhiteboard:o,onUserScroll:a}){this.sideEffect=new Ns,this.userScrolling=!1,this.onNewPageIndex=p=>{this.scrollToPage(p)},this.whiteboardView=t,this.readonly=i,this.box=n,this.pages=r,this.mountWhiteboard=o,this._onUserScroll=a;const l=this.debounce(()=>{this.userScrolling=!1,this._onUserScroll&&this._onUserScroll(this.pageRenderer.pagesScrollTop)},{wait:80},"debounce-updateUserScroll");this.updateUserScroll=()=>{this.userScrolling=!0,l()},this.viewer=new Ah({readonly:i,box:n,pages:r,onNewPageIndex:this.onNewPageIndex});const{width:u,height:h}=this.whiteboardView.size;this.pageRenderer=new zy({pagesScrollTop:s,pages:this.pages,containerWidth:u,containerHeight:h,onPageIndexChanged:this.viewer.setPageIndex.bind(this.viewer)}),this.scrollbar=new jy({pagesScrollTop:this.pageRenderer.pagesScrollTop,containerWidth:u,containerHeight:h,pagesWidth:this.pageRenderer.pagesIntrinsicWidth,pagesHeight:this.pageRenderer.pagesIntrinsicHeight,readonly:this.readonly,wrapClassName:this.wrapClassName.bind(this),onDragScroll:p=>{this.pageScrollTo(p),this.updateUserScroll()}}),this.pageScrollStepper=new Ey({start:this.pageRenderer.pagesScrollTop,onStep:p=>{this.pageScrollTo(p)}}),this.render()}mount(){this.viewer.mount(),this.setupScrollListener();const t=this.debounce(this.renderRatioHeight.bind(this),{wait:80});return this.sideEffect.add(()=>{const i=new Vy(t);return i.observe(this.viewer.$content),()=>i.disconnect()}),this.sideEffect.setTimeout(()=>{this.userScrolling||this.pageScrollTo(this.pageRenderer.pagesScrollTop)},100),this}unmount(){return this.viewer.unmount(),this}setReadonly(t){this.readonly!==t&&(this.readonly=t,this.viewer.setReadonly(t),this.scrollbar.setReadonly(t))}destroy(){this.sideEffect.flushAll(),this.pageScrollStepper.destroy(),this._onUserScroll=void 0,this.unmount(),this.viewer.destroy(),this.pageRenderer.destroy(),this.scrollbar.destroy()}syncPageScrollTop(t){!this.userScrolling&&t>=0&&Math.abs(this.pageRenderer.pagesScrollTop-t)>.01&&this.pageScrollStepper.stepTo(t,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 t=this.box.absoluteHeight,i=t<=rn;if(this.viewer.setSmallBox(i),i){const n=26/rn,r=26/t,s=26/rn,o=0,a=Math.max((n+s-(r+o))/2,0);if(this.box.$titleBar){const l=r+a;this.box.$titleBar.style.height=`${l*100}%`}if(this.box.$footer){const l=o+a;this.box.$footer.style.height=`${l*100}%`}}else{if(this.box.$titleBar){const n=Math.max(26/rn,26/t);this.box.$titleBar.style.height=`${n*100}%`}if(this.box.$footer){const n=Math.max(26/rn,26/t);this.box.$footer.style.height=`${n*100}%`}}}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",t=>{Eh(t),this.readonly||(this.pageScrollTo(this.pageRenderer.pagesScrollTop+t.deltaY),this.updateUserScroll())},{passive:!1,capture:!0}),this.sideEffect.addEventListener(this.$whiteboardView,"touchmove",t=>{this.readonly||t.touches.length<=1||this.updateUserScroll()},{passive:!0,capture:!0})),this.$whiteboardView}scrollTopPageToEl(t){return t*this.pageRenderer.scale}scrollTopElToPage(t){return t/this.pageRenderer.scale}elScrollTo(t){this.pageScrollTo(this.scrollTopElToPage(t))}pageScrollTo(t){const i=this.scrollTopElToPage(this.whiteboardView.size.height/2);this.whiteboardView.moveCamera({centerY:Hi(t+i,i,this.pageRenderer.pagesIntrinsicHeight-i),animationMode:"immediately"})}scrollToPage(t){if(!this.readonly&&!Number.isNaN(t)){const i=this.pageRenderer.pagesIntrinsicYs[t];i>=0&&(this.pageScrollTo(i+5/this.pageRenderer.scale),this.updateUserScroll())}}setupScrollListener(){this.sideEffect.add(()=>{const t=i=>{const{width:n,height:r}=this.whiteboardView.size;if(n<=0||r<=0)return;const s=i.centerY-this.pageRenderer.containerHeight/this.pageRenderer.scale/2;this.pageRenderer.pagesScrollTo(s),this.scrollbar.pagesScrollTo(s)};return this.whiteboardView.callbacks.on("onCameraUpdated",t),()=>this.whiteboardView.callbacks.off("onCameraUpdated",t)}),this.sideEffect.add(()=>{const t=({width:i,height:n})=>{if(i<=0||n<=0)return;this.pageRenderer.setContainerSize(i,n),this.scrollbar.setContainerSize(i,n);const{pagesIntrinsicWidth:r,pagesIntrinsicHeight:s}=this.pageRenderer;this.whiteboardView.moveCameraToContain({originX:0,originY:this.pageRenderer.pagesScrollTop,width:r,height:n/this.pageRenderer.scale,animationMode:"immediately"}),this.whiteboardView.setCameraBound({damping:1,maxContentMode:()=>this.pageRenderer.scale,minContentMode:()=>this.pageRenderer.scale,centerX:r/2,centerY:s/2,width:r,height:s})};return this.whiteboardView.callbacks.on("onSizeUpdated",t),()=>{this.whiteboardView.callbacks.off("onSizeUpdated",t)}},"whiteboard-size-update"),this.sideEffect.addEventListener(window,"keyup",t=>{if(this.readonly||!this.box.focus||this.box.minimized)return;let i=null;switch(t.key){case"PageDown":{i=this.pageRenderer.pagesScrollTop+this.pageRenderer.containerHeight/this.pageRenderer.scale;break}case"PageUp":{i=this.pageRenderer.pagesScrollTop-this.pageRenderer.containerHeight/this.pageRenderer.scale;break}case"ArrowDown":{i=this.pageRenderer.pagesScrollTop+this.pageRenderer.containerHeight/4/this.pageRenderer.scale;break}case"ArrowUp":{i=this.pageRenderer.pagesScrollTop-this.pageRenderer.containerHeight/4/this.pageRenderer.scale;break}}i!==null&&(this._onUserScroll?this._onUserScroll(i):(this.pageScrollTo(i),this.updateUserScroll()))},{capture:!0})}debounce(t,i,n){const r=Zv(t,i);return this.sideEffect.addDisposer(()=>r.cancel(),n),r}wrapClassName(t){return"netless-app-docs-viewer-static-"+t}}class Ry{constructor({context:t,whiteboardView:i,box:n,pages:r}){this.sideEffect=new Ns,this.onPlayPPT=()=>{const s=this.context.getRoom();s&&s.pptNextStep()},this._scaleDocsToFitImpl=()=>{const s=this.pages[this.getPageIndex()];s&&(this.whiteboardView.moveCameraToContain({originX:-s.width/2,originY:-s.height/2,width:s.width,height:s.height,animationMode:"immediately"}),this.whiteboardView.setCameraBound({damping:1,maxContentMode:()=>this.whiteboardView.camera.scale,minContentMode:()=>this.whiteboardView.camera.scale,centerX:0,centerY:0,width:s.width,height:s.height}))},this._scaleDocsToFitDebounced=()=>{this.sideEffect.setTimeout(this._scaleDocsToFitImpl,1e3,"_scaleDocsToFitDebounced")},this.scaleDocsToFit=()=>{this._scaleDocsToFitImpl(),this._scaleDocsToFitDebounced()},this.onNewPageIndex=s=>{this.jumpToPage(s,!0)},this.context=t,this.whiteboardView=i,this.box=n,this.pages=r,this.displayer=t.getDisplayer(),this.viewer=new Ah({readonly:!t.getIsWritable(),box:n,pages:r,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlayPPT}),this.render(),this.sideEffect.add(()=>{const s=o=>{this.viewer.setReadonly(!o)};return this.context.emitter.on("writableChange",s),()=>this.context.emitter.off("writableChange",s)}),this.sideEffect.add(()=>{const s=o=>{this.jumpToPage(o.index)};return this.context.emitter.on("sceneStateChange",s),()=>this.context.emitter.off("sceneStateChange",s)})}mount(){this.viewer.mount();const t=this.getPageIndex();return t!==0&&this.jumpToPage(t),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(t,i){var n,r;if(t=Hi(t,0,this.pages.length-1),t!==this.getPageIndex()&&this.context.getIsWritable()){const s=this.context.getInitScenePath(),o=(r=(n=this.context.getScenes())==null?void 0:n[t])==null?void 0:r.name;s&&o&&this.context.setScenePath(`${s}/${o}`),this.scaleDocsToFit()}if(t!==this.viewer.pageIndex&&this.viewer.setPageIndex(t),i){const s=this.context.getRoom();if(s){const o=s.state.globalState.__pptState;s.setGlobalState({__pptState:o&&{uuid:o.uuid,pageIndex:t,disableAutoPlay:o.disableAutoPlay}})}}}render(){this.viewer.$content.appendChild(this.renderMask()),this.viewer.$content.appendChild(this.renderWhiteboardView()),this.sideEffect.addEventListener(window,"keydown",t=>{var i;if(this.box.focus)switch(t.key){case"ArrowUp":case"ArrowLeft":{this.jumpToPage(this.getPageIndex()-1,!0);break}case"ArrowRight":case"ArrowDown":{(i=this.context.getRoom())==null||i.pptNextStep();break}}})}renderMask(){if(!this.$mask){const t=document.createElement("div");t.className=this.wrapClassName("mask"),this.$mask=t;const i=document.createElement("button");i.className=this.wrapClassName("back");const n=document.createElement("button");n.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",t=>{var i;const n=this.context.getRoom();if(n&&n.state.memberState.currentApplianceName==="clicker"){for(let r=t.target;r;r=r.parentElement)if((i=r.classList)!=null&&i.contains("ppt-event-source"))return;n.pptNextStep()}}),this.context.mountView(this.$whiteboardView)),this.$whiteboardView}wrapClassName(t){return"netless-app-docs-viewer-dynamic-"+t}}const By="DocsViewer",Xr={kind:By,setup(e){const t=e.getBox(),i=e.getScenes();if(!i)throw new Error("[Docs Viewer]: scenes not found.");const n=e.getView();if(!n)throw new Error("[Docs Viewer]: no whiteboard view.");const r=i.map(({ppt:s})=>s?{width:s.width,height:s.height,src:s.src,thumbnail:s.previewURL}:null).filter(s=>Boolean(s));if(r.length<=0)throw new Error("[Docs Viewer]: empty scenes.");t.mountStyles(Bv),r[0].src.startsWith("ppt")?_y(e,n,t,r):Oy(e,n,t,r)}};function Oy(e,t,i,n){var r;t.disableCameraTransform=!e.getIsWritable();const s=new Ly({whiteboardView:t,readonly:!e.getIsWritable(),box:i,pages:n,pageScrollTop:(r=e.getAttributes())==null?void 0:r.pageScrollTop,mountWhiteboard:e.mountView.bind(e),onUserScroll:o=>{var a;((a=e.getAttributes())==null?void 0:a.pageScrollTop)!==o&&!i.readonly&&e.updateAttributes(["pageScrollTop"],o)}}).mount();e.emitter.on("attributesUpdate",o=>{o&&o.pageScrollTop!=null&&s.syncPageScrollTop(o.pageScrollTop)}),e.emitter.on("writableChange",o=>{s.setReadonly(!o),t.disableCameraTransform=!o})}function _y(e,t,i,n){t.disableCameraTransform=!0;const r=new Ry({context:e,whiteboardView:t,box:i,pages:n}).mount();e.mountView(r.$whiteboardView),e.isAddApp&&t.callbacks.once("onSizeUpdated",({width:s,height:o})=>{if(n.length>0&&i.state!=="maximized"){const{width:a,height:l}=n[0],h=l/a*s-o;h!==0&&e.getIsWritable()&&e.emitter.emit("setBoxSize",{width:i.width,height:i.height+h/i.containerRect.height})}})}var Mi={exports:{}},W={};/*
125
+ ${t}`,Wv=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),Hv=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),Fv=(e,t,i)=>{const n=i===""?"":`with ${i.trim()}() `,r=Uv.bind(null,n,t.toString());Object.defineProperty(r,"name",Hv),Object.defineProperty(e,"toString",Fd(Hd({},Wv),{value:r}))};function Qv(e,t,{ignoreNonConfigurable:i=!1}={}){const{name:n}=e;for(const r of Reflect.ownKeys(t))Ov(e,t,r,i);return $v(e,t),Fv(e,t,n),e}const Zv=(e,t={})=>{if(typeof e!="function")throw new TypeError(`Expected the first argument to be a function, got \`${typeof e}\``);const{wait:i=0,maxWait:n=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 o,a,l;const u=function(...h){const p=this,w=()=>{o=void 0,a&&(clearTimeout(a),a=void 0),s&&(l=e.apply(p,h))},C=()=>{a=void 0,o&&(clearTimeout(o),o=void 0),s&&(l=e.apply(p,h))},E=r&&!o;return clearTimeout(o),o=setTimeout(w,i),n>0&&n!==Number.Infinity&&!a&&(a=setTimeout(C,n)),E&&(l=e.apply(p,h)),l};return Qv(u,e),u.cancel=()=>{o&&(clearTimeout(o),o=void 0),a&&(clearTimeout(a),a=void 0)},u},Qd="!#%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",Yv=Qd.length,Pu=Array(20),nn=()=>{for(let e=0;e<20;e++)Pu[e]=Qd.charAt(Math.random()*Yv);return Pu.join("")};class Ns{constructor(){this.disposers=new Map}add(t,i=nn()){return this.flush(i),this.disposers.set(i,t()),i}addDisposer(t,i=nn()){return this.flush(i),this.disposers.set(i,t),i}addEventListener(t,i,n,r,s=nn()){return this.add(()=>(t.addEventListener(i,n,r),()=>t.removeEventListener(i,n,r)),s),s}setTimeout(t,i,n=nn()){return this.add(()=>{const r=window.setTimeout(()=>{this.remove(n),t()},i);return()=>window.clearTimeout(r)},n)}setInterval(t,i,n=nn()){return this.add(()=>{const r=window.setInterval(t,i);return()=>window.clearInterval(r)},n)}remove(t){const i=this.disposers.get(t);return this.disposers.delete(t),i}flush(t){const i=this.remove(t);if(i)try{i()}catch(n){console.error(n)}}flushAll(){this.disposers.forEach(t=>{try{t()}catch(i){console.error(i)}}),this.disposers.clear()}}var li=[],Gv=function(){return li.some(function(e){return e.activeTargets.length>0})},Xv=function(){return li.some(function(e){return e.skippedTargets.length>0})},zu="ResizeObserver loop completed with undelivered notifications.",Jv=function(){var e;typeof ErrorEvent=="function"?e=new ErrorEvent("error",{message:zu}):(e=document.createEvent("Event"),e.initEvent("error",!1,!1),e.message=zu),window.dispatchEvent(e)},Rn;(function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(Rn||(Rn={}));var ui=function(e){return Object.freeze(e)},Kv=function(){function e(t,i){this.inlineSize=t,this.blockSize=i,ui(this)}return e}(),Zd=function(){function e(t,i,n,r){return this.x=t,this.y=i,this.width=n,this.height=r,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,ui(this)}return e.prototype.toJSON=function(){var t=this,i=t.x,n=t.y,r=t.top,s=t.right,o=t.bottom,a=t.left,l=t.width,u=t.height;return{x:i,y:n,top:r,right:s,bottom:o,left:a,width:l,height:u}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),Za=function(e){return e instanceof SVGElement&&"getBBox"in e},Yd=function(e){if(Za(e)){var t=e.getBBox(),i=t.width,n=t.height;return!i&&!n}var r=e,s=r.offsetWidth,o=r.offsetHeight;return!(s||o||e.getClientRects().length)},Du=function(e){var t,i;if(e instanceof Element)return!0;var n=(i=(t=e)===null||t===void 0?void 0:t.ownerDocument)===null||i===void 0?void 0:i.defaultView;return!!(n&&e instanceof n.Element)},qv=function(e){switch(e.tagName){case"INPUT":if(e.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},In=typeof window!="undefined"?window:{},dr=new WeakMap,ju=/auto|scroll/,ew=/^tb|vertical/,tw=/msie|trident/i.test(In.navigator&&In.navigator.userAgent),tt=function(e){return parseFloat(e||"0")},Li=function(e,t,i){return e===void 0&&(e=0),t===void 0&&(t=0),i===void 0&&(i=!1),new Kv((i?t:e)||0,(i?e:t)||0)},Lu=ui({devicePixelContentBoxSize:Li(),borderBoxSize:Li(),contentBoxSize:Li(),contentRect:new Zd(0,0,0,0)}),Gd=function(e,t){if(t===void 0&&(t=!1),dr.has(e)&&!t)return dr.get(e);if(Yd(e))return dr.set(e,Lu),Lu;var i=getComputedStyle(e),n=Za(e)&&e.ownerSVGElement&&e.getBBox(),r=!tw&&i.boxSizing==="border-box",s=ew.test(i.writingMode||""),o=!n&&ju.test(i.overflowY||""),a=!n&&ju.test(i.overflowX||""),l=n?0:tt(i.paddingTop),u=n?0:tt(i.paddingRight),h=n?0:tt(i.paddingBottom),p=n?0:tt(i.paddingLeft),w=n?0:tt(i.borderTopWidth),C=n?0:tt(i.borderRightWidth),E=n?0:tt(i.borderBottomWidth),T=n?0:tt(i.borderLeftWidth),c=p+u,d=l+h,f=T+C,g=w+E,m=a?e.offsetHeight-g-e.clientHeight:0,x=o?e.offsetWidth-f-e.clientWidth:0,y=r?c+f:0,N=r?d+g:0,D=n?n.width:tt(i.width)-y-x,P=n?n.height:tt(i.height)-N-m,J=D+c+x+f,q=P+d+m+g,ee=ui({devicePixelContentBoxSize:Li(Math.round(D*devicePixelRatio),Math.round(P*devicePixelRatio),s),borderBoxSize:Li(J,q,s),contentBoxSize:Li(D,P,s),contentRect:new Zd(p,l,D,P)});return dr.set(e,ee),ee},Xd=function(e,t,i){var n=Gd(e,i),r=n.borderBoxSize,s=n.contentBoxSize,o=n.devicePixelContentBoxSize;switch(t){case Rn.DEVICE_PIXEL_CONTENT_BOX:return o;case Rn.BORDER_BOX:return r;default:return s}},iw=function(){function e(t){var i=Gd(t);this.target=t,this.contentRect=i.contentRect,this.borderBoxSize=ui([i.borderBoxSize]),this.contentBoxSize=ui([i.contentBoxSize]),this.devicePixelContentBoxSize=ui([i.devicePixelContentBoxSize])}return e}(),Jd=function(e){if(Yd(e))return 1/0;for(var t=0,i=e.parentNode;i;)t+=1,i=i.parentNode;return t},nw=function(){var e=1/0,t=[];li.forEach(function(o){if(o.activeTargets.length!==0){var a=[];o.activeTargets.forEach(function(u){var h=new iw(u.target),p=Jd(u.target);a.push(h),u.lastReportedSize=Xd(u.target,u.observedBox),p<e&&(e=p)}),t.push(function(){o.callback.call(o.observer,a,o.observer)}),o.activeTargets.splice(0,o.activeTargets.length)}});for(var i=0,n=t;i<n.length;i++){var r=n[i];r()}return e},Vu=function(e){li.forEach(function(i){i.activeTargets.splice(0,i.activeTargets.length),i.skippedTargets.splice(0,i.skippedTargets.length),i.observationTargets.forEach(function(r){r.isActive()&&(Jd(r.target)>e?i.activeTargets.push(r):i.skippedTargets.push(r))})})},rw=function(){var e=0;for(Vu(e);Gv();)e=nw(),Vu(e);return Xv()&&Jv(),e>0},oo,Kd=[],sw=function(){return Kd.splice(0).forEach(function(e){return e()})},ow=function(e){if(!oo){var t=0,i=document.createTextNode(""),n={characterData:!0};new MutationObserver(function(){return sw()}).observe(i,n),oo=function(){i.textContent=""+(t?t--:t++)}}Kd.push(e),oo()},aw=function(e){ow(function(){requestAnimationFrame(e)})},Nr=0,lw=function(){return!!Nr},uw=250,cw={attributes:!0,characterData:!0,childList:!0,subtree:!0},Ru=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Bu=function(e){return e===void 0&&(e=0),Date.now()+e},ao=!1,dw=function(){function e(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return e.prototype.run=function(t){var i=this;if(t===void 0&&(t=uw),!ao){ao=!0;var n=Bu(t);aw(function(){var r=!1;try{r=rw()}finally{if(ao=!1,t=n-Bu(),!lw())return;r?i.run(1e3):t>0?i.run(t):i.start()}})}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var t=this,i=function(){return t.observer&&t.observer.observe(document.body,cw)};document.body?i():In.addEventListener("DOMContentLoaded",i)},e.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Ru.forEach(function(i){return In.addEventListener(i,t.listener,!0)}))},e.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),Ru.forEach(function(i){return In.removeEventListener(i,t.listener,!0)}),this.stopped=!0)},e}(),Ro=new dw,Ou=function(e){!Nr&&e>0&&Ro.start(),Nr+=e,!Nr&&Ro.stop()},hw=function(e){return!Za(e)&&!qv(e)&&getComputedStyle(e).display==="inline"},pw=function(){function e(t,i){this.target=t,this.observedBox=i||Rn.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var t=Xd(this.target,this.observedBox,!0);return hw(this.target)&&(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),fw=function(){function e(t,i){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=i}return e}(),hr=new WeakMap,_u=function(e,t){for(var i=0;i<e.length;i+=1)if(e[i].target===t)return i;return-1},pr=function(){function e(){}return e.connect=function(t,i){var n=new fw(t,i);hr.set(t,n)},e.observe=function(t,i,n){var r=hr.get(t),s=r.observationTargets.length===0;_u(r.observationTargets,i)<0&&(s&&li.push(r),r.observationTargets.push(new pw(i,n&&n.box)),Ou(1),Ro.schedule())},e.unobserve=function(t,i){var n=hr.get(t),r=_u(n.observationTargets,i),s=n.observationTargets.length===1;r>=0&&(s&&li.splice(li.indexOf(n),1),n.observationTargets.splice(r,1),Ou(-1))},e.disconnect=function(t){var i=this,n=hr.get(t);n.observationTargets.slice().forEach(function(r){return i.unobserve(t,r.target)}),n.activeTargets.splice(0,n.activeTargets.length)},e}(),gw=function(){function e(t){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof t!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");pr.connect(this,t)}return e.prototype.observe=function(t,i){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Du(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");pr.observe(this,t,i)},e.prototype.unobserve=function(t){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Du(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");pr.unobserve(this,t)},e.prototype.disconnect=function(){pr.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();function mw(e){const t="http://www.w3.org/2000/svg",i=document.createElementNS(t,"svg");i.setAttribute("class",`${e}-footer-icon-sidebar`),i.setAttribute("viewBox","0 0 64 64");const n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.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"),i.appendChild(n),i}function vw(e){const t="http://www.w3.org/2000/svg",i=document.createElementNS(t,"svg");i.setAttribute("class",`${e}-footer-icon-arrow-left`),i.setAttribute("viewBox","0 0 500 500");const n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.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"),i.appendChild(n),i}function ww(e){const t="http://www.w3.org/2000/svg",i=document.createElementNS(t,"svg");i.setAttribute("class",`${e}-footer-icon-arrow-right`),i.setAttribute("viewBox","0 0 500 500");const n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.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"),i.appendChild(n),i}function yw(e){const t="http://www.w3.org/2000/svg",i=document.createElementNS(t,"svg");i.setAttribute("class",`${e}-footer-icon-play`),i.setAttribute("viewBox","0 0 500 500");const n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.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"),i.appendChild(n),i}function xw(e){const t="http://www.w3.org/2000/svg",i=document.createElementNS(t,"svg");i.setAttribute("class",`${e}-footer-icon-pause`),i.setAttribute("viewBox","0 0 500 500");const n=document.createElementNS(t,"path");return n.setAttribute("fill","currentColor"),n.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"),i.appendChild(n),i}const Si=typeof window!="undefined",qd=Si&&!("onscroll"in window)||typeof navigator!="undefined"&&/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),eh=Si&&"IntersectionObserver"in window,th=Si&&"classList"in document.createElement("p"),ih=Si&&window.devicePixelRatio>1,Sw={elements_selector:".lazy",container:qd||Si?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},nh=e=>Object.assign({},Sw,e),$u=function(e,t){let i;const n="LazyLoad::Initialized",r=new e(t);try{i=new CustomEvent(n,{detail:{instance:r}})}catch{i=document.createEvent("CustomEvent"),i.initCustomEvent(n,!1,!1,{instance:r})}window.dispatchEvent(i)},Cw=(e,t)=>{if(!!t)if(!t.length)$u(e,t);else for(let i=0,n;n=t[i];i+=1)$u(e,n)},It="src",Ya="srcset",Ga="sizes",rh="poster",Gn="llOriginalAttrs",sh="data",Xa="loading",oh="loaded",ah="applied",bw="entered",Ja="error",lh="native",uh="data-",ch="ll-status",je=(e,t)=>e.getAttribute(uh+t),Mw=(e,t,i)=>{var n=uh+t;if(i===null){e.removeAttribute(n);return}e.setAttribute(n,i)},Xn=e=>je(e,ch),Ci=(e,t)=>Mw(e,ch,t),Ps=e=>Ci(e,null),Ka=e=>Xn(e)===null,Iw=e=>Xn(e)===Xa,Aw=e=>Xn(e)===Ja,qa=e=>Xn(e)===lh,Ew=[Xa,oh,ah,Ja],Tw=e=>Ew.indexOf(Xn(e))>=0,Jt=(e,t,i,n)=>{if(!!e){if(n!==void 0){e(t,i,n);return}if(i!==void 0){e(t,i);return}e(t)}},Ji=(e,t)=>{if(th){e.classList.add(t);return}e.className+=(e.className?" ":"")+t},nt=(e,t)=>{if(th){e.classList.remove(t);return}e.className=e.className.replace(new RegExp("(^|\\s+)"+t+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+$/,"")},kw=e=>{e.llTempImage=document.createElement("IMG")},Nw=e=>{delete e.llTempImage},dh=e=>e.llTempImage,zs=(e,t)=>{if(!t)return;const i=t._observer;!i||i.unobserve(e)},Pw=e=>{e.disconnect()},zw=(e,t,i)=>{t.unobserve_entered&&zs(e,i)},el=(e,t)=>{!e||(e.loadingCount+=t)},Dw=e=>{!e||(e.toLoadCount-=1)},hh=(e,t)=>{!e||(e.toLoadCount=t)},jw=e=>e.loadingCount>0,Lw=e=>e.toLoadCount>0,ph=e=>{let t=[];for(let i=0,n;n=e.children[i];i+=1)n.tagName==="SOURCE"&&t.push(n);return t},tl=(e,t)=>{const i=e.parentNode;if(!i||i.tagName!=="PICTURE")return;ph(i).forEach(t)},fh=(e,t)=>{ph(e).forEach(t)},Ds=[It],gh=[It,rh],Yr=[It,Ya,Ga],mh=[sh],js=e=>!!e[Gn],vh=e=>e[Gn],wh=e=>delete e[Gn],Ui=(e,t)=>{if(js(e))return;const i={};t.forEach(n=>{i[n]=e.getAttribute(n)}),e[Gn]=i},Vw=e=>{js(e)||(e[Gn]={backgroundImage:e.style.backgroundImage})},Rw=(e,t,i)=>{if(!i){e.removeAttribute(t);return}e.setAttribute(t,i)},Wi=(e,t)=>{if(!js(e))return;const i=vh(e);t.forEach(n=>{Rw(e,n,i[n])})},Bw=e=>{if(!js(e))return;const t=vh(e);e.style.backgroundImage=t.backgroundImage},Ow=(e,t,i)=>{Ji(e,t.class_applied),Ci(e,ah),i&&(t.unobserve_completed&&zs(e,t),Jt(t.callback_applied,e,i))},yh=(e,t,i)=>{Ji(e,t.class_loading),Ci(e,Xa),i&&(el(i,1),Jt(t.callback_loading,e,i))},Ot=(e,t,i)=>{!i||e.setAttribute(t,i)},Uu=(e,t)=>{Ot(e,Ga,je(e,t.data_sizes)),Ot(e,Ya,je(e,t.data_srcset)),Ot(e,It,je(e,t.data_src))},_w=(e,t)=>{tl(e,i=>{Ui(i,Yr),Uu(i,t)}),Ui(e,Yr),Uu(e,t)},$w=(e,t)=>{Ui(e,Ds),Ot(e,It,je(e,t.data_src))},Uw=(e,t)=>{fh(e,i=>{Ui(i,Ds),Ot(i,It,je(i,t.data_src))}),Ui(e,gh),Ot(e,rh,je(e,t.data_poster)),Ot(e,It,je(e,t.data_src)),e.load()},Ww=(e,t)=>{Ui(e,mh),Ot(e,sh,je(e,t.data_src))},Hw=(e,t,i)=>{const n=je(e,t.data_bg),r=je(e,t.data_bg_hidpi),s=ih&&r?r:n;!s||(e.style.backgroundImage=`url("${s}")`,dh(e).setAttribute(It,s),yh(e,t,i))},Fw=(e,t,i)=>{const n=je(e,t.data_bg_multi),r=je(e,t.data_bg_multi_hidpi),s=ih&&r?r:n;!s||(e.style.backgroundImage=s,Ow(e,t,i))},xh={IMG:_w,IFRAME:$w,VIDEO:Uw,OBJECT:Ww},Qw=(e,t)=>{const i=xh[e.tagName];!i||i(e,t)},Zw=(e,t,i)=>{const n=xh[e.tagName];!n||(n(e,t),yh(e,t,i))},Yw=["IMG","IFRAME","VIDEO","OBJECT"],Gw=e=>Yw.indexOf(e.tagName)>-1,Sh=(e,t)=>{t&&!jw(t)&&!Lw(t)&&Jt(e.callback_finish,t)},Wu=(e,t,i)=>{e.addEventListener(t,i),e.llEvLisnrs[t]=i},Xw=(e,t,i)=>{e.removeEventListener(t,i)},il=e=>!!e.llEvLisnrs,Jw=(e,t,i)=>{il(e)||(e.llEvLisnrs={});const n=e.tagName==="VIDEO"?"loadeddata":"load";Wu(e,n,t),Wu(e,"error",i)},Bo=e=>{if(!il(e))return;const t=e.llEvLisnrs;for(let i in t){const n=t[i];Xw(e,i,n)}delete e.llEvLisnrs},Ch=(e,t,i)=>{Nw(e),el(i,-1),Dw(i),nt(e,t.class_loading),t.unobserve_completed&&zs(e,i)},Kw=(e,t,i,n)=>{const r=qa(t);Ch(t,i,n),Ji(t,i.class_loaded),Ci(t,oh),Jt(i.callback_loaded,t,n),r||Sh(i,n)},qw=(e,t,i,n)=>{const r=qa(t);Ch(t,i,n),Ji(t,i.class_error),Ci(t,Ja),Jt(i.callback_error,t,n),r||Sh(i,n)},nl=(e,t,i)=>{const n=dh(e)||e;if(il(n))return;Jw(n,o=>{Kw(o,e,t,i),Bo(n)},o=>{qw(o,e,t,i),Bo(n)})},ey=(e,t,i)=>{kw(e),nl(e,t,i),Vw(e),Hw(e,t,i),Fw(e,t,i)},ty=(e,t,i)=>{nl(e,t,i),Zw(e,t,i)},rl=(e,t,i)=>{Gw(e)?ty(e,t,i):ey(e,t,i)},iy=(e,t,i)=>{e.setAttribute("loading","lazy"),nl(e,t,i),Qw(e,t),Ci(e,lh)},Hu=e=>{e.removeAttribute(It),e.removeAttribute(Ya),e.removeAttribute(Ga)},ny=e=>{tl(e,t=>{Hu(t)}),Hu(e)},bh=e=>{tl(e,t=>{Wi(t,Yr)}),Wi(e,Yr)},ry=e=>{fh(e,t=>{Wi(t,Ds)}),Wi(e,gh),e.load()},sy=e=>{Wi(e,Ds)},oy=e=>{Wi(e,mh)},ay={IMG:bh,IFRAME:sy,VIDEO:ry,OBJECT:oy},ly=e=>{const t=ay[e.tagName];if(!t){Bw(e);return}t(e)},uy=(e,t)=>{Ka(e)||qa(e)||(nt(e,t.class_entered),nt(e,t.class_exited),nt(e,t.class_applied),nt(e,t.class_loading),nt(e,t.class_loaded),nt(e,t.class_error))},cy=(e,t)=>{ly(e),uy(e,t),Ps(e),wh(e)},dy=(e,t,i,n)=>{!i.cancel_on_exit||!Iw(e)||e.tagName==="IMG"&&(Bo(e),ny(e),bh(e),nt(e,i.class_loading),el(n,-1),Ps(e),Jt(i.callback_cancel,e,t,n))},hy=(e,t,i,n)=>{const r=Tw(e);Ci(e,bw),Ji(e,i.class_entered),nt(e,i.class_exited),zw(e,i,n),Jt(i.callback_enter,e,t,n),!r&&rl(e,i,n)},py=(e,t,i,n)=>{Ka(e)||(Ji(e,i.class_exited),dy(e,t,i,n),Jt(i.callback_exit,e,t,n))},fy=["IMG","IFRAME","VIDEO"],Mh=e=>e.use_native&&"loading"in HTMLImageElement.prototype,gy=(e,t,i)=>{e.forEach(n=>{fy.indexOf(n.tagName)!==-1&&iy(n,t,i)}),hh(i,0)},my=e=>e.isIntersecting||e.intersectionRatio>0,vy=e=>({root:e.container===document?null:e.container,rootMargin:e.thresholds||e.threshold+"px"}),wy=(e,t,i)=>{e.forEach(n=>my(n)?hy(n.target,n,t,i):py(n.target,n,t,i))},yy=(e,t)=>{t.forEach(i=>{e.observe(i)})},xy=(e,t)=>{Pw(e),yy(e,t)},Sy=(e,t)=>{!eh||Mh(e)||(t._observer=new IntersectionObserver(i=>{wy(i,e,t)},vy(e)))},Ih=e=>Array.prototype.slice.call(e),Gr=e=>e.container.querySelectorAll(e.elements_selector),Cy=e=>Ih(e).filter(Ka),by=e=>Aw(e),My=e=>Ih(e).filter(by),Fu=(e,t)=>Cy(e||Gr(t)),Iy=(e,t)=>{My(Gr(e)).forEach(n=>{nt(n,e.class_error),Ps(n)}),t.update()},Ay=(e,t)=>{!Si||window.addEventListener("online",()=>{Iy(e,t)})},Jn=function(e,t){const i=nh(e);this._settings=i,this.loadingCount=0,Sy(i,this),Ay(i,this),this.update(t)};Jn.prototype={update:function(e){const t=this._settings,i=Fu(e,t);if(hh(this,i.length),qd||!eh){this.loadAll(i);return}if(Mh(t)){gy(i,t,this);return}xy(this._observer,i)},destroy:function(){this._observer&&this._observer.disconnect(),Gr(this._settings).forEach(e=>{wh(e)}),delete this._observer,delete this._settings,delete this.loadingCount,delete this.toLoadCount},loadAll:function(e){const t=this._settings;Fu(e,t).forEach(n=>{zs(n,this),rl(n,t,this)})},restoreAll:function(){const e=this._settings;Gr(e).forEach(t=>{cy(t,e)})}};Jn.load=(e,t)=>{const i=nh(t);rl(e,i)};Jn.resetStatus=e=>{Ps(e)};Si&&Cw(Jn,window.lazyLoadOptions);class Ah{constructor({readonly:t,box:i,pages:n,onNewPageIndex:r,onPlay:s}){if(this.pageIndex=0,this.namespace="netless-app-docs-viewer",this.isShowPreview=!1,this.isSmallBox=!1,this.sideEffect=new Ns,n.length<=0)throw new Error("[DocsViewer] Empty pages.");this.readonly=t,this.box=i,this.pages=n,this.onNewPageIndex=r,this.onPlay=s,this.render()}mount(){this.box.mountContent(this.$content),this.box.mountFooter(this.$footer),this.sideEffect.add(()=>{const t=new Jn({container:this.$preview,elements_selector:`.${this.wrapClassName("preview-page>img")}`});return()=>t.destroy()},"preview-lazyload")}unmount(){this.$content.remove(),this.$footer.remove()}setReadonly(t){this.readonly!==t&&(this.readonly=t,this.$content.classList.toggle(this.wrapClassName("readonly"),t),this.$footer.classList.toggle(this.wrapClassName("readonly"),t),this.$pageNumberInput.disabled=t)}destroy(){this.sideEffect.flushAll(),this.unmount()}setPageIndex(t){Number.isNaN(t)||(this.pageIndex=t,this.$pageNumberInput.value=String(t+1))}setSmallBox(t){this.isSmallBox!==t&&(this.isSmallBox=t,this.$footer.classList.toggle(this.wrapClassName("float-footer"),t))}render(){return this.renderContent(),this.renderFooter(),this.$content}renderContent(){if(!this.$content){const t=document.createElement("div");t.className=this.wrapClassName("content"),this.$content=t,this.readonly&&t.classList.add(this.wrapClassName("readonly")),t.appendChild(this.renderPreviewMask()),t.appendChild(this.renderPreview())}return this.$content}renderPreview(){if(!this.$preview){const t=document.createElement("div");t.className=this.wrapClassName("preview")+" tele-fancy-scrollbar",this.$preview=t;const i=this.wrapClassName("preview-page"),n=this.wrapClassName("preview-page-name");this.pages.forEach((r,s)=>{var o;const a=(o=r.thumbnail)!=null?o:r.src.startsWith("ppt")?void 0:r.src;if(!a)return;const l=String(s),u=document.createElement("a");u.className=i+" "+this.wrapClassName(`preview-page-${s}`),u.setAttribute("href","#"),u.dataset.pageIndex=l;const h=document.createElement("span");h.className=n,h.textContent=String(s+1),h.dataset.pageIndex=l;const p=document.createElement("img");p.width=r.width,p.height=r.height,p.dataset.src=a,p.dataset.pageIndex=l,u.appendChild(p),u.appendChild(h),t.appendChild(u)}),this.sideEffect.addEventListener(t,"click",r=>{var s;if(this.readonly)return;const o=(s=r.target.dataset)==null?void 0:s.pageIndex;o&&(r.preventDefault(),r.stopPropagation(),r.stopImmediatePropagation(),this.onNewPageIndex(Number(o)),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",t=>{this.readonly||t.target===this.$previewMask&&this.togglePreview(!1)})),this.$previewMask}renderFooter(){if(!this.$footer){const t=document.createElement("div");if(t.className=this.wrapClassName("footer"),this.$footer=t,this.readonly&&t.classList.add(this.wrapClassName("readonly")),this.isSmallBox&&t.classList.add(this.wrapClassName("float-footer")),this.pages.some(l=>l.thumbnail||!l.src.startsWith("ppt"))){const l=this.renderFooterBtn("btn-sidebar",mw(this.namespace));this.sideEffect.addEventListener(l,"click",()=>{this.readonly||this.togglePreview()}),this.$footer.appendChild(l)}const i=document.createElement("div");i.className=this.wrapClassName("page-jumps");const n=this.renderFooterBtn("btn-page-back",vw(this.namespace));if(this.sideEffect.addEventListener(n,"click",()=>{this.readonly||this.onNewPageIndex(this.pageIndex-1)}),i.appendChild(n),this.onPlay){const l=this.renderFooterBtn("btn-page-play",yw(this.namespace),xw(this.namespace)),u=()=>{this.sideEffect.setTimeout(()=>{l.classList.toggle(this.wrapClassName("footer-btn-playing"),!1)},500,"returnPlay")};this.sideEffect.addEventListener(l,"click",()=>{this.readonly||(l.classList.toggle(this.wrapClassName("footer-btn-playing"),!0),this.onPlay&&this.onPlay(),u())}),i.appendChild(l)}const r=this.renderFooterBtn("btn-page-next",ww(this.namespace));this.sideEffect.addEventListener(r,"click",()=>{this.readonly||this.onNewPageIndex(this.pageIndex+1)}),i.appendChild(r);const s=document.createElement("div");s.className=this.wrapClassName("page-number");const o=document.createElement("input");o.className=this.wrapClassName("page-number-input"),o.value=String(this.pageIndex+1),this.readonly&&(o.disabled=!0),this.$pageNumberInput=o,this.sideEffect.addEventListener(o,"focus",()=>{o.select()}),this.sideEffect.addEventListener(o,"change",()=>{this.readonly||o.value&&this.onNewPageIndex(Number(o.value)-1)});const a=document.createElement("span");a.textContent=" / "+this.pages.length,s.appendChild(o),s.appendChild(a),this.$footer.appendChild(i),this.$footer.appendChild(s)}return this.$footer}renderFooterBtn(t,i,n){const r=document.createElement("button");return r.className=this.wrapClassName("footer-btn")+" "+this.wrapClassName(t),r.appendChild(i),n&&r.appendChild(n),r}togglePreview(t){if(this.isShowPreview=t!=null?t:!this.isShowPreview,this.$content.classList.toggle(this.wrapClassName("preview-active"),this.isShowPreview),this.isShowPreview){const i=this.$preview.querySelector("."+this.wrapClassName(`preview-page-${this.pageIndex}`));i&&this.$preview.scrollTo({top:i.offsetTop-16})}}wrapClassName(t){return`${this.namespace}-${t}`}}function Hi(e,t,i){return Math.min(Math.max(e,t),i)}function Qu(e){return e.touches?e.touches[0]:e}function Eh(e){e.stopPropagation(),e.cancelable&&e.preventDefault()}class Ey{constructor(t){var i,n,r;this.velocity=0,this.paused=!0,this._animationFrameID=null,this._loopTimestamp=0,this.looper=s=>{if(this.paused)return;let o=Math.floor((s-this._loopTimestamp)/1e3*60)+1;for(this._loopTimestamp=s;o-- >0;)this.stepper();this.onStep(this.current,this),!this.paused&&this.current!==this.target&&window.requestAnimationFrame(this.looper)},this.current=(i=t.start)!=null?i:0,this.target=this.current,this.stiffness=(n=t.stiffness)!=null?n:170,this.damping=(r=t.damping)!=null?r:26,this.onStep=t.onStep}stepTo(t,i){this.paused&&i!=null&&(this.current=i),this.paused=!1,this.target=t,this.onStep(this.current,this),this._loopTimestamp=Date.now(),window.requestAnimationFrame(this.looper)}pause(){this.paused=!0}destroy(){this.pause()}stepper(){const t=-this.stiffness*(this.current-this.target),i=-this.damping*this.velocity,n=this.velocity+(t+i)/60,r=this.current+n/60;Math.abs(n-0)<.01&&Math.abs(r-this.target)<.01?(this.current=this.target,this.velocity=0):(this.current=r,this.velocity=n)}}class Ty{constructor(t,i,n,r){this.scale=1,this.lastVisit=Date.now(),this.pageOffsetY=0,this.pageOffsetX=0,this.visible=!0,this.index=t,this.page=i,this.scale=n,this.pageOffsetX=(r-i.width)/2;const s=document.createElement("div");s.className="page-renderer-page",s.dataset.index=`${t}`,s.style.width=`${i.width*n}px`,s.style.height=`${i.height*n}px`,i.thumbnail&&(s.style.backgroundImage=`url("${i.thumbnail}")`);const o=document.createElement("img");o.className="page-renderer-page-img",o.width=i.width,o.height=i.height,o.src=i.src,s.appendChild(o),this.$page=s}translateY(t){Math.abs(t-this.pageOffsetY)>=.001&&(this.pageOffsetY=t,this.$page.style.transform=`translate(${this.pageOffsetX*this.scale}px, ${this.pageOffsetY*this.scale}px)`)}setScale(t){Math.abs(t-this.scale)>=.001&&(this.scale=t,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(t){t!==this.visible&&(this.visible=t,this.$page.style.opacity=t?"1":"0")}}const ky=window.requestIdleCallback||(e=>window.setTimeout(e,5e3)),Ny=window.cancelIdleCallback||window.clearTimeout;class Py{constructor(t,i,n){this.pages=t,this.pagesIntrinsicWidth=i,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 r=[...this.els.values()].sort((s,o)=>o.lastVisit-s.lastVisit);for(let s=Math.floor(this.maxElCount/4);s<r.length;s++)this.els.delete(r[s].index)}}}getEl(t){let i=this.els.get(t);return i||(i=new Ty(t,this.pages[t],this.scale,this.pagesIntrinsicWidth),this.els.set(t,i)),i.lastVisit=Date.now(),this.els.size>this.maxElCount&&this.gcTimer===null&&(this.gcTimer=ky(this.gc)),i}setScale(t){t!==this.scale&&(this.scale=t,this.els.forEach(i=>i.setScale(t)))}destroy(){this.els.clear(),this.gcTimer!==null&&(Ny(this.gcTimer),this.gcTimer=null)}}class zy{constructor(t){this._hwaTimeout=NaN,this._turnOffHWA=()=>{window.clearTimeout(this._hwaTimeout),this._hwaTimeout=NaN,this.$pages.classList.toggle("is-hwa",!1)},this.pagesScrollTop=t.pagesScrollTop||0,this.containerWidth=t.containerWidth||1,this.containerHeight=t.containerHeight||1,this.pages=t.pages.map(s=>{if(s.thumbnail)return s;try{const o=new URL(s.src);return o.searchParams.set("x-oss-process","image/resize,l_50"),Fd(Hd({},s),{thumbnail:o.toString()})}catch(o){return console.error(o),s}});const i=Array(this.pages.length);let n=1/0,r=0;this.pagesIntrinsicHeight=this.pages.reduce((s,o,a)=>(i[a]=s,o.width>r&&(r=o.width),o.height<=n&&(n=o.height),s+o.height),0),this.pagesIntrinsicWidth=r,this.pagesMinHeight=n,this.pagesIntrinsicYs=i,this.scale=this._calcScale(),this.threshold=this._calcThreshold(),this.onPageIndexChanged=t.onPageIndexChanged,this.pageScrollIndex=0,this.pagesScrollTop!==0&&(this.pageScrollIndex=this.findScrollPageIndex(),this.onPageIndexChanged&&this.pageScrollIndex>0&&this.onPageIndexChanged(this.pageScrollIndex)),this.pageElManager=new Py(this.pages,r,this.scale),this.$pages=this.renderPages()}setContainerSize(t,i){t>0&&i>0&&(t!==this.containerWidth||i!==this.containerHeight)&&(this.containerWidth=t,this.containerHeight=i,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 t=document.createElement("div");return t.className="page-renderer-pages-container",t.style.width=`${this.containerWidth}px`,t.style.height=`${this.containerHeight}px`,t}pagesScrollTo(t,i){if(t=Hi(t,0,this.pagesIntrinsicHeight-this.containerHeight/this.scale),i||Math.abs(t-this.pagesScrollTop)>=.001){this._turnOnHWA(),this.pagesScrollTop=t;const n=this.findScrollPageIndex(),r=Math.max(n-this.threshold,0),s=Math.min(n+this.threshold,this.pages.length-1);for(let o=0;o<this.$pages.children.length;o++){const a=this.$pages.children[o],l=Number(a.dataset.index);l>=r&&l<=s||(a.remove(),o--)}for(let o=r;o<=s;o++){const a=this.pageElManager.getEl(o);a.$page.parentElement!==this.$pages&&this.$pages.appendChild(a.$page),a.translateY(this.pagesIntrinsicYs[o]-this.pagesScrollTop)}n!==this.pageScrollIndex&&(this.pageScrollIndex=n,this.onPageIndexChanged&&this.onPageIndexChanged(n))}}findScrollPageIndex(){for(let t=0;t<this.pagesIntrinsicYs.length;t++)if(this.pagesIntrinsicYs[t]+this.pages[t].height-this.pagesScrollTop>=.001)return t;return this.pagesIntrinsicYs.length-1}mount(t){t.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 Hi(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)}}const Dy=30;class jy{constructor(t){this.sideEffect=new Ns,this.pagesScrollTop=t.pagesScrollTop||0,this.containerWidth=t.containerWidth||1,this.containerHeight=t.containerHeight||1,this.pagesWidth=t.pagesWidth||1,this.pagesHeight=t.pagesHeight||1,this.scale=this._calcScale(),this.scrollbarMinHeight=t.scrollbarMinHeight||Dy,this.scrollbarHeight=this._calcScrollbarHeight(),this.readonly=t.readonly,this.wrapClassName=t.wrapClassName,this.onDragScroll=t.onDragScroll,this.$scrollbar=this.renderScrollbar()}mount(t){t.appendChild(this.$scrollbar),this.pagesScrollTo(this.pagesScrollTop,!0)}unmount(){this.$scrollbar.remove()}setReadonly(t){this.readonly=t}setContainerSize(t,i){t>0&&i>0&&(t!==this.containerWidth||i!==this.containerHeight)&&(this.containerWidth=t,this.containerHeight=i,this.scale=this._calcScale(),this._updateScrollbarHeight(),this.$scrollbar.parentElement&&this.pagesScrollTo(this.pagesScrollTop,!0))}pagesScrollTo(t,i){if(t=Hi(t,0,this.pagesHeight-this.containerHeight/this.scale),i||Math.abs(t-this.pagesScrollTop)>=.001){this.pagesScrollTop=t;const n=this.pagesScrollTop*this.scale,r=this.pagesHeight*this.scale,s=n/(r-this.containerHeight)*(this.containerHeight-this.scrollbarHeight);window.requestAnimationFrame?window.requestAnimationFrame(()=>{this.$scrollbar.style.transform=`translateY(${s}px)`}):this.$scrollbar.style.transform=`translateY(${s}px)`}}destroy(){this.unmount(),this.onDragScroll=void 0,this.sideEffect.flushAll()}renderScrollbar(){const t=document.createElement("button");t.className=this.wrapClassName("scrollbar"),t.style.minHeight=`${this.scrollbarMinHeight}px`,t.style.height=`${this.scrollbarHeight}px`;const i=n=>{if(this.readonly||n.button!=null&&n.button!==0)return;Eh(n);const r=this.wrapClassName("scrollbar-dragging");t.classList.toggle(r,!0);const s=this.pagesScrollTop,{clientY:o}=Qu(n),a=u=>{if(this.readonly)return;const{clientY:h}=Qu(u),p=(h-o)/this.scale;Math.abs(p)>0&&this.onDragScroll&&this.onDragScroll(s+p*(this.pagesHeight*this.scale/this.containerHeight))},l=()=>{t.classList.toggle(r,!1),window.removeEventListener("mousemove",a,!0),window.removeEventListener("touchmove",a,!0),window.removeEventListener("mouseup",l,!0),window.removeEventListener("touchend",l,!0),window.removeEventListener("touchcancel",l,!0)};window.addEventListener("mousemove",a,!0),window.addEventListener("touchmove",a,!0),window.addEventListener("mouseup",l,!0),window.addEventListener("touchend",l,!0),window.addEventListener("touchcancel",l,!0)};return this.sideEffect.addEventListener(t,"mousedown",i),this.sideEffect.addEventListener(t,"touchstart",i),t}_calcScale(){return this.containerWidth/this.pagesWidth||1}_calcScrollbarHeight(){return Hi(this.containerHeight/(this.pagesHeight*this.scale)*this.containerHeight,this.scrollbarMinHeight,this.containerHeight)}_updateScrollbarHeight(){const t=this._calcScrollbarHeight();Math.abs(t-this.scrollbarHeight)>.001&&(this.scrollbarHeight=t,this.$scrollbar.style.height=`${t}px`)}}const Ly=window.ResizeObserver||gw,rn=640;class Vy{constructor({whiteboardView:t,readonly:i,box:n,pages:r,pageScrollTop:s=0,mountWhiteboard:o,onUserScroll:a}){this.sideEffect=new Ns,this.userScrolling=!1,this.onNewPageIndex=p=>{this.scrollToPage(p)},this.whiteboardView=t,this.readonly=i,this.box=n,this.pages=r,this.mountWhiteboard=o,this._onUserScroll=a;const l=this.debounce(()=>{this.userScrolling=!1,this._onUserScroll&&this._onUserScroll(this.pageRenderer.pagesScrollTop)},{wait:80},"debounce-updateUserScroll");this.updateUserScroll=()=>{this.userScrolling=!0,l()},this.viewer=new Ah({readonly:i,box:n,pages:r,onNewPageIndex:this.onNewPageIndex});const{width:u,height:h}=this.whiteboardView.size;this.pageRenderer=new zy({pagesScrollTop:s,pages:this.pages,containerWidth:u,containerHeight:h,onPageIndexChanged:this.viewer.setPageIndex.bind(this.viewer)}),this.scrollbar=new jy({pagesScrollTop:this.pageRenderer.pagesScrollTop,containerWidth:u,containerHeight:h,pagesWidth:this.pageRenderer.pagesIntrinsicWidth,pagesHeight:this.pageRenderer.pagesIntrinsicHeight,readonly:this.readonly,wrapClassName:this.wrapClassName.bind(this),onDragScroll:p=>{this.pageScrollTo(p),this.updateUserScroll()}}),this.pageScrollStepper=new Ey({start:this.pageRenderer.pagesScrollTop,onStep:p=>{this.pageScrollTo(p)}}),this.render()}mount(){this.viewer.mount(),this.setupScrollListener();const t=this.debounce(this.renderRatioHeight.bind(this),{wait:80});return this.sideEffect.add(()=>{const i=new Ly(t);return i.observe(this.viewer.$content),()=>i.disconnect()}),this.sideEffect.setTimeout(()=>{this.userScrolling||this.pageScrollTo(this.pageRenderer.pagesScrollTop)},100),this}unmount(){return this.viewer.unmount(),this}setReadonly(t){this.readonly!==t&&(this.readonly=t,this.viewer.setReadonly(t),this.scrollbar.setReadonly(t))}destroy(){this.sideEffect.flushAll(),this.pageScrollStepper.destroy(),this._onUserScroll=void 0,this.unmount(),this.viewer.destroy(),this.pageRenderer.destroy(),this.scrollbar.destroy()}syncPageScrollTop(t){!this.userScrolling&&t>=0&&Math.abs(this.pageRenderer.pagesScrollTop-t)>.01&&this.pageScrollStepper.stepTo(t,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 t=this.box.absoluteHeight,i=t<=rn;if(this.viewer.setSmallBox(i),i){const n=26/rn,r=26/t,s=26/rn,o=0,a=Math.max((n+s-(r+o))/2,0);if(this.box.$titleBar){const l=r+a;this.box.$titleBar.style.height=`${l*100}%`}if(this.box.$footer){const l=o+a;this.box.$footer.style.height=`${l*100}%`}}else{if(this.box.$titleBar){const n=Math.max(26/rn,26/t);this.box.$titleBar.style.height=`${n*100}%`}if(this.box.$footer){const n=Math.max(26/rn,26/t);this.box.$footer.style.height=`${n*100}%`}}}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",t=>{Eh(t),this.readonly||(this.pageScrollTo(this.pageRenderer.pagesScrollTop+t.deltaY),this.updateUserScroll())},{passive:!1,capture:!0}),this.sideEffect.addEventListener(this.$whiteboardView,"touchmove",t=>{this.readonly||t.touches.length<=1||this.updateUserScroll()},{passive:!0,capture:!0})),this.$whiteboardView}scrollTopPageToEl(t){return t*this.pageRenderer.scale}scrollTopElToPage(t){return t/this.pageRenderer.scale}elScrollTo(t){this.pageScrollTo(this.scrollTopElToPage(t))}pageScrollTo(t){const i=this.scrollTopElToPage(this.whiteboardView.size.height/2);this.whiteboardView.moveCamera({centerY:Hi(t+i,i,this.pageRenderer.pagesIntrinsicHeight-i),animationMode:"immediately"})}scrollToPage(t){if(!this.readonly&&!Number.isNaN(t)){const i=this.pageRenderer.pagesIntrinsicYs[t];i>=0&&(this.pageScrollTo(i+5/this.pageRenderer.scale),this.updateUserScroll())}}setupScrollListener(){this.sideEffect.add(()=>{const t=i=>{const{width:n,height:r}=this.whiteboardView.size;if(n<=0||r<=0)return;const s=i.centerY-this.pageRenderer.containerHeight/this.pageRenderer.scale/2;this.pageRenderer.pagesScrollTo(s),this.scrollbar.pagesScrollTo(s)};return this.whiteboardView.callbacks.on("onCameraUpdated",t),()=>this.whiteboardView.callbacks.off("onCameraUpdated",t)}),this.sideEffect.add(()=>{const t=({width:i,height:n})=>{if(i<=0||n<=0)return;this.pageRenderer.setContainerSize(i,n),this.scrollbar.setContainerSize(i,n);const{pagesIntrinsicWidth:r,pagesIntrinsicHeight:s}=this.pageRenderer;this.whiteboardView.moveCameraToContain({originX:0,originY:this.pageRenderer.pagesScrollTop,width:r,height:n/this.pageRenderer.scale,animationMode:"immediately"}),this.whiteboardView.setCameraBound({damping:1,maxContentMode:()=>this.pageRenderer.scale,minContentMode:()=>this.pageRenderer.scale,centerX:r/2,centerY:s/2,width:r,height:s})};return this.whiteboardView.callbacks.on("onSizeUpdated",t),()=>{this.whiteboardView.callbacks.off("onSizeUpdated",t)}},"whiteboard-size-update"),this.sideEffect.addEventListener(window,"keyup",t=>{if(this.readonly||!this.box.focus||this.box.minimized)return;let i=null;switch(t.key){case"PageDown":{i=this.pageRenderer.pagesScrollTop+this.pageRenderer.containerHeight/this.pageRenderer.scale;break}case"PageUp":{i=this.pageRenderer.pagesScrollTop-this.pageRenderer.containerHeight/this.pageRenderer.scale;break}case"ArrowDown":{i=this.pageRenderer.pagesScrollTop+this.pageRenderer.containerHeight/4/this.pageRenderer.scale;break}case"ArrowUp":{i=this.pageRenderer.pagesScrollTop-this.pageRenderer.containerHeight/4/this.pageRenderer.scale;break}}i!==null&&(this._onUserScroll?this._onUserScroll(i):(this.pageScrollTo(i),this.updateUserScroll()))},{capture:!0})}debounce(t,i,n){const r=Zv(t,i);return this.sideEffect.addDisposer(()=>r.cancel(),n),r}wrapClassName(t){return"netless-app-docs-viewer-static-"+t}}class Ry{constructor({context:t,whiteboardView:i,box:n,pages:r}){this.sideEffect=new Ns,this.onPlayPPT=()=>{const s=this.context.getRoom();s&&s.pptNextStep()},this._scaleDocsToFitImpl=()=>{const s=this.pages[this.getPageIndex()];s&&(this.whiteboardView.moveCameraToContain({originX:-s.width/2,originY:-s.height/2,width:s.width,height:s.height,animationMode:"immediately"}),this.whiteboardView.setCameraBound({damping:1,maxContentMode:()=>this.whiteboardView.camera.scale,minContentMode:()=>this.whiteboardView.camera.scale,centerX:0,centerY:0,width:s.width,height:s.height}))},this._scaleDocsToFitDebounced=()=>{this.sideEffect.setTimeout(this._scaleDocsToFitImpl,1e3,"_scaleDocsToFitDebounced")},this.scaleDocsToFit=()=>{this._scaleDocsToFitImpl(),this._scaleDocsToFitDebounced()},this.onNewPageIndex=s=>{this.jumpToPage(s,!0)},this.context=t,this.whiteboardView=i,this.box=n,this.pages=r,this.displayer=t.getDisplayer(),this.viewer=new Ah({readonly:!t.getIsWritable(),box:n,pages:r,onNewPageIndex:this.onNewPageIndex,onPlay:this.onPlayPPT}),this.render(),this.sideEffect.add(()=>{const s=o=>{this.viewer.setReadonly(!o)};return this.context.emitter.on("writableChange",s),()=>this.context.emitter.off("writableChange",s)}),this.sideEffect.add(()=>{const s=o=>{this.jumpToPage(o.index)};return this.context.emitter.on("sceneStateChange",s),()=>this.context.emitter.off("sceneStateChange",s)})}mount(){this.viewer.mount();const t=this.getPageIndex();return t!==0&&this.jumpToPage(t),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(t,i){var n,r;if(t=Hi(t,0,this.pages.length-1),t!==this.getPageIndex()&&this.context.getIsWritable()){const s=this.context.getInitScenePath(),o=(r=(n=this.context.getScenes())==null?void 0:n[t])==null?void 0:r.name;s&&o&&this.context.setScenePath(`${s}/${o}`),this.scaleDocsToFit()}if(t!==this.viewer.pageIndex&&this.viewer.setPageIndex(t),i){const s=this.context.getRoom();if(s){const o=s.state.globalState.__pptState;s.setGlobalState({__pptState:o&&{uuid:o.uuid,pageIndex:t,disableAutoPlay:o.disableAutoPlay}})}}}render(){this.viewer.$content.appendChild(this.renderMask()),this.viewer.$content.appendChild(this.renderWhiteboardView()),this.sideEffect.addEventListener(window,"keydown",t=>{var i;if(this.box.focus)switch(t.key){case"ArrowUp":case"ArrowLeft":{this.jumpToPage(this.getPageIndex()-1,!0);break}case"ArrowRight":case"ArrowDown":{(i=this.context.getRoom())==null||i.pptNextStep();break}}})}renderMask(){if(!this.$mask){const t=document.createElement("div");t.className=this.wrapClassName("mask"),this.$mask=t;const i=document.createElement("button");i.className=this.wrapClassName("back");const n=document.createElement("button");n.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",t=>{var i;const n=this.context.getRoom();if(n&&n.state.memberState.currentApplianceName==="clicker"){for(let r=t.target;r;r=r.parentElement)if((i=r.classList)!=null&&i.contains("ppt-event-source"))return;n.pptNextStep()}}),this.context.mountView(this.$whiteboardView)),this.$whiteboardView}wrapClassName(t){return"netless-app-docs-viewer-dynamic-"+t}}const By="DocsViewer",Xr={kind:By,setup(e){const t=e.getBox(),i=e.getScenes();if(!i)throw new Error("[Docs Viewer]: scenes not found.");const n=e.getView();if(!n)throw new Error("[Docs Viewer]: no whiteboard view.");const r=i.map(({ppt:s})=>s?{width:s.width,height:s.height,src:s.src,thumbnail:s.previewURL}:null).filter(s=>Boolean(s));if(r.length<=0)throw new Error("[Docs Viewer]: empty scenes.");t.mountStyles(Bv),r[0].src.startsWith("ppt")?_y(e,n,t,r):Oy(e,n,t,r)}};function Oy(e,t,i,n){var r;t.disableCameraTransform=!e.getIsWritable();const s=new Vy({whiteboardView:t,readonly:!e.getIsWritable(),box:i,pages:n,pageScrollTop:(r=e.getAttributes())==null?void 0:r.pageScrollTop,mountWhiteboard:e.mountView.bind(e),onUserScroll:o=>{var a;((a=e.getAttributes())==null?void 0:a.pageScrollTop)!==o&&!i.readonly&&e.updateAttributes(["pageScrollTop"],o)}}).mount();e.emitter.on("attributesUpdate",o=>{o&&o.pageScrollTop!=null&&s.syncPageScrollTop(o.pageScrollTop)}),e.emitter.on("writableChange",o=>{s.setReadonly(!o),t.disableCameraTransform=!o})}function _y(e,t,i,n){t.disableCameraTransform=!0;const r=new Ry({context:e,whiteboardView:t,box:i,pages:n}).mount();e.mountView(r.$whiteboardView),e.isAddApp&&t.callbacks.once("onSizeUpdated",({width:s,height:o})=>{if(n.length>0&&i.state!=="maximized"){const{width:a,height:l}=n[0],h=l/a*s-o;h!==0&&e.getIsWritable()&&e.emitter.emit("setBoxSize",{width:i.width,height:i.height+h/i.containerRect.height})}})}var bi={exports:{}},W={};/*
126
126
  object-assign
127
127
  (c) Sindre Sorhus
128
128
  @license MIT
@@ -133,22 +133,22 @@ object-assign
133
133
  *
134
134
  * This source code is licensed under the MIT license found in the
135
135
  * LICENSE file in the root directory of this source tree.
136
- */var sl=Th,Ke=typeof Symbol=="function"&&Symbol.for,Kn=Ke?Symbol.for("react.element"):60103,Fy=Ke?Symbol.for("react.portal"):60106,Qy=Ke?Symbol.for("react.fragment"):60107,Zy=Ke?Symbol.for("react.strict_mode"):60108,Yy=Ke?Symbol.for("react.profiler"):60114,Gy=Ke?Symbol.for("react.provider"):60109,Xy=Ke?Symbol.for("react.context"):60110,Jy=Ke?Symbol.for("react.forward_ref"):60112,Ky=Ke?Symbol.for("react.suspense"):60113,qy=Ke?Symbol.for("react.memo"):60115,e0=Ke?Symbol.for("react.lazy"):60116,Yu=typeof Symbol=="function"&&Symbol.iterator;function qn(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,i=1;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i]);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 kh={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Nh={};function Ki(e,t,i){this.props=e,this.context=t,this.refs=Nh,this.updater=i||kh}Ki.prototype.isReactComponent={};Ki.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error(qn(85));this.updater.enqueueSetState(this,e,t,"setState")};Ki.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Ph(){}Ph.prototype=Ki.prototype;function ol(e,t,i){this.props=e,this.context=t,this.refs=Nh,this.updater=i||kh}var al=ol.prototype=new Ph;al.constructor=ol;sl(al,Ki.prototype);al.isPureReactComponent=!0;var ll={current:null},zh=Object.prototype.hasOwnProperty,Dh={key:!0,ref:!0,__self:!0,__source:!0};function jh(e,t,i){var n,r={},s=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)zh.call(t,n)&&!Dh.hasOwnProperty(n)&&(r[n]=t[n]);var a=arguments.length-2;if(a===1)r.children=i;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];r.children=l}if(e&&e.defaultProps)for(n in a=e.defaultProps,a)r[n]===void 0&&(r[n]=a[n]);return{$$typeof:Kn,type:e,key:s,ref:o,props:r,_owner:ll.current}}function t0(e,t){return{$$typeof:Kn,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function ul(e){return typeof e=="object"&&e!==null&&e.$$typeof===Kn}function i0(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(i){return t[i]})}var Vh=/\/+/g,Jr=[];function Lh(e,t,i,n){if(Jr.length){var r=Jr.pop();return r.result=e,r.keyPrefix=t,r.func=i,r.context=n,r.count=0,r}return{result:e,keyPrefix:t,func:i,context:n,count:0}}function Rh(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>Jr.length&&Jr.push(e)}function Oo(e,t,i,n){var r=typeof e;(r==="undefined"||r==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(r){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case Kn:case Fy:s=!0}}if(s)return i(n,e,t===""?"."+lo(e,0):t),1;if(s=0,t=t===""?".":t+":",Array.isArray(e))for(var o=0;o<e.length;o++){r=e[o];var a=t+lo(r,o);s+=Oo(r,a,i,n)}else if(e===null||typeof e!="object"?a=null:(a=Yu&&e[Yu]||e["@@iterator"],a=typeof a=="function"?a:null),typeof a=="function")for(e=a.call(e),o=0;!(r=e.next()).done;)r=r.value,a=t+lo(r,o++),s+=Oo(r,a,i,n);else if(r==="object")throw i=""+e,Error(qn(31,i==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":i,""));return s}function _o(e,t,i){return e==null?0:Oo(e,"",t,i)}function lo(e,t){return typeof e=="object"&&e!==null&&e.key!=null?i0(e.key):t.toString(36)}function n0(e,t){e.func.call(e.context,t,e.count++)}function r0(e,t,i){var n=e.result,r=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?$o(e,n,i,function(s){return s}):e!=null&&(ul(e)&&(e=t0(e,r+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(Vh,"$&/")+"/")+i)),n.push(e))}function $o(e,t,i,n,r){var s="";i!=null&&(s=(""+i).replace(Vh,"$&/")+"/"),t=Lh(t,s,n,r),_o(e,r0,t),Rh(t)}var Bh={current:null};function Et(){var e=Bh.current;if(e===null)throw Error(qn(321));return e}var s0={ReactCurrentDispatcher:Bh,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:ll,IsSomeRendererActing:{current:!1},assign:sl};W.Children={map:function(e,t,i){if(e==null)return e;var n=[];return $o(e,n,null,t,i),n},forEach:function(e,t,i){if(e==null)return e;t=Lh(null,null,t,i),_o(e,n0,t),Rh(t)},count:function(e){return _o(e,function(){return null},null)},toArray:function(e){var t=[];return $o(e,t,null,function(i){return i}),t},only:function(e){if(!ul(e))throw Error(qn(143));return e}};W.Component=Ki;W.Fragment=Qy;W.Profiler=Yy;W.PureComponent=ol;W.StrictMode=Zy;W.Suspense=Ky;W.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=s0;W.cloneElement=function(e,t,i){if(e==null)throw Error(qn(267,e));var n=sl({},e.props),r=e.key,s=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,o=ll.current),t.key!==void 0&&(r=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)zh.call(t,l)&&!Dh.hasOwnProperty(l)&&(n[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)n.children=i;else if(1<l){a=Array(l);for(var u=0;u<l;u++)a[u]=arguments[u+2];n.children=a}return{$$typeof:Kn,type:e.type,key:r,ref:s,props:n,_owner:o}};W.createContext=function(e,t){return t===void 0&&(t=null),e={$$typeof:Xy,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider={$$typeof:Gy,_context:e},e.Consumer=e};W.createElement=jh;W.createFactory=function(e){var t=jh.bind(null,e);return t.type=e,t};W.createRef=function(){return{current:null}};W.forwardRef=function(e){return{$$typeof:Jy,render:e}};W.isValidElement=ul;W.lazy=function(e){return{$$typeof:e0,_ctor:e,_status:-1,_result:null}};W.memo=function(e,t){return{$$typeof:qy,type:e,compare:t===void 0?null:t}};W.useCallback=function(e,t){return Et().useCallback(e,t)};W.useContext=function(e,t){return Et().useContext(e,t)};W.useDebugValue=function(){};W.useEffect=function(e,t){return Et().useEffect(e,t)};W.useImperativeHandle=function(e,t,i){return Et().useImperativeHandle(e,t,i)};W.useLayoutEffect=function(e,t){return Et().useLayoutEffect(e,t)};W.useMemo=function(e,t){return Et().useMemo(e,t)};W.useReducer=function(e,t,i){return Et().useReducer(e,t,i)};W.useRef=function(e){return Et().useRef(e)};W.useState=function(e){return Et().useState(e)};W.version="16.14.0";Mi.exports=W;var _=Mi.exports,Oh={exports:{}},He={},_h={exports:{}},$h={};/** @license React v0.19.1
136
+ */var sl=Th,qe=typeof Symbol=="function"&&Symbol.for,Kn=qe?Symbol.for("react.element"):60103,Fy=qe?Symbol.for("react.portal"):60106,Qy=qe?Symbol.for("react.fragment"):60107,Zy=qe?Symbol.for("react.strict_mode"):60108,Yy=qe?Symbol.for("react.profiler"):60114,Gy=qe?Symbol.for("react.provider"):60109,Xy=qe?Symbol.for("react.context"):60110,Jy=qe?Symbol.for("react.forward_ref"):60112,Ky=qe?Symbol.for("react.suspense"):60113,qy=qe?Symbol.for("react.memo"):60115,e0=qe?Symbol.for("react.lazy"):60116,Yu=typeof Symbol=="function"&&Symbol.iterator;function qn(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,i=1;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i]);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 kh={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Nh={};function Ki(e,t,i){this.props=e,this.context=t,this.refs=Nh,this.updater=i||kh}Ki.prototype.isReactComponent={};Ki.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error(qn(85));this.updater.enqueueSetState(this,e,t,"setState")};Ki.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Ph(){}Ph.prototype=Ki.prototype;function ol(e,t,i){this.props=e,this.context=t,this.refs=Nh,this.updater=i||kh}var al=ol.prototype=new Ph;al.constructor=ol;sl(al,Ki.prototype);al.isPureReactComponent=!0;var ll={current:null},zh=Object.prototype.hasOwnProperty,Dh={key:!0,ref:!0,__self:!0,__source:!0};function jh(e,t,i){var n,r={},s=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)zh.call(t,n)&&!Dh.hasOwnProperty(n)&&(r[n]=t[n]);var a=arguments.length-2;if(a===1)r.children=i;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];r.children=l}if(e&&e.defaultProps)for(n in a=e.defaultProps,a)r[n]===void 0&&(r[n]=a[n]);return{$$typeof:Kn,type:e,key:s,ref:o,props:r,_owner:ll.current}}function t0(e,t){return{$$typeof:Kn,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function ul(e){return typeof e=="object"&&e!==null&&e.$$typeof===Kn}function i0(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(i){return t[i]})}var Lh=/\/+/g,Jr=[];function Vh(e,t,i,n){if(Jr.length){var r=Jr.pop();return r.result=e,r.keyPrefix=t,r.func=i,r.context=n,r.count=0,r}return{result:e,keyPrefix:t,func:i,context:n,count:0}}function Rh(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>Jr.length&&Jr.push(e)}function Oo(e,t,i,n){var r=typeof e;(r==="undefined"||r==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(r){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case Kn:case Fy:s=!0}}if(s)return i(n,e,t===""?"."+lo(e,0):t),1;if(s=0,t=t===""?".":t+":",Array.isArray(e))for(var o=0;o<e.length;o++){r=e[o];var a=t+lo(r,o);s+=Oo(r,a,i,n)}else if(e===null||typeof e!="object"?a=null:(a=Yu&&e[Yu]||e["@@iterator"],a=typeof a=="function"?a:null),typeof a=="function")for(e=a.call(e),o=0;!(r=e.next()).done;)r=r.value,a=t+lo(r,o++),s+=Oo(r,a,i,n);else if(r==="object")throw i=""+e,Error(qn(31,i==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":i,""));return s}function _o(e,t,i){return e==null?0:Oo(e,"",t,i)}function lo(e,t){return typeof e=="object"&&e!==null&&e.key!=null?i0(e.key):t.toString(36)}function n0(e,t){e.func.call(e.context,t,e.count++)}function r0(e,t,i){var n=e.result,r=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?$o(e,n,i,function(s){return s}):e!=null&&(ul(e)&&(e=t0(e,r+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(Lh,"$&/")+"/")+i)),n.push(e))}function $o(e,t,i,n,r){var s="";i!=null&&(s=(""+i).replace(Lh,"$&/")+"/"),t=Vh(t,s,n,r),_o(e,r0,t),Rh(t)}var Bh={current:null};function At(){var e=Bh.current;if(e===null)throw Error(qn(321));return e}var s0={ReactCurrentDispatcher:Bh,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:ll,IsSomeRendererActing:{current:!1},assign:sl};W.Children={map:function(e,t,i){if(e==null)return e;var n=[];return $o(e,n,null,t,i),n},forEach:function(e,t,i){if(e==null)return e;t=Vh(null,null,t,i),_o(e,n0,t),Rh(t)},count:function(e){return _o(e,function(){return null},null)},toArray:function(e){var t=[];return $o(e,t,null,function(i){return i}),t},only:function(e){if(!ul(e))throw Error(qn(143));return e}};W.Component=Ki;W.Fragment=Qy;W.Profiler=Yy;W.PureComponent=ol;W.StrictMode=Zy;W.Suspense=Ky;W.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=s0;W.cloneElement=function(e,t,i){if(e==null)throw Error(qn(267,e));var n=sl({},e.props),r=e.key,s=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,o=ll.current),t.key!==void 0&&(r=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)zh.call(t,l)&&!Dh.hasOwnProperty(l)&&(n[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)n.children=i;else if(1<l){a=Array(l);for(var u=0;u<l;u++)a[u]=arguments[u+2];n.children=a}return{$$typeof:Kn,type:e.type,key:r,ref:s,props:n,_owner:o}};W.createContext=function(e,t){return t===void 0&&(t=null),e={$$typeof:Xy,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider={$$typeof:Gy,_context:e},e.Consumer=e};W.createElement=jh;W.createFactory=function(e){var t=jh.bind(null,e);return t.type=e,t};W.createRef=function(){return{current:null}};W.forwardRef=function(e){return{$$typeof:Jy,render:e}};W.isValidElement=ul;W.lazy=function(e){return{$$typeof:e0,_ctor:e,_status:-1,_result:null}};W.memo=function(e,t){return{$$typeof:qy,type:e,compare:t===void 0?null:t}};W.useCallback=function(e,t){return At().useCallback(e,t)};W.useContext=function(e,t){return At().useContext(e,t)};W.useDebugValue=function(){};W.useEffect=function(e,t){return At().useEffect(e,t)};W.useImperativeHandle=function(e,t,i){return At().useImperativeHandle(e,t,i)};W.useLayoutEffect=function(e,t){return At().useLayoutEffect(e,t)};W.useMemo=function(e,t){return At().useMemo(e,t)};W.useReducer=function(e,t,i){return At().useReducer(e,t,i)};W.useRef=function(e){return At().useRef(e)};W.useState=function(e){return At().useState(e)};W.version="16.14.0";bi.exports=W;var O=bi.exports,Oh={exports:{}},He={},_h={exports:{}},$h={};/** @license React v0.19.1
137
137
  * scheduler.production.min.js
138
138
  *
139
139
  * Copyright (c) Facebook, Inc. and its affiliates.
140
140
  *
141
141
  * This source code is licensed under the MIT license found in the
142
142
  * LICENSE file in the root directory of this source tree.
143
- */(function(e){var t,i,n,r,s;if(typeof window=="undefined"||typeof MessageChannel!="function"){var o=null,a=null,l=function(){if(o!==null)try{var C=e.unstable_now();o(!0,C),o=null}catch(P){throw setTimeout(l,0),P}},u=Date.now();e.unstable_now=function(){return Date.now()-u},t=function(C){o!==null?setTimeout(t,0,C):(o=C,setTimeout(l,0))},i=function(C,P){a=setTimeout(C,P)},n=function(){clearTimeout(a)},r=function(){return!1},s=e.unstable_forceFrameRate=function(){}}else{var h=window.performance,p=window.Date,w=window.setTimeout,S=window.clearTimeout;if(typeof console!="undefined"){var I=window.cancelAnimationFrame;typeof window.requestAnimationFrame!="function"&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),typeof I!="function"&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if(typeof h=="object"&&typeof h.now=="function")e.unstable_now=function(){return h.now()};else{var E=p.now();e.unstable_now=function(){return p.now()-E}}var c=!1,d=null,f=-1,g=5,m=0;r=function(){return e.unstable_now()>=m},s=function(){},e.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported"):g=0<C?Math.floor(1e3/C):5};var y=new MessageChannel,v=y.port2;y.port1.onmessage=function(){if(d!==null){var C=e.unstable_now();m=C+g;try{d(!0,C)?v.postMessage(null):(c=!1,d=null)}catch(P){throw v.postMessage(null),P}}else c=!1},t=function(C){d=C,c||(c=!0,v.postMessage(null))},i=function(C,P){f=w(function(){C(e.unstable_now())},P)},n=function(){S(f),f=-1}}function T(C,P){var O=C.length;C.push(P);e:for(;;){var Z=O-1>>>1,ee=C[Z];if(ee!==void 0&&0<X(ee,P))C[Z]=P,C[O]=ee,O=Z;else break e}}function D(C){return C=C[0],C===void 0?null:C}function k(C){var P=C[0];if(P!==void 0){var O=C.pop();if(O!==P){C[0]=O;e:for(var Z=0,ee=C.length;Z<ee;){var et=2*(Z+1)-1,Fe=C[et],ft=et+1,Nt=C[ft];if(Fe!==void 0&&0>X(Fe,O))Nt!==void 0&&0>X(Nt,Fe)?(C[Z]=Nt,C[ft]=O,Z=ft):(C[Z]=Fe,C[et]=O,Z=et);else if(Nt!==void 0&&0>X(Nt,O))C[Z]=Nt,C[ft]=O,Z=ft;else break e}}return P}return null}function X(C,P){var O=C.sortIndex-P.sortIndex;return O!==0?O:C.id-P.id}var J=[],re=[],pt=1,Q=null,q=3,Tt=!1,we=!1,qe=!1;function kt(C){for(var P=D(re);P!==null;){if(P.callback===null)k(re);else if(P.startTime<=C)k(re),P.sortIndex=P.expirationTime,T(J,P);else break;P=D(re)}}function z(C){if(qe=!1,kt(C),!we)if(D(J)!==null)we=!0,t(U);else{var P=D(re);P!==null&&i(z,P.startTime-C)}}function U(C,P){we=!1,qe&&(qe=!1,n()),Tt=!0;var O=q;try{for(kt(P),Q=D(J);Q!==null&&(!(Q.expirationTime>P)||C&&!r());){var Z=Q.callback;if(Z!==null){Q.callback=null,q=Q.priorityLevel;var ee=Z(Q.expirationTime<=P);P=e.unstable_now(),typeof ee=="function"?Q.callback=ee:Q===D(J)&&k(J),kt(P)}else k(J);Q=D(J)}if(Q!==null)var et=!0;else{var Fe=D(re);Fe!==null&&i(z,Fe.startTime-P),et=!1}return et}finally{Q=null,q=O,Tt=!1}}function ye(C){switch(C){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var Me=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(C){C.callback=null},e.unstable_continueExecution=function(){we||Tt||(we=!0,t(U))},e.unstable_getCurrentPriorityLevel=function(){return q},e.unstable_getFirstCallbackNode=function(){return D(J)},e.unstable_next=function(C){switch(q){case 1:case 2:case 3:var P=3;break;default:P=q}var O=q;q=P;try{return C()}finally{q=O}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=Me,e.unstable_runWithPriority=function(C,P){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var O=q;q=C;try{return P()}finally{q=O}},e.unstable_scheduleCallback=function(C,P,O){var Z=e.unstable_now();if(typeof O=="object"&&O!==null){var ee=O.delay;ee=typeof ee=="number"&&0<ee?Z+ee:Z,O=typeof O.timeout=="number"?O.timeout:ye(C)}else O=ye(C),ee=Z;return O=ee+O,C={id:pt++,callback:P,priorityLevel:C,startTime:ee,expirationTime:O,sortIndex:-1},ee>Z?(C.sortIndex=ee,T(re,C),D(J)===null&&C===D(re)&&(qe?n():qe=!0,i(z,ee-Z))):(C.sortIndex=O,T(J,C),we||Tt||(we=!0,t(U))),C},e.unstable_shouldYield=function(){var C=e.unstable_now();kt(C);var P=D(J);return P!==Q&&Q!==null&&P!==null&&P.callback!==null&&P.startTime<=C&&P.expirationTime<Q.expirationTime||r()},e.unstable_wrapCallback=function(C){var P=q;return function(){var O=q;q=P;try{return C.apply(this,arguments)}finally{q=O}}}})($h);_h.exports=$h;/** @license React v16.14.0
143
+ */(function(e){var t,i,n,r,s;if(typeof window=="undefined"||typeof MessageChannel!="function"){var o=null,a=null,l=function(){if(o!==null)try{var b=e.unstable_now();o(!0,b),o=null}catch(v){throw setTimeout(l,0),v}},u=Date.now();e.unstable_now=function(){return Date.now()-u},t=function(b){o!==null?setTimeout(t,0,b):(o=b,setTimeout(l,0))},i=function(b,v){a=setTimeout(b,v)},n=function(){clearTimeout(a)},r=function(){return!1},s=e.unstable_forceFrameRate=function(){}}else{var h=window.performance,p=window.Date,w=window.setTimeout,C=window.clearTimeout;if(typeof console!="undefined"){var E=window.cancelAnimationFrame;typeof window.requestAnimationFrame!="function"&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills"),typeof E!="function"&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://fb.me/react-polyfills")}if(typeof h=="object"&&typeof h.now=="function")e.unstable_now=function(){return h.now()};else{var T=p.now();e.unstable_now=function(){return p.now()-T}}var c=!1,d=null,f=-1,g=5,m=0;r=function(){return e.unstable_now()>=m},s=function(){},e.unstable_forceFrameRate=function(b){0>b||125<b?console.error("forceFrameRate takes a positive int between 0 and 125, forcing framerates higher than 125 fps is not unsupported"):g=0<b?Math.floor(1e3/b):5};var x=new MessageChannel,y=x.port2;x.port1.onmessage=function(){if(d!==null){var b=e.unstable_now();m=b+g;try{d(!0,b)?y.postMessage(null):(c=!1,d=null)}catch(v){throw y.postMessage(null),v}}else c=!1},t=function(b){d=b,c||(c=!0,y.postMessage(null))},i=function(b,v){f=w(function(){b(e.unstable_now())},v)},n=function(){C(f),f=-1}}function N(b,v){var k=b.length;b.push(v);e:for(;;){var _=k-1>>>1,$=b[_];if($!==void 0&&0<J($,v))b[_]=v,b[k]=$,k=_;else break e}}function D(b){return b=b[0],b===void 0?null:b}function P(b){var v=b[0];if(v!==void 0){var k=b.pop();if(k!==v){b[0]=k;e:for(var _=0,$=b.length;_<$;){var ke=2*(_+1)-1,ve=b[ke],pt=ke+1,Tt=b[pt];if(ve!==void 0&&0>J(ve,k))Tt!==void 0&&0>J(Tt,ve)?(b[_]=Tt,b[pt]=k,_=pt):(b[_]=ve,b[ke]=k,_=ke);else if(Tt!==void 0&&0>J(Tt,k))b[_]=Tt,b[pt]=k,_=pt;else break e}}return v}return null}function J(b,v){var k=b.sortIndex-v.sortIndex;return k!==0?k:b.id-v.id}var q=[],ee=[],Fe=1,Q=null,G=3,Qe=!1,ae=!1,Oe=!1;function _e(b){for(var v=D(ee);v!==null;){if(v.callback===null)P(ee);else if(v.startTime<=b)P(ee),v.sortIndex=v.expirationTime,N(q,v);else break;v=D(ee)}}function ht(b){if(Oe=!1,_e(b),!ae)if(D(q)!==null)ae=!0,t(qt);else{var v=D(ee);v!==null&&i(ht,v.startTime-b)}}function qt(b,v){ae=!1,Oe&&(Oe=!1,n()),Qe=!0;var k=G;try{for(_e(v),Q=D(q);Q!==null&&(!(Q.expirationTime>v)||b&&!r());){var _=Q.callback;if(_!==null){Q.callback=null,G=Q.priorityLevel;var $=_(Q.expirationTime<=v);v=e.unstable_now(),typeof $=="function"?Q.callback=$:Q===D(q)&&P(q),_e(v)}else P(q);Q=D(q)}if(Q!==null)var ke=!0;else{var ve=D(ee);ve!==null&&i(ht,ve.startTime-v),ke=!1}return ke}finally{Q=null,G=k,Qe=!1}}function Et(b){switch(b){case 1:return-1;case 2:return 250;case 5:return 1073741823;case 4:return 1e4;default:return 5e3}}var Ii=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(b){b.callback=null},e.unstable_continueExecution=function(){ae||Qe||(ae=!0,t(qt))},e.unstable_getCurrentPriorityLevel=function(){return G},e.unstable_getFirstCallbackNode=function(){return D(q)},e.unstable_next=function(b){switch(G){case 1:case 2:case 3:var v=3;break;default:v=G}var k=G;G=v;try{return b()}finally{G=k}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=Ii,e.unstable_runWithPriority=function(b,v){switch(b){case 1:case 2:case 3:case 4:case 5:break;default:b=3}var k=G;G=b;try{return v()}finally{G=k}},e.unstable_scheduleCallback=function(b,v,k){var _=e.unstable_now();if(typeof k=="object"&&k!==null){var $=k.delay;$=typeof $=="number"&&0<$?_+$:_,k=typeof k.timeout=="number"?k.timeout:Et(b)}else k=Et(b),$=_;return k=$+k,b={id:Fe++,callback:v,priorityLevel:b,startTime:$,expirationTime:k,sortIndex:-1},$>_?(b.sortIndex=$,N(ee,b),D(q)===null&&b===D(ee)&&(Oe?n():Oe=!0,i(ht,$-_))):(b.sortIndex=k,N(q,b),ae||Qe||(ae=!0,t(qt))),b},e.unstable_shouldYield=function(){var b=e.unstable_now();_e(b);var v=D(q);return v!==Q&&Q!==null&&v!==null&&v.callback!==null&&v.startTime<=b&&v.expirationTime<Q.expirationTime||r()},e.unstable_wrapCallback=function(b){var v=G;return function(){var k=G;G=v;try{return b.apply(this,arguments)}finally{G=k}}}})($h);_h.exports=$h;/** @license React v16.14.0
144
144
  * react-dom.production.min.js
145
145
  *
146
146
  * Copyright (c) Facebook, Inc. and its affiliates.
147
147
  *
148
148
  * This source code is licensed under the MIT license found in the
149
149
  * LICENSE file in the root directory of this source tree.
150
- */var Vs=Mi.exports,Ce=Th,de=_h.exports;function x(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,i=1;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i]);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(!Vs)throw Error(x(227));function o0(e,t,i,n,r,s,o,a,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(i,u)}catch(h){this.onError(h)}}var An=!1,Kr=null,qr=!1,Uo=null,a0={onError:function(e){An=!0,Kr=e}};function l0(e,t,i,n,r,s,o,a,l){An=!1,Kr=null,o0.apply(a0,arguments)}function u0(e,t,i,n,r,s,o,a,l){if(l0.apply(this,arguments),An){if(An){var u=Kr;An=!1,Kr=null}else throw Error(x(198));qr||(qr=!0,Uo=u)}}var cl=null,Uh=null,Wh=null;function Gu(e,t,i){var n=e.type||"unknown-event";e.currentTarget=Wh(i),u0(n,t,void 0,e),e.currentTarget=null}var es=null,Ei={};function Hh(){if(es)for(var e in Ei){var t=Ei[e],i=es.indexOf(e);if(!(-1<i))throw Error(x(96,e));if(!ts[i]){if(!t.extractEvents)throw Error(x(97,e));ts[i]=t,i=t.eventTypes;for(var n in i){var r=void 0,s=i[n],o=t,a=n;if(Wo.hasOwnProperty(a))throw Error(x(99,a));Wo[a]=s;var l=s.phasedRegistrationNames;if(l){for(r in l)l.hasOwnProperty(r)&&Xu(l[r],o,a);r=!0}else s.registrationName?(Xu(s.registrationName,o,a),r=!0):r=!1;if(!r)throw Error(x(98,n,e))}}}}function Xu(e,t,i){if(Fi[e])throw Error(x(100,e));Fi[e]=t,dl[e]=t.eventTypes[i].dependencies}var ts=[],Wo={},Fi={},dl={};function Fh(e){var t=!1,i;for(i in e)if(e.hasOwnProperty(i)){var n=e[i];if(!Ei.hasOwnProperty(i)||Ei[i]!==n){if(Ei[i])throw Error(x(102,i));Ei[i]=n,t=!0}}t&&Hh()}var ei=!(typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"),Ho=null,Li=null,Ri=null;function Ju(e){if(e=Uh(e)){if(typeof Ho!="function")throw Error(x(280));var t=e.stateNode;t&&(t=cl(t),Ho(e.stateNode,e.type,t))}}function Qh(e){Li?Ri?Ri.push(e):Ri=[e]:Li=e}function Zh(){if(Li){var e=Li,t=Ri;if(Ri=Li=null,Ju(e),t)for(e=0;e<t.length;e++)Ju(t[e])}}function hl(e,t){return e(t)}function Yh(e,t,i,n,r){return e(t,i,n,r)}function pl(){}var Gh=hl,ri=!1,uo=!1;function fl(){(Li!==null||Ri!==null)&&(pl(),Zh())}function Xh(e,t,i){if(uo)return e(t,i);uo=!0;try{return Gh(e,t,i)}finally{uo=!1,fl()}}var c0=/^[: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]*$/,Ku=Object.prototype.hasOwnProperty,qu={},ec={};function d0(e){return Ku.call(ec,e)?!0:Ku.call(qu,e)?!1:c0.test(e)?ec[e]=!0:(qu[e]=!0,!1)}function h0(e,t,i,n){if(i!==null&&i.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:i!==null?!i.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function p0(e,t,i,n){if(t===null||typeof t=="undefined"||h0(e,t,i,n))return!0;if(n)return!1;if(i!==null)switch(i.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function be(e,t,i,n,r,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=r,this.mustUseProperty=i,this.propertyName=e,this.type=t,this.sanitizeURL=s}var he={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){he[e]=new be(e,0,!1,e,null,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];he[t]=new be(t,1,!1,e[1],null,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){he[e]=new be(e,2,!1,e.toLowerCase(),null,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){he[e]=new be(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){he[e]=new be(e,3,!1,e.toLowerCase(),null,!1)});["checked","multiple","muted","selected"].forEach(function(e){he[e]=new be(e,3,!0,e,null,!1)});["capture","download"].forEach(function(e){he[e]=new be(e,4,!1,e,null,!1)});["cols","rows","size","span"].forEach(function(e){he[e]=new be(e,6,!1,e,null,!1)});["rowSpan","start"].forEach(function(e){he[e]=new be(e,5,!1,e.toLowerCase(),null,!1)});var gl=/[\-:]([a-z])/g;function ml(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(gl,ml);he[t]=new be(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(gl,ml);he[t]=new be(t,1,!1,e,"http://www.w3.org/1999/xlink",!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(gl,ml);he[t]=new be(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1)});["tabIndex","crossOrigin"].forEach(function(e){he[e]=new be(e,1,!1,e.toLowerCase(),null,!1)});he.xlinkHref=new be("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0);["src","href","action","formAction"].forEach(function(e){he[e]=new be(e,1,!1,e.toLowerCase(),null,!0)});var Xe=Vs.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Xe.hasOwnProperty("ReactCurrentDispatcher")||(Xe.ReactCurrentDispatcher={current:null});Xe.hasOwnProperty("ReactCurrentBatchConfig")||(Xe.ReactCurrentBatchConfig={suspense:null});function vl(e,t,i,n){var r=he.hasOwnProperty(t)?he[t]:null,s=r!==null?r.type===0:n?!1:!(!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N");s||(p0(t,i,r,n)&&(i=null),n||r===null?d0(t)&&(i===null?e.removeAttribute(t):e.setAttribute(t,""+i)):r.mustUseProperty?e[r.propertyName]=i===null?r.type===3?!1:"":i:(t=r.attributeName,n=r.attributeNamespace,i===null?e.removeAttribute(t):(r=r.type,i=r===3||r===4&&i===!0?"":""+i,n?e.setAttributeNS(n,t,i):e.setAttribute(t,i))))}var f0=/^(.*)[\\\/]/,Ne=typeof Symbol=="function"&&Symbol.for,fr=Ne?Symbol.for("react.element"):60103,Ti=Ne?Symbol.for("react.portal"):60106,ni=Ne?Symbol.for("react.fragment"):60107,Jh=Ne?Symbol.for("react.strict_mode"):60108,Pr=Ne?Symbol.for("react.profiler"):60114,Kh=Ne?Symbol.for("react.provider"):60109,qh=Ne?Symbol.for("react.context"):60110,g0=Ne?Symbol.for("react.concurrent_mode"):60111,wl=Ne?Symbol.for("react.forward_ref"):60112,zr=Ne?Symbol.for("react.suspense"):60113,Fo=Ne?Symbol.for("react.suspense_list"):60120,yl=Ne?Symbol.for("react.memo"):60115,ep=Ne?Symbol.for("react.lazy"):60116,tp=Ne?Symbol.for("react.block"):60121,tc=typeof Symbol=="function"&&Symbol.iterator;function sn(e){return e===null||typeof e!="object"?null:(e=tc&&e[tc]||e["@@iterator"],typeof e=="function"?e:null)}function m0(e){if(e._status===-1){e._status=0;var t=e._ctor;t=t(),e._result=t,t.then(function(i){e._status===0&&(i=i.default,e._status=1,e._result=i)},function(i){e._status===0&&(e._status=2,e._result=i)})}}function It(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ni:return"Fragment";case Ti:return"Portal";case Pr:return"Profiler";case Jh:return"StrictMode";case zr:return"Suspense";case Fo:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case qh:return"Context.Consumer";case Kh:return"Context.Provider";case wl:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case yl:return It(e.type);case tp:return It(e.render);case ep:if(e=e._status===1?e._result:null)return It(e)}return null}function xl(e){var t="";do{e:switch(e.tag){case 3:case 4:case 6:case 7:case 10:case 9:var i="";break e;default:var n=e._debugOwner,r=e._debugSource,s=It(e.type);i=null,n&&(i=It(n.type)),n=s,s="",r?s=" (at "+r.fileName.replace(f0,"")+":"+r.lineNumber+")":i&&(s=" (created by "+i+")"),i=`
151
- in `+(n||"Unknown")+s}t+=i,e=e.return}while(e);return t}function Xt(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function ip(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function v0(e){var t=ip(e)?"checked":"value",i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof i!="undefined"&&typeof i.get=="function"&&typeof i.set=="function"){var r=i.get,s=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(o){n=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function gr(e){e._valueTracker||(e._valueTracker=v0(e))}function np(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),n="";return e&&(n=ip(e)?e.checked?"true":"false":e.value),e=n,e!==i?(t.setValue(e),!0):!1}function Qo(e,t){var i=t.checked;return Ce({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:i!=null?i:e._wrapperState.initialChecked})}function ic(e,t){var i=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;i=Xt(t.value!=null?t.value:i),e._wrapperState={initialChecked:n,initialValue:i,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function rp(e,t){t=t.checked,t!=null&&vl(e,"checked",t,!1)}function Zo(e,t){rp(e,t);var i=Xt(t.value),n=t.type;if(i!=null)n==="number"?(i===0&&e.value===""||e.value!=i)&&(e.value=""+i):e.value!==""+i&&(e.value=""+i);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Yo(e,t.type,i):t.hasOwnProperty("defaultValue")&&Yo(e,t.type,Xt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function nc(e,t,i){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,i||t===e.value||(e.value=t),e.defaultValue=t}i=e.name,i!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,i!==""&&(e.name=i)}function Yo(e,t,i){(t!=="number"||e.ownerDocument.activeElement!==e)&&(i==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+i&&(e.defaultValue=""+i))}function w0(e){var t="";return Vs.Children.forEach(e,function(i){i!=null&&(t+=i)}),t}function Go(e,t){return e=Ce({children:void 0},t),(t=w0(t.children))&&(e.children=t),e}function Bi(e,t,i,n){if(e=e.options,t){t={};for(var r=0;r<i.length;r++)t["$"+i[r]]=!0;for(i=0;i<e.length;i++)r=t.hasOwnProperty("$"+e[i].value),e[i].selected!==r&&(e[i].selected=r),r&&n&&(e[i].defaultSelected=!0)}else{for(i=""+Xt(i),t=null,r=0;r<e.length;r++){if(e[r].value===i){e[r].selected=!0,n&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function Xo(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(x(91));return Ce({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function rc(e,t){var i=t.value;if(i==null){if(i=t.children,t=t.defaultValue,i!=null){if(t!=null)throw Error(x(92));if(Array.isArray(i)){if(!(1>=i.length))throw Error(x(93));i=i[0]}t=i}t==null&&(t=""),i=t}e._wrapperState={initialValue:Xt(i)}}function sp(e,t){var i=Xt(t.value),n=Xt(t.defaultValue);i!=null&&(i=""+i,i!==e.value&&(e.value=i),t.defaultValue==null&&e.defaultValue!==i&&(e.defaultValue=i)),n!=null&&(e.defaultValue=""+n)}function sc(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}var op={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function ap(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 Jo(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?ap(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var mr,lp=function(e){return typeof MSApp!="undefined"&&MSApp.execUnsafeLocalFunction?function(t,i,n,r){MSApp.execUnsafeLocalFunction(function(){return e(t,i,n,r)})}:e}(function(e,t){if(e.namespaceURI!==op.svg||"innerHTML"in e)e.innerHTML=t;else{for(mr=mr||document.createElement("div"),mr.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=mr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Bn(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}function vr(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var ki={animationend:vr("Animation","AnimationEnd"),animationiteration:vr("Animation","AnimationIteration"),animationstart:vr("Animation","AnimationStart"),transitionend:vr("Transition","TransitionEnd")},co={},up={};ei&&(up=document.createElement("div").style,"AnimationEvent"in window||(delete ki.animationend.animation,delete ki.animationiteration.animation,delete ki.animationstart.animation),"TransitionEvent"in window||delete ki.transitionend.transition);function Ls(e){if(co[e])return co[e];if(!ki[e])return e;var t=ki[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in up)return co[e]=t[i];return e}var cp=Ls("animationend"),dp=Ls("animationiteration"),hp=Ls("animationstart"),pp=Ls("transitionend"),mn="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),oc=new(typeof WeakMap=="function"?WeakMap:Map);function Sl(e){var t=oc.get(e);return t===void 0&&(t=new Map,oc.set(e,t)),t}function Ii(e){var t=e,i=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.effectTag&1026)!==0&&(i=t.return),e=t.return;while(e)}return t.tag===3?i:null}function fp(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function ac(e){if(Ii(e)!==e)throw Error(x(188))}function y0(e){var t=e.alternate;if(!t){if(t=Ii(e),t===null)throw Error(x(188));return t!==e?null:e}for(var i=e,n=t;;){var r=i.return;if(r===null)break;var s=r.alternate;if(s===null){if(n=r.return,n!==null){i=n;continue}break}if(r.child===s.child){for(s=r.child;s;){if(s===i)return ac(r),e;if(s===n)return ac(r),t;s=s.sibling}throw Error(x(188))}if(i.return!==n.return)i=r,n=s;else{for(var o=!1,a=r.child;a;){if(a===i){o=!0,i=r,n=s;break}if(a===n){o=!0,n=r,i=s;break}a=a.sibling}if(!o){for(a=s.child;a;){if(a===i){o=!0,i=s,n=r;break}if(a===n){o=!0,n=s,i=r;break}a=a.sibling}if(!o)throw Error(x(189))}}if(i.alternate!==n)throw Error(x(190))}if(i.tag!==3)throw Error(x(188));return i.stateNode.current===i?e:t}function gp(e){if(e=y0(e),!e)return null;for(var t=e;;){if(t.tag===5||t.tag===6)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 Qi(e,t){if(t==null)throw Error(x(30));return e==null?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 Cl(e,t,i){Array.isArray(e)?e.forEach(t,i):e&&t.call(i,e)}var on=null;function x0(e){if(e){var t=e._dispatchListeners,i=e._dispatchInstances;if(Array.isArray(t))for(var n=0;n<t.length&&!e.isPropagationStopped();n++)Gu(e,t[n],i[n]);else t&&Gu(e,t,i);e._dispatchListeners=null,e._dispatchInstances=null,e.isPersistent()||e.constructor.release(e)}}function Rs(e){if(e!==null&&(on=Qi(on,e)),e=on,on=null,e){if(Cl(e,x0),on)throw Error(x(95));if(qr)throw e=Uo,qr=!1,Uo=null,e}}function bl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}function mp(e){if(!ei)return!1;e="on"+e;var t=e in document;return t||(t=document.createElement("div"),t.setAttribute(e,"return;"),t=typeof t[e]=="function"),t}var is=[];function vp(e){e.topLevelType=null,e.nativeEvent=null,e.targetInst=null,e.ancestors.length=0,10>is.length&&is.push(e)}function wp(e,t,i,n){if(is.length){var r=is.pop();return r.topLevelType=e,r.eventSystemFlags=n,r.nativeEvent=t,r.targetInst=i,r}return{topLevelType:e,eventSystemFlags:n,nativeEvent:t,targetInst:i,ancestors:[]}}function yp(e){var t=e.targetInst,i=t;do{if(!i){e.ancestors.push(i);break}var n=i;if(n.tag===3)n=n.stateNode.containerInfo;else{for(;n.return;)n=n.return;n=n.tag!==3?null:n.stateNode.containerInfo}if(!n)break;t=i.tag,t!==5&&t!==6||e.ancestors.push(i),i=tr(n)}while(i);for(i=0;i<e.ancestors.length;i++){t=e.ancestors[i];var r=bl(e.nativeEvent);n=e.topLevelType;var s=e.nativeEvent,o=e.eventSystemFlags;i===0&&(o|=64);for(var a=null,l=0;l<ts.length;l++){var u=ts[l];u&&(u=u.extractEvents(n,t,s,r,o))&&(a=Qi(a,u))}Rs(a)}}function Ko(e,t,i){if(!i.has(e)){switch(e){case"scroll":vn(t,"scroll",!0);break;case"focus":case"blur":vn(t,"focus",!0),vn(t,"blur",!0),i.set("blur",null),i.set("focus",null);break;case"cancel":case"close":mp(e)&&vn(t,e,!0);break;case"invalid":case"submit":case"reset":break;default:mn.indexOf(e)===-1&&K(e,t)}i.set(e,null)}}var xp,Ml,Sp,qo=!1,ot=[],Ut=null,Wt=null,Ht=null,On=new Map,_n=new Map,an=[],ea="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(" "),S0="focus blur dragenter dragleave mouseover mouseout pointerover pointerout gotpointercapture lostpointercapture".split(" ");function C0(e,t){var i=Sl(t);ea.forEach(function(n){Ko(n,t,i)}),S0.forEach(function(n){Ko(n,t,i)})}function ta(e,t,i,n,r){return{blockedOn:e,topLevelType:t,eventSystemFlags:i|32,nativeEvent:r,container:n}}function lc(e,t){switch(e){case"focus":case"blur":Ut=null;break;case"dragenter":case"dragleave":Wt=null;break;case"mouseover":case"mouseout":Ht=null;break;case"pointerover":case"pointerout":On.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":_n.delete(t.pointerId)}}function ln(e,t,i,n,r,s){return e===null||e.nativeEvent!==s?(e=ta(t,i,n,r,s),t!==null&&(t=ir(t),t!==null&&Ml(t)),e):(e.eventSystemFlags|=n,e)}function b0(e,t,i,n,r){switch(t){case"focus":return Ut=ln(Ut,e,t,i,n,r),!0;case"dragenter":return Wt=ln(Wt,e,t,i,n,r),!0;case"mouseover":return Ht=ln(Ht,e,t,i,n,r),!0;case"pointerover":var s=r.pointerId;return On.set(s,ln(On.get(s)||null,e,t,i,n,r)),!0;case"gotpointercapture":return s=r.pointerId,_n.set(s,ln(_n.get(s)||null,e,t,i,n,r)),!0}return!1}function M0(e){var t=tr(e.target);if(t!==null){var i=Ii(t);if(i!==null){if(t=i.tag,t===13){if(t=fp(i),t!==null){e.blockedOn=t,de.unstable_runWithPriority(e.priority,function(){Sp(i)});return}}else if(t===3&&i.stateNode.hydrate){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Dr(e){if(e.blockedOn!==null)return!1;var t=El(e.topLevelType,e.eventSystemFlags,e.container,e.nativeEvent);if(t!==null){var i=ir(t);return i!==null&&Ml(i),e.blockedOn=t,!1}return!0}function uc(e,t,i){Dr(e)&&i.delete(t)}function I0(){for(qo=!1;0<ot.length;){var e=ot[0];if(e.blockedOn!==null){e=ir(e.blockedOn),e!==null&&xp(e);break}var t=El(e.topLevelType,e.eventSystemFlags,e.container,e.nativeEvent);t!==null?e.blockedOn=t:ot.shift()}Ut!==null&&Dr(Ut)&&(Ut=null),Wt!==null&&Dr(Wt)&&(Wt=null),Ht!==null&&Dr(Ht)&&(Ht=null),On.forEach(uc),_n.forEach(uc)}function un(e,t){e.blockedOn===t&&(e.blockedOn=null,qo||(qo=!0,de.unstable_scheduleCallback(de.unstable_NormalPriority,I0)))}function Cp(e){function t(r){return un(r,e)}if(0<ot.length){un(ot[0],e);for(var i=1;i<ot.length;i++){var n=ot[i];n.blockedOn===e&&(n.blockedOn=null)}}for(Ut!==null&&un(Ut,e),Wt!==null&&un(Wt,e),Ht!==null&&un(Ht,e),On.forEach(t),_n.forEach(t),i=0;i<an.length;i++)n=an[i],n.blockedOn===e&&(n.blockedOn=null);for(;0<an.length&&(i=an[0],i.blockedOn===null);)M0(i),i.blockedOn===null&&an.shift()}var bp={},Mp=new Map,Il=new Map,A0=["abort","abort",cp,"animationEnd",dp,"animationIteration",hp,"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",pp,"transitionEnd","waiting","waiting"];function Al(e,t){for(var i=0;i<e.length;i+=2){var n=e[i],r=e[i+1],s="on"+(r[0].toUpperCase()+r.slice(1));s={phasedRegistrationNames:{bubbled:s,captured:s+"Capture"},dependencies:[n],eventPriority:t},Il.set(n,t),Mp.set(n,s),bp[r]=s}}Al("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);Al("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);Al(A0,2);for(var cc="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),ho=0;ho<cc.length;ho++)Il.set(cc[ho],0);var E0=de.unstable_UserBlockingPriority,T0=de.unstable_runWithPriority,jr=!0;function K(e,t){vn(t,e,!1)}function vn(e,t,i){var n=Il.get(t);switch(n===void 0?2:n){case 0:n=k0.bind(null,t,1,e);break;case 1:n=N0.bind(null,t,1,e);break;default:n=Bs.bind(null,t,1,e)}i?e.addEventListener(t,n,!0):e.addEventListener(t,n,!1)}function k0(e,t,i,n){ri||pl();var r=Bs,s=ri;ri=!0;try{Yh(r,e,t,i,n)}finally{(ri=s)||fl()}}function N0(e,t,i,n){T0(E0,Bs.bind(null,e,t,i,n))}function Bs(e,t,i,n){if(jr)if(0<ot.length&&-1<ea.indexOf(e))e=ta(null,e,t,i,n),ot.push(e);else{var r=El(e,t,i,n);if(r===null)lc(e,n);else if(-1<ea.indexOf(e))e=ta(r,e,t,i,n),ot.push(e);else if(!b0(r,e,t,i,n)){lc(e,n),e=wp(e,n,null,t);try{Xh(yp,e)}finally{vp(e)}}}}function El(e,t,i,n){if(i=bl(n),i=tr(i),i!==null){var r=Ii(i);if(r===null)i=null;else{var s=r.tag;if(s===13){if(i=fp(r),i!==null)return i;i=null}else if(s===3){if(r.stateNode.hydrate)return r.tag===3?r.stateNode.containerInfo:null;i=null}else r!==i&&(i=null)}}e=wp(e,n,i,t);try{Xh(yp,e)}finally{vp(e)}return null}var En={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},P0=["Webkit","ms","Moz","O"];Object.keys(En).forEach(function(e){P0.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),En[t]=En[e]})});function Ip(e,t,i){return t==null||typeof t=="boolean"||t===""?"":i||typeof t!="number"||t===0||En.hasOwnProperty(e)&&En[e]?(""+t).trim():t+"px"}function Ap(e,t){e=e.style;for(var i in t)if(t.hasOwnProperty(i)){var n=i.indexOf("--")===0,r=Ip(i,t[i],n);i==="float"&&(i="cssFloat"),n?e.setProperty(i,r):e[i]=r}}var z0=Ce({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 ia(e,t){if(t){if(z0[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(x(137,e,""));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(x(60));if(!(typeof t.dangerouslySetInnerHTML=="object"&&"__html"in t.dangerouslySetInnerHTML))throw Error(x(61))}if(t.style!=null&&typeof t.style!="object")throw Error(x(62,""))}}function na(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 dc=op.html;function vt(e,t){e=e.nodeType===9||e.nodeType===11?e:e.ownerDocument;var i=Sl(e);t=dl[t];for(var n=0;n<t.length;n++)Ko(t[n],e,i)}function ns(){}function ra(e){if(e=e||(typeof document!="undefined"?document:void 0),typeof e=="undefined")return null;try{return e.activeElement||e.body}catch{return e.body}}function hc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function pc(e,t){var i=hc(e);e=0;for(var n;i;){if(i.nodeType===3){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=hc(i)}}function Ep(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ep(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function fc(){for(var e=window,t=ra();t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=ra(e.document)}return t}function sa(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Tp="$",kp="/$",Tl="$?",kl="$!",po=null,fo=null;function Np(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function oa(e,t){return e==="textarea"||e==="option"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var go=typeof setTimeout=="function"?setTimeout:void 0,D0=typeof clearTimeout=="function"?clearTimeout:void 0;function Oi(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break}return e}function gc(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i===Tp||i===kl||i===Tl){if(t===0)return e;t--}else i===kp&&t++}e=e.previousSibling}return null}var Nl=Math.random().toString(36).slice(2),Vt="__reactInternalInstance$"+Nl,rs="__reactEventHandlers$"+Nl,er="__reactContainere$"+Nl;function tr(e){var t=e[Vt];if(t)return t;for(var i=e.parentNode;i;){if(t=i[er]||i[Vt]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=gc(e);e!==null;){if(i=e[Vt])return i;e=gc(e)}return t}e=i,i=e.parentNode}return null}function ir(e){return e=e[Vt]||e[er],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function wi(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(x(33))}function Pl(e){return e[rs]||null}function wt(e){do e=e.return;while(e&&e.tag!==5);return e||null}function Pp(e,t){var i=e.stateNode;if(!i)return null;var n=cl(i);if(!n)return null;i=n[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":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(x(231,t,typeof i));return i}function mc(e,t,i){(t=Pp(e,i.dispatchConfig.phasedRegistrationNames[t]))&&(i._dispatchListeners=Qi(i._dispatchListeners,t),i._dispatchInstances=Qi(i._dispatchInstances,e))}function j0(e){if(e&&e.dispatchConfig.phasedRegistrationNames){for(var t=e._targetInst,i=[];t;)i.push(t),t=wt(t);for(t=i.length;0<t--;)mc(i[t],"captured",e);for(t=0;t<i.length;t++)mc(i[t],"bubbled",e)}}function aa(e,t,i){e&&i&&i.dispatchConfig.registrationName&&(t=Pp(e,i.dispatchConfig.registrationName))&&(i._dispatchListeners=Qi(i._dispatchListeners,t),i._dispatchInstances=Qi(i._dispatchInstances,e))}function V0(e){e&&e.dispatchConfig.registrationName&&aa(e._targetInst,null,e)}function Zi(e){Cl(e,j0)}var Lt=null,zl=null,Vr=null;function zp(){if(Vr)return Vr;var e,t=zl,i=t.length,n,r="value"in Lt?Lt.value:Lt.textContent,s=r.length;for(e=0;e<i&&t[e]===r[e];e++);var o=i-e;for(n=1;n<=o&&t[i-n]===r[s-n];n++);return Vr=r.slice(e,1<n?1-n:void 0)}function Lr(){return!0}function ss(){return!1}function _e(e,t,i,n){this.dispatchConfig=e,this._targetInst=t,this.nativeEvent=i,e=this.constructor.Interface;for(var r in e)e.hasOwnProperty(r)&&((t=e[r])?this[r]=t(i):r==="target"?this.target=n:this[r]=i[r]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Lr:ss,this.isPropagationStopped=ss,this}Ce(_e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!="unknown"&&(e.returnValue=!1),this.isDefaultPrevented=Lr)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!="unknown"&&(e.cancelBubble=!0),this.isPropagationStopped=Lr)},persist:function(){this.isPersistent=Lr},isPersistent:ss,destructor:function(){var e=this.constructor.Interface,t;for(t in e)this[t]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=ss,this._dispatchInstances=this._dispatchListeners=null}});_e.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};_e.extend=function(e){function t(){}function i(){return n.apply(this,arguments)}var n=this;t.prototype=n.prototype;var r=new t;return Ce(r,i.prototype),i.prototype=r,i.prototype.constructor=i,i.Interface=Ce({},n.Interface,e),i.extend=n.extend,Dp(i),i};Dp(_e);function L0(e,t,i,n){if(this.eventPool.length){var r=this.eventPool.pop();return this.call(r,e,t,i,n),r}return new this(e,t,i,n)}function R0(e){if(!(e instanceof this))throw Error(x(279));e.destructor(),10>this.eventPool.length&&this.eventPool.push(e)}function Dp(e){e.eventPool=[],e.getPooled=L0,e.release=R0}var B0=_e.extend({data:null}),O0=_e.extend({data:null}),_0=[9,13,27,32],Dl=ei&&"CompositionEvent"in window,Tn=null;ei&&"documentMode"in document&&(Tn=document.documentMode);var $0=ei&&"TextEvent"in window&&!Tn,jp=ei&&(!Dl||Tn&&8<Tn&&11>=Tn),vc=String.fromCharCode(32),mt={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(" ")}},wc=!1;function Vp(e,t){switch(e){case"keyup":return _0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function Lp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ni=!1;function U0(e,t){switch(e){case"compositionend":return Lp(t);case"keypress":return t.which!==32?null:(wc=!0,vc);case"textInput":return e=t.data,e===vc&&wc?null:e;default:return null}}function W0(e,t){if(Ni)return e==="compositionend"||!Dl&&Vp(e,t)?(e=zp(),Vr=zl=Lt=null,Ni=!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 jp&&t.locale!=="ko"?null:t.data;default:return null}}var H0={eventTypes:mt,extractEvents:function(e,t,i,n){var r;if(Dl)e:{switch(e){case"compositionstart":var s=mt.compositionStart;break e;case"compositionend":s=mt.compositionEnd;break e;case"compositionupdate":s=mt.compositionUpdate;break e}s=void 0}else Ni?Vp(e,i)&&(s=mt.compositionEnd):e==="keydown"&&i.keyCode===229&&(s=mt.compositionStart);return s?(jp&&i.locale!=="ko"&&(Ni||s!==mt.compositionStart?s===mt.compositionEnd&&Ni&&(r=zp()):(Lt=n,zl="value"in Lt?Lt.value:Lt.textContent,Ni=!0)),s=B0.getPooled(s,t,i,n),r?s.data=r:(r=Lp(i),r!==null&&(s.data=r)),Zi(s),r=s):r=null,(e=$0?U0(e,i):W0(e,i))?(t=O0.getPooled(mt.beforeInput,t,i,n),t.data=e,Zi(t)):t=null,r===null?t:t===null?r:[r,t]}},F0={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 Rp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!F0[e.type]:t==="textarea"}var Bp={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:"blur change click focus input keydown keyup selectionchange".split(" ")}};function Op(e,t,i){return e=_e.getPooled(Bp.change,e,t,i),e.type="change",Qh(i),Zi(e),e}var kn=null,$n=null;function Q0(e){Rs(e)}function Os(e){var t=wi(e);if(np(t))return e}function Z0(e,t){if(e==="change")return t}var la=!1;ei&&(la=mp("input")&&(!document.documentMode||9<document.documentMode));function yc(){kn&&(kn.detachEvent("onpropertychange",_p),$n=kn=null)}function _p(e){if(e.propertyName==="value"&&Os($n))if(e=Op($n,e,bl(e)),ri)Rs(e);else{ri=!0;try{hl(Q0,e)}finally{ri=!1,fl()}}}function Y0(e,t,i){e==="focus"?(yc(),kn=t,$n=i,kn.attachEvent("onpropertychange",_p)):e==="blur"&&yc()}function G0(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Os($n)}function X0(e,t){if(e==="click")return Os(t)}function J0(e,t){if(e==="input"||e==="change")return Os(t)}var K0={eventTypes:Bp,_isInputEventSupported:la,extractEvents:function(e,t,i,n){var r=t?wi(t):window,s=r.nodeName&&r.nodeName.toLowerCase();if(s==="select"||s==="input"&&r.type==="file")var o=Z0;else if(Rp(r))if(la)o=J0;else{o=G0;var a=Y0}else(s=r.nodeName)&&s.toLowerCase()==="input"&&(r.type==="checkbox"||r.type==="radio")&&(o=X0);if(o&&(o=o(e,t)))return Op(o,i,n);a&&a(e,r,t),e==="blur"&&(e=r._wrapperState)&&e.controlled&&r.type==="number"&&Yo(r,"number",r.value)}},nr=_e.extend({view:null,detail:null}),q0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ex(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=q0[e])?!!t[e]:!1}function jl(){return ex}var xc=0,Sc=0,Cc=!1,bc=!1,rr=nr.extend({screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:jl,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=xc;return xc=e.screenX,Cc?e.type==="mousemove"?e.screenX-t:0:(Cc=!0,0)},movementY:function(e){if("movementY"in e)return e.movementY;var t=Sc;return Sc=e.screenY,bc?e.type==="mousemove"?e.screenY-t:0:(bc=!0,0)}}),$p=rr.extend({pointerId:null,width:null,height:null,pressure:null,tangentialPressure:null,tiltX:null,tiltY:null,twist:null,pointerType:null,isPrimary:null}),cn={mouseEnter:{registrationName:"onMouseEnter",dependencies:["mouseout","mouseover"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["mouseout","mouseover"]},pointerEnter:{registrationName:"onPointerEnter",dependencies:["pointerout","pointerover"]},pointerLeave:{registrationName:"onPointerLeave",dependencies:["pointerout","pointerover"]}},tx={eventTypes:cn,extractEvents:function(e,t,i,n,r){var s=e==="mouseover"||e==="pointerover",o=e==="mouseout"||e==="pointerout";if(s&&(r&32)===0&&(i.relatedTarget||i.fromElement)||!o&&!s)return null;if(s=n.window===n?n:(s=n.ownerDocument)?s.defaultView||s.parentWindow:window,o){if(o=t,t=(t=i.relatedTarget||i.toElement)?tr(t):null,t!==null){var a=Ii(t);(t!==a||t.tag!==5&&t.tag!==6)&&(t=null)}}else o=null;if(o===t)return null;if(e==="mouseout"||e==="mouseover")var l=rr,u=cn.mouseLeave,h=cn.mouseEnter,p="mouse";else(e==="pointerout"||e==="pointerover")&&(l=$p,u=cn.pointerLeave,h=cn.pointerEnter,p="pointer");if(e=o==null?s:wi(o),s=t==null?s:wi(t),u=l.getPooled(u,o,i,n),u.type=p+"leave",u.target=e,u.relatedTarget=s,i=l.getPooled(h,t,i,n),i.type=p+"enter",i.target=s,i.relatedTarget=e,n=o,p=t,n&&p)e:{for(l=n,h=p,o=0,e=l;e;e=wt(e))o++;for(e=0,t=h;t;t=wt(t))e++;for(;0<o-e;)l=wt(l),o--;for(;0<e-o;)h=wt(h),e--;for(;o--;){if(l===h||l===h.alternate)break e;l=wt(l),h=wt(h)}l=null}else l=null;for(h=l,l=[];n&&n!==h&&(o=n.alternate,!(o!==null&&o===h));)l.push(n),n=wt(n);for(n=[];p&&p!==h&&(o=p.alternate,!(o!==null&&o===h));)n.push(p),p=wt(p);for(p=0;p<l.length;p++)aa(l[p],"bubbled",u);for(p=n.length;0<p--;)aa(n[p],"captured",i);return(r&64)===0?[u]:[u,i]}};function ix(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var yi=typeof Object.is=="function"?Object.is:ix,nx=Object.prototype.hasOwnProperty;function Un(e,t){if(yi(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),n=Object.keys(t);if(i.length!==n.length)return!1;for(n=0;n<i.length;n++)if(!nx.call(t,i[n])||!yi(e[i[n]],t[i[n]]))return!1;return!0}var rx=ei&&"documentMode"in document&&11>=document.documentMode,Up={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},Pi=null,ua=null,Nn=null,ca=!1;function Mc(e,t){var i=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;return ca||Pi==null||Pi!==ra(i)?null:(i=Pi,"selectionStart"in i&&sa(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Nn&&Un(Nn,i)?null:(Nn=i,e=_e.getPooled(Up.select,ua,e,t),e.type="select",e.target=Pi,Zi(e),e))}var sx={eventTypes:Up,extractEvents:function(e,t,i,n,r,s){if(r=s||(n.window===n?n.document:n.nodeType===9?n:n.ownerDocument),!(s=!r)){e:{r=Sl(r),s=dl.onSelect;for(var o=0;o<s.length;o++)if(!r.has(s[o])){r=!1;break e}r=!0}s=!r}if(s)return null;switch(r=t?wi(t):window,e){case"focus":(Rp(r)||r.contentEditable==="true")&&(Pi=r,ua=t,Nn=null);break;case"blur":Nn=ua=Pi=null;break;case"mousedown":ca=!0;break;case"contextmenu":case"mouseup":case"dragend":return ca=!1,Mc(i,n);case"selectionchange":if(rx)break;case"keydown":case"keyup":return Mc(i,n)}return null}},ox=_e.extend({animationName:null,elapsedTime:null,pseudoElement:null}),ax=_e.extend({clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),lx=nr.extend({relatedTarget:null});function Rr(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}var ux={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},cx={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"},dx=nr.extend({key:function(e){if(e.key){var t=ux[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Rr(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?cx[e.keyCode]||"Unidentified":""},location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:jl,charCode:function(e){return e.type==="keypress"?Rr(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Rr(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),hx=rr.extend({dataTransfer:null}),px=nr.extend({touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:jl}),fx=_e.extend({propertyName:null,elapsedTime:null,pseudoElement:null}),gx=rr.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}),mx={eventTypes:bp,extractEvents:function(e,t,i,n){var r=Mp.get(e);if(!r)return null;switch(e){case"keypress":if(Rr(i)===0)return null;case"keydown":case"keyup":e=dx;break;case"blur":case"focus":e=lx;break;case"click":if(i.button===2)return null;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":e=rr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":e=hx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":e=px;break;case cp:case dp:case hp:e=ox;break;case pp:e=fx;break;case"scroll":e=nr;break;case"wheel":e=gx;break;case"copy":case"cut":case"paste":e=ax;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":e=$p;break;default:e=_e}return t=e.getPooled(r,t,i,n),Zi(t),t}};if(es)throw Error(x(101));es=Array.prototype.slice.call("ResponderEventPlugin SimpleEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin".split(" "));Hh();var vx=ir;cl=Pl;Uh=vx;Wh=wi;Fh({SimpleEventPlugin:mx,EnterLeaveEventPlugin:tx,ChangeEventPlugin:K0,SelectEventPlugin:sx,BeforeInputEventPlugin:H0});var da=[],zi=-1;function G(e){0>zi||(e.current=da[zi],da[zi]=null,zi--)}function ne(e,t){zi++,da[zi]=e.current,e.current=t}var Jt={},ve={current:Jt},Ee={current:!1},xi=Jt;function Yi(e,t){var i=e.type.contextTypes;if(!i)return Jt;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var r={},s;for(s in i)r[s]=t[s];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=r),r}function Te(e){return e=e.childContextTypes,e!=null}function os(){G(Ee),G(ve)}function Ic(e,t,i){if(ve.current!==Jt)throw Error(x(168));ne(ve,t),ne(Ee,i)}function Wp(e,t,i){var n=e.stateNode;if(e=t.childContextTypes,typeof n.getChildContext!="function")return i;n=n.getChildContext();for(var r in n)if(!(r in e))throw Error(x(108,It(t)||"Unknown",r));return Ce({},i,{},n)}function Br(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Jt,xi=ve.current,ne(ve,e),ne(Ee,Ee.current),!0}function Ac(e,t,i){var n=e.stateNode;if(!n)throw Error(x(169));i?(e=Wp(e,t,xi),n.__reactInternalMemoizedMergedChildContext=e,G(Ee),G(ve),ne(ve,e)):G(Ee),ne(Ee,i)}var wx=de.unstable_runWithPriority,Vl=de.unstable_scheduleCallback,Hp=de.unstable_cancelCallback,Ec=de.unstable_requestPaint,ha=de.unstable_now,yx=de.unstable_getCurrentPriorityLevel,_s=de.unstable_ImmediatePriority,Fp=de.unstable_UserBlockingPriority,Qp=de.unstable_NormalPriority,Zp=de.unstable_LowPriority,Yp=de.unstable_IdlePriority,Gp={},xx=de.unstable_shouldYield,Sx=Ec!==void 0?Ec:function(){},xt=null,Or=null,mo=!1,Tc=ha(),$e=1e4>Tc?ha:function(){return ha()-Tc};function $s(){switch(yx()){case _s:return 99;case Fp:return 98;case Qp:return 97;case Zp:return 96;case Yp:return 95;default:throw Error(x(332))}}function Xp(e){switch(e){case 99:return _s;case 98:return Fp;case 97:return Qp;case 96:return Zp;case 95:return Yp;default:throw Error(x(332))}}function Kt(e,t){return e=Xp(e),wx(e,t)}function Jp(e,t,i){return e=Xp(e),Vl(e,t,i)}function kc(e){return xt===null?(xt=[e],Or=Vl(_s,Kp)):xt.push(e),Gp}function ht(){if(Or!==null){var e=Or;Or=null,Hp(e)}Kp()}function Kp(){if(!mo&&xt!==null){mo=!0;var e=0;try{var t=xt;Kt(99,function(){for(;e<t.length;e++){var i=t[e];do i=i(!0);while(i!==null)}}),xt=null}catch(i){throw xt!==null&&(xt=xt.slice(e+1)),Vl(_s,ht),i}finally{mo=!1}}}function _r(e,t,i){return i/=10,1073741821-(((1073741821-e+t/10)/i|0)+1)*i}function Ye(e,t){if(e&&e.defaultProps){t=Ce({},t),e=e.defaultProps;for(var i in e)t[i]===void 0&&(t[i]=e[i])}return t}var as={current:null},ls=null,Di=null,us=null;function Ll(){us=Di=ls=null}function Rl(e){var t=as.current;G(as),e.type._context._currentValue=t}function qp(e,t){for(;e!==null;){var i=e.alternate;if(e.childExpirationTime<t)e.childExpirationTime=t,i!==null&&i.childExpirationTime<t&&(i.childExpirationTime=t);else if(i!==null&&i.childExpirationTime<t)i.childExpirationTime=t;else break;e=e.return}}function _i(e,t){ls=e,us=Di=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.expirationTime>=t&&(at=!0),e.firstContext=null)}function We(e,t){if(us!==e&&t!==!1&&t!==0)if((typeof t!="number"||t===1073741823)&&(us=e,t=1073741823),t={context:e,observedBits:t,next:null},Di===null){if(ls===null)throw Error(x(308));Di=t,ls.dependencies={expirationTime:0,firstContext:t,responders:null}}else Di=Di.next=t;return e._currentValue}var Dt=!1;function Bl(e){e.updateQueue={baseState:e.memoizedState,baseQueue:null,shared:{pending:null},effects:null}}function Ol(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,baseQueue:e.baseQueue,shared:e.shared,effects:e.effects})}function Ft(e,t){return e={expirationTime:e,suspenseConfig:t,tag:0,payload:null,callback:null,next:null},e.next=e}function Qt(e,t){if(e=e.updateQueue,e!==null){e=e.shared;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}}function Nc(e,t){var i=e.alternate;i!==null&&Ol(i,e),e=e.updateQueue,i=e.baseQueue,i===null?(e.baseQueue=t.next=t,t.next=t):(t.next=i.next,i.next=t)}function Wn(e,t,i,n){var r=e.updateQueue;Dt=!1;var s=r.baseQueue,o=r.shared.pending;if(o!==null){if(s!==null){var a=s.next;s.next=o.next,o.next=a}s=o,r.shared.pending=null,a=e.alternate,a!==null&&(a=a.updateQueue,a!==null&&(a.baseQueue=o))}if(s!==null){a=s.next;var l=r.baseState,u=0,h=null,p=null,w=null;if(a!==null){var S=a;do{if(o=S.expirationTime,o<n){var I={expirationTime:S.expirationTime,suspenseConfig:S.suspenseConfig,tag:S.tag,payload:S.payload,callback:S.callback,next:null};w===null?(p=w=I,h=l):w=w.next=I,o>u&&(u=o)}else{w!==null&&(w=w.next={expirationTime:1073741823,suspenseConfig:S.suspenseConfig,tag:S.tag,payload:S.payload,callback:S.callback,next:null}),Nf(o,S.suspenseConfig);e:{var E=e,c=S;switch(o=t,I=i,c.tag){case 1:if(E=c.payload,typeof E=="function"){l=E.call(I,l,o);break e}l=E;break e;case 3:E.effectTag=E.effectTag&-4097|64;case 0:if(E=c.payload,o=typeof E=="function"?E.call(I,l,o):E,o==null)break e;l=Ce({},l,o);break e;case 2:Dt=!0}}S.callback!==null&&(e.effectTag|=32,o=r.effects,o===null?r.effects=[S]:o.push(S))}if(S=S.next,S===null||S===a){if(o=r.shared.pending,o===null)break;S=s.next=o.next,o.next=a,r.baseQueue=s=o,r.shared.pending=null}}while(1)}w===null?h=l:w.next=p,r.baseState=h,r.baseQueue=w,Qs(u),e.expirationTime=u,e.memoizedState=l}}function Pc(e,t,i){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],r=n.callback;if(r!==null){if(n.callback=null,n=r,r=i,typeof n!="function")throw Error(x(191,n));n.call(r)}}}var Pn=Xe.ReactCurrentBatchConfig,ef=new Vs.Component().refs;function cs(e,t,i,n){t=e.memoizedState,i=i(n,t),i=i==null?t:Ce({},t,i),e.memoizedState=i,e.expirationTime===0&&(e.updateQueue.baseState=i)}var Us={isMounted:function(e){return(e=e._reactInternalFiber)?Ii(e)===e:!1},enqueueSetState:function(e,t,i){e=e._reactInternalFiber;var n=ct(),r=Pn.suspense;n=fi(n,e,r),r=Ft(n,r),r.payload=t,i!=null&&(r.callback=i),Qt(e,r),Yt(e,n)},enqueueReplaceState:function(e,t,i){e=e._reactInternalFiber;var n=ct(),r=Pn.suspense;n=fi(n,e,r),r=Ft(n,r),r.tag=1,r.payload=t,i!=null&&(r.callback=i),Qt(e,r),Yt(e,n)},enqueueForceUpdate:function(e,t){e=e._reactInternalFiber;var i=ct(),n=Pn.suspense;i=fi(i,e,n),n=Ft(i,n),n.tag=2,t!=null&&(n.callback=t),Qt(e,n),Yt(e,i)}};function zc(e,t,i,n,r,s,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,s,o):t.prototype&&t.prototype.isPureReactComponent?!Un(i,n)||!Un(r,s):!0}function tf(e,t,i){var n=!1,r=Jt,s=t.contextType;return typeof s=="object"&&s!==null?s=We(s):(r=Te(t)?xi:ve.current,n=t.contextTypes,s=(n=n!=null)?Yi(e,r):Jt),t=new t(i,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Us,e.stateNode=t,t._reactInternalFiber=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=r,e.__reactInternalMemoizedMaskedChildContext=s),t}function Dc(e,t,i,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,n),t.state!==e&&Us.enqueueReplaceState(t,t.state,null)}function pa(e,t,i,n){var r=e.stateNode;r.props=i,r.state=e.memoizedState,r.refs=ef,Bl(e);var s=t.contextType;typeof s=="object"&&s!==null?r.context=We(s):(s=Te(t)?xi:ve.current,r.context=Yi(e,s)),Wn(e,i,r,n),r.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(cs(e,t,s,i),r.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(t=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),t!==r.state&&Us.enqueueReplaceState(r,r.state,null),Wn(e,i,r,n),r.state=e.memoizedState),typeof r.componentDidMount=="function"&&(e.effectTag|=4)}var wr=Array.isArray;function dn(e,t,i){if(e=i.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(i._owner){if(i=i._owner,i){if(i.tag!==1)throw Error(x(309));var n=i.stateNode}if(!n)throw Error(x(147,e));var r=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===r?t.ref:(t=function(s){var o=n.refs;o===ef&&(o=n.refs={}),s===null?delete o[r]:o[r]=s},t._stringRef=r,t)}if(typeof e!="string")throw Error(x(284));if(!i._owner)throw Error(x(290,e))}return e}function yr(e,t){if(e.type!=="textarea")throw Error(x(31,Object.prototype.toString.call(t)==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":t,""))}function nf(e){function t(c,d){if(e){var f=c.lastEffect;f!==null?(f.nextEffect=d,c.lastEffect=d):c.firstEffect=c.lastEffect=d,d.nextEffect=null,d.effectTag=8}}function i(c,d){if(!e)return null;for(;d!==null;)t(c,d),d=d.sibling;return null}function n(c,d){for(c=new Map;d!==null;)d.key!==null?c.set(d.key,d):c.set(d.index,d),d=d.sibling;return c}function r(c,d){return c=Si(c,d),c.index=0,c.sibling=null,c}function s(c,d,f){return c.index=f,e?(f=c.alternate,f!==null?(f=f.index,f<d?(c.effectTag=2,d):f):(c.effectTag=2,d)):d}function o(c){return e&&c.alternate===null&&(c.effectTag=2),c}function a(c,d,f,g){return d===null||d.tag!==6?(d=Co(f,c.mode,g),d.return=c,d):(d=r(d,f),d.return=c,d)}function l(c,d,f,g){return d!==null&&d.elementType===f.type?(g=r(d,f.props),g.ref=dn(c,d,f),g.return=c,g):(g=Hr(f.type,f.key,f.props,null,c.mode,g),g.ref=dn(c,d,f),g.return=c,g)}function u(c,d,f,g){return d===null||d.tag!==4||d.stateNode.containerInfo!==f.containerInfo||d.stateNode.implementation!==f.implementation?(d=bo(f,c.mode,g),d.return=c,d):(d=r(d,f.children||[]),d.return=c,d)}function h(c,d,f,g,m){return d===null||d.tag!==7?(d=Ot(f,c.mode,g,m),d.return=c,d):(d=r(d,f),d.return=c,d)}function p(c,d,f){if(typeof d=="string"||typeof d=="number")return d=Co(""+d,c.mode,f),d.return=c,d;if(typeof d=="object"&&d!==null){switch(d.$$typeof){case fr:return f=Hr(d.type,d.key,d.props,null,c.mode,f),f.ref=dn(c,null,d),f.return=c,f;case Ti:return d=bo(d,c.mode,f),d.return=c,d}if(wr(d)||sn(d))return d=Ot(d,c.mode,f,null),d.return=c,d;yr(c,d)}return null}function w(c,d,f,g){var m=d!==null?d.key:null;if(typeof f=="string"||typeof f=="number")return m!==null?null:a(c,d,""+f,g);if(typeof f=="object"&&f!==null){switch(f.$$typeof){case fr:return f.key===m?f.type===ni?h(c,d,f.props.children,g,m):l(c,d,f,g):null;case Ti:return f.key===m?u(c,d,f,g):null}if(wr(f)||sn(f))return m!==null?null:h(c,d,f,g,null);yr(c,f)}return null}function S(c,d,f,g,m){if(typeof g=="string"||typeof g=="number")return c=c.get(f)||null,a(d,c,""+g,m);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case fr:return c=c.get(g.key===null?f:g.key)||null,g.type===ni?h(d,c,g.props.children,m,g.key):l(d,c,g,m);case Ti:return c=c.get(g.key===null?f:g.key)||null,u(d,c,g,m)}if(wr(g)||sn(g))return c=c.get(f)||null,h(d,c,g,m,null);yr(d,g)}return null}function I(c,d,f,g){for(var m=null,y=null,v=d,T=d=0,D=null;v!==null&&T<f.length;T++){v.index>T?(D=v,v=null):D=v.sibling;var k=w(c,v,f[T],g);if(k===null){v===null&&(v=D);break}e&&v&&k.alternate===null&&t(c,v),d=s(k,d,T),y===null?m=k:y.sibling=k,y=k,v=D}if(T===f.length)return i(c,v),m;if(v===null){for(;T<f.length;T++)v=p(c,f[T],g),v!==null&&(d=s(v,d,T),y===null?m=v:y.sibling=v,y=v);return m}for(v=n(c,v);T<f.length;T++)D=S(v,c,T,f[T],g),D!==null&&(e&&D.alternate!==null&&v.delete(D.key===null?T:D.key),d=s(D,d,T),y===null?m=D:y.sibling=D,y=D);return e&&v.forEach(function(X){return t(c,X)}),m}function E(c,d,f,g){var m=sn(f);if(typeof m!="function")throw Error(x(150));if(f=m.call(f),f==null)throw Error(x(151));for(var y=m=null,v=d,T=d=0,D=null,k=f.next();v!==null&&!k.done;T++,k=f.next()){v.index>T?(D=v,v=null):D=v.sibling;var X=w(c,v,k.value,g);if(X===null){v===null&&(v=D);break}e&&v&&X.alternate===null&&t(c,v),d=s(X,d,T),y===null?m=X:y.sibling=X,y=X,v=D}if(k.done)return i(c,v),m;if(v===null){for(;!k.done;T++,k=f.next())k=p(c,k.value,g),k!==null&&(d=s(k,d,T),y===null?m=k:y.sibling=k,y=k);return m}for(v=n(c,v);!k.done;T++,k=f.next())k=S(v,c,T,k.value,g),k!==null&&(e&&k.alternate!==null&&v.delete(k.key===null?T:k.key),d=s(k,d,T),y===null?m=k:y.sibling=k,y=k);return e&&v.forEach(function(J){return t(c,J)}),m}return function(c,d,f,g){var m=typeof f=="object"&&f!==null&&f.type===ni&&f.key===null;m&&(f=f.props.children);var y=typeof f=="object"&&f!==null;if(y)switch(f.$$typeof){case fr:e:{for(y=f.key,m=d;m!==null;){if(m.key===y){switch(m.tag){case 7:if(f.type===ni){i(c,m.sibling),d=r(m,f.props.children),d.return=c,c=d;break e}break;default:if(m.elementType===f.type){i(c,m.sibling),d=r(m,f.props),d.ref=dn(c,m,f),d.return=c,c=d;break e}}i(c,m);break}else t(c,m);m=m.sibling}f.type===ni?(d=Ot(f.props.children,c.mode,g,f.key),d.return=c,c=d):(g=Hr(f.type,f.key,f.props,null,c.mode,g),g.ref=dn(c,d,f),g.return=c,c=g)}return o(c);case Ti:e:{for(m=f.key;d!==null;){if(d.key===m)if(d.tag===4&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){i(c,d.sibling),d=r(d,f.children||[]),d.return=c,c=d;break e}else{i(c,d);break}else t(c,d);d=d.sibling}d=bo(f,c.mode,g),d.return=c,c=d}return o(c)}if(typeof f=="string"||typeof f=="number")return f=""+f,d!==null&&d.tag===6?(i(c,d.sibling),d=r(d,f),d.return=c,c=d):(i(c,d),d=Co(f,c.mode,g),d.return=c,c=d),o(c);if(wr(f))return I(c,d,f,g);if(sn(f))return E(c,d,f,g);if(y&&yr(c,f),typeof f=="undefined"&&!m)switch(c.tag){case 1:case 0:throw c=c.type,Error(x(152,c.displayName||c.name||"Component"))}return i(c,d)}}var Gi=nf(!0),_l=nf(!1),sr={},ut={current:sr},Hn={current:sr},Fn={current:sr};function si(e){if(e===sr)throw Error(x(174));return e}function fa(e,t){switch(ne(Fn,t),ne(Hn,e),ne(ut,sr),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Jo(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Jo(t,e)}G(ut),ne(ut,t)}function Xi(){G(ut),G(Hn),G(Fn)}function jc(e){si(Fn.current);var t=si(ut.current),i=Jo(t,e.type);t!==i&&(ne(Hn,e),ne(ut,i))}function $l(e){Hn.current===e&&(G(ut),G(Hn))}var te={current:0};function ds(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||i.data===Tl||i.data===kl))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.effectTag&64)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function Ul(e,t){return{responder:e,props:t}}var $r=Xe.ReactCurrentDispatcher,Ue=Xe.ReactCurrentBatchConfig,Rt=0,se=null,fe=null,ge=null,hs=!1;function Pe(){throw Error(x(321))}function Wl(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!yi(e[i],t[i]))return!1;return!0}function Hl(e,t,i,n,r,s){if(Rt=s,se=t,t.memoizedState=null,t.updateQueue=null,t.expirationTime=0,$r.current=e===null||e.memoizedState===null?Cx:bx,e=i(n,r),t.expirationTime===Rt){s=0;do{if(t.expirationTime=0,!(25>s))throw Error(x(301));s+=1,ge=fe=null,t.updateQueue=null,$r.current=Mx,e=i(n,r)}while(t.expirationTime===Rt)}if($r.current=gs,t=fe!==null&&fe.next!==null,Rt=0,ge=fe=se=null,hs=!1,t)throw Error(x(300));return e}function $i(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ge===null?se.memoizedState=ge=e:ge=ge.next=e,ge}function qi(){if(fe===null){var e=se.alternate;e=e!==null?e.memoizedState:null}else e=fe.next;var t=ge===null?se.memoizedState:ge.next;if(t!==null)ge=t,fe=e;else{if(e===null)throw Error(x(310));fe=e,e={memoizedState:fe.memoizedState,baseState:fe.baseState,baseQueue:fe.baseQueue,queue:fe.queue,next:null},ge===null?se.memoizedState=ge=e:ge=ge.next=e}return ge}function di(e,t){return typeof t=="function"?t(e):t}function xr(e){var t=qi(),i=t.queue;if(i===null)throw Error(x(311));i.lastRenderedReducer=e;var n=fe,r=n.baseQueue,s=i.pending;if(s!==null){if(r!==null){var o=r.next;r.next=s.next,s.next=o}n.baseQueue=r=s,i.pending=null}if(r!==null){r=r.next,n=n.baseState;var a=o=s=null,l=r;do{var u=l.expirationTime;if(u<Rt){var h={expirationTime:l.expirationTime,suspenseConfig:l.suspenseConfig,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null};a===null?(o=a=h,s=n):a=a.next=h,u>se.expirationTime&&(se.expirationTime=u,Qs(u))}else a!==null&&(a=a.next={expirationTime:1073741823,suspenseConfig:l.suspenseConfig,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null}),Nf(u,l.suspenseConfig),n=l.eagerReducer===e?l.eagerState:e(n,l.action);l=l.next}while(l!==null&&l!==r);a===null?s=n:a.next=o,yi(n,t.memoizedState)||(at=!0),t.memoizedState=n,t.baseState=s,t.baseQueue=a,i.lastRenderedState=n}return[t.memoizedState,i.dispatch]}function Sr(e){var t=qi(),i=t.queue;if(i===null)throw Error(x(311));i.lastRenderedReducer=e;var n=i.dispatch,r=i.pending,s=t.memoizedState;if(r!==null){i.pending=null;var o=r=r.next;do s=e(s,o.action),o=o.next;while(o!==r);yi(s,t.memoizedState)||(at=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),i.lastRenderedState=s}return[s,n]}function vo(e){var t=$i();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e=t.queue={pending:null,dispatch:null,lastRenderedReducer:di,lastRenderedState:e},e=e.dispatch=uf.bind(null,se,e),[t.memoizedState,e]}function ga(e,t,i,n){return e={tag:e,create:t,destroy:i,deps:n,next:null},t=se.updateQueue,t===null?(t={lastEffect:null},se.updateQueue=t,t.lastEffect=e.next=e):(i=t.lastEffect,i===null?t.lastEffect=e.next=e:(n=i.next,i.next=e,e.next=n,t.lastEffect=e)),e}function rf(){return qi().memoizedState}function ma(e,t,i,n){var r=$i();se.effectTag|=e,r.memoizedState=ga(1|t,i,void 0,n===void 0?null:n)}function Fl(e,t,i,n){var r=qi();n=n===void 0?null:n;var s=void 0;if(fe!==null){var o=fe.memoizedState;if(s=o.destroy,n!==null&&Wl(n,o.deps)){ga(t,i,s,n);return}}se.effectTag|=e,r.memoizedState=ga(1|t,i,s,n)}function Vc(e,t){return ma(516,4,e,t)}function ps(e,t){return Fl(516,4,e,t)}function sf(e,t){return Fl(4,2,e,t)}function of(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function af(e,t,i){return i=i!=null?i.concat([e]):null,Fl(4,2,of.bind(null,t,e),i)}function Ql(){}function Lc(e,t){return $i().memoizedState=[e,t===void 0?null:t],e}function fs(e,t){var i=qi();t=t===void 0?null:t;var n=i.memoizedState;return n!==null&&t!==null&&Wl(t,n[1])?n[0]:(i.memoizedState=[e,t],e)}function lf(e,t){var i=qi();t=t===void 0?null:t;var n=i.memoizedState;return n!==null&&t!==null&&Wl(t,n[1])?n[0]:(e=e(),i.memoizedState=[e,t],e)}function Zl(e,t,i){var n=$s();Kt(98>n?98:n,function(){e(!0)}),Kt(97<n?97:n,function(){var r=Ue.suspense;Ue.suspense=t===void 0?null:t;try{e(!1),i()}finally{Ue.suspense=r}})}function uf(e,t,i){var n=ct(),r=Pn.suspense;n=fi(n,e,r),r={expirationTime:n,suspenseConfig:r,action:i,eagerReducer:null,eagerState:null,next:null};var s=t.pending;if(s===null?r.next=r:(r.next=s.next,s.next=r),t.pending=r,s=e.alternate,e===se||s!==null&&s===se)hs=!0,r.expirationTime=Rt,se.expirationTime=Rt;else{if(e.expirationTime===0&&(s===null||s.expirationTime===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,a=s(o,i);if(r.eagerReducer=s,r.eagerState=a,yi(a,o))return}catch{}finally{}Yt(e,n)}}var gs={readContext:We,useCallback:Pe,useContext:Pe,useEffect:Pe,useImperativeHandle:Pe,useLayoutEffect:Pe,useMemo:Pe,useReducer:Pe,useRef:Pe,useState:Pe,useDebugValue:Pe,useResponder:Pe,useDeferredValue:Pe,useTransition:Pe},Cx={readContext:We,useCallback:Lc,useContext:We,useEffect:Vc,useImperativeHandle:function(e,t,i){return i=i!=null?i.concat([e]):null,ma(4,2,of.bind(null,t,e),i)},useLayoutEffect:function(e,t){return ma(4,2,e,t)},useMemo:function(e,t){var i=$i();return t=t===void 0?null:t,e=e(),i.memoizedState=[e,t],e},useReducer:function(e,t,i){var n=$i();return t=i!==void 0?i(t):t,n.memoizedState=n.baseState=t,e=n.queue={pending:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},e=e.dispatch=uf.bind(null,se,e),[n.memoizedState,e]},useRef:function(e){var t=$i();return e={current:e},t.memoizedState=e},useState:vo,useDebugValue:Ql,useResponder:Ul,useDeferredValue:function(e,t){var i=vo(e),n=i[0],r=i[1];return Vc(function(){var s=Ue.suspense;Ue.suspense=t===void 0?null:t;try{r(e)}finally{Ue.suspense=s}},[e,t]),n},useTransition:function(e){var t=vo(!1),i=t[0];return t=t[1],[Lc(Zl.bind(null,t,e),[t,e]),i]}},bx={readContext:We,useCallback:fs,useContext:We,useEffect:ps,useImperativeHandle:af,useLayoutEffect:sf,useMemo:lf,useReducer:xr,useRef:rf,useState:function(){return xr(di)},useDebugValue:Ql,useResponder:Ul,useDeferredValue:function(e,t){var i=xr(di),n=i[0],r=i[1];return ps(function(){var s=Ue.suspense;Ue.suspense=t===void 0?null:t;try{r(e)}finally{Ue.suspense=s}},[e,t]),n},useTransition:function(e){var t=xr(di),i=t[0];return t=t[1],[fs(Zl.bind(null,t,e),[t,e]),i]}},Mx={readContext:We,useCallback:fs,useContext:We,useEffect:ps,useImperativeHandle:af,useLayoutEffect:sf,useMemo:lf,useReducer:Sr,useRef:rf,useState:function(){return Sr(di)},useDebugValue:Ql,useResponder:Ul,useDeferredValue:function(e,t){var i=Sr(di),n=i[0],r=i[1];return ps(function(){var s=Ue.suspense;Ue.suspense=t===void 0?null:t;try{r(e)}finally{Ue.suspense=s}},[e,t]),n},useTransition:function(e){var t=Sr(di),i=t[0];return t=t[1],[fs(Zl.bind(null,t,e),[t,e]),i]}},bt=null,Bt=null,hi=!1;function cf(e,t){var i=lt(5,null,null,0);i.elementType="DELETED",i.type="DELETED",i.stateNode=t,i.return=e,i.effectTag=8,e.lastEffect!==null?(e.lastEffect.nextEffect=i,e.lastEffect=i):e.firstEffect=e.lastEffect=i}function Rc(e,t){switch(e.tag){case 5:var i=e.type;return t=t.nodeType!==1||i.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,!0):!1;case 13:return!1;default:return!1}}function va(e){if(hi){var t=Bt;if(t){var i=t;if(!Rc(e,t)){if(t=Oi(i.nextSibling),!t||!Rc(e,t)){e.effectTag=e.effectTag&-1025|2,hi=!1,bt=e;return}cf(bt,i)}bt=e,Bt=Oi(t.firstChild)}else e.effectTag=e.effectTag&-1025|2,hi=!1,bt=e}}function Bc(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;bt=e}function Cr(e){if(e!==bt)return!1;if(!hi)return Bc(e),hi=!0,!1;var t=e.type;if(e.tag!==5||t!=="head"&&t!=="body"&&!oa(t,e.memoizedProps))for(t=Bt;t;)cf(e,t),t=Oi(t.nextSibling);if(Bc(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(x(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var i=e.data;if(i===kp){if(t===0){Bt=Oi(e.nextSibling);break e}t--}else i!==Tp&&i!==kl&&i!==Tl||t++}e=e.nextSibling}Bt=null}}else Bt=bt?Oi(e.stateNode.nextSibling):null;return!0}function wo(){Bt=bt=null,hi=!1}var Ix=Xe.ReactCurrentOwner,at=!1;function De(e,t,i,n){t.child=e===null?_l(t,null,i,n):Gi(t,e.child,i,n)}function Oc(e,t,i,n,r){i=i.render;var s=t.ref;return _i(t,r),n=Hl(e,t,i,n,s,r),e!==null&&!at?(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=r&&(e.expirationTime=0),Mt(e,t,r)):(t.effectTag|=1,De(e,t,n,r),t.child)}function _c(e,t,i,n,r,s){if(e===null){var o=i.type;return typeof o=="function"&&!Kl(o)&&o.defaultProps===void 0&&i.compare===null&&i.defaultProps===void 0?(t.tag=15,t.type=o,df(e,t,o,n,r,s)):(e=Hr(i.type,null,n,null,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}return o=e.child,r<s&&(r=o.memoizedProps,i=i.compare,i=i!==null?i:Un,i(r,n)&&e.ref===t.ref)?Mt(e,t,s):(t.effectTag|=1,e=Si(o,n),e.ref=t.ref,e.return=t,t.child=e)}function df(e,t,i,n,r,s){return e!==null&&Un(e.memoizedProps,n)&&e.ref===t.ref&&(at=!1,r<s)?(t.expirationTime=e.expirationTime,Mt(e,t,s)):wa(e,t,i,n,s)}function hf(e,t){var i=t.ref;(e===null&&i!==null||e!==null&&e.ref!==i)&&(t.effectTag|=128)}function wa(e,t,i,n,r){var s=Te(i)?xi:ve.current;return s=Yi(t,s),_i(t,r),i=Hl(e,t,i,n,s,r),e!==null&&!at?(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=r&&(e.expirationTime=0),Mt(e,t,r)):(t.effectTag|=1,De(e,t,i,r),t.child)}function $c(e,t,i,n,r){if(Te(i)){var s=!0;Br(t)}else s=!1;if(_i(t,r),t.stateNode===null)e!==null&&(e.alternate=null,t.alternate=null,t.effectTag|=2),tf(t,i,n),pa(t,i,n,r),n=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var l=o.context,u=i.contextType;typeof u=="object"&&u!==null?u=We(u):(u=Te(i)?xi:ve.current,u=Yi(t,u));var h=i.getDerivedStateFromProps,p=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function";p||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==n||l!==u)&&Dc(t,o,n,u),Dt=!1;var w=t.memoizedState;o.state=w,Wn(t,n,o,r),l=t.memoizedState,a!==n||w!==l||Ee.current||Dt?(typeof h=="function"&&(cs(t,i,h,n),l=t.memoizedState),(a=Dt||zc(t,i,a,n,w,l,u))?(p||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.effectTag|=4)):(typeof o.componentDidMount=="function"&&(t.effectTag|=4),t.memoizedProps=n,t.memoizedState=l),o.props=n,o.state=l,o.context=u,n=a):(typeof o.componentDidMount=="function"&&(t.effectTag|=4),n=!1)}else o=t.stateNode,Ol(e,t),a=t.memoizedProps,o.props=t.type===t.elementType?a:Ye(t.type,a),l=o.context,u=i.contextType,typeof u=="object"&&u!==null?u=We(u):(u=Te(i)?xi:ve.current,u=Yi(t,u)),h=i.getDerivedStateFromProps,(p=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==n||l!==u)&&Dc(t,o,n,u),Dt=!1,l=t.memoizedState,o.state=l,Wn(t,n,o,r),w=t.memoizedState,a!==n||l!==w||Ee.current||Dt?(typeof h=="function"&&(cs(t,i,h,n),w=t.memoizedState),(h=Dt||zc(t,i,a,n,l,w,u))?(p||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,w,u),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,w,u)),typeof o.componentDidUpdate=="function"&&(t.effectTag|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.effectTag|=256)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&l===e.memoizedState||(t.effectTag|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&l===e.memoizedState||(t.effectTag|=256),t.memoizedProps=n,t.memoizedState=w),o.props=n,o.state=w,o.context=u,n=h):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&l===e.memoizedState||(t.effectTag|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&l===e.memoizedState||(t.effectTag|=256),n=!1);return ya(e,t,i,n,s,r)}function ya(e,t,i,n,r,s){hf(e,t);var o=(t.effectTag&64)!==0;if(!n&&!o)return r&&Ac(t,i,!1),Mt(e,t,s);n=t.stateNode,Ix.current=t;var a=o&&typeof i.getDerivedStateFromError!="function"?null:n.render();return t.effectTag|=1,e!==null&&o?(t.child=Gi(t,e.child,null,s),t.child=Gi(t,null,a,s)):De(e,t,a,s),t.memoizedState=n.state,r&&Ac(t,i,!0),t.child}function Uc(e){var t=e.stateNode;t.pendingContext?Ic(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Ic(e,t.context,!1),fa(e,t.containerInfo)}var yo={dehydrated:null,retryTime:0};function Wc(e,t,i){var n=t.mode,r=t.pendingProps,s=te.current,o=!1,a;if((a=(t.effectTag&64)!==0)||(a=(s&2)!==0&&(e===null||e.memoizedState!==null)),a?(o=!0,t.effectTag&=-65):e!==null&&e.memoizedState===null||r.fallback===void 0||r.unstable_avoidThisFallback===!0||(s|=1),ne(te,s&1),e===null){if(r.fallback!==void 0&&va(t),o){if(o=r.fallback,r=Ot(null,n,0,null),r.return=t,(t.mode&2)===0)for(e=t.memoizedState!==null?t.child.child:t.child,r.child=e;e!==null;)e.return=r,e=e.sibling;return i=Ot(o,n,i,null),i.return=t,r.sibling=i,t.memoizedState=yo,t.child=r,i}return n=r.children,t.memoizedState=null,t.child=_l(t,null,n,i)}if(e.memoizedState!==null){if(e=e.child,n=e.sibling,o){if(r=r.fallback,i=Si(e,e.pendingProps),i.return=t,(t.mode&2)===0&&(o=t.memoizedState!==null?t.child.child:t.child,o!==e.child))for(i.child=o;o!==null;)o.return=i,o=o.sibling;return n=Si(n,r),n.return=t,i.sibling=n,i.childExpirationTime=0,t.memoizedState=yo,t.child=i,n}return i=Gi(t,e.child,r.children,i),t.memoizedState=null,t.child=i}if(e=e.child,o){if(o=r.fallback,r=Ot(null,n,0,null),r.return=t,r.child=e,e!==null&&(e.return=r),(t.mode&2)===0)for(e=t.memoizedState!==null?t.child.child:t.child,r.child=e;e!==null;)e.return=r,e=e.sibling;return i=Ot(o,n,i,null),i.return=t,r.sibling=i,i.effectTag|=2,r.childExpirationTime=0,t.memoizedState=yo,t.child=r,i}return t.memoizedState=null,t.child=Gi(t,e,r.children,i)}function Hc(e,t){e.expirationTime<t&&(e.expirationTime=t);var i=e.alternate;i!==null&&i.expirationTime<t&&(i.expirationTime=t),qp(e.return,t)}function xo(e,t,i,n,r,s){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:i,tailExpiration:0,tailMode:r,lastEffect:s}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=n,o.tail=i,o.tailExpiration=0,o.tailMode=r,o.lastEffect=s)}function Fc(e,t,i){var n=t.pendingProps,r=n.revealOrder,s=n.tail;if(De(e,t,n.children,i),n=te.current,(n&2)!==0)n=n&1|2,t.effectTag|=64;else{if(e!==null&&(e.effectTag&64)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Hc(e,i);else if(e.tag===19)Hc(e,i);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(ne(te,n),(t.mode&2)===0)t.memoizedState=null;else switch(r){case"forwards":for(i=t.child,r=null;i!==null;)e=i.alternate,e!==null&&ds(e)===null&&(r=i),i=i.sibling;i=r,i===null?(r=t.child,t.child=null):(r=i.sibling,i.sibling=null),xo(t,!1,r,i,s,t.lastEffect);break;case"backwards":for(i=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&ds(e)===null){t.child=r;break}e=r.sibling,r.sibling=i,i=r,r=e}xo(t,!0,i,null,s,t.lastEffect);break;case"together":xo(t,!1,null,null,void 0,t.lastEffect);break;default:t.memoizedState=null}return t.child}function Mt(e,t,i){e!==null&&(t.dependencies=e.dependencies);var n=t.expirationTime;if(n!==0&&Qs(n),t.childExpirationTime<i)return null;if(e!==null&&t.child!==e.child)throw Error(x(153));if(t.child!==null){for(e=t.child,i=Si(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=Si(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}var pf,xa,ff,gf;pf=function(e,t){for(var i=t.child;i!==null;){if(i.tag===5||i.tag===6)e.appendChild(i.stateNode);else if(i.tag!==4&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return;i=i.return}i.sibling.return=i.return,i=i.sibling}};xa=function(){};ff=function(e,t,i,n,r){var s=e.memoizedProps;if(s!==n){var o=t.stateNode;switch(si(ut.current),e=null,i){case"input":s=Qo(o,s),n=Qo(o,n),e=[];break;case"option":s=Go(o,s),n=Go(o,n),e=[];break;case"select":s=Ce({},s,{value:void 0}),n=Ce({},n,{value:void 0}),e=[];break;case"textarea":s=Xo(o,s),n=Xo(o,n),e=[];break;default:typeof s.onClick!="function"&&typeof n.onClick=="function"&&(o.onclick=ns)}ia(i,n);var a,l;i=null;for(a in s)if(!n.hasOwnProperty(a)&&s.hasOwnProperty(a)&&s[a]!=null)if(a==="style")for(l in o=s[a],o)o.hasOwnProperty(l)&&(i||(i={}),i[l]="");else a!=="dangerouslySetInnerHTML"&&a!=="children"&&a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(Fi.hasOwnProperty(a)?e||(e=[]):(e=e||[]).push(a,null));for(a in n){var u=n[a];if(o=s!=null?s[a]:void 0,n.hasOwnProperty(a)&&u!==o&&(u!=null||o!=null))if(a==="style")if(o){for(l in o)!o.hasOwnProperty(l)||u&&u.hasOwnProperty(l)||(i||(i={}),i[l]="");for(l in u)u.hasOwnProperty(l)&&o[l]!==u[l]&&(i||(i={}),i[l]=u[l])}else i||(e||(e=[]),e.push(a,i)),i=u;else a==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,o=o?o.__html:void 0,u!=null&&o!==u&&(e=e||[]).push(a,u)):a==="children"?o===u||typeof u!="string"&&typeof u!="number"||(e=e||[]).push(a,""+u):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&(Fi.hasOwnProperty(a)?(u!=null&&vt(r,a),e||o===u||(e=[])):(e=e||[]).push(a,u))}i&&(e=e||[]).push("style",i),r=e,(t.updateQueue=r)&&(t.effectTag|=4)}};gf=function(e,t,i,n){i!==n&&(t.effectTag|=4)};function br(e,t){switch(e.tailMode){case"hidden":t=e.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var n=null;i!==null;)i.alternate!==null&&(n=i),i=i.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Ax(e,t,i){var n=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 Te(t.type)&&os(),null;case 3:return Xi(),G(Ee),G(ve),i=t.stateNode,i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),e!==null&&e.child!==null||!Cr(t)||(t.effectTag|=4),xa(t),null;case 5:$l(t),i=si(Fn.current);var r=t.type;if(e!==null&&t.stateNode!=null)ff(e,t,r,n,i),e.ref!==t.ref&&(t.effectTag|=128);else{if(!n){if(t.stateNode===null)throw Error(x(166));return null}if(e=si(ut.current),Cr(t)){n=t.stateNode,r=t.type;var s=t.memoizedProps;switch(n[Vt]=t,n[rs]=s,r){case"iframe":case"object":case"embed":K("load",n);break;case"video":case"audio":for(e=0;e<mn.length;e++)K(mn[e],n);break;case"source":K("error",n);break;case"img":case"image":case"link":K("error",n),K("load",n);break;case"form":K("reset",n),K("submit",n);break;case"details":K("toggle",n);break;case"input":ic(n,s),K("invalid",n),vt(i,"onChange");break;case"select":n._wrapperState={wasMultiple:!!s.multiple},K("invalid",n),vt(i,"onChange");break;case"textarea":rc(n,s),K("invalid",n),vt(i,"onChange")}ia(r,s),e=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="children"?typeof a=="string"?n.textContent!==a&&(e=["children",a]):typeof a=="number"&&n.textContent!==""+a&&(e=["children",""+a]):Fi.hasOwnProperty(o)&&a!=null&&vt(i,o)}switch(r){case"input":gr(n),nc(n,s,!0);break;case"textarea":gr(n),sc(n);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(n.onclick=ns)}i=e,t.updateQueue=i,i!==null&&(t.effectTag|=4)}else{switch(o=i.nodeType===9?i:i.ownerDocument,e===dc&&(e=ap(r)),e===dc?r==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[Vt]=t,e[rs]=n,pf(e,t,!1,!1),t.stateNode=e,o=na(r,n),r){case"iframe":case"object":case"embed":K("load",e),a=n;break;case"video":case"audio":for(a=0;a<mn.length;a++)K(mn[a],e);a=n;break;case"source":K("error",e),a=n;break;case"img":case"image":case"link":K("error",e),K("load",e),a=n;break;case"form":K("reset",e),K("submit",e),a=n;break;case"details":K("toggle",e),a=n;break;case"input":ic(e,n),a=Qo(e,n),K("invalid",e),vt(i,"onChange");break;case"option":a=Go(e,n);break;case"select":e._wrapperState={wasMultiple:!!n.multiple},a=Ce({},n,{value:void 0}),K("invalid",e),vt(i,"onChange");break;case"textarea":rc(e,n),a=Xo(e,n),K("invalid",e),vt(i,"onChange");break;default:a=n}ia(r,a);var l=a;for(s in l)if(l.hasOwnProperty(s)){var u=l[s];s==="style"?Ap(e,u):s==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&lp(e,u)):s==="children"?typeof u=="string"?(r!=="textarea"||u!=="")&&Bn(e,u):typeof u=="number"&&Bn(e,""+u):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(Fi.hasOwnProperty(s)?u!=null&&vt(i,s):u!=null&&vl(e,s,u,o))}switch(r){case"input":gr(e),nc(e,n,!1);break;case"textarea":gr(e),sc(e);break;case"option":n.value!=null&&e.setAttribute("value",""+Xt(n.value));break;case"select":e.multiple=!!n.multiple,i=n.value,i!=null?Bi(e,!!n.multiple,i,!1):n.defaultValue!=null&&Bi(e,!!n.multiple,n.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=ns)}Np(r,n)&&(t.effectTag|=4)}t.ref!==null&&(t.effectTag|=128)}return null;case 6:if(e&&t.stateNode!=null)gf(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(x(166));i=si(Fn.current),si(ut.current),Cr(t)?(i=t.stateNode,n=t.memoizedProps,i[Vt]=t,i.nodeValue!==n&&(t.effectTag|=4)):(i=(i.nodeType===9?i:i.ownerDocument).createTextNode(n),i[Vt]=t,t.stateNode=i)}return null;case 13:return G(te),n=t.memoizedState,(t.effectTag&64)!==0?(t.expirationTime=i,t):(i=n!==null,n=!1,e===null?t.memoizedProps.fallback!==void 0&&Cr(t):(r=e.memoizedState,n=r!==null,i||r===null||(r=e.child.sibling,r!==null&&(s=t.firstEffect,s!==null?(t.firstEffect=r,r.nextEffect=s):(t.firstEffect=t.lastEffect=r,r.nextEffect=null),r.effectTag=8))),i&&!n&&(t.mode&2)!==0&&(e===null&&t.memoizedProps.unstable_avoidThisFallback!==!0||(te.current&1)!==0?ae===pi&&(ae=ws):((ae===pi||ae===ws)&&(ae=Ws),Zn!==0&&Re!==null&&(li(Re,ke),Vf(Re,Zn)))),(i||n)&&(t.effectTag|=4),null);case 4:return Xi(),xa(t),null;case 10:return Rl(t),null;case 17:return Te(t.type)&&os(),null;case 19:if(G(te),n=t.memoizedState,n===null)return null;if(r=(t.effectTag&64)!==0,s=n.rendering,s===null){if(r)br(n,!1);else if(ae!==pi||e!==null&&(e.effectTag&64)!==0)for(s=t.child;s!==null;){if(e=ds(s),e!==null){for(t.effectTag|=64,br(n,!1),r=e.updateQueue,r!==null&&(t.updateQueue=r,t.effectTag|=4),n.lastEffect===null&&(t.firstEffect=null),t.lastEffect=n.lastEffect,n=t.child;n!==null;)r=n,s=i,r.effectTag&=2,r.nextEffect=null,r.firstEffect=null,r.lastEffect=null,e=r.alternate,e===null?(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=s===null?null:{expirationTime:s.expirationTime,firstContext:s.firstContext,responders:s.responders}),n=n.sibling;return ne(te,te.current&1|2),t.child}s=s.sibling}}else{if(!r)if(e=ds(s),e!==null){if(t.effectTag|=64,r=!0,i=e.updateQueue,i!==null&&(t.updateQueue=i,t.effectTag|=4),br(n,!0),n.tail===null&&n.tailMode==="hidden"&&!s.alternate)return t=t.lastEffect=n.lastEffect,t!==null&&(t.nextEffect=null),null}else 2*$e()-n.renderingStartTime>n.tailExpiration&&1<i&&(t.effectTag|=64,r=!0,br(n,!1),t.expirationTime=t.childExpirationTime=i-1);n.isBackwards?(s.sibling=t.child,t.child=s):(i=n.last,i!==null?i.sibling=s:t.child=s,n.last=s)}return n.tail!==null?(n.tailExpiration===0&&(n.tailExpiration=$e()+500),i=n.tail,n.rendering=i,n.tail=i.sibling,n.lastEffect=t.lastEffect,n.renderingStartTime=$e(),i.sibling=null,t=te.current,ne(te,r?t&1|2:t&1),i):null}throw Error(x(156,t.tag))}function Ex(e){switch(e.tag){case 1:Te(e.type)&&os();var t=e.effectTag;return t&4096?(e.effectTag=t&-4097|64,e):null;case 3:if(Xi(),G(Ee),G(ve),t=e.effectTag,(t&64)!==0)throw Error(x(285));return e.effectTag=t&-4097|64,e;case 5:return $l(e),null;case 13:return G(te),t=e.effectTag,t&4096?(e.effectTag=t&-4097|64,e):null;case 19:return G(te),null;case 4:return Xi(),null;case 10:return Rl(e),null;default:return null}}function Yl(e,t){return{value:e,source:t,stack:xl(t)}}var Tx=typeof WeakSet=="function"?WeakSet:Set;function Sa(e,t){var i=t.source,n=t.stack;n===null&&i!==null&&(n=xl(i)),i!==null&&It(i.type),t=t.value,e!==null&&e.tag===1&&It(e.type);try{console.error(t)}catch(r){setTimeout(function(){throw r})}}function kx(e,t){try{t.props=e.memoizedProps,t.state=e.memoizedState,t.componentWillUnmount()}catch(i){gi(e,i)}}function Qc(e){var t=e.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(i){gi(e,i)}else t.current=null}function Nx(e,t){switch(t.tag){case 0:case 11:case 15:case 22:return;case 1:if(t.effectTag&256&&e!==null){var i=e.memoizedProps,n=e.memoizedState;e=t.stateNode,t=e.getSnapshotBeforeUpdate(t.elementType===t.type?i:Ye(t.type,i),n),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:case 5:case 6:case 4:case 17:return}throw Error(x(163))}function mf(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var i=t=t.next;do{if((i.tag&e)===e){var n=i.destroy;i.destroy=void 0,n!==void 0&&n()}i=i.next}while(i!==t)}}function vf(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var i=t=t.next;do{if((i.tag&e)===e){var n=i.create;i.destroy=n()}i=i.next}while(i!==t)}}function Px(e,t,i){switch(i.tag){case 0:case 11:case 15:case 22:vf(3,i);return;case 1:if(e=i.stateNode,i.effectTag&4)if(t===null)e.componentDidMount();else{var n=i.elementType===i.type?t.memoizedProps:Ye(i.type,t.memoizedProps);e.componentDidUpdate(n,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate)}t=i.updateQueue,t!==null&&Pc(i,t,e);return;case 3:if(t=i.updateQueue,t!==null){if(e=null,i.child!==null)switch(i.child.tag){case 5:e=i.child.stateNode;break;case 1:e=i.child.stateNode}Pc(i,t,e)}return;case 5:e=i.stateNode,t===null&&i.effectTag&4&&Np(i.type,i.memoizedProps)&&e.focus();return;case 6:return;case 4:return;case 12:return;case 13:i.memoizedState===null&&(i=i.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&Cp(i))));return;case 19:case 17:case 20:case 21:return}throw Error(x(163))}function Zc(e,t,i){switch(typeof ka=="function"&&ka(t),t.tag){case 0:case 11:case 14:case 15:case 22:if(e=t.updateQueue,e!==null&&(e=e.lastEffect,e!==null)){var n=e.next;Kt(97<i?97:i,function(){var r=n;do{var s=r.destroy;if(s!==void 0){var o=t;try{s()}catch(a){gi(o,a)}}r=r.next}while(r!==n)})}break;case 1:Qc(t),i=t.stateNode,typeof i.componentWillUnmount=="function"&&kx(t,i);break;case 5:Qc(t);break;case 4:yf(e,t,i)}}function wf(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,t!==null&&wf(t)}function Yc(e){return e.tag===5||e.tag===3||e.tag===4}function Gc(e){e:{for(var t=e.return;t!==null;){if(Yc(t)){var i=t;break e}t=t.return}throw Error(x(160))}switch(t=i.stateNode,i.tag){case 5:var n=!1;break;case 3:t=t.containerInfo,n=!0;break;case 4:t=t.containerInfo,n=!0;break;default:throw Error(x(161))}i.effectTag&16&&(Bn(t,""),i.effectTag&=-17);e:t:for(i=e;;){for(;i.sibling===null;){if(i.return===null||Yc(i.return)){i=null;break e}i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.effectTag&2||i.child===null||i.tag===4)continue t;i.child.return=i,i=i.child}if(!(i.effectTag&2)){i=i.stateNode;break e}}n?Ca(e,i,t):ba(e,i,t)}function Ca(e,t,i){var n=e.tag,r=n===5||n===6;if(r)e=r?e.stateNode:e.stateNode.instance,t?i.nodeType===8?i.parentNode.insertBefore(e,t):i.insertBefore(e,t):(i.nodeType===8?(t=i.parentNode,t.insertBefore(e,i)):(t=i,t.appendChild(e)),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=ns));else if(n!==4&&(e=e.child,e!==null))for(Ca(e,t,i),e=e.sibling;e!==null;)Ca(e,t,i),e=e.sibling}function ba(e,t,i){var n=e.tag,r=n===5||n===6;if(r)e=r?e.stateNode:e.stateNode.instance,t?i.insertBefore(e,t):i.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(ba(e,t,i),e=e.sibling;e!==null;)ba(e,t,i),e=e.sibling}function yf(e,t,i){for(var n=t,r=!1,s,o;;){if(!r){r=n.return;e:for(;;){if(r===null)throw Error(x(160));switch(s=r.stateNode,r.tag){case 5:o=!1;break e;case 3:s=s.containerInfo,o=!0;break e;case 4:s=s.containerInfo,o=!0;break e}r=r.return}r=!0}if(n.tag===5||n.tag===6){e:for(var a=e,l=n,u=i,h=l;;)if(Zc(a,h,u),h.child!==null&&h.tag!==4)h.child.return=h,h=h.child;else{if(h===l)break e;for(;h.sibling===null;){if(h.return===null||h.return===l)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}o?(a=s,l=n.stateNode,a.nodeType===8?a.parentNode.removeChild(l):a.removeChild(l)):s.removeChild(n.stateNode)}else if(n.tag===4){if(n.child!==null){s=n.stateNode.containerInfo,o=!0,n.child.return=n,n=n.child;continue}}else if(Zc(e,n,i),n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return,n.tag===4&&(r=!1)}n.sibling.return=n.return,n=n.sibling}}function So(e,t){switch(t.tag){case 0:case 11:case 14:case 15:case 22:mf(3,t);return;case 1:return;case 5:var i=t.stateNode;if(i!=null){var n=t.memoizedProps,r=e!==null?e.memoizedProps:n;e=t.type;var s=t.updateQueue;if(t.updateQueue=null,s!==null){for(i[rs]=n,e==="input"&&n.type==="radio"&&n.name!=null&&rp(i,n),na(e,r),t=na(e,n),r=0;r<s.length;r+=2){var o=s[r],a=s[r+1];o==="style"?Ap(i,a):o==="dangerouslySetInnerHTML"?lp(i,a):o==="children"?Bn(i,a):vl(i,o,a,t)}switch(e){case"input":Zo(i,n);break;case"textarea":sp(i,n);break;case"select":t=i._wrapperState.wasMultiple,i._wrapperState.wasMultiple=!!n.multiple,e=n.value,e!=null?Bi(i,!!n.multiple,e,!1):t!==!!n.multiple&&(n.defaultValue!=null?Bi(i,!!n.multiple,n.defaultValue,!0):Bi(i,!!n.multiple,n.multiple?[]:"",!1))}}}return;case 6:if(t.stateNode===null)throw Error(x(162));t.stateNode.nodeValue=t.memoizedProps;return;case 3:t=t.stateNode,t.hydrate&&(t.hydrate=!1,Cp(t.containerInfo));return;case 12:return;case 13:if(i=t,t.memoizedState===null?n=!1:(n=!0,i=t.child,Jl=$e()),i!==null)e:for(e=i;;){if(e.tag===5)s=e.stateNode,n?(s=s.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(s=e.stateNode,r=e.memoizedProps.style,r=r!=null&&r.hasOwnProperty("display")?r.display:null,s.style.display=Ip("display",r));else if(e.tag===6)e.stateNode.nodeValue=n?"":e.memoizedProps;else if(e.tag===13&&e.memoizedState!==null&&e.memoizedState.dehydrated===null){s=e.child.sibling,s.return=e,e=s;continue}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===i)break;for(;e.sibling===null;){if(e.return===null||e.return===i)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}Xc(t);return;case 19:Xc(t);return;case 17:return}throw Error(x(163))}function Xc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var i=e.stateNode;i===null&&(i=e.stateNode=new Tx),t.forEach(function(n){var r=$x.bind(null,e,n);i.has(n)||(i.add(n),n.then(r,r))})}}var zx=typeof WeakMap=="function"?WeakMap:Map;function xf(e,t,i){i=Ft(i,null),i.tag=3,i.payload={element:null};var n=t.value;return i.callback=function(){Ss||(Ss=!0,Ma=n),Sa(e,t)},i}function Sf(e,t,i){i=Ft(i,null),i.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var r=t.value;i.payload=function(){return Sa(e,t),n(r)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(i.callback=function(){typeof n!="function"&&(Zt===null?Zt=new Set([this]):Zt.add(this),Sa(e,t));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),i}var Dx=Math.ceil,ms=Xe.ReactCurrentDispatcher,Cf=Xe.ReactCurrentOwner,le=0,Gl=8,Je=16,dt=32,pi=0,vs=1,bf=2,ws=3,Ws=4,Xl=5,V=le,Re=null,R=null,ke=0,ae=pi,Hs=null,Ct=1073741823,Qn=1073741823,ys=null,Zn=0,xs=!1,Jl=0,Mf=500,N=null,Ss=!1,Ma=null,Zt=null,Cs=!1,zn=null,wn=90,oi=null,Dn=0,Ia=null,Ur=0;function ct(){return(V&(Je|dt))!==le?1073741821-($e()/10|0):Ur!==0?Ur:Ur=1073741821-($e()/10|0)}function fi(e,t,i){if(t=t.mode,(t&2)===0)return 1073741823;var n=$s();if((t&4)===0)return n===99?1073741823:1073741822;if((V&Je)!==le)return ke;if(i!==null)e=_r(e,i.timeoutMs|0||5e3,250);else switch(n){case 99:e=1073741823;break;case 98:e=_r(e,150,100);break;case 97:case 96:e=_r(e,5e3,250);break;case 95:e=2;break;default:throw Error(x(326))}return Re!==null&&e===ke&&--e,e}function Yt(e,t){if(50<Dn)throw Dn=0,Ia=null,Error(x(185));if(e=Fs(e,t),e!==null){var i=$s();t===1073741823?(V&Gl)!==le&&(V&(Je|dt))===le?Aa(e):(Be(e),V===le&&ht()):Be(e),(V&4)===le||i!==98&&i!==99||(oi===null?oi=new Map([[e,t]]):(i=oi.get(e),(i===void 0||i>t)&&oi.set(e,t)))}}function Fs(e,t){e.expirationTime<t&&(e.expirationTime=t);var i=e.alternate;i!==null&&i.expirationTime<t&&(i.expirationTime=t);var n=e.return,r=null;if(n===null&&e.tag===3)r=e.stateNode;else for(;n!==null;){if(i=n.alternate,n.childExpirationTime<t&&(n.childExpirationTime=t),i!==null&&i.childExpirationTime<t&&(i.childExpirationTime=t),n.return===null&&n.tag===3){r=n.stateNode;break}n=n.return}return r!==null&&(Re===r&&(Qs(t),ae===Ws&&li(r,ke)),Vf(r,t)),r}function Wr(e){var t=e.lastExpiredTime;if(t!==0||(t=e.firstPendingTime,!jf(e,t)))return t;var i=e.lastPingedTime;return e=e.nextKnownPendingLevel,e=i>e?i:e,2>=e&&t!==e?0:e}function Be(e){if(e.lastExpiredTime!==0)e.callbackExpirationTime=1073741823,e.callbackPriority=99,e.callbackNode=kc(Aa.bind(null,e));else{var t=Wr(e),i=e.callbackNode;if(t===0)i!==null&&(e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90);else{var n=ct();if(t===1073741823?n=99:t===1||t===2?n=95:(n=10*(1073741821-t)-10*(1073741821-n),n=0>=n?99:250>=n?98:5250>=n?97:95),i!==null){var r=e.callbackPriority;if(e.callbackExpirationTime===t&&r>=n)return;i!==Gp&&Hp(i)}e.callbackExpirationTime=t,e.callbackPriority=n,t=t===1073741823?kc(Aa.bind(null,e)):Jp(n,If.bind(null,e),{timeout:10*(1073741821-t)-$e()}),e.callbackNode=t}}}function If(e,t){if(Ur=0,t)return t=ct(),Na(e,t),Be(e),null;var i=Wr(e);if(i!==0){if(t=e.callbackNode,(V&(Je|dt))!==le)throw Error(x(327));if(en(),e===Re&&i===ke||ai(e,i),R!==null){var n=V;V|=Je;var r=kf();do try{Lx();break}catch(a){Tf(e,a)}while(1);if(Ll(),V=n,ms.current=r,ae===vs)throw t=Hs,ai(e,i),li(e,i),Be(e),t;if(R===null)switch(r=e.finishedWork=e.current.alternate,e.finishedExpirationTime=i,n=ae,Re=null,n){case pi:case vs:throw Error(x(345));case bf:Na(e,2<i?2:i);break;case ws:if(li(e,i),n=e.lastSuspendedTime,i===n&&(e.nextKnownPendingLevel=Ea(r)),Ct===1073741823&&(r=Jl+Mf-$e(),10<r)){if(xs){var s=e.lastPingedTime;if(s===0||s>=i){e.lastPingedTime=i,ai(e,i);break}}if(s=Wr(e),s!==0&&s!==i)break;if(n!==0&&n!==i){e.lastPingedTime=n;break}e.timeoutHandle=go(ii.bind(null,e),r);break}ii(e);break;case Ws:if(li(e,i),n=e.lastSuspendedTime,i===n&&(e.nextKnownPendingLevel=Ea(r)),xs&&(r=e.lastPingedTime,r===0||r>=i)){e.lastPingedTime=i,ai(e,i);break}if(r=Wr(e),r!==0&&r!==i)break;if(n!==0&&n!==i){e.lastPingedTime=n;break}if(Qn!==1073741823?n=10*(1073741821-Qn)-$e():Ct===1073741823?n=0:(n=10*(1073741821-Ct)-5e3,r=$e(),i=10*(1073741821-i)-r,n=r-n,0>n&&(n=0),n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Dx(n/1960))-n,i<n&&(n=i)),10<n){e.timeoutHandle=go(ii.bind(null,e),n);break}ii(e);break;case Xl:if(Ct!==1073741823&&ys!==null){s=Ct;var o=ys;if(n=o.busyMinDurationMs|0,0>=n?n=0:(r=o.busyDelayMs|0,s=$e()-(10*(1073741821-s)-(o.timeoutMs|0||5e3)),n=s<=r?0:r+n-s),10<n){li(e,i),e.timeoutHandle=go(ii.bind(null,e),n);break}}ii(e);break;default:throw Error(x(329))}if(Be(e),e.callbackNode===t)return If.bind(null,e)}}return null}function Aa(e){var t=e.lastExpiredTime;if(t=t!==0?t:1073741823,(V&(Je|dt))!==le)throw Error(x(327));if(en(),e===Re&&t===ke||ai(e,t),R!==null){var i=V;V|=Je;var n=kf();do try{Vx();break}catch(r){Tf(e,r)}while(1);if(Ll(),V=i,ms.current=n,ae===vs)throw i=Hs,ai(e,t),li(e,t),Be(e),i;if(R!==null)throw Error(x(261));e.finishedWork=e.current.alternate,e.finishedExpirationTime=t,Re=null,ii(e),Be(e)}return null}function jx(){if(oi!==null){var e=oi;oi=null,e.forEach(function(t,i){Na(i,t),Be(i)}),ht()}}function Af(e,t){var i=V;V|=1;try{return e(t)}finally{V=i,V===le&&ht()}}function Ef(e,t){var i=V;V&=-2,V|=Gl;try{return e(t)}finally{V=i,V===le&&ht()}}function ai(e,t){e.finishedWork=null,e.finishedExpirationTime=0;var i=e.timeoutHandle;if(i!==-1&&(e.timeoutHandle=-1,D0(i)),R!==null)for(i=R.return;i!==null;){var n=i;switch(n.tag){case 1:n=n.type.childContextTypes,n!=null&&os();break;case 3:Xi(),G(Ee),G(ve);break;case 5:$l(n);break;case 4:Xi();break;case 13:G(te);break;case 19:G(te);break;case 10:Rl(n)}i=i.return}Re=e,R=Si(e.current,null),ke=t,ae=pi,Hs=null,Qn=Ct=1073741823,ys=null,Zn=0,xs=!1}function Tf(e,t){do{try{if(Ll(),$r.current=gs,hs)for(var i=se.memoizedState;i!==null;){var n=i.queue;n!==null&&(n.pending=null),i=i.next}if(Rt=0,ge=fe=se=null,hs=!1,R===null||R.return===null)return ae=vs,Hs=t,R=null;e:{var r=e,s=R.return,o=R,a=t;if(t=ke,o.effectTag|=2048,o.firstEffect=o.lastEffect=null,a!==null&&typeof a=="object"&&typeof a.then=="function"){var l=a;if((o.mode&2)===0){var u=o.alternate;u?(o.updateQueue=u.updateQueue,o.memoizedState=u.memoizedState,o.expirationTime=u.expirationTime):(o.updateQueue=null,o.memoizedState=null)}var h=(te.current&1)!==0,p=s;do{var w;if(w=p.tag===13){var S=p.memoizedState;if(S!==null)w=S.dehydrated!==null;else{var I=p.memoizedProps;w=I.fallback===void 0?!1:I.unstable_avoidThisFallback!==!0?!0:!h}}if(w){var E=p.updateQueue;if(E===null){var c=new Set;c.add(l),p.updateQueue=c}else E.add(l);if((p.mode&2)===0){if(p.effectTag|=64,o.effectTag&=-2981,o.tag===1)if(o.alternate===null)o.tag=17;else{var d=Ft(1073741823,null);d.tag=2,Qt(o,d)}o.expirationTime=1073741823;break e}a=void 0,o=t;var f=r.pingCache;if(f===null?(f=r.pingCache=new zx,a=new Set,f.set(l,a)):(a=f.get(l),a===void 0&&(a=new Set,f.set(l,a))),!a.has(o)){a.add(o);var g=_x.bind(null,r,l,o);l.then(g,g)}p.effectTag|=4096,p.expirationTime=t;break e}p=p.return}while(p!==null);a=Error((It(o.type)||"A React component")+` suspended while rendering, but no fallback UI was specified.
150
+ */var Ls=bi.exports,xe=Th,ce=_h.exports;function S(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,i=1;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i]);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(!Ls)throw Error(S(227));function o0(e,t,i,n,r,s,o,a,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(i,u)}catch(h){this.onError(h)}}var An=!1,Kr=null,qr=!1,Uo=null,a0={onError:function(e){An=!0,Kr=e}};function l0(e,t,i,n,r,s,o,a,l){An=!1,Kr=null,o0.apply(a0,arguments)}function u0(e,t,i,n,r,s,o,a,l){if(l0.apply(this,arguments),An){if(An){var u=Kr;An=!1,Kr=null}else throw Error(S(198));qr||(qr=!0,Uo=u)}}var cl=null,Uh=null,Wh=null;function Gu(e,t,i){var n=e.type||"unknown-event";e.currentTarget=Wh(i),u0(n,t,void 0,e),e.currentTarget=null}var es=null,Ei={};function Hh(){if(es)for(var e in Ei){var t=Ei[e],i=es.indexOf(e);if(!(-1<i))throw Error(S(96,e));if(!ts[i]){if(!t.extractEvents)throw Error(S(97,e));ts[i]=t,i=t.eventTypes;for(var n in i){var r=void 0,s=i[n],o=t,a=n;if(Wo.hasOwnProperty(a))throw Error(S(99,a));Wo[a]=s;var l=s.phasedRegistrationNames;if(l){for(r in l)l.hasOwnProperty(r)&&Xu(l[r],o,a);r=!0}else s.registrationName?(Xu(s.registrationName,o,a),r=!0):r=!1;if(!r)throw Error(S(98,n,e))}}}}function Xu(e,t,i){if(Fi[e])throw Error(S(100,e));Fi[e]=t,dl[e]=t.eventTypes[i].dependencies}var ts=[],Wo={},Fi={},dl={};function Fh(e){var t=!1,i;for(i in e)if(e.hasOwnProperty(i)){var n=e[i];if(!Ei.hasOwnProperty(i)||Ei[i]!==n){if(Ei[i])throw Error(S(102,i));Ei[i]=n,t=!0}}t&&Hh()}var Kt=!(typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"),Ho=null,Vi=null,Ri=null;function Ju(e){if(e=Uh(e)){if(typeof Ho!="function")throw Error(S(280));var t=e.stateNode;t&&(t=cl(t),Ho(e.stateNode,e.type,t))}}function Qh(e){Vi?Ri?Ri.push(e):Ri=[e]:Vi=e}function Zh(){if(Vi){var e=Vi,t=Ri;if(Ri=Vi=null,Ju(e),t)for(e=0;e<t.length;e++)Ju(t[e])}}function hl(e,t){return e(t)}function Yh(e,t,i,n,r){return e(t,i,n,r)}function pl(){}var Gh=hl,ni=!1,uo=!1;function fl(){(Vi!==null||Ri!==null)&&(pl(),Zh())}function Xh(e,t,i){if(uo)return e(t,i);uo=!0;try{return Gh(e,t,i)}finally{uo=!1,fl()}}var c0=/^[: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]*$/,Ku=Object.prototype.hasOwnProperty,qu={},ec={};function d0(e){return Ku.call(ec,e)?!0:Ku.call(qu,e)?!1:c0.test(e)?ec[e]=!0:(qu[e]=!0,!1)}function h0(e,t,i,n){if(i!==null&&i.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:i!==null?!i.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function p0(e,t,i,n){if(t===null||typeof t=="undefined"||h0(e,t,i,n))return!0;if(n)return!1;if(i!==null)switch(i.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Se(e,t,i,n,r,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=r,this.mustUseProperty=i,this.propertyName=e,this.type=t,this.sanitizeURL=s}var de={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){de[e]=new Se(e,0,!1,e,null,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];de[t]=new Se(t,1,!1,e[1],null,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){de[e]=new Se(e,2,!1,e.toLowerCase(),null,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){de[e]=new Se(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){de[e]=new Se(e,3,!1,e.toLowerCase(),null,!1)});["checked","multiple","muted","selected"].forEach(function(e){de[e]=new Se(e,3,!0,e,null,!1)});["capture","download"].forEach(function(e){de[e]=new Se(e,4,!1,e,null,!1)});["cols","rows","size","span"].forEach(function(e){de[e]=new Se(e,6,!1,e,null,!1)});["rowSpan","start"].forEach(function(e){de[e]=new Se(e,5,!1,e.toLowerCase(),null,!1)});var gl=/[\-:]([a-z])/g;function ml(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(gl,ml);de[t]=new Se(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(gl,ml);de[t]=new Se(t,1,!1,e,"http://www.w3.org/1999/xlink",!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(gl,ml);de[t]=new Se(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1)});["tabIndex","crossOrigin"].forEach(function(e){de[e]=new Se(e,1,!1,e.toLowerCase(),null,!1)});de.xlinkHref=new Se("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0);["src","href","action","formAction"].forEach(function(e){de[e]=new Se(e,1,!1,e.toLowerCase(),null,!0)});var Je=Ls.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;Je.hasOwnProperty("ReactCurrentDispatcher")||(Je.ReactCurrentDispatcher={current:null});Je.hasOwnProperty("ReactCurrentBatchConfig")||(Je.ReactCurrentBatchConfig={suspense:null});function vl(e,t,i,n){var r=de.hasOwnProperty(t)?de[t]:null,s=r!==null?r.type===0:n?!1:!(!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N");s||(p0(t,i,r,n)&&(i=null),n||r===null?d0(t)&&(i===null?e.removeAttribute(t):e.setAttribute(t,""+i)):r.mustUseProperty?e[r.propertyName]=i===null?r.type===3?!1:"":i:(t=r.attributeName,n=r.attributeNamespace,i===null?e.removeAttribute(t):(r=r.type,i=r===3||r===4&&i===!0?"":""+i,n?e.setAttributeNS(n,t,i):e.setAttribute(t,i))))}var f0=/^(.*)[\\\/]/,Te=typeof Symbol=="function"&&Symbol.for,fr=Te?Symbol.for("react.element"):60103,Ti=Te?Symbol.for("react.portal"):60106,ii=Te?Symbol.for("react.fragment"):60107,Jh=Te?Symbol.for("react.strict_mode"):60108,Pr=Te?Symbol.for("react.profiler"):60114,Kh=Te?Symbol.for("react.provider"):60109,qh=Te?Symbol.for("react.context"):60110,g0=Te?Symbol.for("react.concurrent_mode"):60111,wl=Te?Symbol.for("react.forward_ref"):60112,zr=Te?Symbol.for("react.suspense"):60113,Fo=Te?Symbol.for("react.suspense_list"):60120,yl=Te?Symbol.for("react.memo"):60115,ep=Te?Symbol.for("react.lazy"):60116,tp=Te?Symbol.for("react.block"):60121,tc=typeof Symbol=="function"&&Symbol.iterator;function sn(e){return e===null||typeof e!="object"?null:(e=tc&&e[tc]||e["@@iterator"],typeof e=="function"?e:null)}function m0(e){if(e._status===-1){e._status=0;var t=e._ctor;t=t(),e._result=t,t.then(function(i){e._status===0&&(i=i.default,e._status=1,e._result=i)},function(i){e._status===0&&(e._status=2,e._result=i)})}}function Mt(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ii:return"Fragment";case Ti:return"Portal";case Pr:return"Profiler";case Jh:return"StrictMode";case zr:return"Suspense";case Fo:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case qh:return"Context.Consumer";case Kh:return"Context.Provider";case wl:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case yl:return Mt(e.type);case tp:return Mt(e.render);case ep:if(e=e._status===1?e._result:null)return Mt(e)}return null}function xl(e){var t="";do{e:switch(e.tag){case 3:case 4:case 6:case 7:case 10:case 9:var i="";break e;default:var n=e._debugOwner,r=e._debugSource,s=Mt(e.type);i=null,n&&(i=Mt(n.type)),n=s,s="",r?s=" (at "+r.fileName.replace(f0,"")+":"+r.lineNumber+")":i&&(s=" (created by "+i+")"),i=`
151
+ in `+(n||"Unknown")+s}t+=i,e=e.return}while(e);return t}function Yt(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function ip(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function v0(e){var t=ip(e)?"checked":"value",i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof i!="undefined"&&typeof i.get=="function"&&typeof i.set=="function"){var r=i.get,s=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(o){n=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function gr(e){e._valueTracker||(e._valueTracker=v0(e))}function np(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),n="";return e&&(n=ip(e)?e.checked?"true":"false":e.value),e=n,e!==i?(t.setValue(e),!0):!1}function Qo(e,t){var i=t.checked;return xe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:i!=null?i:e._wrapperState.initialChecked})}function ic(e,t){var i=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;i=Yt(t.value!=null?t.value:i),e._wrapperState={initialChecked:n,initialValue:i,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function rp(e,t){t=t.checked,t!=null&&vl(e,"checked",t,!1)}function Zo(e,t){rp(e,t);var i=Yt(t.value),n=t.type;if(i!=null)n==="number"?(i===0&&e.value===""||e.value!=i)&&(e.value=""+i):e.value!==""+i&&(e.value=""+i);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Yo(e,t.type,i):t.hasOwnProperty("defaultValue")&&Yo(e,t.type,Yt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function nc(e,t,i){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,i||t===e.value||(e.value=t),e.defaultValue=t}i=e.name,i!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,i!==""&&(e.name=i)}function Yo(e,t,i){(t!=="number"||e.ownerDocument.activeElement!==e)&&(i==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+i&&(e.defaultValue=""+i))}function w0(e){var t="";return Ls.Children.forEach(e,function(i){i!=null&&(t+=i)}),t}function Go(e,t){return e=xe({children:void 0},t),(t=w0(t.children))&&(e.children=t),e}function Bi(e,t,i,n){if(e=e.options,t){t={};for(var r=0;r<i.length;r++)t["$"+i[r]]=!0;for(i=0;i<e.length;i++)r=t.hasOwnProperty("$"+e[i].value),e[i].selected!==r&&(e[i].selected=r),r&&n&&(e[i].defaultSelected=!0)}else{for(i=""+Yt(i),t=null,r=0;r<e.length;r++){if(e[r].value===i){e[r].selected=!0,n&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function Xo(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(S(91));return xe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function rc(e,t){var i=t.value;if(i==null){if(i=t.children,t=t.defaultValue,i!=null){if(t!=null)throw Error(S(92));if(Array.isArray(i)){if(!(1>=i.length))throw Error(S(93));i=i[0]}t=i}t==null&&(t=""),i=t}e._wrapperState={initialValue:Yt(i)}}function sp(e,t){var i=Yt(t.value),n=Yt(t.defaultValue);i!=null&&(i=""+i,i!==e.value&&(e.value=i),t.defaultValue==null&&e.defaultValue!==i&&(e.defaultValue=i)),n!=null&&(e.defaultValue=""+n)}function sc(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}var op={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function ap(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 Jo(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?ap(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var mr,lp=function(e){return typeof MSApp!="undefined"&&MSApp.execUnsafeLocalFunction?function(t,i,n,r){MSApp.execUnsafeLocalFunction(function(){return e(t,i,n,r)})}:e}(function(e,t){if(e.namespaceURI!==op.svg||"innerHTML"in e)e.innerHTML=t;else{for(mr=mr||document.createElement("div"),mr.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=mr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Bn(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}function vr(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var ki={animationend:vr("Animation","AnimationEnd"),animationiteration:vr("Animation","AnimationIteration"),animationstart:vr("Animation","AnimationStart"),transitionend:vr("Transition","TransitionEnd")},co={},up={};Kt&&(up=document.createElement("div").style,"AnimationEvent"in window||(delete ki.animationend.animation,delete ki.animationiteration.animation,delete ki.animationstart.animation),"TransitionEvent"in window||delete ki.transitionend.transition);function Vs(e){if(co[e])return co[e];if(!ki[e])return e;var t=ki[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in up)return co[e]=t[i];return e}var cp=Vs("animationend"),dp=Vs("animationiteration"),hp=Vs("animationstart"),pp=Vs("transitionend"),mn="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),oc=new(typeof WeakMap=="function"?WeakMap:Map);function Sl(e){var t=oc.get(e);return t===void 0&&(t=new Map,oc.set(e,t)),t}function Mi(e){var t=e,i=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.effectTag&1026)!==0&&(i=t.return),e=t.return;while(e)}return t.tag===3?i:null}function fp(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function ac(e){if(Mi(e)!==e)throw Error(S(188))}function y0(e){var t=e.alternate;if(!t){if(t=Mi(e),t===null)throw Error(S(188));return t!==e?null:e}for(var i=e,n=t;;){var r=i.return;if(r===null)break;var s=r.alternate;if(s===null){if(n=r.return,n!==null){i=n;continue}break}if(r.child===s.child){for(s=r.child;s;){if(s===i)return ac(r),e;if(s===n)return ac(r),t;s=s.sibling}throw Error(S(188))}if(i.return!==n.return)i=r,n=s;else{for(var o=!1,a=r.child;a;){if(a===i){o=!0,i=r,n=s;break}if(a===n){o=!0,n=r,i=s;break}a=a.sibling}if(!o){for(a=s.child;a;){if(a===i){o=!0,i=s,n=r;break}if(a===n){o=!0,n=s,i=r;break}a=a.sibling}if(!o)throw Error(S(189))}}if(i.alternate!==n)throw Error(S(190))}if(i.tag!==3)throw Error(S(188));return i.stateNode.current===i?e:t}function gp(e){if(e=y0(e),!e)return null;for(var t=e;;){if(t.tag===5||t.tag===6)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 Qi(e,t){if(t==null)throw Error(S(30));return e==null?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 Cl(e,t,i){Array.isArray(e)?e.forEach(t,i):e&&t.call(i,e)}var on=null;function x0(e){if(e){var t=e._dispatchListeners,i=e._dispatchInstances;if(Array.isArray(t))for(var n=0;n<t.length&&!e.isPropagationStopped();n++)Gu(e,t[n],i[n]);else t&&Gu(e,t,i);e._dispatchListeners=null,e._dispatchInstances=null,e.isPersistent()||e.constructor.release(e)}}function Rs(e){if(e!==null&&(on=Qi(on,e)),e=on,on=null,e){if(Cl(e,x0),on)throw Error(S(95));if(qr)throw e=Uo,qr=!1,Uo=null,e}}function bl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}function mp(e){if(!Kt)return!1;e="on"+e;var t=e in document;return t||(t=document.createElement("div"),t.setAttribute(e,"return;"),t=typeof t[e]=="function"),t}var is=[];function vp(e){e.topLevelType=null,e.nativeEvent=null,e.targetInst=null,e.ancestors.length=0,10>is.length&&is.push(e)}function wp(e,t,i,n){if(is.length){var r=is.pop();return r.topLevelType=e,r.eventSystemFlags=n,r.nativeEvent=t,r.targetInst=i,r}return{topLevelType:e,eventSystemFlags:n,nativeEvent:t,targetInst:i,ancestors:[]}}function yp(e){var t=e.targetInst,i=t;do{if(!i){e.ancestors.push(i);break}var n=i;if(n.tag===3)n=n.stateNode.containerInfo;else{for(;n.return;)n=n.return;n=n.tag!==3?null:n.stateNode.containerInfo}if(!n)break;t=i.tag,t!==5&&t!==6||e.ancestors.push(i),i=tr(n)}while(i);for(i=0;i<e.ancestors.length;i++){t=e.ancestors[i];var r=bl(e.nativeEvent);n=e.topLevelType;var s=e.nativeEvent,o=e.eventSystemFlags;i===0&&(o|=64);for(var a=null,l=0;l<ts.length;l++){var u=ts[l];u&&(u=u.extractEvents(n,t,s,r,o))&&(a=Qi(a,u))}Rs(a)}}function Ko(e,t,i){if(!i.has(e)){switch(e){case"scroll":vn(t,"scroll",!0);break;case"focus":case"blur":vn(t,"focus",!0),vn(t,"blur",!0),i.set("blur",null),i.set("focus",null);break;case"cancel":case"close":mp(e)&&vn(t,e,!0);break;case"invalid":case"submit":case"reset":break;default:mn.indexOf(e)===-1&&X(e,t)}i.set(e,null)}}var xp,Ml,Sp,qo=!1,st=[],_t=null,$t=null,Ut=null,On=new Map,_n=new Map,an=[],ea="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(" "),S0="focus blur dragenter dragleave mouseover mouseout pointerover pointerout gotpointercapture lostpointercapture".split(" ");function C0(e,t){var i=Sl(t);ea.forEach(function(n){Ko(n,t,i)}),S0.forEach(function(n){Ko(n,t,i)})}function ta(e,t,i,n,r){return{blockedOn:e,topLevelType:t,eventSystemFlags:i|32,nativeEvent:r,container:n}}function lc(e,t){switch(e){case"focus":case"blur":_t=null;break;case"dragenter":case"dragleave":$t=null;break;case"mouseover":case"mouseout":Ut=null;break;case"pointerover":case"pointerout":On.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":_n.delete(t.pointerId)}}function ln(e,t,i,n,r,s){return e===null||e.nativeEvent!==s?(e=ta(t,i,n,r,s),t!==null&&(t=ir(t),t!==null&&Ml(t)),e):(e.eventSystemFlags|=n,e)}function b0(e,t,i,n,r){switch(t){case"focus":return _t=ln(_t,e,t,i,n,r),!0;case"dragenter":return $t=ln($t,e,t,i,n,r),!0;case"mouseover":return Ut=ln(Ut,e,t,i,n,r),!0;case"pointerover":var s=r.pointerId;return On.set(s,ln(On.get(s)||null,e,t,i,n,r)),!0;case"gotpointercapture":return s=r.pointerId,_n.set(s,ln(_n.get(s)||null,e,t,i,n,r)),!0}return!1}function M0(e){var t=tr(e.target);if(t!==null){var i=Mi(t);if(i!==null){if(t=i.tag,t===13){if(t=fp(i),t!==null){e.blockedOn=t,ce.unstable_runWithPriority(e.priority,function(){Sp(i)});return}}else if(t===3&&i.stateNode.hydrate){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Dr(e){if(e.blockedOn!==null)return!1;var t=El(e.topLevelType,e.eventSystemFlags,e.container,e.nativeEvent);if(t!==null){var i=ir(t);return i!==null&&Ml(i),e.blockedOn=t,!1}return!0}function uc(e,t,i){Dr(e)&&i.delete(t)}function I0(){for(qo=!1;0<st.length;){var e=st[0];if(e.blockedOn!==null){e=ir(e.blockedOn),e!==null&&xp(e);break}var t=El(e.topLevelType,e.eventSystemFlags,e.container,e.nativeEvent);t!==null?e.blockedOn=t:st.shift()}_t!==null&&Dr(_t)&&(_t=null),$t!==null&&Dr($t)&&($t=null),Ut!==null&&Dr(Ut)&&(Ut=null),On.forEach(uc),_n.forEach(uc)}function un(e,t){e.blockedOn===t&&(e.blockedOn=null,qo||(qo=!0,ce.unstable_scheduleCallback(ce.unstable_NormalPriority,I0)))}function Cp(e){function t(r){return un(r,e)}if(0<st.length){un(st[0],e);for(var i=1;i<st.length;i++){var n=st[i];n.blockedOn===e&&(n.blockedOn=null)}}for(_t!==null&&un(_t,e),$t!==null&&un($t,e),Ut!==null&&un(Ut,e),On.forEach(t),_n.forEach(t),i=0;i<an.length;i++)n=an[i],n.blockedOn===e&&(n.blockedOn=null);for(;0<an.length&&(i=an[0],i.blockedOn===null);)M0(i),i.blockedOn===null&&an.shift()}var bp={},Mp=new Map,Il=new Map,A0=["abort","abort",cp,"animationEnd",dp,"animationIteration",hp,"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",pp,"transitionEnd","waiting","waiting"];function Al(e,t){for(var i=0;i<e.length;i+=2){var n=e[i],r=e[i+1],s="on"+(r[0].toUpperCase()+r.slice(1));s={phasedRegistrationNames:{bubbled:s,captured:s+"Capture"},dependencies:[n],eventPriority:t},Il.set(n,t),Mp.set(n,s),bp[r]=s}}Al("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);Al("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);Al(A0,2);for(var cc="change selectionchange textInput compositionstart compositionend compositionupdate".split(" "),ho=0;ho<cc.length;ho++)Il.set(cc[ho],0);var E0=ce.unstable_UserBlockingPriority,T0=ce.unstable_runWithPriority,jr=!0;function X(e,t){vn(t,e,!1)}function vn(e,t,i){var n=Il.get(t);switch(n===void 0?2:n){case 0:n=k0.bind(null,t,1,e);break;case 1:n=N0.bind(null,t,1,e);break;default:n=Bs.bind(null,t,1,e)}i?e.addEventListener(t,n,!0):e.addEventListener(t,n,!1)}function k0(e,t,i,n){ni||pl();var r=Bs,s=ni;ni=!0;try{Yh(r,e,t,i,n)}finally{(ni=s)||fl()}}function N0(e,t,i,n){T0(E0,Bs.bind(null,e,t,i,n))}function Bs(e,t,i,n){if(jr)if(0<st.length&&-1<ea.indexOf(e))e=ta(null,e,t,i,n),st.push(e);else{var r=El(e,t,i,n);if(r===null)lc(e,n);else if(-1<ea.indexOf(e))e=ta(r,e,t,i,n),st.push(e);else if(!b0(r,e,t,i,n)){lc(e,n),e=wp(e,n,null,t);try{Xh(yp,e)}finally{vp(e)}}}}function El(e,t,i,n){if(i=bl(n),i=tr(i),i!==null){var r=Mi(i);if(r===null)i=null;else{var s=r.tag;if(s===13){if(i=fp(r),i!==null)return i;i=null}else if(s===3){if(r.stateNode.hydrate)return r.tag===3?r.stateNode.containerInfo:null;i=null}else r!==i&&(i=null)}}e=wp(e,n,i,t);try{Xh(yp,e)}finally{vp(e)}return null}var En={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},P0=["Webkit","ms","Moz","O"];Object.keys(En).forEach(function(e){P0.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),En[t]=En[e]})});function Ip(e,t,i){return t==null||typeof t=="boolean"||t===""?"":i||typeof t!="number"||t===0||En.hasOwnProperty(e)&&En[e]?(""+t).trim():t+"px"}function Ap(e,t){e=e.style;for(var i in t)if(t.hasOwnProperty(i)){var n=i.indexOf("--")===0,r=Ip(i,t[i],n);i==="float"&&(i="cssFloat"),n?e.setProperty(i,r):e[i]=r}}var z0=xe({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 ia(e,t){if(t){if(z0[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(S(137,e,""));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(S(60));if(!(typeof t.dangerouslySetInnerHTML=="object"&&"__html"in t.dangerouslySetInnerHTML))throw Error(S(61))}if(t.style!=null&&typeof t.style!="object")throw Error(S(62,""))}}function na(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 dc=op.html;function mt(e,t){e=e.nodeType===9||e.nodeType===11?e:e.ownerDocument;var i=Sl(e);t=dl[t];for(var n=0;n<t.length;n++)Ko(t[n],e,i)}function ns(){}function ra(e){if(e=e||(typeof document!="undefined"?document:void 0),typeof e=="undefined")return null;try{return e.activeElement||e.body}catch{return e.body}}function hc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function pc(e,t){var i=hc(e);e=0;for(var n;i;){if(i.nodeType===3){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=hc(i)}}function Ep(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ep(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function fc(){for(var e=window,t=ra();t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=ra(e.document)}return t}function sa(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Tp="$",kp="/$",Tl="$?",kl="$!",po=null,fo=null;function Np(e,t){switch(e){case"button":case"input":case"select":case"textarea":return!!t.autoFocus}return!1}function oa(e,t){return e==="textarea"||e==="option"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var go=typeof setTimeout=="function"?setTimeout:void 0,D0=typeof clearTimeout=="function"?clearTimeout:void 0;function Oi(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break}return e}function gc(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i===Tp||i===kl||i===Tl){if(t===0)return e;t--}else i===kp&&t++}e=e.previousSibling}return null}var Nl=Math.random().toString(36).slice(2),Dt="__reactInternalInstance$"+Nl,rs="__reactEventHandlers$"+Nl,er="__reactContainere$"+Nl;function tr(e){var t=e[Dt];if(t)return t;for(var i=e.parentNode;i;){if(t=i[er]||i[Dt]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=gc(e);e!==null;){if(i=e[Dt])return i;e=gc(e)}return t}e=i,i=e.parentNode}return null}function ir(e){return e=e[Dt]||e[er],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function vi(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(S(33))}function Pl(e){return e[rs]||null}function vt(e){do e=e.return;while(e&&e.tag!==5);return e||null}function Pp(e,t){var i=e.stateNode;if(!i)return null;var n=cl(i);if(!n)return null;i=n[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":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(S(231,t,typeof i));return i}function mc(e,t,i){(t=Pp(e,i.dispatchConfig.phasedRegistrationNames[t]))&&(i._dispatchListeners=Qi(i._dispatchListeners,t),i._dispatchInstances=Qi(i._dispatchInstances,e))}function j0(e){if(e&&e.dispatchConfig.phasedRegistrationNames){for(var t=e._targetInst,i=[];t;)i.push(t),t=vt(t);for(t=i.length;0<t--;)mc(i[t],"captured",e);for(t=0;t<i.length;t++)mc(i[t],"bubbled",e)}}function aa(e,t,i){e&&i&&i.dispatchConfig.registrationName&&(t=Pp(e,i.dispatchConfig.registrationName))&&(i._dispatchListeners=Qi(i._dispatchListeners,t),i._dispatchInstances=Qi(i._dispatchInstances,e))}function L0(e){e&&e.dispatchConfig.registrationName&&aa(e._targetInst,null,e)}function Zi(e){Cl(e,j0)}var jt=null,zl=null,Lr=null;function zp(){if(Lr)return Lr;var e,t=zl,i=t.length,n,r="value"in jt?jt.value:jt.textContent,s=r.length;for(e=0;e<i&&t[e]===r[e];e++);var o=i-e;for(n=1;n<=o&&t[i-n]===r[s-n];n++);return Lr=r.slice(e,1<n?1-n:void 0)}function Vr(){return!0}function ss(){return!1}function Be(e,t,i,n){this.dispatchConfig=e,this._targetInst=t,this.nativeEvent=i,e=this.constructor.Interface;for(var r in e)e.hasOwnProperty(r)&&((t=e[r])?this[r]=t(i):r==="target"?this.target=n:this[r]=i[r]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Vr:ss,this.isPropagationStopped=ss,this}xe(Be.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!="unknown"&&(e.returnValue=!1),this.isDefaultPrevented=Vr)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!="unknown"&&(e.cancelBubble=!0),this.isPropagationStopped=Vr)},persist:function(){this.isPersistent=Vr},isPersistent:ss,destructor:function(){var e=this.constructor.Interface,t;for(t in e)this[t]=null;this.nativeEvent=this._targetInst=this.dispatchConfig=null,this.isPropagationStopped=this.isDefaultPrevented=ss,this._dispatchInstances=this._dispatchListeners=null}});Be.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};Be.extend=function(e){function t(){}function i(){return n.apply(this,arguments)}var n=this;t.prototype=n.prototype;var r=new t;return xe(r,i.prototype),i.prototype=r,i.prototype.constructor=i,i.Interface=xe({},n.Interface,e),i.extend=n.extend,Dp(i),i};Dp(Be);function V0(e,t,i,n){if(this.eventPool.length){var r=this.eventPool.pop();return this.call(r,e,t,i,n),r}return new this(e,t,i,n)}function R0(e){if(!(e instanceof this))throw Error(S(279));e.destructor(),10>this.eventPool.length&&this.eventPool.push(e)}function Dp(e){e.eventPool=[],e.getPooled=V0,e.release=R0}var B0=Be.extend({data:null}),O0=Be.extend({data:null}),_0=[9,13,27,32],Dl=Kt&&"CompositionEvent"in window,Tn=null;Kt&&"documentMode"in document&&(Tn=document.documentMode);var $0=Kt&&"TextEvent"in window&&!Tn,jp=Kt&&(!Dl||Tn&&8<Tn&&11>=Tn),vc=String.fromCharCode(32),gt={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(" ")}},wc=!1;function Lp(e,t){switch(e){case"keyup":return _0.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function Vp(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ni=!1;function U0(e,t){switch(e){case"compositionend":return Vp(t);case"keypress":return t.which!==32?null:(wc=!0,vc);case"textInput":return e=t.data,e===vc&&wc?null:e;default:return null}}function W0(e,t){if(Ni)return e==="compositionend"||!Dl&&Lp(e,t)?(e=zp(),Lr=zl=jt=null,Ni=!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 jp&&t.locale!=="ko"?null:t.data;default:return null}}var H0={eventTypes:gt,extractEvents:function(e,t,i,n){var r;if(Dl)e:{switch(e){case"compositionstart":var s=gt.compositionStart;break e;case"compositionend":s=gt.compositionEnd;break e;case"compositionupdate":s=gt.compositionUpdate;break e}s=void 0}else Ni?Lp(e,i)&&(s=gt.compositionEnd):e==="keydown"&&i.keyCode===229&&(s=gt.compositionStart);return s?(jp&&i.locale!=="ko"&&(Ni||s!==gt.compositionStart?s===gt.compositionEnd&&Ni&&(r=zp()):(jt=n,zl="value"in jt?jt.value:jt.textContent,Ni=!0)),s=B0.getPooled(s,t,i,n),r?s.data=r:(r=Vp(i),r!==null&&(s.data=r)),Zi(s),r=s):r=null,(e=$0?U0(e,i):W0(e,i))?(t=O0.getPooled(gt.beforeInput,t,i,n),t.data=e,Zi(t)):t=null,r===null?t:t===null?r:[r,t]}},F0={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 Rp(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!F0[e.type]:t==="textarea"}var Bp={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:"blur change click focus input keydown keyup selectionchange".split(" ")}};function Op(e,t,i){return e=Be.getPooled(Bp.change,e,t,i),e.type="change",Qh(i),Zi(e),e}var kn=null,$n=null;function Q0(e){Rs(e)}function Os(e){var t=vi(e);if(np(t))return e}function Z0(e,t){if(e==="change")return t}var la=!1;Kt&&(la=mp("input")&&(!document.documentMode||9<document.documentMode));function yc(){kn&&(kn.detachEvent("onpropertychange",_p),$n=kn=null)}function _p(e){if(e.propertyName==="value"&&Os($n))if(e=Op($n,e,bl(e)),ni)Rs(e);else{ni=!0;try{hl(Q0,e)}finally{ni=!1,fl()}}}function Y0(e,t,i){e==="focus"?(yc(),kn=t,$n=i,kn.attachEvent("onpropertychange",_p)):e==="blur"&&yc()}function G0(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Os($n)}function X0(e,t){if(e==="click")return Os(t)}function J0(e,t){if(e==="input"||e==="change")return Os(t)}var K0={eventTypes:Bp,_isInputEventSupported:la,extractEvents:function(e,t,i,n){var r=t?vi(t):window,s=r.nodeName&&r.nodeName.toLowerCase();if(s==="select"||s==="input"&&r.type==="file")var o=Z0;else if(Rp(r))if(la)o=J0;else{o=G0;var a=Y0}else(s=r.nodeName)&&s.toLowerCase()==="input"&&(r.type==="checkbox"||r.type==="radio")&&(o=X0);if(o&&(o=o(e,t)))return Op(o,i,n);a&&a(e,r,t),e==="blur"&&(e=r._wrapperState)&&e.controlled&&r.type==="number"&&Yo(r,"number",r.value)}},nr=Be.extend({view:null,detail:null}),q0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ex(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=q0[e])?!!t[e]:!1}function jl(){return ex}var xc=0,Sc=0,Cc=!1,bc=!1,rr=nr.extend({screenX:null,screenY:null,clientX:null,clientY:null,pageX:null,pageY:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,getModifierState:jl,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=xc;return xc=e.screenX,Cc?e.type==="mousemove"?e.screenX-t:0:(Cc=!0,0)},movementY:function(e){if("movementY"in e)return e.movementY;var t=Sc;return Sc=e.screenY,bc?e.type==="mousemove"?e.screenY-t:0:(bc=!0,0)}}),$p=rr.extend({pointerId:null,width:null,height:null,pressure:null,tangentialPressure:null,tiltX:null,tiltY:null,twist:null,pointerType:null,isPrimary:null}),cn={mouseEnter:{registrationName:"onMouseEnter",dependencies:["mouseout","mouseover"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["mouseout","mouseover"]},pointerEnter:{registrationName:"onPointerEnter",dependencies:["pointerout","pointerover"]},pointerLeave:{registrationName:"onPointerLeave",dependencies:["pointerout","pointerover"]}},tx={eventTypes:cn,extractEvents:function(e,t,i,n,r){var s=e==="mouseover"||e==="pointerover",o=e==="mouseout"||e==="pointerout";if(s&&(r&32)===0&&(i.relatedTarget||i.fromElement)||!o&&!s)return null;if(s=n.window===n?n:(s=n.ownerDocument)?s.defaultView||s.parentWindow:window,o){if(o=t,t=(t=i.relatedTarget||i.toElement)?tr(t):null,t!==null){var a=Mi(t);(t!==a||t.tag!==5&&t.tag!==6)&&(t=null)}}else o=null;if(o===t)return null;if(e==="mouseout"||e==="mouseover")var l=rr,u=cn.mouseLeave,h=cn.mouseEnter,p="mouse";else(e==="pointerout"||e==="pointerover")&&(l=$p,u=cn.pointerLeave,h=cn.pointerEnter,p="pointer");if(e=o==null?s:vi(o),s=t==null?s:vi(t),u=l.getPooled(u,o,i,n),u.type=p+"leave",u.target=e,u.relatedTarget=s,i=l.getPooled(h,t,i,n),i.type=p+"enter",i.target=s,i.relatedTarget=e,n=o,p=t,n&&p)e:{for(l=n,h=p,o=0,e=l;e;e=vt(e))o++;for(e=0,t=h;t;t=vt(t))e++;for(;0<o-e;)l=vt(l),o--;for(;0<e-o;)h=vt(h),e--;for(;o--;){if(l===h||l===h.alternate)break e;l=vt(l),h=vt(h)}l=null}else l=null;for(h=l,l=[];n&&n!==h&&(o=n.alternate,!(o!==null&&o===h));)l.push(n),n=vt(n);for(n=[];p&&p!==h&&(o=p.alternate,!(o!==null&&o===h));)n.push(p),p=vt(p);for(p=0;p<l.length;p++)aa(l[p],"bubbled",u);for(p=n.length;0<p--;)aa(n[p],"captured",i);return(r&64)===0?[u]:[u,i]}};function ix(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var wi=typeof Object.is=="function"?Object.is:ix,nx=Object.prototype.hasOwnProperty;function Un(e,t){if(wi(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),n=Object.keys(t);if(i.length!==n.length)return!1;for(n=0;n<i.length;n++)if(!nx.call(t,i[n])||!wi(e[i[n]],t[i[n]]))return!1;return!0}var rx=Kt&&"documentMode"in document&&11>=document.documentMode,Up={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"blur contextmenu dragend focus keydown keyup mousedown mouseup selectionchange".split(" ")}},Pi=null,ua=null,Nn=null,ca=!1;function Mc(e,t){var i=t.window===t?t.document:t.nodeType===9?t:t.ownerDocument;return ca||Pi==null||Pi!==ra(i)?null:(i=Pi,"selectionStart"in i&&sa(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),Nn&&Un(Nn,i)?null:(Nn=i,e=Be.getPooled(Up.select,ua,e,t),e.type="select",e.target=Pi,Zi(e),e))}var sx={eventTypes:Up,extractEvents:function(e,t,i,n,r,s){if(r=s||(n.window===n?n.document:n.nodeType===9?n:n.ownerDocument),!(s=!r)){e:{r=Sl(r),s=dl.onSelect;for(var o=0;o<s.length;o++)if(!r.has(s[o])){r=!1;break e}r=!0}s=!r}if(s)return null;switch(r=t?vi(t):window,e){case"focus":(Rp(r)||r.contentEditable==="true")&&(Pi=r,ua=t,Nn=null);break;case"blur":Nn=ua=Pi=null;break;case"mousedown":ca=!0;break;case"contextmenu":case"mouseup":case"dragend":return ca=!1,Mc(i,n);case"selectionchange":if(rx)break;case"keydown":case"keyup":return Mc(i,n)}return null}},ox=Be.extend({animationName:null,elapsedTime:null,pseudoElement:null}),ax=Be.extend({clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),lx=nr.extend({relatedTarget:null});function Rr(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}var ux={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},cx={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"},dx=nr.extend({key:function(e){if(e.key){var t=ux[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Rr(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?cx[e.keyCode]||"Unidentified":""},location:null,ctrlKey:null,shiftKey:null,altKey:null,metaKey:null,repeat:null,locale:null,getModifierState:jl,charCode:function(e){return e.type==="keypress"?Rr(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Rr(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),hx=rr.extend({dataTransfer:null}),px=nr.extend({touches:null,targetTouches:null,changedTouches:null,altKey:null,metaKey:null,ctrlKey:null,shiftKey:null,getModifierState:jl}),fx=Be.extend({propertyName:null,elapsedTime:null,pseudoElement:null}),gx=rr.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}),mx={eventTypes:bp,extractEvents:function(e,t,i,n){var r=Mp.get(e);if(!r)return null;switch(e){case"keypress":if(Rr(i)===0)return null;case"keydown":case"keyup":e=dx;break;case"blur":case"focus":e=lx;break;case"click":if(i.button===2)return null;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":e=rr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":e=hx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":e=px;break;case cp:case dp:case hp:e=ox;break;case pp:e=fx;break;case"scroll":e=nr;break;case"wheel":e=gx;break;case"copy":case"cut":case"paste":e=ax;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":e=$p;break;default:e=Be}return t=e.getPooled(r,t,i,n),Zi(t),t}};if(es)throw Error(S(101));es=Array.prototype.slice.call("ResponderEventPlugin SimpleEventPlugin EnterLeaveEventPlugin ChangeEventPlugin SelectEventPlugin BeforeInputEventPlugin".split(" "));Hh();var vx=ir;cl=Pl;Uh=vx;Wh=vi;Fh({SimpleEventPlugin:mx,EnterLeaveEventPlugin:tx,ChangeEventPlugin:K0,SelectEventPlugin:sx,BeforeInputEventPlugin:H0});var da=[],zi=-1;function Y(e){0>zi||(e.current=da[zi],da[zi]=null,zi--)}function ie(e,t){zi++,da[zi]=e.current,e.current=t}var Gt={},me={current:Gt},Ie={current:!1},yi=Gt;function Yi(e,t){var i=e.type.contextTypes;if(!i)return Gt;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var r={},s;for(s in i)r[s]=t[s];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=r),r}function Ae(e){return e=e.childContextTypes,e!=null}function os(){Y(Ie),Y(me)}function Ic(e,t,i){if(me.current!==Gt)throw Error(S(168));ie(me,t),ie(Ie,i)}function Wp(e,t,i){var n=e.stateNode;if(e=t.childContextTypes,typeof n.getChildContext!="function")return i;n=n.getChildContext();for(var r in n)if(!(r in e))throw Error(S(108,Mt(t)||"Unknown",r));return xe({},i,{},n)}function Br(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Gt,yi=me.current,ie(me,e),ie(Ie,Ie.current),!0}function Ac(e,t,i){var n=e.stateNode;if(!n)throw Error(S(169));i?(e=Wp(e,t,yi),n.__reactInternalMemoizedMergedChildContext=e,Y(Ie),Y(me),ie(me,e)):Y(Ie),ie(Ie,i)}var wx=ce.unstable_runWithPriority,Ll=ce.unstable_scheduleCallback,Hp=ce.unstable_cancelCallback,Ec=ce.unstable_requestPaint,ha=ce.unstable_now,yx=ce.unstable_getCurrentPriorityLevel,_s=ce.unstable_ImmediatePriority,Fp=ce.unstable_UserBlockingPriority,Qp=ce.unstable_NormalPriority,Zp=ce.unstable_LowPriority,Yp=ce.unstable_IdlePriority,Gp={},xx=ce.unstable_shouldYield,Sx=Ec!==void 0?Ec:function(){},yt=null,Or=null,mo=!1,Tc=ha(),$e=1e4>Tc?ha:function(){return ha()-Tc};function $s(){switch(yx()){case _s:return 99;case Fp:return 98;case Qp:return 97;case Zp:return 96;case Yp:return 95;default:throw Error(S(332))}}function Xp(e){switch(e){case 99:return _s;case 98:return Fp;case 97:return Qp;case 96:return Zp;case 95:return Yp;default:throw Error(S(332))}}function Xt(e,t){return e=Xp(e),wx(e,t)}function Jp(e,t,i){return e=Xp(e),Ll(e,t,i)}function kc(e){return yt===null?(yt=[e],Or=Ll(_s,Kp)):yt.push(e),Gp}function dt(){if(Or!==null){var e=Or;Or=null,Hp(e)}Kp()}function Kp(){if(!mo&&yt!==null){mo=!0;var e=0;try{var t=yt;Xt(99,function(){for(;e<t.length;e++){var i=t[e];do i=i(!0);while(i!==null)}}),yt=null}catch(i){throw yt!==null&&(yt=yt.slice(e+1)),Ll(_s,dt),i}finally{mo=!1}}}function _r(e,t,i){return i/=10,1073741821-(((1073741821-e+t/10)/i|0)+1)*i}function Ge(e,t){if(e&&e.defaultProps){t=xe({},t),e=e.defaultProps;for(var i in e)t[i]===void 0&&(t[i]=e[i])}return t}var as={current:null},ls=null,Di=null,us=null;function Vl(){us=Di=ls=null}function Rl(e){var t=as.current;Y(as),e.type._context._currentValue=t}function qp(e,t){for(;e!==null;){var i=e.alternate;if(e.childExpirationTime<t)e.childExpirationTime=t,i!==null&&i.childExpirationTime<t&&(i.childExpirationTime=t);else if(i!==null&&i.childExpirationTime<t)i.childExpirationTime=t;else break;e=e.return}}function _i(e,t){ls=e,us=Di=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.expirationTime>=t&&(ot=!0),e.firstContext=null)}function We(e,t){if(us!==e&&t!==!1&&t!==0)if((typeof t!="number"||t===1073741823)&&(us=e,t=1073741823),t={context:e,observedBits:t,next:null},Di===null){if(ls===null)throw Error(S(308));Di=t,ls.dependencies={expirationTime:0,firstContext:t,responders:null}}else Di=Di.next=t;return e._currentValue}var Pt=!1;function Bl(e){e.updateQueue={baseState:e.memoizedState,baseQueue:null,shared:{pending:null},effects:null}}function Ol(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,baseQueue:e.baseQueue,shared:e.shared,effects:e.effects})}function Wt(e,t){return e={expirationTime:e,suspenseConfig:t,tag:0,payload:null,callback:null,next:null},e.next=e}function Ht(e,t){if(e=e.updateQueue,e!==null){e=e.shared;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}}function Nc(e,t){var i=e.alternate;i!==null&&Ol(i,e),e=e.updateQueue,i=e.baseQueue,i===null?(e.baseQueue=t.next=t,t.next=t):(t.next=i.next,i.next=t)}function Wn(e,t,i,n){var r=e.updateQueue;Pt=!1;var s=r.baseQueue,o=r.shared.pending;if(o!==null){if(s!==null){var a=s.next;s.next=o.next,o.next=a}s=o,r.shared.pending=null,a=e.alternate,a!==null&&(a=a.updateQueue,a!==null&&(a.baseQueue=o))}if(s!==null){a=s.next;var l=r.baseState,u=0,h=null,p=null,w=null;if(a!==null){var C=a;do{if(o=C.expirationTime,o<n){var E={expirationTime:C.expirationTime,suspenseConfig:C.suspenseConfig,tag:C.tag,payload:C.payload,callback:C.callback,next:null};w===null?(p=w=E,h=l):w=w.next=E,o>u&&(u=o)}else{w!==null&&(w=w.next={expirationTime:1073741823,suspenseConfig:C.suspenseConfig,tag:C.tag,payload:C.payload,callback:C.callback,next:null}),Nf(o,C.suspenseConfig);e:{var T=e,c=C;switch(o=t,E=i,c.tag){case 1:if(T=c.payload,typeof T=="function"){l=T.call(E,l,o);break e}l=T;break e;case 3:T.effectTag=T.effectTag&-4097|64;case 0:if(T=c.payload,o=typeof T=="function"?T.call(E,l,o):T,o==null)break e;l=xe({},l,o);break e;case 2:Pt=!0}}C.callback!==null&&(e.effectTag|=32,o=r.effects,o===null?r.effects=[C]:o.push(C))}if(C=C.next,C===null||C===a){if(o=r.shared.pending,o===null)break;C=s.next=o.next,o.next=a,r.baseQueue=s=o,r.shared.pending=null}}while(1)}w===null?h=l:w.next=p,r.baseState=h,r.baseQueue=w,Qs(u),e.expirationTime=u,e.memoizedState=l}}function Pc(e,t,i){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var n=e[t],r=n.callback;if(r!==null){if(n.callback=null,n=r,r=i,typeof n!="function")throw Error(S(191,n));n.call(r)}}}var Pn=Je.ReactCurrentBatchConfig,ef=new Ls.Component().refs;function cs(e,t,i,n){t=e.memoizedState,i=i(n,t),i=i==null?t:xe({},t,i),e.memoizedState=i,e.expirationTime===0&&(e.updateQueue.baseState=i)}var Us={isMounted:function(e){return(e=e._reactInternalFiber)?Mi(e)===e:!1},enqueueSetState:function(e,t,i){e=e._reactInternalFiber;var n=ut(),r=Pn.suspense;n=pi(n,e,r),r=Wt(n,r),r.payload=t,i!=null&&(r.callback=i),Ht(e,r),Qt(e,n)},enqueueReplaceState:function(e,t,i){e=e._reactInternalFiber;var n=ut(),r=Pn.suspense;n=pi(n,e,r),r=Wt(n,r),r.tag=1,r.payload=t,i!=null&&(r.callback=i),Ht(e,r),Qt(e,n)},enqueueForceUpdate:function(e,t){e=e._reactInternalFiber;var i=ut(),n=Pn.suspense;i=pi(i,e,n),n=Wt(i,n),n.tag=2,t!=null&&(n.callback=t),Ht(e,n),Qt(e,i)}};function zc(e,t,i,n,r,s,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,s,o):t.prototype&&t.prototype.isPureReactComponent?!Un(i,n)||!Un(r,s):!0}function tf(e,t,i){var n=!1,r=Gt,s=t.contextType;return typeof s=="object"&&s!==null?s=We(s):(r=Ae(t)?yi:me.current,n=t.contextTypes,s=(n=n!=null)?Yi(e,r):Gt),t=new t(i,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Us,e.stateNode=t,t._reactInternalFiber=e,n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=r,e.__reactInternalMemoizedMaskedChildContext=s),t}function Dc(e,t,i,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,n),t.state!==e&&Us.enqueueReplaceState(t,t.state,null)}function pa(e,t,i,n){var r=e.stateNode;r.props=i,r.state=e.memoizedState,r.refs=ef,Bl(e);var s=t.contextType;typeof s=="object"&&s!==null?r.context=We(s):(s=Ae(t)?yi:me.current,r.context=Yi(e,s)),Wn(e,i,r,n),r.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(cs(e,t,s,i),r.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(t=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),t!==r.state&&Us.enqueueReplaceState(r,r.state,null),Wn(e,i,r,n),r.state=e.memoizedState),typeof r.componentDidMount=="function"&&(e.effectTag|=4)}var wr=Array.isArray;function dn(e,t,i){if(e=i.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(i._owner){if(i=i._owner,i){if(i.tag!==1)throw Error(S(309));var n=i.stateNode}if(!n)throw Error(S(147,e));var r=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===r?t.ref:(t=function(s){var o=n.refs;o===ef&&(o=n.refs={}),s===null?delete o[r]:o[r]=s},t._stringRef=r,t)}if(typeof e!="string")throw Error(S(284));if(!i._owner)throw Error(S(290,e))}return e}function yr(e,t){if(e.type!=="textarea")throw Error(S(31,Object.prototype.toString.call(t)==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":t,""))}function nf(e){function t(c,d){if(e){var f=c.lastEffect;f!==null?(f.nextEffect=d,c.lastEffect=d):c.firstEffect=c.lastEffect=d,d.nextEffect=null,d.effectTag=8}}function i(c,d){if(!e)return null;for(;d!==null;)t(c,d),d=d.sibling;return null}function n(c,d){for(c=new Map;d!==null;)d.key!==null?c.set(d.key,d):c.set(d.index,d),d=d.sibling;return c}function r(c,d){return c=xi(c,d),c.index=0,c.sibling=null,c}function s(c,d,f){return c.index=f,e?(f=c.alternate,f!==null?(f=f.index,f<d?(c.effectTag=2,d):f):(c.effectTag=2,d)):d}function o(c){return e&&c.alternate===null&&(c.effectTag=2),c}function a(c,d,f,g){return d===null||d.tag!==6?(d=Co(f,c.mode,g),d.return=c,d):(d=r(d,f),d.return=c,d)}function l(c,d,f,g){return d!==null&&d.elementType===f.type?(g=r(d,f.props),g.ref=dn(c,d,f),g.return=c,g):(g=Hr(f.type,f.key,f.props,null,c.mode,g),g.ref=dn(c,d,f),g.return=c,g)}function u(c,d,f,g){return d===null||d.tag!==4||d.stateNode.containerInfo!==f.containerInfo||d.stateNode.implementation!==f.implementation?(d=bo(f,c.mode,g),d.return=c,d):(d=r(d,f.children||[]),d.return=c,d)}function h(c,d,f,g,m){return d===null||d.tag!==7?(d=Rt(f,c.mode,g,m),d.return=c,d):(d=r(d,f),d.return=c,d)}function p(c,d,f){if(typeof d=="string"||typeof d=="number")return d=Co(""+d,c.mode,f),d.return=c,d;if(typeof d=="object"&&d!==null){switch(d.$$typeof){case fr:return f=Hr(d.type,d.key,d.props,null,c.mode,f),f.ref=dn(c,null,d),f.return=c,f;case Ti:return d=bo(d,c.mode,f),d.return=c,d}if(wr(d)||sn(d))return d=Rt(d,c.mode,f,null),d.return=c,d;yr(c,d)}return null}function w(c,d,f,g){var m=d!==null?d.key:null;if(typeof f=="string"||typeof f=="number")return m!==null?null:a(c,d,""+f,g);if(typeof f=="object"&&f!==null){switch(f.$$typeof){case fr:return f.key===m?f.type===ii?h(c,d,f.props.children,g,m):l(c,d,f,g):null;case Ti:return f.key===m?u(c,d,f,g):null}if(wr(f)||sn(f))return m!==null?null:h(c,d,f,g,null);yr(c,f)}return null}function C(c,d,f,g,m){if(typeof g=="string"||typeof g=="number")return c=c.get(f)||null,a(d,c,""+g,m);if(typeof g=="object"&&g!==null){switch(g.$$typeof){case fr:return c=c.get(g.key===null?f:g.key)||null,g.type===ii?h(d,c,g.props.children,m,g.key):l(d,c,g,m);case Ti:return c=c.get(g.key===null?f:g.key)||null,u(d,c,g,m)}if(wr(g)||sn(g))return c=c.get(f)||null,h(d,c,g,m,null);yr(d,g)}return null}function E(c,d,f,g){for(var m=null,x=null,y=d,N=d=0,D=null;y!==null&&N<f.length;N++){y.index>N?(D=y,y=null):D=y.sibling;var P=w(c,y,f[N],g);if(P===null){y===null&&(y=D);break}e&&y&&P.alternate===null&&t(c,y),d=s(P,d,N),x===null?m=P:x.sibling=P,x=P,y=D}if(N===f.length)return i(c,y),m;if(y===null){for(;N<f.length;N++)y=p(c,f[N],g),y!==null&&(d=s(y,d,N),x===null?m=y:x.sibling=y,x=y);return m}for(y=n(c,y);N<f.length;N++)D=C(y,c,N,f[N],g),D!==null&&(e&&D.alternate!==null&&y.delete(D.key===null?N:D.key),d=s(D,d,N),x===null?m=D:x.sibling=D,x=D);return e&&y.forEach(function(J){return t(c,J)}),m}function T(c,d,f,g){var m=sn(f);if(typeof m!="function")throw Error(S(150));if(f=m.call(f),f==null)throw Error(S(151));for(var x=m=null,y=d,N=d=0,D=null,P=f.next();y!==null&&!P.done;N++,P=f.next()){y.index>N?(D=y,y=null):D=y.sibling;var J=w(c,y,P.value,g);if(J===null){y===null&&(y=D);break}e&&y&&J.alternate===null&&t(c,y),d=s(J,d,N),x===null?m=J:x.sibling=J,x=J,y=D}if(P.done)return i(c,y),m;if(y===null){for(;!P.done;N++,P=f.next())P=p(c,P.value,g),P!==null&&(d=s(P,d,N),x===null?m=P:x.sibling=P,x=P);return m}for(y=n(c,y);!P.done;N++,P=f.next())P=C(y,c,N,P.value,g),P!==null&&(e&&P.alternate!==null&&y.delete(P.key===null?N:P.key),d=s(P,d,N),x===null?m=P:x.sibling=P,x=P);return e&&y.forEach(function(q){return t(c,q)}),m}return function(c,d,f,g){var m=typeof f=="object"&&f!==null&&f.type===ii&&f.key===null;m&&(f=f.props.children);var x=typeof f=="object"&&f!==null;if(x)switch(f.$$typeof){case fr:e:{for(x=f.key,m=d;m!==null;){if(m.key===x){switch(m.tag){case 7:if(f.type===ii){i(c,m.sibling),d=r(m,f.props.children),d.return=c,c=d;break e}break;default:if(m.elementType===f.type){i(c,m.sibling),d=r(m,f.props),d.ref=dn(c,m,f),d.return=c,c=d;break e}}i(c,m);break}else t(c,m);m=m.sibling}f.type===ii?(d=Rt(f.props.children,c.mode,g,f.key),d.return=c,c=d):(g=Hr(f.type,f.key,f.props,null,c.mode,g),g.ref=dn(c,d,f),g.return=c,c=g)}return o(c);case Ti:e:{for(m=f.key;d!==null;){if(d.key===m)if(d.tag===4&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){i(c,d.sibling),d=r(d,f.children||[]),d.return=c,c=d;break e}else{i(c,d);break}else t(c,d);d=d.sibling}d=bo(f,c.mode,g),d.return=c,c=d}return o(c)}if(typeof f=="string"||typeof f=="number")return f=""+f,d!==null&&d.tag===6?(i(c,d.sibling),d=r(d,f),d.return=c,c=d):(i(c,d),d=Co(f,c.mode,g),d.return=c,c=d),o(c);if(wr(f))return E(c,d,f,g);if(sn(f))return T(c,d,f,g);if(x&&yr(c,f),typeof f=="undefined"&&!m)switch(c.tag){case 1:case 0:throw c=c.type,Error(S(152,c.displayName||c.name||"Component"))}return i(c,d)}}var Gi=nf(!0),_l=nf(!1),sr={},lt={current:sr},Hn={current:sr},Fn={current:sr};function ri(e){if(e===sr)throw Error(S(174));return e}function fa(e,t){switch(ie(Fn,t),ie(Hn,e),ie(lt,sr),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Jo(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Jo(t,e)}Y(lt),ie(lt,t)}function Xi(){Y(lt),Y(Hn),Y(Fn)}function jc(e){ri(Fn.current);var t=ri(lt.current),i=Jo(t,e.type);t!==i&&(ie(Hn,e),ie(lt,i))}function $l(e){Hn.current===e&&(Y(lt),Y(Hn))}var K={current:0};function ds(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||i.data===Tl||i.data===kl))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.effectTag&64)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}function Ul(e,t){return{responder:e,props:t}}var $r=Je.ReactCurrentDispatcher,Ue=Je.ReactCurrentBatchConfig,Lt=0,ne=null,pe=null,fe=null,hs=!1;function Ne(){throw Error(S(321))}function Wl(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!wi(e[i],t[i]))return!1;return!0}function Hl(e,t,i,n,r,s){if(Lt=s,ne=t,t.memoizedState=null,t.updateQueue=null,t.expirationTime=0,$r.current=e===null||e.memoizedState===null?Cx:bx,e=i(n,r),t.expirationTime===Lt){s=0;do{if(t.expirationTime=0,!(25>s))throw Error(S(301));s+=1,fe=pe=null,t.updateQueue=null,$r.current=Mx,e=i(n,r)}while(t.expirationTime===Lt)}if($r.current=gs,t=pe!==null&&pe.next!==null,Lt=0,fe=pe=ne=null,hs=!1,t)throw Error(S(300));return e}function $i(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return fe===null?ne.memoizedState=fe=e:fe=fe.next=e,fe}function qi(){if(pe===null){var e=ne.alternate;e=e!==null?e.memoizedState:null}else e=pe.next;var t=fe===null?ne.memoizedState:fe.next;if(t!==null)fe=t,pe=e;else{if(e===null)throw Error(S(310));pe=e,e={memoizedState:pe.memoizedState,baseState:pe.baseState,baseQueue:pe.baseQueue,queue:pe.queue,next:null},fe===null?ne.memoizedState=fe=e:fe=fe.next=e}return fe}function ci(e,t){return typeof t=="function"?t(e):t}function xr(e){var t=qi(),i=t.queue;if(i===null)throw Error(S(311));i.lastRenderedReducer=e;var n=pe,r=n.baseQueue,s=i.pending;if(s!==null){if(r!==null){var o=r.next;r.next=s.next,s.next=o}n.baseQueue=r=s,i.pending=null}if(r!==null){r=r.next,n=n.baseState;var a=o=s=null,l=r;do{var u=l.expirationTime;if(u<Lt){var h={expirationTime:l.expirationTime,suspenseConfig:l.suspenseConfig,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null};a===null?(o=a=h,s=n):a=a.next=h,u>ne.expirationTime&&(ne.expirationTime=u,Qs(u))}else a!==null&&(a=a.next={expirationTime:1073741823,suspenseConfig:l.suspenseConfig,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null}),Nf(u,l.suspenseConfig),n=l.eagerReducer===e?l.eagerState:e(n,l.action);l=l.next}while(l!==null&&l!==r);a===null?s=n:a.next=o,wi(n,t.memoizedState)||(ot=!0),t.memoizedState=n,t.baseState=s,t.baseQueue=a,i.lastRenderedState=n}return[t.memoizedState,i.dispatch]}function Sr(e){var t=qi(),i=t.queue;if(i===null)throw Error(S(311));i.lastRenderedReducer=e;var n=i.dispatch,r=i.pending,s=t.memoizedState;if(r!==null){i.pending=null;var o=r=r.next;do s=e(s,o.action),o=o.next;while(o!==r);wi(s,t.memoizedState)||(ot=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),i.lastRenderedState=s}return[s,n]}function vo(e){var t=$i();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e=t.queue={pending:null,dispatch:null,lastRenderedReducer:ci,lastRenderedState:e},e=e.dispatch=uf.bind(null,ne,e),[t.memoizedState,e]}function ga(e,t,i,n){return e={tag:e,create:t,destroy:i,deps:n,next:null},t=ne.updateQueue,t===null?(t={lastEffect:null},ne.updateQueue=t,t.lastEffect=e.next=e):(i=t.lastEffect,i===null?t.lastEffect=e.next=e:(n=i.next,i.next=e,e.next=n,t.lastEffect=e)),e}function rf(){return qi().memoizedState}function ma(e,t,i,n){var r=$i();ne.effectTag|=e,r.memoizedState=ga(1|t,i,void 0,n===void 0?null:n)}function Fl(e,t,i,n){var r=qi();n=n===void 0?null:n;var s=void 0;if(pe!==null){var o=pe.memoizedState;if(s=o.destroy,n!==null&&Wl(n,o.deps)){ga(t,i,s,n);return}}ne.effectTag|=e,r.memoizedState=ga(1|t,i,s,n)}function Lc(e,t){return ma(516,4,e,t)}function ps(e,t){return Fl(516,4,e,t)}function sf(e,t){return Fl(4,2,e,t)}function of(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function af(e,t,i){return i=i!=null?i.concat([e]):null,Fl(4,2,of.bind(null,t,e),i)}function Ql(){}function Vc(e,t){return $i().memoizedState=[e,t===void 0?null:t],e}function fs(e,t){var i=qi();t=t===void 0?null:t;var n=i.memoizedState;return n!==null&&t!==null&&Wl(t,n[1])?n[0]:(i.memoizedState=[e,t],e)}function lf(e,t){var i=qi();t=t===void 0?null:t;var n=i.memoizedState;return n!==null&&t!==null&&Wl(t,n[1])?n[0]:(e=e(),i.memoizedState=[e,t],e)}function Zl(e,t,i){var n=$s();Xt(98>n?98:n,function(){e(!0)}),Xt(97<n?97:n,function(){var r=Ue.suspense;Ue.suspense=t===void 0?null:t;try{e(!1),i()}finally{Ue.suspense=r}})}function uf(e,t,i){var n=ut(),r=Pn.suspense;n=pi(n,e,r),r={expirationTime:n,suspenseConfig:r,action:i,eagerReducer:null,eagerState:null,next:null};var s=t.pending;if(s===null?r.next=r:(r.next=s.next,s.next=r),t.pending=r,s=e.alternate,e===ne||s!==null&&s===ne)hs=!0,r.expirationTime=Lt,ne.expirationTime=Lt;else{if(e.expirationTime===0&&(s===null||s.expirationTime===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,a=s(o,i);if(r.eagerReducer=s,r.eagerState=a,wi(a,o))return}catch{}finally{}Qt(e,n)}}var gs={readContext:We,useCallback:Ne,useContext:Ne,useEffect:Ne,useImperativeHandle:Ne,useLayoutEffect:Ne,useMemo:Ne,useReducer:Ne,useRef:Ne,useState:Ne,useDebugValue:Ne,useResponder:Ne,useDeferredValue:Ne,useTransition:Ne},Cx={readContext:We,useCallback:Vc,useContext:We,useEffect:Lc,useImperativeHandle:function(e,t,i){return i=i!=null?i.concat([e]):null,ma(4,2,of.bind(null,t,e),i)},useLayoutEffect:function(e,t){return ma(4,2,e,t)},useMemo:function(e,t){var i=$i();return t=t===void 0?null:t,e=e(),i.memoizedState=[e,t],e},useReducer:function(e,t,i){var n=$i();return t=i!==void 0?i(t):t,n.memoizedState=n.baseState=t,e=n.queue={pending:null,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},e=e.dispatch=uf.bind(null,ne,e),[n.memoizedState,e]},useRef:function(e){var t=$i();return e={current:e},t.memoizedState=e},useState:vo,useDebugValue:Ql,useResponder:Ul,useDeferredValue:function(e,t){var i=vo(e),n=i[0],r=i[1];return Lc(function(){var s=Ue.suspense;Ue.suspense=t===void 0?null:t;try{r(e)}finally{Ue.suspense=s}},[e,t]),n},useTransition:function(e){var t=vo(!1),i=t[0];return t=t[1],[Vc(Zl.bind(null,t,e),[t,e]),i]}},bx={readContext:We,useCallback:fs,useContext:We,useEffect:ps,useImperativeHandle:af,useLayoutEffect:sf,useMemo:lf,useReducer:xr,useRef:rf,useState:function(){return xr(ci)},useDebugValue:Ql,useResponder:Ul,useDeferredValue:function(e,t){var i=xr(ci),n=i[0],r=i[1];return ps(function(){var s=Ue.suspense;Ue.suspense=t===void 0?null:t;try{r(e)}finally{Ue.suspense=s}},[e,t]),n},useTransition:function(e){var t=xr(ci),i=t[0];return t=t[1],[fs(Zl.bind(null,t,e),[t,e]),i]}},Mx={readContext:We,useCallback:fs,useContext:We,useEffect:ps,useImperativeHandle:af,useLayoutEffect:sf,useMemo:lf,useReducer:Sr,useRef:rf,useState:function(){return Sr(ci)},useDebugValue:Ql,useResponder:Ul,useDeferredValue:function(e,t){var i=Sr(ci),n=i[0],r=i[1];return ps(function(){var s=Ue.suspense;Ue.suspense=t===void 0?null:t;try{r(e)}finally{Ue.suspense=s}},[e,t]),n},useTransition:function(e){var t=Sr(ci),i=t[0];return t=t[1],[fs(Zl.bind(null,t,e),[t,e]),i]}},Ct=null,Vt=null,di=!1;function cf(e,t){var i=at(5,null,null,0);i.elementType="DELETED",i.type="DELETED",i.stateNode=t,i.return=e,i.effectTag=8,e.lastEffect!==null?(e.lastEffect.nextEffect=i,e.lastEffect=i):e.firstEffect=e.lastEffect=i}function Rc(e,t){switch(e.tag){case 5:var i=e.type;return t=t.nodeType!==1||i.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,!0):!1;case 13:return!1;default:return!1}}function va(e){if(di){var t=Vt;if(t){var i=t;if(!Rc(e,t)){if(t=Oi(i.nextSibling),!t||!Rc(e,t)){e.effectTag=e.effectTag&-1025|2,di=!1,Ct=e;return}cf(Ct,i)}Ct=e,Vt=Oi(t.firstChild)}else e.effectTag=e.effectTag&-1025|2,di=!1,Ct=e}}function Bc(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ct=e}function Cr(e){if(e!==Ct)return!1;if(!di)return Bc(e),di=!0,!1;var t=e.type;if(e.tag!==5||t!=="head"&&t!=="body"&&!oa(t,e.memoizedProps))for(t=Vt;t;)cf(e,t),t=Oi(t.nextSibling);if(Bc(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(S(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var i=e.data;if(i===kp){if(t===0){Vt=Oi(e.nextSibling);break e}t--}else i!==Tp&&i!==kl&&i!==Tl||t++}e=e.nextSibling}Vt=null}}else Vt=Ct?Oi(e.stateNode.nextSibling):null;return!0}function wo(){Vt=Ct=null,di=!1}var Ix=Je.ReactCurrentOwner,ot=!1;function Pe(e,t,i,n){t.child=e===null?_l(t,null,i,n):Gi(t,e.child,i,n)}function Oc(e,t,i,n,r){i=i.render;var s=t.ref;return _i(t,r),n=Hl(e,t,i,n,s,r),e!==null&&!ot?(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=r&&(e.expirationTime=0),bt(e,t,r)):(t.effectTag|=1,Pe(e,t,n,r),t.child)}function _c(e,t,i,n,r,s){if(e===null){var o=i.type;return typeof o=="function"&&!Kl(o)&&o.defaultProps===void 0&&i.compare===null&&i.defaultProps===void 0?(t.tag=15,t.type=o,df(e,t,o,n,r,s)):(e=Hr(i.type,null,n,null,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}return o=e.child,r<s&&(r=o.memoizedProps,i=i.compare,i=i!==null?i:Un,i(r,n)&&e.ref===t.ref)?bt(e,t,s):(t.effectTag|=1,e=xi(o,n),e.ref=t.ref,e.return=t,t.child=e)}function df(e,t,i,n,r,s){return e!==null&&Un(e.memoizedProps,n)&&e.ref===t.ref&&(ot=!1,r<s)?(t.expirationTime=e.expirationTime,bt(e,t,s)):wa(e,t,i,n,s)}function hf(e,t){var i=t.ref;(e===null&&i!==null||e!==null&&e.ref!==i)&&(t.effectTag|=128)}function wa(e,t,i,n,r){var s=Ae(i)?yi:me.current;return s=Yi(t,s),_i(t,r),i=Hl(e,t,i,n,s,r),e!==null&&!ot?(t.updateQueue=e.updateQueue,t.effectTag&=-517,e.expirationTime<=r&&(e.expirationTime=0),bt(e,t,r)):(t.effectTag|=1,Pe(e,t,i,r),t.child)}function $c(e,t,i,n,r){if(Ae(i)){var s=!0;Br(t)}else s=!1;if(_i(t,r),t.stateNode===null)e!==null&&(e.alternate=null,t.alternate=null,t.effectTag|=2),tf(t,i,n),pa(t,i,n,r),n=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var l=o.context,u=i.contextType;typeof u=="object"&&u!==null?u=We(u):(u=Ae(i)?yi:me.current,u=Yi(t,u));var h=i.getDerivedStateFromProps,p=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function";p||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==n||l!==u)&&Dc(t,o,n,u),Pt=!1;var w=t.memoizedState;o.state=w,Wn(t,n,o,r),l=t.memoizedState,a!==n||w!==l||Ie.current||Pt?(typeof h=="function"&&(cs(t,i,h,n),l=t.memoizedState),(a=Pt||zc(t,i,a,n,w,l,u))?(p||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.effectTag|=4)):(typeof o.componentDidMount=="function"&&(t.effectTag|=4),t.memoizedProps=n,t.memoizedState=l),o.props=n,o.state=l,o.context=u,n=a):(typeof o.componentDidMount=="function"&&(t.effectTag|=4),n=!1)}else o=t.stateNode,Ol(e,t),a=t.memoizedProps,o.props=t.type===t.elementType?a:Ge(t.type,a),l=o.context,u=i.contextType,typeof u=="object"&&u!==null?u=We(u):(u=Ae(i)?yi:me.current,u=Yi(t,u)),h=i.getDerivedStateFromProps,(p=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==n||l!==u)&&Dc(t,o,n,u),Pt=!1,l=t.memoizedState,o.state=l,Wn(t,n,o,r),w=t.memoizedState,a!==n||l!==w||Ie.current||Pt?(typeof h=="function"&&(cs(t,i,h,n),w=t.memoizedState),(h=Pt||zc(t,i,a,n,l,w,u))?(p||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,w,u),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,w,u)),typeof o.componentDidUpdate=="function"&&(t.effectTag|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.effectTag|=256)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&l===e.memoizedState||(t.effectTag|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&l===e.memoizedState||(t.effectTag|=256),t.memoizedProps=n,t.memoizedState=w),o.props=n,o.state=w,o.context=u,n=h):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&l===e.memoizedState||(t.effectTag|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&l===e.memoizedState||(t.effectTag|=256),n=!1);return ya(e,t,i,n,s,r)}function ya(e,t,i,n,r,s){hf(e,t);var o=(t.effectTag&64)!==0;if(!n&&!o)return r&&Ac(t,i,!1),bt(e,t,s);n=t.stateNode,Ix.current=t;var a=o&&typeof i.getDerivedStateFromError!="function"?null:n.render();return t.effectTag|=1,e!==null&&o?(t.child=Gi(t,e.child,null,s),t.child=Gi(t,null,a,s)):Pe(e,t,a,s),t.memoizedState=n.state,r&&Ac(t,i,!0),t.child}function Uc(e){var t=e.stateNode;t.pendingContext?Ic(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Ic(e,t.context,!1),fa(e,t.containerInfo)}var yo={dehydrated:null,retryTime:0};function Wc(e,t,i){var n=t.mode,r=t.pendingProps,s=K.current,o=!1,a;if((a=(t.effectTag&64)!==0)||(a=(s&2)!==0&&(e===null||e.memoizedState!==null)),a?(o=!0,t.effectTag&=-65):e!==null&&e.memoizedState===null||r.fallback===void 0||r.unstable_avoidThisFallback===!0||(s|=1),ie(K,s&1),e===null){if(r.fallback!==void 0&&va(t),o){if(o=r.fallback,r=Rt(null,n,0,null),r.return=t,(t.mode&2)===0)for(e=t.memoizedState!==null?t.child.child:t.child,r.child=e;e!==null;)e.return=r,e=e.sibling;return i=Rt(o,n,i,null),i.return=t,r.sibling=i,t.memoizedState=yo,t.child=r,i}return n=r.children,t.memoizedState=null,t.child=_l(t,null,n,i)}if(e.memoizedState!==null){if(e=e.child,n=e.sibling,o){if(r=r.fallback,i=xi(e,e.pendingProps),i.return=t,(t.mode&2)===0&&(o=t.memoizedState!==null?t.child.child:t.child,o!==e.child))for(i.child=o;o!==null;)o.return=i,o=o.sibling;return n=xi(n,r),n.return=t,i.sibling=n,i.childExpirationTime=0,t.memoizedState=yo,t.child=i,n}return i=Gi(t,e.child,r.children,i),t.memoizedState=null,t.child=i}if(e=e.child,o){if(o=r.fallback,r=Rt(null,n,0,null),r.return=t,r.child=e,e!==null&&(e.return=r),(t.mode&2)===0)for(e=t.memoizedState!==null?t.child.child:t.child,r.child=e;e!==null;)e.return=r,e=e.sibling;return i=Rt(o,n,i,null),i.return=t,r.sibling=i,i.effectTag|=2,r.childExpirationTime=0,t.memoizedState=yo,t.child=r,i}return t.memoizedState=null,t.child=Gi(t,e,r.children,i)}function Hc(e,t){e.expirationTime<t&&(e.expirationTime=t);var i=e.alternate;i!==null&&i.expirationTime<t&&(i.expirationTime=t),qp(e.return,t)}function xo(e,t,i,n,r,s){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:i,tailExpiration:0,tailMode:r,lastEffect:s}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=n,o.tail=i,o.tailExpiration=0,o.tailMode=r,o.lastEffect=s)}function Fc(e,t,i){var n=t.pendingProps,r=n.revealOrder,s=n.tail;if(Pe(e,t,n.children,i),n=K.current,(n&2)!==0)n=n&1|2,t.effectTag|=64;else{if(e!==null&&(e.effectTag&64)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Hc(e,i);else if(e.tag===19)Hc(e,i);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(ie(K,n),(t.mode&2)===0)t.memoizedState=null;else switch(r){case"forwards":for(i=t.child,r=null;i!==null;)e=i.alternate,e!==null&&ds(e)===null&&(r=i),i=i.sibling;i=r,i===null?(r=t.child,t.child=null):(r=i.sibling,i.sibling=null),xo(t,!1,r,i,s,t.lastEffect);break;case"backwards":for(i=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&ds(e)===null){t.child=r;break}e=r.sibling,r.sibling=i,i=r,r=e}xo(t,!0,i,null,s,t.lastEffect);break;case"together":xo(t,!1,null,null,void 0,t.lastEffect);break;default:t.memoizedState=null}return t.child}function bt(e,t,i){e!==null&&(t.dependencies=e.dependencies);var n=t.expirationTime;if(n!==0&&Qs(n),t.childExpirationTime<i)return null;if(e!==null&&t.child!==e.child)throw Error(S(153));if(t.child!==null){for(e=t.child,i=xi(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=xi(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}var pf,xa,ff,gf;pf=function(e,t){for(var i=t.child;i!==null;){if(i.tag===5||i.tag===6)e.appendChild(i.stateNode);else if(i.tag!==4&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return;i=i.return}i.sibling.return=i.return,i=i.sibling}};xa=function(){};ff=function(e,t,i,n,r){var s=e.memoizedProps;if(s!==n){var o=t.stateNode;switch(ri(lt.current),e=null,i){case"input":s=Qo(o,s),n=Qo(o,n),e=[];break;case"option":s=Go(o,s),n=Go(o,n),e=[];break;case"select":s=xe({},s,{value:void 0}),n=xe({},n,{value:void 0}),e=[];break;case"textarea":s=Xo(o,s),n=Xo(o,n),e=[];break;default:typeof s.onClick!="function"&&typeof n.onClick=="function"&&(o.onclick=ns)}ia(i,n);var a,l;i=null;for(a in s)if(!n.hasOwnProperty(a)&&s.hasOwnProperty(a)&&s[a]!=null)if(a==="style")for(l in o=s[a],o)o.hasOwnProperty(l)&&(i||(i={}),i[l]="");else a!=="dangerouslySetInnerHTML"&&a!=="children"&&a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&a!=="autoFocus"&&(Fi.hasOwnProperty(a)?e||(e=[]):(e=e||[]).push(a,null));for(a in n){var u=n[a];if(o=s!=null?s[a]:void 0,n.hasOwnProperty(a)&&u!==o&&(u!=null||o!=null))if(a==="style")if(o){for(l in o)!o.hasOwnProperty(l)||u&&u.hasOwnProperty(l)||(i||(i={}),i[l]="");for(l in u)u.hasOwnProperty(l)&&o[l]!==u[l]&&(i||(i={}),i[l]=u[l])}else i||(e||(e=[]),e.push(a,i)),i=u;else a==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,o=o?o.__html:void 0,u!=null&&o!==u&&(e=e||[]).push(a,u)):a==="children"?o===u||typeof u!="string"&&typeof u!="number"||(e=e||[]).push(a,""+u):a!=="suppressContentEditableWarning"&&a!=="suppressHydrationWarning"&&(Fi.hasOwnProperty(a)?(u!=null&&mt(r,a),e||o===u||(e=[])):(e=e||[]).push(a,u))}i&&(e=e||[]).push("style",i),r=e,(t.updateQueue=r)&&(t.effectTag|=4)}};gf=function(e,t,i,n){i!==n&&(t.effectTag|=4)};function br(e,t){switch(e.tailMode){case"hidden":t=e.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var n=null;i!==null;)i.alternate!==null&&(n=i),i=i.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Ax(e,t,i){var n=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 Ae(t.type)&&os(),null;case 3:return Xi(),Y(Ie),Y(me),i=t.stateNode,i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),e!==null&&e.child!==null||!Cr(t)||(t.effectTag|=4),xa(t),null;case 5:$l(t),i=ri(Fn.current);var r=t.type;if(e!==null&&t.stateNode!=null)ff(e,t,r,n,i),e.ref!==t.ref&&(t.effectTag|=128);else{if(!n){if(t.stateNode===null)throw Error(S(166));return null}if(e=ri(lt.current),Cr(t)){n=t.stateNode,r=t.type;var s=t.memoizedProps;switch(n[Dt]=t,n[rs]=s,r){case"iframe":case"object":case"embed":X("load",n);break;case"video":case"audio":for(e=0;e<mn.length;e++)X(mn[e],n);break;case"source":X("error",n);break;case"img":case"image":case"link":X("error",n),X("load",n);break;case"form":X("reset",n),X("submit",n);break;case"details":X("toggle",n);break;case"input":ic(n,s),X("invalid",n),mt(i,"onChange");break;case"select":n._wrapperState={wasMultiple:!!s.multiple},X("invalid",n),mt(i,"onChange");break;case"textarea":rc(n,s),X("invalid",n),mt(i,"onChange")}ia(r,s),e=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="children"?typeof a=="string"?n.textContent!==a&&(e=["children",a]):typeof a=="number"&&n.textContent!==""+a&&(e=["children",""+a]):Fi.hasOwnProperty(o)&&a!=null&&mt(i,o)}switch(r){case"input":gr(n),nc(n,s,!0);break;case"textarea":gr(n),sc(n);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(n.onclick=ns)}i=e,t.updateQueue=i,i!==null&&(t.effectTag|=4)}else{switch(o=i.nodeType===9?i:i.ownerDocument,e===dc&&(e=ap(r)),e===dc?r==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[Dt]=t,e[rs]=n,pf(e,t,!1,!1),t.stateNode=e,o=na(r,n),r){case"iframe":case"object":case"embed":X("load",e),a=n;break;case"video":case"audio":for(a=0;a<mn.length;a++)X(mn[a],e);a=n;break;case"source":X("error",e),a=n;break;case"img":case"image":case"link":X("error",e),X("load",e),a=n;break;case"form":X("reset",e),X("submit",e),a=n;break;case"details":X("toggle",e),a=n;break;case"input":ic(e,n),a=Qo(e,n),X("invalid",e),mt(i,"onChange");break;case"option":a=Go(e,n);break;case"select":e._wrapperState={wasMultiple:!!n.multiple},a=xe({},n,{value:void 0}),X("invalid",e),mt(i,"onChange");break;case"textarea":rc(e,n),a=Xo(e,n),X("invalid",e),mt(i,"onChange");break;default:a=n}ia(r,a);var l=a;for(s in l)if(l.hasOwnProperty(s)){var u=l[s];s==="style"?Ap(e,u):s==="dangerouslySetInnerHTML"?(u=u?u.__html:void 0,u!=null&&lp(e,u)):s==="children"?typeof u=="string"?(r!=="textarea"||u!=="")&&Bn(e,u):typeof u=="number"&&Bn(e,""+u):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(Fi.hasOwnProperty(s)?u!=null&&mt(i,s):u!=null&&vl(e,s,u,o))}switch(r){case"input":gr(e),nc(e,n,!1);break;case"textarea":gr(e),sc(e);break;case"option":n.value!=null&&e.setAttribute("value",""+Yt(n.value));break;case"select":e.multiple=!!n.multiple,i=n.value,i!=null?Bi(e,!!n.multiple,i,!1):n.defaultValue!=null&&Bi(e,!!n.multiple,n.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=ns)}Np(r,n)&&(t.effectTag|=4)}t.ref!==null&&(t.effectTag|=128)}return null;case 6:if(e&&t.stateNode!=null)gf(e,t,e.memoizedProps,n);else{if(typeof n!="string"&&t.stateNode===null)throw Error(S(166));i=ri(Fn.current),ri(lt.current),Cr(t)?(i=t.stateNode,n=t.memoizedProps,i[Dt]=t,i.nodeValue!==n&&(t.effectTag|=4)):(i=(i.nodeType===9?i:i.ownerDocument).createTextNode(n),i[Dt]=t,t.stateNode=i)}return null;case 13:return Y(K),n=t.memoizedState,(t.effectTag&64)!==0?(t.expirationTime=i,t):(i=n!==null,n=!1,e===null?t.memoizedProps.fallback!==void 0&&Cr(t):(r=e.memoizedState,n=r!==null,i||r===null||(r=e.child.sibling,r!==null&&(s=t.firstEffect,s!==null?(t.firstEffect=r,r.nextEffect=s):(t.firstEffect=t.lastEffect=r,r.nextEffect=null),r.effectTag=8))),i&&!n&&(t.mode&2)!==0&&(e===null&&t.memoizedProps.unstable_avoidThisFallback!==!0||(K.current&1)!==0?se===hi&&(se=ws):((se===hi||se===ws)&&(se=Ws),Zn!==0&&Le!==null&&(ai(Le,Ee),Lf(Le,Zn)))),(i||n)&&(t.effectTag|=4),null);case 4:return Xi(),xa(t),null;case 10:return Rl(t),null;case 17:return Ae(t.type)&&os(),null;case 19:if(Y(K),n=t.memoizedState,n===null)return null;if(r=(t.effectTag&64)!==0,s=n.rendering,s===null){if(r)br(n,!1);else if(se!==hi||e!==null&&(e.effectTag&64)!==0)for(s=t.child;s!==null;){if(e=ds(s),e!==null){for(t.effectTag|=64,br(n,!1),r=e.updateQueue,r!==null&&(t.updateQueue=r,t.effectTag|=4),n.lastEffect===null&&(t.firstEffect=null),t.lastEffect=n.lastEffect,n=t.child;n!==null;)r=n,s=i,r.effectTag&=2,r.nextEffect=null,r.firstEffect=null,r.lastEffect=null,e=r.alternate,e===null?(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=s===null?null:{expirationTime:s.expirationTime,firstContext:s.firstContext,responders:s.responders}),n=n.sibling;return ie(K,K.current&1|2),t.child}s=s.sibling}}else{if(!r)if(e=ds(s),e!==null){if(t.effectTag|=64,r=!0,i=e.updateQueue,i!==null&&(t.updateQueue=i,t.effectTag|=4),br(n,!0),n.tail===null&&n.tailMode==="hidden"&&!s.alternate)return t=t.lastEffect=n.lastEffect,t!==null&&(t.nextEffect=null),null}else 2*$e()-n.renderingStartTime>n.tailExpiration&&1<i&&(t.effectTag|=64,r=!0,br(n,!1),t.expirationTime=t.childExpirationTime=i-1);n.isBackwards?(s.sibling=t.child,t.child=s):(i=n.last,i!==null?i.sibling=s:t.child=s,n.last=s)}return n.tail!==null?(n.tailExpiration===0&&(n.tailExpiration=$e()+500),i=n.tail,n.rendering=i,n.tail=i.sibling,n.lastEffect=t.lastEffect,n.renderingStartTime=$e(),i.sibling=null,t=K.current,ie(K,r?t&1|2:t&1),i):null}throw Error(S(156,t.tag))}function Ex(e){switch(e.tag){case 1:Ae(e.type)&&os();var t=e.effectTag;return t&4096?(e.effectTag=t&-4097|64,e):null;case 3:if(Xi(),Y(Ie),Y(me),t=e.effectTag,(t&64)!==0)throw Error(S(285));return e.effectTag=t&-4097|64,e;case 5:return $l(e),null;case 13:return Y(K),t=e.effectTag,t&4096?(e.effectTag=t&-4097|64,e):null;case 19:return Y(K),null;case 4:return Xi(),null;case 10:return Rl(e),null;default:return null}}function Yl(e,t){return{value:e,source:t,stack:xl(t)}}var Tx=typeof WeakSet=="function"?WeakSet:Set;function Sa(e,t){var i=t.source,n=t.stack;n===null&&i!==null&&(n=xl(i)),i!==null&&Mt(i.type),t=t.value,e!==null&&e.tag===1&&Mt(e.type);try{console.error(t)}catch(r){setTimeout(function(){throw r})}}function kx(e,t){try{t.props=e.memoizedProps,t.state=e.memoizedState,t.componentWillUnmount()}catch(i){fi(e,i)}}function Qc(e){var t=e.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(i){fi(e,i)}else t.current=null}function Nx(e,t){switch(t.tag){case 0:case 11:case 15:case 22:return;case 1:if(t.effectTag&256&&e!==null){var i=e.memoizedProps,n=e.memoizedState;e=t.stateNode,t=e.getSnapshotBeforeUpdate(t.elementType===t.type?i:Ge(t.type,i),n),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:case 5:case 6:case 4:case 17:return}throw Error(S(163))}function mf(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var i=t=t.next;do{if((i.tag&e)===e){var n=i.destroy;i.destroy=void 0,n!==void 0&&n()}i=i.next}while(i!==t)}}function vf(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var i=t=t.next;do{if((i.tag&e)===e){var n=i.create;i.destroy=n()}i=i.next}while(i!==t)}}function Px(e,t,i){switch(i.tag){case 0:case 11:case 15:case 22:vf(3,i);return;case 1:if(e=i.stateNode,i.effectTag&4)if(t===null)e.componentDidMount();else{var n=i.elementType===i.type?t.memoizedProps:Ge(i.type,t.memoizedProps);e.componentDidUpdate(n,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate)}t=i.updateQueue,t!==null&&Pc(i,t,e);return;case 3:if(t=i.updateQueue,t!==null){if(e=null,i.child!==null)switch(i.child.tag){case 5:e=i.child.stateNode;break;case 1:e=i.child.stateNode}Pc(i,t,e)}return;case 5:e=i.stateNode,t===null&&i.effectTag&4&&Np(i.type,i.memoizedProps)&&e.focus();return;case 6:return;case 4:return;case 12:return;case 13:i.memoizedState===null&&(i=i.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&Cp(i))));return;case 19:case 17:case 20:case 21:return}throw Error(S(163))}function Zc(e,t,i){switch(typeof ka=="function"&&ka(t),t.tag){case 0:case 11:case 14:case 15:case 22:if(e=t.updateQueue,e!==null&&(e=e.lastEffect,e!==null)){var n=e.next;Xt(97<i?97:i,function(){var r=n;do{var s=r.destroy;if(s!==void 0){var o=t;try{s()}catch(a){fi(o,a)}}r=r.next}while(r!==n)})}break;case 1:Qc(t),i=t.stateNode,typeof i.componentWillUnmount=="function"&&kx(t,i);break;case 5:Qc(t);break;case 4:yf(e,t,i)}}function wf(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,t!==null&&wf(t)}function Yc(e){return e.tag===5||e.tag===3||e.tag===4}function Gc(e){e:{for(var t=e.return;t!==null;){if(Yc(t)){var i=t;break e}t=t.return}throw Error(S(160))}switch(t=i.stateNode,i.tag){case 5:var n=!1;break;case 3:t=t.containerInfo,n=!0;break;case 4:t=t.containerInfo,n=!0;break;default:throw Error(S(161))}i.effectTag&16&&(Bn(t,""),i.effectTag&=-17);e:t:for(i=e;;){for(;i.sibling===null;){if(i.return===null||Yc(i.return)){i=null;break e}i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.effectTag&2||i.child===null||i.tag===4)continue t;i.child.return=i,i=i.child}if(!(i.effectTag&2)){i=i.stateNode;break e}}n?Ca(e,i,t):ba(e,i,t)}function Ca(e,t,i){var n=e.tag,r=n===5||n===6;if(r)e=r?e.stateNode:e.stateNode.instance,t?i.nodeType===8?i.parentNode.insertBefore(e,t):i.insertBefore(e,t):(i.nodeType===8?(t=i.parentNode,t.insertBefore(e,i)):(t=i,t.appendChild(e)),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=ns));else if(n!==4&&(e=e.child,e!==null))for(Ca(e,t,i),e=e.sibling;e!==null;)Ca(e,t,i),e=e.sibling}function ba(e,t,i){var n=e.tag,r=n===5||n===6;if(r)e=r?e.stateNode:e.stateNode.instance,t?i.insertBefore(e,t):i.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(ba(e,t,i),e=e.sibling;e!==null;)ba(e,t,i),e=e.sibling}function yf(e,t,i){for(var n=t,r=!1,s,o;;){if(!r){r=n.return;e:for(;;){if(r===null)throw Error(S(160));switch(s=r.stateNode,r.tag){case 5:o=!1;break e;case 3:s=s.containerInfo,o=!0;break e;case 4:s=s.containerInfo,o=!0;break e}r=r.return}r=!0}if(n.tag===5||n.tag===6){e:for(var a=e,l=n,u=i,h=l;;)if(Zc(a,h,u),h.child!==null&&h.tag!==4)h.child.return=h,h=h.child;else{if(h===l)break e;for(;h.sibling===null;){if(h.return===null||h.return===l)break e;h=h.return}h.sibling.return=h.return,h=h.sibling}o?(a=s,l=n.stateNode,a.nodeType===8?a.parentNode.removeChild(l):a.removeChild(l)):s.removeChild(n.stateNode)}else if(n.tag===4){if(n.child!==null){s=n.stateNode.containerInfo,o=!0,n.child.return=n,n=n.child;continue}}else if(Zc(e,n,i),n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return,n.tag===4&&(r=!1)}n.sibling.return=n.return,n=n.sibling}}function So(e,t){switch(t.tag){case 0:case 11:case 14:case 15:case 22:mf(3,t);return;case 1:return;case 5:var i=t.stateNode;if(i!=null){var n=t.memoizedProps,r=e!==null?e.memoizedProps:n;e=t.type;var s=t.updateQueue;if(t.updateQueue=null,s!==null){for(i[rs]=n,e==="input"&&n.type==="radio"&&n.name!=null&&rp(i,n),na(e,r),t=na(e,n),r=0;r<s.length;r+=2){var o=s[r],a=s[r+1];o==="style"?Ap(i,a):o==="dangerouslySetInnerHTML"?lp(i,a):o==="children"?Bn(i,a):vl(i,o,a,t)}switch(e){case"input":Zo(i,n);break;case"textarea":sp(i,n);break;case"select":t=i._wrapperState.wasMultiple,i._wrapperState.wasMultiple=!!n.multiple,e=n.value,e!=null?Bi(i,!!n.multiple,e,!1):t!==!!n.multiple&&(n.defaultValue!=null?Bi(i,!!n.multiple,n.defaultValue,!0):Bi(i,!!n.multiple,n.multiple?[]:"",!1))}}}return;case 6:if(t.stateNode===null)throw Error(S(162));t.stateNode.nodeValue=t.memoizedProps;return;case 3:t=t.stateNode,t.hydrate&&(t.hydrate=!1,Cp(t.containerInfo));return;case 12:return;case 13:if(i=t,t.memoizedState===null?n=!1:(n=!0,i=t.child,Jl=$e()),i!==null)e:for(e=i;;){if(e.tag===5)s=e.stateNode,n?(s=s.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(s=e.stateNode,r=e.memoizedProps.style,r=r!=null&&r.hasOwnProperty("display")?r.display:null,s.style.display=Ip("display",r));else if(e.tag===6)e.stateNode.nodeValue=n?"":e.memoizedProps;else if(e.tag===13&&e.memoizedState!==null&&e.memoizedState.dehydrated===null){s=e.child.sibling,s.return=e,e=s;continue}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===i)break;for(;e.sibling===null;){if(e.return===null||e.return===i)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}Xc(t);return;case 19:Xc(t);return;case 17:return}throw Error(S(163))}function Xc(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var i=e.stateNode;i===null&&(i=e.stateNode=new Tx),t.forEach(function(n){var r=$x.bind(null,e,n);i.has(n)||(i.add(n),n.then(r,r))})}}var zx=typeof WeakMap=="function"?WeakMap:Map;function xf(e,t,i){i=Wt(i,null),i.tag=3,i.payload={element:null};var n=t.value;return i.callback=function(){Ss||(Ss=!0,Ma=n),Sa(e,t)},i}function Sf(e,t,i){i=Wt(i,null),i.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var r=t.value;i.payload=function(){return Sa(e,t),n(r)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(i.callback=function(){typeof n!="function"&&(Ft===null?Ft=new Set([this]):Ft.add(this),Sa(e,t));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),i}var Dx=Math.ceil,ms=Je.ReactCurrentDispatcher,Cf=Je.ReactCurrentOwner,oe=0,Gl=8,Ke=16,ct=32,hi=0,vs=1,bf=2,ws=3,Ws=4,Xl=5,L=oe,Le=null,R=null,Ee=0,se=hi,Hs=null,St=1073741823,Qn=1073741823,ys=null,Zn=0,xs=!1,Jl=0,Mf=500,z=null,Ss=!1,Ma=null,Ft=null,Cs=!1,zn=null,wn=90,si=null,Dn=0,Ia=null,Ur=0;function ut(){return(L&(Ke|ct))!==oe?1073741821-($e()/10|0):Ur!==0?Ur:Ur=1073741821-($e()/10|0)}function pi(e,t,i){if(t=t.mode,(t&2)===0)return 1073741823;var n=$s();if((t&4)===0)return n===99?1073741823:1073741822;if((L&Ke)!==oe)return Ee;if(i!==null)e=_r(e,i.timeoutMs|0||5e3,250);else switch(n){case 99:e=1073741823;break;case 98:e=_r(e,150,100);break;case 97:case 96:e=_r(e,5e3,250);break;case 95:e=2;break;default:throw Error(S(326))}return Le!==null&&e===Ee&&--e,e}function Qt(e,t){if(50<Dn)throw Dn=0,Ia=null,Error(S(185));if(e=Fs(e,t),e!==null){var i=$s();t===1073741823?(L&Gl)!==oe&&(L&(Ke|ct))===oe?Aa(e):(Ve(e),L===oe&&dt()):Ve(e),(L&4)===oe||i!==98&&i!==99||(si===null?si=new Map([[e,t]]):(i=si.get(e),(i===void 0||i>t)&&si.set(e,t)))}}function Fs(e,t){e.expirationTime<t&&(e.expirationTime=t);var i=e.alternate;i!==null&&i.expirationTime<t&&(i.expirationTime=t);var n=e.return,r=null;if(n===null&&e.tag===3)r=e.stateNode;else for(;n!==null;){if(i=n.alternate,n.childExpirationTime<t&&(n.childExpirationTime=t),i!==null&&i.childExpirationTime<t&&(i.childExpirationTime=t),n.return===null&&n.tag===3){r=n.stateNode;break}n=n.return}return r!==null&&(Le===r&&(Qs(t),se===Ws&&ai(r,Ee)),Lf(r,t)),r}function Wr(e){var t=e.lastExpiredTime;if(t!==0||(t=e.firstPendingTime,!jf(e,t)))return t;var i=e.lastPingedTime;return e=e.nextKnownPendingLevel,e=i>e?i:e,2>=e&&t!==e?0:e}function Ve(e){if(e.lastExpiredTime!==0)e.callbackExpirationTime=1073741823,e.callbackPriority=99,e.callbackNode=kc(Aa.bind(null,e));else{var t=Wr(e),i=e.callbackNode;if(t===0)i!==null&&(e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90);else{var n=ut();if(t===1073741823?n=99:t===1||t===2?n=95:(n=10*(1073741821-t)-10*(1073741821-n),n=0>=n?99:250>=n?98:5250>=n?97:95),i!==null){var r=e.callbackPriority;if(e.callbackExpirationTime===t&&r>=n)return;i!==Gp&&Hp(i)}e.callbackExpirationTime=t,e.callbackPriority=n,t=t===1073741823?kc(Aa.bind(null,e)):Jp(n,If.bind(null,e),{timeout:10*(1073741821-t)-$e()}),e.callbackNode=t}}}function If(e,t){if(Ur=0,t)return t=ut(),Na(e,t),Ve(e),null;var i=Wr(e);if(i!==0){if(t=e.callbackNode,(L&(Ke|ct))!==oe)throw Error(S(327));if(en(),e===Le&&i===Ee||oi(e,i),R!==null){var n=L;L|=Ke;var r=kf();do try{Vx();break}catch(a){Tf(e,a)}while(1);if(Vl(),L=n,ms.current=r,se===vs)throw t=Hs,oi(e,i),ai(e,i),Ve(e),t;if(R===null)switch(r=e.finishedWork=e.current.alternate,e.finishedExpirationTime=i,n=se,Le=null,n){case hi:case vs:throw Error(S(345));case bf:Na(e,2<i?2:i);break;case ws:if(ai(e,i),n=e.lastSuspendedTime,i===n&&(e.nextKnownPendingLevel=Ea(r)),St===1073741823&&(r=Jl+Mf-$e(),10<r)){if(xs){var s=e.lastPingedTime;if(s===0||s>=i){e.lastPingedTime=i,oi(e,i);break}}if(s=Wr(e),s!==0&&s!==i)break;if(n!==0&&n!==i){e.lastPingedTime=n;break}e.timeoutHandle=go(ti.bind(null,e),r);break}ti(e);break;case Ws:if(ai(e,i),n=e.lastSuspendedTime,i===n&&(e.nextKnownPendingLevel=Ea(r)),xs&&(r=e.lastPingedTime,r===0||r>=i)){e.lastPingedTime=i,oi(e,i);break}if(r=Wr(e),r!==0&&r!==i)break;if(n!==0&&n!==i){e.lastPingedTime=n;break}if(Qn!==1073741823?n=10*(1073741821-Qn)-$e():St===1073741823?n=0:(n=10*(1073741821-St)-5e3,r=$e(),i=10*(1073741821-i)-r,n=r-n,0>n&&(n=0),n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Dx(n/1960))-n,i<n&&(n=i)),10<n){e.timeoutHandle=go(ti.bind(null,e),n);break}ti(e);break;case Xl:if(St!==1073741823&&ys!==null){s=St;var o=ys;if(n=o.busyMinDurationMs|0,0>=n?n=0:(r=o.busyDelayMs|0,s=$e()-(10*(1073741821-s)-(o.timeoutMs|0||5e3)),n=s<=r?0:r+n-s),10<n){ai(e,i),e.timeoutHandle=go(ti.bind(null,e),n);break}}ti(e);break;default:throw Error(S(329))}if(Ve(e),e.callbackNode===t)return If.bind(null,e)}}return null}function Aa(e){var t=e.lastExpiredTime;if(t=t!==0?t:1073741823,(L&(Ke|ct))!==oe)throw Error(S(327));if(en(),e===Le&&t===Ee||oi(e,t),R!==null){var i=L;L|=Ke;var n=kf();do try{Lx();break}catch(r){Tf(e,r)}while(1);if(Vl(),L=i,ms.current=n,se===vs)throw i=Hs,oi(e,t),ai(e,t),Ve(e),i;if(R!==null)throw Error(S(261));e.finishedWork=e.current.alternate,e.finishedExpirationTime=t,Le=null,ti(e),Ve(e)}return null}function jx(){if(si!==null){var e=si;si=null,e.forEach(function(t,i){Na(i,t),Ve(i)}),dt()}}function Af(e,t){var i=L;L|=1;try{return e(t)}finally{L=i,L===oe&&dt()}}function Ef(e,t){var i=L;L&=-2,L|=Gl;try{return e(t)}finally{L=i,L===oe&&dt()}}function oi(e,t){e.finishedWork=null,e.finishedExpirationTime=0;var i=e.timeoutHandle;if(i!==-1&&(e.timeoutHandle=-1,D0(i)),R!==null)for(i=R.return;i!==null;){var n=i;switch(n.tag){case 1:n=n.type.childContextTypes,n!=null&&os();break;case 3:Xi(),Y(Ie),Y(me);break;case 5:$l(n);break;case 4:Xi();break;case 13:Y(K);break;case 19:Y(K);break;case 10:Rl(n)}i=i.return}Le=e,R=xi(e.current,null),Ee=t,se=hi,Hs=null,Qn=St=1073741823,ys=null,Zn=0,xs=!1}function Tf(e,t){do{try{if(Vl(),$r.current=gs,hs)for(var i=ne.memoizedState;i!==null;){var n=i.queue;n!==null&&(n.pending=null),i=i.next}if(Lt=0,fe=pe=ne=null,hs=!1,R===null||R.return===null)return se=vs,Hs=t,R=null;e:{var r=e,s=R.return,o=R,a=t;if(t=Ee,o.effectTag|=2048,o.firstEffect=o.lastEffect=null,a!==null&&typeof a=="object"&&typeof a.then=="function"){var l=a;if((o.mode&2)===0){var u=o.alternate;u?(o.updateQueue=u.updateQueue,o.memoizedState=u.memoizedState,o.expirationTime=u.expirationTime):(o.updateQueue=null,o.memoizedState=null)}var h=(K.current&1)!==0,p=s;do{var w;if(w=p.tag===13){var C=p.memoizedState;if(C!==null)w=C.dehydrated!==null;else{var E=p.memoizedProps;w=E.fallback===void 0?!1:E.unstable_avoidThisFallback!==!0?!0:!h}}if(w){var T=p.updateQueue;if(T===null){var c=new Set;c.add(l),p.updateQueue=c}else T.add(l);if((p.mode&2)===0){if(p.effectTag|=64,o.effectTag&=-2981,o.tag===1)if(o.alternate===null)o.tag=17;else{var d=Wt(1073741823,null);d.tag=2,Ht(o,d)}o.expirationTime=1073741823;break e}a=void 0,o=t;var f=r.pingCache;if(f===null?(f=r.pingCache=new zx,a=new Set,f.set(l,a)):(a=f.get(l),a===void 0&&(a=new Set,f.set(l,a))),!a.has(o)){a.add(o);var g=_x.bind(null,r,l,o);l.then(g,g)}p.effectTag|=4096,p.expirationTime=t;break e}p=p.return}while(p!==null);a=Error((Mt(o.type)||"A React component")+` suspended while rendering, but no fallback UI was specified.
152
152
 
153
- Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.`+xl(o))}ae!==Xl&&(ae=bf),a=Yl(a,o),p=s;do{switch(p.tag){case 3:l=a,p.effectTag|=4096,p.expirationTime=t;var m=xf(p,l,t);Nc(p,m);break e;case 1:l=a;var y=p.type,v=p.stateNode;if((p.effectTag&64)===0&&(typeof y.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Zt===null||!Zt.has(v)))){p.effectTag|=4096,p.expirationTime=t;var T=Sf(p,l,t);Nc(p,T);break e}}p=p.return}while(p!==null)}R=zf(R)}catch(D){t=D;continue}break}while(1)}function kf(){var e=ms.current;return ms.current=gs,e===null?gs:e}function Nf(e,t){e<Ct&&2<e&&(Ct=e),t!==null&&e<Qn&&2<e&&(Qn=e,ys=t)}function Qs(e){e>Zn&&(Zn=e)}function Vx(){for(;R!==null;)R=Pf(R)}function Lx(){for(;R!==null&&!xx();)R=Pf(R)}function Pf(e){var t=Df(e.alternate,e,ke);return e.memoizedProps=e.pendingProps,t===null&&(t=zf(e)),Cf.current=null,t}function zf(e){R=e;do{var t=R.alternate;if(e=R.return,(R.effectTag&2048)===0){if(t=Ax(t,R,ke),ke===1||R.childExpirationTime!==1){for(var i=0,n=R.child;n!==null;){var r=n.expirationTime,s=n.childExpirationTime;r>i&&(i=r),s>i&&(i=s),n=n.sibling}R.childExpirationTime=i}if(t!==null)return t;e!==null&&(e.effectTag&2048)===0&&(e.firstEffect===null&&(e.firstEffect=R.firstEffect),R.lastEffect!==null&&(e.lastEffect!==null&&(e.lastEffect.nextEffect=R.firstEffect),e.lastEffect=R.lastEffect),1<R.effectTag&&(e.lastEffect!==null?e.lastEffect.nextEffect=R:e.firstEffect=R,e.lastEffect=R))}else{if(t=Ex(R),t!==null)return t.effectTag&=2047,t;e!==null&&(e.firstEffect=e.lastEffect=null,e.effectTag|=2048)}if(t=R.sibling,t!==null)return t;R=e}while(R!==null);return ae===pi&&(ae=Xl),null}function Ea(e){var t=e.expirationTime;return e=e.childExpirationTime,t>e?t:e}function ii(e){var t=$s();return Kt(99,Rx.bind(null,e,t)),null}function Rx(e,t){do en();while(zn!==null);if((V&(Je|dt))!==le)throw Error(x(327));var i=e.finishedWork,n=e.finishedExpirationTime;if(i===null)return null;if(e.finishedWork=null,e.finishedExpirationTime=0,i===e.current)throw Error(x(177));e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90,e.nextKnownPendingLevel=0;var r=Ea(i);if(e.firstPendingTime=r,n<=e.lastSuspendedTime?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:n<=e.firstSuspendedTime&&(e.firstSuspendedTime=n-1),n<=e.lastPingedTime&&(e.lastPingedTime=0),n<=e.lastExpiredTime&&(e.lastExpiredTime=0),e===Re&&(R=Re=null,ke=0),1<i.effectTag?i.lastEffect!==null?(i.lastEffect.nextEffect=i,r=i.firstEffect):r=i:r=i.firstEffect,r!==null){var s=V;V|=dt,Cf.current=null,po=jr;var o=fc();if(sa(o)){if("selectionStart"in o)var a={start:o.selectionStart,end:o.selectionEnd};else e:{a=(a=o.ownerDocument)&&a.defaultView||window;var l=a.getSelection&&a.getSelection();if(l&&l.rangeCount!==0){a=l.anchorNode;var u=l.anchorOffset,h=l.focusNode;l=l.focusOffset;try{a.nodeType,h.nodeType}catch{a=null;break e}var p=0,w=-1,S=-1,I=0,E=0,c=o,d=null;t:for(;;){for(var f;c!==a||u!==0&&c.nodeType!==3||(w=p+u),c!==h||l!==0&&c.nodeType!==3||(S=p+l),c.nodeType===3&&(p+=c.nodeValue.length),(f=c.firstChild)!==null;)d=c,c=f;for(;;){if(c===o)break t;if(d===a&&++I===u&&(w=p),d===h&&++E===l&&(S=p),(f=c.nextSibling)!==null)break;c=d,d=c.parentNode}c=f}a=w===-1||S===-1?null:{start:w,end:S}}else a=null}a=a||{start:0,end:0}}else a=null;fo={activeElementDetached:null,focusedElem:o,selectionRange:a},jr=!1,N=r;do try{Bx()}catch(k){if(N===null)throw Error(x(330));gi(N,k),N=N.nextEffect}while(N!==null);N=r;do try{for(o=e,a=t;N!==null;){var g=N.effectTag;if(g&16&&Bn(N.stateNode,""),g&128){var m=N.alternate;if(m!==null){var y=m.ref;y!==null&&(typeof y=="function"?y(null):y.current=null)}}switch(g&1038){case 2:Gc(N),N.effectTag&=-3;break;case 6:Gc(N),N.effectTag&=-3,So(N.alternate,N);break;case 1024:N.effectTag&=-1025;break;case 1028:N.effectTag&=-1025,So(N.alternate,N);break;case 4:So(N.alternate,N);break;case 8:u=N,yf(o,u,a),wf(u)}N=N.nextEffect}}catch(k){if(N===null)throw Error(x(330));gi(N,k),N=N.nextEffect}while(N!==null);if(y=fo,m=fc(),g=y.focusedElem,a=y.selectionRange,m!==g&&g&&g.ownerDocument&&Ep(g.ownerDocument.documentElement,g)){for(a!==null&&sa(g)&&(m=a.start,y=a.end,y===void 0&&(y=m),"selectionStart"in g?(g.selectionStart=m,g.selectionEnd=Math.min(y,g.value.length)):(y=(m=g.ownerDocument||document)&&m.defaultView||window,y.getSelection&&(y=y.getSelection(),u=g.textContent.length,o=Math.min(a.start,u),a=a.end===void 0?o:Math.min(a.end,u),!y.extend&&o>a&&(u=a,a=o,o=u),u=pc(g,o),h=pc(g,a),u&&h&&(y.rangeCount!==1||y.anchorNode!==u.node||y.anchorOffset!==u.offset||y.focusNode!==h.node||y.focusOffset!==h.offset)&&(m=m.createRange(),m.setStart(u.node,u.offset),y.removeAllRanges(),o>a?(y.addRange(m),y.extend(h.node,h.offset)):(m.setEnd(h.node,h.offset),y.addRange(m)))))),m=[],y=g;y=y.parentNode;)y.nodeType===1&&m.push({element:y,left:y.scrollLeft,top:y.scrollTop});for(typeof g.focus=="function"&&g.focus(),g=0;g<m.length;g++)y=m[g],y.element.scrollLeft=y.left,y.element.scrollTop=y.top}jr=!!po,fo=po=null,e.current=i,N=r;do try{for(g=e;N!==null;){var v=N.effectTag;if(v&36&&Px(g,N.alternate,N),v&128){m=void 0;var T=N.ref;if(T!==null){var D=N.stateNode;switch(N.tag){case 5:m=D;break;default:m=D}typeof T=="function"?T(m):T.current=m}}N=N.nextEffect}}catch(k){if(N===null)throw Error(x(330));gi(N,k),N=N.nextEffect}while(N!==null);N=null,Sx(),V=s}else e.current=i;if(Cs)Cs=!1,zn=e,wn=t;else for(N=r;N!==null;)t=N.nextEffect,N.nextEffect=null,N=t;if(t=e.firstPendingTime,t===0&&(Zt=null),t===1073741823?e===Ia?Dn++:(Dn=0,Ia=e):Dn=0,typeof Ta=="function"&&Ta(i.stateNode,n),Be(e),Ss)throw Ss=!1,e=Ma,Ma=null,e;return(V&Gl)!==le||ht(),null}function Bx(){for(;N!==null;){var e=N.effectTag;(e&256)!==0&&Nx(N.alternate,N),(e&512)===0||Cs||(Cs=!0,Jp(97,function(){return en(),null})),N=N.nextEffect}}function en(){if(wn!==90){var e=97<wn?97:wn;return wn=90,Kt(e,Ox)}}function Ox(){if(zn===null)return!1;var e=zn;if(zn=null,(V&(Je|dt))!==le)throw Error(x(331));var t=V;for(V|=dt,e=e.current.firstEffect;e!==null;){try{var i=e;if((i.effectTag&512)!==0)switch(i.tag){case 0:case 11:case 15:case 22:mf(5,i),vf(5,i)}}catch(n){if(e===null)throw Error(x(330));gi(e,n)}i=e.nextEffect,e.nextEffect=null,e=i}return V=t,ht(),!0}function Jc(e,t,i){t=Yl(i,t),t=xf(e,t,1073741823),Qt(e,t),e=Fs(e,1073741823),e!==null&&Be(e)}function gi(e,t){if(e.tag===3)Jc(e,e,t);else for(var i=e.return;i!==null;){if(i.tag===3){Jc(i,e,t);break}else if(i.tag===1){var n=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Zt===null||!Zt.has(n))){e=Yl(t,e),e=Sf(i,e,1073741823),Qt(i,e),i=Fs(i,1073741823),i!==null&&Be(i);break}}i=i.return}}function _x(e,t,i){var n=e.pingCache;n!==null&&n.delete(t),Re===e&&ke===i?ae===Ws||ae===ws&&Ct===1073741823&&$e()-Jl<Mf?ai(e,ke):xs=!0:jf(e,i)&&(t=e.lastPingedTime,t!==0&&t<i||(e.lastPingedTime=i,Be(e)))}function $x(e,t){var i=e.stateNode;i!==null&&i.delete(t),t=0,t===0&&(t=ct(),t=fi(t,e,null)),e=Fs(e,t),e!==null&&Be(e)}var Df;Df=function(e,t,i){var n=t.expirationTime;if(e!==null){var r=t.pendingProps;if(e.memoizedProps!==r||Ee.current)at=!0;else{if(n<i){switch(at=!1,t.tag){case 3:Uc(t),wo();break;case 5:if(jc(t),t.mode&4&&i!==1&&r.hidden)return t.expirationTime=t.childExpirationTime=1,null;break;case 1:Te(t.type)&&Br(t);break;case 4:fa(t,t.stateNode.containerInfo);break;case 10:n=t.memoizedProps.value,r=t.type._context,ne(as,r._currentValue),r._currentValue=n;break;case 13:if(t.memoizedState!==null)return n=t.child.childExpirationTime,n!==0&&n>=i?Wc(e,t,i):(ne(te,te.current&1),t=Mt(e,t,i),t!==null?t.sibling:null);ne(te,te.current&1);break;case 19:if(n=t.childExpirationTime>=i,(e.effectTag&64)!==0){if(n)return Fc(e,t,i);t.effectTag|=64}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null),ne(te,te.current),!n)return null}return Mt(e,t,i)}at=!1}}else at=!1;switch(t.expirationTime=0,t.tag){case 2:if(n=t.type,e!==null&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,r=Yi(t,ve.current),_i(t,i),r=Hl(null,t,n,e,r,i),t.effectTag|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,Te(n)){var s=!0;Br(t)}else s=!1;t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,Bl(t);var o=n.getDerivedStateFromProps;typeof o=="function"&&cs(t,n,o,e),r.updater=Us,t.stateNode=r,r._reactInternalFiber=t,pa(t,n,e,i),t=ya(null,t,n,!0,s,i)}else t.tag=0,De(null,t,r,i),t=t.child;return t;case 16:e:{if(r=t.elementType,e!==null&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,m0(r),r._status!==1)throw r._result;switch(r=r._result,t.type=r,s=t.tag=Hx(r),e=Ye(r,e),s){case 0:t=wa(null,t,r,e,i);break e;case 1:t=$c(null,t,r,e,i);break e;case 11:t=Oc(null,t,r,e,i);break e;case 14:t=_c(null,t,r,Ye(r.type,e),n,i);break e}throw Error(x(306,r,""))}return t;case 0:return n=t.type,r=t.pendingProps,r=t.elementType===n?r:Ye(n,r),wa(e,t,n,r,i);case 1:return n=t.type,r=t.pendingProps,r=t.elementType===n?r:Ye(n,r),$c(e,t,n,r,i);case 3:if(Uc(t),n=t.updateQueue,e===null||n===null)throw Error(x(282));if(n=t.pendingProps,r=t.memoizedState,r=r!==null?r.element:null,Ol(e,t),Wn(t,n,null,i),n=t.memoizedState.element,n===r)wo(),t=Mt(e,t,i);else{if((r=t.stateNode.hydrate)&&(Bt=Oi(t.stateNode.containerInfo.firstChild),bt=t,r=hi=!0),r)for(i=_l(t,null,n,i),t.child=i;i;)i.effectTag=i.effectTag&-3|1024,i=i.sibling;else De(e,t,n,i),wo();t=t.child}return t;case 5:return jc(t),e===null&&va(t),n=t.type,r=t.pendingProps,s=e!==null?e.memoizedProps:null,o=r.children,oa(n,r)?o=null:s!==null&&oa(n,s)&&(t.effectTag|=16),hf(e,t),t.mode&4&&i!==1&&r.hidden?(t.expirationTime=t.childExpirationTime=1,t=null):(De(e,t,o,i),t=t.child),t;case 6:return e===null&&va(t),null;case 13:return Wc(e,t,i);case 4:return fa(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Gi(t,null,n,i):De(e,t,n,i),t.child;case 11:return n=t.type,r=t.pendingProps,r=t.elementType===n?r:Ye(n,r),Oc(e,t,n,r,i);case 7:return De(e,t,t.pendingProps,i),t.child;case 8:return De(e,t,t.pendingProps.children,i),t.child;case 12:return De(e,t,t.pendingProps.children,i),t.child;case 10:e:{n=t.type._context,r=t.pendingProps,o=t.memoizedProps,s=r.value;var a=t.type._context;if(ne(as,a._currentValue),a._currentValue=s,o!==null)if(a=o.value,s=yi(a,s)?0:(typeof n._calculateChangedBits=="function"?n._calculateChangedBits(a,s):1073741823)|0,s===0){if(o.children===r.children&&!Ee.current){t=Mt(e,t,i);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){o=a.child;for(var u=l.firstContext;u!==null;){if(u.context===n&&(u.observedBits&s)!==0){a.tag===1&&(u=Ft(i,null),u.tag=2,Qt(a,u)),a.expirationTime<i&&(a.expirationTime=i),u=a.alternate,u!==null&&u.expirationTime<i&&(u.expirationTime=i),qp(a.return,i),l.expirationTime<i&&(l.expirationTime=i);break}u=u.next}}else o=a.tag===10&&a.type===t.type?null:a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}De(e,t,r.children,i),t=t.child}return t;case 9:return r=t.type,s=t.pendingProps,n=s.children,_i(t,i),r=We(r,s.unstable_observedBits),n=n(r),t.effectTag|=1,De(e,t,n,i),t.child;case 14:return r=t.type,s=Ye(r,t.pendingProps),s=Ye(r.type,s),_c(e,t,r,s,n,i);case 15:return df(e,t,t.type,t.pendingProps,n,i);case 17:return n=t.type,r=t.pendingProps,r=t.elementType===n?r:Ye(n,r),e!==null&&(e.alternate=null,t.alternate=null,t.effectTag|=2),t.tag=1,Te(n)?(e=!0,Br(t)):e=!1,_i(t,i),tf(t,n,r),pa(t,n,r,i),ya(null,t,n,!0,e,i);case 19:return Fc(e,t,i)}throw Error(x(156,t.tag))};var Ta=null,ka=null;function Ux(e){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__=="undefined")return!1;var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)return!0;try{var i=t.inject(e);Ta=function(n){try{t.onCommitFiberRoot(i,n,void 0,(n.current.effectTag&64)===64)}catch{}},ka=function(n){try{t.onCommitFiberUnmount(i,n)}catch{}}}catch{}return!0}function Wx(e,t,i,n){this.tag=e,this.key=i,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=n,this.effectTag=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childExpirationTime=this.expirationTime=0,this.alternate=null}function lt(e,t,i,n){return new Wx(e,t,i,n)}function Kl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Hx(e){if(typeof e=="function")return Kl(e)?1:0;if(e!=null){if(e=e.$$typeof,e===wl)return 11;if(e===yl)return 14}return 2}function Si(e,t){var i=e.alternate;return i===null?(i=lt(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.effectTag=0,i.nextEffect=null,i.firstEffect=null,i.lastEffect=null),i.childExpirationTime=e.childExpirationTime,i.expirationTime=e.expirationTime,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=t===null?null:{expirationTime:t.expirationTime,firstContext:t.firstContext,responders:t.responders},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i}function Hr(e,t,i,n,r,s){var o=2;if(n=e,typeof e=="function")Kl(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case ni:return Ot(i.children,r,s,t);case g0:o=8,r|=7;break;case Jh:o=8,r|=1;break;case Pr:return e=lt(12,i,t,r|8),e.elementType=Pr,e.type=Pr,e.expirationTime=s,e;case zr:return e=lt(13,i,t,r),e.type=zr,e.elementType=zr,e.expirationTime=s,e;case Fo:return e=lt(19,i,t,r),e.elementType=Fo,e.expirationTime=s,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Kh:o=10;break e;case qh:o=9;break e;case wl:o=11;break e;case yl:o=14;break e;case ep:o=16,n=null;break e;case tp:o=22;break e}throw Error(x(130,e==null?e:typeof e,""))}return t=lt(o,i,t,r),t.elementType=e,t.type=n,t.expirationTime=s,t}function Ot(e,t,i,n){return e=lt(7,e,n,t),e.expirationTime=i,e}function Co(e,t,i){return e=lt(6,e,null,t),e.expirationTime=i,e}function bo(e,t,i){return t=lt(4,e.children!==null?e.children:[],e.key,t),t.expirationTime=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Fx(e,t,i){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=i,this.callbackNode=null,this.callbackPriority=90,this.lastExpiredTime=this.lastPingedTime=this.nextKnownPendingLevel=this.lastSuspendedTime=this.firstSuspendedTime=this.firstPendingTime=0}function jf(e,t){var i=e.firstSuspendedTime;return e=e.lastSuspendedTime,i!==0&&i>=t&&e<=t}function li(e,t){var i=e.firstSuspendedTime,n=e.lastSuspendedTime;i<t&&(e.firstSuspendedTime=t),(n>t||i===0)&&(e.lastSuspendedTime=t),t<=e.lastPingedTime&&(e.lastPingedTime=0),t<=e.lastExpiredTime&&(e.lastExpiredTime=0)}function Vf(e,t){t>e.firstPendingTime&&(e.firstPendingTime=t);var i=e.firstSuspendedTime;i!==0&&(t>=i?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:t>=e.lastSuspendedTime&&(e.lastSuspendedTime=t+1),t>e.nextKnownPendingLevel&&(e.nextKnownPendingLevel=t))}function Na(e,t){var i=e.lastExpiredTime;(i===0||i>t)&&(e.lastExpiredTime=t)}function bs(e,t,i,n){var r=t.current,s=ct(),o=Pn.suspense;s=fi(s,r,o);e:if(i){i=i._reactInternalFiber;t:{if(Ii(i)!==i||i.tag!==1)throw Error(x(170));var a=i;do{switch(a.tag){case 3:a=a.stateNode.context;break t;case 1:if(Te(a.type)){a=a.stateNode.__reactInternalMemoizedMergedChildContext;break t}}a=a.return}while(a!==null);throw Error(x(171))}if(i.tag===1){var l=i.type;if(Te(l)){i=Wp(i,l,a);break e}}i=a}else i=Jt;return t.context===null?t.context=i:t.pendingContext=i,t=Ft(s,o),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),Qt(r,t),Yt(r,s),s}function Mo(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Kc(e,t){e=e.memoizedState,e!==null&&e.dehydrated!==null&&e.retryTime<t&&(e.retryTime=t)}function ql(e,t){Kc(e,t),(e=e.alternate)&&Kc(e,t)}function eu(e,t,i){i=i!=null&&i.hydrate===!0;var n=new Fx(e,t,i),r=lt(3,null,null,t===2?7:t===1?3:0);n.current=r,r.stateNode=n,Bl(r),e[er]=n.current,i&&t!==0&&C0(e,e.nodeType===9?e:e.ownerDocument),this._internalRoot=n}eu.prototype.render=function(e){bs(e,this._internalRoot,null,null)};eu.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;bs(null,e,null,function(){t[er]=null})};function or(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Qx(e,t){if(t||(t=e?e.nodeType===9?e.documentElement:e.firstChild:null,t=!(!t||t.nodeType!==1||!t.hasAttribute("data-reactroot"))),!t)for(var i;i=e.lastChild;)e.removeChild(i);return new eu(e,0,t?{hydrate:!0}:void 0)}function Zs(e,t,i,n,r){var s=i._reactRootContainer;if(s){var o=s._internalRoot;if(typeof r=="function"){var a=r;r=function(){var u=Mo(o);a.call(u)}}bs(t,o,e,r)}else{if(s=i._reactRootContainer=Qx(i,n),o=s._internalRoot,typeof r=="function"){var l=r;r=function(){var u=Mo(o);l.call(u)}}Ef(function(){bs(t,o,e,r)})}return Mo(o)}function Zx(e,t,i){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ti,key:n==null?null:""+n,children:e,containerInfo:t,implementation:i}}xp=function(e){if(e.tag===13){var t=_r(ct(),150,100);Yt(e,t),ql(e,t)}};Ml=function(e){e.tag===13&&(Yt(e,3),ql(e,3))};Sp=function(e){if(e.tag===13){var t=ct();t=fi(t,e,null),Yt(e,t),ql(e,t)}};Ho=function(e,t,i){switch(t){case"input":if(Zo(e,i),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<i.length;t++){var n=i[t];if(n!==e&&n.form===e.form){var r=Pl(n);if(!r)throw Error(x(90));np(n),Zo(n,r)}}}break;case"textarea":sp(e,i);break;case"select":t=i.value,t!=null&&Bi(e,!!i.multiple,t,!1)}};hl=Af;Yh=function(e,t,i,n,r){var s=V;V|=4;try{return Kt(98,e.bind(null,t,i,n,r))}finally{V=s,V===le&&ht()}};pl=function(){(V&(1|Je|dt))===le&&(jx(),en())};Gh=function(e,t){var i=V;V|=2;try{return e(t)}finally{V=i,V===le&&ht()}};function Lf(e,t){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!or(t))throw Error(x(200));return Zx(e,t,null,i)}var Yx={Events:[ir,wi,Pl,Fh,Wo,Zi,function(e){Cl(e,V0)},Qh,Zh,Bs,Rs,en,{current:!1}]};(function(e){var t=e.findFiberByHostInstance;return Ux(Ce({},e,{overrideHookState:null,overrideProps:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Xe.ReactCurrentDispatcher,findHostInstanceByFiber:function(i){return i=gp(i),i===null?null:i.stateNode},findFiberByHostInstance:function(i){return t?t(i):null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null}))})({findFiberByHostInstance:tr,bundleType:0,version:"16.14.0",rendererPackageName:"react-dom"});He.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Yx;He.createPortal=Lf;He.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternalFiber;if(t===void 0)throw typeof e.render=="function"?Error(x(188)):Error(x(268,Object.keys(e)));return e=gp(t),e=e===null?null:e.stateNode,e};He.flushSync=function(e,t){if((V&(Je|dt))!==le)throw Error(x(187));var i=V;V|=1;try{return Kt(99,e.bind(null,t))}finally{V=i,ht()}};He.hydrate=function(e,t,i){if(!or(t))throw Error(x(200));return Zs(null,e,t,!0,i)};He.render=function(e,t,i){if(!or(t))throw Error(x(200));return Zs(null,e,t,!1,i)};He.unmountComponentAtNode=function(e){if(!or(e))throw Error(x(40));return e._reactRootContainer?(Ef(function(){Zs(null,null,e,!1,function(){e._reactRootContainer=null,e[er]=null})}),!0):!1};He.unstable_batchedUpdates=Af;He.unstable_createPortal=function(e,t){return Lf(e,t,2<arguments.length&&arguments[2]!==void 0?arguments[2]:null)};He.unstable_renderSubtreeIntoContainer=function(e,t,i,n){if(!or(i))throw Error(x(200));if(e==null||e._reactInternalFiber===void 0)throw Error(x(38));return Zs(e,t,i,!1,n)};He.version="16.14.0";function Rf(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__=="undefined"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Rf)}catch(e){console.error(e)}}Rf(),Oh.exports=He;var qc=Oh.exports,Gx=Object.defineProperty,Xx=Object.defineProperties,Jx=Object.getOwnPropertyDescriptors,ed=Object.getOwnPropertySymbols,Kx=Object.prototype.hasOwnProperty,qx=Object.prototype.propertyIsEnumerable,td=(e,t,i)=>t in e?Gx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Ve=(e,t)=>{for(var i in t||(t={}))Kx.call(t,i)&&td(e,i,t[i]);if(ed)for(var i of ed(t))qx.call(t,i)&&td(e,i,t[i]);return e};const Bf={src:"",currentTime:0,hostTime:0,muted:!1,paused:!0,volume:1},Of={currentTimeMaxError:1,syncInterval:1e3,retryInterval:15e3,verbose:!1,log:console.log.bind(console)};let zt=Of;function eS(e){zt=Ve(Ve({},Of),e)}function Mr(e,t){if(e.paused)return e.currentTime;const i=function(n){if(n.player)return n.player.beginTimestamp+n.player.progressTime;if(n.room)return n.room.calibrationTimestamp}(t);return i?e.currentTime+(i-e.hostTime)/1e3:e.currentTime}const tS=navigator.userAgent.includes("Safari"),iS=[".aac",".mid",".midi",".mp3",".ogg",".oga",".wav",".weba"];var nS=typeof global=="object"&&global&&global.Object===Object&&global,rS=typeof self=="object"&&self&&self.Object===Object&&self,_f=nS||rS||Function("return this")(),Ms=_f.Symbol,$f=Object.prototype,sS=$f.hasOwnProperty,oS=$f.toString,hn=Ms?Ms.toStringTag:void 0,aS=Object.prototype.toString,id=Ms?Ms.toStringTag:void 0;function lS(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":id&&id in Object(e)?function(t){var i=sS.call(t,hn),n=t[hn];try{t[hn]=void 0;var r=!0}catch{}var s=oS.call(t);return r&&(i?t[hn]=n:delete t[hn]),s}(e):function(t){return aS.call(t)}(e)}var uS=/\s/,cS=/^\s+/;function dS(e){return e&&e.slice(0,function(t){for(var i=t.length;i--&&uS.test(t.charAt(i)););return i}(e)+1).replace(cS,"")}function Pa(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var hS=/^[-+]0x[0-9a-f]+$/i,pS=/^0b[01]+$/i,fS=/^0o[0-7]+$/i,gS=parseInt;function nd(e){if(typeof e=="number")return e;if(function(n){return typeof n=="symbol"||function(r){return r!=null&&typeof r=="object"}(n)&&lS(n)=="[object Symbol]"}(e))return NaN;if(Pa(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Pa(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=dS(e);var i=pS.test(e);return i||fS.test(e)?gS(e.slice(2),i?2:8):hS.test(e)?NaN:+e}var Io=function(){return _f.Date.now()},mS=Math.max,vS=Math.min;function Ir(e,t,i){var n,r,s,o,a,l,u=0,h=!1,p=!1,w=!0;if(typeof e!="function")throw new TypeError("Expected a function");function S(g){var m=n,y=r;return n=r=void 0,u=g,o=e.apply(y,m)}function I(g){return u=g,a=setTimeout(c,t),h?S(g):o}function E(g){var m=g-l;return l===void 0||m>=t||m<0||p&&g-u>=s}function c(){var g=Io();if(E(g))return d(g);a=setTimeout(c,function(m){var y=t-(m-l);return p?vS(y,s-(m-u)):y}(g))}function d(g){return a=void 0,w&&n?S(g):(n=r=void 0,o)}function f(){var g=Io(),m=E(g);if(n=arguments,r=this,l=g,m){if(a===void 0)return I(l);if(p)return clearTimeout(a),a=setTimeout(c,t),S(l)}return a===void 0&&(a=setTimeout(c,t)),o}return t=nd(t)||0,Pa(i)&&(h=!!i.leading,s=(p="maxWait"in i)?mS(nd(i.maxWait)||0,t):s,w="trailing"in i?!!i.trailing:w),f.cancel=function(){a!==void 0&&clearTimeout(a),u=0,n=l=r=a=void 0},f.flush=function(){return a===void 0?o:d(Io())},f}class rd extends Mi.exports.Component{constructor(t){super(t),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=i=>{let n=0;for(let r=0;r<i.changedTouches.length;r++)n=i.changedTouches[r].pageX;n=n<0?0:n,this.mobileSeeking&&this.changeCurrentTimePosition(n)},this.handleSeeking=i=>{this.seeking&&this.changeCurrentTimePosition(i.pageX)},this.setTrackWidthState=()=>{this.track&&this.setState({trackWidth:this.track.offsetWidth})},this.handleTrackHover=(i,n)=>{if(this.track){const r=this.props.scale||1;let s;s=i?0:(n.pageX-this.track.getBoundingClientRect().left)/r,this.setState({seekHoverPosition:s,trackWidth:this.track.offsetWidth})}},this.mouseSeekingHandler=i=>{this.setSeeking(!1,i),this.onMouseUp()},this.setSeeking=(i,n)=>{n.preventDefault(),this.handleSeeking(n),this.seeking=i,this.setState({seekHoverPosition:i?this.state.seekHoverPosition:0})},this.mobileTouchSeekingHandler=()=>{this.setMobileSeeking(!1)},this.setMobileSeeking=i=>{this.mobileSeeking=i,this.setState({seekHoverPosition:i?this.state.seekHoverPosition:0})},this.renderBufferProgress=()=>{if(this.props.buffered){const i=Ve(Ve({},this.getPositionStyle(this.props.buffered)),this.props.bufferColor&&{backgroundColor:this.props.bufferColor});return _.createElement("div",{className:"buffered",style:i})}return null},this.renderProgress=()=>{const i=Ve(Ve({},this.getPositionStyle(this.props.current)),this.props.sliderColor&&{backgroundColor:this.props.sliderColor});return _.createElement("div",{className:"connect",style:i})},this.renderHoverProgress=()=>{const i=Ve(Ve({},this.getSeekHoverPosition()),this.props.sliderHoverColor&&{backgroundColor:this.props.sliderHoverColor});return _.createElement("div",{className:"seek-hover",style:i})},this.renderThumb=()=>_.createElement("div",{className:this.isThumbActive()?"thumb active":"thumb",style:this.getThumbHandlerPosition()},_.createElement("div",{style:{backgroundColor:this.props.thumbColor},className:"handler"})),this.onMouseDown=i=>{var n,r;this.props.pause&&!this.props.paused&&(this.props.pause(),this.seekPause=!0),this.setSeeking(!0,i),(r=(n=this.props).onSeekStart)==null||r.call(n)},this.onMouseUp=()=>{var i,n;this.props.play&&this.seekPause&&(this.props.play(),this.seekPause=!1),(n=(i=this.props).onSeekEnd)==null||n.call(i)},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(t){if(this.track){const i=this.props.scale||1;let n=(t-this.track.getBoundingClientRect().left)/i;n=Math.min(this.state.trackWidth,Math.max(0,n)),this.setState({seekHoverPosition:n});const r=+(n/this.state.trackWidth*this.props.total).toFixed(0);this.props.onChange(r)}}getPositionStyle(t){return{transform:`scaleX(${100*t/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 t=0;return this.hoverTime&&(t=this.state.seekHoverPosition-this.hoverTime.offsetWidth/2,this.props.limitTimeTooltipBySides&&(t<0?t=0:t+this.hoverTime.offsetWidth>this.state.trackWidth&&(t=this.state.trackWidth-this.hoverTime.offsetWidth))),{transform:`translateX(${t}px)`}}secondsToTime(t){t=Math.round(t+this.offset);const i=Math.floor(t/3600),n=t%3600,r=Math.floor(n/60),s=Math.ceil(n%60);return{hh:i.toString(),mm:r<10?"0"+r:r.toString(),ss:s<10?"0"+s:s.toString()}}getHoverTime(){const t=100*this.state.seekHoverPosition/this.state.trackWidth,i=Math.floor(+t*(this.props.total/100)),n=this.secondsToTime(i);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:_.createElement("div",{className:this.isThumbActive()?"hover-time active":"hover-time",style:this.getHoverTimePosition(),ref:t=>this.hoverTime=t},this.getHoverTime())}render(){return _.createElement("div",{className:"seek-slider"},_.createElement("div",{className:"track",ref:t=>this.track=t,onMouseMove:t=>this.handleTrackHover(!1,t),onMouseLeave:t=>this.handleTrackHover(!0,t),onMouseDown:this.onMouseDown,onTouchStart:t=>{this.setMobileSeeking(!0),this.onMouseDown(t)},onMouseUp:this.onMouseUp,onTouchEnd:this.onMouseUp},_.createElement("div",{className:"main"},this.renderBufferProgress(),this.renderHoverProgress(),this.renderProgress())),this.drawHoverTime(),this.renderThumb())}}class wS extends Mi.exports.Component{constructor(t){super(t),this.stageVolume=0,this.updateVolumeTimer=0,this.onVolumeSeeking=!1,this.onClickOperationButton=()=>{const{paused:i}=this.props;i?this.props.play():this.props.pause()},this.operationButton=()=>{const{paused:i}=this.props;return i?_.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNOCA1LjE0djE0bDExLTdsLTExLTd6IiBmaWxsPSIjZmZmIj48L3BhdGg+PC9zdmc+Cg=="}):_.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTQgMTloNFY1aC00TTYgMTloNFY1SDZ2MTR6IiBmaWxsPSIjZmZmIj48L3BhdGg+PC9zdmc+Cg=="})},this.operationVolumeButton=()=>this.props.volume>.9?_.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTQgMy4yM3YyLjA2YzIuODkuODYgNSAzLjU0IDUgNi43MXMtMi4xMSA1Ljg0LTUgNi43djIuMDdjNC0uOTEgNy00LjQ5IDctOC43N2MwLTQuMjgtMy03Ljg2LTctOC43N00xNi41IDEyYzAtMS43Ny0xLTMuMjktMi41LTQuMDNWMTZjMS41LS43MSAyLjUtMi4yNCAyLjUtNE0zIDl2Nmg0bDUgNVY0TDcgOUgzeiIgZmlsbD0iI2ZmZiI+PC9wYXRoPjwvc3ZnPgo="}):this.props.volume===0?_.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNNyA5djZoNGw1IDVWNGwtNSA1SDd6IiBmaWxsPSIjZmZmIj48L3BhdGg+PC9zdmc+Cg=="}):_.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNNSA5djZoNGw1IDVWNEw5IDltOS41IDNjMC0xLjc3LTEtMy4yOS0yLjUtNC4wM1YxNmMxLjUtLjcxIDIuNS0yLjI0IDIuNS00eiIgZmlsbD0iI2ZmZiI+PC9wYXRoPjwvc3ZnPgo="}),this.handleClickVolume=()=>{this.props.volume===0?this.stageVolume!==0?this.props.setVolume(this.stageVolume):this.props.setVolume(1):(this.stageVolume=this.props.volume,this.props.setVolume(0))},this.onChange=i=>{this.setState({currentTime:i}),i&&this.changeTime(i)},this.changeTime=Ir(i=>{this.props.setCurrentTime(i)},50),this.onVolumeChange=i=>{this.changeVolume(i),this.setState({seekVolume:i/100})},this.changeVolume=Ir(i=>{this.props.setVolume(i/100)},50),this.onVolumeSeekStart=()=>{this.onVolumeSeeking=!0},this.onVolumeSeekEnd=Ir(()=>{this.onVolumeSeeking=!1},500),this.onProgressSeekStart=()=>this.setState({isPlayerSeeking:!0}),this.onProgressSeekEnd=Ir(()=>{this.setState({isPlayerSeeking:!1})},500),this.state={isPlayerSeeking:!1,isVolumeHover:!1,seekVolume:1,visible:!0,currentTime:0},this.stageVolume=t.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:t,currentTime:i}=this.props;return _.createElement("div",{className:"player-controller",style:{opacity:this.props.visible?"1":"0"}},_.createElement("div",{className:"player-controller-progress"},_.createElement(rd,{total:t,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})),_.createElement("div",{className:"player-controller-actions"},_.createElement("div",{className:"player-controller-actions-left"},_.createElement("div",{onClick:this.onClickOperationButton,className:"player-controller-play"},this.operationButton()),_.createElement("div",{className:"player-volume-box",onMouseEnter:()=>this.setState({isVolumeHover:!0}),onMouseLeave:()=>this.setState({isVolumeHover:!1})},_.createElement("div",{onClick:this.handleClickVolume,className:"player-volume"},this.operationVolumeButton()),_.createElement("div",{className:"player-volume-slider"},_.createElement(rd,{total:100,current:100*this.state.seekVolume,onChange:this.onVolumeChange,onSeekStart:this.onVolumeSeekStart,onSeekEnd:this.onVolumeSeekEnd,scale:this.props.scale,limitTimeTooltipBySides:!0,hideHoverTime:!0})))),_.createElement("div",{className:"player-mid-box-time"},sd(Math.floor(i/1e3))," /"," ",sd(Math.floor(t/1e3)))))}}function sd(e){const t=e%60,i=(e-t)/60;if(i>=60){const n=i%60;return`${pn((i-n)/60)}:${pn(n)}:${pn(t)}`}return`${pn(i)}:${pn(t)}`}function pn(e){return e<=9?`0${e}`:`${e}`}class yS extends Mi.exports.Component{constructor(){super(...arguments),this.putAttributes=t=>{const{context:i}=this.props,n=i.getAttributes()||{};for(const r in t)n[r]!==t[r]&&i.updateAttributes([r],t[r])}}render(){const{context:t}=this.props,i=t.getRoom(),n=i?void 0:t.getDisplayer(),r=this.putAttributes;return _.createElement(xS,{room:i,player:n,context:t,plugin:{putAttributes:r}})}}class xS extends Mi.exports.Component{constructor(t){super(t),this.alertMask=null,this.container=_.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 i;const n=(i=this.props.room)==null?void 0:i.calibrationTimestamp;this.debug(">>> play",{paused:!1,hostTime:n}),this.isEnabled()&&this.props.plugin.putAttributes({paused:!1,hostTime:n})},this.pause=()=>{const i=Mr(this.getAttributes(),this.props);this.debug(">>> pause",{paused:!0,currentTime:i}),this.isEnabled()&&this.props.plugin.putAttributes({paused:!0,currentTime:i})},this.setVolume=i=>{this.debug(">>> volume",{volume:i}),this.isEnabled()&&this.props.plugin.putAttributes({volume:i}),this.isEnabled()&&this.props.plugin.putAttributes({volume:i,muted:i===0})},this.setCurrentTime=i=>{var n;const r=(n=this.props.room)==null?void 0:n.calibrationTimestamp;this.debug(">>> seek",{currentTime:i/1e3,hostTime:r}),this.isEnabled()&&this.props.plugin.putAttributes({currentTime:i/1e3,hostTime:r})},this.resetPlayer=()=>{var i;(i=this.player)==null||i.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 i;const n=this.getAttributes();if(!n)return;const r=this.player;if(!r||this.state.NoSound&&(this.noSoundSyncCount+=1)%8!=0)return;r.paused()!==n.paused&&(this.debug("<<< paused -> %o",n.paused),n.paused?r.pause():(i=r.play())==null||i.catch(this.catchPlayFail)),r.muted()!==n.muted&&(this.debug("<<< muted -> %o",n.muted),r.muted(n.muted)),r.volume()!==n.volume&&(this.debug("<<< volume -> %o",n.volume),r.volume(n.volume));const s=Mr(n,this.props);let o=zt.currentTimeMaxError;this.state.NoSound&&(o*=3),s>r.duration()?this.resetPlayer():Math.abs(r.currentTime()-s)>o&&(this.debug("<<< currentTime -> %o",s),r.currentTime(s))},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=i=>{var n,r;const s=String(i);if(tS&&s.includes("NotAllowedError")||s.includes("interact"))(n=this.player)==null||n.autoplay("any"),this.setState({NoSound:!0});else{const o=(r=this.player)==null?void 0:r.error();o&&(this.retryCount<=3?(this.initPlayer(),this.retryCount=this.retryCount+1):(this.debug("catch videojs media error",o),this.setState({MediaError:!0}))),this.debug("catch error",i)}},this.fixPlayFail=()=>{this.debug("try to fix play state"),this.setState({NoSound:!1});const{muted:i,volume:n}=this.getAttributes();this.player&&(this.player.muted(i),this.player.volume(n))},this.initPlayer=async()=>{var i;(i=this.player)==null||i.dispose(),this.player=void 0,this.debug("creating elements ...");const{type:n,src:r,poster:s}=this.getAttributes(),o=document.createElement("div");o.setAttribute("data-vjs-player","");const a=document.createElement("video");a.className="video-js",s&&(a.poster=s),a.setAttribute("playsInline",""),a.setAttribute("webkit-playsinline","");const l=document.createElement("source");new URL(r).pathname.endsWith(".m3u8")?l.type="application/x-mpegURL":a.src=r,l.src=r,n&&(l.type=n),a.appendChild(l),o.appendChild(a),this.container.current.appendChild(o),await new Promise(h=>(window.requestAnimationFrame||window.setTimeout)(h)),this.debug("initializing videojs() ...");const u=su.default(a);this.player=u,window.player=u,u.one("loadedmetadata",this.gracefullyUpdate),u.on("ready",()=>{var h;(h=zt.onPlayer)==null||h.call(zt,u),u.on("timeupdate",this.gracefullyUpdate),u.on("volumechange",this.gracefullyUpdate),u.on("seeked",this.gracefullyUpdate),u.on("play",this.gracefullyUpdate),u.on("pause",this.gracefullyUpdate),u.on("ended",this.resetPlayer)}),u.on("error",this.catchPlayFail),this.setState({MediaError:!1})},this.gracefullyUpdate=()=>this.setState({updater:!this.state.updater}),this.setupAlert=i=>{i&&(i.addEventListener("touchstart",this.fixPlayFail),i.addEventListener("click",this.fixPlayFail)),this.alertMask=i},this.setupReload=i=>{i&&(i.addEventListener("touchstart",this.initPlayer),i.addEventListener("click",this.initPlayer))},this.state={NoSound:!1,MediaError:!1,updater:!1,controllerVisible:!1},t.room&&function(i){if(!i.calibrationTimestamp)throw new Error("@netless/app-media-player@0.1.0-alpha.5 requires white-web-sdk@^2.13.8 to work properly.")}(t.room)}getAttributes(){const{context:t}=this.props;let i=t.getAttributes();if(i){if(i=Ve(Ve({},Bf),i),this.player){let r=Mr(i,this.props),s=this.player.duration();!i.paused&&r>s&&(n=Ve({},i),i=Xx(n,Jx({currentTime:0,paused:!0})),this.resetPlayer())}var n;return i}}isShowingPoster(){const t=this.getAttributes();return!(t!=null&&t.src)||iS.some(i=>t.src.endsWith(i))}render(){var t,i;if(!this.props.room&&!this.props.player)return null;const n=this.getAttributes();if(!n)return null;const r=1e3*(((t=this.player)==null?void 0:t.duration())||1e3),s=((i=this.player)==null?void 0:i.bufferedPercent())||0;return _.createElement("div",{className:this.isEnabled()?"vjs-p":"vjs-p disabled",onMouseEnter:this.showController,onMouseMove:this.showController},_.createElement("div",{className:"video-js-plugin-player",ref:this.container}),this.isShowingPoster()&&_.createElement("div",{className:"video-js-plugin-poster"},n.poster&&_.createElement("img",{src:n.poster,alt:"",draggable:!1})),_.createElement(wS,{duration:r,volume:n.volume,setVolume:this.setVolume,paused:n.paused,play:this.play,pause:this.pause,currentTime:1e3*Mr(n,this.props),setCurrentTime:this.setCurrentTime,buffered:r*s,visible:!0}),this.state.NoSound&&_.createElement("div",{ref:this.setupAlert,className:"videojs-plugin-muted-alert"}),this.state.MediaError&&_.createElement("div",{className:"videojs-plugin-recovery-mode"},_.createElement("button",{ref:this.setupReload},"Reload Player")))}debug(t,...i){zt.verbose&&zt.log(`[MediaPlayer] ${t}`,...i)}componentDidMount(){this.debug("app version =","0.1.0-alpha.5"),this.debug("video.js version =",su.default.VERSION),this.initPlayer(),this.props.context.emitter.on("attributesUpdate",this.syncPlayerWithAttributes),this.syncPlayerTimer=setInterval(this.syncPlayerWithAttributes,zt.syncInterval),this.decreaseRetryTimer=setInterval(this.decreaseRetryCount,zt.retryInterval)}componentWillUnmount(){var t;this.debug("unmount"),this.props.context.emitter.off("attributesUpdate",this.syncPlayerWithAttributes),(t=this.player)==null||t.dispose(),clearInterval(this.syncPlayerTimer),clearInterval(this.decreaseRetryTimer)}isEnabled(){return this.props.context.getIsWritable()}}const Is={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=Ve(Ve({},Bf),t);const i=e.getBox();i.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%}
154
- `);const n=document.createElement("div");n.classList.add("netless-app-media-player-container"),qc.render(_.createElement(yS,{context:e}),n),i.mountContent(n),e.emitter.on("destroy",()=>{console.log("[MediaPlayer]: destroy"),qc.unmountComponentAtNode(n)})}},SS=()=>{me.debug&&eS({verbose:!0}),me.register({kind:Xr.kind,src:Xr}),me.register({kind:Is.kind,src:Is})},za={DocsViewer:Xr.kind,MediaPlayer:Is.kind},CS={[za.DocsViewer]:Xr,[za.MediaPlayer]:Is};const Uf=new kv({emitter:j}),B=class extends M.InvisiblePlugin{constructor(e){super(e);this.version="1.0.0-canary.30",this.dependencies={dependencies:{"@juggle/resize-observer":"^3.3.1","@netless/telebox-insider":"1.0.0-alpha.27",emittery:"^0.11.0",lodash:"^4.17.21","p-retry":"^4.6.1","side-effect-manager":"^1.1.0",uuid:"^7.0.3","value-enhancer":"^1.3.0","video.js":">=7"},peerDependencies:{"white-web-sdk":"^2.16.0"},devDependencies:{"@netless/app-docs-viewer":"^0.2.9","@netless/app-media-player":"0.1.0-beta.5","@playwright/test":"^1.23.0","@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":"^4.14.182","@types/lodash-es":"^4.17.4","@types/node":"^18.0.0","@types/uuid":"^8.3.1","@typescript-eslint/eslint-plugin":"^4.30.0","@typescript-eslint/parser":"^4.30.0","@vitest/ui":"^0.14.1",cypress:"^8.7.0",dotenv:"^10.0.0",eslint:"^7.32.0","eslint-config-prettier":"^8.3.0","eslint-plugin-svelte3":"^3.2.0",jsdom:"^19.0.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","vite-plugin-dts":"^1.2.0",vitest:"^0.14.1","white-web-sdk":"2.16.10"}},this.emitter=ie,this.viewMode=M.ViewMode.Broadcaster,this.viewMode$=new b.Val(M.ViewMode.Broadcaster),this.isReplay=M.isPlayer(this.displayer),this.containerSizeRatio=B.containerSizeRatio,B.displayer=e.displayer,window.NETLESS_DEPS={dependencies:{"@juggle/resize-observer":"^3.3.1","@netless/telebox-insider":"1.0.0-alpha.27",emittery:"^0.11.0",lodash:"^4.17.21","p-retry":"^4.6.1","side-effect-manager":"^1.1.0",uuid:"^7.0.3","value-enhancer":"^1.3.0","video.js":">=7"},peerDependencies:{"white-web-sdk":"^2.16.0"},devDependencies:{"@netless/app-docs-viewer":"^0.2.9","@netless/app-media-player":"0.1.0-beta.5","@playwright/test":"^1.23.0","@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":"^4.14.182","@types/lodash-es":"^4.17.4","@types/node":"^18.0.0","@types/uuid":"^8.3.1","@typescript-eslint/eslint-plugin":"^4.30.0","@typescript-eslint/parser":"^4.30.0","@vitest/ui":"^0.14.1",cypress:"^8.7.0",dotenv:"^10.0.0",eslint:"^7.32.0","eslint-config-prettier":"^8.3.0","eslint-plugin-svelte3":"^3.2.0",jsdom:"^19.0.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","vite-plugin-dts":"^1.2.0",vitest:"^0.14.1","white-web-sdk":"2.16.10"}}}static async mount(e){var s;const t=e.room;B.container=e.container;const i=e.debug,n=e.cursor;B.params=e,B.displayer=e.room,_g();let r;if(M.isRoom(t)){if(t.phase!==M.RoomPhase.Connected)throw new Error("[WindowManager]: Room only Connected can be mount");t.phase===M.RoomPhase.Connected&&t.isWritable&&(t.disableSerialization=!1),r=await this.initManager(t)}if(B.isCreated)throw new Error("[WindowManager]: Already created cannot be created again");if(this.debug=Boolean(i),jt("Already insert room",r),M.isRoom(this.displayer)){if(!r)throw new Error("[WindowManager]: init InvisiblePlugin failed")}else await lg.default(async o=>{if(r=await t.getInvisiblePlugin(B.kind),!r)throw jt(`manager is empty. retrying ${o}`),new Error},{retries:10});if(!r)throw new Error("[WindowManager]: create manager failed");e.containerSizeRatio&&(B.containerSizeRatio=e.containerSizeRatio),r.containerSizeRatio=B.containerSizeRatio,await r.ensureAttributes(),r.appManager=new Xg(r),r._pageState=new Tv(r.appManager),r.cursorManager=new Ev(r.appManager,Boolean(n),e.applianceIcons),r.boxManager=tv(r,ie,j,yt,{collectorContainer:e.collectorContainer,collectorStyles:e.collectorStyles,prefersColorScheme:e.prefersColorScheme,stageRatio:B.containerSizeRatio,containerStyle:e.containerStyle,stageStyle:e.stageStyle}),(s=r.appManager)==null||s.setBoxManager(r.boxManager),e.container&&r.bindContainer(e.container),Nv(t,r),j.emit("onCreated"),B.isCreated=!0;try{await fg()}catch(o){console.warn("[WindowManager]: indexedDB open failed"),console.log(o)}return r}static async initManager(e){let t=e.getInvisiblePlugin(B.kind);if(!t&&M.isRoom(e))if(e.isWritable===!1){try{await e.setWritable(!0)}catch{throw new Error("[WindowManger]: room must be switched to be writable")}t=await gu(e),t==null||t.ensureAttributes(),await Fr(500),await e.setWritable(!1)}else t=await gu(e);return t}static initContainer(e,t,i){B.container||(B.container=e);const{playground:n,mainViewElement:r}=Og(e,t);if(B.playground=n,i){const s=document.createElement("style");s.textContent=i,n.appendChild(s)}return r}static get registered(){return Ae.registered}bindContainer(e){var t,i,n,r,s,o;if(M.isRoom(this.displayer)&&this.room.phase!==M.RoomPhase.Connected)throw new vd;if(B.isCreated&&B.container)B.container.firstChild&&e.appendChild(B.container.firstChild);else{const a=(t=this.boxManager)==null?void 0:t.teleBoxManager.$stage;if(B.params&&a){const l=B.params,u=B.initContainer(e,a,l.overwriteStyles);this.boxManager&&B.playground&&this.boxManager.setRoot(B.playground),this.bindMainView(u,l.disableCameraTransform),B.playground&&((i=this.cursorManager)==null||i.setupWrapper(B.playground))}}j.emit("updateManagerRect"),(n=this.appManager)==null||n.refresh(),(r=this.appManager)==null||r.resetMaximized(),(s=this.appManager)==null||s.resetMinimized(),(o=this.appManager)==null||o.displayerWritableListener(!this.room.isWritable),B.container=e}bindCollectorContainer(e){B.isCreated&&this.boxManager?this.boxManager.setCollector(e):B.params&&(B.params.collectorContainer=e)}static register(e){return Ae.register(e)}static unregister(e){return Ae.unregister(e)}async addApp(e){if(this.appManager)return this.appManager.rootDirRemoving?new Promise((t,i)=>{j.once("rootDirRemoved").then(async()=>{try{const n=await this._addApp(e);t(n)}catch(n){i(n.message)}})}):this._addApp(e);throw new ze}async _addApp(e){var t,i,n;if(this.appManager){if(!e.kind||typeof e.kind!="string")throw new pd;const r=await((t=Ae.appClasses.get(e.kind))==null?void 0:t());if(r&&((i=r.config)==null?void 0:i.singleton)&&this.appManager.appProxies.has(e.kind))throw new dd;const s=this.setupScenePath(e,this.appManager);return s===void 0?void 0:((n=e==null?void 0:e.options)!=null&&n.scenePath&&(e.options.scenePath=Pg(e.options.scenePath)),await this.appManager.addApp(e,Boolean(s)))}else throw new ze}setupScenePath(e,t){let i=!1;if(e.options){const{scenePath:n,scenes:r}=e.options;if(n){if(!Ng(n))throw new gd;const s=Object.keys(this.apps||{});for(const o of s){const a=t.store.getAppScenePath(o);if(a&&a===n){if(console.warn(`[WindowManager]: ScenePath ${n} Already opened`),this.boxManager){const l=this.boxManager.getTopBox();l&&this.boxManager.setZIndex(o,l.zIndex+1,!1)}return}}}n&&r&&r.length>0&&(this.isDynamicPPT(r)?(i=!0,vi(this.displayer)[n]||ji(this.room,n,r)):vi(this.displayer)[n]||ji(this.room,n,[{name:r[0].name}])),n&&r===void 0&&ji(this.room,n,[{}])}return i}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)}else 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)}else return!1}async jumpPage(e){return this.appManager?e<0||e>=this.pageState.length?(console.warn(`[WindowManager]: index ${e} out of range`),!1):(await this.appManager.setMainViewSceneIndex(e),!0):!1}async addPage(e){if(this.appManager){const t=e==null?void 0:e.after,i=e==null?void 0:e.scene;if(t){const n=this.mainViewSceneIndex+1;this.room.putScenes(je,[i||{}],n)}else this.room.putScenes(je,[i||{}])}}async removePage(e){if(this.appManager){const t=e===void 0?this.pageState.index:e;return this.pageState.length===1?(console.warn("[WindowManager]: can not remove the last page"),!1):t<0||t>=this.pageState.length?(console.warn(`[WindowManager]: index ${e} out of range`),!1):this.appManager.removeSceneByIndex(t)}else return!1}getMainViewScenePath(){var e;return(e=this.appManager)==null?void 0:e.store.getMainViewScenePath()}getMainViewSceneIndex(){var e;return(e=this.appManager)==null?void 0:e.store.getMainViewSceneIndex()}setReadonly(e){var t;this.readonly=e,(t=this.boxManager)==null||t.setReadonly(e),j.emit("setReadonly",e)}switchMainViewToWriter(){var e;return(e=this.appManager)==null?void 0:e.mainViewProxy.mainViewClickHandler()}onAppDestroy(e,t){Tg(`destroy-${e}`,t)}setViewMode(e){var i;jt("setViewMode",e);const t=(i=this.appManager)==null?void 0:i.mainViewProxy;e===M.ViewMode.Broadcaster&&(this.canOperate&&(t==null||t.storeCurrentCamera()),t==null||t.start()),e===M.ViewMode.Freedom&&(t==null||t.stop()),this.viewMode=e,this.viewMode$.setValue(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);break}}setMaximized(e){var t;!this.canOperate||(t=this.boxManager)==null||t.setMaximized(e,!1)}setMinimized(e){var t;!this.canOperate||(t=this.boxManager)==null||t.setMinimized(e,!1)}get mainView(){if(this.appManager)return this.appManager.mainViewProxy.view;throw new ze}get camera(){if(this.appManager)return this.appManager.mainViewProxy.view.camera;throw new ze}get baseCamera$(){if(this.appManager)return this.appManager.mainViewProxy.camera$;throw new ze}get baseSize$(){if(this.appManager)return this.appManager.mainViewProxy.size$;throw new ze}get cameraState(){if(this.appManager)return this.appManager.mainViewProxy.cameraState;throw new ze}get apps(){var e;return(e=this.appManager)==null?void 0:e.store.apps()}get boxState(){var e;if(this.appManager)return(e=this.appManager.boxManager)==null?void 0:e.boxState;throw new ze}get darkMode(){var e,t;return Boolean((t=(e=this.appManager)==null?void 0:e.boxManager)==null?void 0:t.darkMode)}get prefersColorScheme(){var e;if(this.appManager)return(e=this.appManager.boxManager)==null?void 0:e.prefersColorScheme;throw new ze}get focused(){return this.attributes.focus}get focusedView(){var e,t;return((t=(e=this.appManager)==null?void 0:e.focusApp)==null?void 0:t.view)||this.mainView}get mainViewSceneIndex(){var e;return((e=this._pageState)==null?void 0:e.index)||0}get mainViewSceneDir(){var e;if(this.appManager)return(e=this.appManager)==null?void 0:e.getMainViewSceneDir();throw new ze}get topApp(){var e,t;return(t=(e=this.boxManager)==null?void 0:e.getTopBox())==null?void 0:t.id}get mainViewScenesLength(){var e;return((e=this._pageState)==null?void 0:e.length)||0}get canRedoSteps(){var e;return((e=this.focusedView)==null?void 0:e.canRedoSteps)||0}get canUndoSteps(){var e;return((e=this.focusedView)==null?void 0:e.canUndoSteps)||0}get sceneState(){if(this.appManager)return this.appManager.sceneState;throw new ze}get pageState(){if(this._pageState)return this._pageState.toObject();throw new ze}queryAll(){var e;return Array.from(((e=this.appManager)==null?void 0:e.appProxies.values())||[])}queryOne(e){var t;return(t=this.appManager)==null?void 0:t.appProxies.get(e)}async closeApp(e){var t;return(t=this.appManager)==null?void 0:t.closeApp(e)}moveCamera(e){const t=H({},this.mainView.camera),i=H(H({},t),e);A.isEqual(i,t)||!this.appManager||this.appManager.mainViewProxy.storeCamera(H({id:this.appManager.uid},i))}moveCameraToContain(e){if(!this.appManager)return;const t=this.appManager.mainViewProxy.size$.value;if(t){const i=t.width/e.width,n=t.height/e.height,r=Math.min(i,n);this.appManager.mainViewProxy.storeCamera({id:this.appManager.uid,scale:r,centerX:e.originX,centerY:e.originY})}}convertToPointInWorld(e){return this.mainView.convertToPointInWorld(e)}setCameraBound(e){this.mainView.setCameraBound(e)}onDestroy(){this._destroy()}destroy(){this._destroy()}_destroy(){var e,t,i;(e=this.appManager)==null||e.destroy(),(t=this.cursorManager)==null||t.destroy(),B.container=void 0,B.isCreated=!1,B.playground&&((i=B.playground.parentNode)==null||i.removeChild(B.playground)),B.params=void 0,jt("Destroyed")}bindMainView(e,t){var i;this.appManager&&(this.appManager.bindMainView(e,Boolean(t)),(i=this.cursorManager)==null||i.setMainViewDivElement(e))}get canOperate(){return M.isRoom(this.displayer)?this.displayer.isWritable&&this.displayer.phase===M.RoomPhase.Connected:!1}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,i;(i=(t=this.appManager)==null?void 0:t.boxManager)==null||i.setPrefersColorScheme(e)}cleanCurrentScene(){var e;(e=this.focusedView)==null||e.cleanCurrentScene()}redo(){var e;return((e=this.focusedView)==null?void 0:e.redo())||0}undo(){var e;return((e=this.focusedView)==null?void 0:e.undo())||0}delete(){var e;(e=this.focusedView)==null||e.delete()}copy(){var e;(e=this.focusedView)==null||e.copy()}paste(){var e;(e=this.focusedView)==null||e.paste()}duplicate(){var e;(e=this.focusedView)==null||e.duplicate()}insertText(e,t,i){var n;return((n=this.focusedView)==null?void 0:n.insertText(e,t,i))||""}insertImage(e){var t;return(t=this.focusedView)==null?void 0:t.insertImage(e)}completeImageUpload(e,t){var i;return(i=this.focusedView)==null?void 0:i.completeImageUpload(e,t)}lockImage(e,t){var i;return(i=this.focusedView)==null?void 0:i.lockImage(e,t)}lockImages(e){var t;return(t=this.focusedView)==null?void 0:t.lockImages(e)}refresh(){var e;this._refresh(),(e=this.appManager)==null||e.dispatchInternalEvent(Y.Refresh)}_refresh(){var e,t;(e=this.appManager)==null||e.mainViewProxy.rebind(),B.container&&this.bindContainer(B.container),(t=this.appManager)==null||t.refresher.refresh()}setContainerSizeRatio(e){if(!A.isNumber(e))throw new Error(`[WindowManager]: updateContainerSizeRatio error, ratio must be a number. but got ${e}`);B.containerSizeRatio=e,this.containerSizeRatio=e,j.emit("containerSizeRatioUpdate",e)}setContainerStyle(e){var t;(t=this.boxManager)==null||t.teleBoxManager.setContainerStyle(e)}setStageStyle(e){var t;(t=this.boxManager)==null||t.teleBoxManager.setStageStyle(e)}createPPTHandler(){return{onPageJumpTo:(e,t)=>{var i,n,r,s;(s=(r=(n=(i=this.appManager)==null?void 0:i.focusApp)==null?void 0:n.appContext)==null?void 0:r.whiteBoardView)==null||s.jumpPage(t)},onPageToNext:()=>{var e,t,i,n;this.focused&&((n=(i=(t=(e=this.appManager)==null?void 0:e.focusApp)==null?void 0:t.appContext)==null?void 0:i.whiteBoardView)==null||n.nextPage())},onPageToPrev:()=>{var e,t,i,n;this.focused&&((n=(i=(t=(e=this.appManager)==null?void 0:e.focusApp)==null?void 0:t.appContext)==null?void 0:i.whiteBoardView)==null||n.prevPage())}}}isDynamicPPT(e){var i,n;const t=(n=(i=e[0])==null?void 0:i.ppt)==null?void 0:n.src;return t==null?void 0:t.startsWith("pptx://")}async ensureAttributes(){A.isNull(this.attributes)&&await Fr(50),A.isObject(this.attributes)&&(this.attributes[oe.Apps]||this.safeSetAttributes({[oe.Apps]:{}}),this.attributes[oe.Cursors]||this.safeSetAttributes({[oe.Cursors]:{}}),this.attributes._mainScenePath||this.safeSetAttributes({_mainScenePath:ud}),this.attributes._mainSceneIndex||this.safeSetAttributes({_mainSceneIndex:0}),this.attributes[oe.Registered]||this.safeSetAttributes({[oe.Registered]:{}}))}};let me=B;me.kind="WindowManager";me.debug=!1;me.containerSizeRatio=dg;me.isCreated=!1;SS();exports.AppCreateError=dd;exports.AppManagerNotInitError=ze;exports.AppNotRegisterError=jg;exports.BindContainerRoomPhaseInvalidError=vd;exports.BoxManagerNotFoundError=md;exports.BoxNotCreatedError=fd;exports.BuiltinApps=za;exports.BuiltinAppsMap=CS;exports.InvalidScenePath=gd;exports.ParamsInvalidError=pd;exports.WhiteWebSDKInvalidError=hd;exports.WindowManager=me;exports.calculateNextIndex=ja;exports.reconnectRefresher=Uf;
153
+ Add a <Suspense fallback=...> component higher in the tree to provide a loading indicator or placeholder to display.`+xl(o))}se!==Xl&&(se=bf),a=Yl(a,o),p=s;do{switch(p.tag){case 3:l=a,p.effectTag|=4096,p.expirationTime=t;var m=xf(p,l,t);Nc(p,m);break e;case 1:l=a;var x=p.type,y=p.stateNode;if((p.effectTag&64)===0&&(typeof x.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Ft===null||!Ft.has(y)))){p.effectTag|=4096,p.expirationTime=t;var N=Sf(p,l,t);Nc(p,N);break e}}p=p.return}while(p!==null)}R=zf(R)}catch(D){t=D;continue}break}while(1)}function kf(){var e=ms.current;return ms.current=gs,e===null?gs:e}function Nf(e,t){e<St&&2<e&&(St=e),t!==null&&e<Qn&&2<e&&(Qn=e,ys=t)}function Qs(e){e>Zn&&(Zn=e)}function Lx(){for(;R!==null;)R=Pf(R)}function Vx(){for(;R!==null&&!xx();)R=Pf(R)}function Pf(e){var t=Df(e.alternate,e,Ee);return e.memoizedProps=e.pendingProps,t===null&&(t=zf(e)),Cf.current=null,t}function zf(e){R=e;do{var t=R.alternate;if(e=R.return,(R.effectTag&2048)===0){if(t=Ax(t,R,Ee),Ee===1||R.childExpirationTime!==1){for(var i=0,n=R.child;n!==null;){var r=n.expirationTime,s=n.childExpirationTime;r>i&&(i=r),s>i&&(i=s),n=n.sibling}R.childExpirationTime=i}if(t!==null)return t;e!==null&&(e.effectTag&2048)===0&&(e.firstEffect===null&&(e.firstEffect=R.firstEffect),R.lastEffect!==null&&(e.lastEffect!==null&&(e.lastEffect.nextEffect=R.firstEffect),e.lastEffect=R.lastEffect),1<R.effectTag&&(e.lastEffect!==null?e.lastEffect.nextEffect=R:e.firstEffect=R,e.lastEffect=R))}else{if(t=Ex(R),t!==null)return t.effectTag&=2047,t;e!==null&&(e.firstEffect=e.lastEffect=null,e.effectTag|=2048)}if(t=R.sibling,t!==null)return t;R=e}while(R!==null);return se===hi&&(se=Xl),null}function Ea(e){var t=e.expirationTime;return e=e.childExpirationTime,t>e?t:e}function ti(e){var t=$s();return Xt(99,Rx.bind(null,e,t)),null}function Rx(e,t){do en();while(zn!==null);if((L&(Ke|ct))!==oe)throw Error(S(327));var i=e.finishedWork,n=e.finishedExpirationTime;if(i===null)return null;if(e.finishedWork=null,e.finishedExpirationTime=0,i===e.current)throw Error(S(177));e.callbackNode=null,e.callbackExpirationTime=0,e.callbackPriority=90,e.nextKnownPendingLevel=0;var r=Ea(i);if(e.firstPendingTime=r,n<=e.lastSuspendedTime?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:n<=e.firstSuspendedTime&&(e.firstSuspendedTime=n-1),n<=e.lastPingedTime&&(e.lastPingedTime=0),n<=e.lastExpiredTime&&(e.lastExpiredTime=0),e===Le&&(R=Le=null,Ee=0),1<i.effectTag?i.lastEffect!==null?(i.lastEffect.nextEffect=i,r=i.firstEffect):r=i:r=i.firstEffect,r!==null){var s=L;L|=ct,Cf.current=null,po=jr;var o=fc();if(sa(o)){if("selectionStart"in o)var a={start:o.selectionStart,end:o.selectionEnd};else e:{a=(a=o.ownerDocument)&&a.defaultView||window;var l=a.getSelection&&a.getSelection();if(l&&l.rangeCount!==0){a=l.anchorNode;var u=l.anchorOffset,h=l.focusNode;l=l.focusOffset;try{a.nodeType,h.nodeType}catch{a=null;break e}var p=0,w=-1,C=-1,E=0,T=0,c=o,d=null;t:for(;;){for(var f;c!==a||u!==0&&c.nodeType!==3||(w=p+u),c!==h||l!==0&&c.nodeType!==3||(C=p+l),c.nodeType===3&&(p+=c.nodeValue.length),(f=c.firstChild)!==null;)d=c,c=f;for(;;){if(c===o)break t;if(d===a&&++E===u&&(w=p),d===h&&++T===l&&(C=p),(f=c.nextSibling)!==null)break;c=d,d=c.parentNode}c=f}a=w===-1||C===-1?null:{start:w,end:C}}else a=null}a=a||{start:0,end:0}}else a=null;fo={activeElementDetached:null,focusedElem:o,selectionRange:a},jr=!1,z=r;do try{Bx()}catch(P){if(z===null)throw Error(S(330));fi(z,P),z=z.nextEffect}while(z!==null);z=r;do try{for(o=e,a=t;z!==null;){var g=z.effectTag;if(g&16&&Bn(z.stateNode,""),g&128){var m=z.alternate;if(m!==null){var x=m.ref;x!==null&&(typeof x=="function"?x(null):x.current=null)}}switch(g&1038){case 2:Gc(z),z.effectTag&=-3;break;case 6:Gc(z),z.effectTag&=-3,So(z.alternate,z);break;case 1024:z.effectTag&=-1025;break;case 1028:z.effectTag&=-1025,So(z.alternate,z);break;case 4:So(z.alternate,z);break;case 8:u=z,yf(o,u,a),wf(u)}z=z.nextEffect}}catch(P){if(z===null)throw Error(S(330));fi(z,P),z=z.nextEffect}while(z!==null);if(x=fo,m=fc(),g=x.focusedElem,a=x.selectionRange,m!==g&&g&&g.ownerDocument&&Ep(g.ownerDocument.documentElement,g)){for(a!==null&&sa(g)&&(m=a.start,x=a.end,x===void 0&&(x=m),"selectionStart"in g?(g.selectionStart=m,g.selectionEnd=Math.min(x,g.value.length)):(x=(m=g.ownerDocument||document)&&m.defaultView||window,x.getSelection&&(x=x.getSelection(),u=g.textContent.length,o=Math.min(a.start,u),a=a.end===void 0?o:Math.min(a.end,u),!x.extend&&o>a&&(u=a,a=o,o=u),u=pc(g,o),h=pc(g,a),u&&h&&(x.rangeCount!==1||x.anchorNode!==u.node||x.anchorOffset!==u.offset||x.focusNode!==h.node||x.focusOffset!==h.offset)&&(m=m.createRange(),m.setStart(u.node,u.offset),x.removeAllRanges(),o>a?(x.addRange(m),x.extend(h.node,h.offset)):(m.setEnd(h.node,h.offset),x.addRange(m)))))),m=[],x=g;x=x.parentNode;)x.nodeType===1&&m.push({element:x,left:x.scrollLeft,top:x.scrollTop});for(typeof g.focus=="function"&&g.focus(),g=0;g<m.length;g++)x=m[g],x.element.scrollLeft=x.left,x.element.scrollTop=x.top}jr=!!po,fo=po=null,e.current=i,z=r;do try{for(g=e;z!==null;){var y=z.effectTag;if(y&36&&Px(g,z.alternate,z),y&128){m=void 0;var N=z.ref;if(N!==null){var D=z.stateNode;switch(z.tag){case 5:m=D;break;default:m=D}typeof N=="function"?N(m):N.current=m}}z=z.nextEffect}}catch(P){if(z===null)throw Error(S(330));fi(z,P),z=z.nextEffect}while(z!==null);z=null,Sx(),L=s}else e.current=i;if(Cs)Cs=!1,zn=e,wn=t;else for(z=r;z!==null;)t=z.nextEffect,z.nextEffect=null,z=t;if(t=e.firstPendingTime,t===0&&(Ft=null),t===1073741823?e===Ia?Dn++:(Dn=0,Ia=e):Dn=0,typeof Ta=="function"&&Ta(i.stateNode,n),Ve(e),Ss)throw Ss=!1,e=Ma,Ma=null,e;return(L&Gl)!==oe||dt(),null}function Bx(){for(;z!==null;){var e=z.effectTag;(e&256)!==0&&Nx(z.alternate,z),(e&512)===0||Cs||(Cs=!0,Jp(97,function(){return en(),null})),z=z.nextEffect}}function en(){if(wn!==90){var e=97<wn?97:wn;return wn=90,Xt(e,Ox)}}function Ox(){if(zn===null)return!1;var e=zn;if(zn=null,(L&(Ke|ct))!==oe)throw Error(S(331));var t=L;for(L|=ct,e=e.current.firstEffect;e!==null;){try{var i=e;if((i.effectTag&512)!==0)switch(i.tag){case 0:case 11:case 15:case 22:mf(5,i),vf(5,i)}}catch(n){if(e===null)throw Error(S(330));fi(e,n)}i=e.nextEffect,e.nextEffect=null,e=i}return L=t,dt(),!0}function Jc(e,t,i){t=Yl(i,t),t=xf(e,t,1073741823),Ht(e,t),e=Fs(e,1073741823),e!==null&&Ve(e)}function fi(e,t){if(e.tag===3)Jc(e,e,t);else for(var i=e.return;i!==null;){if(i.tag===3){Jc(i,e,t);break}else if(i.tag===1){var n=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Ft===null||!Ft.has(n))){e=Yl(t,e),e=Sf(i,e,1073741823),Ht(i,e),i=Fs(i,1073741823),i!==null&&Ve(i);break}}i=i.return}}function _x(e,t,i){var n=e.pingCache;n!==null&&n.delete(t),Le===e&&Ee===i?se===Ws||se===ws&&St===1073741823&&$e()-Jl<Mf?oi(e,Ee):xs=!0:jf(e,i)&&(t=e.lastPingedTime,t!==0&&t<i||(e.lastPingedTime=i,Ve(e)))}function $x(e,t){var i=e.stateNode;i!==null&&i.delete(t),t=0,t===0&&(t=ut(),t=pi(t,e,null)),e=Fs(e,t),e!==null&&Ve(e)}var Df;Df=function(e,t,i){var n=t.expirationTime;if(e!==null){var r=t.pendingProps;if(e.memoizedProps!==r||Ie.current)ot=!0;else{if(n<i){switch(ot=!1,t.tag){case 3:Uc(t),wo();break;case 5:if(jc(t),t.mode&4&&i!==1&&r.hidden)return t.expirationTime=t.childExpirationTime=1,null;break;case 1:Ae(t.type)&&Br(t);break;case 4:fa(t,t.stateNode.containerInfo);break;case 10:n=t.memoizedProps.value,r=t.type._context,ie(as,r._currentValue),r._currentValue=n;break;case 13:if(t.memoizedState!==null)return n=t.child.childExpirationTime,n!==0&&n>=i?Wc(e,t,i):(ie(K,K.current&1),t=bt(e,t,i),t!==null?t.sibling:null);ie(K,K.current&1);break;case 19:if(n=t.childExpirationTime>=i,(e.effectTag&64)!==0){if(n)return Fc(e,t,i);t.effectTag|=64}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null),ie(K,K.current),!n)return null}return bt(e,t,i)}ot=!1}}else ot=!1;switch(t.expirationTime=0,t.tag){case 2:if(n=t.type,e!==null&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,r=Yi(t,me.current),_i(t,i),r=Hl(null,t,n,e,r,i),t.effectTag|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ae(n)){var s=!0;Br(t)}else s=!1;t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,Bl(t);var o=n.getDerivedStateFromProps;typeof o=="function"&&cs(t,n,o,e),r.updater=Us,t.stateNode=r,r._reactInternalFiber=t,pa(t,n,e,i),t=ya(null,t,n,!0,s,i)}else t.tag=0,Pe(null,t,r,i),t=t.child;return t;case 16:e:{if(r=t.elementType,e!==null&&(e.alternate=null,t.alternate=null,t.effectTag|=2),e=t.pendingProps,m0(r),r._status!==1)throw r._result;switch(r=r._result,t.type=r,s=t.tag=Hx(r),e=Ge(r,e),s){case 0:t=wa(null,t,r,e,i);break e;case 1:t=$c(null,t,r,e,i);break e;case 11:t=Oc(null,t,r,e,i);break e;case 14:t=_c(null,t,r,Ge(r.type,e),n,i);break e}throw Error(S(306,r,""))}return t;case 0:return n=t.type,r=t.pendingProps,r=t.elementType===n?r:Ge(n,r),wa(e,t,n,r,i);case 1:return n=t.type,r=t.pendingProps,r=t.elementType===n?r:Ge(n,r),$c(e,t,n,r,i);case 3:if(Uc(t),n=t.updateQueue,e===null||n===null)throw Error(S(282));if(n=t.pendingProps,r=t.memoizedState,r=r!==null?r.element:null,Ol(e,t),Wn(t,n,null,i),n=t.memoizedState.element,n===r)wo(),t=bt(e,t,i);else{if((r=t.stateNode.hydrate)&&(Vt=Oi(t.stateNode.containerInfo.firstChild),Ct=t,r=di=!0),r)for(i=_l(t,null,n,i),t.child=i;i;)i.effectTag=i.effectTag&-3|1024,i=i.sibling;else Pe(e,t,n,i),wo();t=t.child}return t;case 5:return jc(t),e===null&&va(t),n=t.type,r=t.pendingProps,s=e!==null?e.memoizedProps:null,o=r.children,oa(n,r)?o=null:s!==null&&oa(n,s)&&(t.effectTag|=16),hf(e,t),t.mode&4&&i!==1&&r.hidden?(t.expirationTime=t.childExpirationTime=1,t=null):(Pe(e,t,o,i),t=t.child),t;case 6:return e===null&&va(t),null;case 13:return Wc(e,t,i);case 4:return fa(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Gi(t,null,n,i):Pe(e,t,n,i),t.child;case 11:return n=t.type,r=t.pendingProps,r=t.elementType===n?r:Ge(n,r),Oc(e,t,n,r,i);case 7:return Pe(e,t,t.pendingProps,i),t.child;case 8:return Pe(e,t,t.pendingProps.children,i),t.child;case 12:return Pe(e,t,t.pendingProps.children,i),t.child;case 10:e:{n=t.type._context,r=t.pendingProps,o=t.memoizedProps,s=r.value;var a=t.type._context;if(ie(as,a._currentValue),a._currentValue=s,o!==null)if(a=o.value,s=wi(a,s)?0:(typeof n._calculateChangedBits=="function"?n._calculateChangedBits(a,s):1073741823)|0,s===0){if(o.children===r.children&&!Ie.current){t=bt(e,t,i);break e}}else for(a=t.child,a!==null&&(a.return=t);a!==null;){var l=a.dependencies;if(l!==null){o=a.child;for(var u=l.firstContext;u!==null;){if(u.context===n&&(u.observedBits&s)!==0){a.tag===1&&(u=Wt(i,null),u.tag=2,Ht(a,u)),a.expirationTime<i&&(a.expirationTime=i),u=a.alternate,u!==null&&u.expirationTime<i&&(u.expirationTime=i),qp(a.return,i),l.expirationTime<i&&(l.expirationTime=i);break}u=u.next}}else o=a.tag===10&&a.type===t.type?null:a.child;if(o!==null)o.return=a;else for(o=a;o!==null;){if(o===t){o=null;break}if(a=o.sibling,a!==null){a.return=o.return,o=a;break}o=o.return}a=o}Pe(e,t,r.children,i),t=t.child}return t;case 9:return r=t.type,s=t.pendingProps,n=s.children,_i(t,i),r=We(r,s.unstable_observedBits),n=n(r),t.effectTag|=1,Pe(e,t,n,i),t.child;case 14:return r=t.type,s=Ge(r,t.pendingProps),s=Ge(r.type,s),_c(e,t,r,s,n,i);case 15:return df(e,t,t.type,t.pendingProps,n,i);case 17:return n=t.type,r=t.pendingProps,r=t.elementType===n?r:Ge(n,r),e!==null&&(e.alternate=null,t.alternate=null,t.effectTag|=2),t.tag=1,Ae(n)?(e=!0,Br(t)):e=!1,_i(t,i),tf(t,n,r),pa(t,n,r,i),ya(null,t,n,!0,e,i);case 19:return Fc(e,t,i)}throw Error(S(156,t.tag))};var Ta=null,ka=null;function Ux(e){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__=="undefined")return!1;var t=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(t.isDisabled||!t.supportsFiber)return!0;try{var i=t.inject(e);Ta=function(n){try{t.onCommitFiberRoot(i,n,void 0,(n.current.effectTag&64)===64)}catch{}},ka=function(n){try{t.onCommitFiberUnmount(i,n)}catch{}}}catch{}return!0}function Wx(e,t,i,n){this.tag=e,this.key=i,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=n,this.effectTag=0,this.lastEffect=this.firstEffect=this.nextEffect=null,this.childExpirationTime=this.expirationTime=0,this.alternate=null}function at(e,t,i,n){return new Wx(e,t,i,n)}function Kl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Hx(e){if(typeof e=="function")return Kl(e)?1:0;if(e!=null){if(e=e.$$typeof,e===wl)return 11;if(e===yl)return 14}return 2}function xi(e,t){var i=e.alternate;return i===null?(i=at(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.effectTag=0,i.nextEffect=null,i.firstEffect=null,i.lastEffect=null),i.childExpirationTime=e.childExpirationTime,i.expirationTime=e.expirationTime,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=t===null?null:{expirationTime:t.expirationTime,firstContext:t.firstContext,responders:t.responders},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i}function Hr(e,t,i,n,r,s){var o=2;if(n=e,typeof e=="function")Kl(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case ii:return Rt(i.children,r,s,t);case g0:o=8,r|=7;break;case Jh:o=8,r|=1;break;case Pr:return e=at(12,i,t,r|8),e.elementType=Pr,e.type=Pr,e.expirationTime=s,e;case zr:return e=at(13,i,t,r),e.type=zr,e.elementType=zr,e.expirationTime=s,e;case Fo:return e=at(19,i,t,r),e.elementType=Fo,e.expirationTime=s,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Kh:o=10;break e;case qh:o=9;break e;case wl:o=11;break e;case yl:o=14;break e;case ep:o=16,n=null;break e;case tp:o=22;break e}throw Error(S(130,e==null?e:typeof e,""))}return t=at(o,i,t,r),t.elementType=e,t.type=n,t.expirationTime=s,t}function Rt(e,t,i,n){return e=at(7,e,n,t),e.expirationTime=i,e}function Co(e,t,i){return e=at(6,e,null,t),e.expirationTime=i,e}function bo(e,t,i){return t=at(4,e.children!==null?e.children:[],e.key,t),t.expirationTime=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Fx(e,t,i){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=i,this.callbackNode=null,this.callbackPriority=90,this.lastExpiredTime=this.lastPingedTime=this.nextKnownPendingLevel=this.lastSuspendedTime=this.firstSuspendedTime=this.firstPendingTime=0}function jf(e,t){var i=e.firstSuspendedTime;return e=e.lastSuspendedTime,i!==0&&i>=t&&e<=t}function ai(e,t){var i=e.firstSuspendedTime,n=e.lastSuspendedTime;i<t&&(e.firstSuspendedTime=t),(n>t||i===0)&&(e.lastSuspendedTime=t),t<=e.lastPingedTime&&(e.lastPingedTime=0),t<=e.lastExpiredTime&&(e.lastExpiredTime=0)}function Lf(e,t){t>e.firstPendingTime&&(e.firstPendingTime=t);var i=e.firstSuspendedTime;i!==0&&(t>=i?e.firstSuspendedTime=e.lastSuspendedTime=e.nextKnownPendingLevel=0:t>=e.lastSuspendedTime&&(e.lastSuspendedTime=t+1),t>e.nextKnownPendingLevel&&(e.nextKnownPendingLevel=t))}function Na(e,t){var i=e.lastExpiredTime;(i===0||i>t)&&(e.lastExpiredTime=t)}function bs(e,t,i,n){var r=t.current,s=ut(),o=Pn.suspense;s=pi(s,r,o);e:if(i){i=i._reactInternalFiber;t:{if(Mi(i)!==i||i.tag!==1)throw Error(S(170));var a=i;do{switch(a.tag){case 3:a=a.stateNode.context;break t;case 1:if(Ae(a.type)){a=a.stateNode.__reactInternalMemoizedMergedChildContext;break t}}a=a.return}while(a!==null);throw Error(S(171))}if(i.tag===1){var l=i.type;if(Ae(l)){i=Wp(i,l,a);break e}}i=a}else i=Gt;return t.context===null?t.context=i:t.pendingContext=i,t=Wt(s,o),t.payload={element:e},n=n===void 0?null:n,n!==null&&(t.callback=n),Ht(r,t),Qt(r,s),s}function Mo(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Kc(e,t){e=e.memoizedState,e!==null&&e.dehydrated!==null&&e.retryTime<t&&(e.retryTime=t)}function ql(e,t){Kc(e,t),(e=e.alternate)&&Kc(e,t)}function eu(e,t,i){i=i!=null&&i.hydrate===!0;var n=new Fx(e,t,i),r=at(3,null,null,t===2?7:t===1?3:0);n.current=r,r.stateNode=n,Bl(r),e[er]=n.current,i&&t!==0&&C0(e,e.nodeType===9?e:e.ownerDocument),this._internalRoot=n}eu.prototype.render=function(e){bs(e,this._internalRoot,null,null)};eu.prototype.unmount=function(){var e=this._internalRoot,t=e.containerInfo;bs(null,e,null,function(){t[er]=null})};function or(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Qx(e,t){if(t||(t=e?e.nodeType===9?e.documentElement:e.firstChild:null,t=!(!t||t.nodeType!==1||!t.hasAttribute("data-reactroot"))),!t)for(var i;i=e.lastChild;)e.removeChild(i);return new eu(e,0,t?{hydrate:!0}:void 0)}function Zs(e,t,i,n,r){var s=i._reactRootContainer;if(s){var o=s._internalRoot;if(typeof r=="function"){var a=r;r=function(){var u=Mo(o);a.call(u)}}bs(t,o,e,r)}else{if(s=i._reactRootContainer=Qx(i,n),o=s._internalRoot,typeof r=="function"){var l=r;r=function(){var u=Mo(o);l.call(u)}}Ef(function(){bs(t,o,e,r)})}return Mo(o)}function Zx(e,t,i){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ti,key:n==null?null:""+n,children:e,containerInfo:t,implementation:i}}xp=function(e){if(e.tag===13){var t=_r(ut(),150,100);Qt(e,t),ql(e,t)}};Ml=function(e){e.tag===13&&(Qt(e,3),ql(e,3))};Sp=function(e){if(e.tag===13){var t=ut();t=pi(t,e,null),Qt(e,t),ql(e,t)}};Ho=function(e,t,i){switch(t){case"input":if(Zo(e,i),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<i.length;t++){var n=i[t];if(n!==e&&n.form===e.form){var r=Pl(n);if(!r)throw Error(S(90));np(n),Zo(n,r)}}}break;case"textarea":sp(e,i);break;case"select":t=i.value,t!=null&&Bi(e,!!i.multiple,t,!1)}};hl=Af;Yh=function(e,t,i,n,r){var s=L;L|=4;try{return Xt(98,e.bind(null,t,i,n,r))}finally{L=s,L===oe&&dt()}};pl=function(){(L&(1|Ke|ct))===oe&&(jx(),en())};Gh=function(e,t){var i=L;L|=2;try{return e(t)}finally{L=i,L===oe&&dt()}};function Vf(e,t){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!or(t))throw Error(S(200));return Zx(e,t,null,i)}var Yx={Events:[ir,vi,Pl,Fh,Wo,Zi,function(e){Cl(e,L0)},Qh,Zh,Bs,Rs,en,{current:!1}]};(function(e){var t=e.findFiberByHostInstance;return Ux(xe({},e,{overrideHookState:null,overrideProps:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Je.ReactCurrentDispatcher,findHostInstanceByFiber:function(i){return i=gp(i),i===null?null:i.stateNode},findFiberByHostInstance:function(i){return t?t(i):null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null}))})({findFiberByHostInstance:tr,bundleType:0,version:"16.14.0",rendererPackageName:"react-dom"});He.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Yx;He.createPortal=Vf;He.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternalFiber;if(t===void 0)throw typeof e.render=="function"?Error(S(188)):Error(S(268,Object.keys(e)));return e=gp(t),e=e===null?null:e.stateNode,e};He.flushSync=function(e,t){if((L&(Ke|ct))!==oe)throw Error(S(187));var i=L;L|=1;try{return Xt(99,e.bind(null,t))}finally{L=i,dt()}};He.hydrate=function(e,t,i){if(!or(t))throw Error(S(200));return Zs(null,e,t,!0,i)};He.render=function(e,t,i){if(!or(t))throw Error(S(200));return Zs(null,e,t,!1,i)};He.unmountComponentAtNode=function(e){if(!or(e))throw Error(S(40));return e._reactRootContainer?(Ef(function(){Zs(null,null,e,!1,function(){e._reactRootContainer=null,e[er]=null})}),!0):!1};He.unstable_batchedUpdates=Af;He.unstable_createPortal=function(e,t){return Vf(e,t,2<arguments.length&&arguments[2]!==void 0?arguments[2]:null)};He.unstable_renderSubtreeIntoContainer=function(e,t,i,n){if(!or(i))throw Error(S(200));if(e==null||e._reactInternalFiber===void 0)throw Error(S(38));return Zs(e,t,i,!1,n)};He.version="16.14.0";function Rf(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__=="undefined"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Rf)}catch(e){console.error(e)}}Rf(),Oh.exports=He;var qc=Oh.exports,Gx=Object.defineProperty,Xx=Object.defineProperties,Jx=Object.getOwnPropertyDescriptors,ed=Object.getOwnPropertySymbols,Kx=Object.prototype.hasOwnProperty,qx=Object.prototype.propertyIsEnumerable,td=(e,t,i)=>t in e?Gx(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,De=(e,t)=>{for(var i in t||(t={}))Kx.call(t,i)&&td(e,i,t[i]);if(ed)for(var i of ed(t))qx.call(t,i)&&td(e,i,t[i]);return e};const Bf={src:"",currentTime:0,hostTime:0,muted:!1,paused:!0,volume:1},Of={currentTimeMaxError:1,syncInterval:1e3,retryInterval:15e3,verbose:!1,log:console.log.bind(console)};let Nt=Of;function eS(e){Nt=De(De({},Of),e)}function Mr(e,t){if(e.paused)return e.currentTime;const i=function(n){if(n.player)return n.player.beginTimestamp+n.player.progressTime;if(n.room)return n.room.calibrationTimestamp}(t);return i?e.currentTime+(i-e.hostTime)/1e3:e.currentTime}const tS=navigator.userAgent.includes("Safari"),iS=[".aac",".mid",".midi",".mp3",".ogg",".oga",".wav",".weba"];var nS=typeof global=="object"&&global&&global.Object===Object&&global,rS=typeof self=="object"&&self&&self.Object===Object&&self,_f=nS||rS||Function("return this")(),Ms=_f.Symbol,$f=Object.prototype,sS=$f.hasOwnProperty,oS=$f.toString,hn=Ms?Ms.toStringTag:void 0,aS=Object.prototype.toString,id=Ms?Ms.toStringTag:void 0;function lS(e){return e==null?e===void 0?"[object Undefined]":"[object Null]":id&&id in Object(e)?function(t){var i=sS.call(t,hn),n=t[hn];try{t[hn]=void 0;var r=!0}catch{}var s=oS.call(t);return r&&(i?t[hn]=n:delete t[hn]),s}(e):function(t){return aS.call(t)}(e)}var uS=/\s/,cS=/^\s+/;function dS(e){return e&&e.slice(0,function(t){for(var i=t.length;i--&&uS.test(t.charAt(i)););return i}(e)+1).replace(cS,"")}function Pa(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var hS=/^[-+]0x[0-9a-f]+$/i,pS=/^0b[01]+$/i,fS=/^0o[0-7]+$/i,gS=parseInt;function nd(e){if(typeof e=="number")return e;if(function(n){return typeof n=="symbol"||function(r){return r!=null&&typeof r=="object"}(n)&&lS(n)=="[object Symbol]"}(e))return NaN;if(Pa(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Pa(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=dS(e);var i=pS.test(e);return i||fS.test(e)?gS(e.slice(2),i?2:8):hS.test(e)?NaN:+e}var Io=function(){return _f.Date.now()},mS=Math.max,vS=Math.min;function Ir(e,t,i){var n,r,s,o,a,l,u=0,h=!1,p=!1,w=!0;if(typeof e!="function")throw new TypeError("Expected a function");function C(g){var m=n,x=r;return n=r=void 0,u=g,o=e.apply(x,m)}function E(g){return u=g,a=setTimeout(c,t),h?C(g):o}function T(g){var m=g-l;return l===void 0||m>=t||m<0||p&&g-u>=s}function c(){var g=Io();if(T(g))return d(g);a=setTimeout(c,function(m){var x=t-(m-l);return p?vS(x,s-(m-u)):x}(g))}function d(g){return a=void 0,w&&n?C(g):(n=r=void 0,o)}function f(){var g=Io(),m=T(g);if(n=arguments,r=this,l=g,m){if(a===void 0)return E(l);if(p)return clearTimeout(a),a=setTimeout(c,t),C(l)}return a===void 0&&(a=setTimeout(c,t)),o}return t=nd(t)||0,Pa(i)&&(h=!!i.leading,s=(p="maxWait"in i)?mS(nd(i.maxWait)||0,t):s,w="trailing"in i?!!i.trailing:w),f.cancel=function(){a!==void 0&&clearTimeout(a),u=0,n=l=r=a=void 0},f.flush=function(){return a===void 0?o:d(Io())},f}class rd extends bi.exports.Component{constructor(t){super(t),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=i=>{let n=0;for(let r=0;r<i.changedTouches.length;r++)n=i.changedTouches[r].pageX;n=n<0?0:n,this.mobileSeeking&&this.changeCurrentTimePosition(n)},this.handleSeeking=i=>{this.seeking&&this.changeCurrentTimePosition(i.pageX)},this.setTrackWidthState=()=>{this.track&&this.setState({trackWidth:this.track.offsetWidth})},this.handleTrackHover=(i,n)=>{if(this.track){const r=this.props.scale||1;let s;s=i?0:(n.pageX-this.track.getBoundingClientRect().left)/r,this.setState({seekHoverPosition:s,trackWidth:this.track.offsetWidth})}},this.mouseSeekingHandler=i=>{this.setSeeking(!1,i),this.onMouseUp()},this.setSeeking=(i,n)=>{n.preventDefault(),this.handleSeeking(n),this.seeking=i,this.setState({seekHoverPosition:i?this.state.seekHoverPosition:0})},this.mobileTouchSeekingHandler=()=>{this.setMobileSeeking(!1)},this.setMobileSeeking=i=>{this.mobileSeeking=i,this.setState({seekHoverPosition:i?this.state.seekHoverPosition:0})},this.renderBufferProgress=()=>{if(this.props.buffered){const i=De(De({},this.getPositionStyle(this.props.buffered)),this.props.bufferColor&&{backgroundColor:this.props.bufferColor});return O.createElement("div",{className:"buffered",style:i})}return null},this.renderProgress=()=>{const i=De(De({},this.getPositionStyle(this.props.current)),this.props.sliderColor&&{backgroundColor:this.props.sliderColor});return O.createElement("div",{className:"connect",style:i})},this.renderHoverProgress=()=>{const i=De(De({},this.getSeekHoverPosition()),this.props.sliderHoverColor&&{backgroundColor:this.props.sliderHoverColor});return O.createElement("div",{className:"seek-hover",style:i})},this.renderThumb=()=>O.createElement("div",{className:this.isThumbActive()?"thumb active":"thumb",style:this.getThumbHandlerPosition()},O.createElement("div",{style:{backgroundColor:this.props.thumbColor},className:"handler"})),this.onMouseDown=i=>{var n,r;this.props.pause&&!this.props.paused&&(this.props.pause(),this.seekPause=!0),this.setSeeking(!0,i),(r=(n=this.props).onSeekStart)==null||r.call(n)},this.onMouseUp=()=>{var i,n;this.props.play&&this.seekPause&&(this.props.play(),this.seekPause=!1),(n=(i=this.props).onSeekEnd)==null||n.call(i)},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(t){if(this.track){const i=this.props.scale||1;let n=(t-this.track.getBoundingClientRect().left)/i;n=Math.min(this.state.trackWidth,Math.max(0,n)),this.setState({seekHoverPosition:n});const r=+(n/this.state.trackWidth*this.props.total).toFixed(0);this.props.onChange(r)}}getPositionStyle(t){return{transform:`scaleX(${100*t/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 t=0;return this.hoverTime&&(t=this.state.seekHoverPosition-this.hoverTime.offsetWidth/2,this.props.limitTimeTooltipBySides&&(t<0?t=0:t+this.hoverTime.offsetWidth>this.state.trackWidth&&(t=this.state.trackWidth-this.hoverTime.offsetWidth))),{transform:`translateX(${t}px)`}}secondsToTime(t){t=Math.round(t+this.offset);const i=Math.floor(t/3600),n=t%3600,r=Math.floor(n/60),s=Math.ceil(n%60);return{hh:i.toString(),mm:r<10?"0"+r:r.toString(),ss:s<10?"0"+s:s.toString()}}getHoverTime(){const t=100*this.state.seekHoverPosition/this.state.trackWidth,i=Math.floor(+t*(this.props.total/100)),n=this.secondsToTime(i);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:O.createElement("div",{className:this.isThumbActive()?"hover-time active":"hover-time",style:this.getHoverTimePosition(),ref:t=>this.hoverTime=t},this.getHoverTime())}render(){return O.createElement("div",{className:"seek-slider"},O.createElement("div",{className:"track",ref:t=>this.track=t,onMouseMove:t=>this.handleTrackHover(!1,t),onMouseLeave:t=>this.handleTrackHover(!0,t),onMouseDown:this.onMouseDown,onTouchStart:t=>{this.setMobileSeeking(!0),this.onMouseDown(t)},onMouseUp:this.onMouseUp,onTouchEnd:this.onMouseUp},O.createElement("div",{className:"main"},this.renderBufferProgress(),this.renderHoverProgress(),this.renderProgress())),this.drawHoverTime(),this.renderThumb())}}class wS extends bi.exports.Component{constructor(t){super(t),this.stageVolume=0,this.updateVolumeTimer=0,this.onVolumeSeeking=!1,this.onClickOperationButton=()=>{const{paused:i}=this.props;i?this.props.play():this.props.pause()},this.operationButton=()=>{const{paused:i}=this.props;return i?O.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNOCA1LjE0djE0bDExLTdsLTExLTd6IiBmaWxsPSIjZmZmIj48L3BhdGg+PC9zdmc+Cg=="}):O.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTQgMTloNFY1aC00TTYgMTloNFY1SDZ2MTR6IiBmaWxsPSIjZmZmIj48L3BhdGg+PC9zdmc+Cg=="})},this.operationVolumeButton=()=>this.props.volume>.9?O.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNMTQgMy4yM3YyLjA2YzIuODkuODYgNSAzLjU0IDUgNi43MXMtMi4xMSA1Ljg0LTUgNi43djIuMDdjNC0uOTEgNy00LjQ5IDctOC43N2MwLTQuMjgtMy03Ljg2LTctOC43N00xNi41IDEyYzAtMS43Ny0xLTMuMjktMi41LTQuMDNWMTZjMS41LS43MSAyLjUtMi4yNCAyLjUtNE0zIDl2Nmg0bDUgNVY0TDcgOUgzeiIgZmlsbD0iI2ZmZiI+PC9wYXRoPjwvc3ZnPgo="}):this.props.volume===0?O.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNNyA5djZoNGw1IDVWNGwtNSA1SDd6IiBmaWxsPSIjZmZmIj48L3BhdGg+PC9zdmc+Cg=="}):O.createElement("img",{src:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgcm9sZT0iaW1nIiBjbGFzcz0iaWNvbmlmeSBpY29uaWZ5LS1tZGkiIHdpZHRoPSIyMiIgaGVpZ2h0PSIyMiIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBkPSJNNSA5djZoNGw1IDVWNEw5IDltOS41IDNjMC0xLjc3LTEtMy4yOS0yLjUtNC4wM1YxNmMxLjUtLjcxIDIuNS0yLjI0IDIuNS00eiIgZmlsbD0iI2ZmZiI+PC9wYXRoPjwvc3ZnPgo="}),this.handleClickVolume=()=>{this.props.volume===0?this.stageVolume!==0?this.props.setVolume(this.stageVolume):this.props.setVolume(1):(this.stageVolume=this.props.volume,this.props.setVolume(0))},this.onChange=i=>{this.setState({currentTime:i}),i&&this.changeTime(i)},this.changeTime=Ir(i=>{this.props.setCurrentTime(i)},50),this.onVolumeChange=i=>{this.changeVolume(i),this.setState({seekVolume:i/100})},this.changeVolume=Ir(i=>{this.props.setVolume(i/100)},50),this.onVolumeSeekStart=()=>{this.onVolumeSeeking=!0},this.onVolumeSeekEnd=Ir(()=>{this.onVolumeSeeking=!1},500),this.onProgressSeekStart=()=>this.setState({isPlayerSeeking:!0}),this.onProgressSeekEnd=Ir(()=>{this.setState({isPlayerSeeking:!1})},500),this.state={isPlayerSeeking:!1,isVolumeHover:!1,seekVolume:1,visible:!0,currentTime:0},this.stageVolume=t.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:t,currentTime:i}=this.props;return O.createElement("div",{className:"player-controller",style:{opacity:this.props.visible?"1":"0"}},O.createElement("div",{className:"player-controller-progress"},O.createElement(rd,{total:t,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})),O.createElement("div",{className:"player-controller-actions"},O.createElement("div",{className:"player-controller-actions-left"},O.createElement("div",{onClick:this.onClickOperationButton,className:"player-controller-play"},this.operationButton()),O.createElement("div",{className:"player-volume-box",onMouseEnter:()=>this.setState({isVolumeHover:!0}),onMouseLeave:()=>this.setState({isVolumeHover:!1})},O.createElement("div",{onClick:this.handleClickVolume,className:"player-volume"},this.operationVolumeButton()),O.createElement("div",{className:"player-volume-slider"},O.createElement(rd,{total:100,current:100*this.state.seekVolume,onChange:this.onVolumeChange,onSeekStart:this.onVolumeSeekStart,onSeekEnd:this.onVolumeSeekEnd,scale:this.props.scale,limitTimeTooltipBySides:!0,hideHoverTime:!0})))),O.createElement("div",{className:"player-mid-box-time"},sd(Math.floor(i/1e3))," /"," ",sd(Math.floor(t/1e3)))))}}function sd(e){const t=e%60,i=(e-t)/60;if(i>=60){const n=i%60;return`${pn((i-n)/60)}:${pn(n)}:${pn(t)}`}return`${pn(i)}:${pn(t)}`}function pn(e){return e<=9?`0${e}`:`${e}`}class yS extends bi.exports.Component{constructor(){super(...arguments),this.putAttributes=t=>{const{context:i}=this.props,n=i.getAttributes()||{};for(const r in t)n[r]!==t[r]&&i.updateAttributes([r],t[r])}}render(){const{context:t}=this.props,i=t.getRoom(),n=i?void 0:t.getDisplayer(),r=this.putAttributes;return O.createElement(xS,{room:i,player:n,context:t,plugin:{putAttributes:r}})}}class xS extends bi.exports.Component{constructor(t){super(t),this.alertMask=null,this.container=O.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 i;const n=(i=this.props.room)==null?void 0:i.calibrationTimestamp;this.debug(">>> play",{paused:!1,hostTime:n}),this.isEnabled()&&this.props.plugin.putAttributes({paused:!1,hostTime:n})},this.pause=()=>{const i=Mr(this.getAttributes(),this.props);this.debug(">>> pause",{paused:!0,currentTime:i}),this.isEnabled()&&this.props.plugin.putAttributes({paused:!0,currentTime:i})},this.setVolume=i=>{this.debug(">>> volume",{volume:i}),this.isEnabled()&&this.props.plugin.putAttributes({volume:i}),this.isEnabled()&&this.props.plugin.putAttributes({volume:i,muted:i===0})},this.setCurrentTime=i=>{var n;const r=(n=this.props.room)==null?void 0:n.calibrationTimestamp;this.debug(">>> seek",{currentTime:i/1e3,hostTime:r}),this.isEnabled()&&this.props.plugin.putAttributes({currentTime:i/1e3,hostTime:r})},this.resetPlayer=()=>{var i;(i=this.player)==null||i.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 i;const n=this.getAttributes();if(!n)return;const r=this.player;if(!r||this.state.NoSound&&(this.noSoundSyncCount+=1)%8!=0)return;r.paused()!==n.paused&&(this.debug("<<< paused -> %o",n.paused),n.paused?r.pause():(i=r.play())==null||i.catch(this.catchPlayFail)),r.muted()!==n.muted&&(this.debug("<<< muted -> %o",n.muted),r.muted(n.muted)),r.volume()!==n.volume&&(this.debug("<<< volume -> %o",n.volume),r.volume(n.volume));const s=Mr(n,this.props);let o=Nt.currentTimeMaxError;this.state.NoSound&&(o*=3),s>r.duration()?this.resetPlayer():Math.abs(r.currentTime()-s)>o&&(this.debug("<<< currentTime -> %o",s),r.currentTime(s))},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=i=>{var n,r;const s=String(i);if(tS&&s.includes("NotAllowedError")||s.includes("interact"))(n=this.player)==null||n.autoplay("any"),this.setState({NoSound:!0});else{const o=(r=this.player)==null?void 0:r.error();o&&(this.retryCount<=3?(this.initPlayer(),this.retryCount=this.retryCount+1):(this.debug("catch videojs media error",o),this.setState({MediaError:!0}))),this.debug("catch error",i)}},this.fixPlayFail=()=>{this.debug("try to fix play state"),this.setState({NoSound:!1});const{muted:i,volume:n}=this.getAttributes();this.player&&(this.player.muted(i),this.player.volume(n))},this.initPlayer=async()=>{var i;(i=this.player)==null||i.dispose(),this.player=void 0,this.debug("creating elements ...");const{type:n,src:r,poster:s}=this.getAttributes(),o=document.createElement("div");o.setAttribute("data-vjs-player","");const a=document.createElement("video");a.className="video-js",s&&(a.poster=s),a.setAttribute("playsInline",""),a.setAttribute("webkit-playsinline","");const l=document.createElement("source");new URL(r).pathname.endsWith(".m3u8")?l.type="application/x-mpegURL":a.src=r,l.src=r,n&&(l.type=n),a.appendChild(l),o.appendChild(a),this.container.current.appendChild(o),await new Promise(h=>(window.requestAnimationFrame||window.setTimeout)(h)),this.debug("initializing videojs() ...");const u=su.default(a);this.player=u,window.player=u,u.one("loadedmetadata",this.gracefullyUpdate),u.on("ready",()=>{var h;(h=Nt.onPlayer)==null||h.call(Nt,u),u.on("timeupdate",this.gracefullyUpdate),u.on("volumechange",this.gracefullyUpdate),u.on("seeked",this.gracefullyUpdate),u.on("play",this.gracefullyUpdate),u.on("pause",this.gracefullyUpdate),u.on("ended",this.resetPlayer)}),u.on("error",this.catchPlayFail),this.setState({MediaError:!1})},this.gracefullyUpdate=()=>this.setState({updater:!this.state.updater}),this.setupAlert=i=>{i&&(i.addEventListener("touchstart",this.fixPlayFail),i.addEventListener("click",this.fixPlayFail)),this.alertMask=i},this.setupReload=i=>{i&&(i.addEventListener("touchstart",this.initPlayer),i.addEventListener("click",this.initPlayer))},this.state={NoSound:!1,MediaError:!1,updater:!1,controllerVisible:!1},t.room&&function(i){if(!i.calibrationTimestamp)throw new Error("@netless/app-media-player@0.1.0-alpha.5 requires white-web-sdk@^2.13.8 to work properly.")}(t.room)}getAttributes(){const{context:t}=this.props;let i=t.getAttributes();if(i){if(i=De(De({},Bf),i),this.player){let r=Mr(i,this.props),s=this.player.duration();!i.paused&&r>s&&(n=De({},i),i=Xx(n,Jx({currentTime:0,paused:!0})),this.resetPlayer())}var n;return i}}isShowingPoster(){const t=this.getAttributes();return!(t!=null&&t.src)||iS.some(i=>t.src.endsWith(i))}render(){var t,i;if(!this.props.room&&!this.props.player)return null;const n=this.getAttributes();if(!n)return null;const r=1e3*(((t=this.player)==null?void 0:t.duration())||1e3),s=((i=this.player)==null?void 0:i.bufferedPercent())||0;return O.createElement("div",{className:this.isEnabled()?"vjs-p":"vjs-p disabled",onMouseEnter:this.showController,onMouseMove:this.showController},O.createElement("div",{className:"video-js-plugin-player",ref:this.container}),this.isShowingPoster()&&O.createElement("div",{className:"video-js-plugin-poster"},n.poster&&O.createElement("img",{src:n.poster,alt:"",draggable:!1})),O.createElement(wS,{duration:r,volume:n.volume,setVolume:this.setVolume,paused:n.paused,play:this.play,pause:this.pause,currentTime:1e3*Mr(n,this.props),setCurrentTime:this.setCurrentTime,buffered:r*s,visible:!0}),this.state.NoSound&&O.createElement("div",{ref:this.setupAlert,className:"videojs-plugin-muted-alert"}),this.state.MediaError&&O.createElement("div",{className:"videojs-plugin-recovery-mode"},O.createElement("button",{ref:this.setupReload},"Reload Player")))}debug(t,...i){Nt.verbose&&Nt.log(`[MediaPlayer] ${t}`,...i)}componentDidMount(){this.debug("app version =","0.1.0-alpha.5"),this.debug("video.js version =",su.default.VERSION),this.initPlayer(),this.props.context.emitter.on("attributesUpdate",this.syncPlayerWithAttributes),this.syncPlayerTimer=setInterval(this.syncPlayerWithAttributes,Nt.syncInterval),this.decreaseRetryTimer=setInterval(this.decreaseRetryCount,Nt.retryInterval)}componentWillUnmount(){var t;this.debug("unmount"),this.props.context.emitter.off("attributesUpdate",this.syncPlayerWithAttributes),(t=this.player)==null||t.dispose(),clearInterval(this.syncPlayerTimer),clearInterval(this.decreaseRetryTimer)}isEnabled(){return this.props.context.getIsWritable()}}const Is={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=De(De({},Bf),t);const i=e.getBox();i.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%}
154
+ `);const n=document.createElement("div");n.classList.add("netless-app-media-player-container"),qc.render(O.createElement(yS,{context:e}),n),i.mountContent(n),e.emitter.on("destroy",()=>{console.log("[MediaPlayer]: destroy"),qc.unmountComponentAtNode(n)})}},SS=()=>{ge.debug&&eS({verbose:!0}),ge.register({kind:Xr.kind,src:Xr}),ge.register({kind:Is.kind,src:Is})},za={DocsViewer:Xr.kind,MediaPlayer:Is.kind},CS={[za.DocsViewer]:Xr,[za.MediaPlayer]:Is};const Uf=new kv({emitter:j}),B=class extends I.InvisiblePlugin{constructor(e){super(e);this.version="1.0.0-canary.33",this.dependencies={dependencies:{"@juggle/resize-observer":"^3.3.1","@netless/telebox-insider":"1.0.0-alpha.30",emittery:"^0.11.0",lodash:"^4.17.21","p-retry":"^4.6.1","side-effect-manager":"^1.1.0",uuid:"^7.0.3","value-enhancer":"^1.3.0","video.js":">=7"},peerDependencies:{"white-web-sdk":"^2.16.0"},devDependencies:{"@netless/app-docs-viewer":"^0.2.9","@netless/app-media-player":"0.1.0-beta.5","@playwright/test":"^1.23.0","@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":"^4.14.182","@types/lodash-es":"^4.17.4","@types/node":"^18.0.0","@types/uuid":"^8.3.1","@typescript-eslint/eslint-plugin":"^4.30.0","@typescript-eslint/parser":"^4.30.0","@vitest/ui":"^0.14.1",cypress:"^8.7.0",dotenv:"^10.0.0",eslint:"^7.32.0","eslint-config-prettier":"^8.3.0","eslint-plugin-svelte3":"^3.2.0",jsdom:"^19.0.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","vite-plugin-dts":"^1.2.0",vitest:"^0.14.1","white-web-sdk":"2.16.10"}},this.emitter=te,this.viewMode=I.ViewMode.Broadcaster,this.viewMode$=new M.Val(I.ViewMode.Broadcaster),this.isReplay=I.isPlayer(this.displayer),this.containerSizeRatio=B.containerSizeRatio,B.displayer=e.displayer,window.NETLESS_DEPS={dependencies:{"@juggle/resize-observer":"^3.3.1","@netless/telebox-insider":"1.0.0-alpha.30",emittery:"^0.11.0",lodash:"^4.17.21","p-retry":"^4.6.1","side-effect-manager":"^1.1.0",uuid:"^7.0.3","value-enhancer":"^1.3.0","video.js":">=7"},peerDependencies:{"white-web-sdk":"^2.16.0"},devDependencies:{"@netless/app-docs-viewer":"^0.2.9","@netless/app-media-player":"0.1.0-beta.5","@playwright/test":"^1.23.0","@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":"^4.14.182","@types/lodash-es":"^4.17.4","@types/node":"^18.0.0","@types/uuid":"^8.3.1","@typescript-eslint/eslint-plugin":"^4.30.0","@typescript-eslint/parser":"^4.30.0","@vitest/ui":"^0.14.1",cypress:"^8.7.0",dotenv:"^10.0.0",eslint:"^7.32.0","eslint-config-prettier":"^8.3.0","eslint-plugin-svelte3":"^3.2.0",jsdom:"^19.0.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","vite-plugin-dts":"^1.2.0",vitest:"^0.14.1","white-web-sdk":"2.16.10"}}}static async mount(e){var s;const t=e.room;B.container=e.container;const i=e.debug,n=e.cursor;B.params=e,B.displayer=e.room,_g();let r;if(I.isRoom(t)){if(t.phase!==I.RoomPhase.Connected)throw new Error("[WindowManager]: Room only Connected can be mount");t.phase===I.RoomPhase.Connected&&t.isWritable&&(t.disableSerialization=!1),r=await this.initManager(t)}if(B.isCreated)throw new Error("[WindowManager]: Already created cannot be created again");if(this.debug=Boolean(i),zt("Already insert room",r),I.isRoom(this.displayer)){if(!r)throw new Error("[WindowManager]: init InvisiblePlugin failed")}else await lg.default(async o=>{if(r=await t.getInvisiblePlugin(B.kind),!r)throw zt(`manager is empty. retrying ${o}`),new Error},{retries:10});if(!r)throw new Error("[WindowManager]: create manager failed");e.containerSizeRatio&&(B.containerSizeRatio=e.containerSizeRatio),r.containerSizeRatio=B.containerSizeRatio,await r.ensureAttributes(),r.appManager=new Xg(r),r._pageState=new Tv(r.appManager),r.cursorManager=new Ev(r.appManager,Boolean(n),e.applianceIcons),r.boxManager=tv(r,te,j,wt,{collectorContainer:e.collectorContainer,collectorStyles:e.collectorStyles,prefersColorScheme:e.prefersColorScheme,stageRatio:B.containerSizeRatio,containerStyle:e.containerStyle,stageStyle:e.stageStyle,fullscreen:e.fullscreen}),(s=r.appManager)==null||s.setBoxManager(r.boxManager),e.container&&r.bindContainer(e.container),Nv(t,r),j.emit("onCreated"),B.isCreated=!0;try{await fg()}catch(o){console.warn("[WindowManager]: indexedDB open failed"),console.log(o)}return r}static async initManager(e){let t=e.getInvisiblePlugin(B.kind);if(!t&&I.isRoom(e))if(e.isWritable===!1){try{await e.setWritable(!0)}catch{throw new Error("[WindowManger]: room must be switched to be writable")}t=await gu(e),t==null||t.ensureAttributes(),await Fr(500),await e.setWritable(!1)}else t=await gu(e);return t}static initContainer(e,t,i){B.container||(B.container=e);const{playground:n,mainViewElement:r}=Og(e,t);if(B.playground=n,i){const s=document.createElement("style");s.textContent=i,n.appendChild(s)}return r}static get registered(){return Me.registered}bindContainer(e){var t,i,n,r,s,o;if(I.isRoom(this.displayer)&&this.room.phase!==I.RoomPhase.Connected)throw new vd;if(B.isCreated&&B.container)B.container.firstChild&&e.appendChild(B.container.firstChild);else{const a=(t=this.boxManager)==null?void 0:t.teleBoxManager.$stage;if(B.params&&a){const l=B.params,u=B.initContainer(e,a,l.overwriteStyles);this.boxManager&&B.playground&&this.boxManager.setRoot(B.playground),this.bindMainView(u,l.disableCameraTransform),B.playground&&((i=this.cursorManager)==null||i.setupWrapper(B.playground))}}j.emit("updateManagerRect"),(n=this.appManager)==null||n.refresh(),(r=this.appManager)==null||r.resetMaximized(),(s=this.appManager)==null||s.resetMinimized(),(o=this.appManager)==null||o.displayerWritableListener(!this.room.isWritable),B.container=e}bindCollectorContainer(e){B.isCreated&&this.boxManager?this.boxManager.setCollector(e):B.params&&(B.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,i)=>{j.once("rootDirRemoved").then(async()=>{try{const n=await this._addApp(e);t(n)}catch(n){i(n.message)}})}):this._addApp(e);throw new Ce}async _addApp(e){var t,i,n;if(this.appManager){if(!e.kind||typeof e.kind!="string")throw new pd;const r=await((t=Me.appClasses.get(e.kind))==null?void 0:t());if(r&&((i=r.config)==null?void 0:i.singleton)&&this.appManager.appProxies.has(e.kind))throw new dd;const s=this.setupScenePath(e,this.appManager);return s===void 0?void 0:((n=e==null?void 0:e.options)!=null&&n.scenePath&&(e.options.scenePath=Pg(e.options.scenePath)),await this.appManager.addApp(e,Boolean(s)))}else throw new Ce}setupScenePath(e,t){let i=!1;if(e.options){const{scenePath:n,scenes:r}=e.options;if(n){if(!Ng(n))throw new gd;const s=Object.keys(this.apps||{});for(const o of s){const a=t.store.getAppScenePath(o);if(a&&a===n){if(console.warn(`[WindowManager]: ScenePath ${n} Already opened`),this.boxManager){const l=this.boxManager.getTopBox();l&&this.boxManager.setZIndex(o,l.zIndex+1,!1)}return}}}n&&r&&r.length>0&&(this.isDynamicPPT(r)?(i=!0,mi(this.displayer)[n]||ji(this.room,n,r)):mi(this.displayer)[n]||ji(this.room,n,[{name:r[0].name}])),n&&r===void 0&&ji(this.room,n,[{}])}return i}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)}else 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)}else return!1}async jumpPage(e){return this.appManager?e<0||e>=this.pageState.length?(console.warn(`[WindowManager]: index ${e} out of range`),!1):(await this.appManager.setMainViewSceneIndex(e),!0):!1}async addPage(e){if(this.appManager){const t=e==null?void 0:e.after,i=e==null?void 0:e.scene;if(t){const n=this.mainViewSceneIndex+1;this.room.putScenes(ze,[i||{}],n)}else this.room.putScenes(ze,[i||{}])}}async removePage(e){if(this.appManager){const t=e===void 0?this.pageState.index:e;return this.pageState.length===1?(console.warn("[WindowManager]: can not remove the last page"),!1):t<0||t>=this.pageState.length?(console.warn(`[WindowManager]: index ${e} out of range`),!1):this.appManager.removeSceneByIndex(t)}else return!1}getMainViewScenePath(){var e;return(e=this.appManager)==null?void 0:e.store.getMainViewScenePath()}getMainViewSceneIndex(){var e;return(e=this.appManager)==null?void 0:e.store.getMainViewSceneIndex()}setReadonly(e){var t;this.readonly=e,(t=this.boxManager)==null||t.setReadonly(e),j.emit("setReadonly",e)}switchMainViewToWriter(){var e;return(e=this.appManager)==null?void 0:e.mainViewProxy.mainViewClickHandler()}onAppDestroy(e,t){Tg(`destroy-${e}`,t)}setViewMode(e){var i;zt("setViewMode",e);const t=(i=this.appManager)==null?void 0:i.mainViewProxy;e===I.ViewMode.Broadcaster&&(this.canOperate&&(t==null||t.storeCurrentCamera()),t==null||t.start()),e===I.ViewMode.Freedom&&(t==null||t.stop()),this.viewMode=e,this.viewMode$.setValue(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);break}}setMaximized(e){var t;!this.canOperate||(t=this.boxManager)==null||t.setMaximized(e,!1)}setMinimized(e){var t;!this.canOperate||(t=this.boxManager)==null||t.setMinimized(e,!1)}get mainView(){if(this.appManager)return this.appManager.mainViewProxy.view;throw new Ce}get camera(){if(this.appManager)return this.appManager.mainViewProxy.view.camera;throw new Ce}get baseCamera$(){if(this.appManager)return this.appManager.mainViewProxy.camera$;throw new Ce}get baseSize$(){if(this.appManager)return this.appManager.mainViewProxy.size$;throw new Ce}get cameraState(){if(this.appManager)return this.appManager.mainViewProxy.cameraState;throw new Ce}get apps(){var e;return(e=this.appManager)==null?void 0:e.store.apps()}get boxState(){var e;if(this.appManager)return(e=this.appManager.boxManager)==null?void 0:e.boxState;throw new Ce}get darkMode(){var e,t;return Boolean((t=(e=this.appManager)==null?void 0:e.boxManager)==null?void 0:t.darkMode)}get prefersColorScheme(){var e;if(this.appManager)return(e=this.appManager.boxManager)==null?void 0:e.prefersColorScheme;throw new Ce}get fullscreen(){var e;if(this.appManager)return(e=this.appManager.boxManager)==null?void 0:e.teleBoxManager.fullscreen;throw new Ce}get focused(){return this.attributes.focus}get focusedView(){var e,t;return((t=(e=this.appManager)==null?void 0:e.focusApp)==null?void 0:t.view)||this.mainView}get mainViewSceneIndex(){var e;return((e=this._pageState)==null?void 0:e.index)||0}get mainViewSceneDir(){var e;if(this.appManager)return(e=this.appManager)==null?void 0:e.getMainViewSceneDir();throw new Ce}get topApp(){var e,t;return(t=(e=this.boxManager)==null?void 0:e.getTopBox())==null?void 0:t.id}get mainViewScenesLength(){var e;return((e=this._pageState)==null?void 0:e.length)||0}get canRedoSteps(){var e;return((e=this.focusedView)==null?void 0:e.canRedoSteps)||0}get canUndoSteps(){var e;return((e=this.focusedView)==null?void 0:e.canUndoSteps)||0}get sceneState(){if(this.appManager)return this.appManager.sceneState;throw new Ce}get pageState(){if(this._pageState)return this._pageState.toObject();throw new Ce}queryAll(){var e;return Array.from(((e=this.appManager)==null?void 0:e.appProxies.values())||[])}queryOne(e){var t;return(t=this.appManager)==null?void 0:t.appProxies.get(e)}async closeApp(e){var t;return(t=this.appManager)==null?void 0:t.closeApp(e)}moveCamera(e){const t=H({},this.mainView.camera),i=H(H({},t),e);A.isEqual(i,t)||!this.appManager||this.appManager.mainViewProxy.storeCamera(H({id:this.appManager.uid},i))}moveCameraToContain(e){if(!this.appManager)return;const t=this.appManager.mainViewProxy.size$.value;if(t){const i=t.width/e.width,n=t.height/e.height,r=Math.min(i,n);this.appManager.mainViewProxy.storeCamera({id:this.appManager.uid,scale:r,centerX:e.originX,centerY:e.originY})}}convertToPointInWorld(e){return this.mainView.convertToPointInWorld(e)}setCameraBound(e){this.mainView.setCameraBound(e)}onDestroy(){this._destroy()}destroy(){this._destroy()}_destroy(){var e,t,i;(e=this.appManager)==null||e.destroy(),(t=this.cursorManager)==null||t.destroy(),B.container=void 0,B.isCreated=!1,B.playground&&((i=B.playground.parentNode)==null||i.removeChild(B.playground)),B.params=void 0,zt("Destroyed")}bindMainView(e,t){var i;this.appManager&&(this.appManager.bindMainView(e,Boolean(t)),(i=this.cursorManager)==null||i.setMainViewDivElement(e))}get canOperate(){return I.isRoom(this.displayer)?this.displayer.isWritable&&this.displayer.phase===I.RoomPhase.Connected:!1}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,i;(i=(t=this.appManager)==null?void 0:t.boxManager)==null||i.setPrefersColorScheme(e)}setFullscreen(e){var t,i;(i=(t=this.appManager)==null?void 0:t.boxManager)==null||i.teleBoxManager.setFullscreen(e)}cleanCurrentScene(){var e;(e=this.focusedView)==null||e.cleanCurrentScene()}redo(){var e;return((e=this.focusedView)==null?void 0:e.redo())||0}undo(){var e;return((e=this.focusedView)==null?void 0:e.undo())||0}delete(){var e;(e=this.focusedView)==null||e.delete()}copy(){var e;(e=this.focusedView)==null||e.copy()}paste(){var e;(e=this.focusedView)==null||e.paste()}duplicate(){var e;(e=this.focusedView)==null||e.duplicate()}insertText(e,t,i){var n;return((n=this.focusedView)==null?void 0:n.insertText(e,t,i))||""}insertImage(e){var t;return(t=this.focusedView)==null?void 0:t.insertImage(e)}completeImageUpload(e,t){var i;return(i=this.focusedView)==null?void 0:i.completeImageUpload(e,t)}lockImage(e,t){var i;return(i=this.focusedView)==null?void 0:i.lockImage(e,t)}lockImages(e){var t;return(t=this.focusedView)==null?void 0:t.lockImages(e)}refresh(){var e;this._refresh(),(e=this.appManager)==null||e.dispatchInternalEvent(Z.Refresh)}_refresh(){var e,t;(e=this.appManager)==null||e.mainViewProxy.rebind(),B.container&&this.bindContainer(B.container),(t=this.appManager)==null||t.refresher.refresh()}setContainerSizeRatio(e){if(!A.isNumber(e))throw new Error(`[WindowManager]: updateContainerSizeRatio error, ratio must be a number. but got ${e}`);B.containerSizeRatio=e,this.containerSizeRatio=e,j.emit("containerSizeRatioUpdate",e)}setContainerStyle(e){var t;(t=this.boxManager)==null||t.teleBoxManager.setContainerStyle(e)}setStageStyle(e){var t;(t=this.boxManager)==null||t.teleBoxManager.setStageStyle(e)}createPPTHandler(){return{onPageJumpTo:(e,t)=>{var i,n,r,s;(s=(r=(n=(i=this.appManager)==null?void 0:i.focusApp)==null?void 0:n.appContext)==null?void 0:r.whiteBoardView)==null||s.jumpPage(t)},onPageToNext:()=>{var e,t,i,n;this.focused&&((n=(i=(t=(e=this.appManager)==null?void 0:e.focusApp)==null?void 0:t.appContext)==null?void 0:i.whiteBoardView)==null||n.nextPage())},onPageToPrev:()=>{var e,t,i,n;this.focused&&((n=(i=(t=(e=this.appManager)==null?void 0:e.focusApp)==null?void 0:t.appContext)==null?void 0:i.whiteBoardView)==null||n.prevPage())}}}isDynamicPPT(e){var i,n;const t=(n=(i=e[0])==null?void 0:i.ppt)==null?void 0:n.src;return t==null?void 0:t.startsWith("pptx://")}async ensureAttributes(){A.isNull(this.attributes)&&await Fr(50),A.isObject(this.attributes)&&(this.attributes[re.Apps]||this.safeSetAttributes({[re.Apps]:{}}),this.attributes[re.Cursors]||this.safeSetAttributes({[re.Cursors]:{}}),this.attributes._mainScenePath||this.safeSetAttributes({_mainScenePath:ud}),this.attributes._mainSceneIndex||this.safeSetAttributes({_mainSceneIndex:0}),this.attributes[re.Registered]||this.safeSetAttributes({[re.Registered]:{}}))}};let ge=B;ge.kind="WindowManager";ge.debug=!1;ge.containerSizeRatio=dg;ge.isCreated=!1;SS();exports.AppCreateError=dd;exports.AppManagerNotInitError=Ce;exports.AppNotRegisterError=jg;exports.BindContainerRoomPhaseInvalidError=vd;exports.BoxManagerNotFoundError=md;exports.BoxNotCreatedError=fd;exports.BuiltinApps=za;exports.BuiltinAppsMap=CS;exports.InvalidScenePath=gd;exports.ParamsInvalidError=pd;exports.WhiteWebSDKInvalidError=hd;exports.WindowManager=ge;exports.calculateNextIndex=ja;exports.reconnectRefresher=Uf;