@micro-zoe/micro-app 1.0.0-rc.2 → 1.0.0-rc.3
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/lib/index.d.ts +10 -1
- package/lib/index.esm.js +247 -122
- package/lib/index.esm.js.map +1 -1
- package/lib/index.min.js +1 -1
- package/lib/index.min.js.map +1 -1
- package/lib/index.umd.js +1 -1
- package/lib/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/typings/global.d.ts +7 -1
package/lib/index.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e="1.0.0-rc.2",t="undefined"!=typeof window,n="undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:Function("return this")(),o=()=>!1,r=Array.isArray,i=Object.assign,s=Object.defineProperty,a=Object.defineProperties,c=Object.prototype.hasOwnProperty;function l(e){return void 0===e}function u(e){return null===e}function p(e){return"string"==typeof e}function d(e){return"boolean"==typeof e}function h(e){return"number"==typeof e}function m(e){return"function"==typeof e}function f(e){return"[object Object]"===toString.call(e)}function _(e){return"object"==typeof e}function A(e){return"[object Promise]"===toString.call(e)}function w(e){var t;if(m(e)){const n=e.toString();return(null===(t=e.prototype)||void 0===t?void 0:t.constructor)===e&&Object.getOwnPropertyNames(e.prototype).length>1||/^function\s+[A-Z]/.test(n)||/^class\s+/.test(n)}return!1}function y(e){var t;return e instanceof URL||!!(null===(t=e)||void 0===t?void 0:t.href)}function g(e){var t;return e instanceof Element||p(null===(t=e)||void 0===t?void 0:t.tagName)}function v(e){var t;return e instanceof Node||h(null===(t=e)||void 0===t?void 0:t.nodeType)}function b(e){var t,n;return"LINK"===(null===(n=null===(t=e)||void 0===t?void 0:t.tagName)||void 0===n?void 0:n.toUpperCase())}function E(e){var t,n;return"STYLE"===(null===(n=null===(t=e)||void 0===t?void 0:t.tagName)||void 0===n?void 0:n.toUpperCase())}function P(e){var t,n;return"SCRIPT"===(null===(n=null===(t=e)||void 0===t?void 0:t.tagName)||void 0===n?void 0:n.toUpperCase())}function R(e){var t,n;return"MICRO-APP-BODY"===(null===(n=null===(t=e)||void 0===t?void 0:t.tagName)||void 0===n?void 0:n.toUpperCase())}function S(e,t=null,...n){const o=t&&p(t)?` app ${t}:`:"";p(e)?console.error(`[micro-app]${o} ${e}`,...n):console.error(`[micro-app]${o}`,e,...n)}function C(e,t=null,...n){const o=t&&p(t)?` app ${t}:`:"";p(e)?console.warn(`[micro-app]${o} ${e}`,...n):console.warn(`[micro-app]${o}`,e,...n)}function M(e,...t){Promise.resolve().then(e.bind(null,...t))}const N=function(){class e extends URL{}return(t,n)=>n?new e(""+t,n):new e(""+t)}();function O(e){return e.startsWith("//")?`${n.location.protocol}${e}`:e}function D(e,t=null){if(!p(e)||!e)return"";try{const{origin:t,pathname:n,search:o}=N(O(e));if(/\.(\w+)$/.test(n))return`${t}${n}${o}`;const r=`${t}${n}/`.replace(/\/\/$/,"/");return/^https?:\/\//.test(r)?`${r}${o}`:""}catch(e){return S(e,t),""}}function I(e){return p(e)&&e?e.replace(/(^\d+)|([^\w\d-_])/gi,""):""}function x(e){const{origin:t,pathname:n}=N(e);if(/\.(\w+)$/.test(n)){const e=`${t}${n}`.split("/");return e.pop(),e.join("/")+"/"}return`${t}${n}/`.replace(/\/\/$/,"/")}function L(e,t){return!e||/^((((ht|f)tps?)|file):)?\/\//.test(e)||/^(data|blob):/.test(e)?e:N(e,x(O(t))).toString()}function T(e,t,n,o){let r=0;function i(){++r===e.length&&o&&o()}e.forEach(((e,o)=>{A(e)?e.then((e=>{t({data:e,index:o}),i()})).catch((e=>{n({error:e,index:o}),i()})):(t({data:e,index:o}),i())}))}const U=n.requestIdleCallback||function(e){const t=Date.now();return setTimeout((function(){e({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-t))})}),1)};function W(e){return new Promise((t=>{U((()=>{e(t)}))}))}let B=null;function k(e){B=e}function F(e){B!==e&&(k(e),M((()=>{k(null)})))}function H(){return B}function $(){k(null)}function j(e,t){const n=(window.rawDocument||document).createElement(e,t);return n.__MICRO_APP_NAME__&&delete n.__MICRO_APP_NAME__,n.__PURE_ELEMENT__=!0,n}function K(e,t,n){if(t)if(e.innerHTML="",n){const n=t.cloneNode(!0),o=document.createDocumentFragment();Array.from(n.childNodes).forEach((e=>{o.appendChild(e)})),e.appendChild(o)}else Array.from(t.childNodes).forEach((t=>{e.appendChild(t)}));return e}function q(e){return!e||/(^\d)|([^\w\d-_\u4e00-\u9fa5])/gi.test(e)}function G(e){return/^body$/i.test(e)||/^head$/i.test(e)||/^html$/i.test(e)||/^title$/i.test(e)||/^:root$/i.test(e)}function Q(e){return function(e){return"undefined"!=typeof ShadowRoot&&e instanceof ShadowRoot}(e)?e.host:e}function z(e){return e?e.replace(/^\s+|\s+$/g,""):""}function X(){return navigator.userAgent.indexOf("Firefox")>-1}function V(e){const t={},n=e.split("&");for(const e of n){const n=e.indexOf("="),o=n<0?e:e.slice(0,n),i=n<0?null:e.slice(n+1);if(o in t){let e=t[o];r(e)||(e=t[o]=[e]),e.push(i)}else t[o]=i}return t}function Y(e){let t="";for(const n in e){const o=e[n];if(u(o))t+=(t.length?"&":"")+n;else{(r(o)?o:[o]).forEach((e=>{l(e)||(t+=(t.length?"&":"")+n,u(e)||(t+="="+e))}))}}return t}function J(){const e=new Set;return{add:function(t){return e.add(t),()=>!!e.has(t)&&e.delete(t)},list:()=>e}}function Z(e){const t=e.attributes,n=new Map;for(let e=0;e<t.length;e++)n.set(t[e].name,t[e].value);return n}function ee(e,t){e?e.push((()=>W((e=>{t(),e()})))):t()}function te(e){return(null==e?void 0:e.reduce(((e,t)=>e.then(t)),Promise.resolve()))||null}function ne(e){return e.startsWith("inline-")}function oe(e,t,n,...o){try{m(e)&&e(...o)}catch(e){S(`An error occurred in app ${t} window.${n} \n`,null,e)}}function re(e,t,n,o){var r;if(!e)return S(`element does not exist in lifecycle ${n}`,t);e=Q(e),$();const s=i({name:t,container:e},o&&{error:o}),a=new CustomEvent(n,{detail:s});!function(e,t){Object.defineProperties(e,{currentTarget:{get:()=>t},target:{get:()=>t}})}(a,e),m(null===(r=Xn.options.lifeCycles)||void 0===r?void 0:r[n])&&Xn.options.lifeCycles[n](a),e.dispatchEvent(a)}function ie(e,t,n={}){var o;const r=new CustomEvent(t,{detail:n});null===(o=e.sandBox)||void 0===o||o.microAppWindow.dispatchEvent(r)}function se(e,t=null,n={}){return $(),m(Xn.options.fetch)?Xn.options.fetch(e,n,t):window.fetch(e,n).then((e=>e.text()))}class ae{static getInstance(){return this.instance||(this.instance=new ae),this.instance}run(e,t){const n=e.name,o=e.ssrUrl||e.url;se(o,n,{cache:"no-cache"}).then((r=>{if(!r){const t="html is empty, please check in detail";return e.onerror(new Error(t)),S(t,n)}r=this.formatHTML(o,r,n),t(r,e)})).catch((t=>{S(`Failed to fetch data from ${e.url}, micro-app stop rendering`,n,t),e.onLoadError(t)}))}formatHTML(e,t,n){return this.processHtml(e,t,n,Xn.options.plugins).replace(/<head[^>]*>[\s\S]*?<\/head>/i,(e=>e.replace(/<head/i,"<micro-app-head").replace(/<\/head>/i,"</micro-app-head>"))).replace(/<body[^>]*>[\s\S]*?<\/body>/i,(e=>e.replace(/<body/i,"<micro-app-body").replace(/<\/body>/i,"</micro-app-body>")))}processHtml(e,t,n,o){var r;if(!o)return t;const i=[];return o.global&&i.push(...o.global),(null===(r=o.modules)||void 0===r?void 0:r[n])&&i.push(...o.modules[n]),i.length>0?i.reduce(((t,n)=>f(n)&&m(n.processHtml)?n.processHtml(t,e):t),t):t}}const ce=/(^|\s+)(html|:root)(?=[\s>~[.#:]+|$)/,le=/(^|\s+)((html[\s>~]+body)|body)(?=[\s>~[.#:]+|$)/;function ue(e,t){e=t?`${t} ${e}`:e;const n=new Error(e);throw n.reason=e,t&&(n.filename=t),n}class pe{constructor(){this.cssText="",this.prefix="",this.baseURI="",this.linkPath="",this.result="",this.scopecssDisable=!1,this.scopecssDisableSelectors=[],this.scopecssDisableNextLine=!1,this.mediaRule=this.createMatcherForRuleWithChildRule(/^@media *([^{]+)/,"@media"),this.supportsRule=this.createMatcherForRuleWithChildRule(/^@supports *([^{]+)/,"@supports"),this.documentRule=this.createMatcherForRuleWithChildRule(/^@([-\w]+)?document *([^{]+)/,"@document"),this.hostRule=this.createMatcherForRuleWithChildRule(/^@host\s*/,"@host"),this.importRule=this.createMatcherForNoneBraceAtRule("import"),this.charsetRule=this.createMatcherForNoneBraceAtRule("charset"),this.namespaceRule=this.createMatcherForNoneBraceAtRule("namespace"),this.containerRule=this.createMatcherForRuleWithChildRule(/^@container *([^{]+)/,"@container")}exec(e,t,n,o){return this.cssText=e,this.prefix=t,this.baseURI=n,this.linkPath=o||"",this.matchRules(),X()?decodeURIComponent(this.result):this.result}reset(){this.cssText=this.prefix=this.baseURI=this.linkPath=this.result="",this.scopecssDisable=this.scopecssDisableNextLine=!1,this.scopecssDisableSelectors=[]}matchRules(){for(this.matchLeadingSpaces(),this.matchComments();this.cssText.length&&"}"!==this.cssText.charAt(0)&&(this.matchAtRule()||this.matchStyleRule());)this.matchComments()}matchStyleRule(){const e=this.formatSelector(!0);return this.scopecssDisableNextLine=!1,e?(this.recordResult(e),this.matchComments(),this.styleDeclarations(),this.matchLeadingSpaces(),!0):ue("selector missing",this.linkPath)}formatSelector(e){const t=this.commonMatch(/^[^{]+/,e);return!!t&&t[0].replace(/(^|,[\n\s]*)([^,]+)/g,((e,t,n)=>(n=z(n),this.scopecssDisableNextLine||this.scopecssDisable&&(!this.scopecssDisableSelectors.length||this.scopecssDisableSelectors.includes(n))||ce.test(n)||(n=le.test(n)?n.replace(le,this.prefix+" micro-app-body"):this.prefix+" "+n),t+n)))}styleDeclarations(){return this.matchOpenBrace()?(this.matchAllDeclarations(),!!this.matchCloseBrace()||ue("Declaration missing '}'",this.linkPath)):ue("Declaration missing '{'",this.linkPath)}matchAllDeclarations(){let e=this.commonMatch(/^(?:url\(["']?(?:[^)"'}]+)["']?\)|[^}/])*/,!0)[0];if(e&&(this.scopecssDisableNextLine||this.scopecssDisable&&!this.scopecssDisableSelectors.length||(e=e.replace(/url\(["']?([^)"']+)["']?\)/gm,((e,t)=>/^((data|blob):|#)/.test(t)||/^(https?:)?\/\//.test(t)?e:(/^((\.\.?\/)|[^/])/.test(t)&&this.linkPath&&(this.baseURI=function(e){const t=e.split("/");return t.pop(),O(t.join("/")+"/")}(this.linkPath)),`url("${L(t,this.baseURI)}")`)))),this.recordResult(e)),this.scopecssDisableNextLine=!1,this.cssText&&"}"!==this.cssText.charAt(0))return"/"===this.cssText.charAt(0)&&"*"===this.cssText.charAt(1)?this.matchComments():this.commonMatch(/\/+/),this.matchAllDeclarations()}matchAtRule(){return"@"===this.cssText[0]&&(this.scopecssDisableNextLine=!1,this.keyframesRule()||this.mediaRule()||this.customMediaRule()||this.supportsRule()||this.importRule()||this.charsetRule()||this.namespaceRule()||this.containerRule()||this.documentRule()||this.pageRule()||this.hostRule()||this.fontFaceRule())}keyframesRule(){if(!this.commonMatch(/^@([-\w]+)?keyframes\s*/))return!1;if(!this.commonMatch(/^[^{]+/))return ue("@keyframes missing name",this.linkPath);if(this.matchComments(),!this.matchOpenBrace())return ue("@keyframes missing '{'",this.linkPath);for(this.matchComments();this.keyframeRule();)this.matchComments();return this.matchCloseBrace()?(this.matchLeadingSpaces(),!0):ue("@keyframes missing '}'",this.linkPath)}keyframeRule(){let e;const t=[];for(;e=this.commonMatch(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),this.commonMatch(/^,\s*/);return!!t.length&&(this.styleDeclarations(),this.matchLeadingSpaces(),!0)}customMediaRule(){return!!this.commonMatch(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/)&&(this.matchLeadingSpaces(),!0)}pageRule(){return!!this.commonMatch(/^@page */)&&(this.formatSelector(!1),this.scopecssDisableNextLine=!1,this.commonHandlerForAtRuleWithSelfRule("page"))}fontFaceRule(){return!!this.commonMatch(/^@font-face\s*/)&&this.commonHandlerForAtRuleWithSelfRule("font-face")}createMatcherForRuleWithChildRule(e,t){return()=>!!this.commonMatch(e)&&(this.matchOpenBrace()?(this.matchComments(),this.matchRules(),this.matchCloseBrace()?(this.matchLeadingSpaces(),!0):ue(`${t} missing '}'`,this.linkPath)):ue(`${t} missing '{'`,this.linkPath))}createMatcherForNoneBraceAtRule(e){const t=new RegExp("^@"+e+"\\s*([^;]+);");return()=>!!this.commonMatch(t)&&(this.matchLeadingSpaces(),!0)}commonHandlerForAtRuleWithSelfRule(e){return this.matchOpenBrace()?(this.matchAllDeclarations(),this.matchCloseBrace()?(this.matchLeadingSpaces(),!0):ue(`@${e} missing '}'`,this.linkPath)):ue(`@${e} missing '{'`,this.linkPath)}matchComments(){for(;this.matchComment(););}matchComment(){if("/"!==this.cssText.charAt(0)||"*"!==this.cssText.charAt(1))return!1;this.scopecssDisableNextLine=!1;let e=2;for(;""!==this.cssText.charAt(e)&&("*"!==this.cssText.charAt(e)||"/"!==this.cssText.charAt(e+1));)++e;if(e+=2,""===this.cssText.charAt(e-1))return ue("End of comment missing",this.linkPath);let t=this.cssText.slice(2,e-2);if(this.recordResult(`/*${t}*/`),t=z(t.replace(/^\s*!/,"")),"scopecss-disable-next-line"===t)this.scopecssDisableNextLine=!0;else if(/^scopecss-disable/.test(t))if("scopecss-disable"===t)this.scopecssDisable=!0;else{this.scopecssDisable=!0;t.replace("scopecss-disable","").split(",").forEach((e=>{this.scopecssDisableSelectors.push(z(e))}))}else"scopecss-enable"===t&&(this.scopecssDisable=!1,this.scopecssDisableSelectors=[]);return this.cssText=this.cssText.slice(e),this.matchLeadingSpaces(),!0}commonMatch(e,t=!1){const n=e.exec(this.cssText);if(!n)return;const o=n[0];return this.cssText=this.cssText.slice(o.length),t||this.recordResult(o),n}matchOpenBrace(){return this.commonMatch(/^{\s*/)}matchCloseBrace(){return this.commonMatch(/^}/)}matchLeadingSpaces(){this.commonMatch(/^\s*/)}recordResult(e){X()?this.result+=encodeURIComponent(e):this.result+=e}}function de(e,t,n,o,r){if(!e.__MICRO_APP_HAS_SCOPED__){e.__MICRO_APP_HAS_SCOPED__=!0;let i=null;try{i=he.exec(e.textContent,n,o,r),he.reset()}catch(e){he.reset(),S("An error occurred while parsing CSS:\n",t,e)}i&&(e.textContent=i)}}let he;function me(e,t,n){if(t.scopecss){const o=fe(t.name);if(he||(he=new pe),e.textContent)de(e,t.name,o,t.url,n);else{const r=new MutationObserver((function(){r.disconnect(),e.textContent&&!e.hasAttribute("data-styled")&&de(e,t.name,o,t.url,n)}));r.observe(e,{childList:!0})}}return e}function fe(e,t=!1){const n=t?"\\":"";return`${Xn.tagName}${n}[name=${e}${n}]`}function _e(e,t){Object.defineProperties(e,{currentTarget:{get:()=>t},srcElement:{get:()=>t},target:{get:()=>t}})}function Ae(e){const t=new CustomEvent("load");_e(t,e),m(e.onload)?e.onload(t):e.dispatchEvent(t)}function we(e){const t=new CustomEvent("error");_e(t,e),m(e.onerror)?e.onerror(t):e.dispatchEvent(t)}var ye,ge,ve,be,Ee,Pe,Re=function(){const e=new Map,t=new Map;function n(e){return{setInfo(t,n){e.set(t,n)},getInfo(t){var n;return null!==(n=e.get(t))&&void 0!==n?n:null},hasInfo:t=>e.has(t),deleteInfo:t=>e.delete(t)}}return{link:n(e),script:Object.assign(Object.assign({},n(t)),{deleteInlineInfo(e){e.forEach((e=>{ne(e)&&t.delete(e)}))}})}}();function Se(e,t,n,o=!1){const r=e.getAttribute("rel");let i=e.getAttribute("href"),s=null;if("stylesheet"===r&&i){i=L(i,n.url);let t=Re.link.getInfo(i);const r={attrs:Z(e)};if(t?t.appSpace[n.name]=t.appSpace[n.name]||r:t={code:"",appSpace:{[n.name]:r}},Re.link.setInfo(i,t),o)return{address:i,linkInfo:t};n.source.links.add(i),s=document.createComment(`link element with href=${i} move to micro-app-head as style element`),t.appSpace[n.name].placeholder=s}else r&&["prefetch","preload","prerender"].includes(r)?o?s=document.createComment(`link element with rel=${r}${i?" & href="+i:""} removed by micro-app`):null==t||t.removeChild(e):i&&Wn.rawSetAttribute.call(e,"href",L(i,n.url));return o?{replaceComment:s}:s?null==t?void 0:t.replaceChild(s,e):void 0}function Ce(e,t,n,o){const r=Array.from(t.source.links),i=r.map((e=>{const n=Re.link.getInfo(e);return n.code?n.code:se(e,t.name)})),s=o?[]:null;T(i,(e=>{ee(s,(()=>function(e,t,n,o){const r=Re.link.getInfo(e);r.code=t;const i=r.appSpace[o.name],s=i.placeholder;if(s){const t=j("style");Me(o,e,t,r,i.attrs),s.parentNode?s.parentNode.replaceChild(t,s):n.appendChild(t),i.placeholder=null}}(r[e.index],e.data,n,t)))}),(e=>{S(e,t.name)}),(()=>{o?o.then((()=>{s.push((()=>Promise.resolve(t.onLoad(e)))),te(s)})):t.onLoad(e)}))}function Me(e,t,n,o,r){if(e.scopecss){const r=o.appSpace[e.name];if(r.prefix=r.prefix||fe(e.name),r.parsedCode)n.textContent=r.parsedCode;else{const i=function(e,t,n){const o=n.appSpace;for(const n in o)if(n!==e){const e=o[n];if(e.parsedCode)return e.parsedCode.replace(new RegExp(fe(n,!0),"g"),t)}}(e.name,r.prefix,o);i?n.textContent=i:(n.textContent=o.code,me(n,e,t)),r.parsedCode=n.textContent}}else n.textContent=o.code;!function(e,t){t.forEach(((t,n)=>{"rel"!==n&&("href"===n&&(n="data-origin-href"),Wn.rawSetAttribute.call(e,n,t))}))}(n,r)}!function(e){e.NAME="name",e.URL="url"}(ye||(ye={})),function(e){e.CREATED="created",e.LOADING="loading",e.LOAD_FAILED="load_failed",e.BEFORE_MOUNT="before_mount",e.MOUNTING="mounting",e.MOUNTED="mounted",e.UNMOUNT="unmount"}(ge||(ge={})),function(e){e.CREATED="created",e.BEFOREMOUNT="beforemount",e.MOUNTED="mounted",e.UNMOUNT="unmount",e.ERROR="error",e.BEFORESHOW="beforeshow",e.AFTERSHOW="aftershow",e.AFTERHIDDEN="afterhidden"}(ve||(ve={})),function(e){e.ONMOUNT="onmount",e.ONUNMOUNT="onunmount"}(be||(be={})),function(e){e.KEEP_ALIVE_SHOW="keep_alive_show",e.KEEP_ALIVE_HIDDEN="keep_alive_hidden"}(Ee||(Ee={})),function(e){e.DESTROY="destroy",e.DESTORY="destory",e.INLINE="inline",e.DISABLESCOPECSS="disableScopecss",e.DISABLESANDBOX="disableSandbox",e.DISABLE_SCOPECSS="disable-scopecss",e.DISABLE_SANDBOX="disable-sandbox",e.DISABLE_MEMORY_ROUTER="disable-memory-router",e.DISABLE_PATCH_REQUEST="disable-patch-request",e.KEEP_ROUTER_STATE="keep-router-state",e.HIDDEN_ROUTER="hidden-router",e.KEEP_ALIVE="keep-alive",e.CLEAR_DATA="clear-data",e.SSR="ssr",e.FIBER="fiber"}(Pe||(Pe={}));const Ne=[1,2,3],Oe="search",De="custom",Ie=[Oe,"history",De],xe=["popstate","hashchange","load","beforeunload","unload","unmount","appstate-change"],Le=["onpopstate","onhashchange","onload","onbeforeunload","onunload"],Te=["DOMContentLoaded","readystatechange"],Ue=["onreadystatechange"],We=["window","self","globalThis"],Be=["rawWindow","rawDocument"],ke="window,self,globalThis,document,Document,Array,Object,String,Boolean,Math,Number,Symbol,Date,Function,Proxy,WeakMap,WeakSet,Set,Map,Reflect,Element,Node,RegExp,Error,TypeError,JSON,isNaN,parseFloat,parseInt,performance,console,decodeURI,encodeURI,decodeURIComponent,encodeURIComponent,navigator,undefined,location,history",Fe=["text/javascript","text/ecmascript","application/javascript","application/ecmascript","module","systemjs-module","systemjs-importmap"];function He(e,t){return t.appSpace[e.name].module&&(!e.useSandbox||e.iframe)}function $e(e,t){return e.inline||t.appSpace[e.name].inline||He(e,t)||function(e,t){return t.appSpace[e.name].attrs.has("id")}(e,t)}function je(e){return e.iframe?e.sandBox.microAppWindow:Wn.rawWindow}function Ke(e,t,n){return function(e,t,n){const o=t.appSpace;for(const t in o)if(t!==e.name){const e=o[t];if(e.parsedCode===n&&e.parsedFunction)return e.parsedFunction}}(e,t,n)||function(e,t){return new(je(e).Function)(t)}(e,n)}function qe(){const e="inline-"+Math.random().toString(36).substr(2,15);return Re.script.hasInfo(e)?qe():e}function Ge(e,t){return e.useSandbox&&!He(e,t)}function Qe(e,t){return Ge(e,t)?e.iframe?"iframe":"with":"disable"}function ze(e,t,n,o=!1){var r;let i=null,s=e.getAttribute("src");if(s&&(s=L(s,n.url)),e.hasAttribute("exclude")||Ve(s,n.name))i=document.createComment("script element with exclude attribute removed by micro-app");else{if(e.type&&!Fe.includes(e.type)||e.hasAttribute("ignore")||Ye(s,n.name))return(null===(r=Wn.rawDocument)||void 0===r?void 0:r.currentScript)&&delete Wn.rawDocument.currentScript,null;if(Wn.supportModuleScript&&e.noModule||!Wn.supportModuleScript&&"module"===e.type)i=document.createComment((e.noModule?"noModule":"module")+" script ignored by micro-app");else if(s){let t=Re.script.getInfo(s);const r={async:e.hasAttribute("async"),defer:e.defer||"module"===e.type,module:"module"===e.type,inline:e.hasAttribute("inline"),pure:e.hasAttribute("pure"),attrs:Z(e)};if(t?t.appSpace[n.name]=t.appSpace[n.name]||r:t={code:"",isExternal:!0,appSpace:{[n.name]:r}},Re.script.setInfo(s,t),o)return{address:s,scriptInfo:t};n.source.scripts.add(s),i=document.createComment(`script with src='${s}' extract by micro-app`)}else if(e.textContent){const t=qe(),r={code:e.textContent,isExternal:!1,appSpace:{[n.name]:{async:!1,defer:"module"===e.type,module:"module"===e.type,inline:e.hasAttribute("inline"),pure:e.hasAttribute("pure"),attrs:Z(e)}}};if(o)return{address:t,scriptInfo:r};n.source.scripts.add(t),Re.script.setInfo(t,r),i=document.createComment("inline script extract by micro-app")}else o||(i=document.createComment("script element removed by micro-app"))}return o?{replaceComment:i}:null==t?void 0:t.replaceChild(i,e)}function Xe(e){var t,n,o;return[...(null===(t=Xn.options.plugins)||void 0===t?void 0:t.global)||[],...(null===(o=null===(n=Xn.options.plugins)||void 0===n?void 0:n.modules)||void 0===o?void 0:o[e])||[]]}function Ve(e,t){if(!e)return!1;return(Xe(t)||[]).some((t=>!!t.excludeChecker&&t.excludeChecker(e)))}function Ye(e,t){if(!e)return!1;return(Xe(t)||[]).some((t=>!!t.ignoreChecker&&t.ignoreChecker(e)))}function Je(e,t){const n=Array.from(t.source.scripts),o=[],r=[];for(const e of n){const n=Re.script.getInfo(e),i=n.appSpace[t.name];(!i.defer&&!i.async||t.isPrefetch&&!t.isPrerender)&&(o.push(n.code?n.code:se(e,t.name)),r.push([e,n]))}const i=t.isPrefetch||t.fiber?[]:null;o.length?T(o,(e=>{ee(i,(()=>function(e,t,n,o){if(t.code=n,o.isPrefetch&&2===o.prefetchLevel){const r=t.appSpace[o.name];if(!r.parsedCode&&(r.parsedCode=et(e,o,n,t),r.sandboxType=Qe(o,t),!$e(o,t)))try{r.parsedFunction=Ke(o,t,r.parsedCode)}catch(e){S("Something went wrong while handling preloaded resources",o.name,"\n",e)}}}(r[e.index][0],r[e.index][1],e.data,t)))}),(e=>{S(e,t.name)}),(()=>{i?(i.push((()=>Promise.resolve(t.onLoad(e)))),te(i)):t.onLoad(e)})):t.onLoad(e)}function Ze(e,t,n,o,r){try{!function(e){!function(e){e.sandBox&&(Wn.rawWindow.__MICRO_APP_PROXY_WINDOW__=e.sandBox.proxyWindow)}(e)}(t);const i=n.appSpace[t.name],s=Qe(t,n);if(i.parsedCode&&i.sandboxType===s||(i.parsedCode=et(e,t,n.code,n),i.sandboxType=s,i.parsedFunction=null),$e(t,n)){const s=r||j("script");if(function(e,t,n,o,r,i){if(n){if(Wn.rawSetAttribute.call(o,"type","module"),ne(e)?o.textContent=t:o.src=e,i){const t=()=>{i.moduleCount&&i.moduleCount--,i(0===i.moduleCount)};ne(e)?M(t):o.onload=t}}else o.textContent=t;!function(e,t){t.forEach(((t,n)=>{"type"===n&&"module"===t||"defer"===n||"async"===n||("src"===n&&(n="data-origin-src"),Wn.rawSetAttribute.call(e,n,t))}))}(o,r)}(e,i.parsedCode,He(t,n),s,i.attrs,o),!r){const e=t.iframe?t.sandBox.microBody:t.querySelector("micro-app-body");null==e||e.appendChild(s)}}else!function(e,t){const n=t.appSpace[e.name];n.parsedFunction||(n.parsedFunction=Ke(e,t,n.parsedCode));n.parsedFunction.call(je(e))}(t,n)}catch(n){console.error(`[micro-app from ${r?"runDynamicScript":"runScript"}] app ${t.name}: `,n,e)}}function et(e,t,n,o){return f(Xn.options.plugins)&&(n=function(e,t,n,o){var r;const i=tt(o.global,t,e);return tt(null===(r=o.modules)||void 0===r?void 0:r[n],i,e)}(e,n,t.name,Xn.options.plugins)),Ge(t,o)?t.iframe?`(function(window,self,global,location){;${n}\n${ne(e)?"":`//# sourceURL=${e}\n`}}).call(window.__MICRO_APP_SANDBOX__.proxyWindow,window.__MICRO_APP_SANDBOX__.proxyWindow,window.__MICRO_APP_SANDBOX__.proxyWindow,window.__MICRO_APP_SANDBOX__.proxyWindow,window.__MICRO_APP_SANDBOX__.proxyLocation);`:`;(function(proxyWindow){with(proxyWindow.__MICRO_APP_WINDOW__){(function(${ke}){;${n}\n${ne(e)?"":`//# sourceURL=${e}\n`}}).call(proxyWindow,${ke})}})(window.__MICRO_APP_PROXY_WINDOW__);`:n}function tt(e,t,n){return r(e)?e.reduce(((e,t)=>f(t)&&m(t.loader)?t.loader(e,n):e),t):t}function nt(e,t,n,o){const r=Array.from(e.children);r.length&&r.forEach((e=>{nt(e,t,n,o)}));for(const n of r)b(n)?n.hasAttribute("exclude")||Ve(n.getAttribute("href"),t.name)?e.replaceChild(document.createComment("link element with exclude attribute ignored by micro-app"),n):n.hasAttribute("ignore")||Ye(n.getAttribute("href"),t.name)?n.hasAttribute("href")&&Wn.rawSetAttribute.call(n,"href",L(n.getAttribute("href"),t.url)):Se(n,e,t):E(n)?n.hasAttribute("exclude")?e.replaceChild(document.createComment("style element with exclude attribute ignored by micro-app"),n):t.scopecss&&!n.hasAttribute("ignore")&&ee(o,(()=>me(n,t))):P(n)?ze(n,e,t):(i=void 0,s=void 0,"IMG"===(null===(s=null===(i=n)||void 0===i?void 0:i.tagName)||void 0===s?void 0:s.toUpperCase())&&n.hasAttribute("src")&&Wn.rawSetAttribute.call(n,"src",L(n.getAttribute("src"),t.url)));var i,s}function ot(e,t){const n=function(e){const t=j("div");return t.innerHTML=e,t}(e),o=Wn.rawElementQuerySelector.call(n,"micro-app-head"),r=Wn.rawElementQuerySelector.call(n,"micro-app-body");if(!o||!r){const e=`element ${o?"body":"head"} is missing`;return t.onerror(new Error(e)),S(e,t.name)}const i=t.isPrefetch||t.fiber?[]:null;nt(n,t,o,i);const s=te(i);t.source.links.size?Ce(n,t,o,s):s?s.then((()=>t.onLoad(n))):t.onLoad(n),t.source.scripts.size?Je(n,t):t.onLoad(n)}const rt=new class{constructor(){this.eventList=new Map,this.queue=[],this.recordStep={},this.process=()=>{var e,t;let n;const o=this.recordStep,r=this.queue;for(this.recordStep={},this.queue=[];n=r.shift();){const r=this.eventList.get(n),i=r.tempData,s=r.force;let a;if(r.tempData=null,r.force=!1,s||!this.isEqual(r.data,i)){r.data=i||r.data;for(const e of r.callbacks){const t=e(r.data);t&&(null!=a?a:a=[]).push(t)}null===(t=(e=o[n]).dispatchDataEvent)||void 0===t||t.call(e),o[n].nextStepList.forEach((e=>e(a)))}}}}isLegalName(e){return!!e||(S("event-center: Invalid name"),!1)}enqueue(e,t,n){this.recordStep[e]?(this.recordStep[e].nextStepList.push(t),n&&(this.recordStep[e].dispatchDataEvent=n)):this.recordStep[e]={nextStepList:[t],dispatchDataEvent:n},!this.queue.includes(e)&&1===this.queue.push(e)&&M(this.process)}isEqual(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&e[n]!==t[n])return!1;return!0}on(e,t,n=!1){if(this.isLegalName(e)){if(!m(t))return S("event-center: Invalid callback function");let o=this.eventList.get(e);o?n&&Object.keys(o.data).length&&(!this.queue.includes(e)||this.isEqual(o.data,o.tempData))&&t(o.data):(o={data:{},callbacks:new Set},this.eventList.set(e,o)),o.callbacks.add(t)}}off(e,t){if(this.isLegalName(e)){const n=this.eventList.get(e);n&&(m(t)?n.callbacks.delete(t):n.callbacks.clear())}}clearData(e){if(this.isLegalName(e)){const t=this.eventList.get(e);t&&(t.data={})}}dispatch(e,t,n,o,r){if(this.isLegalName(e)){if(!f(t))return S("event-center: data must be object");let s=this.eventList.get(e);s?(s.tempData=i({},s.tempData||s.data,t),!s.force&&(s.force=!!o)):(s={data:t,callbacks:new Set},this.eventList.set(e,s),s.force=!0),this.enqueue(e,n,r)}}getData(e){var t;const n=this.eventList.get(e);return null!==(t=null==n?void 0:n.data)&&void 0!==t?t:null}};function it(e,t){return p(e)&&e?t?`__from_base_app_${e}__`:`__from_micro_app_${e}__`:""}class st{addGlobalDataListener(e,t){const n=this.appName;n&&(e.__APP_NAME__=n,e.__AUTO_TRIGGER__=t),rt.on("global",e,t)}removeGlobalDataListener(e){m(e)&&rt.off("global",e)}setGlobalData(e,t,n){$(),rt.dispatch("global",e,(e=>m(t)&&t(e)),n)}forceSetGlobalData(e,t){this.setGlobalData(e,t,!0)}getGlobalData(){return rt.getData("global")}clearGlobalData(){rt.clearData("global")}clearGlobalDataListener(){const e=this.appName,t=rt.eventList.get("global");if(t)for(const n of t.callbacks)(e&&e===n.__APP_NAME__||!e&&!n.__APP_NAME__)&&t.callbacks.delete(n)}}class at extends st{addDataListener(e,t,n){rt.on(it(I(e),!1),t,n)}removeDataListener(e,t){m(t)&&rt.off(it(I(e),!1),t)}getData(e,t=!1){return rt.getData(it(I(e),t))}setData(e,t,n,o){rt.dispatch(it(I(e),!0),t,(e=>m(n)&&n(e)),o)}forceSetData(e,t,n){this.setData(e,t,n,!0)}clearData(e,t=!0){rt.clearData(it(I(e),t))}clearDataListener(e){rt.off(it(I(e),!1))}}class ct extends st{constructor(e){super(),this.appName=I(e),!this.appName&&S(`Invalid appName ${e}`)}addDataListener(e,t){e.__AUTO_TRIGGER__=t,rt.on(it(this.appName,!0),e,t)}removeDataListener(e){m(e)&&rt.off(it(this.appName,!0),e)}getData(e=!0){return rt.getData(it(this.appName,e))}dispatch(e,t,n){$(),rt.dispatch(it(this.appName,!1),e,(e=>m(t)&&t(e)),n,(()=>{const t=En.get(this.appName);if((null==t?void 0:t.container)&&f(e)){const e=new CustomEvent("datachange",{detail:{data:rt.getData(it(this.appName,!1))}});Q(t.container).dispatchEvent(e)}}))}forceDispatch(e,t){this.dispatch(e,t,!0)}clearData(e=!1){rt.clearData(it(this.appName,e))}clearDataListener(){rt.off(it(this.appName,!0))}}function lt(e){var t,n;if(e){e.umdDataListeners={global:new Set(null===(t=e.umdDataListeners)||void 0===t?void 0:t.global),normal:new Set(null===(n=e.umdDataListeners)||void 0===n?void 0:n.normal)};const o=rt.eventList.get("global");if(o)for(const t of o.callbacks)e.appName===t.__APP_NAME__&&e.umdDataListeners.global.add(t);const r=rt.eventList.get(it(e.appName,!0));if(r)for(const t of r.callbacks)e.umdDataListeners.normal.add(t)}}function ut(e){if(null==e?void 0:e.umdDataListeners){for(const t of e.umdDataListeners.global)e.addGlobalDataListener(t,t.__AUTO_TRIGGER__);for(const t of e.umdDataListeners.normal)e.addDataListener(t,t.__AUTO_TRIGGER__);pt(e)}}function pt(e){null==e||delete e.umdDataListeners}class dt{constructor(){this.appInstanceMap=En}static getInstance(){return this.instance||(this.instance=new dt),this.instance}get(e){return this.appInstanceMap.get(e)}set(e,t){this.appInstanceMap.set(e,t)}getAll(){return Array.from(this.appInstanceMap.values())}clear(){this.appInstanceMap.clear()}}function ht(){mt(),dt.getInstance().getAll().forEach((e=>{e.container&&Q(e.container).disconnectedCallback()})),!window.__MICRO_APP_UMD_MODE__&&dt.getInstance().clear()}function mt(){window.__MICRO_APP_ENVIRONMENT__&&window.removeEventListener("unmount",ht,!1)}function ft(e){return d(e.__MICRO_APP_IS_BOUND_FUNCTION__)?e.__MICRO_APP_IS_BOUND_FUNCTION__:e.__MICRO_APP_IS_BOUND_FUNCTION__=m(t=e)&&0===t.name.indexOf("bound ")&&!t.hasOwnProperty("prototype");var t}function _t(e,t,n="WINDOW"){if(m(e)&&!function(e){return d(e.__MICRO_APP_IS_CONSTRUCTOR__)?e.__MICRO_APP_IS_CONSTRUCTOR__:e.__MICRO_APP_IS_CONSTRUCTOR__=w(e)}(e)&&!ft(e)){const o=`__MICRO_APP_BOUND_${n}_FUNCTION__`;if(e[o])return e[o];const r=e.bind(t);for(const t in e)r[t]=e[t];return e.hasOwnProperty("prototype")&&s(r,"prototype",{value:e.prototype,configurable:!0,enumerable:!1,writable:!0}),e[o]=r}return e}function At(e,t,n){const{proxyDocument:o,documentEffect:r}=function(e,t){const n=new Map,o=new Map;let r=null,i=null;const{rawDocument:s,rawCreateElement:a,rawAddEventListener:c,rawRemoveEventListener:l}=Wn;function u(t,n){const o=a.call(s,t,n);return o.__MICRO_APP_NAME__=e,o}function p(e,t,o){const r=n.get(e);r?r.add(t):n.set(e,new Set([t])),t&&(t.__MICRO_APP_MARK_OPTIONS__=o),c.call(s,e,t,o)}function d(e,t,o){const r=n.get(e);(null==r?void 0:r.size)&&r.has(t)&&r.delete(t),l.call(s,e,t,o)}const h=()=>{o.clear(),i=null},f=()=>{i=r||i,n.forEach(((e,t)=>{if(e.size){const n=o.get(t)||[];o.set(t,new Set([...n,...e]))}}))},_=()=>{i&&!r&&(y.onclick=i),o.forEach(((e,t)=>{for(const n of e)y.addEventListener(t,n,null==n?void 0:n.__MICRO_APP_MARK_OPTIONS__)})),h()},A=()=>{m(r)&&l.call(s,"click",r),r=null,n.size&&(n.forEach(((e,t)=>{for(const n of e)l.call(s,t,n)})),n.clear())},w=(()=>{var e;const t=new Map([["onclick",e=>{m(r)&&l.call(s,"click",r,!1),m(e)&&c.call(s,"click",e,!1),r=e}]]),n=(null===(e=Xn.options)||void 0===e?void 0:e.customProxyDocumentProps)||new Map;return new Map([...t,...n])})(),y=new Proxy(s,{get:(n,o)=>{var i;return F(e),"createElement"===o?u:o===Symbol.toStringTag?"ProxyDocument":"defaultView"===o?t.proxyWindow:"onclick"===o?r:"addEventListener"===o?p:"removeEventListener"===o?d:"microAppElement"===o?null===(i=En.get(e))||void 0===i?void 0:i.container:"__MICRO_APP_NAME__"===o?e:_t(Reflect.get(n,o),s,"DOCUMENT")},set:(e,t,n)=>{if(w.has(t)){w.get(t)(n)}else"microAppElement"!==t&&Reflect.set(e,t,n);return!0}});return{proxyDocument:y,documentEffect:{reset:h,record:f,rebuild:_,release:A}}}(e,n),i=function(e,t){const{rawDocument:n,rawRootDocument:o}=Wn;class r{static[Symbol.hasInstance](e){let n=e;for(;n=Object.getPrototypeOf(n);)if(n===r.prototype)return!0;return e===t||e instanceof o}}return Object.setPrototypeOf(r,o),Object.setPrototypeOf(r.prototype,new Proxy(o.prototype,{get:(t,o)=>(F(e),_t(Reflect.get(t,o),n,"DOCUMENT")),set:(e,t,n)=>(Reflect.set(e,t,n),!0)})),r}(e,o);return a(t,{document:{configurable:!1,enumerable:!0,get:()=>o},Document:{configurable:!1,enumerable:!1,get:()=>i}}),r}function wt(e,t,n){return function(e){const t=Wn.rawWindow;Object.getOwnPropertyNames(t).filter((e=>/^on/.test(e)&&!Le.includes(e))).forEach((n=>{const{enumerable:o,writable:r,set:i}=Object.getOwnPropertyDescriptor(t,n)||{enumerable:!0,writable:!0};s(e,n,{enumerable:o,configurable:!0,get:()=>t[n],set:(null!=r?r:i)?e=>{t[n]=e}:void 0})}))}(t),function(e,t,n){const o=Wn.rawWindow,r=new Map,i=new Proxy(t,{get:(t,r)=>(F(e),Reflect.has(t,r)||p(r)&&/^__MICRO_APP_/.test(r)||n.scopeProperties.includes(r)?(Be.includes(r)&&$(),Reflect.get(t,r)):_t(Reflect.get(o,r),o)),set:(e,t,r)=>{if(n.adapter.escapeSetterKeyList.includes(t))Reflect.set(o,t,r);else if(c.call(e,t)||!c.call(o,t)||n.scopeProperties.includes(t))!Reflect.has(e,t)&&n.injectedKeys.add(t),Reflect.set(e,t,r);else{const i=Object.getOwnPropertyDescriptor(o,t),{configurable:a,enumerable:c,writable:l,set:u}=i;s(e,t,{value:r,configurable:a,enumerable:c,writable:null!=l?l:!!u}),n.injectedKeys.add(t)}return(n.escapeProperties.includes(t)||n.adapter.staticEscapeProperties.includes(t)&&!Reflect.has(o,t))&&!n.scopeProperties.includes(t)&&(!Reflect.has(o,t)&&n.escapeKeys.add(t),Reflect.set(o,t,r)),!0},has:(e,t)=>n.scopeProperties.includes(t)?n.adapter.staticScopeProperties.includes(t)?!!e[t]:t in e:t in e||t in o,getOwnPropertyDescriptor:(e,t)=>{if(c.call(e,t))return r.set(t,"target"),Object.getOwnPropertyDescriptor(e,t);if(c.call(o,t)){r.set(t,"rawWindow");const e=Object.getOwnPropertyDescriptor(o,t);return e&&!e.configurable&&(e.configurable=!0),e}},defineProperty:(e,t,n)=>"rawWindow"===r.get(t)?Reflect.defineProperty(o,t,n):Reflect.defineProperty(e,t,n),ownKeys:e=>Reflect.ownKeys(o).concat(Reflect.ownKeys(e)).filter((function(e){return!(e in this)&&(this[e]=!0)}),Object.create(null)),deleteProperty:(e,t)=>!c.call(e,t)||(n.injectedKeys.has(t)&&n.injectedKeys.delete(t),n.escapeKeys.has(t)&&Reflect.deleteProperty(o,t),Reflect.deleteProperty(e,t))});n.proxyWindow=i}(e,t,n),function(e){const t=new Map,n=new Map,o=new Map,r=new Map,{rawWindow:i,rawAddEventListener:s,rawRemoveEventListener:a,rawDispatchEvent:c,rawSetInterval:l,rawSetTimeout:u,rawClearInterval:p,rawClearTimeout:d}=Wn;function h(t){return xe.includes(t)?e:i}e.addEventListener=function(e,n,o){const r=t.get(e);r?r.add(n):t.set(e,new Set([n])),n&&(n.__MICRO_APP_MARK_OPTIONS__=o),s.call(h(e),e,n,o)},e.removeEventListener=function(e,n,o){const r=t.get(e);(null==r?void 0:r.size)&&r.has(n)&&r.delete(n),a.call(h(e),e,n,o)},e.dispatchEvent=function(e){return c.call(h(null==e?void 0:e.type),e)},e.setInterval=function(e,t,...n){const r=l.call(i,e,t,...n);return o.set(r,{handler:e,timeout:t,args:n}),r},e.setTimeout=function(e,t,...n){const o=u.call(i,e,t,...n);return r.set(o,{handler:e,timeout:t,args:n}),o},e.clearInterval=function(e){o.delete(e),p.call(i,e)},e.clearTimeout=function(e){r.delete(e),d.call(i,e)};const m=()=>{n.clear()},f=()=>{n.forEach(((t,n)=>{for(const o of t)e.addEventListener(n,o,null==o?void 0:o.__MICRO_APP_MARK_OPTIONS__)})),m()};return{reset:m,record:()=>{t.forEach(((e,t)=>{if(e.size){const o=n.get(t)||[];n.set(t,new Set([...o,...e]))}}))},rebuild:f,release:e=>{t.size&&(t.forEach(((e,t)=>{for(const n of e)a.call(h(t),t,n)})),t.clear()),e&&(o.forEach(((e,t)=>{p.call(i,t)})),r.forEach(((e,t)=>{d.call(i,t)})),o.clear(),r.clear())}}}(t)}function yt(e,t){if(!It(e)){const n=Wn.rawWindow.history.state,o={microAppState:i({},null==n?void 0:n.microAppState,{[e]:t})};return i({},n,o)}return t}function gt(e){var t;const n=Wn.rawWindow.history.state;return It(e)?n:(null===(t=null==n?void 0:n.microAppState)||void 0===t?void 0:t[e])||null}const vt=/&/g,bt=/=/g,Et=/%M1/g,Pt=/%M2/g;function Rt(e){return encodeURIComponent(Ct(e).replace(vt,"%M1").replace(bt,"%M2"))}function St(e){return Ct(e).replace(Et,"&").replace(Pt,"=")}function Ct(e){try{const t=decodeURIComponent(e);return e===t||Et.test(t)||Pt.test(t)?t:Ct(t)}catch(t){return e}}function Mt(e){var t,n;const o=Wn.rawWindow.location;if(!It(e)){const r=Ot(o.search,o.hash),i=(null===(t=r.hashQuery)||void 0===t?void 0:t[e])||(null===(n=r.searchQuery)||void 0===n?void 0:n[e]);return p(i)?St(i):null}return o.pathname+o.search+o.hash}function Nt(e,t){const n=t.pathname+t.search+t.hash;let o=!1;if(!It(e)){let{pathname:t,search:r,hash:i}=Wn.rawWindow.location;const s=Ot(r,i),a=Rt(n);if(i&&!r){o=!0,s.hashQuery?s.hashQuery[e]=a:s.hashQuery={[e]:a};const t=i.includes("?")?i.slice(0,i.indexOf("?")+1):i+"?";i=t+Y(s.hashQuery)}else s.searchQuery?s.searchQuery[e]=a:s.searchQuery={[e]:a},r="?"+Y(s.searchQuery);return{fullPath:t+r+i,isAttach2Hash:o}}return{fullPath:n,isAttach2Hash:o}}function Ot(e,t){const n={};return""!==e&&"?"!==e&&(n.searchQuery=V(e.slice(1))),t.includes("?")&&(n.hashQuery=V(t.slice(t.indexOf("?")+1))),n}function Dt(e){const t=En.get(e);return!(!t||t.isPrefetch)}function It(e){const t=En.get(e);return!t||!t.sandBox||t.routerMode===De}function xt(e,t){let n;return n=t?t.getDisposeResult("disable-memory-router")?De:e||Xn.options["router-mode"]||"":Xn.options["disable-memory-router"]?De:e||Xn.options["router-mode"]||"",Ie.includes(n)?n:Oe}function Lt(e){const t=Wn.rawWindow,n=t=>{$n({excludeHiddenApp:!0,excludePreRender:!0}).includes(e)&&!t.onlyForBrowser&&Tt(e,Mt(e))};return t.addEventListener("popstate",n),()=>{t.removeEventListener("popstate",n)}}function Tt(e,t){const n=En.get(e),o=n.sandBox.proxyWindow,r=n.sandBox.microAppWindow;let i=!1;const s=o.location.href;if(t){const n=o.location.hash;sn(e,t,r.location),i=o.location.hash!==n}!function(e,t,n){const o=new PopStateEvent("popstate",{state:gt(e)});n.dispatchEvent(o),Rn(e)||m(t.onpopstate)&&t.onpopstate(o)}(e,o,r),i&&function(e,t,n,o){const r=new HashChangeEvent("hashchange",{newURL:t.location.href,oldURL:o});n.dispatchEvent(r),Rn(e)||m(t.onhashchange)&&t.onhashchange(r)}(e,o,r,s),$()}function Ut(e,t,n){$(),Dt(e)&&(function(e){const t=new PopStateEvent("popstate",{state:null});e&&(t.onlyForBrowser=!0),Wn.rawWindow.dispatchEvent(t)}(t),n&&function(e){const t=new HashChangeEvent("hashchange",{newURL:Wn.rawWindow.location.href,oldURL:e});Wn.rawWindow.dispatchEvent(t)}(n))}function Wt(e,t){const n=Wn.rawWindow.history;function o(n){return function(...o){var r,i,s;if(p(o[2])||y(o[2])){const a=N(o[2],t.href),c=a.pathname+a.search+a.hash;kt(e,n,Nt(e,a),!0,yt(e,o[0]),o[1]),c!==t.fullPath&&sn(e,c,t),null===(s=null===(r=En.get(e))||void 0===r?void 0:(i=r.sandBox).updateIframeBase)||void 0===s||s.call(i)}else Bt(e,n,o[2],o[0],o[1])}}const r=o("pushState"),i=o("replaceState");return Rn(e)?{pushState:r,replaceState:i}:new Proxy(n,{get:(t,n)=>"state"===n?gt(e):"pushState"===n?r:"replaceState"===n?i:_t(Reflect.get(t,n),t,"HISTORY"),set:(e,t,n)=>(Reflect.set(e,t,n),!0)})}function Bt(e,t,n,o=null,r=""){if(Dt(e)){("pushState"===t?Wn.rawPushState:Wn.rawReplaceState).call(Wn.rawWindow.history,o,r,n)}}function kt(e,t,n,o,r,i){if(Dt(e)){const s=Wn.rawWindow.location,a=s.pathname+s.search+s.hash,c=n.isAttach2Hash&&a!==n.fullPath?s.href:null;Bt(e,t,n.fullPath,r,i),a===n.fullPath||It(e)||Ut(e,o,c)}}function Ft(e,t,n){kt(e,"replaceState",t,!0,n)}function Ht(e){const t=Wn.rawWindow;return function(...n){var o;if((null===(o=t.history.state)||void 0===o?void 0:o.microAppState)&&(!f(n[0])||!n[0].microAppState)&&(p(n[2])||y(n[2]))){const e=t.location.href;N(n[2],e).href===e&&(n[0]=i({},n[0],{microAppState:t.history.state.microAppState}))}e.apply(t.history,n),$n({excludeHiddenApp:!0,excludePreRender:!0}).forEach((e=>{if(!It(e)&&!Mt(e)){Ft(e,Nt(e,En.get(e).sandBox.proxyWindow.location),yt(e,gt(e)))}})),$()}}function $t(){const e=Wn.rawWindow;e.history.pushState=Ht(Wn.rawPushState),e.history.replaceState=Ht(Wn.rawReplaceState)}function jt(){const e=Wn.rawWindow;e.history.pushState=Wn.rawPushState,e.history.replaceState=Wn.rawReplaceState}const{router:Kt,executeNavigationGuard:qt,clearRouterWhenUnmount:Gt}=function(){function e(e,t,n,o){const r=t.sandBox.proxyWindow.location,i=N(n.path,r.href),s=r.pathname+r.search+r.hash,a=i.pathname+i.search+i.hash;if(s!==a||Mt(e)!==a){!function(e,t,n,o){kt(e,t,Nt(e,n),!1,yt(e,null!=o?o:null)),$()}(e,o&&!1!==n.replace||!0===n.replace?"replaceState":"pushState",i,n.state),It(e)&&Tt(e,a)}}function t(t){return function(n){const o=I(n.name);if(o&&p(n.path))if($n({excludeHiddenApp:!0,excludePreRender:!0}).includes(o)){const r=En.get(o),i=()=>e(o,r,n,t);r.iframe?r.sandBox.sandboxReady.then(i):i()}else C("navigation failed, app does not exist or is inactive");else S("navigation failed, name & path are required when use router."+(t?"replace":"push"))}}function n(e){return function(...t){return Wn.rawWindow.history[e](...t)}}const r=J(),i=J();function s(e,t,n,o){$();for(const r of o)m(r)?r(t,n,e):f(r)&&m(r[e])&&r[e](t,n)}function a(e){if(!It(e)){Ft(e,Nt(e,En.get(e).sandBox.proxyWindow.location),yt(e,gt(e)))}}const c=Object.assign(Object.assign({current:new Map,encode:Rt,decode:St,push:t(!1),replace:t(!0),go:n("go"),back:n("back"),forward:n("forward"),beforeEach:r.add,afterEach:i.add,attachToURL:function(e){(e=I(e))&&$n().includes(e)&&a(e)},attachAllToURL:function({includeHiddenApp:e=!1,includePreRender:t=!1}){$n({excludeHiddenApp:!e,excludePreRender:!t}).forEach((e=>a(e)))}},function(){const e=function(){const e=new Map;return{add:function(t,n){return e.set(t,n),()=>!!e.has(t)&&e.delete(t)},get:t=>e.get(t),delete:t=>!!e.has(t)&&e.delete(t)}}();return{setDefaultPage:function(t){const n=I(t.name);return n&&t.path?e.add(n,t.path):o},removeDefaultPage:function(t){return!!(t=I(t))&&e.delete(t)},getDefaultPage:e.get}}()),function(){let e=null;return{setBaseAppRouter:function(t){_(t)&&(e=new Proxy(t,{get:(e,t)=>($(),_t(Reflect.get(e,t),e,"BASEROUTER")),set:(e,t,n)=>(Reflect.set(e,t,n),!0)}))},getBaseAppRouter:()=>e}}());return{router:c,executeNavigationGuard:function(e,t,n){c.current.set(e,t),s(e,t,n,r.list()),U((()=>{s(e,t,n,i.list())}))},clearRouterWhenUnmount:function(e){c.current.delete(e)}}}(),Qt=["getComputedStyle","visualViewport","matchMedia","ResizeObserver","IntersectionObserver"],zt=[/animationFrame$/i,/mutationObserver$/i,/height$|width$/i,/offset$/i,/selection$/i,/^range/i,/^screen/i,/^scroll/i,/X$|Y$/],Xt=["body","head","html","title"],Vt=["host","hostname","port","protocol","origin"],Yt=["childElementCount","children","firstElementChild","firstChild","lastElementChild","activeElement","fullscreenElement","pictureInPictureElement","pointerLockElement","styleSheets"],Jt=["append","contains","replaceChildren","createRange","getSelection","elementFromPoint","elementsFromPoint","getAnimations"],Zt=["characterSet","compatMode","contentType","designMode","dir","doctype","embeds","fullscreenEnabled","hidden","implementation","lastModified","pictureInPictureEnabled","plugins","readyState","referrer","visibilityState","fonts"],en=["execCommand","createRange","exitFullscreen","exitPictureInPicture","getElementsByTagNameNS","hasFocus","prepend"],tn=["href","pathname","search","hash","host","hostname","port","protocol","search"],nn=[...tn,"origin","fullPath"];function on(e,t,n,o,r,i){const a=Wn.rawWindow.location,c=!!n,l=N(t);function u(){return c?n.location:l}function p(t,n){const o=N(t,A.href);if(o.origin===A.origin){const t=Nt(e,o);if(!It(e)){if(o.pathname===A.pathname&&o.search===A.search){let r=null;return o.hash!==A.hash&&(t.isAttach2Hash&&(r=a.href),Bt(e,n,t.fullPath)),void(o.hash?Ut(e,!1,r):_())}if(t.isAttach2Hash)return Bt(e,n,t.fullPath),void _()}return t.fullPath}return t}function d(n,o){const r=N(n,t);r[o]===A[o]&&A.hash?Ut(e,!1):(Bt(e,r[o]===A[o]?"replaceState":"pushState",Nt(e,r).fullPath),_())}const h=t=>function(n){if(Dt(e)){const e=p(n,"assign"===t?"pushState":"replaceState");e&&a[t](N(e,a.origin).href)}},m=h("assign"),f=h("replace"),_=e=>a.reload(e);s(u(),"fullPath",{enumerable:!0,configurable:!0,get:()=>A.pathname+A.search+A.hash});const A=new Proxy({},{get:(e,t)=>{const n=u();if(c){if(Vt.includes(t))return o[t];if("href"===t)return n[t].replace(r,i)}return"assign"===t?m:"replace"===t?f:"reload"===t?_:"self"===t?n:_t(Reflect.get(n,t),n,"LOCATION")},set:(n,o,r)=>{if(Dt(e)){const n=u();if("href"===o){const e=p(r,"pushState");e&&(a.href=N(e,a.origin).href)}else if("pathname"===o)if(It(e))a.pathname=r;else{d(("/"+r).replace(/^\/+/,"/")+A.search+A.hash,"pathname")}else if("search"===o)if(It(e))a.search=r;else{d(A.pathname+("?"+r).replace(/^\?+/,"?")+A.hash,"search")}else if("hash"===o)if(It(e))a.hash=r;else{const n=A.pathname+A.search+("#"+r).replace(/^#+/,"#"),o=N(n,t);o.hash!==A.hash&&kt(e,"pushState",Nt(e,o),!1)}else Reflect.set(n,o,r)}return!0}});return A}function rn(e,t){const n=i({name:e},t);for(const e of nn)n[e]=t[e];return n}function sn(e,t,n,o){var r;const i=rn(e,n),s=N(t,n.href);if(Rn(e)){const t=En.get(e).sandBox.microAppWindow;null===(r=t.rawReplaceState)||void 0===r||r.call(t.history,gt(e),"",s.href)}else for(const e of tn)n.self[e]=s[e];const a=rn(e,n);("auto"===o||i.fullPath!==a.fullPath&&"prevent"!==o)&&qt(e,a,i)}function an(e,t,n){const o=Mt(e);o?sn(e,o,t,"auto"):cn(e,t,n)}function cn(e,t,n){n&&sn(e,n,t,"prevent"),Ft(e,Nt(e,t),yt(e,null)),function(e,t){qt(e,rn(e,t),rn(e,t))}(e,t)}function ln(e,t,n,o){if(!It(e)){if(!o){const{pathname:o,search:r,hash:i}=N(t);sn(e,o+r+i,n,"prevent")}un(e)}Gt(e)}function un(e){Ft(e,function(e,t){var n,o,r,i;let{pathname:s,search:a,hash:c}=t||Wn.rawWindow.location,l=!1;if(!It(e)){const t=Ot(a,c);if(null===(n=t.hashQuery)||void 0===n?void 0:n[e]){l=!0,null===(o=t.hashQuery)||void 0===o||delete o[e];const n=Y(t.hashQuery);c=c.slice(0,c.indexOf("?")+Number(Boolean(n)))+n}else if(null===(r=t.searchQuery)||void 0===r?void 0:r[e]){null===(i=t.searchQuery)||void 0===i||delete i[e];const n=Y(t.searchQuery);a=n?"?"+n:""}}return{fullPath:s+a+c,isAttach2Hash:l}}(e),function(e,t){return It(e)?t:(f(null==t?void 0:t.microAppState)&&(l(t.microAppState[e])||delete t.microAppState[e],Object.keys(t.microAppState).length||delete t.microAppState),i({},t))}(e,Wn.rawWindow.history.state))}class pn{constructor(){this.escapeSetterKeyList=["location"],this.staticEscapeProperties=["System","__cjsWrapper"],this.staticScopeProperties=["webpackJsonp","webpackHotUpdate","Vue"],this.injectReactHMRProperty()}injectReactHMRProperty(){}}function dn(e,t){const n=Array.from(e.children);n.length&&n.forEach((e=>{dn(e,t)}));for(const e of n)hn(e,t)}function hn(e,t){var n,o;const r=null===(o=null===(n=En.get(t))||void 0===n?void 0:n.sandBox)||void 0===o?void 0:o.proxyWindow;return v(e)&&!e.__MICRO_APP_NAME__&&!e.__PURE_ELEMENT__&&r&&(a(e,{baseURI:{configurable:!0,get:()=>r.location.href},__MICRO_APP_NAME__:{configurable:!0,writable:!0,value:t}}),Rn(t)&&s(e,"ownerDocument",{configurable:!0,get:()=>r.document})),e}function mn(e,t){const n=l(t)?Wn.rawWindow.fetch:t;return m(n)?function(t,o,...r){return(p(t)||y(t))&&(t=N(t,e).toString()),$(),n.call(Wn.rawWindow,t,o,...r)}:n}function fn(e,t){const n=l(t)?Wn.rawWindow.XMLHttpRequest:t;return w(n)?class extends n{open(t,n,...o){(p(n)&&!/^f(ile|tp):\/\//.test(n)||y(n))&&(n=N(n,e).toString()),$(),super.open(t,n,...o)}}:n}const{createMicroEventSource:_n,clearMicroEventSource:An}=function(){let e;return{createMicroEventSource:function(t,n,o){const r=l(o)?Wn.rawWindow.EventSource:o;return w(r)?class extends r{constructor(o,r,...i){if((p(o)||y(o))&&(o=N(o,n).toString()),$(),super(o,r,...i),e){const n=e.get(t);n?n.add(this):e.set(t,new Set([this]))}else e=new Map([[t,new Set([this])]])}close(){var n;super.close(),null===(n=e.get(t))||void 0===n||n.delete(this)}}:r},clearMicroEventSource:function(t){const n=null==e?void 0:e.get(t);(null==n?void 0:n.size)&&(n.forEach((e=>{e.close()})),n.clear())}}}();class wn{constructor(e,t){this.active=!1,this.scopeProperties=[],this.escapeProperties=[],this.escapeKeys=new Set,this.injectedKeys=new Set,this.microAppWindow=new EventTarget,this.adapter=new pn,this.getSpecialProperties(e),this.patchRouter(e,t,this.microAppWindow),this.windowEffect=wt(e,this.microAppWindow,this),this.documentEffect=At(e,this.microAppWindow,this),this.initStaticGlobalKeys(e,t,this.microAppWindow)}start({umdMode:e,baseroute:t,defaultPage:n,disablePatchRequest:o}){this.active||(this.active=!0,this.initRouteState(n),this.removeHistoryListener=Lt(this.microAppWindow.__MICRO_APP_NAME__),this.microAppWindow.__MICRO_APP_BASE_ROUTE__=this.microAppWindow.__MICRO_APP_BASE_URL__=t,e||this.initGlobalKeysWhenStart(this.microAppWindow.__MICRO_APP_NAME__,this.microAppWindow.__MICRO_APP_URL__,this.microAppWindow,o),1==++Wn.activeSandbox&&(xn(),$t()),1==++wn.activeCount&&window.__MICRO_APP_ENVIRONMENT__&&(mt(),window.addEventListener("unmount",ht,!1)),Wn.rawWindow._babelPolyfill&&(Wn.rawWindow._babelPolyfill=!1))}stop({umdMode:e,keepRouteState:t,destroy:n,clearData:o}){var r;this.active&&(this.recordAndReleaseEffect({umdMode:e,clearData:o,destroy:n},!e||n),this.clearRouteState(t),null===(r=this.removeHistoryListener)||void 0===r||r.call(this),e&&!n||(An(this.microAppWindow.__MICRO_APP_NAME__),this.injectedKeys.forEach((e=>{Reflect.deleteProperty(this.microAppWindow,e)})),this.injectedKeys.clear(),this.escapeKeys.forEach((e=>{Reflect.deleteProperty(Wn.rawWindow,e)})),this.escapeKeys.clear()),0==--Wn.activeSandbox&&(Tn(),jt()),--wn.activeCount,this.active=!1)}initStaticGlobalKeys(e,t,n){n.__MICRO_APP_ENVIRONMENT__=!0,n.__MICRO_APP_NAME__=e,n.__MICRO_APP_URL__=t,n.__MICRO_APP_PUBLIC_PATH__=x(t),n.__MICRO_APP_BASE_ROUTE__="",n.__MICRO_APP_WINDOW__=n,n.__MICRO_APP_PRE_RENDER__=!1,n.__MICRO_APP_UMD_MODE__=!1,n.__MICRO_APP_SANDBOX__=this,n.__MICRO_APP_SANDBOX_TYPE__="with",n.rawWindow=Wn.rawWindow,n.rawDocument=Wn.rawDocument,n.microApp=i(new ct(e),{removeDomScope:$,pureCreateElement:j,router:Kt}),this.setMappingPropertiesWithRawDescriptor(n)}recordAndReleaseEffect(e,t=!1){t?this.resetEffectSnapshot():this.recordEffectSnapshot(),this.releaseGlobalEffect(e)}resetEffectSnapshot(){this.windowEffect.reset(),this.documentEffect.reset(),pt(this.microAppWindow.microApp)}recordEffectSnapshot(){this.windowEffect.record(),this.documentEffect.record(),lt(this.microAppWindow.microApp)}rebuildEffectSnapshot(){this.windowEffect.rebuild(),this.documentEffect.rebuild(),ut(this.microAppWindow.microApp)}releaseGlobalEffect({umdMode:e=!1,clearData:t=!1,isPrerender:n=!1,keepAlive:o=!1,destroy:r=!1}){var i,s,a;this.windowEffect.release(!e&&!o&&!n||r),this.documentEffect.release(),null===(i=this.microAppWindow.microApp)||void 0===i||i.clearDataListener(),null===(s=this.microAppWindow.microApp)||void 0===s||s.clearGlobalDataListener(),t&&(Xn.clearData(this.microAppWindow.__MICRO_APP_NAME__),null===(a=this.microAppWindow.microApp)||void 0===a||a.clearData())}getSpecialProperties(e){var t;this.scopeProperties=this.scopeProperties.concat(this.adapter.staticScopeProperties),f(Xn.options.plugins)&&(this.commonActionForSpecialProperties(Xn.options.plugins.global),this.commonActionForSpecialProperties(null===(t=Xn.options.plugins.modules)||void 0===t?void 0:t[e]))}commonActionForSpecialProperties(e){if(r(e))for(const t of e)f(t)&&(r(t.scopeProperties)&&(this.scopeProperties=this.scopeProperties.concat(t.scopeProperties)),r(t.escapeProperties)&&(this.escapeProperties=this.escapeProperties.concat(t.escapeProperties)))}setPreRenderState(e){this.microAppWindow.__MICRO_APP_PRE_RENDER__=e}markUmdMode(e){this.microAppWindow.__MICRO_APP_UMD_MODE__=e}setMappingPropertiesWithRawDescriptor(e){let t,n;const o=Wn.rawWindow;o===o.parent?t=n=this.proxyWindow:(t=o.top,n=o.parent),s(e,"top",this.createDescriptorForMicroAppWindow("top",t)),s(e,"parent",this.createDescriptorForMicroAppWindow("parent",n)),We.forEach((t=>{s(e,t,this.createDescriptorForMicroAppWindow(t,this.proxyWindow))}))}createDescriptorForMicroAppWindow(e,t){const{configurable:n=!0,enumerable:o=!0,writable:r,set:i}=Object.getOwnPropertyDescriptor(Wn.rawWindow,e)||{writable:!0};return{value:t,configurable:n,enumerable:o,writable:null!=r?r:!!i}}initGlobalKeysWhenStart(e,t,n,o){n.hasOwnProperty=e=>c.call(n,e)||c.call(Wn.rawWindow,e),this.setHijackProperty(e,n),o||this.patchRequestApi(e,t,n),this.setScopeProperties(n)}setHijackProperty(e,t){let n,o;a(t,{eval:{configurable:!0,enumerable:!1,get:()=>(F(e),n||Wn.rawWindow.eval),set:e=>{n=e}},Image:{configurable:!0,enumerable:!1,get:()=>(F(e),o||Wn.ImageProxy),set:e=>{o=e}}})}patchRequestApi(e,t,n){let o=mn(t),r=fn(t),i=_n(e,t);a(n,{fetch:{configurable:!0,enumerable:!0,get:()=>o,set(e){o=mn(t,e)}},XMLHttpRequest:{configurable:!0,enumerable:!0,get:()=>r,set(e){r=fn(t,e)}},EventSource:{configurable:!0,enumerable:!0,get:()=>i,set(n){i=_n(e,t,n)}}})}setScopeProperties(e){this.scopeProperties.forEach((t=>{Reflect.set(e,t,e[t])}))}patchRouter(e,t,n){const{microLocation:o,microHistory:r}=function(e,t){const n=on(e,t);return{microLocation:n,microHistory:Wt(e,n)}}(e,t);a(n,{location:{configurable:!1,enumerable:!0,get:()=>o,set:e=>{Wn.rawWindow.location=e}},history:{configurable:!0,enumerable:!0,get:()=>r}})}initRouteState(e){an(this.microAppWindow.__MICRO_APP_NAME__,this.microAppWindow.location,e)}clearRouteState(e){ln(this.microAppWindow.__MICRO_APP_NAME__,this.microAppWindow.__MICRO_APP_URL__,this.microAppWindow.location,e)}setRouteInfoForKeepAliveApp(){cn(this.microAppWindow.__MICRO_APP_NAME__,this.microAppWindow.location)}removeRouteInfoForKeepAliveApp(){un(this.microAppWindow.__MICRO_APP_NAME__)}patchStaticElement(e){dn(e,this.microAppWindow.__MICRO_APP_NAME__)}actionBeforeExecScripts(e){this.patchStaticElement(e)}}function yn(e,t,n){return function(e,t){const n=Wn.rawWindow;Qt.forEach((e=>{t[e]=_t(n[e],n)})),Object.getOwnPropertyNames(t).filter((e=>(zt.some((o=>{if(o.test(e)&&e in t.parent){if(m(n[e]))t[e]=_t(n[e],n);else{const{configurable:o,enumerable:r}=Object.getOwnPropertyDescriptor(t,e)||{configurable:!0,enumerable:!0};o&&s(t,e,{configurable:o,enumerable:r,get:()=>n[e],set:t=>{n[e]=t}})}return!0}return!1})),/^on/.test(e)&&!Le.includes(e)))).forEach((o=>{const{enumerable:r,writable:i,set:a}=Object.getOwnPropertyDescriptor(t,o)||{enumerable:!0,writable:!0};try{s(t,o,{enumerable:r,configurable:!0,get:()=>n[o],set:(null!=i?i:a)?e=>{n[o]=m(e)?e.bind(t):e}:void 0})}catch(t){C(t,e)}}))}(e,t),function(e,t){const n=Wn.rawWindow,o=[],r=new Proxy(e,{get:(e,n)=>"location"===n?t.proxyLocation:We.includes(n.toString())?r:o.includes(n)?Reflect.get(e,n):_t(Reflect.get(e,n),e),set:(e,r,i)=>"location"===r?Reflect.set(n,r,i):(Reflect.has(e,r)||o.push(r),Reflect.set(e,r,i),t.escapeProperties.includes(r)&&(!Reflect.has(n,r)&&t.escapeKeys.add(r),Reflect.set(n,r,i)),!0),has:(e,t)=>t in e,deleteProperty:(e,o)=>!Reflect.has(e,o)||(t.escapeKeys.has(o)&&Reflect.deleteProperty(n,o),Reflect.deleteProperty(e,o))});t.proxyWindow=r}(t,n),function(e){const{rawWindow:t,rawAddEventListener:n,rawRemoveEventListener:o}=Wn,r=new Map,i=new Map;function s(n){return xe.includes(n)?e:t}e.addEventListener=function(e,t,o){const i=r.get(e);i?i.add(t):r.set(e,new Set([t])),t&&(t.__MICRO_APP_MARK_OPTIONS__=o),n.call(s(e),e,t,o)},e.removeEventListener=function(e,t,n){const i=r.get(e);(null==i?void 0:i.size)&&i.has(t)&&i.delete(t),o.call(s(e),e,t,n)};const a=()=>{i.clear()},c=()=>{i.forEach(((t,n)=>{for(const o of t)e.addEventListener(n,o,null==o?void 0:o.__MICRO_APP_MARK_OPTIONS__)})),a()};return{reset:a,record:()=>{r.forEach(((e,t)=>{if(e.size){const n=i.get(t)||[];i.set(t,new Set([...n,...e]))}}))},rebuild:c,release:()=>{r.size&&(r.forEach(((e,t)=>{for(const n of e)o.call(s(t),t,n)})),r.clear())}}}(t)}function gn(e,t,n){return function(e,t){const n=Wn.rawDocument,o=t.Document,r=t.document,i=o.prototype.createElement,s=o.prototype.createTextNode,a=o.prototype.createComment,c=o.prototype.querySelector,l=o.prototype.querySelectorAll,u=o.prototype.getElementById,p=o.prototype.getElementsByClassName,d=o.prototype.getElementsByTagName,h=o.prototype.getElementsByName,m=o.prototype.elementFromPoint,f=o.prototype.caretRangeFromPoint;function _(e){return r!==e?e:n}function A(t){var n,o;if(!t||G(t)||r!==this){const e=_(this);return c.call(e,t)}return null!==(o=null===(n=En.get(e))||void 0===n?void 0:n.querySelector(t))&&void 0!==o?o:null}function w(t){var n,o;if(!t||G(t)||r!==this){const e=_(this);return l.call(e,t)}return null!==(o=null===(n=En.get(e))||void 0===n?void 0:n.querySelectorAll(t))&&void 0!==o?o:[]}o.prototype.caretRangeFromPoint=function(t,o){const r=m.call(n,t,o),i=f.call(n,t,o);return hn(r,e),i},o.prototype.createElement=function(t,n){return hn(i.call(this,t,n),e)},o.prototype.createTextNode=function(t){return hn(s.call(this,t),e)},o.prototype.createComment=function(t){return hn(a.call(this,t),e)},o.prototype.querySelector=A,o.prototype.querySelectorAll=w,o.prototype.getElementById=function(e){const t=_(this);if(q(e))return u.call(t,e);try{return A.call(this,`#${e}`)}catch(n){return u.call(t,e)}},o.prototype.getElementsByClassName=function(e){const t=_(this);if(q(e))return p.call(t,e);try{return w.call(this,`.${e}`)}catch(n){return p.call(t,e)}},o.prototype.getElementsByTagName=function(e){const t=_(this);if(G(e)||q(e))return d.call(t,e);if(/^script|base$/i.test(e))return d.call(r,e);try{return w.call(this,e)}catch(n){return d.call(t,e)}},o.prototype.getElementsByName=function(e){const t=_(this);if(q(e))return h.call(t,e);try{return w.call(this,`[name=${e}]`)}catch(n){return h.call(t,e)}}}(e,t),function(e,t,n){const o=Wn.rawDocument,r=t.Document,i=t.document,c=(e,t)=>{const{enumerable:n}=Object.getOwnPropertyDescriptor(r.prototype,e)||{enumerable:!0};return{configurable:!0,enumerable:n,get:t}},l=()=>{const t={};return[["documentURI",()=>n.proxyLocation.href],["URL",()=>n.proxyLocation.href],["documentElement",()=>o.documentElement],["scrollingElement",()=>o.scrollingElement],["forms",()=>r.prototype.querySelectorAll.call(i,"form")],["images",()=>r.prototype.querySelectorAll.call(i,"img")],["links",()=>r.prototype.querySelectorAll.call(i,"a")],["microAppElement",()=>{var t;return null===(t=En.get(e))||void 0===t?void 0:t.container}],["__MICRO_APP_NAME__",()=>e]].forEach((e=>{t[e[0]]=c(e[0],e[1])})),Yt.forEach((e=>{t[e]=c(e,(()=>o[e]))})),Jt.forEach((e=>{t[e]=c(e,(()=>_t(o[e],o,"DOCUMENT")))})),Zt.forEach((e=>{t[e]=c(e,(()=>o[e]))})),en.forEach((e=>{t[e]=c(e,(()=>_t(o[e],o,"DOCUMENT")))})),t};a(r.prototype,l()),Xt.forEach((e=>{s(i,e,{enumerable:!0,configurable:!0,get:()=>o[e],set:t=>{o[e]=t}})}))}(e,t,n),function(e,t){const{rawDocument:n,rawAddEventListener:o,rawRemoveEventListener:r}=Wn,i=new Map,a=new Map;let c=null,l=null;const u=t.Document,p=t.document;function d(e,t){return Te.includes(e)?t:n}function h(e){return"onclick"===e?e=>{m(c)&&r.call(n,"click",c,!1),m(e)?(c=e.bind(p),o.call(n,"click",c,!1)):c=e}:t=>{n[e]=m(t)?t.bind(p):t}}u.prototype.addEventListener=function(e,t,n){const r=m(t)?t.__MICRO_APP_BOUND_FUNCTION__=t.__MICRO_APP_BOUND_FUNCTION__||t.bind(this):t,s=i.get(e);s?s.add(t):i.set(e,new Set([t])),t&&(t.__MICRO_APP_MARK_OPTIONS__=n),o.call(d(e,this),e,r,n)},u.prototype.removeEventListener=function(e,t,n){const o=i.get(e);(null==o?void 0:o.size)&&o.has(t)&&o.delete(t);const s=(null==t?void 0:t.__MICRO_APP_BOUND_FUNCTION__)||t;r.call(d(e,this),e,s,n)},Object.getOwnPropertyNames(u.prototype).filter((e=>/^on/.test(e)&&!Ue.includes(e))).forEach((t=>{const{enumerable:o,writable:r,set:i}=Object.getOwnPropertyDescriptor(u.prototype,t)||{enumerable:!0,writable:!0};try{s(u.prototype,t,{enumerable:o,configurable:!0,get:()=>"onclick"===t?c:n[t],set:(null!=r?r:i)?h(t):void 0})}catch(t){C(t,e)}}));const f=()=>{a.clear(),l=null},_=()=>{l&&!c&&(p.onclick=l),a.forEach(((e,t)=>{for(const n of e)p.addEventListener(t,n,null==n?void 0:n.__MICRO_APP_MARK_OPTIONS__)})),f()};return{reset:f,record:()=>{l=c||l,i.forEach(((e,t)=>{if(e.size){const n=a.get(t)||[];a.set(t,new Set([...n,...e]))}}))},rebuild:_,release:()=>{m(c)&&r.call(n,"click",c),c=null,i.size&&(i.forEach(((e,t)=>{for(const n of e)r.call(d(t,p),t,(null==n?void 0:n.__MICRO_APP_BOUND_FUNCTION__)||n)})),i.clear())}}}(e,t)}function vn(e,t,n,o){!function(e,t,n){const o=Wn.rawRootElement,r=Wn.rawDocument,i=t.document,a=t.Node,c=t.Element,l=a.prototype.appendChild,u=a.prototype.insertBefore,p=a.prototype.replaceChild,d=a.prototype.removeChild,h=c.prototype.append,m=c.prototype.prepend,f=c.prototype.insertAdjacentElement,_=a.prototype.cloneNode,A=Object.getOwnPropertyDescriptor(c.prototype,"innerHTML"),w=Object.getOwnPropertyDescriptor(a.prototype,"parentNode"),y=e=>(P(e)||function(e){var t,n;return"BASE"===(null===(n=null===(t=e)||void 0===t?void 0:t.tagName)||void 0===n?void 0:n.toUpperCase())}(e))&&e.__PURE_ELEMENT__,b=e=>e===n.microHead?r.head:e===n.microBody?r.body:e;a.prototype.getRootNode=function(){return i},a.prototype.appendChild=function(t){return hn(t,e),y(t)?l.call(this,t):o.prototype.appendChild.call(b(this),t)},a.prototype.insertBefore=function(t,n){return hn(t,e),y(t)?u.call(this,t,n):o.prototype.insertBefore.call(b(this),t,n)},a.prototype.replaceChild=function(t,n){return hn(t,e),y(t)?p.call(this,t,n):o.prototype.replaceChild.call(b(this),t,n)},a.prototype.removeChild=function(e){return y(e)||this.contains(e)?d.call(this,e):o.prototype.removeChild.call(b(this),e)},c.prototype.append=function(...e){let t=0,n=!1;for(;t<e.length;)e[t]=v(e[t])?e[t]:i.createTextNode(e[t]),y(e[t])&&(n=!0),t++;return n?h.call(this,...e):o.prototype.append.call(b(this),...e)},c.prototype.prepend=function(...e){let t=0,n=!1;for(;t<e.length;)e[t]=v(e[t])?e[t]:i.createTextNode(e[t]),y(e[t])&&(n=!0),t++;return n?m.call(this,...e):o.prototype.prepend.call(b(this),...e)},c.prototype.insertAdjacentElement=function(t,n){return hn(n,e),y(n)?f.call(this,t,n):o.prototype.insertAdjacentElement.call(b(this),t,n)},a.prototype.cloneNode=function(t){return hn(_.call(this,t),e)},s(c.prototype,"innerHTML",{configurable:!0,enumerable:!0,get(){return A.get.call(this)},set(t){A.set.call(this,t),Array.from(this.children).forEach((t=>{g(t)&&hn(t,e)}))}}),s(a.prototype,"parentNode",{configurable:!0,enumerable:!0,get(){var t,n,o;F(e);const i=w.get.call(this);return R(i)&&(null===(t=En.get(e))||void 0===t?void 0:t.container)?(null===(o=(n=Xn.options).getRootElementParentNode)||void 0===o?void 0:o.call(n,this,e))||r.body:i}});const E=new Proxy(t.Image,{construct(t,n){const o=new t(...n);return hn(o,e),o}});s(t,"Image",{configurable:!0,writable:!0,value:E})}(e,n,o),function(e,t){const n=t.Element,o=n.prototype.setAttribute;n.prototype.setAttribute=function(t,n){(("src"===t||"srcset"===t)&&/^(img|script)$/i.test(this.tagName)||"href"===t&&/^link$/i.test(this.tagName))&&(n=L(n,e)),o.call(this,t,n)};const r=[[t.HTMLImageElement.prototype,"src"],[t.HTMLScriptElement.prototype,"src"],[t.HTMLLinkElement.prototype,"href"]];r.forEach((([t,n])=>{const{enumerable:o,configurable:r,get:i,set:a}=Object.getOwnPropertyDescriptor(t,n)||{enumerable:!0,configurable:!0};s(t,n,{enumerable:o,configurable:r,get:function(){return null==i?void 0:i.call(this)},set:function(t){null==a||a.call(this,L(t,e))}})}))}(t,n)}wn.activeCount=0;class bn{constructor(e,t){this.active=!1,this.escapeProperties=[],this.escapeKeys=new Set,this.updateIframeBase=()=>{var e;null===(e=this.baseElement)||void 0===e||e.setAttribute("href",this.proxyLocation.protocol+"//"+this.proxyLocation.host+this.proxyLocation.pathname)};const n=Wn.rawWindow.location,o=n.protocol+"//"+n.host;this.deleteIframeElement=this.createIframeElement(e,o),this.microAppWindow=this.iframe.contentWindow,this.patchIframe(this.microAppWindow,(n=>{this.createIframeTemplate(this.microAppWindow),this.getSpecialProperties(e),this.proxyLocation=function(e,t,n,o){const r=new URL(t),s=r.protocol+"//"+r.host,a=r.pathname+r.search+r.hash,c=n.history;return n.rawReplaceState=c.replaceState,i(c,Wt(e,n.location)),sn(e,a,n.location,"prevent"),on(e,t,n,r,o,s)}(e,t,this.microAppWindow,o),this.windowEffect=yn(e,this.microAppWindow,this),this.documentEffect=gn(e,this.microAppWindow,this),vn(e,t,this.microAppWindow,this),this.initStaticGlobalKeys(e,t,this.microAppWindow),n()}))}createIframeElement(e,t){this.iframe=j("iframe");const n={src:t,style:"display: none",id:e};return Object.keys(n).forEach((e=>this.iframe.setAttribute(e,n[e]))),Wn.rawDocument.body.appendChild(this.iframe),()=>M((()=>{var e,t;null===(t=null===(e=this.iframe)||void 0===e?void 0:e.parentNode)||void 0===t||t.removeChild(this.iframe),this.iframe=null}))}start({baseroute:e,defaultPage:t,disablePatchRequest:n}){this.active||(this.active=!0,this.initRouteState(t),this.removeHistoryListener=Lt(this.microAppWindow.__MICRO_APP_NAME__),this.microAppWindow.__MICRO_APP_BASE_ROUTE__=this.microAppWindow.__MICRO_APP_BASE_URL__=e,n||this.createIframeBase(),1==++Wn.activeSandbox&&(xn(),$t()),++bn.activeCount)}stop({umdMode:e,keepRouteState:t,destroy:n,clearData:o}){var r;this.active&&(this.recordAndReleaseEffect({clearData:o},!e||n),this.clearRouteState(t),null===(r=this.removeHistoryListener)||void 0===r||r.call(this),e&&!n||(this.deleteIframeElement(),this.escapeKeys.forEach((e=>{Reflect.deleteProperty(Wn.rawWindow,e)})),this.escapeKeys.clear()),0==--Wn.activeSandbox&&(Tn(),jt()),--bn.activeCount,this.active=!1)}initStaticGlobalKeys(e,t,n){n.__MICRO_APP_ENVIRONMENT__=!0,n.__MICRO_APP_NAME__=e,n.__MICRO_APP_URL__=t,n.__MICRO_APP_PUBLIC_PATH__=x(t),n.__MICRO_APP_BASE_ROUTE__="",n.__MICRO_APP_WINDOW__=n,n.__MICRO_APP_PRE_RENDER__=!1,n.__MICRO_APP_UMD_MODE__=!1,n.__MICRO_APP_PROXY_WINDOW__=this.proxyWindow,n.__MICRO_APP_SANDBOX__=this,n.__MICRO_APP_SANDBOX_TYPE__="iframe",n.rawWindow=Wn.rawWindow,n.rawDocument=Wn.rawDocument,n.microApp=i(new ct(e),{removeDomScope:$,pureCreateElement:j,location:this.proxyLocation,router:Kt})}recordAndReleaseEffect(e,t=!1){t?this.resetEffectSnapshot():this.recordEffectSnapshot(),this.releaseGlobalEffect(e)}resetEffectSnapshot(){var e,t;null===(e=this.windowEffect)||void 0===e||e.reset(),null===(t=this.documentEffect)||void 0===t||t.reset(),pt(this.microAppWindow.microApp)}recordEffectSnapshot(){var e,t;null===(e=this.windowEffect)||void 0===e||e.record(),null===(t=this.documentEffect)||void 0===t||t.record(),lt(this.microAppWindow.microApp)}rebuildEffectSnapshot(){var e,t;null===(e=this.windowEffect)||void 0===e||e.rebuild(),null===(t=this.documentEffect)||void 0===t||t.rebuild(),ut(this.microAppWindow.microApp)}releaseGlobalEffect({clearData:e=!1}){var t,n,o,r,i;null===(t=this.windowEffect)||void 0===t||t.release(),null===(n=this.documentEffect)||void 0===n||n.release(),null===(o=this.microAppWindow.microApp)||void 0===o||o.clearDataListener(),null===(r=this.microAppWindow.microApp)||void 0===r||r.clearGlobalDataListener(),e&&(Xn.clearData(this.microAppWindow.__MICRO_APP_NAME__),null===(i=this.microAppWindow.microApp)||void 0===i||i.clearData())}setPreRenderState(e){this.microAppWindow.__MICRO_APP_PRE_RENDER__=e}markUmdMode(e){this.microAppWindow.__MICRO_APP_UMD_MODE__=e}patchIframe(e,t){const n=e.document;this.sandboxReady=new Promise((o=>{!function r(){setTimeout((()=>{try{e.document===n?r():(e.stop(),t(o))}catch(e){r()}}),0)}()}))}createIframeTemplate(e){const t=e.document;!function(e){for(;null==e?void 0:e.firstChild;)e.removeChild(e.firstChild)}(t);const n=t.createElement("html");n.innerHTML="<head></head><body></body>",t.appendChild(n),this.microBody=t.body,this.microHead=t.head}createIframeBase(){this.baseElement=j("base"),this.updateIframeBase(),this.microHead.appendChild(this.baseElement)}getSpecialProperties(e){var t;f(Xn.options.plugins)&&(this.commonActionForSpecialProperties(Xn.options.plugins.global),this.commonActionForSpecialProperties(null===(t=Xn.options.plugins.modules)||void 0===t?void 0:t[e]))}commonActionForSpecialProperties(e){if(r(e))for(const t of e)f(t)&&r(t.escapeProperties)&&(this.escapeProperties=this.escapeProperties.concat(t.escapeProperties))}initRouteState(e){an(this.microAppWindow.__MICRO_APP_NAME__,this.microAppWindow.location,e)}clearRouteState(e){ln(this.microAppWindow.__MICRO_APP_NAME__,this.microAppWindow.__MICRO_APP_URL__,this.microAppWindow.location,e)}setRouteInfoForKeepAliveApp(){cn(this.microAppWindow.__MICRO_APP_NAME__,this.microAppWindow.location)}removeRouteInfoForKeepAliveApp(){un(this.microAppWindow.__MICRO_APP_NAME__)}patchStaticElement(e){dn(e,this.microAppWindow.__MICRO_APP_NAME__)}actionBeforeExecScripts(e){this.patchStaticElement(e)}}bn.activeCount=0;const En=new Map;class Pn{constructor({name:e,url:t,container:n,scopecss:o,useSandbox:r,inline:i,iframe:s,ssrUrl:a,isPrefetch:c,prefetchLevel:l,routerMode:u}){this.state=ge.CREATED,this.keepAliveState=null,this.loadSourceLevel=0,this.umdHookMount=null,this.umdHookUnmount=null,this.umdMode=!1,this.sandBox=null,this.fiber=!1,En.set(e,this),this.name=e,this.url=t,this.useSandbox=r,this.scopecss=this.useSandbox&&o,this.iframe=null!=s&&s,this.inline=this.getInlineModeState(i),this.routerMode=u||Oe,this.container=null!=n?n:null,this.ssrUrl=null!=a?a:"",this.isPrefetch=null!=c&&c,this.isPrerender=3===l,this.prefetchLevel=l,this.source={html:null,links:new Set,scripts:new Set},this.loadSourceCode(),this.createSandbox()}loadSourceCode(){this.setAppState(ge.LOADING),ae.getInstance().run(this,ot)}onLoad(e,t,n,o,r){var i;if(2==++this.loadSourceLevel)if(this.source.html=e,this.isPrefetch||this.isUnmounted()){if(this.isPrerender){const e=j("div");e.setAttribute("prerender","true"),null===(i=this.sandBox)||void 0===i||i.setPreRenderState(!0),this.mount({container:e,inline:this.inline,routerMode:o,baseroute:r||"",fiber:!0,defaultPage:t||"",disablePatchRequest:null!=n&&n})}}else Q(this.container).mount(this)}onLoadError(e){this.loadSourceLevel=-1,this.isUnmounted()||(this.onerror(e),this.setAppState(ge.LOAD_FAILED))}mount({container:e,inline:t,routerMode:n,defaultPage:o,baseroute:r,disablePatchRequest:i,fiber:s}){if(2!==this.loadSourceLevel)return this.container=e,this.isPrerender=!1,this.setAppState(ge.LOADING);this.createSandbox(),this.setAppState(ge.BEFORE_MOUNT);const a=()=>{var a,c,u,d,h,f,_;if(this.isPrerender&&function(e){var t,n;return"DIV"===(null===(n=null===(t=e)||void 0===t?void 0:t.tagName)||void 0===n?void 0:n.toUpperCase())}(this.container)&&this.container.hasAttribute("prerender"))null===(a=this.sandBox)||void 0===a||a.rebuildEffectSnapshot(),K(e,this.container,!1),this.container=e,null===(c=this.preRenderEvents)||void 0===c||c.forEach((e=>e())),this.isPrerender=!1,this.preRenderEvents=null,Kt.attachToURL(this.name),null===(u=this.sandBox)||void 0===u||u.setPreRenderState(!1);else{this.container=e,this.inline=this.getInlineModeState(t),this.fiber=s,this.routerMode=n;const a=()=>re(this.container,this.name,ve.BEFOREMOUNT);if(this.isPrerender?(null!==(d=this.preRenderEvents)&&void 0!==d?d:this.preRenderEvents=[]).push(a):a(),this.setAppState(ge.MOUNTING),K(this.container,this.source.html,!this.umdMode),null===(h=this.sandBox)||void 0===h||h.start({umdMode:this.umdMode,baseroute:r,defaultPage:o,disablePatchRequest:i}),this.umdMode){null===(_=this.sandBox)||void 0===_||_.rebuildEffectSnapshot();try{this.handleMounted(this.umdHookMount(Xn.getData(this.name,!0)))}catch(e){S("An error occurred in window.mount \n",this.name,e)}}else null===(f=this.sandBox)||void 0===f||f.actionBeforeExecScripts(this.container),function(e,t){const n=e.fiber?[]:null,o=Array.from(e.source.scripts),r=[],i=[];for(const s of o){const o=Re.script.getInfo(s),a=o.appSpace[e.name];a.defer||a.async?(!o.isExternal||o.code||He(e,o)?r.push(o.code):r.push(se(s,e.name)),i.push([s,o]),He(e,o)&&(t.moduleCount=t.moduleCount?++t.moduleCount:1)):ee(n,(()=>{Ze(s,e,o),t(!1)}))}r.length?T(r,(e=>{const t=i[e.index][1];t.code=t.code||e.data}),(n=>{t.errorCount=t.errorCount?++t.errorCount:1,S(n,e.name)}),(()=>{i.forEach((([o,r])=>{p(r.code)&&ee(n,(()=>{Ze(o,e,r,t),!He(e,r)&&t(!1)}))})),n?(n.push((()=>Promise.resolve(t(l(t.moduleCount)||t.errorCount===r.length)))),te(n)):t(l(t.moduleCount)||t.errorCount===r.length)})):n?(n.push((()=>Promise.resolve(t(!0)))),te(n)):t(!0)}(this,(e=>{if(!this.umdMode){const{mount:t,unmount:n}=this.getUmdLibraryHooks();if(this.umdHookUnmount=n,m(t)&&m(n)){this.umdHookMount=t,this.sandBox.markUmdMode(this.umdMode=!0);try{this.handleMounted(this.umdHookMount(Xn.getData(this.name,!0)))}catch(e){S("An error occurred in window.mount \n",this.name,e)}}else!0===e&&this.handleMounted()}}))}};this.iframe?this.sandBox.sandboxReady.then(a):a()}handleMounted(e){var t,n;const o=()=>{A(e)?e.then((()=>this.dispatchMountedEvent())).catch((e=>{S("An error occurred in window.mount \n",this.name,e),this.dispatchMountedEvent()})):this.dispatchMountedEvent()};this.isPrerender?(null===(t=this.preRenderEvents)||void 0===t||t.push(o),null===(n=this.sandBox)||void 0===n||n.recordAndReleaseEffect({isPrerender:!0})):o()}dispatchMountedEvent(){var e;this.isUnmounted()||(this.setAppState(ge.MOUNTED),oe(this.getMicroAppGlobalHook(be.ONMOUNT),this.name,be.ONMOUNT,Xn.getData(this.name,!0)),re(this.container,this.name,ve.MOUNTED),this.isHidden()&&(null===(e=this.sandBox)||void 0===e||e.recordAndReleaseEffect({keepAlive:!0})))}unmount({destroy:e,clearData:t,keepRouteState:n,unmountcb:o}){var r;e=e||this.state===ge.LOAD_FAILED,this.setAppState(ge.UNMOUNT);let i=null;try{i=null===(r=this.umdHookUnmount)||void 0===r?void 0:r.call(this,Xn.getData(this.name,!0))}catch(e){S("An error occurred in window.unmount \n",this.name,e)}ie(this,"unmount"),oe(this.getMicroAppGlobalHook(be.ONUNMOUNT),this.name,be.ONUNMOUNT),this.handleUnmounted({destroy:e,clearData:t,keepRouteState:n,unmountcb:o,umdHookUnmountResult:i})}handleUnmounted({destroy:e,clearData:t,keepRouteState:n,unmountcb:o,umdHookUnmountResult:r}){const i=()=>this.actionsForUnmount({destroy:e,clearData:t,keepRouteState:n,unmountcb:o});A(r)?($(),r.then(i).catch(i)):i()}actionsForUnmount({destroy:e,clearData:t,keepRouteState:n,unmountcb:o}){var r;this.umdMode&&this.container&&!e&&K(this.source.html,this.container,!1),null===(r=this.sandBox)||void 0===r||r.stop({umdMode:this.umdMode,keepRouteState:n&&!e,destroy:e,clearData:t||e}),re(this.container,this.name,ve.UNMOUNT),this.clearOptions(e),null==o||o()}clearOptions(e){this.container.innerHTML="",this.container=null,this.isPrerender=!1,this.preRenderEvents=null,this.setKeepAliveState(null),this.iframe&&!this.umdMode&&(this.sandBox=null),e&&this.actionsForCompletelyDestroy(),$()}actionsForCompletelyDestroy(){var e,t;null===(t=null===(e=this.sandBox)||void 0===e?void 0:e.deleteIframeElement)||void 0===t||t.call(e),Re.script.deleteInlineInfo(this.source.scripts),En.delete(this.name)}hiddenKeepAliveApp(e){var t,n;this.setKeepAliveState(Ee.KEEP_ALIVE_HIDDEN),ie(this,"appstate-change",{appState:"afterhidden"}),re(this.container,this.name,ve.AFTERHIDDEN),this.routerMode!==De&&(null===(t=this.sandBox)||void 0===t||t.removeRouteInfoForKeepAliveApp()),2!==this.loadSourceLevel?Q(this.container).unmount():(this.container=K(j("div"),this.container,!1),null===(n=this.sandBox)||void 0===n||n.recordAndReleaseEffect({keepAlive:!0})),null==e||e()}showKeepAliveApp(e){var t,n;null===(t=this.sandBox)||void 0===t||t.rebuildEffectSnapshot(),ie(this,"appstate-change",{appState:"beforeshow"}),re(e,this.name,ve.BEFORESHOW),this.setKeepAliveState(Ee.KEEP_ALIVE_SHOW),this.container=K(e,this.container,!1),this.routerMode!==De&&(null===(n=this.sandBox)||void 0===n||n.setRouteInfoForKeepAliveApp()),ie(this,"appstate-change",{appState:"aftershow"}),re(this.container,this.name,ve.AFTERSHOW)}onerror(e){re(this.container,this.name,ve.ERROR,e)}createSandbox(){this.useSandbox&&!this.sandBox&&(this.iframe?this.sandBox=new bn(this.name,this.url):this.sandBox=new wn(this.name,this.url))}setAppState(e){this.state=e}getAppState(){return this.state}setKeepAliveState(e){this.keepAliveState=e}getKeepAliveState(){return this.keepAliveState}isUnmounted(){return ge.UNMOUNT===this.state}isHidden(){return Ee.KEEP_ALIVE_HIDDEN===this.keepAliveState}getUmdLibraryHooks(){if(!this.isUnmounted()&&this.sandBox){const e=Q(this.container).getAttribute("library")||`micro-app-${this.name}`,t=this.sandBox.proxyWindow;return _(t[e])?t[e]:{mount:t.mount,unmount:t.unmount}}return{}}getMicroAppGlobalHook(e){var t,n;const o=null===(n=null===(t=this.sandBox)||void 0===t?void 0:t.proxyWindow)||void 0===n?void 0:n[e];return m(o)?o:null}querySelector(e){return this.container?Wn.rawElementQuerySelector.call(this.container,e):null}querySelectorAll(e){return this.container?Wn.rawElementQuerySelectorAll.call(this.container,e):[]}getInlineModeState(e){var t;return null!==(t=this.iframe||e)&&void 0!==t&&t}}function Rn(e){var t,n;return null!==(n=null===(t=En.get(e))||void 0===t?void 0:t.iframe)&&void 0!==n&&n}const Sn=new WeakMap;function Cn(e){var t;return null!==(t=Sn.get(e))&&void 0!==t?t:e}function Mn(e,t){if(Sn.has(e))return Sn.get(e);if(E(e)){if(e.hasAttribute("exclude")){const t=document.createComment("style element with exclude attribute ignored by micro-app");return Sn.set(e,t),t}return t.scopecss&&!e.hasAttribute("ignore")?me(e,t):e}if(b(e)){if(e.hasAttribute("exclude")||Ve(e.getAttribute("href"),t.name)){const t=document.createComment("link element with exclude attribute ignored by micro-app");return Sn.set(e,t),t}if(e.hasAttribute("ignore")||Ye(e.getAttribute("href"),t.name)||e.href&&m(Xn.options.excludeAssetFilter)&&Xn.options.excludeAssetFilter(e.href))return e;const{address:n,linkInfo:o,replaceComment:r}=Se(e,null,t,!0);if(n&&o){const r=function(e,t,n,o){const r=j("style"),i=()=>{Me(t,e,r,n,n.appSpace[t.name].attrs),Ae(o)};return n.code?M(i):se(e,t.name).then((e=>{n.code=e,i()})).catch((e=>{S(e,t.name),we(o)})),r}(n,t,o,e);return Sn.set(e,r),r}return r?(Sn.set(e,r),r):e}if(P(e)){if(e.src&&m(Xn.options.excludeAssetFilter)&&Xn.options.excludeAssetFilter(e.src))return e;const{replaceComment:n,address:o,scriptInfo:r}=ze(e,null,t,!0)||{};if(o&&r){const n=r.isExternal?function(e,t,n,o){const r=$e(t,n)?j("script"):document.createComment("dynamic script extract by micro-app"),i=()=>Ae(o),s=()=>{const s=Object.getOwnPropertyDescriptor(Wn.rawDocument,"currentScript");s&&!s.configurable||Object.defineProperty(Wn.rawDocument,"currentScript",{value:o,configurable:!0}),Ze(e,t,n,i,r),!He(t,n)&&i()};return n.code||He(t,n)?M(s):se(e,t.name).then((e=>{n.code=e,s()})).catch((e=>{S(e,t.name),we(o)})),r}(o,t,r,e):function(e,t,n){const o=$e(t,n)?j("script"):document.createComment("dynamic script extract by micro-app");return Ze(e,t,n,void 0,o),o}(o,t,r);return Sn.set(e,n),n}return n?(Sn.set(e,n),n):e}return e}function Nn(e,t,n,o,r){const i=On(n,o,e);if(i){if(!Rn(e.name)&&R(i)&&t!==Wn.rawRemoveChild){const t=Object.getOwnPropertyDescriptor(o,"parentNode");t&&!t.configurable||o.__MICRO_APP_HAS_DPN__||a(o,{parentNode:{configurable:!0,get(){var t,n;const o=Wn.rawParentNodeDesc.get.call(this);return R(o)&&e.container?(null===(n=(t=Xn.options).getRootElementParentNode)||void 0===n?void 0:n.call(t,this,e.name))||document.body:o}},__MICRO_APP_HAS_DPN__:{configurable:!0,get:()=>!0}})}return r&&!i.contains(r)?Wn.rawAppendChild.call(i,o):t!==Wn.rawRemoveChild||i.contains(o)?Dn(t,i,o,r):n.contains(o)?t.call(n,o):o}return Dn(t,n,o,r)}function On(e,t,n){if(n){if(e===document.head)return n.iframe&&P(t)?n.sandBox.microHead:n.querySelector("micro-app-head");if(e===document.body||e===document.body.parentNode)return n.iframe&&P(t)?n.sandBox.microBody:n.querySelector("micro-app-body");if(n.iframe&&P(t))return n.sandBox.microBody}return null}function Dn(e,t,n,o){return(r=e)===Wn.rawAppend||r===Wn.rawPrepend?e.call(t,n):e.call(t,n,o);var r}function In(e,t,n,o){const r=H();if(v(t)&&!t.__PURE_ELEMENT__&&(t.__MICRO_APP_NAME__||r)){t.__MICRO_APP_NAME__=t.__MICRO_APP_NAME__||r;const i=En.get(t.__MICRO_APP_NAME__);if(null==i?void 0:i.container)return function(e,t){g(t)&&(/^(img|script)$/i.test(t.tagName)?(t.hasAttribute("src")&&Wn.rawSetAttribute.call(t,"src",L(t.getAttribute("src"),e.url)),t.hasAttribute("srcset")&&Wn.rawSetAttribute.call(t,"srcset",L(t.getAttribute("srcset"),e.url))):/^link$/i.test(t.tagName)&&t.hasAttribute("href")&&Wn.rawSetAttribute.call(t,"href",L(t.getAttribute("href"),e.url)))}(i,t),Nn(i,o,e,Mn(t,i),n&&Cn(n))}return o===Wn.rawAppend||o===Wn.rawPrepend?o.call(e,t):o.call(e,t,n)}function xn(){!function(){const e=Wn.rawDocument,t=Wn.rawRootDocument;function n(t){return function(e){return"[object ProxyDocument]"===toString.call(e)}(t)?e:t}function o(t){var o,r;const i=n(this),s=H();return s&&t&&!G(t)&&e===i?null!==(r=null===(o=En.get(s))||void 0===o?void 0:o.querySelector(t))&&void 0!==r?r:null:Wn.rawQuerySelector.call(i,t)}function r(t){var o,r;const i=n(this),s=H();return s&&t&&!G(t)&&e===i?null!==(r=null===(o=En.get(s))||void 0===o?void 0:o.querySelectorAll(t))&&void 0!==r?r:[]:Wn.rawQuerySelectorAll.call(i,t)}t.prototype.createElement=function(e,t){return Ln(Wn.rawCreateElement.call(n(this),e,t))},t.prototype.createElementNS=function(e,t,o){return Ln(Wn.rawCreateElementNS.call(n(this),e,t,o))},t.prototype.createDocumentFragment=function(){return Ln(Wn.rawCreateDocumentFragment.call(n(this)))},t.prototype.createComment=function(e){return Ln(Wn.rawCreateComment.call(n(this),e))},t.prototype.querySelector=o,t.prototype.querySelectorAll=r,t.prototype.getElementById=function(e){const t=n(this);if(!H()||q(e))return Wn.rawGetElementById.call(t,e);try{return o.call(t,`#${e}`)}catch(n){return Wn.rawGetElementById.call(t,e)}},t.prototype.getElementsByClassName=function(e){const t=n(this);if(!H()||q(e))return Wn.rawGetElementsByClassName.call(t,e);try{return r.call(t,`.${e}`)}catch(n){return Wn.rawGetElementsByClassName.call(t,e)}},t.prototype.getElementsByTagName=function(e){var t;const o=n(this),i=H();if(!i||G(e)||q(e)||!(null===(t=En.get(i))||void 0===t?void 0:t.inline)&&/^script$/i.test(e))return Wn.rawGetElementsByTagName.call(o,e);try{return r.call(o,e)}catch(t){return Wn.rawGetElementsByTagName.call(o,e)}},t.prototype.getElementsByName=function(e){const t=n(this);if(!H()||q(e))return Wn.rawGetElementsByName.call(t,e);try{return r.call(t,`[name=${e}]`)}catch(n){return Wn.rawGetElementsByName.call(t,e)}}}();const e=Wn.rawRootElement,t=Wn.rawRootNode;function n(e){const t=H();if((e===document.body||e===document.head)&&t){const n=En.get(t);if(null==n?void 0:n.container){if(e===document.body)return n.querySelector("micro-app-body");if(e===document.head)return n.querySelector("micro-app-head")}}return null}e.prototype.appendChild=function(e){return In(this,e,null,Wn.rawAppendChild)},e.prototype.insertBefore=function(e,t){return In(this,e,t,Wn.rawInsertBefore)},e.prototype.replaceChild=function(e,t){return In(this,e,t,Wn.rawReplaceChild)},e.prototype.append=function(...e){let t=0;for(;t<e.length;){let n=e[t];n=v(n)?n:Wn.rawCreateTextNode.call(Wn.rawDocument,n),In(this,Ln(n),null,Wn.rawAppend),t++}},e.prototype.prepend=function(...e){let t=e.length;for(;t>0;){let n=e[t-1];n=v(n)?n:Wn.rawCreateTextNode.call(Wn.rawDocument,n),In(this,Ln(n),null,Wn.rawPrepend),t--}},e.prototype.removeChild=function(e){if(null==e?void 0:e.__MICRO_APP_NAME__){const t=En.get(e.__MICRO_APP_NAME__);if(null==t?void 0:t.container)return Nn(t,Wn.rawRemoveChild,this,Cn(e));try{return Wn.rawRemoveChild.call(this,e)}catch(t){return(null==e?void 0:e.parentNode)&&Wn.rawRemoveChild.call(e.parentNode,e)}}return Wn.rawRemoveChild.call(this,e)},e.prototype.insertAdjacentElement=function(e,t){var n;if((null==t?void 0:t.__MICRO_APP_NAME__)&&g(t)){const o=En.get(t.__MICRO_APP_NAME__);if(null==o?void 0:o.container){const r=Mn(t,o);if(!g(r))return t;const i=null!==(n=On(this,r,o))&&void 0!==n?n:this;return Wn.rawInsertAdjacentElement.call(i,e,r)}}return Wn.rawInsertAdjacentElement.call(this,e,t)},e.prototype.cloneNode=function(e){const t=Wn.rawCloneNode.call(this,e);return this.__MICRO_APP_NAME__&&(t.__MICRO_APP_NAME__=this.__MICRO_APP_NAME__),t},e.prototype.querySelector=function(e){var t;const o=null!==(t=n(this))&&void 0!==t?t:this;return Wn.rawElementQuerySelector.call(o,e)},e.prototype.querySelectorAll=function(e){var t;const o=null!==(t=n(this))&&void 0!==t?t:this;return Wn.rawElementQuerySelectorAll.call(o,e)},e.prototype.setAttribute=function(e,t){const n=this.__MICRO_APP_NAME__||H();if(n&&En.has(n)&&(("src"===e||"srcset"===e)&&/^(img|script|video|audio|source|embed)$/i.test(this.tagName)||"href"===e&&/^link$/i.test(this.tagName))){t=L(t,En.get(n).url)}Wn.rawSetAttribute.call(this,e,t)},s(e.prototype,"innerHTML",{configurable:!0,enumerable:!0,get(){return Wn.rawInnerHTMLDesc.get.call(this)},set(e){Wn.rawInnerHTMLDesc.set.call(this,e);const t=H();Array.from(this.children).forEach((e=>{g(e)&&t&&(e.__MICRO_APP_NAME__=t)}))}}),s(t.prototype,"parentNode",{configurable:!0,enumerable:!0,get(){var e,t,n;const o=H();if(o&&this===Wn.rawDocument.firstElementChild){const r=null===(n=null===(t=null===(e=En.get(o))||void 0===e?void 0:e.sandBox)||void 0===t?void 0:t.proxyWindow)||void 0===n?void 0:n.document;if(r)return r}return Wn.rawParentNodeDesc.get.call(this)}})}function Ln(e){const t=H();return t&&(e.__MICRO_APP_NAME__=t),e}function Tn(){$(),function(){const e=Wn.rawRootDocument;e.prototype.createElement=Wn.rawCreateElement,e.prototype.createElementNS=Wn.rawCreateElementNS,e.prototype.createDocumentFragment=Wn.rawCreateDocumentFragment,e.prototype.querySelector=Wn.rawQuerySelector,e.prototype.querySelectorAll=Wn.rawQuerySelectorAll,e.prototype.getElementById=Wn.rawGetElementById,e.prototype.getElementsByClassName=Wn.rawGetElementsByClassName,e.prototype.getElementsByTagName=Wn.rawGetElementsByTagName,e.prototype.getElementsByName=Wn.rawGetElementsByName}();const e=Wn.rawRootElement,t=Wn.rawRootNode;e.prototype.appendChild=Wn.rawAppendChild,e.prototype.insertBefore=Wn.rawInsertBefore,e.prototype.replaceChild=Wn.rawReplaceChild,e.prototype.removeChild=Wn.rawRemoveChild,e.prototype.append=Wn.rawAppend,e.prototype.prepend=Wn.rawPrepend,e.prototype.cloneNode=Wn.rawCloneNode,e.prototype.querySelector=Wn.rawElementQuerySelector,e.prototype.querySelectorAll=Wn.rawElementQuerySelectorAll,e.prototype.setAttribute=Wn.rawSetAttribute,s(e.prototype,"innerHTML",Wn.rawInnerHTMLDesc),s(t.prototype,"parentNode",Wn.rawParentNodeDesc)}let Un=!1;const Wn={activeSandbox:0};function Bn(){if(t){const e=window.rawWindow||Function("return window")(),t=window.rawDocument||Function("return document")(),n=e.Document||Function("return Document")(),o=e.Element,r=e.Node,s=e.EventTarget,a=o.prototype.setAttribute,c=o.prototype.appendChild,l=o.prototype.insertBefore,u=o.prototype.replaceChild,p=o.prototype.removeChild,d=o.prototype.append,h=o.prototype.prepend,m=o.prototype.cloneNode,f=o.prototype.querySelector,_=o.prototype.querySelectorAll,A=o.prototype.insertAdjacentElement,w=Object.getOwnPropertyDescriptor(o.prototype,"innerHTML"),y=Object.getOwnPropertyDescriptor(r.prototype,"parentNode"),g=n.prototype.createElement,v=n.prototype.createElementNS,b=n.prototype.createDocumentFragment,E=n.prototype.createTextNode,P=n.prototype.createComment,R=n.prototype.querySelector,S=n.prototype.querySelectorAll,C=n.prototype.getElementById,M=n.prototype.getElementsByClassName,N=n.prototype.getElementsByTagName,O=n.prototype.getElementsByName,D=new Proxy(Image,{construct(e,t){const n=new e(...t),o=H();return o&&(n.__MICRO_APP_NAME__=o),n}}),I=e.setInterval,x=e.setTimeout,L=e.clearInterval,T=e.clearTimeout,U=e.history.pushState,W=e.history.replaceState,B=s.prototype.addEventListener,k=s.prototype.removeEventListener,F=s.prototype.dispatchEvent;window.__MICRO_APP_BASE_APPLICATION__=!0,i(Wn,{supportModuleScript:"noModule"in document.createElement("script"),rawWindow:e,rawDocument:t,rawRootDocument:n,rawRootElement:o,rawRootNode:r,rawSetAttribute:a,rawAppendChild:c,rawInsertBefore:l,rawReplaceChild:u,rawRemoveChild:p,rawAppend:d,rawPrepend:h,rawCloneNode:m,rawElementQuerySelector:f,rawElementQuerySelectorAll:_,rawInsertAdjacentElement:A,rawInnerHTMLDesc:w,rawParentNodeDesc:y,rawCreateElement:g,rawCreateElementNS:v,rawCreateDocumentFragment:b,rawCreateTextNode:E,rawCreateComment:P,rawQuerySelector:R,rawQuerySelectorAll:S,rawGetElementById:C,rawGetElementsByClassName:M,rawGetElementsByTagName:N,rawGetElementsByName:O,ImageProxy:D,rawSetInterval:I,rawSetTimeout:x,rawClearInterval:L,rawClearTimeout:T,rawPushState:U,rawReplaceState:W,rawAddEventListener:B,rawRemoveEventListener:k,rawDispatchEvent:F}),function(){if(!Un){Un=!0;const e=j("style");Wn.rawSetAttribute.call(e,"type","text/css"),e.textContent=`\n${Xn.tagName}, micro-app-body { display: block; } \nmicro-app-head { display: none; }`,Wn.rawDocument.head.appendChild(e)}}()}}function kn(t){class n extends(function(){var e;return(null===(e=window.rawWindow)||void 0===e?void 0:e.HTMLElement)||window.HTMLElement}()){constructor(){super(...arguments),this.isWaiting=!1,this.cacheData=null,this.connectedCount=0,this.connectStateMap=new Map,this.appName="",this.appUrl="",this.ssrUrl="",this.version=e,this.handleAttributeUpdate=()=>{this.isWaiting=!1;const e=I(this.getAttribute("name")),t=D(this.getAttribute("url"),this.appName);if(this.legalAttribute("name",e)&&this.legalAttribute("url",t)){const n=En.get(e);if(e!==this.appName&&n&&!n.isUnmounted()&&!n.isHidden()&&!n.isPrefetch)return this.setAttribute("name",this.appName),S(`app name conflict, an app named ${e} is running`);e===this.appName&&t===this.appUrl||(e===this.appName?this.unmount(!0,(()=>{this.actionsForAttributeChange(e,t,n)})):this.getKeepAliveModeResult()?(this.handleHiddenKeepAliveApp(),this.actionsForAttributeChange(e,t,n)):this.unmount(!1,(()=>{this.actionsForAttributeChange(e,t,n)})))}else e!==this.appName&&this.setAttribute("name",this.appName)}}static get observedAttributes(){return["name","url"]}connectedCallback(){const e=++this.connectedCount;this.connectStateMap.set(e,!0);const t=this.appName&&this.appUrl;M((()=>{this.connectStateMap.get(e)&&(re(this,this.appName,ve.CREATED),t&&this.handleConnected())}))}disconnectedCallback(){this.connectStateMap.set(this.connectedCount,!1),this.handleDisconnected()}reload(e){return new Promise((t=>{const n=()=>{this.removeEventListener(ve.MOUNTED,n),this.removeEventListener(ve.AFTERSHOW,n),t(!0)};this.addEventListener(ve.MOUNTED,n),this.addEventListener(ve.AFTERSHOW,n),this.handleDisconnected(e,(()=>{this.handleConnected()}))}))}handleDisconnected(e=!1,t){const n=En.get(this.appName);!n||n.isUnmounted()||n.isHidden()||(this.getKeepAliveModeResult()&&!e?this.handleHiddenKeepAliveApp(t):this.unmount(e,t))}attributeChangedCallback(e,t,n){if(this.legalAttribute(e,n)&&this[e===ye.NAME?"appName":"appUrl"]!==n)if(e!==ye.URL||this.appUrl&&this.connectStateMap.get(this.connectedCount))if(e!==ye.NAME||this.appName&&this.connectStateMap.get(this.connectedCount))this.isWaiting||(this.isWaiting=!0,M(this.handleAttributeUpdate));else{const e=I(n);if(!e)return S(`Invalid attribute name ${n}`,this.appName);this.cacheData&&(Xn.setData(e,this.cacheData),this.cacheData=null),this.appName=e,e!==n&&this.setAttribute("name",this.appName),this.handleInitialNameAndUrl()}else{if(!(n=D(n,this.appName)))return S(`Invalid attribute url ${n}`,this.appName);this.appUrl=n,this.handleInitialNameAndUrl()}}handleInitialNameAndUrl(){this.connectStateMap.get(this.connectedCount)&&this.handleConnected()}handleConnected(){if(this.appName&&this.appUrl)if(this.getDisposeResult("shadowDOM")&&!this.shadowRoot&&m(this.attachShadow)&&this.attachShadow({mode:"open"}),this.updateSsrUrl(this.appUrl),En.has(this.appName)){const e=En.get(this.appName),t=e.ssrUrl||e.url,n=this.ssrUrl||this.appUrl;e.isHidden()&&e.url===this.appUrl?this.handleShowKeepAliveApp(e):t===n&&(e.isUnmounted()||e.isPrefetch&&this.sameCoreOptions(e))?this.handleMount(e):e.isPrefetch||e.isUnmounted()?this.handleCreateApp():S(`app name conflict, an app named: ${this.appName} with url: ${t} is running`)}else this.handleCreateApp()}actionsForAttributeChange(e,t,n){var o;this.updateSsrUrl(t),this.appName=e,this.appUrl=t,(null!==(o=this.shadowRoot)&&void 0!==o?o:this).innerHTML="",e!==this.getAttribute("name")&&this.setAttribute("name",this.appName),n?n.isHidden()?n.url===this.appUrl?this.handleShowKeepAliveApp(n):S(`app name conflict, an app named ${this.appName} is running`):n.url===this.appUrl&&n.ssrUrl===this.ssrUrl?this.handleMount(n):this.handleCreateApp():this.handleCreateApp()}legalAttribute(e,t){return!(!p(t)||!t)||(S(`unexpected attribute ${e}, please check again`,this.appName),!1)}handleCreateApp(){const e=()=>{var e;return new Pn({name:this.appName,url:this.appUrl,container:null!==(e=this.shadowRoot)&&void 0!==e?e:this,scopecss:this.useScopecss(),useSandbox:this.useSandbox(),inline:this.getDisposeResult("inline"),iframe:this.getDisposeResult("iframe"),ssrUrl:this.ssrUrl,routerMode:this.getMemoryRouterMode()})},t=En.get(this.appName);t?t.isPrerender?this.unmount(!0,e):(t.actionsForCompletelyDestroy(),e()):e()}handleMount(e){e.isPrefetch=!1,e.setAppState(ge.BEFORE_MOUNT),M((()=>this.mount(e)))}mount(e){var t;e.mount({container:null!==(t=this.shadowRoot)&&void 0!==t?t:this,inline:this.getDisposeResult("inline"),routerMode:this.getMemoryRouterMode(),baseroute:this.getBaseRouteCompatible(),defaultPage:this.getDefaultPage(),disablePatchRequest:this.getDisposeResult("disable-patch-request"),fiber:this.getDisposeResult("fiber")})}unmount(e,t){const n=En.get(this.appName);n&&!n.isUnmounted()&&n.unmount({destroy:e||this.getDestroyCompatibleResult(),clearData:this.getDisposeResult("clear-data"),keepRouteState:this.getDisposeResult("keep-router-state"),unmountcb:t})}handleHiddenKeepAliveApp(e){const t=En.get(this.appName);!t||t.isUnmounted()||t.isHidden()||t.hiddenKeepAliveApp(e)}handleShowKeepAliveApp(e){M((()=>{var t;return e.showKeepAliveApp(null!==(t=this.shadowRoot)&&void 0!==t?t:this)}))}getDisposeResult(e){return(this.compatibleProperties(e)||!!Xn.options[e])&&this.compatibleDisableProperties(e)}compatibleProperties(e){return"disable-scopecss"===e?this.hasAttribute("disable-scopecss")||this.hasAttribute("disableScopecss"):"disable-sandbox"===e?this.hasAttribute("disable-sandbox")||this.hasAttribute("disableSandbox"):this.hasAttribute(e)}compatibleDisableProperties(e){return"disable-scopecss"===e?"false"!==this.getAttribute("disable-scopecss")&&"false"!==this.getAttribute("disableScopecss"):"disable-sandbox"===e?"false"!==this.getAttribute("disable-sandbox")&&"false"!==this.getAttribute("disableSandbox"):"false"!==this.getAttribute(e)}useScopecss(){return!(this.getDisposeResult("disable-scopecss")||this.getDisposeResult("shadowDOM"))}useSandbox(){return!this.getDisposeResult("disable-sandbox")}sameCoreOptions(e){return e.scopecss===this.useScopecss()&&e.useSandbox===this.useSandbox()&&e.iframe===this.getDisposeResult("iframe")}getBaseRouteCompatible(){var e,t;return null!==(t=null!==(e=this.getAttribute("baseroute"))&&void 0!==e?e:this.getAttribute("baseurl"))&&void 0!==t?t:""}getDestroyCompatibleResult(){return this.getDisposeResult("destroy")||this.getDisposeResult("destory")}getKeepAliveModeResult(){return this.getDisposeResult("keep-alive")&&!this.getDestroyCompatibleResult()}updateSsrUrl(e){if(this.getDisposeResult("ssr"))if(this.getDisposeResult("disable-memory-router")||this.getDisposeResult("disableSandbox")){const t=Wn.rawWindow.location;this.ssrUrl=L(t.pathname+t.search,e)}else{let t=function(e,t){const n=Mt(e);if(!n)return"";const o=N(n,t);return o.origin+o.pathname+o.search}(this.appName,e);const n=this.getDefaultPage();if(!t&&n){const o=N(n,e);t=o.origin+o.pathname+o.search}this.ssrUrl=t}else this.ssrUrl&&(this.ssrUrl="")}getDefaultPage(){return Kt.getDefaultPage(this.appName)||this.getAttribute("default-page")||this.getAttribute("defaultPage")||""}getMemoryRouterMode(){return xt(this.getAttribute("router-mode"),this)}setAttribute(e,t){if("data"===e)if(f(t)){const e={};Object.getOwnPropertyNames(t).forEach((n=>{p(n)&&0===n.indexOf("__")||(e[n]=t[n])})),this.data=e}else"[object Object]"!==t&&C("property data must be an object",this.appName);else Wn.rawSetAttribute.call(this,e,t)}set data(e){this.appName?Xn.setData(this.appName,e):this.cacheData=e}get data(){return this.appName?Xn.getData(this.appName,!0):this.cacheData?this.cacheData:null}}Wn.rawWindow.customElements.define(t,n)}function Fn(e,n){if(!t)return S("preFetch is only supported in browser environment");U((()=>{const t=h(n)?n:Xn.options.prefetchDelay;setTimeout((()=>{!function(e){m(e)&&(e=e()),r(e)&&e.reduce(((e,t)=>e.then((()=>{return e=t,W((t=>{var n,o,r,i,s,a;if(f(e)&&navigator.onLine)if(e.name=I(e.name),e.url=D(e.url,e.name),e.name&&e.url&&!En.has(e.name)){const c=new Pn({name:e.name,url:e.url,isPrefetch:!0,scopecss:!(null!==(o=null!==(n=e["disable-scopecss"])&&void 0!==n?n:e.disableScopecss)&&void 0!==o?o:Xn.options["disable-scopecss"]),useSandbox:!(null!==(i=null!==(r=e["disable-sandbox"])&&void 0!==r?r:e.disableSandbox)&&void 0!==i?i:Xn.options["disable-sandbox"]),inline:null!==(s=e.inline)&&void 0!==s?s:Xn.options.inline,iframe:null!==(a=e.iframe)&&void 0!==a?a:Xn.options.iframe,prefetchLevel:e.level&&Ne.includes(e.level)?e.level:Xn.options.prefetchLevel&&Ne.includes(Xn.options.prefetchLevel)?Xn.options.prefetchLevel:2}),l=c.onLoad,u=c.onLoadError;c.onLoad=n=>{t(),l.call(c,n,e["default-page"],e["disable-patch-request"],xt(e["router-mode"]),e.baseroute)},c.onLoadError=(...e)=>{t(),u.call(c,...e)}}else t();else t()}));var e}))),Promise.resolve())}(e)}),h(t)?t:3e3)}))}function Hn(e,t,n){if(r(e)){const o=e.filter((e=>p(e)&&e.includes(`.${t}`)&&!n.hasInfo(e)));T(o.map((e=>se(e))),(e=>{const r=o[e.index];"js"===t?n.hasInfo(r)||n.setInfo(r,{code:e.data,isExternal:!1,appSpace:{}}):n.hasInfo(r)||n.setInfo(r,{code:e.data,appSpace:{}})}),(e=>{S(e)}))}}function $n({excludeHiddenApp:e=!1,excludePreRender:t=!1}={}){const n=[];return En.forEach(((o,r)=>{o.isUnmounted()||o.isPrefetch&&(!o.isPrerender||t)||e&&o.isHidden()||n.push(r)})),n}function jn(){return Array.from(En.keys())}function Kn(e,t){const n=En.get(I(e));return new Promise((o=>{if(n)if(n.isUnmounted()||n.isPrefetch)n.isPrerender?n.unmount({destroy:!!(null==t?void 0:t.destroy),clearData:!!(null==t?void 0:t.clearData),keepRouteState:!1,unmountcb:o.bind(null,!0)}):((null==t?void 0:t.destroy)&&n.actionsForCompletelyDestroy(),o(!0));else if(n.isHidden())(null==t?void 0:t.destroy)?n.unmount({destroy:!0,clearData:!0,keepRouteState:!0,unmountcb:o.bind(null,!0)}):(null==t?void 0:t.clearAliveState)?n.unmount({destroy:!1,clearData:!!t.clearData,keepRouteState:!0,unmountcb:o.bind(null,!0)}):o(!0);else{const e=Q(n.container),r=()=>{e.removeEventListener(ve.UNMOUNT,r),e.removeEventListener(ve.AFTERHIDDEN,i),o(!0)},i=()=>{e.removeEventListener(ve.UNMOUNT,r),e.removeEventListener(ve.AFTERHIDDEN,i),o(!0)};if(e.addEventListener(ve.UNMOUNT,r),e.addEventListener(ve.AFTERHIDDEN,i),null==t?void 0:t.destroy){let t,n;e.hasAttribute("destroy")&&(t=e.getAttribute("destroy")),e.hasAttribute("destory")&&(n=e.getAttribute("destory")),e.setAttribute("destroy","true"),e.parentNode.removeChild(e),e.removeAttribute("destroy"),p(t)&&e.setAttribute("destroy",t),p(n)&&e.setAttribute("destory",n)}else if((null==t?void 0:t.clearAliveState)&&e.hasAttribute("keep-alive")){const n=e.getAttribute("keep-alive");e.removeAttribute("keep-alive");let o=null;t.clearData&&(o=e.getAttribute("clear-data"),e.setAttribute("clear-data","true")),e.parentNode.removeChild(e),e.setAttribute("keep-alive",n),p(o)&&e.setAttribute("clear-data",o)}else{let n=null;(null==t?void 0:t.clearData)&&(n=e.getAttribute("clear-data"),e.setAttribute("clear-data","true")),e.parentNode.removeChild(e),p(n)&&e.setAttribute("clear-data",n)}}else C(`app ${e} does not exist`),o(!1)}))}function qn(e){return Array.from(En.keys()).reduce(((t,n)=>t.then((()=>Kn(n,e)))),Promise.resolve(!0))}function Gn(e,t){return new Promise((n=>{const o=En.get(I(e));if(o){const r=o.container&&Q(o.container);r?n(r.reload(t)):(C(`app ${e} is not rendered, cannot use reload`),n(!1))}else C(`app ${e} does not exist`),n(!1)}))}function Qn(e){return new Promise((t=>{if(!f(e))return S("renderApp options must be an object");const n=g(e.container)?e.container:p(e.container)?document.querySelector(e.container):null;if(!g(n))return S("Target container is not a DOM element.");const o=j(Xn.tagName);for(const t in e)if("onDataChange"===t)m(e[t])&&o.addEventListener("datachange",e[t]);else if("lifeCycles"===t){const n=e[t];if(f(n))for(const e in n)e.toUpperCase()in ve&&m(n[e])&&o.addEventListener(e.toLowerCase(),n[e])}else"container"!==t&&o.setAttribute(t,e[t]);const r=()=>{s(),t(!0)},i=()=>{s(),t(!1)},s=()=>{o.removeEventListener(ve.MOUNTED,r),o.removeEventListener(ve.ERROR,i)};o.addEventListener(ve.MOUNTED,r),o.addEventListener(ve.ERROR,i),n.appendChild(o)}))}class zn extends at{constructor(){super(...arguments),this.tagName="micro-app",this.hasInit=!1,this.options={},this.router=Kt,this.preFetch=Fn,this.unmountApp=Kn,this.unmountAllApps=qn,this.getActiveApps=$n,this.getAllApps=jn,this.reload=Gn,this.renderApp=Qn}start(e){var n,o,r;if(!t||!window.customElements)return S("micro-app is not supported in this environment");if(this.hasInit)return S("microApp.start executed repeatedly");if(this.hasInit=!0,null==e?void 0:e.tagName){if(!/^micro-app(-\S+)?/.test(e.tagName))return S(`${e.tagName} is invalid tagName`);this.tagName=e.tagName}if(Bn(),Wn.rawWindow.customElements.get(this.tagName))return C(`element ${this.tagName} is already defined`);if(f(e)&&(this.options=e,e["disable-scopecss"]=null!==(n=e["disable-scopecss"])&&void 0!==n?n:e.disableScopecss,e["disable-sandbox"]=null!==(o=e["disable-sandbox"])&&void 0!==o?o:e.disableSandbox,e.preFetchApps&&Fn(e.preFetchApps),e.globalAssets&&(f(r=e.globalAssets)&&U((()=>{Hn(r.js,"js",Re.script),Hn(r.css,"css",Re.link)}))),f(e.plugins))){const t=e.plugins.modules;if(f(t))for(const e in t){const n=I(e);n&&e!==n&&(t[n]=t[e],delete t[e])}}kn(this.tagName)}}const Xn=new zn;exports.EventCenterForMicroApp=ct,exports.MicroApp=zn,exports.default=Xn,exports.getActiveApps=$n,exports.getAllApps=jn,exports.preFetch=Fn,exports.pureCreateElement=j,exports.reload=Gn,exports.removeDomScope=$,exports.renderApp=Qn,exports.unmountAllApps=qn,exports.unmountApp=Kn,exports.version=e;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e="1.0.0-rc.3",t="undefined"!=typeof window,n="undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:Function("return this")(),o=()=>!1,r=Array.isArray,i=Object.assign,s=Object.defineProperty,a=Object.defineProperties,c=Object.prototype.toString,l=Object.prototype.hasOwnProperty,u=e=>c.call(e);function p(e){return void 0===e}function h(e){return null===e}function d(e){return"string"==typeof e}function m(e){return"boolean"==typeof e}function f(e){return"number"==typeof e}function _(e){return"function"==typeof e}function A(e){return"[object Object]"===u(e)}function w(e){return!h(e)&&"object"==typeof e}function y(e){return"[object Promise]"===u(e)}function g(e){var t;if(_(e)){const n=e.toString();return(null===(t=e.prototype)||void 0===t?void 0:t.constructor)===e&&Object.getOwnPropertyNames(e.prototype).length>1||/^function\s+[A-Z]/.test(n)||/^class\s+/.test(n)}return!1}function b(e){var t;return e instanceof URL||!!(null===(t=e)||void 0===t?void 0:t.href)}function v(e){var t;return e instanceof Element||d(null===(t=e)||void 0===t?void 0:t.tagName)}function E(e){var t;return e instanceof Node||f(null===(t=e)||void 0===t?void 0:t.nodeType)}function P(e){return"[object HTMLLinkElement]"===u(e)}function R(e){return"[object HTMLStyleElement]"===u(e)}function S(e){return"[object HTMLScriptElement]"===u(e)}function M(e){return v(e)&&"MICRO-APP-BODY"===e.tagName.toUpperCase()}function C(e,t=null,...n){const o=t&&d(t)?` app ${t}:`:"";d(e)?console.error(`[micro-app]${o} ${e}`,...n):console.error(`[micro-app]${o}`,e,...n)}function N(e,t=null,...n){const o=t&&d(t)?` app ${t}:`:"";d(e)?console.warn(`[micro-app]${o} ${e}`,...n):console.warn(`[micro-app]${o}`,e,...n)}function O(e,...t){Promise.resolve().then(e.bind(null,...t))}const D=function(){class e extends URL{}return(t,n)=>n?new e(""+t,n):new e(""+t)}();function I(e){return e.startsWith("//")?`${n.location.protocol}${e}`:e}function x(e,t=null){if(!d(e)||!e)return"";try{const{origin:t,pathname:n,search:o}=D(I(e));if(/\.(\w+)$/.test(n))return`${t}${n}${o}`;const r=`${t}${n}/`.replace(/\/\/$/,"/");return/^https?:\/\//.test(r)?`${r}${o}`:""}catch(e){return C(e,t),""}}function L(e){return d(e)&&e?e.replace(/(^\d+)|([^\w\d-_])/gi,""):""}function T(e){const{origin:t,pathname:n}=D(e);if(/\.(\w+)$/.test(n)){const e=`${t}${n}`.split("/");return e.pop(),e.join("/")+"/"}return`${t}${n}/`.replace(/\/\/$/,"/")}function U(e,t){return!e||/^((((ht|f)tps?)|file):)?\/\//.test(e)||/^(data|blob):/.test(e)?e:D(e,T(I(t))).toString()}function W(e,t,n,o){let r=0;function i(){++r===e.length&&o&&o()}e.forEach(((e,o)=>{y(e)?e.then((e=>{t({data:e,index:o}),i()})).catch((e=>{n({error:e,index:o}),i()})):(t({data:e,index:o}),i())}))}const B=n.requestIdleCallback||function(e){const t=Date.now();return setTimeout((function(){e({didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-t))})}),1)};function k(e){return new Promise((t=>{B((()=>{e(t)}))}))}let H=null;function F(e){H=e}function $(e){H!==e&&(F(e),O((()=>{F(null)})))}function j(){return H}function K(){F(null)}function q(e,t){const n=(window.rawDocument||document).createElement(e,t);return n.__MICRO_APP_NAME__&&delete n.__MICRO_APP_NAME__,n.__PURE_ELEMENT__=!0,n}function G(e,t,n){if(t)if(e.innerHTML="",n){const n=t.cloneNode(!0),o=document.createDocumentFragment();Array.from(n.childNodes).forEach((e=>{o.appendChild(e)})),e.appendChild(o)}else Array.from(t.childNodes).forEach((t=>{e.appendChild(t)}));return e}function Q(e){return!e||/(^\d)|([^\w\d-_\u4e00-\u9fa5])/gi.test(e)}function z(e){return/^body$/i.test(e)||/^head$/i.test(e)||/^html$/i.test(e)||/^title$/i.test(e)||/^:root$/i.test(e)}function X(e){return function(e){return"undefined"!=typeof ShadowRoot&&e instanceof ShadowRoot}(e)?e.host:e}function V(e){return e?e.replace(/^\s+|\s+$/g,""):""}function Y(){return navigator.userAgent.indexOf("Firefox")>-1}function J(e){const t={},n=e.split("&");for(const e of n){const n=e.indexOf("="),o=n<0?e:e.slice(0,n),i=n<0?null:e.slice(n+1);if(o in t){let e=t[o];r(e)||(e=t[o]=[e]),e.push(i)}else t[o]=i}return t}function Z(e){let t="";for(const n in e){const o=e[n];if(h(o))t+=(t.length?"&":"")+n;else{(r(o)?o:[o]).forEach((e=>{p(e)||(t+=(t.length?"&":"")+n,h(e)||(t+="="+e))}))}}return t}function ee(){const e=new Set;return{add:function(t){return e.add(t),()=>!!e.has(t)&&e.delete(t)},list:()=>e}}function te(e){const t=e.attributes,n=new Map;for(let e=0;e<t.length;e++)n.set(t[e].name,t[e].value);return n}function ne(e,t){e?e.push((()=>k((e=>{t(),e()})))):t()}function oe(e){return(null==e?void 0:e.reduce(((e,t)=>e.then(t)),Promise.resolve()))||null}function re(e){return e.startsWith("inline-")}function ie(e,t,n,...o){try{_(e)&&e(...o)}catch(e){C(`An error occurred in app ${t} window.${n} \n`,null,e)}}function se(e,t,n,o){var r;if(!e)return C(`element does not exist in lifecycle ${n}`,t);e=X(e),K();const s=i({name:t,container:e},o&&{error:o}),a=new CustomEvent(n,{detail:s});!function(e,t){Object.defineProperties(e,{currentTarget:{get:()=>t},target:{get:()=>t}})}(a,e),_(null===(r=Zn.options.lifeCycles)||void 0===r?void 0:r[n])&&Zn.options.lifeCycles[n](a),e.dispatchEvent(a)}function ae(e,t,n={}){var o;const r=new CustomEvent(t,{detail:n});null===(o=e.sandBox)||void 0===o||o.microAppWindow.dispatchEvent(r)}function ce(e,t=null,n={}){return K(),_(Zn.options.fetch)?Zn.options.fetch(e,n,t):window.fetch(e,n).then((e=>e.text()))}class le{static getInstance(){return this.instance||(this.instance=new le),this.instance}run(e,t){const n=e.name,o=e.ssrUrl||e.url;(o.includes(".js")?Promise.resolve(`<micro-app-head><script src='${o}'><\/script></micro-app-head><micro-app-body></micro-app-body>`):ce(o,n,{cache:"no-cache"})).then((r=>{if(!r){const t="html is empty, please check in detail";return e.onerror(new Error(t)),C(t,n)}r=this.formatHTML(o,r,n),t(r,e)})).catch((t=>{C(`Failed to fetch data from ${e.url}, micro-app stop rendering`,n,t),e.onLoadError(t)}))}formatHTML(e,t,n){return this.processHtml(e,t,n,Zn.options.plugins).replace(/<head[^>]*>[\s\S]*?<\/head>/i,(e=>e.replace(/<head/i,"<micro-app-head").replace(/<\/head>/i,"</micro-app-head>"))).replace(/<body[^>]*>[\s\S]*?<\/body>/i,(e=>e.replace(/<body/i,"<micro-app-body").replace(/<\/body>/i,"</micro-app-body>")))}processHtml(e,t,n,o){var r;if(!o)return t;const i=[];return o.global&&i.push(...o.global),(null===(r=o.modules)||void 0===r?void 0:r[n])&&i.push(...o.modules[n]),i.length>0?i.reduce(((t,n)=>A(n)&&_(n.processHtml)?n.processHtml(t,e):t),t):t}}const ue=/(^|\s+)(html|:root)(?=[\s>~[.#:]+|$)/,pe=/(^|\s+)((html[\s>~]+body)|body)(?=[\s>~[.#:]+|$)/;function he(e,t){e=t?`${t} ${e}`:e;const n=new Error(e);throw n.reason=e,t&&(n.filename=t),n}class de{constructor(){this.cssText="",this.prefix="",this.baseURI="",this.linkPath="",this.result="",this.scopecssDisable=!1,this.scopecssDisableSelectors=[],this.scopecssDisableNextLine=!1,this.mediaRule=this.createMatcherForRuleWithChildRule(/^@media *([^{]+)/,"@media"),this.supportsRule=this.createMatcherForRuleWithChildRule(/^@supports *([^{]+)/,"@supports"),this.documentRule=this.createMatcherForRuleWithChildRule(/^@([-\w]+)?document *([^{]+)/,"@document"),this.hostRule=this.createMatcherForRuleWithChildRule(/^@host\s*/,"@host"),this.importRule=this.createMatcherForNoneBraceAtRule("import"),this.charsetRule=this.createMatcherForNoneBraceAtRule("charset"),this.namespaceRule=this.createMatcherForNoneBraceAtRule("namespace"),this.containerRule=this.createMatcherForRuleWithChildRule(/^@container *([^{]+)/,"@container")}exec(e,t,n,o){return this.cssText=e,this.prefix=t,this.baseURI=n,this.linkPath=o||"",this.matchRules(),Y()?decodeURIComponent(this.result):this.result}reset(){this.cssText=this.prefix=this.baseURI=this.linkPath=this.result="",this.scopecssDisable=this.scopecssDisableNextLine=!1,this.scopecssDisableSelectors=[]}matchRules(){for(this.matchLeadingSpaces(),this.matchComments();this.cssText.length&&"}"!==this.cssText.charAt(0)&&(this.matchAtRule()||this.matchStyleRule());)this.matchComments()}matchStyleRule(){const e=this.formatSelector(!0);return this.scopecssDisableNextLine=!1,e?(this.recordResult(e),this.matchComments(),this.styleDeclarations(),this.matchLeadingSpaces(),!0):he("selector missing",this.linkPath)}formatSelector(e){const t=this.commonMatch(/^[^{]+/,e);return!!t&&t[0].replace(/(^|,[\n\s]*)([^,]+)/g,((e,t,n)=>(n=V(n),this.scopecssDisableNextLine||this.scopecssDisable&&(!this.scopecssDisableSelectors.length||this.scopecssDisableSelectors.includes(n))||ue.test(n)||(n=pe.test(n)?n.replace(pe,this.prefix+" micro-app-body"):this.prefix+" "+n),t+n)))}styleDeclarations(){return this.matchOpenBrace()?(this.matchAllDeclarations(),!!this.matchCloseBrace()||he("Declaration missing '}'",this.linkPath)):he("Declaration missing '{'",this.linkPath)}matchAllDeclarations(e=1){let t=this.commonMatch(/^(?:url\(["']?(?:[^)"'}]+)["']?\)|[^{}/])*/,!0)[0];if(t&&(this.scopecssDisableNextLine||this.scopecssDisable&&!this.scopecssDisableSelectors.length||(t=t.replace(/url\(["']?([^)"']+)["']?\)/gm,((e,t)=>/^((data|blob):|#)/.test(t)||/^(https?:)?\/\//.test(t)?e:(/^((\.\.?\/)|[^/])/.test(t)&&this.linkPath&&(this.baseURI=function(e){const t=e.split("/");return t.pop(),I(t.join("/")+"/")}(this.linkPath)),`url("${U(t,this.baseURI)}")`)))),this.recordResult(t)),this.scopecssDisableNextLine=!1,this.cssText){if("}"===this.cssText.charAt(0)){if(!e)return;return e>1&&this.commonMatch(/}+/),this.matchAllDeclarations(e-1)}return"/"===this.cssText.charAt(0)&&("*"===this.cssText.charAt(1)?this.matchComments():this.commonMatch(/\/+/)),"{"===this.cssText.charAt(0)&&(this.commonMatch(/{+\s*/),e++),this.matchAllDeclarations(e)}}matchAtRule(){return"@"===this.cssText[0]&&(this.scopecssDisableNextLine=!1,this.keyframesRule()||this.mediaRule()||this.customMediaRule()||this.supportsRule()||this.importRule()||this.charsetRule()||this.namespaceRule()||this.containerRule()||this.documentRule()||this.pageRule()||this.hostRule()||this.fontFaceRule())}keyframesRule(){if(!this.commonMatch(/^@([-\w]+)?keyframes\s*/))return!1;if(!this.commonMatch(/^[^{]+/))return he("@keyframes missing name",this.linkPath);if(this.matchComments(),!this.matchOpenBrace())return he("@keyframes missing '{'",this.linkPath);for(this.matchComments();this.keyframeRule();)this.matchComments();return this.matchCloseBrace()?(this.matchLeadingSpaces(),!0):he("@keyframes missing '}'",this.linkPath)}keyframeRule(){let e;const t=[];for(;e=this.commonMatch(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),this.commonMatch(/^,\s*/);return!!t.length&&(this.styleDeclarations(),this.matchLeadingSpaces(),!0)}customMediaRule(){return!!this.commonMatch(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/)&&(this.matchLeadingSpaces(),!0)}pageRule(){return!!this.commonMatch(/^@page */)&&(this.formatSelector(!1),this.scopecssDisableNextLine=!1,this.commonHandlerForAtRuleWithSelfRule("page"))}fontFaceRule(){return!!this.commonMatch(/^@font-face\s*/)&&this.commonHandlerForAtRuleWithSelfRule("font-face")}createMatcherForRuleWithChildRule(e,t){return()=>!!this.commonMatch(e)&&(this.matchOpenBrace()?(this.matchComments(),this.matchRules(),this.matchCloseBrace()?(this.matchLeadingSpaces(),!0):he(`${t} missing '}'`,this.linkPath)):he(`${t} missing '{'`,this.linkPath))}createMatcherForNoneBraceAtRule(e){const t=new RegExp("^@"+e+"\\s*([^;]+);");return()=>!!this.commonMatch(t)&&(this.matchLeadingSpaces(),!0)}commonHandlerForAtRuleWithSelfRule(e){return this.matchOpenBrace()?(this.matchAllDeclarations(),this.matchCloseBrace()?(this.matchLeadingSpaces(),!0):he(`@${e} missing '}'`,this.linkPath)):he(`@${e} missing '{'`,this.linkPath)}matchComments(){for(;this.matchComment(););}matchComment(){if("/"!==this.cssText.charAt(0)||"*"!==this.cssText.charAt(1))return!1;this.scopecssDisableNextLine=!1;let e=2;for(;""!==this.cssText.charAt(e)&&("*"!==this.cssText.charAt(e)||"/"!==this.cssText.charAt(e+1));)++e;if(e+=2,""===this.cssText.charAt(e-1))return he("End of comment missing",this.linkPath);let t=this.cssText.slice(2,e-2);if(this.recordResult(`/*${t}*/`),t=V(t.replace(/^\s*!/,"")),"scopecss-disable-next-line"===t)this.scopecssDisableNextLine=!0;else if(/^scopecss-disable/.test(t))if("scopecss-disable"===t)this.scopecssDisable=!0;else{this.scopecssDisable=!0;t.replace("scopecss-disable","").split(",").forEach((e=>{this.scopecssDisableSelectors.push(V(e))}))}else"scopecss-enable"===t&&(this.scopecssDisable=!1,this.scopecssDisableSelectors=[]);return this.cssText=this.cssText.slice(e),this.matchLeadingSpaces(),!0}commonMatch(e,t=!1){const n=e.exec(this.cssText);if(!n)return;const o=n[0];return this.cssText=this.cssText.slice(o.length),t||this.recordResult(o),n}matchOpenBrace(){return this.commonMatch(/^{\s*/)}matchCloseBrace(){return this.commonMatch(/^}/)}matchLeadingSpaces(){this.commonMatch(/^\s*/)}recordResult(e){Y()?this.result+=encodeURIComponent(e):this.result+=e}}function me(e,t,n,o,r){if(!e.__MICRO_APP_HAS_SCOPED__){e.__MICRO_APP_HAS_SCOPED__=!0;let i=null;try{i=fe.exec(e.textContent,n,o,r),fe.reset()}catch(e){fe.reset(),C("An error occurred while parsing CSS:\n",t,e)}i&&(e.textContent=i)}}let fe;function _e(e,t,n){if(t.scopecss){const o=Ae(t.name);if(fe||(fe=new de),e.textContent)me(e,t.name,o,t.url,n);else{const r=new MutationObserver((function(){r.disconnect(),e.textContent&&!e.hasAttribute("data-styled")&&me(e,t.name,o,t.url,n)}));r.observe(e,{childList:!0})}}return e}function Ae(e,t=!1){const n=t?"\\":"";return`${Zn.tagName}${n}[name=${e}${n}]`}function we(e,t){Object.defineProperties(e,{currentTarget:{get:()=>t},srcElement:{get:()=>t},target:{get:()=>t}})}function ye(e){const t=new CustomEvent("load");we(t,e),_(e.onload)?e.onload(t):e.dispatchEvent(t)}function ge(e){const t=new CustomEvent("error");we(t,e),_(e.onerror)?e.onerror(t):e.dispatchEvent(t)}var be,ve,Ee,Pe,Re,Se,Me=function(){const e=new Map,t=new Map;function n(e){return{setInfo(t,n){e.set(t,n)},getInfo(t){var n;return null!==(n=e.get(t))&&void 0!==n?n:null},hasInfo:t=>e.has(t),deleteInfo:t=>e.delete(t)}}return{link:n(e),script:Object.assign(Object.assign({},n(t)),{deleteInlineInfo(e){e.forEach((e=>{re(e)&&t.delete(e)}))}})}}();function Ce(e,t,n,o=!1){const r=e.getAttribute("rel");let i=e.getAttribute("href"),s=null;if("stylesheet"===r&&i){i=U(i,n.url);let t=Me.link.getInfo(i);const r={attrs:te(e)};if(t?t.appSpace[n.name]=t.appSpace[n.name]||r:t={code:"",appSpace:{[n.name]:r}},Me.link.setInfo(i,t),o)return{address:i,linkInfo:t};n.source.links.add(i),s=document.createComment(`link element with href=${i} move to micro-app-head as style element`),t.appSpace[n.name].placeholder=s}else r&&["prefetch","preload","prerender"].includes(r)?o?s=document.createComment(`link element with rel=${r}${i?" & href="+i:""} removed by micro-app`):null==t||t.removeChild(e):i&&Hn.rawSetAttribute.call(e,"href",U(i,n.url));return o?{replaceComment:s}:s?null==t?void 0:t.replaceChild(s,e):void 0}function Ne(e,t,n,o){const r=Array.from(t.source.links),i=r.map((e=>{const n=Me.link.getInfo(e);return n.code?n.code:ce(e,t.name)})),s=o?[]:null;W(i,(e=>{ne(s,(()=>function(e,t,n,o){const r=Me.link.getInfo(e);r.code=t;const i=r.appSpace[o.name],s=i.placeholder;if(s){const t=q("style");Oe(o,e,t,r,i.attrs),s.parentNode?s.parentNode.replaceChild(t,s):n.appendChild(t),i.placeholder=null}}(r[e.index],e.data,n,t)))}),(e=>{C(e,t.name)}),(()=>{o?o.then((()=>{s.push((()=>Promise.resolve(t.onLoad(e)))),oe(s)})):t.onLoad(e)}))}function Oe(e,t,n,o,r){if(e.scopecss){const r=o.appSpace[e.name];if(r.prefix=r.prefix||Ae(e.name),r.parsedCode)n.textContent=r.parsedCode;else{const i=function(e,t,n){const o=n.appSpace;for(const n in o)if(n!==e){const e=o[n];if(e.parsedCode)return e.parsedCode.replace(new RegExp(Ae(n,!0),"g"),t)}}(e.name,r.prefix,o);i?n.textContent=i:(n.textContent=o.code,_e(n,e,t)),r.parsedCode=n.textContent}}else n.textContent=o.code;!function(e,t){t.forEach(((t,n)=>{"rel"!==n&&("href"===n&&(n="data-origin-href"),Hn.rawSetAttribute.call(e,n,t))}))}(n,r)}!function(e){e.NAME="name",e.URL="url"}(be||(be={})),function(e){e.CREATED="created",e.LOADING="loading",e.LOAD_FAILED="load_failed",e.BEFORE_MOUNT="before_mount",e.MOUNTING="mounting",e.MOUNTED="mounted",e.UNMOUNT="unmount"}(ve||(ve={})),function(e){e.CREATED="created",e.BEFOREMOUNT="beforemount",e.MOUNTED="mounted",e.UNMOUNT="unmount",e.ERROR="error",e.BEFORESHOW="beforeshow",e.AFTERSHOW="aftershow",e.AFTERHIDDEN="afterhidden"}(Ee||(Ee={})),function(e){e.ONMOUNT="onmount",e.ONUNMOUNT="onunmount"}(Pe||(Pe={})),function(e){e.KEEP_ALIVE_SHOW="keep_alive_show",e.KEEP_ALIVE_HIDDEN="keep_alive_hidden"}(Re||(Re={})),function(e){e.DESTROY="destroy",e.DESTORY="destory",e.INLINE="inline",e.DISABLESCOPECSS="disableScopecss",e.DISABLESANDBOX="disableSandbox",e.DISABLE_SCOPECSS="disable-scopecss",e.DISABLE_SANDBOX="disable-sandbox",e.DISABLE_MEMORY_ROUTER="disable-memory-router",e.DISABLE_PATCH_REQUEST="disable-patch-request",e.KEEP_ROUTER_STATE="keep-router-state",e.HIDDEN_ROUTER="hidden-router",e.KEEP_ALIVE="keep-alive",e.CLEAR_DATA="clear-data",e.SSR="ssr",e.FIBER="fiber"}(Se||(Se={}));const De=[1,2,3],Ie="search",xe="custom",Le=[Ie,"history",xe],Te=["popstate","hashchange","load","beforeunload","unload","unmount","appstate-change","statechange","mounted"],Ue=["onpopstate","onhashchange","onload","onbeforeunload","onunload","onerror"],We=["DOMContentLoaded","readystatechange"],Be=["onreadystatechange"],ke=["window","self","globalThis"],He=["rawWindow","rawDocument"],Fe="window,self,globalThis,document,Document,Array,Object,String,Boolean,Math,Number,Symbol,Date,Function,Proxy,WeakMap,WeakSet,Set,Map,Reflect,Element,Node,RegExp,Error,TypeError,JSON,isNaN,parseFloat,parseInt,performance,console,decodeURI,encodeURI,decodeURIComponent,encodeURIComponent,navigator,undefined,location,history",$e=["text/javascript","text/ecmascript","application/javascript","application/ecmascript","module","systemjs-module","systemjs-importmap"];function je(e,t){return t.appSpace[e.name].module&&(!e.useSandbox||e.iframe)}function Ke(e,t){return e.inline||t.appSpace[e.name].inline||je(e,t)||function(e,t){return t.appSpace[e.name].attrs.has("id")}(e,t)}function qe(e){return e.iframe?e.sandBox.microAppWindow:Hn.rawWindow}function Ge(e,t,n){return function(e,t,n){const o=t.appSpace;for(const t in o)if(t!==e.name){const e=o[t];if(e.parsedCode===n&&e.parsedFunction)return e.parsedFunction}}(e,t,n)||function(e,t){return new(qe(e).Function)(t)}(e,n)}function Qe(){const e="inline-"+Math.random().toString(36).substr(2,15);return Me.script.hasInfo(e)?Qe():e}function ze(e,t){return e.useSandbox&&!je(e,t)}function Xe(e,t){return ze(e,t)?e.iframe?"iframe":"with":"disable"}function Ve(e,t,n,o=!1){var r;let i=null,s=e.getAttribute("src");if(s&&(s=U(s,n.url)),e.hasAttribute("exclude")||Je(s,n.name))i=document.createComment("script element with exclude attribute removed by micro-app");else{if(e.type&&!$e.includes(e.type)||e.hasAttribute("ignore")||Ze(s,n.name))return(null===(r=Hn.rawDocument)||void 0===r?void 0:r.currentScript)&&delete Hn.rawDocument.currentScript,null;if(Hn.supportModuleScript&&e.noModule||!Hn.supportModuleScript&&"module"===e.type)i=document.createComment((e.noModule?"noModule":"module")+" script ignored by micro-app");else if(s){let t=Me.script.getInfo(s);const r={async:e.hasAttribute("async"),defer:e.defer||"module"===e.type,module:"module"===e.type,inline:e.hasAttribute("inline"),pure:e.hasAttribute("pure"),attrs:te(e)};if(t?t.appSpace[n.name]=t.appSpace[n.name]||r:t={code:"",isExternal:!0,appSpace:{[n.name]:r}},Me.script.setInfo(s,t),o)return{address:s,scriptInfo:t};n.source.scripts.add(s),i=document.createComment(`script with src='${s}' extract by micro-app`)}else if(e.textContent){const t=Qe(),r={code:e.textContent,isExternal:!1,appSpace:{[n.name]:{async:!1,defer:"module"===e.type,module:"module"===e.type,inline:e.hasAttribute("inline"),pure:e.hasAttribute("pure"),attrs:te(e)}}};if(o)return{address:t,scriptInfo:r};n.source.scripts.add(t),Me.script.setInfo(t,r),i=document.createComment("inline script extract by micro-app")}else o||(i=document.createComment("script element removed by micro-app"))}return o?{replaceComment:i}:null==t?void 0:t.replaceChild(i,e)}function Ye(e){var t,n,o;return[...(null===(t=Zn.options.plugins)||void 0===t?void 0:t.global)||[],...(null===(o=null===(n=Zn.options.plugins)||void 0===n?void 0:n.modules)||void 0===o?void 0:o[e])||[]]}function Je(e,t){if(!e)return!1;return(Ye(t)||[]).some((t=>!!t.excludeChecker&&t.excludeChecker(e)))}function Ze(e,t){if(!e)return!1;return(Ye(t)||[]).some((t=>!!t.ignoreChecker&&t.ignoreChecker(e)))}function et(e,t){const n=Array.from(t.source.scripts),o=[],r=[];for(const e of n){const n=Me.script.getInfo(e),i=n.appSpace[t.name];(!i.defer&&!i.async||t.isPrefetch&&!t.isPrerender)&&(o.push(n.code?n.code:ce(e,t.name)),r.push([e,n]))}const i=t.isPrefetch||t.fiber?[]:null;o.length?W(o,(e=>{ne(i,(()=>function(e,t,n,o){if(t.code=n,o.isPrefetch&&2===o.prefetchLevel){const r=t.appSpace[o.name];if(!r.parsedCode&&(r.parsedCode=nt(e,o,n,t),r.sandboxType=Xe(o,t),!Ke(o,t)))try{r.parsedFunction=Ge(o,t,r.parsedCode)}catch(e){C("Something went wrong while handling preloaded resources",o.name,"\n",e)}}}(r[e.index][0],r[e.index][1],e.data,t)))}),(e=>{C(e,t.name)}),(()=>{i?(i.push((()=>Promise.resolve(t.onLoad(e)))),oe(i)):t.onLoad(e)})):t.onLoad(e)}function tt(e,t,n,o,r){try{!function(e){!function(e){e.sandBox&&(Hn.rawWindow.__MICRO_APP_PROXY_WINDOW__=e.sandBox.proxyWindow)}(e)}(t);const i=n.appSpace[t.name],s=Xe(t,n);if(i.parsedCode&&i.sandboxType===s||(i.parsedCode=nt(e,t,n.code,n),i.sandboxType=s,i.parsedFunction=null),Ke(t,n)){const s=r||q("script");if(function(e,t,n,o,r,i){if(n){if(Hn.rawSetAttribute.call(o,"type","module"),re(e)?o.textContent=t:o.src=e,i){const t=()=>{i.moduleCount&&i.moduleCount--,i(0===i.moduleCount)};re(e)?O(t):o.onload=t}}else o.textContent=t;!function(e,t){t.forEach(((t,n)=>{"type"===n&&"module"===t||"defer"===n||"async"===n||("src"===n&&(n="data-origin-src"),Hn.rawSetAttribute.call(e,n,t))}))}(o,r)}(e,i.parsedCode,je(t,n),s,i.attrs,o),!r){const e=t.iframe?t.sandBox.microBody:t.querySelector("micro-app-body");null==e||e.appendChild(s)}}else!function(e,t){const n=t.appSpace[e.name];n.parsedFunction||(n.parsedFunction=Ge(e,t,n.parsedCode));n.parsedFunction.call(qe(e))}(t,n)}catch(n){throw console.error(`[micro-app from ${r?"runDynamicScript":"runScript"}] app ${t.name}: `,n,e),n}}function nt(e,t,n,o){return A(Zn.options.plugins)&&(n=function(e,t,n,o){var r;const i=ot(o.global,t,e);return ot(null===(r=o.modules)||void 0===r?void 0:r[n],i,e)}(e,n,t.name,Zn.options.plugins)),ze(t,o)?t.iframe?`(function(window,self,global,location){;${n}\n${re(e)?"":`//# sourceURL=${e}\n`}}).call(window.__MICRO_APP_SANDBOX__.proxyWindow,window.__MICRO_APP_SANDBOX__.proxyWindow,window.__MICRO_APP_SANDBOX__.proxyWindow,window.__MICRO_APP_SANDBOX__.proxyWindow,window.__MICRO_APP_SANDBOX__.proxyLocation);`:`;(function(proxyWindow){with(proxyWindow.__MICRO_APP_WINDOW__){(function(${Fe}){;${n}\n${re(e)?"":`//# sourceURL=${e}\n`}}).call(proxyWindow,${Fe})}})(window.__MICRO_APP_PROXY_WINDOW__);`:n}function ot(e,t,n){return r(e)?e.reduce(((e,t)=>A(t)&&_(t.loader)?t.loader(e,n):e),t):t}function rt(e,t,n,o){const r=Array.from(e.children);r.length&&r.forEach((e=>{rt(e,t,n,o)}));for(const n of r)P(n)?n.hasAttribute("exclude")||Je(n.getAttribute("href"),t.name)?e.replaceChild(document.createComment("link element with exclude attribute ignored by micro-app"),n):n.hasAttribute("ignore")||Ze(n.getAttribute("href"),t.name)?n.hasAttribute("href")&&Hn.rawSetAttribute.call(n,"href",U(n.getAttribute("href"),t.url)):Ce(n,e,t):R(n)?n.hasAttribute("exclude")?e.replaceChild(document.createComment("style element with exclude attribute ignored by micro-app"),n):t.scopecss&&!n.hasAttribute("ignore")&&ne(o,(()=>_e(n,t))):S(n)?Ve(n,e,t):"[object HTMLImageElement]"===u(n)&&n.hasAttribute("src")&&Hn.rawSetAttribute.call(n,"src",U(n.getAttribute("src"),t.url))}function it(e,t){const n=function(e){const t=q("div");return t.innerHTML=e,t}(e),o=Hn.rawElementQuerySelector.call(n,"micro-app-head"),r=Hn.rawElementQuerySelector.call(n,"micro-app-body");if(!o||!r){const e=`element ${o?"body":"head"} is missing`;return t.onerror(new Error(e)),C(e,t.name)}const i=t.isPrefetch||t.fiber?[]:null;rt(n,t,o,i);const s=oe(i);t.source.links.size?Ne(n,t,o,s):s?s.then((()=>t.onLoad(n))):t.onLoad(n),t.source.scripts.size?et(n,t):t.onLoad(n)}const st=new class{constructor(){this.eventList=new Map,this.queue=[],this.recordStep={},this.process=()=>{var e,t;let n;const o=this.recordStep,r=this.queue;for(this.recordStep={},this.queue=[];n=r.shift();){const r=this.eventList.get(n),i=r.tempData,s=r.force;let a;if(r.tempData=null,r.force=!1,s||!this.isEqual(r.data,i)){r.data=i||r.data;for(const e of r.callbacks){const t=e(r.data);t&&(null!=a?a:a=[]).push(t)}null===(t=(e=o[n]).dispatchDataEvent)||void 0===t||t.call(e),o[n].nextStepList.forEach((e=>e(a)))}}}}isLegalName(e){return!!e||(C("event-center: Invalid name"),!1)}enqueue(e,t,n){this.recordStep[e]?(this.recordStep[e].nextStepList.push(t),n&&(this.recordStep[e].dispatchDataEvent=n)):this.recordStep[e]={nextStepList:[t],dispatchDataEvent:n},!this.queue.includes(e)&&1===this.queue.push(e)&&O(this.process)}isEqual(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&e[n]!==t[n])return!1;return!0}on(e,t,n=!1){if(this.isLegalName(e)){if(!_(t))return C("event-center: Invalid callback function");let o=this.eventList.get(e);o?n&&Object.keys(o.data).length&&(!this.queue.includes(e)||this.isEqual(o.data,o.tempData))&&t(o.data):(o={data:{},callbacks:new Set},this.eventList.set(e,o)),o.callbacks.add(t)}}off(e,t){if(this.isLegalName(e)){const n=this.eventList.get(e);n&&(_(t)?n.callbacks.delete(t):n.callbacks.clear())}}clearData(e){if(this.isLegalName(e)){const t=this.eventList.get(e);t&&(t.data={})}}dispatch(e,t,n,o,r){if(this.isLegalName(e)){if(!A(t))return C("event-center: data must be object");let s=this.eventList.get(e);s?(s.tempData=i({},s.tempData||s.data,t),!s.force&&(s.force=!!o)):(s={data:t,callbacks:new Set},this.eventList.set(e,s),s.force=!0),this.enqueue(e,n,r)}}getData(e){var t;const n=this.eventList.get(e);return null!==(t=null==n?void 0:n.data)&&void 0!==t?t:null}};function at(e,t){return d(e)&&e?t?`__from_base_app_${e}__`:`__from_micro_app_${e}__`:""}class ct{addGlobalDataListener(e,t){const n=this.appName;n&&(e.__APP_NAME__=n,e.__AUTO_TRIGGER__=t),st.on("global",e,t)}removeGlobalDataListener(e){_(e)&&st.off("global",e)}setGlobalData(e,t,n){K(),st.dispatch("global",e,(e=>_(t)&&t(e)),n)}forceSetGlobalData(e,t){this.setGlobalData(e,t,!0)}getGlobalData(){return st.getData("global")}clearGlobalData(){st.clearData("global")}clearGlobalDataListener(){const e=this.appName,t=st.eventList.get("global");if(t)for(const n of t.callbacks)(e&&e===n.__APP_NAME__||!e&&!n.__APP_NAME__)&&t.callbacks.delete(n)}}class lt extends ct{addDataListener(e,t,n){st.on(at(L(e),!1),t,n)}removeDataListener(e,t){_(t)&&st.off(at(L(e),!1),t)}getData(e,t=!1){return st.getData(at(L(e),t))}setData(e,t,n,o){st.dispatch(at(L(e),!0),t,(e=>_(n)&&n(e)),o)}forceSetData(e,t,n){this.setData(e,t,n,!0)}clearData(e,t=!0){st.clearData(at(L(e),t))}clearDataListener(e){st.off(at(L(e),!1))}}class ut extends ct{constructor(e){super(),this.appName=L(e),!this.appName&&C(`Invalid appName ${e}`)}addDataListener(e,t){e.__AUTO_TRIGGER__=t,st.on(at(this.appName,!0),e,t)}removeDataListener(e){_(e)&&st.off(at(this.appName,!0),e)}getData(e=!0){return st.getData(at(this.appName,e))}dispatch(e,t,n){K(),st.dispatch(at(this.appName,!1),e,(e=>_(t)&&t(e)),n,(()=>{const t=Sn.get(this.appName);if((null==t?void 0:t.container)&&A(e)){const e=new CustomEvent("datachange",{detail:{data:st.getData(at(this.appName,!1))}});X(t.container).dispatchEvent(e)}}))}forceDispatch(e,t){this.dispatch(e,t,!0)}clearData(e=!1){st.clearData(at(this.appName,e))}clearDataListener(){st.off(at(this.appName,!0))}}function pt(e){var t,n;if(e){e.umdDataListeners={global:new Set(null===(t=e.umdDataListeners)||void 0===t?void 0:t.global),normal:new Set(null===(n=e.umdDataListeners)||void 0===n?void 0:n.normal)};const o=st.eventList.get("global");if(o)for(const t of o.callbacks)e.appName===t.__APP_NAME__&&e.umdDataListeners.global.add(t);const r=st.eventList.get(at(e.appName,!0));if(r)for(const t of r.callbacks)e.umdDataListeners.normal.add(t)}}function ht(e){if(null==e?void 0:e.umdDataListeners){for(const t of e.umdDataListeners.global)e.addGlobalDataListener(t,t.__AUTO_TRIGGER__);for(const t of e.umdDataListeners.normal)e.addDataListener(t,t.__AUTO_TRIGGER__);dt(e)}}function dt(e){null==e||delete e.umdDataListeners}class mt{constructor(){this.appInstanceMap=Sn}static getInstance(){return this.instance||(this.instance=new mt),this.instance}get(e){return this.appInstanceMap.get(e)}set(e,t){this.appInstanceMap.set(e,t)}getAll(){return Array.from(this.appInstanceMap.values())}clear(){this.appInstanceMap.clear()}}function ft(){_t(),mt.getInstance().getAll().forEach((e=>{e.container&&X(e.container).disconnectedCallback()})),!window.__MICRO_APP_UMD_MODE__&&mt.getInstance().clear()}function _t(){window.__MICRO_APP_ENVIRONMENT__&&window.removeEventListener("unmount",ft,!1)}function At(e){return m(e.__MICRO_APP_IS_BOUND_FUNCTION__)?e.__MICRO_APP_IS_BOUND_FUNCTION__:e.__MICRO_APP_IS_BOUND_FUNCTION__=_(t=e)&&0===t.name.indexOf("bound ")&&!t.hasOwnProperty("prototype");var t}function wt(e,t,n="WINDOW"){if(_(e)&&!function(e){return m(e.__MICRO_APP_IS_CONSTRUCTOR__)?e.__MICRO_APP_IS_CONSTRUCTOR__:e.__MICRO_APP_IS_CONSTRUCTOR__=g(e)}(e)&&!At(e)){const o=`__MICRO_APP_BOUND_${n}_FUNCTION__`;if(e[o])return e[o];const r=e.bind(t);for(const t in e)r[t]=e[t];return e.hasOwnProperty("prototype")&&s(r,"prototype",{value:e.prototype,configurable:!0,enumerable:!1,writable:!0}),e[o]=r}return e}function yt(e,t,n){const{proxyDocument:o,documentEffect:r}=function(e,t){const n=new Map,o=new Map;let r=null,i=null;const{rawDocument:s,rawCreateElement:a,rawAddEventListener:c,rawRemoveEventListener:l}=Hn;function u(t,n){const o=a.call(s,t,n);return o.__MICRO_APP_NAME__=e,o}function p(e,t,o){const r=n.get(e);r?r.add(t):n.set(e,new Set([t])),t&&(t.__MICRO_APP_MARK_OPTIONS__=o),c.call(s,e,t,o)}function h(e,t,o){const r=n.get(e);(null==r?void 0:r.size)&&r.has(t)&&r.delete(t),l.call(s,e,t,o)}const d=()=>{o.clear(),i=null},m=()=>{i=r||i,n.forEach(((e,t)=>{if(e.size){const n=o.get(t)||[];o.set(t,new Set([...n,...e]))}}))},f=()=>{i&&!r&&(y.onclick=i),o.forEach(((e,t)=>{for(const n of e)y.addEventListener(t,n,null==n?void 0:n.__MICRO_APP_MARK_OPTIONS__)})),d()},A=()=>{_(r)&&l.call(s,"click",r),r=null,n.size&&(n.forEach(((e,t)=>{for(const n of e)l.call(s,t,n)})),n.clear())},w=(()=>{var e;const t=new Map([["onclick",e=>{_(r)&&l.call(s,"click",r,!1),_(e)&&c.call(s,"click",e,!1),r=e}]]),n=(null===(e=Zn.options)||void 0===e?void 0:e.customProxyDocumentProps)||new Map;return new Map([...t,...n])})(),y=new Proxy(s,{get:(n,o)=>{var i;return $(e),"createElement"===o?u:o===Symbol.toStringTag?"ProxyDocument":"defaultView"===o?t.proxyWindow:"onclick"===o?r:"addEventListener"===o?p:"removeEventListener"===o?h:"microAppElement"===o?null===(i=Sn.get(e))||void 0===i?void 0:i.container:"__MICRO_APP_NAME__"===o?e:wt(Reflect.get(n,o),s,"DOCUMENT")},set:(e,t,n)=>{if(w.has(t)){w.get(t)(n)}else"microAppElement"!==t&&Reflect.set(e,t,n);return!0}});return{proxyDocument:y,documentEffect:{reset:d,record:m,rebuild:f,release:A}}}(e,n),i=function(e,t){const{rawDocument:n,rawRootDocument:o}=Hn;class r{static[Symbol.hasInstance](e){let n=e;for(;n;)if(n=Object.getPrototypeOf(n),n===r.prototype)return!0;return e===t||e instanceof o}}return Object.setPrototypeOf(r,o),Object.setPrototypeOf(r.prototype,new Proxy(o.prototype,{get:(t,o)=>($(e),wt(Reflect.get(t,o),n,"DOCUMENT")),set:(e,t,n)=>(Reflect.set(e,t,n),!0)})),r}(e,o);return a(t,{document:{configurable:!1,enumerable:!0,get:()=>o},Document:{configurable:!1,enumerable:!1,get:()=>i}}),r}function gt(e,t,n){return function(e){const t=Hn.rawWindow;Object.getOwnPropertyNames(t).filter((e=>/^on/.test(e)&&!Ue.includes(e))).forEach((n=>{const{enumerable:o,writable:r,set:i}=Object.getOwnPropertyDescriptor(t,n)||{enumerable:!0,writable:!0};s(e,n,{enumerable:o,configurable:!0,get:()=>t[n],set:(null!=r?r:i)?e=>{t[n]=e}:void 0})}))}(t),function(e,t,n){const o=Hn.rawWindow,r=new Map,i=new Proxy(t,{get:(t,r)=>($(e),Reflect.has(t,r)||d(r)&&/^__MICRO_APP_/.test(r)||n.scopeProperties.includes(r)?(He.includes(r)&&K(),Reflect.get(t,r)):wt(Reflect.get(o,r),o)),set:(e,t,r)=>{if(n.adapter.escapeSetterKeyList.includes(t))Reflect.set(o,t,r);else if(l.call(e,t)||!l.call(o,t)||n.scopeProperties.includes(t))!Reflect.has(e,t)&&n.injectedKeys.add(t),Reflect.set(e,t,r);else{const i=Object.getOwnPropertyDescriptor(o,t),{configurable:a,enumerable:c,writable:l,set:u}=i;s(e,t,{value:r,configurable:a,enumerable:c,writable:null!=l?l:!!u}),n.injectedKeys.add(t)}return(n.escapeProperties.includes(t)||n.adapter.staticEscapeProperties.includes(t)&&!Reflect.has(o,t))&&!n.scopeProperties.includes(t)&&(!Reflect.has(o,t)&&n.escapeKeys.add(t),Reflect.set(o,t,r)),!0},has:(e,t)=>n.scopeProperties.includes(t)?n.adapter.staticScopeProperties.includes(t)?!!e[t]:t in e:t in e||t in o,getOwnPropertyDescriptor:(e,t)=>{if(l.call(e,t))return r.set(t,"target"),Object.getOwnPropertyDescriptor(e,t);if(l.call(o,t)){r.set(t,"rawWindow");const e=Object.getOwnPropertyDescriptor(o,t);return e&&!e.configurable&&(e.configurable=!0),e}},defineProperty:(e,t,n)=>"rawWindow"===r.get(t)?Reflect.defineProperty(o,t,n):Reflect.defineProperty(e,t,n),ownKeys:e=>Reflect.ownKeys(o).concat(Reflect.ownKeys(e)).filter((function(e){return!(e in this)&&(this[e]=!0)}),Object.create(null)),deleteProperty:(e,t)=>!l.call(e,t)||(n.injectedKeys.has(t)&&n.injectedKeys.delete(t),n.escapeKeys.has(t)&&Reflect.deleteProperty(o,t),Reflect.deleteProperty(e,t))});n.proxyWindow=i}(e,t,n),function(e){const t=new Map,n=new Map,o=new Map,r=new Map,{rawWindow:i,rawAddEventListener:s,rawRemoveEventListener:a,rawDispatchEvent:c,rawSetInterval:l,rawSetTimeout:u,rawClearInterval:p,rawClearTimeout:h}=Hn;function d(t){return Te.includes(t)?e:i}e.addEventListener=function(e,n,o){const r=t.get(e);r?r.add(n):t.set(e,new Set([n])),n&&(n.__MICRO_APP_MARK_OPTIONS__=o),s.call(d(e),e,n,o)},e.removeEventListener=function(e,n,o){const r=t.get(e);(null==r?void 0:r.size)&&r.has(n)&&r.delete(n),a.call(d(e),e,n,o)},e.dispatchEvent=function(e){return c.call(d(null==e?void 0:e.type),e)},e.setInterval=function(e,t,...n){const r=l.call(i,e,t,...n);return o.set(r,{handler:e,timeout:t,args:n}),r},e.setTimeout=function(e,t,...n){const o=u.call(i,e,t,...n);return r.set(o,{handler:e,timeout:t,args:n}),o},e.clearInterval=function(e){o.delete(e),p.call(i,e)},e.clearTimeout=function(e){r.delete(e),h.call(i,e)};const m=()=>{n.clear()},f=()=>{n.forEach(((t,n)=>{for(const o of t)e.addEventListener(n,o,null==o?void 0:o.__MICRO_APP_MARK_OPTIONS__)})),m()};return{reset:m,record:()=>{t.forEach(((e,t)=>{if(e.size){const o=n.get(t)||[];n.set(t,new Set([...o,...e]))}}))},rebuild:f,release:e=>{t.size&&(t.forEach(((e,t)=>{for(const n of e)a.call(d(t),t,n)})),t.clear()),e&&(o.forEach(((e,t)=>{p.call(i,t)})),r.forEach(((e,t)=>{h.call(i,t)})),o.clear(),r.clear())}}}(t)}function bt(e,t){if(!Lt(e)){const n=Hn.rawWindow.history.state,o={microAppState:i({},null==n?void 0:n.microAppState,{[e]:t})};return i({},n,o)}return t}function vt(e){var t;const n=Hn.rawWindow.history.state;return Lt(e)?n:(null===(t=null==n?void 0:n.microAppState)||void 0===t?void 0:t[e])||null}const Et=/&/g,Pt=/=/g,Rt=/%M1/g,St=/%M2/g;function Mt(e){return encodeURIComponent(Nt(e).replace(Et,"%M1").replace(Pt,"%M2"))}function Ct(e){return Nt(e).replace(Rt,"&").replace(St,"=")}function Nt(e){try{const t=decodeURIComponent(e);return e===t||Rt.test(t)||St.test(t)?t:Nt(t)}catch(t){return e}}function Ot(e){var t,n;const o=Hn.rawWindow.location;if(!Lt(e)){const r=It(o.search,o.hash),i=(null===(t=r.hashQuery)||void 0===t?void 0:t[e])||(null===(n=r.searchQuery)||void 0===n?void 0:n[e]);return d(i)?Ct(i):null}return o.pathname+o.search+o.hash}function Dt(e,t){const n=t.pathname+t.search+t.hash;let o=!1;if(!Lt(e)){let{pathname:t,search:r,hash:i}=Hn.rawWindow.location;const s=It(r,i),a=Mt(n);if(i&&!r){o=!0,s.hashQuery?s.hashQuery[e]=a:s.hashQuery={[e]:a};const t=i.includes("?")?i.slice(0,i.indexOf("?")+1):i+"?";i=t+Z(s.hashQuery)}else s.searchQuery?s.searchQuery[e]=a:s.searchQuery={[e]:a},r="?"+Z(s.searchQuery);return{fullPath:t+r+i,isAttach2Hash:o}}return{fullPath:n,isAttach2Hash:o}}function It(e,t){const n={};return""!==e&&"?"!==e&&(n.searchQuery=J(e.slice(1))),t.includes("?")&&(n.hashQuery=J(t.slice(t.indexOf("?")+1))),n}function xt(e){const t=Sn.get(e);return!(!t||t.isPrefetch)}function Lt(e){const t=Sn.get(e);return!t||!t.sandBox||t.routerMode===xe}function Tt(e,t){let n;return n=t?t.getDisposeResult("disable-memory-router")?xe:e||Zn.options["router-mode"]||"":Zn.options["disable-memory-router"]?xe:e||Zn.options["router-mode"]||"",Le.includes(n)?n:Ie}function Ut(e){const t=Hn.rawWindow,n=t=>{qn({excludeHiddenApp:!0,excludePreRender:!0}).includes(e)&&!t.onlyForBrowser&&Wt(e,Ot(e))};return t.addEventListener("popstate",n),()=>{t.removeEventListener("popstate",n)}}function Wt(e,t){const n=Sn.get(e),o=n.sandBox.proxyWindow,r=n.sandBox.microAppWindow;let i=!1;const s=o.location.href;if(t){const n=o.location.hash;cn(e,t,r.location),i=o.location.hash!==n}!function(e,t,n){const o=new PopStateEvent("popstate",{state:vt(e)});n.dispatchEvent(o),Cn(e)||_(t.onpopstate)&&t.onpopstate(o)}(e,o,r),i&&function(e,t,n,o){const r=new HashChangeEvent("hashchange",{newURL:t.location.href,oldURL:o});n.dispatchEvent(r),Cn(e)||_(t.onhashchange)&&t.onhashchange(r)}(e,o,r,s),K()}function Bt(e,t,n){K(),xt(e)&&(function(e){const t=new PopStateEvent("popstate",{state:null});e&&(t.onlyForBrowser=!0),Hn.rawWindow.dispatchEvent(t)}(t),n&&function(e){const t=new HashChangeEvent("hashchange",{newURL:Hn.rawWindow.location.href,oldURL:e});Hn.rawWindow.dispatchEvent(t)}(n))}function kt(e,t){const n=Hn.rawWindow.history;function o(n){return function(...o){var r,i,s;if(d(o[2])||b(o[2])){const a=D(o[2],t.href),c=a.pathname+a.search+a.hash;Ft(e,n,Dt(e,a),!0,bt(e,o[0]),o[1]),c!==t.fullPath&&cn(e,c,t),null===(s=null===(r=Sn.get(e))||void 0===r?void 0:(i=r.sandBox).updateIframeBase)||void 0===s||s.call(i)}else Ht(e,n,o[2],o[0],o[1])}}const r=o("pushState"),i=o("replaceState");return Cn(e)?{pushState:r,replaceState:i}:new Proxy(n,{get:(t,n)=>"state"===n?vt(e):"pushState"===n?r:"replaceState"===n?i:wt(Reflect.get(t,n),t,"HISTORY"),set:(e,t,n)=>(Reflect.set(e,t,n),!0)})}function Ht(e,t,n,o=null,r=""){if(xt(e)){("pushState"===t?Hn.rawPushState:Hn.rawReplaceState).call(Hn.rawWindow.history,o,r,n)}}function Ft(e,t,n,o,r,i){if(xt(e)){const s=Hn.rawWindow.location,a=s.pathname+s.search+s.hash,c=n.isAttach2Hash&&a!==n.fullPath?s.href:null;Ht(e,t,n.fullPath,r,i),a===n.fullPath||Lt(e)||Bt(e,o,c)}}function $t(e,t,n){Ft(e,"replaceState",t,!0,n)}function jt(e){const t=Hn.rawWindow;return function(...n){var o;if((null===(o=t.history.state)||void 0===o?void 0:o.microAppState)&&(!A(n[0])||!n[0].microAppState)&&(d(n[2])||b(n[2]))){const e=t.location.href;D(n[2],e).href===e&&(n[0]=i({},n[0],{microAppState:t.history.state.microAppState}))}e.apply(t.history,n),qn({excludeHiddenApp:!0,excludePreRender:!0}).forEach((e=>{if(!Lt(e)&&!Ot(e)){$t(e,Dt(e,Sn.get(e).sandBox.proxyWindow.location),bt(e,vt(e)))}})),K()}}function Kt(){const e=Hn.rawWindow;e.history.pushState=jt(Hn.rawPushState),e.history.replaceState=jt(Hn.rawReplaceState)}function qt(){const e=Hn.rawWindow;e.history.pushState=Hn.rawPushState,e.history.replaceState=Hn.rawReplaceState}const{router:Gt,executeNavigationGuard:Qt,clearRouterWhenUnmount:zt}=function(){function e(e,t,n,o){const r=t.sandBox.proxyWindow.location,i=D(n.path,r.href),s=r.pathname+r.search+r.hash,a=i.pathname+i.search+i.hash;if(s!==a||Ot(e)!==a){!function(e,t,n,o){Ft(e,t,Dt(e,n),!1,bt(e,null!=o?o:null)),K()}(e,o&&!1!==n.replace||!0===n.replace?"replaceState":"pushState",i,n.state),Lt(e)&&Wt(e,a)}}function t(t){return function(n){return new Promise(((o,r)=>{const i=L(n.name);if(i&&d(n.path))if(qn({excludeHiddenApp:!0,excludePreRender:!0}).includes(i)){const r=Sn.get(i);o(r.sandBox.sandboxReady.then((()=>e(i,r,n,t))))}else r(C("navigation failed, app does not exist or is inactive"));else r(C("navigation failed, name & path are required when use router."+(t?"replace":"push")))}))}}function n(e){return function(...t){return Hn.rawWindow.history[e](...t)}}const r=ee(),i=ee();function s(e,t,n,o){K();for(const r of o)_(r)?r(t,n,e):A(r)&&_(r[e])&&r[e](t,n)}function a(e){if(!Lt(e)){$t(e,Dt(e,Sn.get(e).sandBox.proxyWindow.location),bt(e,vt(e)))}}const c=Object.assign(Object.assign({current:new Map,encode:Mt,decode:Ct,push:t(!1),replace:t(!0),go:n("go"),back:n("back"),forward:n("forward"),beforeEach:r.add,afterEach:i.add,attachToURL:function(e){(e=L(e))&&qn().includes(e)&&a(e)},attachAllToURL:function({includeHiddenApp:e=!1,includePreRender:t=!1}){qn({excludeHiddenApp:!e,excludePreRender:!t}).forEach((e=>a(e)))}},function(){const e=function(){const e=new Map;return{add:function(t,n){return e.set(t,n),()=>!!e.has(t)&&e.delete(t)},get:t=>e.get(t),delete:t=>!!e.has(t)&&e.delete(t)}}();return{setDefaultPage:function(t){const n=L(t.name);return n&&t.path?e.add(n,t.path):o},removeDefaultPage:function(t){return!!(t=L(t))&&e.delete(t)},getDefaultPage:e.get}}()),function(){let e=null;return{setBaseAppRouter:function(t){w(t)&&(e=new Proxy(t,{get:(e,t)=>(K(),wt(Reflect.get(e,t),e,"BASEROUTER")),set:(e,t,n)=>(Reflect.set(e,t,n),!0)}))},getBaseAppRouter:()=>e}}());return{router:c,executeNavigationGuard:function(e,t,n){c.current.set(e,t),s(e,t,n,r.list()),B((()=>{s(e,t,n,i.list())}))},clearRouterWhenUnmount:function(e){c.current.delete(e)}}}(),Xt=["getComputedStyle","visualViewport","matchMedia","ResizeObserver","IntersectionObserver"],Vt=[/animationFrame$/i,/mutationObserver$/i,/height$|width$/i,/offset$/i,/selection$/i,/^range/i,/^screen/i,/^scroll/i,/X$|Y$/],Yt=["body","head","html","title"],Jt=["host","hostname","port","protocol","origin"],Zt=["childElementCount","children","firstElementChild","firstChild","lastElementChild","activeElement","fullscreenElement","pictureInPictureElement","pointerLockElement","styleSheets"],en=["append","contains","replaceChildren","createRange","getSelection","elementFromPoint","elementsFromPoint","getAnimations"],tn=["characterSet","compatMode","contentType","designMode","dir","doctype","embeds","fullscreenEnabled","hidden","implementation","lastModified","pictureInPictureEnabled","plugins","readyState","referrer","visibilityState","fonts"],nn=["execCommand","createRange","exitFullscreen","exitPictureInPicture","getElementsByTagNameNS","hasFocus","prepend"],on=["href","pathname","search","hash","host","hostname","port","protocol","search"],rn=[...on,"origin","fullPath"];function sn(e,t,n,o,r,i){const a=Hn.rawWindow.location,c=!!n,l=D(t);function u(){return c?n.location:l}function p(t,n){const o=D(t,A.href);if(o.origin===A.origin){const t=Dt(e,o);if(!Lt(e)){if(o.pathname===A.pathname&&o.search===A.search){let r=null;return o.hash!==A.hash&&(t.isAttach2Hash&&(r=a.href),Ht(e,n,t.fullPath)),void(o.hash?Bt(e,!1,r):_())}if(t.isAttach2Hash)return Ht(e,n,t.fullPath),void _()}return t.fullPath}return t}function h(n,o){const r=D(n,t);r[o]===A[o]&&A.hash?Bt(e,!1):(Ht(e,r[o]===A[o]?"replaceState":"pushState",Dt(e,r).fullPath),_())}const d=t=>function(n){if(xt(e)){const e=p(n,"assign"===t?"pushState":"replaceState");e&&a[t](D(e,a.origin).href)}},m=d("assign"),f=d("replace"),_=e=>a.reload(e);s(u(),"fullPath",{enumerable:!0,configurable:!0,get:()=>A.pathname+A.search+A.hash});const A=new Proxy({},{get:(e,t)=>{const n=u();if(c){if(Jt.includes(t))return o[t];if("href"===t)return n[t].replace(r,i)}return"assign"===t?m:"replace"===t?f:"reload"===t?_:"self"===t?n:wt(Reflect.get(n,t),n,"LOCATION")},set:(n,o,r)=>{if(xt(e)){const n=u();if("href"===o){const e=p(r,"pushState");e&&(a.href=D(e,a.origin).href)}else if("pathname"===o)if(Lt(e))a.pathname=r;else{h(("/"+r).replace(/^\/+/,"/")+A.search+A.hash,"pathname")}else if("search"===o)if(Lt(e))a.search=r;else{h(A.pathname+("?"+r).replace(/^\?+/,"?")+A.hash,"search")}else if("hash"===o)if(Lt(e))a.hash=r;else{const n=A.pathname+A.search+("#"+r).replace(/^#+/,"#"),o=D(n,t);o.hash!==A.hash&&Ft(e,"pushState",Dt(e,o),!1)}else Reflect.set(n,o,r)}return!0}});return A}function an(e,t){const n=i({name:e},t);for(const e of rn)n[e]=t[e];return n}function cn(e,t,n,o){var r;const i=an(e,n),s=D(t,n.href);if(Cn(e)){const t=Sn.get(e).sandBox.microAppWindow;null===(r=t.rawReplaceState)||void 0===r||r.call(t.history,vt(e),"",s.href)}else for(const e of on)n.self[e]=s[e];const a=an(e,n);("auto"===o||i.fullPath!==a.fullPath&&"prevent"!==o)&&Qt(e,a,i)}function ln(e,t,n){const o=Ot(e);o?cn(e,o,t,"auto"):un(e,t,n)}function un(e,t,n){n&&cn(e,n,t,"prevent"),$t(e,Dt(e,t),bt(e,null)),function(e,t){Qt(e,an(e,t),an(e,t))}(e,t)}function pn(e,t,n,o){if(!Lt(e)){if(!o){const{pathname:o,search:r,hash:i}=D(t);cn(e,o+r+i,n,"prevent")}hn(e)}zt(e)}function hn(e){$t(e,function(e,t){var n,o,r,i;let{pathname:s,search:a,hash:c}=t||Hn.rawWindow.location,l=!1;if(!Lt(e)){const t=It(a,c);if(null===(n=t.hashQuery)||void 0===n?void 0:n[e]){l=!0,null===(o=t.hashQuery)||void 0===o||delete o[e];const n=Z(t.hashQuery);c=c.slice(0,c.indexOf("?")+Number(Boolean(n)))+n}else if(null===(r=t.searchQuery)||void 0===r?void 0:r[e]){null===(i=t.searchQuery)||void 0===i||delete i[e];const n=Z(t.searchQuery);a=n?"?"+n:""}}return{fullPath:s+a+c,isAttach2Hash:l}}(e),function(e,t){return Lt(e)?t:(A(null==t?void 0:t.microAppState)&&(p(t.microAppState[e])||delete t.microAppState[e],Object.keys(t.microAppState).length||delete t.microAppState),i({},t))}(e,Hn.rawWindow.history.state))}class dn{constructor(){this.escapeSetterKeyList=["location"],this.staticEscapeProperties=["System","__cjsWrapper"],this.staticScopeProperties=["webpackJsonp","webpackHotUpdate","Vue"],this.injectReactHMRProperty()}injectReactHMRProperty(){}}function mn(e,t){const n=Array.from(e.children);n.length&&n.forEach((e=>{mn(e,t)}));for(const e of n)fn(e,t)}function fn(e,t){var n,o;const r=null===(o=null===(n=Sn.get(t))||void 0===n?void 0:n.sandBox)||void 0===o?void 0:o.proxyWindow;return E(e)&&!e.__MICRO_APP_NAME__&&!e.__PURE_ELEMENT__&&r&&(a(e,{baseURI:{configurable:!0,get:()=>r.location.href},__MICRO_APP_NAME__:{configurable:!0,writable:!0,value:t}}),Cn(t)&&e instanceof Hn.rawRootNode&&s(e,"parentNode",{configurable:!0,get:_n(t,Hn.rawParentNodeDesc,!0)})),e}function _n(e,t,n){return function(){var o,r,i;$(e);const s=t.get.call(this);return!n&&M(s)&&(null===(o=Sn.get(e))||void 0===o?void 0:o.container)?(null===(i=(r=Zn.options).getRootElementParentNode)||void 0===i?void 0:i.call(r,this,e))||Hn.rawDocument.body:s}}function An(e,t){const n=p(t)?Hn.rawWindow.fetch:t;return _(n)?function(t,o,...r){return(d(t)||b(t))&&(t=D(t,e).toString()),K(),n.call(Hn.rawWindow,t,o,...r)}:n}function wn(e,t){const n=p(t)?Hn.rawWindow.XMLHttpRequest:t;return g(n)?class extends n{open(t,n,...o){(d(n)&&!/^f(ile|tp):\/\//.test(n)||b(n))&&(n=D(n,e).toString()),K(),super.open(t,n,...o)}}:n}const{createMicroEventSource:yn,clearMicroEventSource:gn}=function(){let e;return{createMicroEventSource:function(t,n,o){const r=p(o)?Hn.rawWindow.EventSource:o;return g(r)?class extends r{constructor(o,r,...i){if((d(o)||b(o))&&(o=D(o,n).toString()),K(),super(o,r,...i),e){const n=e.get(t);n?n.add(this):e.set(t,new Set([this]))}else e=new Map([[t,new Set([this])]])}close(){var n;super.close(),null===(n=e.get(t))||void 0===n||n.delete(this)}}:r},clearMicroEventSource:function(t){const n=null==e?void 0:e.get(t);(null==n?void 0:n.size)&&(n.forEach((e=>{e.close()})),n.clear())}}}();class bn{constructor(e,t){this.active=!1,this.scopeProperties=[],this.escapeProperties=[],this.escapeKeys=new Set,this.injectedKeys=new Set,this.microAppWindow=new EventTarget,this.patchWith((n=>{this.adapter=new dn,this.getSpecialProperties(e),this.patchRouter(e,t,this.microAppWindow),this.windowEffect=gt(e,this.microAppWindow,this),this.documentEffect=yt(e,this.microAppWindow,this),this.initStaticGlobalKeys(e,t,this.microAppWindow),n()}))}start({umdMode:e,baseroute:t,defaultPage:n,disablePatchRequest:o}){this.active||(this.active=!0,this.initRouteState(n),this.removeHistoryListener=Ut(this.microAppWindow.__MICRO_APP_NAME__),Lt(this.microAppWindow.__MICRO_APP_NAME__)&&(this.microAppWindow.__MICRO_APP_BASE_ROUTE__=this.microAppWindow.__MICRO_APP_BASE_URL__=t),e||this.initGlobalKeysWhenStart(this.microAppWindow.__MICRO_APP_NAME__,this.microAppWindow.__MICRO_APP_URL__,this.microAppWindow,o),1==++Hn.activeSandbox&&(Un(),Kt()),1==++bn.activeCount&&window.__MICRO_APP_ENVIRONMENT__&&(_t(),window.addEventListener("unmount",ft,!1)),Hn.rawWindow._babelPolyfill&&(Hn.rawWindow._babelPolyfill=!1))}stop({umdMode:e,keepRouteState:t,destroy:n,clearData:o}){var r;this.active&&(this.recordAndReleaseEffect({umdMode:e,clearData:o,destroy:n},!e||n),this.clearRouteState(t),null===(r=this.removeHistoryListener)||void 0===r||r.call(this),e&&!n||(gn(this.microAppWindow.__MICRO_APP_NAME__),this.injectedKeys.forEach((e=>{Reflect.deleteProperty(this.microAppWindow,e)})),this.injectedKeys.clear(),this.escapeKeys.forEach((e=>{Reflect.deleteProperty(Hn.rawWindow,e)})),this.escapeKeys.clear()),0==--Hn.activeSandbox&&(Bn(),qt()),--bn.activeCount,this.active=!1)}initStaticGlobalKeys(e,t,n){n.__MICRO_APP_ENVIRONMENT__=!0,n.__MICRO_APP_NAME__=e,n.__MICRO_APP_URL__=t,n.__MICRO_APP_PUBLIC_PATH__=T(t),n.__MICRO_APP_BASE_ROUTE__="",n.__MICRO_APP_WINDOW__=n,n.__MICRO_APP_PRE_RENDER__=!1,n.__MICRO_APP_UMD_MODE__=!1,n.__MICRO_APP_SANDBOX__=this,n.__MICRO_APP_SANDBOX_TYPE__="with",n.rawWindow=Hn.rawWindow,n.rawDocument=Hn.rawDocument,n.microApp=i(new ut(e),{removeDomScope:K,pureCreateElement:q,router:Gt}),this.setMappingPropertiesWithRawDescriptor(n)}recordAndReleaseEffect(e,t=!1){t?this.resetEffectSnapshot():this.recordEffectSnapshot(),this.releaseGlobalEffect(e)}resetEffectSnapshot(){this.windowEffect.reset(),this.documentEffect.reset(),dt(this.microAppWindow.microApp)}recordEffectSnapshot(){this.windowEffect.record(),this.documentEffect.record(),pt(this.microAppWindow.microApp)}rebuildEffectSnapshot(){this.windowEffect.rebuild(),this.documentEffect.rebuild(),ht(this.microAppWindow.microApp)}releaseGlobalEffect({umdMode:e=!1,clearData:t=!1,isPrerender:n=!1,keepAlive:o=!1,destroy:r=!1}){var i,s,a;this.windowEffect.release(!e&&!o&&!n||r),this.documentEffect.release(),null===(i=this.microAppWindow.microApp)||void 0===i||i.clearDataListener(),null===(s=this.microAppWindow.microApp)||void 0===s||s.clearGlobalDataListener(),t&&(Zn.clearData(this.microAppWindow.__MICRO_APP_NAME__),null===(a=this.microAppWindow.microApp)||void 0===a||a.clearData())}getSpecialProperties(e){var t;this.scopeProperties=this.scopeProperties.concat(this.adapter.staticScopeProperties),A(Zn.options.plugins)&&(this.commonActionForSpecialProperties(Zn.options.plugins.global),this.commonActionForSpecialProperties(null===(t=Zn.options.plugins.modules)||void 0===t?void 0:t[e]))}commonActionForSpecialProperties(e){if(r(e))for(const t of e)A(t)&&(r(t.scopeProperties)&&(this.scopeProperties=this.scopeProperties.concat(t.scopeProperties)),r(t.escapeProperties)&&(this.escapeProperties=this.escapeProperties.concat(t.escapeProperties)))}setPreRenderState(e){this.microAppWindow.__MICRO_APP_PRE_RENDER__=e}markUmdMode(e){this.microAppWindow.__MICRO_APP_UMD_MODE__=e}patchWith(e){this.sandboxReady=new Promise((t=>e(t)))}setMappingPropertiesWithRawDescriptor(e){let t,n;const o=Hn.rawWindow;o===o.parent?t=n=this.proxyWindow:(t=o.top,n=o.parent),s(e,"top",this.createDescriptorForMicroAppWindow("top",t)),s(e,"parent",this.createDescriptorForMicroAppWindow("parent",n)),ke.forEach((t=>{s(e,t,this.createDescriptorForMicroAppWindow(t,this.proxyWindow))}))}createDescriptorForMicroAppWindow(e,t){const{configurable:n=!0,enumerable:o=!0,writable:r,set:i}=Object.getOwnPropertyDescriptor(Hn.rawWindow,e)||{writable:!0};return{value:t,configurable:n,enumerable:o,writable:null!=r?r:!!i}}initGlobalKeysWhenStart(e,t,n,o){n.hasOwnProperty=e=>l.call(n,e)||l.call(Hn.rawWindow,e),this.setHijackProperty(e,n),o||this.patchRequestApi(e,t,n),this.setScopeProperties(n)}setHijackProperty(e,t){let n,o;a(t,{eval:{configurable:!0,enumerable:!1,get:()=>($(e),n||Hn.rawWindow.eval),set:e=>{n=e}},Image:{configurable:!0,enumerable:!1,get:()=>($(e),o||Hn.ImageProxy),set:e=>{o=e}}})}patchRequestApi(e,t,n){let o=An(t),r=wn(t),i=yn(e,t);a(n,{fetch:{configurable:!0,enumerable:!0,get:()=>o,set(e){o=An(t,e)}},XMLHttpRequest:{configurable:!0,enumerable:!0,get:()=>r,set(e){r=wn(t,e)}},EventSource:{configurable:!0,enumerable:!0,get:()=>i,set(n){i=yn(e,t,n)}}})}setScopeProperties(e){this.scopeProperties.forEach((t=>{Reflect.set(e,t,e[t])}))}patchRouter(e,t,n){const{microLocation:o,microHistory:r}=function(e,t){const n=sn(e,t);return{microLocation:n,microHistory:kt(e,n)}}(e,t);a(n,{location:{configurable:!1,enumerable:!0,get:()=>o,set:e=>{Hn.rawWindow.location=e}},history:{configurable:!0,enumerable:!0,get:()=>r}})}initRouteState(e){ln(this.microAppWindow.__MICRO_APP_NAME__,this.microAppWindow.location,e)}clearRouteState(e){pn(this.microAppWindow.__MICRO_APP_NAME__,this.microAppWindow.__MICRO_APP_URL__,this.microAppWindow.location,e)}setRouteInfoForKeepAliveApp(){un(this.microAppWindow.__MICRO_APP_NAME__,this.microAppWindow.location)}removeRouteInfoForKeepAliveApp(){hn(this.microAppWindow.__MICRO_APP_NAME__)}patchStaticElement(e){mn(e,this.microAppWindow.__MICRO_APP_NAME__)}actionBeforeExecScripts(e){this.patchStaticElement(e)}setStaticAppState(e){this.microAppWindow.__MICRO_APP_STATE__=e}}function vn(e,t,n){return function(e,t){const n=Hn.rawWindow;Xt.forEach((e=>{t[e]=wt(n[e],n)})),Object.getOwnPropertyNames(t).filter((e=>(Vt.some((o=>{if(o.test(e)&&e in t.parent){if(_(n[e]))t[e]=wt(n[e],n);else{const{configurable:o,enumerable:r}=Object.getOwnPropertyDescriptor(t,e)||{configurable:!0,enumerable:!0};o&&s(t,e,{configurable:o,enumerable:r,get:()=>n[e],set:t=>{n[e]=t}})}return!0}return!1})),/^on/.test(e)&&!Ue.includes(e)))).forEach((o=>{const{enumerable:r,writable:i,set:a}=Object.getOwnPropertyDescriptor(t,o)||{enumerable:!0,writable:!0};try{s(t,o,{enumerable:r,configurable:!0,get:()=>n[o],set:(null!=i?i:a)?e=>{n[o]=_(e)?e.bind(t):e}:void 0})}catch(t){N(t,e)}}))}(e,t),function(e,t){const n=Hn.rawWindow,o=[],r=new Proxy(e,{get:(e,n)=>"location"===n?t.proxyLocation:ke.includes(n.toString())?r:o.includes(n)?Reflect.get(e,n):wt(Reflect.get(e,n),e),set:(e,r,i)=>"location"===r?Reflect.set(n,r,i):(Reflect.has(e,r)||o.push(r),Reflect.set(e,r,i),t.escapeProperties.includes(r)&&(!Reflect.has(n,r)&&t.escapeKeys.add(r),Reflect.set(n,r,i)),!0),has:(e,t)=>t in e,deleteProperty:(e,o)=>!Reflect.has(e,o)||(t.escapeKeys.has(o)&&Reflect.deleteProperty(n,o),Reflect.deleteProperty(e,o))});t.proxyWindow=r}(t,n),function(e){const{rawWindow:t,rawAddEventListener:n,rawRemoveEventListener:o}=Hn,r=new Map,i=new Map;function s(n){return Te.includes(n)?e:t}e.addEventListener=function(e,t,o){const i=r.get(e);i?i.add(t):r.set(e,new Set([t])),t&&(t.__MICRO_APP_MARK_OPTIONS__=o),n.call(s(e),e,t,o)},e.removeEventListener=function(e,t,n){const i=r.get(e);(null==i?void 0:i.size)&&i.has(t)&&i.delete(t),o.call(s(e),e,t,n)};const a=()=>{i.clear()},c=()=>{i.forEach(((t,n)=>{for(const o of t)e.addEventListener(n,o,null==o?void 0:o.__MICRO_APP_MARK_OPTIONS__)})),a()};return{reset:a,record:()=>{r.forEach(((e,t)=>{if(e.size){const n=i.get(t)||[];i.set(t,new Set([...n,...e]))}}))},rebuild:c,release:()=>{r.size&&(r.forEach(((e,t)=>{for(const n of e)o.call(s(t),t,n)})),r.clear())}}}(t)}function En(e,t,n){return function(e,t){const n=Hn.rawDocument,o=t.Document,r=t.document,i=o.prototype.createElement,s=o.prototype.createTextNode,a=o.prototype.createComment,c=o.prototype.querySelector,l=o.prototype.querySelectorAll,u=o.prototype.getElementById,p=o.prototype.getElementsByClassName,h=o.prototype.getElementsByTagName,d=o.prototype.getElementsByName,m=o.prototype.elementFromPoint,f=o.prototype.caretRangeFromPoint;function _(e){return r!==e?e:n}function A(t){var n,o;if(!t||z(t)||r!==this){const e=_(this);return c.call(e,t)}return null!==(o=null===(n=Sn.get(e))||void 0===n?void 0:n.querySelector(t))&&void 0!==o?o:null}function w(t){var n,o;if(!t||z(t)||r!==this){const e=_(this);return l.call(e,t)}return null!==(o=null===(n=Sn.get(e))||void 0===n?void 0:n.querySelectorAll(t))&&void 0!==o?o:[]}o.prototype.caretRangeFromPoint=function(t,o){const r=m.call(n,t,o),i=f.call(n,t,o);return fn(r,e),i},o.prototype.createElement=function(t,n){return fn(i.call(this,t,n),e)},o.prototype.createTextNode=function(t){return fn(s.call(this,t),e)},o.prototype.createComment=function(t){return fn(a.call(this,t),e)},o.prototype.querySelector=A,o.prototype.querySelectorAll=w,o.prototype.getElementById=function(e){const t=_(this);if(Q(e))return u.call(t,e);try{return A.call(this,`#${e}`)}catch(n){return u.call(t,e)}},o.prototype.getElementsByClassName=function(e){const t=_(this);if(Q(e))return p.call(t,e);try{return w.call(this,`.${e}`)}catch(n){return p.call(t,e)}},o.prototype.getElementsByTagName=function(e){const t=_(this);if(z(e)||Q(e))return h.call(t,e);if(/^script|base$/i.test(e))return h.call(r,e);try{return w.call(this,e)}catch(n){return h.call(t,e)}},o.prototype.getElementsByName=function(e){const t=_(this);if(Q(e))return d.call(t,e);try{return w.call(this,`[name=${e}]`)}catch(n){return d.call(t,e)}}}(e,t),function(e,t,n){const o=Hn.rawDocument,r=t.Document,i=t.document,c=(e,t)=>{const{enumerable:n}=Object.getOwnPropertyDescriptor(r.prototype,e)||{enumerable:!0};return{configurable:!0,enumerable:n,get:t}},l=()=>{const t={};return[["documentURI",()=>n.proxyLocation.href],["URL",()=>n.proxyLocation.href],["documentElement",()=>o.documentElement],["scrollingElement",()=>o.scrollingElement],["forms",()=>r.prototype.querySelectorAll.call(i,"form")],["images",()=>r.prototype.querySelectorAll.call(i,"img")],["links",()=>r.prototype.querySelectorAll.call(i,"a")],["microAppElement",()=>{var t;return null===(t=Sn.get(e))||void 0===t?void 0:t.container}],["__MICRO_APP_NAME__",()=>e]].forEach((e=>{t[e[0]]=c(e[0],e[1])})),Zt.forEach((e=>{t[e]=c(e,(()=>o[e]))})),en.forEach((e=>{t[e]=c(e,(()=>wt(o[e],o,"DOCUMENT")))})),tn.forEach((e=>{t[e]=c(e,(()=>o[e]))})),nn.forEach((e=>{t[e]=c(e,(()=>wt(o[e],o,"DOCUMENT")))})),t};a(r.prototype,l()),Yt.forEach((t=>{s(i,t,{enumerable:!0,configurable:!0,get:()=>($(e),o[t]),set:e=>{o[t]=e}})}))}(e,t,n),function(e,t){const{rawDocument:n,rawAddEventListener:o,rawRemoveEventListener:r}=Hn,i=new Map,a=new Map;let c=null,l=null;const u=t.Document,p=t.document;function h(e,t){return We.includes(e)?t:n}function d(e){return"onclick"===e?e=>{_(c)&&r.call(n,"click",c,!1),_(e)?(c=e.bind(p),o.call(n,"click",c,!1)):c=e}:t=>{n[e]=_(t)?t.bind(p):t}}u.prototype.addEventListener=function(e,t,n){const r=_(t)?t.__MICRO_APP_BOUND_FUNCTION__=t.__MICRO_APP_BOUND_FUNCTION__||t.bind(this):t,s=i.get(e);s?s.add(t):i.set(e,new Set([t])),t&&(t.__MICRO_APP_MARK_OPTIONS__=n),o.call(h(e,this),e,r,n)},u.prototype.removeEventListener=function(e,t,n){const o=i.get(e);(null==o?void 0:o.size)&&o.has(t)&&o.delete(t);const s=(null==t?void 0:t.__MICRO_APP_BOUND_FUNCTION__)||t;r.call(h(e,this),e,s,n)},Object.getOwnPropertyNames(u.prototype).filter((e=>/^on/.test(e)&&!Be.includes(e))).forEach((t=>{const{enumerable:o,writable:r,set:i}=Object.getOwnPropertyDescriptor(u.prototype,t)||{enumerable:!0,writable:!0};try{s(u.prototype,t,{enumerable:o,configurable:!0,get:()=>"onclick"===t?c:n[t],set:(null!=r?r:i)?d(t):void 0})}catch(t){N(t,e)}}));const m=()=>{a.clear(),l=null},f=()=>{l&&!c&&(p.onclick=l),a.forEach(((e,t)=>{for(const n of e)p.addEventListener(t,n,null==n?void 0:n.__MICRO_APP_MARK_OPTIONS__)})),m()};return{reset:m,record:()=>{l=c||l,i.forEach(((e,t)=>{if(e.size){const n=a.get(t)||[];a.set(t,new Set([...n,...e]))}}))},rebuild:f,release:()=>{_(c)&&r.call(n,"click",c),c=null,i.size&&(i.forEach(((e,t)=>{for(const n of e)r.call(h(t,p),t,(null==n?void 0:n.__MICRO_APP_BOUND_FUNCTION__)||n)})),i.clear())}}}(e,t)}function Pn(e,t,n,o){!function(e,t,n){const o=Hn.rawRootElement,r=Hn.rawDocument,i=t.document,a=t.Node,c=t.Element,l=a.prototype.appendChild,p=a.prototype.insertBefore,h=a.prototype.replaceChild,d=a.prototype.removeChild,m=c.prototype.append,f=c.prototype.prepend,_=c.prototype.insertAdjacentElement,A=a.prototype.cloneNode,w=Object.getOwnPropertyDescriptor(c.prototype,"innerHTML"),y=Object.getOwnPropertyDescriptor(a.prototype,"parentNode"),g=Object.getOwnPropertyDescriptor(a.prototype,"ownerDocument"),b=e=>(S(e)||function(e){return"[object HTMLBaseElement]"===u(e)}(e))&&e.__PURE_ELEMENT__,P=e=>e===n.microHead?r.head:e===n.microBody?r.body:e;a.prototype.getRootNode=function(){return i},a.prototype.appendChild=function(t){return fn(t,e),b(t)?l.call(this,t):o.prototype.appendChild.call(P(this),t)},a.prototype.insertBefore=function(t,n){return fn(t,e),b(t)?p.call(this,t,n):o.prototype.insertBefore.call(P(this),t,n)},a.prototype.replaceChild=function(t,n){return fn(t,e),b(t)?h.call(this,t,n):o.prototype.replaceChild.call(P(this),t,n)},a.prototype.removeChild=function(e){return b(e)||this.contains(e)?d.call(this,e):o.prototype.removeChild.call(P(this),e)},c.prototype.append=function(...e){let t=0,n=!1;for(;t<e.length;)e[t]=E(e[t])?e[t]:i.createTextNode(e[t]),b(e[t])&&(n=!0),t++;return n?m.call(this,...e):o.prototype.append.call(P(this),...e)},c.prototype.prepend=function(...e){let t=0,n=!1;for(;t<e.length;)e[t]=E(e[t])?e[t]:i.createTextNode(e[t]),b(e[t])&&(n=!0),t++;return n?f.call(this,...e):o.prototype.prepend.call(P(this),...e)},c.prototype.insertAdjacentElement=function(t,n){return fn(n,e),b(n)?_.call(this,t,n):o.prototype.insertAdjacentElement.call(P(this),t,n)},a.prototype.cloneNode=function(t){return fn(A.call(this,t),e)},s(a.prototype,"ownerDocument",{configurable:!0,enumerable:!0,get(){return this.__PURE_ELEMENT__?g.get.call(this):i}}),s(c.prototype,"innerHTML",{configurable:!0,enumerable:!0,get(){return w.get.call(this)},set(t){w.set.call(this,t),Array.from(this.children).forEach((t=>{v(t)&&fn(t,e)}))}}),s(a.prototype,"parentNode",{configurable:!0,enumerable:!0,get:_n(e,y)});const R=new Proxy(t.Image,{construct(t,n){const o=new t(...n);return fn(o,e),o}});s(t,"Image",{configurable:!0,writable:!0,value:R})}(e,n,o),function(e,t){const n=t.Element,o=n.prototype.setAttribute;n.prototype.setAttribute=function(t,n){(("src"===t||"srcset"===t)&&/^(img|script)$/i.test(this.tagName)||"href"===t&&/^link$/i.test(this.tagName))&&(n=U(n,e)),o.call(this,t,n)};const r=[[t.HTMLImageElement.prototype,"src"],[t.HTMLScriptElement.prototype,"src"],[t.HTMLLinkElement.prototype,"href"]];r.forEach((([t,n])=>{const{enumerable:o,configurable:r,get:i,set:a}=Object.getOwnPropertyDescriptor(t,n)||{enumerable:!0,configurable:!0};s(t,n,{enumerable:o,configurable:r,get:function(){return null==i?void 0:i.call(this)},set:function(t){null==a||a.call(this,U(t,e))}})}))}(t,n)}bn.activeCount=0;class Rn{constructor(e,t){this.active=!1,this.escapeProperties=[],this.escapeKeys=new Set,this.updateIframeBase=()=>{var e;null===(e=this.baseElement)||void 0===e||e.setAttribute("href",this.proxyLocation.protocol+"//"+this.proxyLocation.host+this.proxyLocation.pathname)};const n=Hn.rawWindow.location,o=n.protocol+"//"+n.host;this.deleteIframeElement=this.createIframeElement(e,o),this.microAppWindow=this.iframe.contentWindow,this.patchIframe(this.microAppWindow,(n=>{this.createIframeTemplate(this.microAppWindow),this.getSpecialProperties(e),this.proxyLocation=function(e,t,n,o){const r=new URL(t),s=r.protocol+"//"+r.host,a=r.pathname+r.search+r.hash,c=n.history;return n.rawReplaceState=c.replaceState,i(c,kt(e,n.location)),cn(e,a,n.location,"prevent"),sn(e,t,n,r,o,s)}(e,t,this.microAppWindow,o),this.windowEffect=vn(e,this.microAppWindow,this),this.documentEffect=En(e,this.microAppWindow,this),Pn(e,t,this.microAppWindow,this),this.initStaticGlobalKeys(e,t,this.microAppWindow),n()}))}createIframeElement(e,t){this.iframe=q("iframe");const n={src:t,style:"display: none",id:e};return Object.keys(n).forEach((e=>this.iframe.setAttribute(e,n[e]))),Hn.rawDocument.body.appendChild(this.iframe),()=>O((()=>{var e,t;null===(t=null===(e=this.iframe)||void 0===e?void 0:e.parentNode)||void 0===t||t.removeChild(this.iframe),this.iframe=null}))}start({baseroute:e,defaultPage:t,disablePatchRequest:n}){this.active||(this.active=!0,this.initRouteState(t),this.removeHistoryListener=Ut(this.microAppWindow.__MICRO_APP_NAME__),Lt(this.microAppWindow.__MICRO_APP_NAME__)&&(this.microAppWindow.__MICRO_APP_BASE_ROUTE__=this.microAppWindow.__MICRO_APP_BASE_URL__=e),n||this.createIframeBase(),1==++Hn.activeSandbox&&(Un(),Kt()),++Rn.activeCount)}stop({umdMode:e,keepRouteState:t,destroy:n,clearData:o}){var r;this.active&&(this.recordAndReleaseEffect({clearData:o},!e||n),this.clearRouteState(t),null===(r=this.removeHistoryListener)||void 0===r||r.call(this),e&&!n||(this.deleteIframeElement(),this.escapeKeys.forEach((e=>{Reflect.deleteProperty(Hn.rawWindow,e)})),this.escapeKeys.clear()),0==--Hn.activeSandbox&&(Bn(),qt()),--Rn.activeCount,this.active=!1)}initStaticGlobalKeys(e,t,n){n.__MICRO_APP_ENVIRONMENT__=!0,n.__MICRO_APP_NAME__=e,n.__MICRO_APP_URL__=t,n.__MICRO_APP_PUBLIC_PATH__=T(t),n.__MICRO_APP_BASE_ROUTE__="",n.__MICRO_APP_WINDOW__=n,n.__MICRO_APP_PRE_RENDER__=!1,n.__MICRO_APP_UMD_MODE__=!1,n.__MICRO_APP_PROXY_WINDOW__=this.proxyWindow,n.__MICRO_APP_SANDBOX__=this,n.__MICRO_APP_SANDBOX_TYPE__="iframe",n.rawWindow=Hn.rawWindow,n.rawDocument=Hn.rawDocument,n.microApp=i(new ut(e),{removeDomScope:K,pureCreateElement:q,location:this.proxyLocation,router:Gt})}recordAndReleaseEffect(e,t=!1){t?this.resetEffectSnapshot():this.recordEffectSnapshot(),this.releaseGlobalEffect(e)}resetEffectSnapshot(){var e,t;null===(e=this.windowEffect)||void 0===e||e.reset(),null===(t=this.documentEffect)||void 0===t||t.reset(),dt(this.microAppWindow.microApp)}recordEffectSnapshot(){var e,t;null===(e=this.windowEffect)||void 0===e||e.record(),null===(t=this.documentEffect)||void 0===t||t.record(),pt(this.microAppWindow.microApp)}rebuildEffectSnapshot(){var e,t;null===(e=this.windowEffect)||void 0===e||e.rebuild(),null===(t=this.documentEffect)||void 0===t||t.rebuild(),ht(this.microAppWindow.microApp)}releaseGlobalEffect({clearData:e=!1}){var t,n,o,r,i;null===(t=this.windowEffect)||void 0===t||t.release(),null===(n=this.documentEffect)||void 0===n||n.release(),null===(o=this.microAppWindow.microApp)||void 0===o||o.clearDataListener(),null===(r=this.microAppWindow.microApp)||void 0===r||r.clearGlobalDataListener(),e&&(Zn.clearData(this.microAppWindow.__MICRO_APP_NAME__),null===(i=this.microAppWindow.microApp)||void 0===i||i.clearData())}setPreRenderState(e){this.microAppWindow.__MICRO_APP_PRE_RENDER__=e}markUmdMode(e){this.microAppWindow.__MICRO_APP_UMD_MODE__=e}patchIframe(e,t){const n=e.document;this.sandboxReady=new Promise((o=>{!function r(){setTimeout((()=>{try{e.document===n?r():(e.stop(),t(o))}catch(e){r()}}),0)}()}))}createIframeTemplate(e){const t=e.document;!function(e){for(;null==e?void 0:e.firstChild;)e.removeChild(e.firstChild)}(t);const n=t.createElement("html");n.innerHTML="<head></head><body></body>",t.appendChild(n),this.microBody=t.body,this.microHead=t.head}createIframeBase(){this.baseElement=q("base"),this.updateIframeBase(),this.microHead.appendChild(this.baseElement)}getSpecialProperties(e){var t;A(Zn.options.plugins)&&(this.commonActionForSpecialProperties(Zn.options.plugins.global),this.commonActionForSpecialProperties(null===(t=Zn.options.plugins.modules)||void 0===t?void 0:t[e]))}commonActionForSpecialProperties(e){if(r(e))for(const t of e)A(t)&&r(t.escapeProperties)&&(this.escapeProperties=this.escapeProperties.concat(t.escapeProperties))}initRouteState(e){ln(this.microAppWindow.__MICRO_APP_NAME__,this.microAppWindow.location,e)}clearRouteState(e){pn(this.microAppWindow.__MICRO_APP_NAME__,this.microAppWindow.__MICRO_APP_URL__,this.microAppWindow.location,e)}setRouteInfoForKeepAliveApp(){un(this.microAppWindow.__MICRO_APP_NAME__,this.microAppWindow.location)}removeRouteInfoForKeepAliveApp(){hn(this.microAppWindow.__MICRO_APP_NAME__)}patchStaticElement(e){mn(e,this.microAppWindow.__MICRO_APP_NAME__)}actionBeforeExecScripts(e){this.patchStaticElement(e)}setStaticAppState(e){this.microAppWindow.__MICRO_APP_STATE__=e}}Rn.activeCount=0;const Sn=new Map;class Mn{constructor({name:e,url:t,container:n,scopecss:o,useSandbox:r,inline:i,iframe:s,ssrUrl:a,isPrefetch:c,prefetchLevel:l,routerMode:u}){this.state=ve.CREATED,this.keepAliveState=null,this.loadSourceLevel=0,this.umdHookMount=null,this.umdHookUnmount=null,this.lifeCycleState=null,this.umdMode=!1,this.sandBox=null,this.fiber=!1,Sn.set(e,this),this.name=e,this.url=t,this.useSandbox=r,this.scopecss=this.useSandbox&&o,this.iframe=null!=s&&s,this.inline=this.getInlineModeState(i),this.routerMode=u||Ie,this.container=null!=n?n:null,this.ssrUrl=null!=a?a:"",this.isPrefetch=null!=c&&c,this.isPrerender=3===l,this.prefetchLevel=l,this.source={html:null,links:new Set,scripts:new Set},this.loadSourceCode(),this.createSandbox()}loadSourceCode(){this.setAppState(ve.LOADING),le.getInstance().run(this,it)}onLoad(e,t,n,o,r){var i;if(2==++this.loadSourceLevel)if(this.source.html=e,this.isPrefetch||this.isUnmounted()){if(this.isPrerender){const e=q("div");e.setAttribute("prerender","true"),null===(i=this.sandBox)||void 0===i||i.setPreRenderState(!0),this.mount({container:e,inline:this.inline,routerMode:o,baseroute:r||"",fiber:!0,defaultPage:t||"",disablePatchRequest:null!=n&&n})}}else X(this.container).mount(this)}onLoadError(e){this.loadSourceLevel=-1,this.isUnmounted()||(this.onerror(e),this.setAppState(ve.LOAD_FAILED))}mount({container:e,inline:t,routerMode:n,defaultPage:o,baseroute:r,disablePatchRequest:i,fiber:s}){if(2!==this.loadSourceLevel)return this.container=e,this.isPrerender=!1,ae(this,"statechange",{appState:ve.LOADING}),this.setAppState(ve.LOADING);this.createSandbox(),this.setAppState(ve.BEFORE_MOUNT);const a=()=>{var a,c,l,h,m,f,A,w;if(this.isPrerender&&(w=this.container,"[object HTMLDivElement]"===u(w))&&this.container.hasAttribute("prerender"))null===(a=this.sandBox)||void 0===a||a.rebuildEffectSnapshot(),G(e,this.container,!1),this.container=e,null===(c=this.preRenderEvents)||void 0===c||c.forEach((e=>e())),this.isPrerender=!1,this.preRenderEvents=null,Gt.attachToURL(this.name),null===(l=this.sandBox)||void 0===l||l.setPreRenderState(!1);else{this.container=e,this.inline=this.getInlineModeState(t),this.fiber=s,this.routerMode=n;const a=()=>{this.setLifeCycleState(Ee.BEFOREMOUNT),se(this.container,this.name,Ee.BEFOREMOUNT)};if(this.isPrerender?(null!==(h=this.preRenderEvents)&&void 0!==h?h:this.preRenderEvents=[]).push(a):a(),this.setAppState(ve.MOUNTING),ae(this,"statechange",{appState:ve.MOUNTING}),G(this.container,this.source.html,!this.umdMode),null===(m=this.sandBox)||void 0===m||m.start({umdMode:this.umdMode,baseroute:r,defaultPage:o,disablePatchRequest:i}),this.umdMode){null===(A=this.sandBox)||void 0===A||A.rebuildEffectSnapshot();try{this.handleMounted(this.umdHookMount(Zn.getData(this.name,!0)))}catch(e){C("An error occurred in window.mount \n",this.name,e)}}else null===(f=this.sandBox)||void 0===f||f.actionBeforeExecScripts(this.container),function(e,t){const n=e.fiber?[]:null,o=Array.from(e.source.scripts),r=[],i=[];for(const s of o){const o=Me.script.getInfo(s),a=o.appSpace[e.name];a.defer||a.async?(!o.isExternal||o.code||je(e,o)?r.push(o.code):r.push(ce(s,e.name)),i.push([s,o]),je(e,o)&&(t.moduleCount=t.moduleCount?++t.moduleCount:1)):ne(n,(()=>{tt(s,e,o),t(!1)}))}r.length?W(r,(e=>{const t=i[e.index][1];t.code=t.code||e.data}),(n=>{t.errorCount=t.errorCount?++t.errorCount:1,C(n,e.name)}),(()=>{i.forEach((([o,r])=>{d(r.code)&&ne(n,(()=>{tt(o,e,r,t),!je(e,r)&&t(!1)}))})),n?(n.push((()=>Promise.resolve(t(p(t.moduleCount)||t.errorCount===r.length)))),oe(n)):t(p(t.moduleCount)||t.errorCount===r.length)})):n?(n.push((()=>Promise.resolve(t(!0)))),oe(n)):t(!0)}(this,(e=>{if(!this.umdMode){const{mount:t,unmount:n}=this.getUmdLibraryHooks();if(this.umdHookUnmount=n,_(t)&&_(n)){this.umdHookMount=t,this.sandBox.markUmdMode(this.umdMode=!0);try{this.handleMounted(this.umdHookMount(Zn.getData(this.name,!0)))}catch(e){C("An error occurred in window.mount \n",this.name,e)}}else!0===e&&this.handleMounted()}}))}};this.sandBox?this.sandBox.sandboxReady.then(a):a()}handleMounted(e){var t,n;const o=()=>{y(e)?e.then((()=>this.dispatchMountedEvent())).catch((e=>{C("An error occurred in window.mount \n",this.name,e),this.dispatchMountedEvent()})):this.dispatchMountedEvent()};this.isPrerender?(null===(t=this.preRenderEvents)||void 0===t||t.push(o),null===(n=this.sandBox)||void 0===n||n.recordAndReleaseEffect({isPrerender:!0})):o()}dispatchMountedEvent(){var e;this.isUnmounted()||(this.setAppState(ve.MOUNTED),ie(this.getMicroAppGlobalHook(Pe.ONMOUNT),this.name,Pe.ONMOUNT,Zn.getData(this.name,!0)),ae(this,"statechange",{appState:ve.MOUNTED}),ae(this,"mounted"),this.setLifeCycleState(Ee.MOUNTED),se(this.container,this.name,Ee.MOUNTED),this.isHidden()&&(null===(e=this.sandBox)||void 0===e||e.recordAndReleaseEffect({keepAlive:!0})))}unmount({destroy:e,clearData:t,keepRouteState:n,unmountcb:o}){var r;e=e||this.state===ve.LOAD_FAILED,this.setAppState(ve.UNMOUNT);let i=null;try{i=null===(r=this.umdHookUnmount)||void 0===r?void 0:r.call(this,Zn.getData(this.name,!0))}catch(e){C("An error occurred in window.unmount \n",this.name,e)}ae(this,"statechange",{appState:ve.UNMOUNT}),ae(this,"unmount"),ie(this.getMicroAppGlobalHook(Pe.ONUNMOUNT),this.name,Pe.ONUNMOUNT),this.handleUnmounted({destroy:e,clearData:t,keepRouteState:n,unmountcb:o,umdHookUnmountResult:i})}handleUnmounted({destroy:e,clearData:t,keepRouteState:n,unmountcb:o,umdHookUnmountResult:r}){const i=()=>this.actionsForUnmount({destroy:e,clearData:t,keepRouteState:n,unmountcb:o});y(r)?(K(),r.then(i).catch(i)):i()}actionsForUnmount({destroy:e,clearData:t,keepRouteState:n,unmountcb:o}){var r;this.umdMode&&this.container&&!e&&G(this.source.html,this.container,!1),null===(r=this.sandBox)||void 0===r||r.stop({umdMode:this.umdMode,keepRouteState:n&&!e,destroy:e,clearData:t||e}),this.setLifeCycleState(Ee.UNMOUNT),se(this.container,this.name,Ee.UNMOUNT),this.clearOptions(e),null==o||o()}clearOptions(e){this.container.innerHTML="",this.container=null,this.isPrerender=!1,this.preRenderEvents=null,this.setKeepAliveState(null),this.iframe&&!this.umdMode&&(this.sandBox=null),e&&this.actionsForCompletelyDestroy(),K()}actionsForCompletelyDestroy(){var e,t;null===(t=null===(e=this.sandBox)||void 0===e?void 0:e.deleteIframeElement)||void 0===t||t.call(e),Me.script.deleteInlineInfo(this.source.scripts),Sn.delete(this.name)}hiddenKeepAliveApp(e){var t,n;this.setKeepAliveState(Re.KEEP_ALIVE_HIDDEN),ae(this,"appstate-change",{appState:"afterhidden"}),this.setLifeCycleState(Ee.AFTERHIDDEN),se(this.container,this.name,Ee.AFTERHIDDEN),this.routerMode!==xe&&(null===(t=this.sandBox)||void 0===t||t.removeRouteInfoForKeepAliveApp()),2!==this.loadSourceLevel?X(this.container).unmount():(this.container=G(q("div"),this.container,!1),null===(n=this.sandBox)||void 0===n||n.recordAndReleaseEffect({keepAlive:!0})),null==e||e()}showKeepAliveApp(e){var t,n;null===(t=this.sandBox)||void 0===t||t.rebuildEffectSnapshot(),ae(this,"appstate-change",{appState:"beforeshow"}),se(e,this.name,Ee.BEFORESHOW),this.setKeepAliveState(Re.KEEP_ALIVE_SHOW),this.container=G(e,this.container,!1),this.routerMode!==xe&&(null===(n=this.sandBox)||void 0===n||n.setRouteInfoForKeepAliveApp()),ae(this,"appstate-change",{appState:"aftershow"}),this.setLifeCycleState(Ee.AFTERSHOW),se(this.container,this.name,Ee.AFTERSHOW)}onerror(e){this.setLifeCycleState(Ee.ERROR),ae(this,"statechange",{appState:ve.LOAD_FAILED}),se(this.container,this.name,Ee.ERROR,e)}createSandbox(){this.useSandbox&&!this.sandBox&&(this.iframe?this.sandBox=new Rn(this.name,this.url):this.sandBox=new bn(this.name,this.url))}setAppState(e){var t;this.state=e,null===(t=this.sandBox)||void 0===t||t.setStaticAppState(e)}getAppState(){return this.state}setLifeCycleState(e){this.lifeCycleState=e}getLifeCycleState(){return this.lifeCycleState||""}setKeepAliveState(e){this.keepAliveState=e}getKeepAliveState(){return this.keepAliveState}isUnmounted(){return ve.UNMOUNT===this.state}isHidden(){return Re.KEEP_ALIVE_HIDDEN===this.keepAliveState}getUmdLibraryHooks(){if(!this.isUnmounted()&&this.sandBox){const e=X(this.container).getAttribute("library")||`micro-app-${this.name}`,t=this.sandBox.proxyWindow;return w(t[e])?t[e]:{mount:t.mount,unmount:t.unmount}}return{}}getMicroAppGlobalHook(e){var t,n;const o=null===(n=null===(t=this.sandBox)||void 0===t?void 0:t.proxyWindow)||void 0===n?void 0:n[e];return _(o)?o:null}querySelector(e){return this.container?Hn.rawElementQuerySelector.call(this.container,e):null}querySelectorAll(e){return this.container?Hn.rawElementQuerySelectorAll.call(this.container,e):[]}getInlineModeState(e){var t;return null!==(t=this.iframe||e)&&void 0!==t&&t}}function Cn(e){var t,n;return null!==(n=null===(t=Sn.get(e))||void 0===t?void 0:t.iframe)&&void 0!==n&&n}const Nn=new WeakMap;function On(e){var t;return null!==(t=Nn.get(e))&&void 0!==t?t:e}function Dn(e,t){if(Nn.has(e))return Nn.get(e);if(R(e)){if(e.hasAttribute("exclude")){const t=document.createComment("style element with exclude attribute ignored by micro-app");return Nn.set(e,t),t}return t.scopecss&&!e.hasAttribute("ignore")?_e(e,t):e}if(P(e)){if(e.hasAttribute("exclude")||Je(e.getAttribute("href"),t.name)){const t=document.createComment("link element with exclude attribute ignored by micro-app");return Nn.set(e,t),t}if(e.hasAttribute("ignore")||Ze(e.getAttribute("href"),t.name)||e.href&&_(Zn.options.excludeAssetFilter)&&Zn.options.excludeAssetFilter(e.href))return e;const{address:n,linkInfo:o,replaceComment:r}=Ce(e,null,t,!0);if(n&&o){const r=function(e,t,n,o){const r=q("style"),i=()=>{Oe(t,e,r,n,n.appSpace[t.name].attrs),ye(o)};return n.code?O(i):ce(e,t.name).then((e=>{n.code=e,i()})).catch((e=>{C(e,t.name),ge(o)})),r}(n,t,o,e);return Nn.set(e,r),r}return r?(Nn.set(e,r),r):e}if(S(e)){if(e.src&&_(Zn.options.excludeAssetFilter)&&Zn.options.excludeAssetFilter(e.src))return e;const{replaceComment:n,address:o,scriptInfo:r}=Ve(e,null,t,!0)||{};if(o&&r){const n=r.isExternal?function(e,t,n,o){const r=Ke(t,n)?q("script"):document.createComment("dynamic script extract by micro-app"),i=()=>ye(o),s=()=>{const s=Object.getOwnPropertyDescriptor(Hn.rawDocument,"currentScript");s&&!s.configurable||Object.defineProperty(Hn.rawDocument,"currentScript",{value:o,configurable:!0}),tt(e,t,n,i,r),!je(t,n)&&i()};return n.code||je(t,n)?O(s):ce(e,t.name).then((e=>{n.code=e,s()})).catch((e=>{C(e,t.name),ge(o)})),r}(o,t,r,e):function(e,t,n){const o=Ke(t,n)?q("script"):document.createComment("dynamic script extract by micro-app");return tt(e,t,n,void 0,o),o}(o,t,r);return Nn.set(e,n),n}return n?(Nn.set(e,n),n):e}return e}function In(e,t,n,o,r){const i=xn(n,o,e);if(i){if(!Cn(e.name)&&M(i)&&t!==Hn.rawRemoveChild){const t=Object.getOwnPropertyDescriptor(o,"parentNode");t&&!t.configurable||o.__MICRO_APP_HAS_DPN__||a(o,{parentNode:{configurable:!0,get(){var t,n;const o=Hn.rawParentNodeDesc.get.call(this);return M(o)&&e.container?(null===(n=(t=Zn.options).getRootElementParentNode)||void 0===n?void 0:n.call(t,this,e.name))||document.body:o}},__MICRO_APP_HAS_DPN__:{configurable:!0,get:()=>!0}})}return r&&!i.contains(r)?Hn.rawAppendChild.call(i,o):t!==Hn.rawRemoveChild||i.contains(o)?Ln(t,i,o,r):n.contains(o)?t.call(n,o):o}return Ln(t,n,o,r)}function xn(e,t,n){if(n){if(e===document.head)return n.iframe&&S(t)?n.sandBox.microHead:n.querySelector("micro-app-head");if(e===document.body||e===document.body.parentNode)return n.iframe&&S(t)?n.sandBox.microBody:n.querySelector("micro-app-body");if(n.iframe&&S(t))return n.sandBox.microBody}return null}function Ln(e,t,n,o){return(r=e)===Hn.rawAppend||r===Hn.rawPrepend?e.call(t,n):e.call(t,n,o);var r}function Tn(e,t,n,o){const r=j();if(E(t)&&!t.__PURE_ELEMENT__&&(t.__MICRO_APP_NAME__||r)){t.__MICRO_APP_NAME__=t.__MICRO_APP_NAME__||r;const i=Sn.get(t.__MICRO_APP_NAME__);if(null==i?void 0:i.container)return function(e,t){v(t)&&(/^(img|script)$/i.test(t.tagName)?(t.hasAttribute("src")&&Hn.rawSetAttribute.call(t,"src",U(t.getAttribute("src"),e.url)),t.hasAttribute("srcset")&&Hn.rawSetAttribute.call(t,"srcset",U(t.getAttribute("srcset"),e.url))):/^link$/i.test(t.tagName)&&t.hasAttribute("href")&&Hn.rawSetAttribute.call(t,"href",U(t.getAttribute("href"),e.url)))}(i,t),In(i,o,e,Dn(t,i),n&&On(n))}return o===Hn.rawAppend||o===Hn.rawPrepend?o.call(e,t):o.call(e,t,n)}function Un(){!function(){const e=Hn.rawDocument,t=Hn.rawRootDocument;function n(t){return function(e){return"[object ProxyDocument]"===u(e)}(t)?e:t}function o(t){var o,r;const i=n(this),s=j();return s&&t&&!z(t)&&e===i?null!==(r=null===(o=Sn.get(s))||void 0===o?void 0:o.querySelector(t))&&void 0!==r?r:null:Hn.rawQuerySelector.call(i,t)}function r(t){var o,r;const i=n(this),s=j();return s&&t&&!z(t)&&e===i?null!==(r=null===(o=Sn.get(s))||void 0===o?void 0:o.querySelectorAll(t))&&void 0!==r?r:[]:Hn.rawQuerySelectorAll.call(i,t)}t.prototype.createElement=function(e,t){return Wn(Hn.rawCreateElement.call(n(this),e,t))},t.prototype.createElementNS=function(e,t,o){return Wn(Hn.rawCreateElementNS.call(n(this),e,t,o))},t.prototype.createDocumentFragment=function(){return Wn(Hn.rawCreateDocumentFragment.call(n(this)))},t.prototype.createComment=function(e){return Wn(Hn.rawCreateComment.call(n(this),e))},t.prototype.querySelector=o,t.prototype.querySelectorAll=r,t.prototype.getElementById=function(e){const t=n(this);if(!j()||Q(e))return Hn.rawGetElementById.call(t,e);try{return o.call(t,`#${e}`)}catch(n){return Hn.rawGetElementById.call(t,e)}},t.prototype.getElementsByClassName=function(e){const t=n(this);if(!j()||Q(e))return Hn.rawGetElementsByClassName.call(t,e);try{return r.call(t,`.${e}`)}catch(n){return Hn.rawGetElementsByClassName.call(t,e)}},t.prototype.getElementsByTagName=function(e){var t;const o=n(this),i=j();if(!i||z(e)||Q(e)||!(null===(t=Sn.get(i))||void 0===t?void 0:t.inline)&&/^script$/i.test(e))return Hn.rawGetElementsByTagName.call(o,e);try{return r.call(o,e)}catch(t){return Hn.rawGetElementsByTagName.call(o,e)}},t.prototype.getElementsByName=function(e){const t=n(this);if(!j()||Q(e))return Hn.rawGetElementsByName.call(t,e);try{return r.call(t,`[name=${e}]`)}catch(n){return Hn.rawGetElementsByName.call(t,e)}}}();const e=Hn.rawRootElement,t=Hn.rawRootNode;function n(e){const t=j();if((e===document.body||e===document.head)&&t){const n=Sn.get(t);if(null==n?void 0:n.container){if(e===document.body)return n.querySelector("micro-app-body");if(e===document.head)return n.querySelector("micro-app-head")}}return null}e.prototype.appendChild=function(e){return Tn(this,e,null,Hn.rawAppendChild)},e.prototype.insertBefore=function(e,t){return Tn(this,e,t,Hn.rawInsertBefore)},e.prototype.replaceChild=function(e,t){return Tn(this,e,t,Hn.rawReplaceChild)},e.prototype.append=function(...e){let t=0;for(;t<e.length;){let n=e[t];n=E(n)?n:Hn.rawCreateTextNode.call(Hn.rawDocument,n),Tn(this,Wn(n),null,Hn.rawAppend),t++}},e.prototype.prepend=function(...e){let t=e.length;for(;t>0;){let n=e[t-1];n=E(n)?n:Hn.rawCreateTextNode.call(Hn.rawDocument,n),Tn(this,Wn(n),null,Hn.rawPrepend),t--}},e.prototype.removeChild=function(e){if(null==e?void 0:e.__MICRO_APP_NAME__){const t=Sn.get(e.__MICRO_APP_NAME__);if(null==t?void 0:t.container)return In(t,Hn.rawRemoveChild,this,On(e));try{return Hn.rawRemoveChild.call(this,e)}catch(t){return(null==e?void 0:e.parentNode)&&Hn.rawRemoveChild.call(e.parentNode,e)}}return Hn.rawRemoveChild.call(this,e)},e.prototype.insertAdjacentElement=function(e,t){var n;if((null==t?void 0:t.__MICRO_APP_NAME__)&&v(t)){const o=Sn.get(t.__MICRO_APP_NAME__);if(null==o?void 0:o.container){const r=Dn(t,o);if(!v(r))return t;const i=null!==(n=xn(this,r,o))&&void 0!==n?n:this;return Hn.rawInsertAdjacentElement.call(i,e,r)}}return Hn.rawInsertAdjacentElement.call(this,e,t)},e.prototype.cloneNode=function(e){const t=Hn.rawCloneNode.call(this,e);return this.__MICRO_APP_NAME__&&(t.__MICRO_APP_NAME__=this.__MICRO_APP_NAME__),t},e.prototype.querySelector=function(e){var t;const o=null!==(t=n(this))&&void 0!==t?t:this;return Hn.rawElementQuerySelector.call(o,e)},e.prototype.querySelectorAll=function(e){var t;const o=null!==(t=n(this))&&void 0!==t?t:this;return Hn.rawElementQuerySelectorAll.call(o,e)},e.prototype.setAttribute=function(e,t){const n=this.__MICRO_APP_NAME__||j();if(n&&Sn.has(n)&&(("src"===e||"srcset"===e)&&/^(img|script|video|audio|source|embed)$/i.test(this.tagName)||"href"===e&&/^link$/i.test(this.tagName))){t=U(t,Sn.get(n).url)}Hn.rawSetAttribute.call(this,e,t)},s(e.prototype,"innerHTML",{configurable:!0,enumerable:!0,get(){return Hn.rawInnerHTMLDesc.get.call(this)},set(e){Hn.rawInnerHTMLDesc.set.call(this,e);const t=j();Array.from(this.children).forEach((e=>{v(e)&&t&&(e.__MICRO_APP_NAME__=t)}))}}),s(t.prototype,"parentNode",{configurable:!0,enumerable:!0,get(){var e,t,n;const o=j();if(o&&this===Hn.rawDocument.firstElementChild){const r=null===(n=null===(t=null===(e=Sn.get(o))||void 0===e?void 0:e.sandBox)||void 0===t?void 0:t.proxyWindow)||void 0===n?void 0:n.document;if(r)return r}return Hn.rawParentNodeDesc.get.call(this)}})}function Wn(e){const t=j();return t&&(e.__MICRO_APP_NAME__=t),e}function Bn(){K(),function(){const e=Hn.rawRootDocument;e.prototype.createElement=Hn.rawCreateElement,e.prototype.createElementNS=Hn.rawCreateElementNS,e.prototype.createDocumentFragment=Hn.rawCreateDocumentFragment,e.prototype.querySelector=Hn.rawQuerySelector,e.prototype.querySelectorAll=Hn.rawQuerySelectorAll,e.prototype.getElementById=Hn.rawGetElementById,e.prototype.getElementsByClassName=Hn.rawGetElementsByClassName,e.prototype.getElementsByTagName=Hn.rawGetElementsByTagName,e.prototype.getElementsByName=Hn.rawGetElementsByName}();const e=Hn.rawRootElement,t=Hn.rawRootNode;e.prototype.appendChild=Hn.rawAppendChild,e.prototype.insertBefore=Hn.rawInsertBefore,e.prototype.replaceChild=Hn.rawReplaceChild,e.prototype.removeChild=Hn.rawRemoveChild,e.prototype.append=Hn.rawAppend,e.prototype.prepend=Hn.rawPrepend,e.prototype.cloneNode=Hn.rawCloneNode,e.prototype.querySelector=Hn.rawElementQuerySelector,e.prototype.querySelectorAll=Hn.rawElementQuerySelectorAll,e.prototype.setAttribute=Hn.rawSetAttribute,s(e.prototype,"innerHTML",Hn.rawInnerHTMLDesc),s(t.prototype,"parentNode",Hn.rawParentNodeDesc)}let kn=!1;const Hn={activeSandbox:0};function Fn(){if(t){const e=window.rawWindow||Function("return window")(),t=window.rawDocument||Function("return document")(),n=e.Document||Function("return Document")(),o=e.Element,r=e.Node,s=e.EventTarget,a=o.prototype.setAttribute,c=o.prototype.appendChild,l=o.prototype.insertBefore,u=o.prototype.replaceChild,p=o.prototype.removeChild,h=o.prototype.append,d=o.prototype.prepend,m=o.prototype.cloneNode,f=o.prototype.querySelector,_=o.prototype.querySelectorAll,A=o.prototype.insertAdjacentElement,w=Object.getOwnPropertyDescriptor(o.prototype,"innerHTML"),y=Object.getOwnPropertyDescriptor(r.prototype,"parentNode"),g=n.prototype.createElement,b=n.prototype.createElementNS,v=n.prototype.createDocumentFragment,E=n.prototype.createTextNode,P=n.prototype.createComment,R=n.prototype.querySelector,S=n.prototype.querySelectorAll,M=n.prototype.getElementById,C=n.prototype.getElementsByClassName,N=n.prototype.getElementsByTagName,O=n.prototype.getElementsByName,D=new Proxy(Image,{construct(e,t){const n=new e(...t),o=j();return o&&(n.__MICRO_APP_NAME__=o),n}}),I=e.setInterval,x=e.setTimeout,L=e.clearInterval,T=e.clearTimeout,U=e.history.pushState,W=e.history.replaceState,B=s.prototype.addEventListener,k=s.prototype.removeEventListener,H=s.prototype.dispatchEvent;window.__MICRO_APP_BASE_APPLICATION__=!0,i(Hn,{supportModuleScript:"noModule"in document.createElement("script"),rawWindow:e,rawDocument:t,rawRootDocument:n,rawRootElement:o,rawRootNode:r,rawSetAttribute:a,rawAppendChild:c,rawInsertBefore:l,rawReplaceChild:u,rawRemoveChild:p,rawAppend:h,rawPrepend:d,rawCloneNode:m,rawElementQuerySelector:f,rawElementQuerySelectorAll:_,rawInsertAdjacentElement:A,rawInnerHTMLDesc:w,rawParentNodeDesc:y,rawCreateElement:g,rawCreateElementNS:b,rawCreateDocumentFragment:v,rawCreateTextNode:E,rawCreateComment:P,rawQuerySelector:R,rawQuerySelectorAll:S,rawGetElementById:M,rawGetElementsByClassName:C,rawGetElementsByTagName:N,rawGetElementsByName:O,ImageProxy:D,rawSetInterval:I,rawSetTimeout:x,rawClearInterval:L,rawClearTimeout:T,rawPushState:U,rawReplaceState:W,rawAddEventListener:B,rawRemoveEventListener:k,rawDispatchEvent:H}),function(){if(!kn){kn=!0;const e=q("style");Hn.rawSetAttribute.call(e,"type","text/css"),e.textContent=`\n${Zn.tagName}, micro-app-body { display: block; } \nmicro-app-head { display: none; }`,Hn.rawDocument.head.appendChild(e)}}()}}function $n(t){class n extends(function(){var e;return(null===(e=window.rawWindow)||void 0===e?void 0:e.HTMLElement)||window.HTMLElement}()){constructor(){super(...arguments),this.isWaiting=!1,this.cacheData=null,this.connectedCount=0,this.connectStateMap=new Map,this.appName="",this.appUrl="",this.ssrUrl="",this.version=e,this.handleAttributeUpdate=()=>{this.isWaiting=!1;const e=L(this.getAttribute("name")),t=x(this.getAttribute("url"),this.appName);if(this.legalAttribute("name",e)&&this.legalAttribute("url",t)){const n=Sn.get(e);if(e!==this.appName&&n&&!n.isUnmounted()&&!n.isHidden()&&!n.isPrefetch)return this.setAttribute("name",this.appName),C(`app name conflict, an app named ${e} is running`);e===this.appName&&t===this.appUrl||(e===this.appName?this.unmount(!0,(()=>{this.actionsForAttributeChange(e,t,n)})):this.getKeepAliveModeResult()?(this.handleHiddenKeepAliveApp(),this.actionsForAttributeChange(e,t,n)):this.unmount(!1,(()=>{this.actionsForAttributeChange(e,t,n)})))}else e!==this.appName&&this.setAttribute("name",this.appName)}}static get observedAttributes(){return["name","url"]}connectedCallback(){const e=++this.connectedCount;this.connectStateMap.set(e,!0);const t=this.appName&&this.appUrl;O((()=>{this.connectStateMap.get(e)&&(se(this,this.appName,Ee.CREATED),t&&this.handleConnected())}))}disconnectedCallback(){this.connectStateMap.set(this.connectedCount,!1),this.handleDisconnected()}reload(e){return new Promise((t=>{const n=()=>{this.removeEventListener(Ee.MOUNTED,n),this.removeEventListener(Ee.AFTERSHOW,n),t(!0)};this.addEventListener(Ee.MOUNTED,n),this.addEventListener(Ee.AFTERSHOW,n),this.handleDisconnected(e,(()=>{this.handleConnected()}))}))}handleDisconnected(e=!1,t){const n=Sn.get(this.appName);!n||n.isUnmounted()||n.isHidden()||(this.getKeepAliveModeResult()&&!e?this.handleHiddenKeepAliveApp(t):this.unmount(e,t))}attributeChangedCallback(e,t,n){if(this.legalAttribute(e,n)&&this[e===be.NAME?"appName":"appUrl"]!==n)if(e!==be.URL||this.appUrl&&this.connectStateMap.get(this.connectedCount))if(e!==be.NAME||this.appName&&this.connectStateMap.get(this.connectedCount))this.isWaiting||(this.isWaiting=!0,O(this.handleAttributeUpdate));else{const e=L(n);if(!e)return C(`Invalid attribute name ${n}`,this.appName);this.cacheData&&(Zn.setData(e,this.cacheData),this.cacheData=null),this.appName=e,e!==n&&this.setAttribute("name",this.appName),this.handleInitialNameAndUrl()}else{if(!(n=x(n,this.appName)))return C(`Invalid attribute url ${n}`,this.appName);this.appUrl=n,this.handleInitialNameAndUrl()}}handleInitialNameAndUrl(){this.connectStateMap.get(this.connectedCount)&&this.handleConnected()}handleConnected(){if(this.appName&&this.appUrl)if(this.getDisposeResult("shadowDOM")&&!this.shadowRoot&&_(this.attachShadow)&&this.attachShadow({mode:"open"}),this.updateSsrUrl(this.appUrl),Sn.has(this.appName)){const e=Sn.get(this.appName),t=e.ssrUrl||e.url,n=this.ssrUrl||this.appUrl;e.isHidden()&&e.url===this.appUrl?this.handleShowKeepAliveApp(e):t===n&&(e.isUnmounted()||e.isPrefetch&&this.sameCoreOptions(e))?this.handleMount(e):e.isPrefetch||e.isUnmounted()?this.handleCreateApp():C(`app name conflict, an app named: ${this.appName} with url: ${t} is running`)}else this.handleCreateApp()}actionsForAttributeChange(e,t,n){var o;this.updateSsrUrl(t),this.appName=e,this.appUrl=t,(null!==(o=this.shadowRoot)&&void 0!==o?o:this).innerHTML="",e!==this.getAttribute("name")&&this.setAttribute("name",this.appName),n?n.isHidden()?n.url===this.appUrl?this.handleShowKeepAliveApp(n):C(`app name conflict, an app named ${this.appName} is running`):n.url===this.appUrl&&n.ssrUrl===this.ssrUrl?this.handleMount(n):this.handleCreateApp():this.handleCreateApp()}legalAttribute(e,t){return!(!d(t)||!t)||(C(`unexpected attribute ${e}, please check again`,this.appName),!1)}handleCreateApp(){const e=()=>{var e;return new Mn({name:this.appName,url:this.appUrl,container:null!==(e=this.shadowRoot)&&void 0!==e?e:this,scopecss:this.useScopecss(),useSandbox:this.useSandbox(),inline:this.getDisposeResult("inline"),iframe:this.getDisposeResult("iframe"),ssrUrl:this.ssrUrl,routerMode:this.getMemoryRouterMode()})},t=Sn.get(this.appName);t?t.isPrerender?this.unmount(!0,e):(t.actionsForCompletelyDestroy(),e()):e()}handleMount(e){e.isPrefetch=!1,e.setAppState(ve.BEFORE_MOUNT),O((()=>this.mount(e)))}mount(e){var t;e.mount({container:null!==(t=this.shadowRoot)&&void 0!==t?t:this,inline:this.getDisposeResult("inline"),routerMode:this.getMemoryRouterMode(),baseroute:this.getBaseRouteCompatible(),defaultPage:this.getDefaultPage(),disablePatchRequest:this.getDisposeResult("disable-patch-request"),fiber:this.getDisposeResult("fiber")})}unmount(e,t){const n=Sn.get(this.appName);n&&!n.isUnmounted()&&n.unmount({destroy:e||this.getDestroyCompatibleResult(),clearData:this.getDisposeResult("clear-data"),keepRouteState:this.getDisposeResult("keep-router-state"),unmountcb:t})}handleHiddenKeepAliveApp(e){const t=Sn.get(this.appName);!t||t.isUnmounted()||t.isHidden()||t.hiddenKeepAliveApp(e)}handleShowKeepAliveApp(e){O((()=>{var t;return e.showKeepAliveApp(null!==(t=this.shadowRoot)&&void 0!==t?t:this)}))}getDisposeResult(e){return(this.compatibleProperties(e)||!!Zn.options[e])&&this.compatibleDisableProperties(e)}compatibleProperties(e){return"disable-scopecss"===e?this.hasAttribute("disable-scopecss")||this.hasAttribute("disableScopecss"):"disable-sandbox"===e?this.hasAttribute("disable-sandbox")||this.hasAttribute("disableSandbox"):this.hasAttribute(e)}compatibleDisableProperties(e){return"disable-scopecss"===e?"false"!==this.getAttribute("disable-scopecss")&&"false"!==this.getAttribute("disableScopecss"):"disable-sandbox"===e?"false"!==this.getAttribute("disable-sandbox")&&"false"!==this.getAttribute("disableSandbox"):"false"!==this.getAttribute(e)}useScopecss(){return!(this.getDisposeResult("disable-scopecss")||this.getDisposeResult("shadowDOM"))}useSandbox(){return!this.getDisposeResult("disable-sandbox")}sameCoreOptions(e){return e.scopecss===this.useScopecss()&&e.useSandbox===this.useSandbox()&&e.iframe===this.getDisposeResult("iframe")}getBaseRouteCompatible(){var e,t;return null!==(t=null!==(e=this.getAttribute("baseroute"))&&void 0!==e?e:this.getAttribute("baseurl"))&&void 0!==t?t:""}getDestroyCompatibleResult(){return this.getDisposeResult("destroy")||this.getDisposeResult("destory")}getKeepAliveModeResult(){return this.getDisposeResult("keep-alive")&&!this.getDestroyCompatibleResult()}updateSsrUrl(e){if(this.getDisposeResult("ssr"))if(this.getDisposeResult("disable-memory-router")||this.getDisposeResult("disableSandbox")){const t=Hn.rawWindow.location;this.ssrUrl=U(t.pathname+t.search,e)}else{let t=function(e,t){const n=Ot(e);if(!n)return"";const o=D(n,t);return o.origin+o.pathname+o.search}(this.appName,e);const n=this.getDefaultPage();if(!t&&n){const o=D(n,e);t=o.origin+o.pathname+o.search}this.ssrUrl=t}else this.ssrUrl&&(this.ssrUrl="")}getDefaultPage(){return Gt.getDefaultPage(this.appName)||this.getAttribute("default-page")||this.getAttribute("defaultPage")||""}getMemoryRouterMode(){return Tt(this.getAttribute("router-mode"),this)}setAttribute(e,t){if("data"===e)if(A(t)){const e={};Object.getOwnPropertyNames(t).forEach((n=>{d(n)&&0===n.indexOf("__")||(e[n]=t[n])})),this.data=e}else"[object Object]"!==t&&N("property data must be an object",this.appName);else Hn.rawSetAttribute.call(this,e,t)}set data(e){this.appName?Zn.setData(this.appName,e):this.cacheData=e}get data(){return this.appName?Zn.getData(this.appName,!0):this.cacheData?this.cacheData:null}}Hn.rawWindow.customElements.define(t,n)}function jn(e,n){if(!t)return C("preFetch is only supported in browser environment");B((()=>{const t=f(n)?n:Zn.options.prefetchDelay;setTimeout((()=>{!function(e){_(e)&&(e=e()),r(e)&&e.reduce(((e,t)=>e.then((()=>{return e=t,k((t=>{var n,o,r,i,s,a;if(A(e)&&navigator.onLine)if(e.name=L(e.name),e.url=x(e.url,e.name),e.name&&e.url&&!Sn.has(e.name)){const c=new Mn({name:e.name,url:e.url,isPrefetch:!0,scopecss:!(null!==(o=null!==(n=e["disable-scopecss"])&&void 0!==n?n:e.disableScopecss)&&void 0!==o?o:Zn.options["disable-scopecss"]),useSandbox:!(null!==(i=null!==(r=e["disable-sandbox"])&&void 0!==r?r:e.disableSandbox)&&void 0!==i?i:Zn.options["disable-sandbox"]),inline:null!==(s=e.inline)&&void 0!==s?s:Zn.options.inline,iframe:null!==(a=e.iframe)&&void 0!==a?a:Zn.options.iframe,prefetchLevel:e.level&&De.includes(e.level)?e.level:Zn.options.prefetchLevel&&De.includes(Zn.options.prefetchLevel)?Zn.options.prefetchLevel:2}),l=c.onLoad,u=c.onLoadError;c.onLoad=n=>{t(),l.call(c,n,e["default-page"],e["disable-patch-request"],Tt(e["router-mode"]),e.baseroute)},c.onLoadError=(...e)=>{t(),u.call(c,...e)}}else t();else t()}));var e}))),Promise.resolve())}(e)}),f(t)?t:3e3)}))}function Kn(e,t,n){if(r(e)){const o=e.filter((e=>d(e)&&e.includes(`.${t}`)&&!n.hasInfo(e)));W(o.map((e=>ce(e))),(e=>{const r=o[e.index];"js"===t?n.hasInfo(r)||n.setInfo(r,{code:e.data,isExternal:!1,appSpace:{}}):n.hasInfo(r)||n.setInfo(r,{code:e.data,appSpace:{}})}),(e=>{C(e)}))}}function qn({excludeHiddenApp:e=!1,excludePreRender:t=!1}={}){const n=[];return Sn.forEach(((o,r)=>{o.isUnmounted()||o.isPrefetch&&(!o.isPrerender||t)||e&&o.isHidden()||n.push(r)})),n}function Gn(){return Array.from(Sn.keys())}function Qn(e,t){const n=Sn.get(L(e));return new Promise((o=>{if(n)if(n.isUnmounted()||n.isPrefetch)n.isPrerender?n.unmount({destroy:!!(null==t?void 0:t.destroy),clearData:!!(null==t?void 0:t.clearData),keepRouteState:!1,unmountcb:o.bind(null,!0)}):((null==t?void 0:t.destroy)&&n.actionsForCompletelyDestroy(),o(!0));else if(n.isHidden())(null==t?void 0:t.destroy)?n.unmount({destroy:!0,clearData:!0,keepRouteState:!0,unmountcb:o.bind(null,!0)}):(null==t?void 0:t.clearAliveState)?n.unmount({destroy:!1,clearData:!!t.clearData,keepRouteState:!0,unmountcb:o.bind(null,!0)}):o(!0);else{const e=X(n.container),r=()=>{e.removeEventListener(Ee.UNMOUNT,r),e.removeEventListener(Ee.AFTERHIDDEN,i),o(!0)},i=()=>{e.removeEventListener(Ee.UNMOUNT,r),e.removeEventListener(Ee.AFTERHIDDEN,i),o(!0)};if(e.addEventListener(Ee.UNMOUNT,r),e.addEventListener(Ee.AFTERHIDDEN,i),null==t?void 0:t.destroy){let t,n;e.hasAttribute("destroy")&&(t=e.getAttribute("destroy")),e.hasAttribute("destory")&&(n=e.getAttribute("destory")),e.setAttribute("destroy","true"),e.parentNode.removeChild(e),e.removeAttribute("destroy"),d(t)&&e.setAttribute("destroy",t),d(n)&&e.setAttribute("destory",n)}else if((null==t?void 0:t.clearAliveState)&&e.hasAttribute("keep-alive")){const n=e.getAttribute("keep-alive");e.removeAttribute("keep-alive");let o=null;t.clearData&&(o=e.getAttribute("clear-data"),e.setAttribute("clear-data","true")),e.parentNode.removeChild(e),e.setAttribute("keep-alive",n),d(o)&&e.setAttribute("clear-data",o)}else{let n=null;(null==t?void 0:t.clearData)&&(n=e.getAttribute("clear-data"),e.setAttribute("clear-data","true")),e.parentNode.removeChild(e),d(n)&&e.setAttribute("clear-data",n)}}else N(`app ${e} does not exist`),o(!1)}))}function zn(e){return Array.from(Sn.keys()).reduce(((t,n)=>t.then((()=>Qn(n,e)))),Promise.resolve(!0))}function Xn(e,t){return new Promise((n=>{const o=Sn.get(L(e));if(o){const r=o.container&&X(o.container);r?n(r.reload(t)):(N(`app ${e} is not rendered, cannot use reload`),n(!1))}else N(`app ${e} does not exist`),n(!1)}))}function Vn(e){return new Promise((t=>{if(!A(e))return C("renderApp options must be an object");const n=v(e.container)?e.container:d(e.container)?document.querySelector(e.container):null;if(!v(n))return C("Target container is not a DOM element.");const o=q(Zn.tagName);for(const t in e)if("onDataChange"===t)_(e[t])&&o.addEventListener("datachange",e[t]);else if("lifeCycles"===t){const n=e[t];if(A(n))for(const e in n)e.toUpperCase()in Ee&&_(n[e])&&o.addEventListener(e.toLowerCase(),n[e])}else"container"!==t&&o.setAttribute(t,e[t]);const r=()=>{s(),t(!0)},i=()=>{s(),t(!1)},s=()=>{o.removeEventListener(Ee.MOUNTED,r),o.removeEventListener(Ee.ERROR,i)};o.addEventListener(Ee.MOUNTED,r),o.addEventListener(Ee.ERROR,i),n.appendChild(o)}))}function Yn(e){const t=Sn.get(L(e));if(t)return t.getLifeCycleState();N(`app ${e} does not exist`)}class Jn extends lt{constructor(){super(...arguments),this.tagName="micro-app",this.hasInit=!1,this.options={},this.router=Gt,this.preFetch=jn,this.unmountApp=Qn,this.unmountAllApps=zn,this.getActiveApps=qn,this.getAllApps=Gn,this.reload=Xn,this.renderApp=Vn,this.getAppStatus=Yn}start(e){var n,o,r;if(!t||!window.customElements)return C("micro-app is not supported in this environment");if(this.hasInit)return C("microApp.start executed repeatedly");if(this.hasInit=!0,null==e?void 0:e.tagName){if(!/^micro-app(-\S+)?/.test(e.tagName))return C(`${e.tagName} is invalid tagName`);this.tagName=e.tagName}if(Fn(),Hn.rawWindow.customElements.get(this.tagName))return N(`element ${this.tagName} is already defined`);if(A(e)&&(this.options=e,e["disable-scopecss"]=null!==(n=e["disable-scopecss"])&&void 0!==n?n:e.disableScopecss,e["disable-sandbox"]=null!==(o=e["disable-sandbox"])&&void 0!==o?o:e.disableSandbox,e.preFetchApps&&jn(e.preFetchApps),e.globalAssets&&(A(r=e.globalAssets)&&B((()=>{Kn(r.js,"js",Me.script),Kn(r.css,"css",Me.link)}))),A(e.plugins))){const t=e.plugins.modules;if(A(t))for(const e in t){const n=L(e);n&&e!==n&&(t[n]=t[e],delete t[e])}}$n(this.tagName)}}const Zn=new Jn;exports.EventCenterForMicroApp=ut,exports.MicroApp=Jn,exports.default=Zn,exports.getActiveApps=qn,exports.getAllApps=Gn,exports.getAppStatus=Yn,exports.preFetch=jn,exports.pureCreateElement=q,exports.reload=Xn,exports.removeDomScope=K,exports.renderApp=Vn,exports.unmountAllApps=zn,exports.unmountApp=Qn,exports.version=e;
|
|
2
2
|
//# sourceMappingURL=index.min.js.map
|