@dao42/d42paas-front 0.9.143 → 0.9.144
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/DaoPaaS.cjs +2 -2
- package/dist/sdk/docs/enums/I18nLanguageType.html +2 -2
- package/dist/sdk/docs/enums/Messages.html +1 -1
- package/dist/sdk/docs/enums/ThemeType.html +2 -2
- package/dist/sdk/docs/interfaces/Component.html +2 -2
- package/dist/sdk/docs/interfaces/I18nResourcesType.html +1 -1
- package/dist/sdk/docs/interfaces/IDaoPaaS.html +30 -30
- package/dist/sdk/docs/interfaces/IExtralAction.html +1 -1
- package/dist/sdk/docs/interfaces/PaaSOptions.html +19 -19
- package/dist/sdk/docs/interfaces/XtermStyleType.html +1 -1
- package/dist/sdk/docs/modules.html +6 -6
- package/package.json +1 -1
package/dist/DaoPaaS.cjs
CHANGED
|
@@ -46,7 +46,7 @@ Error generating stack: `+o.message+`
|
|
|
46
46
|
* This source code is licensed under the MIT license found in the
|
|
47
47
|
* LICENSE file in the root directory of this source tree.
|
|
48
48
|
*/var VS=z.exports,Rme=qV.exports;function Ame(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Ime=typeof Object.is=="function"?Object.is:Ame,zme=Rme.useSyncExternalStore,Lme=VS.useRef,Mme=VS.useEffect,Nme=VS.useMemo,Dme=VS.useDebugValue;UV.useSyncExternalStoreWithSelector=function(t,e,n,r,i){var o=Lme(null);if(o.current===null){var s={hasValue:!1,value:null};o.current=s}else s=o.current;o=Nme(function(){function l(d){if(!c){if(c=!0,u=d,d=r(d),i!==void 0&&s.hasValue){var p=s.value;if(i(p,d))return f=p}return f=d}if(p=f,Ime(u,d))return p;var b=r(d);return i!==void 0&&i(p,b)?p:(u=d,f=b)}var c=!1,u,f,h=n===void 0?null:n;return[function(){return l(e())},h===null?void 0:function(){return l(h())}]},[e,n,r,i]);var a=zme(t,o[0],o[1]);return Mme(function(){s.hasValue=!0,s.value=a},[a]),Dme(a),a};WV.exports=UV;var Xme=WV.exports;const{useSyncExternalStoreWithSelector:Wme}=Xme;function Ume(t,e=t.getState,n){const r=Wme(t.subscribe,t.getState,t.getServerState||t.getState,e,n);return z.exports.useDebugValue(r),r}const lM=t=>{const e=typeof t=="function"?XV(t):t,n=(r,i)=>Ume(e,r,i);return Object.assign(n,e),n},qme=t=>t?lM(t):lM;var Bme=qme;const Fme=(t,e={})=>(n,r,i)=>{const{enabled:o,anonymousActionType:s,...a}=e;let l;try{l=(o!=null?o:({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!l)return({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"&&o&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),t(n,r,i);const c=l.connect(a);let u=!0;i.setState=(d,p,b)=>{const y=n(d,p);return u&&c.send(b===void 0?{type:s||"anonymous"}:typeof b=="string"?{type:b}:b,r()),y};const f=(...d)=>{const p=u;u=!1,n(...d),u=p},h=t(i.setState,r,i);if(c.init(h),i.dispatchFromDevtools&&typeof i.dispatch=="function"){let d=!1;const p=i.dispatch;i.dispatch=(...b)=>{({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"&&b[0].type==="__setState"&&!d&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),d=!0),p(...b)}}return c.subscribe(d=>{var p;switch(d.type){case"ACTION":if(typeof d.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return Ck(d.payload,b=>{if(b.type==="__setState"){f(b.state);return}!i.dispatchFromDevtools||typeof i.dispatch=="function"&&i.dispatch(b)});case"DISPATCH":switch(d.payload.type){case"RESET":return f(h),c.init(i.getState());case"COMMIT":return c.init(i.getState());case"ROLLBACK":return Ck(d.state,b=>{f(b),c.init(i.getState())});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return Ck(d.state,b=>{f(b)});case"IMPORT_STATE":{const{nextLiftedState:b}=d.payload,y=(p=b.computedStates.slice(-1)[0])==null?void 0:p.state;if(!y)return;f(y),c.send(null,b);return}case"PAUSE_RECORDING":return u=!u}return}}),h},Yme=Fme,Ck=(t,e)=>{let n;try{n=JSON.parse(t)}catch(r){console.error("[zustand devtools middleware] Could not parse the received json",r)}n!==void 0&&e(n)},q5=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(r){return q5(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return q5(r)(n)}}}},jme=(t,e)=>(n,r,i)=>{let o={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:y=>y,version:0,merge:(y,O)=>({...O,...y}),...e},s=!1;const a=new Set,l=new Set;let c;try{c=o.getStorage()}catch{}if(!c)return t((...y)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...y)},r,i);const u=q5(o.serialize),f=()=>{const y=o.partialize({...r()});let O;const m=u({state:y,version:o.version}).then(v=>c.setItem(o.name,v)).catch(v=>{O=v});if(O)throw O;return m},h=i.setState;i.setState=(y,O)=>{h(y,O),f()};const d=t((...y)=>{n(...y),f()},r,i);let p;const b=()=>{var y;if(!c)return;s=!1,a.forEach(m=>m(r()));const O=((y=o.onRehydrateStorage)==null?void 0:y.call(o,r()))||void 0;return q5(c.getItem.bind(c))(o.name).then(m=>{if(m)return o.deserialize(m)}).then(m=>{if(m)if(typeof m.version=="number"&&m.version!==o.version){if(o.migrate)return o.migrate(m.state,m.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return m.state}).then(m=>{var v;return p=o.merge(m,(v=r())!=null?v:d),n(p,!0),f()}).then(()=>{O==null||O(p,void 0),s=!0,l.forEach(m=>m(p))}).catch(m=>{O==null||O(void 0,m)})};return i.persist={setOptions:y=>{o={...o,...y},y.getStorage&&(c=y.getStorage())},clearStorage:()=>{c==null||c.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>b(),hasHydrated:()=>s,onHydrate:y=>(a.add(y),()=>{a.delete(y)}),onFinishHydration:y=>(l.add(y),()=>{l.delete(y)})},b(),p||d},Zme=jme,Vme=(t,e)=>{const n={};return Object.keys(t.getState()).forEach(r=>{n[r]=i=>{if(t.getState()[r]===i)return;const s=r.replace(/^\S/,a=>a.toUpperCase());t.setState(a=>{a[r]=i},`@@${e}/set${s}`)}}),n},Gme=(t,e)=>{const n=t(e.set,e.get,e);return{...e,set:{...e.set,...n}}},Hme=(t,e)=>{const n={...e.use},r={...e.useTracked},i={...e.get};return Object.keys(t(e.store.getState(),e.get,e)).forEach(o=>{n[o]=(...s)=>e.useStore(a=>{const c=t(a,e.get,e)[o];return c(...s)}),r[o]=(...s)=>{const a=e.useTrackedStore(),c=t(a,e.get,e)[o];return c(...s)},i[o]=(...s)=>{const l=t(e.store.getState(),e.get,e)[o];return l(...s)}}),{...e,get:i,use:n,useTracked:r}},fQ=t=>({...t,extendSelectors:e=>fQ(Hme(e,t)),extendActions:e=>fQ(Gme(e,t))}),Kme=t=>{const e={};return Object.keys(t.getState()).forEach(n=>{e[n]=()=>t.getState()[n]}),e},Jme=t=>{const e={};return Object.keys(t.getState()).forEach(n=>{e[n]=r=>t(i=>i[n],r)}),e},ege=(t,e)=>{const n={};return Object.keys(t.getState()).forEach(r=>{n[r]=()=>e()[r]}),n},tge=t=>(e,n,r)=>{const i=(o,s)=>e(mme(o),!0,s);return r.setState=i,t(i,n,r)};function nge(t,...e){return e.reduce((n,r)=>r(n),t)}const GS=t=>(e,n={})=>{var r;const{middlewares:i=[],devtools:o,persist:s,immer:a}=n;gme((r=a==null?void 0:a.enabledAutoFreeze)!==null&&r!==void 0?r:!1),a!=null&&a.enableMapSet&&ume();const l=[tge,...i];s!=null&&s.enabled&&l.push($=>Zme($,{...s,name:t})),o!=null&&o.enabled&&l.push($=>Yme($,{...o,name:t})),l.push(XV);const u=($=>nge($,...l))(()=>e),f=Bme(u),h=Vme(f,t),d=($,S)=>{u.setState(w=>{Object.assign(w,$)},S||`@@${t}/mergeState`)},p=($,S)=>{u.setState($,S||`@@${t}/setState`)},b=Jme(f),y=Kme(f),O=$me(f),m=ege(f,O),v={get:{state:u.getState,...y},name:t,set:{state:p,mergeState:d,...h},store:u,use:b,useTracked:m,useStore:f,useTrackedStore:O,extendSelectors:()=>v,extendActions:()=>v};return fQ(v)};var Db=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function FV(t,e){return e={exports:{}},t(e,e.exports),e.exports}var rge=typeof Db=="object"&&Db&&Db.Object===Object&&Db,YV=rge,ige=typeof self=="object"&&self&&self.Object===Object&&self,oge=YV||ige||Function("return this")(),If=oge,sge=If.Symbol,Bd=sge,jV=Object.prototype,age=jV.hasOwnProperty,lge=jV.toString,Z0=Bd?Bd.toStringTag:void 0;function cge(t){var e=age.call(t,Z0),n=t[Z0];try{t[Z0]=void 0;var r=!0}catch{}var i=lge.call(t);return r&&(e?t[Z0]=n:delete t[Z0]),i}var uge=cge,fge=Object.prototype,dge=fge.toString;function hge(t){return dge.call(t)}var Oge=hge,pge="[object Null]",mge="[object Undefined]",cM=Bd?Bd.toStringTag:void 0;function gge(t){return t==null?t===void 0?mge:pge:cM&&cM in Object(t)?uge(t):Oge(t)}var e0=gge;function vge(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var lE=vge,yge="[object AsyncFunction]",bge="[object Function]",_ge="[object GeneratorFunction]",$ge="[object Proxy]";function Sge(t){if(!lE(t))return!1;var e=e0(t);return e==bge||e==_ge||e==yge||e==$ge}var ZV=Sge,xge=If["__core-js_shared__"],Rk=xge,uM=function(){var t=/[^.]+$/.exec(Rk&&Rk.keys&&Rk.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function wge(t){return!!uM&&uM in t}var kge=wge,Tge=Function.prototype,Pge=Tge.toString;function Qge(t){if(t!=null){try{return Pge.call(t)}catch{}try{return t+""}catch{}}return""}var kO=Qge,Ege=/[\\^$.*+?()[\]{}|]/g,Cge=/^\[object .+?Constructor\]$/,Rge=Function.prototype,Age=Object.prototype,Ige=Rge.toString,zge=Age.hasOwnProperty,Lge=RegExp("^"+Ige.call(zge).replace(Ege,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Mge(t){if(!lE(t)||kge(t))return!1;var e=ZV(t)?Lge:Cge;return e.test(kO(t))}var Nge=Mge;function Dge(t,e){return t==null?void 0:t[e]}var Xge=Dge;function Wge(t,e){var n=Xge(t,e);return Nge(n)?n:void 0}var TO=Wge,Uge=function(){try{var t=TO(Object,"defineProperty");return t({},"",{}),t}catch{}}(),fM=Uge;function qge(t,e,n){e=="__proto__"&&fM?fM(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}var Bge=qge;function Fge(t){return function(e,n,r){for(var i=-1,o=Object(e),s=r(e),a=s.length;a--;){var l=s[t?a:++i];if(n(o[l],l,o)===!1)break}return e}}var Yge=Fge,jge=Yge(),Zge=jge;function Vge(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var Gge=Vge;function Hge(t){return t!=null&&typeof t=="object"}var x1=Hge,Kge="[object Arguments]";function Jge(t){return x1(t)&&e0(t)==Kge}var dM=Jge,VV=Object.prototype,eve=VV.hasOwnProperty,tve=VV.propertyIsEnumerable,nve=dM(function(){return arguments}())?dM:function(t){return x1(t)&&eve.call(t,"callee")&&!tve.call(t,"callee")},GV=nve,rve=Array.isArray,Tf=rve;function ive(){return!1}var ove=ive,dQ=FV(function(t,e){var n=e&&!e.nodeType&&e,r=n&&!0&&t&&!t.nodeType&&t,i=r&&r.exports===n,o=i?If.Buffer:void 0,s=o?o.isBuffer:void 0,a=s||ove;t.exports=a}),sve=9007199254740991,ave=/^(?:0|[1-9]\d*)$/;function lve(t,e){var n=typeof t;return e=e==null?sve:e,!!e&&(n=="number"||n!="symbol"&&ave.test(t))&&t>-1&&t%1==0&&t<e}var HV=lve,cve=9007199254740991;function uve(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=cve}var cE=uve,fve="[object Arguments]",dve="[object Array]",hve="[object Boolean]",Ove="[object Date]",pve="[object Error]",mve="[object Function]",gve="[object Map]",vve="[object Number]",yve="[object Object]",bve="[object RegExp]",_ve="[object Set]",$ve="[object String]",Sve="[object WeakMap]",xve="[object ArrayBuffer]",wve="[object DataView]",kve="[object Float32Array]",Tve="[object Float64Array]",Pve="[object Int8Array]",Qve="[object Int16Array]",Eve="[object Int32Array]",Cve="[object Uint8Array]",Rve="[object Uint8ClampedArray]",Ave="[object Uint16Array]",Ive="[object Uint32Array]",ki={};ki[kve]=ki[Tve]=ki[Pve]=ki[Qve]=ki[Eve]=ki[Cve]=ki[Rve]=ki[Ave]=ki[Ive]=!0;ki[fve]=ki[dve]=ki[xve]=ki[hve]=ki[wve]=ki[Ove]=ki[pve]=ki[mve]=ki[gve]=ki[vve]=ki[yve]=ki[bve]=ki[_ve]=ki[$ve]=ki[Sve]=!1;function zve(t){return x1(t)&&cE(t.length)&&!!ki[e0(t)]}var Lve=zve;function Mve(t){return function(e){return t(e)}}var Nve=Mve,hM=FV(function(t,e){var n=e&&!e.nodeType&&e,r=n&&!0&&t&&!t.nodeType&&t,i=r&&r.exports===n,o=i&&YV.process,s=function(){try{var a=r&&r.require&&r.require("util").types;return a||o&&o.binding&&o.binding("util")}catch{}}();t.exports=s}),OM=hM&&hM.isTypedArray,Dve=OM?Nve(OM):Lve,KV=Dve,Xve=Object.prototype,Wve=Xve.hasOwnProperty;function Uve(t,e){var n=Tf(t),r=!n&&GV(t),i=!n&&!r&&dQ(t),o=!n&&!r&&!i&&KV(t),s=n||r||i||o,a=s?Gge(t.length,String):[],l=a.length;for(var c in t)(e||Wve.call(t,c))&&!(s&&(c=="length"||i&&(c=="offset"||c=="parent")||o&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||HV(c,l)))&&a.push(c);return a}var qve=Uve,Bve=Object.prototype;function Fve(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||Bve;return t===n}var Yve=Fve;function jve(t,e){return function(n){return t(e(n))}}var Zve=jve,Vve=Zve(Object.keys,Object),Gve=Vve,Hve=Object.prototype,Kve=Hve.hasOwnProperty;function Jve(t){if(!Yve(t))return Gve(t);var e=[];for(var n in Object(t))Kve.call(t,n)&&n!="constructor"&&e.push(n);return e}var eye=Jve;function tye(t){return t!=null&&cE(t.length)&&!ZV(t)}var nye=tye;function rye(t){return nye(t)?qve(t):eye(t)}var uE=rye;function iye(t,e){return t&&Zge(t,e,uE)}var oye=iye;function sye(){this.__data__=[],this.size=0}var aye=sye;function lye(t,e){return t===e||t!==t&&e!==e}var JV=lye;function cye(t,e){for(var n=t.length;n--;)if(JV(t[n][0],e))return n;return-1}var HS=cye,uye=Array.prototype,fye=uye.splice;function dye(t){var e=this.__data__,n=HS(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():fye.call(e,n,1),--this.size,!0}var hye=dye;function Oye(t){var e=this.__data__,n=HS(e,t);return n<0?void 0:e[n][1]}var pye=Oye;function mye(t){return HS(this.__data__,t)>-1}var gye=mye;function vye(t,e){var n=this.__data__,r=HS(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}var yye=vye;function t0(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}t0.prototype.clear=aye;t0.prototype.delete=hye;t0.prototype.get=pye;t0.prototype.has=gye;t0.prototype.set=yye;var KS=t0;function bye(){this.__data__=new KS,this.size=0}var _ye=bye;function $ye(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}var Sye=$ye;function xye(t){return this.__data__.get(t)}var wye=xye;function kye(t){return this.__data__.has(t)}var Tye=kye,Pye=TO(If,"Map"),Vg=Pye,Qye=TO(Object,"create"),Gg=Qye;function Eye(){this.__data__=Gg?Gg(null):{},this.size=0}var Cye=Eye;function Rye(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Aye=Rye,Iye="__lodash_hash_undefined__",zye=Object.prototype,Lye=zye.hasOwnProperty;function Mye(t){var e=this.__data__;if(Gg){var n=e[t];return n===Iye?void 0:n}return Lye.call(e,t)?e[t]:void 0}var Nye=Mye,Dye=Object.prototype,Xye=Dye.hasOwnProperty;function Wye(t){var e=this.__data__;return Gg?e[t]!==void 0:Xye.call(e,t)}var Uye=Wye,qye="__lodash_hash_undefined__";function Bye(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Gg&&e===void 0?qye:e,this}var Fye=Bye;function n0(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}n0.prototype.clear=Cye;n0.prototype.delete=Aye;n0.prototype.get=Nye;n0.prototype.has=Uye;n0.prototype.set=Fye;var pM=n0;function Yye(){this.size=0,this.__data__={hash:new pM,map:new(Vg||KS),string:new pM}}var jye=Yye;function Zye(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var Vye=Zye;function Gye(t,e){var n=t.__data__;return Vye(e)?n[typeof e=="string"?"string":"hash"]:n.map}var JS=Gye;function Hye(t){var e=JS(this,t).delete(t);return this.size-=e?1:0,e}var Kye=Hye;function Jye(t){return JS(this,t).get(t)}var ebe=Jye;function tbe(t){return JS(this,t).has(t)}var nbe=tbe;function rbe(t,e){var n=JS(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}var ibe=rbe;function r0(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}r0.prototype.clear=jye;r0.prototype.delete=Kye;r0.prototype.get=ebe;r0.prototype.has=nbe;r0.prototype.set=ibe;var e4=r0,obe=200;function sbe(t,e){var n=this.__data__;if(n instanceof KS){var r=n.__data__;if(!Vg||r.length<obe-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new e4(r)}return n.set(t,e),this.size=n.size,this}var abe=sbe;function i0(t){var e=this.__data__=new KS(t);this.size=e.size}i0.prototype.clear=_ye;i0.prototype.delete=Sye;i0.prototype.get=wye;i0.prototype.has=Tye;i0.prototype.set=abe;var E$=i0,lbe="__lodash_hash_undefined__";function cbe(t){return this.__data__.set(t,lbe),this}var ube=cbe;function fbe(t){return this.__data__.has(t)}var dbe=fbe;function B5(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new e4;++e<n;)this.add(t[e])}B5.prototype.add=B5.prototype.push=ube;B5.prototype.has=dbe;var hbe=B5;function Obe(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var pbe=Obe;function mbe(t,e){return t.has(e)}var gbe=mbe,vbe=1,ybe=2;function bbe(t,e,n,r,i,o){var s=n&vbe,a=t.length,l=e.length;if(a!=l&&!(s&&l>a))return!1;var c=o.get(t),u=o.get(e);if(c&&u)return c==e&&u==t;var f=-1,h=!0,d=n&ybe?new hbe:void 0;for(o.set(t,e),o.set(e,t);++f<a;){var p=t[f],b=e[f];if(r)var y=s?r(b,p,f,e,t,o):r(p,b,f,t,e,o);if(y!==void 0){if(y)continue;h=!1;break}if(d){if(!pbe(e,function(O,m){if(!gbe(d,m)&&(p===O||i(p,O,n,r,o)))return d.push(m)})){h=!1;break}}else if(!(p===b||i(p,b,n,r,o))){h=!1;break}}return o.delete(t),o.delete(e),h}var eG=bbe,_be=If.Uint8Array,mM=_be;function $be(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}var Sbe=$be;function xbe(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var wbe=xbe,kbe=1,Tbe=2,Pbe="[object Boolean]",Qbe="[object Date]",Ebe="[object Error]",Cbe="[object Map]",Rbe="[object Number]",Abe="[object RegExp]",Ibe="[object Set]",zbe="[object String]",Lbe="[object Symbol]",Mbe="[object ArrayBuffer]",Nbe="[object DataView]",gM=Bd?Bd.prototype:void 0,Ak=gM?gM.valueOf:void 0;function Dbe(t,e,n,r,i,o,s){switch(n){case Nbe:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Mbe:return!(t.byteLength!=e.byteLength||!o(new mM(t),new mM(e)));case Pbe:case Qbe:case Rbe:return JV(+t,+e);case Ebe:return t.name==e.name&&t.message==e.message;case Abe:case zbe:return t==e+"";case Cbe:var a=Sbe;case Ibe:var l=r&kbe;if(a||(a=wbe),t.size!=e.size&&!l)return!1;var c=s.get(t);if(c)return c==e;r|=Tbe,s.set(t,e);var u=eG(a(t),a(e),r,i,o,s);return s.delete(t),u;case Lbe:if(Ak)return Ak.call(t)==Ak.call(e)}return!1}var Xbe=Dbe;function Wbe(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var Ube=Wbe;function qbe(t,e,n){var r=e(t);return Tf(t)?r:Ube(r,n(t))}var Bbe=qbe;function Fbe(t,e){for(var n=-1,r=t==null?0:t.length,i=0,o=[];++n<r;){var s=t[n];e(s,n,t)&&(o[i++]=s)}return o}var Ybe=Fbe;function jbe(){return[]}var Zbe=jbe,Vbe=Object.prototype,Gbe=Vbe.propertyIsEnumerable,vM=Object.getOwnPropertySymbols,Hbe=vM?function(t){return t==null?[]:(t=Object(t),Ybe(vM(t),function(e){return Gbe.call(t,e)}))}:Zbe,Kbe=Hbe;function Jbe(t){return Bbe(t,uE,Kbe)}var yM=Jbe,e_e=1,t_e=Object.prototype,n_e=t_e.hasOwnProperty;function r_e(t,e,n,r,i,o){var s=n&e_e,a=yM(t),l=a.length,c=yM(e),u=c.length;if(l!=u&&!s)return!1;for(var f=l;f--;){var h=a[f];if(!(s?h in e:n_e.call(e,h)))return!1}var d=o.get(t),p=o.get(e);if(d&&p)return d==e&&p==t;var b=!0;o.set(t,e),o.set(e,t);for(var y=s;++f<l;){h=a[f];var O=t[h],m=e[h];if(r)var v=s?r(m,O,h,e,t,o):r(O,m,h,t,e,o);if(!(v===void 0?O===m||i(O,m,n,r,o):v)){b=!1;break}y||(y=h=="constructor")}if(b&&!y){var $=t.constructor,S=e.constructor;$!=S&&"constructor"in t&&"constructor"in e&&!(typeof $=="function"&&$ instanceof $&&typeof S=="function"&&S instanceof S)&&(b=!1)}return o.delete(t),o.delete(e),b}var i_e=r_e,o_e=TO(If,"DataView"),hQ=o_e,s_e=TO(If,"Promise"),OQ=s_e,a_e=TO(If,"Set"),pQ=a_e,l_e=TO(If,"WeakMap"),mQ=l_e,bM="[object Map]",c_e="[object Object]",_M="[object Promise]",$M="[object Set]",SM="[object WeakMap]",xM="[object DataView]",u_e=kO(hQ),f_e=kO(Vg),d_e=kO(OQ),h_e=kO(pQ),O_e=kO(mQ),Dh=e0;(hQ&&Dh(new hQ(new ArrayBuffer(1)))!=xM||Vg&&Dh(new Vg)!=bM||OQ&&Dh(OQ.resolve())!=_M||pQ&&Dh(new pQ)!=$M||mQ&&Dh(new mQ)!=SM)&&(Dh=function(t){var e=e0(t),n=e==c_e?t.constructor:void 0,r=n?kO(n):"";if(r)switch(r){case u_e:return xM;case f_e:return bM;case d_e:return _M;case h_e:return $M;case O_e:return SM}return e});var wM=Dh,p_e=1,kM="[object Arguments]",TM="[object Array]",Xb="[object Object]",m_e=Object.prototype,PM=m_e.hasOwnProperty;function g_e(t,e,n,r,i,o){var s=Tf(t),a=Tf(e),l=s?TM:wM(t),c=a?TM:wM(e);l=l==kM?Xb:l,c=c==kM?Xb:c;var u=l==Xb,f=c==Xb,h=l==c;if(h&&dQ(t)){if(!dQ(e))return!1;s=!0,u=!1}if(h&&!u)return o||(o=new E$),s||KV(t)?eG(t,e,n,r,i,o):Xbe(t,e,l,n,r,i,o);if(!(n&p_e)){var d=u&&PM.call(t,"__wrapped__"),p=f&&PM.call(e,"__wrapped__");if(d||p){var b=d?t.value():t,y=p?e.value():e;return o||(o=new E$),i(b,y,n,r,o)}}return h?(o||(o=new E$),i_e(t,e,n,r,i,o)):!1}var v_e=g_e;function tG(t,e,n,r,i){return t===e?!0:t==null||e==null||!x1(t)&&!x1(e)?t!==t&&e!==e:v_e(t,e,n,r,tG,i)}var nG=tG,y_e=1,b_e=2;function __e(t,e,n,r){var i=n.length,o=i,s=!r;if(t==null)return!o;for(t=Object(t);i--;){var a=n[i];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<o;){a=n[i];var l=a[0],c=t[l],u=a[1];if(s&&a[2]){if(c===void 0&&!(l in t))return!1}else{var f=new E$;if(r)var h=r(c,u,l,t,e,f);if(!(h===void 0?nG(u,c,y_e|b_e,r,f):h))return!1}}return!0}var $_e=__e;function S_e(t){return t===t&&!lE(t)}var rG=S_e;function x_e(t){for(var e=uE(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,rG(i)]}return e}var w_e=x_e;function k_e(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}var iG=k_e;function T_e(t){var e=w_e(t);return e.length==1&&e[0][2]?iG(e[0][0],e[0][1]):function(n){return n===t||$_e(n,t,e)}}var P_e=T_e,Q_e="[object Symbol]";function E_e(t){return typeof t=="symbol"||x1(t)&&e0(t)==Q_e}var fE=E_e,C_e=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,R_e=/^\w*$/;function A_e(t,e){if(Tf(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||fE(t)?!0:R_e.test(t)||!C_e.test(t)||e!=null&&t in Object(e)}var dE=A_e,I_e="Expected a function";function hE(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(I_e);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=t.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(hE.Cache||e4),n}hE.Cache=e4;var z_e=hE,L_e=500;function M_e(t){var e=z_e(t,function(r){return n.size===L_e&&n.clear(),r}),n=e.cache;return e}var N_e=M_e,D_e=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,X_e=/\\(\\)?/g,W_e=N_e(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(D_e,function(n,r,i,o){e.push(i?o.replace(X_e,"$1"):r||n)}),e}),U_e=W_e;function q_e(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var B_e=q_e,F_e=1/0,QM=Bd?Bd.prototype:void 0,EM=QM?QM.toString:void 0;function oG(t){if(typeof t=="string")return t;if(Tf(t))return B_e(t,oG)+"";if(fE(t))return EM?EM.call(t):"";var e=t+"";return e=="0"&&1/t==-F_e?"-0":e}var Y_e=oG;function j_e(t){return t==null?"":Y_e(t)}var Z_e=j_e;function V_e(t,e){return Tf(t)?t:dE(t,e)?[t]:U_e(Z_e(t))}var sG=V_e,G_e=1/0;function H_e(t){if(typeof t=="string"||fE(t))return t;var e=t+"";return e=="0"&&1/t==-G_e?"-0":e}var t4=H_e;function K_e(t,e){e=sG(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[t4(e[n++])];return n&&n==r?t:void 0}var aG=K_e;function J_e(t,e,n){var r=t==null?void 0:aG(t,e);return r===void 0?n:r}var e$e=J_e;function t$e(t,e){return t!=null&&e in Object(t)}var n$e=t$e;function r$e(t,e,n){e=sG(e,t);for(var r=-1,i=e.length,o=!1;++r<i;){var s=t4(e[r]);if(!(o=t!=null&&n(t,s)))break;t=t[s]}return o||++r!=i?o:(i=t==null?0:t.length,!!i&&cE(i)&&HV(s,i)&&(Tf(t)||GV(t)))}var i$e=r$e;function o$e(t,e){return t!=null&&i$e(t,e,n$e)}var s$e=o$e,a$e=1,l$e=2;function c$e(t,e){return dE(t)&&rG(e)?iG(t4(t),e):function(n){var r=e$e(n,t);return r===void 0&&r===e?s$e(n,t):nG(e,r,a$e|l$e)}}var u$e=c$e;function f$e(t){return t}var d$e=f$e;function h$e(t){return function(e){return e==null?void 0:e[t]}}var O$e=h$e;function p$e(t){return function(e){return aG(e,t)}}var m$e=p$e;function g$e(t){return dE(t)?O$e(t4(t)):m$e(t)}var v$e=g$e;function y$e(t){return typeof t=="function"?t:t==null?d$e:typeof t=="object"?Tf(t)?u$e(t[0],t[1]):P_e(t):v$e(t)}var b$e=y$e;function _$e(t,e){var n={};return e=b$e(e),oye(t,function(r,i,o){Bge(n,i,e(r,i,o))}),n}var $$e=_$e;const n4=(t,e)=>$$e(e,n=>n[t]),bu=Object.create(null);bu.open="0";bu.close="1";bu.ping="2";bu.pong="3";bu.message="4";bu.upgrade="5";bu.noop="6";const C$=Object.create(null);Object.keys(bu).forEach(t=>{C$[bu[t]]=t});const S$e={type:"error",data:"parser error"},x$e=typeof Blob=="function"||typeof Blob!="undefined"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",w$e=typeof ArrayBuffer=="function",k$e=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t&&t.buffer instanceof ArrayBuffer,lG=({type:t,data:e},n,r)=>x$e&&e instanceof Blob?n?r(e):CM(e,r):w$e&&(e instanceof ArrayBuffer||k$e(e))?n?r(e):CM(new Blob([e]),r):r(bu[t]+(e||"")),CM=(t,e)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];e("b"+r)},n.readAsDataURL(t)},RM="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Cm=typeof Uint8Array=="undefined"?[]:new Uint8Array(256);for(let t=0;t<RM.length;t++)Cm[RM.charCodeAt(t)]=t;const T$e=t=>{let e=t.length*.75,n=t.length,r,i=0,o,s,a,l;t[t.length-1]==="="&&(e--,t[t.length-2]==="="&&e--);const c=new ArrayBuffer(e),u=new Uint8Array(c);for(r=0;r<n;r+=4)o=Cm[t.charCodeAt(r)],s=Cm[t.charCodeAt(r+1)],a=Cm[t.charCodeAt(r+2)],l=Cm[t.charCodeAt(r+3)],u[i++]=o<<2|s>>4,u[i++]=(s&15)<<4|a>>2,u[i++]=(a&3)<<6|l&63;return c},P$e=typeof ArrayBuffer=="function",cG=(t,e)=>{if(typeof t!="string")return{type:"message",data:uG(t,e)};const n=t.charAt(0);return n==="b"?{type:"message",data:Q$e(t.substring(1),e)}:C$[n]?t.length>1?{type:C$[n],data:t.substring(1)}:{type:C$[n]}:S$e},Q$e=(t,e)=>{if(P$e){const n=T$e(t);return uG(n,e)}else return{base64:!0,data:t}},uG=(t,e)=>{switch(e){case"blob":return t instanceof ArrayBuffer?new Blob([t]):t;case"arraybuffer":default:return t}},fG=String.fromCharCode(30),E$e=(t,e)=>{const n=t.length,r=new Array(n);let i=0;t.forEach((o,s)=>{lG(o,!1,a=>{r[s]=a,++i===n&&e(r.join(fG))})})},C$e=(t,e)=>{const n=t.split(fG),r=[];for(let i=0;i<n.length;i++){const o=cG(n[i],e);if(r.push(o),o.type==="error")break}return r},dG=4;function ko(t){if(t)return R$e(t)}function R$e(t){for(var e in ko.prototype)t[e]=ko.prototype[e];return t}ko.prototype.on=ko.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this};ko.prototype.once=function(t,e){function n(){this.off(t,n),e.apply(this,arguments)}return n.fn=e,this.on(t,n),this};ko.prototype.off=ko.prototype.removeListener=ko.prototype.removeAllListeners=ko.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+t];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+t],this;for(var r,i=0;i<n.length;i++)if(r=n[i],r===e||r.fn===e){n.splice(i,1);break}return n.length===0&&delete this._callbacks["$"+t],this};ko.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),n=this._callbacks["$"+t],r=1;r<arguments.length;r++)e[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,e)}return this};ko.prototype.emitReserved=ko.prototype.emit;ko.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]};ko.prototype.hasListeners=function(t){return!!this.listeners(t).length};const bd=(()=>typeof self!="undefined"?self:typeof window!="undefined"?window:Function("return this")())();function hG(t,...e){return e.reduce((n,r)=>(t.hasOwnProperty(r)&&(n[r]=t[r]),n),{})}const A$e=setTimeout,I$e=clearTimeout;function r4(t,e){e.useNativeTimers?(t.setTimeoutFn=A$e.bind(bd),t.clearTimeoutFn=I$e.bind(bd)):(t.setTimeoutFn=setTimeout.bind(bd),t.clearTimeoutFn=clearTimeout.bind(bd))}const z$e=1.33;function L$e(t){return typeof t=="string"?M$e(t):Math.ceil((t.byteLength||t.size)*z$e)}function M$e(t){let e=0,n=0;for(let r=0,i=t.length;r<i;r++)e=t.charCodeAt(r),e<128?n+=1:e<2048?n+=2:e<55296||e>=57344?n+=3:(r++,n+=4);return n}class N$e extends Error{constructor(e,n,r){super(e),this.description=n,this.context=r,this.type="TransportError"}}class OG extends ko{constructor(e){super(),this.writable=!1,r4(this,e),this.opts=e,this.query=e.query,this.readyState="",this.socket=e.socket}onError(e,n,r){return super.emitReserved("error",new N$e(e,n,r)),this}open(){return(this.readyState==="closed"||this.readyState==="")&&(this.readyState="opening",this.doOpen()),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(e){this.readyState==="open"&&this.write(e)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(e){const n=cG(e,this.socket.binaryType);this.onPacket(n)}onPacket(e){super.emitReserved("packet",e)}onClose(e){this.readyState="closed",super.emitReserved("close",e)}}const pG="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),gQ=64,D$e={};let AM=0,Wb=0,IM;function zM(t){let e="";do e=pG[t%gQ]+e,t=Math.floor(t/gQ);while(t>0);return e}function mG(){const t=zM(+new Date);return t!==IM?(AM=0,IM=t):t+"."+zM(AM++)}for(;Wb<gQ;Wb++)D$e[pG[Wb]]=Wb;function gG(t){let e="";for(let n in t)t.hasOwnProperty(n)&&(e.length&&(e+="&"),e+=encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return e}function X$e(t){let e={},n=t.split("&");for(let r=0,i=n.length;r<i;r++){let o=n[r].split("=");e[decodeURIComponent(o[0])]=decodeURIComponent(o[1])}return e}let vG=!1;try{vG=typeof XMLHttpRequest!="undefined"&&"withCredentials"in new XMLHttpRequest}catch{}const W$e=vG;function yG(t){const e=t.xdomain;try{if(typeof XMLHttpRequest!="undefined"&&(!e||W$e))return new XMLHttpRequest}catch{}if(!e)try{return new bd[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}function U$e(){}const q$e=function(){return new yG({xdomain:!1}).responseType!=null}();class B$e extends OG{constructor(e){if(super(e),this.polling=!1,typeof location!="undefined"){const r=location.protocol==="https:";let i=location.port;i||(i=r?"443":"80"),this.xd=typeof location!="undefined"&&e.hostname!==location.hostname||i!==e.port,this.xs=e.secure!==r}const n=e&&e.forceBase64;this.supportsBinary=q$e&&!n}get name(){return"polling"}doOpen(){this.poll()}pause(e){this.readyState="pausing";const n=()=>{this.readyState="paused",e()};if(this.polling||!this.writable){let r=0;this.polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}poll(){this.polling=!0,this.doPoll(),this.emitReserved("poll")}onData(e){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};C$e(e,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this.polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this.poll())}doClose(){const e=()=>{this.write([{type:"close"}])};this.readyState==="open"?e():this.once("open",e)}write(e){this.writable=!1,E$e(e,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){let e=this.query||{};const n=this.opts.secure?"https":"http";let r="";this.opts.timestampRequests!==!1&&(e[this.opts.timestampParam]=mG()),!this.supportsBinary&&!e.sid&&(e.b64=1),this.opts.port&&(n==="https"&&Number(this.opts.port)!==443||n==="http"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port);const i=gG(e),o=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(i.length?"?"+i:"")}request(e={}){return Object.assign(e,{xd:this.xd,xs:this.xs},this.opts),new Ou(this.uri(),e)}doWrite(e,n){const r=this.request({method:"POST",data:e});r.on("success",n),r.on("error",(i,o)=>{this.onError("xhr post error",i,o)})}doPoll(){const e=this.request();e.on("data",this.onData.bind(this)),e.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=e}}class Ou extends ko{constructor(e,n){super(),r4(this,n),this.opts=n,this.method=n.method||"GET",this.uri=e,this.async=n.async!==!1,this.data=n.data!==void 0?n.data:null,this.create()}create(){const e=hG(this.opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");e.xdomain=!!this.opts.xd,e.xscheme=!!this.opts.xs;const n=this.xhr=new yG(e);try{n.open(this.method,this.uri,this.async);try{if(this.opts.extraHeaders){n.setDisableHeaderCheck&&n.setDisableHeaderCheck(!0);for(let r in this.opts.extraHeaders)this.opts.extraHeaders.hasOwnProperty(r)&&n.setRequestHeader(r,this.opts.extraHeaders[r])}}catch{}if(this.method==="POST")try{n.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{n.setRequestHeader("Accept","*/*")}catch{}"withCredentials"in n&&(n.withCredentials=this.opts.withCredentials),this.opts.requestTimeout&&(n.timeout=this.opts.requestTimeout),n.onreadystatechange=()=>{n.readyState===4&&(n.status===200||n.status===1223?this.onLoad():this.setTimeoutFn(()=>{this.onError(typeof n.status=="number"?n.status:0)},0))},n.send(this.data)}catch(r){this.setTimeoutFn(()=>{this.onError(r)},0);return}typeof document!="undefined"&&(this.index=Ou.requestsCount++,Ou.requests[this.index]=this)}onError(e){this.emitReserved("error",e,this.xhr),this.cleanup(!0)}cleanup(e){if(!(typeof this.xhr=="undefined"||this.xhr===null)){if(this.xhr.onreadystatechange=U$e,e)try{this.xhr.abort()}catch{}typeof document!="undefined"&&delete Ou.requests[this.index],this.xhr=null}}onLoad(){const e=this.xhr.responseText;e!==null&&(this.emitReserved("data",e),this.emitReserved("success"),this.cleanup())}abort(){this.cleanup()}}Ou.requestsCount=0;Ou.requests={};if(typeof document!="undefined"){if(typeof attachEvent=="function")attachEvent("onunload",LM);else if(typeof addEventListener=="function"){const t="onpagehide"in bd?"pagehide":"unload";addEventListener(t,LM,!1)}}function LM(){for(let t in Ou.requests)Ou.requests.hasOwnProperty(t)&&Ou.requests[t].abort()}const F$e=(()=>typeof Promise=="function"&&typeof Promise.resolve=="function"?e=>Promise.resolve().then(e):(e,n)=>n(e,0))(),Ub=bd.WebSocket||bd.MozWebSocket,MM=!0,Y$e="arraybuffer",NM=typeof navigator!="undefined"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class j$e extends OG{constructor(e){super(e),this.supportsBinary=!e.forceBase64}get name(){return"websocket"}doOpen(){if(!this.check())return;const e=this.uri(),n=this.opts.protocols,r=NM?{}:hG(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=MM&&!NM?n?new Ub(e,n):new Ub(e):new Ub(e,n,r)}catch(i){return this.emitReserved("error",i)}this.ws.binaryType=this.socket.binaryType||Y$e,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=e=>this.onClose({description:"websocket connection closed",context:e}),this.ws.onmessage=e=>this.onData(e.data),this.ws.onerror=e=>this.onError("websocket error",e)}write(e){this.writable=!1;for(let n=0;n<e.length;n++){const r=e[n],i=n===e.length-1;lG(r,this.supportsBinary,o=>{const s={};try{MM&&this.ws.send(o)}catch{}i&&F$e(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws!="undefined"&&(this.ws.close(),this.ws=null)}uri(){let e=this.query||{};const n=this.opts.secure?"wss":"ws";let r="";this.opts.port&&(n==="wss"&&Number(this.opts.port)!==443||n==="ws"&&Number(this.opts.port)!==80)&&(r=":"+this.opts.port),this.opts.timestampRequests&&(e[this.opts.timestampParam]=mG()),this.supportsBinary||(e.b64=1);const i=gG(e),o=this.opts.hostname.indexOf(":")!==-1;return n+"://"+(o?"["+this.opts.hostname+"]":this.opts.hostname)+r+this.opts.path+(i.length?"?"+i:"")}check(){return!!Ub}}const Z$e={websocket:j$e,polling:B$e},V$e=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,G$e=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function vQ(t){const e=t,n=t.indexOf("["),r=t.indexOf("]");n!=-1&&r!=-1&&(t=t.substring(0,n)+t.substring(n,r).replace(/:/g,";")+t.substring(r,t.length));let i=V$e.exec(t||""),o={},s=14;for(;s--;)o[G$e[s]]=i[s]||"";return n!=-1&&r!=-1&&(o.source=e,o.host=o.host.substring(1,o.host.length-1).replace(/;/g,":"),o.authority=o.authority.replace("[","").replace("]","").replace(/;/g,":"),o.ipv6uri=!0),o.pathNames=H$e(o,o.path),o.queryKey=K$e(o,o.query),o}function H$e(t,e){const n=/\/{2,9}/g,r=e.replace(n,"/").split("/");return(e.substr(0,1)=="/"||e.length===0)&&r.splice(0,1),e.substr(e.length-1,1)=="/"&&r.splice(r.length-1,1),r}function K$e(t,e){const n={};return e.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,i,o){i&&(n[i]=o)}),n}class Od extends ko{constructor(e,n={}){super(),e&&typeof e=="object"&&(n=e,e=null),e?(e=vQ(e),n.hostname=e.host,n.secure=e.protocol==="https"||e.protocol==="wss",n.port=e.port,e.query&&(n.query=e.query)):n.host&&(n.hostname=vQ(n.host).host),r4(this,n),this.secure=n.secure!=null?n.secure:typeof location!="undefined"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location!="undefined"?location.hostname:"localhost"),this.port=n.port||(typeof location!="undefined"&&location.port?location.port:this.secure?"443":"80"),this.transports=n.transports||["polling","websocket"],this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!0},n),this.opts.path=this.opts.path.replace(/\/$/,"")+"/",typeof this.opts.query=="string"&&(this.opts.query=X$e(this.opts.query)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingTimeoutTimer=null,typeof addEventListener=="function"&&(this.opts.closeOnBeforeunload&&addEventListener("beforeunload",()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},!1),this.hostname!=="localhost"&&(this.offlineEventListener=()=>{this.onClose("transport close",{description:"network connection lost"})},addEventListener("offline",this.offlineEventListener,!1))),this.open()}createTransport(e){const n=Object.assign({},this.opts.query);n.EIO=dG,n.transport=e,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts.transportOptions[e],this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port});return new Z$e[e](r)}open(){let e;if(this.opts.rememberUpgrade&&Od.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1)e="websocket";else if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}else e=this.transports[0];this.readyState="opening";try{e=this.createTransport(e)}catch{this.transports.shift(),this.open();return}e.open(),this.setTransport(e)}setTransport(e){this.transport&&this.transport.removeAllListeners(),this.transport=e,e.on("drain",this.onDrain.bind(this)).on("packet",this.onPacket.bind(this)).on("error",this.onError.bind(this)).on("close",n=>this.onClose("transport close",n))}probe(e){let n=this.createTransport(e),r=!1;Od.priorWebsocketSuccess=!1;const i=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",f=>{if(!r)if(f.type==="pong"&&f.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;Od.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(u(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const h=new Error("probe error");h.transport=n.name,this.emitReserved("upgradeError",h)}}))};function o(){r||(r=!0,u(),n.close(),n=null)}const s=f=>{const h=new Error("probe error: "+f);h.transport=n.name,o(),this.emitReserved("upgradeError",h)};function a(){s("transport closed")}function l(){s("socket closed")}function c(f){n&&f.name!==n.name&&o()}const u=()=>{n.removeListener("open",i),n.removeListener("error",s),n.removeListener("close",a),this.off("close",l),this.off("upgrading",c)};n.once("open",i),n.once("error",s),n.once("close",a),this.once("close",l),this.once("upgrading",c),n.open()}onOpen(){if(this.readyState="open",Od.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush(),this.readyState==="open"&&this.opts.upgrade&&this.transport.pause){let e=0;const n=this.upgrades.length;for(;e<n;e++)this.probe(this.upgrades[e])}}onPacket(e){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",e),this.emitReserved("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"ping":this.resetPingTimeout(),this.sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong");break;case"error":const n=new Error("server error");n.code=e.data,this.onError(n);break;case"message":this.emitReserved("data",e.data),this.emitReserved("message",e.data);break}}onHandshake(e){this.emitReserved("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.maxPayload=e.maxPayload,this.onOpen(),this.readyState!=="closed"&&this.resetPingTimeout()}resetPingTimeout(){this.clearTimeoutFn(this.pingTimeoutTimer),this.pingTimeoutTimer=this.setTimeoutFn(()=>{this.onClose("ping timeout")},this.pingInterval+this.pingTimeout),this.opts.autoUnref&&this.pingTimeoutTimer.unref()}onDrain(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const e=this.getWritablePackets();this.transport.send(e),this.prevBufferLen=e.length,this.emitReserved("flush")}}getWritablePackets(){if(!(this.maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const i=this.writeBuffer[r].data;if(i&&(n+=L$e(i)),r>0&&n>this.maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}write(e,n,r){return this.sendPacket("message",e,n,r),this}send(e,n,r){return this.sendPacket("message",e,n,r),this}sendPacket(e,n,r,i){if(typeof n=="function"&&(i=n,n=void 0),typeof r=="function"&&(i=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const o={type:e,data:n,options:r};this.emitReserved("packetCreate",o),this.writeBuffer.push(o),i&&this.once("flush",i),this.flush()}close(){const e=()=>{this.onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),e()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():e()}):this.upgrading?r():e()),this}onError(e){Od.priorWebsocketSuccess=!1,this.emitReserved("error",e),this.onClose("transport error",e)}onClose(e,n){(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")&&(this.clearTimeoutFn(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),typeof removeEventListener=="function"&&removeEventListener("offline",this.offlineEventListener,!1),this.readyState="closed",this.id=null,this.emitReserved("close",e,n),this.writeBuffer=[],this.prevBufferLen=0)}filterUpgrades(e){const n=[];let r=0;const i=e.length;for(;r<i;r++)~this.transports.indexOf(e[r])&&n.push(e[r]);return n}}Od.protocol=dG;function J$e(t,e="",n){let r=t;n=n||typeof location!="undefined"&&location,t==null&&(t=n.protocol+"//"+n.host),typeof t=="string"&&(t.charAt(0)==="/"&&(t.charAt(1)==="/"?t=n.protocol+t:t=n.host+t),/^(https?|wss?):\/\//.test(t)||(typeof n!="undefined"?t=n.protocol+"//"+t:t="https://"+t),r=vQ(t)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const o=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+o+":"+r.port+e,r.href=r.protocol+"://"+o+(n&&n.port===r.port?"":":"+r.port),r}const e5e=typeof ArrayBuffer=="function",t5e=t=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(t):t.buffer instanceof ArrayBuffer,bG=Object.prototype.toString,n5e=typeof Blob=="function"||typeof Blob!="undefined"&&bG.call(Blob)==="[object BlobConstructor]",r5e=typeof File=="function"||typeof File!="undefined"&&bG.call(File)==="[object FileConstructor]";function OE(t){return e5e&&(t instanceof ArrayBuffer||t5e(t))||n5e&&t instanceof Blob||r5e&&t instanceof File}function R$(t,e){if(!t||typeof t!="object")return!1;if(Array.isArray(t)){for(let n=0,r=t.length;n<r;n++)if(R$(t[n]))return!0;return!1}if(OE(t))return!0;if(t.toJSON&&typeof t.toJSON=="function"&&arguments.length===1)return R$(t.toJSON(),!0);for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&R$(t[n]))return!0;return!1}function i5e(t){const e=[],n=t.data,r=t;return r.data=yQ(n,e),r.attachments=e.length,{packet:r,buffers:e}}function yQ(t,e){if(!t)return t;if(OE(t)){const n={_placeholder:!0,num:e.length};return e.push(t),n}else if(Array.isArray(t)){const n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=yQ(t[r],e);return n}else if(typeof t=="object"&&!(t instanceof Date)){const n={};for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=yQ(t[r],e));return n}return t}function o5e(t,e){return t.data=bQ(t.data,e),t.attachments=void 0,t}function bQ(t,e){if(!t)return t;if(t&&t._placeholder)return e[t.num];if(Array.isArray(t))for(let n=0;n<t.length;n++)t[n]=bQ(t[n],e);else if(typeof t=="object")for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(t[n]=bQ(t[n],e));return t}const s5e=5;var xr;(function(t){t[t.CONNECT=0]="CONNECT",t[t.DISCONNECT=1]="DISCONNECT",t[t.EVENT=2]="EVENT",t[t.ACK=3]="ACK",t[t.CONNECT_ERROR=4]="CONNECT_ERROR",t[t.BINARY_EVENT=5]="BINARY_EVENT",t[t.BINARY_ACK=6]="BINARY_ACK"})(xr||(xr={}));class a5e{constructor(e){this.replacer=e}encode(e){return(e.type===xr.EVENT||e.type===xr.ACK)&&R$(e)?(e.type=e.type===xr.EVENT?xr.BINARY_EVENT:xr.BINARY_ACK,this.encodeAsBinary(e)):[this.encodeAsString(e)]}encodeAsString(e){let n=""+e.type;return(e.type===xr.BINARY_EVENT||e.type===xr.BINARY_ACK)&&(n+=e.attachments+"-"),e.nsp&&e.nsp!=="/"&&(n+=e.nsp+","),e.id!=null&&(n+=e.id),e.data!=null&&(n+=JSON.stringify(e.data,this.replacer)),n}encodeAsBinary(e){const n=i5e(e),r=this.encodeAsString(n.packet),i=n.buffers;return i.unshift(r),i}}class pE extends ko{constructor(e){super(),this.reviver=e}add(e){let n;if(typeof e=="string")n=this.decodeString(e),n.type===xr.BINARY_EVENT||n.type===xr.BINARY_ACK?(this.reconstructor=new l5e(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n);else if(OE(e)||e.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(e),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+e)}decodeString(e){let n=0;const r={type:Number(e.charAt(0))};if(xr[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===xr.BINARY_EVENT||r.type===xr.BINARY_ACK){const o=n+1;for(;e.charAt(++n)!=="-"&&n!=e.length;);const s=e.substring(o,n);if(s!=Number(s)||e.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(s)}if(e.charAt(n+1)==="/"){const o=n+1;for(;++n&&!(e.charAt(n)===","||n===e.length););r.nsp=e.substring(o,n)}else r.nsp="/";const i=e.charAt(n+1);if(i!==""&&Number(i)==i){const o=n+1;for(;++n;){const s=e.charAt(n);if(s==null||Number(s)!=s){--n;break}if(n===e.length)break}r.id=Number(e.substring(o,n+1))}if(e.charAt(++n)){const o=this.tryParse(e.substr(n));if(pE.isPayloadValid(r.type,o))r.data=o;else throw new Error("invalid payload")}return r}tryParse(e){try{return JSON.parse(e,this.reviver)}catch{return!1}}static isPayloadValid(e,n){switch(e){case xr.CONNECT:return typeof n=="object";case xr.DISCONNECT:return n===void 0;case xr.CONNECT_ERROR:return typeof n=="string"||typeof n=="object";case xr.EVENT:case xr.BINARY_EVENT:return Array.isArray(n)&&n.length>0;case xr.ACK:case xr.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&this.reconstructor.finishedReconstruction()}}class l5e{constructor(e){this.packet=e,this.buffers=[],this.reconPack=e}takeBinaryData(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){const n=o5e(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}var c5e=Object.freeze(Object.defineProperty({__proto__:null,protocol:s5e,get PacketType(){return xr},Encoder:a5e,Decoder:pE},Symbol.toStringTag,{value:"Module"}));function bc(t,e,n){return t.on(e,n),function(){t.off(e,n)}}const u5e=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class _G extends ko{constructor(e,n,r){super(),this.connected=!1,this.receiveBuffer=[],this.sendBuffer=[],this.ids=0,this.acks={},this.flags={},this.io=e,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const e=this.io;this.subs=[bc(e,"open",this.onopen.bind(this)),bc(e,"packet",this.onpacket.bind(this)),bc(e,"error",this.onerror.bind(this)),bc(e,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...e){return e.unshift("message"),this.emit.apply(this,e),this}emit(e,...n){if(u5e.hasOwnProperty(e))throw new Error('"'+e+'" is a reserved event name');n.unshift(e);const r={type:xr.EVENT,data:n};if(r.options={},r.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const s=this.ids++,a=n.pop();this._registerAckCallback(s,a),r.id=s}const i=this.io.engine&&this.io.engine.transport&&this.io.engine.transport.writable;return this.flags.volatile&&(!i||!this.connected)||(this.connected?(this.notifyOutgoingListeners(r),this.packet(r)):this.sendBuffer.push(r)),this.flags={},this}_registerAckCallback(e,n){const r=this.flags.timeout;if(r===void 0){this.acks[e]=n;return}const i=this.io.setTimeoutFn(()=>{delete this.acks[e];for(let o=0;o<this.sendBuffer.length;o++)this.sendBuffer[o].id===e&&this.sendBuffer.splice(o,1);n.call(this,new Error("operation has timed out"))},r);this.acks[e]=(...o)=>{this.io.clearTimeoutFn(i),n.apply(this,[null,...o])}}packet(e){e.nsp=this.nsp,this.io._packet(e)}onopen(){typeof this.auth=="function"?this.auth(e=>{this.packet({type:xr.CONNECT,data:e})}):this.packet({type:xr.CONNECT,data:this.auth})}onerror(e){this.connected||this.emitReserved("connect_error",e)}onclose(e,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",e,n)}onpacket(e){if(e.nsp===this.nsp)switch(e.type){case xr.CONNECT:if(e.data&&e.data.sid){const i=e.data.sid;this.onconnect(i)}else this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case xr.EVENT:case xr.BINARY_EVENT:this.onevent(e);break;case xr.ACK:case xr.BINARY_ACK:this.onack(e);break;case xr.DISCONNECT:this.ondisconnect();break;case xr.CONNECT_ERROR:this.destroy();const r=new Error(e.data.message);r.data=e.data.data,this.emitReserved("connect_error",r);break}}onevent(e){const n=e.data||[];e.id!=null&&n.push(this.ack(e.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(e){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,e)}super.emit.apply(this,e)}ack(e){const n=this;let r=!1;return function(...i){r||(r=!0,n.packet({type:xr.ACK,id:e,data:i}))}}onack(e){const n=this.acks[e.id];typeof n=="function"&&(n.apply(this,e.data),delete this.acks[e.id])}onconnect(e){this.id=e,this.connected=!0,this.emitBuffered(),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(e=>this.emitEvent(e)),this.receiveBuffer=[],this.sendBuffer.forEach(e=>{this.notifyOutgoingListeners(e),this.packet(e)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(e=>e()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:xr.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(e){return this.flags.compress=e,this}get volatile(){return this.flags.volatile=!0,this}timeout(e){return this.flags.timeout=e,this}onAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(e),this}prependAny(e){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(e),this}offAny(e){if(!this._anyListeners)return this;if(e){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(e===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(e),this}prependAnyOutgoing(e){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(e),this}offAnyOutgoing(e){if(!this._anyOutgoingListeners)return this;if(e){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(e===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(e){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,e.data)}}}function o0(t){t=t||{},this.ms=t.min||100,this.max=t.max||1e4,this.factor=t.factor||2,this.jitter=t.jitter>0&&t.jitter<=1?t.jitter:0,this.attempts=0}o0.prototype.duration=function(){var t=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var e=Math.random(),n=Math.floor(e*this.jitter*t);t=(Math.floor(e*10)&1)==0?t-n:t+n}return Math.min(t,this.max)|0};o0.prototype.reset=function(){this.attempts=0};o0.prototype.setMin=function(t){this.ms=t};o0.prototype.setMax=function(t){this.max=t};o0.prototype.setJitter=function(t){this.jitter=t};class _Q extends ko{constructor(e,n){var r;super(),this.nsps={},this.subs=[],e&&typeof e=="object"&&(n=e,e=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,r4(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new o0({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=e;const i=n.parser||c5e;this.encoder=new i.Encoder,this.decoder=new i.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection}reconnectionAttempts(e){return e===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=e,this)}reconnectionDelay(e){var n;return e===void 0?this._reconnectionDelay:(this._reconnectionDelay=e,(n=this.backoff)===null||n===void 0||n.setMin(e),this)}randomizationFactor(e){var n;return e===void 0?this._randomizationFactor:(this._randomizationFactor=e,(n=this.backoff)===null||n===void 0||n.setJitter(e),this)}reconnectionDelayMax(e){var n;return e===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=e,(n=this.backoff)===null||n===void 0||n.setMax(e),this)}timeout(e){return arguments.length?(this._timeout=e,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(e){if(~this._readyState.indexOf("open"))return this;this.engine=new Od(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const i=bc(n,"open",function(){r.onopen(),e&&e()}),o=bc(n,"error",s=>{r.cleanup(),r._readyState="closed",this.emitReserved("error",s),e?e(s):r.maybeReconnectOnOpen()});if(this._timeout!==!1){const s=this._timeout;s===0&&i();const a=this.setTimeoutFn(()=>{i(),n.close(),n.emit("error",new Error("timeout"))},s);this.opts.autoUnref&&a.unref(),this.subs.push(function(){clearTimeout(a)})}return this.subs.push(i),this.subs.push(o),this}connect(e){return this.open(e)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const e=this.engine;this.subs.push(bc(e,"ping",this.onping.bind(this)),bc(e,"data",this.ondata.bind(this)),bc(e,"error",this.onerror.bind(this)),bc(e,"close",this.onclose.bind(this)),bc(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(e){this.decoder.add(e)}ondecoded(e){this.emitReserved("packet",e)}onerror(e){this.emitReserved("error",e)}socket(e,n){let r=this.nsps[e];return r||(r=new _G(this,e,n),this.nsps[e]=r),r}_destroy(e){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(e){const n=this.encoder.encode(e);for(let r=0;r<n.length;r++)this.engine.write(n[r],e.options)}cleanup(){this.subs.forEach(e=>e()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close"),this.engine&&this.engine.close()}disconnect(){return this._close()}onclose(e,n){this.cleanup(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",e,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const e=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{e.skipReconnect||(this.emitReserved("reconnect_attempt",e.backoff.attempts),!e.skipReconnect&&e.open(i=>{i?(e._reconnecting=!1,e.reconnect(),this.emitReserved("reconnect_error",i)):e.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(function(){clearTimeout(r)})}}onreconnect(){const e=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",e)}}const V0={};function A$(t,e){typeof t=="object"&&(e=t,t=void 0),e=e||{};const n=J$e(t,e.path||"/socket.io"),r=n.source,i=n.id,o=n.path,s=V0[i]&&o in V0[i].nsps,a=e.forceNew||e["force new connection"]||e.multiplex===!1||s;let l;return a?l=new _Q(r,e):(V0[i]||(V0[i]=new _Q(r,e)),l=V0[i]),n.query&&!e.query&&(e.query=n.queryKey),l.socket(n.path,e)}Object.assign(A$,{Manager:_Q,Socket:_G,io:A$,connect:A$});var Yt=(t=>(t.Loading="loading",t.Ready="ready",t.Offline="offline",t.Online="online",t.Reconnecting="reconnecting",t.StatusChanged="statusChanged",t.PausePlayback="pausePlayback",t.LspStatusChanged="lspStatusChanged",t.PlaygroundChanged="playgroundChanged",t.Following="following",t.UnFollowing="unFollowing",t.RunStatusChanged="runStatusChanged",t.FileStructureChanged="fileStructureChanged",t.FileContentChanged="fileContentChanged",t.AppendToConsole="appendToConsole",t.AppendToTerminal="appendToTerminal",t.ApplicationAvailable="ApplicationAvailable",t.PlaybackInfo="playbackInfo",t.ReplayStart="ReplayStart",t.ReplayEnd="ReplayEnd",t.Customize="customize",t.UserEnter="userEnter",t.UserLeave="userLeave",t.UsersUpdated="usersUpdated",t.EditorScroll="editorScroll",t.ConnectionBroken="connectionBroken",t.ConnectionFailed="connectionFailed",t.AuthorizationFailed="authorizationFailed",t.FileStructureDamaged="fileStructureDamaged",t.ErrorFromServer="errorFromServer",t.AppendCustomizeFrameData="appendCustomizeFrameData",t.LineAction="lineAction",t.FileInfo="fileInfo",t.InsertTextById="insertTextById",t.ReplaceCodeById="replaceCodeById",t.UpdateAreaFlags="updateAreaFlags",t.Debug="debug",t.JumpToAreaById="jumpToAreaById",t.Xterm="xterm",t.ResourceMonitoring="resourceMonitoring",t.AnswerAreaOperate="answerAreaOperate",t.AnswerAreaInfo="answerAreaInfo",t.XtermInfo="xtermInfo",t))(Yt||{}),Yi=(t=>(t.RetainingAllFiles="retainingAllFiles",t.Authorize="auth",t.Active="active",t.Run="run",t.Stop="stop",t.Heartbeat="heartbeat",t.SetFileLockStatus="",t.SetFileVisiable="",t.AddFileToUnitTest="",t.RemoveFileFromUnitTest="",t.KeyEvent="keyEvent",t.File="file",t.CloseFile="closeFile",t.EditFile="editFile",t.FileTree="fileTree",t.Terminal="terminal",t.XtermStatus="XtermStatus",t.Cursor="cursor",t.GetPlaybackInfo="getPlaybackInfo",t.LoadPlaybackData="loadPlaybackData",t.FollowingAgentUser="followingAgentUser",t.UnFollowingAgentUser="unFollowingAgentUser",t.FollowingFocusComponent="followingFocusComponent",t.EditorScroll="editorScroll",t.CustomizeFrameData="appendCustomizeFrameData",t.AddCDNSource="addCDNSource",t.RestartServer="restartServer",t.RestartLSPServer="restartLSPServer",t.SwitchLanguage="switchLanguage",t.StatisticsPlaybackData="statisticsPlaybackData",t.ReconnectOnline="reconnectOnline",t))(Yi||{}),Ot=(t=>(t.Connect="connect",t.Disconnect="disconnect",t.AuthAck="authAck",t.Active="active",t.SyncPlaygroundInfo="syncPlaygroundInfo",t.ChangePlaygroundInfo="changePlaygroundInfo",t.RunStatus="runStatus",t.LspStatus="lspStatus",t.Following="following",t.UnFollowing="unFollowing",t.UserEnter="userEnter",t.UserLeave="userLeave",t.UsersUpdated="usersUpdated",t.FileWatchRefreshConfig="fileWatchRefreshConfig",t.ManualRefresh="manualRefresh",t.EditorBlur="editorBlur",t.ForceRefreshFile="forceRefreshFile",t.Simulator="simulator",t.PlaybackInfo="playbackInfo",t.PlaybackData="playbackData",t.File="file",t.FileTree="fileTree",t.Run="run",t.Console="console",t.Terminal="terminal",t.XtermStatus="XtermStatus",t.Editor="editor",t.Debug="debug",t.KeyEvent="keyEvent",t.CloseFile="closeFile",t.FocusComponent="FocusComponent",t.InvisibleComponentActive="InvisibleComponentActive",t.AppendCustomizeFrameData="appendCustomizeFrameData",t.TerminalStatus="terminalStatus",t.LspServerClientStateChange="lspServerClientStateChange",t.I18nLanguage="i18nLanguage",t.PushFormatCode="pushFormatCode",t.ResourceMonitoring="resourceMonitoring",t.CustomExecute="customExecute",t.SelectedUpdated="selectedUpdated",t.SetBreakPoint="setBreakPoint",t.DebugRun="debugRun",t.StoppedData="stoppedData",t.DebugNext="next",t.DebugContinue="continue",t.DebugStatus="debugStatus",t.DebugStepIn="stepIn",t.DebugStepOut="stepOut",t.Variables="variables",t.UpdateArea="updateArea",t.UpdateDebugSupport="updateDebugSupport",t.SyncDebugData="syncDebugData",t))(Ot||{}),Hg=(t=>(t.NotSupport="notSupport",t.Loading="loading",t.Running="running",t.Shutdown="shutdown",t.LspReady="lspReady",t.Uninitialized="uninitialized",t))(Hg||{});const $G="daoLogger",f5e=typeof module=="object"&&typeof module.exports=="object",Ik=f5e?global:window,SG=Ik&&Ik.localStorage?Ik.localStorage:{store:{},getItem(t){return this.store[t]},setItem(t,e){this.store[t]=e}},Qt=new Proxy(console,{get(t,e){return SG.getItem($G)?t[e]:()=>{}}}),d5e=()=>{SG.setItem($G,"*")};function Ta(t){return Ta=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ta(t)}function na(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function DM(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ra(t,e,n){return e&&DM(t.prototype,e),n&&DM(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function Bl(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function F5(t,e){return F5=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,i){return r.__proto__=i,r},F5(t,e)}function sh(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&F5(t,e)}function s0(t,e){if(e&&(Ta(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Bl(t)}function Vl(t){return Vl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Vl(t)}function Dn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function xG(t){if(Array.isArray(t))return t}function wG(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function $Q(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function mE(t,e){if(!!t){if(typeof t=="string")return $Q(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return $Q(t,e)}}function kG(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
49
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function h5e(t){return xG(t)||wG(t)||mE(t)||kG()}function XM(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function WM(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?XM(Object(n),!0).forEach(function(r){Dn(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):XM(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var O5e={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,n){console&&console[e]&&console[e].apply(console,n)}},p5e=function(){function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};na(this,t),this.init(e,n)}return ra(t,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=n||O5e,this.options=r,this.debug=r.debug}},{key:"setDebug",value:function(n){this.debug=n}},{key:"log",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return this.forward(r,"log","",!0)}},{key:"warn",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return this.forward(r,"warn","",!0)}},{key:"error",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return this.forward(r,"error","")}},{key:"deprecate",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return this.forward(r,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(n,r,i,o){return o&&!this.debug?null:(typeof n[0]=="string"&&(n[0]="".concat(i).concat(this.prefix," ").concat(n[0])),this.logger[r](n))}},{key:"create",value:function(n){return new t(this.logger,WM(WM({},{prefix:"".concat(this.prefix,":").concat(n,":")}),this.options))}}]),t}(),ou=new p5e,Fd=function(){function t(){na(this,t),this.observers={}}return ra(t,[{key:"on",value:function(n,r){var i=this;return n.split(" ").forEach(function(o){i.observers[o]=i.observers[o]||[],i.observers[o].push(r)}),this}},{key:"off",value:function(n,r){if(!!this.observers[n]){if(!r){delete this.observers[n];return}this.observers[n]=this.observers[n].filter(function(i){return i!==r})}}},{key:"emit",value:function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];if(this.observers[n]){var s=[].concat(this.observers[n]);s.forEach(function(l){l.apply(void 0,i)})}if(this.observers["*"]){var a=[].concat(this.observers["*"]);a.forEach(function(l){l.apply(l,[n].concat(i))})}}}]),t}();function G0(){var t,e,n=new Promise(function(r,i){t=r,e=i});return n.resolve=t,n.reject=e,n}function UM(t){return t==null?"":""+t}function m5e(t,e,n){t.forEach(function(r){e[r]&&(n[r]=e[r])})}function gE(t,e,n){function r(a){return a&&a.indexOf("###")>-1?a.replace(/###/g,"."):a}function i(){return!t||typeof t=="string"}for(var o=typeof e!="string"?[].concat(e):e.split(".");o.length>1;){if(i())return{};var s=r(o.shift());!t[s]&&n&&(t[s]=new n),Object.prototype.hasOwnProperty.call(t,s)?t=t[s]:t={}}return i()?{}:{obj:t,k:r(o.shift())}}function qM(t,e,n){var r=gE(t,e,Object),i=r.obj,o=r.k;i[o]=n}function g5e(t,e,n,r){var i=gE(t,e,Object),o=i.obj,s=i.k;o[s]=o[s]||[],r&&(o[s]=o[s].concat(n)),r||o[s].push(n)}function Y5(t,e){var n=gE(t,e),r=n.obj,i=n.k;if(!!r)return r[i]}function BM(t,e,n){var r=Y5(t,n);return r!==void 0?r:Y5(e,n)}function TG(t,e,n){for(var r in e)r!=="__proto__"&&r!=="constructor"&&(r in t?typeof t[r]=="string"||t[r]instanceof String||typeof e[r]=="string"||e[r]instanceof String?n&&(t[r]=e[r]):TG(t[r],e[r],n):t[r]=e[r]);return t}function ep(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var v5e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function y5e(t){return typeof t=="string"?t.replace(/[&<>"'\/]/g,function(e){return v5e[e]}):t}var i4=typeof window!="undefined"&&window.navigator&&typeof window.navigator.userAgentData=="undefined"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,b5e=[" ",",","?","!",";"];function _5e(t,e,n){e=e||"",n=n||"";var r=b5e.filter(function(a){return e.indexOf(a)<0&&n.indexOf(a)<0});if(r.length===0)return!0;var i=new RegExp("(".concat(r.map(function(a){return a==="?"?"\\?":a}).join("|"),")")),o=!i.test(t);if(!o){var s=t.indexOf(n);s>0&&!i.test(t.substring(0,s))&&(o=!0)}return o}function FM(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function qb(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?FM(Object(n),!0).forEach(function(r){Dn(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):FM(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function $5e(t){var e=S5e();return function(){var r=Vl(t),i;if(e){var o=Vl(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return s0(this,i)}}function S5e(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function PG(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!!t){if(t[e])return t[e];for(var r=e.split(n),i=t,o=0;o<r.length;++o){if(!i||typeof i[r[o]]=="string"&&o+1<r.length)return;if(i[r[o]]===void 0){for(var s=2,a=r.slice(o,o+s).join(n),l=i[a];l===void 0&&r.length>o+s;)s++,a=r.slice(o,o+s).join(n),l=i[a];if(l===void 0)return;if(l===null)return null;if(e.endsWith(a)){if(typeof l=="string")return l;if(a&&typeof l[a]=="string")return l[a]}var c=r.slice(o+s).join(n);return c?PG(l,c,n):void 0}i=i[r[o]]}return i}}var x5e=function(t){sh(n,t);var e=$5e(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return na(this,n),i=e.call(this),i4&&Fd.call(Bl(i)),i.data=r||{},i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.options.ignoreJSONStructure===void 0&&(i.options.ignoreJSONStructure=!0),i}return ra(n,[{key:"addNamespaces",value:function(i){this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}},{key:"removeNamespaces",value:function(i){var o=this.options.ns.indexOf(i);o>-1&&this.options.ns.splice(o,1)}},{key:"getResource",value:function(i,o,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,c=a.ignoreJSONStructure!==void 0?a.ignoreJSONStructure:this.options.ignoreJSONStructure,u=[i,o];s&&typeof s!="string"&&(u=u.concat(s)),s&&typeof s=="string"&&(u=u.concat(l?s.split(l):s)),i.indexOf(".")>-1&&(u=i.split("."));var f=Y5(this.data,u);return f||!c||typeof s!="string"?f:PG(this.data&&this.data[i]&&this.data[i][o],s,l)}},{key:"addResource",value:function(i,o,s,a){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},c=this.options.keySeparator;c===void 0&&(c=".");var u=[i,o];s&&(u=u.concat(c?s.split(c):s)),i.indexOf(".")>-1&&(u=i.split("."),a=o,o=u[1]),this.addNamespaces(o),qM(this.data,u,a),l.silent||this.emit("added",i,o,s,a)}},{key:"addResources",value:function(i,o,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var l in s)(typeof s[l]=="string"||Object.prototype.toString.apply(s[l])==="[object Array]")&&this.addResource(i,o,l,s[l],{silent:!0});a.silent||this.emit("added",i,o,s)}},{key:"addResourceBundle",value:function(i,o,s,a,l){var c=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},u=[i,o];i.indexOf(".")>-1&&(u=i.split("."),a=s,s=o,o=u[1]),this.addNamespaces(o);var f=Y5(this.data,u)||{};a?TG(f,s,l):f=qb(qb({},f),s),qM(this.data,u,f),c.silent||this.emit("added",i,o,s)}},{key:"removeResourceBundle",value:function(i,o){this.hasResourceBundle(i,o)&&delete this.data[i][o],this.removeNamespaces(o),this.emit("removed",i,o)}},{key:"hasResourceBundle",value:function(i,o){return this.getResource(i,o)!==void 0}},{key:"getResourceBundle",value:function(i,o){return o||(o=this.options.defaultNS),this.options.compatibilityAPI==="v1"?qb(qb({},{}),this.getResource(i,o)):this.getResource(i,o)}},{key:"getDataByLanguage",value:function(i){return this.data[i]}},{key:"hasLanguageSomeTranslations",value:function(i){var o=this.getDataByLanguage(i),s=o&&Object.keys(o)||[];return!!s.find(function(a){return o[a]&&Object.keys(o[a]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),n}(Fd),QG={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,n,r,i,o){var s=this;return e.forEach(function(a){s.processors[a]&&(n=s.processors[a].process(n,r,i,o))}),n}};function YM(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Bs(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?YM(Object(n),!0).forEach(function(r){Dn(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):YM(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function w5e(t){var e=k5e();return function(){var r=Vl(t),i;if(e){var o=Vl(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return s0(this,i)}}function k5e(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var jM={},ZM=function(t){sh(n,t);var e=w5e(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return na(this,n),i=e.call(this),i4&&Fd.call(Bl(i)),m5e(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r,Bl(i)),i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.logger=ou.create("translator"),i}return ra(n,[{key:"changeLanguage",value:function(i){i&&(this.language=i)}},{key:"exists",value:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(i==null)return!1;var s=this.resolve(i,o);return s&&s.res!==void 0}},{key:"extractFromKey",value:function(i,o){var s=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");var a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,l=o.ns||this.options.defaultNS||[],c=s&&i.indexOf(s)>-1,u=!this.options.userDefinedKeySeparator&&!o.keySeparator&&!this.options.userDefinedNsSeparator&&!o.nsSeparator&&!_5e(i,s,a);if(c&&!u){var f=i.match(this.interpolator.nestingRegexp);if(f&&f.length>0)return{key:i,namespaces:l};var h=i.split(s);(s!==a||s===a&&this.options.ns.indexOf(h[0])>-1)&&(l=h.shift()),i=h.join(a)}return typeof l=="string"&&(l=[l]),{key:i,namespaces:l}}},{key:"translate",value:function(i,o,s){var a=this;if(Ta(o)!=="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),o||(o={}),i==null)return"";Array.isArray(i)||(i=[String(i)]);var l=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,c=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,u=this.extractFromKey(i[i.length-1],o),f=u.key,h=u.namespaces,d=h[h.length-1],p=o.lng||this.language,b=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(p&&p.toLowerCase()==="cimode"){if(b){var y=o.nsSeparator||this.options.nsSeparator;return l?(O.res="".concat(d).concat(y).concat(f),O):"".concat(d).concat(y).concat(f)}return l?(O.res=f,O):f}var O=this.resolve(i,o),m=O&&O.res,v=O&&O.usedKey||f,$=O&&O.exactUsedKey||f,S=Object.prototype.toString.apply(m),w=["[object Number]","[object Function]","[object RegExp]"],k=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,I=!this.i18nFormat||this.i18nFormat.handleAsObject,L=typeof m!="string"&&typeof m!="boolean"&&typeof m!="number";if(I&&m&&L&&w.indexOf(S)<0&&!(typeof k=="string"&&S==="[object Array]")){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var C=this.options.returnedObjectHandler?this.options.returnedObjectHandler(v,m,Bs(Bs({},o),{},{ns:h})):"key '".concat(f," (").concat(this.language,")' returned an object instead of string.");return l?(O.res=C,O):C}if(c){var T=S==="[object Array]",E=T?[]:{},N=T?$:v;for(var G in m)if(Object.prototype.hasOwnProperty.call(m,G)){var j="".concat(N).concat(c).concat(G);E[G]=this.translate(j,Bs(Bs({},o),{joinArrays:!1,ns:h})),E[G]===j&&(E[G]=m[G])}m=E}}else if(I&&typeof k=="string"&&S==="[object Array]")m=m.join(k),m&&(m=this.extendTranslation(m,i,o,s));else{var A=!1,W=!1,q=o.count!==void 0&&typeof o.count!="string",K=n.hasDefaultValue(o),ie=q?this.pluralResolver.getSuffix(p,o.count,o):"",V=o["defaultValue".concat(ie)]||o.defaultValue;!this.isValidLookup(m)&&K&&(A=!0,m=V),this.isValidLookup(m)||(W=!0,m=f);var ne=o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,Pe=ne&&W?void 0:m,Ee=K&&V!==m&&this.options.updateMissing;if(W||A||Ee){if(this.logger.log(Ee?"updateKey":"missingKey",p,d,f,Ee?V:m),c){var H=this.resolve(f,Bs(Bs({},o),{},{keySeparator:!1}));H&&H.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var _e=[],re=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&re&&re[0])for(var ae=0;ae<re.length;ae++)_e.push(re[ae]);else this.options.saveMissingTo==="all"?_e=this.languageUtils.toResolveHierarchy(o.lng||this.language):_e.push(o.lng||this.language);var ee=function(Be,ot,Ve){var dt=K&&Ve!==m?Ve:Pe;a.options.missingKeyHandler?a.options.missingKeyHandler(Be,d,ot,dt,Ee,o):a.backendConnector&&a.backendConnector.saveMissing&&a.backendConnector.saveMissing(Be,d,ot,dt,Ee,o),a.emit("missingKey",Be,d,ot,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&q?_e.forEach(function(Re){a.pluralResolver.getSuffixes(Re,o).forEach(function(Be){ee([Re],f+Be,o["defaultValue".concat(Be)]||V)})}):ee(_e,f,V))}m=this.extendTranslation(m,i,o,O,s),W&&m===f&&this.options.appendNamespaceToMissingKey&&(m="".concat(d,":").concat(f)),(W||A)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(d,":").concat(f):f,A?m:void 0):m=this.options.parseMissingKeyHandler(m))}return l?(O.res=m,O):m}},{key:"extendTranslation",value:function(i,o,s,a,l){var c=this;if(this.i18nFormat&&this.i18nFormat.parse)i=this.i18nFormat.parse(i,Bs(Bs({},this.options.interpolation.defaultVariables),s),a.usedLng,a.usedNS,a.usedKey,{resolved:a});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init(Bs(Bs({},s),{interpolation:Bs(Bs({},this.options.interpolation),s.interpolation)}));var u=typeof i=="string"&&(s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),f;if(u){var h=i.match(this.interpolator.nestingRegexp);f=h&&h.length}var d=s.replace&&typeof s.replace!="string"?s.replace:s;if(this.options.interpolation.defaultVariables&&(d=Bs(Bs({},this.options.interpolation.defaultVariables),d)),i=this.interpolator.interpolate(i,d,s.lng||this.language,s),u){var p=i.match(this.interpolator.nestingRegexp),b=p&&p.length;f<b&&(s.nest=!1)}s.nest!==!1&&(i=this.interpolator.nest(i,function(){for(var m=arguments.length,v=new Array(m),$=0;$<m;$++)v[$]=arguments[$];return l&&l[0]===v[0]&&!s.context?(c.logger.warn("It seems you are nesting recursively key: ".concat(v[0]," in key: ").concat(o[0])),null):c.translate.apply(c,v.concat([o]))},s)),s.interpolation&&this.interpolator.reset()}var y=s.postProcess||this.options.postProcess,O=typeof y=="string"?[y]:y;return i!=null&&O&&O.length&&s.applyPostProcessor!==!1&&(i=QG.handle(O,i,o,this.options&&this.options.postProcessPassResolved?Bs({i18nResolved:a},s):s,this)),i}},{key:"resolve",value:function(i){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a,l,c,u,f;return typeof i=="string"&&(i=[i]),i.forEach(function(h){if(!o.isValidLookup(a)){var d=o.extractFromKey(h,s),p=d.key;l=p;var b=d.namespaces;o.options.fallbackNS&&(b=b.concat(o.options.fallbackNS));var y=s.count!==void 0&&typeof s.count!="string",O=y&&!s.ordinal&&s.count===0&&o.pluralResolver.shouldUseIntlApi(),m=s.context!==void 0&&(typeof s.context=="string"||typeof s.context=="number")&&s.context!=="",v=s.lngs?s.lngs:o.languageUtils.toResolveHierarchy(s.lng||o.language,s.fallbackLng);b.forEach(function($){o.isValidLookup(a)||(f=$,!jM["".concat(v[0],"-").concat($)]&&o.utils&&o.utils.hasLoadedNamespace&&!o.utils.hasLoadedNamespace(f)&&(jM["".concat(v[0],"-").concat($)]=!0,o.logger.warn('key "'.concat(l,'" for languages "').concat(v.join(", "),`" won't get resolved as namespace "`).concat(f,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),v.forEach(function(S){if(!o.isValidLookup(a)){u=S;var w=[p];if(o.i18nFormat&&o.i18nFormat.addLookupKeys)o.i18nFormat.addLookupKeys(w,p,S,$,s);else{var k;y&&(k=o.pluralResolver.getSuffix(S,s.count,s));var I="".concat(o.options.pluralSeparator,"zero");if(y&&(w.push(p+k),O&&w.push(p+I)),m){var L="".concat(p).concat(o.options.contextSeparator).concat(s.context);w.push(L),y&&(w.push(L+k),O&&w.push(L+I))}}for(var C;C=w.pop();)o.isValidLookup(a)||(c=C,a=o.getResource(S,$,C,s))}}))})}}),{res:a,usedKey:l,exactUsedKey:c,usedLng:u,usedNS:f}}},{key:"isValidLookup",value:function(i){return i!==void 0&&!(!this.options.returnNull&&i===null)&&!(!this.options.returnEmptyString&&i==="")}},{key:"getResource",value:function(i,o,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(i,o,s,a):this.resourceStore.getResource(i,o,s,a)}}],[{key:"hasDefaultValue",value:function(i){var o="defaultValue";for(var s in i)if(Object.prototype.hasOwnProperty.call(i,s)&&o===s.substring(0,o.length)&&i[s]!==void 0)return!0;return!1}}]),n}(Fd);function zk(t){return t.charAt(0).toUpperCase()+t.slice(1)}var T5e=function(){function t(e){na(this,t),this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ou.create("languageUtils")}return ra(t,[{key:"getScriptPartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return null;var r=n.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}},{key:"getLanguagePartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return n;var r=n.split("-");return this.formatLanguageCode(r[0])}},{key:"formatLanguageCode",value:function(n){if(typeof n=="string"&&n.indexOf("-")>-1){var r=["hans","hant","latn","cyrl","cans","mong","arab"],i=n.split("-");return this.options.lowerCaseLng?i=i.map(function(o){return o.toLowerCase()}):i.length===2?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=zk(i[1].toLowerCase()))):i.length===3&&(i[0]=i[0].toLowerCase(),i[1].length===2&&(i[1]=i[1].toUpperCase()),i[0]!=="sgn"&&i[2].length===2&&(i[2]=i[2].toUpperCase()),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=zk(i[1].toLowerCase())),r.indexOf(i[2].toLowerCase())>-1&&(i[2]=zk(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n}},{key:"isSupportedCode",value:function(n){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(n=this.getLanguagePartFromCode(n)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(n)>-1}},{key:"getBestMatchFromCodes",value:function(n){var r=this;if(!n)return null;var i;return n.forEach(function(o){if(!i){var s=r.formatLanguageCode(o);(!r.options.supportedLngs||r.isSupportedCode(s))&&(i=s)}}),!i&&this.options.supportedLngs&&n.forEach(function(o){if(!i){var s=r.getLanguagePartFromCode(o);if(r.isSupportedCode(s))return i=s;i=r.options.supportedLngs.find(function(a){if(a.indexOf(s)===0)return a})}}),i||(i=this.getFallbackCodes(this.options.fallbackLng)[0]),i}},{key:"getFallbackCodes",value:function(n,r){if(!n)return[];if(typeof n=="function"&&(n=n(r)),typeof n=="string"&&(n=[n]),Object.prototype.toString.apply(n)==="[object Array]")return n;if(!r)return n.default||[];var i=n[r];return i||(i=n[this.getScriptPartFromCode(r)]),i||(i=n[this.formatLanguageCode(r)]),i||(i=n[this.getLanguagePartFromCode(r)]),i||(i=n.default),i||[]}},{key:"toResolveHierarchy",value:function(n,r){var i=this,o=this.getFallbackCodes(r||this.options.fallbackLng||[],n),s=[],a=function(c){!c||(i.isSupportedCode(c)?s.push(c):i.logger.warn("rejecting language code not found in supportedLngs: ".concat(c)))};return typeof n=="string"&&n.indexOf("-")>-1?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(n)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(n)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(n))):typeof n=="string"&&a(this.formatLanguageCode(n)),o.forEach(function(l){s.indexOf(l)<0&&a(i.formatLanguageCode(l))}),s}}]),t}(),P5e=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Q5e={1:function(e){return Number(e>1)},2:function(e){return Number(e!=1)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(e==1?0:e>=2&&e<=4?1:2)},7:function(e){return Number(e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(e==1?0:e==2?1:e!=8&&e!=11?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(e==1?0:e==2?1:e<7?2:e<11?3:4)},11:function(e){return Number(e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(e!==0)},14:function(e){return Number(e==1?0:e==2?1:e==3?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:e!==0?1:2)},17:function(e){return Number(e==1||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(e==0?0:e==1?1:2)},19:function(e){return Number(e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(e==1?0:e==0||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3)}},E5e=["v1","v2","v3"],VM={zero:0,one:1,two:2,few:3,many:4,other:5};function C5e(){var t={};return P5e.forEach(function(e){e.lngs.forEach(function(n){t[n]={numbers:e.nr,plurals:Q5e[e.fc]}})}),t}var R5e=function(){function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};na(this,t),this.languageUtils=e,this.options=n,this.logger=ou.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl=="undefined"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=C5e()}return ra(t,[{key:"addRule",value:function(n,r){this.rules[n]=r}},{key:"getRule",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(n,{type:r.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[n]||this.rules[this.languageUtils.getLanguagePartFromCode(n)]}},{key:"needsPlural",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(n,r);return this.shouldUseIntlApi()?i&&i.resolvedOptions().pluralCategories.length>1:i&&i.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(n,i).map(function(o){return"".concat(r).concat(o)})}},{key:"getSuffixes",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.getRule(n,i);return o?this.shouldUseIntlApi()?o.resolvedOptions().pluralCategories.sort(function(s,a){return VM[s]-VM[a]}).map(function(s){return"".concat(r.options.prepend).concat(s)}):o.numbers.map(function(s){return r.getSuffix(n,s,i)}):[]}},{key:"getSuffix",value:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=this.getRule(n,i);return o?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(o.select(r)):this.getSuffixRetroCompatible(o,r):(this.logger.warn("no plural rule found for: ".concat(n)),"")}},{key:"getSuffixRetroCompatible",value:function(n,r){var i=this,o=n.noAbs?n.plurals(r):n.plurals(Math.abs(r)),s=n.numbers[o];this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1&&(s===2?s="plural":s===1&&(s=""));var a=function(){return i.options.prepend&&s.toString()?i.options.prepend+s.toString():s.toString()};return this.options.compatibilityJSON==="v1"?s===1?"":typeof s=="number"?"_plural_".concat(s.toString()):a():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1?a():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}},{key:"shouldUseIntlApi",value:function(){return!E5e.includes(this.options.compatibilityJSON)}}]),t}();function GM(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function lc(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?GM(Object(n),!0).forEach(function(r){Dn(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):GM(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var A5e=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};na(this,t),this.logger=ou.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||function(n){return n},this.init(e)}return ra(t,[{key:"init",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n.interpolation||(n.interpolation={escapeValue:!0});var r=n.interpolation;this.escape=r.escape!==void 0?r.escape:y5e,this.escapeValue=r.escapeValue!==void 0?r.escapeValue:!0,this.useRawValueToEscape=r.useRawValueToEscape!==void 0?r.useRawValueToEscape:!1,this.prefix=r.prefix?ep(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?ep(r.suffix):r.suffixEscaped||"}}",this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",",this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"",this.nestingPrefix=r.nestingPrefix?ep(r.nestingPrefix):r.nestingPrefixEscaped||ep("$t("),this.nestingSuffix=r.nestingSuffix?ep(r.nestingSuffix):r.nestingSuffixEscaped||ep(")"),this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",",this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3,this.alwaysFormat=r.alwaysFormat!==void 0?r.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var n="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(n,"g");var r="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(r,"g");var i="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(i,"g")}},{key:"interpolate",value:function(n,r,i,o){var s=this,a,l,c,u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function f(y){return y.replace(/\$/g,"$$$$")}var h=function(O){if(O.indexOf(s.formatSeparator)<0){var m=BM(r,u,O);return s.alwaysFormat?s.format(m,void 0,i,lc(lc(lc({},o),r),{},{interpolationkey:O})):m}var v=O.split(s.formatSeparator),$=v.shift().trim(),S=v.join(s.formatSeparator).trim();return s.format(BM(r,u,$),S,i,lc(lc(lc({},o),r),{},{interpolationkey:$}))};this.resetRegExp();var d=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,p=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,b=[{regex:this.regexpUnescape,safeValue:function(O){return f(O)}},{regex:this.regexp,safeValue:function(O){return s.escapeValue?f(s.escape(O)):f(O)}}];return b.forEach(function(y){for(c=0;a=y.regex.exec(n);){var O=a[1].trim();if(l=h(O),l===void 0)if(typeof d=="function"){var m=d(n,a,o);l=typeof m=="string"?m:""}else if(o&&o.hasOwnProperty(O))l="";else if(p){l=a[0];continue}else s.logger.warn("missed to pass in variable ".concat(O," for interpolating ").concat(n)),l="";else typeof l!="string"&&!s.useRawValueToEscape&&(l=UM(l));var v=y.safeValue(l);if(n=n.replace(a[0],v),p?(y.regex.lastIndex+=l.length,y.regex.lastIndex-=a[0].length):y.regex.lastIndex=0,c++,c>=s.maxReplaces)break}}),n}},{key:"nest",value:function(n,r){var i=this,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,a,l=lc({},o);l.applyPostProcessor=!1,delete l.defaultValue;function c(d,p){var b=this.nestingOptionsSeparator;if(d.indexOf(b)<0)return d;var y=d.split(new RegExp("".concat(b,"[ ]*{"))),O="{".concat(y[1]);d=y[0],O=this.interpolate(O,l),O=O.replace(/'/g,'"');try{l=JSON.parse(O),p&&(l=lc(lc({},p),l))}catch(m){return this.logger.warn("failed parsing options string in nesting for key ".concat(d),m),"".concat(d).concat(b).concat(O)}return delete l.defaultValue,d}for(;s=this.nestingRegexp.exec(n);){var u=[],f=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){var h=s[1].split(this.formatSeparator).map(function(d){return d.trim()});s[1]=h.shift(),u=h,f=!0}if(a=r(c.call(this,s[1].trim(),l),l),a&&s[0]===n&&typeof a!="string")return a;typeof a!="string"&&(a=UM(a)),a||(this.logger.warn("missed to resolve ".concat(s[1]," for nesting ").concat(n)),a=""),f&&(a=u.reduce(function(d,p){return i.format(d,p,o.lng,lc(lc({},o),{},{interpolationkey:s[1].trim()}))},a.trim())),n=n.replace(s[0],a),this.regexp.lastIndex=0}return n}}]),t}();function HM(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Vf(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?HM(Object(n),!0).forEach(function(r){Dn(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):HM(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function I5e(t){var e=t.toLowerCase().trim(),n={};if(t.indexOf("(")>-1){var r=t.split("(");e=r[0].toLowerCase().trim();var i=r[1].substring(0,r[1].length-1);if(e==="currency"&&i.indexOf(":")<0)n.currency||(n.currency=i.trim());else if(e==="relativetime"&&i.indexOf(":")<0)n.range||(n.range=i.trim());else{var o=i.split(";");o.forEach(function(s){if(!!s){var a=s.split(":"),l=h5e(a),c=l[0],u=l.slice(1),f=u.join(":").trim().replace(/^'+|'+$/g,"");n[c.trim()]||(n[c.trim()]=f),f==="false"&&(n[c.trim()]=!1),f==="true"&&(n[c.trim()]=!0),isNaN(f)||(n[c.trim()]=parseInt(f,10))}})}}return{formatName:e,formatOptions:n}}var z5e=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};na(this,t),this.logger=ou.create("formatter"),this.options=e,this.formats={number:function(r,i,o){return new Intl.NumberFormat(i,o).format(r)},currency:function(r,i,o){return new Intl.NumberFormat(i,Vf(Vf({},o),{},{style:"currency"})).format(r)},datetime:function(r,i,o){return new Intl.DateTimeFormat(i,Vf({},o)).format(r)},relativetime:function(r,i,o){return new Intl.RelativeTimeFormat(i,Vf({},o)).format(r,o.range||"day")},list:function(r,i,o){return new Intl.ListFormat(i,Vf({},o)).format(r)}},this.init(e)}return ra(t,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},i=r.interpolation;this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||","}},{key:"add",value:function(n,r){this.formats[n.toLowerCase().trim()]=r}},{key:"format",value:function(n,r,i,o){var s=this,a=r.split(this.formatSeparator),l=a.reduce(function(c,u){var f=I5e(u),h=f.formatName,d=f.formatOptions;if(s.formats[h]){var p=c;try{var b=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{},y=b.locale||b.lng||o.locale||o.lng||i;p=s.formats[h](c,y,Vf(Vf(Vf({},d),o),b))}catch(O){s.logger.warn(O)}return p}else s.logger.warn("there was no format function for ".concat(h));return c},n);return l}}]),t}();function KM(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function JM(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?KM(Object(n),!0).forEach(function(r){Dn(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):KM(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function L5e(t){var e=M5e();return function(){var r=Vl(t),i;if(e){var o=Vl(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return s0(this,i)}}function M5e(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function N5e(t,e){t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)}var D5e=function(t){sh(n,t);var e=L5e(n);function n(r,i,o){var s,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return na(this,n),s=e.call(this),i4&&Fd.call(Bl(s)),s.backend=r,s.store=i,s.services=o,s.languageUtils=o.languageUtils,s.options=a,s.logger=ou.create("backendConnector"),s.waitingReads=[],s.maxParallelReads=a.maxParallelReads||10,s.readingCalls=0,s.maxRetries=a.maxRetries>=0?a.maxRetries:5,s.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,s.state={},s.queue=[],s.backend&&s.backend.init&&s.backend.init(o,a.backend,a),s}return ra(n,[{key:"queueLoad",value:function(i,o,s,a){var l=this,c={},u={},f={},h={};return i.forEach(function(d){var p=!0;o.forEach(function(b){var y="".concat(d,"|").concat(b);!s.reload&&l.store.hasResourceBundle(d,b)?l.state[y]=2:l.state[y]<0||(l.state[y]===1?u[y]===void 0&&(u[y]=!0):(l.state[y]=1,p=!1,u[y]===void 0&&(u[y]=!0),c[y]===void 0&&(c[y]=!0),h[b]===void 0&&(h[b]=!0)))}),p||(f[d]=!0)}),(Object.keys(c).length||Object.keys(u).length)&&this.queue.push({pending:u,pendingCount:Object.keys(u).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(c),pending:Object.keys(u),toLoadLanguages:Object.keys(f),toLoadNamespaces:Object.keys(h)}}},{key:"loaded",value:function(i,o,s){var a=i.split("|"),l=a[0],c=a[1];o&&this.emit("failedLoading",l,c,o),s&&this.store.addResourceBundle(l,c,s),this.state[i]=o?-1:2;var u={};this.queue.forEach(function(f){g5e(f.loaded,[l],c),N5e(f,i),o&&f.errors.push(o),f.pendingCount===0&&!f.done&&(Object.keys(f.loaded).forEach(function(h){u[h]||(u[h]={});var d=f.loaded[h];d.length&&d.forEach(function(p){u[h][p]===void 0&&(u[h][p]=!0)})}),f.done=!0,f.errors.length?f.callback(f.errors):f.callback())}),this.emit("loaded",u),this.queue=this.queue.filter(function(f){return!f.done})}},{key:"read",value:function(i,o,s){var a=this,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,c=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,u=arguments.length>5?arguments[5]:void 0;if(!i.length)return u(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:i,ns:o,fcName:s,tried:l,wait:c,callback:u});return}return this.readingCalls++,this.backend[s](i,o,function(f,h){if(a.readingCalls--,a.waitingReads.length>0){var d=a.waitingReads.shift();a.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(f&&h&&l<a.maxRetries){setTimeout(function(){a.read.call(a,i,o,s,l+1,c*2,u)},c);return}u(f,h)})}},{key:"prepareLoading",value:function(i,o){var s=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),l&&l();typeof i=="string"&&(i=this.languageUtils.toResolveHierarchy(i)),typeof o=="string"&&(o=[o]);var c=this.queueLoad(i,o,a,l);if(!c.toLoad.length)return c.pending.length||l(),null;c.toLoad.forEach(function(u){s.loadOne(u)})}},{key:"load",value:function(i,o,s){this.prepareLoading(i,o,{},s)}},{key:"reload",value:function(i,o,s){this.prepareLoading(i,o,{reload:!0},s)}},{key:"loadOne",value:function(i){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=i.split("|"),l=a[0],c=a[1];this.read(l,c,"read",void 0,void 0,function(u,f){u&&o.logger.warn("".concat(s,"loading namespace ").concat(c," for language ").concat(l," failed"),u),!u&&f&&o.logger.log("".concat(s,"loaded namespace ").concat(c," for language ").concat(l),f),o.loaded(i,u,f)})}},{key:"saveMissing",value:function(i,o,s,a,l){var c=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(o)){this.logger.warn('did not save key "'.concat(s,'" as the namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}s==null||s===""||(this.backend&&this.backend.create&&this.backend.create(i,o,s,a,null,JM(JM({},c),{},{isUpdate:l})),!(!i||!i[0])&&this.store.addResource(i[0],o,s,a))}}]),n}(Fd);function X5e(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var n={};if(Ta(e[1])==="object"&&(n=e[1]),typeof e[1]=="string"&&(n.defaultValue=e[1]),typeof e[2]=="string"&&(n.tDescription=e[2]),Ta(e[2])==="object"||Ta(e[3])==="object"){var r=e[3]||e[2];Object.keys(r).forEach(function(i){n[i]=r[i]})}return n},interpolation:{escapeValue:!0,format:function(e,n,r,i){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function eN(t){return typeof t.ns=="string"&&(t.ns=[t.ns]),typeof t.fallbackLng=="string"&&(t.fallbackLng=[t.fallbackLng]),typeof t.fallbackNS=="string"&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t}function tN(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Uc(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?tN(Object(n),!0).forEach(function(r){Dn(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):tN(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function W5e(t){var e=U5e();return function(){var r=Vl(t),i;if(e){var o=Vl(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return s0(this,i)}}function U5e(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Bb(){}function q5e(t){var e=Object.getOwnPropertyNames(Object.getPrototypeOf(t));e.forEach(function(n){typeof t[n]=="function"&&(t[n]=t[n].bind(t))})}var j5=function(t){sh(n,t);var e=W5e(n);function n(){var r,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(na(this,n),r=e.call(this),i4&&Fd.call(Bl(r)),r.options=eN(i),r.services={},r.logger=ou,r.modules={external:[]},q5e(Bl(r)),o&&!r.isInitialized&&!i.isClone){if(!r.options.initImmediate)return r.init(i,o),s0(r,Bl(r));setTimeout(function(){r.init(i,o)},0)}return r}return ra(n,[{key:"init",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;typeof o=="function"&&(s=o,o={}),!o.defaultNS&&o.ns&&(typeof o.ns=="string"?o.defaultNS=o.ns:o.ns.indexOf("translation")<0&&(o.defaultNS=o.ns[0]));var a=X5e();this.options=Uc(Uc(Uc({},a),this.options),eN(o)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=Uc(Uc({},a.interpolation),this.options.interpolation)),o.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=o.keySeparator),o.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=o.nsSeparator);function l(O){return O?typeof O=="function"?new O:O:null}if(!this.options.isClone){this.modules.logger?ou.init(l(this.modules.logger),this.options):ou.init(null,this.options);var c;this.modules.formatter?c=this.modules.formatter:typeof Intl!="undefined"&&(c=z5e);var u=new T5e(this.options);this.store=new x5e(this.options.resources,this.options);var f=this.services;f.logger=ou,f.resourceStore=this.store,f.languageUtils=u,f.pluralResolver=new R5e(u,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),c&&(!this.options.interpolation.format||this.options.interpolation.format===a.interpolation.format)&&(f.formatter=l(c),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new A5e(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new D5e(l(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(O){for(var m=arguments.length,v=new Array(m>1?m-1:0),$=1;$<m;$++)v[$-1]=arguments[$];i.emit.apply(i,[O].concat(v))}),this.modules.languageDetector&&(f.languageDetector=l(this.modules.languageDetector),f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=l(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new ZM(this.services,this.options),this.translator.on("*",function(O){for(var m=arguments.length,v=new Array(m>1?m-1:0),$=1;$<m;$++)v[$-1]=arguments[$];i.emit.apply(i,[O].concat(v))}),this.modules.external.forEach(function(O){O.init&&O.init(i)})}if(this.format=this.options.interpolation.format,s||(s=Bb),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var h=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);h.length>0&&h[0]!=="dev"&&(this.options.lng=h[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var d=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];d.forEach(function(O){i[O]=function(){var m;return(m=i.store)[O].apply(m,arguments)}});var p=["addResource","addResources","addResourceBundle","removeResourceBundle"];p.forEach(function(O){i[O]=function(){var m;return(m=i.store)[O].apply(m,arguments),i}});var b=G0(),y=function(){var m=function($,S){i.isInitialized&&!i.initializedStoreOnce&&i.logger.warn("init: i18next is already initialized. You should call init just once!"),i.isInitialized=!0,i.options.isClone||i.logger.log("initialized",i.options),i.emit("initialized",i.options),b.resolve(S),s($,S)};if(i.languages&&i.options.compatibilityAPI!=="v1"&&!i.isInitialized)return m(null,i.t.bind(i));i.changeLanguage(i.options.lng,m)};return this.options.resources||!this.options.initImmediate?y():setTimeout(y,0),b}},{key:"loadResources",value:function(i){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Bb,a=s,l=typeof i=="string"?i:this.language;if(typeof i=="function"&&(a=i),!this.options.resources||this.options.partialBundledLanguages){if(l&&l.toLowerCase()==="cimode")return a();var c=[],u=function(d){if(!!d){var p=o.services.languageUtils.toResolveHierarchy(d);p.forEach(function(b){c.indexOf(b)<0&&c.push(b)})}};if(l)u(l);else{var f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.forEach(function(h){return u(h)})}this.options.preload&&this.options.preload.forEach(function(h){return u(h)}),this.services.backendConnector.load(c,this.options.ns,function(h){!h&&!o.resolvedLanguage&&o.language&&o.setResolvedLanguage(o.language),a(h)})}else a(null)}},{key:"reloadResources",value:function(i,o,s){var a=G0();return i||(i=this.languages),o||(o=this.options.ns),s||(s=Bb),this.services.backendConnector.reload(i,o,function(l){a.resolve(),s(l)}),a}},{key:"use",value:function(i){if(!i)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!i.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return i.type==="backend"&&(this.modules.backend=i),(i.type==="logger"||i.log&&i.warn&&i.error)&&(this.modules.logger=i),i.type==="languageDetector"&&(this.modules.languageDetector=i),i.type==="i18nFormat"&&(this.modules.i18nFormat=i),i.type==="postProcessor"&&QG.addPostProcessor(i),i.type==="formatter"&&(this.modules.formatter=i),i.type==="3rdParty"&&this.modules.external.push(i),this}},{key:"setResolvedLanguage",value:function(i){if(!(!i||!this.languages)&&!(["cimode","dev"].indexOf(i)>-1))for(var o=0;o<this.languages.length;o++){var s=this.languages[o];if(!(["cimode","dev"].indexOf(s)>-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}}},{key:"changeLanguage",value:function(i,o){var s=this;this.isLanguageChangingTo=i;var a=G0();this.emit("languageChanging",i);var l=function(h){s.language=h,s.languages=s.services.languageUtils.toResolveHierarchy(h),s.resolvedLanguage=void 0,s.setResolvedLanguage(h)},c=function(h,d){d?(l(d),s.translator.changeLanguage(d),s.isLanguageChangingTo=void 0,s.emit("languageChanged",d),s.logger.log("languageChanged",d)):s.isLanguageChangingTo=void 0,a.resolve(function(){return s.t.apply(s,arguments)}),o&&o(h,function(){return s.t.apply(s,arguments)})},u=function(h){!i&&!h&&s.services.languageDetector&&(h=[]);var d=typeof h=="string"?h:s.services.languageUtils.getBestMatchFromCodes(h);d&&(s.language||l(d),s.translator.language||s.translator.changeLanguage(d),s.services.languageDetector&&s.services.languageDetector.cacheUserLanguage(d)),s.loadResources(d,function(p){c(p,d)})};return!i&&this.services.languageDetector&&!this.services.languageDetector.async?u(this.services.languageDetector.detect()):!i&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(u):u(i),a}},{key:"getFixedT",value:function(i,o,s){var a=this,l=function c(u,f){var h;if(Ta(f)!=="object"){for(var d=arguments.length,p=new Array(d>2?d-2:0),b=2;b<d;b++)p[b-2]=arguments[b];h=a.options.overloadTranslationOptionHandler([u,f].concat(p))}else h=Uc({},f);h.lng=h.lng||c.lng,h.lngs=h.lngs||c.lngs,h.ns=h.ns||c.ns,h.keyPrefix=h.keyPrefix||s||c.keyPrefix;var y=a.options.keySeparator||".",O=h.keyPrefix?"".concat(h.keyPrefix).concat(y).concat(u):u;return a.t(O,h)};return typeof i=="string"?l.lng=i:l.lngs=i,l.ns=o,l.keyPrefix=s,l}},{key:"t",value:function(){var i;return this.translator&&(i=this.translator).translate.apply(i,arguments)}},{key:"exists",value:function(){var i;return this.translator&&(i=this.translator).exists.apply(i,arguments)}},{key:"setDefaultNamespace",value:function(i){this.options.defaultNS=i}},{key:"hasLoadedNamespace",value:function(i){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var a=this.resolvedLanguage||this.languages[0],l=this.options?this.options.fallbackLng:!1,c=this.languages[this.languages.length-1];if(a.toLowerCase()==="cimode")return!0;var u=function(d,p){var b=o.services.backendConnector.state["".concat(d,"|").concat(p)];return b===-1||b===2};if(s.precheck){var f=s.precheck(this,u);if(f!==void 0)return f}return!!(this.hasResourceBundle(a,i)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||u(a,i)&&(!l||u(c,i)))}},{key:"loadNamespaces",value:function(i,o){var s=this,a=G0();return this.options.ns?(typeof i=="string"&&(i=[i]),i.forEach(function(l){s.options.ns.indexOf(l)<0&&s.options.ns.push(l)}),this.loadResources(function(l){a.resolve(),o&&o(l)}),a):(o&&o(),Promise.resolve())}},{key:"loadLanguages",value:function(i,o){var s=G0();typeof i=="string"&&(i=[i]);var a=this.options.preload||[],l=i.filter(function(c){return a.indexOf(c)<0});return l.length?(this.options.preload=a.concat(l),this.loadResources(function(c){s.resolve(),o&&o(c)}),s):(o&&o(),Promise.resolve())}},{key:"dir",value:function(i){if(i||(i=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!i)return"rtl";var o=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"];return o.indexOf(this.services.languageUtils.getLanguagePartFromCode(i))>-1||i.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Bb,a=Uc(Uc(Uc({},this.options),o),{isClone:!0}),l=new n(a),c=["store","services","language"];return c.forEach(function(u){l[u]=i[u]}),l.services=Uc({},this.services),l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l.translator=new ZM(l.services,l.options),l.translator.on("*",function(u){for(var f=arguments.length,h=new Array(f>1?f-1:0),d=1;d<f;d++)h[d-1]=arguments[d];l.emit.apply(l,[u].concat(h))}),l.init(a,s),l.translator.options=l.options,l.translator.backendConnector.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),n}(Fd);Dn(j5,"createInstance",function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return new j5(t,e)});var To=j5.createInstance();To.createInstance=j5.createInstance;To.createInstance;To.init;To.loadResources;To.reloadResources;To.use;To.changeLanguage;To.getFixedT;var B5e=To.t;To.exists;To.setDefaultNamespace;To.hasLoadedNamespace;To.loadNamespaces;To.loadLanguages;function w1(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function Wo(t,e){if(t==null)return{};var n=w1(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,r)||(n[r]=t[r]))}return n}var F5e=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230);/g,Y5e={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"\xA9","©":"\xA9","®":"\xAE","®":"\xAE","…":"\u2026","…":"\u2026"},j5e=function(e){return Y5e[e]},Z5e=function(e){return e.replace(F5e,j5e)};function nN(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function rN(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?nN(Object(n),!0).forEach(function(r){Dn(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):nN(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var SQ={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Z5e},EG,V5e=z.exports.createContext();function G5e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};SQ=rN(rN({},SQ),t)}function H5e(){return SQ}var K5e=function(){function t(){na(this,t),this.usedNamespaces={}}return ra(t,[{key:"addUsedNamespaces",value:function(n){var r=this;n.forEach(function(i){r.usedNamespaces[i]||(r.usedNamespaces[i]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),t}();function J5e(t){EG=t}function e2e(){return EG}var t2e={type:"3rdParty",init:function(e){G5e(e.options.react),J5e(e)}};function n2e(){if(console&&console.warn){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];typeof n[0]=="string"&&(n[0]="react-i18next:: ".concat(n[0])),(t=console).warn.apply(t,n)}}var iN={};function xQ(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];typeof e[0]=="string"&&iN[e[0]]||(typeof e[0]=="string"&&(iN[e[0]]=new Date),n2e.apply(void 0,e))}function oN(t,e,n){t.loadNamespaces(e,function(){if(t.isInitialized)n();else{var r=function i(){setTimeout(function(){t.off("initialized",i)},0),n()};t.on("initialized",r)}})}function r2e(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=e.languages[0],i=e.options?e.options.fallbackLng:!1,o=e.languages[e.languages.length-1];if(r.toLowerCase()==="cimode")return!0;var s=function(l,c){var u=e.services.backendConnector.state["".concat(l,"|").concat(c)];return u===-1||u===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&e.services.backendConnector.backend&&e.isLanguageChangingTo&&!s(e.isLanguageChangingTo,t)?!1:!!(e.hasResourceBundle(r,t)||!e.services.backendConnector.backend||e.options.resources&&!e.options.partialBundledLanguages||s(r,t)&&(!i||s(o,t)))}function i2e(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!e.languages||!e.languages.length)return xQ("i18n.languages were undefined or empty",e.languages),!0;var r=e.options.ignoreJSONStructure!==void 0;return r?e.hasLoadedNamespace(t,{precheck:function(o,s){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&o.services.backendConnector.backend&&o.isLanguageChangingTo&&!s(o.isLanguageChangingTo,t))return!1}}):r2e(t,e,n)}function o2e(t,e){var n=t==null?null:typeof Symbol!="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,s,a;try{for(n=n.call(t);!(i=(s=n.next()).done)&&(r.push(s.value),!(e&&r.length===e));i=!0);}catch(l){o=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw a}}return r}}function En(t,e){return xG(t)||o2e(t,e)||mE(t,e)||kG()}function sN(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Lk(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?sN(Object(n),!0).forEach(function(r){Dn(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):sN(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var s2e=function(e,n){var r=z.exports.useRef();return z.exports.useEffect(function(){r.current=n?r.current:e},[e,n]),r.current};function ia(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.i18n,r=z.exports.useContext(V5e)||{},i=r.i18n,o=r.defaultNS,s=n||i||e2e();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new K5e),!s){xQ("You will need to pass in an i18next instance by using initReactI18next");var a=function(L){return Array.isArray(L)?L[L.length-1]:L},l=[a,{},!1];return l.t=a,l.i18n={},l.ready=!1,l}s.options.react&&s.options.react.wait!==void 0&&xQ("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var c=Lk(Lk(Lk({},H5e()),s.options.react),e),u=c.useSuspense,f=c.keyPrefix,h=t||o||s.options&&s.options.defaultNS;h=typeof h=="string"?[h]:h||["translation"],s.reportNamespaces.addUsedNamespaces&&s.reportNamespaces.addUsedNamespaces(h);var d=(s.isInitialized||s.initializedStoreOnce)&&h.every(function(I){return i2e(I,s,c)});function p(){return s.getFixedT(null,c.nsMode==="fallback"?h:h[0],f)}var b=z.exports.useState(p),y=En(b,2),O=y[0],m=y[1],v=h.join(),$=s2e(v),S=z.exports.useRef(!0);z.exports.useEffect(function(){var I=c.bindI18n,L=c.bindI18nStore;S.current=!0,!d&&!u&&oN(s,h,function(){S.current&&m(p)}),d&&$&&$!==v&&S.current&&m(p);function C(){S.current&&m(p)}return I&&s&&s.on(I,C),L&&s&&s.store.on(L,C),function(){S.current=!1,I&&s&&I.split(" ").forEach(function(T){return s.off(T,C)}),L&&s&&L.split(" ").forEach(function(T){return s.store.off(T,C)})}},[s,v]);var w=z.exports.useRef(!0);z.exports.useEffect(function(){S.current&&!w.current&&m(p),w.current=!1},[s]);var k=[O,s,d];if(k.t=O,k.i18n=s,k.ready=d,d||!d&&!u)return k;throw new Promise(function(I){oN(s,h,function(){I()})})}var a2e={common_success:"Success",common_confirm:"Confirm",common_cancel:"Cancel",common_delete:"Delete",common_hidden:"Hidden",common_locked:"Locked",common_offline:"Offline",common_directory:"Directory",common_file:"File",editor_no_open_file:"None file opened",editor_large_file_tip:"The file size is over 16 MB, preview is not supported",editor_unsupported_format_file_cannot_display:"The file cannot be displayed for unsupported format",editor_picture_not_support_preview:"Picture's preview is not yet supported",editor_search_files_by_name:"Search files by name",editor_pending_update:"{{pendingUpdate}} updates to be written",editor_ot_success:"Success",editor_file_is_not_editable:"The file is not editable",editor_image_preview_failed_to_load_image:"Failed to load image",editor_image_preview_loading:"loading",file_tree_click_to_show:"Click to show",file_tree_click_to_hidden:"Click to hide",file_tree_click_to_cancel:"Click to cancel",file_tree_click_to_locked:"Click to lock",file_tree_joined_the_test:"Joined the test",file_tree_click_to_remove:"Click to remove",file_tree_add_test:"Add test",file_tree_num_of_files_cannot_exceed_500:"The number of files cannot exceed 500",file_tree_x_existed:"{{x}} existed",\u56DE\u653E\u5DF2\u6682\u505C:"Playback already pause.",\u56DE\u653E\u6A21\u5F0F\u4E0D\u652F\u6301\u6253\u5F00\u8BE5\u6587\u4EF6:"Cannot open the file with playback mode.",file_tree_x_filtered:"{{x}} filtered",file_tree_x_upload_not_allowed:"Upload of {{x}} not allowed",file_tree_renamed:"Renamed",file_tree_upload_files:"Upload files",file_tree_upload_folder:"Upload folder",show_hidden_files:"Show Hidden files",do_no_show_hidden_files:"Do not show hidden files",file_tree_rename:"Rename",file_tree_create_new_file:"New file",file_tree_create_new_folder:"New folder",file_tree_down_file:"Download",file_tree_failed_to_download_file:"Failed to download file",file_tree_make_sure_delete_x_unrecoverable:"Are you sure to delete this {{x}}? The file cannot be recovered after deletion",file_tree_kind_tips:"Notice",file_tree_understood:"Know",file_tree_space_char_exist_in_file_or_folder:"There is a space character",file_tree_file_exceeds_size_limit:"The file {{filePath}} exceeds the size limit of 16M",file_tree_rename_cannot_be_empty:"Rename cannot be empty",output_browser_click_run_start_application:"Click \u3010Run\u3011 to start the application",helpers_invalid_parameter_rate_x:"Invalid parameter: rate={{x}}",lib_the_area_already_set_answer_area_cannot_repeatedly:"The area has already set the answering area and cannot be set repeatedly",lib_x_file_cannot_set_the_answer_area:"The {{x}} file cannot set the answer area",lib_locked:"locked",lib_hidden:"hidden",store_user_not_found:"User not found",store_appStatus_transition_error_x:"AppStatus transition error: {{x}}",dao_channel_agentUserId_x_inconsistent:"The agentUserId {{x}} is inconsistent",dao_channel_event_x_is_not_supported:"Event {{x}} is not supported",dao_channel_connection_not_established:"The connection has not been established yet",dao_channel_playground_not_exist:"Playground does not exist",dao_channel_playground_unbound_container:"Playground unbound container",dao_channel_container_startup_failed:"Container startup failed",dao_channel_insufficient_server_resources:"Insufficient server resources",dao_channel_server_is_busy:"Server is busy",dao_channel_activation_timeout:"Docker activation timeout",dao_channel_docker_failed_to_activate:"Docker failed to start",dao_channel_socket_is_not_ready:"Socket is not ready",dao_channel_socket_is_not_ready_for_x:"Socket is not ready for {{x}}",dao_channel_socket_connect_broken:"Socket connection broken",debug_variables:"Variables",debug_call_stack:"Call stack",debug_staring:"staring",debug_tooltip_run:"Run",debug_tooltip_stop:"Stop",debug_tooltip_continue:"Continue",debug_tooltip_step_over:"Step Over",debug_tooltip_step_into:"Step Into",debug_tooltip_step_out:"Step Out",debug_call_stack_cannot_open_file:"Cannot open non-workspace file",dao_paas_cannot_follow_each_other:"Cannot follow each other",\u4E0D\u80FD\u76F4\u63A5\u590D\u5236\u7B54\u9898\u533A\u57DF\u5185\u5BB9:"Cannt copy the content",\u8BE5\u533A\u57DF\u4E0D\u53EF\u7F16\u8F91:"Cannt edit the content",dao_paas_not_find_mount_dom_object_for_x:"Could not find mounted DOM object for {{x}}",dao_paas_x_component_is_not_supported:"{{x}} component is not supported",dao_paas_no_ready:"No ready",\u8BF7\u5728\u6587\u4EF6\u6811\u4E2D\u6253\u5F00\u6587\u4EF6\u8FDB\u884C\u7F16\u8F91:"Pleas go to file tree to select one file and open it",dao_paas_file_does_not_exist:"File does not exist",dao_pass_set_answer_wrong:"Get wrong when insert answer for question",dao_paas_docker_has_been_destoryed:"docker has been destroyed","Unable to create file or directory with system reserved name":"Unable to create file or directory with system reserved name","The file or folder {{path}} already exists in this location, please choose another name":"The file or folder {{path}} already exists in this location, please choose another name","No results":"No results","Collapse the file tree":"Collapse the file tree","Create or rename to hidden files, will not be visible":"Create or rename to hidden files, will not be visible","Live refresh":"Live refresh","Code diagnosis":"Code diagnosis"},l2e={common_success:"\u6210\u529F",common_confirm:"\u786E\u5B9A",common_cancel:"\u53D6\u6D88",common_delete:"\u5220\u9664",common_hidden:"\u5DF2\u9690\u85CF",common_locked:"\u5DF2\u52A0\u9501",common_offline:"\u79BB\u7EBF",common_directory:"\u76EE\u5F55",common_file:"\u6587\u4EF6",editor_no_open_file:"\u672A\u6253\u5F00\u6587\u4EF6",editor_large_file_tip:"\u6587\u4EF6\u8D85\u8FC716\u5146\u5927\u5C0F\uFF0C\u6682\u4E0D\u652F\u6301\u9884\u89C8",editor_unsupported_format_file_cannot_display:"\u6B64\u6587\u4EF6\u662F\u4E8C\u8FDB\u5236\u6587\u4EF6\u6216\u4F7F\u7528\u4E86\u4E0D\u652F\u6301\u7684\u6587\u4EF6\u7F16\u7801\uFF0C\u65E0\u6CD5\u5728\u7F16\u8F91\u5668\u4E2D\u663E\u793A",editor_picture_not_support_preview:"\u56FE\u7247\u6682\u65F6\u4E0D\u652F\u6301\u9884\u89C8",editor_search_files_by_name:"\u6309\u540D\u79F0\u641C\u7D22\u6587\u4EF6",editor_pending_update:"{{pendingUpdate}}\u4E2A\u66F4\u65B0\u5F85\u5199\u5165",editor_ot_success:"\u6210\u529F",editor_file_is_not_editable:"\u8BE5\u6587\u4EF6\u4E0D\u53EF\u7F16\u8F91",editor_image_preview_failed_to_load_image:"\u52A0\u8F7D\u56FE\u7247\u5931\u8D25",editor_image_preview_loading:"\u52A0\u8F7D\u4E2D...",file_tree_click_to_show:"\u70B9\u51FB\u663E\u793A",file_tree_click_to_hidden:"\u70B9\u51FB\u9690\u85CF",file_tree_click_to_cancel:"\u70B9\u51FB\u53D6\u6D88",file_tree_click_to_locked:"\u70B9\u51FB\u9501\u5B9A",file_tree_joined_the_test:"\u5DF2\u52A0\u5165\u6D4B\u8BD5",file_tree_click_to_remove:"\u70B9\u51FB\u79FB\u9664",file_tree_add_test:"\u6DFB\u52A0\u6D4B\u8BD5",file_tree_num_of_files_cannot_exceed_500:"\u6587\u4EF6\u6570\u91CF\u4E0D\u80FD\u8D85\u8FC7500",file_tree_x_existed:"{{x}}\u5DF2\u5B58\u5728",\u56DE\u653E\u5DF2\u6682\u505C:"\u56DE\u653E\u5DF2\u6682\u505C",\u56DE\u653E\u6A21\u5F0F\u4E0D\u652F\u6301\u6253\u5F00\u8BE5\u6587\u4EF6:"\u56DE\u653E\u6A21\u5F0F\u4E0D\u652F\u6301\u6253\u5F00\u8BE5\u6587\u4EF6",file_tree_x_filtered:"{{x}}\u88AB\u8FC7\u6EE4",file_tree_x_upload_not_allowed:"{{x}}\u4E0D\u5141\u8BB8\u4E0A\u4F20",file_tree_renamed:"\u91CD\u540D\u4E86",file_tree_upload_files:"\u4E0A\u4F20\u6587\u4EF6",file_tree_upload_folder:"\u4E0A\u4F20\u6587\u4EF6\u5939",show_hidden_files:"\u663E\u793A\u9690\u85CF\u6587\u4EF6",do_no_show_hidden_files:"\u4E0D\u663E\u793A\u9690\u85CF\u6587\u4EF6",file_tree_rename:"\u91CD\u547D\u540D",file_tree_create_new_file:"\u65B0\u5EFA\u6587\u4EF6",file_tree_create_new_folder:"\u65B0\u5EFA\u6587\u4EF6\u5939",file_tree_down_file:"\u4E0B\u8F7D",file_tree_failed_to_download_file:"\u4E0B\u8F7D\u6587\u4EF6\u5931\u8D25",file_tree_make_sure_delete_x_unrecoverable:"\u786E\u5B9A\u5220\u9664\u8FD9\u4E2A{{x}}\u5417\uFF1F\u5220\u9664\u540E\u4E0D\u53EF\u6062\u590D",file_tree_kind_tips:"\u6E29\u99A8\u63D0\u793A",file_tree_understood:"\u77E5\u9053\u4E86",file_tree_space_char_exist_in_file_or_folder:"\u5B58\u5728\u7A7A\u683C\u5B57\u7B26",file_tree_file_exceeds_size_limit:"\u6587\u4EF6{{filePath}}\u8D85\u51FA\u4E8616M\u7684\u5927\u5C0F\u9650\u5236",file_tree_rename_cannot_be_empty:"\u91CD\u547D\u540D\u4E0D\u80FD\u4E3A\u7A7A",output_browser_click_run_start_application:"\u70B9\u51FB\u3010\u8FD0\u884C\u3011\u542F\u52A8\u5E94\u7528",helpers_invalid_parameter_rate_x:"\u65E0\u6548\u7684\u53C2\u6570: rate={{x}}",lib_the_area_already_set_answer_area_cannot_repeatedly:"\u8BE5\u533A\u57DF\u5DF2\u8BBE\u7F6E\u7B54\u9898\u533A\uFF0C\u4E0D\u53EF\u91CD\u590D\u8BBE\u7F6E",lib_x_file_cannot_set_the_answer_area:"{{x}}\u6587\u4EF6\u4E0D\u53EF\u4EE5\u8BBE\u7F6E\u7B54\u9898\u533A",lib_locked:"\u52A0\u9501",lib_hidden:"\u9690\u85CF",store_user_not_found:"\u627E\u4E0D\u5230\u7528\u6237",store_appStatus_transition_error_x:"appStatus \u8F6C\u6362\u9519\u8BEF: {{x}}",dao_channel_agentUserId_x_inconsistent:"agentUserId {{x}} \u4E0D\u4E00\u81F4",dao_channel_event_x_is_not_supported:"\u4E8B\u4EF6 {{x}} \u4E0D\u652F\u6301",dao_channel_connection_not_established:"\u8FDE\u63A5\u5C1A\u672A\u5EFA\u7ACB",dao_channel_playground_not_exist:"playground\u4E0D\u5B58\u5728",dao_channel_playground_unbound_container:"playground\u672A\u7ED1\u5B9A\u5BB9\u5668",dao_channel_container_startup_failed:"\u5BB9\u5668\u542F\u52A8\u5931\u8D25",dao_channel_insufficient_server_resources:"\u670D\u52A1\u5668\u8D44\u6E90\u4E0D\u8DB3",dao_channel_server_is_busy:"\u670D\u52A1\u5668\u7E41\u5FD9",dao_channel_activation_timeout:"docker\u6FC0\u6D3B\u8D85\u65F6",dao_channel_docker_failed_to_activate:"docker\u542F\u52A8\u5931\u8D25",dao_channel_socket_is_not_ready:"socket\u672A\u51C6\u5907\u597D",dao_channel_socket_is_not_ready_for_x:"socket \u8FD8\u6CA1\u6709\u4E3A{{x}}\u51C6\u5907\u597D",dao_channel_socket_connect_broken:"socket\u8FDE\u63A5\u4E2D\u65AD",debug_variables:"\u53D8\u91CF",debug_call_stack:"\u8C03\u7528\u5806\u6808",debug_staring:"\u542F\u52A8\u4E2D",debug_tooltip_run:"\u8FD0\u884C",debug_tooltip_stop:"\u505C\u6B62",debug_tooltip_continue:"\u7EE7\u7EED",debug_tooltip_step_over:"\u5355\u6B65\u8DF3\u8FC7",debug_tooltip_step_into:"\u5355\u6B65\u8C03\u8BD5",debug_tooltip_step_out:"\u5355\u6B65\u8DF3\u51FA",debug_call_stack_cannot_open_file:"\u65E0\u6CD5\u6253\u5F00\u975E\u5DE5\u4F5C\u533A\u6587\u4EF6",dao_paas_cannot_follow_each_other:"\u4E0D\u80FD\u4E92\u76F8\u8DDF\u968F",\u4E0D\u80FD\u76F4\u63A5\u590D\u5236\u7B54\u9898\u533A\u57DF\u5185\u5BB9:"\u4E0D\u80FD\u76F4\u63A5\u590D\u5236\u7B54\u9898\u533A\u57DF\u5185\u5BB9",\u8BE5\u533A\u57DF\u4E0D\u53EF\u7F16\u8F91:"\u8BE5\u533A\u57DF\u4E0D\u53EF\u7F16\u8F91",dao_paas_not_find_mount_dom_object_for_x:"\u627E\u4E0D\u5230\u4E3A{{x}}\u7684\u6302\u8F7DDOM\u5BF9\u8C61",dao_paas_x_component_is_not_supported:"\u7EC4\u4EF6{{x}}\u4E0D\u652F\u6301",dao_paas_no_ready:"\u672A\u51C6\u5907",\u8BF7\u5728\u6587\u4EF6\u6811\u4E2D\u6253\u5F00\u6587\u4EF6\u8FDB\u884C\u7F16\u8F91:"\u8BF7\u5728\u6587\u4EF6\u6811\u4E2D\u6253\u5F00\u6587\u4EF6\u8FDB\u884C\u7F16\u8F91",dao_paas_file_does_not_exist:"\u6587\u4EF6\u4E0D\u5B58\u5728",dao_pass_set_answer_wrong:"\u8BBE\u7F6E\u9898\u76EE\u7B54\u6848\u9519\u8BEF",dao_paas_docker_has_been_destoryed:"docker\u5DF2\u7ECF\u88AB\u9500\u6BC1","Unable to create file or directory with system reserved name":"\u65E0\u6CD5\u4F7F\u7528\u7CFB\u7EDF\u4FDD\u7559\u540D\u79F0\u521B\u5EFA\u6587\u4EF6\u6216\u76EE\u5F55","The file or folder {{path}} already exists in this location, please choose another name":"\u6B64\u4F4D\u7F6E\u5DF2\u5B58\u5728\u6587\u4EF6\u6216\u8005\u6587\u4EF6\u5939 {{path}}\uFF0C\u8BF7\u9009\u62E9\u5176\u5B83\u540D\u79F0","No results":"\u6CA1\u6709\u7ED3\u679C","Collapse the file tree":"\u6536\u8D77\u6587\u4EF6\u6811","Create or rename to hidden files, will not be visible":"\u521B\u5EFA\u6216\u8005\u91CD\u547D\u540D\u4E3A\u9690\u85CF\u6587\u4EF6\uFF0C\u5C06\u4E0D\u53EF\u89C1","Live refresh":"\u5B9E\u65F6\u5237\u65B0","Code diagnosis":"\u4EE3\u7801\u8BCA\u65AD"},Z5=(t=>(t.ZH="ZH",t.EN="EN",t))(Z5||{});const c2e={EN:{translation:a2e},ZH:{translation:l2e}},u2e="ZH";To.use(t2e).init({resources:c2e,lng:u2e,keySeparator:!1,interpolation:{escapeValue:!1}});const qn=To.t,f2e=[1,2,3,5,8,16];class d2e{constructor(e,n,r,i,o,s,a,l){ct(this,"start");ct(this,"end");ct(this,"totalTime");ct(this,"rate");ct(this,"preFrameTime",0);ct(this,"resumeTime",0);ct(this,"dataBuffer",[]);ct(this,"playing",!1);ct(this,"isReplay",!1);ct(this,"index",0);ct(this,"firstFrameTime",0);ct(this,"isMovePosition",!1);ct(this,"preTerminalIndex",{});ct(this,"preDebugIndex",{});ct(this,"preFireTreeIndex",{});ct(this,"preTerminalDockerId","");ct(this,"preConsoleDockerId","");ct(this,"isStopMovePosition",!1);ct(this,"triggerEventForMaxTimespanRecord","");ct(this,"triggerEventForMaxTimespan",-1);ct(this,"eventCustomize");ct(this,"eventDispatcher");ct(this,"getPlaybackSnapshot");ct(this,"progressDispatcher");ct(this,"currentDockerId");this.start=e,this.end=n,this.rate=1,this.totalTime=n-e,this.triggerEventForMaxTimespan=i,this.eventDispatcher=o,this.progressDispatcher=s,this.getPlaybackSnapshot=a,this.eventCustomize=l,this.step=this.step.bind(this),this.currentDockerId=""}logger(...e){Qt.info(`${new Date(Date.now()).toLocaleString()} [Playback]${e.join(",")}`)}convertToAbsoluteTime(e){return this.start+e}getFileRootPathByDockerId(e){const n=this.index>=this.dataBuffer.length?this.dataBuffer.length-1:this.index;for(let r=n;r>=0;r--){const i=this.dataBuffer[r];if(this.isFileTree(i.eventName)&&i.dockerId===e&&i.data.fileRootPath)return i.data.fileRootPath}for(let r=0;r<this.dataBuffer.length;r++){const i=this.dataBuffer[r];if(this.isFileTree(i.eventName)&&i.dockerId===e&&i.data.fileRootPath)return i.data.fileRootPath}}getCurrentDocByPathAndDocker(e,n){const r=this.index>=this.dataBuffer.length?this.dataBuffer.length-1:this.index,i=(o,s)=>{var l;if(this.isEditor(o.eventName)&&o.dockerId===e&&o.data.openedPath===n)return o.snapshot||(o=((l=this.getPlaybackSnapshot)==null?void 0:l.call(this,o.eventName,o,this.getPreFrameByFrame(o,s)))||o),o};for(let o=r;o>=0;o--){const s=this.dataBuffer[o],a=i(s,o);if(a)return a}for(let o=0;o<this.dataBuffer.length;o++){const s=this.dataBuffer[o],a=i(s,o);if(a)return a}}getCurrentFrame(){return this.index>=this.dataBuffer.length?this.dataBuffer[this.dataBuffer.length-1]:this.dataBuffer[this.index]}setRate(e){e&&!f2e.includes(e)&&this.progressDispatcher&&this.progressDispatcher("error",`${qn("helpers_invalid_parameter_rate_x",{x:e})}`),this.rate=e||this.rate}buffer(e){this.dataBuffer=this.dataBuffer.concat(e),this.firstFrameTime=this.dataBuffer[0].timestamp}pause(){if(this.logger("Click Pause!"),!this.playing){Qt.warn("Do not pause more than one time");return}this.playing=!1}resume(){this.resumeTime=this.resumeTime||0,this.resumeTime>0?this.isReplay=!0:this.preFrameTime=Date.now(),this.playing=!0,this.isStopMovePosition=!1,window.requestAnimationFrame(this.step)}restart(){this.preFrameTime=Date.now(),this.playing=!0,this.preFireTreeIndex={},this.preTerminalIndex={},this.preDebugIndex={},this.preTerminalDockerId="",this.preConsoleDockerId="",Se.file.reset(),this.index=0,window.requestAnimationFrame(this.step)}movePosition(e){var n;if(!((n=this.dataBuffer)!=null&&n.length)){this.resumeTime=e;return}this.isStopMovePosition=!this.playing,this.resumeTime=e,this.isReplay=!0,this.index=this.findFrameByTimeStamp(),this.isMovePosition=!0,this.preTerminalIndex={},this.preDebugIndex={},Se.dao.resetTerminal(),Se.dao.resetConsole(),J.dao.channel().xtermStatus({resetConsole:!0}),window.requestAnimationFrame(this.step)}findFrameByTimeStamp(){const e=this.resumeTime+this.firstFrameTime,n=this.dataBuffer,r=n.length,i=(a,l)=>{var c,u,f,h;if(a<=l){const d=Math.floor((l-a)/2+a),p=n[d].timestamp;return p===e?d:e===((c=n[d-1])==null?void 0:c.timestamp)?d-1:e===((u=n[d+1])==null?void 0:u.timestamp)?d+1:e>((f=n[d-1])==null?void 0:f.timestamp)&&e<((h=n[d+1])==null?void 0:h.timestamp)?d:(e<p?l=d-1:e>p&&(a=d+1),i(a,l))}else return Qt.warn("Do not find the next frame"),this.index=0,this.resumeTime=0,this.resume(),this.index},o=0,s=r-1;return i(o,s)}gotoNextFrame(){var e;!this.isStopMovePosition&&((e=this.progressDispatcher)==null||e.call(this,"progress",this.resumeTime)),this.isStopMovePosition?(this.playing=!1,this.isStopMovePosition=!1):(this.preFrameTime=Date.now(),window.requestAnimationFrame(this.step))}triggerCustomizeEvent(e){var n;(n=this.eventCustomize)==null||n.call(this,e)}step(){var n,r,i;if(!this.playing&&!this.isStopMovePosition)return;if(this.isReplay&&(this.isReplay=!1,this.preFrameTime=Date.now()),this.resumeTime=this.resumeTime+(Date.now()-this.preFrameTime)*this.rate,this.index>this.dataBuffer.length-1){this.playing=!1,this.resumeTime=0,!this.isStopMovePosition&&((n=this.progressDispatcher)==null||n.call(this,"progress",this.totalTime)),(r=this.progressDispatcher)==null||r.call(this,"complete",this.resumeTime);return}let e=this.dataBuffer[this.index];if(!e){this.gotoNextFrame();return}if(e.eventName==="customize"&&(this.firstFrameTime+this.resumeTime>(e==null?void 0:e.timestamp)&&(this.logger(this.index,e.index,e.eventName,e._id),this.index++,this.triggerCustomizeEvent(e)),!this.isStopMovePosition)){this.gotoNextFrame();return}if(this.isMovePosition){this.triggerPreFrames(),this.isMovePosition=!1;return}if(this.firstFrameTime+this.resumeTime>(e==null?void 0:e.timestamp)){let o=0;const s=this.firstFrameTime+this.resumeTime;for(let a=this.index+1;a<this.dataBuffer.length&&this.dataBuffer[a].timestamp<=s;a++)o++,this.index=a;o>0&&(e=this.dataBuffer[this.index],this.isMovePosition=!0),this.isMovePosition?(this.triggerPreFrames(),this.isMovePosition=!1):(e=((i=this.getPlaybackSnapshot)==null?void 0:i.call(this,e.eventName,e,this.getPreFrameByFrame(e,this.index)||e))||e,this.setPreFrameData(e,this.index)),this.trigger(e.eventName,e)}else this.isMovePosition&&(this.triggerPreFrames(),this.isMovePosition=!1);this.gotoNextFrame()}getPreFrameByFrame(e,n){const{eventName:r,dockerId:i}=e,o=this.isEditor(r),s=this.isFileTree(r);let a;if(o){const{data:{openedPath:l}}=e;for(let c=n-1;c>=0;c--){const u=this.dataBuffer[c];if(u.dockerId===i&&u.eventName===r&&u.data.openedPath===l){a=this.dataBuffer[c],!a.snapshot&&c>=0&&this.setSnapshotByIndex(c);break}}}return s&&(a=this.dataBuffer[this.preFireTreeIndex[i]]),a}setPreFrameData(e,n){const{eventName:r,dockerId:i}=e;this.isFileTree(r)&&(this.preFireTreeIndex[i]=n)}isEditor(e){return e===Ot.Editor}isFileTree(e){return e===Ot.FileTree}isTerminal(e){return e===Ot.Terminal}isConsole(e){return e===Ot.Console}isDebug(e){return e===Ot.Debug}isTerminalOrConsole(e){return[Ot.Terminal.toString(),Ot.Console.toString()].includes(e)}setSnapshotByIndex(e){var o;const n=this.dataBuffer[e],{eventName:r}=n,i=this.isEditor(r);for(let s=0;s<=e;s++){let a=this.dataBuffer[s];if(a.eventName===n.eventName&&a.dockerId===n.dockerId&&(i?a.data.openedPath===n.data.openedPath:!0)){if(a.snapshot){this.setPreFrameData(a,s);continue}a=((o=this.getPlaybackSnapshot)==null?void 0:o.call(this,a.eventName,a,this.getPreFrameByFrame(a,s)))||a,this.setPreFrameData(a,s)}}}triggerPreFrames(){var s;const e=[Ot.FileTree.toString(),Ot.Editor.toString(),Ot.Terminal.toString(),Ot.Console.toString(),Ot.Debug.toString()],n=J.file.doc().openedPath;let r=!1;const i=this.index,o=this.dataBuffer[i].dockerId;this.currentDockerId=o;for(let a=i;a>=0;a--){if(!e.length)return;if(e.includes(this.dataBuffer[a].eventName)&&this.dataBuffer[a].dockerId===this.currentDockerId){const l=this.dataBuffer[a],c=e.findIndex(u=>u===l.eventName);e.splice(c,1),l.eventName===Ot.Editor.toString()&&!r&&n!==l.data.openedPath&&(J.file.editorView()&&((s=J.file.editorView())==null||s.destroy(),Se.file.editorView(void 0),Qt.log("%c[Editor]: unmount","color: red")),Se.file.resetFile(),r=!0),l.snapshot||this.setSnapshotByIndex(a),this.trigger(l.eventName,l,!1)}}e.forEach(a=>{this.logger("trigger reset eventName:",a),this.trigger(a,null,!1)})}trigger(e,n,r=!0){if(e==="customize"){this.logger(this.index,e,n==null?void 0:n._id),this.triggerCustomizeEvent(n),r&&this.index++;return}const i=this.isTerminalOrConsole(e),o=this.isDebug(e);if(!i&&!o){this.logger(this.index,e,n==null?void 0:n._id),this.eventDispatcher(e,n),r&&this.index++;return}const s=n==null?void 0:n.dockerId;this.logger("[TR]",s);const a=this.preTerminalIndex[s]||0,l=this.preDebugIndex[s]||0,c=o?l:a;for(let u=c+1;u<=this.index;u++){const f=this.dataBuffer[u];f&&(this.isTerminalOrConsole(f.eventName)||o)&&f.dockerId===s&&(this.logger("[TR]",u,this.index,f.eventName,this.dataBuffer[u].dockerId,this.dataBuffer[u]._id),this.isTerminal(e)&&(this.preTerminalDockerId&&this.preTerminalDockerId!==s&&Se.dao.resetTerminal(),this.preTerminalDockerId=s),this.isConsole(e)&&(this.preConsoleDockerId&&this.preConsoleDockerId!==s&&(Se.dao.resetConsole(),J.dao.channel().xtermStatus({resetConsole:!0})),this.preConsoleDockerId=s),this.eventDispatcher(f.eventName,f))}o?this.preDebugIndex[s]=this.index:this.preTerminalIndex[s]=this.index,r&&this.index++}}const h2e="@dao42/d42paas-front",O2e="0.9.143",p2e="d42paas front",m2e="dao42 paas team",g2e="https://github.com/dao42/d42paas_frontend#readme",v2e="UNLICENSED",y2e="./dist/DaoPaaS.cjs",b2e="./dist/DaoPaaS.cjs",_2e="./dist/DaoPaaS.d.ts",$2e={prebuild:"rimraf dist",build:"cross-env VITE_BUILD_EVENT=true pnpm tsc && pnpm vite && pnpm typedoc",copydist:"cp -r dist/sdk ../demo/public/",vite:"vite build --config ./config/vite.config.ts && shx cp ./src/types/DaoPaaS.d.ts ./dist",typedoc:"npx typedoc --tsconfig ./doc.tsconfig.json",workNameSpaceToFix:"node ./config/workNameSpaceToFix.js",tsc:"tsc -p ./tsconfig.json --isolatedModules false",test1:"jest --coverage",test:"jest",prepublish:"pnpm build",publish:"npm publish --access public"},S2e={"@babel/core":"7.4.5","@babel/preset-env":"7.4.5","@codemirror/autocomplete":"^6.0.2","@codemirror/collab":"^6.0.0","@codemirror/commands":"^6.0.0","@codemirror/lang-cpp":"^6.0.0","@codemirror/lang-css":"^6.0.0","@codemirror/lang-html":"^6.0.0","@codemirror/lang-java":"^6.0.0","@codemirror/lang-javascript":"^6.0.0","@codemirror/lang-json":"^6.0.0","@codemirror/lang-lezer":"^6.0.0","@codemirror/lang-markdown":"^6.0.0","@codemirror/lang-php":"^6.0.0","@codemirror/lang-python":"^6.0.0","@codemirror/lang-rust":"^6.0.0","@codemirror/lang-sql":"^6.0.0","@codemirror/lang-xml":"^6.0.0","@codemirror/language":"6.5.0","@codemirror/legacy-modes":"^6.0.0","@codemirror/lint":"^6.0.0","@codemirror/search":"^6.0.0","@codemirror/state":"^6.2.0","@codemirror/theme-one-dark":"^6.0.0","@codemirror/view":"^6.8.1","@emotion/babel-plugin":"^11.3.0","@emotion/babel-preset-css-prop":"^11.2.0","@emotion/core":"^11.0.0","@emotion/css":"^11.1.3","@emotion/eslint-plugin":"^11.2.0","@emotion/react":"^11.9.3","@emotion/styled":"^11.3.0","@headlessui/react":"^1.4.3","@loadable/component":"^5.15.2","@open-rpc/client-js":"^1.7.1","@testing-library/jest-dom":"^5.16.4","@testing-library/react":"^13.3.0","@testing-library/user-event":"^14.4.3","@types/fs-extra":"^9.0.13","@types/jest":"^27.0.2","@types/loadable__component":"^5.13.4","@types/lodash":"^4.14.175","@types/lodash.clonedeep":"^4.5.7","@types/lodash.debounce":"^4.0.7","@types/lodash.isequal":"^4.5.6","@types/lodash.throttle":"^4.1.7","@types/node":"^16.11.1","@types/ot":"^0.0.5","@types/prop-types":"^15.7.5","@types/react":"^18.0.14","@types/react-dom":"^18.0.5","@types/react-transition-group":"^4.4.5","@types/testing-library__jest-dom":"^5.14.5","@types/uuid":"^8.3.1","@typescript-eslint/eslint-plugin":"^4.28.2","@typescript-eslint/parser":"^4.28.2","@udecode/zustood":"^1.1.1","@vitejs/plugin-react":"^1.0.7",ahooks:"^3.3.10","babel-loader":"^8.2.2",bufferutil:"^4.0.6",classnames:"^2.3.1",codemirror:"^6.0.0",concurrently:"^6.3.0","cross-env":"^7.0.3",devicon:"^2.14.0",dexie:"^3.2.0","file-icons-js":"^1.1.0","file-loader":"^6.2.0","fs-extra":"^10.0.0","glob-all":"^3.2.1","highlight.js":"^11.6.0","hotkeys-js":"^3.9.4",immer:"^9.0.14",jest:"27.0.6",lodash:"^4.17.21",msw:"^0.39.2","ninja-keys":"^1.1.12",ot:"^0.0.15","prop-types":"^15.8.1",react:"^18.2.0","react-complex-tree":"^1.1.6","react-content-loader":"^6.2.0","react-dom":"18.2.0","react-icons":"^4.3.1","react-transition-group":"^4.4.2","rehype-document":"^6.1.0","rehype-highlight":"^5.0.2","rehype-katex":"^6.0.2","rehype-stringify":"^9.0.3","remark-gfm":"^3.0.1","remark-math":"^5.1.1","remark-parse":"^10.0.1","remark-rehype":"^10.1.0",rimraf:"^3.0.2","rollup-plugin-visualizer":"^5.6.0",sass:"^1.43.2","sass-loader":"^12.2.0",shx:"^0.3.3","socket.io-client":"^4.5.1","source-map-loader":"^3.0.0","style-loader":"^3.3.1",stylis:"^4.0.10","ts-jest":"^27.1.3","ts-loader":"^9.2.5","ts-node":"^10.0.0",typedoc:"^0.22.12",unified:"^10.1.2","use-immer":"^0.7.0","utf-8-validate":"^5.0.9",uuid:"^8.3.2",vite:"^2.9.15","vite-plugin-html":"^3.0.6","whatwg-fetch":"^3.6.2",xterm:"^4.13.0","xterm-addon-attach":"^0.6.0","xterm-addon-fit":"^0.5.0",zustand:"^4.0.0-rc.1"},x2e=["dist"],w2e={type:"git",url:"git+https://github.com/dao42/d42paas_frontend.git"},k2e={url:"https://github.com/dao42/d42paas_frontend/issues"},T2e={workerDirectory:"src"},P2e={"@babel/plugin-transform-modules-commonjs":"^7.18.2","babel-jest":"^29.3.1","babel-preset-react-app":"^10.0.1","codemirror-lang-elixir":"^3.0.0","detect-indent":"^7.0.1",i18next:"^21.8.16","jest-websocket-mock":"^2.4.0",lib0:"^0.2.58","lodash.clonedeep":"^4.5.0","lodash.debounce":"^4.0.8","lodash.isequal":"^4.5.0","lodash.throttle":"^4.1.1",minimatch:"^5.1.0","range-analyzer":"0.1.1-alpha.2","rc-dropdown":"^4.0.1","rc-menu":"^9.6.3","react-app-polyfill":"^3.0.0","react-i18next":"11.18.3","socket.io":"^4.5.1","socket.io-mock":"^1.3.2","socket.io-msgpack-parser":"^3.0.1","xterm-addon-web-links":"^0.6.0"};var Q2e={name:h2e,version:O2e,description:p2e,author:m2e,homepage:g2e,license:v2e,main:y2e,module:b2e,types:_2e,scripts:$2e,devDependencies:S2e,files:x2e,repository:w2e,bugs:k2e,msw:T2e,dependencies:P2e};const E2e=()=>Q2e.version,C2e=async(t,e,n)=>{const r=window.localStorage.getItem("__paas__testServerCode__"),i=r?{serverCode:r}:{},s=await(await fetch(t+"/api/v1/jssdk/ticket",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ticket:e,packageVersion:n,...i})})).json();if(s.status==="failure")throw Qt.error(s),new Error(s.errors[0].erromsg);return s.data},CG=(t,e=1)=>{t=t||"#ffffff";let n=t.replace("#","");n.length===3&&(n=`${n[0]}${n[0]}${n[1]}${n[1]}${n[2]}${n[2]}`);const r=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),o=parseInt(n.substring(4,6),16);return e>1&&e<=100&&(e=e/100),`rgba(${r},${i},${o},${e})`},R2e=()=>{const t=`
|
|
49
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function h5e(t){return xG(t)||wG(t)||mE(t)||kG()}function XM(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function WM(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?XM(Object(n),!0).forEach(function(r){Dn(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):XM(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var O5e={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,n){console&&console[e]&&console[e].apply(console,n)}},p5e=function(){function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};na(this,t),this.init(e,n)}return ra(t,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=r.prefix||"i18next:",this.logger=n||O5e,this.options=r,this.debug=r.debug}},{key:"setDebug",value:function(n){this.debug=n}},{key:"log",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return this.forward(r,"log","",!0)}},{key:"warn",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return this.forward(r,"warn","",!0)}},{key:"error",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return this.forward(r,"error","")}},{key:"deprecate",value:function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return this.forward(r,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(n,r,i,o){return o&&!this.debug?null:(typeof n[0]=="string"&&(n[0]="".concat(i).concat(this.prefix," ").concat(n[0])),this.logger[r](n))}},{key:"create",value:function(n){return new t(this.logger,WM(WM({},{prefix:"".concat(this.prefix,":").concat(n,":")}),this.options))}}]),t}(),ou=new p5e,Fd=function(){function t(){na(this,t),this.observers={}}return ra(t,[{key:"on",value:function(n,r){var i=this;return n.split(" ").forEach(function(o){i.observers[o]=i.observers[o]||[],i.observers[o].push(r)}),this}},{key:"off",value:function(n,r){if(!!this.observers[n]){if(!r){delete this.observers[n];return}this.observers[n]=this.observers[n].filter(function(i){return i!==r})}}},{key:"emit",value:function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];if(this.observers[n]){var s=[].concat(this.observers[n]);s.forEach(function(l){l.apply(void 0,i)})}if(this.observers["*"]){var a=[].concat(this.observers["*"]);a.forEach(function(l){l.apply(l,[n].concat(i))})}}}]),t}();function G0(){var t,e,n=new Promise(function(r,i){t=r,e=i});return n.resolve=t,n.reject=e,n}function UM(t){return t==null?"":""+t}function m5e(t,e,n){t.forEach(function(r){e[r]&&(n[r]=e[r])})}function gE(t,e,n){function r(a){return a&&a.indexOf("###")>-1?a.replace(/###/g,"."):a}function i(){return!t||typeof t=="string"}for(var o=typeof e!="string"?[].concat(e):e.split(".");o.length>1;){if(i())return{};var s=r(o.shift());!t[s]&&n&&(t[s]=new n),Object.prototype.hasOwnProperty.call(t,s)?t=t[s]:t={}}return i()?{}:{obj:t,k:r(o.shift())}}function qM(t,e,n){var r=gE(t,e,Object),i=r.obj,o=r.k;i[o]=n}function g5e(t,e,n,r){var i=gE(t,e,Object),o=i.obj,s=i.k;o[s]=o[s]||[],r&&(o[s]=o[s].concat(n)),r||o[s].push(n)}function Y5(t,e){var n=gE(t,e),r=n.obj,i=n.k;if(!!r)return r[i]}function BM(t,e,n){var r=Y5(t,n);return r!==void 0?r:Y5(e,n)}function TG(t,e,n){for(var r in e)r!=="__proto__"&&r!=="constructor"&&(r in t?typeof t[r]=="string"||t[r]instanceof String||typeof e[r]=="string"||e[r]instanceof String?n&&(t[r]=e[r]):TG(t[r],e[r],n):t[r]=e[r]);return t}function ep(t){return t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var v5e={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function y5e(t){return typeof t=="string"?t.replace(/[&<>"'\/]/g,function(e){return v5e[e]}):t}var i4=typeof window!="undefined"&&window.navigator&&typeof window.navigator.userAgentData=="undefined"&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,b5e=[" ",",","?","!",";"];function _5e(t,e,n){e=e||"",n=n||"";var r=b5e.filter(function(a){return e.indexOf(a)<0&&n.indexOf(a)<0});if(r.length===0)return!0;var i=new RegExp("(".concat(r.map(function(a){return a==="?"?"\\?":a}).join("|"),")")),o=!i.test(t);if(!o){var s=t.indexOf(n);s>0&&!i.test(t.substring(0,s))&&(o=!0)}return o}function FM(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function qb(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?FM(Object(n),!0).forEach(function(r){Dn(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):FM(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function $5e(t){var e=S5e();return function(){var r=Vl(t),i;if(e){var o=Vl(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return s0(this,i)}}function S5e(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function PG(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!!t){if(t[e])return t[e];for(var r=e.split(n),i=t,o=0;o<r.length;++o){if(!i||typeof i[r[o]]=="string"&&o+1<r.length)return;if(i[r[o]]===void 0){for(var s=2,a=r.slice(o,o+s).join(n),l=i[a];l===void 0&&r.length>o+s;)s++,a=r.slice(o,o+s).join(n),l=i[a];if(l===void 0)return;if(l===null)return null;if(e.endsWith(a)){if(typeof l=="string")return l;if(a&&typeof l[a]=="string")return l[a]}var c=r.slice(o+s).join(n);return c?PG(l,c,n):void 0}i=i[r[o]]}return i}}var x5e=function(t){sh(n,t);var e=$5e(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};return na(this,n),i=e.call(this),i4&&Fd.call(Bl(i)),i.data=r||{},i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.options.ignoreJSONStructure===void 0&&(i.options.ignoreJSONStructure=!0),i}return ra(n,[{key:"addNamespaces",value:function(i){this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}},{key:"removeNamespaces",value:function(i){var o=this.options.ns.indexOf(i);o>-1&&this.options.ns.splice(o,1)}},{key:"getResource",value:function(i,o,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},l=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,c=a.ignoreJSONStructure!==void 0?a.ignoreJSONStructure:this.options.ignoreJSONStructure,u=[i,o];s&&typeof s!="string"&&(u=u.concat(s)),s&&typeof s=="string"&&(u=u.concat(l?s.split(l):s)),i.indexOf(".")>-1&&(u=i.split("."));var f=Y5(this.data,u);return f||!c||typeof s!="string"?f:PG(this.data&&this.data[i]&&this.data[i][o],s,l)}},{key:"addResource",value:function(i,o,s,a){var l=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1},c=this.options.keySeparator;c===void 0&&(c=".");var u=[i,o];s&&(u=u.concat(c?s.split(c):s)),i.indexOf(".")>-1&&(u=i.split("."),a=o,o=u[1]),this.addNamespaces(o),qM(this.data,u,a),l.silent||this.emit("added",i,o,s,a)}},{key:"addResources",value:function(i,o,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(var l in s)(typeof s[l]=="string"||Object.prototype.toString.apply(s[l])==="[object Array]")&&this.addResource(i,o,l,s[l],{silent:!0});a.silent||this.emit("added",i,o,s)}},{key:"addResourceBundle",value:function(i,o,s,a,l){var c=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1},u=[i,o];i.indexOf(".")>-1&&(u=i.split("."),a=s,s=o,o=u[1]),this.addNamespaces(o);var f=Y5(this.data,u)||{};a?TG(f,s,l):f=qb(qb({},f),s),qM(this.data,u,f),c.silent||this.emit("added",i,o,s)}},{key:"removeResourceBundle",value:function(i,o){this.hasResourceBundle(i,o)&&delete this.data[i][o],this.removeNamespaces(o),this.emit("removed",i,o)}},{key:"hasResourceBundle",value:function(i,o){return this.getResource(i,o)!==void 0}},{key:"getResourceBundle",value:function(i,o){return o||(o=this.options.defaultNS),this.options.compatibilityAPI==="v1"?qb(qb({},{}),this.getResource(i,o)):this.getResource(i,o)}},{key:"getDataByLanguage",value:function(i){return this.data[i]}},{key:"hasLanguageSomeTranslations",value:function(i){var o=this.getDataByLanguage(i),s=o&&Object.keys(o)||[];return!!s.find(function(a){return o[a]&&Object.keys(o[a]).length>0})}},{key:"toJSON",value:function(){return this.data}}]),n}(Fd),QG={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,n,r,i,o){var s=this;return e.forEach(function(a){s.processors[a]&&(n=s.processors[a].process(n,r,i,o))}),n}};function YM(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Bs(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?YM(Object(n),!0).forEach(function(r){Dn(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):YM(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function w5e(t){var e=k5e();return function(){var r=Vl(t),i;if(e){var o=Vl(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return s0(this,i)}}function k5e(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}var jM={},ZM=function(t){sh(n,t);var e=w5e(n);function n(r){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return na(this,n),i=e.call(this),i4&&Fd.call(Bl(i)),m5e(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],r,Bl(i)),i.options=o,i.options.keySeparator===void 0&&(i.options.keySeparator="."),i.logger=ou.create("translator"),i}return ra(n,[{key:"changeLanguage",value:function(i){i&&(this.language=i)}},{key:"exists",value:function(i){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(i==null)return!1;var s=this.resolve(i,o);return s&&s.res!==void 0}},{key:"extractFromKey",value:function(i,o){var s=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");var a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,l=o.ns||this.options.defaultNS||[],c=s&&i.indexOf(s)>-1,u=!this.options.userDefinedKeySeparator&&!o.keySeparator&&!this.options.userDefinedNsSeparator&&!o.nsSeparator&&!_5e(i,s,a);if(c&&!u){var f=i.match(this.interpolator.nestingRegexp);if(f&&f.length>0)return{key:i,namespaces:l};var h=i.split(s);(s!==a||s===a&&this.options.ns.indexOf(h[0])>-1)&&(l=h.shift()),i=h.join(a)}return typeof l=="string"&&(l=[l]),{key:i,namespaces:l}}},{key:"translate",value:function(i,o,s){var a=this;if(Ta(o)!=="object"&&this.options.overloadTranslationOptionHandler&&(o=this.options.overloadTranslationOptionHandler(arguments)),o||(o={}),i==null)return"";Array.isArray(i)||(i=[String(i)]);var l=o.returnDetails!==void 0?o.returnDetails:this.options.returnDetails,c=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator,u=this.extractFromKey(i[i.length-1],o),f=u.key,h=u.namespaces,d=h[h.length-1],p=o.lng||this.language,b=o.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(p&&p.toLowerCase()==="cimode"){if(b){var y=o.nsSeparator||this.options.nsSeparator;return l?(O.res="".concat(d).concat(y).concat(f),O):"".concat(d).concat(y).concat(f)}return l?(O.res=f,O):f}var O=this.resolve(i,o),m=O&&O.res,v=O&&O.usedKey||f,$=O&&O.exactUsedKey||f,S=Object.prototype.toString.apply(m),w=["[object Number]","[object Function]","[object RegExp]"],k=o.joinArrays!==void 0?o.joinArrays:this.options.joinArrays,I=!this.i18nFormat||this.i18nFormat.handleAsObject,L=typeof m!="string"&&typeof m!="boolean"&&typeof m!="number";if(I&&m&&L&&w.indexOf(S)<0&&!(typeof k=="string"&&S==="[object Array]")){if(!o.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");var C=this.options.returnedObjectHandler?this.options.returnedObjectHandler(v,m,Bs(Bs({},o),{},{ns:h})):"key '".concat(f," (").concat(this.language,")' returned an object instead of string.");return l?(O.res=C,O):C}if(c){var T=S==="[object Array]",E=T?[]:{},N=T?$:v;for(var G in m)if(Object.prototype.hasOwnProperty.call(m,G)){var j="".concat(N).concat(c).concat(G);E[G]=this.translate(j,Bs(Bs({},o),{joinArrays:!1,ns:h})),E[G]===j&&(E[G]=m[G])}m=E}}else if(I&&typeof k=="string"&&S==="[object Array]")m=m.join(k),m&&(m=this.extendTranslation(m,i,o,s));else{var A=!1,W=!1,q=o.count!==void 0&&typeof o.count!="string",K=n.hasDefaultValue(o),ie=q?this.pluralResolver.getSuffix(p,o.count,o):"",V=o["defaultValue".concat(ie)]||o.defaultValue;!this.isValidLookup(m)&&K&&(A=!0,m=V),this.isValidLookup(m)||(W=!0,m=f);var ne=o.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey,Pe=ne&&W?void 0:m,Ee=K&&V!==m&&this.options.updateMissing;if(W||A||Ee){if(this.logger.log(Ee?"updateKey":"missingKey",p,d,f,Ee?V:m),c){var H=this.resolve(f,Bs(Bs({},o),{},{keySeparator:!1}));H&&H.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var _e=[],re=this.languageUtils.getFallbackCodes(this.options.fallbackLng,o.lng||this.language);if(this.options.saveMissingTo==="fallback"&&re&&re[0])for(var ae=0;ae<re.length;ae++)_e.push(re[ae]);else this.options.saveMissingTo==="all"?_e=this.languageUtils.toResolveHierarchy(o.lng||this.language):_e.push(o.lng||this.language);var ee=function(Be,ot,Ve){var dt=K&&Ve!==m?Ve:Pe;a.options.missingKeyHandler?a.options.missingKeyHandler(Be,d,ot,dt,Ee,o):a.backendConnector&&a.backendConnector.saveMissing&&a.backendConnector.saveMissing(Be,d,ot,dt,Ee,o),a.emit("missingKey",Be,d,ot,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&q?_e.forEach(function(Re){a.pluralResolver.getSuffixes(Re,o).forEach(function(Be){ee([Re],f+Be,o["defaultValue".concat(Be)]||V)})}):ee(_e,f,V))}m=this.extendTranslation(m,i,o,O,s),W&&m===f&&this.options.appendNamespaceToMissingKey&&(m="".concat(d,":").concat(f)),(W||A)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?"".concat(d,":").concat(f):f,A?m:void 0):m=this.options.parseMissingKeyHandler(m))}return l?(O.res=m,O):m}},{key:"extendTranslation",value:function(i,o,s,a,l){var c=this;if(this.i18nFormat&&this.i18nFormat.parse)i=this.i18nFormat.parse(i,Bs(Bs({},this.options.interpolation.defaultVariables),s),a.usedLng,a.usedNS,a.usedKey,{resolved:a});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init(Bs(Bs({},s),{interpolation:Bs(Bs({},this.options.interpolation),s.interpolation)}));var u=typeof i=="string"&&(s&&s.interpolation&&s.interpolation.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables),f;if(u){var h=i.match(this.interpolator.nestingRegexp);f=h&&h.length}var d=s.replace&&typeof s.replace!="string"?s.replace:s;if(this.options.interpolation.defaultVariables&&(d=Bs(Bs({},this.options.interpolation.defaultVariables),d)),i=this.interpolator.interpolate(i,d,s.lng||this.language,s),u){var p=i.match(this.interpolator.nestingRegexp),b=p&&p.length;f<b&&(s.nest=!1)}s.nest!==!1&&(i=this.interpolator.nest(i,function(){for(var m=arguments.length,v=new Array(m),$=0;$<m;$++)v[$]=arguments[$];return l&&l[0]===v[0]&&!s.context?(c.logger.warn("It seems you are nesting recursively key: ".concat(v[0]," in key: ").concat(o[0])),null):c.translate.apply(c,v.concat([o]))},s)),s.interpolation&&this.interpolator.reset()}var y=s.postProcess||this.options.postProcess,O=typeof y=="string"?[y]:y;return i!=null&&O&&O.length&&s.applyPostProcessor!==!1&&(i=QG.handle(O,i,o,this.options&&this.options.postProcessPassResolved?Bs({i18nResolved:a},s):s,this)),i}},{key:"resolve",value:function(i){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a,l,c,u,f;return typeof i=="string"&&(i=[i]),i.forEach(function(h){if(!o.isValidLookup(a)){var d=o.extractFromKey(h,s),p=d.key;l=p;var b=d.namespaces;o.options.fallbackNS&&(b=b.concat(o.options.fallbackNS));var y=s.count!==void 0&&typeof s.count!="string",O=y&&!s.ordinal&&s.count===0&&o.pluralResolver.shouldUseIntlApi(),m=s.context!==void 0&&(typeof s.context=="string"||typeof s.context=="number")&&s.context!=="",v=s.lngs?s.lngs:o.languageUtils.toResolveHierarchy(s.lng||o.language,s.fallbackLng);b.forEach(function($){o.isValidLookup(a)||(f=$,!jM["".concat(v[0],"-").concat($)]&&o.utils&&o.utils.hasLoadedNamespace&&!o.utils.hasLoadedNamespace(f)&&(jM["".concat(v[0],"-").concat($)]=!0,o.logger.warn('key "'.concat(l,'" for languages "').concat(v.join(", "),`" won't get resolved as namespace "`).concat(f,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),v.forEach(function(S){if(!o.isValidLookup(a)){u=S;var w=[p];if(o.i18nFormat&&o.i18nFormat.addLookupKeys)o.i18nFormat.addLookupKeys(w,p,S,$,s);else{var k;y&&(k=o.pluralResolver.getSuffix(S,s.count,s));var I="".concat(o.options.pluralSeparator,"zero");if(y&&(w.push(p+k),O&&w.push(p+I)),m){var L="".concat(p).concat(o.options.contextSeparator).concat(s.context);w.push(L),y&&(w.push(L+k),O&&w.push(L+I))}}for(var C;C=w.pop();)o.isValidLookup(a)||(c=C,a=o.getResource(S,$,C,s))}}))})}}),{res:a,usedKey:l,exactUsedKey:c,usedLng:u,usedNS:f}}},{key:"isValidLookup",value:function(i){return i!==void 0&&!(!this.options.returnNull&&i===null)&&!(!this.options.returnEmptyString&&i==="")}},{key:"getResource",value:function(i,o,s){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(i,o,s,a):this.resourceStore.getResource(i,o,s,a)}}],[{key:"hasDefaultValue",value:function(i){var o="defaultValue";for(var s in i)if(Object.prototype.hasOwnProperty.call(i,s)&&o===s.substring(0,o.length)&&i[s]!==void 0)return!0;return!1}}]),n}(Fd);function zk(t){return t.charAt(0).toUpperCase()+t.slice(1)}var T5e=function(){function t(e){na(this,t),this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=ou.create("languageUtils")}return ra(t,[{key:"getScriptPartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return null;var r=n.split("-");return r.length===2||(r.pop(),r[r.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(r.join("-"))}},{key:"getLanguagePartFromCode",value:function(n){if(!n||n.indexOf("-")<0)return n;var r=n.split("-");return this.formatLanguageCode(r[0])}},{key:"formatLanguageCode",value:function(n){if(typeof n=="string"&&n.indexOf("-")>-1){var r=["hans","hant","latn","cyrl","cans","mong","arab"],i=n.split("-");return this.options.lowerCaseLng?i=i.map(function(o){return o.toLowerCase()}):i.length===2?(i[0]=i[0].toLowerCase(),i[1]=i[1].toUpperCase(),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=zk(i[1].toLowerCase()))):i.length===3&&(i[0]=i[0].toLowerCase(),i[1].length===2&&(i[1]=i[1].toUpperCase()),i[0]!=="sgn"&&i[2].length===2&&(i[2]=i[2].toUpperCase()),r.indexOf(i[1].toLowerCase())>-1&&(i[1]=zk(i[1].toLowerCase())),r.indexOf(i[2].toLowerCase())>-1&&(i[2]=zk(i[2].toLowerCase()))),i.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?n.toLowerCase():n}},{key:"isSupportedCode",value:function(n){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(n=this.getLanguagePartFromCode(n)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(n)>-1}},{key:"getBestMatchFromCodes",value:function(n){var r=this;if(!n)return null;var i;return n.forEach(function(o){if(!i){var s=r.formatLanguageCode(o);(!r.options.supportedLngs||r.isSupportedCode(s))&&(i=s)}}),!i&&this.options.supportedLngs&&n.forEach(function(o){if(!i){var s=r.getLanguagePartFromCode(o);if(r.isSupportedCode(s))return i=s;i=r.options.supportedLngs.find(function(a){if(a.indexOf(s)===0)return a})}}),i||(i=this.getFallbackCodes(this.options.fallbackLng)[0]),i}},{key:"getFallbackCodes",value:function(n,r){if(!n)return[];if(typeof n=="function"&&(n=n(r)),typeof n=="string"&&(n=[n]),Object.prototype.toString.apply(n)==="[object Array]")return n;if(!r)return n.default||[];var i=n[r];return i||(i=n[this.getScriptPartFromCode(r)]),i||(i=n[this.formatLanguageCode(r)]),i||(i=n[this.getLanguagePartFromCode(r)]),i||(i=n.default),i||[]}},{key:"toResolveHierarchy",value:function(n,r){var i=this,o=this.getFallbackCodes(r||this.options.fallbackLng||[],n),s=[],a=function(c){!c||(i.isSupportedCode(c)?s.push(c):i.logger.warn("rejecting language code not found in supportedLngs: ".concat(c)))};return typeof n=="string"&&n.indexOf("-")>-1?(this.options.load!=="languageOnly"&&a(this.formatLanguageCode(n)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&a(this.getScriptPartFromCode(n)),this.options.load!=="currentOnly"&&a(this.getLanguagePartFromCode(n))):typeof n=="string"&&a(this.formatLanguageCode(n)),o.forEach(function(l){s.indexOf(l)<0&&a(i.formatLanguageCode(l))}),s}}]),t}(),P5e=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],Q5e={1:function(e){return Number(e>1)},2:function(e){return Number(e!=1)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(e==0?0:e==1?1:e==2?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(e==1?0:e>=2&&e<=4?1:2)},7:function(e){return Number(e==1?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(e==1?0:e==2?1:e!=8&&e!=11?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(e==1?0:e==2?1:e<7?2:e<11?3:4)},11:function(e){return Number(e==1||e==11?0:e==2||e==12?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(e!==0)},14:function(e){return Number(e==1?0:e==2?1:e==3?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:e!==0?1:2)},17:function(e){return Number(e==1||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(e==0?0:e==1?1:2)},19:function(e){return Number(e==1?0:e==0||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(e==1?0:e==0||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(e==1?0:e==2?1:(e<0||e>10)&&e%10==0?2:3)}},E5e=["v1","v2","v3"],VM={zero:0,one:1,two:2,few:3,many:4,other:5};function C5e(){var t={};return P5e.forEach(function(e){e.lngs.forEach(function(n){t[n]={numbers:e.nr,plurals:Q5e[e.fc]}})}),t}var R5e=function(){function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};na(this,t),this.languageUtils=e,this.options=n,this.logger=ou.create("pluralResolver"),(!this.options.compatibilityJSON||this.options.compatibilityJSON==="v4")&&(typeof Intl=="undefined"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=C5e()}return ra(t,[{key:"addRule",value:function(n,r){this.rules[n]=r}},{key:"getRule",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(n,{type:r.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[n]||this.rules[this.languageUtils.getLanguagePartFromCode(n)]}},{key:"needsPlural",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=this.getRule(n,r);return this.shouldUseIntlApi()?i&&i.resolvedOptions().pluralCategories.length>1:i&&i.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(n,i).map(function(o){return"".concat(r).concat(o)})}},{key:"getSuffixes",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=this.getRule(n,i);return o?this.shouldUseIntlApi()?o.resolvedOptions().pluralCategories.sort(function(s,a){return VM[s]-VM[a]}).map(function(s){return"".concat(r.options.prepend).concat(s)}):o.numbers.map(function(s){return r.getSuffix(n,s,i)}):[]}},{key:"getSuffix",value:function(n,r){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},o=this.getRule(n,i);return o?this.shouldUseIntlApi()?"".concat(this.options.prepend).concat(o.select(r)):this.getSuffixRetroCompatible(o,r):(this.logger.warn("no plural rule found for: ".concat(n)),"")}},{key:"getSuffixRetroCompatible",value:function(n,r){var i=this,o=n.noAbs?n.plurals(r):n.plurals(Math.abs(r)),s=n.numbers[o];this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1&&(s===2?s="plural":s===1&&(s=""));var a=function(){return i.options.prepend&&s.toString()?i.options.prepend+s.toString():s.toString()};return this.options.compatibilityJSON==="v1"?s===1?"":typeof s=="number"?"_plural_".concat(s.toString()):a():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&n.numbers.length===2&&n.numbers[0]===1?a():this.options.prepend&&o.toString()?this.options.prepend+o.toString():o.toString()}},{key:"shouldUseIntlApi",value:function(){return!E5e.includes(this.options.compatibilityJSON)}}]),t}();function GM(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function lc(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?GM(Object(n),!0).forEach(function(r){Dn(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):GM(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var A5e=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};na(this,t),this.logger=ou.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||function(n){return n},this.init(e)}return ra(t,[{key:"init",value:function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};n.interpolation||(n.interpolation={escapeValue:!0});var r=n.interpolation;this.escape=r.escape!==void 0?r.escape:y5e,this.escapeValue=r.escapeValue!==void 0?r.escapeValue:!0,this.useRawValueToEscape=r.useRawValueToEscape!==void 0?r.useRawValueToEscape:!1,this.prefix=r.prefix?ep(r.prefix):r.prefixEscaped||"{{",this.suffix=r.suffix?ep(r.suffix):r.suffixEscaped||"}}",this.formatSeparator=r.formatSeparator?r.formatSeparator:r.formatSeparator||",",this.unescapePrefix=r.unescapeSuffix?"":r.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":r.unescapeSuffix||"",this.nestingPrefix=r.nestingPrefix?ep(r.nestingPrefix):r.nestingPrefixEscaped||ep("$t("),this.nestingSuffix=r.nestingSuffix?ep(r.nestingSuffix):r.nestingSuffixEscaped||ep(")"),this.nestingOptionsSeparator=r.nestingOptionsSeparator?r.nestingOptionsSeparator:r.nestingOptionsSeparator||",",this.maxReplaces=r.maxReplaces?r.maxReplaces:1e3,this.alwaysFormat=r.alwaysFormat!==void 0?r.alwaysFormat:!1,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var n="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(n,"g");var r="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(r,"g");var i="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(i,"g")}},{key:"interpolate",value:function(n,r,i,o){var s=this,a,l,c,u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function f(y){return y.replace(/\$/g,"$$$$")}var h=function(O){if(O.indexOf(s.formatSeparator)<0){var m=BM(r,u,O);return s.alwaysFormat?s.format(m,void 0,i,lc(lc(lc({},o),r),{},{interpolationkey:O})):m}var v=O.split(s.formatSeparator),$=v.shift().trim(),S=v.join(s.formatSeparator).trim();return s.format(BM(r,u,$),S,i,lc(lc(lc({},o),r),{},{interpolationkey:$}))};this.resetRegExp();var d=o&&o.missingInterpolationHandler||this.options.missingInterpolationHandler,p=o&&o.interpolation&&o.interpolation.skipOnVariables!==void 0?o.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables,b=[{regex:this.regexpUnescape,safeValue:function(O){return f(O)}},{regex:this.regexp,safeValue:function(O){return s.escapeValue?f(s.escape(O)):f(O)}}];return b.forEach(function(y){for(c=0;a=y.regex.exec(n);){var O=a[1].trim();if(l=h(O),l===void 0)if(typeof d=="function"){var m=d(n,a,o);l=typeof m=="string"?m:""}else if(o&&o.hasOwnProperty(O))l="";else if(p){l=a[0];continue}else s.logger.warn("missed to pass in variable ".concat(O," for interpolating ").concat(n)),l="";else typeof l!="string"&&!s.useRawValueToEscape&&(l=UM(l));var v=y.safeValue(l);if(n=n.replace(a[0],v),p?(y.regex.lastIndex+=l.length,y.regex.lastIndex-=a[0].length):y.regex.lastIndex=0,c++,c>=s.maxReplaces)break}}),n}},{key:"nest",value:function(n,r){var i=this,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s,a,l=lc({},o);l.applyPostProcessor=!1,delete l.defaultValue;function c(d,p){var b=this.nestingOptionsSeparator;if(d.indexOf(b)<0)return d;var y=d.split(new RegExp("".concat(b,"[ ]*{"))),O="{".concat(y[1]);d=y[0],O=this.interpolate(O,l),O=O.replace(/'/g,'"');try{l=JSON.parse(O),p&&(l=lc(lc({},p),l))}catch(m){return this.logger.warn("failed parsing options string in nesting for key ".concat(d),m),"".concat(d).concat(b).concat(O)}return delete l.defaultValue,d}for(;s=this.nestingRegexp.exec(n);){var u=[],f=!1;if(s[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(s[1])){var h=s[1].split(this.formatSeparator).map(function(d){return d.trim()});s[1]=h.shift(),u=h,f=!0}if(a=r(c.call(this,s[1].trim(),l),l),a&&s[0]===n&&typeof a!="string")return a;typeof a!="string"&&(a=UM(a)),a||(this.logger.warn("missed to resolve ".concat(s[1]," for nesting ").concat(n)),a=""),f&&(a=u.reduce(function(d,p){return i.format(d,p,o.lng,lc(lc({},o),{},{interpolationkey:s[1].trim()}))},a.trim())),n=n.replace(s[0],a),this.regexp.lastIndex=0}return n}}]),t}();function HM(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Vf(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?HM(Object(n),!0).forEach(function(r){Dn(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):HM(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function I5e(t){var e=t.toLowerCase().trim(),n={};if(t.indexOf("(")>-1){var r=t.split("(");e=r[0].toLowerCase().trim();var i=r[1].substring(0,r[1].length-1);if(e==="currency"&&i.indexOf(":")<0)n.currency||(n.currency=i.trim());else if(e==="relativetime"&&i.indexOf(":")<0)n.range||(n.range=i.trim());else{var o=i.split(";");o.forEach(function(s){if(!!s){var a=s.split(":"),l=h5e(a),c=l[0],u=l.slice(1),f=u.join(":").trim().replace(/^'+|'+$/g,"");n[c.trim()]||(n[c.trim()]=f),f==="false"&&(n[c.trim()]=!1),f==="true"&&(n[c.trim()]=!0),isNaN(f)||(n[c.trim()]=parseInt(f,10))}})}}return{formatName:e,formatOptions:n}}var z5e=function(){function t(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};na(this,t),this.logger=ou.create("formatter"),this.options=e,this.formats={number:function(r,i,o){return new Intl.NumberFormat(i,o).format(r)},currency:function(r,i,o){return new Intl.NumberFormat(i,Vf(Vf({},o),{},{style:"currency"})).format(r)},datetime:function(r,i,o){return new Intl.DateTimeFormat(i,Vf({},o)).format(r)},relativetime:function(r,i,o){return new Intl.RelativeTimeFormat(i,Vf({},o)).format(r,o.range||"day")},list:function(r,i,o){return new Intl.ListFormat(i,Vf({},o)).format(r)}},this.init(e)}return ra(t,[{key:"init",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}},i=r.interpolation;this.formatSeparator=i.formatSeparator?i.formatSeparator:i.formatSeparator||","}},{key:"add",value:function(n,r){this.formats[n.toLowerCase().trim()]=r}},{key:"format",value:function(n,r,i,o){var s=this,a=r.split(this.formatSeparator),l=a.reduce(function(c,u){var f=I5e(u),h=f.formatName,d=f.formatOptions;if(s.formats[h]){var p=c;try{var b=o&&o.formatParams&&o.formatParams[o.interpolationkey]||{},y=b.locale||b.lng||o.locale||o.lng||i;p=s.formats[h](c,y,Vf(Vf(Vf({},d),o),b))}catch(O){s.logger.warn(O)}return p}else s.logger.warn("there was no format function for ".concat(h));return c},n);return l}}]),t}();function KM(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function JM(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?KM(Object(n),!0).forEach(function(r){Dn(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):KM(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function L5e(t){var e=M5e();return function(){var r=Vl(t),i;if(e){var o=Vl(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return s0(this,i)}}function M5e(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function N5e(t,e){t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)}var D5e=function(t){sh(n,t);var e=L5e(n);function n(r,i,o){var s,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return na(this,n),s=e.call(this),i4&&Fd.call(Bl(s)),s.backend=r,s.store=i,s.services=o,s.languageUtils=o.languageUtils,s.options=a,s.logger=ou.create("backendConnector"),s.waitingReads=[],s.maxParallelReads=a.maxParallelReads||10,s.readingCalls=0,s.maxRetries=a.maxRetries>=0?a.maxRetries:5,s.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,s.state={},s.queue=[],s.backend&&s.backend.init&&s.backend.init(o,a.backend,a),s}return ra(n,[{key:"queueLoad",value:function(i,o,s,a){var l=this,c={},u={},f={},h={};return i.forEach(function(d){var p=!0;o.forEach(function(b){var y="".concat(d,"|").concat(b);!s.reload&&l.store.hasResourceBundle(d,b)?l.state[y]=2:l.state[y]<0||(l.state[y]===1?u[y]===void 0&&(u[y]=!0):(l.state[y]=1,p=!1,u[y]===void 0&&(u[y]=!0),c[y]===void 0&&(c[y]=!0),h[b]===void 0&&(h[b]=!0)))}),p||(f[d]=!0)}),(Object.keys(c).length||Object.keys(u).length)&&this.queue.push({pending:u,pendingCount:Object.keys(u).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(c),pending:Object.keys(u),toLoadLanguages:Object.keys(f),toLoadNamespaces:Object.keys(h)}}},{key:"loaded",value:function(i,o,s){var a=i.split("|"),l=a[0],c=a[1];o&&this.emit("failedLoading",l,c,o),s&&this.store.addResourceBundle(l,c,s),this.state[i]=o?-1:2;var u={};this.queue.forEach(function(f){g5e(f.loaded,[l],c),N5e(f,i),o&&f.errors.push(o),f.pendingCount===0&&!f.done&&(Object.keys(f.loaded).forEach(function(h){u[h]||(u[h]={});var d=f.loaded[h];d.length&&d.forEach(function(p){u[h][p]===void 0&&(u[h][p]=!0)})}),f.done=!0,f.errors.length?f.callback(f.errors):f.callback())}),this.emit("loaded",u),this.queue=this.queue.filter(function(f){return!f.done})}},{key:"read",value:function(i,o,s){var a=this,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,c=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,u=arguments.length>5?arguments[5]:void 0;if(!i.length)return u(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:i,ns:o,fcName:s,tried:l,wait:c,callback:u});return}return this.readingCalls++,this.backend[s](i,o,function(f,h){if(a.readingCalls--,a.waitingReads.length>0){var d=a.waitingReads.shift();a.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(f&&h&&l<a.maxRetries){setTimeout(function(){a.read.call(a,i,o,s,l+1,c*2,u)},c);return}u(f,h)})}},{key:"prepareLoading",value:function(i,o){var s=this,a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},l=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),l&&l();typeof i=="string"&&(i=this.languageUtils.toResolveHierarchy(i)),typeof o=="string"&&(o=[o]);var c=this.queueLoad(i,o,a,l);if(!c.toLoad.length)return c.pending.length||l(),null;c.toLoad.forEach(function(u){s.loadOne(u)})}},{key:"load",value:function(i,o,s){this.prepareLoading(i,o,{},s)}},{key:"reload",value:function(i,o,s){this.prepareLoading(i,o,{reload:!0},s)}},{key:"loadOne",value:function(i){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",a=i.split("|"),l=a[0],c=a[1];this.read(l,c,"read",void 0,void 0,function(u,f){u&&o.logger.warn("".concat(s,"loading namespace ").concat(c," for language ").concat(l," failed"),u),!u&&f&&o.logger.log("".concat(s,"loaded namespace ").concat(c," for language ").concat(l),f),o.loaded(i,u,f)})}},{key:"saveMissing",value:function(i,o,s,a,l){var c=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(o)){this.logger.warn('did not save key "'.concat(s,'" as the namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}s==null||s===""||(this.backend&&this.backend.create&&this.backend.create(i,o,s,a,null,JM(JM({},c),{},{isUpdate:l})),!(!i||!i[0])&&this.store.addResource(i[0],o,s,a))}}]),n}(Fd);function X5e(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var n={};if(Ta(e[1])==="object"&&(n=e[1]),typeof e[1]=="string"&&(n.defaultValue=e[1]),typeof e[2]=="string"&&(n.tDescription=e[2]),Ta(e[2])==="object"||Ta(e[3])==="object"){var r=e[3]||e[2];Object.keys(r).forEach(function(i){n[i]=r[i]})}return n},interpolation:{escapeValue:!0,format:function(e,n,r,i){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function eN(t){return typeof t.ns=="string"&&(t.ns=[t.ns]),typeof t.fallbackLng=="string"&&(t.fallbackLng=[t.fallbackLng]),typeof t.fallbackNS=="string"&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t}function tN(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Uc(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?tN(Object(n),!0).forEach(function(r){Dn(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):tN(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function W5e(t){var e=U5e();return function(){var r=Vl(t),i;if(e){var o=Vl(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return s0(this,i)}}function U5e(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Bb(){}function q5e(t){var e=Object.getOwnPropertyNames(Object.getPrototypeOf(t));e.forEach(function(n){typeof t[n]=="function"&&(t[n]=t[n].bind(t))})}var j5=function(t){sh(n,t);var e=W5e(n);function n(){var r,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=arguments.length>1?arguments[1]:void 0;if(na(this,n),r=e.call(this),i4&&Fd.call(Bl(r)),r.options=eN(i),r.services={},r.logger=ou,r.modules={external:[]},q5e(Bl(r)),o&&!r.isInitialized&&!i.isClone){if(!r.options.initImmediate)return r.init(i,o),s0(r,Bl(r));setTimeout(function(){r.init(i,o)},0)}return r}return ra(n,[{key:"init",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;typeof o=="function"&&(s=o,o={}),!o.defaultNS&&o.ns&&(typeof o.ns=="string"?o.defaultNS=o.ns:o.ns.indexOf("translation")<0&&(o.defaultNS=o.ns[0]));var a=X5e();this.options=Uc(Uc(Uc({},a),this.options),eN(o)),this.options.compatibilityAPI!=="v1"&&(this.options.interpolation=Uc(Uc({},a.interpolation),this.options.interpolation)),o.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=o.keySeparator),o.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=o.nsSeparator);function l(O){return O?typeof O=="function"?new O:O:null}if(!this.options.isClone){this.modules.logger?ou.init(l(this.modules.logger),this.options):ou.init(null,this.options);var c;this.modules.formatter?c=this.modules.formatter:typeof Intl!="undefined"&&(c=z5e);var u=new T5e(this.options);this.store=new x5e(this.options.resources,this.options);var f=this.services;f.logger=ou,f.resourceStore=this.store,f.languageUtils=u,f.pluralResolver=new R5e(u,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),c&&(!this.options.interpolation.format||this.options.interpolation.format===a.interpolation.format)&&(f.formatter=l(c),f.formatter.init(f,this.options),this.options.interpolation.format=f.formatter.format.bind(f.formatter)),f.interpolator=new A5e(this.options),f.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},f.backendConnector=new D5e(l(this.modules.backend),f.resourceStore,f,this.options),f.backendConnector.on("*",function(O){for(var m=arguments.length,v=new Array(m>1?m-1:0),$=1;$<m;$++)v[$-1]=arguments[$];i.emit.apply(i,[O].concat(v))}),this.modules.languageDetector&&(f.languageDetector=l(this.modules.languageDetector),f.languageDetector.init(f,this.options.detection,this.options)),this.modules.i18nFormat&&(f.i18nFormat=l(this.modules.i18nFormat),f.i18nFormat.init&&f.i18nFormat.init(this)),this.translator=new ZM(this.services,this.options),this.translator.on("*",function(O){for(var m=arguments.length,v=new Array(m>1?m-1:0),$=1;$<m;$++)v[$-1]=arguments[$];i.emit.apply(i,[O].concat(v))}),this.modules.external.forEach(function(O){O.init&&O.init(i)})}if(this.format=this.options.interpolation.format,s||(s=Bb),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var h=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);h.length>0&&h[0]!=="dev"&&(this.options.lng=h[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined");var d=["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"];d.forEach(function(O){i[O]=function(){var m;return(m=i.store)[O].apply(m,arguments)}});var p=["addResource","addResources","addResourceBundle","removeResourceBundle"];p.forEach(function(O){i[O]=function(){var m;return(m=i.store)[O].apply(m,arguments),i}});var b=G0(),y=function(){var m=function($,S){i.isInitialized&&!i.initializedStoreOnce&&i.logger.warn("init: i18next is already initialized. You should call init just once!"),i.isInitialized=!0,i.options.isClone||i.logger.log("initialized",i.options),i.emit("initialized",i.options),b.resolve(S),s($,S)};if(i.languages&&i.options.compatibilityAPI!=="v1"&&!i.isInitialized)return m(null,i.t.bind(i));i.changeLanguage(i.options.lng,m)};return this.options.resources||!this.options.initImmediate?y():setTimeout(y,0),b}},{key:"loadResources",value:function(i){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Bb,a=s,l=typeof i=="string"?i:this.language;if(typeof i=="function"&&(a=i),!this.options.resources||this.options.partialBundledLanguages){if(l&&l.toLowerCase()==="cimode")return a();var c=[],u=function(d){if(!!d){var p=o.services.languageUtils.toResolveHierarchy(d);p.forEach(function(b){c.indexOf(b)<0&&c.push(b)})}};if(l)u(l);else{var f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.forEach(function(h){return u(h)})}this.options.preload&&this.options.preload.forEach(function(h){return u(h)}),this.services.backendConnector.load(c,this.options.ns,function(h){!h&&!o.resolvedLanguage&&o.language&&o.setResolvedLanguage(o.language),a(h)})}else a(null)}},{key:"reloadResources",value:function(i,o,s){var a=G0();return i||(i=this.languages),o||(o=this.options.ns),s||(s=Bb),this.services.backendConnector.reload(i,o,function(l){a.resolve(),s(l)}),a}},{key:"use",value:function(i){if(!i)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!i.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return i.type==="backend"&&(this.modules.backend=i),(i.type==="logger"||i.log&&i.warn&&i.error)&&(this.modules.logger=i),i.type==="languageDetector"&&(this.modules.languageDetector=i),i.type==="i18nFormat"&&(this.modules.i18nFormat=i),i.type==="postProcessor"&&QG.addPostProcessor(i),i.type==="formatter"&&(this.modules.formatter=i),i.type==="3rdParty"&&this.modules.external.push(i),this}},{key:"setResolvedLanguage",value:function(i){if(!(!i||!this.languages)&&!(["cimode","dev"].indexOf(i)>-1))for(var o=0;o<this.languages.length;o++){var s=this.languages[o];if(!(["cimode","dev"].indexOf(s)>-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}}},{key:"changeLanguage",value:function(i,o){var s=this;this.isLanguageChangingTo=i;var a=G0();this.emit("languageChanging",i);var l=function(h){s.language=h,s.languages=s.services.languageUtils.toResolveHierarchy(h),s.resolvedLanguage=void 0,s.setResolvedLanguage(h)},c=function(h,d){d?(l(d),s.translator.changeLanguage(d),s.isLanguageChangingTo=void 0,s.emit("languageChanged",d),s.logger.log("languageChanged",d)):s.isLanguageChangingTo=void 0,a.resolve(function(){return s.t.apply(s,arguments)}),o&&o(h,function(){return s.t.apply(s,arguments)})},u=function(h){!i&&!h&&s.services.languageDetector&&(h=[]);var d=typeof h=="string"?h:s.services.languageUtils.getBestMatchFromCodes(h);d&&(s.language||l(d),s.translator.language||s.translator.changeLanguage(d),s.services.languageDetector&&s.services.languageDetector.cacheUserLanguage(d)),s.loadResources(d,function(p){c(p,d)})};return!i&&this.services.languageDetector&&!this.services.languageDetector.async?u(this.services.languageDetector.detect()):!i&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(u):u(i),a}},{key:"getFixedT",value:function(i,o,s){var a=this,l=function c(u,f){var h;if(Ta(f)!=="object"){for(var d=arguments.length,p=new Array(d>2?d-2:0),b=2;b<d;b++)p[b-2]=arguments[b];h=a.options.overloadTranslationOptionHandler([u,f].concat(p))}else h=Uc({},f);h.lng=h.lng||c.lng,h.lngs=h.lngs||c.lngs,h.ns=h.ns||c.ns,h.keyPrefix=h.keyPrefix||s||c.keyPrefix;var y=a.options.keySeparator||".",O=h.keyPrefix?"".concat(h.keyPrefix).concat(y).concat(u):u;return a.t(O,h)};return typeof i=="string"?l.lng=i:l.lngs=i,l.ns=o,l.keyPrefix=s,l}},{key:"t",value:function(){var i;return this.translator&&(i=this.translator).translate.apply(i,arguments)}},{key:"exists",value:function(){var i;return this.translator&&(i=this.translator).exists.apply(i,arguments)}},{key:"setDefaultNamespace",value:function(i){this.options.defaultNS=i}},{key:"hasLoadedNamespace",value:function(i){var o=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var a=this.resolvedLanguage||this.languages[0],l=this.options?this.options.fallbackLng:!1,c=this.languages[this.languages.length-1];if(a.toLowerCase()==="cimode")return!0;var u=function(d,p){var b=o.services.backendConnector.state["".concat(d,"|").concat(p)];return b===-1||b===2};if(s.precheck){var f=s.precheck(this,u);if(f!==void 0)return f}return!!(this.hasResourceBundle(a,i)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||u(a,i)&&(!l||u(c,i)))}},{key:"loadNamespaces",value:function(i,o){var s=this,a=G0();return this.options.ns?(typeof i=="string"&&(i=[i]),i.forEach(function(l){s.options.ns.indexOf(l)<0&&s.options.ns.push(l)}),this.loadResources(function(l){a.resolve(),o&&o(l)}),a):(o&&o(),Promise.resolve())}},{key:"loadLanguages",value:function(i,o){var s=G0();typeof i=="string"&&(i=[i]);var a=this.options.preload||[],l=i.filter(function(c){return a.indexOf(c)<0});return l.length?(this.options.preload=a.concat(l),this.loadResources(function(c){s.resolve(),o&&o(c)}),s):(o&&o(),Promise.resolve())}},{key:"dir",value:function(i){if(i||(i=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!i)return"rtl";var o=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"];return o.indexOf(this.services.languageUtils.getLanguagePartFromCode(i))>-1||i.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}},{key:"cloneInstance",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Bb,a=Uc(Uc(Uc({},this.options),o),{isClone:!0}),l=new n(a),c=["store","services","language"];return c.forEach(function(u){l[u]=i[u]}),l.services=Uc({},this.services),l.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l.translator=new ZM(l.services,l.options),l.translator.on("*",function(u){for(var f=arguments.length,h=new Array(f>1?f-1:0),d=1;d<f;d++)h[d-1]=arguments[d];l.emit.apply(l,[u].concat(h))}),l.init(a,s),l.translator.options=l.options,l.translator.backendConnector.services.utils={hasLoadedNamespace:l.hasLoadedNamespace.bind(l)},l}},{key:"toJSON",value:function(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}]),n}(Fd);Dn(j5,"createInstance",function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return new j5(t,e)});var To=j5.createInstance();To.createInstance=j5.createInstance;To.createInstance;To.init;To.loadResources;To.reloadResources;To.use;To.changeLanguage;To.getFixedT;var B5e=To.t;To.exists;To.setDefaultNamespace;To.hasLoadedNamespace;To.loadNamespaces;To.loadLanguages;function w1(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}function Wo(t,e){if(t==null)return{};var n=w1(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&(!Object.prototype.propertyIsEnumerable.call(t,r)||(n[r]=t[r]))}return n}var F5e=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230);/g,Y5e={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"\xA9","©":"\xA9","®":"\xAE","®":"\xAE","…":"\u2026","…":"\u2026"},j5e=function(e){return Y5e[e]},Z5e=function(e){return e.replace(F5e,j5e)};function nN(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function rN(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?nN(Object(n),!0).forEach(function(r){Dn(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):nN(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var SQ={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Z5e},EG,V5e=z.exports.createContext();function G5e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};SQ=rN(rN({},SQ),t)}function H5e(){return SQ}var K5e=function(){function t(){na(this,t),this.usedNamespaces={}}return ra(t,[{key:"addUsedNamespaces",value:function(n){var r=this;n.forEach(function(i){r.usedNamespaces[i]||(r.usedNamespaces[i]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),t}();function J5e(t){EG=t}function e2e(){return EG}var t2e={type:"3rdParty",init:function(e){G5e(e.options.react),J5e(e)}};function n2e(){if(console&&console.warn){for(var t,e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];typeof n[0]=="string"&&(n[0]="react-i18next:: ".concat(n[0])),(t=console).warn.apply(t,n)}}var iN={};function xQ(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];typeof e[0]=="string"&&iN[e[0]]||(typeof e[0]=="string"&&(iN[e[0]]=new Date),n2e.apply(void 0,e))}function oN(t,e,n){t.loadNamespaces(e,function(){if(t.isInitialized)n();else{var r=function i(){setTimeout(function(){t.off("initialized",i)},0),n()};t.on("initialized",r)}})}function r2e(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=e.languages[0],i=e.options?e.options.fallbackLng:!1,o=e.languages[e.languages.length-1];if(r.toLowerCase()==="cimode")return!0;var s=function(l,c){var u=e.services.backendConnector.state["".concat(l,"|").concat(c)];return u===-1||u===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&e.services.backendConnector.backend&&e.isLanguageChangingTo&&!s(e.isLanguageChangingTo,t)?!1:!!(e.hasResourceBundle(r,t)||!e.services.backendConnector.backend||e.options.resources&&!e.options.partialBundledLanguages||s(r,t)&&(!i||s(o,t)))}function i2e(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!e.languages||!e.languages.length)return xQ("i18n.languages were undefined or empty",e.languages),!0;var r=e.options.ignoreJSONStructure!==void 0;return r?e.hasLoadedNamespace(t,{precheck:function(o,s){if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&o.services.backendConnector.backend&&o.isLanguageChangingTo&&!s(o.isLanguageChangingTo,t))return!1}}):r2e(t,e,n)}function o2e(t,e){var n=t==null?null:typeof Symbol!="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,s,a;try{for(n=n.call(t);!(i=(s=n.next()).done)&&(r.push(s.value),!(e&&r.length===e));i=!0);}catch(l){o=!0,a=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw a}}return r}}function En(t,e){return xG(t)||o2e(t,e)||mE(t,e)||kG()}function sN(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Lk(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?sN(Object(n),!0).forEach(function(r){Dn(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):sN(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}var s2e=function(e,n){var r=z.exports.useRef();return z.exports.useEffect(function(){r.current=n?r.current:e},[e,n]),r.current};function ia(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=e.i18n,r=z.exports.useContext(V5e)||{},i=r.i18n,o=r.defaultNS,s=n||i||e2e();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new K5e),!s){xQ("You will need to pass in an i18next instance by using initReactI18next");var a=function(L){return Array.isArray(L)?L[L.length-1]:L},l=[a,{},!1];return l.t=a,l.i18n={},l.ready=!1,l}s.options.react&&s.options.react.wait!==void 0&&xQ("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var c=Lk(Lk(Lk({},H5e()),s.options.react),e),u=c.useSuspense,f=c.keyPrefix,h=t||o||s.options&&s.options.defaultNS;h=typeof h=="string"?[h]:h||["translation"],s.reportNamespaces.addUsedNamespaces&&s.reportNamespaces.addUsedNamespaces(h);var d=(s.isInitialized||s.initializedStoreOnce)&&h.every(function(I){return i2e(I,s,c)});function p(){return s.getFixedT(null,c.nsMode==="fallback"?h:h[0],f)}var b=z.exports.useState(p),y=En(b,2),O=y[0],m=y[1],v=h.join(),$=s2e(v),S=z.exports.useRef(!0);z.exports.useEffect(function(){var I=c.bindI18n,L=c.bindI18nStore;S.current=!0,!d&&!u&&oN(s,h,function(){S.current&&m(p)}),d&&$&&$!==v&&S.current&&m(p);function C(){S.current&&m(p)}return I&&s&&s.on(I,C),L&&s&&s.store.on(L,C),function(){S.current=!1,I&&s&&I.split(" ").forEach(function(T){return s.off(T,C)}),L&&s&&L.split(" ").forEach(function(T){return s.store.off(T,C)})}},[s,v]);var w=z.exports.useRef(!0);z.exports.useEffect(function(){S.current&&!w.current&&m(p),w.current=!1},[s]);var k=[O,s,d];if(k.t=O,k.i18n=s,k.ready=d,d||!d&&!u)return k;throw new Promise(function(I){oN(s,h,function(){I()})})}var a2e={common_success:"Success",common_confirm:"Confirm",common_cancel:"Cancel",common_delete:"Delete",common_hidden:"Hidden",common_locked:"Locked",common_offline:"Offline",common_directory:"Directory",common_file:"File",editor_no_open_file:"None file opened",editor_large_file_tip:"The file size is over 16 MB, preview is not supported",editor_unsupported_format_file_cannot_display:"The file cannot be displayed for unsupported format",editor_picture_not_support_preview:"Picture's preview is not yet supported",editor_search_files_by_name:"Search files by name",editor_pending_update:"{{pendingUpdate}} updates to be written",editor_ot_success:"Success",editor_file_is_not_editable:"The file is not editable",editor_image_preview_failed_to_load_image:"Failed to load image",editor_image_preview_loading:"loading",file_tree_click_to_show:"Click to show",file_tree_click_to_hidden:"Click to hide",file_tree_click_to_cancel:"Click to cancel",file_tree_click_to_locked:"Click to lock",file_tree_joined_the_test:"Joined the test",file_tree_click_to_remove:"Click to remove",file_tree_add_test:"Add test",file_tree_num_of_files_cannot_exceed_500:"The number of files cannot exceed 500",file_tree_x_existed:"{{x}} existed",\u56DE\u653E\u5DF2\u6682\u505C:"Playback already pause.",\u56DE\u653E\u6A21\u5F0F\u4E0D\u652F\u6301\u6253\u5F00\u8BE5\u6587\u4EF6:"Cannot open the file with playback mode.",file_tree_x_filtered:"{{x}} filtered",file_tree_x_upload_not_allowed:"Upload of {{x}} not allowed",file_tree_renamed:"Renamed",file_tree_upload_files:"Upload files",file_tree_upload_folder:"Upload folder",show_hidden_files:"Show Hidden files",do_no_show_hidden_files:"Do not show hidden files",file_tree_rename:"Rename",file_tree_create_new_file:"New file",file_tree_create_new_folder:"New folder",file_tree_down_file:"Download",file_tree_failed_to_download_file:"Failed to download file",file_tree_make_sure_delete_x_unrecoverable:"Are you sure to delete this {{x}}? The file cannot be recovered after deletion",file_tree_kind_tips:"Notice",file_tree_understood:"Know",file_tree_space_char_exist_in_file_or_folder:"There is a space character",file_tree_file_exceeds_size_limit:"The file {{filePath}} exceeds the size limit of 16M",file_tree_rename_cannot_be_empty:"Rename cannot be empty",output_browser_click_run_start_application:"Click \u3010Run\u3011 to start the application",helpers_invalid_parameter_rate_x:"Invalid parameter: rate={{x}}",lib_the_area_already_set_answer_area_cannot_repeatedly:"The area has already set the answering area and cannot be set repeatedly",lib_x_file_cannot_set_the_answer_area:"The {{x}} file cannot set the answer area",lib_locked:"locked",lib_hidden:"hidden",store_user_not_found:"User not found",store_appStatus_transition_error_x:"AppStatus transition error: {{x}}",dao_channel_agentUserId_x_inconsistent:"The agentUserId {{x}} is inconsistent",dao_channel_event_x_is_not_supported:"Event {{x}} is not supported",dao_channel_connection_not_established:"The connection has not been established yet",dao_channel_playground_not_exist:"Playground does not exist",dao_channel_playground_unbound_container:"Playground unbound container",dao_channel_container_startup_failed:"Container startup failed",dao_channel_insufficient_server_resources:"Insufficient server resources",dao_channel_server_is_busy:"Server is busy",dao_channel_activation_timeout:"Docker activation timeout",dao_channel_docker_failed_to_activate:"Docker failed to start",dao_channel_socket_is_not_ready:"Socket is not ready",dao_channel_socket_is_not_ready_for_x:"Socket is not ready for {{x}}",dao_channel_socket_connect_broken:"Socket connection broken",debug_variables:"Variables",debug_call_stack:"Call stack",debug_staring:"staring",debug_tooltip_run:"Run",debug_tooltip_stop:"Stop",debug_tooltip_continue:"Continue",debug_tooltip_step_over:"Step Over",debug_tooltip_step_into:"Step Into",debug_tooltip_step_out:"Step Out",debug_call_stack_cannot_open_file:"Cannot open non-workspace file",dao_paas_cannot_follow_each_other:"Cannot follow each other",\u4E0D\u80FD\u76F4\u63A5\u590D\u5236\u7B54\u9898\u533A\u57DF\u5185\u5BB9:"Cannt copy the content",\u8BE5\u533A\u57DF\u4E0D\u53EF\u7F16\u8F91:"Cannt edit the content",dao_paas_not_find_mount_dom_object_for_x:"Could not find mounted DOM object for {{x}}",dao_paas_x_component_is_not_supported:"{{x}} component is not supported",dao_paas_no_ready:"No ready",\u8BF7\u5728\u6587\u4EF6\u6811\u4E2D\u6253\u5F00\u6587\u4EF6\u8FDB\u884C\u7F16\u8F91:"Pleas go to file tree to select one file and open it",dao_paas_file_does_not_exist:"File does not exist",dao_pass_set_answer_wrong:"Get wrong when insert answer for question",dao_paas_docker_has_been_destoryed:"docker has been destroyed","Unable to create file or directory with system reserved name":"Unable to create file or directory with system reserved name","The file or folder {{path}} already exists in this location, please choose another name":"The file or folder {{path}} already exists in this location, please choose another name","No results":"No results","Collapse the file tree":"Collapse the file tree","Create or rename to hidden files, will not be visible":"Create or rename to hidden files, will not be visible","Live refresh":"Live refresh","Code diagnosis":"Code diagnosis"},l2e={common_success:"\u6210\u529F",common_confirm:"\u786E\u5B9A",common_cancel:"\u53D6\u6D88",common_delete:"\u5220\u9664",common_hidden:"\u5DF2\u9690\u85CF",common_locked:"\u5DF2\u52A0\u9501",common_offline:"\u79BB\u7EBF",common_directory:"\u76EE\u5F55",common_file:"\u6587\u4EF6",editor_no_open_file:"\u672A\u6253\u5F00\u6587\u4EF6",editor_large_file_tip:"\u6587\u4EF6\u8D85\u8FC716\u5146\u5927\u5C0F\uFF0C\u6682\u4E0D\u652F\u6301\u9884\u89C8",editor_unsupported_format_file_cannot_display:"\u6B64\u6587\u4EF6\u662F\u4E8C\u8FDB\u5236\u6587\u4EF6\u6216\u4F7F\u7528\u4E86\u4E0D\u652F\u6301\u7684\u6587\u4EF6\u7F16\u7801\uFF0C\u65E0\u6CD5\u5728\u7F16\u8F91\u5668\u4E2D\u663E\u793A",editor_picture_not_support_preview:"\u56FE\u7247\u6682\u65F6\u4E0D\u652F\u6301\u9884\u89C8",editor_search_files_by_name:"\u6309\u540D\u79F0\u641C\u7D22\u6587\u4EF6",editor_pending_update:"{{pendingUpdate}}\u4E2A\u66F4\u65B0\u5F85\u5199\u5165",editor_ot_success:"\u6210\u529F",editor_file_is_not_editable:"\u8BE5\u6587\u4EF6\u4E0D\u53EF\u7F16\u8F91",editor_image_preview_failed_to_load_image:"\u52A0\u8F7D\u56FE\u7247\u5931\u8D25",editor_image_preview_loading:"\u52A0\u8F7D\u4E2D...",file_tree_click_to_show:"\u70B9\u51FB\u663E\u793A",file_tree_click_to_hidden:"\u70B9\u51FB\u9690\u85CF",file_tree_click_to_cancel:"\u70B9\u51FB\u53D6\u6D88",file_tree_click_to_locked:"\u70B9\u51FB\u9501\u5B9A",file_tree_joined_the_test:"\u5DF2\u52A0\u5165\u6D4B\u8BD5",file_tree_click_to_remove:"\u70B9\u51FB\u79FB\u9664",file_tree_add_test:"\u6DFB\u52A0\u6D4B\u8BD5",file_tree_num_of_files_cannot_exceed_500:"\u6587\u4EF6\u6570\u91CF\u4E0D\u80FD\u8D85\u8FC7500",file_tree_x_existed:"{{x}}\u5DF2\u5B58\u5728",\u56DE\u653E\u5DF2\u6682\u505C:"\u56DE\u653E\u5DF2\u6682\u505C",\u56DE\u653E\u6A21\u5F0F\u4E0D\u652F\u6301\u6253\u5F00\u8BE5\u6587\u4EF6:"\u56DE\u653E\u6A21\u5F0F\u4E0D\u652F\u6301\u6253\u5F00\u8BE5\u6587\u4EF6",file_tree_x_filtered:"{{x}}\u88AB\u8FC7\u6EE4",file_tree_x_upload_not_allowed:"{{x}}\u4E0D\u5141\u8BB8\u4E0A\u4F20",file_tree_renamed:"\u91CD\u540D\u4E86",file_tree_upload_files:"\u4E0A\u4F20\u6587\u4EF6",file_tree_upload_folder:"\u4E0A\u4F20\u6587\u4EF6\u5939",show_hidden_files:"\u663E\u793A\u9690\u85CF\u6587\u4EF6",do_no_show_hidden_files:"\u4E0D\u663E\u793A\u9690\u85CF\u6587\u4EF6",file_tree_rename:"\u91CD\u547D\u540D",file_tree_create_new_file:"\u65B0\u5EFA\u6587\u4EF6",file_tree_create_new_folder:"\u65B0\u5EFA\u6587\u4EF6\u5939",file_tree_down_file:"\u4E0B\u8F7D",file_tree_failed_to_download_file:"\u4E0B\u8F7D\u6587\u4EF6\u5931\u8D25",file_tree_make_sure_delete_x_unrecoverable:"\u786E\u5B9A\u5220\u9664\u8FD9\u4E2A{{x}}\u5417\uFF1F\u5220\u9664\u540E\u4E0D\u53EF\u6062\u590D",file_tree_kind_tips:"\u6E29\u99A8\u63D0\u793A",file_tree_understood:"\u77E5\u9053\u4E86",file_tree_space_char_exist_in_file_or_folder:"\u5B58\u5728\u7A7A\u683C\u5B57\u7B26",file_tree_file_exceeds_size_limit:"\u6587\u4EF6{{filePath}}\u8D85\u51FA\u4E8616M\u7684\u5927\u5C0F\u9650\u5236",file_tree_rename_cannot_be_empty:"\u91CD\u547D\u540D\u4E0D\u80FD\u4E3A\u7A7A",output_browser_click_run_start_application:"\u70B9\u51FB\u3010\u8FD0\u884C\u3011\u542F\u52A8\u5E94\u7528",helpers_invalid_parameter_rate_x:"\u65E0\u6548\u7684\u53C2\u6570: rate={{x}}",lib_the_area_already_set_answer_area_cannot_repeatedly:"\u8BE5\u533A\u57DF\u5DF2\u8BBE\u7F6E\u7B54\u9898\u533A\uFF0C\u4E0D\u53EF\u91CD\u590D\u8BBE\u7F6E",lib_x_file_cannot_set_the_answer_area:"{{x}}\u6587\u4EF6\u4E0D\u53EF\u4EE5\u8BBE\u7F6E\u7B54\u9898\u533A",lib_locked:"\u52A0\u9501",lib_hidden:"\u9690\u85CF",store_user_not_found:"\u627E\u4E0D\u5230\u7528\u6237",store_appStatus_transition_error_x:"appStatus \u8F6C\u6362\u9519\u8BEF: {{x}}",dao_channel_agentUserId_x_inconsistent:"agentUserId {{x}} \u4E0D\u4E00\u81F4",dao_channel_event_x_is_not_supported:"\u4E8B\u4EF6 {{x}} \u4E0D\u652F\u6301",dao_channel_connection_not_established:"\u8FDE\u63A5\u5C1A\u672A\u5EFA\u7ACB",dao_channel_playground_not_exist:"playground\u4E0D\u5B58\u5728",dao_channel_playground_unbound_container:"playground\u672A\u7ED1\u5B9A\u5BB9\u5668",dao_channel_container_startup_failed:"\u5BB9\u5668\u542F\u52A8\u5931\u8D25",dao_channel_insufficient_server_resources:"\u670D\u52A1\u5668\u8D44\u6E90\u4E0D\u8DB3",dao_channel_server_is_busy:"\u670D\u52A1\u5668\u7E41\u5FD9",dao_channel_activation_timeout:"docker\u6FC0\u6D3B\u8D85\u65F6",dao_channel_docker_failed_to_activate:"docker\u542F\u52A8\u5931\u8D25",dao_channel_socket_is_not_ready:"socket\u672A\u51C6\u5907\u597D",dao_channel_socket_is_not_ready_for_x:"socket \u8FD8\u6CA1\u6709\u4E3A{{x}}\u51C6\u5907\u597D",dao_channel_socket_connect_broken:"socket\u8FDE\u63A5\u4E2D\u65AD",debug_variables:"\u53D8\u91CF",debug_call_stack:"\u8C03\u7528\u5806\u6808",debug_staring:"\u542F\u52A8\u4E2D",debug_tooltip_run:"\u8FD0\u884C",debug_tooltip_stop:"\u505C\u6B62",debug_tooltip_continue:"\u7EE7\u7EED",debug_tooltip_step_over:"\u5355\u6B65\u8DF3\u8FC7",debug_tooltip_step_into:"\u5355\u6B65\u8C03\u8BD5",debug_tooltip_step_out:"\u5355\u6B65\u8DF3\u51FA",debug_call_stack_cannot_open_file:"\u65E0\u6CD5\u6253\u5F00\u975E\u5DE5\u4F5C\u533A\u6587\u4EF6",dao_paas_cannot_follow_each_other:"\u4E0D\u80FD\u4E92\u76F8\u8DDF\u968F",\u4E0D\u80FD\u76F4\u63A5\u590D\u5236\u7B54\u9898\u533A\u57DF\u5185\u5BB9:"\u4E0D\u80FD\u76F4\u63A5\u590D\u5236\u7B54\u9898\u533A\u57DF\u5185\u5BB9",\u8BE5\u533A\u57DF\u4E0D\u53EF\u7F16\u8F91:"\u8BE5\u533A\u57DF\u4E0D\u53EF\u7F16\u8F91",dao_paas_not_find_mount_dom_object_for_x:"\u627E\u4E0D\u5230\u4E3A{{x}}\u7684\u6302\u8F7DDOM\u5BF9\u8C61",dao_paas_x_component_is_not_supported:"\u7EC4\u4EF6{{x}}\u4E0D\u652F\u6301",dao_paas_no_ready:"\u672A\u51C6\u5907",\u8BF7\u5728\u6587\u4EF6\u6811\u4E2D\u6253\u5F00\u6587\u4EF6\u8FDB\u884C\u7F16\u8F91:"\u8BF7\u5728\u6587\u4EF6\u6811\u4E2D\u6253\u5F00\u6587\u4EF6\u8FDB\u884C\u7F16\u8F91",dao_paas_file_does_not_exist:"\u6587\u4EF6\u4E0D\u5B58\u5728",dao_pass_set_answer_wrong:"\u8BBE\u7F6E\u9898\u76EE\u7B54\u6848\u9519\u8BEF",dao_paas_docker_has_been_destoryed:"docker\u5DF2\u7ECF\u88AB\u9500\u6BC1","Unable to create file or directory with system reserved name":"\u65E0\u6CD5\u4F7F\u7528\u7CFB\u7EDF\u4FDD\u7559\u540D\u79F0\u521B\u5EFA\u6587\u4EF6\u6216\u76EE\u5F55","The file or folder {{path}} already exists in this location, please choose another name":"\u6B64\u4F4D\u7F6E\u5DF2\u5B58\u5728\u6587\u4EF6\u6216\u8005\u6587\u4EF6\u5939 {{path}}\uFF0C\u8BF7\u9009\u62E9\u5176\u5B83\u540D\u79F0","No results":"\u6CA1\u6709\u7ED3\u679C","Collapse the file tree":"\u6536\u8D77\u6587\u4EF6\u6811","Create or rename to hidden files, will not be visible":"\u521B\u5EFA\u6216\u8005\u91CD\u547D\u540D\u4E3A\u9690\u85CF\u6587\u4EF6\uFF0C\u5C06\u4E0D\u53EF\u89C1","Live refresh":"\u5B9E\u65F6\u5237\u65B0","Code diagnosis":"\u4EE3\u7801\u8BCA\u65AD"},Z5=(t=>(t.ZH="ZH",t.EN="EN",t))(Z5||{});const c2e={EN:{translation:a2e},ZH:{translation:l2e}},u2e="ZH";To.use(t2e).init({resources:c2e,lng:u2e,keySeparator:!1,interpolation:{escapeValue:!1}});const qn=To.t,f2e=[1,2,3,5,8,16];class d2e{constructor(e,n,r,i,o,s,a,l){ct(this,"start");ct(this,"end");ct(this,"totalTime");ct(this,"rate");ct(this,"preFrameTime",0);ct(this,"resumeTime",0);ct(this,"dataBuffer",[]);ct(this,"playing",!1);ct(this,"isReplay",!1);ct(this,"index",0);ct(this,"firstFrameTime",0);ct(this,"isMovePosition",!1);ct(this,"preTerminalIndex",{});ct(this,"preDebugIndex",{});ct(this,"preFireTreeIndex",{});ct(this,"preTerminalDockerId","");ct(this,"preConsoleDockerId","");ct(this,"isStopMovePosition",!1);ct(this,"triggerEventForMaxTimespanRecord","");ct(this,"triggerEventForMaxTimespan",-1);ct(this,"eventCustomize");ct(this,"eventDispatcher");ct(this,"getPlaybackSnapshot");ct(this,"progressDispatcher");ct(this,"currentDockerId");this.start=e,this.end=n,this.rate=1,this.totalTime=n-e,this.triggerEventForMaxTimespan=i,this.eventDispatcher=o,this.progressDispatcher=s,this.getPlaybackSnapshot=a,this.eventCustomize=l,this.step=this.step.bind(this),this.currentDockerId=""}logger(...e){Qt.info(`${new Date(Date.now()).toLocaleString()} [Playback]${e.join(",")}`)}convertToAbsoluteTime(e){return this.start+e}getFileRootPathByDockerId(e){const n=this.index>=this.dataBuffer.length?this.dataBuffer.length-1:this.index;for(let r=n;r>=0;r--){const i=this.dataBuffer[r];if(this.isFileTree(i.eventName)&&i.dockerId===e&&i.data.fileRootPath)return i.data.fileRootPath}for(let r=0;r<this.dataBuffer.length;r++){const i=this.dataBuffer[r];if(this.isFileTree(i.eventName)&&i.dockerId===e&&i.data.fileRootPath)return i.data.fileRootPath}}getCurrentDocByPathAndDocker(e,n){const r=this.index>=this.dataBuffer.length?this.dataBuffer.length-1:this.index,i=(o,s)=>{var l;if(this.isEditor(o.eventName)&&o.dockerId===e&&o.data.openedPath===n)return o.snapshot||(o=((l=this.getPlaybackSnapshot)==null?void 0:l.call(this,o.eventName,o,this.getPreFrameByFrame(o,s)))||o),o};for(let o=r;o>=0;o--){const s=this.dataBuffer[o],a=i(s,o);if(a)return a}for(let o=0;o<this.dataBuffer.length;o++){const s=this.dataBuffer[o],a=i(s,o);if(a)return a}}getCurrentFrame(){return this.index>=this.dataBuffer.length?this.dataBuffer[this.dataBuffer.length-1]:this.dataBuffer[this.index]}setRate(e){e&&!f2e.includes(e)&&this.progressDispatcher&&this.progressDispatcher("error",`${qn("helpers_invalid_parameter_rate_x",{x:e})}`),this.rate=e||this.rate}buffer(e){this.dataBuffer=this.dataBuffer.concat(e),this.firstFrameTime=this.dataBuffer[0].timestamp}pause(){if(this.logger("Click Pause!"),!this.playing){Qt.warn("Do not pause more than one time");return}this.playing=!1}resume(){this.resumeTime=this.resumeTime||0,this.resumeTime>0?this.isReplay=!0:this.preFrameTime=Date.now(),this.playing=!0,this.isStopMovePosition=!1,window.requestAnimationFrame(this.step)}restart(){this.preFrameTime=Date.now(),this.playing=!0,this.preFireTreeIndex={},this.preTerminalIndex={},this.preDebugIndex={},this.preTerminalDockerId="",this.preConsoleDockerId="",Se.file.reset(),this.index=0,window.requestAnimationFrame(this.step)}movePosition(e){var n;if(!((n=this.dataBuffer)!=null&&n.length)){this.resumeTime=e;return}this.isStopMovePosition=!this.playing,this.resumeTime=e,this.isReplay=!0,this.index=this.findFrameByTimeStamp(),this.isMovePosition=!0,this.preTerminalIndex={},this.preDebugIndex={},Se.dao.resetTerminal(),Se.dao.resetConsole(),J.dao.channel().xtermStatus({resetConsole:!0}),window.requestAnimationFrame(this.step)}findFrameByTimeStamp(){const e=this.resumeTime+this.firstFrameTime,n=this.dataBuffer,r=n.length,i=(a,l)=>{var c,u,f,h;if(a<=l){const d=Math.floor((l-a)/2+a),p=n[d].timestamp;return p===e?d:e===((c=n[d-1])==null?void 0:c.timestamp)?d-1:e===((u=n[d+1])==null?void 0:u.timestamp)?d+1:e>((f=n[d-1])==null?void 0:f.timestamp)&&e<((h=n[d+1])==null?void 0:h.timestamp)?d:(e<p?l=d-1:e>p&&(a=d+1),i(a,l))}else return Qt.warn("Do not find the next frame"),this.index=0,this.resumeTime=0,this.resume(),this.index},o=0,s=r-1;return i(o,s)}gotoNextFrame(){var e;!this.isStopMovePosition&&((e=this.progressDispatcher)==null||e.call(this,"progress",this.resumeTime)),this.isStopMovePosition?(this.playing=!1,this.isStopMovePosition=!1):(this.preFrameTime=Date.now(),window.requestAnimationFrame(this.step))}triggerCustomizeEvent(e){var n;(n=this.eventCustomize)==null||n.call(this,e)}step(){var n,r,i;if(!this.playing&&!this.isStopMovePosition)return;if(this.isReplay&&(this.isReplay=!1,this.preFrameTime=Date.now()),this.resumeTime=this.resumeTime+(Date.now()-this.preFrameTime)*this.rate,this.index>this.dataBuffer.length-1){this.playing=!1,this.resumeTime=0,!this.isStopMovePosition&&((n=this.progressDispatcher)==null||n.call(this,"progress",this.totalTime)),(r=this.progressDispatcher)==null||r.call(this,"complete",this.resumeTime);return}let e=this.dataBuffer[this.index];if(!e){this.gotoNextFrame();return}if(e.eventName==="customize"&&(this.firstFrameTime+this.resumeTime>(e==null?void 0:e.timestamp)&&(this.logger(this.index,e.index,e.eventName,e._id),this.index++,this.triggerCustomizeEvent(e)),!this.isStopMovePosition)){this.gotoNextFrame();return}if(this.isMovePosition){this.triggerPreFrames(),this.isMovePosition=!1;return}if(this.firstFrameTime+this.resumeTime>(e==null?void 0:e.timestamp)){let o=0;const s=this.firstFrameTime+this.resumeTime;for(let a=this.index+1;a<this.dataBuffer.length&&this.dataBuffer[a].timestamp<=s;a++)o++,this.index=a;o>0&&(e=this.dataBuffer[this.index],this.isMovePosition=!0),this.isMovePosition?(this.triggerPreFrames(),this.isMovePosition=!1):(e=((i=this.getPlaybackSnapshot)==null?void 0:i.call(this,e.eventName,e,this.getPreFrameByFrame(e,this.index)||e))||e,this.setPreFrameData(e,this.index)),this.trigger(e.eventName,e)}else this.isMovePosition&&(this.triggerPreFrames(),this.isMovePosition=!1);this.gotoNextFrame()}getPreFrameByFrame(e,n){const{eventName:r,dockerId:i}=e,o=this.isEditor(r),s=this.isFileTree(r);let a;if(o){const{data:{openedPath:l}}=e;for(let c=n-1;c>=0;c--){const u=this.dataBuffer[c];if(u.dockerId===i&&u.eventName===r&&u.data.openedPath===l){a=this.dataBuffer[c],!a.snapshot&&c>=0&&this.setSnapshotByIndex(c);break}}}return s&&(a=this.dataBuffer[this.preFireTreeIndex[i]]),a}setPreFrameData(e,n){const{eventName:r,dockerId:i}=e;this.isFileTree(r)&&(this.preFireTreeIndex[i]=n)}isEditor(e){return e===Ot.Editor}isFileTree(e){return e===Ot.FileTree}isTerminal(e){return e===Ot.Terminal}isConsole(e){return e===Ot.Console}isDebug(e){return e===Ot.Debug}isTerminalOrConsole(e){return[Ot.Terminal.toString(),Ot.Console.toString()].includes(e)}setSnapshotByIndex(e){var o;const n=this.dataBuffer[e],{eventName:r}=n,i=this.isEditor(r);for(let s=0;s<=e;s++){let a=this.dataBuffer[s];if(a.eventName===n.eventName&&a.dockerId===n.dockerId&&(i?a.data.openedPath===n.data.openedPath:!0)){if(a.snapshot){this.setPreFrameData(a,s);continue}a=((o=this.getPlaybackSnapshot)==null?void 0:o.call(this,a.eventName,a,this.getPreFrameByFrame(a,s)))||a,this.setPreFrameData(a,s)}}}triggerPreFrames(){var s;const e=[Ot.FileTree.toString(),Ot.Editor.toString(),Ot.Terminal.toString(),Ot.Console.toString(),Ot.Debug.toString()],n=J.file.doc().openedPath;let r=!1;const i=this.index,o=this.dataBuffer[i].dockerId;this.currentDockerId=o;for(let a=i;a>=0;a--){if(!e.length)return;if(e.includes(this.dataBuffer[a].eventName)&&this.dataBuffer[a].dockerId===this.currentDockerId){const l=this.dataBuffer[a],c=e.findIndex(u=>u===l.eventName);e.splice(c,1),l.eventName===Ot.Editor.toString()&&!r&&n!==l.data.openedPath&&(J.file.editorView()&&((s=J.file.editorView())==null||s.destroy(),Se.file.editorView(void 0),Qt.log("%c[Editor]: unmount","color: red")),Se.file.resetFile(),r=!0),l.snapshot||this.setSnapshotByIndex(a),this.trigger(l.eventName,l,!1)}}e.forEach(a=>{this.logger("trigger reset eventName:",a),this.trigger(a,null,!1)})}trigger(e,n,r=!0){if(e==="customize"){this.logger(this.index,e,n==null?void 0:n._id),this.triggerCustomizeEvent(n),r&&this.index++;return}const i=this.isTerminalOrConsole(e),o=this.isDebug(e);if(!i&&!o){this.logger(this.index,e,n==null?void 0:n._id),this.eventDispatcher(e,n),r&&this.index++;return}const s=n==null?void 0:n.dockerId;this.logger("[TR]",s);const a=this.preTerminalIndex[s]||0,l=this.preDebugIndex[s]||0,c=o?l:a;for(let u=c+1;u<=this.index;u++){const f=this.dataBuffer[u];f&&(this.isTerminalOrConsole(f.eventName)||o)&&f.dockerId===s&&(this.logger("[TR]",u,this.index,f.eventName,this.dataBuffer[u].dockerId,this.dataBuffer[u]._id),this.isTerminal(e)&&(this.preTerminalDockerId&&this.preTerminalDockerId!==s&&Se.dao.resetTerminal(),this.preTerminalDockerId=s),this.isConsole(e)&&(this.preConsoleDockerId&&this.preConsoleDockerId!==s&&(Se.dao.resetConsole(),J.dao.channel().xtermStatus({resetConsole:!0})),this.preConsoleDockerId=s),this.eventDispatcher(f.eventName,f))}o?this.preDebugIndex[s]=this.index:this.preTerminalIndex[s]=this.index,r&&this.index++}}const h2e="@dao42/d42paas-front",O2e="0.9.144",p2e="d42paas front",m2e="dao42 paas team",g2e="https://github.com/dao42/d42paas_frontend#readme",v2e="UNLICENSED",y2e="./dist/DaoPaaS.cjs",b2e="./dist/DaoPaaS.cjs",_2e="./dist/DaoPaaS.d.ts",$2e={prebuild:"rimraf dist",build:"cross-env VITE_BUILD_EVENT=true pnpm tsc && pnpm vite && pnpm typedoc",copydist:"cp -r dist/sdk ../demo/public/",vite:"vite build --config ./config/vite.config.ts && shx cp ./src/types/DaoPaaS.d.ts ./dist",typedoc:"npx typedoc --tsconfig ./doc.tsconfig.json",workNameSpaceToFix:"node ./config/workNameSpaceToFix.js",tsc:"tsc -p ./tsconfig.json --isolatedModules false",test1:"jest --coverage",test:"jest",prepublish:"pnpm build",publish:"npm publish --access public"},S2e={"@babel/core":"7.4.5","@babel/preset-env":"7.4.5","@codemirror/autocomplete":"^6.0.2","@codemirror/collab":"^6.0.0","@codemirror/commands":"^6.0.0","@codemirror/lang-cpp":"^6.0.0","@codemirror/lang-css":"^6.0.0","@codemirror/lang-html":"^6.0.0","@codemirror/lang-java":"^6.0.0","@codemirror/lang-javascript":"^6.0.0","@codemirror/lang-json":"^6.0.0","@codemirror/lang-lezer":"^6.0.0","@codemirror/lang-markdown":"^6.0.0","@codemirror/lang-php":"^6.0.0","@codemirror/lang-python":"^6.0.0","@codemirror/lang-rust":"^6.0.0","@codemirror/lang-sql":"^6.0.0","@codemirror/lang-xml":"^6.0.0","@codemirror/language":"6.5.0","@codemirror/legacy-modes":"^6.0.0","@codemirror/lint":"^6.0.0","@codemirror/search":"^6.0.0","@codemirror/state":"^6.2.0","@codemirror/theme-one-dark":"^6.0.0","@codemirror/view":"^6.8.1","@emotion/babel-plugin":"^11.3.0","@emotion/babel-preset-css-prop":"^11.2.0","@emotion/core":"^11.0.0","@emotion/css":"^11.1.3","@emotion/eslint-plugin":"^11.2.0","@emotion/react":"^11.9.3","@emotion/styled":"^11.3.0","@headlessui/react":"^1.4.3","@loadable/component":"^5.15.2","@open-rpc/client-js":"^1.7.1","@testing-library/jest-dom":"^5.16.4","@testing-library/react":"^13.3.0","@testing-library/user-event":"^14.4.3","@types/fs-extra":"^9.0.13","@types/jest":"^27.0.2","@types/loadable__component":"^5.13.4","@types/lodash":"^4.14.175","@types/lodash.clonedeep":"^4.5.7","@types/lodash.debounce":"^4.0.7","@types/lodash.isequal":"^4.5.6","@types/lodash.throttle":"^4.1.7","@types/node":"^16.11.1","@types/ot":"^0.0.5","@types/prop-types":"^15.7.5","@types/react":"^18.0.14","@types/react-dom":"^18.0.5","@types/react-transition-group":"^4.4.5","@types/testing-library__jest-dom":"^5.14.5","@types/uuid":"^8.3.1","@typescript-eslint/eslint-plugin":"^4.28.2","@typescript-eslint/parser":"^4.28.2","@udecode/zustood":"^1.1.1","@vitejs/plugin-react":"^1.0.7",ahooks:"^3.3.10","babel-loader":"^8.2.2",bufferutil:"^4.0.6",classnames:"^2.3.1",codemirror:"^6.0.0",concurrently:"^6.3.0","cross-env":"^7.0.3",devicon:"^2.14.0",dexie:"^3.2.0","file-icons-js":"^1.1.0","file-loader":"^6.2.0","fs-extra":"^10.0.0","glob-all":"^3.2.1","highlight.js":"^11.6.0","hotkeys-js":"^3.9.4",immer:"^9.0.14",jest:"27.0.6",lodash:"^4.17.21",msw:"^0.39.2","ninja-keys":"^1.1.12",ot:"^0.0.15","prop-types":"^15.8.1",react:"^18.2.0","react-complex-tree":"^1.1.6","react-content-loader":"^6.2.0","react-dom":"18.2.0","react-icons":"^4.3.1","react-transition-group":"^4.4.2","rehype-document":"^6.1.0","rehype-highlight":"^5.0.2","rehype-katex":"^6.0.2","rehype-stringify":"^9.0.3","remark-gfm":"^3.0.1","remark-math":"^5.1.1","remark-parse":"^10.0.1","remark-rehype":"^10.1.0",rimraf:"^3.0.2","rollup-plugin-visualizer":"^5.6.0",sass:"^1.43.2","sass-loader":"^12.2.0",shx:"^0.3.3","socket.io-client":"^4.5.1","source-map-loader":"^3.0.0","style-loader":"^3.3.1",stylis:"^4.0.10","ts-jest":"^27.1.3","ts-loader":"^9.2.5","ts-node":"^10.0.0",typedoc:"^0.22.12",unified:"^10.1.2","use-immer":"^0.7.0","utf-8-validate":"^5.0.9",uuid:"^8.3.2",vite:"^2.9.15","vite-plugin-html":"^3.0.6","whatwg-fetch":"^3.6.2",xterm:"^4.13.0","xterm-addon-attach":"^0.6.0","xterm-addon-fit":"^0.5.0",zustand:"^4.0.0-rc.1"},x2e=["dist"],w2e={type:"git",url:"git+https://github.com/dao42/d42paas_frontend.git"},k2e={url:"https://github.com/dao42/d42paas_frontend/issues"},T2e={workerDirectory:"src"},P2e={"@babel/plugin-transform-modules-commonjs":"^7.18.2","babel-jest":"^29.3.1","babel-preset-react-app":"^10.0.1","codemirror-lang-elixir":"^3.0.0","detect-indent":"^7.0.1",i18next:"^21.8.16","jest-websocket-mock":"^2.4.0",lib0:"^0.2.58","lodash.clonedeep":"^4.5.0","lodash.debounce":"^4.0.8","lodash.isequal":"^4.5.0","lodash.throttle":"^4.1.1",minimatch:"^5.1.0","range-analyzer":"0.1.1-alpha.2","rc-dropdown":"^4.0.1","rc-menu":"^9.6.3","react-app-polyfill":"^3.0.0","react-i18next":"11.18.3","socket.io":"^4.5.1","socket.io-mock":"^1.3.2","socket.io-msgpack-parser":"^3.0.1","xterm-addon-web-links":"^0.6.0"};var Q2e={name:h2e,version:O2e,description:p2e,author:m2e,homepage:g2e,license:v2e,main:y2e,module:b2e,types:_2e,scripts:$2e,devDependencies:S2e,files:x2e,repository:w2e,bugs:k2e,msw:T2e,dependencies:P2e};const E2e=()=>Q2e.version,C2e=async(t,e,n)=>{const r=window.localStorage.getItem("__paas__testServerCode__"),i=r?{serverCode:r}:{},s=await(await fetch(t+"/api/v1/jssdk/ticket",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({ticket:e,packageVersion:n,...i})})).json();if(s.status==="failure")throw Qt.error(s),new Error(s.errors[0].erromsg);return s.data},CG=(t,e=1)=>{t=t||"#ffffff";let n=t.replace("#","");n.length===3&&(n=`${n[0]}${n[0]}${n[1]}${n[1]}${n[2]}${n[2]}`);const r=parseInt(n.substring(0,2),16),i=parseInt(n.substring(2,4),16),o=parseInt(n.substring(4,6),16);return e>1&&e<=100&&(e=e/100),`rgba(${r},${i},${o},${e})`},R2e=()=>{const t=`
|
|
50
50
|
@keyframes fadeOut {
|
|
51
51
|
0% {opacity: 1;}
|
|
52
52
|
100% {opacity: 0;}
|
|
@@ -1021,7 +1021,7 @@ and limitations under the License.
|
|
|
1021
1021
|
z-index: 11;
|
|
1022
1022
|
width: 100%;
|
|
1023
1023
|
}
|
|
1024
|
-
`,w7e=(t,e)=>{const{className:n,children:r,meun:i,position:o="bottom",container:s,isMask:a=!0,enableResize:l=!1,popupAlign:c={},onClose:u}=t,[f,h]=z.exports.useState(!1),d=z.exports.useRef(null),p=z.exports.useRef(null),[b,y]=z.exports.useState({}),O=z.exports.useRef(null),m=z.exports.useCallback(()=>{h(!1),u&&u()},[u]),v=z.exports.useCallback(L=>{if(!p.current||!d.current)return;const C=d.current,T=p.current;!$6(C,L.target)&&!$6(T,L.target)&&m()},[m]);z.exports.useEffect(()=>(window.document.addEventListener("mousedown",v),()=>{window.document.removeEventListener("mousedown",v)}),[v]),z.exports.useEffect(()=>{i||h(!1)},[i]),z.exports.useEffect(()=>{f&&k()},[f]),z.exports.useImperativeHandle(e,()=>({click:()=>{f&&u&&u(),h(!0)},close:()=>{h(!1)},open:f}));const $=z.exports.useCallback((L=0)=>{if(!!f&&L<4){w(k);return}},[f]),S=z.exports.useCallback(()=>{$()},[$]);z.exports.useEffect(()=>(l&&window.addEventListener("resize",S),()=>{l&&window.removeEventListener("resize",S)}),[l,S]);const w=L=>{const{requestAnimationFrame:C,cancelAnimationFrame:T}=window;O.current&&T(O.current),O.current=C(()=>{L(),O.current=null})},k=()=>{if(!p.current||!d.current)return;const L=s||document.body,C=p.current,T=d.current,{style:E}=BJ({position:o,popupAlign:c},C,T,L);y(E||{})},I=ue(nO,{in:f,classNames:"d42-fade",timeout:0,unmountOnExit:!0,appear:!0,children:ue("div",{className:a?"d42-mask":"",onClick:L=>{L.preventDefault(),L.stopPropagation(),h(!1),u&&u()},children:ue("div",{ref:p,className:zn("d42-expaned-wrapper",o),style:{position:"absolute",zIndex:1115,...b},children:i||null})})});return ue(x7e,{ref:d,className:n!=null?n:"",children:Kt("div",{className:"d42-popover-container",children:[ue("div",{onClick:L=>{L.preventDefault(),L.stopPropagation(),f&&u&&u(),h(!f)},children:r}),Qc.createPortal(I,s||document.body)]})})};var S6=At.forwardRef(w7e);class YJ{constructor(e,n,r,i){this.origin=e,this.changes=n,this.effects=r,this.clientID=i}}class b2{constructor(e,n){this.version=e,this.unconfirmed=n}}const _2=Ft.define({combine(t){let e=Kl(t,{startVersion:0,clientID:null,sharedEffects:()=>[]});return e.clientID==null&&(e.clientID=t.length&&t[0].generatedID||""),e}}),x6=ch.define(),Q4=fi.define({create(t){return new b2(t.facet(_2).startVersion,[])},update(t,e){let n=e.annotation(x6);if(n)return n;let{sharedEffects:r,clientID:i}=e.startState.facet(_2),o=r(e);return o.length||!e.changes.empty?new b2(t.version,t.unconfirmed.concat(new YJ(e,e.changes,o,i))):t}});function k7e(t={}){return[Q4,_2.of(Object.assign({generatedID:Math.floor(Math.random()*1e9).toString(36)},t))]}function QX(t,e){let{version:n,unconfirmed:r}=t.field(Q4),{clientID:i}=t.facet(_2);n+=e.length;let o=0;for(;o<e.length&&e[o].clientID==i;)o++;if(o&&(r=r.slice(o),e=e.slice(o)),!e.length)return t.update({annotations:[x6.of(new b2(n,r))]});let s=e[0].changes,a=e[0].effects||[];for(let l=1;l<e.length;l++){let c=e[l];a=fn.mapEffects(a,c.changes),c.effects&&(a=a.concat(c.effects)),s=s.compose(c.changes)}return r.length&&(r=r.map(l=>{let c=l.changes.map(s);return s=s.map(l.changes,!0),new YJ(l.origin,c,fn.mapEffects(l.effects,s),i)}),a=fn.mapEffects(a,r.reduce((l,c)=>l.compose(c.changes),Ei.empty(r[0].changes.length)))),t.update({changes:s,effects:a,annotations:[Kr.addToHistory.of(!1),Kr.remote.of(!0),x6.of(new b2(n,r))],filter:!1})}function cg(t){return t.field(Q4).unconfirmed}function fT(t){return t.field(Q4).version}const T7e=require("minimatch"),P7e=()=>Kt(_7e,{speed:1,backgroundColor:"var(--d42-tree__skeleton--bg)",foregroundColor:"var(--d42-tree__skeleton--foregroundColor)",style:{width:"100%",height:"140px"},children:[ue("rect",{y:"0",rx:"16",ry:"16",width:"16",height:"16"}),ue("rect",{y:"0",x:"30",rx:"2",ry:"2",width:"100",height:"16"}),ue("rect",{y:"30",rx:"16",ry:"16",width:"16",height:"16"}),ue("rect",{y:"30",x:"30",rx:"2",ry:"2",width:"190",height:"16"}),ue("rect",{y:"60",rx:"16",ry:"16",width:"16",height:"16"}),ue("rect",{y:"60",x:"30",rx:"2",ry:"2",width:"80",height:"16"}),ue("rect",{y:"90",rx:"16",ry:"16",width:"16",height:"16"}),ue("rect",{y:"90",x:"30",rx:"2",ry:"2",width:"116",height:"16"}),ue("rect",{y:"116",rx:"16",ry:"16",width:"16",height:"16"}),ue("rect",{y:"116",x:"30",rx:"2",ry:"2",width:"100",height:"16"}),ue("rect",{y:"150",rx:"16",ry:"16",width:"16",height:"16"}),ue("rect",{y:"150",x:"30",rx:"2",ry:"2",width:"160",height:"16"})]}),Q7e=({onCustomSelect:t,treeItemHeight:e,hideFeature:n,hideEditFeature:r,lockFeature:i,lockEditFeature:o,unittestFeature:s,unittestEditFeature:a,disableFileAction:l={},fileRootActions:c=[]})=>{const{t:u}=ia(),f=_d().file.fileIntoView(),[h,d]=z.exports.useState(),{getOnlineAgentUsersByPath:p,agentUserOpenFile:b}=X9e(),y=ut().file.expandedFolders(),O=ut().file.loadingPath(),[m,v]=z.exports.useState(""),[$,S]=z.exports.useState(""),w=z.exports.useRef(null),{fileTreeIgnore:k,dockerId:I,fileRootPath:L,url:C}=ut().dao.playgroundInfo(),T=ut().file.fileTree(),E=ut().dao.playgroundMode(),N=ut().dao.channel(),G=ut().dao.channelAvailable(),[j,A]=z.exports.useState(""),W=z.exports.useRef(null),q=z.exports.useRef(null),[K,ie]=z.exports.useState("CREATE"),[V,ne]=z.exports.useState(!1),[Pe,Ee]=z.exports.useState({isDir:!1,path:""}),H=z.exports.useRef(null);let _e=null;const re=z.exports.useRef(null),[ae,ee]=z.exports.useState({}),Re=ut().file.treeData(),Be=Se.file.setTreeData,[ot,Ve]=z.exports.useState(!1),[dt,Dt]=z.exports.useState(""),Ze=(k==null?void 0:k.split(";"))||[],je=".",Ut=z.exports.useRef(null),Gt=z.exports.useRef(null),Nt=ut().file.tempFileOrFolder(),wn=z.exports.useRef(0),Tn=z.exports.useRef(!1),ln=ut().file.selectedFilePath(),at=Se.file.setSelectedFilePath,Me=ut().file.getOpenedPath();z.exports.useRef("");const Fe=ut().dao.isPlayBack(),xt=ut().file.fileTreeLoading()&&!Fe,[Qe,Le]=z.exports.useState(!1),Ue=z.exports.useRef(null),yt=ut().file.fileStyle(),{disableFileTreeAction:_t}=ut().dao.config(),Pt=z.exports.useRef(null),mt=z.exports.useRef(null),wt=z.exports.useRef(0),Jt=z.exports.useRef(!0);z.exports.useEffect(()=>{Se.file.hideFeature(n),Se.file.hideEditFeature(r)},[n,r]),z.exports.useEffect(()=>{var Oe;if(Me&&E===_u.edit&&((Oe=Re[Me])==null?void 0:Oe.type)==="FILE"){const Ie=e2(Me),Je=!!(Ie!=null&&Ie.lock)&&!o&&i==="on";Se.file.setDocEditable(!Je)}},[o,i,Me,E,Re]),z.exports.useEffect(()=>{I&&Le(wE(I))},[I]),z.exports.useEffect(()=>{const Oe=J.dao.channel().playbackIsRunning();!G||Fe&&Oe||ln&&(ln!==O&&ln!==Me||Fe)&&N.loadFile(ln)},[N,G,O,Fe,Me,ln]),z.exports.useEffect(()=>{if(f&&ln){const Oe=document.getElementById(ln);Oe==null||Oe.scrollIntoView({block:"center",inline:"start"}),Se.file.fileIntoView(!1)}},[f,ln]);const jn=Oe=>{const Ie=J.dao.currentAgentUser();return(Ie==null?void 0:Ie.agentUserId)===Oe||(Ie==null?void 0:Ie.followingAgentUserId)===Oe},Ht=(Oe=u("file_tree_num_of_files_cannot_exceed_500"))=>{J.dao.channel().transitionCustomError({name:"upload",error:Oe})},Cn=z.exports.useCallback((Oe,Ie)=>{const{data:{action:Je}}=Oe;return["REFRESH","EXPAND","COLLAPSE","FOCUS"].includes(Je)?(Bu(Oe,Ie==null?void 0:Ie.snapshot),Oe.snapshot=io((Ie==null?void 0:Ie.snapshot)||Oe.data.payload),Oe):(Oe.snapshot,Bu(Oe,io(Ie==null?void 0:Ie.snapshot)),Oe)},[]),Gn=z.exports.useCallback(Oe=>{var Zo,Li;if(!Oe)return;let{snapshot:Ie}=Oe;const{agentUserId:Je}=Oe,{action:xe,result:ke,message:et,destination:Zt,files:kt,failPath:tn=[],url:un}=Oe.data,Or=J.dao.isPlayBack(),Vn=J.dao.currentAgentUser();if(xe==="REFRESH"){!Ie&&Or&&(Oe=Cn(Oe,null),Ie=Oe.snapshot),Or&&un&&Se.dao.setPlaygroundUrl(un),Se.file.setFileTree(io(Ie)),Bu(Oe,io(Ie));return}else if(Or&&Ie&&!["EXPAND","COLLAPSE"].includes(xe)){Se.file.setFileTree(io(Ie));return}const pr=J.file.expandedFolders(),$i=((Zo=J.dao.currentAgentUser())==null?void 0:Zo.followingAgentUserId)===Je||J.dao.isPlayBack();for(const Sn of kt)switch(xe){case"MOVE":{if(ee({}),ke===!1){Ur.error(et),Zn(),m&&Zt&&Be(x=>(x[m].data=Sn.name,x)),v("");return}if(Bu(Oe,T),Zt&&Sn.name===ln&&Sn.type==="FILE")at(Zt);else if(Sn.type==="DIRECTORY"){const x=J.file.doc().openedPath.indexOf(Sn.name),R=J.file.expandedFolders().map(M=>M.startsWith(`${Sn.name}/`)||M===Sn.name?Zt+M.substring(Sn.name.length):M);if(Se.file.expandedFolders(R),x===0){const M=`${Zt}${J.file.doc().openedPath.substring(Sn.name.length)}`;at(M)}}Zn(),v("");break}case"CREATE":{if(ke===!1)Ur.error(et),Zn(),Be(x=>(delete x[Sn.name],delete x[m],x)),A("");else{Bu(Oe,T);const x=(Vn==null?void 0:Vn.agentUserId)===Je||(Vn==null?void 0:Vn.followingAgentUserId)===Je;Sn.type==="FILE"&&x&&Sn.name!==J.file.getOpenedPath()&&Se.file.setSelectedFilePath(Sn.name),d(Sn.name)}v(""),ee({});break}case"DELETE":{if(ke===!1)Ur.error(et);else{const x=J.file.doc().openedPath,R=x.indexOf(Sn.name),M=Sn.type==="FILE"?Sn.name===x:R===0&&x[Sn.name.length]==="/";(!x||M)&&Se.file.resetFile(),Bu(Oe,T),Se.file.deletedPath(Sn.name),DG(Sn.name,!0)}break}case"UPLOAD":{if(ke===!1&&tn.length>0){if(!Object.keys(Re).length)return;tn.forEach(M=>{var Q;delete Re[M],Re["."].children=(Q=Re["."].children)==null?void 0:Q.filter(D=>D!==M),Be(io(Re))}),Ht(et);return}const R=Sn.name.lastIndexOf("/")>-1?Sn.name.substring(0,Sn.name.lastIndexOf("/")):Sn.name;(ke||ke===void 0)&&Bu(Oe,T,Sn),ke&&((Li=Oe.data)==null?void 0:Li.uploadingCount)===0?(wn.current=0,ee({})):!ke&&Re[R]&&(Ur.error(et),delete Re[R],Be(io(Re)));break}case"FEATURE":{ke?Bu(Oe,T):Ur.error(et);break}case"EXPAND":{if($i){const x=[...new Set(pr.concat(Sn.name))];Se.file.expandedFolders(x)}break}case"COLLAPSE":{$i&&Se.file.expandedFolders(pr.filter(x=>x!==Sn.name));break}case"FOCUS":{b(Sn.name,Je),(jn(Je)||J.dao.isPlayBack())&&(Sn.type==="FILE"&&at(Sn.name),d(Sn.name));break}}},[b,T,m,ln,at,Re,Be]);z.exports.useEffect(()=>{J.dao.channel().subscribeForComponent(Ot.FileTree,{onStart:()=>{Se.file.expandedFolders([]),Be({}),Se.file.setFileTree(null)},onData:Gn,getPlaybackSnapshot:Cn})},[Gn]);const Rn=Oe=>{if(!J.dao.channelAvailable())return Qt.error("offline");if(Oe.length===1){if(ae[Oe[0]])return;if(Re[Oe[0]].type==="FILE"){if(Fe)J.dao.channel().playbackIsRunning()&&(J.dao.channel().pausePlayback(!0),Ur.warn(u("\u56DE\u653E\u5DF2\u6682\u505C")));else{const Ie=J.file.editorView(),Je=Ie&&cg(Ie.state).filter(xe=>!xe.changes.empty).length;if(Je){setTimeout(()=>{at(Oe[0])},400);const xe=["delayLoadFile",`\u7F16\u8F91\u5668\u8FD8\u6709${Je}\u6761\u5185\u5BB9\u6B63\u5728\u66F4\u65B0`];Qt.log(...xe),J.dao.channel().uploadLog(xe[0],xe[1]);return}}at(Oe[0])}}},Ln=Oe=>{J.dao.channel().operateFileTree({action:"EXPAND",files:[{type:"DIRECTORY",name:Oe}]}),Oe!==je&&d(Oe);const Ie=J.file.expandedFolders(),Je=Ie.includes(Oe)?"":Oe;Se.file.expandedFolders([...Ie,Je])},sr=Oe=>{J.dao.channel().operateFileTree({action:"COLLAPSE",files:[{type:"DIRECTORY",name:Oe}]});const Ie=J.file.expandedFolders();Se.file.expandedFolders(Ie.filter(Je=>Je!==Oe))},si=Oe=>{Be(Ie=>({...Ie,...Oe}))},Ki=async Oe=>{const Ie=new FileReader;return Ie.readAsArrayBuffer(Oe),new Promise(Je=>{Ie.onload=function(){Je(Ie.result)}})},Pr=async(Oe,Ie)=>{var et,Zt;if(Oe.length>500){Ht();return}const Je=J5(T),xe=Array.from(Oe).find(kt=>{const tn=`${Ie?`${Ie}/`:""}${kt.name}`;return Je[tn]});if(xe){Ve(!0),Dt(u("file_tree_x_existed",{x:xe.name}));return}const ke={action:"UPLOAD",destination:"",files:[]};for(const kt of Array.from(Oe)){const tn=`${Ie?`${Ie}/`:""}${kt.name}`;if(Ze.includes(kt.name))Qt.log(u("file_tree_x_filtered",{x:kt.name}));else{const un=io(Je),Or=Ie||je;un[Or]&&!((et=un[Or].children)!=null&&et.includes(tn))&&((Zt=un[Or].children)==null||Zt.push(tn)),un[tn]={data:kt.name,hasChildren:!1,index:tn,type:"FILE"},si(un),ee(pr=>({...pr,[tn]:!0}));const Vn=J.dao.openSocketBuffer()?await Ki(kt):kt;ke.files.push({type:"FILE",name:tn,content:Vn})}}ke.files.length&&J.dao.channel().operateFileTree(ke)},en=async Oe=>{const Ie=[];for(const Je of Array.from(Oe))Ze.includes(Je.name)?Qt.log(u("file_tree_x_upload_not_allowed",{x:Je.name})):Ie.push({path:Je.fullPath||Je.webkitRelativePath,file:Je});return Ie},hn=Oe=>Oe.indexOf("/")>-1?Oe.substring(0,Oe.indexOf("/")):Oe,An=(Oe,Ie)=>{const Je=io(Re),xe=[...new Set(Oe.map(et=>hn(et.path)))];Oe.filter(et=>{if(xe.length===0)return!1;const Zt=xe.findIndex(kt=>kt===hn(et.path));return Zt>-1?(xe.splice(Zt,1),Zt>-1):!1}).forEach(et=>{var Or;const Zt=et.path,kt=hn(et.path),tn=Ie?`${Ie}/${kt}`:kt;(Or=Je[Ie||je].children)==null||Or.push(tn),ee(Vn=>({...Vn,[tn]:!0}));const un=Zt.indexOf("/")>-1?"DIRECTORY":"FILE";Je[tn]={data:kt,hasChildren:un==="DIRECTORY",index:`${Ie?`${Ie}/`:""}${un==="DIRECTORY"?kt:Zt}`,type:un},si(Je)})},fr=async(Oe,Ie)=>{const Je=J5(T);if(!Object.keys(Je).length)return;const xe=await en(Oe);if(xe.length>500){Ht();return}if(xe.length>0){const ke=xe.find(Zt=>{const kt=Ie?`${Ie}/${Zt.path}`:Zt.path;return!!Je[m4e(kt)]});if(ke){Ve(!0);const Zt=Ie?`${Ie}/${ke.path}`:ke.path;Dt(u("file_tree_x_existed",{x:Zt}));return}wn.current=xe.length;const et={action:"UPLOAD",destination:"",files:[]};An(xe,Ie);for(let Zt=0;Zt<xe.length;Zt++){const kt=xe[Zt],tn=J.dao.openSocketBuffer()?await Ki(kt.file):kt.file;et.files.push({type:"FILE",name:`${Ie?`${Ie}/`:""}${kt.path}`,content:tn})}J.dao.channel().operateFileTree(et)}},Br=async(Oe,Ie)=>{Gr(""),ls(""),wt.current=0,Oe.preventDefault(),Oe.stopPropagation(),document.querySelector(".d42-tree-root").classList.remove("d42-drag-over-node");const xe=Array.from(Oe.dataTransfer.items)||[];if(xe.length===0)return;const ke=[];for(const tn of xe)ke.push(tn.webkitGetAsEntry());const et=ke.some(tn=>tn==null?void 0:tn.isDirectory),Zt=await KG(ke,[]);Vr(),!b4e(Zt)&&(et?fr(Zt,Ie):Pr(Zt,Ie))},ge=Oe=>{var Ie;((Ie=Oe.dataTransfer)==null?void 0:Ie.items.length)!==0&&(Oe.preventDefault(),Oe.stopPropagation())},Ge=Oe=>{if(Fe)return;la("."),Oe.preventDefault(),Oe.stopPropagation(),Vr();const Ie=document.querySelector(".d42-tree-root");Ie.classList.add("d42-drag-over-node"),mt.current=Ie,wt.current=wt.current+1},gt=Oe=>{wt.current=wt.current-1,Oe.dataTransfer.items.length!==0&&(Oe.preventDefault(),Oe.stopPropagation(),Oe.nativeEvent.stopImmediatePropagation(),wt.current===0&&(Vr(),cs()))},Lt=Oe=>(Re[Oe].hasChildren?Oe=Re[Oe].index:Oe[Oe.length-1]!=="/"&&(Oe=Oe.substring(0,Oe.lastIndexOf("/"))),Oe),bn=()=>{Zn(),Be(Oe=>(Object.entries(Oe).forEach(([Ie,Je])=>{Je.data||delete Oe[Ie]}),Oe))},Hn=(Oe=je)=>{var et;Jt.current=!0,bn(),Ln(Oe),ie("CREATE"),Oe=Lt(Oe);const Ie=io(Re),xe=`${Oe===je?"":`${Oe}/`}${b6().substring(0,6)}`;(et=Ie[Oe].children)==null||et.push(xe);const ke={root:Oe,path:xe,type:"FILE"};Se.file.tempFileOrFolder(ke),Ie[xe]={index:xe,hasChildren:!1,data:""},si(Ie),v(xe),S("")},Fn=(Oe=je)=>{var et;Jt.current=!0,bn(),Ln(Oe),ie("CREATE"),Oe=Lt(Oe);const Ie=io(Re),xe=`${Oe===je?"":`${Oe}/`}${b6().substring(0,6)}`;(et=Ie[Oe].children)==null||et.push(xe);const ke={root:Oe,path:xe,type:"DIRECTORY"};Se.file.tempFileOrFolder(ke),Ie[xe]={index:xe,hasChildren:!0,children:[],data:""},si(Ie),v(xe),S("")},Zn=()=>{const Oe={path:"",root:"",type:""};Se.file.tempFileOrFolder(Oe)},dr=(Oe,Ie="")=>{if(!J.dao.channelAvailable())return Qt.log("offline");const Je={action:"CREATE",files:[]},xe=go(m),ke=xe===je||!xe?"":`${xe}/`;if(!Oe||!$||Uk(`${ke}`+$))return;const et=Re[Nt.path].hasChildren;if(Re[`${ke}${$}`]){Qt.error(u("file_tree_renamed"));return}const Zt=Oe.index.split("/");Zt.length>0&&(Zt[Zt.length-1]=$),Zt.splice(-1,1,Ie);const kt=Zt.join("/");K==="CREATE"?(Je.action=K,et?Je.files=[{type:"DIRECTORY",name:kt}]:Je.files=[{type:"FILE",name:kt}]):(Je.action="MOVE",Je.destination=kt,Je.files=[{type:"FILE",name:Oe.index}],(Me.startsWith(`${Oe.index}/`)||Me===Oe.index)&&Se.file.setDocLoading(!0)),ee(tn=>({...tn,[kt]:!0})),Je.files[0].type=et?"DIRECTORY":"FILE",J.dao.channel().operateFileTree(Je),Zn()},In=Oe=>{ee(Ie=>({...Ie,[Oe]:!0})),J.dao.channel().operateFileTree({action:"DELETE",files:[{type:Pe.isDir?"DIRECTORY":"FILE",name:Oe}]})},Pn=z.exports.useCallback(()=>{var Zt,kt,tn,un,Or;const{root:Oe,path:Ie}=Nt,Je=io(Re),xe=Ie.lastIndexOf("/"),ke=Ie.substring(0,xe>-1?xe+1:xe),et=`${ke}${$}`;if(Re[et]||((Zt=Ue.current)==null?void 0:Zt.dataset.error)==="1"){Zn(),K==="MOVE"&&m!==et&&Be(Vn=>{if(Vn[m]){const pr=m.lastIndexOf("/"),$i=~pr?m.substring(pr+1):m;Vn[m].data=$i}return Vn}),K!=="MOVE"&&m!==$&&Be(Vn=>(delete Vn[m],Vn)),A(""),v(""),S("");return}if(!(!Ie||!Oe)){if(!$&&Ie||Re[`${ke}`+$]||Uk(`${ke}`+$)||((kt=Ue.current)==null?void 0:kt.dataset.error)==="1")Je[Oe].children=(un=(tn=Je[Oe])==null?void 0:tn.children)==null?void 0:un.filter(Vn=>Vn!==Ie),delete Je[Ie],Zn(),Be(Je);else if($){const Vn=(Or=Je[Ie])==null?void 0:Or.hasChildren,pr={action:K,files:[{type:Vn?"DIRECTORY":"FILE",name:K==="MOVE"?Ie:ke+$}]};K==="MOVE"&&(pr.destination=ke+$),J.dao.channel().operateFileTree(pr),S(""),A(""),Zn(),v("")}}},[K,$,m,Be,Nt,Re]),Mn=z.exports.useCallback(Oe=>{if(!Pt.current)return;const Ie=Pt.current;if(!$6(Ie,Oe.target)){const Je=Oe.target,xe=Je.querySelector(".d42-create-box"),ke=xe==null?void 0:xe.dataset.path;if(m===ke&&Je.dataset.path!==je)return;Pn()}},[Pn,m]);z.exports.useEffect(()=>(window.document.addEventListener("mousedown",Mn),()=>{window.document.removeEventListener("mousedown",Mn)}),[Mn]);const ar=(Oe,Ie)=>ue(mf,{popup:()=>ue("span",{children:Oe}),children:Ie}),ir=()=>{if(!J.dao.channelAvailable())return;Qe&&Me.startsWith(".")&&Se.file.resetFile();const Oe=window.localStorage.getItem("showHiddenFiles");let Ie=Oe?JSON.parse(Oe):{};Ie=ah(Ie)?Ie:{},Ie[I]=!Qe,window.localStorage.setItem("showHiddenFiles",JSON.stringify(Ie));const xe=Me.split("/").some(ke=>ke.startsWith("."));Qe&&xe&&Se.file.resetFile(),Le(!Qe)},di=()=>Kt("div",{className:"d42-operation-panel",children:[ue("div",{className:"d42-panel-item",onClick:()=>{var Oe,Ie;!J.dao.channelAvailable()||((Oe=H.current)==null||Oe.click(),(Ie=re.current)==null||Ie.close())},children:u("file_tree_upload_files")}),ue("div",{className:"d42-panel-item",onClick:()=>{var Oe;!J.dao.channelAvailable()||(_e==null||_e.click(),(Oe=re.current)==null||Oe.close())},children:u("file_tree_upload_folder")}),ue("div",{className:"d42-panel-item",onClick:ir,children:u(Qe?"do_no_show_hidden_files":"show_hidden_files")}),ue(tu,{children:c.map((Oe,Ie)=>ue("div",{className:"d42-panel-item",onClick:()=>{var Je;!J.dao.channelAvailable()||(Je=Oe.onClick)==null||Je.call(Oe)},children:Oe.label},Ie))})]}),zi=z.exports.useRef({}),lo=z.exports.useCallback((Oe,Ie,Je)=>{Jt.current=!1,Je=Je||"",Oe.stopPropagation(),ie("MOVE"),A(""),S(Je),v(Ie);const xe=io(Nt);xe.path=Ie;const ke=Ie.split("/");ke.length>1&&ke.pop(),xe.root=Ie.includes("/")?ke.join("/"):".",Se.file.tempFileOrFolder(xe)},[Nt]),os=(Oe,Ie,Je)=>{Oe.stopPropagation(),Ee({isDir:Ie,path:Je}),A(""),ne(!0)},Ls=(Oe,Ie)=>{Oe.stopPropagation(),A(""),Hn(Ie)},Fo=(Oe,Ie)=>{Oe.stopPropagation(),A(""),Fn(Ie)},Ui=Oe=>Oe.substring(Oe.lastIndexOf("/")+1),aa=(Oe,Ie)=>{Oe.stopPropagation(),A("");const Je=$E(C,L,Ie),xe=Ui(Ie);cSe(Je,xe)},ss=z.exports.useCallback((Oe,Ie,Je)=>{if(Boolean(Ie.hasChildren)&&Je)return!1;const{isRetainedFile:ke}=Ie,{filesPath:et=[],isDisable:Zt=!1}=l;return Zt&&(ke||et.includes(Oe))},[l]),as=(Oe,Ie,Je)=>{const{data:xe}=Je,ke=ss(Ie,Je,!1),et=ue("div",{className:"d42-panel-item",onClick:kt=>{!J.dao.channelAvailable()||(lo(kt,Ie,xe),zi.current[Ie].close())},children:u("file_tree_rename")}),Zt=ue("div",{className:"d42-panel-item delete",onClick:kt=>{!J.dao.channelAvailable()||(ie("DELETE"),os(kt,Oe,Ie),zi.current[Ie].close())},children:u("common_delete")});return Kt("div",{className:"d42-operation-panel",children:[Oe&&!Fe&&Kt(tu,{children:[ue("div",{className:"d42-panel-item",onClick:kt=>{!J.dao.channelAvailable()||(Ls(kt,Ie),zi.current[Ie].close())},children:u("file_tree_create_new_file")}),ue("div",{className:"d42-panel-item",onClick:kt=>{!J.dao.channelAvailable()||(Fo(kt,Ie),zi.current[Ie].close())},children:u("file_tree_create_new_folder")})]}),!Oe&&!Fe&&ue("div",{className:"d42-panel-item",onClick:kt=>{!J.dao.channelAvailable()||(aa(kt,Ie),zi.current[Ie].close())},children:u("file_tree_down_file")}),!ke&&et,!ke&&Zt]})},go=Oe=>Oe.substring(0,Oe.lastIndexOf("/"));z.exports.useEffect(()=>{if(m&&Ue.current){const Oe=Ue.current.value;if(!Oe)return;Oe.lastIndexOf(".")>-1?Ue.current.setSelectionRange(0,Oe.lastIndexOf(".")):Ue.current.setSelectionRange(0,Oe.length)}},[m]);const hr=(Oe,Ie)=>{var Je;switch(Oe.stopPropagation(),Oe.key){case"Enter":{if(Oe.currentTarget.dataset.error==="1")return;if(!Tn.current||Tn.current&&!$||vp(Ie)===$){Pn();return}Ie===Me&&Se.file.setDocLoading(!0),dr(Re[m],$),(Je=zi.current[Ie])==null||Je.close();break}}},Wn=Oe=>{Tn.current=!0;const Ie=Oe.target.value,Je=m.lastIndexOf("/"),xe=Je>-1?m.substring(Je+1):m,ke=Je>-1?m.substring(0,Je+1):"";S(Ie),Be(et=>(et[m]&&!Ze.includes(Ie)&&(et[m].data=et[ke+Ie]?xe:Ie),et))},br=Oe=>{Oe.stopPropagation(),W.current&&Hn()},_i=Oe=>{Oe.stopPropagation(),W.current&&Fn()};z.exports.useEffect(()=>{m||(Tn.current=!1)},[m]);const Vr=()=>{mt.current&&(mt.current.classList.remove("d42-drag-over-node"),mt.current=null)},[Ji,Gr]=z.exports.useState(""),[er,ls]=z.exports.useState(""),[Ms,la]=z.exports.useState(""),Yo=Oe=>{Oe.stopPropagation(),Oe.nativeEvent.stopImmediatePropagation(),Oe.dataTransfer.dropEffect="none",ls(Oe.currentTarget.dataset.path)},hl=Oe=>{if(Fe)return;Oe.stopPropagation(),Oe.nativeEvent.stopImmediatePropagation(),Oe.dataTransfer.items.length||(Oe.dataTransfer.dropEffect="none");const Ie=Oe.currentTarget.dataset,{path:Je,type:xe}=Ie,ke=Oe.currentTarget;let et=null;if(xe==="DIRECTORY")et=ke.firstElementChild,Gr(Je),J.file.expandedFolders().includes(Je)||Se.file.expandedFolders(J.file.expandedFolders().concat([Je]));else{et=ke.parentElement;do{if(!et)break;const kt=et.getAttribute("role");if(kt==="treeitem"||kt==="tree")break}while(et&&(et=et.parentElement));(!g4e(Je,er)||!er)&&Gr(Je.substring(0,Je.lastIndexOf("/")))}et&&et.classList.contains("d42-drag-over-node")||(mt.current&&mt.current.classList.remove("d42-drag-over-node"),et&&et.classList.add("d42-drag-over-node"),mt.current=et)},cs=()=>{Gr(""),ls(""),la("")},Ia=(Oe,Ie)=>{var Vn;Oe.stopPropagation(),Oe.nativeEvent.stopImmediatePropagation();const Je=Oe.currentTarget.dataset,{path:xe,type:ke}=Je,et=y4e(Ms),Zt=J.file.treeData(),kt=((Vn=Zt[Ms])==null?void 0:Vn.type)==="DIRECTORY",tn=et&&!kt?"":Ji;if(Vr(),!xe||!tn&&!et||tn===xe||!tn&&xe.indexOf("/")===-1){cs();return}const un=v4e(tn,vp(Ie));if(Zt[un]){Dt(u("file_tree_x_existed",{x:un})),Ve(!0),cs();return}ee({[un]:!0,[Ie]:!0});const Or={action:"MOVE",destination:un,files:[{type:ke,name:Ie}]};J.dao.channel().operateFileTree(Or),cs()},us=z.exports.useCallback((Oe,Ie)=>{if(!Object.keys(yt).length)return"";const{paths:Je,styles:xe}=yt;for(let ke=0;ke<Je.length;ke++)if(T7e(Oe,Je[ke]))return xe[Ie];return""},[yt]),Ns=z.exports.useMemo(()=>/\s/.test($),[$]),Ds=ut().dao.currentFocusComponent(),za=ut().file.openSearch(),vo=ut().file.editorView(),co=vo==null?void 0:vo.hasFocus;z.exports.useEffect(()=>{const Oe=Ie=>{let Je=Ie.target;const xe=["Tree","Editor","Browser","Console","Terminal"];let ke="";for(;Je&&!xe.includes(ke);)Je=(Je==null?void 0:Je.parentElement)||null,ke=(Je==null?void 0:Je.dataset.component)||"";Se.dao.currentFocusComponent(ke)};return window.addEventListener("click",Oe,!0),()=>{window.removeEventListener("click",Oe,!0)}},[]),z.exports.useEffect(()=>{d(Me)},[Me]),z.exports.useEffect(()=>{const Oe=Ie=>{var Je,xe;switch(Ie.key){case"Enter":{if(h&&!((Je=re.current)!=null&&Je.open)&&!((xe=zi.current[h])!=null&&xe.open)&&!Fe){const ke=Re[h];!ss(h,ke,!1)&&lo(Ie,h,vp(h))}break}}};return Ds==="Tree"&&h&&!za&&!co&&window.addEventListener("keydown",Oe,!1),(Ds!=="Tree"||co)&&window.removeEventListener("keydown",Oe),()=>{window.removeEventListener("keydown",Oe)}},[Ds,h,za,co,Fe,Re,ss,lo]);const jo=Oe=>{var ke;const Ie=new RegExp("(?<=background=)([^&]+)"),Je=Oe.color.slice(1),xe=(ke=Oe.userInfo.avatarUrl)!=null?ke:"";return xe&&xe.replace(Ie,`${Je}`)},uo="rct-tree-item-title-container",Xs="rct-tree-item-li",qi="rct-tree-item-button";return ue(PO,{name:"file",componentType:"Tree",children:Kt(W9e,{id:"d42-fileTree","data-testid":"file-title",ref:w,className:"d42-tree-root-container",treeItemHeight:e,onClick:()=>{J.dao.channel().followingFocusComponent("Tree")},children:[ue("input",{id:"manual-upload-file",ref:H,type:"file",multiple:!0,hidden:!0,onChange:Oe=>{Pr(Oe.target.files),Oe.target.value=""}}),ue("input",{id:"manual-upload-folder",type:"file",multiple:!0,hidden:!0,ref:Oe=>{Oe&&(_e=Oe,Oe.setAttribute("webkitdirectory","true"))},onChange:Oe=>{fr(Oe.target.files),Oe.target.value=""}}),xt?ue("div",{className:"d42-filetree-skeleton",children:ue(P7e,{})}):Kt(tu,{children:[Kt("div",{className:"d42-root-toolbar",children:[ue("strong",{children:"Files"}),Kt("div",{className:"d42-root-toolbar-btns",children:[!_t&&!Fe&&Kt(tu,{children:[ar(u("file_tree_create_new_file"),ue("button",{className:"d42-btn",onClick:br,children:ue("i",{className:"d42 dao42__icon--add-file"})})),ar(u("file_tree_create_new_folder"),ue("button",{className:"d42-btn d42-dir-btn",onClick:_i,children:ue("i",{className:"d42 dao42__icon--add-folder"})}))]}),!Fe&&ar(u("Collapse the file tree"),ue("button",{className:"d42-btn d42-dir-btn",onClick:()=>{Se.file.expandedFolders([])},children:ue("i",{className:"d42 dao42__icon--expand"})})),!_t&&!Fe&&ue(S6,{ref:re,container:w.current,meun:di(),popupAlign:{bottom:3,top:3},children:ue("button",{className:"d42-btn d42-more-btn",children:ue("i",{className:"d42 dao42__icon--more"})})})]})]}),ue("div",{ref:q,className:"file-tree-wrap",children:ue(GK,{canSearch:!1,ref:W,items:Re,onFocusItem:Oe=>{d(Oe.index)},onExpandItem:Oe=>{Ln(Oe.index)},onCollapseItem:Oe=>{sr(Oe.index)},getItemTitle:Oe=>Oe.data,viewState:{["tree-1"]:{focusedItem:h,expandedItems:y,selectedItems:[Me]}},renderItem:Oe=>{const{title:Ie,arrow:Je,depth:xe,children:ke}=Oe,et=Oe.item,Zt=et.canNotExpaned,kt=et.index;if(et.data.startsWith(".")&&!Qe&&m!==kt)return null;const tn=p(et.index),un=Oe.context,Or=xe>0?xe*16+8:8,Vn=sC(et.data),pr=et.hasChildren?ue("div",{...un.arrowProps,className:"d42-folder-wrapper",children:ue("div",{className:zn("d42-folder-icon",us(kt,"icon")),children:ue(o7e,{})})}):null,$i=!Vn&&!et.hasChildren&&!Zt?ue("div",{...un.arrowProps,className:zn("d42-file-icon default",us(kt,"icon")),children:ue(aC,{})}):null,Zo=go(kt),Li=`${Zo}${Zo?"/":""}${$}`,Sn=Uk(Li),x=!Jt.current&&!$,R=(Re[Li]||Sn)&&Tn.current&&vp(m)!==$||!Qe&&$.startsWith(".")||Ns||x,M=!((Re[Li]||Sn)&&Tn.current&&vp(m)!==$)&&!Qe&&$.startsWith("."),Q=et.hasChildren?hn(et.index):et.index;return et.hide&&n==="preview"&&!r?null:ue("div",{id:`${et.index}`,"data-drag":!Zt,onClick:D=>{D.stopPropagation(),D.nativeEvent.stopImmediatePropagation(),J.dao.channel().followingFocusComponent("Tree"),!Zt&&!ae[kt]&&m!==kt&&(A(""),Zn(),v(""),Rn([et.index]),t==null||t([et.index],et.type))},onContextMenu:D=>{var U;D.preventDefault(),D.stopPropagation(),Pn(),Fe||((U=zi.current[kt])==null||U.click(),A(et.index))},draggable:!(Fe||R||m),onDragStart:D=>{Fe||(Zt?(D.preventDefault(),D.stopPropagation(),D.nativeEvent.stopImmediatePropagation()):Yo(D))},onDragEnter:D=>{Fe||(D.stopPropagation(),D.nativeEvent.stopImmediatePropagation(),wt.current=wt.current+1,la(D.currentTarget.dataset.path))},onDragOver:hl,onDragEnd:D=>{Fe||Ia(D,kt)},"data-path":et.index,"data-type":et.hasChildren?"DIRECTORY":"FILE",className:zn("d42-file-tree-item",{"d42-open-feature":j===kt}),onDrop:D=>{_t||D.dataTransfer.items.length&&Br(D,Ji)},children:z.exports.createElement("li",{...un.itemContainerWithChildrenProps,...un.itemContainerWithoutChildrenProps,key:et.index,className:zn(Xs,{[`${Xs}-selected`]:un.isSelected,[`${Xs}-expanded`]:un.isExpanded,[`${Xs}-focused`]:un.isFocused,[`${Xs}-hasChildren`]:ke,"d42-light-selected":m===kt})},ue("div",{className:zn(uo,{[`${uo}-selected`]:un.isSelected,[`${uo}-expanded`]:un.isExpanded,[`${uo}-hasChildren`]:ke,show:un.isFocused||j===et.index}),style:{paddingLeft:Or},children:m===kt?Kt("div",{ref:Pt,className:"d42-create-box",onClick:D=>{D.stopPropagation(),D.preventDefault()},"data-path":kt,children:[ue("input",{"data-error":R&&!M?1:0,className:zn("d42-create-file-folder",{error:R,warn:M}),type:"text",autoFocus:!0,value:$,onClick:D=>D.stopPropagation(),ref:D=>{D==null||D.focus(),Ue.current=D},style:{marginLeft:et.hasChildren?8:0},onInput:Wn,onKeyDown:D=>{hr(D,kt)}}),R&&ue("div",{className:zn("d42-create-box-tip",{warn:M}),style:{marginLeft:et.hasChildren?8:0},children:Sn?u("Unable to create file or directory with system reserved name"):Ns?u("file_tree_space_char_exist_in_file_or_folder"):Re[Li]?u("The file or folder {{path}} already exists in this location, please choose another name",{path:$}):x?u("file_tree_rename_cannot_be_empty"):!Qe&&$.startsWith(".")?u("Create or rename to hidden files, will not be visible"):""})]}):ue(tu,{children:Kt("div",{...un.itemContainerWithoutChildrenProps,...un.interactiveElementProps,className:zn(qi,{[`${qi}-selected`]:un.isSelected,[`${qi}-expanded`]:un.isExpanded,[`${qi}-focused`]:un.isFocused,[`${qi}-hasChildren`]:et.hasChildren,"no-child":!et.hasChildren}),children:[Kt("div",{className:"d42-item-title-wrapper",children:[!et.hasChildren&&Vn&&!Zt&&ue("em",{className:zn("d42-file-icon",Vn||"not-cls",us(kt,"icon"))}),ue("div",{onClick:D=>{D.stopPropagation(),D.preventDefault()},className:zn(us(kt,"arrowIcon")),children:Je}),pr,$i,ue("span",{className:zn("d42-item-title",{"can-not-expanded":Zt},us(kt,"title")),title:et.data,children:Ie})]}),!_t&&!Zt&&Kt("div",{className:"d42-filetree-extra",children:[tn&&m!==kt&&ue("div",{className:"rct-tree-item-avatar-container",style:{marginRight:ae[kt]?10:0},children:tn.map((D,U)=>ue("div",{className:"rct-tree-item-avatar",style:{border:`1px solid ${D.color}`,marginLeft:`-${U*4}px`},children:ue("img",{className:"rct-tree-item-avatar-img",src:jo(D),alt:""})},U))}),!ae[kt]&&ue("div",{className:"d42-actions-container",children:ue(g7e,{treeNode:et,hideFeature:n,hideEditFeature:r,lockFeature:i,lockEditFeature:o,unittestFeature:s,unittestEditFeature:a})}),!ss(kt,et,!0)&&ue(S6,{ref:D=>{D&&(zi.current={...zi.current,[kt]:D})},onClose:()=>A(""),isMask:!1,container:Gt.current||document.body,popupAlign:{bottom:5,top:5},meun:!ae[kt]&&m!==kt&&wn.current===0&&j===et.index&&as(Boolean(et.hasChildren),kt,et),children:!ae[kt]&&!Fe&&ue("button",{className:"d42-expand-panel",onClick:()=>{A(j===et.index?"":et.index)},children:ue("i",{className:"d42 dao42__icon--more"})})})]}),ae[Q]||ae[kt]?ue("div",{className:"d42-upload-loading",children:ue(H3e,{spin:!0})}):null]})})}),Je?y.includes(et.index)&&ke:ke,ae[Q]&&ue("div",{className:"d42-filetree-item-loading"}))},et.index)},children:ue("div",{className:"d42-tree-root",ref:Gt,onDrop:Br,onDragEnter:Ge,onDragOver:ge,onDragEnd:()=>Gr(""),onDragLeaveCapture:gt,"data-path":".",children:ue(nJ,{treeId:"tree-1",ref:Ut,rootItem:je,treeLabel:"File Tree"})})})})]}),ue(PX,{title:Kt("div",{className:"d42-modal-title-content",children:[u("common_delete"),"\xA0",Pe.path.substring(Pe.path.lastIndexOf("/")+1),"\uFF1F"]}),visible:V,onCancel:()=>ne(!1),onOk:()=>{In(Pe.path),ne(!1)},children:ue("div",{children:u("file_tree_make_sure_delete_x_unrecoverable",{x:Pe.isDir?u("common_directory"):u("common_file")})})}),ue(PX,{visible:ot,title:u("file_tree_kind_tips"),showCancelBtn:!1,okText:u("file_tree_understood"),onOk:()=>Ve(!1),children:ue("div",{children:dt})})]})})};var E7e=Object.freeze(Object.defineProperty({__proto__:null,FileTree:Q7e},Symbol.toStringTag,{value:"Module"}));const jJ=1024;let C7e=0;class Dl{constructor(e,n){this.from=e,this.to=n}}class Xn{constructor(e={}){this.id=C7e++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Eo.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}Xn.closedBy=new Xn({deserialize:t=>t.split(" ")});Xn.openedBy=new Xn({deserialize:t=>t.split(" ")});Xn.group=new Xn({deserialize:t=>t.split(" ")});Xn.contextHash=new Xn({perNode:!0});Xn.lookAhead=new Xn({perNode:!0});Xn.mounted=new Xn({perNode:!0});class R7e{constructor(e,n,r){this.tree=e,this.overlay=n,this.parser=r}}const A7e=Object.create(null);class Eo{constructor(e,n,r,i=0){this.name=e,this.props=n,this.id=r,this.flags=i}static define(e){let n=e.props&&e.props.length?Object.create(null):A7e,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new Eo(e.name||"",n,e.id,r);if(e.props){for(let o of e.props)if(Array.isArray(o)||(o=o(i)),o){if(o[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[o[0].id]=o[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(Xn.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let r in e)for(let i of r.split(" "))n[i]=e[r];return r=>{for(let i=r.prop(Xn.group),o=-1;o<(i?i.length:0);o++){let s=n[o<0?r.name:i[o]];if(s)return s}}}}Eo.none=new Eo("",Object.create(null),0,8);class d0{constructor(e){this.types=e;for(let n=0;n<e.length;n++)if(e[n].id!=n)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let n=[];for(let r of this.types){let i=null;for(let o of e){let s=o(r);s&&(i||(i=Object.assign({},r.props)),i[s[0].id]=s[1])}n.push(i?new Eo(r.name,i,r.id,r.flags):r)}return new d0(n)}}const l_=new WeakMap,EX=new WeakMap;var Xi;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays"})(Xi||(Xi={}));class vr{constructor(e,n,r,i,o){if(this.type=e,this.children=n,this.positions=r,this.length=i,this.props=null,o&&o.length){this.props=Object.create(null);for(let[s,a]of o)this.props[typeof s=="number"?s:s.id]=a}}toString(){let e=this.prop(Xn.mounted);if(e&&!e.overlay)return e.tree.toString();let n="";for(let r of this.children){let i=r.toString();i&&(n&&(n+=","),n+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}cursor(e=0){return new fv(this.topNode,e)}cursorAt(e,n=0,r=0){let i=l_.get(this)||this.topNode,o=new fv(i);return o.moveTo(e,n),l_.set(this,o._tree),o}get topNode(){return new Fl(this,0,0,null)}resolve(e,n=0){let r=R1(l_.get(this)||this.topNode,e,n,!1);return l_.set(this,r),r}resolveInner(e,n=0){let r=R1(EX.get(this)||this.topNode,e,n,!0);return EX.set(this,r),r}iterate(e){let{enter:n,leave:r,from:i=0,to:o=this.length}=e;for(let s=this.cursor((e.mode||0)|Xi.IncludeAnonymous);;){let a=!1;if(s.from<=o&&s.to>=i&&(s.type.isAnonymous||n(s)!==!1)){if(s.firstChild())continue;a=!0}for(;a&&r&&!s.type.isAnonymous&&r(s),!s.nextSibling();){if(!s.parent())return;a=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:fC(Eo.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new vr(this.type,n,r,i,this.propValues),e.makeTree||((n,r,i)=>new vr(Eo.none,n,r,i)))}static build(e){return z7e(e)}}vr.empty=new vr(Eo.none,[],[],0);class cC{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new cC(this.buffer,this.index)}}class CO{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return Eo.none}toString(){let e=[];for(let n=0;n<this.buffer.length;)e.push(this.childString(n)),n=this.buffer[n+3];return e.join(",")}childString(e){let n=this.buffer[e],r=this.buffer[e+3],i=this.set.types[n],o=i.name;if(/\W/.test(o)&&!i.isError&&(o=JSON.stringify(o)),e+=4,r==e)return o;let s=[];for(;e<r;)s.push(this.childString(e)),e=this.buffer[e+3];return o+"("+s.join(",")+")"}findChild(e,n,r,i,o){let{buffer:s}=this,a=-1;for(let l=e;l!=n&&!(ZJ(o,i,s[l+1],s[l+2])&&(a=l,r>0));l=s[l+3]);return a}slice(e,n,r,i){let o=this.buffer,s=new Uint16Array(n-e);for(let a=e,l=0;a<n;)s[l++]=o[a++],s[l++]=o[a++]-r,s[l++]=o[a++]-r,s[l++]=o[a++]-e;return new CO(s,i-r,this.set)}}function ZJ(t,e,n,r){switch(t){case-2:return n<e;case-1:return r>=e&&n<e;case 0:return n<e&&r>e;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}function VJ(t,e){let n=t.childBefore(e);for(;n;){let r=n.lastChild;if(!r||r.to!=n.to)break;r.type.isError&&r.from==r.to?(t=n,n=r.prevSibling):n=r}return t}function R1(t,e,n,r){for(var i;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to<e);){let s=!r&&t instanceof Fl&&t.index<0?null:t.parent;if(!s)return t;t=s}let o=r?0:Xi.IgnoreOverlays;if(r)for(let s=t,a=s.parent;a;s=a,a=s.parent)s instanceof Fl&&s.index<0&&((i=a.enter(e,n,o))===null||i===void 0?void 0:i.from)!=s.from&&(t=a);for(;;){let s=t.enter(e,n,o);if(!s)return t;t=s}}class Fl{constructor(e,n,r,i){this._tree=e,this.from=n,this.index=r,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,n,r,i,o=0){for(let s=this;;){for(let{children:a,positions:l}=s._tree,c=n>0?a.length:-1;e!=c;e+=n){let u=a[e],f=l[e]+s.from;if(!!ZJ(i,r,f,f+u.length)){if(u instanceof CO){if(o&Xi.ExcludeBuffers)continue;let h=u.findChild(0,u.buffer.length,n,r-f,i);if(h>-1)return new su(new I7e(s,u,e,f),null,h)}else if(o&Xi.IncludeAnonymous||!u.type.isAnonymous||uC(u)){let h;if(!(o&Xi.IgnoreMounts)&&u.props&&(h=u.prop(Xn.mounted))&&!h.overlay)return new Fl(h.tree,f,e,s);let d=new Fl(u,f,e,s);return o&Xi.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(n<0?u.children.length-1:0,n,r,i)}}}if(o&Xi.IncludeAnonymous||!s.type.isAnonymous||(s.index>=0?e=s.index+n:e=n<0?-1:s._parent._tree.children.length,s=s._parent,!s))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,n,r=0){let i;if(!(r&Xi.IgnoreOverlays)&&(i=this._tree.prop(Xn.mounted))&&i.overlay){let o=e-this.from;for(let{from:s,to:a}of i.overlay)if((n>0?s<=o:s<o)&&(n<0?a>=o:a>o))return new Fl(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}cursor(e=0){return new fv(this,e)}get tree(){return this._tree}toTree(){return this._tree}resolve(e,n=0){return R1(this,e,n,!1)}resolveInner(e,n=0){return R1(this,e,n,!0)}enterUnfinishedNodesBefore(e){return VJ(this,e)}getChild(e,n=null,r=null){let i=$2(this,e,n,r);return i.length?i[0]:null}getChildren(e,n=null,r=null){return $2(this,e,n,r)}toString(){return this._tree.toString()}get node(){return this}matchContext(e){return S2(this,e)}}function $2(t,e,n,r){let i=t.cursor(),o=[];if(!i.firstChild())return o;if(n!=null){for(;!i.type.is(n);)if(!i.nextSibling())return o}for(;;){if(r!=null&&i.type.is(r))return o;if(i.type.is(e)&&o.push(i.node),!i.nextSibling())return r==null?o:[]}}function S2(t,e,n=e.length-1){for(let r=t.parent;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[n]&&e[n]!=r.name)return!1;n--}}return!0}class I7e{constructor(e,n,r,i){this.parent=e,this.buffer=n,this.index=r,this.start=i}}class su{constructor(e,n,r){this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}child(e,n,r){let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.context.start,r);return o<0?null:new su(this.context,this,o)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,n,r=0){if(r&Xi.ExcludeBuffers)return null;let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return o<0?null:new su(this.context,this,o)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new su(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new su(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}cursor(e=0){return new fv(this,e)}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,i=this.index+4,o=r.buffer[this.index+3];if(o>i){let s=r.buffer[this.index+1],a=r.buffer[this.index+2];e.push(r.slice(i,o,s,a)),n.push(0)}return new vr(this.type,e,n,this.to-this.from)}resolve(e,n=0){return R1(this,e,n,!1)}resolveInner(e,n=0){return R1(this,e,n,!0)}enterUnfinishedNodesBefore(e){return VJ(this,e)}toString(){return this.context.buffer.childString(this.index)}getChild(e,n=null,r=null){let i=$2(this,e,n,r);return i.length?i[0]:null}getChildren(e,n=null,r=null){return $2(this,e,n,r)}get node(){return this}matchContext(e){return S2(this,e)}}class fv{constructor(e,n=0){if(this.mode=n,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof Fl)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}get name(){return this.type.name}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:r,buffer:i}=this.buffer;return this.type=n||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof Fl?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,r,this.mode));let{buffer:i}=this.buffer,o=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.buffer.start,r);return o<0?!1:(this.stack.push(this.index),this.yieldBuf(o))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,r=this.mode){return this.buffer?r&Xi.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Xi.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Xi.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(n.findChild(i,this.index,-1,0,4))}else{let i=n.buffer[this.index+3];if(i<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,r,{buffer:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let o=0;o<this.index;o++)if(i.buffer.buffer[o+3]<this.index)return!1;({index:n,parent:r}=i)}else({index:n,_parent:r}=this._tree);for(;r;{index:n,_parent:r}=r)if(n>-1)for(let o=n+e,s=e<0?-1:r._tree.children.length;o!=s;o+=e){let a=r._tree.children[o];if(this.mode&Xi.IncludeAnonymous||a instanceof CO||!a.type.isAnonymous||uC(a))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,n););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,n=null,r=0;if(e&&e.context==this.buffer){e:for(let i=this.index,o=this.stack.length;o>=0;){for(let s=e;s;s=s._parent)if(s.index==i){if(i==this.index)return s;n=s,r=o+1;break e}i=this.stack[--o]}}for(let i=r;i<this.stack.length;i++)n=new su(this.buffer,n,this.stack[i]);return this.bufferNode=new su(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,n){for(let r=0;;){let i=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(i=!0)}for(;i&&n&&n(this),i=this.type.isAnonymous,!this.nextSibling();){if(!r)return;this.parent(),r--,i=!0}}}matchContext(e){if(!this.buffer)return S2(this.node,e);let{buffer:n}=this.buffer,{types:r}=n.set;for(let i=e.length-1,o=this.stack.length-1;i>=0;o--){if(o<0)return S2(this.node,e,i);let s=r[n.buffer[this.stack[o]]];if(!s.isAnonymous){if(e[i]&&e[i]!=s.name)return!1;i--}}return!0}}function uC(t){return t.children.some(e=>e instanceof CO||!e.type.isAnonymous||uC(e))}function z7e(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:i=jJ,reused:o=[],minRepeatType:s=r.types.length}=t,a=Array.isArray(n)?new cC(n,n.length):n,l=r.types,c=0,u=0;function f($,S,w,k,I){let{id:L,start:C,end:T,size:E}=a,N=u;for(;E<0;)if(a.next(),E==-1){let q=o[L];w.push(q),k.push(C-$);return}else if(E==-3){c=L;return}else if(E==-4){u=L;return}else throw new RangeError(`Unrecognized record size: ${E}`);let G=l[L],j,A,W=C-$;if(T-C<=i&&(A=b(a.pos-S,I))){let q=new Uint16Array(A.size-A.skip),K=a.pos-A.size,ie=q.length;for(;a.pos>K;)ie=y(A.start,q,ie);j=new CO(q,T-A.start,r),W=A.start-$}else{let q=a.pos-E;a.next();let K=[],ie=[],V=L>=s?L:-1,ne=0,Pe=T;for(;a.pos>q;)V>=0&&a.id==V&&a.size>=0?(a.end<=Pe-i&&(d(K,ie,C,ne,a.end,Pe,V,N),ne=K.length,Pe=a.end),a.next()):f(C,q,K,ie,V);if(V>=0&&ne>0&&ne<K.length&&d(K,ie,C,ne,C,Pe,V,N),K.reverse(),ie.reverse(),V>-1&&ne>0){let Ee=h(G);j=fC(G,K,ie,0,K.length,0,T-C,Ee,Ee)}else j=p(G,K,ie,T-C,N-T)}w.push(j),k.push(W)}function h($){return(S,w,k)=>{let I=0,L=S.length-1,C,T;if(L>=0&&(C=S[L])instanceof vr){if(!L&&C.type==$&&C.length==k)return C;(T=C.prop(Xn.lookAhead))&&(I=w[L]+C.length+T)}return p($,S,w,k,I)}}function d($,S,w,k,I,L,C,T){let E=[],N=[];for(;$.length>k;)E.push($.pop()),N.push(S.pop()+w-I);$.push(p(r.types[C],E,N,L-I,T-L)),S.push(I-w)}function p($,S,w,k,I=0,L){if(c){let C=[Xn.contextHash,c];L=L?[C].concat(L):[C]}if(I>25){let C=[Xn.lookAhead,I];L=L?[C].concat(L):[C]}return new vr($,S,w,k,L)}function b($,S){let w=a.fork(),k=0,I=0,L=0,C=w.end-i,T={size:0,start:0,skip:0};e:for(let E=w.pos-$;w.pos>E;){let N=w.size;if(w.id==S&&N>=0){T.size=k,T.start=I,T.skip=L,L+=4,k+=4,w.next();continue}let G=w.pos-N;if(N<0||G<E||w.start<C)break;let j=w.id>=s?4:0,A=w.start;for(w.next();w.pos>G;){if(w.size<0)if(w.size==-3)j+=4;else break e;else w.id>=s&&(j+=4);w.next()}I=A,k+=N,L+=j}return(S<0||k==$)&&(T.size=k,T.start=I,T.skip=L),T.size>4?T:void 0}function y($,S,w){let{id:k,start:I,end:L,size:C}=a;if(a.next(),C>=0&&k<s){let T=w;if(C>4){let E=a.pos-(C-4);for(;a.pos>E;)w=y($,S,w)}S[--w]=T,S[--w]=L-$,S[--w]=I-$,S[--w]=k}else C==-3?c=k:C==-4&&(u=k);return w}let O=[],m=[];for(;a.pos>0;)f(t.start||0,t.bufferStart||0,O,m,-1);let v=(e=t.length)!==null&&e!==void 0?e:O.length?m[0]+O[0].length:0;return new vr(l[t.topID],O.reverse(),m.reverse(),v)}const CX=new WeakMap;function B$(t,e){if(!t.isAnonymous||e instanceof CO||e.type!=t)return 1;let n=CX.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof vr)){n=1;break}n+=B$(t,r)}CX.set(e,n)}return n}function fC(t,e,n,r,i,o,s,a,l){let c=0;for(let p=r;p<i;p++)c+=B$(t,e[p]);let u=Math.ceil(c*1.5/8),f=[],h=[];function d(p,b,y,O,m){for(let v=y;v<O;){let $=v,S=b[v],w=B$(t,p[v]);for(v++;v<O;v++){let k=B$(t,p[v]);if(w+k>=u)break;w+=k}if(v==$+1){if(w>u){let k=p[$];d(k.children,k.positions,0,k.children.length,b[$]+m);continue}f.push(p[$])}else{let k=b[v-1]+p[v-1].length-S;f.push(fC(t,p,b,$,v,S,k,null,l))}h.push(S+m-o)}}return d(e,n,r,i,0),(a||l)(f,h,s)}class L7e{constructor(){this.map=new WeakMap}setBuffer(e,n,r){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(n,r)}getBuffer(e,n){let r=this.map.get(e);return r&&r.get(n)}set(e,n){e instanceof su?this.setBuffer(e.context.buffer,e.index,n):e instanceof Fl&&this.map.set(e.tree,n)}get(e){return e instanceof su?this.getBuffer(e.context.buffer,e.index):e instanceof Fl?this.map.get(e.tree):void 0}cursorSet(e,n){e.buffer?this.setBuffer(e.buffer.buffer,e.index,n):this.map.set(e.tree,n)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class vf{constructor(e,n,r,i,o=!1,s=!1){this.from=e,this.to=n,this.tree=r,this.offset=i,this.open=(o?1:0)|(s?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],r=!1){let i=[new vf(0,e.length,e,0,!1,r)];for(let o of n)o.to>e.length&&i.push(o);return i}static applyChanges(e,n,r=128){if(!n.length)return e;let i=[],o=1,s=e.length?e[0]:null;for(let a=0,l=0,c=0;;a++){let u=a<n.length?n[a]:null,f=u?u.fromA:1e9;if(f-l>=r)for(;s&&s.from<f;){let h=s;if(l>=h.from||f<=h.to||c){let d=Math.max(h.from,l)-c,p=Math.min(h.to,f)-c;h=d>=p?null:new vf(d,p,h.tree,h.offset+c,a>0,!!u)}if(h&&i.push(h),s.to>f)break;s=o<e.length?e[o++]:null}if(!u)break;l=u.toA,c=u.toA-u.toB}return i}}class E4{startParse(e,n,r){return typeof e=="string"&&(e=new M7e(e)),r=r?r.length?r.map(i=>new Dl(i.from,i.to)):[new Dl(0,0)]:[new Dl(0,e.length)],this.createParse(e,n||[],r)}parse(e,n,r){let i=this.startParse(e,n,r);for(;;){let o=i.advance();if(o)return o}}}class M7e{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}function dC(t){return(e,n,r,i)=>new D7e(e,t,n,r,i)}class RX{constructor(e,n,r,i,o){this.parser=e,this.parse=n,this.overlay=r,this.target=i,this.ranges=o}}class N7e{constructor(e,n,r,i,o,s,a){this.parser=e,this.predicate=n,this.mounts=r,this.index=i,this.start=o,this.target=s,this.prev=a,this.depth=0,this.ranges=[]}}const w6=new Xn({perNode:!0});class D7e{constructor(e,n,r,i,o){this.nest=n,this.input=r,this.fragments=i,this.ranges=o,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let r=this.baseParse.advance();if(!r)return null;if(this.baseParse=null,this.baseTree=r,this.startInner(),this.stoppedAt!=null)for(let i of this.inner)i.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let r=this.baseTree;return this.stoppedAt!=null&&(r=new vr(r.type,r.children,r.positions,r.length,r.propValues.concat([[w6,this.stoppedAt]]))),r}let e=this.inner[this.innerDone],n=e.parse.advance();if(n){this.innerDone++;let r=Object.assign(Object.create(null),e.target.props);r[Xn.mounted.id]=new R7e(n,e.overlay,e.parser),e.target.props=r}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let n=this.innerDone;n<this.inner.length;n++)this.inner[n].ranges[0].from<e&&(e=Math.min(e,this.inner[n].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let n=this.innerDone;n<this.inner.length;n++)this.inner[n].parse.stopAt(e)}startInner(){let e=new U7e(this.fragments),n=null,r=null,i=new fv(new Fl(this.baseTree,this.ranges[0].from,0,null),Xi.IncludeAnonymous|Xi.IgnoreMounts);e:for(let o,s;this.stoppedAt==null||i.from<this.stoppedAt;){let a=!0,l;if(e.hasNode(i)){if(n){let c=n.mounts.find(u=>u.frag.from<=i.from&&u.frag.to>=i.to&&u.mount.overlay);if(c)for(let u of c.mount.overlay){let f=u.from+c.pos,h=u.to+c.pos;f>=i.from&&h<=i.to&&!n.ranges.some(d=>d.from<h&&d.to>f)&&n.ranges.push({from:f,to:h})}}a=!1}else if(r&&(s=X7e(r.ranges,i.from,i.to)))a=s!=2;else if(!i.type.isAnonymous&&i.from<i.to&&(o=this.nest(i,this.input))){i.tree||W7e(i);let c=e.findMounts(i.from,o.parser);if(typeof o.overlay=="function")n=new N7e(o.parser,o.overlay,c,this.inner.length,i.from,i.tree,n);else{let u=zX(this.ranges,o.overlay||[new Dl(i.from,i.to)]);u.length&&this.inner.push(new RX(o.parser,o.parser.startParse(this.input,LX(c,u),u),o.overlay?o.overlay.map(f=>new Dl(f.from-i.from,f.to-i.from)):null,i.tree,u)),o.overlay?u.length&&(r={ranges:u,depth:0,prev:r}):a=!1}}else n&&(l=n.predicate(i))&&(l===!0&&(l=new Dl(i.from,i.to)),l.from<l.to&&n.ranges.push(l));if(a&&i.firstChild())n&&n.depth++,r&&r.depth++;else for(;!i.nextSibling();){if(!i.parent())break e;if(n&&!--n.depth){let c=zX(this.ranges,n.ranges);c.length&&this.inner.splice(n.index,0,new RX(n.parser,n.parser.startParse(this.input,LX(n.mounts,c),c),n.ranges.map(u=>new Dl(u.from-n.start,u.to-n.start)),n.target,c)),n=n.prev}r&&!--r.depth&&(r=r.prev)}}}}function X7e(t,e,n){for(let r of t){if(r.from>=n)break;if(r.to>e)return r.from<=e&&r.to>=n?2:1}return 0}function AX(t,e,n,r,i,o){if(e<n){let s=t.buffer[e+1],a=t.buffer[n-2];r.push(t.slice(e,n,s,a)),i.push(s-o)}}function W7e(t){let{node:e}=t,n=0;do t.parent(),n++;while(!t.tree);let r=0,i=t.tree,o=0;for(;o=i.positions[r]+t.from,!(o<=e.from&&o+i.children[r].length>=e.to);r++);let s=i.children[r],a=s.buffer;function l(c,u,f,h,d){let p=c;for(;a[p+2]+o<=e.from;)p=a[p+3];let b=[],y=[];AX(s,c,p,b,y,h);let O=a[p+1],m=a[p+2],v=O+o==e.from&&m+o==e.to&&a[p]==e.type.id;return b.push(v?e.toTree():l(p+4,a[p+3],s.set.types[a[p]],O,m-O)),y.push(O-h),AX(s,a[p+3],u,b,y,h),new vr(f,b,y,d)}i.children[r]=l(0,a.length,Eo.none,0,s.length);for(let c=0;c<=n;c++)t.childAfter(e.from)}class IX{constructor(e,n){this.offset=n,this.done=!1,this.cursor=e.cursor(Xi.IncludeAnonymous|Xi.IgnoreMounts)}moveTo(e){let{cursor:n}=this,r=e-this.offset;for(;!this.done&&n.from<r;)n.to>=e&&n.enter(r,1,Xi.IgnoreOverlays|Xi.ExcludeBuffers)||n.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let n=this.cursor.tree;;){if(n==e.tree)return!0;if(n.children.length&&n.positions[0]==0&&n.children[0]instanceof vr)n=n.children[0];else break}return!1}}class U7e{constructor(e){var n;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let r=this.curFrag=e[0];this.curTo=(n=r.tree.prop(w6))!==null&&n!==void 0?n:r.to,this.inner=new IX(r.tree,-r.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let n=this.curFrag=this.fragments[this.fragI];this.curTo=(e=n.tree.prop(w6))!==null&&e!==void 0?e:n.to,this.inner=new IX(n.tree,-n.offset)}}findMounts(e,n){var r;let i=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let o=this.inner.cursor.node;o;o=o.parent){let s=(r=o.tree)===null||r===void 0?void 0:r.prop(Xn.mounted);if(s&&s.parser==n)for(let a=this.fragI;a<this.fragments.length;a++){let l=this.fragments[a];if(l.from>=o.to)break;l.tree==this.curFrag.tree&&i.push({frag:l,pos:o.from-l.offset,mount:s})}}}return i}}function zX(t,e){let n=null,r=e;for(let i=1,o=0;i<t.length;i++){let s=t[i-1].to,a=t[i].from;for(;o<r.length;o++){let l=r[o];if(l.from>=a)break;l.to<=s||(n||(r=n=e.slice()),l.from<s?(n[o]=new Dl(l.from,s),l.to>a&&n.splice(o+1,0,new Dl(a,l.to))):l.to>a?n[o--]=new Dl(a,l.to):n.splice(o--,1))}}return r}function q7e(t,e,n,r){let i=0,o=0,s=!1,a=!1,l=-1e9,c=[];for(;;){let u=i==t.length?1e9:s?t[i].to:t[i].from,f=o==e.length?1e9:a?e[o].to:e[o].from;if(s!=a){let h=Math.max(l,n),d=Math.min(u,f,r);h<d&&c.push(new Dl(h,d))}if(l=Math.min(u,f),l==1e9)break;u==l&&(s?(s=!1,i++):s=!0),f==l&&(a?(a=!1,o++):a=!0)}return c}function LX(t,e){let n=[];for(let{pos:r,mount:i,frag:o}of t){let s=r+(i.overlay?i.overlay[0].from:0),a=s+i.tree.length,l=Math.max(o.from,s),c=Math.min(o.to,a);if(i.overlay){let u=i.overlay.map(h=>new Dl(h.from+r,h.to+r)),f=q7e(e,u,l,c);for(let h=0,d=l;;h++){let p=h==f.length,b=p?c:f[h].from;if(b>d&&n.push(new vf(d,b,i.tree,-s,o.from>=d,o.to<=b)),p)break;d=f[h].to}}else n.push(new vf(l,c,i.tree,-s,o.from>=s,o.to<=a))}return n}let B7e=0;class xc{constructor(e,n,r){this.set=e,this.base=n,this.modified=r,this.id=B7e++}static define(e){if(e!=null&&e.base)throw new Error("Can not derive from a modified tag");let n=new xc([],null,[]);if(n.set.push(n),e)for(let r of e.set)n.set.push(r);return n}static defineModifier(){let e=new x2;return n=>n.modified.indexOf(e)>-1?n:x2.get(n.base||n,n.modified.concat(e).sort((r,i)=>r.id-i.id))}}let F7e=0;class x2{constructor(){this.instances=[],this.id=F7e++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(a=>a.base==e&&Y7e(n,a.modified));if(r)return r;let i=[],o=new xc(i,e,n);for(let a of n)a.instances.push(o);let s=GJ(n);for(let a of e.set)for(let l of s)i.push(x2.get(a,l));return o}}function Y7e(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function GJ(t){let e=[t];for(let n=0;n<t.length;n++)for(let r of GJ(t.slice(0,n).concat(t.slice(n+1))))e.push(r);return e}function Ra(t){let e=Object.create(null);for(let n in t){let r=t[n];Array.isArray(r)||(r=[r]);for(let i of n.split(" "))if(i){let o=[],s=2,a=i;for(let f=0;;){if(a=="..."&&f>0&&f+3==i.length){s=1;break}let h=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!h)throw new RangeError("Invalid path: "+i);if(o.push(h[0]=="*"?"":h[0][0]=='"'?JSON.parse(h[0]):h[0]),f+=h[0].length,f==i.length)break;let d=i[f++];if(f==i.length&&d=="!"){s=0;break}if(d!="/")throw new RangeError("Invalid path: "+i);a=i.slice(f)}let l=o.length-1,c=o[l];if(!c)throw new RangeError("Invalid path: "+i);let u=new j7e(r,s,l>0?o.slice(0,l):null);e[c]=u.sort(e[c])}}return HJ.add(e)}const HJ=new Xn;class j7e{constructor(e,n,r,i){this.tags=e,this.mode=n,this.context=r,this.next=i}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}function KJ(t,e){let n=Object.create(null);for(let o of t)if(!Array.isArray(o.tag))n[o.tag.id]=o.class;else for(let s of o.tag)n[s.id]=o.class;let{scope:r,all:i=null}=e||{};return{style:o=>{let s=i;for(let a of o)for(let l of a.set){let c=n[l.id];if(c){s=s?s+" "+c:c;break}}return s},scope:r}}function Z7e(t,e){let n=null;for(let r of t){let i=r.style(e);i&&(n=n?n+" "+i:i)}return n}function V7e(t,e,n,r=0,i=t.length){let o=new G7e(r,Array.isArray(e)?e:[e],n);o.highlightRange(t.cursor(),r,i,"",o.highlighters),o.flush(i)}class G7e{constructor(e,n,r){this.at=e,this.highlighters=n,this.span=r,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,r,i,o){let{type:s,from:a,to:l}=e;if(a>=r||l<=n)return;s.isTop&&(o=this.highlighters.filter(d=>!d.scope||d.scope(s)));let c=i,u=s.prop(HJ),f=!1;for(;u;){if(!u.context||e.matchContext(u.context)){let d=Z7e(o,u.tags);d&&(c&&(c+=" "),c+=d,u.mode==1?i+=(i?" ":"")+d:u.mode==0&&(f=!0));break}u=u.next}if(this.startSpan(e.from,c),f)return;let h=e.tree&&e.tree.prop(Xn.mounted);if(h&&h.overlay){let d=e.node.enter(h.overlay[0].from+a,1),p=this.highlighters.filter(y=>!y.scope||y.scope(h.tree.type)),b=e.firstChild();for(let y=0,O=a;;y++){let m=y<h.overlay.length?h.overlay[y]:null,v=m?m.from+a:l,$=Math.max(n,O),S=Math.min(r,v);if($<S&&b)for(;e.from<S&&(this.highlightRange(e,$,S,i,o),this.startSpan(Math.min(r,e.to),c),!(e.to>=v||!e.nextSibling())););if(!m||v>r)break;O=m.to+a,O>n&&(this.highlightRange(d.cursor(),Math.max(n,m.from+a),Math.min(r,O),i,p),this.startSpan(O,c))}b&&e.parent()}else if(e.firstChild()){do if(!(e.to<=n)){if(e.from>=r)break;this.highlightRange(e,n,r,i,o),this.startSpan(Math.min(r,e.to),c)}while(e.nextSibling());e.parent()}}}const It=xc.define,c_=It(),cd=It(),MX=It(cd),NX=It(cd),ud=It(),u_=It(ud),dT=It(ud),Zc=It(),wh=It(Zc),Bc=It(),Fc=It(),k6=It(),im=It(k6),f_=It(),Z={comment:c_,lineComment:It(c_),blockComment:It(c_),docComment:It(c_),name:cd,variableName:It(cd),typeName:MX,tagName:It(MX),propertyName:NX,attributeName:It(NX),className:It(cd),labelName:It(cd),namespace:It(cd),macroName:It(cd),literal:ud,string:u_,docString:It(u_),character:It(u_),attributeValue:It(u_),number:dT,integer:It(dT),float:It(dT),bool:It(ud),regexp:It(ud),escape:It(ud),color:It(ud),url:It(ud),keyword:Bc,self:It(Bc),null:It(Bc),atom:It(Bc),unit:It(Bc),modifier:It(Bc),operatorKeyword:It(Bc),controlKeyword:It(Bc),definitionKeyword:It(Bc),moduleKeyword:It(Bc),operator:Fc,derefOperator:It(Fc),arithmeticOperator:It(Fc),logicOperator:It(Fc),bitwiseOperator:It(Fc),compareOperator:It(Fc),updateOperator:It(Fc),definitionOperator:It(Fc),typeOperator:It(Fc),controlOperator:It(Fc),punctuation:k6,separator:It(k6),bracket:im,angleBracket:It(im),squareBracket:It(im),paren:It(im),brace:It(im),content:Zc,heading:wh,heading1:It(wh),heading2:It(wh),heading3:It(wh),heading4:It(wh),heading5:It(wh),heading6:It(wh),contentSeparator:It(Zc),list:It(Zc),quote:It(Zc),emphasis:It(Zc),strong:It(Zc),link:It(Zc),monospace:It(Zc),strikethrough:It(Zc),inserted:It(),deleted:It(),changed:It(),invalid:It(),meta:f_,documentMeta:It(f_),annotation:It(f_),processingInstruction:It(f_),definition:xc.defineModifier(),constant:xc.defineModifier(),function:xc.defineModifier(),standard:xc.defineModifier(),local:xc.defineModifier(),special:xc.defineModifier()};KJ([{tag:Z.link,class:"tok-link"},{tag:Z.heading,class:"tok-heading"},{tag:Z.emphasis,class:"tok-emphasis"},{tag:Z.strong,class:"tok-strong"},{tag:Z.keyword,class:"tok-keyword"},{tag:Z.atom,class:"tok-atom"},{tag:Z.bool,class:"tok-bool"},{tag:Z.url,class:"tok-url"},{tag:Z.labelName,class:"tok-labelName"},{tag:Z.inserted,class:"tok-inserted"},{tag:Z.deleted,class:"tok-deleted"},{tag:Z.literal,class:"tok-literal"},{tag:Z.string,class:"tok-string"},{tag:Z.number,class:"tok-number"},{tag:[Z.regexp,Z.escape,Z.special(Z.string)],class:"tok-string2"},{tag:Z.variableName,class:"tok-variableName"},{tag:Z.local(Z.variableName),class:"tok-variableName tok-local"},{tag:Z.definition(Z.variableName),class:"tok-variableName tok-definition"},{tag:Z.special(Z.variableName),class:"tok-variableName2"},{tag:Z.definition(Z.propertyName),class:"tok-propertyName tok-definition"},{tag:Z.typeName,class:"tok-typeName"},{tag:Z.namespace,class:"tok-namespace"},{tag:Z.className,class:"tok-className"},{tag:Z.macroName,class:"tok-macroName"},{tag:Z.propertyName,class:"tok-propertyName"},{tag:Z.operator,class:"tok-operator"},{tag:Z.comment,class:"tok-comment"},{tag:Z.meta,class:"tok-meta"},{tag:Z.invalid,class:"tok-invalid"},{tag:Z.punctuation,class:"tok-punctuation"}]);var hT;const vO=new Xn;function hC(t){return Ft.define({combine:t?e=>e.concat(t):void 0})}class $a{constructor(e,n,r=[],i=""){this.data=e,this.name=i,rr.prototype.hasOwnProperty("tree")||Object.defineProperty(rr.prototype,"tree",{get(){return oi(this)}}),this.parser=n,this.extension=[Gd.of(this),rr.languageData.of((o,s,a)=>o.facet(DX(o,s,a)))].concat(r)}isActiveAt(e,n,r=-1){return DX(e,n,r)==this.data}findRegions(e){let n=e.facet(Gd);if((n==null?void 0:n.data)==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],i=(o,s)=>{if(o.prop(vO)==this.data){r.push({from:s,to:s+o.length});return}let a=o.prop(Xn.mounted);if(a){if(a.tree.prop(vO)==this.data){if(a.overlay)for(let l of a.overlay)r.push({from:l.from+s,to:l.to+s});else r.push({from:s,to:s+o.length});return}else if(a.overlay){let l=r.length;if(i(a.tree,a.overlay[0].from+s),r.length>l)return}}for(let l=0;l<o.children.length;l++){let c=o.children[l];c instanceof vr&&i(c,o.positions[l]+s)}};return i(oi(e),0),r}get allowsNesting(){return!0}}$a.setState=fn.define();function DX(t,e,n){let r=t.facet(Gd);if(!r)return null;let i=r.data;if(r.allowsNesting)for(let o=oi(t).topNode;o;o=o.enter(e,n,Xi.ExcludeBuffers))i=o.type.prop(vO)||i;return i}class Qa extends $a{constructor(e,n,r){super(e,n,[],r),this.parser=n}static define(e){let n=hC(e.languageData);return new Qa(n,e.parser.configure({props:[vO.add(r=>r.isTop?n:void 0)]}),e.name)}configure(e,n){return new Qa(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function oi(t){let e=t.field($a.state,!1);return e?e.tree:vr.empty}function H7e(t,e,n=50){var r;let i=(r=t.field($a.state,!1))===null||r===void 0?void 0:r.context;if(!i)return null;let o=i.viewport;i.updateViewport({from:0,to:e});let s=i.isDone(e)||i.work(n,e)?i.tree:null;return i.updateViewport(o),s}class K7e{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let r=this.cursorPos-this.string.length;return e<r||n>=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-r,n-r)}}let om=null;class yO{constructor(e,n,r=[],i,o,s,a,l){this.parser=e,this.state=n,this.fragments=r,this.tree=i,this.treeLen=o,this.viewport=s,this.skipped=a,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new yO(e,n,[],vr.empty,0,r,[],null)}startParse(){return this.parser.startParse(new K7e(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=vr.empty&&this.isDone(n!=null?n:this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n<this.state.doc.length&&this.parse.stopAt(n);;){let i=this.parse.advance();if(i)if(this.fragments=this.withoutTempSkipped(vf.addTree(i,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=i,this.parse=null,this.treeLen<(n!=null?n:this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,n;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(vf.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=om;om=this;try{return e()}finally{om=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=XX(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:i,treeLen:o,viewport:s,skipped:a}=this;if(this.takeTree(),!e.empty){let l=[];if(e.iterChangedRanges((c,u,f,h)=>l.push({fromA:c,toA:u,fromB:f,toB:h})),r=vf.applyChanges(r,l),i=vr.empty,o=0,s={from:e.mapPos(s.from,-1),to:e.mapPos(s.to,1)},this.skipped.length){a=[];for(let c of this.skipped){let u=e.mapPos(c.from,1),f=e.mapPos(c.to,-1);u<f&&a.push({from:u,to:f})}}}return new yO(this.parser,n,r,i,o,s,a,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let n=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:i,to:o}=this.skipped[r];i<e.to&&o>e.from&&(this.fragments=XX(this.fragments,i,o),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends E4{createParse(n,r,i){let o=i[0].from,s=i[i.length-1].to;return{parsedPos:o,advance(){let l=om;if(l){for(let c of i)l.tempSkipped.push(c);e&&(l.scheduleOn=l.scheduleOn?Promise.all([l.scheduleOn,e]):e)}return this.parsedPos=s,new vr(Eo.none,[],[],s-o)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return om}}function XX(t,e,n){return vf.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class A1{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new A1(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=yO.create(e.facet(Gd).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new A1(r)}}$a.state=fi.define({create:A1.init,update(t,e){for(let n of e.effects)if(n.is($a.setState))return n.value;return e.startState.facet(Gd)!=e.state.facet(Gd)?A1.init(e.state):t.apply(e)}});let JJ=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback!="undefined"&&(JJ=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:500-100})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const OT=typeof navigator!="undefined"&&((hT=navigator.scheduling)===null||hT===void 0?void 0:hT.isInputPending)?()=>navigator.scheduling.isInputPending():null,J7e=qr.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field($a.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),e.docChanged&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field($a.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=JJ(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEnd<n&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=n+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:i}}=this.view,o=r.field($a.state);if(o.tree==o.context.tree&&o.context.isDone(i+1e5))return;let s=Date.now()+Math.min(this.chunkBudget,100,e&&!OT?Math.max(25,e.timeRemaining()-5):1e9),a=o.context.treeLen<i&&r.doc.length>i+1e3,l=o.context.work(()=>OT&&OT()||Date.now()>s,i+(a?0:1e5));this.chunkBudget-=Date.now()-n,(l||this.chunkBudget<=0)&&(o.context.takeTree(),this.view.dispatch({effects:$a.setState.of(new A1(o.context))})),this.chunkBudget>0&&!(l&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(o.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Ja(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Gd=Ft.define({combine(t){return t.length?t[0]:null},enables:t=>[$a.state,J7e,ht.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class il{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}class w2{constructor(e,n,r,i,o,s=void 0){this.name=e,this.alias=n,this.extensions=r,this.filename=i,this.loadFunc=o,this.support=s,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:n,support:r}=e;if(!n){if(!r)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");n=()=>Promise.resolve(r)}return new w2(e.name,(e.alias||[]).concat(e.name).map(i=>i.toLowerCase()),e.extensions||[],e.filename,n,r)}static matchFilename(e,n){for(let i of e)if(i.filename&&i.filename.test(n))return i;let r=/\.([^.]+)$/.exec(n);if(r){for(let i of e)if(i.extensions.indexOf(r[1])>-1)return i}return null}static matchLanguageName(e,n,r=!0){n=n.toLowerCase();for(let i of e)if(i.alias.some(o=>o==n))return i;if(r)for(let i of e)for(let o of i.alias){let s=n.indexOf(o);if(s>-1&&(o.length>2||!/\w/.test(n[s-1])&&!/\w/.test(n[s+o.length])))return i}return null}}const eee=Ft.define(),Pf=Ft.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function Hd(t){let e=t.facet(Pf);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function I1(t,e){let n="",r=t.tabSize,i=t.facet(Pf)[0];if(i==" "){for(;e>=r;)n+=" ",e-=r;i=" "}for(let o=0;o<e;o++)n+=i;return n}function uy(t,e){t instanceof rr&&(t=new fy(t));for(let r of t.state.facet(eee)){let i=r(t,e);if(i!==void 0)return i}let n=oi(t.state);return n?eEe(t,n,e):null}function T6(t,e,n){let r=Object.create(null),i=new fy(t,{overrideIndentation:s=>{var a;return(a=r[s])!==null&&a!==void 0?a:-1}}),o=[];for(let s=e;s<=n;){let a=t.doc.lineAt(s);s=a.to+1;let l=uy(i,a.from);if(l==null)continue;/\S/.test(a.text)||(l=0);let c=/^\s*/.exec(a.text)[0],u=I1(t,l);c!=u&&(r[a.from]=l,o.push({from:a.from,to:a.from+c.length,insert:u}))}return t.changes(o)}class fy{constructor(e,n={}){this.state=e,this.options=n,this.unit=Hd(e)}lineAt(e,n=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:o}=this.options;return i!=null&&i>=r.from&&i<=r.to?o&&i==e?{text:"",from:e}:(n<0?i<e:i<=e)?{text:r.text.slice(i-r.from),from:i}:{text:r.text.slice(0,i-r.from),from:r.from}:r}textAfterPos(e,n=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:r,from:i}=this.lineAt(e,n);return r.slice(e-i,Math.min(r.length,e+100-i))}column(e,n=1){let{text:r,from:i}=this.lineAt(e,n),o=this.countColumn(r,e-i),s=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return s>-1&&(o+=s-this.countColumn(r,r.search(/\S|$/))),o}countColumn(e,n=e.length){return ry(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:r,from:i}=this.lineAt(e,n),o=this.options.overrideIndentation;if(o){let s=o(i);if(s>-1)return s}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const ll=new Xn;function eEe(t,e,n){return tee(e.resolveInner(n).enterUnfinishedNodesBefore(n),n,t)}function tEe(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function nEe(t){let e=t.type.prop(ll);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(Xn.closedBy))){let i=t.lastChild,o=i&&r.indexOf(i.name)>-1;return s=>nee(s,!0,1,void 0,o&&!tEe(s)?i.from:void 0)}return t.parent==null?rEe:null}function tee(t,e,n){for(;t;t=t.parent){let r=nEe(t);if(r)return r(OC.create(n,e,t))}return null}function rEe(){return 0}class OC extends fy{constructor(e,n,r){super(e.state,e.options),this.base=e,this.pos=n,this.node=r}static create(e,n,r){return new OC(e,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){let e=this.state.doc.lineAt(this.node.from);for(;;){let n=this.node.resolve(e.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(iEe(n,this.node))break;e=this.state.doc.lineAt(n.from)}return this.lineIndent(e.from)}continue(){let e=this.node.parent;return e?tee(e,this.pos,this.base):0}}function iEe(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function oEe(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let i=t.options.simulateBreak,o=t.state.doc.lineAt(n.from),s=i==null||i<=o.from?o.to:Math.min(o.to,i);for(let a=n.to;;){let l=e.childAfter(a);if(!l||l==r)return null;if(!l.type.isSkipped)return l.from<s?n:null;a=l.to}}function oO({closing:t,align:e=!0,units:n=1}){return r=>nee(r,e,n,t)}function nee(t,e,n,r,i){let o=t.textAfter,s=o.match(/^\s*/)[0].length,a=r&&o.slice(s,s+r.length)==r||i==t.pos+s,l=e?oEe(t):null;return l?a?t.column(l.from):t.column(l.to):t.baseIndent+(a?0:t.unit*n)}const pC=t=>t.baseIndent;function ns({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}const sEe=200;function ree(){return rr.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let n=t.newDoc,{head:r}=t.newSelection.main,i=n.lineAt(r);if(r>i.from+sEe)return t;let o=n.sliceString(i.from,r);if(!e.some(c=>c.test(o)))return t;let{state:s}=t,a=-1,l=[];for(let{head:c}of s.selection.ranges){let u=s.doc.lineAt(c);if(u.from==a)continue;a=u.from;let f=uy(s,u.from);if(f==null)continue;let h=/^\s*/.exec(u.text)[0],d=I1(s,f);h!=d&&l.push({from:u.from,to:u.from+h.length,insert:d})}return l.length?[t,{changes:l,sequential:!0}]:t})}const aEe=Ft.define(),cl=new Xn;function uh(t){let e=t.firstChild,n=t.lastChild;return e&&e.to<n.from?{from:e.to,to:n.type.isError?t.to:n.from}:null}function lEe(t,e,n){let r=oi(t);if(r.length<n)return null;let i=r.resolveInner(n,1),o=null;for(let s=i;s;s=s.parent){if(s.to<=n||s.from>n)continue;if(o&&s.from<e)break;let a=s.type.prop(cl);if(a&&(s.to<r.length-50||r.length==t.doc.length||!cEe(s))){let l=a(s,t);l&&l.from<=n&&l.from>=e&&l.to>n&&(o=l)}}return o}function cEe(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function k2(t,e,n){for(let r of t.facet(aEe)){let i=r(t,e,n);if(i)return i}return lEe(t,e,n)}function iee(t,e){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);return n>=r?void 0:{from:n,to:r}}const C4=fn.define({map:iee}),dy=fn.define({map:iee});function oee(t){let e=[];for(let{head:n}of t.state.selection.ranges)e.some(r=>r.from<=n&&r.to>=n)||e.push(t.lineBlockAt(n));return e}const bO=fi.define({create(){return zt.none},update(t,e){t=t.map(e.changes);for(let n of e.effects)n.is(C4)&&!uEe(t,n.value.from,n.value.to)?t=t.update({add:[WX.range(n.value.from,n.value.to)]}):n.is(dy)&&(t=t.update({filter:(r,i)=>n.value.from!=r||n.value.to!=i,filterFrom:n.value.from,filterTo:n.value.to}));if(e.selection){let n=!1,{head:r}=e.selection.main;t.between(r,r,(i,o)=>{i<r&&o>r&&(n=!0)}),n&&(t=t.update({filterFrom:r,filterTo:r,filter:(i,o)=>o<=r||i>=r}))}return t},provide:t=>ht.decorations.from(t),toJSON(t,e){let n=[];return t.between(0,e.doc.length,(r,i)=>{n.push(r,i)}),n},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let n=0;n<t.length;){let r=t[n++],i=t[n++];if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid JSON for fold state");e.push(WX.range(r,i))}return zt.set(e,!0)}});function T2(t,e,n){var r;let i=null;return(r=t.field(bO,!1))===null||r===void 0||r.between(e,n,(o,s)=>{(!i||i.from>o)&&(i={from:o,to:s})}),i}function uEe(t,e,n){let r=!1;return t.between(e,e,(i,o)=>{i==e&&o==n&&(r=!0)}),r}function see(t,e){return t.field(bO,!1)?e:e.concat(fn.appendConfig.of(hee()))}const aee=t=>{for(let e of oee(t)){let n=k2(t.state,e.from,e.to);if(n)return t.dispatch({effects:see(t.state,[C4.of(n),lee(t,n)])}),!0}return!1},fEe=t=>{if(!t.state.field(bO,!1))return!1;let e=[];for(let n of oee(t)){let r=T2(t.state,n.from,n.to);r&&e.push(dy.of(r),lee(t,r,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function lee(t,e,n=!0){let r=t.state.doc.lineAt(e.from).number,i=t.state.doc.lineAt(e.to).number;return ht.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${t.state.phrase("to")} ${i}.`)}const cee=t=>{let{state:e}=t,n=[];for(let r=0;r<e.doc.length;){let i=t.lineBlockAt(r),o=k2(e,i.from,i.to);o&&n.push(C4.of(o)),r=(o?t.lineBlockAt(o.to):i).to+1}return n.length&&t.dispatch({effects:see(t.state,n)}),!!n.length},uee=t=>{let e=t.state.field(bO,!1);if(!e||!e.size)return!1;let n=[];return e.between(0,t.state.doc.length,(r,i)=>{n.push(dy.of({from:r,to:i}))}),t.dispatch({effects:n}),!0},fee=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:aee},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:fEe},{key:"Ctrl-Alt-[",run:cee},{key:"Ctrl-Alt-]",run:uee}],dEe={placeholderDOM:null,placeholderText:"\u2026"},dee=Ft.define({combine(t){return Kl(t,dEe)}});function hee(t){let e=[bO,OEe];return t&&e.push(dee.of(t)),e}const WX=zt.replace({widget:new class extends Ic{toDOM(t){let{state:e}=t,n=e.facet(dee),r=o=>{let s=t.lineBlockAt(t.posAtDOM(o.target)),a=T2(t.state,s.from,s.to);a&&t.dispatch({effects:dy.of(a)}),o.preventDefault()};if(n.placeholderDOM)return n.placeholderDOM(t,r);let i=document.createElement("span");return i.textContent=n.placeholderText,i.setAttribute("aria-label",e.phrase("folded code")),i.title=e.phrase("unfold"),i.className="cm-foldPlaceholder",i.onclick=r,i}}}),hEe={openText:"\u2304",closedText:"\u203A",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class pT extends Rc{constructor(e,n){super(),this.config=e,this.open=n}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=e.state.phrase(this.open?"Fold line":"Unfold line"),n}}function Oee(t={}){let e=Object.assign(Object.assign({},hEe),t),n=new pT(e,!0),r=new pT(e,!1),i=qr.fromClass(class{constructor(s){this.from=s.viewport.from,this.markers=this.buildMarkers(s)}update(s){(s.docChanged||s.viewportChanged||s.startState.facet(Gd)!=s.state.facet(Gd)||s.startState.field(bO,!1)!=s.state.field(bO,!1)||oi(s.startState)!=oi(s.state)||e.foldingChanged(s))&&(this.markers=this.buildMarkers(s.view))}buildMarkers(s){let a=new $u;for(let l of s.viewportLineBlocks){let c=T2(s.state,l.from,l.to)?r:k2(s.state,l.from,l.to)?n:null;c&&a.add(l.from,l.from,c)}return a.finish()}}),{domEventHandlers:o}=e;return[i,RK({class:"cm-foldGutter",markers(s){var a;return((a=s.plugin(i))===null||a===void 0?void 0:a.markers)||Ir.empty},initialSpacer(){return new pT(e,!1)},domEventHandlers:Object.assign(Object.assign({},o),{click:(s,a,l)=>{if(o.click&&o.click(s,a,l))return!0;let c=T2(s.state,a.from,a.to);if(c)return s.dispatch({effects:dy.of(c)}),!0;let u=k2(s.state,a.from,a.to);return u?(s.dispatch({effects:C4.of(u)}),!0):!1}})}),hee()]}const OEe=ht.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class hy{constructor(e,n){this.specs=e;let r;function i(a){let l=Yd.newName();return(r||(r=Object.create(null)))["."+l]=a,l}const o=typeof n.all=="string"?n.all:n.all?i(n.all):void 0,s=n.scope;this.scope=s instanceof $a?a=>a.prop(vO)==s.data:s?a=>a==s:void 0,this.style=KJ(e.map(a=>({tag:a.tag,class:a.class||i(Object.assign({},a,{tag:null}))})),{all:o}).style,this.module=r?new Yd(r):null,this.themeType=n.themeType}static define(e,n){return new hy(e,n||{})}}const P6=Ft.define(),pee=Ft.define({combine(t){return t.length?[t[0]]:null}});function mT(t){let e=t.facet(P6);return e.length?e:t.facet(pee)}function R4(t,e){let n=[mEe],r;return t instanceof hy&&(t.module&&n.push(ht.styleModule.of(t.module)),r=t.themeType),e!=null&&e.fallback?n.push(pee.of(t)):r?n.push(P6.computeN([ht.darkTheme],i=>i.facet(ht.darkTheme)==(r=="dark")?[t]:[])):n.push(P6.of(t)),n}class pEe{constructor(e){this.markCache=Object.create(null),this.tree=oi(e.state),this.decorations=this.buildDeco(e,mT(e.state))}update(e){let n=oi(e.state),r=mT(e.state),i=r!=mT(e.startState);n.length<e.view.viewport.to&&!i&&n.type==this.tree.type?this.decorations=this.decorations.map(e.changes):(n!=this.tree||e.viewportChanged||i)&&(this.tree=n,this.decorations=this.buildDeco(e.view,r))}buildDeco(e,n){if(!n||!this.tree.length)return zt.none;let r=new $u;for(let{from:i,to:o}of e.visibleRanges)V7e(this.tree,n,(s,a,l)=>{r.add(s,a,this.markCache[l]||(this.markCache[l]=zt.mark({class:l})))},i,o);return r.finish()}}const mEe=xu.high(qr.fromClass(pEe,{decorations:t=>t.decorations})),mC=hy.define([{tag:Z.meta,color:"#404740"},{tag:Z.link,textDecoration:"underline"},{tag:Z.heading,textDecoration:"underline",fontWeight:"bold"},{tag:Z.emphasis,fontStyle:"italic"},{tag:Z.strong,fontWeight:"bold"},{tag:Z.strikethrough,textDecoration:"line-through"},{tag:Z.keyword,color:"#708"},{tag:[Z.atom,Z.bool,Z.url,Z.contentSeparator,Z.labelName],color:"#219"},{tag:[Z.literal,Z.inserted],color:"#164"},{tag:[Z.string,Z.deleted],color:"#a11"},{tag:[Z.regexp,Z.escape,Z.special(Z.string)],color:"#e40"},{tag:Z.definition(Z.variableName),color:"#00f"},{tag:Z.local(Z.variableName),color:"#30a"},{tag:[Z.typeName,Z.namespace],color:"#085"},{tag:Z.className,color:"#167"},{tag:[Z.special(Z.variableName),Z.macroName],color:"#256"},{tag:Z.definition(Z.propertyName),color:"#00c"},{tag:Z.comment,color:"#940"},{tag:Z.invalid,color:"#f00"}]),gEe=ht.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),mee=1e4,gee="()[]{}",vee=Ft.define({combine(t){return Kl(t,{afterCursor:!0,brackets:gee,maxScanDistance:mee,renderMatch:bEe})}}),vEe=zt.mark({class:"cm-matchingBracket"}),yEe=zt.mark({class:"cm-nonmatchingBracket"});function bEe(t){let e=[],n=t.matched?vEe:yEe;return e.push(n.range(t.start.from,t.start.to)),t.end&&e.push(n.range(t.end.from,t.end.to)),e}const _Ee=fi.define({create(){return zt.none},update(t,e){if(!e.docChanged&&!e.selection)return t;let n=[],r=e.state.facet(vee);for(let i of e.state.selection.ranges){if(!i.empty)continue;let o=Vs(e.state,i.head,-1,r)||i.head>0&&Vs(e.state,i.head-1,1,r)||r.afterCursor&&(Vs(e.state,i.head,1,r)||i.head<e.state.doc.length&&Vs(e.state,i.head+1,-1,r));o&&(n=n.concat(r.renderMatch(o,e.state)))}return zt.set(n,!0)},provide:t=>ht.decorations.from(t)}),$Ee=[_Ee,gEe];function yee(t={}){return[vee.of(t),$Ee]}const SEe=new Xn;function Q6(t,e,n){let r=t.prop(e<0?Xn.openedBy:Xn.closedBy);if(r)return r;if(t.name.length==1){let i=n.indexOf(t.name);if(i>-1&&i%2==(e<0?1:0))return[n[i+e]]}return null}function E6(t){let e=t.type.prop(SEe);return e?e(t.node):t}function Vs(t,e,n,r={}){let i=r.maxScanDistance||mee,o=r.brackets||gee,s=oi(t),a=s.resolveInner(e,n);for(let l=a;l;l=l.parent){let c=Q6(l.type,n,o);if(c&&l.from<l.to){let u=E6(l);if(u&&(n>0?e>=u.from&&e<u.to:e>u.from&&e<=u.to))return xEe(t,e,n,l,u,c,o)}}return wEe(t,e,n,s,a.type,i,o)}function xEe(t,e,n,r,i,o,s){let a=r.parent,l={from:i.from,to:i.to},c=0,u=a==null?void 0:a.cursor();if(u&&(n<0?u.childBefore(r.from):u.childAfter(r.to)))do if(n<0?u.to<=r.from:u.from>=r.to){if(c==0&&o.indexOf(u.type.name)>-1&&u.from<u.to){let f=E6(u);return{start:l,end:f?{from:f.from,to:f.to}:void 0,matched:!0}}else if(Q6(u.type,n,s))c++;else if(Q6(u.type,-n,s)){if(c==0){let f=E6(u);return{start:l,end:f&&f.from<f.to?{from:f.from,to:f.to}:void 0,matched:!1}}c--}}while(n<0?u.prevSibling():u.nextSibling());return{start:l,matched:!1}}function wEe(t,e,n,r,i,o,s){let a=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),l=s.indexOf(a);if(l<0||l%2==0!=n>0)return null;let c={from:n<0?e-1:e,to:n>0?e+1:e},u=t.doc.iterRange(e,n>0?t.doc.length:0),f=0;for(let h=0;!u.next().done&&h<=o;){let d=u.value;n<0&&(h+=d.length);let p=e+h*n;for(let b=n>0?0:d.length-1,y=n>0?d.length:-1;b!=y;b+=n){let O=s.indexOf(d[b]);if(!(O<0||r.resolveInner(p+b,1).type!=i))if(O%2==0==n>0)f++;else{if(f==1)return{start:c,end:{from:p+b,to:p+b+1},matched:O>>1==l>>1};f--}}n>0&&(h+=d.length)}return u.done?{start:c,matched:!1}:null}function UX(t,e,n,r=0,i=0){e==null&&(e=t.search(/[^\s\u00a0]/),e==-1&&(e=t.length));let o=i;for(let s=r;s<e;s++)t.charCodeAt(s)==9?o+=n-o%n:o++;return o}class gC{constructor(e,n,r,i){this.string=e,this.tabSize=n,this.indentUnit=r,this.overrideIndent=i,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(e){let n=this.string.charAt(this.pos),r;if(typeof e=="string"?r=n==e:r=n&&(e instanceof RegExp?e.test(n):e(n)),r)return++this.pos,n}eatWhile(e){let n=this.pos;for(;this.eat(e););return this.pos>n}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let n=this.string.indexOf(e,this.pos);if(n>-1)return this.pos=n,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=UX(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){var e;return(e=this.overrideIndent)!==null&&e!==void 0?e:UX(this.string,null,this.tabSize)}match(e,n,r){if(typeof e=="string"){let i=s=>r?s.toLowerCase():s,o=this.string.substr(this.pos,e.length);return i(o)==i(e)?(n!==!1&&(this.pos+=e.length),!0):null}else{let i=this.string.slice(this.pos).match(e);return i&&i.index>0?null:(i&&n!==!1&&(this.pos+=i[0].length),i)}}current(){return this.string.slice(this.start,this.pos)}}function kEe(t){return{name:t.name||"",token:t.token,blankLine:t.blankLine||(()=>{}),startState:t.startState||(()=>!0),copyState:t.copyState||TEe,indent:t.indent||(()=>null),languageData:t.languageData||{},tokenTable:t.tokenTable||yC}}function TEe(t){if(typeof t!="object")return t;let e={};for(let n in t){let r=t[n];e[n]=r instanceof Array?r.slice():r}return e}const qX=new WeakMap;class li extends $a{constructor(e){let n=hC(e.languageData),r=kEe(e),i,o=new class extends E4{createParse(s,a,l){return new QEe(i,s,a,l)}};super(n,o,[eee.of((s,a)=>this.getIndent(s,a))],e.name),this.topNode=REe(n),i=this,this.streamParser=r,this.stateAfter=new Xn({perNode:!0}),this.tokenTable=e.tokenTable?new See(r.tokenTable):CEe}static define(e){return new li(e)}getIndent(e,n){let r=oi(e.state),i=r.resolve(n);for(;i&&i.type!=this.topNode;)i=i.parent;if(!i)return null;let o,{overrideIndentation:s}=e.options;s&&(o=qX.get(e.state),o!=null&&o<n-1e4&&(o=void 0));let a=vC(this,r,0,i.from,o!=null?o:n),l,c;if(a?(c=a.state,l=a.pos+1):(c=this.streamParser.startState(e.unit),l=0),n-l>1e4)return null;for(;l<n;){let f=e.state.doc.lineAt(l),h=Math.min(n,f.to);if(f.length){let d=s?s(f.from):-1,p=new gC(f.text,e.state.tabSize,e.unit,d<0?void 0:d);for(;p.pos<h-f.from;)_ee(this.streamParser.token,p,c)}else this.streamParser.blankLine(c,e.unit);if(h==n)break;l=f.to+1}let u=e.lineAt(n);return s&&o==null&&qX.set(e.state,u.from),this.streamParser.indent(c,/^\s*(.*)/.exec(u.text)[1],e)}get allowsNesting(){return!1}}function vC(t,e,n,r,i){let o=n>=r&&n+e.length<=i&&e.prop(t.stateAfter);if(o)return{state:t.streamParser.copyState(o),pos:n+e.length};for(let s=e.children.length-1;s>=0;s--){let a=e.children[s],l=n+e.positions[s],c=a instanceof vr&&l<i&&vC(t,a,l,r,i);if(c)return c}return null}function bee(t,e,n,r,i){if(i&&n<=0&&r>=e.length)return e;!i&&e.type==t.topNode&&(i=!0);for(let o=e.children.length-1;o>=0;o--){let s=e.positions[o],a=e.children[o],l;if(s<r&&a instanceof vr){if(!(l=bee(t,a,n-s,r-s,i)))break;return i?new vr(e.type,e.children.slice(0,o).concat(l),e.positions.slice(0,o+1),s+l.length):l}}return null}function PEe(t,e,n,r){for(let i of e){let o=i.from+(i.openStart?25:0),s=i.to-(i.openEnd?25:0),a=o<=n&&s>n&&vC(t,i.tree,0-i.offset,n,s),l;if(a&&(l=bee(t,i.tree,n+i.offset,a.pos+i.offset,!1)))return{state:a.state,tree:l}}return{state:t.streamParser.startState(r?Hd(r):4),tree:vr.empty}}class QEe{constructor(e,n,r,i){this.lang=e,this.input=n,this.fragments=r,this.ranges=i,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=i[i.length-1].to;let o=yO.get(),s=i[0].from,{state:a,tree:l}=PEe(e,r,s,o==null?void 0:o.state);this.state=a,this.parsedPos=this.chunkStart=s+l.length;for(let c=0;c<l.children.length;c++)this.chunks.push(l.children[c]),this.chunkPos.push(l.positions[c]);o&&this.parsedPos<o.viewport.from-1e5&&(this.state=this.lang.streamParser.startState(Hd(o.state)),o.skipUntilInView(this.parsedPos,o.viewport.from),this.parsedPos=o.viewport.from),this.moveRangeIndex()}advance(){let e=yO.get(),n=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),r=Math.min(n,this.chunkStart+2048);for(e&&(r=Math.min(r,e.viewport.to));this.parsedPos<r;)this.parseLine(e);return this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=n?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,n),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let n=this.input.chunk(e);if(this.input.lineChunks)n==`
|
|
1024
|
+
`,w7e=(t,e)=>{const{className:n,children:r,meun:i,position:o="bottom",container:s,isMask:a=!0,enableResize:l=!1,popupAlign:c={},onClose:u}=t,[f,h]=z.exports.useState(!1),d=z.exports.useRef(null),p=z.exports.useRef(null),[b,y]=z.exports.useState({}),O=z.exports.useRef(null),m=z.exports.useCallback(()=>{h(!1),u&&u()},[u]),v=z.exports.useCallback(L=>{if(!p.current||!d.current)return;const C=d.current,T=p.current;!$6(C,L.target)&&!$6(T,L.target)&&m()},[m]);z.exports.useEffect(()=>(window.document.addEventListener("mousedown",v),()=>{window.document.removeEventListener("mousedown",v)}),[v]),z.exports.useEffect(()=>{i||h(!1)},[i]),z.exports.useEffect(()=>{f&&k()},[f]),z.exports.useImperativeHandle(e,()=>({click:()=>{f&&u&&u(),h(!0)},close:()=>{h(!1)},open:f}));const $=z.exports.useCallback((L=0)=>{if(!!f&&L<4){w(k);return}},[f]),S=z.exports.useCallback(()=>{$()},[$]);z.exports.useEffect(()=>(l&&window.addEventListener("resize",S),()=>{l&&window.removeEventListener("resize",S)}),[l,S]);const w=L=>{const{requestAnimationFrame:C,cancelAnimationFrame:T}=window;O.current&&T(O.current),O.current=C(()=>{L(),O.current=null})},k=()=>{if(!p.current||!d.current)return;const L=s||document.body,C=p.current,T=d.current,{style:E}=BJ({position:o,popupAlign:c},C,T,L);y(E||{})},I=ue(nO,{in:f,classNames:"d42-fade",timeout:0,unmountOnExit:!0,appear:!0,children:ue("div",{className:a?"d42-mask":"",onClick:L=>{L.preventDefault(),L.stopPropagation(),h(!1),u&&u()},children:ue("div",{ref:p,className:zn("d42-expaned-wrapper",o),style:{position:"absolute",zIndex:1115,...b},children:i||null})})});return ue(x7e,{ref:d,className:n!=null?n:"",children:Kt("div",{className:"d42-popover-container",children:[ue("div",{onClick:L=>{L.preventDefault(),L.stopPropagation(),f&&u&&u(),h(!f)},children:r}),Qc.createPortal(I,s||document.body)]})})};var S6=At.forwardRef(w7e);class YJ{constructor(e,n,r,i){this.origin=e,this.changes=n,this.effects=r,this.clientID=i}}class b2{constructor(e,n){this.version=e,this.unconfirmed=n}}const _2=Ft.define({combine(t){let e=Kl(t,{startVersion:0,clientID:null,sharedEffects:()=>[]});return e.clientID==null&&(e.clientID=t.length&&t[0].generatedID||""),e}}),x6=ch.define(),Q4=fi.define({create(t){return new b2(t.facet(_2).startVersion,[])},update(t,e){let n=e.annotation(x6);if(n)return n;let{sharedEffects:r,clientID:i}=e.startState.facet(_2),o=r(e);return o.length||!e.changes.empty?new b2(t.version,t.unconfirmed.concat(new YJ(e,e.changes,o,i))):t}});function k7e(t={}){return[Q4,_2.of(Object.assign({generatedID:Math.floor(Math.random()*1e9).toString(36)},t))]}function QX(t,e){let{version:n,unconfirmed:r}=t.field(Q4),{clientID:i}=t.facet(_2);n+=e.length;let o=0;for(;o<e.length&&e[o].clientID==i;)o++;if(o&&(r=r.slice(o),e=e.slice(o)),!e.length)return t.update({annotations:[x6.of(new b2(n,r))]});let s=e[0].changes,a=e[0].effects||[];for(let l=1;l<e.length;l++){let c=e[l];a=fn.mapEffects(a,c.changes),c.effects&&(a=a.concat(c.effects)),s=s.compose(c.changes)}return r.length&&(r=r.map(l=>{let c=l.changes.map(s);return s=s.map(l.changes,!0),new YJ(l.origin,c,fn.mapEffects(l.effects,s),i)}),a=fn.mapEffects(a,r.reduce((l,c)=>l.compose(c.changes),Ei.empty(r[0].changes.length)))),t.update({changes:s,effects:a,annotations:[Kr.addToHistory.of(!1),Kr.remote.of(!0),x6.of(new b2(n,r))],filter:!1})}function cg(t){return t.field(Q4).unconfirmed}function fT(t){return t.field(Q4).version}const T7e=require("minimatch"),P7e=()=>Kt(_7e,{speed:1,backgroundColor:"var(--d42-tree__skeleton--bg)",foregroundColor:"var(--d42-tree__skeleton--foregroundColor)",style:{width:"100%",height:"140px"},children:[ue("rect",{y:"0",rx:"16",ry:"16",width:"16",height:"16"}),ue("rect",{y:"0",x:"30",rx:"2",ry:"2",width:"100",height:"16"}),ue("rect",{y:"30",rx:"16",ry:"16",width:"16",height:"16"}),ue("rect",{y:"30",x:"30",rx:"2",ry:"2",width:"190",height:"16"}),ue("rect",{y:"60",rx:"16",ry:"16",width:"16",height:"16"}),ue("rect",{y:"60",x:"30",rx:"2",ry:"2",width:"80",height:"16"}),ue("rect",{y:"90",rx:"16",ry:"16",width:"16",height:"16"}),ue("rect",{y:"90",x:"30",rx:"2",ry:"2",width:"116",height:"16"}),ue("rect",{y:"116",rx:"16",ry:"16",width:"16",height:"16"}),ue("rect",{y:"116",x:"30",rx:"2",ry:"2",width:"100",height:"16"}),ue("rect",{y:"150",rx:"16",ry:"16",width:"16",height:"16"}),ue("rect",{y:"150",x:"30",rx:"2",ry:"2",width:"160",height:"16"})]}),Q7e=({onCustomSelect:t,treeItemHeight:e,hideFeature:n,hideEditFeature:r,lockFeature:i,lockEditFeature:o,unittestFeature:s,unittestEditFeature:a,disableFileAction:l={},fileRootActions:c=[]})=>{const{t:u}=ia(),f=_d().file.fileIntoView(),[h,d]=z.exports.useState(),{getOnlineAgentUsersByPath:p,agentUserOpenFile:b}=X9e(),y=ut().file.expandedFolders(),O=ut().file.loadingPath(),[m,v]=z.exports.useState(""),[$,S]=z.exports.useState(""),w=z.exports.useRef(null),{fileTreeIgnore:k,dockerId:I,fileRootPath:L,url:C}=ut().dao.playgroundInfo(),T=ut().file.fileTree(),E=ut().dao.playgroundMode(),N=ut().dao.channel(),G=ut().dao.channelAvailable(),[j,A]=z.exports.useState(""),W=z.exports.useRef(null),q=z.exports.useRef(null),[K,ie]=z.exports.useState("CREATE"),[V,ne]=z.exports.useState(!1),[Pe,Ee]=z.exports.useState({isDir:!1,path:""}),H=z.exports.useRef(null);let _e=null;const re=z.exports.useRef(null),[ae,ee]=z.exports.useState({}),Re=ut().file.treeData(),Be=Se.file.setTreeData,[ot,Ve]=z.exports.useState(!1),[dt,Dt]=z.exports.useState(""),Ze=(k==null?void 0:k.split(";"))||[],je=".",Ut=z.exports.useRef(null),Gt=z.exports.useRef(null),Nt=ut().file.tempFileOrFolder(),wn=z.exports.useRef(0),Tn=z.exports.useRef(!1),ln=ut().file.selectedFilePath(),at=Se.file.setSelectedFilePath,Me=ut().file.getOpenedPath();z.exports.useRef("");const Fe=ut().dao.isPlayBack(),xt=ut().file.fileTreeLoading()&&!Fe,[Qe,Le]=z.exports.useState(!1),Ue=z.exports.useRef(null),yt=ut().file.fileStyle(),{disableFileTreeAction:_t}=ut().dao.config(),Pt=z.exports.useRef(null),mt=z.exports.useRef(null),wt=z.exports.useRef(0),Jt=z.exports.useRef(!0);z.exports.useEffect(()=>{Se.file.hideFeature(n),Se.file.hideEditFeature(r)},[n,r]),z.exports.useEffect(()=>{var Oe;if(Me&&E===_u.edit&&((Oe=Re[Me])==null?void 0:Oe.type)==="FILE"){const Ie=e2(Me),Je=!!(Ie!=null&&Ie.lock)&&!o&&i==="on";Se.file.setDocEditable(!Je)}},[o,i,Me,E,Re]),z.exports.useEffect(()=>{I&&Le(wE(I))},[I]),z.exports.useEffect(()=>{const Oe=J.dao.channel().playbackIsRunning();!G||Fe&&Oe||ln&&(ln!==O&&ln!==Me||Fe)&&N.loadFile(ln)},[N,G,O,Fe,Me,ln]),z.exports.useEffect(()=>{if(f&&ln){const Oe=document.getElementById(ln);Oe==null||Oe.scrollIntoView({block:"center",inline:"start"}),Se.file.fileIntoView(!1)}},[f,ln]);const jn=Oe=>{const Ie=J.dao.currentAgentUser();return(Ie==null?void 0:Ie.agentUserId)===Oe||(Ie==null?void 0:Ie.followingAgentUserId)===Oe},Ht=(Oe=u("file_tree_num_of_files_cannot_exceed_500"))=>{J.dao.channel().transitionCustomError({name:"upload",error:Oe})},Cn=z.exports.useCallback((Oe,Ie)=>{const{data:{action:Je}}=Oe;return["REFRESH","EXPAND","COLLAPSE","FOCUS"].includes(Je)?(Bu(Oe,Ie==null?void 0:Ie.snapshot),Oe.snapshot=io((Ie==null?void 0:Ie.snapshot)||Oe.data.payload),Oe):(Oe.snapshot,Bu(Oe,io(Ie==null?void 0:Ie.snapshot)),Oe)},[]),Gn=z.exports.useCallback(Oe=>{var Zo,Li;if(!Oe)return;let{snapshot:Ie}=Oe;const{agentUserId:Je}=Oe,{action:xe,result:ke,message:et,destination:Zt,files:kt,failPath:tn=[],url:un}=Oe.data,Or=J.dao.isPlayBack(),Vn=J.dao.currentAgentUser();if(xe==="REFRESH"){!Ie&&Or&&(Oe=Cn(Oe,null),Ie=Oe.snapshot),Or&&un&&Se.dao.setPlaygroundUrl(un),Se.file.setFileTree(io(Ie)),Bu(Oe,io(Ie));return}else if(Or&&Ie&&!["EXPAND","COLLAPSE"].includes(xe)){Se.file.setFileTree(io(Ie));return}const pr=J.file.expandedFolders(),$i=((Zo=J.dao.currentAgentUser())==null?void 0:Zo.followingAgentUserId)===Je||J.dao.isPlayBack();for(const Sn of kt)switch(xe){case"MOVE":{if(ee({}),ke===!1){Ur.error(et),Zn(),m&&Zt&&Be(x=>(x[m].data=Sn.name,x)),v("");return}if(Bu(Oe,T),Zt&&Sn.name===ln&&Sn.type==="FILE")at(Zt);else if(Sn.type==="DIRECTORY"){const x=J.file.doc().openedPath.indexOf(Sn.name),R=J.file.expandedFolders().map(M=>M.startsWith(`${Sn.name}/`)||M===Sn.name?Zt+M.substring(Sn.name.length):M);if(Se.file.expandedFolders(R),x===0){const M=`${Zt}${J.file.doc().openedPath.substring(Sn.name.length)}`;at(M)}}Zn(),v("");break}case"CREATE":{if(ke===!1)Ur.error(et),Zn(),Be(x=>(delete x[Sn.name],delete x[m],x)),A("");else{Bu(Oe,T);const x=(Vn==null?void 0:Vn.agentUserId)===Je||(Vn==null?void 0:Vn.followingAgentUserId)===Je;Sn.type==="FILE"&&x&&Sn.name!==J.file.getOpenedPath()&&Se.file.setSelectedFilePath(Sn.name),d(Sn.name)}v(""),ee({});break}case"DELETE":{if(ke===!1)Ur.error(et);else{const x=J.file.doc().openedPath,R=x.indexOf(Sn.name),M=Sn.type==="FILE"?Sn.name===x:R===0&&x[Sn.name.length]==="/";(!x||M)&&Se.file.resetFile(),Bu(Oe,T),Se.file.deletedPath(Sn.name),DG(Sn.name,!0)}break}case"UPLOAD":{if(ke===!1&&tn.length>0){if(!Object.keys(Re).length)return;tn.forEach(M=>{var Q;delete Re[M],Re["."].children=(Q=Re["."].children)==null?void 0:Q.filter(D=>D!==M),Be(io(Re))}),Ht(et);return}const R=Sn.name.lastIndexOf("/")>-1?Sn.name.substring(0,Sn.name.lastIndexOf("/")):Sn.name;(ke||ke===void 0)&&Bu(Oe,T,Sn),ke&&((Li=Oe.data)==null?void 0:Li.uploadingCount)===0?(wn.current=0,ee({})):!ke&&Re[R]&&(Ur.error(et),delete Re[R],Be(io(Re)));break}case"FEATURE":{ke?Bu(Oe,T):Ur.error(et);break}case"EXPAND":{if($i){const x=[...new Set(pr.concat(Sn.name))];Se.file.expandedFolders(x)}break}case"COLLAPSE":{$i&&Se.file.expandedFolders(pr.filter(x=>x!==Sn.name));break}case"FOCUS":{b(Sn.name,Je),(jn(Je)||J.dao.isPlayBack())&&(Sn.type==="FILE"&&at(Sn.name),d(Sn.name));break}}},[b,T,m,ln,at,Re,Be]);z.exports.useEffect(()=>{J.dao.channel().subscribeForComponent(Ot.FileTree,{onStart:()=>{Se.file.expandedFolders([]),Be({}),Se.file.setFileTree(null)},onData:Gn,getPlaybackSnapshot:Cn})},[Gn]);const Rn=Oe=>{if(!J.dao.channelAvailable())return Qt.error("offline");if(Oe.length===1){if(ae[Oe[0]])return;if(Re[Oe[0]].type==="FILE"){if(Fe)J.dao.channel().playbackIsRunning()&&(J.dao.channel().pausePlayback(!0),Ur.warn(u("\u56DE\u653E\u5DF2\u6682\u505C")));else{const Ie=J.file.editorView(),Je=Ie&&cg(Ie.state).filter(xe=>!xe.changes.empty).length;if(Je){setTimeout(()=>{at(Oe[0])},400);const xe=["delayLoadFile",`\u7F16\u8F91\u5668\u8FD8\u6709${Je}\u6761\u5185\u5BB9\u6B63\u5728\u66F4\u65B0`];Qt.log(...xe),J.dao.channel().uploadLog(xe[0],xe[1]);return}}at(Oe[0])}}},Ln=Oe=>{J.dao.channel().operateFileTree({action:"EXPAND",files:[{type:"DIRECTORY",name:Oe}]}),Oe!==je&&d(Oe);const Ie=J.file.expandedFolders(),Je=Ie.includes(Oe)?"":Oe;Se.file.expandedFolders([...Ie,Je])},sr=Oe=>{J.dao.channel().operateFileTree({action:"COLLAPSE",files:[{type:"DIRECTORY",name:Oe}]});const Ie=J.file.expandedFolders();Se.file.expandedFolders(Ie.filter(Je=>Je!==Oe))},si=Oe=>{Be(Ie=>({...Ie,...Oe}))},Ki=async Oe=>{const Ie=new FileReader;return Ie.readAsArrayBuffer(Oe),new Promise(Je=>{Ie.onload=function(){Je(Ie.result)}})},Pr=async(Oe,Ie)=>{var et,Zt;if(Oe.length>500){Ht();return}const Je=J5(T),xe=Array.from(Oe).find(kt=>{const tn=`${Ie?`${Ie}/`:""}${kt.name}`;return Je[tn]});if(xe){Ve(!0),Dt(u("file_tree_x_existed",{x:xe.name}));return}const ke={action:"UPLOAD",destination:"",files:[]};for(const kt of Array.from(Oe)){const tn=`${Ie?`${Ie}/`:""}${kt.name}`;if(Ze.includes(kt.name))Qt.log(u("file_tree_x_filtered",{x:kt.name}));else{const un=io(Je),Or=Ie||je;un[Or]&&!((et=un[Or].children)!=null&&et.includes(tn))&&((Zt=un[Or].children)==null||Zt.push(tn)),un[tn]={data:kt.name,hasChildren:!1,index:tn,type:"FILE"},si(un),ee(pr=>({...pr,[tn]:!0}));const Vn=J.dao.openSocketBuffer()?await Ki(kt):kt;ke.files.push({type:"FILE",name:tn,content:Vn})}}ke.files.length&&J.dao.channel().operateFileTree(ke)},en=async Oe=>{const Ie=[];for(const Je of Array.from(Oe))Ze.includes(Je.name)?Qt.log(u("file_tree_x_upload_not_allowed",{x:Je.name})):Ie.push({path:Je.fullPath||Je.webkitRelativePath,file:Je});return Ie},hn=Oe=>Oe.indexOf("/")>-1?Oe.substring(0,Oe.indexOf("/")):Oe,An=(Oe,Ie)=>{const Je=io(Re),xe=[...new Set(Oe.map(et=>hn(et.path)))];Oe.filter(et=>{if(xe.length===0)return!1;const Zt=xe.findIndex(kt=>kt===hn(et.path));return Zt>-1?(xe.splice(Zt,1),Zt>-1):!1}).forEach(et=>{var Or;const Zt=et.path,kt=hn(et.path),tn=Ie?`${Ie}/${kt}`:kt;(Or=Je[Ie||je].children)==null||Or.push(tn),ee(Vn=>({...Vn,[tn]:!0}));const un=Zt.indexOf("/")>-1?"DIRECTORY":"FILE";Je[tn]={data:kt,hasChildren:un==="DIRECTORY",index:`${Ie?`${Ie}/`:""}${un==="DIRECTORY"?kt:Zt}`,type:un},si(Je)})},fr=async(Oe,Ie)=>{const Je=J5(T);if(!Object.keys(Je).length)return;const xe=await en(Oe);if(xe.length>500){Ht();return}if(xe.length>0){const ke=xe.find(Zt=>{const kt=Ie?`${Ie}/${Zt.path}`:Zt.path;return!!Je[m4e(kt)]});if(ke){Ve(!0);const Zt=Ie?`${Ie}/${ke.path}`:ke.path;Dt(u("file_tree_x_existed",{x:Zt}));return}wn.current=xe.length;const et={action:"UPLOAD",destination:"",files:[]};An(xe,Ie);for(let Zt=0;Zt<xe.length;Zt++){const kt=xe[Zt],tn=J.dao.openSocketBuffer()?await Ki(kt.file):kt.file;et.files.push({type:"FILE",name:`${Ie?`${Ie}/`:""}${kt.path}`,content:tn})}J.dao.channel().operateFileTree(et)}},Br=async(Oe,Ie)=>{Gr(""),ls(""),wt.current=0,Oe.preventDefault(),Oe.stopPropagation(),document.querySelector(".d42-tree-root").classList.remove("d42-drag-over-node");const xe=Array.from(Oe.dataTransfer.items)||[];if(xe.length===0)return;const ke=[];for(const tn of xe)ke.push(tn.webkitGetAsEntry());const et=ke.some(tn=>tn==null?void 0:tn.isDirectory),Zt=await KG(ke,[]);Vr(),!b4e(Zt)&&(et?fr(Zt,Ie):Pr(Zt,Ie))},ge=Oe=>{var Ie;((Ie=Oe.dataTransfer)==null?void 0:Ie.items.length)!==0&&(Oe.preventDefault(),Oe.stopPropagation())},Ge=Oe=>{if(Fe)return;la("."),Oe.preventDefault(),Oe.stopPropagation(),Vr();const Ie=document.querySelector(".d42-tree-root");Ie.classList.add("d42-drag-over-node"),mt.current=Ie,wt.current=wt.current+1},gt=Oe=>{wt.current=wt.current-1,Oe.dataTransfer.items.length!==0&&(Oe.preventDefault(),Oe.stopPropagation(),Oe.nativeEvent.stopImmediatePropagation(),wt.current===0&&(Vr(),cs()))},Lt=Oe=>(Re[Oe].hasChildren?Oe=Re[Oe].index:Oe[Oe.length-1]!=="/"&&(Oe=Oe.substring(0,Oe.lastIndexOf("/"))),Oe),bn=()=>{Zn(),Be(Oe=>(Object.entries(Oe).forEach(([Ie,Je])=>{Je.data||delete Oe[Ie]}),Oe))},Hn=(Oe=je)=>{var et;Jt.current=!0,bn(),Ln(Oe),ie("CREATE"),Oe=Lt(Oe);const Ie=io(Re),xe=`${Oe===je?"":`${Oe}/`}${b6().substring(0,6)}`;(et=Ie[Oe].children)==null||et.push(xe);const ke={root:Oe,path:xe,type:"FILE"};Se.file.tempFileOrFolder(ke),Ie[xe]={index:xe,hasChildren:!1,data:""},si(Ie),v(xe),S("")},Fn=(Oe=je)=>{var et;Jt.current=!0,bn(),Ln(Oe),ie("CREATE"),Oe=Lt(Oe);const Ie=io(Re),xe=`${Oe===je?"":`${Oe}/`}${b6().substring(0,6)}`;(et=Ie[Oe].children)==null||et.push(xe);const ke={root:Oe,path:xe,type:"DIRECTORY"};Se.file.tempFileOrFolder(ke),Ie[xe]={index:xe,hasChildren:!0,children:[],data:""},si(Ie),v(xe),S("")},Zn=()=>{const Oe={path:"",root:"",type:""};Se.file.tempFileOrFolder(Oe)},dr=(Oe,Ie="")=>{if(!J.dao.channelAvailable())return Qt.log("offline");const Je={action:"CREATE",files:[]},xe=go(m),ke=xe===je||!xe?"":`${xe}/`;if(!Oe||!$||Uk(`${ke}`+$))return;const et=Re[Nt.path].hasChildren;if(Re[`${ke}${$}`]){Qt.error(u("file_tree_renamed"));return}const Zt=Oe.index.split("/");Zt.length>0&&(Zt[Zt.length-1]=$),Zt.splice(-1,1,Ie);const kt=Zt.join("/");K==="CREATE"?(Je.action=K,et?Je.files=[{type:"DIRECTORY",name:kt}]:Je.files=[{type:"FILE",name:kt}]):(Je.action="MOVE",Je.destination=kt,Je.files=[{type:"FILE",name:Oe.index}],(Me.startsWith(`${Oe.index}/`)||Me===Oe.index)&&Se.file.setDocLoading(!0)),ee(tn=>({...tn,[kt]:!0})),Je.files[0].type=et?"DIRECTORY":"FILE",J.dao.channel().operateFileTree(Je),Zn()},In=Oe=>{ee(Ie=>({...Ie,[Oe]:!0})),J.dao.channel().operateFileTree({action:"DELETE",files:[{type:Pe.isDir?"DIRECTORY":"FILE",name:Oe}]})},Pn=z.exports.useCallback(()=>{var Zt,kt,tn,un,Or;const{root:Oe,path:Ie}=Nt,Je=io(Re),xe=Ie.lastIndexOf("/"),ke=Ie.substring(0,xe>-1?xe+1:xe),et=`${ke}${$}`;if(Re[et]||((Zt=Ue.current)==null?void 0:Zt.dataset.error)==="1"){Zn(),K==="MOVE"&&m!==et&&Be(Vn=>{if(Vn[m]){const pr=m.lastIndexOf("/"),$i=~pr?m.substring(pr+1):m;Vn[m].data=$i}return Vn}),K!=="MOVE"&&m!==$&&Be(Vn=>(delete Vn[m],Vn)),A(""),v(""),S("");return}if(!(!Ie||!Oe)){if(!$&&Ie||Re[`${ke}`+$]||Uk(`${ke}`+$)||((kt=Ue.current)==null?void 0:kt.dataset.error)==="1")Je[Oe].children=(un=(tn=Je[Oe])==null?void 0:tn.children)==null?void 0:un.filter(Vn=>Vn!==Ie),delete Je[Ie],Zn(),Be(Je);else if($){const Vn=(Or=Je[Ie])==null?void 0:Or.hasChildren,pr={action:K,files:[{type:Vn?"DIRECTORY":"FILE",name:K==="MOVE"?Ie:ke+$}]};K==="MOVE"&&(pr.destination=ke+$),J.dao.channel().operateFileTree(pr),S(""),A(""),Zn(),v("")}}},[K,$,m,Be,Nt,Re]),Mn=z.exports.useCallback(Oe=>{if(!Pt.current)return;const Ie=Pt.current;if(!$6(Ie,Oe.target)){const Je=Oe.target,xe=Je.querySelector(".d42-create-box"),ke=xe==null?void 0:xe.dataset.path;if(m===ke&&Je.dataset.path!==je)return;Pn()}},[Pn,m]);z.exports.useEffect(()=>(window.document.addEventListener("mousedown",Mn),()=>{window.document.removeEventListener("mousedown",Mn)}),[Mn]);const ar=(Oe,Ie)=>ue(mf,{popup:()=>ue("span",{children:Oe}),children:Ie}),ir=()=>{if(!J.dao.channelAvailable())return;Qe&&Me.startsWith(".")&&Se.file.resetFile();const Oe=window.localStorage.getItem("showHiddenFiles");let Ie=Oe?JSON.parse(Oe):{};Ie=ah(Ie)?Ie:{},Ie[I]=!Qe,window.localStorage.setItem("showHiddenFiles",JSON.stringify(Ie));const xe=Me.split("/").some(ke=>ke.startsWith("."));Qe&&xe&&Se.file.resetFile(),Le(!Qe)},di=()=>Kt("div",{className:"d42-operation-panel",children:[ue("div",{className:"d42-panel-item",onClick:()=>{var Oe,Ie;!J.dao.channelAvailable()||((Oe=H.current)==null||Oe.click(),(Ie=re.current)==null||Ie.close())},children:u("file_tree_upload_files")}),ue("div",{className:"d42-panel-item",onClick:()=>{var Oe;!J.dao.channelAvailable()||(_e==null||_e.click(),(Oe=re.current)==null||Oe.close())},children:u("file_tree_upload_folder")}),ue("div",{className:"d42-panel-item",onClick:ir,children:u(Qe?"do_no_show_hidden_files":"show_hidden_files")}),ue(tu,{children:c.map((Oe,Ie)=>ue("div",{className:"d42-panel-item",onClick:()=>{var Je;!J.dao.channelAvailable()||(Je=Oe.onClick)==null||Je.call(Oe)},children:Oe.label},Ie))})]}),zi=z.exports.useRef({}),lo=z.exports.useCallback((Oe,Ie,Je)=>{Jt.current=!1,Je=Je||"",Oe.stopPropagation(),ie("MOVE"),A(""),S(Je),v(Ie);const xe=io(Nt);xe.path=Ie;const ke=Ie.split("/");ke.length>1&&ke.pop(),xe.root=Ie.includes("/")?ke.join("/"):".",Se.file.tempFileOrFolder(xe)},[Nt]),os=(Oe,Ie,Je)=>{Oe.stopPropagation(),Ee({isDir:Ie,path:Je}),A(""),ne(!0)},Ls=(Oe,Ie)=>{Oe.stopPropagation(),A(""),Hn(Ie)},Fo=(Oe,Ie)=>{Oe.stopPropagation(),A(""),Fn(Ie)},Ui=Oe=>Oe.substring(Oe.lastIndexOf("/")+1),aa=(Oe,Ie)=>{Oe.stopPropagation(),A("");const Je=$E(C,L,Ie),xe=Ui(Ie);cSe(Je,xe)},ss=z.exports.useCallback((Oe,Ie,Je)=>{if(Boolean(Ie.hasChildren)&&Je)return!1;const{isRetainedFile:ke}=Ie,{filesPath:et=[],isDisable:Zt=!1}=l;return Zt&&(ke||et.includes(Oe))},[l]),as=(Oe,Ie,Je)=>{const{data:xe}=Je,ke=ss(Ie,Je,!1),et=ue("div",{className:"d42-panel-item",onClick:kt=>{!J.dao.channelAvailable()||(lo(kt,Ie,xe),zi.current[Ie].close())},children:u("file_tree_rename")}),Zt=ue("div",{className:"d42-panel-item delete",onClick:kt=>{!J.dao.channelAvailable()||(ie("DELETE"),os(kt,Oe,Ie),zi.current[Ie].close())},children:u("common_delete")});return Kt("div",{className:"d42-operation-panel",children:[Oe&&!Fe&&Kt(tu,{children:[ue("div",{className:"d42-panel-item",onClick:kt=>{!J.dao.channelAvailable()||(Ls(kt,Ie),zi.current[Ie].close())},children:u("file_tree_create_new_file")}),ue("div",{className:"d42-panel-item",onClick:kt=>{!J.dao.channelAvailable()||(Fo(kt,Ie),zi.current[Ie].close())},children:u("file_tree_create_new_folder")})]}),!Oe&&!Fe&&ue("div",{className:"d42-panel-item",onClick:kt=>{!J.dao.channelAvailable()||(aa(kt,Ie),zi.current[Ie].close())},children:u("file_tree_down_file")}),!ke&&et,!ke&&Zt]})},go=Oe=>Oe.substring(0,Oe.lastIndexOf("/"));z.exports.useEffect(()=>{if(m&&Ue.current){const Oe=Ue.current.value;if(!Oe)return;Oe.lastIndexOf(".")>-1?Ue.current.setSelectionRange(0,Oe.lastIndexOf(".")):Ue.current.setSelectionRange(0,Oe.length)}},[m]);const hr=(Oe,Ie)=>{var Je;switch(Oe.stopPropagation(),Oe.key){case"Enter":{if(Oe.currentTarget.dataset.error==="1")return;if(!Tn.current||Tn.current&&!$||vp(Ie)===$){Pn();return}Ie===Me&&Se.file.setDocLoading(!0),dr(Re[m],$),(Je=zi.current[Ie])==null||Je.close();break}}},Wn=Oe=>{Tn.current=!0;const Ie=Oe.target.value,Je=m.lastIndexOf("/"),xe=Je>-1?m.substring(Je+1):m,ke=Je>-1?m.substring(0,Je+1):"";S(Ie),Be(et=>(et[m]&&!Ze.includes(Ie)&&(et[m].data=et[ke+Ie]?xe:Ie),et))},br=Oe=>{Oe.stopPropagation(),W.current&&Hn()},_i=Oe=>{Oe.stopPropagation(),W.current&&Fn()};z.exports.useEffect(()=>{m||(Tn.current=!1)},[m]);const Vr=()=>{mt.current&&(mt.current.classList.remove("d42-drag-over-node"),mt.current=null)},[Ji,Gr]=z.exports.useState(""),[er,ls]=z.exports.useState(""),[Ms,la]=z.exports.useState(""),Yo=Oe=>{Oe.stopPropagation(),Oe.nativeEvent.stopImmediatePropagation(),Oe.dataTransfer.dropEffect="none",ls(Oe.currentTarget.dataset.path)},hl=Oe=>{if(Fe)return;Oe.stopPropagation(),Oe.nativeEvent.stopImmediatePropagation(),Oe.dataTransfer.items.length||(Oe.dataTransfer.dropEffect="none");const Ie=Oe.currentTarget.dataset,{path:Je,type:xe}=Ie,ke=Oe.currentTarget;let et=null;if(xe==="DIRECTORY")et=ke.firstElementChild,Gr(Je),J.file.expandedFolders().includes(Je)||Se.file.expandedFolders(J.file.expandedFolders().concat([Je]));else{et=ke.parentElement;do{if(!et)break;const kt=et.getAttribute("role");if(kt==="treeitem"||kt==="tree")break}while(et&&(et=et.parentElement));(!g4e(Je,er)||!er)&&Gr(Je.substring(0,Je.lastIndexOf("/")))}et&&et.classList.contains("d42-drag-over-node")||(mt.current&&mt.current.classList.remove("d42-drag-over-node"),et&&et.classList.add("d42-drag-over-node"),mt.current=et)},cs=()=>{Gr(""),ls(""),la("")},Ia=(Oe,Ie)=>{var Vn;Oe.stopPropagation(),Oe.nativeEvent.stopImmediatePropagation();const Je=Oe.currentTarget.dataset,{path:xe,type:ke}=Je,et=y4e(Ms),Zt=J.file.treeData(),kt=((Vn=Zt[Ms])==null?void 0:Vn.type)==="DIRECTORY",tn=et&&!kt?"":Ji;if(Vr(),!xe||!tn&&!et||tn===xe||!tn&&xe.indexOf("/")===-1){cs();return}const un=v4e(tn,vp(Ie));if(Zt[un]){Dt(u("file_tree_x_existed",{x:un})),Ve(!0),cs();return}ee({[un]:!0,[Ie]:!0});const Or={action:"MOVE",destination:un,files:[{type:ke,name:Ie}]};J.dao.channel().operateFileTree(Or),cs()},us=z.exports.useCallback((Oe,Ie)=>{if(!Object.keys(yt).length)return"";const{paths:Je,styles:xe}=yt;for(let ke=0;ke<Je.length;ke++)if(T7e(Oe,Je[ke]))return xe[Ie];return""},[yt]),Ns=z.exports.useMemo(()=>/\s/.test($),[$]),Ds=ut().dao.currentFocusComponent(),za=ut().file.openSearch(),vo=ut().file.editorView(),co=vo==null?void 0:vo.hasFocus;z.exports.useEffect(()=>{const Oe=Ie=>{let Je=Ie.target;const xe=["Tree","Editor","Browser","Console","Terminal"];let ke="";for(;Je&&!xe.includes(ke);)Je=(Je==null?void 0:Je.parentElement)||null,ke=(Je==null?void 0:Je.dataset.component)||"";Se.dao.currentFocusComponent(ke)};return window.addEventListener("click",Oe,!0),()=>{window.removeEventListener("click",Oe,!0)}},[]),z.exports.useEffect(()=>{d(Me)},[Me]),z.exports.useEffect(()=>{const Oe=Ie=>{var Je,xe;switch(Ie.key){case"Enter":{if(h&&!((Je=re.current)!=null&&Je.open)&&!((xe=zi.current[h])!=null&&xe.open)&&!Fe){const ke=Re[h];!ss(h,ke,!1)&&lo(Ie,h,vp(h))}break}}};return Ds==="Tree"&&h&&!za&&!co&&window.addEventListener("keydown",Oe,!1),(Ds!=="Tree"||co)&&window.removeEventListener("keydown",Oe),()=>{window.removeEventListener("keydown",Oe)}},[Ds,h,za,co,Fe,Re,ss,lo]);const jo=Oe=>{var ke;const Ie=/(background=)([^&]+)/,Je=Oe.color.slice(1),xe=(ke=Oe.userInfo.avatarUrl)!=null?ke:"";return xe&&xe.replace(Ie,`$1${Je}`)},uo="rct-tree-item-title-container",Xs="rct-tree-item-li",qi="rct-tree-item-button";return ue(PO,{name:"file",componentType:"Tree",children:Kt(W9e,{id:"d42-fileTree","data-testid":"file-title",ref:w,className:"d42-tree-root-container",treeItemHeight:e,onClick:()=>{J.dao.channel().followingFocusComponent("Tree")},children:[ue("input",{id:"manual-upload-file",ref:H,type:"file",multiple:!0,hidden:!0,onChange:Oe=>{Pr(Oe.target.files),Oe.target.value=""}}),ue("input",{id:"manual-upload-folder",type:"file",multiple:!0,hidden:!0,ref:Oe=>{Oe&&(_e=Oe,Oe.setAttribute("webkitdirectory","true"))},onChange:Oe=>{fr(Oe.target.files),Oe.target.value=""}}),xt?ue("div",{className:"d42-filetree-skeleton",children:ue(P7e,{})}):Kt(tu,{children:[Kt("div",{className:"d42-root-toolbar",children:[ue("strong",{children:"Files"}),Kt("div",{className:"d42-root-toolbar-btns",children:[!_t&&!Fe&&Kt(tu,{children:[ar(u("file_tree_create_new_file"),ue("button",{className:"d42-btn",onClick:br,children:ue("i",{className:"d42 dao42__icon--add-file"})})),ar(u("file_tree_create_new_folder"),ue("button",{className:"d42-btn d42-dir-btn",onClick:_i,children:ue("i",{className:"d42 dao42__icon--add-folder"})}))]}),!Fe&&ar(u("Collapse the file tree"),ue("button",{className:"d42-btn d42-dir-btn",onClick:()=>{Se.file.expandedFolders([])},children:ue("i",{className:"d42 dao42__icon--expand"})})),!_t&&!Fe&&ue(S6,{ref:re,container:w.current,meun:di(),popupAlign:{bottom:3,top:3},children:ue("button",{className:"d42-btn d42-more-btn",children:ue("i",{className:"d42 dao42__icon--more"})})})]})]}),ue("div",{ref:q,className:"file-tree-wrap",children:ue(GK,{canSearch:!1,ref:W,items:Re,onFocusItem:Oe=>{d(Oe.index)},onExpandItem:Oe=>{Ln(Oe.index)},onCollapseItem:Oe=>{sr(Oe.index)},getItemTitle:Oe=>Oe.data,viewState:{["tree-1"]:{focusedItem:h,expandedItems:y,selectedItems:[Me]}},renderItem:Oe=>{const{title:Ie,arrow:Je,depth:xe,children:ke}=Oe,et=Oe.item,Zt=et.canNotExpaned,kt=et.index;if(et.data.startsWith(".")&&!Qe&&m!==kt)return null;const tn=p(et.index),un=Oe.context,Or=xe>0?xe*16+8:8,Vn=sC(et.data),pr=et.hasChildren?ue("div",{...un.arrowProps,className:"d42-folder-wrapper",children:ue("div",{className:zn("d42-folder-icon",us(kt,"icon")),children:ue(o7e,{})})}):null,$i=!Vn&&!et.hasChildren&&!Zt?ue("div",{...un.arrowProps,className:zn("d42-file-icon default",us(kt,"icon")),children:ue(aC,{})}):null,Zo=go(kt),Li=`${Zo}${Zo?"/":""}${$}`,Sn=Uk(Li),x=!Jt.current&&!$,R=(Re[Li]||Sn)&&Tn.current&&vp(m)!==$||!Qe&&$.startsWith(".")||Ns||x,M=!((Re[Li]||Sn)&&Tn.current&&vp(m)!==$)&&!Qe&&$.startsWith("."),Q=et.hasChildren?hn(et.index):et.index;return et.hide&&n==="preview"&&!r?null:ue("div",{id:`${et.index}`,"data-drag":!Zt,onClick:D=>{D.stopPropagation(),D.nativeEvent.stopImmediatePropagation(),J.dao.channel().followingFocusComponent("Tree"),!Zt&&!ae[kt]&&m!==kt&&(A(""),Zn(),v(""),Rn([et.index]),t==null||t([et.index],et.type))},onContextMenu:D=>{var U;D.preventDefault(),D.stopPropagation(),Pn(),Fe||((U=zi.current[kt])==null||U.click(),A(et.index))},draggable:!(Fe||R||m),onDragStart:D=>{Fe||(Zt?(D.preventDefault(),D.stopPropagation(),D.nativeEvent.stopImmediatePropagation()):Yo(D))},onDragEnter:D=>{Fe||(D.stopPropagation(),D.nativeEvent.stopImmediatePropagation(),wt.current=wt.current+1,la(D.currentTarget.dataset.path))},onDragOver:hl,onDragEnd:D=>{Fe||Ia(D,kt)},"data-path":et.index,"data-type":et.hasChildren?"DIRECTORY":"FILE",className:zn("d42-file-tree-item",{"d42-open-feature":j===kt}),onDrop:D=>{_t||D.dataTransfer.items.length&&Br(D,Ji)},children:z.exports.createElement("li",{...un.itemContainerWithChildrenProps,...un.itemContainerWithoutChildrenProps,key:et.index,className:zn(Xs,{[`${Xs}-selected`]:un.isSelected,[`${Xs}-expanded`]:un.isExpanded,[`${Xs}-focused`]:un.isFocused,[`${Xs}-hasChildren`]:ke,"d42-light-selected":m===kt})},ue("div",{className:zn(uo,{[`${uo}-selected`]:un.isSelected,[`${uo}-expanded`]:un.isExpanded,[`${uo}-hasChildren`]:ke,show:un.isFocused||j===et.index}),style:{paddingLeft:Or},children:m===kt?Kt("div",{ref:Pt,className:"d42-create-box",onClick:D=>{D.stopPropagation(),D.preventDefault()},"data-path":kt,children:[ue("input",{"data-error":R&&!M?1:0,className:zn("d42-create-file-folder",{error:R,warn:M}),type:"text",autoFocus:!0,value:$,onClick:D=>D.stopPropagation(),ref:D=>{D==null||D.focus(),Ue.current=D},style:{marginLeft:et.hasChildren?8:0},onInput:Wn,onKeyDown:D=>{hr(D,kt)}}),R&&ue("div",{className:zn("d42-create-box-tip",{warn:M}),style:{marginLeft:et.hasChildren?8:0},children:Sn?u("Unable to create file or directory with system reserved name"):Ns?u("file_tree_space_char_exist_in_file_or_folder"):Re[Li]?u("The file or folder {{path}} already exists in this location, please choose another name",{path:$}):x?u("file_tree_rename_cannot_be_empty"):!Qe&&$.startsWith(".")?u("Create or rename to hidden files, will not be visible"):""})]}):ue(tu,{children:Kt("div",{...un.itemContainerWithoutChildrenProps,...un.interactiveElementProps,className:zn(qi,{[`${qi}-selected`]:un.isSelected,[`${qi}-expanded`]:un.isExpanded,[`${qi}-focused`]:un.isFocused,[`${qi}-hasChildren`]:et.hasChildren,"no-child":!et.hasChildren}),children:[Kt("div",{className:"d42-item-title-wrapper",children:[!et.hasChildren&&Vn&&!Zt&&ue("em",{className:zn("d42-file-icon",Vn||"not-cls",us(kt,"icon"))}),ue("div",{onClick:D=>{D.stopPropagation(),D.preventDefault()},className:zn(us(kt,"arrowIcon")),children:Je}),pr,$i,ue("span",{className:zn("d42-item-title",{"can-not-expanded":Zt},us(kt,"title")),title:et.data,children:Ie})]}),!_t&&!Zt&&Kt("div",{className:"d42-filetree-extra",children:[tn&&m!==kt&&ue("div",{className:"rct-tree-item-avatar-container",style:{marginRight:ae[kt]?10:0},children:tn.map((D,U)=>ue("div",{className:"rct-tree-item-avatar",style:{border:`1px solid ${D.color}`,marginLeft:`-${U*4}px`},children:ue("img",{className:"rct-tree-item-avatar-img",src:jo(D),alt:""})},U))}),!ae[kt]&&ue("div",{className:"d42-actions-container",children:ue(g7e,{treeNode:et,hideFeature:n,hideEditFeature:r,lockFeature:i,lockEditFeature:o,unittestFeature:s,unittestEditFeature:a})}),!ss(kt,et,!0)&&ue(S6,{ref:D=>{D&&(zi.current={...zi.current,[kt]:D})},onClose:()=>A(""),isMask:!1,container:Gt.current||document.body,popupAlign:{bottom:5,top:5},meun:!ae[kt]&&m!==kt&&wn.current===0&&j===et.index&&as(Boolean(et.hasChildren),kt,et),children:!ae[kt]&&!Fe&&ue("button",{className:"d42-expand-panel",onClick:()=>{A(j===et.index?"":et.index)},children:ue("i",{className:"d42 dao42__icon--more"})})})]}),ae[Q]||ae[kt]?ue("div",{className:"d42-upload-loading",children:ue(H3e,{spin:!0})}):null]})})}),Je?y.includes(et.index)&&ke:ke,ae[Q]&&ue("div",{className:"d42-filetree-item-loading"}))},et.index)},children:ue("div",{className:"d42-tree-root",ref:Gt,onDrop:Br,onDragEnter:Ge,onDragOver:ge,onDragEnd:()=>Gr(""),onDragLeaveCapture:gt,"data-path":".",children:ue(nJ,{treeId:"tree-1",ref:Ut,rootItem:je,treeLabel:"File Tree"})})})})]}),ue(PX,{title:Kt("div",{className:"d42-modal-title-content",children:[u("common_delete"),"\xA0",Pe.path.substring(Pe.path.lastIndexOf("/")+1),"\uFF1F"]}),visible:V,onCancel:()=>ne(!1),onOk:()=>{In(Pe.path),ne(!1)},children:ue("div",{children:u("file_tree_make_sure_delete_x_unrecoverable",{x:Pe.isDir?u("common_directory"):u("common_file")})})}),ue(PX,{visible:ot,title:u("file_tree_kind_tips"),showCancelBtn:!1,okText:u("file_tree_understood"),onOk:()=>Ve(!1),children:ue("div",{children:dt})})]})})};var E7e=Object.freeze(Object.defineProperty({__proto__:null,FileTree:Q7e},Symbol.toStringTag,{value:"Module"}));const jJ=1024;let C7e=0;class Dl{constructor(e,n){this.from=e,this.to=n}}class Xn{constructor(e={}){this.id=C7e++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Eo.match(e)),n=>{let r=e(n);return r===void 0?null:[this,r]}}}Xn.closedBy=new Xn({deserialize:t=>t.split(" ")});Xn.openedBy=new Xn({deserialize:t=>t.split(" ")});Xn.group=new Xn({deserialize:t=>t.split(" ")});Xn.contextHash=new Xn({perNode:!0});Xn.lookAhead=new Xn({perNode:!0});Xn.mounted=new Xn({perNode:!0});class R7e{constructor(e,n,r){this.tree=e,this.overlay=n,this.parser=r}}const A7e=Object.create(null);class Eo{constructor(e,n,r,i=0){this.name=e,this.props=n,this.id=r,this.flags=i}static define(e){let n=e.props&&e.props.length?Object.create(null):A7e,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new Eo(e.name||"",n,e.id,r);if(e.props){for(let o of e.props)if(Array.isArray(o)||(o=o(i)),o){if(o[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");n[o[0].id]=o[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let n=this.prop(Xn.group);return n?n.indexOf(e)>-1:!1}return this.id==e}static match(e){let n=Object.create(null);for(let r in e)for(let i of r.split(" "))n[i]=e[r];return r=>{for(let i=r.prop(Xn.group),o=-1;o<(i?i.length:0);o++){let s=n[o<0?r.name:i[o]];if(s)return s}}}}Eo.none=new Eo("",Object.create(null),0,8);class d0{constructor(e){this.types=e;for(let n=0;n<e.length;n++)if(e[n].id!=n)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let n=[];for(let r of this.types){let i=null;for(let o of e){let s=o(r);s&&(i||(i=Object.assign({},r.props)),i[s[0].id]=s[1])}n.push(i?new Eo(r.name,i,r.id,r.flags):r)}return new d0(n)}}const l_=new WeakMap,EX=new WeakMap;var Xi;(function(t){t[t.ExcludeBuffers=1]="ExcludeBuffers",t[t.IncludeAnonymous=2]="IncludeAnonymous",t[t.IgnoreMounts=4]="IgnoreMounts",t[t.IgnoreOverlays=8]="IgnoreOverlays"})(Xi||(Xi={}));class vr{constructor(e,n,r,i,o){if(this.type=e,this.children=n,this.positions=r,this.length=i,this.props=null,o&&o.length){this.props=Object.create(null);for(let[s,a]of o)this.props[typeof s=="number"?s:s.id]=a}}toString(){let e=this.prop(Xn.mounted);if(e&&!e.overlay)return e.tree.toString();let n="";for(let r of this.children){let i=r.toString();i&&(n&&(n+=","),n+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(n.length?"("+n+")":""):n}cursor(e=0){return new fv(this.topNode,e)}cursorAt(e,n=0,r=0){let i=l_.get(this)||this.topNode,o=new fv(i);return o.moveTo(e,n),l_.set(this,o._tree),o}get topNode(){return new Fl(this,0,0,null)}resolve(e,n=0){let r=R1(l_.get(this)||this.topNode,e,n,!1);return l_.set(this,r),r}resolveInner(e,n=0){let r=R1(EX.get(this)||this.topNode,e,n,!0);return EX.set(this,r),r}iterate(e){let{enter:n,leave:r,from:i=0,to:o=this.length}=e;for(let s=this.cursor((e.mode||0)|Xi.IncludeAnonymous);;){let a=!1;if(s.from<=o&&s.to>=i&&(s.type.isAnonymous||n(s)!==!1)){if(s.firstChild())continue;a=!0}for(;a&&r&&!s.type.isAnonymous&&r(s),!s.nextSibling();){if(!s.parent())return;a=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let n in this.props)e.push([+n,this.props[n]]);return e}balance(e={}){return this.children.length<=8?this:fC(Eo.none,this.children,this.positions,0,this.children.length,0,this.length,(n,r,i)=>new vr(this.type,n,r,i,this.propValues),e.makeTree||((n,r,i)=>new vr(Eo.none,n,r,i)))}static build(e){return z7e(e)}}vr.empty=new vr(Eo.none,[],[],0);class cC{constructor(e,n){this.buffer=e,this.index=n}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new cC(this.buffer,this.index)}}class CO{constructor(e,n,r){this.buffer=e,this.length=n,this.set=r}get type(){return Eo.none}toString(){let e=[];for(let n=0;n<this.buffer.length;)e.push(this.childString(n)),n=this.buffer[n+3];return e.join(",")}childString(e){let n=this.buffer[e],r=this.buffer[e+3],i=this.set.types[n],o=i.name;if(/\W/.test(o)&&!i.isError&&(o=JSON.stringify(o)),e+=4,r==e)return o;let s=[];for(;e<r;)s.push(this.childString(e)),e=this.buffer[e+3];return o+"("+s.join(",")+")"}findChild(e,n,r,i,o){let{buffer:s}=this,a=-1;for(let l=e;l!=n&&!(ZJ(o,i,s[l+1],s[l+2])&&(a=l,r>0));l=s[l+3]);return a}slice(e,n,r,i){let o=this.buffer,s=new Uint16Array(n-e);for(let a=e,l=0;a<n;)s[l++]=o[a++],s[l++]=o[a++]-r,s[l++]=o[a++]-r,s[l++]=o[a++]-e;return new CO(s,i-r,this.set)}}function ZJ(t,e,n,r){switch(t){case-2:return n<e;case-1:return r>=e&&n<e;case 0:return n<e&&r>e;case 1:return n<=e&&r>e;case 2:return r>e;case 4:return!0}}function VJ(t,e){let n=t.childBefore(e);for(;n;){let r=n.lastChild;if(!r||r.to!=n.to)break;r.type.isError&&r.from==r.to?(t=n,n=r.prevSibling):n=r}return t}function R1(t,e,n,r){for(var i;t.from==t.to||(n<1?t.from>=e:t.from>e)||(n>-1?t.to<=e:t.to<e);){let s=!r&&t instanceof Fl&&t.index<0?null:t.parent;if(!s)return t;t=s}let o=r?0:Xi.IgnoreOverlays;if(r)for(let s=t,a=s.parent;a;s=a,a=s.parent)s instanceof Fl&&s.index<0&&((i=a.enter(e,n,o))===null||i===void 0?void 0:i.from)!=s.from&&(t=a);for(;;){let s=t.enter(e,n,o);if(!s)return t;t=s}}class Fl{constructor(e,n,r,i){this._tree=e,this.from=n,this.index=r,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,n,r,i,o=0){for(let s=this;;){for(let{children:a,positions:l}=s._tree,c=n>0?a.length:-1;e!=c;e+=n){let u=a[e],f=l[e]+s.from;if(!!ZJ(i,r,f,f+u.length)){if(u instanceof CO){if(o&Xi.ExcludeBuffers)continue;let h=u.findChild(0,u.buffer.length,n,r-f,i);if(h>-1)return new su(new I7e(s,u,e,f),null,h)}else if(o&Xi.IncludeAnonymous||!u.type.isAnonymous||uC(u)){let h;if(!(o&Xi.IgnoreMounts)&&u.props&&(h=u.prop(Xn.mounted))&&!h.overlay)return new Fl(h.tree,f,e,s);let d=new Fl(u,f,e,s);return o&Xi.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(n<0?u.children.length-1:0,n,r,i)}}}if(o&Xi.IncludeAnonymous||!s.type.isAnonymous||(s.index>=0?e=s.index+n:e=n<0?-1:s._parent._tree.children.length,s=s._parent,!s))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,n,r=0){let i;if(!(r&Xi.IgnoreOverlays)&&(i=this._tree.prop(Xn.mounted))&&i.overlay){let o=e-this.from;for(let{from:s,to:a}of i.overlay)if((n>0?s<=o:s<o)&&(n<0?a>=o:a>o))return new Fl(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,n,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}cursor(e=0){return new fv(this,e)}get tree(){return this._tree}toTree(){return this._tree}resolve(e,n=0){return R1(this,e,n,!1)}resolveInner(e,n=0){return R1(this,e,n,!0)}enterUnfinishedNodesBefore(e){return VJ(this,e)}getChild(e,n=null,r=null){let i=$2(this,e,n,r);return i.length?i[0]:null}getChildren(e,n=null,r=null){return $2(this,e,n,r)}toString(){return this._tree.toString()}get node(){return this}matchContext(e){return S2(this,e)}}function $2(t,e,n,r){let i=t.cursor(),o=[];if(!i.firstChild())return o;if(n!=null){for(;!i.type.is(n);)if(!i.nextSibling())return o}for(;;){if(r!=null&&i.type.is(r))return o;if(i.type.is(e)&&o.push(i.node),!i.nextSibling())return r==null?o:[]}}function S2(t,e,n=e.length-1){for(let r=t.parent;n>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[n]&&e[n]!=r.name)return!1;n--}}return!0}class I7e{constructor(e,n,r,i){this.parent=e,this.buffer=n,this.index=r,this.start=i}}class su{constructor(e,n,r){this.context=e,this._parent=n,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}child(e,n,r){let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.context.start,r);return o<0?null:new su(this.context,this,o)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,n,r=0){if(r&Xi.ExcludeBuffers)return null;let{buffer:i}=this.context,o=i.findChild(this.index+4,i.buffer[this.index+3],n>0?1:-1,e-this.context.start,n);return o<0?null:new su(this.context,this,o)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,n=e.buffer[this.index+3];return n<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new su(this.context,this._parent,n):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,n=this._parent?this._parent.index+4:0;return this.index==n?this.externalSibling(-1):new su(this.context,this._parent,e.findChild(n,this.index,-1,0,4))}cursor(e=0){return new fv(this,e)}get tree(){return null}toTree(){let e=[],n=[],{buffer:r}=this.context,i=this.index+4,o=r.buffer[this.index+3];if(o>i){let s=r.buffer[this.index+1],a=r.buffer[this.index+2];e.push(r.slice(i,o,s,a)),n.push(0)}return new vr(this.type,e,n,this.to-this.from)}resolve(e,n=0){return R1(this,e,n,!1)}resolveInner(e,n=0){return R1(this,e,n,!0)}enterUnfinishedNodesBefore(e){return VJ(this,e)}toString(){return this.context.buffer.childString(this.index)}getChild(e,n=null,r=null){let i=$2(this,e,n,r);return i.length?i[0]:null}getChildren(e,n=null,r=null){return $2(this,e,n,r)}get node(){return this}matchContext(e){return S2(this,e)}}class fv{constructor(e,n=0){if(this.mode=n,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof Fl)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}get name(){return this.type.name}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,n){this.index=e;let{start:r,buffer:i}=this.buffer;return this.type=n||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof Fl?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,n,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,n,r,this.mode));let{buffer:i}=this.buffer,o=i.findChild(this.index+4,i.buffer[this.index+3],e,n-this.buffer.start,r);return o<0?!1:(this.stack.push(this.index),this.yieldBuf(o))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,n,r=this.mode){return this.buffer?r&Xi.ExcludeBuffers?!1:this.enterChild(1,e,n):this.yield(this._tree.enter(e,n,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Xi.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Xi.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:n}=this.buffer,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(n.findChild(i,this.index,-1,0,4))}else{let i=n.buffer[this.index+3];if(i<(r<0?n.buffer.length:n.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let n,r,{buffer:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let o=0;o<this.index;o++)if(i.buffer.buffer[o+3]<this.index)return!1;({index:n,parent:r}=i)}else({index:n,_parent:r}=this._tree);for(;r;{index:n,_parent:r}=r)if(n>-1)for(let o=n+e,s=e<0?-1:r._tree.children.length;o!=s;o+=e){let a=r._tree.children[o];if(this.mode&Xi.IncludeAnonymous||a instanceof CO||!a.type.isAnonymous||uC(a))return!1}return!0}move(e,n){if(n&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,n=0){for(;(this.from==this.to||(n<1?this.from>=e:this.from>e)||(n>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,n););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,n=null,r=0;if(e&&e.context==this.buffer){e:for(let i=this.index,o=this.stack.length;o>=0;){for(let s=e;s;s=s._parent)if(s.index==i){if(i==this.index)return s;n=s,r=o+1;break e}i=this.stack[--o]}}for(let i=r;i<this.stack.length;i++)n=new su(this.buffer,n,this.stack[i]);return this.bufferNode=new su(this.buffer,n,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,n){for(let r=0;;){let i=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(i=!0)}for(;i&&n&&n(this),i=this.type.isAnonymous,!this.nextSibling();){if(!r)return;this.parent(),r--,i=!0}}}matchContext(e){if(!this.buffer)return S2(this.node,e);let{buffer:n}=this.buffer,{types:r}=n.set;for(let i=e.length-1,o=this.stack.length-1;i>=0;o--){if(o<0)return S2(this.node,e,i);let s=r[n.buffer[this.stack[o]]];if(!s.isAnonymous){if(e[i]&&e[i]!=s.name)return!1;i--}}return!0}}function uC(t){return t.children.some(e=>e instanceof CO||!e.type.isAnonymous||uC(e))}function z7e(t){var e;let{buffer:n,nodeSet:r,maxBufferLength:i=jJ,reused:o=[],minRepeatType:s=r.types.length}=t,a=Array.isArray(n)?new cC(n,n.length):n,l=r.types,c=0,u=0;function f($,S,w,k,I){let{id:L,start:C,end:T,size:E}=a,N=u;for(;E<0;)if(a.next(),E==-1){let q=o[L];w.push(q),k.push(C-$);return}else if(E==-3){c=L;return}else if(E==-4){u=L;return}else throw new RangeError(`Unrecognized record size: ${E}`);let G=l[L],j,A,W=C-$;if(T-C<=i&&(A=b(a.pos-S,I))){let q=new Uint16Array(A.size-A.skip),K=a.pos-A.size,ie=q.length;for(;a.pos>K;)ie=y(A.start,q,ie);j=new CO(q,T-A.start,r),W=A.start-$}else{let q=a.pos-E;a.next();let K=[],ie=[],V=L>=s?L:-1,ne=0,Pe=T;for(;a.pos>q;)V>=0&&a.id==V&&a.size>=0?(a.end<=Pe-i&&(d(K,ie,C,ne,a.end,Pe,V,N),ne=K.length,Pe=a.end),a.next()):f(C,q,K,ie,V);if(V>=0&&ne>0&&ne<K.length&&d(K,ie,C,ne,C,Pe,V,N),K.reverse(),ie.reverse(),V>-1&&ne>0){let Ee=h(G);j=fC(G,K,ie,0,K.length,0,T-C,Ee,Ee)}else j=p(G,K,ie,T-C,N-T)}w.push(j),k.push(W)}function h($){return(S,w,k)=>{let I=0,L=S.length-1,C,T;if(L>=0&&(C=S[L])instanceof vr){if(!L&&C.type==$&&C.length==k)return C;(T=C.prop(Xn.lookAhead))&&(I=w[L]+C.length+T)}return p($,S,w,k,I)}}function d($,S,w,k,I,L,C,T){let E=[],N=[];for(;$.length>k;)E.push($.pop()),N.push(S.pop()+w-I);$.push(p(r.types[C],E,N,L-I,T-L)),S.push(I-w)}function p($,S,w,k,I=0,L){if(c){let C=[Xn.contextHash,c];L=L?[C].concat(L):[C]}if(I>25){let C=[Xn.lookAhead,I];L=L?[C].concat(L):[C]}return new vr($,S,w,k,L)}function b($,S){let w=a.fork(),k=0,I=0,L=0,C=w.end-i,T={size:0,start:0,skip:0};e:for(let E=w.pos-$;w.pos>E;){let N=w.size;if(w.id==S&&N>=0){T.size=k,T.start=I,T.skip=L,L+=4,k+=4,w.next();continue}let G=w.pos-N;if(N<0||G<E||w.start<C)break;let j=w.id>=s?4:0,A=w.start;for(w.next();w.pos>G;){if(w.size<0)if(w.size==-3)j+=4;else break e;else w.id>=s&&(j+=4);w.next()}I=A,k+=N,L+=j}return(S<0||k==$)&&(T.size=k,T.start=I,T.skip=L),T.size>4?T:void 0}function y($,S,w){let{id:k,start:I,end:L,size:C}=a;if(a.next(),C>=0&&k<s){let T=w;if(C>4){let E=a.pos-(C-4);for(;a.pos>E;)w=y($,S,w)}S[--w]=T,S[--w]=L-$,S[--w]=I-$,S[--w]=k}else C==-3?c=k:C==-4&&(u=k);return w}let O=[],m=[];for(;a.pos>0;)f(t.start||0,t.bufferStart||0,O,m,-1);let v=(e=t.length)!==null&&e!==void 0?e:O.length?m[0]+O[0].length:0;return new vr(l[t.topID],O.reverse(),m.reverse(),v)}const CX=new WeakMap;function B$(t,e){if(!t.isAnonymous||e instanceof CO||e.type!=t)return 1;let n=CX.get(e);if(n==null){n=1;for(let r of e.children){if(r.type!=t||!(r instanceof vr)){n=1;break}n+=B$(t,r)}CX.set(e,n)}return n}function fC(t,e,n,r,i,o,s,a,l){let c=0;for(let p=r;p<i;p++)c+=B$(t,e[p]);let u=Math.ceil(c*1.5/8),f=[],h=[];function d(p,b,y,O,m){for(let v=y;v<O;){let $=v,S=b[v],w=B$(t,p[v]);for(v++;v<O;v++){let k=B$(t,p[v]);if(w+k>=u)break;w+=k}if(v==$+1){if(w>u){let k=p[$];d(k.children,k.positions,0,k.children.length,b[$]+m);continue}f.push(p[$])}else{let k=b[v-1]+p[v-1].length-S;f.push(fC(t,p,b,$,v,S,k,null,l))}h.push(S+m-o)}}return d(e,n,r,i,0),(a||l)(f,h,s)}class L7e{constructor(){this.map=new WeakMap}setBuffer(e,n,r){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(n,r)}getBuffer(e,n){let r=this.map.get(e);return r&&r.get(n)}set(e,n){e instanceof su?this.setBuffer(e.context.buffer,e.index,n):e instanceof Fl&&this.map.set(e.tree,n)}get(e){return e instanceof su?this.getBuffer(e.context.buffer,e.index):e instanceof Fl?this.map.get(e.tree):void 0}cursorSet(e,n){e.buffer?this.setBuffer(e.buffer.buffer,e.index,n):this.map.set(e.tree,n)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class vf{constructor(e,n,r,i,o=!1,s=!1){this.from=e,this.to=n,this.tree=r,this.offset=i,this.open=(o?1:0)|(s?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,n=[],r=!1){let i=[new vf(0,e.length,e,0,!1,r)];for(let o of n)o.to>e.length&&i.push(o);return i}static applyChanges(e,n,r=128){if(!n.length)return e;let i=[],o=1,s=e.length?e[0]:null;for(let a=0,l=0,c=0;;a++){let u=a<n.length?n[a]:null,f=u?u.fromA:1e9;if(f-l>=r)for(;s&&s.from<f;){let h=s;if(l>=h.from||f<=h.to||c){let d=Math.max(h.from,l)-c,p=Math.min(h.to,f)-c;h=d>=p?null:new vf(d,p,h.tree,h.offset+c,a>0,!!u)}if(h&&i.push(h),s.to>f)break;s=o<e.length?e[o++]:null}if(!u)break;l=u.toA,c=u.toA-u.toB}return i}}class E4{startParse(e,n,r){return typeof e=="string"&&(e=new M7e(e)),r=r?r.length?r.map(i=>new Dl(i.from,i.to)):[new Dl(0,0)]:[new Dl(0,e.length)],this.createParse(e,n||[],r)}parse(e,n,r){let i=this.startParse(e,n,r);for(;;){let o=i.advance();if(o)return o}}}class M7e{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,n){return this.string.slice(e,n)}}function dC(t){return(e,n,r,i)=>new D7e(e,t,n,r,i)}class RX{constructor(e,n,r,i,o){this.parser=e,this.parse=n,this.overlay=r,this.target=i,this.ranges=o}}class N7e{constructor(e,n,r,i,o,s,a){this.parser=e,this.predicate=n,this.mounts=r,this.index=i,this.start=o,this.target=s,this.prev=a,this.depth=0,this.ranges=[]}}const w6=new Xn({perNode:!0});class D7e{constructor(e,n,r,i,o){this.nest=n,this.input=r,this.fragments=i,this.ranges=o,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let r=this.baseParse.advance();if(!r)return null;if(this.baseParse=null,this.baseTree=r,this.startInner(),this.stoppedAt!=null)for(let i of this.inner)i.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let r=this.baseTree;return this.stoppedAt!=null&&(r=new vr(r.type,r.children,r.positions,r.length,r.propValues.concat([[w6,this.stoppedAt]]))),r}let e=this.inner[this.innerDone],n=e.parse.advance();if(n){this.innerDone++;let r=Object.assign(Object.create(null),e.target.props);r[Xn.mounted.id]=new R7e(n,e.overlay,e.parser),e.target.props=r}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let n=this.innerDone;n<this.inner.length;n++)this.inner[n].ranges[0].from<e&&(e=Math.min(e,this.inner[n].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let n=this.innerDone;n<this.inner.length;n++)this.inner[n].parse.stopAt(e)}startInner(){let e=new U7e(this.fragments),n=null,r=null,i=new fv(new Fl(this.baseTree,this.ranges[0].from,0,null),Xi.IncludeAnonymous|Xi.IgnoreMounts);e:for(let o,s;this.stoppedAt==null||i.from<this.stoppedAt;){let a=!0,l;if(e.hasNode(i)){if(n){let c=n.mounts.find(u=>u.frag.from<=i.from&&u.frag.to>=i.to&&u.mount.overlay);if(c)for(let u of c.mount.overlay){let f=u.from+c.pos,h=u.to+c.pos;f>=i.from&&h<=i.to&&!n.ranges.some(d=>d.from<h&&d.to>f)&&n.ranges.push({from:f,to:h})}}a=!1}else if(r&&(s=X7e(r.ranges,i.from,i.to)))a=s!=2;else if(!i.type.isAnonymous&&i.from<i.to&&(o=this.nest(i,this.input))){i.tree||W7e(i);let c=e.findMounts(i.from,o.parser);if(typeof o.overlay=="function")n=new N7e(o.parser,o.overlay,c,this.inner.length,i.from,i.tree,n);else{let u=zX(this.ranges,o.overlay||[new Dl(i.from,i.to)]);u.length&&this.inner.push(new RX(o.parser,o.parser.startParse(this.input,LX(c,u),u),o.overlay?o.overlay.map(f=>new Dl(f.from-i.from,f.to-i.from)):null,i.tree,u)),o.overlay?u.length&&(r={ranges:u,depth:0,prev:r}):a=!1}}else n&&(l=n.predicate(i))&&(l===!0&&(l=new Dl(i.from,i.to)),l.from<l.to&&n.ranges.push(l));if(a&&i.firstChild())n&&n.depth++,r&&r.depth++;else for(;!i.nextSibling();){if(!i.parent())break e;if(n&&!--n.depth){let c=zX(this.ranges,n.ranges);c.length&&this.inner.splice(n.index,0,new RX(n.parser,n.parser.startParse(this.input,LX(n.mounts,c),c),n.ranges.map(u=>new Dl(u.from-n.start,u.to-n.start)),n.target,c)),n=n.prev}r&&!--r.depth&&(r=r.prev)}}}}function X7e(t,e,n){for(let r of t){if(r.from>=n)break;if(r.to>e)return r.from<=e&&r.to>=n?2:1}return 0}function AX(t,e,n,r,i,o){if(e<n){let s=t.buffer[e+1],a=t.buffer[n-2];r.push(t.slice(e,n,s,a)),i.push(s-o)}}function W7e(t){let{node:e}=t,n=0;do t.parent(),n++;while(!t.tree);let r=0,i=t.tree,o=0;for(;o=i.positions[r]+t.from,!(o<=e.from&&o+i.children[r].length>=e.to);r++);let s=i.children[r],a=s.buffer;function l(c,u,f,h,d){let p=c;for(;a[p+2]+o<=e.from;)p=a[p+3];let b=[],y=[];AX(s,c,p,b,y,h);let O=a[p+1],m=a[p+2],v=O+o==e.from&&m+o==e.to&&a[p]==e.type.id;return b.push(v?e.toTree():l(p+4,a[p+3],s.set.types[a[p]],O,m-O)),y.push(O-h),AX(s,a[p+3],u,b,y,h),new vr(f,b,y,d)}i.children[r]=l(0,a.length,Eo.none,0,s.length);for(let c=0;c<=n;c++)t.childAfter(e.from)}class IX{constructor(e,n){this.offset=n,this.done=!1,this.cursor=e.cursor(Xi.IncludeAnonymous|Xi.IgnoreMounts)}moveTo(e){let{cursor:n}=this,r=e-this.offset;for(;!this.done&&n.from<r;)n.to>=e&&n.enter(r,1,Xi.IgnoreOverlays|Xi.ExcludeBuffers)||n.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let n=this.cursor.tree;;){if(n==e.tree)return!0;if(n.children.length&&n.positions[0]==0&&n.children[0]instanceof vr)n=n.children[0];else break}return!1}}class U7e{constructor(e){var n;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let r=this.curFrag=e[0];this.curTo=(n=r.tree.prop(w6))!==null&&n!==void 0?n:r.to,this.inner=new IX(r.tree,-r.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let n=this.curFrag=this.fragments[this.fragI];this.curTo=(e=n.tree.prop(w6))!==null&&e!==void 0?e:n.to,this.inner=new IX(n.tree,-n.offset)}}findMounts(e,n){var r;let i=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let o=this.inner.cursor.node;o;o=o.parent){let s=(r=o.tree)===null||r===void 0?void 0:r.prop(Xn.mounted);if(s&&s.parser==n)for(let a=this.fragI;a<this.fragments.length;a++){let l=this.fragments[a];if(l.from>=o.to)break;l.tree==this.curFrag.tree&&i.push({frag:l,pos:o.from-l.offset,mount:s})}}}return i}}function zX(t,e){let n=null,r=e;for(let i=1,o=0;i<t.length;i++){let s=t[i-1].to,a=t[i].from;for(;o<r.length;o++){let l=r[o];if(l.from>=a)break;l.to<=s||(n||(r=n=e.slice()),l.from<s?(n[o]=new Dl(l.from,s),l.to>a&&n.splice(o+1,0,new Dl(a,l.to))):l.to>a?n[o--]=new Dl(a,l.to):n.splice(o--,1))}}return r}function q7e(t,e,n,r){let i=0,o=0,s=!1,a=!1,l=-1e9,c=[];for(;;){let u=i==t.length?1e9:s?t[i].to:t[i].from,f=o==e.length?1e9:a?e[o].to:e[o].from;if(s!=a){let h=Math.max(l,n),d=Math.min(u,f,r);h<d&&c.push(new Dl(h,d))}if(l=Math.min(u,f),l==1e9)break;u==l&&(s?(s=!1,i++):s=!0),f==l&&(a?(a=!1,o++):a=!0)}return c}function LX(t,e){let n=[];for(let{pos:r,mount:i,frag:o}of t){let s=r+(i.overlay?i.overlay[0].from:0),a=s+i.tree.length,l=Math.max(o.from,s),c=Math.min(o.to,a);if(i.overlay){let u=i.overlay.map(h=>new Dl(h.from+r,h.to+r)),f=q7e(e,u,l,c);for(let h=0,d=l;;h++){let p=h==f.length,b=p?c:f[h].from;if(b>d&&n.push(new vf(d,b,i.tree,-s,o.from>=d,o.to<=b)),p)break;d=f[h].to}}else n.push(new vf(l,c,i.tree,-s,o.from>=s,o.to<=a))}return n}let B7e=0;class xc{constructor(e,n,r){this.set=e,this.base=n,this.modified=r,this.id=B7e++}static define(e){if(e!=null&&e.base)throw new Error("Can not derive from a modified tag");let n=new xc([],null,[]);if(n.set.push(n),e)for(let r of e.set)n.set.push(r);return n}static defineModifier(){let e=new x2;return n=>n.modified.indexOf(e)>-1?n:x2.get(n.base||n,n.modified.concat(e).sort((r,i)=>r.id-i.id))}}let F7e=0;class x2{constructor(){this.instances=[],this.id=F7e++}static get(e,n){if(!n.length)return e;let r=n[0].instances.find(a=>a.base==e&&Y7e(n,a.modified));if(r)return r;let i=[],o=new xc(i,e,n);for(let a of n)a.instances.push(o);let s=GJ(n);for(let a of e.set)for(let l of s)i.push(x2.get(a,l));return o}}function Y7e(t,e){return t.length==e.length&&t.every((n,r)=>n==e[r])}function GJ(t){let e=[t];for(let n=0;n<t.length;n++)for(let r of GJ(t.slice(0,n).concat(t.slice(n+1))))e.push(r);return e}function Ra(t){let e=Object.create(null);for(let n in t){let r=t[n];Array.isArray(r)||(r=[r]);for(let i of n.split(" "))if(i){let o=[],s=2,a=i;for(let f=0;;){if(a=="..."&&f>0&&f+3==i.length){s=1;break}let h=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!h)throw new RangeError("Invalid path: "+i);if(o.push(h[0]=="*"?"":h[0][0]=='"'?JSON.parse(h[0]):h[0]),f+=h[0].length,f==i.length)break;let d=i[f++];if(f==i.length&&d=="!"){s=0;break}if(d!="/")throw new RangeError("Invalid path: "+i);a=i.slice(f)}let l=o.length-1,c=o[l];if(!c)throw new RangeError("Invalid path: "+i);let u=new j7e(r,s,l>0?o.slice(0,l):null);e[c]=u.sort(e[c])}}return HJ.add(e)}const HJ=new Xn;class j7e{constructor(e,n,r,i){this.tags=e,this.mode=n,this.context=r,this.next=i}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}function KJ(t,e){let n=Object.create(null);for(let o of t)if(!Array.isArray(o.tag))n[o.tag.id]=o.class;else for(let s of o.tag)n[s.id]=o.class;let{scope:r,all:i=null}=e||{};return{style:o=>{let s=i;for(let a of o)for(let l of a.set){let c=n[l.id];if(c){s=s?s+" "+c:c;break}}return s},scope:r}}function Z7e(t,e){let n=null;for(let r of t){let i=r.style(e);i&&(n=n?n+" "+i:i)}return n}function V7e(t,e,n,r=0,i=t.length){let o=new G7e(r,Array.isArray(e)?e:[e],n);o.highlightRange(t.cursor(),r,i,"",o.highlighters),o.flush(i)}class G7e{constructor(e,n,r){this.at=e,this.highlighters=n,this.span=r,this.class=""}startSpan(e,n){n!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=n)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,n,r,i,o){let{type:s,from:a,to:l}=e;if(a>=r||l<=n)return;s.isTop&&(o=this.highlighters.filter(d=>!d.scope||d.scope(s)));let c=i,u=s.prop(HJ),f=!1;for(;u;){if(!u.context||e.matchContext(u.context)){let d=Z7e(o,u.tags);d&&(c&&(c+=" "),c+=d,u.mode==1?i+=(i?" ":"")+d:u.mode==0&&(f=!0));break}u=u.next}if(this.startSpan(e.from,c),f)return;let h=e.tree&&e.tree.prop(Xn.mounted);if(h&&h.overlay){let d=e.node.enter(h.overlay[0].from+a,1),p=this.highlighters.filter(y=>!y.scope||y.scope(h.tree.type)),b=e.firstChild();for(let y=0,O=a;;y++){let m=y<h.overlay.length?h.overlay[y]:null,v=m?m.from+a:l,$=Math.max(n,O),S=Math.min(r,v);if($<S&&b)for(;e.from<S&&(this.highlightRange(e,$,S,i,o),this.startSpan(Math.min(r,e.to),c),!(e.to>=v||!e.nextSibling())););if(!m||v>r)break;O=m.to+a,O>n&&(this.highlightRange(d.cursor(),Math.max(n,m.from+a),Math.min(r,O),i,p),this.startSpan(O,c))}b&&e.parent()}else if(e.firstChild()){do if(!(e.to<=n)){if(e.from>=r)break;this.highlightRange(e,n,r,i,o),this.startSpan(Math.min(r,e.to),c)}while(e.nextSibling());e.parent()}}}const It=xc.define,c_=It(),cd=It(),MX=It(cd),NX=It(cd),ud=It(),u_=It(ud),dT=It(ud),Zc=It(),wh=It(Zc),Bc=It(),Fc=It(),k6=It(),im=It(k6),f_=It(),Z={comment:c_,lineComment:It(c_),blockComment:It(c_),docComment:It(c_),name:cd,variableName:It(cd),typeName:MX,tagName:It(MX),propertyName:NX,attributeName:It(NX),className:It(cd),labelName:It(cd),namespace:It(cd),macroName:It(cd),literal:ud,string:u_,docString:It(u_),character:It(u_),attributeValue:It(u_),number:dT,integer:It(dT),float:It(dT),bool:It(ud),regexp:It(ud),escape:It(ud),color:It(ud),url:It(ud),keyword:Bc,self:It(Bc),null:It(Bc),atom:It(Bc),unit:It(Bc),modifier:It(Bc),operatorKeyword:It(Bc),controlKeyword:It(Bc),definitionKeyword:It(Bc),moduleKeyword:It(Bc),operator:Fc,derefOperator:It(Fc),arithmeticOperator:It(Fc),logicOperator:It(Fc),bitwiseOperator:It(Fc),compareOperator:It(Fc),updateOperator:It(Fc),definitionOperator:It(Fc),typeOperator:It(Fc),controlOperator:It(Fc),punctuation:k6,separator:It(k6),bracket:im,angleBracket:It(im),squareBracket:It(im),paren:It(im),brace:It(im),content:Zc,heading:wh,heading1:It(wh),heading2:It(wh),heading3:It(wh),heading4:It(wh),heading5:It(wh),heading6:It(wh),contentSeparator:It(Zc),list:It(Zc),quote:It(Zc),emphasis:It(Zc),strong:It(Zc),link:It(Zc),monospace:It(Zc),strikethrough:It(Zc),inserted:It(),deleted:It(),changed:It(),invalid:It(),meta:f_,documentMeta:It(f_),annotation:It(f_),processingInstruction:It(f_),definition:xc.defineModifier(),constant:xc.defineModifier(),function:xc.defineModifier(),standard:xc.defineModifier(),local:xc.defineModifier(),special:xc.defineModifier()};KJ([{tag:Z.link,class:"tok-link"},{tag:Z.heading,class:"tok-heading"},{tag:Z.emphasis,class:"tok-emphasis"},{tag:Z.strong,class:"tok-strong"},{tag:Z.keyword,class:"tok-keyword"},{tag:Z.atom,class:"tok-atom"},{tag:Z.bool,class:"tok-bool"},{tag:Z.url,class:"tok-url"},{tag:Z.labelName,class:"tok-labelName"},{tag:Z.inserted,class:"tok-inserted"},{tag:Z.deleted,class:"tok-deleted"},{tag:Z.literal,class:"tok-literal"},{tag:Z.string,class:"tok-string"},{tag:Z.number,class:"tok-number"},{tag:[Z.regexp,Z.escape,Z.special(Z.string)],class:"tok-string2"},{tag:Z.variableName,class:"tok-variableName"},{tag:Z.local(Z.variableName),class:"tok-variableName tok-local"},{tag:Z.definition(Z.variableName),class:"tok-variableName tok-definition"},{tag:Z.special(Z.variableName),class:"tok-variableName2"},{tag:Z.definition(Z.propertyName),class:"tok-propertyName tok-definition"},{tag:Z.typeName,class:"tok-typeName"},{tag:Z.namespace,class:"tok-namespace"},{tag:Z.className,class:"tok-className"},{tag:Z.macroName,class:"tok-macroName"},{tag:Z.propertyName,class:"tok-propertyName"},{tag:Z.operator,class:"tok-operator"},{tag:Z.comment,class:"tok-comment"},{tag:Z.meta,class:"tok-meta"},{tag:Z.invalid,class:"tok-invalid"},{tag:Z.punctuation,class:"tok-punctuation"}]);var hT;const vO=new Xn;function hC(t){return Ft.define({combine:t?e=>e.concat(t):void 0})}class $a{constructor(e,n,r=[],i=""){this.data=e,this.name=i,rr.prototype.hasOwnProperty("tree")||Object.defineProperty(rr.prototype,"tree",{get(){return oi(this)}}),this.parser=n,this.extension=[Gd.of(this),rr.languageData.of((o,s,a)=>o.facet(DX(o,s,a)))].concat(r)}isActiveAt(e,n,r=-1){return DX(e,n,r)==this.data}findRegions(e){let n=e.facet(Gd);if((n==null?void 0:n.data)==this.data)return[{from:0,to:e.doc.length}];if(!n||!n.allowsNesting)return[];let r=[],i=(o,s)=>{if(o.prop(vO)==this.data){r.push({from:s,to:s+o.length});return}let a=o.prop(Xn.mounted);if(a){if(a.tree.prop(vO)==this.data){if(a.overlay)for(let l of a.overlay)r.push({from:l.from+s,to:l.to+s});else r.push({from:s,to:s+o.length});return}else if(a.overlay){let l=r.length;if(i(a.tree,a.overlay[0].from+s),r.length>l)return}}for(let l=0;l<o.children.length;l++){let c=o.children[l];c instanceof vr&&i(c,o.positions[l]+s)}};return i(oi(e),0),r}get allowsNesting(){return!0}}$a.setState=fn.define();function DX(t,e,n){let r=t.facet(Gd);if(!r)return null;let i=r.data;if(r.allowsNesting)for(let o=oi(t).topNode;o;o=o.enter(e,n,Xi.ExcludeBuffers))i=o.type.prop(vO)||i;return i}class Qa extends $a{constructor(e,n,r){super(e,n,[],r),this.parser=n}static define(e){let n=hC(e.languageData);return new Qa(n,e.parser.configure({props:[vO.add(r=>r.isTop?n:void 0)]}),e.name)}configure(e,n){return new Qa(this.data,this.parser.configure(e),n||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function oi(t){let e=t.field($a.state,!1);return e?e.tree:vr.empty}function H7e(t,e,n=50){var r;let i=(r=t.field($a.state,!1))===null||r===void 0?void 0:r.context;if(!i)return null;let o=i.viewport;i.updateViewport({from:0,to:e});let s=i.isDone(e)||i.work(n,e)?i.tree:null;return i.updateViewport(o),s}class K7e{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,n){let r=this.cursorPos-this.string.length;return e<r||n>=this.cursorPos?this.doc.sliceString(e,n):this.string.slice(e-r,n-r)}}let om=null;class yO{constructor(e,n,r=[],i,o,s,a,l){this.parser=e,this.state=n,this.fragments=r,this.tree=i,this.treeLen=o,this.viewport=s,this.skipped=a,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,n,r){return new yO(e,n,[],vr.empty,0,r,[],null)}startParse(){return this.parser.startParse(new K7e(this.state.doc),this.fragments)}work(e,n){return n!=null&&n>=this.state.doc.length&&(n=void 0),this.tree!=vr.empty&&this.isDone(n!=null?n:this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),n!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>n)&&n<this.state.doc.length&&this.parse.stopAt(n);;){let i=this.parse.advance();if(i)if(this.fragments=this.withoutTempSkipped(vf.addTree(i,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=i,this.parse=null,this.treeLen<(n!=null?n:this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,n;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(n=this.parse.advance()););}),this.treeLen=e,this.tree=n,this.fragments=this.withoutTempSkipped(vf.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let n=om;om=this;try{return e()}finally{om=n}}withoutTempSkipped(e){for(let n;n=this.tempSkipped.pop();)e=XX(e,n.from,n.to);return e}changes(e,n){let{fragments:r,tree:i,treeLen:o,viewport:s,skipped:a}=this;if(this.takeTree(),!e.empty){let l=[];if(e.iterChangedRanges((c,u,f,h)=>l.push({fromA:c,toA:u,fromB:f,toB:h})),r=vf.applyChanges(r,l),i=vr.empty,o=0,s={from:e.mapPos(s.from,-1),to:e.mapPos(s.to,1)},this.skipped.length){a=[];for(let c of this.skipped){let u=e.mapPos(c.from,1),f=e.mapPos(c.to,-1);u<f&&a.push({from:u,to:f})}}}return new yO(this.parser,n,r,i,o,s,a,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let n=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:i,to:o}=this.skipped[r];i<e.to&&o>e.from&&(this.fragments=XX(this.fragments,i,o),this.skipped.splice(r--,1))}return this.skipped.length>=n?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,n){this.skipped.push({from:e,to:n})}static getSkippingParser(e){return new class extends E4{createParse(n,r,i){let o=i[0].from,s=i[i.length-1].to;return{parsedPos:o,advance(){let l=om;if(l){for(let c of i)l.tempSkipped.push(c);e&&(l.scheduleOn=l.scheduleOn?Promise.all([l.scheduleOn,e]):e)}return this.parsedPos=s,new vr(Eo.none,[],[],s-o)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let n=this.fragments;return this.treeLen>=e&&n.length&&n[0].from==0&&n[0].to>=e}static get(){return om}}function XX(t,e,n){return vf.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class A1{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let n=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),n.viewport.to);return n.work(20,r)||n.takeTree(),new A1(n)}static init(e){let n=Math.min(3e3,e.doc.length),r=yO.create(e.facet(Gd).parser,e,{from:0,to:n});return r.work(20,n)||r.takeTree(),new A1(r)}}$a.state=fi.define({create:A1.init,update(t,e){for(let n of e.effects)if(n.is($a.setState))return n.value;return e.startState.facet(Gd)!=e.state.facet(Gd)?A1.init(e.state):t.apply(e)}});let JJ=t=>{let e=setTimeout(()=>t(),500);return()=>clearTimeout(e)};typeof requestIdleCallback!="undefined"&&(JJ=t=>{let e=-1,n=setTimeout(()=>{e=requestIdleCallback(t,{timeout:500-100})},100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)});const OT=typeof navigator!="undefined"&&((hT=navigator.scheduling)===null||hT===void 0?void 0:hT.isInputPending)?()=>navigator.scheduling.isInputPending():null,J7e=qr.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let n=this.view.state.field($a.state).context;(n.updateViewport(e.view.viewport)||this.view.viewport.to>n.treeLen)&&this.scheduleWork(),e.docChanged&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(n)}scheduleWork(){if(this.working)return;let{state:e}=this.view,n=e.field($a.state);(n.tree!=n.context.tree||!n.context.isDone(e.doc.length))&&(this.working=JJ(this.work))}work(e){this.working=null;let n=Date.now();if(this.chunkEnd<n&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=n+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:i}}=this.view,o=r.field($a.state);if(o.tree==o.context.tree&&o.context.isDone(i+1e5))return;let s=Date.now()+Math.min(this.chunkBudget,100,e&&!OT?Math.max(25,e.timeRemaining()-5):1e9),a=o.context.treeLen<i&&r.doc.length>i+1e3,l=o.context.work(()=>OT&&OT()||Date.now()>s,i+(a?0:1e5));this.chunkBudget-=Date.now()-n,(l||this.chunkBudget<=0)&&(o.context.takeTree(),this.view.dispatch({effects:$a.setState.of(new A1(o.context))})),this.chunkBudget>0&&!(l&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(o.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(n=>Ja(this.view.state,n)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Gd=Ft.define({combine(t){return t.length?t[0]:null},enables:t=>[$a.state,J7e,ht.contentAttributes.compute([t],e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}})]});class il{constructor(e,n=[]){this.language=e,this.support=n,this.extension=[e,n]}}class w2{constructor(e,n,r,i,o,s=void 0){this.name=e,this.alias=n,this.extensions=r,this.filename=i,this.loadFunc=o,this.support=s,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:n,support:r}=e;if(!n){if(!r)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");n=()=>Promise.resolve(r)}return new w2(e.name,(e.alias||[]).concat(e.name).map(i=>i.toLowerCase()),e.extensions||[],e.filename,n,r)}static matchFilename(e,n){for(let i of e)if(i.filename&&i.filename.test(n))return i;let r=/\.([^.]+)$/.exec(n);if(r){for(let i of e)if(i.extensions.indexOf(r[1])>-1)return i}return null}static matchLanguageName(e,n,r=!0){n=n.toLowerCase();for(let i of e)if(i.alias.some(o=>o==n))return i;if(r)for(let i of e)for(let o of i.alias){let s=n.indexOf(o);if(s>-1&&(o.length>2||!/\w/.test(n[s-1])&&!/\w/.test(n[s+o.length])))return i}return null}}const eee=Ft.define(),Pf=Ft.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some(n=>n!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function Hd(t){let e=t.facet(Pf);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function I1(t,e){let n="",r=t.tabSize,i=t.facet(Pf)[0];if(i==" "){for(;e>=r;)n+=" ",e-=r;i=" "}for(let o=0;o<e;o++)n+=i;return n}function uy(t,e){t instanceof rr&&(t=new fy(t));for(let r of t.state.facet(eee)){let i=r(t,e);if(i!==void 0)return i}let n=oi(t.state);return n?eEe(t,n,e):null}function T6(t,e,n){let r=Object.create(null),i=new fy(t,{overrideIndentation:s=>{var a;return(a=r[s])!==null&&a!==void 0?a:-1}}),o=[];for(let s=e;s<=n;){let a=t.doc.lineAt(s);s=a.to+1;let l=uy(i,a.from);if(l==null)continue;/\S/.test(a.text)||(l=0);let c=/^\s*/.exec(a.text)[0],u=I1(t,l);c!=u&&(r[a.from]=l,o.push({from:a.from,to:a.from+c.length,insert:u}))}return t.changes(o)}class fy{constructor(e,n={}){this.state=e,this.options=n,this.unit=Hd(e)}lineAt(e,n=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:o}=this.options;return i!=null&&i>=r.from&&i<=r.to?o&&i==e?{text:"",from:e}:(n<0?i<e:i<=e)?{text:r.text.slice(i-r.from),from:i}:{text:r.text.slice(0,i-r.from),from:r.from}:r}textAfterPos(e,n=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:r,from:i}=this.lineAt(e,n);return r.slice(e-i,Math.min(r.length,e+100-i))}column(e,n=1){let{text:r,from:i}=this.lineAt(e,n),o=this.countColumn(r,e-i),s=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return s>-1&&(o+=s-this.countColumn(r,r.search(/\S|$/))),o}countColumn(e,n=e.length){return ry(e,this.state.tabSize,n)}lineIndent(e,n=1){let{text:r,from:i}=this.lineAt(e,n),o=this.options.overrideIndentation;if(o){let s=o(i);if(s>-1)return s}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const ll=new Xn;function eEe(t,e,n){return tee(e.resolveInner(n).enterUnfinishedNodesBefore(n),n,t)}function tEe(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function nEe(t){let e=t.type.prop(ll);if(e)return e;let n=t.firstChild,r;if(n&&(r=n.type.prop(Xn.closedBy))){let i=t.lastChild,o=i&&r.indexOf(i.name)>-1;return s=>nee(s,!0,1,void 0,o&&!tEe(s)?i.from:void 0)}return t.parent==null?rEe:null}function tee(t,e,n){for(;t;t=t.parent){let r=nEe(t);if(r)return r(OC.create(n,e,t))}return null}function rEe(){return 0}class OC extends fy{constructor(e,n,r){super(e.state,e.options),this.base=e,this.pos=n,this.node=r}static create(e,n,r){return new OC(e,n,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){let e=this.state.doc.lineAt(this.node.from);for(;;){let n=this.node.resolve(e.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(iEe(n,this.node))break;e=this.state.doc.lineAt(n.from)}return this.lineIndent(e.from)}continue(){let e=this.node.parent;return e?tee(e,this.pos,this.base):0}}function iEe(t,e){for(let n=e;n;n=n.parent)if(t==n)return!0;return!1}function oEe(t){let e=t.node,n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let i=t.options.simulateBreak,o=t.state.doc.lineAt(n.from),s=i==null||i<=o.from?o.to:Math.min(o.to,i);for(let a=n.to;;){let l=e.childAfter(a);if(!l||l==r)return null;if(!l.type.isSkipped)return l.from<s?n:null;a=l.to}}function oO({closing:t,align:e=!0,units:n=1}){return r=>nee(r,e,n,t)}function nee(t,e,n,r,i){let o=t.textAfter,s=o.match(/^\s*/)[0].length,a=r&&o.slice(s,s+r.length)==r||i==t.pos+s,l=e?oEe(t):null;return l?a?t.column(l.from):t.column(l.to):t.baseIndent+(a?0:t.unit*n)}const pC=t=>t.baseIndent;function ns({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}const sEe=200;function ree(){return rr.transactionFilter.of(t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let n=t.newDoc,{head:r}=t.newSelection.main,i=n.lineAt(r);if(r>i.from+sEe)return t;let o=n.sliceString(i.from,r);if(!e.some(c=>c.test(o)))return t;let{state:s}=t,a=-1,l=[];for(let{head:c}of s.selection.ranges){let u=s.doc.lineAt(c);if(u.from==a)continue;a=u.from;let f=uy(s,u.from);if(f==null)continue;let h=/^\s*/.exec(u.text)[0],d=I1(s,f);h!=d&&l.push({from:u.from,to:u.from+h.length,insert:d})}return l.length?[t,{changes:l,sequential:!0}]:t})}const aEe=Ft.define(),cl=new Xn;function uh(t){let e=t.firstChild,n=t.lastChild;return e&&e.to<n.from?{from:e.to,to:n.type.isError?t.to:n.from}:null}function lEe(t,e,n){let r=oi(t);if(r.length<n)return null;let i=r.resolveInner(n,1),o=null;for(let s=i;s;s=s.parent){if(s.to<=n||s.from>n)continue;if(o&&s.from<e)break;let a=s.type.prop(cl);if(a&&(s.to<r.length-50||r.length==t.doc.length||!cEe(s))){let l=a(s,t);l&&l.from<=n&&l.from>=e&&l.to>n&&(o=l)}}return o}function cEe(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function k2(t,e,n){for(let r of t.facet(aEe)){let i=r(t,e,n);if(i)return i}return lEe(t,e,n)}function iee(t,e){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);return n>=r?void 0:{from:n,to:r}}const C4=fn.define({map:iee}),dy=fn.define({map:iee});function oee(t){let e=[];for(let{head:n}of t.state.selection.ranges)e.some(r=>r.from<=n&&r.to>=n)||e.push(t.lineBlockAt(n));return e}const bO=fi.define({create(){return zt.none},update(t,e){t=t.map(e.changes);for(let n of e.effects)n.is(C4)&&!uEe(t,n.value.from,n.value.to)?t=t.update({add:[WX.range(n.value.from,n.value.to)]}):n.is(dy)&&(t=t.update({filter:(r,i)=>n.value.from!=r||n.value.to!=i,filterFrom:n.value.from,filterTo:n.value.to}));if(e.selection){let n=!1,{head:r}=e.selection.main;t.between(r,r,(i,o)=>{i<r&&o>r&&(n=!0)}),n&&(t=t.update({filterFrom:r,filterTo:r,filter:(i,o)=>o<=r||i>=r}))}return t},provide:t=>ht.decorations.from(t),toJSON(t,e){let n=[];return t.between(0,e.doc.length,(r,i)=>{n.push(r,i)}),n},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let n=0;n<t.length;){let r=t[n++],i=t[n++];if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid JSON for fold state");e.push(WX.range(r,i))}return zt.set(e,!0)}});function T2(t,e,n){var r;let i=null;return(r=t.field(bO,!1))===null||r===void 0||r.between(e,n,(o,s)=>{(!i||i.from>o)&&(i={from:o,to:s})}),i}function uEe(t,e,n){let r=!1;return t.between(e,e,(i,o)=>{i==e&&o==n&&(r=!0)}),r}function see(t,e){return t.field(bO,!1)?e:e.concat(fn.appendConfig.of(hee()))}const aee=t=>{for(let e of oee(t)){let n=k2(t.state,e.from,e.to);if(n)return t.dispatch({effects:see(t.state,[C4.of(n),lee(t,n)])}),!0}return!1},fEe=t=>{if(!t.state.field(bO,!1))return!1;let e=[];for(let n of oee(t)){let r=T2(t.state,n.from,n.to);r&&e.push(dy.of(r),lee(t,r,!1))}return e.length&&t.dispatch({effects:e}),e.length>0};function lee(t,e,n=!0){let r=t.state.doc.lineAt(e.from).number,i=t.state.doc.lineAt(e.to).number;return ht.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${t.state.phrase("to")} ${i}.`)}const cee=t=>{let{state:e}=t,n=[];for(let r=0;r<e.doc.length;){let i=t.lineBlockAt(r),o=k2(e,i.from,i.to);o&&n.push(C4.of(o)),r=(o?t.lineBlockAt(o.to):i).to+1}return n.length&&t.dispatch({effects:see(t.state,n)}),!!n.length},uee=t=>{let e=t.state.field(bO,!1);if(!e||!e.size)return!1;let n=[];return e.between(0,t.state.doc.length,(r,i)=>{n.push(dy.of({from:r,to:i}))}),t.dispatch({effects:n}),!0},fee=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:aee},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:fEe},{key:"Ctrl-Alt-[",run:cee},{key:"Ctrl-Alt-]",run:uee}],dEe={placeholderDOM:null,placeholderText:"\u2026"},dee=Ft.define({combine(t){return Kl(t,dEe)}});function hee(t){let e=[bO,OEe];return t&&e.push(dee.of(t)),e}const WX=zt.replace({widget:new class extends Ic{toDOM(t){let{state:e}=t,n=e.facet(dee),r=o=>{let s=t.lineBlockAt(t.posAtDOM(o.target)),a=T2(t.state,s.from,s.to);a&&t.dispatch({effects:dy.of(a)}),o.preventDefault()};if(n.placeholderDOM)return n.placeholderDOM(t,r);let i=document.createElement("span");return i.textContent=n.placeholderText,i.setAttribute("aria-label",e.phrase("folded code")),i.title=e.phrase("unfold"),i.className="cm-foldPlaceholder",i.onclick=r,i}}}),hEe={openText:"\u2304",closedText:"\u203A",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class pT extends Rc{constructor(e,n){super(),this.config=e,this.open=n}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let n=document.createElement("span");return n.textContent=this.open?this.config.openText:this.config.closedText,n.title=e.state.phrase(this.open?"Fold line":"Unfold line"),n}}function Oee(t={}){let e=Object.assign(Object.assign({},hEe),t),n=new pT(e,!0),r=new pT(e,!1),i=qr.fromClass(class{constructor(s){this.from=s.viewport.from,this.markers=this.buildMarkers(s)}update(s){(s.docChanged||s.viewportChanged||s.startState.facet(Gd)!=s.state.facet(Gd)||s.startState.field(bO,!1)!=s.state.field(bO,!1)||oi(s.startState)!=oi(s.state)||e.foldingChanged(s))&&(this.markers=this.buildMarkers(s.view))}buildMarkers(s){let a=new $u;for(let l of s.viewportLineBlocks){let c=T2(s.state,l.from,l.to)?r:k2(s.state,l.from,l.to)?n:null;c&&a.add(l.from,l.from,c)}return a.finish()}}),{domEventHandlers:o}=e;return[i,RK({class:"cm-foldGutter",markers(s){var a;return((a=s.plugin(i))===null||a===void 0?void 0:a.markers)||Ir.empty},initialSpacer(){return new pT(e,!1)},domEventHandlers:Object.assign(Object.assign({},o),{click:(s,a,l)=>{if(o.click&&o.click(s,a,l))return!0;let c=T2(s.state,a.from,a.to);if(c)return s.dispatch({effects:dy.of(c)}),!0;let u=k2(s.state,a.from,a.to);return u?(s.dispatch({effects:C4.of(u)}),!0):!1}})}),hee()]}const OEe=ht.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class hy{constructor(e,n){this.specs=e;let r;function i(a){let l=Yd.newName();return(r||(r=Object.create(null)))["."+l]=a,l}const o=typeof n.all=="string"?n.all:n.all?i(n.all):void 0,s=n.scope;this.scope=s instanceof $a?a=>a.prop(vO)==s.data:s?a=>a==s:void 0,this.style=KJ(e.map(a=>({tag:a.tag,class:a.class||i(Object.assign({},a,{tag:null}))})),{all:o}).style,this.module=r?new Yd(r):null,this.themeType=n.themeType}static define(e,n){return new hy(e,n||{})}}const P6=Ft.define(),pee=Ft.define({combine(t){return t.length?[t[0]]:null}});function mT(t){let e=t.facet(P6);return e.length?e:t.facet(pee)}function R4(t,e){let n=[mEe],r;return t instanceof hy&&(t.module&&n.push(ht.styleModule.of(t.module)),r=t.themeType),e!=null&&e.fallback?n.push(pee.of(t)):r?n.push(P6.computeN([ht.darkTheme],i=>i.facet(ht.darkTheme)==(r=="dark")?[t]:[])):n.push(P6.of(t)),n}class pEe{constructor(e){this.markCache=Object.create(null),this.tree=oi(e.state),this.decorations=this.buildDeco(e,mT(e.state))}update(e){let n=oi(e.state),r=mT(e.state),i=r!=mT(e.startState);n.length<e.view.viewport.to&&!i&&n.type==this.tree.type?this.decorations=this.decorations.map(e.changes):(n!=this.tree||e.viewportChanged||i)&&(this.tree=n,this.decorations=this.buildDeco(e.view,r))}buildDeco(e,n){if(!n||!this.tree.length)return zt.none;let r=new $u;for(let{from:i,to:o}of e.visibleRanges)V7e(this.tree,n,(s,a,l)=>{r.add(s,a,this.markCache[l]||(this.markCache[l]=zt.mark({class:l})))},i,o);return r.finish()}}const mEe=xu.high(qr.fromClass(pEe,{decorations:t=>t.decorations})),mC=hy.define([{tag:Z.meta,color:"#404740"},{tag:Z.link,textDecoration:"underline"},{tag:Z.heading,textDecoration:"underline",fontWeight:"bold"},{tag:Z.emphasis,fontStyle:"italic"},{tag:Z.strong,fontWeight:"bold"},{tag:Z.strikethrough,textDecoration:"line-through"},{tag:Z.keyword,color:"#708"},{tag:[Z.atom,Z.bool,Z.url,Z.contentSeparator,Z.labelName],color:"#219"},{tag:[Z.literal,Z.inserted],color:"#164"},{tag:[Z.string,Z.deleted],color:"#a11"},{tag:[Z.regexp,Z.escape,Z.special(Z.string)],color:"#e40"},{tag:Z.definition(Z.variableName),color:"#00f"},{tag:Z.local(Z.variableName),color:"#30a"},{tag:[Z.typeName,Z.namespace],color:"#085"},{tag:Z.className,color:"#167"},{tag:[Z.special(Z.variableName),Z.macroName],color:"#256"},{tag:Z.definition(Z.propertyName),color:"#00c"},{tag:Z.comment,color:"#940"},{tag:Z.invalid,color:"#f00"}]),gEe=ht.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),mee=1e4,gee="()[]{}",vee=Ft.define({combine(t){return Kl(t,{afterCursor:!0,brackets:gee,maxScanDistance:mee,renderMatch:bEe})}}),vEe=zt.mark({class:"cm-matchingBracket"}),yEe=zt.mark({class:"cm-nonmatchingBracket"});function bEe(t){let e=[],n=t.matched?vEe:yEe;return e.push(n.range(t.start.from,t.start.to)),t.end&&e.push(n.range(t.end.from,t.end.to)),e}const _Ee=fi.define({create(){return zt.none},update(t,e){if(!e.docChanged&&!e.selection)return t;let n=[],r=e.state.facet(vee);for(let i of e.state.selection.ranges){if(!i.empty)continue;let o=Vs(e.state,i.head,-1,r)||i.head>0&&Vs(e.state,i.head-1,1,r)||r.afterCursor&&(Vs(e.state,i.head,1,r)||i.head<e.state.doc.length&&Vs(e.state,i.head+1,-1,r));o&&(n=n.concat(r.renderMatch(o,e.state)))}return zt.set(n,!0)},provide:t=>ht.decorations.from(t)}),$Ee=[_Ee,gEe];function yee(t={}){return[vee.of(t),$Ee]}const SEe=new Xn;function Q6(t,e,n){let r=t.prop(e<0?Xn.openedBy:Xn.closedBy);if(r)return r;if(t.name.length==1){let i=n.indexOf(t.name);if(i>-1&&i%2==(e<0?1:0))return[n[i+e]]}return null}function E6(t){let e=t.type.prop(SEe);return e?e(t.node):t}function Vs(t,e,n,r={}){let i=r.maxScanDistance||mee,o=r.brackets||gee,s=oi(t),a=s.resolveInner(e,n);for(let l=a;l;l=l.parent){let c=Q6(l.type,n,o);if(c&&l.from<l.to){let u=E6(l);if(u&&(n>0?e>=u.from&&e<u.to:e>u.from&&e<=u.to))return xEe(t,e,n,l,u,c,o)}}return wEe(t,e,n,s,a.type,i,o)}function xEe(t,e,n,r,i,o,s){let a=r.parent,l={from:i.from,to:i.to},c=0,u=a==null?void 0:a.cursor();if(u&&(n<0?u.childBefore(r.from):u.childAfter(r.to)))do if(n<0?u.to<=r.from:u.from>=r.to){if(c==0&&o.indexOf(u.type.name)>-1&&u.from<u.to){let f=E6(u);return{start:l,end:f?{from:f.from,to:f.to}:void 0,matched:!0}}else if(Q6(u.type,n,s))c++;else if(Q6(u.type,-n,s)){if(c==0){let f=E6(u);return{start:l,end:f&&f.from<f.to?{from:f.from,to:f.to}:void 0,matched:!1}}c--}}while(n<0?u.prevSibling():u.nextSibling());return{start:l,matched:!1}}function wEe(t,e,n,r,i,o,s){let a=n<0?t.sliceDoc(e-1,e):t.sliceDoc(e,e+1),l=s.indexOf(a);if(l<0||l%2==0!=n>0)return null;let c={from:n<0?e-1:e,to:n>0?e+1:e},u=t.doc.iterRange(e,n>0?t.doc.length:0),f=0;for(let h=0;!u.next().done&&h<=o;){let d=u.value;n<0&&(h+=d.length);let p=e+h*n;for(let b=n>0?0:d.length-1,y=n>0?d.length:-1;b!=y;b+=n){let O=s.indexOf(d[b]);if(!(O<0||r.resolveInner(p+b,1).type!=i))if(O%2==0==n>0)f++;else{if(f==1)return{start:c,end:{from:p+b,to:p+b+1},matched:O>>1==l>>1};f--}}n>0&&(h+=d.length)}return u.done?{start:c,matched:!1}:null}function UX(t,e,n,r=0,i=0){e==null&&(e=t.search(/[^\s\u00a0]/),e==-1&&(e=t.length));let o=i;for(let s=r;s<e;s++)t.charCodeAt(s)==9?o+=n-o%n:o++;return o}class gC{constructor(e,n,r,i){this.string=e,this.tabSize=n,this.indentUnit=r,this.overrideIndent=i,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(e){let n=this.string.charAt(this.pos),r;if(typeof e=="string"?r=n==e:r=n&&(e instanceof RegExp?e.test(n):e(n)),r)return++this.pos,n}eatWhile(e){let n=this.pos;for(;this.eat(e););return this.pos>n}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let n=this.string.indexOf(e,this.pos);if(n>-1)return this.pos=n,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=UX(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){var e;return(e=this.overrideIndent)!==null&&e!==void 0?e:UX(this.string,null,this.tabSize)}match(e,n,r){if(typeof e=="string"){let i=s=>r?s.toLowerCase():s,o=this.string.substr(this.pos,e.length);return i(o)==i(e)?(n!==!1&&(this.pos+=e.length),!0):null}else{let i=this.string.slice(this.pos).match(e);return i&&i.index>0?null:(i&&n!==!1&&(this.pos+=i[0].length),i)}}current(){return this.string.slice(this.start,this.pos)}}function kEe(t){return{name:t.name||"",token:t.token,blankLine:t.blankLine||(()=>{}),startState:t.startState||(()=>!0),copyState:t.copyState||TEe,indent:t.indent||(()=>null),languageData:t.languageData||{},tokenTable:t.tokenTable||yC}}function TEe(t){if(typeof t!="object")return t;let e={};for(let n in t){let r=t[n];e[n]=r instanceof Array?r.slice():r}return e}const qX=new WeakMap;class li extends $a{constructor(e){let n=hC(e.languageData),r=kEe(e),i,o=new class extends E4{createParse(s,a,l){return new QEe(i,s,a,l)}};super(n,o,[eee.of((s,a)=>this.getIndent(s,a))],e.name),this.topNode=REe(n),i=this,this.streamParser=r,this.stateAfter=new Xn({perNode:!0}),this.tokenTable=e.tokenTable?new See(r.tokenTable):CEe}static define(e){return new li(e)}getIndent(e,n){let r=oi(e.state),i=r.resolve(n);for(;i&&i.type!=this.topNode;)i=i.parent;if(!i)return null;let o,{overrideIndentation:s}=e.options;s&&(o=qX.get(e.state),o!=null&&o<n-1e4&&(o=void 0));let a=vC(this,r,0,i.from,o!=null?o:n),l,c;if(a?(c=a.state,l=a.pos+1):(c=this.streamParser.startState(e.unit),l=0),n-l>1e4)return null;for(;l<n;){let f=e.state.doc.lineAt(l),h=Math.min(n,f.to);if(f.length){let d=s?s(f.from):-1,p=new gC(f.text,e.state.tabSize,e.unit,d<0?void 0:d);for(;p.pos<h-f.from;)_ee(this.streamParser.token,p,c)}else this.streamParser.blankLine(c,e.unit);if(h==n)break;l=f.to+1}let u=e.lineAt(n);return s&&o==null&&qX.set(e.state,u.from),this.streamParser.indent(c,/^\s*(.*)/.exec(u.text)[1],e)}get allowsNesting(){return!1}}function vC(t,e,n,r,i){let o=n>=r&&n+e.length<=i&&e.prop(t.stateAfter);if(o)return{state:t.streamParser.copyState(o),pos:n+e.length};for(let s=e.children.length-1;s>=0;s--){let a=e.children[s],l=n+e.positions[s],c=a instanceof vr&&l<i&&vC(t,a,l,r,i);if(c)return c}return null}function bee(t,e,n,r,i){if(i&&n<=0&&r>=e.length)return e;!i&&e.type==t.topNode&&(i=!0);for(let o=e.children.length-1;o>=0;o--){let s=e.positions[o],a=e.children[o],l;if(s<r&&a instanceof vr){if(!(l=bee(t,a,n-s,r-s,i)))break;return i?new vr(e.type,e.children.slice(0,o).concat(l),e.positions.slice(0,o+1),s+l.length):l}}return null}function PEe(t,e,n,r){for(let i of e){let o=i.from+(i.openStart?25:0),s=i.to-(i.openEnd?25:0),a=o<=n&&s>n&&vC(t,i.tree,0-i.offset,n,s),l;if(a&&(l=bee(t,i.tree,n+i.offset,a.pos+i.offset,!1)))return{state:a.state,tree:l}}return{state:t.streamParser.startState(r?Hd(r):4),tree:vr.empty}}class QEe{constructor(e,n,r,i){this.lang=e,this.input=n,this.fragments=r,this.ranges=i,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=i[i.length-1].to;let o=yO.get(),s=i[0].from,{state:a,tree:l}=PEe(e,r,s,o==null?void 0:o.state);this.state=a,this.parsedPos=this.chunkStart=s+l.length;for(let c=0;c<l.children.length;c++)this.chunks.push(l.children[c]),this.chunkPos.push(l.positions[c]);o&&this.parsedPos<o.viewport.from-1e5&&(this.state=this.lang.streamParser.startState(Hd(o.state)),o.skipUntilInView(this.parsedPos,o.viewport.from),this.parsedPos=o.viewport.from),this.moveRangeIndex()}advance(){let e=yO.get(),n=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),r=Math.min(n,this.chunkStart+2048);for(e&&(r=Math.min(r,e.viewport.to));this.parsedPos<r;)this.parseLine(e);return this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=n?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,n),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let n=this.input.chunk(e);if(this.input.lineChunks)n==`
|
|
1025
1025
|
`&&(n="");else{let r=n.indexOf(`
|
|
1026
1026
|
`);r>-1&&(n=n.slice(0,r))}return e+n.length<=this.to?n:n.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,n=this.lineAfter(e),r=e+n.length;for(let i=this.rangeIndex;;){let o=this.ranges[i].to;if(o>=r||(n=n.slice(0,o-(r-n.length)),i++,i==this.ranges.length))break;let s=this.ranges[i].from,a=this.lineAfter(s);n+=a,r=s+a.length}return{line:n,end:r}}skipGapsTo(e,n,r){for(;;){let i=this.ranges[this.rangeIndex].to,o=e+n;if(r>0?i>o:i>=o)break;n+=this.ranges[++this.rangeIndex].from-i}return n}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,n,r,i,o){if(this.ranges.length>1){o=this.skipGapsTo(n,o,1),n+=o;let s=this.chunk.length;o=this.skipGapsTo(r,o,-1),r+=o,i+=this.chunk.length-s}return this.chunk.push(e,n,r,i),o}parseLine(e){let{line:n,end:r}=this.nextLine(),i=0,{streamParser:o}=this.lang,s=new gC(n,e?e.state.tabSize:4,e?Hd(e.state):2);if(s.eol())o.blankLine(this.state,s.indentUnit);else for(;!s.eol();){let a=_ee(o.token,s,this.state);if(a&&(i=this.emitToken(this.lang.tokenTable.resolve(a),this.parsedPos+s.start,this.parsedPos+s.pos,4,i)),s.start>1e4)break}this.parsedPos=r,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=vr.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:EEe,topID:0,maxBufferLength:2048,reused:this.chunkReused});e=new vr(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new vr(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function _ee(t,e,n){e.start=e.pos;for(let r=0;r<10;r++){let i=t(e,n);if(e.pos>e.start)return i}throw new Error("Stream parser failed to advance stream.")}const yC=Object.create(null),dv=[Eo.none],EEe=new d0(dv),BX=[],$ee=Object.create(null);for(let[t,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])$ee[t]=xee(yC,e);class See{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),$ee)}resolve(e){return e?this.table[e]||(this.table[e]=xee(this.extra,e)):0}}const CEe=new See(yC);function gT(t,e){BX.indexOf(t)>-1||(BX.push(t),console.warn(e))}function xee(t,e){let n=null;for(let o of e.split(".")){let s=t[o]||Z[o];s?typeof s=="function"?n?n=s(n):gT(o,`Modifier ${o} used at start of tag`):n?gT(o,`Tag ${o} used as modifier`):n=s:gT(o,`Unknown highlighting tag ${o}`)}if(!n)return 0;let r=e.replace(/ /g,"_"),i=Eo.define({id:dv.length,name:r,props:[Ra({[r]:n})]});return dv.push(i),i.id}function REe(t){let e=Eo.define({id:dv.length,name:"Document",props:[vO.add(()=>t)]});return dv.push(e),e}class wee{constructor(e,n,r){this.state=e,this.pos=n,this.explicit=r,this.abortListeners=[]}tokenBefore(e){let n=oi(this.state).resolveInner(this.pos,-1);for(;n&&e.indexOf(n.name)<0;)n=n.parent;return n?{from:n.from,to:this.pos,text:this.state.sliceDoc(n.from,this.pos),type:n.type}:null}matchBefore(e){let n=this.state.doc.lineAt(this.pos),r=Math.max(n.from,this.pos-250),i=n.text.slice(r-n.from,this.pos-n.from),o=i.search(Tee(e,!1));return o<0?null:{from:r+o,to:this.pos,text:i.slice(o)}}get aborted(){return this.abortListeners==null}addEventListener(e,n){e=="abort"&&this.abortListeners&&this.abortListeners.push(n)}}function FX(t){let e=Object.keys(t).join(""),n=/\w/.test(e);return n&&(e=e.replace(/\w/g,"")),`[${n?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function AEe(t){let e=Object.create(null),n=Object.create(null);for(let{label:i}of t){e[i[0]]=!0;for(let o=1;o<i.length;o++)n[i[o]]=!0}let r=FX(e)+FX(n)+"*$";return[new RegExp("^"+r),new RegExp(r)]}function bC(t){let e=t.map(i=>typeof i=="string"?{label:i}:i),[n,r]=e.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:AEe(e);return i=>{let o=i.matchBefore(r);return o||i.explicit?{from:o?o.from:i.pos,options:e,validFor:n}:null}}function kee(t,e){return n=>{for(let r=oi(n.state).resolveInner(n.pos,-1);r;r=r.parent)if(t.indexOf(r.name)>-1)return null;return e(n)}}class YX{constructor(e,n,r){this.completion=e,this.source=n,this.match=r}}function Dd(t){return t.selection.main.head}function Tee(t,e){var n;let{source:r}=t,i=e&&r[0]!="^",o=r[r.length-1]!="$";return!i&&!o?t:new RegExp(`${i?"^":""}(?:${r})${o?"$":""}`,(n=t.flags)!==null&&n!==void 0?n:t.ignoreCase?"i":"")}function hv(t,e,n,r){return Object.assign(Object.assign({},t.changeByRange(i=>{if(i==t.selection.main)return{changes:{from:n,to:r,insert:e},range:Ne.cursor(n+e.length)};let o=r-n;return!i.empty||o&&t.sliceDoc(i.from-o,i.from)!=t.sliceDoc(n,r)?{range:i}:{changes:{from:i.from-o,to:i.from,insert:e},range:Ne.cursor(i.from-o+e.length)}})),{userEvent:"input.complete"})}function Pee(t,e){const n=e.completion.apply||e.completion.label;let r=e.source;typeof n=="string"?t.dispatch(hv(t.state,n,r.from,r.to)):n(t,e.completion,r.from,r.to)}const jX=new WeakMap;function IEe(t){if(!Array.isArray(t))return t;let e=jX.get(t);return e||jX.set(t,e=bC(t)),e}class zEe{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[];for(let n=0;n<e.length;){let r=gs(e,n),i=ja(r);this.chars.push(r);let o=e.slice(n,n+i),s=o.toUpperCase();this.folded.push(gs(s==o?o.toLowerCase():s,0)),n+=i}this.astral=e.length!=this.chars.length}match(e){if(this.pattern.length==0)return[0];if(e.length<this.pattern.length)return null;let{chars:n,folded:r,any:i,precise:o,byWord:s}=this;if(n.length==1){let m=gs(e,0);return m==n[0]?[0,0,ja(m)]:m==r[0]?[-200,0,ja(m)]:null}let a=e.indexOf(this.pattern);if(a==0)return[0,0,this.pattern.length];let l=n.length,c=0;if(a<0){for(let m=0,v=Math.min(e.length,200);m<v&&c<l;){let $=gs(e,m);($==n[c]||$==r[c])&&(i[c++]=m),m+=ja($)}if(c<l)return null}let u=0,f=0,h=!1,d=0,p=-1,b=-1,y=/[a-z]/.test(e),O=!0;for(let m=0,v=Math.min(e.length,200),$=0;m<v&&f<l;){let S=gs(e,m);a<0&&(u<l&&S==n[u]&&(o[u++]=m),d<l&&(S==n[d]||S==r[d]?(d==0&&(p=m),b=m+1,d++):d=0));let w,k=S<255?S>=48&&S<=57||S>=97&&S<=122?2:S>=65&&S<=90?1:0:(w=CE(S))!=w.toLowerCase()?1:w!=w.toUpperCase()?2:0;(!m||k==1&&y||$==0&&k!=0)&&(n[f]==S||r[f]==S&&(h=!0)?s[f++]=m:s.length&&(O=!1)),$=k,m+=ja(S)}return f==l&&s[0]==0&&O?this.result(-100+(h?-200:0),s,e):d==l&&p==0?[-200-e.length,0,b]:a>-1?[-700-e.length,a,a+this.pattern.length]:d==l?[-200+-700-e.length,p,b]:f==l?this.result(-100+(h?-200:0)+-700+(O?0:-1100),s,e):n.length==2?null:this.result((i[0]?-700:0)+-200+-1100,i,e)}result(e,n,r){let i=[e-r.length],o=1;for(let s of n){let a=s+(this.astral?ja(gs(r,s)):1);o>1&&i[o-1]==s?i[o-1]=a:(i[o++]=s,i[o++]=a)}return i}}const Kd=Ft.define({combine(t){return Kl(t,{activateOnTyping:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[]},{defaultKeymap:(e,n)=>e&&n,closeOnBlur:(e,n)=>e&&n,icons:(e,n)=>e&&n,optionClass:(e,n)=>r=>LEe(e(r),n(r)),addToOptions:(e,n)=>e.concat(n)})}});function LEe(t,e){return t?e?t+" "+e:t:e}function MEe(t){let e=t.addToOptions.slice();return t.icons&&e.push({render(n){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),n.type&&r.classList.add(...n.type.split(/\s+/g).map(i=>"cm-completionIcon-"+i)),r.setAttribute("aria-hidden","true"),r},position:20}),e.push({render(n,r,i){let o=document.createElement("span");o.className="cm-completionLabel";let{label:s}=n,a=0;for(let l=1;l<i.length;){let c=i[l++],u=i[l++];c>a&&o.appendChild(document.createTextNode(s.slice(a,c)));let f=o.appendChild(document.createElement("span"));f.appendChild(document.createTextNode(s.slice(c,u))),f.className="cm-completionMatchedText",a=u}return a<s.length&&o.appendChild(document.createTextNode(s.slice(a))),o},position:50},{render(n){if(!n.detail)return null;let r=document.createElement("span");return r.className="cm-completionDetail",r.textContent=n.detail,r},position:80}),e.sort((n,r)=>n.position-r.position).map(n=>n.render)}function ZX(t,e,n){if(t<=n)return{from:0,to:t};if(e<=t>>1){let i=Math.floor(e/n);return{from:i*n,to:(i+1)*n}}let r=Math.floor((t-e)/n);return{from:t-(r+1)*n,to:t-r*n}}class NEe{constructor(e,n){this.view=e,this.stateField=n,this.info=null,this.placeInfo={read:()=>this.measureInfo(),write:a=>this.positionInfo(a),key:this};let r=e.state.field(n),{options:i,selected:o}=r.open,s=e.state.facet(Kd);this.optionContent=MEe(s),this.optionClass=s.optionClass,this.range=ZX(i.length,o,s.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.dom.addEventListener("mousedown",a=>{for(let l=a.target,c;l&&l!=this.dom;l=l.parentNode)if(l.nodeName=="LI"&&(c=/-(\d+)$/.exec(l.id))&&+c[1]<i.length){Pee(e,i[+c[1]]),a.preventDefault();return}}),this.list=this.dom.appendChild(this.createListBox(i,r.id,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfo)})}mount(){this.updateSel()}update(e){e.state.field(this.stateField)!=e.startState.field(this.stateField)&&this.updateSel()}positioned(){this.info&&this.view.requestMeasure(this.placeInfo)}updateSel(){let e=this.view.state.field(this.stateField),n=e.open;if((n.selected<this.range.from||n.selected>=this.range.to)&&(this.range=ZX(n.options.length,n.selected,this.view.state.facet(Kd).maxRenderedOptions),this.list.remove(),this.list=this.dom.appendChild(this.createListBox(n.options,e.id,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfo)})),this.updateSelectedOption(n.selected)){this.info&&(this.info.remove(),this.info=null);let{completion:r}=n.options[n.selected],{info:i}=r;if(!i)return;let o=typeof i=="string"?document.createTextNode(i):i(r);if(!o)return;"then"in o?o.then(s=>{s&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(s)}).catch(s=>Ja(this.view.state,s,"completion info")):this.addInfoPane(o)}}addInfoPane(e){let n=this.info=document.createElement("div");n.className="cm-tooltip cm-completionInfo",n.appendChild(e),this.dom.appendChild(n),this.view.requestMeasure(this.placeInfo)}updateSelectedOption(e){let n=null;for(let r=this.list.firstChild,i=this.range.from;r;r=r.nextSibling,i++)i==e?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),n=r):r.hasAttribute("aria-selected")&&r.removeAttribute("aria-selected");return n&&XEe(this.list,n),n}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let n=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),i=e.getBoundingClientRect();if(i.top>Math.min(innerHeight,n.bottom)-10||i.bottom<Math.max(0,n.top)+10)return null;let o=Math.max(0,Math.min(i.top,innerHeight-r.height))-n.top,s=this.view.textDirection==Ri.RTL,a=n.left,l=innerWidth-n.right;return s&&a<Math.min(r.width,l)?s=!1:!s&&l<Math.min(r.width,a)&&(s=!0),{top:o,left:s}}positionInfo(e){this.info&&(this.info.style.top=(e?e.top:-1e6)+"px",e&&(this.info.classList.toggle("cm-completionInfo-left",e.left),this.info.classList.toggle("cm-completionInfo-right",!e.left)))}createListBox(e,n,r){const i=document.createElement("ul");i.id=n,i.setAttribute("role","listbox"),i.setAttribute("aria-expanded","true"),i.setAttribute("aria-label",this.view.state.phrase("Completions"));for(let o=r.from;o<r.to;o++){let{completion:s,match:a}=e[o];const l=i.appendChild(document.createElement("li"));l.id=n+"-"+o,l.setAttribute("role","option");let c=this.optionClass(s);c&&(l.className=c);for(let u of this.optionContent){let f=u(s,this.view.state,a);f&&l.appendChild(f)}}return r.from&&i.classList.add("cm-completionListIncompleteTop"),r.to<e.length&&i.classList.add("cm-completionListIncompleteBottom"),i}}function DEe(t){return e=>new NEe(e,t)}function XEe(t,e){let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();r.top<n.top?t.scrollTop-=n.top-r.top:r.bottom>n.bottom&&(t.scrollTop+=r.bottom-n.bottom)}function VX(t){return(t.boost||0)*100+(t.apply?10:0)+(t.info?5:0)+(t.type?1:0)}function WEe(t,e){let n=[],r=0;for(let s of t)if(s.hasResult())if(s.result.filter===!1){let a=s.result.getMatch;for(let l of s.result.options){let c=[1e9-r++];if(a)for(let u of a(l))c.push(u);n.push(new YX(l,s,c))}}else{let a=new zEe(e.sliceDoc(s.from,s.to)),l;for(let c of s.result.options)(l=a.match(c.label))&&(c.boost!=null&&(l[0]+=c.boost),n.push(new YX(c,s,l)))}let i=[],o=null;for(let s of n.sort(FEe))!o||o.label!=s.completion.label||o.detail!=s.completion.detail||o.type!=null&&s.completion.type!=null&&o.type!=s.completion.type||o.apply!=s.completion.apply?i.push(s):VX(s.completion)>VX(o)&&(i[i.length-1]=s),o=s.completion;return i}class ug{constructor(e,n,r,i,o){this.options=e,this.attrs=n,this.tooltip=r,this.timestamp=i,this.selected=o}setSelected(e,n){return e==this.selected||e>=this.options.length?this:new ug(this.options,GX(n,e),this.tooltip,this.timestamp,e)}static build(e,n,r,i,o){let s=WEe(e,n);if(!s.length)return null;let a=0;if(i&&i.selected){let l=i.options[i.selected].completion;for(let c=0;c<s.length;c++)if(s[c].completion==l){a=c;break}}return new ug(s,GX(r,a),{pos:e.reduce((l,c)=>c.hasResult()?Math.min(l,c.from):l,1e8),create:DEe(Cl),above:o.aboveCursor},i?i.timestamp:Date.now(),a)}map(e){return new ug(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected)}}class P2{constructor(e,n,r){this.active=e,this.id=n,this.open=r}static start(){return new P2(BEe,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:n}=e,r=n.facet(Kd),o=(r.override||n.languageDataAt("autocomplete",Dd(n)).map(IEe)).map(a=>(this.active.find(c=>c.source==a)||new ba(a,this.active.some(c=>c.state!=0)?1:0)).update(e,r));o.length==this.active.length&&o.every((a,l)=>a==this.active[l])&&(o=this.active);let s=e.selection||o.some(a=>a.hasResult()&&e.changes.touchesRange(a.from,a.to))||!UEe(o,this.active)?ug.build(o,n,this.id,this.open,r):this.open&&e.docChanged?this.open.map(e.changes):this.open;!s&&o.every(a=>a.state!=1)&&o.some(a=>a.hasResult())&&(o=o.map(a=>a.hasResult()?new ba(a.source,0):a));for(let a of e.effects)a.is(Eee)&&(s=s&&s.setSelected(a.value,this.id));return o==this.active&&s==this.open?this:new P2(o,this.id,s)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:qEe}}function UEe(t,e){if(t==e)return!0;for(let n=0,r=0;;){for(;n<t.length&&!t[n].hasResult;)n++;for(;r<e.length&&!e[r].hasResult;)r++;let i=n==t.length,o=r==e.length;if(i||o)return i==o;if(t[n++].result!=e[r++].result)return!1}}const qEe={"aria-autocomplete":"list"};function GX(t,e){return{"aria-autocomplete":"list","aria-haspopup":"listbox","aria-activedescendant":t+"-"+e,"aria-controls":t}}const BEe=[];function FEe(t,e){let n=e.match[0]-t.match[0];return n||t.completion.label.localeCompare(e.completion.label)}function C6(t){return t.isUserEvent("input.type")?"input":t.isUserEvent("delete.backward")?"delete":null}class ba{constructor(e,n,r=-1){this.source=e,this.state=n,this.explicitPos=r}hasResult(){return!1}update(e,n){let r=C6(e),i=this;r?i=i.handleUserEvent(e,r,n):e.docChanged?i=i.handleChange(e):e.selection&&i.state!=0&&(i=new ba(i.source,0));for(let o of e.effects)if(o.is(_C))i=new ba(i.source,1,o.value?Dd(e.state):-1);else if(o.is(Q2))i=new ba(i.source,0);else if(o.is(Qee))for(let s of o.value)s.source==i.source&&(i=s);return i}handleUserEvent(e,n,r){return n=="delete"||!r.activateOnTyping?this.map(e.changes):new ba(this.source,1)}handleChange(e){return e.changes.touchesRange(Dd(e.startState))?new ba(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new ba(this.source,this.state,e.mapPos(this.explicitPos))}}class fg extends ba{constructor(e,n,r,i,o){super(e,2,n),this.result=r,this.from=i,this.to=o}hasResult(){return!0}handleUserEvent(e,n,r){var i;let o=e.changes.mapPos(this.from),s=e.changes.mapPos(this.to,1),a=Dd(e.state);if((this.explicitPos<0?a<=o:a<this.from)||a>s||n=="delete"&&Dd(e.startState)==this.from)return new ba(this.source,n=="input"&&r.activateOnTyping?1:0);let l=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos),c;return YEe(this.result.validFor,e.state,o,s)?new fg(this.source,l,this.result,o,s):this.result.update&&(c=this.result.update(this.result,o,s,new wee(e.state,a,l>=0)))?new fg(this.source,l,c,c.from,(i=c.to)!==null&&i!==void 0?i:Dd(e.state)):new ba(this.source,1,l)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new ba(this.source,0):this.map(e.changes)}map(e){return e.empty?this:new fg(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1))}}function YEe(t,e,n,r){if(!t)return!1;let i=e.sliceDoc(n,r);return typeof t=="function"?t(i,n,r,e):Tee(t,!0).test(i)}const _C=fn.define(),Q2=fn.define(),Qee=fn.define({map(t,e){return t.map(n=>n.map(e))}}),Eee=fn.define(),Cl=fi.define({create(){return P2.start()},update(t,e){return t.update(e)},provide:t=>[sy.from(t,e=>e.tooltip),ht.contentAttributes.from(t,e=>e.attrs)]}),Cee=75;function d_(t,e="option"){return n=>{let r=n.state.field(Cl,!1);if(!r||!r.open||Date.now()-r.open.timestamp<Cee)return!1;let i=1,o;e=="page"&&(o=wke(n,r.open.tooltip))&&(i=Math.max(2,Math.floor(o.dom.offsetHeight/o.dom.querySelector("li").offsetHeight)-1));let s=r.open.selected+i*(t?1:-1),{length:a}=r.open.options;return s<0?s=e=="page"?0:a-1:s>=a&&(s=e=="page"?a-1:0),n.dispatch({effects:Eee.of(s)}),!0}}const jEe=t=>{let e=t.state.field(Cl,!1);return t.state.readOnly||!e||!e.open||Date.now()-e.open.timestamp<Cee?!1:(Pee(t,e.open.options[e.open.selected]),!0)},Ree=t=>t.state.field(Cl,!1)?(t.dispatch({effects:_C.of(!0)}),!0):!1,ZEe=t=>{let e=t.state.field(Cl,!1);return!e||!e.active.some(n=>n.state!=0)?!1:(t.dispatch({effects:Q2.of(null)}),!0)};class VEe{constructor(e,n){this.active=e,this.context=n,this.time=Date.now(),this.updates=[],this.done=void 0}}const HX=50,GEe=50,HEe=1e3,KEe=qr.fromClass(class{constructor(t){this.view=t,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.composing=0;for(let e of t.state.field(Cl).active)e.state==1&&this.startQuery(e)}update(t){let e=t.state.field(Cl);if(!t.selectionSet&&!t.docChanged&&t.startState.field(Cl)==e)return;let n=t.transactions.some(r=>(r.selection||r.docChanged)&&!C6(r));for(let r=0;r<this.running.length;r++){let i=this.running[r];if(n||i.updates.length+t.transactions.length>GEe&&Date.now()-i.time>HEe){for(let o of i.context.abortListeners)try{o()}catch(s){Ja(this.view.state,s)}i.context.abortListeners=null,this.running.splice(r--,1)}else i.updates.push(...t.transactions)}if(this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=e.active.some(r=>r.state==1&&!this.running.some(i=>i.active.source==r.source))?setTimeout(()=>this.startUpdate(),HX):-1,this.composing!=0)for(let r of t.transactions)C6(r)=="input"?this.composing=2:this.composing==2&&r.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1;let{state:t}=this.view,e=t.field(Cl);for(let n of e.active)n.state==1&&!this.running.some(r=>r.active.source==n.source)&&this.startQuery(n)}startQuery(t){let{state:e}=this.view,n=Dd(e),r=new wee(e,n,t.explicitPos==n),i=new VEe(t,r);this.running.push(i),Promise.resolve(t.source(r)).then(o=>{i.context.aborted||(i.done=o||null,this.scheduleAccept())},o=>{this.view.dispatch({effects:Q2.of(null)}),Ja(this.view.state,o)})}scheduleAccept(){this.running.every(t=>t.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),HX))}accept(){var t;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],n=this.view.state.facet(Kd);for(let r=0;r<this.running.length;r++){let i=this.running[r];if(i.done===void 0)continue;if(this.running.splice(r--,1),i.done){let s=new fg(i.active.source,i.active.explicitPos,i.done,i.done.from,(t=i.done.to)!==null&&t!==void 0?t:Dd(i.updates.length?i.updates[0].startState:this.view.state));for(let a of i.updates)s=s.update(a,n);if(s.hasResult()){e.push(s);continue}}let o=this.view.state.field(Cl).active.find(s=>s.source==i.active.source);if(o&&o.state==1)if(i.done==null){let s=new ba(i.active.source,0);for(let a of i.updates)s=s.update(a,n);s.state!=1&&e.push(s)}else this.startQuery(o)}e.length&&this.view.dispatch({effects:Qee.of(e)})}},{eventHandlers:{blur(){let t=this.view.state.field(Cl,!1);t&&t.tooltip&&this.view.state.facet(Kd).closeOnBlur&&this.view.dispatch({effects:Q2.of(null)})},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:_C.of(!1)}),20),this.composing=0}}}),Aee=ht.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",listStyle:"none",margin:0,padding:0,"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer",padding:"1px 3px",lineHeight:1.2}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"\xB7\xB7\xB7"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"300px"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'\u0192'"}},".cm-completionIcon-class":{"&:after":{content:"'\u25CB'"}},".cm-completionIcon-interface":{"&:after":{content:"'\u25CC'"}},".cm-completionIcon-variable":{"&:after":{content:"'\u{1D465}'"}},".cm-completionIcon-constant":{"&:after":{content:"'\u{1D436}'"}},".cm-completionIcon-type":{"&:after":{content:"'\u{1D461}'"}},".cm-completionIcon-enum":{"&:after":{content:"'\u222A'"}},".cm-completionIcon-property":{"&:after":{content:"'\u25A1'"}},".cm-completionIcon-keyword":{"&:after":{content:"'\u{1F511}\uFE0E'"}},".cm-completionIcon-namespace":{"&:after":{content:"'\u25A2'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class JEe{constructor(e,n,r,i){this.field=e,this.line=n,this.from=r,this.to=i}}class $C{constructor(e,n,r){this.field=e,this.from=n,this.to=r}map(e){let n=e.mapPos(this.from,-1,No.TrackDel),r=e.mapPos(this.to,1,No.TrackDel);return n==null||r==null?null:new $C(this.field,n,r)}}class SC{constructor(e,n){this.lines=e,this.fieldPositions=n}instantiate(e,n){let r=[],i=[n],o=e.doc.lineAt(n),s=/^\s*/.exec(o.text)[0];for(let l of this.lines){if(r.length){let c=s,u=/^\t*/.exec(l)[0].length;for(let f=0;f<u;f++)c+=e.facet(Pf);i.push(n+c.length-u),l=c+l.slice(u)}r.push(l),n+=l.length+1}let a=this.fieldPositions.map(l=>new $C(l.field,i[l.line]+l.from,i[l.line]+l.to));return{text:r,ranges:a}}static parse(e){let n=[],r=[],i=[],o;for(let s of e.split(/\r\n?|\n/)){for(;o=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(s);){let a=o[1]?+o[1]:null,l=o[2]||o[3]||"",c=-1;for(let u=0;u<n.length;u++)(a!=null?n[u].seq==a:l?n[u].name==l:!1)&&(c=u);if(c<0){let u=0;for(;u<n.length&&(a==null||n[u].seq!=null&&n[u].seq<a);)u++;n.splice(u,0,{seq:a,name:l}),c=u;for(let f of i)f.field>=c&&f.field++}i.push(new JEe(c,r.length,o.index,o.index+l.length)),s=s.slice(0,o.index)+l+s.slice(o.index+o[0].length)}for(let a;a=/([$#])\\{/.exec(s);){s=s.slice(0,a.index)+a[1]+"{"+s.slice(a.index+a[0].length);for(let l of i)l.line==r.length&&l.from>a.index&&(l.from--,l.to--)}r.push(s)}return new SC(r,i)}}let eCe=zt.widget({widget:new class extends Ic{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),tCe=zt.mark({class:"cm-snippetField"});class h0{constructor(e,n){this.ranges=e,this.active=n,this.deco=zt.set(e.map(r=>(r.from==r.to?eCe:tCe).range(r.from,r.to)))}map(e){let n=[];for(let r of this.ranges){let i=r.map(e);if(!i)return null;n.push(i)}return new h0(n,this.active)}selectionInsideField(e){return e.ranges.every(n=>this.ranges.some(r=>r.field==this.active&&r.from<=n.from&&r.to>=n.to))}}const Oy=fn.define({map(t,e){return t&&t.map(e)}}),nCe=fn.define(),Ov=fi.define({create(){return null},update(t,e){for(let n of e.effects){if(n.is(Oy))return n.value;if(n.is(nCe)&&t)return new h0(t.ranges,n.value)}return t&&e.docChanged&&(t=t.map(e.changes)),t&&e.selection&&!t.selectionInsideField(e.selection)&&(t=null),t},provide:t=>ht.decorations.from(t,e=>e?e.deco:zt.none)});function xC(t,e){return Ne.create(t.filter(n=>n.field==e).map(n=>Ne.range(n.from,n.to)))}function rCe(t){let e=SC.parse(t);return(n,r,i,o)=>{let{text:s,ranges:a}=e.instantiate(n.state,i),l={changes:{from:i,to:o,insert:Sr.of(s)},scrollIntoView:!0};if(a.length&&(l.selection=xC(a,0)),a.length>1){let c=new h0(a,0),u=l.effects=[Oy.of(c)];n.state.field(Ov,!1)===void 0&&u.push(fn.appendConfig.of([Ov,lCe,cCe,Aee]))}n.dispatch(n.state.update(l))}}function Iee(t){return({state:e,dispatch:n})=>{let r=e.field(Ov,!1);if(!r||t<0&&r.active==0)return!1;let i=r.active+t,o=t>0&&!r.ranges.some(s=>s.field==i+t);return n(e.update({selection:xC(r.ranges,i),effects:Oy.of(o?null:new h0(r.ranges,i))})),!0}}const iCe=({state:t,dispatch:e})=>t.field(Ov,!1)?(e(t.update({effects:Oy.of(null)})),!0):!1,oCe=Iee(1),sCe=Iee(-1),aCe=[{key:"Tab",run:oCe,shift:sCe},{key:"Escape",run:iCe}],KX=Ft.define({combine(t){return t.length?t[0]:aCe}}),lCe=xu.highest(Lf.compute([KX],t=>t.facet(KX)));function cc(t,e){return Object.assign(Object.assign({},e),{apply:rCe(t)})}const cCe=ht.domEventHandlers({mousedown(t,e){let n=e.state.field(Ov,!1),r;if(!n||(r=e.posAtCoords({x:t.clientX,y:t.clientY}))==null)return!1;let i=n.ranges.find(o=>o.from<=r&&o.to>=r);return!i||i.field==n.active?!1:(e.dispatch({selection:xC(n.ranges,i.field),effects:Oy.of(n.ranges.some(o=>o.field>i.field)?new h0(n.ranges,i.field):null)}),!0)}}),E2={brackets:["(","[","{","'",'"'],before:")]}:;>"},Kh=fn.define({map(t,e){let n=e.mapPos(t,-1,No.TrackAfter);return n==null?void 0:n}}),wC=fn.define({map(t,e){return e.mapPos(t)}}),kC=new class extends mO{};kC.startSide=1;kC.endSide=-1;const zee=fi.define({create(){return Ir.empty},update(t,e){if(e.selection){let n=e.state.doc.lineAt(e.selection.main.head).from,r=e.startState.doc.lineAt(e.startState.selection.main.head).from;n!=e.changes.mapPos(r,-1)&&(t=Ir.empty)}t=t.map(e.changes);for(let n of e.effects)n.is(Kh)?t=t.update({add:[kC.range(n.value,n.value+1)]}):n.is(wC)&&(t=t.update({filter:r=>r!=n.value}));return t}});function Lee(){return[fCe,zee]}const vT="()[]{}<>";function Mee(t){for(let e=0;e<vT.length;e+=2)if(vT.charCodeAt(e)==t)return vT.charAt(e+1);return CE(t<128?t:t+1)}function Nee(t,e){return t.languageDataAt("closeBrackets",e)[0]||E2}const uCe=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),fCe=ht.inputHandler.of((t,e,n,r)=>{if((uCe?t.composing:t.compositionStarted)||t.state.readOnly)return!1;let i=t.state.selection.main;if(r.length>2||r.length==2&&ja(gs(r,0))==1||e!=i.from||n!=i.to)return!1;let o=hCe(t.state,r);return o?(t.dispatch(o),!0):!1}),dCe=({state:t,dispatch:e})=>{if(t.readOnly)return!1;let r=Nee(t,t.selection.main.head).brackets||E2.brackets,i=null,o=t.changeByRange(s=>{if(s.empty){let a=OCe(t.doc,s.head);for(let l of r)if(l==a&&A4(t.doc,s.head)==Mee(gs(l,0)))return{changes:{from:s.head-l.length,to:s.head+l.length},range:Ne.cursor(s.head-l.length),userEvent:"delete.backward"}}return{range:i=s}});return i||e(t.update(o,{scrollIntoView:!0})),!i},Dee=[{key:"Backspace",run:dCe}];function hCe(t,e){let n=Nee(t,t.selection.main.head),r=n.brackets||E2.brackets;for(let i of r){let o=Mee(gs(i,0));if(e==i)return o==i?gCe(t,i,r.indexOf(i+i+i)>-1):pCe(t,i,o,n.before||E2.before);if(e==o&&Xee(t,t.selection.main.from))return mCe(t,i,o)}return null}function Xee(t,e){let n=!1;return t.field(zee).between(0,t.doc.length,r=>{r==e&&(n=!0)}),n}function A4(t,e){let n=t.sliceString(e,e+2);return n.slice(0,ja(gs(n,0)))}function OCe(t,e){let n=t.sliceString(e-2,e);return ja(gs(n,0))==n.length?n:n.slice(1)}function pCe(t,e,n,r){let i=null,o=t.changeByRange(s=>{if(!s.empty)return{changes:[{insert:e,from:s.from},{insert:n,from:s.to}],effects:Kh.of(s.to+e.length),range:Ne.range(s.anchor+e.length,s.head+e.length)};let a=A4(t.doc,s.head);return!a||/\s/.test(a)||r.indexOf(a)>-1?{changes:{insert:e+n,from:s.head},effects:Kh.of(s.head+e.length),range:Ne.cursor(s.head+e.length)}:{range:i=s}});return i?null:t.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function mCe(t,e,n){let r=null,i=t.selection.ranges.map(o=>o.empty&&A4(t.doc,o.head)==n?Ne.cursor(o.head+n.length):r=o);return r?null:t.update({selection:Ne.create(i,t.selection.mainIndex),scrollIntoView:!0,effects:t.selection.ranges.map(({from:o})=>wC.of(o))})}function gCe(t,e,n){let r=null,i=t.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:e,from:o.to}],effects:Kh.of(o.to+e.length),range:Ne.range(o.anchor+e.length,o.head+e.length)};let s=o.head,a=A4(t.doc,s);if(a==e){if(JX(t,s))return{changes:{insert:e+e,from:s},effects:Kh.of(s+e.length),range:Ne.cursor(s+e.length)};if(Xee(t,s)){let l=n&&t.sliceDoc(s,s+e.length*3)==e+e+e;return{range:Ne.cursor(s+e.length*(l?3:1)),effects:wC.of(s)}}}else{if(n&&t.sliceDoc(s-2*e.length,s)==e+e&&JX(t,s-2*e.length))return{changes:{insert:e+e+e+e,from:s},effects:Kh.of(s+e.length),range:Ne.cursor(s+e.length)};if(t.charCategorizer(s)(a)!=Xo.Word){let l=t.sliceDoc(s-1,s);if(l!=e&&t.charCategorizer(s)(l)!=Xo.Word&&!vCe(t,s,e))return{changes:{insert:e+e,from:s},effects:Kh.of(s+e.length),range:Ne.cursor(s+e.length)}}}return{range:r=o}});return r?null:t.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function JX(t,e){let n=oi(t).resolveInner(e+1);return n.parent&&n.from==e}function vCe(t,e,n){let r=oi(t).resolveInner(e,-1);for(let i=0;i<5;i++){if(t.sliceDoc(r.from,r.from+n.length)==n)return!0;let o=r.to==e&&r.parent;if(!o)break;r=o}return!1}function pv(t={}){return[Cl,Kd.of(t),KEe,yCe,Aee]}const TC=[{key:"Ctrl-Space",run:Ree},{key:"Escape",run:ZEe},{key:"ArrowDown",run:d_(!0)},{key:"ArrowUp",run:d_(!1)},{key:"PageDown",run:d_(!0,"page")},{key:"PageUp",run:d_(!1,"page")},{key:"Enter",run:jEe}],yCe=xu.highest(Lf.computeN([Kd],t=>t.facet(Kd).defaultKeymap?[TC]:[]));/*! *****************************************************************************
|
|
1027
1027
|
Copyright (c) Microsoft Corporation. All rights reserved.
|