mxcad-app 1.0.18 → 1.0.19

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.
@@ -1181,7 +1181,7 @@ ${o}
1181
1181
  const mxcad: typeof import('mxcad')
1182
1182
  `)},{addCommand:jOe,callCommand:zOe,getMxCADUIImplement:Pg,utils:qOe}=MxPluginContext,{browserCacheRef:UOe}=qOe;let $g;const Af=Se.ref(),POe=o=>{$g==null||$g.setValue(o)},RQ=o=>{Af.value=o,POe(o.code)},jm=UOe(!1,"Mx_isShowCodeEditor"),$Oe=o=>{const e=Se.ref("全部"),t=Se.computed(()=>{var l,a,c;return!((l=Pg())!=null&&l.plugin)||!((c=(a=Pg())==null?void 0:a.plugin)!=null&&c.sampleCode)||Pg().plugin.sampleCode.length===0?[{type:"自定义",name:"代码测试",code:"console.log('log')"}]:e.value==="全部"?Pg().plugin.sampleCode:Pg().plugin.sampleCode.filter(({type:g})=>e.value===g)});Af.value=t.value[0],Se.watch(e,()=>{Af.value=t.value[0],RQ(Af.value)});const i=Se.computed(()=>{var l,a,c;return!((l=Pg())!=null&&l.plugin)||!((c=(a=Pg())==null?void 0:a.plugin)!=null&&c.sampleCode)||Pg().plugin.sampleCode.length===0?["全部"]:Array.from(new Set(["全部",...Pg().plugin.sampleCode.map(({type:g})=>g)]))}),n=(l="console.log('test')")=>{if($g){$g.setValue("typescript",l);return}if(o.value)return $g=FOe(o.value,{typescript:l}),$g},s=l=>{l&&n(Af.value.code)};return Se.watch(jm,s),Se.onMounted(()=>{s(jm.value),MOe(),LOe(({name:l,type:a,content:c})=>{(l.endsWith(".tsx")||l.endsWith(".ts"))&&$g.setValue("typescript",c)})}),jOe("runCode",()=>Z(this,null,function*(){try{const l=yield HOe($g,"pro");new Function(l)()}catch(l){console.warn(l)}})),{isShowCodeEditor:jm,run:()=>{zOe("runCode")},updateCode:RQ,currentType:e,types:i,code:Af,codes:t}},f6e="";var Mee=Object.defineProperty,eEe=(o,e,t)=>e in o?Mee(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,Ae=(o,e)=>Mee(o,"name",{value:e,configurable:!0}),Jl=(o=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(o,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):o)(function(o){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+o+'" is not supported')}),an=(o,e,t)=>eEe(o,typeof e!="symbol"?e+"":e,t),$N,jee=($N=class{constructor(o){this._listeners=new Map,this._lastMessage={},this.options=Object.assign({ignoreError:!1},o)}get listeners(){return this._listeners}on(){let o=arguments[0],e=arguments[1],t=arguments[2],{objectify:i=!0,count:n=-1}=Object.assign({},t);this._listeners.has(o)||this._listeners.set(o,new Map);let s=++$N.listenerSeqId,r=this._listeners.get(o);return r==null||r.set(s,[e,n]),this._emitRetainEvent(o,s,r),i?{off:Ae(()=>{r==null||r.delete(s),(r==null?void 0:r.size)==0&&this._listeners.delete(o)},"off")}:s}onAny(o,e){return this.on("*",o,e)}_emitRetainEvent(o,e,t){o in this._lastMessage&&this._executeListener(e,t,this._lastMessage[o])}once(o,e,t){return this.on(o,e,Object.assign({},t,{count:1}))}_forEachListeners(o){let e=!1;for(let[t,i]of this._listeners.entries()){if(e)break;for(let[n,[s,r]]of i.entries()){if(e)break;e=o({event:t,listenerId:n,listener:s,count:r,eventListeners:i})===!1}}}_forEachEventListeners(o,e){let t=!1,i=[[o,this._listeners.get(o)]];for(let[n,s]of i)if(s)for(let[r,[l,a]]of s){if(t)break;t=e({event:n,listenerId:r,listener:l,count:a,eventListeners:s})===!1}}off(){if(arguments.length==1){if(typeof arguments[0]=="number")this._forEachListeners(({listenerId:o,eventListeners:e,event:t})=>{var i;if(o==arguments[0])return e.delete(o),((i=this._listeners.get(t))==null?void 0:i.size)==0&&this._listeners.delete(t),!1});else if(typeof arguments[0]=="function"){let o=arguments[0];this._forEachListeners(({listenerId:e,listener:t,eventListeners:i,event:n})=>{var s;t==o&&(i.delete(e),((s=this._listeners.get(n))==null?void 0:s.size)==0&&this._listeners.delete(n))})}}else arguments.length==2&&typeof arguments[0]=="string"&&typeof arguments[1]=="function"&&this._forEachEventListeners(arguments[0],({event:o,listenerId:e,listener:t,eventListeners:i})=>{var n;o==arguments[0]&&t==arguments[1]&&(i.delete(e),((n=this._listeners.get(o))==null?void 0:n.size)==0&&this._listeners.delete(o))})}waitFor(o,e=0){return new Promise((t,i)=>{let n,s=!1,r;e>0&&(n=setTimeout(()=>{s=!0,this.off(r),i(new Error("Timeout"))},e)),r=this.once(o,l=>{s||(clearTimeout(n),t(l))})})}offAll(o){o?this._listeners.delete(o):this._listeners.clear()}_executeListener(o,e,t){if(!e)return;let i=e.get(o);if(i)try{return i[0](t)}catch(n){if(!this.options.ignoreError)throw n}finally{i[1]>-1&&(i[1]=i[1]-1,i[1]==0&&e.delete(o))}}_executeListeners(o,e,t){let i=[];return this._forEachEventListeners(o,({event:n,listenerId:s,eventListeners:r})=>{i.push(this._executeListener(s,r,e)),typeof t=="function"&&t(s),r.size==0&&this._listeners.delete(n)}),i}emit(o,e,t){return t&&(this._lastMessage[o]=e),this._executeListeners(o,e)}emitAsync(o,e,t){return Z(this,null,function*(){return yield Promise.allSettled(this.emit(o,e,t))})}},Ae($N,"l"),$N);jee.listenerSeqId=0;var zee=jee;(o=>typeof Jl<"u"?Jl:typeof Proxy<"u"?new Proxy(o,{get:Ae((e,t)=>(typeof Jl<"u"?Jl:e)[t],"get")}):o)(function(o){if(typeof Jl<"u")return Jl.apply(this,arguments);throw Error('Dynamic require of "'+o+'" is not supported')});function qee(){return Date.now().toString()+parseInt(String(Math.random()*1e3))}Ae(qee,"getId");function e1(o,e=!1){if(typeof o=="number")return!0;if(typeof o!="string"||e)return!1;try{if(o.includes(".")){let t=parseFloat(o);return o.endsWith(".")?!isNaN(t)&&String(t).length===o.length-1:!isNaN(t)&&String(t).length===o.length}else{let t=parseInt(o);return!isNaN(t)&&String(t).length===o.length}}catch(t){return!1}}Ae(e1,"r");function t1(o){return e1(o)}Ae(t1,"isMessageId");function Uee(o){return o&&typeof o=="object"&&o.__VoerkaI18nScope__}Ae(Uee,"isI18nScope");function Pee(o){return Z(this,null,function*(){let e=yield o.call(this);return e&&"__esModule"in e||Symbol.toStringTag in e?e.default:e})}Ae(Pee,"loadAsyncModule");function $ee(o){return o&&typeof o.get=="function"&&typeof o.set=="function"&&typeof o.remove=="function"}Ae($ee,"isStorage");function ete(o){return Z(this,null,function*(){return(yield Promise.allSettled(o)).map(e=>e.status==="fulfilled"?e.value:e.reason)})}Ae(ete,"execAsyncs");function JQ(){try{return typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"}catch(o){return!1}}Ae(JQ,"isBrowser");var DQ=class h_ extends zee{constructor(e){if(super(),an(this,"__VoerkaI18nManager__",!0),an(this,"_scopes",[]),an(this,"_appScope"),h_.instance)return h_.instance;if(!e)throw new Error("create VoerkaI18nManager failed, appScope is required");this._registerAppScope(e),this._registerScopes(),this._loadPlugins(),h_.instance=this,globalThis.VoerkaI18n=this}get debug(){return this.scope.debug}get logger(){return this.scope.logger}get scopes(){return this._scopes}get activeLanguage(){return this._appScope.activeLanguage}get defaultLanguage(){return this._appScope.defaultLanguage}get loader(){return this._appScope.loader}get storage(){return this.scope.storage}get languages(){return this.scope.languages}get scope(){return this._appScope}_registerScopes(){let e=globalThis.__VoerkaI18nScopes__;e&&Array.isArray(e)&&e.forEach(t=>this.register(t)),delete globalThis.__VoerkaI18nScopes__}getScope(e){return this._scopes.find(t=>t.id===e)}_loadPlugins(){let e=globalThis.__VoerkaI18nPlugins__;e&&Array.isArray(e)&&e.forEach(t=>t(this)),delete globalThis.__VoerkaI18nPlugins__}registerPlugin(e){typeof e=="function"&&e(this)}_registerAppScope(e){this._scopes.push(e),this._appScope=e,this.logger.debug("VoerkaI18nScope<"+e.id+"> is registered as appScope"),this.emitAsync("init",()=>this._appScope.activeLanguage,!0)}register(e){if(!Uee(e))throw new Error("register scope failed, invalid scope");this._scopes.push(e),e.bind(this),this.logger.debug(`VoerkaI18nScope<${e.id}> is registered`)}change(e){return Z(this,null,function*(){yield this._refreshScopes(e);let t=this._appScope.activeLanguage;return this.scope.saveLanguage(),this.emit("change",t,!0),this.logger.info("language changed to: "+t),t})}_refreshScopes(e){return Z(this,null,function*(){let t=this._scopes.map(i=>i.refresh(e));yield ete(t)})}refresh(){return Z(this,null,function*(){return yield this._refreshScopes(this.activeLanguage)})}ready(e,t){return this.waitFor("ready",t).then(i=>{e&&e.call(this,i)})}clearPatchedMessages(){this._scopes.forEach(e=>e.clearPatchedMessages())}hasLanguage(e){return this.languages.findIndex(t=>t.name==e)!=-1}clearLanguage(){this.scope.clearLanguage()}saveLanguage(){this.scope.saveLanguage()}restoreLanguage(){this.scope.restoreLanguage()}};Ae(DQ,"VoerkaI18nManager"),an(DQ,"instance");var tte=DQ,tEe={get(o){if(globalThis.localStorage)return globalThis.localStorage.getItem(o)},set(o,e){globalThis.localStorage&&globalThis.localStorage.setItem(o,e)},remove(o){globalThis.localStorage&&globalThis.localStorage.removeItem(o)}},iEe=[{name:"zh",title:"中文",default:!0,active:!0},{name:"en",title:"英文"}],ite=Ae((o,e,t=[])=>{let i=Object.getOwnPropertyDescriptors(e);for(let n of t)delete i[n];Object.defineProperties(o,i)},"copyProps"),vf=Ae((o,e=[o])=>{let t=Object.getPrototypeOf(o);return t===null?e:vf(t,[...e,t])},"protoChain"),nEe=Ae((...o)=>{if(o.length===0)return;let e,t=o.map(i=>vf(i));for(;t.every(i=>i.length>0);){let i=t.map(s=>s.pop()),n=i[0];if(i.every(s=>s===n))e=n;else break}return e},"nearestCommonProto"),nte=Ae((o,e,t=[])=>{var i;let n=(i=nEe(...o))!==null&&i!==void 0?i:Object.prototype,s=Object.create(n),r=vf(n);for(let l of o){let a=vf(l);for(let c=a.length-1;c>=0;c--){let g=a[c];r.indexOf(g)===-1&&(ite(s,g,["constructor",...t]),r.push(g))}}return s.constructor=e,s},"hardMixProtos"),LQ=Ae(o=>o.filter((e,t)=>o.indexOf(e)==t),"unique"),i1=Ae((o,e)=>{let t=e.map(s=>vf(s)),i=0,n=!0;for(;n;){n=!1;for(let s=e.length-1;s>=0;s--){let r=t[s][i];if(r!=null&&(n=!0,Object.getOwnPropertyDescriptor(r,o)!=null))return t[s][0]}i++}},"getIngredientWithProp"),oEe=Ae((o,e=Object.prototype)=>new Proxy({},{getPrototypeOf(){return e},setPrototypeOf(){throw Error("Cannot set prototype of Proxies created by ts-mixer")},getOwnPropertyDescriptor(t,i){return Object.getOwnPropertyDescriptor(i1(i,o)||{},i)},defineProperty(){throw new Error("Cannot define new properties on Proxies created by ts-mixer")},has(t,i){return i1(i,o)!==void 0||e[i]!==void 0},get(t,i){return(i1(i,o)||e)[i]},set(t,i,n){let s=i1(i,o);if(s===void 0)throw new Error("Cannot set new properties on Proxies created by ts-mixer");return s[i]=n,!0},deleteProperty(){throw new Error("Cannot delete properties on Proxies created by ts-mixer")},ownKeys(){return o.map(Object.getOwnPropertyNames).reduce((t,i)=>i.concat(t.filter(n=>i.indexOf(n)<0)))}}),"proxyMix");Ae((o,e)=>oEe([...o,{constructor:e}]),"softMixProtos");var ote=new WeakMap,sEe=Ae(o=>ote.get(o),"getMixinsForClass"),rEe=Ae((o,e)=>ote.set(o,e),"registerMixins"),ste=Ae((o,e)=>{var t,i;let n=LQ([...Object.getOwnPropertyNames(o),...Object.getOwnPropertyNames(e)]),s={};for(let r of n)s[r]=LQ([...(t=o==null?void 0:o[r])!==null&&t!==void 0?t:[],...(i=e==null?void 0:e[r])!==null&&i!==void 0?i:[]]);return s},"mergeObjectsOfDecorators"),rte=Ae((o,e)=>{var t,i,n,s;return{property:ste((t=o==null?void 0:o.property)!==null&&t!==void 0?t:{},(i=e==null?void 0:e.property)!==null&&i!==void 0?i:{}),method:ste((n=o==null?void 0:o.method)!==null&&n!==void 0?n:{},(s=e==null?void 0:e.method)!==null&&s!==void 0?s:{})}},"mergePropertyAndMethodDecorators"),lte=Ae((o,e)=>{var t,i,n,s,r,l;return{class:LQ([...(t=o==null?void 0:o.class)!==null&&t!==void 0?t:[],...(i=e==null?void 0:e.class)!==null&&i!==void 0?i:[]]),static:rte((n=o==null?void 0:o.static)!==null&&n!==void 0?n:{},(s=e==null?void 0:e.static)!==null&&s!==void 0?s:{}),instance:rte((r=o==null?void 0:o.instance)!==null&&r!==void 0?r:{},(l=e==null?void 0:e.instance)!==null&&l!==void 0?l:{})}},"mergeDecorators"),OQ=new Map,lEe=Ae((...o)=>{var e;let t=new Set,i=new Set([...o]);for(;i.size>0;)for(let n of i){let s=vf(n.prototype).map(a=>a.constructor),r=(e=sEe(n))!==null&&e!==void 0?e:[],l=[...s,...r].filter(a=>!t.has(a));for(let a of l)i.add(a);t.add(n),i.delete(n)}return[...t]},"findAllConstituentClasses"),aEe=Ae((...o)=>{let e=lEe(...o).map(t=>OQ.get(t)).filter(t=>!!t);return e.length==0?{}:e.length==1?e[0]:e.reduce((t,i)=>lte(t,i))},"deepDecoratorSearch");Ae((...o)=>{let e=o.map(t=>cEe(t));return e.length===0?{}:e.length===1?e[0]:e.reduce((t,i)=>lte(t,i))},"directDecoratorSearch");var cEe=Ae(o=>{let e=OQ.get(o);return e||(e={},OQ.set(o,e)),e},"getDecoratorsForClass");function ate(...o){var e,t,i;let n=o.map(l=>l.prototype);function s(...l){for(let a of o)ite(this,new a(...l))}Ae(s,"MixedClass"),s.prototype=nte(n,s),Object.setPrototypeOf(s,nte(o,null,["prototype"]));let r=s;{let l=aEe(...o);for(let a of(e=l==null?void 0:l.class)!==null&&e!==void 0?e:[]){let c=a(r);c&&(r=c)}cte((t=l==null?void 0:l.static)!==null&&t!==void 0?t:{},r),cte((i=l==null?void 0:l.instance)!==null&&i!==void 0?i:{},r.prototype)}return rEe(r,o),r}Ae(ate,"Mixin");var cte=Ae((o,e)=>{let t=o.property,i=o.method;if(t)for(let n in t)for(let s of t[n])s(e,n);if(i)for(let n in i)for(let s of i[n])s(e,n,Object.getOwnPropertyDescriptor(e,n))},"applyPropAndMethodDecorators"),gte=class{constructor(){an(this,"_eventEmitter")}_getEventEmitter(){return this.attached?this.manager:(this._eventEmitter||(this._eventEmitter=new zee),this._eventEmitter)}on(e,t){return this._getEventEmitter().on(e,t)}once(e,t){return this._getEventEmitter().once(e,t)}off(e,t){return this._getEventEmitter().off(e,t)}waitFor(e,t){return this._getEventEmitter().waitFor(e,t)}emit(e,t,i){return Z(this,null,function*(){return yield this._getEventEmitter().emitAsync(e,t,i)})}};Ae(gte,"EventEmitterMixin");var gEe=gte;function Gc(o){return o&&typeof o=="function"}Ae(Gc,"t");function zm(o){if(typeof o!="object"||o===null)return!1;var e=Object.getPrototypeOf(o);if(e===null)return!0;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return e===t}Ae(zm,"o");var EQ,dEe=(EQ=class extends Error{},Ae(EQ,"m"),EQ),uEe=0;function dte(o,e={timeout:0}){let t=!1,i=!1,n=!1,s,r,l=0,a,c=++uEe,g=Ae(function(){clearTimeout(l),t=!1,i=!1,n=!1,a=new Promise((u,h)=>{s=u,r=h})},"g");g();function d(u=0,h){return Z(this,null,function*(){if(typeof o=="function"&&o()){t=!0;return}return(t||i)&&g(),u>0&&(l=setTimeout(()=>{t=!0;try{h instanceof Error?r(h):s(h)}catch(m){}},u)),n=!0,a})}return Ae(d,"o"),d.id=c,d.resolve=u=>{if(clearTimeout(l),!!n&&!(t||i)){if(typeof o=="function"&&o())if(o())s(u);else return;else s(u);t=!0}},d.reject=u=>{clearTimeout(l),n&&(t||i||(r(typeof u=="string"?new Error(u):u instanceof Error?u:new Error),i=!0))},d.destroy=()=>{clearTimeout(l),n&&r(new dEe),t=!1,n=!1,i=!1,a=null},d.reset=g,d.isResolved=()=>t,d.isRejected=()=>i,d.isPending=()=>n,d}Ae(dte,"p");var ute=class{constructor(){an(this,"_patching")}_getPatchKey(e){return`voerkai18n_${this.id}_${e}_patched_messages`}clearPatchedMessages(e){if(this.storage){let t=e?[e]:this.languages.map(i=>i.name);for(let i of t)this.storage.remove(this._getPatchKey(i))}}_patch(e){return Z(this,null,function*(){var t;this._patching=dte(),e||(e=this.activeLanguage),this._restorePatchedMessages(this.activeMessages,e);try{if(Gc(this.loader)){let i=yield this._loadMessagesFromLoader(e);zm(i)&&(Object.assign(this._activeMessages,i),this._setPatchedMessages(i,e),this.emit("patched",{language:e,scope:this.id}))}}catch(i){this.logger.warn(`从远程加载语言补丁包<${e}>时出错: ${i.stack}(scope=${this.id})`)}finally{(t=this._patching)==null||t.resolve(),this._patching=void 0}})}_restorePatchedMessages(e,t){let i=this._getPatchedMessages(t);zm(i)&&(Object.assign(e,i),this.emit("restore",{language:t,scope:this.id}),this.logger.debug(`成功恢复补丁语言包<${t}>(scope=${this.id})`))}_setPatchedMessages(e,t){if(!(!this.attached&&!this.storage))try{this.storage&&this.storage.set(this._getPatchKey(t),JSON.stringify(e))}catch(i){this.logger.error(`保存语言包补丁(${t})时出错: ${i.stack}(scope=${this.id})`)}}_getPatchedMessages(e){try{return this.storage&&this.options.cachePatch?this.storage.get(this._getPatchKey(e)):{}}catch(t){return this.logger.error(`读取语言包补丁(${e})时出错:${t.stack}(scope=${this.id})`),{}}}};Ae(ute,"PatchMessageMixin");var hEe=ute,mEe=Ae((o,e,t)=>new Promise((i,n)=>{var s=Ae(a=>{try{l(t.next(a))}catch(c){n(c)}},"f"),r=Ae(a=>{try{l(t.throw(a))}catch(c){n(c)}},"d"),l=Ae(a=>a.done?i(a.value):Promise.resolve(a.value).then(s,r),"u");l((t=t.apply(o,e)).next())}),"j"),YQ,CEe=(YQ=class extends Error{},Ae(YQ,"b"),YQ),pEe=0;function hte(o,e={timeout:0}){let t=!1,i=!1,n=!1,s,r,l=0,a,c=++pEe,g=Ae(function(){clearTimeout(l),t=!1,i=!1,n=!1,a=new Promise((u,h)=>{s=u,r=h})},"m");g();function d(){return mEe(this,arguments,function*(u=e.timeout,h){if(typeof o=="function"&&o()){t=!0;return}return(t||i)&&g(),u>0&&(l=setTimeout(()=>{t=!0;try{h instanceof Error?r(h):s(h)}catch(m){}},u)),n=!0,a})}return Ae(d,"c"),d.id=c,d.resolve=u=>{if(clearTimeout(l),!!n&&!(t||i)){if(typeof o=="function"&&o())if(o())s(u);else return;else s(u);t=!0}},d.reject=u=>{clearTimeout(l),n&&(t||i||(r(typeof u=="string"?new Error(u):u instanceof Error?u:new Error),i=!0))},d.destroy=()=>{clearTimeout(l),n&&r(new CEe),t=!1,n=!1,i=!1,a=null},d.reset=g,d.isResolved=()=>t,d.isRejected=()=>i,d.isPending=()=>n,d}Ae(hte,"R");var mte=class extends Error{};Ae(mte,"VoerkaI18nError");var dW=mte,bEe=class extends dW{};Ae(bEe,"VoerkaI18nInvalidLanguageError");var fEe=class extends dW{};Ae(fEe,"VoerkaI18nOnlyOneAppScopeError");var IEe=class extends dW{};Ae(IEe,"VoerkaI18nChangeLanguageError");var Cte=class extends dW{};Ae(Cte,"VoerkaI18nLoadLanguageError");var pte=Cte,bte=class{constructor(){an(this,"_refreshSignal")}refresh(e,t){return Z(this,null,function*(){this._refreshSignal||(this._refreshSignal=hte()),e||(e=this.activeLanguage);let i=e,n,{patch:s,fallback:r}=Object.assign({fallback:!1,patch:!0},t);try{n=yield this._loadLanguageMessages(e),this._activeMessages=n,n&&!n.$remote&&s&&(yield this._patch(e))}catch(l){if(l&&l instanceof dW){let a=this.getFallbackLanguage(e);a&&a!==e&&(i=yield this.refresh(a,{patch:s,fallback:!0}))}}finally{r||(this._activeLanguage=i,(typeof this.messages[i]=="function"||!(i in this.messages))&&(this.messages[i]=this._activeMessages),this._activeParagraphs=this.paragraphs[i],this._refreshSignal.resolve(),this._refreshSignal=void 0,yield this.emit("scope/change",i,!0))}return this._setLanguageAttr(),i})}_loadLanguageMessages(e){return Z(this,null,function*(){this.logger.debug(`准备加载语言包:${e}`);let t=this.messages[e],i;if(zm(t))i=t;else if(Gc(t))try{i=yield Pee.call(this,t)}catch(n){this.logger.error(`加载异步语言包<${e}>失败:${n.message}`),i=void 0}if(!i&&Gc(this.loader))try{let n=yield this._loadMessagesFromLoader(e);zm(n)?i=Object.assign({$remote:!0},this.messages[this.defaultLanguage],n):this.logger.error(`错误的语言包<${e}>数据:${n}`)}catch(n){throw new pte(n.message)}if(!zm(i))throw new pte(e);return i})}_loadMessagesFromLoader(e){return Z(this,null,function*(){if(Gc(this.loader))return yield this.loader.call(this,e,this)})}ready(){let e=typeof arguments[0]=="function"?arguments[0]:void 0,t=typeof arguments[0]=="number"?arguments[0]:arguments[1];if(typeof e=="function")this.manager.ready(e,t);else return new Promise(i=>{this.manager.ready(i,t)})}changing(e){return Z(this,null,function*(){var t,i;!this._refreshSignal&&!this._patching||(yield Promise.all([(t=this._refreshSignal)==null?void 0:t.call(this,e),(i=this._patching)==null?void 0:i.call(this,e)]))})}};Ae(bte,"ChangeLanguageMixin");var AEe=bte,vEe={warn:console.warn,error:console.error,info:console.info,debug:console.debug};function fte(o){let e,t=[],i=Ae((n,...s)=>{let r=s.join(" ");if(e){if(!e.debug)return;e.emit("log",{level:n,message:r})}else if(e=globalThis.VoerkaI18n,e&&e instanceof tte)if(e.debug){t.push([n,r]);let l=Ae((a,c)=>{o?o(a,c):vEe[a](c)},"log");e.on("log",({level:a,message:c})=>l(a,c)),t.forEach(([a,c])=>l(a,c))}else t.splice(0,t.length);else t.push([n,r])},"logOutput");return{warn:Ae((...n)=>i("warn",...n),"warn"),error:Ae((...n)=>i("error",...n),"error"),info:Ae((...n)=>i("info",...n),"info"),debug:Ae((...n)=>i("debug",...n),"debug")}}Ae(fte,"createLogger");var kEe=class extends Error{constructor(e){super(`Formatters of language<${e}> is not loaded,try to call load()`)}};Ae(kEe,"FormattersNotLoadedError");var Ite=class{constructor(e){an(this,"_formatters",[]),an(this,"_scope"),this._scope=e,this._formatters=e==null?void 0:e.options.formatters,this._registerFormatters()}get scope(){return this._scope}get formatters(){return this._formatters}_registerFormatters(){this._formatters&&this._formatters.forEach(e=>{Array.isArray(e)?this.register.apply(this,e):this.register.apply(this,[e])})}_addFormatter(e){try{if(this.scope.interpolator.addFilter(e),e){let t=this.scope.manager.scope;t.id!==this.scope.id&&t.interpolator.addFilter(e)}}catch(t){this.scope.logger.error(`fail while register formatter<${e.name}>:${t.stack}`)}}register(e,t,i){let n=this.scope,s=e.next;e.next=function(r,l,a){let c=a.getConfig;return a.getConfig=()=>Object.assign({},i,t==null?void 0:t[n.activeLanguage],c(e.name)),s.call(this,r,l,a)},this._addFormatter(e)}};Ae(Ite,"VoerkaI18nFormatterManager");var WEe=Ite;function Ate(o){return o&&typeof o=="object"&&o.__VoerkaI18nManager__}Ae(Ate,"isI18nManger");var vte=class{getLanguage(e){let t=this.languages.findIndex(i=>i.name==e);if(t!==-1)return this.languages[t]}getFallbackLanguage(e){let t=this.getLanguage(e);return t&&t.fallback||this.options.fallback||this._defaultLanguage}hasLanguage(e){return this.languages.findIndex(t=>t.name==e)!=-1}};Ae(vte,"LanguageMixin");var yEe=vte,kte=class{_getPluraMessage(e,t){try{return Array.isArray(e)?e.length>t?e[t]:e[e.length-1]:e}catch(i){return Array.isArray(e)?e[0]:e}}_getPluraValue(e){let t=null,i=[];if(zm(e)){let n=e;for(let[s,r]of Object.entries(n)){if(Gc(r))try{n[s]=r()}catch(a){n[s]=r}let l=typeof n[s]=="number";(t==null&&l||s.startsWith("$")&&l)&&(t=n[s])}i=[n]}else Array.isArray(e)?i=e.map(n=>{try{n=Gc(n)?n():n,e1(n)&&!t&&(t=parseInt(n))}catch(s){return String(n)}return n}):e!==void 0&&(t=e1(e)?parseInt(e):0,i=[e]);return[t,i]}_getTranslateComponent(){if(!this._translateComponent){let e=this.options.component||this.appScope.options.component;typeof e=="function"?this._translateComponent=e.call(this,this):(this._translateComponent=()=>{},this.logger.warn("No translate component builder configured"))}return this._translateComponent}_getTranslateTransformer(){if(!this._translateTransformer){let e=this.options.transform||this.appScope.options.transform;typeof e=="function"&&(this._translateTransformer=e.call(this,this))}return this._translateTransformer}_getActiveMessages(e){return typeof this.messages[e]=="function"?(this.logger.warn(`When the t function specifies the language <${e}> , only synchronized language packs can be used`),this.activeMessages):this.messages[e]}translate(e,t,i){if(typeof e!="string")return this.logger.debug(`failed to translate message:${e},it is not a string`),"";let n=(i==null?void 0:i.language)||this.activeLanguage,s=this._getActiveMessages(n);e=e.replace(/\n/g,"\\n");let r=e;if(typeof e!="string")return e;let l=t===void 0?[]:Gc(t)?t():t;try{if(t1(e))r=s[e]||e;else{let g=this.idMap[e];r=s[g]||s[e]||e}let[a,c]=this._getPluraValue(l);Array.isArray(r)&&r.length>0&&(a!==null?r=this._getPluraMessage(r,a):r=r[0]),l.length,r=this.interpolator.replace(r,...c),this._translateTransformer&&(i!=null&&i.transform)&&(r=this._translateTransformer(r,c,i))}catch(a){this.logger.error(`翻译失败:${a.stack}`)}return r}};Ae(kte,"TranslateMixin");var wEe=kte,Wte=class{_getStorage(){let e=this.storage;return $ee(e)?e:void 0}_getStorageKey(){return this.options.storageKey.replace("{scope}",this.id)}restoreLanguage(){let e=this._getStorage();if(e){let t=this._getStorageKey(),i=e.get(t);if(!i||!this.hasLanguage(i))return;this._activeLanguage=i,this.logger.debug(`从存储<${t}>中恢复保存的语言:${i}`)}}saveLanguage(){let e=this._getStorage();if(e){if(!this._activeLanguage)return;let t=this._getStorageKey();e.set(t,this.activeLanguage),this.logger.debug(`当前语言已保存到存储${t}=${this.activeLanguage}`)}}clearLanguage(){let e=this._getStorage();e&&e.remove(this._getStorageKey())}};Ae(Wte,"RestoreMixin");var SEe=Wte,BEe=Object.defineProperty,yte=Object.getOwnPropertySymbols,ZEe=Object.prototype.hasOwnProperty,NEe=Object.prototype.propertyIsEnumerable,wte=Ae((o,e,t)=>e in o?BEe(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,"R"),Ste=Ae((o,e)=>{for(var t in e||(e={}))ZEe.call(e,t)&&wte(o,t,e[t]);if(yte)for(var t of yte(e))NEe.call(e,t)&&wte(o,t,e[t]);return o},"b"),kf=(o=>typeof Jl<"u"?Jl:typeof Proxy<"u"?new Proxy(o,{get:Ae((e,t)=>(typeof Jl<"u"?Jl:e)[t],"get")}):o)(function(o){if(typeof Jl<"u")return Jl.apply(this,arguments);throw Error('Dynamic require of "'+o+'" is not supported')}),qm={Abort:Symbol("Abort"),Throw:Symbol("Throw"),Ignore:Symbol("Ignore")},xQ,Wf=(xQ=class extends Error{constructor(o){super(),this.value=o}},Ae(xQ,"a"),xQ),TQ,Um=(TQ=class extends Wf{},Ae(TQ,"p"),TQ),QQ,n1=(QQ=class extends Wf{},Ae(QQ,"x"),QQ),FQ,XQ=(FQ=class extends Wf{},Ae(FQ,"g"),FQ),GEe={name:"error",priority:"before",args:["operate","value"],default:{operate:"ignore"},next(o,e,t){let i=e.operate.toLowerCase(),n=e.value;return t.onError=(s,r,l,a)=>{if(!(s instanceof Error)||s instanceof Wf)throw s;if(i=="throw")throw n?new Error(n):s;if(i=="abort")throw new Um(n);if(i=="ignore")throw new n1(n);return r},o}},_Ee={name:"empty",priority:"before",args:["operate","value"],default:{operate:"abort",value:""},next(o,e,t){let i=e.operate.toLowerCase(),n=e.value;return t.onEmpty=()=>{if(i=="throw")throw new XQ;if(i=="abort")throw new Um(n);if(i=="ignore")throw new n1;return i},o}};function uW(o,...e){if(e.length===0)return o;let t=e.map((i,n)=>{let s=Object.entries(i||{});return s.some(([r,l])=>l===void 0)?s.reduce((r,[l,a])=>(a!==void 0&&(r[l]=a),r),{}):i});return Object.assign(o,...t)}Ae(uW,"F"),(o=>typeof kf<"u"?kf:typeof Proxy<"u"?new Proxy(o,{get:Ae((e,t)=>(typeof kf<"u"?kf:e)[t],"get")}):o)(function(o){if(typeof kf<"u")return kf.apply(this,arguments);throw Error('Dynamic require of "'+o+'" is not supported')});function HQ(o){if(typeof o!="object"||o===null)return!1;var e=Object.getPrototypeOf(o);if(e===null)return!0;for(var t=e;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return e===t}Ae(HQ,"y");function Bte(o){return o&&typeof o=="function"}Ae(Bte,"v");function MQ(o,e,t){if(typeof e=="string"){let i=0,n;for(;(n=o.indexOf(e,i))>-1;){let s=typeof t=="function"?t(e):t,r=o.length;o=o.substring(0,n)+s+o.substring(n+e.length),i=n+s.length+o.length-r}}else{let i;if(!e.global||!e.multiline)throw new Error("The search parameter must be enabled '/gm' option");for(;(i=e.exec(o))!==null;){i.index===e.lastIndex&&e.lastIndex++;let n=o.length,s=i[0].length,r=typeof t=="function"?t(i[0],...i):t;o=o.substring(0,i.index)+r+o.substring(i.index+s),e.lastIndex+=o.length-n}}return o}Ae(MQ,"w"),String.prototype.replaceAll||(String.prototype.replaceAll=function(o,e){return MQ(this,o,e)});function hW(o){return o.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}Ae(hW,"m");function Zte(o,e=!1){if(typeof o=="number")return!0;if(typeof o!="string"||e)return!1;try{if(o.includes(".")){let t=parseFloat(o);return o.endsWith(".")?!isNaN(t)&&String(t).length===o.length-1:!isNaN(t)&&String(t).length===o.length}else{let t=parseInt(o);return!isNaN(t)&&String(t).length===o.length}}catch(t){return!1}}Ae(Zte,"C");var VEe=/\n/gm,KEe=/(["'])(.*?)(\1)/gm,REe=/([\s\[\,\{])(\w+)(\s*\:)/gm;function Nte(o,e){try{return JSON.parse(o,(i,n)=>e?e(i,n):n)}catch(i){}let t=o.replace(VEe,(i,n,s)=>{let r=s.slice(0,n).trim(),l=s.slice(n+1).trim();return!/,$/.test(r)&&!/[\[\{\}]$/.test(r)&&!/^\}/.test(l)?`,
1183
1183
  `:`
1184
- `});return t=t.replaceAll(KEe,(i,n,s)=>`"${encodeURI(s)}"`),t=t.replaceAll(REe,(i,n,s,r)=>`${n}"${s}"${r}`),t=t.replaceAll(",",",").replaceAll("“",'"').replaceAll("”",'"'),JSON.parse(t,(i,n)=>(typeof n=="string"&&(n=decodeURI(n)),n))}Ae(Nte,"V");function Gte(o,e="{",t="}"){let i=0,n=0;for(;i<o.length;){let s=o.slice(i,i+e.length),r=o.slice(i,i+t.length);if(s==e){n++,o=o.substring(0,i+e.length)+`${n}%`+o.substring(i+e.length),i+=e.length+String(n).length+1;continue}if(r==t){n>0&&(o=o.substring(0,i)+`%${n}`+o.substring(i)),i+=t.length+String(n).length+1,n--;continue}i++}return o}Ae(Gte,"J");function _te(o,...e){return e.length==0&&(e.push(["{","}"]),e.push(["[","]"])),e.forEach(t=>{o.includes(t[0])&&o.includes(t[1])&&(o=Gte(o,...t))}),o}Ae(_te,"H");function Vte(o,e,t){return[[e,new RegExp(hW(e)+"\\d+%")],[t,new RegExp("%\\d+"+hW(t))]].forEach(([i,n])=>{let s;for(;(s=n.exec(o))!==null;)s.index===n.lastIndex&&n.lastIndex++,o=o.replace(n,i)}),o}Ae(Vte,"G");function o1(o,...e){return e.length==0&&(e.push(["{","}"]),e.push(["[","]"])),e.forEach(([t,i])=>{o.includes(t)&&o.includes(i)&&(o=Vte(o,t,i))}),o}Ae(o1,"E");function Kte(o){return o?o.trim().substring(1).trim().split("|").map(e=>e.trim()).map(e=>{if(e=="")return null;let t=e.indexOf("("),i=e.lastIndexOf(")");if(t!==-1&&i!==-1){let n=e.substring(t+1,i).trim(),s=Jte(n);return[e.substring(0,t),s]}else return[e,[]]}).filter(e=>Array.isArray(e)):[]}Ae(Kte,"M");function Rte(...o){o.length==0&&(o.push(["{","}"]),o.push(["[","]"]));let e=o.map(([t,i])=>`(${hW(t)}1%.*?%1${hW(i)})`);return JEe.replace("__TAG_REGEXP__",e.length>0?e.join("|")+"|":"")}Ae(Rte,"z");var JEe=String.raw`((([\'\"])(.*?)\3))|__TAG_REGEXP__([\d]+\.?[\d]?)|((true|false|null)(?=[,\b\s]))|([\w\.]+)|((?<=,)\s*(?=,))(?<=\s*[,\)]?\s*)`;function Jte(o){let e=[],t;o=_te(o);try{let i=new RegExp(Rte(),"g");for(;(t=i.exec(o))!==null;){t.index===i.lastIndex&&i.lastIndex++;let n=t[0];if(n.trim()=="")n=void 0;else if(n.startsWith("'")&&n.endsWith("'")||n.startsWith('"')&&n.endsWith('"'))n=n.substring(1,n.length-1),n=o1(n);else if(n.startsWith("{")&&n.endsWith("}")||n.startsWith("[")&&n.endsWith("]"))try{n=o1(n),n=Nte(n)}catch(s){}else["true","false","null"].includes(n)?n=JSON.parse(n):Zte(n)?n=parseFloat(n):n=o1(String(n));e.push(n)}}catch(i){}return e}Ae(Jte,"U");var DEe=new RegExp("(?<!\\\\)\\{([\\S]+\\s)?\\s*(\\w+)?((\\s*\\|\\s*\\w*(\\(.*?\\)){0,1}\\s*)*)\\s*(\\s[\\S]+)?\\}","gm");function jQ(o,e,t={}){let i=o,n,s=Object.assign({replaceAll:!0},t),r=DEe;for(r.lastIndex=0;(n=r.exec(i))!==null;){n.index===r.lastIndex&&r.lastIndex++;let l=n[2]||"",a=(n[1]||"").trim(),c=(n[6]||"").trim(),g=i.length,d=Kte(n[3]||"");if(Bte(e)){let u=e(l,a,c,d,n[0]);s.replaceAll?i=MQ(i,n[0],u):i=i.replace(n[0],u),r.lastIndex+=i.length-g}}return i}Ae(jQ,"O");function zQ(o,e){let t=e.value;if(o.length>0){let i=Yte.call(this,o,e);for(let n of i)try{t=n.call(this,t)}catch(s){if(s instanceof XQ)throw s;if(s instanceof Wf){if(s.value!=null&&(t=s.value),s instanceof Um)break}else throw s}}return this.options.isEmpty(t)||(t=`${e.prefix}${t}${e.suffix}`),t}Ae(zQ,"I");function Dte(o,e,t,i){if(!this.options.isEmpty(o))return o;let n=i.onEmpty||t.onEmpty||this.options.onEmpty;if(typeof n!="function")return o;let s=n.call(this,o,e,i);throw s instanceof Error?s:s==qm.Abort?new Um:s==qm.Ignore?new n1:s==qm.Throw?new XQ:new Um(s)}Ae(Dte,"K");function Lte(o,e,t,i,n){let s=n.onError||i.onError||this.options.onError;if(typeof s!="function")return e;let r=s.call(this,o,e,t,n);throw r instanceof Error?r:r==qm.Abort?new Um:r==qm.Ignore?new n1:r==qm.Throw?o:new Um(r)}Ae(Lte,"Q");function Ote(o,e,t){var i;let n=Object.assign({},typeof o.default=="function"?o.default():o.default);return e.length==1&&HQ(e[0])?uW(n,e[0]):o.args&&((i=o.args)==null?void 0:i.length)>0&&o.args.forEach((s,r)=>{e[r]!==void 0&&(n[s]=e[r])}),s=>{let r;try{t.args=e,r=o.next.call(this,s,n,t),r=Dte.call(this,r,n,o,t)}catch(l){if(l.filter=o.name,l instanceof Wf)throw l;return this.log(`当执行过滤器器<${t.match}:${o.name}>时出错:${l.stack}`),Lte.call(this,l,s,n,o,t)}return String(r)}}Ae(Ote,"Y");function Ete(o){let e=[],t=o.map(([i,n])=>[this.getFilter.call(this,i),n]).filter(([i])=>i!=null);return t=t.reduce((i,[n,s])=>(n&&(n.priority=="before"?i.unshift([n,s]):n.priority=="after"?e.push([n,s]):i.push([n,s])),i),[]),t.concat(e)}Ae(Ete,"Z");function Yte(o,e){let t=Ete.call(this,o),i=[];for(let[n,s]of t)i.push(Ote.call(this,n,s,e));return i}Ae(Yte,"ee");var qQ,LEe=(qQ=class{constructor(o){this.options=uW({log:console.log,filters:{},missing:"default",filterContext:{}},o),this.addDefaultHandlers(),this.addBuildinFilters(),this.normalizeFilters()}get filters(){return this.options.filters}addDefaultHandlers(){this.options.onError=()=>qm.Ignore,this.options.onEmpty=()=>"",this.options.isEmpty=o=>o===null||o===""}addFilter(o){if(!o.name)throw new Error("Filter name cannot be empty");if(typeof o.next!="function")throw new Error("The filter must provide a next function");return o=uW({priority:"normal"},o),this.filters[o.name]=o}removeFilter(o){delete this.filters[o]}getFilter(o){var e;if(o in this.options.filters)return this.options.filters[o];{let t=(e=this.options.getFilter)==null?void 0:e.call(this,o);return typeof t=="function"?{name:o,next:t}:o in String.prototype?{name:o,next:Ae((i,n,s)=>i[o](...s.args),"next")}:t}}addBuildinFilters(){this.addFilter(GEe),this.addFilter(_Ee)}normalizeFilters(){Object.entries(this.options.filters).forEach(([o,e])=>{let t=uW({name:o,priority:"normal",args:null,next:Ae(i=>i,"next")},typeof e=="function"?{filter:e}:e);this.options.filters[o]=t})}getMissingValue(o,e){let t=this.options.missing;if(t=="default")return"";if(t=="ignore")return e;if(typeof t=="function")return t.call(this,o)}replace(o,...e){if(e.length===0)return o;if(e.length===1&&typeof e[0]=="function"&&(e[0]=e[0].call(this)),e.length===1&&HQ(e[0])){let t=e[0];return jQ.call(this,o,(i,n,s,r,l)=>{let a=i in t?t[i]:this.getMissingValue(i,l);return typeof a=="function"&&(a=a.call(this)),zQ.call(this,r,Ste({name:i,value:a,prefix:n,suffix:s,template:o,match:l,args:[]},this.options.filterContext))})}else{let t=e.length===1&&Array.isArray(e[0])?[...e[0]]:e,i=0;return jQ.call(this,o,(n,s,r,l,a)=>{let c=t.length>i?t[i++]:this.getMissingValue(i,a);return typeof c=="function"&&(c=c.call(this)),zQ.call(this,l,Ste({name:n,value:c,prefix:s,suffix:r,template:o,match:a,args:[]},this.options.filterContext))},{replaceAll:!1})}}log(o,...e){this.options.debug&&this.options.log(o,...e)}},Ae(qQ,"$"),qQ);function xte(o,e,t){let{defaultValue:i,delimiter:n,matched:s}=Object.assign({delimiter:"."},t);if(!o||typeof e!="string")return i;if(!e)return o;let r=e.split(n),l=o,a,c;try{for(let g of r)if(l instanceof Map||l instanceof WeakMap){if(!l.has(g))return i;a=l,c=g,l=l.get(g)}else if(l instanceof Set){let d=parseInt(g,10);if(d>=l.size)return i;a=l,c=d,l=[...l][d]}else if(l&&typeof l=="object"&&g in l)a=l,c=Array.isArray(l)?parseInt(g):g,l=l[g];else return i}catch(g){return i}return typeof s=="function"&&s({value:l,parent:a,indexOrKey:c}),l}Ae(xte,"u");var Tte=class{constructor(){an(this,"_flexVars")}_initInterpolators(){this._flexVars=new LEe({filterContext:{getConfig:Ae(e=>{let t=this.activeMessages.$config||{};return e?xte(t,e):t},"getConfig"),scope:this}})}};Ae(Tte,"InterpolatorMixin");var OEe=Tte;function Qte(o,...e){if(e.length===0)return o;let t=e.map((i,n)=>{let s=Object.entries(i||{});return s.some(([r,l])=>l===void 0)?s.reduce((r,[l,a])=>(a!==void 0&&(r[l]=a),r),{}):i});return Object.assign(o,...t)}Ae(Qte,"u");var UQ=class Qre extends ate(gEe,hEe,AEe,yEe,wEe,OEe,SEe){constructor(e){super(),an(this,"__VoerkaI18nScope__",!0),an(this,"_options"),an(this,"_manager"),an(this,"_formatterManager",null),an(this,"_logger"),an(this,"_defaultLanguage","zh-CN"),an(this,"_activeLanguage","zh-CN"),an(this,"_activeMessages",{}),an(this,"_patchedMessages",{}),an(this,"_translateComponent"),an(this,"_translateTransformer"),an(this,"_activeParagraphs",{}),an(this,"$id",++Qre.idSeq),this._options=Qte({id:qee(),library:!1,debug:!1,injectLangAttr:!0,languages:[],messages:{},paragraphs:{},idMap:{},formatters:[],attached:!0,storageKey:"language",cachePatch:!0},e),this._init()}get id(){return this._options.id}get options(){return this._options}get attached(){return this._options.attached}get debug(){return this._options.debug}get library(){return this._options.library}get formatters(){return this._formatterManager}get defaultLanguage(){return this._defaultLanguage}get defaultMessages(){return this.messages[this.defaultLanguage]}get messages(){return this._options.messages}get paragraphs(){return this._options.paragraphs}get idMap(){return this._options.idMap}get languages(){return this._options.languages}get manager(){return this._manager}get appScope(){return this._manager.scope}get interpolator(){return this._flexVars}get logger(){return this._logger}get t(){return this.translate.bind(this)}get Translate(){return this._getTranslateComponent()}get activeMessages(){return this._activeMessages}get activeParagraphs(){return this._activeParagraphs}get activeLanguage(){return this._activeLanguage}get storage(){return this.getScopeOption("storage")}get loader(){return this.getScopeOption("loader")}get $t(){return(e,t,i)=>(this._getTranslateTransformer(),i||(i={}),i.transform=!0,this.translate(e,t,i))}getScopeOption(e){let t=this._options;return this.attached?t[e]||(this.library?this._manager[e]:void 0):t[e]}_initOptions(){if(!Array.isArray(this.languages))this.logger.warn("[VoerkaI18n] invalid language settings, will use default language settings."),this._options.languages=Object.assign([],iEe);else if(this.languages.length==0)throw new Error("[VoerkaI18n] must provide valid language settings.");let e,t;this.languages.forEach(n=>{n.default&&(t=n.name),n.active&&(e=n.name)});let i=this._options.messages;if(t in i||(t=Object.keys(i)[0]),e in i||(e=t),!(t in i))throw new Error("[VoerkaI18n] invalid language configuration, must provide valid default and active languages.");if(this._activeLanguage=e,this._defaultLanguage=t,!this._options.library&&!this._options.storage&&(this._options.storage=tEe),Gc(this.messages[this._defaultLanguage]))throw new Error("[VoerkaI18n] default language pack must be static content, can't use async load way.");this._activeMessages=this.messages[this._activeLanguage],this._activeParagraphs=this.paragraphs[this._activeLanguage]}_init(){this._logger=fte(this._options.log),this._initOptions(),this.library||this.restoreLanguage(),this._initInterpolators(),this.registerToManager(),this._formatterManager=new WEe(this)}bind(e){this._manager=e,this._manager.once("init",this._initRefresh.bind(this))}_initRefresh(e){if(this.library)this.refresh(e&&e());else{let t=[];(this._defaultLanguage!==this._activeLanguage||Gc(this.activeMessages))&&t.push(this.refresh(void 0,{patch:!1})),t.push(this._patch()),Promise.all(t).then(()=>{this.emit("ready",this.activeLanguage,!0),this._setLanguageAttr()})}}registerToManager(){if(!this.attached)return;let e=!this.options.library;e&&(globalThis.VoerkaI18n&&globalThis.VoerkaI18n.scope&&JQ()&&console.warn("Only can have one i18nScope with library=false"),this._manager=new tte(this));let t=globalThis.VoerkaI18n;t&&Ate(t)?e?this._initRefresh():t.register(this):(globalThis.__VoerkaI18nScopes__||(globalThis.__VoerkaI18nScopes__=[]),globalThis.__VoerkaI18nScopes__.push(this))}change(e){return Z(this,null,function*(){let t=this.activeLanguage;return this.attached?t=yield this._manager.change(e):t=yield this.refresh(e),t})}_setLanguageAttr(){if(!(this.library||!JQ()))try{let e=this._options.injectLangAttr;if(!e)return;let t=e===!0?document.body:document.body.querySelector(e);t&&t.setAttribute("lang",this.activeLanguage)}catch(e){}}getRawMessage(e){if(t1(e)){if(e in this.defaultMessages)return this.defaultMessages[e]}else return e}getMessageId(e){if(t1(e))return e;if(e in this.idMap)return this.idMap[e]}};Ae(UQ,"VoerkaI18nScope"),an(UQ,"idSeq",0);var EEe=UQ;function YEe(o,e,t){return i=>{let n=o.next;return o.next=function(s,r,l){let a=l.getConfig;return l.getConfig=()=>Object.assign({},t,e==null?void 0:e[i.activeLanguage],a(o.name)),n.call(this,s,r,l)},o}}Ae(YEe,"createFormatter");function xEe(o){let e=globalThis.VoerkaI18n;e?e.registerPlugin(o):(globalThis.__VoerkaI18nPlugins__||(globalThis.__VoerkaI18nPlugins__=[]),globalThis.__VoerkaI18nPlugins__.push(o))}Ae(xEe,"definePlugin");const TEe={get(o){if(globalThis.localStorage)return globalThis.localStorage.getItem(o)},set(o,e){globalThis.localStorage&&globalThis.localStorage.setItem(o,e)},remove(o){globalThis.localStorage&&globalThis.localStorage.removeItem(o)}};var QEe=Object.defineProperty,$o=(o,e)=>QEe(o,"name",{value:e,configurable:!0}),yf=(o=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(o,{get:(e,t)=>(typeof require!="undefined"?require:e)[t]}):o)(function(o){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+o+'" is not supported')});function Fte(o,e=!1){if(typeof o=="number")return!0;if(typeof o!="string"||e)return!1;try{if(o.includes(".")){let t=parseFloat(o);return o.endsWith(".")?!isNaN(t)&&String(t).length===o.length-1:!isNaN(t)&&String(t).length===o.length}else{let t=parseInt(o);return!isNaN(t)&&String(t).length===o.length}}catch(t){return!1}}$o(Fte,"r"),(o=>typeof yf<"u"?yf:typeof Proxy<"u"?new Proxy(o,{get:$o((e,t)=>(typeof yf<"u"?yf:e)[t],"get")}):o)(function(o){if(typeof yf<"u")return yf.apply(this,arguments);throw Error('Dynamic require of "'+o+'" is not supported')});function Xte(o,e=3){let t=new RegExp(String.raw`(?!^)(?=(\d{${e}})+$)`,"g"),i=o.replace(t,",");return i.startsWith(",")&&(i=i.substring(1)),i.endsWith(",")&&(i=i.substring(0,i.length-2)),i}$o(Xte,"addSplitChars");function PQ(o,e){let{symbol:t="",division:i=3,prefix:n="",precision:s=-1,suffix:r="",unit:l=0,radix:a=3,units:c=[],format:g="{symbol}{value}{unit}"}=e,[d,u]=String(o).split(".");l>0&&a>0&&(d.length<a*l&&(d=Array.from({length:a*l-d.length+1}).fill(0).join("")+d),u=d.substring(Number(d),d.length-a*l)+u,d=d.substring(0,d.length-a*l),d==""&&(d="0"));let h=[];h.push(Xte(d,i)),u&&Fte(s)&&s!=0&&(s==0||(s==-1?h.push(`.${u}`):s>0&&(s<0?u=String(parseFloat(`0.${u}`)):u=String(parseFloat(`0.${u}`).toFixed(s)).split(".")[1],h.push(`.${u}`))));const m=c[l]||"";return g.replace("{value}",h.join("")).replace("{symbol}",t).replace("{prefix}",n).replace("{suffix}",r).replace("{unit}",m)}$o(PQ,"toCurrency");var FEe=[{name:"currency",args:["format","unit","precision","prefix","suffix","division","symbol","radix"],next(o,e,t){const i=t.getConfig(),n=Object.assign({},i,e);return n.format in n&&(n.format=n[n.format]),n.unit=parseInt(String(n.unit))||0,n.unit>n.units.length-1&&(n.unit=n.units.length-1),n.unit<0&&(n.unit=0),n.unit>0&&n.precision==2&&(n.precision=-1),PQ(o,n)}},{"en-US":{units:[""," thousands"," millions"," billions"," trillions"],radix:3,symbol:"$",prefix:"USD",suffix:"",division:3,precision:2},"zh-CN":{units:["","万","亿","万亿","万万亿"],radix:4,symbol:"¥",prefix:"RMB",suffix:"元",division:4,precision:2}},{default:"{symbol}{value}{unit}",long:"{prefix} {symbol}{value}{unit}{suffix}",short:"{symbol}{value}{unit}",custom:"{prefix} {symbol}{value}{unit}{suffix}",format:"default"}],XEe=[{name:"number",args:["precision","division"],next(o,e,t){const i=t.getConfig();return PQ(o,Object.assign({},i,e))}},{"en-US":{division:3},"zh-CN":{division:4}}];function Vu(o){return o instanceof Date?o:new Date(o)}$o(Vu,"toDate");var HEe=[{name:"timeSlots",args:["upper"],default:{upper:!0},next(o,e,t){const i=t.getConfig(),n=Vu(o).getHours(),s=!!e.upper;let r=i.slots.findIndex(l=>n<l);return r===-1&&(r=i.upperCases.length-1),s?i.upperCases[r]:i.lowerCases[r]}},{"en-US":{slots:[12],lowerCases:["am","pm"],upperCases:["AM","PM"]},"zh-CN":{slots:[5,8,11,13,18],lowerCases:["凌晨","早上","上午","中午","下午","晚上"],upperCases:["凌晨","早上","上午","中午","下午","晚上"]}}];function $Q(o,...e){if(e.length===0)return o;let t=e.map((i,n)=>{let s=Object.entries(i||{});return s.some(([r,l])=>l===void 0)?s.reduce((r,[l,a])=>(a!==void 0&&(r[l]=a),r),{}):i});return Object.assign(o,...t)}$o($Q,"u");var s1={en:{month:{long:["January","February","March","April","May","June","July","August","September","October","November","December"],short:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec"]},weekday:{long:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],short:["Sun","Mon","Tues","Wed","Thur","Fri","Sat"]}},cn:{month:{long:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],short:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"]},weekday:{long:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],short:["周日","周一","周二","周三","周四","周五","周六"]}}},Hte={en:{slots:[12],names:["AM","PM"]},cn:{slots:[6,9,11,13,18],names:["凌晨","早上","上午","中午","下午","晚上"]}},MEe="YYYY-MM-DD HH:mm:ss";function eF(o){o<0&&o>23&&(o=0);let e=[0,...Hte[this.language].slots,24].findIndex(t=>t>o)-1;return Hte[this.language].names[e]}$o(eF,"h");function tF(o,e,t){let i=$Q({language:"cn"},t),n=o instanceof Date?o:new Date(o||Date.now()),s=n.getHours(),r=String(s).padStart(2,"0"),l=s>12?s-12:s,a=String(l).padStart(2,"0"),c=String(n.getMinutes()),g=String(n.getSeconds()),d=String(n.getMilliseconds()),u=String(n.getFullYear()),h=n.getMonth(),m=n.getDay(),p=String(n.getDate()),b=[["HH",r],["H",s],["hh",a],["h",l],["mm",c.padStart(2,"0")],["m",c],["ss",g.padStart(2,"0")],["s",g],["SSS",d.padStart(3,"0")],["A",s>12?"PM":"AM"],["a",s>12?"pm":"am"],["t",eF.call(i,s)],["T",eF.call(i,s)],["YYYY",u],["yyyy",u],["YY",u.substring(2)],["MMM",s1[i.language].month.short[h]],["MM",String(h+1).padStart(2,"0")],["M",h+1],["DD",p.padStart(2,"0")],["D",p],["d",m],["dd",s1[i.language].weekday.short[m]],["ddd",s1[i.language].weekday.short[m]],["dddd",s1[i.language].weekday.long[m]]],f=e||MEe;return b.forEach(([I,A])=>f=f.replaceAll(I,A)),f}$o(tF,"H");function Mte(o,e,t){if(typeof e=="string"){let i=0,n;for(;(n=o.indexOf(e,i))>-1;){let s=typeof t=="function"?t(e):t,r=o.length;o=o.substring(0,n)+s+o.substring(n+e.length),i=n+s.length+o.length-r}}else{let i;if(!e.global||!e.multiline)throw new Error("The search parameter must be enabled '/gm' option");for(;(i=e.exec(o))!==null;){i.index===e.lastIndex&&e.lastIndex++;let n=o.length,s=i[0].length,r=typeof t=="function"?t(i[0],...i):t;o=o.substring(0,i.index)+r+o.substring(i.index+s),e.lastIndex+=o.length-n}}return o}$o(Mte,"s"),String.prototype.replaceAll||(String.prototype.replaceAll=function(o,e){return Mte(this,o,e)});var jte={local:$o(o=>o.toLocaleString(),"local"),iso:$o(o=>o.toISOString(),"iso"),utc:$o(o=>o.toUTCString(),"utc"),gmt:$o(o=>o.toGMTString(),"gmt")},jEe=[{global:!0,name:"date",args:["format"],next(o,e,t){const i=t.getConfig(),n=Vu(o);let s=e.format||i.format;if(s in jte)return jte[s](n);if(s in i&&(s=i[s],typeof s=="function"))return s(n);if(typeof s=="string")return tF(n,s)}},{"en-US":{long:"YYYY/MM/DD HH:mm:ss",short:"YYYY/MM/DD"},"zh-CN":{long:"YYYY年M月D日 HH点mm分ss秒",short:"YYYY年M月D日"}},{format:"local"}],zte={local:$o(o=>o.toLocaleTimeString(),"local"),timestamp:$o(o=>o.getTime(),"timestamp")},zEe=[{name:"time",args:["format"],next(o,e,t){const i=t.getConfig(),n=Vu(o);let s=e.format||i.format;if(s in zte)return zte[s](n);if(s in i&&(s=i[s],typeof s=="function"))return s(n);if(typeof s=="string")return tF(n,s)}},{"en-US":{long:"HH:mm:ss"},"zh-CN":{long:"HH点mm分ss秒"}},{format:"local",short:"HH:mm:ss"}],qEe=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],UEe=["周日","周一","周二","周三","周四","周五","周六"],PEe=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],$Ee=["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],eYe=[{name:"weekday",args:["format"],next(o,e,t){const i=t.getConfig(),n=Vu(o).getDay(),s=e.format||"long";if(typeof s=="string"&&s in i){const r=i[s];return typeof r=="function"?r(n):r[n]}return n}},{"en-US":{long:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],short:["Sun","Mon","Tues","Wed","Thur","Fri","Sat"]},"zh-CN":{long:qEe,short:UEe}},{format:"long"}],tYe=[{name:"month",args:["format"],next(o,e,t){const i=t.getConfig(),n=Vu(o).getMonth()+1,s=e.format||i.format;if(typeof s=="string"&&s in i){const r=i[s];return typeof r=="function"?r(n):r[n-1]}return n}},{"en-US":{long:["January","February","March","April","May","June","July","August","September","October","November","December"],short:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec"]},"zh-CN":{long:PEe,short:$Ee}},{format:"long"}],iYe=[{name:"quarter",args:["format"],next(o,e,t){const i=t.getConfig(),n=Vu(o).getMonth()+1,s=Math.floor(n%3==0?n/3:n/3+1)-1,r=e.format||i.format;if(typeof r=="string"&&r in i){const l=i[r];return typeof l=="function"?l(s):l[s]}return s}},{"en-US":{long:["First Quarter","Second Quarter","Third Quarter","Fourth Quarter"]},"zh-CN":{long:["一季度","二季度","三季度","四季度"]}},{format:"short",short:["Q1","Q2","Q3","Q4"]}],mW=[1e3,6e4,36e5,864e5,6048e5,2592e6,31536e6,Number.MAX_SAFE_INTEGER];function qte(o,e,t){let{units:i,now:n,before:s,after:r}=$Q({units:["秒","分钟","小时","天","周","个月","年"],now:"刚刚",before:"{value}{unit}前",after:"{value}{unit}后"},t),l=typeof o=="number"?new Date(o).getTime():o.getTime(),a=(e instanceof Date?e:typeof e=="number"?new Date(e):new Date).getTime(),c=l-a,g=mW.findIndex(d=>Math.abs(c)<d)-1;if(g<0&&(g=0),g>mW.length-1&&(g=mW.length-1),c<1e3&&c>-1e3)return n;if(c<=-1e3){let d=parseInt(String(Math.abs(c)/mW[g]));return s.replace("{value}",d).replace("{unit}",i[g])}else{let d=parseInt(String(Math.abs(c)/mW[g]));return r.replace("{value}",d).replace("{unit}",i[g])}}$o(qte,"b");var nYe=[{name:"relativeTime",args:["base"],default:$o(()=>({base:new Date}),"default"),next(o,e,t){const i=t.getConfig(),n=e.base||new Date;return qte(Vu(o),n,i)}},{"en-US":{units:["seconds","minutes","hours","days","weeks","months","years"],now:"Just now",before:"{value} {unit} ago",after:"after {value} {unit}"},"zh-CN":{units:["秒","分钟","小时","天","周","个月","年"],now:"刚刚",before:"{value}{unit}前",after:"{value}{unit}后"}}],oYe=[FEe,XEe,HEe,jEe,zEe,eYe,tYe,iYe,nYe];const sYe=(o,e)=>Z(this,null,function*(){return yield(yield fetch(MxPluginContext.getLoaderLanguageUrl(o,e))).json()}),rYe={"zh-CN":{},"en-US":{},"ko-KR":{}},lYe={代码编辑:4,运行:5},aYe=void 0,cYe=void 0,gYe={languages:[{name:"zh-CN",title:"中文",active:!0,default:!0},{name:"en-US",title:"英语"},{name:"ko-KR",title:"韩语"},{name:"zh-TW",title:"繁体中文"}],library:!0,debug:!1},dYe={"zh-CN":{},"en-US":()=>Promise.resolve().then(()=>$Me),"ko-KR":()=>Promise.resolve().then(()=>e4e),"zh-TW":()=>Promise.resolve().then(()=>t4e)},CW=new EEe(T({id:"pluginCodeEdit__1_0_0",idMap:lYe,formatters:oYe,storage:TEe,messages:dYe,paragraphs:rYe,component:aYe,loader:sYe,transform:cYe},gYe));CW.t,CW.$t,CW.Translate;const Ute=Se.ref();CW.on("change",o=>{Ute.value=o});const Ku=(o,...e)=>(Ute.value,CW.t(o,...e));MxPluginContext.addDrawerComponent("CodeEditor",{isShow:jm,component:Se.defineAsyncComponent(()=>Promise.resolve().then(()=>n4e)),width:600,title:Ku("代码编辑")}),MxPluginContext.addCommand("Mx_CodeEditor",o=>{if(typeof o=="string"){jm.value=!0,RQ({name:"AI"+Ku("生成"),type:"AI",code:o});return}jm.value=!jm.value}),MxPluginContext.getUiConfig().then(o=>{var i,n;(i=o==null?void 0:o.leftDrawerComponents)!=null&&i.includes("CodeEditor")||(n=o==null?void 0:o.leftDrawerComponents)==null||n.push("CodeEditor");const e={icon:"class: iconfont daimabianji",prompt:Ku("代码编辑"),cmd:"Mx_CodeEditor"};o.mTopButtonBarData||(o.mTopButtonBarData=[]),o.mTopButtonBarData.some(s=>s.cmd===e.cmd&&e.prompt===e.prompt)||o.mTopButtonBarData.push(e)});/*!-----------------------------------------------------------------------------
1184
+ `});return t=t.replaceAll(KEe,(i,n,s)=>`"${encodeURI(s)}"`),t=t.replaceAll(REe,(i,n,s,r)=>`${n}"${s}"${r}`),t=t.replaceAll(",",",").replaceAll("“",'"').replaceAll("”",'"'),JSON.parse(t,(i,n)=>(typeof n=="string"&&(n=decodeURI(n)),n))}Ae(Nte,"V");function Gte(o,e="{",t="}"){let i=0,n=0;for(;i<o.length;){let s=o.slice(i,i+e.length),r=o.slice(i,i+t.length);if(s==e){n++,o=o.substring(0,i+e.length)+`${n}%`+o.substring(i+e.length),i+=e.length+String(n).length+1;continue}if(r==t){n>0&&(o=o.substring(0,i)+`%${n}`+o.substring(i)),i+=t.length+String(n).length+1,n--;continue}i++}return o}Ae(Gte,"J");function _te(o,...e){return e.length==0&&(e.push(["{","}"]),e.push(["[","]"])),e.forEach(t=>{o.includes(t[0])&&o.includes(t[1])&&(o=Gte(o,...t))}),o}Ae(_te,"H");function Vte(o,e,t){return[[e,new RegExp(hW(e)+"\\d+%")],[t,new RegExp("%\\d+"+hW(t))]].forEach(([i,n])=>{let s;for(;(s=n.exec(o))!==null;)s.index===n.lastIndex&&n.lastIndex++,o=o.replace(n,i)}),o}Ae(Vte,"G");function o1(o,...e){return e.length==0&&(e.push(["{","}"]),e.push(["[","]"])),e.forEach(([t,i])=>{o.includes(t)&&o.includes(i)&&(o=Vte(o,t,i))}),o}Ae(o1,"E");function Kte(o){return o?o.trim().substring(1).trim().split("|").map(e=>e.trim()).map(e=>{if(e=="")return null;let t=e.indexOf("("),i=e.lastIndexOf(")");if(t!==-1&&i!==-1){let n=e.substring(t+1,i).trim(),s=Jte(n);return[e.substring(0,t),s]}else return[e,[]]}).filter(e=>Array.isArray(e)):[]}Ae(Kte,"M");function Rte(...o){o.length==0&&(o.push(["{","}"]),o.push(["[","]"]));let e=o.map(([t,i])=>`(${hW(t)}1%.*?%1${hW(i)})`);return JEe.replace("__TAG_REGEXP__",e.length>0?e.join("|")+"|":"")}Ae(Rte,"z");var JEe=String.raw`((([\'\"])(.*?)\3))|__TAG_REGEXP__([\d]+\.?[\d]?)|((true|false|null)(?=[,\b\s]))|([\w\.]+)|((?<=,)\s*(?=,))(?<=\s*[,\)]?\s*)`;function Jte(o){let e=[],t;o=_te(o);try{let i=new RegExp(Rte(),"g");for(;(t=i.exec(o))!==null;){t.index===i.lastIndex&&i.lastIndex++;let n=t[0];if(n.trim()=="")n=void 0;else if(n.startsWith("'")&&n.endsWith("'")||n.startsWith('"')&&n.endsWith('"'))n=n.substring(1,n.length-1),n=o1(n);else if(n.startsWith("{")&&n.endsWith("}")||n.startsWith("[")&&n.endsWith("]"))try{n=o1(n),n=Nte(n)}catch(s){}else["true","false","null"].includes(n)?n=JSON.parse(n):Zte(n)?n=parseFloat(n):n=o1(String(n));e.push(n)}}catch(i){}return e}Ae(Jte,"U");var DEe=new RegExp("(?<!\\\\)\\{([\\S]+\\s)?\\s*(\\w+)?((\\s*\\|\\s*\\w*(\\(.*?\\)){0,1}\\s*)*)\\s*(\\s[\\S]+)?\\}","gm");function jQ(o,e,t={}){let i=o,n,s=Object.assign({replaceAll:!0},t),r=DEe;for(r.lastIndex=0;(n=r.exec(i))!==null;){n.index===r.lastIndex&&r.lastIndex++;let l=n[2]||"",a=(n[1]||"").trim(),c=(n[6]||"").trim(),g=i.length,d=Kte(n[3]||"");if(Bte(e)){let u=e(l,a,c,d,n[0]);s.replaceAll?i=MQ(i,n[0],u):i=i.replace(n[0],u),r.lastIndex+=i.length-g}}return i}Ae(jQ,"O");function zQ(o,e){let t=e.value;if(o.length>0){let i=Yte.call(this,o,e);for(let n of i)try{t=n.call(this,t)}catch(s){if(s instanceof XQ)throw s;if(s instanceof Wf){if(s.value!=null&&(t=s.value),s instanceof Um)break}else throw s}}return this.options.isEmpty(t)||(t=`${e.prefix}${t}${e.suffix}`),t}Ae(zQ,"I");function Dte(o,e,t,i){if(!this.options.isEmpty(o))return o;let n=i.onEmpty||t.onEmpty||this.options.onEmpty;if(typeof n!="function")return o;let s=n.call(this,o,e,i);throw s instanceof Error?s:s==qm.Abort?new Um:s==qm.Ignore?new n1:s==qm.Throw?new XQ:new Um(s)}Ae(Dte,"K");function Lte(o,e,t,i,n){let s=n.onError||i.onError||this.options.onError;if(typeof s!="function")return e;let r=s.call(this,o,e,t,n);throw r instanceof Error?r:r==qm.Abort?new Um:r==qm.Ignore?new n1:r==qm.Throw?o:new Um(r)}Ae(Lte,"Q");function Ote(o,e,t){var i;let n=Object.assign({},typeof o.default=="function"?o.default():o.default);return e.length==1&&HQ(e[0])?uW(n,e[0]):o.args&&((i=o.args)==null?void 0:i.length)>0&&o.args.forEach((s,r)=>{e[r]!==void 0&&(n[s]=e[r])}),s=>{let r;try{t.args=e,r=o.next.call(this,s,n,t),r=Dte.call(this,r,n,o,t)}catch(l){if(l.filter=o.name,l instanceof Wf)throw l;return this.log(`当执行过滤器器<${t.match}:${o.name}>时出错:${l.stack}`),Lte.call(this,l,s,n,o,t)}return String(r)}}Ae(Ote,"Y");function Ete(o){let e=[],t=o.map(([i,n])=>[this.getFilter.call(this,i),n]).filter(([i])=>i!=null);return t=t.reduce((i,[n,s])=>(n&&(n.priority=="before"?i.unshift([n,s]):n.priority=="after"?e.push([n,s]):i.push([n,s])),i),[]),t.concat(e)}Ae(Ete,"Z");function Yte(o,e){let t=Ete.call(this,o),i=[];for(let[n,s]of t)i.push(Ote.call(this,n,s,e));return i}Ae(Yte,"ee");var qQ,LEe=(qQ=class{constructor(o){this.options=uW({log:console.log,filters:{},missing:"default",filterContext:{}},o),this.addDefaultHandlers(),this.addBuildinFilters(),this.normalizeFilters()}get filters(){return this.options.filters}addDefaultHandlers(){this.options.onError=()=>qm.Ignore,this.options.onEmpty=()=>"",this.options.isEmpty=o=>o===null||o===""}addFilter(o){if(!o.name)throw new Error("Filter name cannot be empty");if(typeof o.next!="function")throw new Error("The filter must provide a next function");return o=uW({priority:"normal"},o),this.filters[o.name]=o}removeFilter(o){delete this.filters[o]}getFilter(o){var e;if(o in this.options.filters)return this.options.filters[o];{let t=(e=this.options.getFilter)==null?void 0:e.call(this,o);return typeof t=="function"?{name:o,next:t}:o in String.prototype?{name:o,next:Ae((i,n,s)=>i[o](...s.args),"next")}:t}}addBuildinFilters(){this.addFilter(GEe),this.addFilter(_Ee)}normalizeFilters(){Object.entries(this.options.filters).forEach(([o,e])=>{let t=uW({name:o,priority:"normal",args:null,next:Ae(i=>i,"next")},typeof e=="function"?{filter:e}:e);this.options.filters[o]=t})}getMissingValue(o,e){let t=this.options.missing;if(t=="default")return"";if(t=="ignore")return e;if(typeof t=="function")return t.call(this,o)}replace(o,...e){if(e.length===0)return o;if(e.length===1&&typeof e[0]=="function"&&(e[0]=e[0].call(this)),e.length===1&&HQ(e[0])){let t=e[0];return jQ.call(this,o,(i,n,s,r,l)=>{let a=i in t?t[i]:this.getMissingValue(i,l);return typeof a=="function"&&(a=a.call(this)),zQ.call(this,r,Ste({name:i,value:a,prefix:n,suffix:s,template:o,match:l,args:[]},this.options.filterContext))})}else{let t=e.length===1&&Array.isArray(e[0])?[...e[0]]:e,i=0;return jQ.call(this,o,(n,s,r,l,a)=>{let c=t.length>i?t[i++]:this.getMissingValue(i,a);return typeof c=="function"&&(c=c.call(this)),zQ.call(this,l,Ste({name:n,value:c,prefix:s,suffix:r,template:o,match:a,args:[]},this.options.filterContext))},{replaceAll:!1})}}log(o,...e){this.options.debug&&this.options.log(o,...e)}},Ae(qQ,"$"),qQ);function xte(o,e,t){let{defaultValue:i,delimiter:n,matched:s}=Object.assign({delimiter:"."},t);if(!o||typeof e!="string")return i;if(!e)return o;let r=e.split(n),l=o,a,c;try{for(let g of r)if(l instanceof Map||l instanceof WeakMap){if(!l.has(g))return i;a=l,c=g,l=l.get(g)}else if(l instanceof Set){let d=parseInt(g,10);if(d>=l.size)return i;a=l,c=d,l=[...l][d]}else if(l&&typeof l=="object"&&g in l)a=l,c=Array.isArray(l)?parseInt(g):g,l=l[g];else return i}catch(g){return i}return typeof s=="function"&&s({value:l,parent:a,indexOrKey:c}),l}Ae(xte,"u");var Tte=class{constructor(){an(this,"_flexVars")}_initInterpolators(){this._flexVars=new LEe({filterContext:{getConfig:Ae(e=>{let t=this.activeMessages.$config||{};return e?xte(t,e):t},"getConfig"),scope:this}})}};Ae(Tte,"InterpolatorMixin");var OEe=Tte;function Qte(o,...e){if(e.length===0)return o;let t=e.map((i,n)=>{let s=Object.entries(i||{});return s.some(([r,l])=>l===void 0)?s.reduce((r,[l,a])=>(a!==void 0&&(r[l]=a),r),{}):i});return Object.assign(o,...t)}Ae(Qte,"u");var UQ=class Qre extends ate(gEe,hEe,AEe,yEe,wEe,OEe,SEe){constructor(e){super(),an(this,"__VoerkaI18nScope__",!0),an(this,"_options"),an(this,"_manager"),an(this,"_formatterManager",null),an(this,"_logger"),an(this,"_defaultLanguage","zh-CN"),an(this,"_activeLanguage","zh-CN"),an(this,"_activeMessages",{}),an(this,"_patchedMessages",{}),an(this,"_translateComponent"),an(this,"_translateTransformer"),an(this,"_activeParagraphs",{}),an(this,"$id",++Qre.idSeq),this._options=Qte({id:qee(),library:!1,debug:!1,injectLangAttr:!0,languages:[],messages:{},paragraphs:{},idMap:{},formatters:[],attached:!0,storageKey:"language",cachePatch:!0},e),this._init()}get id(){return this._options.id}get options(){return this._options}get attached(){return this._options.attached}get debug(){return this._options.debug}get library(){return this._options.library}get formatters(){return this._formatterManager}get defaultLanguage(){return this._defaultLanguage}get defaultMessages(){return this.messages[this.defaultLanguage]}get messages(){return this._options.messages}get paragraphs(){return this._options.paragraphs}get idMap(){return this._options.idMap}get languages(){return this._options.languages}get manager(){return this._manager}get appScope(){return this._manager.scope}get interpolator(){return this._flexVars}get logger(){return this._logger}get t(){return this.translate.bind(this)}get Translate(){return this._getTranslateComponent()}get activeMessages(){return this._activeMessages}get activeParagraphs(){return this._activeParagraphs}get activeLanguage(){return this._activeLanguage}get storage(){return this.getScopeOption("storage")}get loader(){return this.getScopeOption("loader")}get $t(){return(e,t,i)=>(this._getTranslateTransformer(),i||(i={}),i.transform=!0,this.translate(e,t,i))}getScopeOption(e){let t=this._options;return this.attached?t[e]||(this.library?this._manager[e]:void 0):t[e]}_initOptions(){if(!Array.isArray(this.languages))this.logger.warn("[VoerkaI18n] invalid language settings, will use default language settings."),this._options.languages=Object.assign([],iEe);else if(this.languages.length==0)throw new Error("[VoerkaI18n] must provide valid language settings.");let e,t;this.languages.forEach(n=>{n.default&&(t=n.name),n.active&&(e=n.name)});let i=this._options.messages;if(t in i||(t=Object.keys(i)[0]),e in i||(e=t),!(t in i))throw new Error("[VoerkaI18n] invalid language configuration, must provide valid default and active languages.");if(this._activeLanguage=e,this._defaultLanguage=t,!this._options.library&&!this._options.storage&&(this._options.storage=tEe),Gc(this.messages[this._defaultLanguage]))throw new Error("[VoerkaI18n] default language pack must be static content, can't use async load way.");this._activeMessages=this.messages[this._activeLanguage],this._activeParagraphs=this.paragraphs[this._activeLanguage]}_init(){this._logger=fte(this._options.log),this._initOptions(),this.library||this.restoreLanguage(),this._initInterpolators(),this.registerToManager(),this._formatterManager=new WEe(this)}bind(e){this._manager=e,this._manager.once("init",this._initRefresh.bind(this))}_initRefresh(e){if(this.library)this.refresh(e&&e());else{let t=[];(this._defaultLanguage!==this._activeLanguage||Gc(this.activeMessages))&&t.push(this.refresh(void 0,{patch:!1})),t.push(this._patch()),Promise.all(t).then(()=>{this.emit("ready",this.activeLanguage,!0),this._setLanguageAttr()})}}registerToManager(){if(!this.attached)return;let e=!this.options.library;e&&(globalThis.VoerkaI18n&&globalThis.VoerkaI18n.scope&&JQ()&&console.warn("Only can have one i18nScope with library=false"),this._manager=new tte(this));let t=globalThis.VoerkaI18n;t&&Ate(t)?e?this._initRefresh():t.register(this):(globalThis.__VoerkaI18nScopes__||(globalThis.__VoerkaI18nScopes__=[]),globalThis.__VoerkaI18nScopes__.push(this))}change(e){return Z(this,null,function*(){let t=this.activeLanguage;return this.attached?t=yield this._manager.change(e):t=yield this.refresh(e),t})}_setLanguageAttr(){if(!(this.library||!JQ()))try{let e=this._options.injectLangAttr;if(!e)return;let t=e===!0?document.body:document.body.querySelector(e);t&&t.setAttribute("lang",this.activeLanguage)}catch(e){}}getRawMessage(e){if(t1(e)){if(e in this.defaultMessages)return this.defaultMessages[e]}else return e}getMessageId(e){if(t1(e))return e;if(e in this.idMap)return this.idMap[e]}};Ae(UQ,"VoerkaI18nScope"),an(UQ,"idSeq",0);var EEe=UQ;function YEe(o,e,t){return i=>{let n=o.next;return o.next=function(s,r,l){let a=l.getConfig;return l.getConfig=()=>Object.assign({},t,e==null?void 0:e[i.activeLanguage],a(o.name)),n.call(this,s,r,l)},o}}Ae(YEe,"createFormatter");function xEe(o){let e=globalThis.VoerkaI18n;e?e.registerPlugin(o):(globalThis.__VoerkaI18nPlugins__||(globalThis.__VoerkaI18nPlugins__=[]),globalThis.__VoerkaI18nPlugins__.push(o))}Ae(xEe,"definePlugin");const TEe={get(o){if(globalThis.localStorage)return globalThis.localStorage.getItem(o)},set(o,e){globalThis.localStorage&&globalThis.localStorage.setItem(o,e)},remove(o){globalThis.localStorage&&globalThis.localStorage.removeItem(o)}};var QEe=Object.defineProperty,$o=(o,e)=>QEe(o,"name",{value:e,configurable:!0}),yf=(o=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(o,{get:(e,t)=>(typeof require!="undefined"?require:e)[t]}):o)(function(o){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+o+'" is not supported')});function Fte(o,e=!1){if(typeof o=="number")return!0;if(typeof o!="string"||e)return!1;try{if(o.includes(".")){let t=parseFloat(o);return o.endsWith(".")?!isNaN(t)&&String(t).length===o.length-1:!isNaN(t)&&String(t).length===o.length}else{let t=parseInt(o);return!isNaN(t)&&String(t).length===o.length}}catch(t){return!1}}$o(Fte,"r"),(o=>typeof yf<"u"?yf:typeof Proxy<"u"?new Proxy(o,{get:$o((e,t)=>(typeof yf<"u"?yf:e)[t],"get")}):o)(function(o){if(typeof yf<"u")return yf.apply(this,arguments);throw Error('Dynamic require of "'+o+'" is not supported')});function Xte(o,e=3){let t=new RegExp(String.raw`(?!^)(?=(\d{${e}})+$)`,"g"),i=o.replace(t,",");return i.startsWith(",")&&(i=i.substring(1)),i.endsWith(",")&&(i=i.substring(0,i.length-2)),i}$o(Xte,"addSplitChars");function PQ(o,e){let{symbol:t="",division:i=3,prefix:n="",precision:s=-1,suffix:r="",unit:l=0,radix:a=3,units:c=[],format:g="{symbol}{value}{unit}"}=e,[d,u]=String(o).split(".");l>0&&a>0&&(d.length<a*l&&(d=Array.from({length:a*l-d.length+1}).fill(0).join("")+d),u=d.substring(Number(d),d.length-a*l)+u,d=d.substring(0,d.length-a*l),d==""&&(d="0"));let h=[];h.push(Xte(d,i)),u&&Fte(s)&&s!=0&&(s==0||(s==-1?h.push(`.${u}`):s>0&&(s<0?u=String(parseFloat(`0.${u}`)):u=String(parseFloat(`0.${u}`).toFixed(s)).split(".")[1],h.push(`.${u}`))));const m=c[l]||"";return g.replace("{value}",h.join("")).replace("{symbol}",t).replace("{prefix}",n).replace("{suffix}",r).replace("{unit}",m)}$o(PQ,"toCurrency");var FEe=[{name:"currency",args:["format","unit","precision","prefix","suffix","division","symbol","radix"],next(o,e,t){const i=t.getConfig(),n=Object.assign({},i,e);return n.format in n&&(n.format=n[n.format]),n.unit=parseInt(String(n.unit))||0,n.unit>n.units.length-1&&(n.unit=n.units.length-1),n.unit<0&&(n.unit=0),n.unit>0&&n.precision==2&&(n.precision=-1),PQ(o,n)}},{"en-US":{units:[""," thousands"," millions"," billions"," trillions"],radix:3,symbol:"$",prefix:"USD",suffix:"",division:3,precision:2},"zh-CN":{units:["","万","亿","万亿","万万亿"],radix:4,symbol:"¥",prefix:"RMB",suffix:"元",division:4,precision:2}},{default:"{symbol}{value}{unit}",long:"{prefix} {symbol}{value}{unit}{suffix}",short:"{symbol}{value}{unit}",custom:"{prefix} {symbol}{value}{unit}{suffix}",format:"default"}],XEe=[{name:"number",args:["precision","division"],next(o,e,t){const i=t.getConfig();return PQ(o,Object.assign({},i,e))}},{"en-US":{division:3},"zh-CN":{division:4}}];function Vu(o){return o instanceof Date?o:new Date(o)}$o(Vu,"toDate");var HEe=[{name:"timeSlots",args:["upper"],default:{upper:!0},next(o,e,t){const i=t.getConfig(),n=Vu(o).getHours(),s=!!e.upper;let r=i.slots.findIndex(l=>n<l);return r===-1&&(r=i.upperCases.length-1),s?i.upperCases[r]:i.lowerCases[r]}},{"en-US":{slots:[12],lowerCases:["am","pm"],upperCases:["AM","PM"]},"zh-CN":{slots:[5,8,11,13,18],lowerCases:["凌晨","早上","上午","中午","下午","晚上"],upperCases:["凌晨","早上","上午","中午","下午","晚上"]}}];function $Q(o,...e){if(e.length===0)return o;let t=e.map((i,n)=>{let s=Object.entries(i||{});return s.some(([r,l])=>l===void 0)?s.reduce((r,[l,a])=>(a!==void 0&&(r[l]=a),r),{}):i});return Object.assign(o,...t)}$o($Q,"u");var s1={en:{month:{long:["January","February","March","April","May","June","July","August","September","October","November","December"],short:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec"]},weekday:{long:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],short:["Sun","Mon","Tues","Wed","Thur","Fri","Sat"]}},cn:{month:{long:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],short:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"]},weekday:{long:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],short:["周日","周一","周二","周三","周四","周五","周六"]}}},Hte={en:{slots:[12],names:["AM","PM"]},cn:{slots:[6,9,11,13,18],names:["凌晨","早上","上午","中午","下午","晚上"]}},MEe="YYYY-MM-DD HH:mm:ss";function eF(o){o<0&&o>23&&(o=0);let e=[0,...Hte[this.language].slots,24].findIndex(t=>t>o)-1;return Hte[this.language].names[e]}$o(eF,"h");function tF(o,e,t){let i=$Q({language:"cn"},t),n=o instanceof Date?o:new Date(o||Date.now()),s=n.getHours(),r=String(s).padStart(2,"0"),l=s>12?s-12:s,a=String(l).padStart(2,"0"),c=String(n.getMinutes()),g=String(n.getSeconds()),d=String(n.getMilliseconds()),u=String(n.getFullYear()),h=n.getMonth(),m=n.getDay(),p=String(n.getDate()),b=[["HH",r],["H",s],["hh",a],["h",l],["mm",c.padStart(2,"0")],["m",c],["ss",g.padStart(2,"0")],["s",g],["SSS",d.padStart(3,"0")],["A",s>12?"PM":"AM"],["a",s>12?"pm":"am"],["t",eF.call(i,s)],["T",eF.call(i,s)],["YYYY",u],["yyyy",u],["YY",u.substring(2)],["MMM",s1[i.language].month.short[h]],["MM",String(h+1).padStart(2,"0")],["M",h+1],["DD",p.padStart(2,"0")],["D",p],["d",m],["dd",s1[i.language].weekday.short[m]],["ddd",s1[i.language].weekday.short[m]],["dddd",s1[i.language].weekday.long[m]]],f=e||MEe;return b.forEach(([I,A])=>f=f.replaceAll(I,A)),f}$o(tF,"H");function Mte(o,e,t){if(typeof e=="string"){let i=0,n;for(;(n=o.indexOf(e,i))>-1;){let s=typeof t=="function"?t(e):t,r=o.length;o=o.substring(0,n)+s+o.substring(n+e.length),i=n+s.length+o.length-r}}else{let i;if(!e.global||!e.multiline)throw new Error("The search parameter must be enabled '/gm' option");for(;(i=e.exec(o))!==null;){i.index===e.lastIndex&&e.lastIndex++;let n=o.length,s=i[0].length,r=typeof t=="function"?t(i[0],...i):t;o=o.substring(0,i.index)+r+o.substring(i.index+s),e.lastIndex+=o.length-n}}return o}$o(Mte,"s"),String.prototype.replaceAll||(String.prototype.replaceAll=function(o,e){return Mte(this,o,e)});var jte={local:$o(o=>o.toLocaleString(),"local"),iso:$o(o=>o.toISOString(),"iso"),utc:$o(o=>o.toUTCString(),"utc"),gmt:$o(o=>o.toGMTString(),"gmt")},jEe=[{global:!0,name:"date",args:["format"],next(o,e,t){const i=t.getConfig(),n=Vu(o);let s=e.format||i.format;if(s in jte)return jte[s](n);if(s in i&&(s=i[s],typeof s=="function"))return s(n);if(typeof s=="string")return tF(n,s)}},{"en-US":{long:"YYYY/MM/DD HH:mm:ss",short:"YYYY/MM/DD"},"zh-CN":{long:"YYYY年M月D日 HH点mm分ss秒",short:"YYYY年M月D日"}},{format:"local"}],zte={local:$o(o=>o.toLocaleTimeString(),"local"),timestamp:$o(o=>o.getTime(),"timestamp")},zEe=[{name:"time",args:["format"],next(o,e,t){const i=t.getConfig(),n=Vu(o);let s=e.format||i.format;if(s in zte)return zte[s](n);if(s in i&&(s=i[s],typeof s=="function"))return s(n);if(typeof s=="string")return tF(n,s)}},{"en-US":{long:"HH:mm:ss"},"zh-CN":{long:"HH点mm分ss秒"}},{format:"local",short:"HH:mm:ss"}],qEe=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],UEe=["周日","周一","周二","周三","周四","周五","周六"],PEe=["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],$Ee=["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],eYe=[{name:"weekday",args:["format"],next(o,e,t){const i=t.getConfig(),n=Vu(o).getDay(),s=e.format||"long";if(typeof s=="string"&&s in i){const r=i[s];return typeof r=="function"?r(n):r[n]}return n}},{"en-US":{long:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],short:["Sun","Mon","Tues","Wed","Thur","Fri","Sat"]},"zh-CN":{long:qEe,short:UEe}},{format:"long"}],tYe=[{name:"month",args:["format"],next(o,e,t){const i=t.getConfig(),n=Vu(o).getMonth()+1,s=e.format||i.format;if(typeof s=="string"&&s in i){const r=i[s];return typeof r=="function"?r(n):r[n-1]}return n}},{"en-US":{long:["January","February","March","April","May","June","July","August","September","October","November","December"],short:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec"]},"zh-CN":{long:PEe,short:$Ee}},{format:"long"}],iYe=[{name:"quarter",args:["format"],next(o,e,t){const i=t.getConfig(),n=Vu(o).getMonth()+1,s=Math.floor(n%3==0?n/3:n/3+1)-1,r=e.format||i.format;if(typeof r=="string"&&r in i){const l=i[r];return typeof l=="function"?l(s):l[s]}return s}},{"en-US":{long:["First Quarter","Second Quarter","Third Quarter","Fourth Quarter"]},"zh-CN":{long:["一季度","二季度","三季度","四季度"]}},{format:"short",short:["Q1","Q2","Q3","Q4"]}],mW=[1e3,6e4,36e5,864e5,6048e5,2592e6,31536e6,Number.MAX_SAFE_INTEGER];function qte(o,e,t){let{units:i,now:n,before:s,after:r}=$Q({units:["秒","分钟","小时","天","周","个月","年"],now:"刚刚",before:"{value}{unit}前",after:"{value}{unit}后"},t),l=typeof o=="number"?new Date(o).getTime():o.getTime(),a=(e instanceof Date?e:typeof e=="number"?new Date(e):new Date).getTime(),c=l-a,g=mW.findIndex(d=>Math.abs(c)<d)-1;if(g<0&&(g=0),g>mW.length-1&&(g=mW.length-1),c<1e3&&c>-1e3)return n;if(c<=-1e3){let d=parseInt(String(Math.abs(c)/mW[g]));return s.replace("{value}",d).replace("{unit}",i[g])}else{let d=parseInt(String(Math.abs(c)/mW[g]));return r.replace("{value}",d).replace("{unit}",i[g])}}$o(qte,"b");var nYe=[{name:"relativeTime",args:["base"],default:$o(()=>({base:new Date}),"default"),next(o,e,t){const i=t.getConfig(),n=e.base||new Date;return qte(Vu(o),n,i)}},{"en-US":{units:["seconds","minutes","hours","days","weeks","months","years"],now:"Just now",before:"{value} {unit} ago",after:"after {value} {unit}"},"zh-CN":{units:["秒","分钟","小时","天","周","个月","年"],now:"刚刚",before:"{value}{unit}前",after:"{value}{unit}后"}}],oYe=[FEe,XEe,HEe,jEe,zEe,eYe,tYe,iYe,nYe];const sYe=(o,e)=>Z(this,null,function*(){return yield(yield fetch(MxPluginContext.getLoaderLanguageUrl(o,e))).json()}),rYe={"zh-CN":{},"en-US":{},"ko-KR":{}},lYe={代码编辑:4,运行:5},aYe=void 0,cYe=void 0,gYe={languages:[{name:"zh-CN",title:"中文",active:!0,default:!0},{name:"en-US",title:"英语"},{name:"ko-KR",title:"韩语"},{name:"zh-TW",title:"繁体中文"}],library:!0,debug:!1},dYe={"zh-CN":{},"en-US":()=>Promise.resolve().then(()=>$Me),"ko-KR":()=>Promise.resolve().then(()=>e4e),"zh-TW":()=>Promise.resolve().then(()=>t4e)},CW=new EEe(T({id:"pluginCodeEdit__1_0_0",idMap:lYe,formatters:oYe,storage:TEe,messages:dYe,paragraphs:rYe,component:aYe,loader:sYe,transform:cYe},gYe));CW.t,CW.$t,CW.Translate;const Ute=Se.ref();CW.on("change",o=>{Ute.value=o});const Ku=(o,...e)=>(Ute.value,CW.t(o,...e));MxPluginContext.addDrawerComponent("CodeEditor",{isShow:jm,component:Se.defineAsyncComponent(()=>Promise.resolve().then(()=>n4e)),width:600,title:Ku("代码编辑")}),MxPluginContext.addCommand("Mx_CodeEditor",o=>{if(typeof o=="string"){jm.value=!0,RQ({name:"AI"+Ku("生成"),type:"AI",code:o});return}jm.value=!jm.value}),MxPluginContext.getUiConfig().then(o=>{var i,n;(i=o==null?void 0:o.leftDrawerComponents)!=null&&i.includes("CodeEditor")||(n=o==null?void 0:o.leftDrawerComponents)==null||n.push("CodeEditor");const e={icon:"class: iconfont daimabianji",prompt:Ku("代码编辑"),cmd:"Mx_CodeEditor"};MxPluginContext.addCommand("Mx_ShowCodeBtn",()=>{const s=o.mTopButtonBarData.findIndex(r=>e.cmd===r.cmd);s>=0?o.mTopButtonBarData.splice(s,1):o.mTopButtonBarData.push(e)}),o.mTopButtonBarData||(o.mTopButtonBarData=[]),o.mTopButtonBarData.some(s=>s.cmd===e.cmd&&e.prompt===e.prompt)||o.mTopButtonBarData.push(e)});/*!-----------------------------------------------------------------------------
1185
1185
  * Copyright (c) Microsoft Corporation. All rights reserved.
1186
1186
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
1187
1187
  * Released under the MIT license