single-spa
Advanced tools
Comparing version 6.0.1 to 6.0.2
@@ -1,2 +0,2 @@ | ||
/* single-spa@6.0.1 - ES2015 - dev */ | ||
/* single-spa@6.0.2 - ES2015 - dev */ | ||
var singleSpa = /*#__PURE__*/Object.freeze({ | ||
@@ -1028,3 +1028,2 @@ __proto__: null, | ||
capturedEventListeners[eventName] = capturedEventListeners[eventName].filter(fn => fn !== listenerFn); | ||
return; | ||
} | ||
@@ -1031,0 +1030,0 @@ } |
@@ -1,3 +0,3 @@ | ||
/* single-spa@6.0.1 - ES2015 - prod */ | ||
var t=Object.freeze({__proto__:null,get start(){return It},get ensureJQuerySupport(){return ft},get setBootstrapMaxTime(){return K},get setMountMaxTime(){return H},get setUnmountMaxTime(){return J},get setUnloadMaxTime(){return Q},get registerApplication(){return Tt},get unregisterApplication(){return At},get getMountedApps(){return Et},get getAppStatus(){return Pt},get unloadApplication(){return Nt},get checkActivityFunctions(){return bt},get getAppNames(){return vt},get pathToActiveWhen(){return Dt},get navigateToUrl(){return tt},get patchHistoryApi(){return at},get triggerAppChange(){return $t},get addErrorHandler(){return i},get removeErrorHandler(){return s},get mountRootParcel(){return G},get NOT_LOADED(){return c},get LOADING_SOURCE_CODE(){return l},get NOT_BOOTSTRAPPED(){return f},get BOOTSTRAPPING(){return p},get NOT_MOUNTED(){return h},get MOUNTING(){return m},get UPDATING(){return w},get LOAD_ERROR(){return E},get MOUNTED(){return d},get UNLOADING(){return y},get UNMOUNTING(){return g},get SKIP_BECAUSE_BROKEN(){return v}}),e=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}).CustomEvent,n=function(){try{var t=new e("cat",{detail:{foo:"bar"}});return"cat"===t.type&&"bar"===t.detail.foo}catch(t){}return!1}()?e:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(t,e){var n=document.createEvent("CustomEvent");return e?n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail):n.initCustomEvent(t,!1,!1,void 0),n}:function(t,e){var n=document.createEventObject();return n.type=t,e?(n.bubbles=Boolean(e.bubbles),n.cancelable=Boolean(e.cancelable),n.detail=e.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n};let r=[];function o(t,e,n){const o=a(t,e,n);r.length?r.forEach((t=>t(o))):setTimeout((()=>{throw o}))}function i(t){if("function"!=typeof t)throw Error(u(28,!1));r.push(t)}function s(t){if("function"!=typeof t)throw Error(u(29,!1));let e=!1;return r=r.filter((n=>{const r=n===t;return e=e||r,!r})),e}function u(t,e,...n){return`single-spa minified message #${t}: ${e?e+" ":""}See https://single-spa.js.org/error/?code=${t}${n.length?`&arg=${n.join("&arg=")}`:""}`}function a(t,e,n){const r=`${A(e)} '${T(e)}' died in status ${e.status}: `;let o;if(t instanceof Error){try{t.message=r+t.message}catch(t){}o=t}else{console.warn(u(30,!1,e.status,T(e)));try{o=Error(r+JSON.stringify(t))}catch(e){o=t}}return o.appOrParcelName=T(e),e.status=n,o}const c="NOT_LOADED",l="LOADING_SOURCE_CODE",f="NOT_BOOTSTRAPPED",p="BOOTSTRAPPING",h="NOT_MOUNTED",m="MOUNTING",d="MOUNTED",w="UPDATING",g="UNMOUNTING",y="UNLOADING",E="LOAD_ERROR",v="SKIP_BECAUSE_BROKEN";function P(t){return t.status===d}function O(t){try{return t.activeWhen(window.location)}catch(e){return o(e,t,v),!1}}function T(t){return t.name}function b(t){return Boolean(t.unmountThisParcel)}function A(t){return b(t)?"parcel":"application"}function N(){for(let t=arguments.length-1;t>0;t--)for(let e in arguments[t])"__proto__"!==e&&(arguments[t-1][e]=arguments[t][e]);return arguments[0]}function S(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return t[n];return null}function _(t){return t&&("function"==typeof t||(e=t,Array.isArray(e)&&!S(e,(t=>"function"!=typeof t))));var e}function D(t,e){let n=t[e]||[];n=Array.isArray(n)?n:[n],0===n.length&&(n=[()=>Promise.resolve()]);const r=A(t),o=T(t);return function(t){return n.reduce(((n,i,s)=>n.then((()=>{const n=i(t);return U(n)?n:Promise.reject(u(15,!1,r,o,e,s))}))),Promise.resolve())}}function U(t){return t&&"function"==typeof t.then&&"function"==typeof t.catch}let M=[];function j(t,e){return Promise.resolve().then((()=>t.status!==f?t:(t.status=p,t.bootstrap?V(t,"bootstrap").then(n).catch((n=>{if(e)throw a(n,t,v);return o(n,t,v),t})):Promise.resolve().then(n))));function n(){return t.status=h,t}}function $(t,e){return Promise.resolve().then((()=>{if(t.status!==d)return t;t.status=g;const n=Object.keys(t.parcels).map((e=>t.parcels[e].unmountThisParcel()));return Promise.all(n).then(r,(n=>r().then((()=>{const r=Error(n.message);if(e)throw a(r,t,v);o(r,t,v)})))).then((()=>t));function r(){return V(t,"unmount").then((()=>{t.status=h}),(n=>{if(e)throw a(n,t,v);o(n,t,v)}))}}))}let L=!1,R=!1;function x(t,e){return Promise.resolve().then((()=>t.status!==h?t:(L||(window.dispatchEvent(new n("single-spa:before-first-mount")),L=!0),t.status=m,V(t,"mount").then((()=>(t.status=d,R||(window.dispatchEvent(new n("single-spa:first-mount")),R=!0),t))).catch((n=>{return t.status=d,$(t,!0).then(r,r);function r(){if(e)throw a(n,t,v);return o(n,t,v),t}})))))}let I=0;const B={parcels:{}};function G(){return W.apply(B,arguments)}function W(t,e){const n=this;if(!t||"object"!=typeof t&&"function"!=typeof t)throw Error(u(2,!1));if(t.name&&"string"!=typeof t.name)throw Error(u(3,!1,typeof t.name));const r=I++;let o=t.name||`parcel-${r}`;if("object"!=typeof e)throw Error(u(4,!1,o,typeof e));if(!e.domElement)throw Error(u(5,!1,o));const i="function"==typeof t,s=i?t:()=>Promise.resolve(t),c={id:r,parcels:{},status:i?l:f,customProps:e,parentName:T(n),unmountThisParcel:()=>y.then((()=>{if(c.status!==d)throw Error(u(6,!1,o,c.status));return $(c,!0)})).then((t=>(c.parentName&&delete n.parcels[c.id],t))).then((t=>(E(t),t))).catch((t=>{throw c.status=v,P(t),t}))};let p;n.parcels[r]=c;let m=s();if(!m||"function"!=typeof m.then)throw Error(u(7,!1));m=m.then((t=>{if(!t)throw Error(u(8,!1));if(o=t.name||`parcel-${r}`,Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!_(t.bootstrap))throw Error(u(9,!1,o));if(!_(t.mount))throw Error(u(10,!1,o));if(!_(t.unmount))throw Error(u(11,!1,o));if(t.update&&!_(t.update))throw Error(u(12,!1,o));const e=D(t,"bootstrap"),n=D(t,"mount"),i=D(t,"unmount");c.status=f,c.name=o,c.bootstrap=e,c.mount=n,c.unmount=i,c.timeouts=q(t.timeouts),t.update&&(c.update=D(t,"update"),p.update=function(t){return c.customProps=t,C((e=c,Promise.resolve().then((()=>{if(e.status!==d)throw Error(u(32,!1,T(e)));return e.status=w,V(e,"update").then((()=>(e.status=d,e))).catch((t=>{throw a(t,e,v)}))}))));var e})}));const g=m.then((()=>j(c,!0))),y=g.then((()=>x(c,!0)));let E,P;const O=new Promise(((t,e)=>{E=t,P=e}));return p={mount:()=>C(Promise.resolve().then((()=>{if(c.status!==h)throw Error(u(13,!1,o,c.status));return n.parcels[r]=c,x(c)}))),unmount:()=>C(c.unmountThisParcel()),getStatus:()=>c.status,loadPromise:C(m),bootstrapPromise:C(g),mountPromise:C(y),unmountPromise:C(O)},p}function C(t){return t.then((()=>null))}function k(e){const n=T(e);let r="function"==typeof e.customProps?e.customProps(n,window.location):e.customProps;("object"!=typeof r||null===r||Array.isArray(r))&&(r={},console.warn(u(40,!1),n,r));const o=N({},r,{name:n,mountParcel:W.bind(e),singleSpa:t});return b(e)&&(o.unmountSelf=e.unmountThisParcel),o}const F={bootstrap:{millis:4e3,dieOnTimeout:!1,warningMillis:1e3},mount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unmount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unload:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},update:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3}};function K(t,e,n){if("number"!=typeof t||t<=0)throw Error(u(16,!1));F.bootstrap={millis:t,dieOnTimeout:e,warningMillis:n||1e3}}function H(t,e,n){if("number"!=typeof t||t<=0)throw Error(u(17,!1));F.mount={millis:t,dieOnTimeout:e,warningMillis:n||1e3}}function J(t,e,n){if("number"!=typeof t||t<=0)throw Error(u(18,!1));F.unmount={millis:t,dieOnTimeout:e,warningMillis:n||1e3}}function Q(t,e,n){if("number"!=typeof t||t<=0)throw Error(u(19,!1));F.unload={millis:t,dieOnTimeout:e,warningMillis:n||1e3}}function V(t,e){const n=t.timeouts[e],r=n.warningMillis,o=A(t);return new Promise(((i,s)=>{let a=!1,c=!1;t[e](k(t)).then((t=>{a=!0,i(t)})).catch((t=>{a=!0,s(t)})),setTimeout((()=>f(1)),r),setTimeout((()=>f(!0)),n.millis);const l=u(31,!1,e,o,T(t),n.millis);function f(t){if(!a)if(!0===t)c=!0,n.dieOnTimeout?s(Error(l)):console.error(l);else if(!c){const e=t,o=e*r;console.warn(l),o+r<n.millis&&setTimeout((()=>f(e+1)),r)}}}))}function q(t){const e={};for(let n in F)e[n]=N({},F[n],t&&t[n]||{});return e}function z(t){return Promise.resolve().then((()=>{if(t.loadPromise)return t.loadPromise;if(t.status!==c&&t.status!==E)return t;let e,n;return t.status=l,t.loadPromise=Promise.resolve().then((()=>{const r=t.loadApp(k(t));if(!U(r))throw n=!0,Error(u(33,!1,T(t)));return r.then((n=>{let r;t.loadErrorTime=null,e=n,"object"!=typeof e&&(r=34),Object.prototype.hasOwnProperty.call(e,"bootstrap")&&!_(e.bootstrap)&&(r=35),_(e.mount)||(r=36),_(e.unmount)||(r=37);const i=A(e);if(r){let n;try{n=JSON.stringify(e)}catch(t){}return console.error(u(r,!1,i,T(t),n),e),o(void 0,t,v),t}return e.devtools&&e.devtools.overlays&&(t.devtools.overlays=N({},t.devtools.overlays,e.devtools.overlays)),t.status=f,t.bootstrap=D(e,"bootstrap"),t.mount=D(e,"mount"),t.unmount=D(e,"unmount"),t.unload=D(e,"unload"),t.timeouts=q(e.timeouts),delete t.loadPromise,t}))})).catch((e=>{let r;return delete t.loadPromise,n?r=v:(r=E,t.loadErrorTime=(new Date).getTime()),o(e,t,r),t}))}))}const X="undefined"!=typeof window,Y={hashchange:[],popstate:[]},Z=["hashchange","popstate"];function tt(t){let e;if("string"==typeof t)e=t;else if(this&&this.href)e=this.href;else{if(!(t&&t.currentTarget&&t.currentTarget.href&&t.preventDefault))throw Error(u(14,!1));e=t.currentTarget.href,t.preventDefault()}const n=ct(window.location.href),r=ct(e);0===e.indexOf("#")?window.location.hash=r.hash:n.host!==r.host&&r.host?window.location.href=e:r.pathname===n.pathname&&r.search===n.search?window.location.hash=r.hash:window.history.pushState(null,null,e)}function et(t){if(t){const e=t[0].type;Z.indexOf(e)>=0&&Y[e].forEach((e=>{try{e.apply(this,t)}catch(t){setTimeout((()=>{throw t}))}}))}}let nt;function rt(){Lt([],arguments)}function ot(t,e){return function(){const n=window.location.href,r=t.apply(this,arguments),o=window.location.href;return nt&&n===o||window.dispatchEvent(it(window.history.state,e)),r}}function it(t,e){let n;try{n=new PopStateEvent("popstate",{state:t})}catch(e){n=document.createEvent("PopStateEvent"),n.initPopStateEvent("popstate",!1,!1,t)}return n.singleSpa=!0,n.singleSpaTrigger=e,n}let st=null,ut=!1;function at(t){if(ut)throw Error(u(43,!1));nt=!t||!t.hasOwnProperty("urlRerouteOnly")||t.urlRerouteOnly,ut=!0,st=window.history.replaceState,window.addEventListener("hashchange",rt),window.addEventListener("popstate",rt);const e=window.addEventListener,n=window.removeEventListener;window.addEventListener=function(t,n){if(!("function"==typeof n&&Z.indexOf(t)>=0)||S(Y[t],(t=>t===n)))return e.apply(this,arguments);Y[t].push(n)},window.removeEventListener=function(t,e){if(!("function"==typeof e&&Z.indexOf(t)>=0))return n.apply(this,arguments);Y[t]=Y[t].filter((t=>t!==e))},window.history.pushState=ot(window.history.pushState,"pushState"),window.history.replaceState=ot(st,"replaceState")}function ct(t){const e=document.createElement("a");return e.href=t,e}X&&(window.singleSpaNavigate?console.warn(u(41,!1)):window.singleSpaNavigate=tt);let lt=!1;function ft(t=window.jQuery){if(t||window.$&&window.$.fn&&window.$.fn.jquery&&(t=window.$),t&&!lt){const e=t.fn.on,n=t.fn.off;t.fn.on=function(t,n){return pt.call(this,e,window.addEventListener,t,n,arguments)},t.fn.off=function(t,e){return pt.call(this,n,window.removeEventListener,t,e,arguments)},lt=!0}}function pt(t,e,n,r,o){return"string"!=typeof n?t.apply(this,o):(n.split(/\s+/).forEach((t=>{Z.indexOf(t)>=0&&(e(t,r),n=n.replace(t,""))})),""===n.trim()?this:t.apply(this,o))}const ht={};function mt(t){return Promise.resolve().then((()=>{const e=ht[T(t)];if(!e)return t;if(t.status===c)return dt(t,e),t;if(t.status===y)return e.promise.then((()=>t));if(t.status!==h&&t.status!==E)return t;const n=t.status===E?Promise.resolve():V(t,"unload");return t.status=y,n.then((()=>(dt(t,e),t))).catch((n=>(function(t,e,n){delete ht[T(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,o(n,t,v),e.reject(n)}(t,e,n),t)))}))}function dt(t,e){delete ht[T(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,t.status=c,e.resolve()}function wt(t,e,n,r){ht[T(t)]={app:t,resolve:n,reject:r},Object.defineProperty(ht[T(t)],"promise",{get:e})}function gt(t){return ht[t]}const yt=[];function Et(){return yt.filter(P).map(T)}function vt(){return yt.map(T)}function Pt(t){const e=S(yt,(e=>T(e)===t));return e?e.status:null}let Ot=!1;function Tt(t,e,n,r){const o=function(t,e,n,r){const o={name:null,loadApp:null,activeWhen:null,customProps:null};return"object"==typeof t?(function(t){if(Array.isArray(t)||null===t)throw Error(u(39,!1));const e=["name","app","activeWhen","customProps"],n=Object.keys(t).reduce(((t,n)=>e.indexOf(n)>=0?t:t.concat(n)),[]);if(0!==n.length)throw Error(u(38,!1,e.join(", "),n.join(", ")));if("string"!=typeof t.name||0===t.name.length)throw Error(u(20,!1));if("object"!=typeof t.app&&"function"!=typeof t.app)throw Error(u(20,!1));const r=t=>"string"==typeof t||"function"==typeof t;if(!(r(t.activeWhen)||Array.isArray(t.activeWhen)&&t.activeWhen.every(r)))throw Error(u(24,!1));if(!_t(t.customProps))throw Error(u(22,!1))}(t),o.name=t.name,o.loadApp=t.app,o.activeWhen=t.activeWhen,o.customProps=t.customProps):(function(t,e,n,r){if("string"!=typeof t||0===t.length)throw Error(u(20,!1));if(!e)throw Error(u(23,!1));if("function"!=typeof n)throw Error(u(24,!1));if(!_t(r))throw Error(u(22,!1))}(t,e,n,r),o.name=t,o.loadApp=e,o.activeWhen=n,o.customProps=r),o.loadApp="function"!=typeof(i=o.loadApp)?()=>Promise.resolve(i):i,o.customProps=function(t){return t||{}}(o.customProps),o.activeWhen=function(t){let e=Array.isArray(t)?t:[t];return e=e.map((t=>"function"==typeof t?t:Dt(t))),t=>e.some((e=>e(t)))}(o.activeWhen),o;var i}(t,e,n,r);if(Bt()||Ot||(Ot=!0,setTimeout((()=>{Bt()||console.warn(u(1,!1))}),5e3)),-1!==vt().indexOf(o.name))throw Error(u(21,!1,o.name));yt.push(N({loadErrorTime:null,status:c,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},o)),X&&(ft(),Lt())}function bt(t=window.location){return yt.filter((e=>e.activeWhen(t))).map(T)}function At(t){if(0===yt.filter((e=>T(e)===t)).length)throw Error(u(25,!1,t));return(X?Nt(t,{waitForUnmount:!1}):Promise.resolve()).then((()=>{const e=yt.map(T).indexOf(t);yt.splice(e,1)}))}function Nt(t,e={waitForUnmount:!1}){if("string"!=typeof t)throw Error(u(26,!1));const n=S(yt,(e=>T(e)===t));if(!n)throw Error(u(27,!1,t));const r=gt(T(n));if(e&&e.waitForUnmount){if(r)return r.promise;{const t=new Promise(((e,r)=>{wt(n,(()=>t),e,r)}));return t}}{let t;return r?(t=r.promise,St(n,r.resolve,r.reject)):t=new Promise(((e,r)=>{wt(n,(()=>t),e,r),St(n,e,r)})),t}}function St(t,e,n){Promise.resolve().then((()=>{if(S(bt(),(e=>e===T(t))))return $t()})).then((()=>$(t).then(mt).then((()=>{e(),setTimeout((()=>{Lt()}))})))).catch(n)}function _t(t){return!t||"function"==typeof t||"object"==typeof t&&null!==t&&!Array.isArray(t)}function Dt(t,e){const n=function(t,e){let n=0,r=!1,o="^";"/"!==t[0]&&(t="/"+t);for(let e=0;e<t.length;e++){const n=t[e],o=r&&"/"===n;(!r&&":"===n||o)&&i(e)}return i(t.length),new RegExp(o,"i");function i(i){const s=t.slice(n,i).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(o+=r?"[^/]+/?":s,i===t.length)if(r)e&&(o+="$");else{const t=e?"":".*";o="/"===o.charAt(o.length-1)?`${o}${t}$`:`${o}(/${t})?(#.*)?$`}r=!r,n=i}}(t,e);return t=>{let e=t.origin;e||(e=`${t.protocol}//${t.host}`);const r=t.href.replace(e,"").replace(t.search,"").split("?")[0];return n.test(r)}}let Ut=!1,Mt=[],jt=X&&window.location.href;function $t(){return Lt()}function Lt(t=[],e,r=!1){if(Ut)return new Promise(((t,n)=>{Mt.push({resolve:t,reject:n,eventArguments:e})}));const{appsToUnload:o,appsToUnmount:i,appsToLoad:s,appsToMount:a}=function(){const t=[],e=[],n=[],r=[],o=(new Date).getTime();return yt.forEach((i=>{const s=i.status!==v&&O(i);switch(i.status){case E:s&&o-i.loadErrorTime>=200&&n.push(i);break;case c:case l:s&&n.push(i);break;case f:case h:!s&>(T(i))?t.push(i):s&&r.push(i);break;case d:s||e.push(i)}})),{appsToUnload:t,appsToUnmount:e,appsToLoad:n,appsToMount:r}}();let p,m=[],w=jt,g=jt=window.location.href;return Bt()?(Ut=!0,p=o.concat(s,i,a),Promise.resolve().then((()=>(S(0===p.length?"before-no-app-change":"before-app-change",A(!0)),S("before-routing-event",A(!0,{cancelNavigation:y})),Promise.all(m).then((n=>{if(n.some((t=>t)))return st.call(window.history,history.state,"",w.substring(location.origin.length)),jt=location.href,Ut=!1,Lt(t,e,!0);const r=o.map(mt),u=i.map($).map((t=>t.then(mt))).concat(r),c=Promise.all(u);c.then((()=>{S("before-mount-routing-event",A(!0))}),(t=>{throw t}));const l=s.map((t=>z(t).then((t=>Rt(t,c))))),f=a.filter((t=>s.indexOf(t)<0)).map((t=>Rt(t,c)));return c.catch((t=>{throw b(),t})).then((()=>(b(),Promise.all(l.concat(f)).catch((e=>{throw t.forEach((t=>t.reject(e))),e})).then(P).then((()=>{}),(t=>{throw t})))))})))))):(p=s,Promise.resolve().then((()=>{const t=s.map(z);return Promise.all(t).then(b).then((()=>[])).catch((t=>{throw b(),t})).finally((()=>{}))})));function y(t=!0){const e="function"==typeof(null==t?void 0:t.then)?t:Promise.resolve(t);m.push(e.catch((t=>(console.warn(Error(u(42,!1))),console.warn(t),!1))))}function P(){const e=Et();t.forEach((t=>t.resolve(e)));try{S(0===p.length?"no-app-change":"app-change",A()),S("routing-event",A())}catch(t){setTimeout((()=>{throw t}))}if(Ut=!1,Mt.length>0){const t=Mt;Mt=[],Lt(t)}return e}function b(){r||(t.forEach((t=>{et(t.eventArguments)})),et(e))}function A(t=!1,n){const r={},u={[d]:[],[h]:[],[c]:[],[v]:[]};t?(s.concat(a).forEach(((t,e)=>{f(t,d)})),o.forEach((t=>{f(t,c)})),i.forEach((t=>{f(t,h)}))):p.forEach((t=>{f(t)}));const l={detail:{newAppStatuses:r,appsByNewStatus:u,totalAppChanges:p.length,originalEvent:null==e?void 0:e[0],oldUrl:w,newUrl:g}};return n&&N(l.detail,n),l;function f(t,e){const n=T(t);e=e||Pt(n),r[n]=e,(u[e]=u[e]||[]).push(n)}}function S(t,e){r||window.dispatchEvent(new n(`single-spa:${t}`,e))}}function Rt(t,e){return O(t)?j(t).then((t=>e.then((()=>O(t)?x(t):t)))):e.then((()=>t))}let xt=!1;function It(t){xt=!0,X&&(at(t),Lt())}function Bt(){return xt}var Gt={getRawAppData:function(){return[...yt]},reroute:Lt,NOT_LOADED:c,toLoadPromise:z,toBootstrapPromise:j,unregisterApplication:At,getProfilerData:function(){return M}};X&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=Gt);export{p as BOOTSTRAPPING,l as LOADING_SOURCE_CODE,E as LOAD_ERROR,d as MOUNTED,m as MOUNTING,f as NOT_BOOTSTRAPPED,c as NOT_LOADED,h as NOT_MOUNTED,v as SKIP_BECAUSE_BROKEN,y as UNLOADING,g as UNMOUNTING,w as UPDATING,i as addErrorHandler,bt as checkActivityFunctions,ft as ensureJQuerySupport,vt as getAppNames,Pt as getAppStatus,Et as getMountedApps,G as mountRootParcel,tt as navigateToUrl,at as patchHistoryApi,Dt as pathToActiveWhen,Tt as registerApplication,s as removeErrorHandler,K as setBootstrapMaxTime,H as setMountMaxTime,Q as setUnloadMaxTime,J as setUnmountMaxTime,It as start,$t as triggerAppChange,Nt as unloadApplication,At as unregisterApplication}; | ||
/* single-spa@6.0.2 - ES2015 - prod */ | ||
var t=Object.freeze({__proto__:null,get start(){return It},get ensureJQuerySupport(){return ft},get setBootstrapMaxTime(){return K},get setMountMaxTime(){return H},get setUnmountMaxTime(){return J},get setUnloadMaxTime(){return Q},get registerApplication(){return Tt},get unregisterApplication(){return At},get getMountedApps(){return Et},get getAppStatus(){return Pt},get unloadApplication(){return Nt},get checkActivityFunctions(){return bt},get getAppNames(){return vt},get pathToActiveWhen(){return Dt},get navigateToUrl(){return tt},get patchHistoryApi(){return at},get triggerAppChange(){return $t},get addErrorHandler(){return i},get removeErrorHandler(){return s},get mountRootParcel(){return G},get NOT_LOADED(){return c},get LOADING_SOURCE_CODE(){return l},get NOT_BOOTSTRAPPED(){return f},get BOOTSTRAPPING(){return p},get NOT_MOUNTED(){return h},get MOUNTING(){return m},get UPDATING(){return w},get LOAD_ERROR(){return E},get MOUNTED(){return d},get UNLOADING(){return y},get UNMOUNTING(){return g},get SKIP_BECAUSE_BROKEN(){return v}}),e=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}).CustomEvent,n=function(){try{var t=new e("cat",{detail:{foo:"bar"}});return"cat"===t.type&&"bar"===t.detail.foo}catch(t){}return!1}()?e:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(t,e){var n=document.createEvent("CustomEvent");return e?n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail):n.initCustomEvent(t,!1,!1,void 0),n}:function(t,e){var n=document.createEventObject();return n.type=t,e?(n.bubbles=Boolean(e.bubbles),n.cancelable=Boolean(e.cancelable),n.detail=e.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n};let r=[];function o(t,e,n){const o=a(t,e,n);r.length?r.forEach((t=>t(o))):setTimeout((()=>{throw o}))}function i(t){if("function"!=typeof t)throw Error(u(28,!1));r.push(t)}function s(t){if("function"!=typeof t)throw Error(u(29,!1));let e=!1;return r=r.filter((n=>{const r=n===t;return e=e||r,!r})),e}function u(t,e,...n){return`single-spa minified message #${t}: ${e?e+" ":""}See https://single-spa.js.org/error/?code=${t}${n.length?`&arg=${n.join("&arg=")}`:""}`}function a(t,e,n){const r=`${A(e)} '${T(e)}' died in status ${e.status}: `;let o;if(t instanceof Error){try{t.message=r+t.message}catch(t){}o=t}else{console.warn(u(30,!1,e.status,T(e)));try{o=Error(r+JSON.stringify(t))}catch(e){o=t}}return o.appOrParcelName=T(e),e.status=n,o}const c="NOT_LOADED",l="LOADING_SOURCE_CODE",f="NOT_BOOTSTRAPPED",p="BOOTSTRAPPING",h="NOT_MOUNTED",m="MOUNTING",d="MOUNTED",w="UPDATING",g="UNMOUNTING",y="UNLOADING",E="LOAD_ERROR",v="SKIP_BECAUSE_BROKEN";function P(t){return t.status===d}function O(t){try{return t.activeWhen(window.location)}catch(e){return o(e,t,v),!1}}function T(t){return t.name}function b(t){return Boolean(t.unmountThisParcel)}function A(t){return b(t)?"parcel":"application"}function N(){for(let t=arguments.length-1;t>0;t--)for(let e in arguments[t])"__proto__"!==e&&(arguments[t-1][e]=arguments[t][e]);return arguments[0]}function S(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return t[n];return null}function _(t){return t&&("function"==typeof t||(e=t,Array.isArray(e)&&!S(e,(t=>"function"!=typeof t))));var e}function D(t,e){let n=t[e]||[];n=Array.isArray(n)?n:[n],0===n.length&&(n=[()=>Promise.resolve()]);const r=A(t),o=T(t);return function(t){return n.reduce(((n,i,s)=>n.then((()=>{const n=i(t);return U(n)?n:Promise.reject(u(15,!1,r,o,e,s))}))),Promise.resolve())}}function U(t){return t&&"function"==typeof t.then&&"function"==typeof t.catch}let M=[];function j(t,e){return Promise.resolve().then((()=>t.status!==f?t:(t.status=p,t.bootstrap?V(t,"bootstrap").then(n).catch((n=>{if(e)throw a(n,t,v);return o(n,t,v),t})):Promise.resolve().then(n))));function n(){return t.status=h,t}}function $(t,e){return Promise.resolve().then((()=>{if(t.status!==d)return t;t.status=g;const n=Object.keys(t.parcels).map((e=>t.parcels[e].unmountThisParcel()));return Promise.all(n).then(r,(n=>r().then((()=>{const r=Error(n.message);if(e)throw a(r,t,v);o(r,t,v)})))).then((()=>t));function r(){return V(t,"unmount").then((()=>{t.status=h}),(n=>{if(e)throw a(n,t,v);o(n,t,v)}))}}))}let L=!1,R=!1;function x(t,e){return Promise.resolve().then((()=>t.status!==h?t:(L||(window.dispatchEvent(new n("single-spa:before-first-mount")),L=!0),t.status=m,V(t,"mount").then((()=>(t.status=d,R||(window.dispatchEvent(new n("single-spa:first-mount")),R=!0),t))).catch((n=>{return t.status=d,$(t,!0).then(r,r);function r(){if(e)throw a(n,t,v);return o(n,t,v),t}})))))}let I=0;const B={parcels:{}};function G(){return W.apply(B,arguments)}function W(t,e){const n=this;if(!t||"object"!=typeof t&&"function"!=typeof t)throw Error(u(2,!1));if(t.name&&"string"!=typeof t.name)throw Error(u(3,!1,typeof t.name));const r=I++;let o=t.name||`parcel-${r}`;if("object"!=typeof e)throw Error(u(4,!1,o,typeof e));if(!e.domElement)throw Error(u(5,!1,o));const i="function"==typeof t,s=i?t:()=>Promise.resolve(t),c={id:r,parcels:{},status:i?l:f,customProps:e,parentName:T(n),unmountThisParcel:()=>y.then((()=>{if(c.status!==d)throw Error(u(6,!1,o,c.status));return $(c,!0)})).then((t=>(c.parentName&&delete n.parcels[c.id],t))).then((t=>(E(t),t))).catch((t=>{throw c.status=v,P(t),t}))};let p;n.parcels[r]=c;let m=s();if(!m||"function"!=typeof m.then)throw Error(u(7,!1));m=m.then((t=>{if(!t)throw Error(u(8,!1));if(o=t.name||`parcel-${r}`,Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!_(t.bootstrap))throw Error(u(9,!1,o));if(!_(t.mount))throw Error(u(10,!1,o));if(!_(t.unmount))throw Error(u(11,!1,o));if(t.update&&!_(t.update))throw Error(u(12,!1,o));const e=D(t,"bootstrap"),n=D(t,"mount"),i=D(t,"unmount");c.status=f,c.name=o,c.bootstrap=e,c.mount=n,c.unmount=i,c.timeouts=q(t.timeouts),t.update&&(c.update=D(t,"update"),p.update=function(t){return c.customProps=t,C((e=c,Promise.resolve().then((()=>{if(e.status!==d)throw Error(u(32,!1,T(e)));return e.status=w,V(e,"update").then((()=>(e.status=d,e))).catch((t=>{throw a(t,e,v)}))}))));var e})}));const g=m.then((()=>j(c,!0))),y=g.then((()=>x(c,!0)));let E,P;const O=new Promise(((t,e)=>{E=t,P=e}));return p={mount:()=>C(Promise.resolve().then((()=>{if(c.status!==h)throw Error(u(13,!1,o,c.status));return n.parcels[r]=c,x(c)}))),unmount:()=>C(c.unmountThisParcel()),getStatus:()=>c.status,loadPromise:C(m),bootstrapPromise:C(g),mountPromise:C(y),unmountPromise:C(O)},p}function C(t){return t.then((()=>null))}function k(e){const n=T(e);let r="function"==typeof e.customProps?e.customProps(n,window.location):e.customProps;("object"!=typeof r||null===r||Array.isArray(r))&&(r={},console.warn(u(40,!1),n,r));const o=N({},r,{name:n,mountParcel:W.bind(e),singleSpa:t});return b(e)&&(o.unmountSelf=e.unmountThisParcel),o}const F={bootstrap:{millis:4e3,dieOnTimeout:!1,warningMillis:1e3},mount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unmount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unload:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},update:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3}};function K(t,e,n){if("number"!=typeof t||t<=0)throw Error(u(16,!1));F.bootstrap={millis:t,dieOnTimeout:e,warningMillis:n||1e3}}function H(t,e,n){if("number"!=typeof t||t<=0)throw Error(u(17,!1));F.mount={millis:t,dieOnTimeout:e,warningMillis:n||1e3}}function J(t,e,n){if("number"!=typeof t||t<=0)throw Error(u(18,!1));F.unmount={millis:t,dieOnTimeout:e,warningMillis:n||1e3}}function Q(t,e,n){if("number"!=typeof t||t<=0)throw Error(u(19,!1));F.unload={millis:t,dieOnTimeout:e,warningMillis:n||1e3}}function V(t,e){const n=t.timeouts[e],r=n.warningMillis,o=A(t);return new Promise(((i,s)=>{let a=!1,c=!1;t[e](k(t)).then((t=>{a=!0,i(t)})).catch((t=>{a=!0,s(t)})),setTimeout((()=>f(1)),r),setTimeout((()=>f(!0)),n.millis);const l=u(31,!1,e,o,T(t),n.millis);function f(t){if(!a)if(!0===t)c=!0,n.dieOnTimeout?s(Error(l)):console.error(l);else if(!c){const e=t,o=e*r;console.warn(l),o+r<n.millis&&setTimeout((()=>f(e+1)),r)}}}))}function q(t){const e={};for(let n in F)e[n]=N({},F[n],t&&t[n]||{});return e}function z(t){return Promise.resolve().then((()=>{if(t.loadPromise)return t.loadPromise;if(t.status!==c&&t.status!==E)return t;let e,n;return t.status=l,t.loadPromise=Promise.resolve().then((()=>{const r=t.loadApp(k(t));if(!U(r))throw n=!0,Error(u(33,!1,T(t)));return r.then((n=>{let r;t.loadErrorTime=null,e=n,"object"!=typeof e&&(r=34),Object.prototype.hasOwnProperty.call(e,"bootstrap")&&!_(e.bootstrap)&&(r=35),_(e.mount)||(r=36),_(e.unmount)||(r=37);const i=A(e);if(r){let n;try{n=JSON.stringify(e)}catch(t){}return console.error(u(r,!1,i,T(t),n),e),o(void 0,t,v),t}return e.devtools&&e.devtools.overlays&&(t.devtools.overlays=N({},t.devtools.overlays,e.devtools.overlays)),t.status=f,t.bootstrap=D(e,"bootstrap"),t.mount=D(e,"mount"),t.unmount=D(e,"unmount"),t.unload=D(e,"unload"),t.timeouts=q(e.timeouts),delete t.loadPromise,t}))})).catch((e=>{let r;return delete t.loadPromise,n?r=v:(r=E,t.loadErrorTime=(new Date).getTime()),o(e,t,r),t}))}))}const X="undefined"!=typeof window,Y={hashchange:[],popstate:[]},Z=["hashchange","popstate"];function tt(t){let e;if("string"==typeof t)e=t;else if(this&&this.href)e=this.href;else{if(!(t&&t.currentTarget&&t.currentTarget.href&&t.preventDefault))throw Error(u(14,!1));e=t.currentTarget.href,t.preventDefault()}const n=ct(window.location.href),r=ct(e);0===e.indexOf("#")?window.location.hash=r.hash:n.host!==r.host&&r.host?window.location.href=e:r.pathname===n.pathname&&r.search===n.search?window.location.hash=r.hash:window.history.pushState(null,null,e)}function et(t){if(t){const e=t[0].type;Z.indexOf(e)>=0&&Y[e].forEach((e=>{try{e.apply(this,t)}catch(t){setTimeout((()=>{throw t}))}}))}}let nt;function rt(){Lt([],arguments)}function ot(t,e){return function(){const n=window.location.href,r=t.apply(this,arguments),o=window.location.href;return nt&&n===o||window.dispatchEvent(it(window.history.state,e)),r}}function it(t,e){let n;try{n=new PopStateEvent("popstate",{state:t})}catch(e){n=document.createEvent("PopStateEvent"),n.initPopStateEvent("popstate",!1,!1,t)}return n.singleSpa=!0,n.singleSpaTrigger=e,n}let st=null,ut=!1;function at(t){if(ut)throw Error(u(43,!1));nt=!t||!t.hasOwnProperty("urlRerouteOnly")||t.urlRerouteOnly,ut=!0,st=window.history.replaceState,window.addEventListener("hashchange",rt),window.addEventListener("popstate",rt);const e=window.addEventListener,n=window.removeEventListener;window.addEventListener=function(t,n){if(!("function"==typeof n&&Z.indexOf(t)>=0)||S(Y[t],(t=>t===n)))return e.apply(this,arguments);Y[t].push(n)},window.removeEventListener=function(t,e){return"function"==typeof e&&Z.indexOf(t)>=0&&(Y[t]=Y[t].filter((t=>t!==e))),n.apply(this,arguments)},window.history.pushState=ot(window.history.pushState,"pushState"),window.history.replaceState=ot(st,"replaceState")}function ct(t){const e=document.createElement("a");return e.href=t,e}X&&(window.singleSpaNavigate?console.warn(u(41,!1)):window.singleSpaNavigate=tt);let lt=!1;function ft(t=window.jQuery){if(t||window.$&&window.$.fn&&window.$.fn.jquery&&(t=window.$),t&&!lt){const e=t.fn.on,n=t.fn.off;t.fn.on=function(t,n){return pt.call(this,e,window.addEventListener,t,n,arguments)},t.fn.off=function(t,e){return pt.call(this,n,window.removeEventListener,t,e,arguments)},lt=!0}}function pt(t,e,n,r,o){return"string"!=typeof n?t.apply(this,o):(n.split(/\s+/).forEach((t=>{Z.indexOf(t)>=0&&(e(t,r),n=n.replace(t,""))})),""===n.trim()?this:t.apply(this,o))}const ht={};function mt(t){return Promise.resolve().then((()=>{const e=ht[T(t)];if(!e)return t;if(t.status===c)return dt(t,e),t;if(t.status===y)return e.promise.then((()=>t));if(t.status!==h&&t.status!==E)return t;const n=t.status===E?Promise.resolve():V(t,"unload");return t.status=y,n.then((()=>(dt(t,e),t))).catch((n=>(function(t,e,n){delete ht[T(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,o(n,t,v),e.reject(n)}(t,e,n),t)))}))}function dt(t,e){delete ht[T(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,t.status=c,e.resolve()}function wt(t,e,n,r){ht[T(t)]={app:t,resolve:n,reject:r},Object.defineProperty(ht[T(t)],"promise",{get:e})}function gt(t){return ht[t]}const yt=[];function Et(){return yt.filter(P).map(T)}function vt(){return yt.map(T)}function Pt(t){const e=S(yt,(e=>T(e)===t));return e?e.status:null}let Ot=!1;function Tt(t,e,n,r){const o=function(t,e,n,r){const o={name:null,loadApp:null,activeWhen:null,customProps:null};return"object"==typeof t?(function(t){if(Array.isArray(t)||null===t)throw Error(u(39,!1));const e=["name","app","activeWhen","customProps"],n=Object.keys(t).reduce(((t,n)=>e.indexOf(n)>=0?t:t.concat(n)),[]);if(0!==n.length)throw Error(u(38,!1,e.join(", "),n.join(", ")));if("string"!=typeof t.name||0===t.name.length)throw Error(u(20,!1));if("object"!=typeof t.app&&"function"!=typeof t.app)throw Error(u(20,!1));const r=t=>"string"==typeof t||"function"==typeof t;if(!(r(t.activeWhen)||Array.isArray(t.activeWhen)&&t.activeWhen.every(r)))throw Error(u(24,!1));if(!_t(t.customProps))throw Error(u(22,!1))}(t),o.name=t.name,o.loadApp=t.app,o.activeWhen=t.activeWhen,o.customProps=t.customProps):(function(t,e,n,r){if("string"!=typeof t||0===t.length)throw Error(u(20,!1));if(!e)throw Error(u(23,!1));if("function"!=typeof n)throw Error(u(24,!1));if(!_t(r))throw Error(u(22,!1))}(t,e,n,r),o.name=t,o.loadApp=e,o.activeWhen=n,o.customProps=r),o.loadApp="function"!=typeof(i=o.loadApp)?()=>Promise.resolve(i):i,o.customProps=function(t){return t||{}}(o.customProps),o.activeWhen=function(t){let e=Array.isArray(t)?t:[t];return e=e.map((t=>"function"==typeof t?t:Dt(t))),t=>e.some((e=>e(t)))}(o.activeWhen),o;var i}(t,e,n,r);if(Bt()||Ot||(Ot=!0,setTimeout((()=>{Bt()||console.warn(u(1,!1))}),5e3)),-1!==vt().indexOf(o.name))throw Error(u(21,!1,o.name));yt.push(N({loadErrorTime:null,status:c,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},o)),X&&(ft(),Lt())}function bt(t=window.location){return yt.filter((e=>e.activeWhen(t))).map(T)}function At(t){if(0===yt.filter((e=>T(e)===t)).length)throw Error(u(25,!1,t));return(X?Nt(t,{waitForUnmount:!1}):Promise.resolve()).then((()=>{const e=yt.map(T).indexOf(t);yt.splice(e,1)}))}function Nt(t,e={waitForUnmount:!1}){if("string"!=typeof t)throw Error(u(26,!1));const n=S(yt,(e=>T(e)===t));if(!n)throw Error(u(27,!1,t));const r=gt(T(n));if(e&&e.waitForUnmount){if(r)return r.promise;{const t=new Promise(((e,r)=>{wt(n,(()=>t),e,r)}));return t}}{let t;return r?(t=r.promise,St(n,r.resolve,r.reject)):t=new Promise(((e,r)=>{wt(n,(()=>t),e,r),St(n,e,r)})),t}}function St(t,e,n){Promise.resolve().then((()=>{if(S(bt(),(e=>e===T(t))))return $t()})).then((()=>$(t).then(mt).then((()=>{e(),setTimeout((()=>{Lt()}))})))).catch(n)}function _t(t){return!t||"function"==typeof t||"object"==typeof t&&null!==t&&!Array.isArray(t)}function Dt(t,e){const n=function(t,e){let n=0,r=!1,o="^";"/"!==t[0]&&(t="/"+t);for(let e=0;e<t.length;e++){const n=t[e],o=r&&"/"===n;(!r&&":"===n||o)&&i(e)}return i(t.length),new RegExp(o,"i");function i(i){const s=t.slice(n,i).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(o+=r?"[^/]+/?":s,i===t.length)if(r)e&&(o+="$");else{const t=e?"":".*";o="/"===o.charAt(o.length-1)?`${o}${t}$`:`${o}(/${t})?(#.*)?$`}r=!r,n=i}}(t,e);return t=>{let e=t.origin;e||(e=`${t.protocol}//${t.host}`);const r=t.href.replace(e,"").replace(t.search,"").split("?")[0];return n.test(r)}}let Ut=!1,Mt=[],jt=X&&window.location.href;function $t(){return Lt()}function Lt(t=[],e,r=!1){if(Ut)return new Promise(((t,n)=>{Mt.push({resolve:t,reject:n,eventArguments:e})}));const{appsToUnload:o,appsToUnmount:i,appsToLoad:s,appsToMount:a}=function(){const t=[],e=[],n=[],r=[],o=(new Date).getTime();return yt.forEach((i=>{const s=i.status!==v&&O(i);switch(i.status){case E:s&&o-i.loadErrorTime>=200&&n.push(i);break;case c:case l:s&&n.push(i);break;case f:case h:!s&>(T(i))?t.push(i):s&&r.push(i);break;case d:s||e.push(i)}})),{appsToUnload:t,appsToUnmount:e,appsToLoad:n,appsToMount:r}}();let p,m=[],w=jt,g=jt=window.location.href;return Bt()?(Ut=!0,p=o.concat(s,i,a),Promise.resolve().then((()=>(S(0===p.length?"before-no-app-change":"before-app-change",A(!0)),S("before-routing-event",A(!0,{cancelNavigation:y})),Promise.all(m).then((n=>{if(n.some((t=>t)))return st.call(window.history,history.state,"",w.substring(location.origin.length)),jt=location.href,Ut=!1,Lt(t,e,!0);const r=o.map(mt),u=i.map($).map((t=>t.then(mt))).concat(r),c=Promise.all(u);c.then((()=>{S("before-mount-routing-event",A(!0))}),(t=>{throw t}));const l=s.map((t=>z(t).then((t=>Rt(t,c))))),f=a.filter((t=>s.indexOf(t)<0)).map((t=>Rt(t,c)));return c.catch((t=>{throw b(),t})).then((()=>(b(),Promise.all(l.concat(f)).catch((e=>{throw t.forEach((t=>t.reject(e))),e})).then(P).then((()=>{}),(t=>{throw t})))))})))))):(p=s,Promise.resolve().then((()=>{const t=s.map(z);return Promise.all(t).then(b).then((()=>[])).catch((t=>{throw b(),t})).finally((()=>{}))})));function y(t=!0){const e="function"==typeof(null==t?void 0:t.then)?t:Promise.resolve(t);m.push(e.catch((t=>(console.warn(Error(u(42,!1))),console.warn(t),!1))))}function P(){const e=Et();t.forEach((t=>t.resolve(e)));try{S(0===p.length?"no-app-change":"app-change",A()),S("routing-event",A())}catch(t){setTimeout((()=>{throw t}))}if(Ut=!1,Mt.length>0){const t=Mt;Mt=[],Lt(t)}return e}function b(){r||(t.forEach((t=>{et(t.eventArguments)})),et(e))}function A(t=!1,n){const r={},u={[d]:[],[h]:[],[c]:[],[v]:[]};t?(s.concat(a).forEach(((t,e)=>{f(t,d)})),o.forEach((t=>{f(t,c)})),i.forEach((t=>{f(t,h)}))):p.forEach((t=>{f(t)}));const l={detail:{newAppStatuses:r,appsByNewStatus:u,totalAppChanges:p.length,originalEvent:null==e?void 0:e[0],oldUrl:w,newUrl:g}};return n&&N(l.detail,n),l;function f(t,e){const n=T(t);e=e||Pt(n),r[n]=e,(u[e]=u[e]||[]).push(n)}}function S(t,e){r||window.dispatchEvent(new n(`single-spa:${t}`,e))}}function Rt(t,e){return O(t)?j(t).then((t=>e.then((()=>O(t)?x(t):t)))):e.then((()=>t))}let xt=!1;function It(t){xt=!0,X&&(at(t),Lt())}function Bt(){return xt}var Gt={getRawAppData:function(){return[...yt]},reroute:Lt,NOT_LOADED:c,toLoadPromise:z,toBootstrapPromise:j,unregisterApplication:At,getProfilerData:function(){return M}};X&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=Gt);export{p as BOOTSTRAPPING,l as LOADING_SOURCE_CODE,E as LOAD_ERROR,d as MOUNTED,m as MOUNTING,f as NOT_BOOTSTRAPPED,c as NOT_LOADED,h as NOT_MOUNTED,v as SKIP_BECAUSE_BROKEN,y as UNLOADING,g as UNMOUNTING,w as UPDATING,i as addErrorHandler,bt as checkActivityFunctions,ft as ensureJQuerySupport,vt as getAppNames,Pt as getAppStatus,Et as getMountedApps,G as mountRootParcel,tt as navigateToUrl,at as patchHistoryApi,Dt as pathToActiveWhen,Tt as registerApplication,s as removeErrorHandler,K as setBootstrapMaxTime,H as setMountMaxTime,Q as setUnloadMaxTime,J as setUnmountMaxTime,It as start,$t as triggerAppChange,Nt as unloadApplication,At as unregisterApplication}; | ||
//# sourceMappingURL=single-spa.min.js.map |
@@ -1,3 +0,3 @@ | ||
/* single-spa@6.0.1 - SystemJS ES2015 - prod */ | ||
System.register([],(function(t){return{execute:function(){t({addErrorHandler:s,checkActivityFunctions:Nt,ensureJQuerySupport:ht,getAppNames:Tt,getAppStatus:Pt,getMountedApps:Ot,mountRootParcel:C,navigateToUrl:nt,patchHistoryApi:lt,pathToActiveWhen:Mt,registerApplication:bt,removeErrorHandler:u,setBootstrapMaxTime:J,setMountMaxTime:Q,setUnloadMaxTime:q,setUnmountMaxTime:V,start:Bt,triggerAppChange:$t,unloadApplication:_t,unregisterApplication:St});var e=Object.freeze({__proto__:null,get start(){return Bt},get ensureJQuerySupport(){return ht},get setBootstrapMaxTime(){return J},get setMountMaxTime(){return Q},get setUnmountMaxTime(){return V},get setUnloadMaxTime(){return q},get registerApplication(){return bt},get unregisterApplication(){return St},get getMountedApps(){return Ot},get getAppStatus(){return Pt},get unloadApplication(){return _t},get checkActivityFunctions(){return Nt},get getAppNames(){return Tt},get pathToActiveWhen(){return Mt},get navigateToUrl(){return nt},get patchHistoryApi(){return lt},get triggerAppChange(){return $t},get addErrorHandler(){return s},get removeErrorHandler(){return u},get mountRootParcel(){return C},get NOT_LOADED(){return l},get LOADING_SOURCE_CODE(){return f},get NOT_BOOTSTRAPPED(){return p},get BOOTSTRAPPING(){return h},get NOT_MOUNTED(){return m},get MOUNTING(){return d},get UPDATING(){return g},get LOAD_ERROR(){return v},get MOUNTED(){return w},get UNLOADING(){return y},get UNMOUNTING(){return E},get SKIP_BECAUSE_BROKEN(){return O}}),n=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}).CustomEvent,r=function(){try{var t=new n("cat",{detail:{foo:"bar"}});return"cat"===t.type&&"bar"===t.detail.foo}catch(t){}return!1}()?n:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(t,e){var n=document.createEvent("CustomEvent");return e?n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail):n.initCustomEvent(t,!1,!1,void 0),n}:function(t,e){var n=document.createEventObject();return n.type=t,e?(n.bubbles=Boolean(e.bubbles),n.cancelable=Boolean(e.cancelable),n.detail=e.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n};let o=[];function i(t,e,n){const r=c(t,e,n);o.length?o.forEach((t=>t(r))):setTimeout((()=>{throw r}))}function s(t){if("function"!=typeof t)throw Error(a(28,!1));o.push(t)}function u(t){if("function"!=typeof t)throw Error(a(29,!1));let e=!1;return o=o.filter((n=>{const r=n===t;return e=e||r,!r})),e}function a(t,e,...n){return`single-spa minified message #${t}: ${e?e+" ":""}See https://single-spa.js.org/error/?code=${t}${n.length?`&arg=${n.join("&arg=")}`:""}`}function c(t,e,n){const r=`${N(e)} '${A(e)}' died in status ${e.status}: `;let o;if(t instanceof Error){try{t.message=r+t.message}catch(t){}o=t}else{console.warn(a(30,!1,e.status,A(e)));try{o=Error(r+JSON.stringify(t))}catch(e){o=t}}return o.appOrParcelName=A(e),e.status=n,o}const l=t("NOT_LOADED","NOT_LOADED"),f=t("LOADING_SOURCE_CODE","LOADING_SOURCE_CODE"),p=t("NOT_BOOTSTRAPPED","NOT_BOOTSTRAPPED"),h=t("BOOTSTRAPPING","BOOTSTRAPPING"),m=t("NOT_MOUNTED","NOT_MOUNTED"),d=t("MOUNTING","MOUNTING"),w=t("MOUNTED","MOUNTED"),g=t("UPDATING","UPDATING"),E=t("UNMOUNTING","UNMOUNTING"),y=t("UNLOADING","UNLOADING"),v=t("LOAD_ERROR","LOAD_ERROR"),O=t("SKIP_BECAUSE_BROKEN","SKIP_BECAUSE_BROKEN");function T(t){return t.status===w}function P(t){try{return t.activeWhen(window.location)}catch(e){return i(e,t,O),!1}}function A(t){return t.name}function b(t){return Boolean(t.unmountThisParcel)}function N(t){return b(t)?"parcel":"application"}function S(){for(let t=arguments.length-1;t>0;t--)for(let e in arguments[t])"__proto__"!==e&&(arguments[t-1][e]=arguments[t][e]);return arguments[0]}function _(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return t[n];return null}function U(t){return t&&("function"==typeof t||(e=t,Array.isArray(e)&&!_(e,(t=>"function"!=typeof t))));var e}function D(t,e){let n=t[e]||[];n=Array.isArray(n)?n:[n],0===n.length&&(n=[()=>Promise.resolve()]);const r=N(t),o=A(t);return function(t){return n.reduce(((n,i,s)=>n.then((()=>{const n=i(t);return M(n)?n:Promise.reject(a(15,!1,r,o,e,s))}))),Promise.resolve())}}function M(t){return t&&"function"==typeof t.then&&"function"==typeof t.catch}let L=[];function R(t,e){return Promise.resolve().then((()=>t.status!==p?t:(t.status=h,t.bootstrap?z(t,"bootstrap").then(n).catch((n=>{if(e)throw c(n,t,O);return i(n,t,O),t})):Promise.resolve().then(n))));function n(){return t.status=m,t}}function j(t,e){return Promise.resolve().then((()=>{if(t.status!==w)return t;t.status=E;const n=Object.keys(t.parcels).map((e=>t.parcels[e].unmountThisParcel()));return Promise.all(n).then(r,(n=>r().then((()=>{const r=Error(n.message);if(e)throw c(r,t,O);i(r,t,O)})))).then((()=>t));function r(){return z(t,"unmount").then((()=>{t.status=m}),(n=>{if(e)throw c(n,t,O);i(n,t,O)}))}}))}let $=!1,I=!1;function x(t,e){return Promise.resolve().then((()=>t.status!==m?t:($||(window.dispatchEvent(new r("single-spa:before-first-mount")),$=!0),t.status=d,z(t,"mount").then((()=>(t.status=w,I||(window.dispatchEvent(new r("single-spa:first-mount")),I=!0),t))).catch((n=>{return t.status=w,j(t,!0).then(r,r);function r(){if(e)throw c(n,t,O);return i(n,t,O),t}})))))}let G=0;const B={parcels:{}};function C(){return W.apply(B,arguments)}function W(t,e){const n=this;if(!t||"object"!=typeof t&&"function"!=typeof t)throw Error(a(2,!1));if(t.name&&"string"!=typeof t.name)throw Error(a(3,!1,typeof t.name));const r=G++;let o=t.name||`parcel-${r}`;if("object"!=typeof e)throw Error(a(4,!1,o,typeof e));if(!e.domElement)throw Error(a(5,!1,o));const i="function"==typeof t,s=i?t:()=>Promise.resolve(t),u={id:r,parcels:{},status:i?f:p,customProps:e,parentName:A(n),unmountThisParcel:()=>E.then((()=>{if(u.status!==w)throw Error(a(6,!1,o,u.status));return j(u,!0)})).then((t=>(u.parentName&&delete n.parcels[u.id],t))).then((t=>(y(t),t))).catch((t=>{throw u.status=O,v(t),t}))};let l;n.parcels[r]=u;let h=s();if(!h||"function"!=typeof h.then)throw Error(a(7,!1));h=h.then((t=>{if(!t)throw Error(a(8,!1));if(o=t.name||`parcel-${r}`,Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!U(t.bootstrap))throw Error(a(9,!1,o));if(!U(t.mount))throw Error(a(10,!1,o));if(!U(t.unmount))throw Error(a(11,!1,o));if(t.update&&!U(t.update))throw Error(a(12,!1,o));const e=D(t,"bootstrap"),n=D(t,"mount"),i=D(t,"unmount");u.status=p,u.name=o,u.bootstrap=e,u.mount=n,u.unmount=i,u.timeouts=X(t.timeouts),t.update&&(u.update=D(t,"update"),l.update=function(t){return u.customProps=t,k((e=u,Promise.resolve().then((()=>{if(e.status!==w)throw Error(a(32,!1,A(e)));return e.status=g,z(e,"update").then((()=>(e.status=w,e))).catch((t=>{throw c(t,e,O)}))}))));var e})}));const d=h.then((()=>R(u,!0))),E=d.then((()=>x(u,!0)));let y,v;const T=new Promise(((t,e)=>{y=t,v=e}));return l={mount:()=>k(Promise.resolve().then((()=>{if(u.status!==m)throw Error(a(13,!1,o,u.status));return n.parcels[r]=u,x(u)}))),unmount:()=>k(u.unmountThisParcel()),getStatus:()=>u.status,loadPromise:k(h),bootstrapPromise:k(d),mountPromise:k(E),unmountPromise:k(T)},l}function k(t){return t.then((()=>null))}function H(t){const n=A(t);let r="function"==typeof t.customProps?t.customProps(n,window.location):t.customProps;("object"!=typeof r||null===r||Array.isArray(r))&&(r={},console.warn(a(40,!1),n,r));const o=S({},r,{name:n,mountParcel:W.bind(t),singleSpa:e});return b(t)&&(o.unmountSelf=t.unmountThisParcel),o}const K=1e3,F={bootstrap:{millis:4e3,dieOnTimeout:!1,warningMillis:K},mount:{millis:3e3,dieOnTimeout:!1,warningMillis:K},unmount:{millis:3e3,dieOnTimeout:!1,warningMillis:K},unload:{millis:3e3,dieOnTimeout:!1,warningMillis:K},update:{millis:3e3,dieOnTimeout:!1,warningMillis:K}};function J(t,e,n){if("number"!=typeof t||t<=0)throw Error(a(16,!1));F.bootstrap={millis:t,dieOnTimeout:e,warningMillis:n||K}}function Q(t,e,n){if("number"!=typeof t||t<=0)throw Error(a(17,!1));F.mount={millis:t,dieOnTimeout:e,warningMillis:n||K}}function V(t,e,n){if("number"!=typeof t||t<=0)throw Error(a(18,!1));F.unmount={millis:t,dieOnTimeout:e,warningMillis:n||K}}function q(t,e,n){if("number"!=typeof t||t<=0)throw Error(a(19,!1));F.unload={millis:t,dieOnTimeout:e,warningMillis:n||K}}function z(t,e){const n=t.timeouts[e],r=n.warningMillis,o=N(t);return new Promise(((i,s)=>{let u=!1,c=!1;t[e](H(t)).then((t=>{u=!0,i(t)})).catch((t=>{u=!0,s(t)})),setTimeout((()=>f(1)),r),setTimeout((()=>f(!0)),n.millis);const l=a(31,!1,e,o,A(t),n.millis);function f(t){if(!u)if(!0===t)c=!0,n.dieOnTimeout?s(Error(l)):console.error(l);else if(!c){const e=t,o=e*r;console.warn(l),o+r<n.millis&&setTimeout((()=>f(e+1)),r)}}}))}function X(t){const e={};for(let n in F)e[n]=S({},F[n],t&&t[n]||{});return e}function Y(t){return Promise.resolve().then((()=>{if(t.loadPromise)return t.loadPromise;if(t.status!==l&&t.status!==v)return t;let e,n;return t.status=f,t.loadPromise=Promise.resolve().then((()=>{const r=t.loadApp(H(t));if(!M(r))throw n=!0,Error(a(33,!1,A(t)));return r.then((n=>{let r;t.loadErrorTime=null,e=n,"object"!=typeof e&&(r=34),Object.prototype.hasOwnProperty.call(e,"bootstrap")&&!U(e.bootstrap)&&(r=35),U(e.mount)||(r=36),U(e.unmount)||(r=37);const o=N(e);if(r){let n;try{n=JSON.stringify(e)}catch(t){}return console.error(a(r,!1,o,A(t),n),e),i(void 0,t,O),t}return e.devtools&&e.devtools.overlays&&(t.devtools.overlays=S({},t.devtools.overlays,e.devtools.overlays)),t.status=p,t.bootstrap=D(e,"bootstrap"),t.mount=D(e,"mount"),t.unmount=D(e,"unmount"),t.unload=D(e,"unload"),t.timeouts=X(e.timeouts),delete t.loadPromise,t}))})).catch((e=>{let r;return delete t.loadPromise,n?r=O:(r=v,t.loadErrorTime=(new Date).getTime()),i(e,t,r),t}))}))}const Z="undefined"!=typeof window,tt={hashchange:[],popstate:[]},et=["hashchange","popstate"];function nt(t){let e;if("string"==typeof t)e=t;else if(this&&this.href)e=this.href;else{if(!(t&&t.currentTarget&&t.currentTarget.href&&t.preventDefault))throw Error(a(14,!1));e=t.currentTarget.href,t.preventDefault()}const n=ft(window.location.href),r=ft(e);0===e.indexOf("#")?window.location.hash=r.hash:n.host!==r.host&&r.host?window.location.href=e:r.pathname===n.pathname&&r.search===n.search?window.location.hash=r.hash:window.history.pushState(null,null,e)}function rt(t){if(t){const e=t[0].type;et.indexOf(e)>=0&&tt[e].forEach((e=>{try{e.apply(this,t)}catch(t){setTimeout((()=>{throw t}))}}))}}let ot;function it(){It([],arguments)}function st(t,e){return function(){const n=window.location.href,r=t.apply(this,arguments),o=window.location.href;return ot&&n===o||window.dispatchEvent(ut(window.history.state,e)),r}}function ut(t,e){let n;try{n=new PopStateEvent("popstate",{state:t})}catch(e){n=document.createEvent("PopStateEvent"),n.initPopStateEvent("popstate",!1,!1,t)}return n.singleSpa=!0,n.singleSpaTrigger=e,n}let at=null,ct=!1;function lt(t){if(ct)throw Error(a(43,!1));ot=!t||!t.hasOwnProperty("urlRerouteOnly")||t.urlRerouteOnly,ct=!0,at=window.history.replaceState,window.addEventListener("hashchange",it),window.addEventListener("popstate",it);const e=window.addEventListener,n=window.removeEventListener;window.addEventListener=function(t,n){if(!("function"==typeof n&&et.indexOf(t)>=0)||_(tt[t],(t=>t===n)))return e.apply(this,arguments);tt[t].push(n)},window.removeEventListener=function(t,e){if(!("function"==typeof e&&et.indexOf(t)>=0))return n.apply(this,arguments);tt[t]=tt[t].filter((t=>t!==e))},window.history.pushState=st(window.history.pushState,"pushState"),window.history.replaceState=st(at,"replaceState")}function ft(t){const e=document.createElement("a");return e.href=t,e}Z&&(window.singleSpaNavigate?console.warn(a(41,!1)):window.singleSpaNavigate=nt);let pt=!1;function ht(t=window.jQuery){if(t||window.$&&window.$.fn&&window.$.fn.jquery&&(t=window.$),t&&!pt){const e=t.fn.on,n=t.fn.off;t.fn.on=function(t,n){return mt.call(this,e,window.addEventListener,t,n,arguments)},t.fn.off=function(t,e){return mt.call(this,n,window.removeEventListener,t,e,arguments)},pt=!0}}function mt(t,e,n,r,o){return"string"!=typeof n?t.apply(this,o):(n.split(/\s+/).forEach((t=>{et.indexOf(t)>=0&&(e(t,r),n=n.replace(t,""))})),""===n.trim()?this:t.apply(this,o))}const dt={};function wt(t){return Promise.resolve().then((()=>{const e=dt[A(t)];if(!e)return t;if(t.status===l)return gt(t,e),t;if(t.status===y)return e.promise.then((()=>t));if(t.status!==m&&t.status!==v)return t;const n=t.status===v?Promise.resolve():z(t,"unload");return t.status=y,n.then((()=>(gt(t,e),t))).catch((n=>(function(t,e,n){delete dt[A(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,i(n,t,O),e.reject(n)}(t,e,n),t)))}))}function gt(t,e){delete dt[A(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,t.status=l,e.resolve()}function Et(t,e,n,r){dt[A(t)]={app:t,resolve:n,reject:r},Object.defineProperty(dt[A(t)],"promise",{get:e})}function yt(t){return dt[t]}const vt=[];function Ot(){return vt.filter(T).map(A)}function Tt(){return vt.map(A)}function Pt(t){const e=_(vt,(e=>A(e)===t));return e?e.status:null}let At=!1;function bt(t,e,n,r){const o=function(t,e,n,r){const o={name:null,loadApp:null,activeWhen:null,customProps:null};return"object"==typeof t?(function(t){if(Array.isArray(t)||null===t)throw Error(a(39,!1));const e=["name","app","activeWhen","customProps"],n=Object.keys(t).reduce(((t,n)=>e.indexOf(n)>=0?t:t.concat(n)),[]);if(0!==n.length)throw Error(a(38,!1,e.join(", "),n.join(", ")));if("string"!=typeof t.name||0===t.name.length)throw Error(a(20,!1));if("object"!=typeof t.app&&"function"!=typeof t.app)throw Error(a(20,!1));const r=t=>"string"==typeof t||"function"==typeof t;if(!(r(t.activeWhen)||Array.isArray(t.activeWhen)&&t.activeWhen.every(r)))throw Error(a(24,!1));if(!Dt(t.customProps))throw Error(a(22,!1))}(t),o.name=t.name,o.loadApp=t.app,o.activeWhen=t.activeWhen,o.customProps=t.customProps):(function(t,e,n,r){if("string"!=typeof t||0===t.length)throw Error(a(20,!1));if(!e)throw Error(a(23,!1));if("function"!=typeof n)throw Error(a(24,!1));if(!Dt(r))throw Error(a(22,!1))}(t,e,n,r),o.name=t,o.loadApp=e,o.activeWhen=n,o.customProps=r),o.loadApp="function"!=typeof(i=o.loadApp)?()=>Promise.resolve(i):i,o.customProps=function(t){return t||{}}(o.customProps),o.activeWhen=function(t){let e=Array.isArray(t)?t:[t];return e=e.map((t=>"function"==typeof t?t:Mt(t))),t=>e.some((e=>e(t)))}(o.activeWhen),o;var i}(t,e,n,r);if(Ct()||At||(At=!0,setTimeout((()=>{Ct()||console.warn(a(1,!1))}),5e3)),-1!==Tt().indexOf(o.name))throw Error(a(21,!1,o.name));vt.push(S({loadErrorTime:null,status:l,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},o)),Z&&(ht(),It())}function Nt(t=window.location){return vt.filter((e=>e.activeWhen(t))).map(A)}function St(t){if(0===vt.filter((e=>A(e)===t)).length)throw Error(a(25,!1,t));return(Z?_t(t,{waitForUnmount:!1}):Promise.resolve()).then((()=>{const e=vt.map(A).indexOf(t);vt.splice(e,1)}))}function _t(t,e={waitForUnmount:!1}){if("string"!=typeof t)throw Error(a(26,!1));const n=_(vt,(e=>A(e)===t));if(!n)throw Error(a(27,!1,t));const r=yt(A(n));if(e&&e.waitForUnmount){if(r)return r.promise;{const t=new Promise(((e,r)=>{Et(n,(()=>t),e,r)}));return t}}{let t;return r?(t=r.promise,Ut(n,r.resolve,r.reject)):t=new Promise(((e,r)=>{Et(n,(()=>t),e,r),Ut(n,e,r)})),t}}function Ut(t,e,n){Promise.resolve().then((()=>{if(_(Nt(),(e=>e===A(t))))return $t()})).then((()=>j(t).then(wt).then((()=>{e(),setTimeout((()=>{It()}))})))).catch(n)}function Dt(t){return!t||"function"==typeof t||"object"==typeof t&&null!==t&&!Array.isArray(t)}function Mt(t,e){const n=function(t,e){let n=0,r=!1,o="^";"/"!==t[0]&&(t="/"+t);for(let e=0;e<t.length;e++){const n=t[e],o=r&&"/"===n;(!r&&":"===n||o)&&i(e)}return i(t.length),new RegExp(o,"i");function i(i){const s=t.slice(n,i).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(o+=r?"[^/]+/?":s,i===t.length)if(r)e&&(o+="$");else{const t=e?"":".*";o="/"===o.charAt(o.length-1)?`${o}${t}$`:`${o}(/${t})?(#.*)?$`}r=!r,n=i}}(t,e);return t=>{let e=t.origin;e||(e=`${t.protocol}//${t.host}`);const r=t.href.replace(e,"").replace(t.search,"").split("?")[0];return n.test(r)}}let Lt=!1,Rt=[],jt=Z&&window.location.href;function $t(){return It()}function It(t=[],e,n=!1){if(Lt)return new Promise(((t,n)=>{Rt.push({resolve:t,reject:n,eventArguments:e})}));const{appsToUnload:o,appsToUnmount:i,appsToLoad:s,appsToMount:u}=function(){const t=[],e=[],n=[],r=[],o=(new Date).getTime();return vt.forEach((i=>{const s=i.status!==O&&P(i);switch(i.status){case v:s&&o-i.loadErrorTime>=200&&n.push(i);break;case l:case f:s&&n.push(i);break;case p:case m:!s&&yt(A(i))?t.push(i):s&&r.push(i);break;case w:s||e.push(i)}})),{appsToUnload:t,appsToUnmount:e,appsToLoad:n,appsToMount:r}}();let c,h=[],d=jt,g=jt=window.location.href;return Ct()?(Lt=!0,c=o.concat(s,i,u),Promise.resolve().then((()=>(N(0===c.length?"before-no-app-change":"before-app-change",b(!0)),N("before-routing-event",b(!0,{cancelNavigation:E})),Promise.all(h).then((n=>{if(n.some((t=>t)))return at.call(window.history,history.state,"",d.substring(location.origin.length)),jt=location.href,Lt=!1,It(t,e,!0);const r=o.map(wt),a=i.map(j).map((t=>t.then(wt))).concat(r),c=Promise.all(a);c.then((()=>{N("before-mount-routing-event",b(!0))}),(t=>{throw t}));const l=s.map((t=>Y(t).then((t=>xt(t,c))))),f=u.filter((t=>s.indexOf(t)<0)).map((t=>xt(t,c)));return c.catch((t=>{throw T(),t})).then((()=>(T(),Promise.all(l.concat(f)).catch((e=>{throw t.forEach((t=>t.reject(e))),e})).then(y).then((()=>{}),(t=>{throw t})))))})))))):(c=s,Promise.resolve().then((()=>{const t=s.map(Y);return Promise.all(t).then(T).then((()=>[])).catch((t=>{throw T(),t})).finally((()=>{}))})));function E(t=!0){const e="function"==typeof(null==t?void 0:t.then)?t:Promise.resolve(t);h.push(e.catch((t=>(console.warn(Error(a(42,!1))),console.warn(t),!1))))}function y(){const e=Ot();t.forEach((t=>t.resolve(e)));try{N(0===c.length?"no-app-change":"app-change",b()),N("routing-event",b())}catch(t){setTimeout((()=>{throw t}))}if(Lt=!1,Rt.length>0){const t=Rt;Rt=[],It(t)}return e}function T(){n||(t.forEach((t=>{rt(t.eventArguments)})),rt(e))}function b(t=!1,n){const r={},a={[w]:[],[m]:[],[l]:[],[O]:[]};t?(s.concat(u).forEach(((t,e)=>{p(t,w)})),o.forEach((t=>{p(t,l)})),i.forEach((t=>{p(t,m)}))):c.forEach((t=>{p(t)}));const f={detail:{newAppStatuses:r,appsByNewStatus:a,totalAppChanges:c.length,originalEvent:null==e?void 0:e[0],oldUrl:d,newUrl:g}};return n&&S(f.detail,n),f;function p(t,e){const n=A(t);e=e||Pt(n),r[n]=e,(a[e]=a[e]||[]).push(n)}}function N(t,e){n||window.dispatchEvent(new r(`single-spa:${t}`,e))}}function xt(t,e){return P(t)?R(t).then((t=>e.then((()=>P(t)?x(t):t)))):e.then((()=>t))}let Gt=!1;function Bt(t){Gt=!0,Z&&(lt(t),It())}function Ct(){return Gt}var Wt={getRawAppData:function(){return[...vt]},reroute:It,NOT_LOADED:l,toLoadPromise:Y,toBootstrapPromise:R,unregisterApplication:St,getProfilerData:function(){return L}};Z&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=Wt)}}})); | ||
/* single-spa@6.0.2 - SystemJS ES2015 - prod */ | ||
System.register([],(function(t){return{execute:function(){t({addErrorHandler:s,checkActivityFunctions:Nt,ensureJQuerySupport:ht,getAppNames:Tt,getAppStatus:Pt,getMountedApps:Ot,mountRootParcel:C,navigateToUrl:nt,patchHistoryApi:lt,pathToActiveWhen:Mt,registerApplication:bt,removeErrorHandler:u,setBootstrapMaxTime:J,setMountMaxTime:Q,setUnloadMaxTime:q,setUnmountMaxTime:V,start:Bt,triggerAppChange:$t,unloadApplication:_t,unregisterApplication:St});var e=Object.freeze({__proto__:null,get start(){return Bt},get ensureJQuerySupport(){return ht},get setBootstrapMaxTime(){return J},get setMountMaxTime(){return Q},get setUnmountMaxTime(){return V},get setUnloadMaxTime(){return q},get registerApplication(){return bt},get unregisterApplication(){return St},get getMountedApps(){return Ot},get getAppStatus(){return Pt},get unloadApplication(){return _t},get checkActivityFunctions(){return Nt},get getAppNames(){return Tt},get pathToActiveWhen(){return Mt},get navigateToUrl(){return nt},get patchHistoryApi(){return lt},get triggerAppChange(){return $t},get addErrorHandler(){return s},get removeErrorHandler(){return u},get mountRootParcel(){return C},get NOT_LOADED(){return l},get LOADING_SOURCE_CODE(){return f},get NOT_BOOTSTRAPPED(){return p},get BOOTSTRAPPING(){return h},get NOT_MOUNTED(){return m},get MOUNTING(){return d},get UPDATING(){return g},get LOAD_ERROR(){return v},get MOUNTED(){return w},get UNLOADING(){return y},get UNMOUNTING(){return E},get SKIP_BECAUSE_BROKEN(){return O}}),n=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}).CustomEvent,r=function(){try{var t=new n("cat",{detail:{foo:"bar"}});return"cat"===t.type&&"bar"===t.detail.foo}catch(t){}return!1}()?n:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(t,e){var n=document.createEvent("CustomEvent");return e?n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail):n.initCustomEvent(t,!1,!1,void 0),n}:function(t,e){var n=document.createEventObject();return n.type=t,e?(n.bubbles=Boolean(e.bubbles),n.cancelable=Boolean(e.cancelable),n.detail=e.detail):(n.bubbles=!1,n.cancelable=!1,n.detail=void 0),n};let o=[];function i(t,e,n){const r=c(t,e,n);o.length?o.forEach((t=>t(r))):setTimeout((()=>{throw r}))}function s(t){if("function"!=typeof t)throw Error(a(28,!1));o.push(t)}function u(t){if("function"!=typeof t)throw Error(a(29,!1));let e=!1;return o=o.filter((n=>{const r=n===t;return e=e||r,!r})),e}function a(t,e,...n){return`single-spa minified message #${t}: ${e?e+" ":""}See https://single-spa.js.org/error/?code=${t}${n.length?`&arg=${n.join("&arg=")}`:""}`}function c(t,e,n){const r=`${N(e)} '${A(e)}' died in status ${e.status}: `;let o;if(t instanceof Error){try{t.message=r+t.message}catch(t){}o=t}else{console.warn(a(30,!1,e.status,A(e)));try{o=Error(r+JSON.stringify(t))}catch(e){o=t}}return o.appOrParcelName=A(e),e.status=n,o}const l=t("NOT_LOADED","NOT_LOADED"),f=t("LOADING_SOURCE_CODE","LOADING_SOURCE_CODE"),p=t("NOT_BOOTSTRAPPED","NOT_BOOTSTRAPPED"),h=t("BOOTSTRAPPING","BOOTSTRAPPING"),m=t("NOT_MOUNTED","NOT_MOUNTED"),d=t("MOUNTING","MOUNTING"),w=t("MOUNTED","MOUNTED"),g=t("UPDATING","UPDATING"),E=t("UNMOUNTING","UNMOUNTING"),y=t("UNLOADING","UNLOADING"),v=t("LOAD_ERROR","LOAD_ERROR"),O=t("SKIP_BECAUSE_BROKEN","SKIP_BECAUSE_BROKEN");function T(t){return t.status===w}function P(t){try{return t.activeWhen(window.location)}catch(e){return i(e,t,O),!1}}function A(t){return t.name}function b(t){return Boolean(t.unmountThisParcel)}function N(t){return b(t)?"parcel":"application"}function S(){for(let t=arguments.length-1;t>0;t--)for(let e in arguments[t])"__proto__"!==e&&(arguments[t-1][e]=arguments[t][e]);return arguments[0]}function _(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return t[n];return null}function U(t){return t&&("function"==typeof t||(e=t,Array.isArray(e)&&!_(e,(t=>"function"!=typeof t))));var e}function D(t,e){let n=t[e]||[];n=Array.isArray(n)?n:[n],0===n.length&&(n=[()=>Promise.resolve()]);const r=N(t),o=A(t);return function(t){return n.reduce(((n,i,s)=>n.then((()=>{const n=i(t);return M(n)?n:Promise.reject(a(15,!1,r,o,e,s))}))),Promise.resolve())}}function M(t){return t&&"function"==typeof t.then&&"function"==typeof t.catch}let L=[];function R(t,e){return Promise.resolve().then((()=>t.status!==p?t:(t.status=h,t.bootstrap?z(t,"bootstrap").then(n).catch((n=>{if(e)throw c(n,t,O);return i(n,t,O),t})):Promise.resolve().then(n))));function n(){return t.status=m,t}}function j(t,e){return Promise.resolve().then((()=>{if(t.status!==w)return t;t.status=E;const n=Object.keys(t.parcels).map((e=>t.parcels[e].unmountThisParcel()));return Promise.all(n).then(r,(n=>r().then((()=>{const r=Error(n.message);if(e)throw c(r,t,O);i(r,t,O)})))).then((()=>t));function r(){return z(t,"unmount").then((()=>{t.status=m}),(n=>{if(e)throw c(n,t,O);i(n,t,O)}))}}))}let $=!1,I=!1;function x(t,e){return Promise.resolve().then((()=>t.status!==m?t:($||(window.dispatchEvent(new r("single-spa:before-first-mount")),$=!0),t.status=d,z(t,"mount").then((()=>(t.status=w,I||(window.dispatchEvent(new r("single-spa:first-mount")),I=!0),t))).catch((n=>{return t.status=w,j(t,!0).then(r,r);function r(){if(e)throw c(n,t,O);return i(n,t,O),t}})))))}let G=0;const B={parcels:{}};function C(){return W.apply(B,arguments)}function W(t,e){const n=this;if(!t||"object"!=typeof t&&"function"!=typeof t)throw Error(a(2,!1));if(t.name&&"string"!=typeof t.name)throw Error(a(3,!1,typeof t.name));const r=G++;let o=t.name||`parcel-${r}`;if("object"!=typeof e)throw Error(a(4,!1,o,typeof e));if(!e.domElement)throw Error(a(5,!1,o));const i="function"==typeof t,s=i?t:()=>Promise.resolve(t),u={id:r,parcels:{},status:i?f:p,customProps:e,parentName:A(n),unmountThisParcel:()=>E.then((()=>{if(u.status!==w)throw Error(a(6,!1,o,u.status));return j(u,!0)})).then((t=>(u.parentName&&delete n.parcels[u.id],t))).then((t=>(y(t),t))).catch((t=>{throw u.status=O,v(t),t}))};let l;n.parcels[r]=u;let h=s();if(!h||"function"!=typeof h.then)throw Error(a(7,!1));h=h.then((t=>{if(!t)throw Error(a(8,!1));if(o=t.name||`parcel-${r}`,Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!U(t.bootstrap))throw Error(a(9,!1,o));if(!U(t.mount))throw Error(a(10,!1,o));if(!U(t.unmount))throw Error(a(11,!1,o));if(t.update&&!U(t.update))throw Error(a(12,!1,o));const e=D(t,"bootstrap"),n=D(t,"mount"),i=D(t,"unmount");u.status=p,u.name=o,u.bootstrap=e,u.mount=n,u.unmount=i,u.timeouts=X(t.timeouts),t.update&&(u.update=D(t,"update"),l.update=function(t){return u.customProps=t,k((e=u,Promise.resolve().then((()=>{if(e.status!==w)throw Error(a(32,!1,A(e)));return e.status=g,z(e,"update").then((()=>(e.status=w,e))).catch((t=>{throw c(t,e,O)}))}))));var e})}));const d=h.then((()=>R(u,!0))),E=d.then((()=>x(u,!0)));let y,v;const T=new Promise(((t,e)=>{y=t,v=e}));return l={mount:()=>k(Promise.resolve().then((()=>{if(u.status!==m)throw Error(a(13,!1,o,u.status));return n.parcels[r]=u,x(u)}))),unmount:()=>k(u.unmountThisParcel()),getStatus:()=>u.status,loadPromise:k(h),bootstrapPromise:k(d),mountPromise:k(E),unmountPromise:k(T)},l}function k(t){return t.then((()=>null))}function H(t){const n=A(t);let r="function"==typeof t.customProps?t.customProps(n,window.location):t.customProps;("object"!=typeof r||null===r||Array.isArray(r))&&(r={},console.warn(a(40,!1),n,r));const o=S({},r,{name:n,mountParcel:W.bind(t),singleSpa:e});return b(t)&&(o.unmountSelf=t.unmountThisParcel),o}const K=1e3,F={bootstrap:{millis:4e3,dieOnTimeout:!1,warningMillis:K},mount:{millis:3e3,dieOnTimeout:!1,warningMillis:K},unmount:{millis:3e3,dieOnTimeout:!1,warningMillis:K},unload:{millis:3e3,dieOnTimeout:!1,warningMillis:K},update:{millis:3e3,dieOnTimeout:!1,warningMillis:K}};function J(t,e,n){if("number"!=typeof t||t<=0)throw Error(a(16,!1));F.bootstrap={millis:t,dieOnTimeout:e,warningMillis:n||K}}function Q(t,e,n){if("number"!=typeof t||t<=0)throw Error(a(17,!1));F.mount={millis:t,dieOnTimeout:e,warningMillis:n||K}}function V(t,e,n){if("number"!=typeof t||t<=0)throw Error(a(18,!1));F.unmount={millis:t,dieOnTimeout:e,warningMillis:n||K}}function q(t,e,n){if("number"!=typeof t||t<=0)throw Error(a(19,!1));F.unload={millis:t,dieOnTimeout:e,warningMillis:n||K}}function z(t,e){const n=t.timeouts[e],r=n.warningMillis,o=N(t);return new Promise(((i,s)=>{let u=!1,c=!1;t[e](H(t)).then((t=>{u=!0,i(t)})).catch((t=>{u=!0,s(t)})),setTimeout((()=>f(1)),r),setTimeout((()=>f(!0)),n.millis);const l=a(31,!1,e,o,A(t),n.millis);function f(t){if(!u)if(!0===t)c=!0,n.dieOnTimeout?s(Error(l)):console.error(l);else if(!c){const e=t,o=e*r;console.warn(l),o+r<n.millis&&setTimeout((()=>f(e+1)),r)}}}))}function X(t){const e={};for(let n in F)e[n]=S({},F[n],t&&t[n]||{});return e}function Y(t){return Promise.resolve().then((()=>{if(t.loadPromise)return t.loadPromise;if(t.status!==l&&t.status!==v)return t;let e,n;return t.status=f,t.loadPromise=Promise.resolve().then((()=>{const r=t.loadApp(H(t));if(!M(r))throw n=!0,Error(a(33,!1,A(t)));return r.then((n=>{let r;t.loadErrorTime=null,e=n,"object"!=typeof e&&(r=34),Object.prototype.hasOwnProperty.call(e,"bootstrap")&&!U(e.bootstrap)&&(r=35),U(e.mount)||(r=36),U(e.unmount)||(r=37);const o=N(e);if(r){let n;try{n=JSON.stringify(e)}catch(t){}return console.error(a(r,!1,o,A(t),n),e),i(void 0,t,O),t}return e.devtools&&e.devtools.overlays&&(t.devtools.overlays=S({},t.devtools.overlays,e.devtools.overlays)),t.status=p,t.bootstrap=D(e,"bootstrap"),t.mount=D(e,"mount"),t.unmount=D(e,"unmount"),t.unload=D(e,"unload"),t.timeouts=X(e.timeouts),delete t.loadPromise,t}))})).catch((e=>{let r;return delete t.loadPromise,n?r=O:(r=v,t.loadErrorTime=(new Date).getTime()),i(e,t,r),t}))}))}const Z="undefined"!=typeof window,tt={hashchange:[],popstate:[]},et=["hashchange","popstate"];function nt(t){let e;if("string"==typeof t)e=t;else if(this&&this.href)e=this.href;else{if(!(t&&t.currentTarget&&t.currentTarget.href&&t.preventDefault))throw Error(a(14,!1));e=t.currentTarget.href,t.preventDefault()}const n=ft(window.location.href),r=ft(e);0===e.indexOf("#")?window.location.hash=r.hash:n.host!==r.host&&r.host?window.location.href=e:r.pathname===n.pathname&&r.search===n.search?window.location.hash=r.hash:window.history.pushState(null,null,e)}function rt(t){if(t){const e=t[0].type;et.indexOf(e)>=0&&tt[e].forEach((e=>{try{e.apply(this,t)}catch(t){setTimeout((()=>{throw t}))}}))}}let ot;function it(){It([],arguments)}function st(t,e){return function(){const n=window.location.href,r=t.apply(this,arguments),o=window.location.href;return ot&&n===o||window.dispatchEvent(ut(window.history.state,e)),r}}function ut(t,e){let n;try{n=new PopStateEvent("popstate",{state:t})}catch(e){n=document.createEvent("PopStateEvent"),n.initPopStateEvent("popstate",!1,!1,t)}return n.singleSpa=!0,n.singleSpaTrigger=e,n}let at=null,ct=!1;function lt(t){if(ct)throw Error(a(43,!1));ot=!t||!t.hasOwnProperty("urlRerouteOnly")||t.urlRerouteOnly,ct=!0,at=window.history.replaceState,window.addEventListener("hashchange",it),window.addEventListener("popstate",it);const e=window.addEventListener,n=window.removeEventListener;window.addEventListener=function(t,n){if(!("function"==typeof n&&et.indexOf(t)>=0)||_(tt[t],(t=>t===n)))return e.apply(this,arguments);tt[t].push(n)},window.removeEventListener=function(t,e){return"function"==typeof e&&et.indexOf(t)>=0&&(tt[t]=tt[t].filter((t=>t!==e))),n.apply(this,arguments)},window.history.pushState=st(window.history.pushState,"pushState"),window.history.replaceState=st(at,"replaceState")}function ft(t){const e=document.createElement("a");return e.href=t,e}Z&&(window.singleSpaNavigate?console.warn(a(41,!1)):window.singleSpaNavigate=nt);let pt=!1;function ht(t=window.jQuery){if(t||window.$&&window.$.fn&&window.$.fn.jquery&&(t=window.$),t&&!pt){const e=t.fn.on,n=t.fn.off;t.fn.on=function(t,n){return mt.call(this,e,window.addEventListener,t,n,arguments)},t.fn.off=function(t,e){return mt.call(this,n,window.removeEventListener,t,e,arguments)},pt=!0}}function mt(t,e,n,r,o){return"string"!=typeof n?t.apply(this,o):(n.split(/\s+/).forEach((t=>{et.indexOf(t)>=0&&(e(t,r),n=n.replace(t,""))})),""===n.trim()?this:t.apply(this,o))}const dt={};function wt(t){return Promise.resolve().then((()=>{const e=dt[A(t)];if(!e)return t;if(t.status===l)return gt(t,e),t;if(t.status===y)return e.promise.then((()=>t));if(t.status!==m&&t.status!==v)return t;const n=t.status===v?Promise.resolve():z(t,"unload");return t.status=y,n.then((()=>(gt(t,e),t))).catch((n=>(function(t,e,n){delete dt[A(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,i(n,t,O),e.reject(n)}(t,e,n),t)))}))}function gt(t,e){delete dt[A(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,t.status=l,e.resolve()}function Et(t,e,n,r){dt[A(t)]={app:t,resolve:n,reject:r},Object.defineProperty(dt[A(t)],"promise",{get:e})}function yt(t){return dt[t]}const vt=[];function Ot(){return vt.filter(T).map(A)}function Tt(){return vt.map(A)}function Pt(t){const e=_(vt,(e=>A(e)===t));return e?e.status:null}let At=!1;function bt(t,e,n,r){const o=function(t,e,n,r){const o={name:null,loadApp:null,activeWhen:null,customProps:null};return"object"==typeof t?(function(t){if(Array.isArray(t)||null===t)throw Error(a(39,!1));const e=["name","app","activeWhen","customProps"],n=Object.keys(t).reduce(((t,n)=>e.indexOf(n)>=0?t:t.concat(n)),[]);if(0!==n.length)throw Error(a(38,!1,e.join(", "),n.join(", ")));if("string"!=typeof t.name||0===t.name.length)throw Error(a(20,!1));if("object"!=typeof t.app&&"function"!=typeof t.app)throw Error(a(20,!1));const r=t=>"string"==typeof t||"function"==typeof t;if(!(r(t.activeWhen)||Array.isArray(t.activeWhen)&&t.activeWhen.every(r)))throw Error(a(24,!1));if(!Dt(t.customProps))throw Error(a(22,!1))}(t),o.name=t.name,o.loadApp=t.app,o.activeWhen=t.activeWhen,o.customProps=t.customProps):(function(t,e,n,r){if("string"!=typeof t||0===t.length)throw Error(a(20,!1));if(!e)throw Error(a(23,!1));if("function"!=typeof n)throw Error(a(24,!1));if(!Dt(r))throw Error(a(22,!1))}(t,e,n,r),o.name=t,o.loadApp=e,o.activeWhen=n,o.customProps=r),o.loadApp="function"!=typeof(i=o.loadApp)?()=>Promise.resolve(i):i,o.customProps=function(t){return t||{}}(o.customProps),o.activeWhen=function(t){let e=Array.isArray(t)?t:[t];return e=e.map((t=>"function"==typeof t?t:Mt(t))),t=>e.some((e=>e(t)))}(o.activeWhen),o;var i}(t,e,n,r);if(Ct()||At||(At=!0,setTimeout((()=>{Ct()||console.warn(a(1,!1))}),5e3)),-1!==Tt().indexOf(o.name))throw Error(a(21,!1,o.name));vt.push(S({loadErrorTime:null,status:l,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},o)),Z&&(ht(),It())}function Nt(t=window.location){return vt.filter((e=>e.activeWhen(t))).map(A)}function St(t){if(0===vt.filter((e=>A(e)===t)).length)throw Error(a(25,!1,t));return(Z?_t(t,{waitForUnmount:!1}):Promise.resolve()).then((()=>{const e=vt.map(A).indexOf(t);vt.splice(e,1)}))}function _t(t,e={waitForUnmount:!1}){if("string"!=typeof t)throw Error(a(26,!1));const n=_(vt,(e=>A(e)===t));if(!n)throw Error(a(27,!1,t));const r=yt(A(n));if(e&&e.waitForUnmount){if(r)return r.promise;{const t=new Promise(((e,r)=>{Et(n,(()=>t),e,r)}));return t}}{let t;return r?(t=r.promise,Ut(n,r.resolve,r.reject)):t=new Promise(((e,r)=>{Et(n,(()=>t),e,r),Ut(n,e,r)})),t}}function Ut(t,e,n){Promise.resolve().then((()=>{if(_(Nt(),(e=>e===A(t))))return $t()})).then((()=>j(t).then(wt).then((()=>{e(),setTimeout((()=>{It()}))})))).catch(n)}function Dt(t){return!t||"function"==typeof t||"object"==typeof t&&null!==t&&!Array.isArray(t)}function Mt(t,e){const n=function(t,e){let n=0,r=!1,o="^";"/"!==t[0]&&(t="/"+t);for(let e=0;e<t.length;e++){const n=t[e],o=r&&"/"===n;(!r&&":"===n||o)&&i(e)}return i(t.length),new RegExp(o,"i");function i(i){const s=t.slice(n,i).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(o+=r?"[^/]+/?":s,i===t.length)if(r)e&&(o+="$");else{const t=e?"":".*";o="/"===o.charAt(o.length-1)?`${o}${t}$`:`${o}(/${t})?(#.*)?$`}r=!r,n=i}}(t,e);return t=>{let e=t.origin;e||(e=`${t.protocol}//${t.host}`);const r=t.href.replace(e,"").replace(t.search,"").split("?")[0];return n.test(r)}}let Lt=!1,Rt=[],jt=Z&&window.location.href;function $t(){return It()}function It(t=[],e,n=!1){if(Lt)return new Promise(((t,n)=>{Rt.push({resolve:t,reject:n,eventArguments:e})}));const{appsToUnload:o,appsToUnmount:i,appsToLoad:s,appsToMount:u}=function(){const t=[],e=[],n=[],r=[],o=(new Date).getTime();return vt.forEach((i=>{const s=i.status!==O&&P(i);switch(i.status){case v:s&&o-i.loadErrorTime>=200&&n.push(i);break;case l:case f:s&&n.push(i);break;case p:case m:!s&&yt(A(i))?t.push(i):s&&r.push(i);break;case w:s||e.push(i)}})),{appsToUnload:t,appsToUnmount:e,appsToLoad:n,appsToMount:r}}();let c,h=[],d=jt,g=jt=window.location.href;return Ct()?(Lt=!0,c=o.concat(s,i,u),Promise.resolve().then((()=>(N(0===c.length?"before-no-app-change":"before-app-change",b(!0)),N("before-routing-event",b(!0,{cancelNavigation:E})),Promise.all(h).then((n=>{if(n.some((t=>t)))return at.call(window.history,history.state,"",d.substring(location.origin.length)),jt=location.href,Lt=!1,It(t,e,!0);const r=o.map(wt),a=i.map(j).map((t=>t.then(wt))).concat(r),c=Promise.all(a);c.then((()=>{N("before-mount-routing-event",b(!0))}),(t=>{throw t}));const l=s.map((t=>Y(t).then((t=>xt(t,c))))),f=u.filter((t=>s.indexOf(t)<0)).map((t=>xt(t,c)));return c.catch((t=>{throw T(),t})).then((()=>(T(),Promise.all(l.concat(f)).catch((e=>{throw t.forEach((t=>t.reject(e))),e})).then(y).then((()=>{}),(t=>{throw t})))))})))))):(c=s,Promise.resolve().then((()=>{const t=s.map(Y);return Promise.all(t).then(T).then((()=>[])).catch((t=>{throw T(),t})).finally((()=>{}))})));function E(t=!0){const e="function"==typeof(null==t?void 0:t.then)?t:Promise.resolve(t);h.push(e.catch((t=>(console.warn(Error(a(42,!1))),console.warn(t),!1))))}function y(){const e=Ot();t.forEach((t=>t.resolve(e)));try{N(0===c.length?"no-app-change":"app-change",b()),N("routing-event",b())}catch(t){setTimeout((()=>{throw t}))}if(Lt=!1,Rt.length>0){const t=Rt;Rt=[],It(t)}return e}function T(){n||(t.forEach((t=>{rt(t.eventArguments)})),rt(e))}function b(t=!1,n){const r={},a={[w]:[],[m]:[],[l]:[],[O]:[]};t?(s.concat(u).forEach(((t,e)=>{p(t,w)})),o.forEach((t=>{p(t,l)})),i.forEach((t=>{p(t,m)}))):c.forEach((t=>{p(t)}));const f={detail:{newAppStatuses:r,appsByNewStatus:a,totalAppChanges:c.length,originalEvent:null==e?void 0:e[0],oldUrl:d,newUrl:g}};return n&&S(f.detail,n),f;function p(t,e){const n=A(t);e=e||Pt(n),r[n]=e,(a[e]=a[e]||[]).push(n)}}function N(t,e){n||window.dispatchEvent(new r(`single-spa:${t}`,e))}}function xt(t,e){return P(t)?R(t).then((t=>e.then((()=>P(t)?x(t):t)))):e.then((()=>t))}let Gt=!1;function Bt(t){Gt=!0,Z&&(lt(t),It())}function Ct(){return Gt}var Wt={getRawAppData:function(){return[...vt]},reroute:It,NOT_LOADED:l,toLoadPromise:Y,toBootstrapPromise:R,unregisterApplication:St,getProfilerData:function(){return L}};Z&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=Wt)}}})); | ||
//# sourceMappingURL=single-spa.min.js.map |
@@ -1,3 +0,3 @@ | ||
/* single-spa@6.0.1 - ESM ES5 - prod */ | ||
var t=Object.freeze({__proto__:null,get start(){return Ct},get ensureJQuerySupport(){return ht},get setBootstrapMaxTime(){return J},get setMountMaxTime(){return Q},get setUnmountMaxTime(){return V},get setUnloadMaxTime(){return q},get registerApplication(){return Nt},get unregisterApplication(){return _t},get getMountedApps(){return Ot},get getAppStatus(){return Tt},get unloadApplication(){return Dt},get checkActivityFunctions(){return St},get getAppNames(){return bt},get pathToActiveWhen(){return Mt},get navigateToUrl(){return et},get patchHistoryApi(){return ft},get triggerAppChange(){return It},get addErrorHandler(){return a},get removeErrorHandler(){return c},get mountRootParcel(){return $},get NOT_LOADED(){return l},get LOADING_SOURCE_CODE(){return p},get NOT_BOOTSTRAPPED(){return h},get BOOTSTRAPPING(){return m},get NOT_MOUNTED(){return v},get MOUNTING(){return d},get UPDATING(){return g},get LOAD_ERROR(){return P},get MOUNTED(){return w},get UNLOADING(){return E},get UNMOUNTING(){return y},get SKIP_BECAUSE_BROKEN(){return O}});function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t,n,r){return n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t}var e=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}).CustomEvent,o=function(){try{var t=new e("cat",{detail:{foo:"bar"}});return"cat"===t.type&&"bar"===t.detail.foo}catch(t){}return!1}()?e:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(t,n){var r=document.createEvent("CustomEvent");return n?r.initCustomEvent(t,n.bubbles,n.cancelable,n.detail):r.initCustomEvent(t,!1,!1,void 0),r}:function(t,n){var r=document.createEventObject();return r.type=t,n?(r.bubbles=Boolean(n.bubbles),r.cancelable=Boolean(n.cancelable),r.detail=n.detail):(r.bubbles=!1,r.cancelable=!1,r.detail=void 0),r},i=[];function u(t,n,r){var e=f(t,n,r);i.length?i.forEach((function(t){return t(e)})):setTimeout((function(){throw e}))}function a(t){if("function"!=typeof t)throw Error(s(28,!1));i.push(t)}function c(t){if("function"!=typeof t)throw Error(s(29,!1));var n=!1;return i=i.filter((function(r){var e=r===t;return n=n||e,!e})),n}function s(t,n){for(var r=arguments.length,e=new Array(r>2?r-2:0),o=2;o<r;o++)e[o-2]=arguments[o];return"single-spa minified message #".concat(t,": ").concat(n?n+" ":"","See https://single-spa.js.org/error/?code=").concat(t).concat(e.length?"&arg=".concat(e.join("&arg=")):"")}function f(t,n,r){var e,o="".concat(S(n)," '").concat(A(n),"' died in status ").concat(n.status,": ");if(t instanceof Error){try{t.message=o+t.message}catch(t){}e=t}else{console.warn(s(30,!1,n.status,A(n)));try{e=Error(o+JSON.stringify(t))}catch(n){e=t}}return e.appOrParcelName=A(n),n.status=r,e}var l="NOT_LOADED",p="LOADING_SOURCE_CODE",h="NOT_BOOTSTRAPPED",m="BOOTSTRAPPING",v="NOT_MOUNTED",d="MOUNTING",w="MOUNTED",g="UPDATING",y="UNMOUNTING",E="UNLOADING",P="LOAD_ERROR",O="SKIP_BECAUSE_BROKEN";function b(t){return t.status===w}function T(t){try{return t.activeWhen(window.location)}catch(n){return u(n,t,O),!1}}function A(t){return t.name}function N(t){return Boolean(t.unmountThisParcel)}function S(t){return N(t)?"parcel":"application"}function _(){for(var t=arguments.length-1;t>0;t--)for(var n in arguments[t])"__proto__"!==n&&(arguments[t-1][n]=arguments[t][n]);return arguments[0]}function D(t,n){for(var r=0;r<t.length;r++)if(n(t[r]))return t[r];return null}function U(t){return t&&("function"==typeof t||(n=t,Array.isArray(n)&&!D(n,(function(t){return"function"!=typeof t}))));var n}function j(t,n){var r=t[n]||[];0===(r=Array.isArray(r)?r:[r]).length&&(r=[function(){return Promise.resolve()}]);var e=S(t),o=A(t);return function(t){return r.reduce((function(r,i,u){return r.then((function(){var r=i(t);return M(r)?r:Promise.reject(s(15,!1,e,o,n,u))}))}),Promise.resolve())}}function M(t){return t&&"function"==typeof t.then&&"function"==typeof t.catch}var L=[];function R(t,n){return Promise.resolve().then((function(){return t.status!==h?t:(t.status=m,t.bootstrap?z(t,"bootstrap").then(r).catch((function(r){if(n)throw f(r,t,O);return u(r,t,O),t})):Promise.resolve().then(r))}));function r(){return t.status=v,t}}function x(t,n){return Promise.resolve().then((function(){if(t.status!==w)return t;t.status=y;var r=Object.keys(t.parcels).map((function(n){return t.parcels[n].unmountThisParcel()}));return Promise.all(r).then(e,(function(r){return e().then((function(){var e=Error(r.message);if(n)throw f(e,t,O);u(e,t,O)}))})).then((function(){return t}));function e(){return z(t,"unmount").then((function(){t.status=v}),(function(r){if(n)throw f(r,t,O);u(r,t,O)}))}}))}var I=!1,B=!1;function G(t,n){return Promise.resolve().then((function(){return t.status!==v?t:(I||(window.dispatchEvent(new o("single-spa:before-first-mount")),I=!0),t.status=d,z(t,"mount").then((function(){return t.status=w,B||(window.dispatchEvent(new o("single-spa:first-mount")),B=!0),t})).catch((function(r){return t.status=w,x(t,!0).then(e,e);function e(){if(n)throw f(r,t,O);return u(r,t,O),t}})))}))}var W=0,C={parcels:{}};function $(){return k.apply(C,arguments)}function k(t,r){var e=this;if(!t||"object"!==n(t)&&"function"!=typeof t)throw Error(s(2,!1));if(t.name&&"string"!=typeof t.name)throw Error(s(3,!1,n(t.name)));var o=W++,i=t.name||"parcel-".concat(o);if("object"!==n(r))throw Error(s(4,!1,i,n(r)));if(!r.domElement)throw Error(s(5,!1,i));var u,a="function"==typeof t,c=a?t:function(){return Promise.resolve(t)},l={id:o,parcels:{},status:a?p:h,customProps:r,parentName:A(e),unmountThisParcel:function(){return P.then((function(){if(l.status!==w)throw Error(s(6,!1,i,l.status));return x(l,!0)})).then((function(t){return l.parentName&&delete e.parcels[l.id],t})).then((function(t){return d(t),t})).catch((function(t){throw l.status=O,y(t),t}))}};e.parcels[o]=l;var m=c();if(!m||"function"!=typeof m.then)throw Error(s(7,!1));var d,y,E=(m=m.then((function(t){if(!t)throw Error(s(8,!1));if(i=t.name||"parcel-".concat(o),Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!U(t.bootstrap))throw Error(s(9,!1,i));if(!U(t.mount))throw Error(s(10,!1,i));if(!U(t.unmount))throw Error(s(11,!1,i));if(t.update&&!U(t.update))throw Error(s(12,!1,i));var n=j(t,"bootstrap"),r=j(t,"mount"),e=j(t,"unmount");l.status=h,l.name=i,l.bootstrap=n,l.mount=r,l.unmount=e,l.timeouts=X(t.timeouts),t.update&&(l.update=j(t,"update"),u.update=function(t){return l.customProps=t,F((n=l,Promise.resolve().then((function(){if(n.status!==w)throw Error(s(32,!1,A(n)));return n.status=g,z(n,"update").then((function(){return n.status=w,n})).catch((function(t){throw f(t,n,O)}))}))));var n})}))).then((function(){return R(l,!0)})),P=E.then((function(){return G(l,!0)})),b=new Promise((function(t,n){d=t,y=n}));return u={mount:function(){return F(Promise.resolve().then((function(){if(l.status!==v)throw Error(s(13,!1,i,l.status));return e.parcels[o]=l,G(l)})))},unmount:function(){return F(l.unmountThisParcel())},getStatus:function(){return l.status},loadPromise:F(m),bootstrapPromise:F(E),mountPromise:F(P),unmountPromise:F(b)}}function F(t){return t.then((function(){return null}))}function K(r){var e=A(r),o="function"==typeof r.customProps?r.customProps(e,window.location):r.customProps;("object"!==n(o)||null===o||Array.isArray(o))&&(o={},console.warn(s(40,!1),e,o));var i=_({},o,{name:e,mountParcel:k.bind(r),singleSpa:t});return N(r)&&(i.unmountSelf=r.unmountThisParcel),i}var H={bootstrap:{millis:4e3,dieOnTimeout:!1,warningMillis:1e3},mount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unmount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unload:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},update:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3}};function J(t,n,r){if("number"!=typeof t||t<=0)throw Error(s(16,!1));H.bootstrap={millis:t,dieOnTimeout:n,warningMillis:r||1e3}}function Q(t,n,r){if("number"!=typeof t||t<=0)throw Error(s(17,!1));H.mount={millis:t,dieOnTimeout:n,warningMillis:r||1e3}}function V(t,n,r){if("number"!=typeof t||t<=0)throw Error(s(18,!1));H.unmount={millis:t,dieOnTimeout:n,warningMillis:r||1e3}}function q(t,n,r){if("number"!=typeof t||t<=0)throw Error(s(19,!1));H.unload={millis:t,dieOnTimeout:n,warningMillis:r||1e3}}function z(t,n){var r=t.timeouts[n],e=r.warningMillis,o=S(t);return new Promise((function(i,u){var a=!1,c=!1;t[n](K(t)).then((function(t){a=!0,i(t)})).catch((function(t){a=!0,u(t)})),setTimeout((function(){return l(1)}),e),setTimeout((function(){return l(!0)}),r.millis);var f=s(31,!1,n,o,A(t),r.millis);function l(t){if(!a)if(!0===t)c=!0,r.dieOnTimeout?u(Error(f)):console.error(f);else if(!c){var n=t,o=n*e;console.warn(f),o+e<r.millis&&setTimeout((function(){return l(n+1)}),e)}}}))}function X(t){var n={};for(var r in H)n[r]=_({},H[r],t&&t[r]||{});return n}function Y(t){return Promise.resolve().then((function(){return t.loadPromise?t.loadPromise:t.status!==l&&t.status!==P?t:(t.status=p,t.loadPromise=Promise.resolve().then((function(){var o=t.loadApp(K(t));if(!M(o))throw e=!0,Error(s(33,!1,A(t)));return o.then((function(e){var o;t.loadErrorTime=null,"object"!==n(r=e)&&(o=34),Object.prototype.hasOwnProperty.call(r,"bootstrap")&&!U(r.bootstrap)&&(o=35),U(r.mount)||(o=36),U(r.unmount)||(o=37);var i=S(r);if(o){var a;try{a=JSON.stringify(r)}catch(t){}return console.error(s(o,!1,i,A(t),a),r),u(void 0,t,O),t}return r.devtools&&r.devtools.overlays&&(t.devtools.overlays=_({},t.devtools.overlays,r.devtools.overlays)),t.status=h,t.bootstrap=j(r,"bootstrap"),t.mount=j(r,"mount"),t.unmount=j(r,"unmount"),t.unload=j(r,"unload"),t.timeouts=X(r.timeouts),delete t.loadPromise,t}))})).catch((function(n){var r;return delete t.loadPromise,e?r=O:(r=P,t.loadErrorTime=(new Date).getTime()),u(n,t,r),t})));var r,e}))}var Z,tt="undefined"!=typeof window,nt={hashchange:[],popstate:[]},rt=["hashchange","popstate"];function et(t){var n;if("string"==typeof t)n=t;else if(this&&this.href)n=this.href;else{if(!(t&&t.currentTarget&&t.currentTarget.href&&t.preventDefault))throw Error(s(14,!1));n=t.currentTarget.href,t.preventDefault()}var r=lt(window.location.href),e=lt(n);0===n.indexOf("#")?window.location.hash=e.hash:r.host!==e.host&&e.host?window.location.href=n:e.pathname===r.pathname&&e.search===r.search?window.location.hash=e.hash:window.history.pushState(null,null,n)}function ot(t){var n=this;if(t){var r=t[0].type;rt.indexOf(r)>=0&&nt[r].forEach((function(r){try{r.apply(n,t)}catch(t){setTimeout((function(){throw t}))}}))}}function it(){Bt([],arguments)}function ut(t,n){return function(){var r=window.location.href,e=t.apply(this,arguments),o=window.location.href;return Z&&r===o||window.dispatchEvent(at(window.history.state,n)),e}}function at(t,n){var r;try{r=new PopStateEvent("popstate",{state:t})}catch(n){(r=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,t)}return r.singleSpa=!0,r.singleSpaTrigger=n,r}var ct=null,st=!1;function ft(t){if(st)throw Error(s(43,!1));Z=!t||!t.hasOwnProperty("urlRerouteOnly")||t.urlRerouteOnly,st=!0,ct=window.history.replaceState,window.addEventListener("hashchange",it),window.addEventListener("popstate",it);var n=window.addEventListener,r=window.removeEventListener;window.addEventListener=function(t,r){if(!("function"==typeof r&&rt.indexOf(t)>=0)||D(nt[t],(function(t){return t===r})))return n.apply(this,arguments);nt[t].push(r)},window.removeEventListener=function(t,n){if(!("function"==typeof n&&rt.indexOf(t)>=0))return r.apply(this,arguments);nt[t]=nt[t].filter((function(t){return t!==n}))},window.history.pushState=ut(window.history.pushState,"pushState"),window.history.replaceState=ut(ct,"replaceState")}function lt(t){var n=document.createElement("a");return n.href=t,n}tt&&(window.singleSpaNavigate?console.warn(s(41,!1)):window.singleSpaNavigate=et);var pt=!1;function ht(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.jQuery;if(t||window.$&&window.$.fn&&window.$.fn.jquery&&(t=window.$),t&&!pt){var n=t.fn.on,r=t.fn.off;t.fn.on=function(t,r){return mt.call(this,n,window.addEventListener,t,r,arguments)},t.fn.off=function(t,n){return mt.call(this,r,window.removeEventListener,t,n,arguments)},pt=!0}}function mt(t,n,r,e,o){return"string"!=typeof r?t.apply(this,o):(r.split(/\s+/).forEach((function(t){rt.indexOf(t)>=0&&(n(t,e),r=r.replace(t,""))})),""===r.trim()?this:t.apply(this,o))}var vt={};function dt(t){return Promise.resolve().then((function(){var n=vt[A(t)];if(!n)return t;if(t.status===l)return wt(t,n),t;if(t.status===E)return n.promise.then((function(){return t}));if(t.status!==v&&t.status!==P)return t;var r=t.status===P?Promise.resolve():z(t,"unload");return t.status=E,r.then((function(){return wt(t,n),t})).catch((function(r){return function(t,n,r){delete vt[A(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,u(r,t,O),n.reject(r)}(t,n,r),t}))}))}function wt(t,n){delete vt[A(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,t.status=l,n.resolve()}function gt(t,n,r,e){vt[A(t)]={app:t,resolve:r,reject:e},Object.defineProperty(vt[A(t)],"promise",{get:n})}function yt(t){return vt[t]}var Et=[];function Pt(){var t=[],n=[],r=[],e=[],o=(new Date).getTime();return Et.forEach((function(i){var u=i.status!==O&&T(i);switch(i.status){case P:u&&o-i.loadErrorTime>=200&&r.push(i);break;case l:case p:u&&r.push(i);break;case h:case v:!u&&yt(A(i))?t.push(i):u&&e.push(i);break;case w:u||n.push(i)}})),{appsToUnload:t,appsToUnmount:n,appsToLoad:r,appsToMount:e}}function Ot(){return Et.filter(b).map(A)}function bt(){return Et.map(A)}function Tt(t){var n=D(Et,(function(n){return A(n)===t}));return n?n.status:null}var At=!1;function Nt(t,r,e,o){var i=function(t,r,e,o){var i,u={name:null,loadApp:null,activeWhen:null,customProps:null};return"object"===n(t)?(function(t){if(Array.isArray(t)||null===t)throw Error(s(39,!1));var r=["name","app","activeWhen","customProps"],e=Object.keys(t).reduce((function(t,n){return r.indexOf(n)>=0?t:t.concat(n)}),[]);if(0!==e.length)throw Error(s(38,!1,r.join(", "),e.join(", ")));if("string"!=typeof t.name||0===t.name.length)throw Error(s(20,!1));if("object"!==n(t.app)&&"function"!=typeof t.app)throw Error(s(20,!1));var o=function(t){return"string"==typeof t||"function"==typeof t};if(!(o(t.activeWhen)||Array.isArray(t.activeWhen)&&t.activeWhen.every(o)))throw Error(s(24,!1));if(!jt(t.customProps))throw Error(s(22,!1))}(t),u.name=t.name,u.loadApp=t.app,u.activeWhen=t.activeWhen,u.customProps=t.customProps):(function(t,n,r,e){if("string"!=typeof t||0===t.length)throw Error(s(20,!1));if(!n)throw Error(s(23,!1));if("function"!=typeof r)throw Error(s(24,!1));if(!jt(e))throw Error(s(22,!1))}(t,r,e,o),u.name=t,u.loadApp=r,u.activeWhen=e,u.customProps=o),u.loadApp="function"!=typeof(i=u.loadApp)?function(){return Promise.resolve(i)}:i,u.customProps=function(t){return t||{}}(u.customProps),u.activeWhen=function(t){var n=Array.isArray(t)?t:[t];return n=n.map((function(t){return"function"==typeof t?t:Mt(t)})),function(t){return n.some((function(n){return n(t)}))}}(u.activeWhen),u}(t,r,e,o);if($t()||At||(At=!0,setTimeout((function(){$t()||console.warn(s(1,!1))}),5e3)),-1!==bt().indexOf(i.name))throw Error(s(21,!1,i.name));Et.push(_({loadErrorTime:null,status:l,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},i)),tt&&(ht(),Bt())}function St(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location;return Et.filter((function(n){return n.activeWhen(t)})).map(A)}function _t(t){if(0===Et.filter((function(n){return A(n)===t})).length)throw Error(s(25,!1,t));return(tt?Dt(t,{waitForUnmount:!1}):Promise.resolve()).then((function(){var n=Et.map(A).indexOf(t);Et.splice(n,1)}))}function Dt(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{waitForUnmount:!1};if("string"!=typeof t)throw Error(s(26,!1));var r=D(Et,(function(n){return A(n)===t}));if(!r)throw Error(s(27,!1,t));var e,o=yt(A(r));if(n&&n.waitForUnmount){if(o)return o.promise;var i=new Promise((function(t,n){gt(r,(function(){return i}),t,n)}));return i}return o?(e=o.promise,Ut(r,o.resolve,o.reject)):e=new Promise((function(t,n){gt(r,(function(){return e}),t,n),Ut(r,t,n)})),e}function Ut(t,n,r){Promise.resolve().then((function(){if(D(St(),(function(n){return n===A(t)})))return It()})).then((function(){return x(t).then(dt).then((function(){n(),setTimeout((function(){Bt()}))}))})).catch(r)}function jt(t){return!t||"function"==typeof t||"object"===n(t)&&null!==t&&!Array.isArray(t)}function Mt(t,n){var r=function(t,n){var r=0,e=!1,o="^";"/"!==t[0]&&(t="/"+t);for(var i=0;i<t.length;i++){var u=t[i];(!e&&":"===u||e&&"/"===u)&&a(i)}return a(t.length),new RegExp(o,"i");function a(i){var u=t.slice(r,i).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(o+=e?"[^/]+/?":u,i===t.length)if(e)n&&(o+="$");else{var a=n?"":".*";o="/"===o.charAt(o.length-1)?"".concat(o).concat(a,"$"):"".concat(o,"(/").concat(a,")?(#.*)?$")}e=!e,r=i}}(t,n);return function(t){var n=t.origin;n||(n="".concat(t.protocol,"//").concat(t.host));var e=t.href.replace(n,"").replace(t.search,"").split("?")[0];return r.test(e)}}var Lt=!1,Rt=[],xt=tt&&window.location.href;function It(){return Bt()}function Bt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,e=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Lt)return new Promise((function(t,r){Rt.push({resolve:t,reject:r,eventArguments:n})}));var i,u=Pt(),a=u.appsToUnload,c=u.appsToUnmount,f=u.appsToLoad,p=u.appsToMount,h=[],m=xt,d=xt=window.location.href;return $t()?(Lt=!0,i=a.concat(f,c,p),E()):(i=f,y());function g(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n="function"==typeof(null==t?void 0:t.then)?t:Promise.resolve(t);h.push(n.catch((function(t){return console.warn(Error(s(42,!1))),console.warn(t),!1})))}function y(){return Promise.resolve().then((function(){var t=f.map(Y);return Promise.all(t).then(b).then((function(){return[]})).catch((function(t){throw b(),t})).finally((function(){}))}))}function E(){return Promise.resolve().then((function(){return N(0===i.length?"before-no-app-change":"before-app-change",T(!0)),N("before-routing-event",T(!0,{cancelNavigation:g})),Promise.all(h).then((function(r){if(r.some((function(t){return t})))return ct.call(window.history,history.state,"",m.substring(location.origin.length)),xt=location.href,Lt=!1,Bt(t,n,!0);var e=a.map(dt),o=c.map(x).map((function(t){return t.then(dt)})).concat(e),i=Promise.all(o);i.then((function(){N("before-mount-routing-event",T(!0))}),(function(t){throw t}));var u=f.map((function(t){return Y(t).then((function(t){return Gt(t,i)}))})),s=p.filter((function(t){return f.indexOf(t)<0})).map((function(t){return Gt(t,i)}));return i.catch((function(t){throw b(),t})).then((function(){return b(),Promise.all(u.concat(s)).catch((function(n){throw t.forEach((function(t){return t.reject(n)})),n})).then(P).then((function(){}),(function(t){throw t}))}))}))}))}function P(){var n=Ot();t.forEach((function(t){return t.resolve(n)}));try{N(0===i.length?"no-app-change":"app-change",T()),N("routing-event",T())}catch(t){setTimeout((function(){throw t}))}if(Lt=!1,Rt.length>0){var r=Rt;Rt=[],Bt(r)}return n}function b(){e||(t.forEach((function(t){ot(t.eventArguments)})),ot(n))}function T(){var t,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],o=arguments.length>1?arguments[1]:void 0,u={},s=(r(t={},w,[]),r(t,v,[]),r(t,l,[]),r(t,O,[]),t);e?(f.concat(p).forEach((function(t,n){g(t,w)})),a.forEach((function(t){g(t,l)})),c.forEach((function(t){g(t,v)}))):i.forEach((function(t){g(t)}));var h={detail:{newAppStatuses:u,appsByNewStatus:s,totalAppChanges:i.length,originalEvent:null==n?void 0:n[0],oldUrl:m,newUrl:d}};return o&&_(h.detail,o),h;function g(t,n){var r=A(t);n=n||Tt(r),u[r]=n,(s[n]=s[n]||[]).push(r)}}function N(t,n){e||window.dispatchEvent(new o("single-spa:".concat(t),n))}}function Gt(t,n){return T(t)?R(t).then((function(t){return n.then((function(){return T(t)?G(t):t}))})):n.then((function(){return t}))}var Wt=!1;function Ct(t){Wt=!0,tt&&(ft(t),Bt())}function $t(){return Wt}var kt={getRawAppData:function(){return[].concat(Et)},reroute:Bt,NOT_LOADED:l,toLoadPromise:Y,toBootstrapPromise:R,unregisterApplication:_t,getProfilerData:function(){return L}};tt&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=kt);export{m as BOOTSTRAPPING,p as LOADING_SOURCE_CODE,P as LOAD_ERROR,w as MOUNTED,d as MOUNTING,h as NOT_BOOTSTRAPPED,l as NOT_LOADED,v as NOT_MOUNTED,O as SKIP_BECAUSE_BROKEN,E as UNLOADING,y as UNMOUNTING,g as UPDATING,a as addErrorHandler,St as checkActivityFunctions,ht as ensureJQuerySupport,bt as getAppNames,Tt as getAppStatus,Ot as getMountedApps,$ as mountRootParcel,et as navigateToUrl,ft as patchHistoryApi,Mt as pathToActiveWhen,Nt as registerApplication,c as removeErrorHandler,J as setBootstrapMaxTime,Q as setMountMaxTime,q as setUnloadMaxTime,V as setUnmountMaxTime,Ct as start,It as triggerAppChange,Dt as unloadApplication,_t as unregisterApplication}; | ||
/* single-spa@6.0.2 - ESM ES5 - prod */ | ||
var t=Object.freeze({__proto__:null,get start(){return Ct},get ensureJQuerySupport(){return ht},get setBootstrapMaxTime(){return J},get setMountMaxTime(){return Q},get setUnmountMaxTime(){return V},get setUnloadMaxTime(){return q},get registerApplication(){return Nt},get unregisterApplication(){return _t},get getMountedApps(){return Ot},get getAppStatus(){return Tt},get unloadApplication(){return Dt},get checkActivityFunctions(){return St},get getAppNames(){return bt},get pathToActiveWhen(){return Mt},get navigateToUrl(){return et},get patchHistoryApi(){return ft},get triggerAppChange(){return It},get addErrorHandler(){return a},get removeErrorHandler(){return c},get mountRootParcel(){return $},get NOT_LOADED(){return l},get LOADING_SOURCE_CODE(){return p},get NOT_BOOTSTRAPPED(){return h},get BOOTSTRAPPING(){return m},get NOT_MOUNTED(){return v},get MOUNTING(){return d},get UPDATING(){return g},get LOAD_ERROR(){return P},get MOUNTED(){return w},get UNLOADING(){return E},get UNMOUNTING(){return y},get SKIP_BECAUSE_BROKEN(){return O}});function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function r(t,n,r){return n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t}var e=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}).CustomEvent,o=function(){try{var t=new e("cat",{detail:{foo:"bar"}});return"cat"===t.type&&"bar"===t.detail.foo}catch(t){}return!1}()?e:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(t,n){var r=document.createEvent("CustomEvent");return n?r.initCustomEvent(t,n.bubbles,n.cancelable,n.detail):r.initCustomEvent(t,!1,!1,void 0),r}:function(t,n){var r=document.createEventObject();return r.type=t,n?(r.bubbles=Boolean(n.bubbles),r.cancelable=Boolean(n.cancelable),r.detail=n.detail):(r.bubbles=!1,r.cancelable=!1,r.detail=void 0),r},i=[];function u(t,n,r){var e=f(t,n,r);i.length?i.forEach((function(t){return t(e)})):setTimeout((function(){throw e}))}function a(t){if("function"!=typeof t)throw Error(s(28,!1));i.push(t)}function c(t){if("function"!=typeof t)throw Error(s(29,!1));var n=!1;return i=i.filter((function(r){var e=r===t;return n=n||e,!e})),n}function s(t,n){for(var r=arguments.length,e=new Array(r>2?r-2:0),o=2;o<r;o++)e[o-2]=arguments[o];return"single-spa minified message #".concat(t,": ").concat(n?n+" ":"","See https://single-spa.js.org/error/?code=").concat(t).concat(e.length?"&arg=".concat(e.join("&arg=")):"")}function f(t,n,r){var e,o="".concat(S(n)," '").concat(A(n),"' died in status ").concat(n.status,": ");if(t instanceof Error){try{t.message=o+t.message}catch(t){}e=t}else{console.warn(s(30,!1,n.status,A(n)));try{e=Error(o+JSON.stringify(t))}catch(n){e=t}}return e.appOrParcelName=A(n),n.status=r,e}var l="NOT_LOADED",p="LOADING_SOURCE_CODE",h="NOT_BOOTSTRAPPED",m="BOOTSTRAPPING",v="NOT_MOUNTED",d="MOUNTING",w="MOUNTED",g="UPDATING",y="UNMOUNTING",E="UNLOADING",P="LOAD_ERROR",O="SKIP_BECAUSE_BROKEN";function b(t){return t.status===w}function T(t){try{return t.activeWhen(window.location)}catch(n){return u(n,t,O),!1}}function A(t){return t.name}function N(t){return Boolean(t.unmountThisParcel)}function S(t){return N(t)?"parcel":"application"}function _(){for(var t=arguments.length-1;t>0;t--)for(var n in arguments[t])"__proto__"!==n&&(arguments[t-1][n]=arguments[t][n]);return arguments[0]}function D(t,n){for(var r=0;r<t.length;r++)if(n(t[r]))return t[r];return null}function U(t){return t&&("function"==typeof t||(n=t,Array.isArray(n)&&!D(n,(function(t){return"function"!=typeof t}))));var n}function j(t,n){var r=t[n]||[];0===(r=Array.isArray(r)?r:[r]).length&&(r=[function(){return Promise.resolve()}]);var e=S(t),o=A(t);return function(t){return r.reduce((function(r,i,u){return r.then((function(){var r=i(t);return M(r)?r:Promise.reject(s(15,!1,e,o,n,u))}))}),Promise.resolve())}}function M(t){return t&&"function"==typeof t.then&&"function"==typeof t.catch}var L=[];function R(t,n){return Promise.resolve().then((function(){return t.status!==h?t:(t.status=m,t.bootstrap?z(t,"bootstrap").then(r).catch((function(r){if(n)throw f(r,t,O);return u(r,t,O),t})):Promise.resolve().then(r))}));function r(){return t.status=v,t}}function x(t,n){return Promise.resolve().then((function(){if(t.status!==w)return t;t.status=y;var r=Object.keys(t.parcels).map((function(n){return t.parcels[n].unmountThisParcel()}));return Promise.all(r).then(e,(function(r){return e().then((function(){var e=Error(r.message);if(n)throw f(e,t,O);u(e,t,O)}))})).then((function(){return t}));function e(){return z(t,"unmount").then((function(){t.status=v}),(function(r){if(n)throw f(r,t,O);u(r,t,O)}))}}))}var I=!1,B=!1;function G(t,n){return Promise.resolve().then((function(){return t.status!==v?t:(I||(window.dispatchEvent(new o("single-spa:before-first-mount")),I=!0),t.status=d,z(t,"mount").then((function(){return t.status=w,B||(window.dispatchEvent(new o("single-spa:first-mount")),B=!0),t})).catch((function(r){return t.status=w,x(t,!0).then(e,e);function e(){if(n)throw f(r,t,O);return u(r,t,O),t}})))}))}var W=0,C={parcels:{}};function $(){return k.apply(C,arguments)}function k(t,r){var e=this;if(!t||"object"!==n(t)&&"function"!=typeof t)throw Error(s(2,!1));if(t.name&&"string"!=typeof t.name)throw Error(s(3,!1,n(t.name)));var o=W++,i=t.name||"parcel-".concat(o);if("object"!==n(r))throw Error(s(4,!1,i,n(r)));if(!r.domElement)throw Error(s(5,!1,i));var u,a="function"==typeof t,c=a?t:function(){return Promise.resolve(t)},l={id:o,parcels:{},status:a?p:h,customProps:r,parentName:A(e),unmountThisParcel:function(){return P.then((function(){if(l.status!==w)throw Error(s(6,!1,i,l.status));return x(l,!0)})).then((function(t){return l.parentName&&delete e.parcels[l.id],t})).then((function(t){return d(t),t})).catch((function(t){throw l.status=O,y(t),t}))}};e.parcels[o]=l;var m=c();if(!m||"function"!=typeof m.then)throw Error(s(7,!1));var d,y,E=(m=m.then((function(t){if(!t)throw Error(s(8,!1));if(i=t.name||"parcel-".concat(o),Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!U(t.bootstrap))throw Error(s(9,!1,i));if(!U(t.mount))throw Error(s(10,!1,i));if(!U(t.unmount))throw Error(s(11,!1,i));if(t.update&&!U(t.update))throw Error(s(12,!1,i));var n=j(t,"bootstrap"),r=j(t,"mount"),e=j(t,"unmount");l.status=h,l.name=i,l.bootstrap=n,l.mount=r,l.unmount=e,l.timeouts=X(t.timeouts),t.update&&(l.update=j(t,"update"),u.update=function(t){return l.customProps=t,F((n=l,Promise.resolve().then((function(){if(n.status!==w)throw Error(s(32,!1,A(n)));return n.status=g,z(n,"update").then((function(){return n.status=w,n})).catch((function(t){throw f(t,n,O)}))}))));var n})}))).then((function(){return R(l,!0)})),P=E.then((function(){return G(l,!0)})),b=new Promise((function(t,n){d=t,y=n}));return u={mount:function(){return F(Promise.resolve().then((function(){if(l.status!==v)throw Error(s(13,!1,i,l.status));return e.parcels[o]=l,G(l)})))},unmount:function(){return F(l.unmountThisParcel())},getStatus:function(){return l.status},loadPromise:F(m),bootstrapPromise:F(E),mountPromise:F(P),unmountPromise:F(b)}}function F(t){return t.then((function(){return null}))}function K(r){var e=A(r),o="function"==typeof r.customProps?r.customProps(e,window.location):r.customProps;("object"!==n(o)||null===o||Array.isArray(o))&&(o={},console.warn(s(40,!1),e,o));var i=_({},o,{name:e,mountParcel:k.bind(r),singleSpa:t});return N(r)&&(i.unmountSelf=r.unmountThisParcel),i}var H={bootstrap:{millis:4e3,dieOnTimeout:!1,warningMillis:1e3},mount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unmount:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},unload:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3},update:{millis:3e3,dieOnTimeout:!1,warningMillis:1e3}};function J(t,n,r){if("number"!=typeof t||t<=0)throw Error(s(16,!1));H.bootstrap={millis:t,dieOnTimeout:n,warningMillis:r||1e3}}function Q(t,n,r){if("number"!=typeof t||t<=0)throw Error(s(17,!1));H.mount={millis:t,dieOnTimeout:n,warningMillis:r||1e3}}function V(t,n,r){if("number"!=typeof t||t<=0)throw Error(s(18,!1));H.unmount={millis:t,dieOnTimeout:n,warningMillis:r||1e3}}function q(t,n,r){if("number"!=typeof t||t<=0)throw Error(s(19,!1));H.unload={millis:t,dieOnTimeout:n,warningMillis:r||1e3}}function z(t,n){var r=t.timeouts[n],e=r.warningMillis,o=S(t);return new Promise((function(i,u){var a=!1,c=!1;t[n](K(t)).then((function(t){a=!0,i(t)})).catch((function(t){a=!0,u(t)})),setTimeout((function(){return l(1)}),e),setTimeout((function(){return l(!0)}),r.millis);var f=s(31,!1,n,o,A(t),r.millis);function l(t){if(!a)if(!0===t)c=!0,r.dieOnTimeout?u(Error(f)):console.error(f);else if(!c){var n=t,o=n*e;console.warn(f),o+e<r.millis&&setTimeout((function(){return l(n+1)}),e)}}}))}function X(t){var n={};for(var r in H)n[r]=_({},H[r],t&&t[r]||{});return n}function Y(t){return Promise.resolve().then((function(){return t.loadPromise?t.loadPromise:t.status!==l&&t.status!==P?t:(t.status=p,t.loadPromise=Promise.resolve().then((function(){var o=t.loadApp(K(t));if(!M(o))throw e=!0,Error(s(33,!1,A(t)));return o.then((function(e){var o;t.loadErrorTime=null,"object"!==n(r=e)&&(o=34),Object.prototype.hasOwnProperty.call(r,"bootstrap")&&!U(r.bootstrap)&&(o=35),U(r.mount)||(o=36),U(r.unmount)||(o=37);var i=S(r);if(o){var a;try{a=JSON.stringify(r)}catch(t){}return console.error(s(o,!1,i,A(t),a),r),u(void 0,t,O),t}return r.devtools&&r.devtools.overlays&&(t.devtools.overlays=_({},t.devtools.overlays,r.devtools.overlays)),t.status=h,t.bootstrap=j(r,"bootstrap"),t.mount=j(r,"mount"),t.unmount=j(r,"unmount"),t.unload=j(r,"unload"),t.timeouts=X(r.timeouts),delete t.loadPromise,t}))})).catch((function(n){var r;return delete t.loadPromise,e?r=O:(r=P,t.loadErrorTime=(new Date).getTime()),u(n,t,r),t})));var r,e}))}var Z,tt="undefined"!=typeof window,nt={hashchange:[],popstate:[]},rt=["hashchange","popstate"];function et(t){var n;if("string"==typeof t)n=t;else if(this&&this.href)n=this.href;else{if(!(t&&t.currentTarget&&t.currentTarget.href&&t.preventDefault))throw Error(s(14,!1));n=t.currentTarget.href,t.preventDefault()}var r=lt(window.location.href),e=lt(n);0===n.indexOf("#")?window.location.hash=e.hash:r.host!==e.host&&e.host?window.location.href=n:e.pathname===r.pathname&&e.search===r.search?window.location.hash=e.hash:window.history.pushState(null,null,n)}function ot(t){var n=this;if(t){var r=t[0].type;rt.indexOf(r)>=0&&nt[r].forEach((function(r){try{r.apply(n,t)}catch(t){setTimeout((function(){throw t}))}}))}}function it(){Bt([],arguments)}function ut(t,n){return function(){var r=window.location.href,e=t.apply(this,arguments),o=window.location.href;return Z&&r===o||window.dispatchEvent(at(window.history.state,n)),e}}function at(t,n){var r;try{r=new PopStateEvent("popstate",{state:t})}catch(n){(r=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,t)}return r.singleSpa=!0,r.singleSpaTrigger=n,r}var ct=null,st=!1;function ft(t){if(st)throw Error(s(43,!1));Z=!t||!t.hasOwnProperty("urlRerouteOnly")||t.urlRerouteOnly,st=!0,ct=window.history.replaceState,window.addEventListener("hashchange",it),window.addEventListener("popstate",it);var n=window.addEventListener,r=window.removeEventListener;window.addEventListener=function(t,r){if(!("function"==typeof r&&rt.indexOf(t)>=0)||D(nt[t],(function(t){return t===r})))return n.apply(this,arguments);nt[t].push(r)},window.removeEventListener=function(t,n){return"function"==typeof n&&rt.indexOf(t)>=0&&(nt[t]=nt[t].filter((function(t){return t!==n}))),r.apply(this,arguments)},window.history.pushState=ut(window.history.pushState,"pushState"),window.history.replaceState=ut(ct,"replaceState")}function lt(t){var n=document.createElement("a");return n.href=t,n}tt&&(window.singleSpaNavigate?console.warn(s(41,!1)):window.singleSpaNavigate=et);var pt=!1;function ht(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.jQuery;if(t||window.$&&window.$.fn&&window.$.fn.jquery&&(t=window.$),t&&!pt){var n=t.fn.on,r=t.fn.off;t.fn.on=function(t,r){return mt.call(this,n,window.addEventListener,t,r,arguments)},t.fn.off=function(t,n){return mt.call(this,r,window.removeEventListener,t,n,arguments)},pt=!0}}function mt(t,n,r,e,o){return"string"!=typeof r?t.apply(this,o):(r.split(/\s+/).forEach((function(t){rt.indexOf(t)>=0&&(n(t,e),r=r.replace(t,""))})),""===r.trim()?this:t.apply(this,o))}var vt={};function dt(t){return Promise.resolve().then((function(){var n=vt[A(t)];if(!n)return t;if(t.status===l)return wt(t,n),t;if(t.status===E)return n.promise.then((function(){return t}));if(t.status!==v&&t.status!==P)return t;var r=t.status===P?Promise.resolve():z(t,"unload");return t.status=E,r.then((function(){return wt(t,n),t})).catch((function(r){return function(t,n,r){delete vt[A(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,u(r,t,O),n.reject(r)}(t,n,r),t}))}))}function wt(t,n){delete vt[A(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,t.status=l,n.resolve()}function gt(t,n,r,e){vt[A(t)]={app:t,resolve:r,reject:e},Object.defineProperty(vt[A(t)],"promise",{get:n})}function yt(t){return vt[t]}var Et=[];function Pt(){var t=[],n=[],r=[],e=[],o=(new Date).getTime();return Et.forEach((function(i){var u=i.status!==O&&T(i);switch(i.status){case P:u&&o-i.loadErrorTime>=200&&r.push(i);break;case l:case p:u&&r.push(i);break;case h:case v:!u&&yt(A(i))?t.push(i):u&&e.push(i);break;case w:u||n.push(i)}})),{appsToUnload:t,appsToUnmount:n,appsToLoad:r,appsToMount:e}}function Ot(){return Et.filter(b).map(A)}function bt(){return Et.map(A)}function Tt(t){var n=D(Et,(function(n){return A(n)===t}));return n?n.status:null}var At=!1;function Nt(t,r,e,o){var i=function(t,r,e,o){var i,u={name:null,loadApp:null,activeWhen:null,customProps:null};return"object"===n(t)?(function(t){if(Array.isArray(t)||null===t)throw Error(s(39,!1));var r=["name","app","activeWhen","customProps"],e=Object.keys(t).reduce((function(t,n){return r.indexOf(n)>=0?t:t.concat(n)}),[]);if(0!==e.length)throw Error(s(38,!1,r.join(", "),e.join(", ")));if("string"!=typeof t.name||0===t.name.length)throw Error(s(20,!1));if("object"!==n(t.app)&&"function"!=typeof t.app)throw Error(s(20,!1));var o=function(t){return"string"==typeof t||"function"==typeof t};if(!(o(t.activeWhen)||Array.isArray(t.activeWhen)&&t.activeWhen.every(o)))throw Error(s(24,!1));if(!jt(t.customProps))throw Error(s(22,!1))}(t),u.name=t.name,u.loadApp=t.app,u.activeWhen=t.activeWhen,u.customProps=t.customProps):(function(t,n,r,e){if("string"!=typeof t||0===t.length)throw Error(s(20,!1));if(!n)throw Error(s(23,!1));if("function"!=typeof r)throw Error(s(24,!1));if(!jt(e))throw Error(s(22,!1))}(t,r,e,o),u.name=t,u.loadApp=r,u.activeWhen=e,u.customProps=o),u.loadApp="function"!=typeof(i=u.loadApp)?function(){return Promise.resolve(i)}:i,u.customProps=function(t){return t||{}}(u.customProps),u.activeWhen=function(t){var n=Array.isArray(t)?t:[t];return n=n.map((function(t){return"function"==typeof t?t:Mt(t)})),function(t){return n.some((function(n){return n(t)}))}}(u.activeWhen),u}(t,r,e,o);if($t()||At||(At=!0,setTimeout((function(){$t()||console.warn(s(1,!1))}),5e3)),-1!==bt().indexOf(i.name))throw Error(s(21,!1,i.name));Et.push(_({loadErrorTime:null,status:l,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},i)),tt&&(ht(),Bt())}function St(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location;return Et.filter((function(n){return n.activeWhen(t)})).map(A)}function _t(t){if(0===Et.filter((function(n){return A(n)===t})).length)throw Error(s(25,!1,t));return(tt?Dt(t,{waitForUnmount:!1}):Promise.resolve()).then((function(){var n=Et.map(A).indexOf(t);Et.splice(n,1)}))}function Dt(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{waitForUnmount:!1};if("string"!=typeof t)throw Error(s(26,!1));var r=D(Et,(function(n){return A(n)===t}));if(!r)throw Error(s(27,!1,t));var e,o=yt(A(r));if(n&&n.waitForUnmount){if(o)return o.promise;var i=new Promise((function(t,n){gt(r,(function(){return i}),t,n)}));return i}return o?(e=o.promise,Ut(r,o.resolve,o.reject)):e=new Promise((function(t,n){gt(r,(function(){return e}),t,n),Ut(r,t,n)})),e}function Ut(t,n,r){Promise.resolve().then((function(){if(D(St(),(function(n){return n===A(t)})))return It()})).then((function(){return x(t).then(dt).then((function(){n(),setTimeout((function(){Bt()}))}))})).catch(r)}function jt(t){return!t||"function"==typeof t||"object"===n(t)&&null!==t&&!Array.isArray(t)}function Mt(t,n){var r=function(t,n){var r=0,e=!1,o="^";"/"!==t[0]&&(t="/"+t);for(var i=0;i<t.length;i++){var u=t[i];(!e&&":"===u||e&&"/"===u)&&a(i)}return a(t.length),new RegExp(o,"i");function a(i){var u=t.slice(r,i).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(o+=e?"[^/]+/?":u,i===t.length)if(e)n&&(o+="$");else{var a=n?"":".*";o="/"===o.charAt(o.length-1)?"".concat(o).concat(a,"$"):"".concat(o,"(/").concat(a,")?(#.*)?$")}e=!e,r=i}}(t,n);return function(t){var n=t.origin;n||(n="".concat(t.protocol,"//").concat(t.host));var e=t.href.replace(n,"").replace(t.search,"").split("?")[0];return r.test(e)}}var Lt=!1,Rt=[],xt=tt&&window.location.href;function It(){return Bt()}function Bt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,e=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(Lt)return new Promise((function(t,r){Rt.push({resolve:t,reject:r,eventArguments:n})}));var i,u=Pt(),a=u.appsToUnload,c=u.appsToUnmount,f=u.appsToLoad,p=u.appsToMount,h=[],m=xt,d=xt=window.location.href;return $t()?(Lt=!0,i=a.concat(f,c,p),E()):(i=f,y());function g(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n="function"==typeof(null==t?void 0:t.then)?t:Promise.resolve(t);h.push(n.catch((function(t){return console.warn(Error(s(42,!1))),console.warn(t),!1})))}function y(){return Promise.resolve().then((function(){var t=f.map(Y);return Promise.all(t).then(b).then((function(){return[]})).catch((function(t){throw b(),t})).finally((function(){}))}))}function E(){return Promise.resolve().then((function(){return N(0===i.length?"before-no-app-change":"before-app-change",T(!0)),N("before-routing-event",T(!0,{cancelNavigation:g})),Promise.all(h).then((function(r){if(r.some((function(t){return t})))return ct.call(window.history,history.state,"",m.substring(location.origin.length)),xt=location.href,Lt=!1,Bt(t,n,!0);var e=a.map(dt),o=c.map(x).map((function(t){return t.then(dt)})).concat(e),i=Promise.all(o);i.then((function(){N("before-mount-routing-event",T(!0))}),(function(t){throw t}));var u=f.map((function(t){return Y(t).then((function(t){return Gt(t,i)}))})),s=p.filter((function(t){return f.indexOf(t)<0})).map((function(t){return Gt(t,i)}));return i.catch((function(t){throw b(),t})).then((function(){return b(),Promise.all(u.concat(s)).catch((function(n){throw t.forEach((function(t){return t.reject(n)})),n})).then(P).then((function(){}),(function(t){throw t}))}))}))}))}function P(){var n=Ot();t.forEach((function(t){return t.resolve(n)}));try{N(0===i.length?"no-app-change":"app-change",T()),N("routing-event",T())}catch(t){setTimeout((function(){throw t}))}if(Lt=!1,Rt.length>0){var r=Rt;Rt=[],Bt(r)}return n}function b(){e||(t.forEach((function(t){ot(t.eventArguments)})),ot(n))}function T(){var t,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],o=arguments.length>1?arguments[1]:void 0,u={},s=(r(t={},w,[]),r(t,v,[]),r(t,l,[]),r(t,O,[]),t);e?(f.concat(p).forEach((function(t,n){g(t,w)})),a.forEach((function(t){g(t,l)})),c.forEach((function(t){g(t,v)}))):i.forEach((function(t){g(t)}));var h={detail:{newAppStatuses:u,appsByNewStatus:s,totalAppChanges:i.length,originalEvent:null==n?void 0:n[0],oldUrl:m,newUrl:d}};return o&&_(h.detail,o),h;function g(t,n){var r=A(t);n=n||Tt(r),u[r]=n,(s[n]=s[n]||[]).push(r)}}function N(t,n){e||window.dispatchEvent(new o("single-spa:".concat(t),n))}}function Gt(t,n){return T(t)?R(t).then((function(t){return n.then((function(){return T(t)?G(t):t}))})):n.then((function(){return t}))}var Wt=!1;function Ct(t){Wt=!0,tt&&(ft(t),Bt())}function $t(){return Wt}var kt={getRawAppData:function(){return[].concat(Et)},reroute:Bt,NOT_LOADED:l,toLoadPromise:Y,toBootstrapPromise:R,unregisterApplication:_t,getProfilerData:function(){return L}};tt&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=kt);export{m as BOOTSTRAPPING,p as LOADING_SOURCE_CODE,P as LOAD_ERROR,w as MOUNTED,d as MOUNTING,h as NOT_BOOTSTRAPPED,l as NOT_LOADED,v as NOT_MOUNTED,O as SKIP_BECAUSE_BROKEN,E as UNLOADING,y as UNMOUNTING,g as UPDATING,a as addErrorHandler,St as checkActivityFunctions,ht as ensureJQuerySupport,bt as getAppNames,Tt as getAppStatus,Ot as getMountedApps,$ as mountRootParcel,et as navigateToUrl,ft as patchHistoryApi,Mt as pathToActiveWhen,Nt as registerApplication,c as removeErrorHandler,J as setBootstrapMaxTime,Q as setMountMaxTime,q as setUnloadMaxTime,V as setUnmountMaxTime,Ct as start,It as triggerAppChange,Dt as unloadApplication,_t as unregisterApplication}; | ||
//# sourceMappingURL=single-spa.min.js.map |
@@ -1,3 +0,3 @@ | ||
/* single-spa@6.0.1 - SystemJS ES5 - prod */ | ||
System.register([],(function(t){"use strict";return{execute:function(){t({addErrorHandler:c,checkActivityFunctions:Ut,ensureJQuerySupport:vt,getAppNames:At,getAppStatus:Nt,getMountedApps:bt,mountRootParcel:k,navigateToUrl:it,patchHistoryApi:pt,pathToActiveWhen:Rt,registerApplication:_t,removeErrorHandler:s,setBootstrapMaxTime:V,setMountMaxTime:q,setUnloadMaxTime:X,setUnmountMaxTime:z,start:kt,triggerAppChange:Bt,unloadApplication:Mt,unregisterApplication:Dt});var n=Object.freeze({__proto__:null,get start(){return kt},get ensureJQuerySupport(){return vt},get setBootstrapMaxTime(){return V},get setMountMaxTime(){return q},get setUnmountMaxTime(){return z},get setUnloadMaxTime(){return X},get registerApplication(){return _t},get unregisterApplication(){return Dt},get getMountedApps(){return bt},get getAppStatus(){return Nt},get unloadApplication(){return Mt},get checkActivityFunctions(){return Ut},get getAppNames(){return At},get pathToActiveWhen(){return Rt},get navigateToUrl(){return it},get patchHistoryApi(){return pt},get triggerAppChange(){return Bt},get addErrorHandler(){return c},get removeErrorHandler(){return s},get mountRootParcel(){return k},get NOT_LOADED(){return p},get LOADING_SOURCE_CODE(){return h},get NOT_BOOTSTRAPPED(){return m},get BOOTSTRAPPING(){return v},get NOT_MOUNTED(){return d},get MOUNTING(){return w},get UPDATING(){return E},get LOAD_ERROR(){return T},get MOUNTED(){return g},get UNLOADING(){return O},get UNMOUNTING(){return y},get SKIP_BECAUSE_BROKEN(){return P}});function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function e(t,n,r){return n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t}var o=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}).CustomEvent,i=function(){try{var t=new o("cat",{detail:{foo:"bar"}});return"cat"===t.type&&"bar"===t.detail.foo}catch(t){}return!1}()?o:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(t,n){var r=document.createEvent("CustomEvent");return n?r.initCustomEvent(t,n.bubbles,n.cancelable,n.detail):r.initCustomEvent(t,!1,!1,void 0),r}:function(t,n){var r=document.createEventObject();return r.type=t,n?(r.bubbles=Boolean(n.bubbles),r.cancelable=Boolean(n.cancelable),r.detail=n.detail):(r.bubbles=!1,r.cancelable=!1,r.detail=void 0),r},u=[];function a(t,n,r){var e=l(t,n,r);u.length?u.forEach((function(t){return t(e)})):setTimeout((function(){throw e}))}function c(t){if("function"!=typeof t)throw Error(f(28,!1));u.push(t)}function s(t){if("function"!=typeof t)throw Error(f(29,!1));var n=!1;return u=u.filter((function(r){var e=r===t;return n=n||e,!e})),n}function f(t,n){for(var r=arguments.length,e=new Array(r>2?r-2:0),o=2;o<r;o++)e[o-2]=arguments[o];return"single-spa minified message #".concat(t,": ").concat(n?n+" ":"","See https://single-spa.js.org/error/?code=").concat(t).concat(e.length?"&arg=".concat(e.join("&arg=")):"")}function l(t,n,r){var e,o="".concat(_(n)," '").concat(N(n),"' died in status ").concat(n.status,": ");if(t instanceof Error){try{t.message=o+t.message}catch(t){}e=t}else{console.warn(f(30,!1,n.status,N(n)));try{e=Error(o+JSON.stringify(t))}catch(n){e=t}}return e.appOrParcelName=N(n),n.status=r,e}var p=t("NOT_LOADED","NOT_LOADED"),h=t("LOADING_SOURCE_CODE","LOADING_SOURCE_CODE"),m=t("NOT_BOOTSTRAPPED","NOT_BOOTSTRAPPED"),v=t("BOOTSTRAPPING","BOOTSTRAPPING"),d=t("NOT_MOUNTED","NOT_MOUNTED"),w=t("MOUNTING","MOUNTING"),g=t("MOUNTED","MOUNTED"),E=t("UPDATING","UPDATING"),y=t("UNMOUNTING","UNMOUNTING"),O=t("UNLOADING","UNLOADING"),T=t("LOAD_ERROR","LOAD_ERROR"),P=t("SKIP_BECAUSE_BROKEN","SKIP_BECAUSE_BROKEN");function b(t){return t.status===g}function A(t){try{return t.activeWhen(window.location)}catch(n){return a(n,t,P),!1}}function N(t){return t.name}function S(t){return Boolean(t.unmountThisParcel)}function _(t){return S(t)?"parcel":"application"}function U(){for(var t=arguments.length-1;t>0;t--)for(var n in arguments[t])"__proto__"!==n&&(arguments[t-1][n]=arguments[t][n]);return arguments[0]}function D(t,n){for(var r=0;r<t.length;r++)if(n(t[r]))return t[r];return null}function M(t){return t&&("function"==typeof t||(n=t,Array.isArray(n)&&!D(n,(function(t){return"function"!=typeof t}))));var n}function L(t,n){var r=t[n]||[];0===(r=Array.isArray(r)?r:[r]).length&&(r=[function(){return Promise.resolve()}]);var e=_(t),o=N(t);return function(t){return r.reduce((function(r,i,u){return r.then((function(){var r=i(t);return j(r)?r:Promise.reject(f(15,!1,e,o,n,u))}))}),Promise.resolve())}}function j(t){return t&&"function"==typeof t.then&&"function"==typeof t.catch}var R=[];function I(t,n){return Promise.resolve().then((function(){return t.status!==m?t:(t.status=v,t.bootstrap?Y(t,"bootstrap").then(r).catch((function(r){if(n)throw l(r,t,P);return a(r,t,P),t})):Promise.resolve().then(r))}));function r(){return t.status=d,t}}function x(t,n){return Promise.resolve().then((function(){if(t.status!==g)return t;t.status=y;var r=Object.keys(t.parcels).map((function(n){return t.parcels[n].unmountThisParcel()}));return Promise.all(r).then(e,(function(r){return e().then((function(){var e=Error(r.message);if(n)throw l(e,t,P);a(e,t,P)}))})).then((function(){return t}));function e(){return Y(t,"unmount").then((function(){t.status=d}),(function(r){if(n)throw l(r,t,P);a(r,t,P)}))}}))}var G=!1,B=!1;function C(t,n){return Promise.resolve().then((function(){return t.status!==d?t:(G||(window.dispatchEvent(new i("single-spa:before-first-mount")),G=!0),t.status=w,Y(t,"mount").then((function(){return t.status=g,B||(window.dispatchEvent(new i("single-spa:first-mount")),B=!0),t})).catch((function(r){return t.status=g,x(t,!0).then(e,e);function e(){if(n)throw l(r,t,P);return a(r,t,P),t}})))}))}var W=0,$={parcels:{}};function k(){return H.apply($,arguments)}function H(t,n){var e=this;if(!t||"object"!==r(t)&&"function"!=typeof t)throw Error(f(2,!1));if(t.name&&"string"!=typeof t.name)throw Error(f(3,!1,r(t.name)));var o=W++,i=t.name||"parcel-".concat(o);if("object"!==r(n))throw Error(f(4,!1,i,r(n)));if(!n.domElement)throw Error(f(5,!1,i));var u,a="function"==typeof t,c=a?t:function(){return Promise.resolve(t)},s={id:o,parcels:{},status:a?h:m,customProps:n,parentName:N(e),unmountThisParcel:function(){return O.then((function(){if(s.status!==g)throw Error(f(6,!1,i,s.status));return x(s,!0)})).then((function(t){return s.parentName&&delete e.parcels[s.id],t})).then((function(t){return v(t),t})).catch((function(t){throw s.status=P,w(t),t}))}};e.parcels[o]=s;var p=c();if(!p||"function"!=typeof p.then)throw Error(f(7,!1));var v,w,y=(p=p.then((function(t){if(!t)throw Error(f(8,!1));if(i=t.name||"parcel-".concat(o),Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!M(t.bootstrap))throw Error(f(9,!1,i));if(!M(t.mount))throw Error(f(10,!1,i));if(!M(t.unmount))throw Error(f(11,!1,i));if(t.update&&!M(t.update))throw Error(f(12,!1,i));var n=L(t,"bootstrap"),r=L(t,"mount"),e=L(t,"unmount");s.status=m,s.name=i,s.bootstrap=n,s.mount=r,s.unmount=e,s.timeouts=Z(t.timeouts),t.update&&(s.update=L(t,"update"),u.update=function(t){return s.customProps=t,K((n=s,Promise.resolve().then((function(){if(n.status!==g)throw Error(f(32,!1,N(n)));return n.status=E,Y(n,"update").then((function(){return n.status=g,n})).catch((function(t){throw l(t,n,P)}))}))));var n})}))).then((function(){return I(s,!0)})),O=y.then((function(){return C(s,!0)})),T=new Promise((function(t,n){v=t,w=n}));return u={mount:function(){return K(Promise.resolve().then((function(){if(s.status!==d)throw Error(f(13,!1,i,s.status));return e.parcels[o]=s,C(s)})))},unmount:function(){return K(s.unmountThisParcel())},getStatus:function(){return s.status},loadPromise:K(p),bootstrapPromise:K(y),mountPromise:K(O),unmountPromise:K(T)}}function K(t){return t.then((function(){return null}))}function F(t){var e=N(t),o="function"==typeof t.customProps?t.customProps(e,window.location):t.customProps;("object"!==r(o)||null===o||Array.isArray(o))&&(o={},console.warn(f(40,!1),e,o));var i=U({},o,{name:e,mountParcel:H.bind(t),singleSpa:n});return S(t)&&(i.unmountSelf=t.unmountThisParcel),i}var J=1e3,Q={bootstrap:{millis:4e3,dieOnTimeout:!1,warningMillis:J},mount:{millis:3e3,dieOnTimeout:!1,warningMillis:J},unmount:{millis:3e3,dieOnTimeout:!1,warningMillis:J},unload:{millis:3e3,dieOnTimeout:!1,warningMillis:J},update:{millis:3e3,dieOnTimeout:!1,warningMillis:J}};function V(t,n,r){if("number"!=typeof t||t<=0)throw Error(f(16,!1));Q.bootstrap={millis:t,dieOnTimeout:n,warningMillis:r||J}}function q(t,n,r){if("number"!=typeof t||t<=0)throw Error(f(17,!1));Q.mount={millis:t,dieOnTimeout:n,warningMillis:r||J}}function z(t,n,r){if("number"!=typeof t||t<=0)throw Error(f(18,!1));Q.unmount={millis:t,dieOnTimeout:n,warningMillis:r||J}}function X(t,n,r){if("number"!=typeof t||t<=0)throw Error(f(19,!1));Q.unload={millis:t,dieOnTimeout:n,warningMillis:r||J}}function Y(t,n){var r=t.timeouts[n],e=r.warningMillis,o=_(t);return new Promise((function(i,u){var a=!1,c=!1;t[n](F(t)).then((function(t){a=!0,i(t)})).catch((function(t){a=!0,u(t)})),setTimeout((function(){return l(1)}),e),setTimeout((function(){return l(!0)}),r.millis);var s=f(31,!1,n,o,N(t),r.millis);function l(t){if(!a)if(!0===t)c=!0,r.dieOnTimeout?u(Error(s)):console.error(s);else if(!c){var n=t,o=n*e;console.warn(s),o+e<r.millis&&setTimeout((function(){return l(n+1)}),e)}}}))}function Z(t){var n={};for(var r in Q)n[r]=U({},Q[r],t&&t[r]||{});return n}function tt(t){return Promise.resolve().then((function(){return t.loadPromise?t.loadPromise:t.status!==p&&t.status!==T?t:(t.status=h,t.loadPromise=Promise.resolve().then((function(){var o=t.loadApp(F(t));if(!j(o))throw e=!0,Error(f(33,!1,N(t)));return o.then((function(e){var o;t.loadErrorTime=null,"object"!==r(n=e)&&(o=34),Object.prototype.hasOwnProperty.call(n,"bootstrap")&&!M(n.bootstrap)&&(o=35),M(n.mount)||(o=36),M(n.unmount)||(o=37);var i=_(n);if(o){var u;try{u=JSON.stringify(n)}catch(t){}return console.error(f(o,!1,i,N(t),u),n),a(void 0,t,P),t}return n.devtools&&n.devtools.overlays&&(t.devtools.overlays=U({},t.devtools.overlays,n.devtools.overlays)),t.status=m,t.bootstrap=L(n,"bootstrap"),t.mount=L(n,"mount"),t.unmount=L(n,"unmount"),t.unload=L(n,"unload"),t.timeouts=Z(n.timeouts),delete t.loadPromise,t}))})).catch((function(n){var r;return delete t.loadPromise,e?r=P:(r=T,t.loadErrorTime=(new Date).getTime()),a(n,t,r),t})));var n,e}))}var nt,rt="undefined"!=typeof window,et={hashchange:[],popstate:[]},ot=["hashchange","popstate"];function it(t){var n;if("string"==typeof t)n=t;else if(this&&this.href)n=this.href;else{if(!(t&&t.currentTarget&&t.currentTarget.href&&t.preventDefault))throw Error(f(14,!1));n=t.currentTarget.href,t.preventDefault()}var r=ht(window.location.href),e=ht(n);0===n.indexOf("#")?window.location.hash=e.hash:r.host!==e.host&&e.host?window.location.href=n:e.pathname===r.pathname&&e.search===r.search?window.location.hash=e.hash:window.history.pushState(null,null,n)}function ut(t){var n=this;if(t){var r=t[0].type;ot.indexOf(r)>=0&&et[r].forEach((function(r){try{r.apply(n,t)}catch(t){setTimeout((function(){throw t}))}}))}}function at(){Ct([],arguments)}function ct(t,n){return function(){var r=window.location.href,e=t.apply(this,arguments),o=window.location.href;return nt&&r===o||window.dispatchEvent(st(window.history.state,n)),e}}function st(t,n){var r;try{r=new PopStateEvent("popstate",{state:t})}catch(n){(r=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,t)}return r.singleSpa=!0,r.singleSpaTrigger=n,r}var ft=null,lt=!1;function pt(t){if(lt)throw Error(f(43,!1));nt=!t||!t.hasOwnProperty("urlRerouteOnly")||t.urlRerouteOnly,lt=!0,ft=window.history.replaceState,window.addEventListener("hashchange",at),window.addEventListener("popstate",at);var n=window.addEventListener,r=window.removeEventListener;window.addEventListener=function(t,r){if(!("function"==typeof r&&ot.indexOf(t)>=0)||D(et[t],(function(t){return t===r})))return n.apply(this,arguments);et[t].push(r)},window.removeEventListener=function(t,n){if(!("function"==typeof n&&ot.indexOf(t)>=0))return r.apply(this,arguments);et[t]=et[t].filter((function(t){return t!==n}))},window.history.pushState=ct(window.history.pushState,"pushState"),window.history.replaceState=ct(ft,"replaceState")}function ht(t){var n=document.createElement("a");return n.href=t,n}rt&&(window.singleSpaNavigate?console.warn(f(41,!1)):window.singleSpaNavigate=it);var mt=!1;function vt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.jQuery;if(t||window.$&&window.$.fn&&window.$.fn.jquery&&(t=window.$),t&&!mt){var n=t.fn.on,r=t.fn.off;t.fn.on=function(t,r){return dt.call(this,n,window.addEventListener,t,r,arguments)},t.fn.off=function(t,n){return dt.call(this,r,window.removeEventListener,t,n,arguments)},mt=!0}}function dt(t,n,r,e,o){return"string"!=typeof r?t.apply(this,o):(r.split(/\s+/).forEach((function(t){ot.indexOf(t)>=0&&(n(t,e),r=r.replace(t,""))})),""===r.trim()?this:t.apply(this,o))}var wt={};function gt(t){return Promise.resolve().then((function(){var n=wt[N(t)];if(!n)return t;if(t.status===p)return Et(t,n),t;if(t.status===O)return n.promise.then((function(){return t}));if(t.status!==d&&t.status!==T)return t;var r=t.status===T?Promise.resolve():Y(t,"unload");return t.status=O,r.then((function(){return Et(t,n),t})).catch((function(r){return function(t,n,r){delete wt[N(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,a(r,t,P),n.reject(r)}(t,n,r),t}))}))}function Et(t,n){delete wt[N(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,t.status=p,n.resolve()}function yt(t,n,r,e){wt[N(t)]={app:t,resolve:r,reject:e},Object.defineProperty(wt[N(t)],"promise",{get:n})}function Ot(t){return wt[t]}var Tt=[];function Pt(){var t=[],n=[],r=[],e=[],o=(new Date).getTime();return Tt.forEach((function(i){var u=i.status!==P&&A(i);switch(i.status){case T:u&&o-i.loadErrorTime>=200&&r.push(i);break;case p:case h:u&&r.push(i);break;case m:case d:!u&&Ot(N(i))?t.push(i):u&&e.push(i);break;case g:u||n.push(i)}})),{appsToUnload:t,appsToUnmount:n,appsToLoad:r,appsToMount:e}}function bt(){return Tt.filter(b).map(N)}function At(){return Tt.map(N)}function Nt(t){var n=D(Tt,(function(n){return N(n)===t}));return n?n.status:null}var St=!1;function _t(t,n,e,o){var i=function(t,n,e,o){var i,u={name:null,loadApp:null,activeWhen:null,customProps:null};return"object"===r(t)?(function(t){if(Array.isArray(t)||null===t)throw Error(f(39,!1));var n=["name","app","activeWhen","customProps"],e=Object.keys(t).reduce((function(t,r){return n.indexOf(r)>=0?t:t.concat(r)}),[]);if(0!==e.length)throw Error(f(38,!1,n.join(", "),e.join(", ")));if("string"!=typeof t.name||0===t.name.length)throw Error(f(20,!1));if("object"!==r(t.app)&&"function"!=typeof t.app)throw Error(f(20,!1));var o=function(t){return"string"==typeof t||"function"==typeof t};if(!(o(t.activeWhen)||Array.isArray(t.activeWhen)&&t.activeWhen.every(o)))throw Error(f(24,!1));if(!jt(t.customProps))throw Error(f(22,!1))}(t),u.name=t.name,u.loadApp=t.app,u.activeWhen=t.activeWhen,u.customProps=t.customProps):(function(t,n,r,e){if("string"!=typeof t||0===t.length)throw Error(f(20,!1));if(!n)throw Error(f(23,!1));if("function"!=typeof r)throw Error(f(24,!1));if(!jt(e))throw Error(f(22,!1))}(t,n,e,o),u.name=t,u.loadApp=n,u.activeWhen=e,u.customProps=o),u.loadApp="function"!=typeof(i=u.loadApp)?function(){return Promise.resolve(i)}:i,u.customProps=function(t){return t||{}}(u.customProps),u.activeWhen=function(t){var n=Array.isArray(t)?t:[t];return n=n.map((function(t){return"function"==typeof t?t:Rt(t)})),function(t){return n.some((function(n){return n(t)}))}}(u.activeWhen),u}(t,n,e,o);if(Ht()||St||(St=!0,setTimeout((function(){Ht()||console.warn(f(1,!1))}),5e3)),-1!==At().indexOf(i.name))throw Error(f(21,!1,i.name));Tt.push(U({loadErrorTime:null,status:p,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},i)),rt&&(vt(),Ct())}function Ut(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location;return Tt.filter((function(n){return n.activeWhen(t)})).map(N)}function Dt(t){if(0===Tt.filter((function(n){return N(n)===t})).length)throw Error(f(25,!1,t));return(rt?Mt(t,{waitForUnmount:!1}):Promise.resolve()).then((function(){var n=Tt.map(N).indexOf(t);Tt.splice(n,1)}))}function Mt(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{waitForUnmount:!1};if("string"!=typeof t)throw Error(f(26,!1));var r=D(Tt,(function(n){return N(n)===t}));if(!r)throw Error(f(27,!1,t));var e,o=Ot(N(r));if(n&&n.waitForUnmount){if(o)return o.promise;var i=new Promise((function(t,n){yt(r,(function(){return i}),t,n)}));return i}return o?(e=o.promise,Lt(r,o.resolve,o.reject)):e=new Promise((function(t,n){yt(r,(function(){return e}),t,n),Lt(r,t,n)})),e}function Lt(t,n,r){Promise.resolve().then((function(){if(D(Ut(),(function(n){return n===N(t)})))return Bt()})).then((function(){return x(t).then(gt).then((function(){n(),setTimeout((function(){Ct()}))}))})).catch(r)}function jt(t){return!t||"function"==typeof t||"object"===r(t)&&null!==t&&!Array.isArray(t)}function Rt(t,n){var r=function(t,n){var r=0,e=!1,o="^";"/"!==t[0]&&(t="/"+t);for(var i=0;i<t.length;i++){var u=t[i];(!e&&":"===u||e&&"/"===u)&&a(i)}return a(t.length),new RegExp(o,"i");function a(i){var u=t.slice(r,i).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(o+=e?"[^/]+/?":u,i===t.length)if(e)n&&(o+="$");else{var a=n?"":".*";o="/"===o.charAt(o.length-1)?"".concat(o).concat(a,"$"):"".concat(o,"(/").concat(a,")?(#.*)?$")}e=!e,r=i}}(t,n);return function(t){var n=t.origin;n||(n="".concat(t.protocol,"//").concat(t.host));var e=t.href.replace(n,"").replace(t.search,"").split("?")[0];return r.test(e)}}var It=!1,xt=[],Gt=rt&&window.location.href;function Bt(){return Ct()}function Ct(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(It)return new Promise((function(t,r){xt.push({resolve:t,reject:r,eventArguments:n})}));var o,u=Pt(),a=u.appsToUnload,c=u.appsToUnmount,s=u.appsToLoad,l=u.appsToMount,h=[],m=Gt,v=Gt=window.location.href;return Ht()?(It=!0,o=a.concat(s,c,l),y()):(o=s,E());function w(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n="function"==typeof(null==t?void 0:t.then)?t:Promise.resolve(t);h.push(n.catch((function(t){return console.warn(Error(f(42,!1))),console.warn(t),!1})))}function E(){return Promise.resolve().then((function(){var t=s.map(tt);return Promise.all(t).then(T).then((function(){return[]})).catch((function(t){throw T(),t})).finally((function(){}))}))}function y(){return Promise.resolve().then((function(){return A(0===o.length?"before-no-app-change":"before-app-change",b(!0)),A("before-routing-event",b(!0,{cancelNavigation:w})),Promise.all(h).then((function(r){if(r.some((function(t){return t})))return ft.call(window.history,history.state,"",m.substring(location.origin.length)),Gt=location.href,It=!1,Ct(t,n,!0);var e=a.map(gt),o=c.map(x).map((function(t){return t.then(gt)})).concat(e),i=Promise.all(o);i.then((function(){A("before-mount-routing-event",b(!0))}),(function(t){throw t}));var u=s.map((function(t){return tt(t).then((function(t){return Wt(t,i)}))})),f=l.filter((function(t){return s.indexOf(t)<0})).map((function(t){return Wt(t,i)}));return i.catch((function(t){throw T(),t})).then((function(){return T(),Promise.all(u.concat(f)).catch((function(n){throw t.forEach((function(t){return t.reject(n)})),n})).then(O).then((function(){}),(function(t){throw t}))}))}))}))}function O(){var n=bt();t.forEach((function(t){return t.resolve(n)}));try{A(0===o.length?"no-app-change":"app-change",b()),A("routing-event",b())}catch(t){setTimeout((function(){throw t}))}if(It=!1,xt.length>0){var r=xt;xt=[],Ct(r)}return n}function T(){r||(t.forEach((function(t){ut(t.eventArguments)})),ut(n))}function b(){var t,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=arguments.length>1?arguments[1]:void 0,u={},f=(e(t={},g,[]),e(t,d,[]),e(t,p,[]),e(t,P,[]),t);r?(s.concat(l).forEach((function(t,n){w(t,g)})),a.forEach((function(t){w(t,p)})),c.forEach((function(t){w(t,d)}))):o.forEach((function(t){w(t)}));var h={detail:{newAppStatuses:u,appsByNewStatus:f,totalAppChanges:o.length,originalEvent:null==n?void 0:n[0],oldUrl:m,newUrl:v}};return i&&U(h.detail,i),h;function w(t,n){var r=N(t);n=n||Nt(r),u[r]=n,(f[n]=f[n]||[]).push(r)}}function A(t,n){r||window.dispatchEvent(new i("single-spa:".concat(t),n))}}function Wt(t,n){return A(t)?I(t).then((function(t){return n.then((function(){return A(t)?C(t):t}))})):n.then((function(){return t}))}var $t=!1;function kt(t){$t=!0,rt&&(pt(t),Ct())}function Ht(){return $t}var Kt={getRawAppData:function(){return[].concat(Tt)},reroute:Ct,NOT_LOADED:p,toLoadPromise:tt,toBootstrapPromise:I,unregisterApplication:Dt,getProfilerData:function(){return R}};rt&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=Kt)}}})); | ||
/* single-spa@6.0.2 - SystemJS ES5 - prod */ | ||
System.register([],(function(t){"use strict";return{execute:function(){t({addErrorHandler:c,checkActivityFunctions:Ut,ensureJQuerySupport:vt,getAppNames:At,getAppStatus:Nt,getMountedApps:bt,mountRootParcel:k,navigateToUrl:it,patchHistoryApi:pt,pathToActiveWhen:Rt,registerApplication:_t,removeErrorHandler:s,setBootstrapMaxTime:V,setMountMaxTime:q,setUnloadMaxTime:X,setUnmountMaxTime:z,start:kt,triggerAppChange:Bt,unloadApplication:Mt,unregisterApplication:Dt});var n=Object.freeze({__proto__:null,get start(){return kt},get ensureJQuerySupport(){return vt},get setBootstrapMaxTime(){return V},get setMountMaxTime(){return q},get setUnmountMaxTime(){return z},get setUnloadMaxTime(){return X},get registerApplication(){return _t},get unregisterApplication(){return Dt},get getMountedApps(){return bt},get getAppStatus(){return Nt},get unloadApplication(){return Mt},get checkActivityFunctions(){return Ut},get getAppNames(){return At},get pathToActiveWhen(){return Rt},get navigateToUrl(){return it},get patchHistoryApi(){return pt},get triggerAppChange(){return Bt},get addErrorHandler(){return c},get removeErrorHandler(){return s},get mountRootParcel(){return k},get NOT_LOADED(){return p},get LOADING_SOURCE_CODE(){return h},get NOT_BOOTSTRAPPED(){return m},get BOOTSTRAPPING(){return v},get NOT_MOUNTED(){return d},get MOUNTING(){return w},get UPDATING(){return E},get LOAD_ERROR(){return T},get MOUNTED(){return g},get UNLOADING(){return O},get UNMOUNTING(){return y},get SKIP_BECAUSE_BROKEN(){return P}});function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function e(t,n,r){return n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t}var o=("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}).CustomEvent,i=function(){try{var t=new o("cat",{detail:{foo:"bar"}});return"cat"===t.type&&"bar"===t.detail.foo}catch(t){}return!1}()?o:"undefined"!=typeof document&&"function"==typeof document.createEvent?function(t,n){var r=document.createEvent("CustomEvent");return n?r.initCustomEvent(t,n.bubbles,n.cancelable,n.detail):r.initCustomEvent(t,!1,!1,void 0),r}:function(t,n){var r=document.createEventObject();return r.type=t,n?(r.bubbles=Boolean(n.bubbles),r.cancelable=Boolean(n.cancelable),r.detail=n.detail):(r.bubbles=!1,r.cancelable=!1,r.detail=void 0),r},u=[];function a(t,n,r){var e=l(t,n,r);u.length?u.forEach((function(t){return t(e)})):setTimeout((function(){throw e}))}function c(t){if("function"!=typeof t)throw Error(f(28,!1));u.push(t)}function s(t){if("function"!=typeof t)throw Error(f(29,!1));var n=!1;return u=u.filter((function(r){var e=r===t;return n=n||e,!e})),n}function f(t,n){for(var r=arguments.length,e=new Array(r>2?r-2:0),o=2;o<r;o++)e[o-2]=arguments[o];return"single-spa minified message #".concat(t,": ").concat(n?n+" ":"","See https://single-spa.js.org/error/?code=").concat(t).concat(e.length?"&arg=".concat(e.join("&arg=")):"")}function l(t,n,r){var e,o="".concat(_(n)," '").concat(N(n),"' died in status ").concat(n.status,": ");if(t instanceof Error){try{t.message=o+t.message}catch(t){}e=t}else{console.warn(f(30,!1,n.status,N(n)));try{e=Error(o+JSON.stringify(t))}catch(n){e=t}}return e.appOrParcelName=N(n),n.status=r,e}var p=t("NOT_LOADED","NOT_LOADED"),h=t("LOADING_SOURCE_CODE","LOADING_SOURCE_CODE"),m=t("NOT_BOOTSTRAPPED","NOT_BOOTSTRAPPED"),v=t("BOOTSTRAPPING","BOOTSTRAPPING"),d=t("NOT_MOUNTED","NOT_MOUNTED"),w=t("MOUNTING","MOUNTING"),g=t("MOUNTED","MOUNTED"),E=t("UPDATING","UPDATING"),y=t("UNMOUNTING","UNMOUNTING"),O=t("UNLOADING","UNLOADING"),T=t("LOAD_ERROR","LOAD_ERROR"),P=t("SKIP_BECAUSE_BROKEN","SKIP_BECAUSE_BROKEN");function b(t){return t.status===g}function A(t){try{return t.activeWhen(window.location)}catch(n){return a(n,t,P),!1}}function N(t){return t.name}function S(t){return Boolean(t.unmountThisParcel)}function _(t){return S(t)?"parcel":"application"}function U(){for(var t=arguments.length-1;t>0;t--)for(var n in arguments[t])"__proto__"!==n&&(arguments[t-1][n]=arguments[t][n]);return arguments[0]}function D(t,n){for(var r=0;r<t.length;r++)if(n(t[r]))return t[r];return null}function M(t){return t&&("function"==typeof t||(n=t,Array.isArray(n)&&!D(n,(function(t){return"function"!=typeof t}))));var n}function L(t,n){var r=t[n]||[];0===(r=Array.isArray(r)?r:[r]).length&&(r=[function(){return Promise.resolve()}]);var e=_(t),o=N(t);return function(t){return r.reduce((function(r,i,u){return r.then((function(){var r=i(t);return j(r)?r:Promise.reject(f(15,!1,e,o,n,u))}))}),Promise.resolve())}}function j(t){return t&&"function"==typeof t.then&&"function"==typeof t.catch}var R=[];function I(t,n){return Promise.resolve().then((function(){return t.status!==m?t:(t.status=v,t.bootstrap?Y(t,"bootstrap").then(r).catch((function(r){if(n)throw l(r,t,P);return a(r,t,P),t})):Promise.resolve().then(r))}));function r(){return t.status=d,t}}function x(t,n){return Promise.resolve().then((function(){if(t.status!==g)return t;t.status=y;var r=Object.keys(t.parcels).map((function(n){return t.parcels[n].unmountThisParcel()}));return Promise.all(r).then(e,(function(r){return e().then((function(){var e=Error(r.message);if(n)throw l(e,t,P);a(e,t,P)}))})).then((function(){return t}));function e(){return Y(t,"unmount").then((function(){t.status=d}),(function(r){if(n)throw l(r,t,P);a(r,t,P)}))}}))}var G=!1,B=!1;function C(t,n){return Promise.resolve().then((function(){return t.status!==d?t:(G||(window.dispatchEvent(new i("single-spa:before-first-mount")),G=!0),t.status=w,Y(t,"mount").then((function(){return t.status=g,B||(window.dispatchEvent(new i("single-spa:first-mount")),B=!0),t})).catch((function(r){return t.status=g,x(t,!0).then(e,e);function e(){if(n)throw l(r,t,P);return a(r,t,P),t}})))}))}var W=0,$={parcels:{}};function k(){return H.apply($,arguments)}function H(t,n){var e=this;if(!t||"object"!==r(t)&&"function"!=typeof t)throw Error(f(2,!1));if(t.name&&"string"!=typeof t.name)throw Error(f(3,!1,r(t.name)));var o=W++,i=t.name||"parcel-".concat(o);if("object"!==r(n))throw Error(f(4,!1,i,r(n)));if(!n.domElement)throw Error(f(5,!1,i));var u,a="function"==typeof t,c=a?t:function(){return Promise.resolve(t)},s={id:o,parcels:{},status:a?h:m,customProps:n,parentName:N(e),unmountThisParcel:function(){return O.then((function(){if(s.status!==g)throw Error(f(6,!1,i,s.status));return x(s,!0)})).then((function(t){return s.parentName&&delete e.parcels[s.id],t})).then((function(t){return v(t),t})).catch((function(t){throw s.status=P,w(t),t}))}};e.parcels[o]=s;var p=c();if(!p||"function"!=typeof p.then)throw Error(f(7,!1));var v,w,y=(p=p.then((function(t){if(!t)throw Error(f(8,!1));if(i=t.name||"parcel-".concat(o),Object.prototype.hasOwnProperty.call(t,"bootstrap")&&!M(t.bootstrap))throw Error(f(9,!1,i));if(!M(t.mount))throw Error(f(10,!1,i));if(!M(t.unmount))throw Error(f(11,!1,i));if(t.update&&!M(t.update))throw Error(f(12,!1,i));var n=L(t,"bootstrap"),r=L(t,"mount"),e=L(t,"unmount");s.status=m,s.name=i,s.bootstrap=n,s.mount=r,s.unmount=e,s.timeouts=Z(t.timeouts),t.update&&(s.update=L(t,"update"),u.update=function(t){return s.customProps=t,K((n=s,Promise.resolve().then((function(){if(n.status!==g)throw Error(f(32,!1,N(n)));return n.status=E,Y(n,"update").then((function(){return n.status=g,n})).catch((function(t){throw l(t,n,P)}))}))));var n})}))).then((function(){return I(s,!0)})),O=y.then((function(){return C(s,!0)})),T=new Promise((function(t,n){v=t,w=n}));return u={mount:function(){return K(Promise.resolve().then((function(){if(s.status!==d)throw Error(f(13,!1,i,s.status));return e.parcels[o]=s,C(s)})))},unmount:function(){return K(s.unmountThisParcel())},getStatus:function(){return s.status},loadPromise:K(p),bootstrapPromise:K(y),mountPromise:K(O),unmountPromise:K(T)}}function K(t){return t.then((function(){return null}))}function F(t){var e=N(t),o="function"==typeof t.customProps?t.customProps(e,window.location):t.customProps;("object"!==r(o)||null===o||Array.isArray(o))&&(o={},console.warn(f(40,!1),e,o));var i=U({},o,{name:e,mountParcel:H.bind(t),singleSpa:n});return S(t)&&(i.unmountSelf=t.unmountThisParcel),i}var J=1e3,Q={bootstrap:{millis:4e3,dieOnTimeout:!1,warningMillis:J},mount:{millis:3e3,dieOnTimeout:!1,warningMillis:J},unmount:{millis:3e3,dieOnTimeout:!1,warningMillis:J},unload:{millis:3e3,dieOnTimeout:!1,warningMillis:J},update:{millis:3e3,dieOnTimeout:!1,warningMillis:J}};function V(t,n,r){if("number"!=typeof t||t<=0)throw Error(f(16,!1));Q.bootstrap={millis:t,dieOnTimeout:n,warningMillis:r||J}}function q(t,n,r){if("number"!=typeof t||t<=0)throw Error(f(17,!1));Q.mount={millis:t,dieOnTimeout:n,warningMillis:r||J}}function z(t,n,r){if("number"!=typeof t||t<=0)throw Error(f(18,!1));Q.unmount={millis:t,dieOnTimeout:n,warningMillis:r||J}}function X(t,n,r){if("number"!=typeof t||t<=0)throw Error(f(19,!1));Q.unload={millis:t,dieOnTimeout:n,warningMillis:r||J}}function Y(t,n){var r=t.timeouts[n],e=r.warningMillis,o=_(t);return new Promise((function(i,u){var a=!1,c=!1;t[n](F(t)).then((function(t){a=!0,i(t)})).catch((function(t){a=!0,u(t)})),setTimeout((function(){return l(1)}),e),setTimeout((function(){return l(!0)}),r.millis);var s=f(31,!1,n,o,N(t),r.millis);function l(t){if(!a)if(!0===t)c=!0,r.dieOnTimeout?u(Error(s)):console.error(s);else if(!c){var n=t,o=n*e;console.warn(s),o+e<r.millis&&setTimeout((function(){return l(n+1)}),e)}}}))}function Z(t){var n={};for(var r in Q)n[r]=U({},Q[r],t&&t[r]||{});return n}function tt(t){return Promise.resolve().then((function(){return t.loadPromise?t.loadPromise:t.status!==p&&t.status!==T?t:(t.status=h,t.loadPromise=Promise.resolve().then((function(){var o=t.loadApp(F(t));if(!j(o))throw e=!0,Error(f(33,!1,N(t)));return o.then((function(e){var o;t.loadErrorTime=null,"object"!==r(n=e)&&(o=34),Object.prototype.hasOwnProperty.call(n,"bootstrap")&&!M(n.bootstrap)&&(o=35),M(n.mount)||(o=36),M(n.unmount)||(o=37);var i=_(n);if(o){var u;try{u=JSON.stringify(n)}catch(t){}return console.error(f(o,!1,i,N(t),u),n),a(void 0,t,P),t}return n.devtools&&n.devtools.overlays&&(t.devtools.overlays=U({},t.devtools.overlays,n.devtools.overlays)),t.status=m,t.bootstrap=L(n,"bootstrap"),t.mount=L(n,"mount"),t.unmount=L(n,"unmount"),t.unload=L(n,"unload"),t.timeouts=Z(n.timeouts),delete t.loadPromise,t}))})).catch((function(n){var r;return delete t.loadPromise,e?r=P:(r=T,t.loadErrorTime=(new Date).getTime()),a(n,t,r),t})));var n,e}))}var nt,rt="undefined"!=typeof window,et={hashchange:[],popstate:[]},ot=["hashchange","popstate"];function it(t){var n;if("string"==typeof t)n=t;else if(this&&this.href)n=this.href;else{if(!(t&&t.currentTarget&&t.currentTarget.href&&t.preventDefault))throw Error(f(14,!1));n=t.currentTarget.href,t.preventDefault()}var r=ht(window.location.href),e=ht(n);0===n.indexOf("#")?window.location.hash=e.hash:r.host!==e.host&&e.host?window.location.href=n:e.pathname===r.pathname&&e.search===r.search?window.location.hash=e.hash:window.history.pushState(null,null,n)}function ut(t){var n=this;if(t){var r=t[0].type;ot.indexOf(r)>=0&&et[r].forEach((function(r){try{r.apply(n,t)}catch(t){setTimeout((function(){throw t}))}}))}}function at(){Ct([],arguments)}function ct(t,n){return function(){var r=window.location.href,e=t.apply(this,arguments),o=window.location.href;return nt&&r===o||window.dispatchEvent(st(window.history.state,n)),e}}function st(t,n){var r;try{r=new PopStateEvent("popstate",{state:t})}catch(n){(r=document.createEvent("PopStateEvent")).initPopStateEvent("popstate",!1,!1,t)}return r.singleSpa=!0,r.singleSpaTrigger=n,r}var ft=null,lt=!1;function pt(t){if(lt)throw Error(f(43,!1));nt=!t||!t.hasOwnProperty("urlRerouteOnly")||t.urlRerouteOnly,lt=!0,ft=window.history.replaceState,window.addEventListener("hashchange",at),window.addEventListener("popstate",at);var n=window.addEventListener,r=window.removeEventListener;window.addEventListener=function(t,r){if(!("function"==typeof r&&ot.indexOf(t)>=0)||D(et[t],(function(t){return t===r})))return n.apply(this,arguments);et[t].push(r)},window.removeEventListener=function(t,n){return"function"==typeof n&&ot.indexOf(t)>=0&&(et[t]=et[t].filter((function(t){return t!==n}))),r.apply(this,arguments)},window.history.pushState=ct(window.history.pushState,"pushState"),window.history.replaceState=ct(ft,"replaceState")}function ht(t){var n=document.createElement("a");return n.href=t,n}rt&&(window.singleSpaNavigate?console.warn(f(41,!1)):window.singleSpaNavigate=it);var mt=!1;function vt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.jQuery;if(t||window.$&&window.$.fn&&window.$.fn.jquery&&(t=window.$),t&&!mt){var n=t.fn.on,r=t.fn.off;t.fn.on=function(t,r){return dt.call(this,n,window.addEventListener,t,r,arguments)},t.fn.off=function(t,n){return dt.call(this,r,window.removeEventListener,t,n,arguments)},mt=!0}}function dt(t,n,r,e,o){return"string"!=typeof r?t.apply(this,o):(r.split(/\s+/).forEach((function(t){ot.indexOf(t)>=0&&(n(t,e),r=r.replace(t,""))})),""===r.trim()?this:t.apply(this,o))}var wt={};function gt(t){return Promise.resolve().then((function(){var n=wt[N(t)];if(!n)return t;if(t.status===p)return Et(t,n),t;if(t.status===O)return n.promise.then((function(){return t}));if(t.status!==d&&t.status!==T)return t;var r=t.status===T?Promise.resolve():Y(t,"unload");return t.status=O,r.then((function(){return Et(t,n),t})).catch((function(r){return function(t,n,r){delete wt[N(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,a(r,t,P),n.reject(r)}(t,n,r),t}))}))}function Et(t,n){delete wt[N(t)],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,t.status=p,n.resolve()}function yt(t,n,r,e){wt[N(t)]={app:t,resolve:r,reject:e},Object.defineProperty(wt[N(t)],"promise",{get:n})}function Ot(t){return wt[t]}var Tt=[];function Pt(){var t=[],n=[],r=[],e=[],o=(new Date).getTime();return Tt.forEach((function(i){var u=i.status!==P&&A(i);switch(i.status){case T:u&&o-i.loadErrorTime>=200&&r.push(i);break;case p:case h:u&&r.push(i);break;case m:case d:!u&&Ot(N(i))?t.push(i):u&&e.push(i);break;case g:u||n.push(i)}})),{appsToUnload:t,appsToUnmount:n,appsToLoad:r,appsToMount:e}}function bt(){return Tt.filter(b).map(N)}function At(){return Tt.map(N)}function Nt(t){var n=D(Tt,(function(n){return N(n)===t}));return n?n.status:null}var St=!1;function _t(t,n,e,o){var i=function(t,n,e,o){var i,u={name:null,loadApp:null,activeWhen:null,customProps:null};return"object"===r(t)?(function(t){if(Array.isArray(t)||null===t)throw Error(f(39,!1));var n=["name","app","activeWhen","customProps"],e=Object.keys(t).reduce((function(t,r){return n.indexOf(r)>=0?t:t.concat(r)}),[]);if(0!==e.length)throw Error(f(38,!1,n.join(", "),e.join(", ")));if("string"!=typeof t.name||0===t.name.length)throw Error(f(20,!1));if("object"!==r(t.app)&&"function"!=typeof t.app)throw Error(f(20,!1));var o=function(t){return"string"==typeof t||"function"==typeof t};if(!(o(t.activeWhen)||Array.isArray(t.activeWhen)&&t.activeWhen.every(o)))throw Error(f(24,!1));if(!jt(t.customProps))throw Error(f(22,!1))}(t),u.name=t.name,u.loadApp=t.app,u.activeWhen=t.activeWhen,u.customProps=t.customProps):(function(t,n,r,e){if("string"!=typeof t||0===t.length)throw Error(f(20,!1));if(!n)throw Error(f(23,!1));if("function"!=typeof r)throw Error(f(24,!1));if(!jt(e))throw Error(f(22,!1))}(t,n,e,o),u.name=t,u.loadApp=n,u.activeWhen=e,u.customProps=o),u.loadApp="function"!=typeof(i=u.loadApp)?function(){return Promise.resolve(i)}:i,u.customProps=function(t){return t||{}}(u.customProps),u.activeWhen=function(t){var n=Array.isArray(t)?t:[t];return n=n.map((function(t){return"function"==typeof t?t:Rt(t)})),function(t){return n.some((function(n){return n(t)}))}}(u.activeWhen),u}(t,n,e,o);if(Ht()||St||(St=!0,setTimeout((function(){Ht()||console.warn(f(1,!1))}),5e3)),-1!==At().indexOf(i.name))throw Error(f(21,!1,i.name));Tt.push(U({loadErrorTime:null,status:p,parcels:{},devtools:{overlays:{options:{},selectors:[]}}},i)),rt&&(vt(),Ct())}function Ut(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location;return Tt.filter((function(n){return n.activeWhen(t)})).map(N)}function Dt(t){if(0===Tt.filter((function(n){return N(n)===t})).length)throw Error(f(25,!1,t));return(rt?Mt(t,{waitForUnmount:!1}):Promise.resolve()).then((function(){var n=Tt.map(N).indexOf(t);Tt.splice(n,1)}))}function Mt(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{waitForUnmount:!1};if("string"!=typeof t)throw Error(f(26,!1));var r=D(Tt,(function(n){return N(n)===t}));if(!r)throw Error(f(27,!1,t));var e,o=Ot(N(r));if(n&&n.waitForUnmount){if(o)return o.promise;var i=new Promise((function(t,n){yt(r,(function(){return i}),t,n)}));return i}return o?(e=o.promise,Lt(r,o.resolve,o.reject)):e=new Promise((function(t,n){yt(r,(function(){return e}),t,n),Lt(r,t,n)})),e}function Lt(t,n,r){Promise.resolve().then((function(){if(D(Ut(),(function(n){return n===N(t)})))return Bt()})).then((function(){return x(t).then(gt).then((function(){n(),setTimeout((function(){Ct()}))}))})).catch(r)}function jt(t){return!t||"function"==typeof t||"object"===r(t)&&null!==t&&!Array.isArray(t)}function Rt(t,n){var r=function(t,n){var r=0,e=!1,o="^";"/"!==t[0]&&(t="/"+t);for(var i=0;i<t.length;i++){var u=t[i];(!e&&":"===u||e&&"/"===u)&&a(i)}return a(t.length),new RegExp(o,"i");function a(i){var u=t.slice(r,i).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");if(o+=e?"[^/]+/?":u,i===t.length)if(e)n&&(o+="$");else{var a=n?"":".*";o="/"===o.charAt(o.length-1)?"".concat(o).concat(a,"$"):"".concat(o,"(/").concat(a,")?(#.*)?$")}e=!e,r=i}}(t,n);return function(t){var n=t.origin;n||(n="".concat(t.protocol,"//").concat(t.host));var e=t.href.replace(n,"").replace(t.search,"").split("?")[0];return r.test(e)}}var It=!1,xt=[],Gt=rt&&window.location.href;function Bt(){return Ct()}function Ct(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(It)return new Promise((function(t,r){xt.push({resolve:t,reject:r,eventArguments:n})}));var o,u=Pt(),a=u.appsToUnload,c=u.appsToUnmount,s=u.appsToLoad,l=u.appsToMount,h=[],m=Gt,v=Gt=window.location.href;return Ht()?(It=!0,o=a.concat(s,c,l),y()):(o=s,E());function w(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n="function"==typeof(null==t?void 0:t.then)?t:Promise.resolve(t);h.push(n.catch((function(t){return console.warn(Error(f(42,!1))),console.warn(t),!1})))}function E(){return Promise.resolve().then((function(){var t=s.map(tt);return Promise.all(t).then(T).then((function(){return[]})).catch((function(t){throw T(),t})).finally((function(){}))}))}function y(){return Promise.resolve().then((function(){return A(0===o.length?"before-no-app-change":"before-app-change",b(!0)),A("before-routing-event",b(!0,{cancelNavigation:w})),Promise.all(h).then((function(r){if(r.some((function(t){return t})))return ft.call(window.history,history.state,"",m.substring(location.origin.length)),Gt=location.href,It=!1,Ct(t,n,!0);var e=a.map(gt),o=c.map(x).map((function(t){return t.then(gt)})).concat(e),i=Promise.all(o);i.then((function(){A("before-mount-routing-event",b(!0))}),(function(t){throw t}));var u=s.map((function(t){return tt(t).then((function(t){return Wt(t,i)}))})),f=l.filter((function(t){return s.indexOf(t)<0})).map((function(t){return Wt(t,i)}));return i.catch((function(t){throw T(),t})).then((function(){return T(),Promise.all(u.concat(f)).catch((function(n){throw t.forEach((function(t){return t.reject(n)})),n})).then(O).then((function(){}),(function(t){throw t}))}))}))}))}function O(){var n=bt();t.forEach((function(t){return t.resolve(n)}));try{A(0===o.length?"no-app-change":"app-change",b()),A("routing-event",b())}catch(t){setTimeout((function(){throw t}))}if(It=!1,xt.length>0){var r=xt;xt=[],Ct(r)}return n}function T(){r||(t.forEach((function(t){ut(t.eventArguments)})),ut(n))}function b(){var t,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=arguments.length>1?arguments[1]:void 0,u={},f=(e(t={},g,[]),e(t,d,[]),e(t,p,[]),e(t,P,[]),t);r?(s.concat(l).forEach((function(t,n){w(t,g)})),a.forEach((function(t){w(t,p)})),c.forEach((function(t){w(t,d)}))):o.forEach((function(t){w(t)}));var h={detail:{newAppStatuses:u,appsByNewStatus:f,totalAppChanges:o.length,originalEvent:null==n?void 0:n[0],oldUrl:m,newUrl:v}};return i&&U(h.detail,i),h;function w(t,n){var r=N(t);n=n||Nt(r),u[r]=n,(f[n]=f[n]||[]).push(r)}}function A(t,n){r||window.dispatchEvent(new i("single-spa:".concat(t),n))}}function Wt(t,n){return A(t)?I(t).then((function(t){return n.then((function(){return A(t)?C(t):t}))})):n.then((function(){return t}))}var $t=!1;function kt(t){$t=!0,rt&&(pt(t),Ct())}function Ht(){return $t}var Kt={getRawAppData:function(){return[].concat(Tt)},reroute:Ct,NOT_LOADED:p,toLoadPromise:tt,toBootstrapPromise:I,unregisterApplication:Dt,getProfilerData:function(){return R}};rt&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=Kt)}}})); | ||
//# sourceMappingURL=single-spa.min.js.map |
{ | ||
"name": "single-spa", | ||
"version": "6.0.1", | ||
"version": "6.0.2", | ||
"description": "The router for easy microfrontends", | ||
@@ -5,0 +5,0 @@ "main": "lib/es2015/umd/single-spa.min.cjs", |
@@ -9,3 +9,3 @@ <img src="https://github.com/single-spa/single-spa/assets/5524384/7b1b642d-53d1-409a-b992-e77495bcf631" height="40"> | ||
[Join the chat on Slack](https://join.slack.com/t/single-spa/shared_invite/zt-21skfl7l3-leF7JkoKwKaRIPX~N6jXJQ) | ||
[Join the chat on Slack](https://join.slack.com/t/single-spa/shared_invite/zt-2efw13fg4-oJgemeyCUJv4~JrQlYttnA) | ||
@@ -12,0 +12,0 @@ [Donate to this project](https://opencollective.com/single-spa) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2046927
10636