New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

single-spa

Package Overview
Dependencies
Maintainers
13
Versions
139
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

single-spa - npm Package Compare versions

Comparing version 4.3.2 to 4.3.3

typings/single-spa.d.ts

5

jest.config.json
{
"moduleNameMapper": {
"single-spa": "<rootDir>/src/single-spa.js"
}
},
"setupFiles": [
"<rootDir>/spec/test-setup.js"
]
}

2

lib/esm/single-spa.min.js

@@ -1,2 +0,2 @@

var t=Object.freeze({get start(){return Ut},get ensureJQuerySupport(){return lt},get setBootstrapMaxTime(){return D},get setMountMaxTime(){return U},get setUnmountMaxTime(){return C},get setUnloadMaxTime(){return L},get registerApplication(){return Pt},get getMountedApps(){return gt},get getAppStatus(){return bt},get unloadApplication(){return Nt},get checkActivityFunctions(){return Ot},get getAppNames(){return yt},get declareChildApplication(){return Et},get unloadChildApplication(){return At},get navigateToUrl(){return nt},get triggerAppChange(){return _t},get addErrorHandler(){return c},get removeErrorHandler(){return s},get mountRootParcel(){return Q},get NOT_LOADED(){return l},get LOADING_SOURCE_CODE(){return p},get NOT_BOOTSTRAPPED(){return m},get BOOTSTRAPPING(){return d},get NOT_MOUNTED(){return h},get MOUNTING(){return v},get UPDATING(){return g},get MOUNTED(){return w},get UNMOUNTING(){return y},get SKIP_BECAUSE_BROKEN(){return E}}),n=("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}).CustomEvent;var e=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,n){var e=document.createEvent("CustomEvent");return n?e.initCustomEvent(t,n.bubbles,n.cancelable,n.detail):e.initCustomEvent(t,!1,!1,void 0),e}:function(t,n){var e=document.createEventObject();return e.type=t,n?(e.bubbles=Boolean(n.bubbles),e.cancelable=Boolean(n.cancelable),e.detail=n.detail):(e.bubbles=!1,e.cancelable=!1,e.detail=void 0),e};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 o(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function i(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{},r=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(e).filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.forEach(function(n){o(t,n,e[n])})}return t}var a=[];function u(t,n){var e=f(t,n);a.length?a.forEach(function(t){return t(e)}):setTimeout(function(){throw e})}function c(t){if("function"!=typeof t)throw new Error("a single-spa error handler must be a function");a.push(t)}function s(t){if("function"!=typeof t)throw new Error("a single-spa error handler must be a function");var n=!1;return a=a.filter(function(e){var r=e===t;return n=n||r,!r}),n}function f(t,n){var e,r=n.unmountThisParcel?"Parcel":"Application",o="".concat(r," '").concat(n.name,"' died in status ").concat(n.status,": ");if(t instanceof Error){try{t.message=o+t.message}catch(t){}e=t}else{console.warn("While ".concat(n.status,", '").concat(n.name,"' rejected its lifecycle function promise with a non-Error. This will cause stack traces to not be accurate."));try{e=new Error(o+JSON.stringify(t))}catch(n){e=t}}return e.appName=n.name,e.name=n.name,e}var l="NOT_LOADED",p="LOADING_SOURCE_CODE",m="NOT_BOOTSTRAPPED",d="BOOTSTRAPPING",h="NOT_MOUNTED",v="MOUNTING",w="MOUNTED",g="UPDATING",y="UNMOUNTING",b="UNLOADING",E="SKIP_BECAUSE_BROKEN";function P(t){return t.status===w}function O(t){return!P(t)}function T(t){return t.status!==l&&t.status!==p}function A(t){return!T(t)}function N(t){try{return t.activeWhen(window.location)}catch(n){u(n,t),t.status=E}}function S(t){try{return!t.activeWhen(window.location)}catch(n){u(n,t),t.status=E}}function j(t){return t!==E&&(!t||t.status!==E)}function x(t){return t.name}var _={bootstrap:{millis:4e3,dieOnTimeout:!1},mount:{millis:3e3,dieOnTimeout:!1},unmount:{millis:3e3,dieOnTimeout:!1},unload:{millis:3e3,dieOnTimeout:!1}};function D(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("number"!=typeof t||t<=0)throw new Error("bootstrap max time must be a positive integer number of milliseconds");_.bootstrap={millis:t,dieOnTimeout:n}}function U(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("number"!=typeof t||t<=0)throw new Error("mount max time must be a positive integer number of milliseconds");_.mount={millis:t,dieOnTimeout:n}}function C(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("number"!=typeof t||t<=0)throw new Error("unmount max time must be a positive integer number of milliseconds");_.unmount={millis:t,dieOnTimeout:n}}function L(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("number"!=typeof t||t<=0)throw new Error("unload max time must be a positive integer number of milliseconds");_.unload={millis:t,dieOnTimeout:n}}function I(t,n,e){var r=1e3;return new Promise(function(o,i){var a=!1,u=!1;function c(t){if(!a)if(!0===t)u=!0,e.dieOnTimeout?i("".concat(n," did not resolve or reject for ").concat(e.millis," milliseconds")):console.error("".concat(n," did not resolve or reject for ").concat(e.millis," milliseconds -- we're no longer going to warn you about it."));else if(!u){var o=t,s=o*r;console.warn("".concat(n," did not resolve or reject within ").concat(s," milliseconds")),s+r<e.millis&&setTimeout(function(){return c(o+1)},r)}}t.then(function(t){a=!0,o(t)}).catch(function(t){a=!0,i(t)}),setTimeout(function(){return c(1)},r),setTimeout(function(){return c(!0)},e.millis)})}function M(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return i({},_,t)}function B(t,n){for(var e=0;e<t.length;e++)if(n(t[e]))return t[e];return null}function G(t){return t&&("function"==typeof t||(n=t,Array.isArray(n)&&!B(n,function(t){return"function"!=typeof t})));var n}function R(t,n){return 0===(t=Array.isArray(t)?t:[t]).length&&(t=[function(){return Promise.resolve()}]),function(e){return new Promise(function(r,o){!function i(a){var u=t[a](e);k(u)?u.then(function(){a===t.length-1?r():i(a+1)}).catch(o):o("".concat(n," at index ").concat(a," did not return a promise"))}(0)})}}function k(t){return t&&"function"==typeof t.then&&"function"==typeof t.catch}function q(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Promise.resolve().then(function(){return t.status!==m?t:(t.status=d,I(t.bootstrap(X(t)),"Bootstrapping appOrParcel '".concat(t.name,"'"),t.timeouts.bootstrap).then(function(){return t.status=h,t}).catch(function(e){if(t.status=E,n)throw f(e,t);return u(e,t),t}))})}function W(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Promise.resolve().then(function(){if(t.status!==w)return t;t.status=y;var e=Object.keys(t.parcels).map(function(n){return t.parcels[n].unmountThisParcel()});return Promise.all(e).then(r,function(e){return r().then(function(){var r=new Error(e.message);if(n){var o=f(r,t);throw t.status=E,o}u(r,t),t.status=E})}).then(function(){return t});function r(){return I(t.unmount(X(t)),"Unmounting application ".concat(t.name,"'"),t.timeouts.unmount).then(function(){t.status=h}).catch(function(e){if(n){var r=f(e,t);throw t.status=E,r}u(e,t),t.status=E})}})}var F=!1,K=!1;function $(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Promise.resolve().then(function(){return t.status!==h?t:(F||(window.dispatchEvent(new e("single-spa:before-first-mount")),F=!0),I(t.mount(X(t)),"Mounting application '".concat(t.name,"'"),t.timeouts.mount).then(function(){return t.status=w,K||(window.dispatchEvent(new e("single-spa:first-mount")),K=!0),t}).catch(function(e){return t.status=w,W(t).then(r,r);function r(){if(n){var r=f(e,t);throw t.status=E,r}return u(e,t),t.status=E,t}}))})}var H=0,J={parcels:{}};function Q(){return V.apply(J,arguments)}function V(t,n){var e=this;if(!t||"object"!==r(t)&&"function"!=typeof t)throw new Error("Cannot mount parcel without a config object or config loading function");if(t.name&&"string"!=typeof t.name)throw new Error("Parcel name must be a string, if provided");if("object"!==r(n))throw new Error("Parcel ".concat(name," has invalid customProps -- must be an object"));if(!n.domElement)throw new Error("Parcel ".concat(name," cannot be mounted without a domElement provided as a prop"));var o,i=H++,a="function"==typeof t,u=a?t:function(){return Promise.resolve(t)},c={id:i,parcels:{},status:a?p:m,customProps:n,parentName:e.name,unmountThisParcel:function(){if(c.status!==w)throw new Error("Cannot unmount parcel '".concat(name,"' -- it is in a ").concat(c.status," status"));return W(c,!0).then(function(t){return c.parentName&&delete e.parcels[c.id],t}).then(function(t){return l(t),t}).catch(function(t){throw c.status=E,d(t),t})}};e.parcels[i]=c;var s=u();if(!s||"function"!=typeof s.then)throw new Error("When mounting a parcel, the config loading function must return a promise that resolves with the parcel config");var l,d,v=(s=s.then(function(t){if(!t)throw new Error("When mounting a parcel, the config loading function returned a promise that did not resolve with a parcel config");var n=t.name||"parcel-".concat(i);if(!G(t.bootstrap))throw new Error("Parcel ".concat(n," must have a valid bootstrap function"));if(!G(t.mount))throw new Error("Parcel ".concat(n," must have a valid mount function"));if(!G(t.unmount))throw new Error("Parcel ".concat(n," must have a valid unmount function"));if(t.update&&!G(t.update))throw new Error("Parcel ".concat(n," provided an invalid update function"));var e=R(t.bootstrap),r=R(t.mount),a=R(t.unmount);c.status=m,c.name=n,c.bootstrap=e,c.mount=r,c.unmount=a,c.timeouts=M(t.timeouts),t.update&&(c.update=R(t.update),o.update=function(t){return c.customProps=t,z(function(t){return Promise.resolve().then(function(){if(t.status!==w)throw new Error("Cannot update parcel '".concat(t.name,"' because it is not mounted"));return t.status=g,I(t.update(X(t)),"Updating parcel '".concat(t.name,"'"),t.timeouts.mount).then(function(){return t.status=w,t}).catch(function(n){var e=f(n,t);throw t.status=E,e})})}(c))})})).then(function(){return q(c,!0)}),y=v.then(function(){return $(c,!0)}),b=new Promise(function(t,n){l=t,d=n});return o={mount:function(){return z(Promise.resolve().then(function(){if(c.status!==h)throw new Error("Cannot mount parcel '".concat(name,"' -- it is in a ").concat(c.status," status"));return e.parcels[i]=c,$(c)}))},unmount:function(){return z(c.unmountThisParcel())},getStatus:function(){return c.status},loadPromise:z(s),bootstrapPromise:z(v),mountPromise:z(y),unmountPromise:z(b)}}function z(t){return t.then(function(){return null})}function X(n){var e=i({},n.customProps,{name:n.name,mountParcel:V.bind(n),singleSpa:t});return n.unmountThisParcel&&(e.unmountSelf=n.unmountThisParcel),e}function Y(t){return Promise.resolve().then(function(){return t.status!==l?t:(t.status=p,Promise.resolve().then(function(){var e=t.loadImpl(X(t));if(!k(e))throw new Error("single-spa loading function did not return a promise. Check the second argument to registerApplication('".concat(t.name,"', loadingFunction, activityFunction)"));return e.then(function(e){var o;return"object"!==r(n=e)&&(o="does not export anything"),G(n.bootstrap)||(o="does not export a bootstrap function or array of functions"),G(n.mount)||(o="does not export a mount function or array of functions"),G(n.unmount)||(o="does not export an unmount function or array of functions"),o?(u(o,t),t.status=E,t):(n.devtools&&n.devtools.overlays&&(t.devtools.overlays=i({},t.devtools.overlays,n.devtools.overlays)),t.status=m,t.bootstrap=R(n.bootstrap,"App '".concat(t.name,"' bootstrap function")),t.mount=R(n.mount,"App '".concat(t.name,"' mount function")),t.unmount=R(n.unmount,"App '".concat(t.name,"' unmount function")),t.unload=R(n.unload||[],"App '".concat(t.name,"' unload function")),t.timeouts=M(n.timeouts),t)})}).catch(function(n){return u(n,t),t.status=E,t}));var n})}var Z={hashchange:[],popstate:[]},tt=["hashchange","popstate"];function nt(t){var n,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};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 new Error("singleSpaNavigate must be either called with a string url, with an <a> tag as its context, or with an event whose currentTarget is an <a> tag");n=t.currentTarget.href,t.preventDefault()}var r=st(window.location.href),o=st(n);if(0===n.indexOf("#"))window.location.hash="#"+o.anchor;else if(r.host!==o.host&&o.host){if(e.isTestingEnv)return{wouldHaveReloadedThePage:!0};window.location.href=n}else!function(t,n){return n===t||n==="/"+t}(o.path,r.path)?window.history.pushState(null,null,n):window.location.hash="#"+o.anchor}function et(t){var n=this;if(t){var e=t[0].type;tt.indexOf(e)>=0&&Z[e].forEach(function(e){e.apply(n,t)})}}function rt(){_t([],arguments)}window.addEventListener("hashchange",rt),window.addEventListener("popstate",rt);var ot=window.addEventListener,it=window.removeEventListener;window.addEventListener=function(t,n){if(!("function"==typeof n&&tt.indexOf(t)>=0)||B(Z[t],function(t){return t===n}))return ot.apply(this,arguments);Z[t].push(n)},window.removeEventListener=function(t,n){if(!("function"==typeof n&&tt.indexOf(t)>=0))return it.apply(this,arguments);Z[t]=Z[t].filter(function(t){return t!==n})};var at=window.history.pushState;window.history.pushState=function(t){var n=at.apply(this,arguments);return rt(ct(t)),n};var ut=window.history.replaceState;function ct(t){try{return new PopStateEvent("popstate",{state:t})}catch(e){var n=document.createEvent("PopStateEvent");return n.initPopStateEvent("popstate",!1,!1,t),n}}function st(t){for(var n={strictMode:!0,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},e=n.parser.strict.exec(t),r={},o=14;o--;)r[n.key[o]]=e[o]||"";return r[n.q.name]={},r[n.key[12]].replace(n.q.parser,function(t,e,o){e&&(r[n.q.name][e]=o)}),r}window.history.replaceState=function(t){var n=ut.apply(this,arguments);return rt(ct(t)),n},window.singleSpaNavigate=nt;var ft=!1;function lt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.jQuery;if(t||window.$&&window.$.fn&&window.$.fn.jquery&&(t=window.$),t&&!ft){var n=t.fn.on,e=t.fn.off;t.fn.on=function(t,e){return pt.call(this,n,window.addEventListener,t,e,arguments)},t.fn.off=function(t,n){return pt.call(this,e,window.removeEventListener,t,n,arguments)},ft=!0}}function pt(t,n,e,r,o){return"string"!=typeof e?t.apply(this,o):(e.split(/\s+/).forEach(function(t){tt.indexOf(t)>=0&&(n(t,r),e=e.replace(t,""))}),""===e.trim()?this:t.apply(this,o))}var mt={};function dt(t){return Promise.resolve().then(function(){var n=mt[t.name];return n?t.status===l?(ht(t,n),t):t.status===b?n.promise.then(function(){return t}):t.status!==h?t:(t.status=b,I(t.unload(X(t)),"Unloading application '".concat(t.name,"'"),t.timeouts.unload).then(function(){return ht(t,n),t}).catch(function(e){return function(t,n,e){delete mt[t.name],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,u(e,t),t.status=E,n.reject(e)}(t,n,e),t})):t})}function ht(t,n){delete mt[t.name],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,t.status=l,n.resolve()}function vt(t,n,e,r){mt[t.name]={app:t,resolve:e,reject:r},Object.defineProperty(mt[t.name],"promise",{get:n})}var wt=[];function gt(){return wt.filter(P).map(x)}function yt(){return wt.map(x)}function bt(t){var n=B(wt,function(n){return n.name===t});return n?n.status:null}function Et(t,n,e){return console.warn('declareChildApplication is deprecated and will be removed in the next major version, use "registerApplication" instead'),Pt(t,n,e)}function Pt(t,n,e){var o,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if("string"!=typeof t||0===t.length)throw new Error("The first argument must be a non-empty string 'appName'");if(-1!==yt().indexOf(t))throw new Error("There is already an app declared with name ".concat(t));if("object"!==r(i)||Array.isArray(i))throw new Error("customProps must be an object");if(!n)throw new Error("The application or loading function is required");if(o="function"!=typeof n?function(){return Promise.resolve(n)}:n,"function"!=typeof e)throw new Error("The activeWhen argument must be a function");wt.push({name:t,loadImpl:o,activeWhen:e,status:l,parcels:{},devtools:{overlays:{options:{},selectors:[]}},customProps:i}),lt(),_t()}function Ot(t){for(var n=[],e=0;e<wt.length;e++)wt[e].activeWhen(t)&&n.push(wt[e].name);return n}function Tt(){return wt.filter(j).filter(A).filter(N)}function At(t,n){return console.warn('unloadChildApplication is deprecated and will be removed in the next major version, use "unloadApplication" instead'),Nt(t,n)}function Nt(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{waitForUnmount:!1};if("string"!=typeof t)throw new Error("unloadApplication requires a string 'appName'");var e=B(wt,function(n){return n.name===t});if(!e)throw new Error("Could not unload application '".concat(t,"' because no such application has been declared"));var r,o=function(t){return mt[t]}(e.name);if(n&&n.waitForUnmount){if(o)return o.promise;var i=new Promise(function(t,n){vt(e,function(){return i},t,n)});return i}return o?(r=o.promise,St(e,o.resolve,o.reject)):r=new Promise(function(t,n){vt(e,function(){return r},t,n),St(e,t,n)}),r}function St(t,n,e){W(t).then(dt).then(function(){n(),setTimeout(function(){_t()})}).catch(e)}var jt=!1,xt=[];function _t(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;if(jt)return new Promise(function(t,e){xt.push({resolve:t,reject:e,eventArguments:n})});jt=!0;var r=!0;return Dt?Promise.resolve().then(function(){window.dispatchEvent(new e("single-spa:before-routing-event",a()));var n=Object.keys(mt).map(function(t){return mt[t].app}).filter(O).map(dt),u=wt.filter(j).filter(P).filter(S).map(W).map(function(t){return t.then(dt)}),c=u.concat(n);c.length>0&&(r=!1);var s=Promise.all(c),f=Tt(),l=f.map(function(t){return Y(t).then(q).then(function(t){return s.then(function(){return $(t)})})});l.length>0&&(r=!1);var p=wt.filter(j).filter(O).filter(T).filter(N).filter(function(t){return f.indexOf(t)<0}).map(function(t){return q(t).then(function(){return s}).then(function(){return $(t)})});return p.length>0&&(r=!1),s.catch(function(t){throw i(),t}).then(function(){return i(),Promise.all(l.concat(p)).catch(function(n){throw t.forEach(function(t){return t.reject(n)}),n}).then(function(){return o(!1)})})}):Promise.resolve().then(function(){var t=Tt().map(Y);return t.length>0&&(r=!1),Promise.all(t).then(o).catch(function(t){throw i(),t})});function o(){var n=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],o=gt();n&&i(),t.forEach(function(t){return t.resolve(o)});try{var u=r?"single-spa:no-app-change":"single-spa:app-change";window.dispatchEvent(new e(u,a())),window.dispatchEvent(new e("single-spa:routing-event",a()))}catch(t){setTimeout(function(){throw t})}if(jt=!1,xt.length>0){var c=xt;xt=[],_t(c)}return o}function i(){t.forEach(function(t){et(t.eventArguments)}),et(n)}function a(){var t={detail:{}};return n&&n[0]&&(t.detail.originalEvent=n[0]),t}}var Dt=!1;function Ut(){Dt=!0,_t()}setTimeout(function(){Dt||console.warn("singleSpa.start() has not been called, ".concat(5e3,"ms after single-spa was loaded. Before start() is called, apps can be declared and loaded, but not bootstrapped or mounted. See https://github.com/CanopyTax/single-spa/blob/master/docs/single-spa-api.md#start"))},5e3);var Ct={getRawAppData:function(){return[].concat(wt)},reroute:_t,NOT_LOADED:l,toLoadPromise:Y,toBootstrapPromise:q};window&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=Ct);export{d as BOOTSTRAPPING,p as LOADING_SOURCE_CODE,w as MOUNTED,v as MOUNTING,m as NOT_BOOTSTRAPPED,l as NOT_LOADED,h as NOT_MOUNTED,E as SKIP_BECAUSE_BROKEN,y as UNMOUNTING,g as UPDATING,c as addErrorHandler,Ot as checkActivityFunctions,Et as declareChildApplication,lt as ensureJQuerySupport,yt as getAppNames,bt as getAppStatus,gt as getMountedApps,Q as mountRootParcel,nt as navigateToUrl,Pt as registerApplication,s as removeErrorHandler,D as setBootstrapMaxTime,U as setMountMaxTime,L as setUnloadMaxTime,C as setUnmountMaxTime,Ut as start,_t as triggerAppChange,Nt as unloadApplication,At as unloadChildApplication};
var t=Object.freeze({get start(){return Ct},get ensureJQuerySupport(){return lt},get setBootstrapMaxTime(){return D},get setMountMaxTime(){return U},get setUnmountMaxTime(){return C},get setUnloadMaxTime(){return I},get registerApplication(){return Pt},get getMountedApps(){return wt},get getAppStatus(){return bt},get unloadApplication(){return Nt},get checkActivityFunctions(){return Ot},get getAppNames(){return yt},get declareChildApplication(){return Et},get unloadChildApplication(){return At},get navigateToUrl(){return nt},get triggerAppChange(){return _t},get addErrorHandler(){return c},get removeErrorHandler(){return s},get mountRootParcel(){return Q},get NOT_LOADED(){return l},get LOADING_SOURCE_CODE(){return p},get NOT_BOOTSTRAPPED(){return m},get BOOTSTRAPPING(){return d},get NOT_MOUNTED(){return h},get MOUNTING(){return v},get UPDATING(){return w},get MOUNTED(){return g},get UNMOUNTING(){return y},get SKIP_BECAUSE_BROKEN(){return E}}),n=("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}).CustomEvent;var e=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,n){var e=document.createEvent("CustomEvent");return n?e.initCustomEvent(t,n.bubbles,n.cancelable,n.detail):e.initCustomEvent(t,!1,!1,void 0),e}:function(t,n){var e=document.createEventObject();return e.type=t,n?(e.bubbles=Boolean(n.bubbles),e.cancelable=Boolean(n.cancelable),e.detail=n.detail):(e.bubbles=!1,e.cancelable=!1,e.detail=void 0),e};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 o(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function i(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{},r=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(e).filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.forEach(function(n){o(t,n,e[n])})}return t}var a=[];function u(t,n){var e=f(t,n);a.length?a.forEach(function(t){return t(e)}):setTimeout(function(){throw e})}function c(t){if("function"!=typeof t)throw Error("a single-spa error handler must be a function");a.push(t)}function s(t){if("function"!=typeof t)throw Error("a single-spa error handler must be a function");var n=!1;return a=a.filter(function(e){var r=e===t;return n=n||r,!r}),n}function f(t,n){var e,r=n.unmountThisParcel?"Parcel":"Application",o="".concat(r," '").concat(n.name,"' died in status ").concat(n.status,": ");if(t instanceof Error){try{t.message=o+t.message}catch(t){}e=t}else{console.warn("While ".concat(n.status,", '").concat(n.name,"' rejected its lifecycle function promise with a non-Error. This will cause stack traces to not be accurate."));try{e=Error(o+JSON.stringify(t))}catch(n){e=t}}return e.appName=n.name,e.name=n.name,e}var l="NOT_LOADED",p="LOADING_SOURCE_CODE",m="NOT_BOOTSTRAPPED",d="BOOTSTRAPPING",h="NOT_MOUNTED",v="MOUNTING",g="MOUNTED",w="UPDATING",y="UNMOUNTING",b="UNLOADING",E="SKIP_BECAUSE_BROKEN";function P(t){return t.status===g}function O(t){return!P(t)}function T(t){return t.status!==l&&t.status!==p}function A(t){return!T(t)}function N(t){try{return t.activeWhen(window.location)}catch(n){u(n,t),t.status=E}}function S(t){try{return!t.activeWhen(window.location)}catch(n){u(n,t),t.status=E}}function j(t){return t!==E&&(!t||t.status!==E)}function x(t){return t.name}var _={bootstrap:{millis:4e3,dieOnTimeout:!1},mount:{millis:3e3,dieOnTimeout:!1},unmount:{millis:3e3,dieOnTimeout:!1},unload:{millis:3e3,dieOnTimeout:!1}};function D(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("number"!=typeof t||t<=0)throw Error("bootstrap max time must be a positive integer number of milliseconds");_.bootstrap={millis:t,dieOnTimeout:n}}function U(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("number"!=typeof t||t<=0)throw Error("mount max time must be a positive integer number of milliseconds");_.mount={millis:t,dieOnTimeout:n}}function C(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("number"!=typeof t||t<=0)throw Error("unmount max time must be a positive integer number of milliseconds");_.unmount={millis:t,dieOnTimeout:n}}function I(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("number"!=typeof t||t<=0)throw Error("unload max time must be a positive integer number of milliseconds");_.unload={millis:t,dieOnTimeout:n}}function L(t,n,e){var r=1e3;return new Promise(function(o,i){var a=!1,u=!1;function c(t){if(!a)if(!0===t)u=!0,e.dieOnTimeout?i("".concat(n," did not resolve or reject for ").concat(e.millis," milliseconds")):console.error("".concat(n," did not resolve or reject for ").concat(e.millis," milliseconds -- we're no longer going to warn you about it."));else if(!u){var o=t,s=o*r;console.warn("".concat(n," did not resolve or reject within ").concat(s," milliseconds")),s+r<e.millis&&setTimeout(function(){return c(o+1)},r)}}t.then(function(t){a=!0,o(t)}).catch(function(t){a=!0,i(t)}),setTimeout(function(){return c(1)},r),setTimeout(function(){return c(!0)},e.millis)})}function M(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return i({},_,t)}function B(t,n){for(var e=0;e<t.length;e++)if(n(t[e]))return t[e];return null}function G(t){return t&&("function"==typeof t||(n=t,Array.isArray(n)&&!B(n,function(t){return"function"!=typeof t})));var n}function R(t,n){return 0===(t=Array.isArray(t)?t:[t]).length&&(t=[function(){return Promise.resolve()}]),function(e){return new Promise(function(r,o){!function i(a){var u=t[a](e);k(u)?u.then(function(){a===t.length-1?r():i(a+1)}).catch(o):o("".concat(n," at index ").concat(a," did not return a promise"))}(0)})}}function k(t){return t&&"function"==typeof t.then&&"function"==typeof t.catch}function q(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Promise.resolve().then(function(){return t.status!==m?t:(t.status=d,L(t.bootstrap(X(t)),"Bootstrapping appOrParcel '".concat(t.name,"'"),t.timeouts.bootstrap).then(function(){return t.status=h,t}).catch(function(e){if(t.status=E,n)throw f(e,t);return u(e,t),t}))})}function W(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Promise.resolve().then(function(){if(t.status!==g)return t;t.status=y;var e=Object.keys(t.parcels).map(function(n){return t.parcels[n].unmountThisParcel()});return Promise.all(e).then(r,function(e){return r().then(function(){var r=Error(e.message);if(n){var o=f(r,t);throw t.status=E,o}u(r,t),t.status=E})}).then(function(){return t});function r(){return L(t.unmount(X(t)),"Unmounting application ".concat(t.name,"'"),t.timeouts.unmount).then(function(){t.status=h}).catch(function(e){if(n){var r=f(e,t);throw t.status=E,r}u(e,t),t.status=E})}})}var F=!1,K=!1;function $(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Promise.resolve().then(function(){return t.status!==h?t:(F||(window.dispatchEvent(new e("single-spa:before-first-mount")),F=!0),L(t.mount(X(t)),"Mounting application '".concat(t.name,"'"),t.timeouts.mount).then(function(){return t.status=g,K||(window.dispatchEvent(new e("single-spa:first-mount")),K=!0),t}).catch(function(e){return t.status=g,W(t).then(r,r);function r(){if(n){var r=f(e,t);throw t.status=E,r}return u(e,t),t.status=E,t}}))})}var H=0,J={parcels:{}};function Q(){return V.apply(J,arguments)}function V(t,n){var e=this;if(!t||"object"!==r(t)&&"function"!=typeof t)throw Error("Cannot mount parcel without a config object or config loading function");if(t.name&&"string"!=typeof t.name)throw Error("Parcel name must be a string, if provided");if("object"!==r(n))throw Error("Parcel ".concat(name," has invalid customProps -- must be an object"));if(!n.domElement)throw Error("Parcel ".concat(name," cannot be mounted without a domElement provided as a prop"));var o,i=H++,a="function"==typeof t,u=a?t:function(){return Promise.resolve(t)},c={id:i,parcels:{},status:a?p:m,customProps:n,parentName:e.name,unmountThisParcel:function(){if(c.status!==g)throw Error("Cannot unmount parcel '".concat(name,"' -- it is in a ").concat(c.status," status"));return W(c,!0).then(function(t){return c.parentName&&delete e.parcels[c.id],t}).then(function(t){return l(t),t}).catch(function(t){throw c.status=E,d(t),t})}};e.parcels[i]=c;var s=u();if(!s||"function"!=typeof s.then)throw Error("When mounting a parcel, the config loading function must return a promise that resolves with the parcel config");var l,d,v=(s=s.then(function(t){if(!t)throw Error("When mounting a parcel, the config loading function returned a promise that did not resolve with a parcel config");var n=t.name||"parcel-".concat(i);if(!G(t.bootstrap))throw Error("Parcel ".concat(n," must have a valid bootstrap function"));if(!G(t.mount))throw Error("Parcel ".concat(n," must have a valid mount function"));if(!G(t.unmount))throw Error("Parcel ".concat(n," must have a valid unmount function"));if(t.update&&!G(t.update))throw Error("Parcel ".concat(n," provided an invalid update function"));var e=R(t.bootstrap),r=R(t.mount),a=R(t.unmount);c.status=m,c.name=n,c.bootstrap=e,c.mount=r,c.unmount=a,c.timeouts=M(t.timeouts),t.update&&(c.update=R(t.update),o.update=function(t){return c.customProps=t,z(function(t){return Promise.resolve().then(function(){if(t.status!==g)throw Error("Cannot update parcel '".concat(t.name,"' because it is not mounted"));return t.status=w,L(t.update(X(t)),"Updating parcel '".concat(t.name,"'"),t.timeouts.mount).then(function(){return t.status=g,t}).catch(function(n){var e=f(n,t);throw t.status=E,e})})}(c))})})).then(function(){return q(c,!0)}),y=v.then(function(){return $(c,!0)}),b=new Promise(function(t,n){l=t,d=n});return o={mount:function(){return z(Promise.resolve().then(function(){if(c.status!==h)throw Error("Cannot mount parcel '".concat(name,"' -- it is in a ").concat(c.status," status"));return e.parcels[i]=c,$(c)}))},unmount:function(){return z(c.unmountThisParcel())},getStatus:function(){return c.status},loadPromise:z(s),bootstrapPromise:z(v),mountPromise:z(y),unmountPromise:z(b)}}function z(t){return t.then(function(){return null})}function X(n){var e=i({},n.customProps,{name:n.name,mountParcel:V.bind(n),singleSpa:t});return n.unmountThisParcel&&(e.unmountSelf=n.unmountThisParcel),e}function Y(t){return Promise.resolve().then(function(){return t.status!==l?t:(t.status=p,Promise.resolve().then(function(){var e=t.loadImpl(X(t));if(!k(e))throw Error("single-spa loading function did not return a promise. Check the second argument to registerApplication('".concat(t.name,"', loadingFunction, activityFunction)"));return e.then(function(e){var o;return"object"!==r(n=e)&&(o="does not export anything"),G(n.bootstrap)||(o="does not export a bootstrap function or array of functions"),G(n.mount)||(o="does not export a mount function or array of functions"),G(n.unmount)||(o="does not export an unmount function or array of functions"),o?(u(o,t),t.status=E,t):(n.devtools&&n.devtools.overlays&&(t.devtools.overlays=i({},t.devtools.overlays,n.devtools.overlays)),t.status=m,t.bootstrap=R(n.bootstrap,"App '".concat(t.name,"' bootstrap function")),t.mount=R(n.mount,"App '".concat(t.name,"' mount function")),t.unmount=R(n.unmount,"App '".concat(t.name,"' unmount function")),t.unload=R(n.unload||[],"App '".concat(t.name,"' unload function")),t.timeouts=M(n.timeouts),t)})}).catch(function(n){return u(n,t),t.status=E,t}));var n})}var Z={hashchange:[],popstate:[]},tt=["hashchange","popstate"];function nt(t){var n,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};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("singleSpaNavigate must be either called with a string url, with an <a> tag as its context, or with an event whose currentTarget is an <a> tag");n=t.currentTarget.href,t.preventDefault()}var r=st(window.location.href),o=st(n);if(0===n.indexOf("#"))window.location.hash="#"+o.anchor;else if(r.host!==o.host&&o.host){if(e.isTestingEnv)return{wouldHaveReloadedThePage:!0};window.location.href=n}else!function(t,n){return n===t||n==="/"+t}(o.path,r.path)?window.history.pushState(null,null,n):window.location.hash="#"+o.anchor}function et(t){var n=this;if(t){var e=t[0].type;tt.indexOf(e)>=0&&Z[e].forEach(function(e){e.apply(n,t)})}}function rt(){Dt([],arguments)}window.addEventListener("hashchange",rt),window.addEventListener("popstate",rt);var ot=window.addEventListener,it=window.removeEventListener;window.addEventListener=function(t,n){if(!("function"==typeof n&&tt.indexOf(t)>=0)||B(Z[t],function(t){return t===n}))return ot.apply(this,arguments);Z[t].push(n)},window.removeEventListener=function(t,n){if(!("function"==typeof n&&tt.indexOf(t)>=0))return it.apply(this,arguments);Z[t]=Z[t].filter(function(t){return t!==n})};var at=window.history.pushState;window.history.pushState=function(t){var n=at.apply(this,arguments);return rt(ct(t)),n};var ut=window.history.replaceState;function ct(t){try{return new PopStateEvent("popstate",{state:t})}catch(e){var n=document.createEvent("PopStateEvent");return n.initPopStateEvent("popstate",!1,!1,t),n}}function st(t){for(var n={strictMode:!0,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},e=n.parser.strict.exec(t),r={},o=14;o--;)r[n.key[o]]=e[o]||"";return r[n.q.name]={},r[n.key[12]].replace(n.q.parser,function(t,e,o){e&&(r[n.q.name][e]=o)}),r}window.history.replaceState=function(t){var n=ut.apply(this,arguments);return rt(ct(t)),n},window.singleSpaNavigate=nt;var ft=!1;function lt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.jQuery;if(t||window.$&&window.$.fn&&window.$.fn.jquery&&(t=window.$),t&&!ft){var n=t.fn.on,e=t.fn.off;t.fn.on=function(t,e){return pt.call(this,n,window.addEventListener,t,e,arguments)},t.fn.off=function(t,n){return pt.call(this,e,window.removeEventListener,t,n,arguments)},ft=!0}}function pt(t,n,e,r,o){return"string"!=typeof e?t.apply(this,o):(e.split(/\s+/).forEach(function(t){tt.indexOf(t)>=0&&(n(t,r),e=e.replace(t,""))}),""===e.trim()?this:t.apply(this,o))}var mt={};function dt(t){return Promise.resolve().then(function(){var n=mt[t.name];return n?t.status===l?(ht(t,n),t):t.status===b?n.promise.then(function(){return t}):t.status!==h?t:(t.status=b,L(t.unload(X(t)),"Unloading application '".concat(t.name,"'"),t.timeouts.unload).then(function(){return ht(t,n),t}).catch(function(e){return function(t,n,e){delete mt[t.name],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,u(e,t),t.status=E,n.reject(e)}(t,n,e),t})):t})}function ht(t,n){delete mt[t.name],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,t.status=l,n.resolve()}function vt(t,n,e,r){mt[t.name]={app:t,resolve:e,reject:r},Object.defineProperty(mt[t.name],"promise",{get:n})}var gt=[];function wt(){return gt.filter(P).map(x)}function yt(){return gt.map(x)}function bt(t){var n=B(gt,function(n){return n.name===t});return n?n.status:null}function Et(t,n,e){return console.warn('declareChildApplication is deprecated and will be removed in the next major version, use "registerApplication" instead'),Pt(t,n,e)}function Pt(t,n,e){var o,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if("string"!=typeof t||0===t.length)throw Error("The first argument must be a non-empty string 'appName'");if(-1!==yt().indexOf(t))throw Error("There is already an app declared with name ".concat(t));if("object"!==r(i)||Array.isArray(i))throw Error("customProps must be an object");if(!n)throw Error("The application or loading function is required");if(o="function"!=typeof n?function(){return Promise.resolve(n)}:n,"function"!=typeof e)throw Error("The activeWhen argument must be a function");gt.push({name:t,loadImpl:o,activeWhen:e,status:l,parcels:{},devtools:{overlays:{options:{},selectors:[]}},customProps:i}),lt(),Dt()}function Ot(t){for(var n=[],e=0;e<gt.length;e++)gt[e].activeWhen(t)&&n.push(gt[e].name);return n}function Tt(){return gt.filter(j).filter(A).filter(N)}function At(t,n){return console.warn('unloadChildApplication is deprecated and will be removed in the next major version, use "unloadApplication" instead'),Nt(t,n)}function Nt(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{waitForUnmount:!1};if("string"!=typeof t)throw Error("unloadApplication requires a string 'appName'");var e=B(gt,function(n){return n.name===t});if(!e)throw Error("Could not unload application '".concat(t,"' because no such application has been registered"));var r,o=function(t){return mt[t]}(e.name);if(n&&n.waitForUnmount){if(o)return o.promise;var i=new Promise(function(t,n){vt(e,function(){return i},t,n)});return i}return o?(r=o.promise,St(e,o.resolve,o.reject)):r=new Promise(function(t,n){vt(e,function(){return r},t,n),St(e,t,n)}),r}function St(t,n,e){W(t).then(dt).then(function(){n(),setTimeout(function(){Dt()})}).catch(e)}var jt=!1,xt=[];function _t(){return Dt()}function Dt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;if(jt)return new Promise(function(t,e){xt.push({resolve:t,reject:e,eventArguments:n})});jt=!0;var r=!0;return Ut?Promise.resolve().then(function(){window.dispatchEvent(new e("single-spa:before-routing-event",a()));var n=Object.keys(mt).map(function(t){return mt[t].app}).filter(O).map(dt),u=gt.filter(j).filter(P).filter(S).map(W).map(function(t){return t.then(dt)}),c=u.concat(n);c.length>0&&(r=!1);var s=Promise.all(c),f=Tt(),l=f.map(function(t){return Y(t).then(q).then(function(t){return s.then(function(){return $(t)})})});l.length>0&&(r=!1);var p=gt.filter(j).filter(O).filter(T).filter(N).filter(function(t){return f.indexOf(t)<0}).map(function(t){return q(t).then(function(){return s}).then(function(){return $(t)})});return p.length>0&&(r=!1),s.catch(function(t){throw i(),t}).then(function(){return i(),Promise.all(l.concat(p)).catch(function(n){throw t.forEach(function(t){return t.reject(n)}),n}).then(function(){return o(!1)})})}):Promise.resolve().then(function(){var t=Tt().map(Y);return t.length>0&&(r=!1),Promise.all(t).then(o).catch(function(t){throw i(),t})});function o(){var n=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],o=wt();n&&i(),t.forEach(function(t){return t.resolve(o)});try{var u=r?"single-spa:no-app-change":"single-spa:app-change";window.dispatchEvent(new e(u,a())),window.dispatchEvent(new e("single-spa:routing-event",a()))}catch(t){setTimeout(function(){throw t})}if(jt=!1,xt.length>0){var c=xt;xt=[],Dt(c)}return o}function i(){t.forEach(function(t){et(t.eventArguments)}),et(n)}function a(){var t={detail:{}};return n&&n[0]&&(t.detail.originalEvent=n[0]),t}}var Ut=!1;function Ct(){Ut=!0,Dt()}setTimeout(function(){Ut||console.warn("singleSpa.start() has not been called, ".concat(5e3,"ms after single-spa was loaded. Before start() is called, apps can be declared and loaded, but not bootstrapped or mounted. See https://github.com/CanopyTax/single-spa/blob/master/docs/single-spa-api.md#start"))},5e3);var It={getRawAppData:function(){return[].concat(gt)},reroute:Dt,NOT_LOADED:l,toLoadPromise:Y,toBootstrapPromise:q,unregisterApplication:function(t){if(!gt.find(function(n){return n.name===t}))throw Error("Cannot unregister application '".concat(t,"' because no such application has been registered"));return Nt(t).then(function(){var n=gt.findIndex(function(n){return n.name===t});gt.splice(n,1)})}};window&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=It);export{d as BOOTSTRAPPING,p as LOADING_SOURCE_CODE,g as MOUNTED,v as MOUNTING,m as NOT_BOOTSTRAPPED,l as NOT_LOADED,h as NOT_MOUNTED,E as SKIP_BECAUSE_BROKEN,y as UNMOUNTING,w as UPDATING,c as addErrorHandler,Ot as checkActivityFunctions,Et as declareChildApplication,lt as ensureJQuerySupport,yt as getAppNames,bt as getAppStatus,wt as getMountedApps,Q as mountRootParcel,nt as navigateToUrl,Pt as registerApplication,s as removeErrorHandler,D as setBootstrapMaxTime,U as setMountMaxTime,I as setUnloadMaxTime,C as setUnmountMaxTime,Ct as start,_t as triggerAppChange,Nt as unloadApplication,At as unloadChildApplication};
//# sourceMappingURL=single-spa.min.js.map

@@ -1,2 +0,2 @@

System.register([],function(t,n){"use strict";return{execute:function(){t({addErrorHandler:s,checkActivityFunctions:Pt,declareChildApplication:Ot,ensureJQuerySupport:pt,getAppNames:bt,getAppStatus:Et,getMountedApps:yt,mountRootParcel:V,navigateToUrl:et,registerApplication:Tt,removeErrorHandler:f,setBootstrapMaxTime:j,setMountMaxTime:C,setUnloadMaxTime:I,setUnmountMaxTime:M,start:Ct,triggerAppChange:xt,unloadApplication:St,unloadChildApplication:Nt});var n=Object.freeze({get start(){return Ct},get ensureJQuerySupport(){return pt},get setBootstrapMaxTime(){return j},get setMountMaxTime(){return C},get setUnmountMaxTime(){return M},get setUnloadMaxTime(){return I},get registerApplication(){return Tt},get getMountedApps(){return yt},get getAppStatus(){return Et},get unloadApplication(){return St},get checkActivityFunctions(){return Pt},get getAppNames(){return bt},get declareChildApplication(){return Ot},get unloadChildApplication(){return Nt},get navigateToUrl(){return et},get triggerAppChange(){return xt},get addErrorHandler(){return s},get removeErrorHandler(){return f},get mountRootParcel(){return V},get NOT_LOADED(){return p},get LOADING_SOURCE_CODE(){return m},get NOT_BOOTSTRAPPED(){return d},get BOOTSTRAPPING(){return h},get NOT_MOUNTED(){return v},get MOUNTING(){return w},get UPDATING(){return y},get MOUNTED(){return g},get UNMOUNTING(){return b},get SKIP_BECAUSE_BROKEN(){return O}}),e=("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}).CustomEvent;var r=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 e=document.createEvent("CustomEvent");return n?e.initCustomEvent(t,n.bubbles,n.cancelable,n.detail):e.initCustomEvent(t,!1,!1,void 0),e}:function(t,n){var e=document.createEventObject();return e.type=t,n?(e.bubbles=Boolean(n.bubbles),e.cancelable=Boolean(n.cancelable),e.detail=n.detail):(e.bubbles=!1,e.cancelable=!1,e.detail=void 0),e};function o(t){return(o="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 i(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function a(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{},r=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(e).filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.forEach(function(n){i(t,n,e[n])})}return t}var u=[];function c(t,n){var e=l(t,n);u.length?u.forEach(function(t){return t(e)}):setTimeout(function(){throw e})}function s(t){if("function"!=typeof t)throw new Error("a single-spa error handler must be a function");u.push(t)}function f(t){if("function"!=typeof t)throw new Error("a single-spa error handler must be a function");var n=!1;return u=u.filter(function(e){var r=e===t;return n=n||r,!r}),n}function l(t,n){var e,r=n.unmountThisParcel?"Parcel":"Application",o="".concat(r," '").concat(n.name,"' died in status ").concat(n.status,": ");if(t instanceof Error){try{t.message=o+t.message}catch(t){}e=t}else{console.warn("While ".concat(n.status,", '").concat(n.name,"' rejected its lifecycle function promise with a non-Error. This will cause stack traces to not be accurate."));try{e=new Error(o+JSON.stringify(t))}catch(n){e=t}}return e.appName=n.name,e.name=n.name,e}var p=t("NOT_LOADED","NOT_LOADED"),m=t("LOADING_SOURCE_CODE","LOADING_SOURCE_CODE"),d=t("NOT_BOOTSTRAPPED","NOT_BOOTSTRAPPED"),h=t("BOOTSTRAPPING","BOOTSTRAPPING"),v=t("NOT_MOUNTED","NOT_MOUNTED"),w=t("MOUNTING","MOUNTING"),g=t("MOUNTED","MOUNTED"),y=t("UPDATING","UPDATING"),b=t("UNMOUNTING","UNMOUNTING"),E="UNLOADING",O=t("SKIP_BECAUSE_BROKEN","SKIP_BECAUSE_BROKEN");function T(t){return t.status===g}function P(t){return!T(t)}function A(t){return t.status!==p&&t.status!==m}function N(t){return!A(t)}function S(t){try{return t.activeWhen(window.location)}catch(n){c(n,t),t.status=O}}function U(t){try{return!t.activeWhen(window.location)}catch(n){c(n,t),t.status=O}}function _(t){return t!==O&&(!t||t.status!==O)}function D(t){return t.name}var x={bootstrap:{millis:4e3,dieOnTimeout:!1},mount:{millis:3e3,dieOnTimeout:!1},unmount:{millis:3e3,dieOnTimeout:!1},unload:{millis:3e3,dieOnTimeout:!1}};function j(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("number"!=typeof t||t<=0)throw new Error("bootstrap max time must be a positive integer number of milliseconds");x.bootstrap={millis:t,dieOnTimeout:n}}function C(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("number"!=typeof t||t<=0)throw new Error("mount max time must be a positive integer number of milliseconds");x.mount={millis:t,dieOnTimeout:n}}function M(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("number"!=typeof t||t<=0)throw new Error("unmount max time must be a positive integer number of milliseconds");x.unmount={millis:t,dieOnTimeout:n}}function I(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("number"!=typeof t||t<=0)throw new Error("unload max time must be a positive integer number of milliseconds");x.unload={millis:t,dieOnTimeout:n}}function L(t,n,e){var r=1e3;return new Promise(function(o,i){var a=!1,u=!1;function c(t){if(!a)if(!0===t)u=!0,e.dieOnTimeout?i("".concat(n," did not resolve or reject for ").concat(e.millis," milliseconds")):console.error("".concat(n," did not resolve or reject for ").concat(e.millis," milliseconds -- we're no longer going to warn you about it."));else if(!u){var o=t,s=o*r;console.warn("".concat(n," did not resolve or reject within ").concat(s," milliseconds")),s+r<e.millis&&setTimeout(function(){return c(o+1)},r)}}t.then(function(t){a=!0,o(t)}).catch(function(t){a=!0,i(t)}),setTimeout(function(){return c(1)},r),setTimeout(function(){return c(!0)},e.millis)})}function B(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a({},x,t)}function G(t,n){for(var e=0;e<t.length;e++)if(n(t[e]))return t[e];return null}function R(t){return t&&("function"==typeof t||(n=t,Array.isArray(n)&&!G(n,function(t){return"function"!=typeof t})));var n}function k(t,n){return 0===(t=Array.isArray(t)?t:[t]).length&&(t=[function(){return Promise.resolve()}]),function(e){return new Promise(function(r,o){!function i(a){var u=t[a](e);q(u)?u.then(function(){a===t.length-1?r():i(a+1)}).catch(o):o("".concat(n," at index ").concat(a," did not return a promise"))}(0)})}}function q(t){return t&&"function"==typeof t.then&&"function"==typeof t.catch}function W(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Promise.resolve().then(function(){return t.status!==d?t:(t.status=h,L(t.bootstrap(Y(t)),"Bootstrapping appOrParcel '".concat(t.name,"'"),t.timeouts.bootstrap).then(function(){return t.status=v,t}).catch(function(e){if(t.status=O,n)throw l(e,t);return c(e,t),t}))})}function K(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Promise.resolve().then(function(){if(t.status!==g)return t;t.status=b;var e=Object.keys(t.parcels).map(function(n){return t.parcels[n].unmountThisParcel()});return Promise.all(e).then(r,function(e){return r().then(function(){var r=new Error(e.message);if(n){var o=l(r,t);throw t.status=O,o}c(r,t),t.status=O})}).then(function(){return t});function r(){return L(t.unmount(Y(t)),"Unmounting application ".concat(t.name,"'"),t.timeouts.unmount).then(function(){t.status=v}).catch(function(e){if(n){var r=l(e,t);throw t.status=O,r}c(e,t),t.status=O})}})}var F=!1,H=!1;function $(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Promise.resolve().then(function(){return t.status!==v?t:(F||(window.dispatchEvent(new r("single-spa:before-first-mount")),F=!0),L(t.mount(Y(t)),"Mounting application '".concat(t.name,"'"),t.timeouts.mount).then(function(){return t.status=g,H||(window.dispatchEvent(new r("single-spa:first-mount")),H=!0),t}).catch(function(e){return t.status=g,K(t).then(r,r);function r(){if(n){var r=l(e,t);throw t.status=O,r}return c(e,t),t.status=O,t}}))})}var J=0,Q={parcels:{}};function V(){return z.apply(Q,arguments)}function z(t,n){var e=this;if(!t||"object"!==o(t)&&"function"!=typeof t)throw new Error("Cannot mount parcel without a config object or config loading function");if(t.name&&"string"!=typeof t.name)throw new Error("Parcel name must be a string, if provided");if("object"!==o(n))throw new Error("Parcel ".concat(name," has invalid customProps -- must be an object"));if(!n.domElement)throw new Error("Parcel ".concat(name," cannot be mounted without a domElement provided as a prop"));var r,i=J++,a="function"==typeof t,u=a?t:function(){return Promise.resolve(t)},c={id:i,parcels:{},status:a?m:d,customProps:n,parentName:e.name,unmountThisParcel:function(){if(c.status!==g)throw new Error("Cannot unmount parcel '".concat(name,"' -- it is in a ").concat(c.status," status"));return K(c,!0).then(function(t){return c.parentName&&delete e.parcels[c.id],t}).then(function(t){return f(t),t}).catch(function(t){throw c.status=O,p(t),t})}};e.parcels[i]=c;var s=u();if(!s||"function"!=typeof s.then)throw new Error("When mounting a parcel, the config loading function must return a promise that resolves with the parcel config");var f,p,h=(s=s.then(function(t){if(!t)throw new Error("When mounting a parcel, the config loading function returned a promise that did not resolve with a parcel config");var n=t.name||"parcel-".concat(i);if(!R(t.bootstrap))throw new Error("Parcel ".concat(n," must have a valid bootstrap function"));if(!R(t.mount))throw new Error("Parcel ".concat(n," must have a valid mount function"));if(!R(t.unmount))throw new Error("Parcel ".concat(n," must have a valid unmount function"));if(t.update&&!R(t.update))throw new Error("Parcel ".concat(n," provided an invalid update function"));var e=k(t.bootstrap),o=k(t.mount),a=k(t.unmount);c.status=d,c.name=n,c.bootstrap=e,c.mount=o,c.unmount=a,c.timeouts=B(t.timeouts),t.update&&(c.update=k(t.update),r.update=function(t){return c.customProps=t,X(function(t){return Promise.resolve().then(function(){if(t.status!==g)throw new Error("Cannot update parcel '".concat(t.name,"' because it is not mounted"));return t.status=y,L(t.update(Y(t)),"Updating parcel '".concat(t.name,"'"),t.timeouts.mount).then(function(){return t.status=g,t}).catch(function(n){var e=l(n,t);throw t.status=O,e})})}(c))})})).then(function(){return W(c,!0)}),w=h.then(function(){return $(c,!0)}),b=new Promise(function(t,n){f=t,p=n});return r={mount:function(){return X(Promise.resolve().then(function(){if(c.status!==v)throw new Error("Cannot mount parcel '".concat(name,"' -- it is in a ").concat(c.status," status"));return e.parcels[i]=c,$(c)}))},unmount:function(){return X(c.unmountThisParcel())},getStatus:function(){return c.status},loadPromise:X(s),bootstrapPromise:X(h),mountPromise:X(w),unmountPromise:X(b)}}function X(t){return t.then(function(){return null})}function Y(t){var e=a({},t.customProps,{name:t.name,mountParcel:z.bind(t),singleSpa:n});return t.unmountThisParcel&&(e.unmountSelf=t.unmountThisParcel),e}function Z(t){return Promise.resolve().then(function(){return t.status!==p?t:(t.status=m,Promise.resolve().then(function(){var e=t.loadImpl(Y(t));if(!q(e))throw new Error("single-spa loading function did not return a promise. Check the second argument to registerApplication('".concat(t.name,"', loadingFunction, activityFunction)"));return e.then(function(e){var r;return"object"!==o(n=e)&&(r="does not export anything"),R(n.bootstrap)||(r="does not export a bootstrap function or array of functions"),R(n.mount)||(r="does not export a mount function or array of functions"),R(n.unmount)||(r="does not export an unmount function or array of functions"),r?(c(r,t),t.status=O,t):(n.devtools&&n.devtools.overlays&&(t.devtools.overlays=a({},t.devtools.overlays,n.devtools.overlays)),t.status=d,t.bootstrap=k(n.bootstrap,"App '".concat(t.name,"' bootstrap function")),t.mount=k(n.mount,"App '".concat(t.name,"' mount function")),t.unmount=k(n.unmount,"App '".concat(t.name,"' unmount function")),t.unload=k(n.unload||[],"App '".concat(t.name,"' unload function")),t.timeouts=B(n.timeouts),t)})}).catch(function(n){return c(n,t),t.status=O,t}));var n})}var tt={hashchange:[],popstate:[]},nt=["hashchange","popstate"];function et(t){var n,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};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 new Error("singleSpaNavigate must be either called with a string url, with an <a> tag as its context, or with an event whose currentTarget is an <a> tag");n=t.currentTarget.href,t.preventDefault()}var r=ft(window.location.href),o=ft(n);if(0===n.indexOf("#"))window.location.hash="#"+o.anchor;else if(r.host!==o.host&&o.host){if(e.isTestingEnv)return{wouldHaveReloadedThePage:!0};window.location.href=n}else!function(t,n){return n===t||n==="/"+t}(o.path,r.path)?window.history.pushState(null,null,n):window.location.hash="#"+o.anchor}function rt(t){var n=this;if(t){var e=t[0].type;nt.indexOf(e)>=0&&tt[e].forEach(function(e){e.apply(n,t)})}}function ot(){xt([],arguments)}window.addEventListener("hashchange",ot),window.addEventListener("popstate",ot);var it=window.addEventListener,at=window.removeEventListener;window.addEventListener=function(t,n){if(!("function"==typeof n&&nt.indexOf(t)>=0)||G(tt[t],function(t){return t===n}))return it.apply(this,arguments);tt[t].push(n)},window.removeEventListener=function(t,n){if(!("function"==typeof n&&nt.indexOf(t)>=0))return at.apply(this,arguments);tt[t]=tt[t].filter(function(t){return t!==n})};var ut=window.history.pushState;window.history.pushState=function(t){var n=ut.apply(this,arguments);return ot(st(t)),n};var ct=window.history.replaceState;function st(t){try{return new PopStateEvent("popstate",{state:t})}catch(e){var n=document.createEvent("PopStateEvent");return n.initPopStateEvent("popstate",!1,!1,t),n}}function ft(t){for(var n={strictMode:!0,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},e=n.parser.strict.exec(t),r={},o=14;o--;)r[n.key[o]]=e[o]||"";return r[n.q.name]={},r[n.key[12]].replace(n.q.parser,function(t,e,o){e&&(r[n.q.name][e]=o)}),r}window.history.replaceState=function(t){var n=ct.apply(this,arguments);return ot(st(t)),n},window.singleSpaNavigate=et;var lt=!1;function pt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.jQuery;if(t||window.$&&window.$.fn&&window.$.fn.jquery&&(t=window.$),t&&!lt){var n=t.fn.on,e=t.fn.off;t.fn.on=function(t,e){return mt.call(this,n,window.addEventListener,t,e,arguments)},t.fn.off=function(t,n){return mt.call(this,e,window.removeEventListener,t,n,arguments)},lt=!0}}function mt(t,n,e,r,o){return"string"!=typeof e?t.apply(this,o):(e.split(/\s+/).forEach(function(t){nt.indexOf(t)>=0&&(n(t,r),e=e.replace(t,""))}),""===e.trim()?this:t.apply(this,o))}var dt={};function ht(t){return Promise.resolve().then(function(){var n=dt[t.name];return n?t.status===p?(vt(t,n),t):t.status===E?n.promise.then(function(){return t}):t.status!==v?t:(t.status=E,L(t.unload(Y(t)),"Unloading application '".concat(t.name,"'"),t.timeouts.unload).then(function(){return vt(t,n),t}).catch(function(e){return function(t,n,e){delete dt[t.name],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,c(e,t),t.status=O,n.reject(e)}(t,n,e),t})):t})}function vt(t,n){delete dt[t.name],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,t.status=p,n.resolve()}function wt(t,n,e,r){dt[t.name]={app:t,resolve:e,reject:r},Object.defineProperty(dt[t.name],"promise",{get:n})}var gt=[];function yt(){return gt.filter(T).map(D)}function bt(){return gt.map(D)}function Et(t){var n=G(gt,function(n){return n.name===t});return n?n.status:null}function Ot(t,n,e){return console.warn('declareChildApplication is deprecated and will be removed in the next major version, use "registerApplication" instead'),Tt(t,n,e)}function Tt(t,n,e){var r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if("string"!=typeof t||0===t.length)throw new Error("The first argument must be a non-empty string 'appName'");if(-1!==bt().indexOf(t))throw new Error("There is already an app declared with name ".concat(t));if("object"!==o(i)||Array.isArray(i))throw new Error("customProps must be an object");if(!n)throw new Error("The application or loading function is required");if(r="function"!=typeof n?function(){return Promise.resolve(n)}:n,"function"!=typeof e)throw new Error("The activeWhen argument must be a function");gt.push({name:t,loadImpl:r,activeWhen:e,status:p,parcels:{},devtools:{overlays:{options:{},selectors:[]}},customProps:i}),pt(),xt()}function Pt(t){for(var n=[],e=0;e<gt.length;e++)gt[e].activeWhen(t)&&n.push(gt[e].name);return n}function At(){return gt.filter(_).filter(N).filter(S)}function Nt(t,n){return console.warn('unloadChildApplication is deprecated and will be removed in the next major version, use "unloadApplication" instead'),St(t,n)}function St(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{waitForUnmount:!1};if("string"!=typeof t)throw new Error("unloadApplication requires a string 'appName'");var e=G(gt,function(n){return n.name===t});if(!e)throw new Error("Could not unload application '".concat(t,"' because no such application has been declared"));var r,o=function(t){return dt[t]}(e.name);if(n&&n.waitForUnmount){if(o)return o.promise;var i=new Promise(function(t,n){wt(e,function(){return i},t,n)});return i}return o?(r=o.promise,Ut(e,o.resolve,o.reject)):r=new Promise(function(t,n){wt(e,function(){return r},t,n),Ut(e,t,n)}),r}function Ut(t,n,e){K(t).then(ht).then(function(){n(),setTimeout(function(){xt()})}).catch(e)}var _t=!1,Dt=[];function xt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;if(_t)return new Promise(function(t,e){Dt.push({resolve:t,reject:e,eventArguments:n})});_t=!0;var e=!0;return jt?Promise.resolve().then(function(){window.dispatchEvent(new r("single-spa:before-routing-event",a()));var n=Object.keys(dt).map(function(t){return dt[t].app}).filter(P).map(ht),u=gt.filter(_).filter(T).filter(U).map(K).map(function(t){return t.then(ht)}),c=u.concat(n);c.length>0&&(e=!1);var s=Promise.all(c),f=At(),l=f.map(function(t){return Z(t).then(W).then(function(t){return s.then(function(){return $(t)})})});l.length>0&&(e=!1);var p=gt.filter(_).filter(P).filter(A).filter(S).filter(function(t){return f.indexOf(t)<0}).map(function(t){return W(t).then(function(){return s}).then(function(){return $(t)})});return p.length>0&&(e=!1),s.catch(function(t){throw i(),t}).then(function(){return i(),Promise.all(l.concat(p)).catch(function(n){throw t.forEach(function(t){return t.reject(n)}),n}).then(function(){return o(!1)})})}):Promise.resolve().then(function(){var t=At().map(Z);return t.length>0&&(e=!1),Promise.all(t).then(o).catch(function(t){throw i(),t})});function o(){var n=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],o=yt();n&&i(),t.forEach(function(t){return t.resolve(o)});try{var u=e?"single-spa:no-app-change":"single-spa:app-change";window.dispatchEvent(new r(u,a())),window.dispatchEvent(new r("single-spa:routing-event",a()))}catch(t){setTimeout(function(){throw t})}if(_t=!1,Dt.length>0){var c=Dt;Dt=[],xt(c)}return o}function i(){t.forEach(function(t){rt(t.eventArguments)}),rt(n)}function a(){var t={detail:{}};return n&&n[0]&&(t.detail.originalEvent=n[0]),t}}var jt=!1;function Ct(){jt=!0,xt()}setTimeout(function(){jt||console.warn("singleSpa.start() has not been called, ".concat(5e3,"ms after single-spa was loaded. Before start() is called, apps can be declared and loaded, but not bootstrapped or mounted. See https://github.com/CanopyTax/single-spa/blob/master/docs/single-spa-api.md#start"))},5e3);var Mt={getRawAppData:function(){return[].concat(gt)},reroute:xt,NOT_LOADED:p,toLoadPromise:Z,toBootstrapPromise:W};window&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=Mt)}}});
System.register([],function(t,n){"use strict";return{execute:function(){t({addErrorHandler:s,checkActivityFunctions:Pt,declareChildApplication:Ot,ensureJQuerySupport:pt,getAppNames:bt,getAppStatus:Et,getMountedApps:yt,mountRootParcel:V,navigateToUrl:et,registerApplication:Tt,removeErrorHandler:f,setBootstrapMaxTime:j,setMountMaxTime:C,setUnloadMaxTime:I,setUnmountMaxTime:M,start:Mt,triggerAppChange:xt,unloadApplication:St,unloadChildApplication:Nt});var n=Object.freeze({get start(){return Mt},get ensureJQuerySupport(){return pt},get setBootstrapMaxTime(){return j},get setMountMaxTime(){return C},get setUnmountMaxTime(){return M},get setUnloadMaxTime(){return I},get registerApplication(){return Tt},get getMountedApps(){return yt},get getAppStatus(){return Et},get unloadApplication(){return St},get checkActivityFunctions(){return Pt},get getAppNames(){return bt},get declareChildApplication(){return Ot},get unloadChildApplication(){return Nt},get navigateToUrl(){return et},get triggerAppChange(){return xt},get addErrorHandler(){return s},get removeErrorHandler(){return f},get mountRootParcel(){return V},get NOT_LOADED(){return p},get LOADING_SOURCE_CODE(){return m},get NOT_BOOTSTRAPPED(){return d},get BOOTSTRAPPING(){return h},get NOT_MOUNTED(){return v},get MOUNTING(){return g},get UPDATING(){return y},get MOUNTED(){return w},get UNMOUNTING(){return b},get SKIP_BECAUSE_BROKEN(){return O}}),e=("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}).CustomEvent;var r=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 e=document.createEvent("CustomEvent");return n?e.initCustomEvent(t,n.bubbles,n.cancelable,n.detail):e.initCustomEvent(t,!1,!1,void 0),e}:function(t,n){var e=document.createEventObject();return e.type=t,n?(e.bubbles=Boolean(n.bubbles),e.cancelable=Boolean(n.cancelable),e.detail=n.detail):(e.bubbles=!1,e.cancelable=!1,e.detail=void 0),e};function o(t){return(o="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 i(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function a(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{},r=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(e).filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.forEach(function(n){i(t,n,e[n])})}return t}var u=[];function c(t,n){var e=l(t,n);u.length?u.forEach(function(t){return t(e)}):setTimeout(function(){throw e})}function s(t){if("function"!=typeof t)throw Error("a single-spa error handler must be a function");u.push(t)}function f(t){if("function"!=typeof t)throw Error("a single-spa error handler must be a function");var n=!1;return u=u.filter(function(e){var r=e===t;return n=n||r,!r}),n}function l(t,n){var e,r=n.unmountThisParcel?"Parcel":"Application",o="".concat(r," '").concat(n.name,"' died in status ").concat(n.status,": ");if(t instanceof Error){try{t.message=o+t.message}catch(t){}e=t}else{console.warn("While ".concat(n.status,", '").concat(n.name,"' rejected its lifecycle function promise with a non-Error. This will cause stack traces to not be accurate."));try{e=Error(o+JSON.stringify(t))}catch(n){e=t}}return e.appName=n.name,e.name=n.name,e}var p=t("NOT_LOADED","NOT_LOADED"),m=t("LOADING_SOURCE_CODE","LOADING_SOURCE_CODE"),d=t("NOT_BOOTSTRAPPED","NOT_BOOTSTRAPPED"),h=t("BOOTSTRAPPING","BOOTSTRAPPING"),v=t("NOT_MOUNTED","NOT_MOUNTED"),g=t("MOUNTING","MOUNTING"),w=t("MOUNTED","MOUNTED"),y=t("UPDATING","UPDATING"),b=t("UNMOUNTING","UNMOUNTING"),E="UNLOADING",O=t("SKIP_BECAUSE_BROKEN","SKIP_BECAUSE_BROKEN");function T(t){return t.status===w}function P(t){return!T(t)}function A(t){return t.status!==p&&t.status!==m}function N(t){return!A(t)}function S(t){try{return t.activeWhen(window.location)}catch(n){c(n,t),t.status=O}}function U(t){try{return!t.activeWhen(window.location)}catch(n){c(n,t),t.status=O}}function _(t){return t!==O&&(!t||t.status!==O)}function D(t){return t.name}var x={bootstrap:{millis:4e3,dieOnTimeout:!1},mount:{millis:3e3,dieOnTimeout:!1},unmount:{millis:3e3,dieOnTimeout:!1},unload:{millis:3e3,dieOnTimeout:!1}};function j(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("number"!=typeof t||t<=0)throw Error("bootstrap max time must be a positive integer number of milliseconds");x.bootstrap={millis:t,dieOnTimeout:n}}function C(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("number"!=typeof t||t<=0)throw Error("mount max time must be a positive integer number of milliseconds");x.mount={millis:t,dieOnTimeout:n}}function M(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("number"!=typeof t||t<=0)throw Error("unmount max time must be a positive integer number of milliseconds");x.unmount={millis:t,dieOnTimeout:n}}function I(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("number"!=typeof t||t<=0)throw Error("unload max time must be a positive integer number of milliseconds");x.unload={millis:t,dieOnTimeout:n}}function L(t,n,e){var r=1e3;return new Promise(function(o,i){var a=!1,u=!1;function c(t){if(!a)if(!0===t)u=!0,e.dieOnTimeout?i("".concat(n," did not resolve or reject for ").concat(e.millis," milliseconds")):console.error("".concat(n," did not resolve or reject for ").concat(e.millis," milliseconds -- we're no longer going to warn you about it."));else if(!u){var o=t,s=o*r;console.warn("".concat(n," did not resolve or reject within ").concat(s," milliseconds")),s+r<e.millis&&setTimeout(function(){return c(o+1)},r)}}t.then(function(t){a=!0,o(t)}).catch(function(t){a=!0,i(t)}),setTimeout(function(){return c(1)},r),setTimeout(function(){return c(!0)},e.millis)})}function B(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a({},x,t)}function G(t,n){for(var e=0;e<t.length;e++)if(n(t[e]))return t[e];return null}function R(t){return t&&("function"==typeof t||(n=t,Array.isArray(n)&&!G(n,function(t){return"function"!=typeof t})));var n}function k(t,n){return 0===(t=Array.isArray(t)?t:[t]).length&&(t=[function(){return Promise.resolve()}]),function(e){return new Promise(function(r,o){!function i(a){var u=t[a](e);q(u)?u.then(function(){a===t.length-1?r():i(a+1)}).catch(o):o("".concat(n," at index ").concat(a," did not return a promise"))}(0)})}}function q(t){return t&&"function"==typeof t.then&&"function"==typeof t.catch}function W(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Promise.resolve().then(function(){return t.status!==d?t:(t.status=h,L(t.bootstrap(Y(t)),"Bootstrapping appOrParcel '".concat(t.name,"'"),t.timeouts.bootstrap).then(function(){return t.status=v,t}).catch(function(e){if(t.status=O,n)throw l(e,t);return c(e,t),t}))})}function K(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Promise.resolve().then(function(){if(t.status!==w)return t;t.status=b;var e=Object.keys(t.parcels).map(function(n){return t.parcels[n].unmountThisParcel()});return Promise.all(e).then(r,function(e){return r().then(function(){var r=Error(e.message);if(n){var o=l(r,t);throw t.status=O,o}c(r,t),t.status=O})}).then(function(){return t});function r(){return L(t.unmount(Y(t)),"Unmounting application ".concat(t.name,"'"),t.timeouts.unmount).then(function(){t.status=v}).catch(function(e){if(n){var r=l(e,t);throw t.status=O,r}c(e,t),t.status=O})}})}var F=!1,H=!1;function $(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Promise.resolve().then(function(){return t.status!==v?t:(F||(window.dispatchEvent(new r("single-spa:before-first-mount")),F=!0),L(t.mount(Y(t)),"Mounting application '".concat(t.name,"'"),t.timeouts.mount).then(function(){return t.status=w,H||(window.dispatchEvent(new r("single-spa:first-mount")),H=!0),t}).catch(function(e){return t.status=w,K(t).then(r,r);function r(){if(n){var r=l(e,t);throw t.status=O,r}return c(e,t),t.status=O,t}}))})}var J=0,Q={parcels:{}};function V(){return z.apply(Q,arguments)}function z(t,n){var e=this;if(!t||"object"!==o(t)&&"function"!=typeof t)throw Error("Cannot mount parcel without a config object or config loading function");if(t.name&&"string"!=typeof t.name)throw Error("Parcel name must be a string, if provided");if("object"!==o(n))throw Error("Parcel ".concat(name," has invalid customProps -- must be an object"));if(!n.domElement)throw Error("Parcel ".concat(name," cannot be mounted without a domElement provided as a prop"));var r,i=J++,a="function"==typeof t,u=a?t:function(){return Promise.resolve(t)},c={id:i,parcels:{},status:a?m:d,customProps:n,parentName:e.name,unmountThisParcel:function(){if(c.status!==w)throw Error("Cannot unmount parcel '".concat(name,"' -- it is in a ").concat(c.status," status"));return K(c,!0).then(function(t){return c.parentName&&delete e.parcels[c.id],t}).then(function(t){return f(t),t}).catch(function(t){throw c.status=O,p(t),t})}};e.parcels[i]=c;var s=u();if(!s||"function"!=typeof s.then)throw Error("When mounting a parcel, the config loading function must return a promise that resolves with the parcel config");var f,p,h=(s=s.then(function(t){if(!t)throw Error("When mounting a parcel, the config loading function returned a promise that did not resolve with a parcel config");var n=t.name||"parcel-".concat(i);if(!R(t.bootstrap))throw Error("Parcel ".concat(n," must have a valid bootstrap function"));if(!R(t.mount))throw Error("Parcel ".concat(n," must have a valid mount function"));if(!R(t.unmount))throw Error("Parcel ".concat(n," must have a valid unmount function"));if(t.update&&!R(t.update))throw Error("Parcel ".concat(n," provided an invalid update function"));var e=k(t.bootstrap),o=k(t.mount),a=k(t.unmount);c.status=d,c.name=n,c.bootstrap=e,c.mount=o,c.unmount=a,c.timeouts=B(t.timeouts),t.update&&(c.update=k(t.update),r.update=function(t){return c.customProps=t,X(function(t){return Promise.resolve().then(function(){if(t.status!==w)throw Error("Cannot update parcel '".concat(t.name,"' because it is not mounted"));return t.status=y,L(t.update(Y(t)),"Updating parcel '".concat(t.name,"'"),t.timeouts.mount).then(function(){return t.status=w,t}).catch(function(n){var e=l(n,t);throw t.status=O,e})})}(c))})})).then(function(){return W(c,!0)}),g=h.then(function(){return $(c,!0)}),b=new Promise(function(t,n){f=t,p=n});return r={mount:function(){return X(Promise.resolve().then(function(){if(c.status!==v)throw Error("Cannot mount parcel '".concat(name,"' -- it is in a ").concat(c.status," status"));return e.parcels[i]=c,$(c)}))},unmount:function(){return X(c.unmountThisParcel())},getStatus:function(){return c.status},loadPromise:X(s),bootstrapPromise:X(h),mountPromise:X(g),unmountPromise:X(b)}}function X(t){return t.then(function(){return null})}function Y(t){var e=a({},t.customProps,{name:t.name,mountParcel:z.bind(t),singleSpa:n});return t.unmountThisParcel&&(e.unmountSelf=t.unmountThisParcel),e}function Z(t){return Promise.resolve().then(function(){return t.status!==p?t:(t.status=m,Promise.resolve().then(function(){var e=t.loadImpl(Y(t));if(!q(e))throw Error("single-spa loading function did not return a promise. Check the second argument to registerApplication('".concat(t.name,"', loadingFunction, activityFunction)"));return e.then(function(e){var r;return"object"!==o(n=e)&&(r="does not export anything"),R(n.bootstrap)||(r="does not export a bootstrap function or array of functions"),R(n.mount)||(r="does not export a mount function or array of functions"),R(n.unmount)||(r="does not export an unmount function or array of functions"),r?(c(r,t),t.status=O,t):(n.devtools&&n.devtools.overlays&&(t.devtools.overlays=a({},t.devtools.overlays,n.devtools.overlays)),t.status=d,t.bootstrap=k(n.bootstrap,"App '".concat(t.name,"' bootstrap function")),t.mount=k(n.mount,"App '".concat(t.name,"' mount function")),t.unmount=k(n.unmount,"App '".concat(t.name,"' unmount function")),t.unload=k(n.unload||[],"App '".concat(t.name,"' unload function")),t.timeouts=B(n.timeouts),t)})}).catch(function(n){return c(n,t),t.status=O,t}));var n})}var tt={hashchange:[],popstate:[]},nt=["hashchange","popstate"];function et(t){var n,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};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("singleSpaNavigate must be either called with a string url, with an <a> tag as its context, or with an event whose currentTarget is an <a> tag");n=t.currentTarget.href,t.preventDefault()}var r=ft(window.location.href),o=ft(n);if(0===n.indexOf("#"))window.location.hash="#"+o.anchor;else if(r.host!==o.host&&o.host){if(e.isTestingEnv)return{wouldHaveReloadedThePage:!0};window.location.href=n}else!function(t,n){return n===t||n==="/"+t}(o.path,r.path)?window.history.pushState(null,null,n):window.location.hash="#"+o.anchor}function rt(t){var n=this;if(t){var e=t[0].type;nt.indexOf(e)>=0&&tt[e].forEach(function(e){e.apply(n,t)})}}function ot(){jt([],arguments)}window.addEventListener("hashchange",ot),window.addEventListener("popstate",ot);var it=window.addEventListener,at=window.removeEventListener;window.addEventListener=function(t,n){if(!("function"==typeof n&&nt.indexOf(t)>=0)||G(tt[t],function(t){return t===n}))return it.apply(this,arguments);tt[t].push(n)},window.removeEventListener=function(t,n){if(!("function"==typeof n&&nt.indexOf(t)>=0))return at.apply(this,arguments);tt[t]=tt[t].filter(function(t){return t!==n})};var ut=window.history.pushState;window.history.pushState=function(t){var n=ut.apply(this,arguments);return ot(st(t)),n};var ct=window.history.replaceState;function st(t){try{return new PopStateEvent("popstate",{state:t})}catch(e){var n=document.createEvent("PopStateEvent");return n.initPopStateEvent("popstate",!1,!1,t),n}}function ft(t){for(var n={strictMode:!0,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},e=n.parser.strict.exec(t),r={},o=14;o--;)r[n.key[o]]=e[o]||"";return r[n.q.name]={},r[n.key[12]].replace(n.q.parser,function(t,e,o){e&&(r[n.q.name][e]=o)}),r}window.history.replaceState=function(t){var n=ct.apply(this,arguments);return ot(st(t)),n},window.singleSpaNavigate=et;var lt=!1;function pt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.jQuery;if(t||window.$&&window.$.fn&&window.$.fn.jquery&&(t=window.$),t&&!lt){var n=t.fn.on,e=t.fn.off;t.fn.on=function(t,e){return mt.call(this,n,window.addEventListener,t,e,arguments)},t.fn.off=function(t,n){return mt.call(this,e,window.removeEventListener,t,n,arguments)},lt=!0}}function mt(t,n,e,r,o){return"string"!=typeof e?t.apply(this,o):(e.split(/\s+/).forEach(function(t){nt.indexOf(t)>=0&&(n(t,r),e=e.replace(t,""))}),""===e.trim()?this:t.apply(this,o))}var dt={};function ht(t){return Promise.resolve().then(function(){var n=dt[t.name];return n?t.status===p?(vt(t,n),t):t.status===E?n.promise.then(function(){return t}):t.status!==v?t:(t.status=E,L(t.unload(Y(t)),"Unloading application '".concat(t.name,"'"),t.timeouts.unload).then(function(){return vt(t,n),t}).catch(function(e){return function(t,n,e){delete dt[t.name],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,c(e,t),t.status=O,n.reject(e)}(t,n,e),t})):t})}function vt(t,n){delete dt[t.name],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,t.status=p,n.resolve()}function gt(t,n,e,r){dt[t.name]={app:t,resolve:e,reject:r},Object.defineProperty(dt[t.name],"promise",{get:n})}var wt=[];function yt(){return wt.filter(T).map(D)}function bt(){return wt.map(D)}function Et(t){var n=G(wt,function(n){return n.name===t});return n?n.status:null}function Ot(t,n,e){return console.warn('declareChildApplication is deprecated and will be removed in the next major version, use "registerApplication" instead'),Tt(t,n,e)}function Tt(t,n,e){var r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if("string"!=typeof t||0===t.length)throw Error("The first argument must be a non-empty string 'appName'");if(-1!==bt().indexOf(t))throw Error("There is already an app declared with name ".concat(t));if("object"!==o(i)||Array.isArray(i))throw Error("customProps must be an object");if(!n)throw Error("The application or loading function is required");if(r="function"!=typeof n?function(){return Promise.resolve(n)}:n,"function"!=typeof e)throw Error("The activeWhen argument must be a function");wt.push({name:t,loadImpl:r,activeWhen:e,status:p,parcels:{},devtools:{overlays:{options:{},selectors:[]}},customProps:i}),pt(),jt()}function Pt(t){for(var n=[],e=0;e<wt.length;e++)wt[e].activeWhen(t)&&n.push(wt[e].name);return n}function At(){return wt.filter(_).filter(N).filter(S)}function Nt(t,n){return console.warn('unloadChildApplication is deprecated and will be removed in the next major version, use "unloadApplication" instead'),St(t,n)}function St(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{waitForUnmount:!1};if("string"!=typeof t)throw Error("unloadApplication requires a string 'appName'");var e=G(wt,function(n){return n.name===t});if(!e)throw Error("Could not unload application '".concat(t,"' because no such application has been registered"));var r,o=function(t){return dt[t]}(e.name);if(n&&n.waitForUnmount){if(o)return o.promise;var i=new Promise(function(t,n){gt(e,function(){return i},t,n)});return i}return o?(r=o.promise,Ut(e,o.resolve,o.reject)):r=new Promise(function(t,n){gt(e,function(){return r},t,n),Ut(e,t,n)}),r}function Ut(t,n,e){K(t).then(ht).then(function(){n(),setTimeout(function(){jt()})}).catch(e)}var _t=!1,Dt=[];function xt(){return jt()}function jt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;if(_t)return new Promise(function(t,e){Dt.push({resolve:t,reject:e,eventArguments:n})});_t=!0;var e=!0;return Ct?Promise.resolve().then(function(){window.dispatchEvent(new r("single-spa:before-routing-event",a()));var n=Object.keys(dt).map(function(t){return dt[t].app}).filter(P).map(ht),u=wt.filter(_).filter(T).filter(U).map(K).map(function(t){return t.then(ht)}),c=u.concat(n);c.length>0&&(e=!1);var s=Promise.all(c),f=At(),l=f.map(function(t){return Z(t).then(W).then(function(t){return s.then(function(){return $(t)})})});l.length>0&&(e=!1);var p=wt.filter(_).filter(P).filter(A).filter(S).filter(function(t){return f.indexOf(t)<0}).map(function(t){return W(t).then(function(){return s}).then(function(){return $(t)})});return p.length>0&&(e=!1),s.catch(function(t){throw i(),t}).then(function(){return i(),Promise.all(l.concat(p)).catch(function(n){throw t.forEach(function(t){return t.reject(n)}),n}).then(function(){return o(!1)})})}):Promise.resolve().then(function(){var t=At().map(Z);return t.length>0&&(e=!1),Promise.all(t).then(o).catch(function(t){throw i(),t})});function o(){var n=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],o=yt();n&&i(),t.forEach(function(t){return t.resolve(o)});try{var u=e?"single-spa:no-app-change":"single-spa:app-change";window.dispatchEvent(new r(u,a())),window.dispatchEvent(new r("single-spa:routing-event",a()))}catch(t){setTimeout(function(){throw t})}if(_t=!1,Dt.length>0){var c=Dt;Dt=[],jt(c)}return o}function i(){t.forEach(function(t){rt(t.eventArguments)}),rt(n)}function a(){var t={detail:{}};return n&&n[0]&&(t.detail.originalEvent=n[0]),t}}var Ct=!1;function Mt(){Ct=!0,jt()}setTimeout(function(){Ct||console.warn("singleSpa.start() has not been called, ".concat(5e3,"ms after single-spa was loaded. Before start() is called, apps can be declared and loaded, but not bootstrapped or mounted. See https://github.com/CanopyTax/single-spa/blob/master/docs/single-spa-api.md#start"))},5e3);var It={getRawAppData:function(){return[].concat(wt)},reroute:jt,NOT_LOADED:p,toLoadPromise:Z,toBootstrapPromise:W,unregisterApplication:function(t){if(!wt.find(function(n){return n.name===t}))throw Error("Cannot unregister application '".concat(t,"' because no such application has been registered"));return St(t).then(function(){var n=wt.findIndex(function(n){return n.name===t});wt.splice(n,1)})}};window&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=It)}}});
//# sourceMappingURL=single-spa.min.js.map

@@ -1,2 +0,2 @@

!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t=t||self).singleSpa={})}(this,function(t){"use strict";var n=Object.freeze({get start(){return Ct},get ensureJQuerySupport(){return pt},get setBootstrapMaxTime(){return j},get setMountMaxTime(){return C},get setUnmountMaxTime(){return M},get setUnloadMaxTime(){return I},get registerApplication(){return Pt},get getMountedApps(){return yt},get getAppStatus(){return Et},get unloadApplication(){return St},get checkActivityFunctions(){return Tt},get getAppNames(){return bt},get declareChildApplication(){return Ot},get unloadChildApplication(){return Nt},get navigateToUrl(){return et},get triggerAppChange(){return Dt},get addErrorHandler(){return s},get removeErrorHandler(){return f},get mountRootParcel(){return V},get NOT_LOADED(){return p},get LOADING_SOURCE_CODE(){return m},get NOT_BOOTSTRAPPED(){return d},get BOOTSTRAPPING(){return h},get NOT_MOUNTED(){return v},get MOUNTING(){return w},get UPDATING(){return y},get MOUNTED(){return g},get UNMOUNTING(){return b},get SKIP_BECAUSE_BROKEN(){return O}}),e=("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}).CustomEvent;var r=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 e=document.createEvent("CustomEvent");return n?e.initCustomEvent(t,n.bubbles,n.cancelable,n.detail):e.initCustomEvent(t,!1,!1,void 0),e}:function(t,n){var e=document.createEventObject();return e.type=t,n?(e.bubbles=Boolean(n.bubbles),e.cancelable=Boolean(n.cancelable),e.detail=n.detail):(e.bubbles=!1,e.cancelable=!1,e.detail=void 0),e};function o(t){return(o="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 i(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function a(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{},r=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(e).filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.forEach(function(n){i(t,n,e[n])})}return t}var u=[];function c(t,n){var e=l(t,n);u.length?u.forEach(function(t){return t(e)}):setTimeout(function(){throw e})}function s(t){if("function"!=typeof t)throw new Error("a single-spa error handler must be a function");u.push(t)}function f(t){if("function"!=typeof t)throw new Error("a single-spa error handler must be a function");var n=!1;return u=u.filter(function(e){var r=e===t;return n=n||r,!r}),n}function l(t,n){var e,r=n.unmountThisParcel?"Parcel":"Application",o="".concat(r," '").concat(n.name,"' died in status ").concat(n.status,": ");if(t instanceof Error){try{t.message=o+t.message}catch(t){}e=t}else{console.warn("While ".concat(n.status,", '").concat(n.name,"' rejected its lifecycle function promise with a non-Error. This will cause stack traces to not be accurate."));try{e=new Error(o+JSON.stringify(t))}catch(n){e=t}}return e.appName=n.name,e.name=n.name,e}var p="NOT_LOADED",m="LOADING_SOURCE_CODE",d="NOT_BOOTSTRAPPED",h="BOOTSTRAPPING",v="NOT_MOUNTED",w="MOUNTING",g="MOUNTED",y="UPDATING",b="UNMOUNTING",E="UNLOADING",O="SKIP_BECAUSE_BROKEN";function P(t){return t.status===g}function T(t){return!P(t)}function A(t){return t.status!==p&&t.status!==m}function N(t){return!A(t)}function S(t){try{return t.activeWhen(window.location)}catch(n){c(n,t),t.status=O}}function U(t){try{return!t.activeWhen(window.location)}catch(n){c(n,t),t.status=O}}function _(t){return t!==O&&(!t||t.status!==O)}function x(t){return t.name}var D={bootstrap:{millis:4e3,dieOnTimeout:!1},mount:{millis:3e3,dieOnTimeout:!1},unmount:{millis:3e3,dieOnTimeout:!1},unload:{millis:3e3,dieOnTimeout:!1}};function j(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("number"!=typeof t||t<=0)throw new Error("bootstrap max time must be a positive integer number of milliseconds");D.bootstrap={millis:t,dieOnTimeout:n}}function C(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("number"!=typeof t||t<=0)throw new Error("mount max time must be a positive integer number of milliseconds");D.mount={millis:t,dieOnTimeout:n}}function M(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("number"!=typeof t||t<=0)throw new Error("unmount max time must be a positive integer number of milliseconds");D.unmount={millis:t,dieOnTimeout:n}}function I(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("number"!=typeof t||t<=0)throw new Error("unload max time must be a positive integer number of milliseconds");D.unload={millis:t,dieOnTimeout:n}}function L(t,n,e){var r=1e3;return new Promise(function(o,i){var a=!1,u=!1;function c(t){if(!a)if(!0===t)u=!0,e.dieOnTimeout?i("".concat(n," did not resolve or reject for ").concat(e.millis," milliseconds")):console.error("".concat(n," did not resolve or reject for ").concat(e.millis," milliseconds -- we're no longer going to warn you about it."));else if(!u){var o=t,s=o*r;console.warn("".concat(n," did not resolve or reject within ").concat(s," milliseconds")),s+r<e.millis&&setTimeout(function(){return c(o+1)},r)}}t.then(function(t){a=!0,o(t)}).catch(function(t){a=!0,i(t)}),setTimeout(function(){return c(1)},r),setTimeout(function(){return c(!0)},e.millis)})}function B(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a({},D,t)}function G(t,n){for(var e=0;e<t.length;e++)if(n(t[e]))return t[e];return null}function R(t){return t&&("function"==typeof t||(n=t,Array.isArray(n)&&!G(n,function(t){return"function"!=typeof t})));var n}function k(t,n){return 0===(t=Array.isArray(t)?t:[t]).length&&(t=[function(){return Promise.resolve()}]),function(e){return new Promise(function(r,o){!function i(a){var u=t[a](e);q(u)?u.then(function(){a===t.length-1?r():i(a+1)}).catch(o):o("".concat(n," at index ").concat(a," did not return a promise"))}(0)})}}function q(t){return t&&"function"==typeof t.then&&"function"==typeof t.catch}function W(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Promise.resolve().then(function(){return t.status!==d?t:(t.status=h,L(t.bootstrap(Y(t)),"Bootstrapping appOrParcel '".concat(t.name,"'"),t.timeouts.bootstrap).then(function(){return t.status=v,t}).catch(function(e){if(t.status=O,n)throw l(e,t);return c(e,t),t}))})}function K(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Promise.resolve().then(function(){if(t.status!==g)return t;t.status=b;var e=Object.keys(t.parcels).map(function(n){return t.parcels[n].unmountThisParcel()});return Promise.all(e).then(r,function(e){return r().then(function(){var r=new Error(e.message);if(n){var o=l(r,t);throw t.status=O,o}c(r,t),t.status=O})}).then(function(){return t});function r(){return L(t.unmount(Y(t)),"Unmounting application ".concat(t.name,"'"),t.timeouts.unmount).then(function(){t.status=v}).catch(function(e){if(n){var r=l(e,t);throw t.status=O,r}c(e,t),t.status=O})}})}var F=!1,H=!1;function $(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Promise.resolve().then(function(){return t.status!==v?t:(F||(window.dispatchEvent(new r("single-spa:before-first-mount")),F=!0),L(t.mount(Y(t)),"Mounting application '".concat(t.name,"'"),t.timeouts.mount).then(function(){return t.status=g,H||(window.dispatchEvent(new r("single-spa:first-mount")),H=!0),t}).catch(function(e){return t.status=g,K(t).then(r,r);function r(){if(n){var r=l(e,t);throw t.status=O,r}return c(e,t),t.status=O,t}}))})}var J=0,Q={parcels:{}};function V(){return z.apply(Q,arguments)}function z(t,n){var e=this;if(!t||"object"!==o(t)&&"function"!=typeof t)throw new Error("Cannot mount parcel without a config object or config loading function");if(t.name&&"string"!=typeof t.name)throw new Error("Parcel name must be a string, if provided");if("object"!==o(n))throw new Error("Parcel ".concat(name," has invalid customProps -- must be an object"));if(!n.domElement)throw new Error("Parcel ".concat(name," cannot be mounted without a domElement provided as a prop"));var r,i=J++,a="function"==typeof t,u=a?t:function(){return Promise.resolve(t)},c={id:i,parcels:{},status:a?m:d,customProps:n,parentName:e.name,unmountThisParcel:function(){if(c.status!==g)throw new Error("Cannot unmount parcel '".concat(name,"' -- it is in a ").concat(c.status," status"));return K(c,!0).then(function(t){return c.parentName&&delete e.parcels[c.id],t}).then(function(t){return f(t),t}).catch(function(t){throw c.status=O,p(t),t})}};e.parcels[i]=c;var s=u();if(!s||"function"!=typeof s.then)throw new Error("When mounting a parcel, the config loading function must return a promise that resolves with the parcel config");var f,p,h=(s=s.then(function(t){if(!t)throw new Error("When mounting a parcel, the config loading function returned a promise that did not resolve with a parcel config");var n=t.name||"parcel-".concat(i);if(!R(t.bootstrap))throw new Error("Parcel ".concat(n," must have a valid bootstrap function"));if(!R(t.mount))throw new Error("Parcel ".concat(n," must have a valid mount function"));if(!R(t.unmount))throw new Error("Parcel ".concat(n," must have a valid unmount function"));if(t.update&&!R(t.update))throw new Error("Parcel ".concat(n," provided an invalid update function"));var e=k(t.bootstrap),o=k(t.mount),a=k(t.unmount);c.status=d,c.name=n,c.bootstrap=e,c.mount=o,c.unmount=a,c.timeouts=B(t.timeouts),t.update&&(c.update=k(t.update),r.update=function(t){return c.customProps=t,X(function(t){return Promise.resolve().then(function(){if(t.status!==g)throw new Error("Cannot update parcel '".concat(t.name,"' because it is not mounted"));return t.status=y,L(t.update(Y(t)),"Updating parcel '".concat(t.name,"'"),t.timeouts.mount).then(function(){return t.status=g,t}).catch(function(n){var e=l(n,t);throw t.status=O,e})})}(c))})})).then(function(){return W(c,!0)}),w=h.then(function(){return $(c,!0)}),b=new Promise(function(t,n){f=t,p=n});return r={mount:function(){return X(Promise.resolve().then(function(){if(c.status!==v)throw new Error("Cannot mount parcel '".concat(name,"' -- it is in a ").concat(c.status," status"));return e.parcels[i]=c,$(c)}))},unmount:function(){return X(c.unmountThisParcel())},getStatus:function(){return c.status},loadPromise:X(s),bootstrapPromise:X(h),mountPromise:X(w),unmountPromise:X(b)}}function X(t){return t.then(function(){return null})}function Y(t){var e=a({},t.customProps,{name:t.name,mountParcel:z.bind(t),singleSpa:n});return t.unmountThisParcel&&(e.unmountSelf=t.unmountThisParcel),e}function Z(t){return Promise.resolve().then(function(){return t.status!==p?t:(t.status=m,Promise.resolve().then(function(){var e=t.loadImpl(Y(t));if(!q(e))throw new Error("single-spa loading function did not return a promise. Check the second argument to registerApplication('".concat(t.name,"', loadingFunction, activityFunction)"));return e.then(function(e){var r;return"object"!==o(n=e)&&(r="does not export anything"),R(n.bootstrap)||(r="does not export a bootstrap function or array of functions"),R(n.mount)||(r="does not export a mount function or array of functions"),R(n.unmount)||(r="does not export an unmount function or array of functions"),r?(c(r,t),t.status=O,t):(n.devtools&&n.devtools.overlays&&(t.devtools.overlays=a({},t.devtools.overlays,n.devtools.overlays)),t.status=d,t.bootstrap=k(n.bootstrap,"App '".concat(t.name,"' bootstrap function")),t.mount=k(n.mount,"App '".concat(t.name,"' mount function")),t.unmount=k(n.unmount,"App '".concat(t.name,"' unmount function")),t.unload=k(n.unload||[],"App '".concat(t.name,"' unload function")),t.timeouts=B(n.timeouts),t)})}).catch(function(n){return c(n,t),t.status=O,t}));var n})}var tt={hashchange:[],popstate:[]},nt=["hashchange","popstate"];function et(t){var n,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};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 new Error("singleSpaNavigate must be either called with a string url, with an <a> tag as its context, or with an event whose currentTarget is an <a> tag");n=t.currentTarget.href,t.preventDefault()}var r=ft(window.location.href),o=ft(n);if(0===n.indexOf("#"))window.location.hash="#"+o.anchor;else if(r.host!==o.host&&o.host){if(e.isTestingEnv)return{wouldHaveReloadedThePage:!0};window.location.href=n}else!function(t,n){return n===t||n==="/"+t}(o.path,r.path)?window.history.pushState(null,null,n):window.location.hash="#"+o.anchor}function rt(t){var n=this;if(t){var e=t[0].type;nt.indexOf(e)>=0&&tt[e].forEach(function(e){e.apply(n,t)})}}function ot(){Dt([],arguments)}window.addEventListener("hashchange",ot),window.addEventListener("popstate",ot);var it=window.addEventListener,at=window.removeEventListener;window.addEventListener=function(t,n){if(!("function"==typeof n&&nt.indexOf(t)>=0)||G(tt[t],function(t){return t===n}))return it.apply(this,arguments);tt[t].push(n)},window.removeEventListener=function(t,n){if(!("function"==typeof n&&nt.indexOf(t)>=0))return at.apply(this,arguments);tt[t]=tt[t].filter(function(t){return t!==n})};var ut=window.history.pushState;window.history.pushState=function(t){var n=ut.apply(this,arguments);return ot(st(t)),n};var ct=window.history.replaceState;function st(t){try{return new PopStateEvent("popstate",{state:t})}catch(e){var n=document.createEvent("PopStateEvent");return n.initPopStateEvent("popstate",!1,!1,t),n}}function ft(t){for(var n={strictMode:!0,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},e=n.parser.strict.exec(t),r={},o=14;o--;)r[n.key[o]]=e[o]||"";return r[n.q.name]={},r[n.key[12]].replace(n.q.parser,function(t,e,o){e&&(r[n.q.name][e]=o)}),r}window.history.replaceState=function(t){var n=ct.apply(this,arguments);return ot(st(t)),n},window.singleSpaNavigate=et;var lt=!1;function pt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.jQuery;if(t||window.$&&window.$.fn&&window.$.fn.jquery&&(t=window.$),t&&!lt){var n=t.fn.on,e=t.fn.off;t.fn.on=function(t,e){return mt.call(this,n,window.addEventListener,t,e,arguments)},t.fn.off=function(t,n){return mt.call(this,e,window.removeEventListener,t,n,arguments)},lt=!0}}function mt(t,n,e,r,o){return"string"!=typeof e?t.apply(this,o):(e.split(/\s+/).forEach(function(t){nt.indexOf(t)>=0&&(n(t,r),e=e.replace(t,""))}),""===e.trim()?this:t.apply(this,o))}var dt={};function ht(t){return Promise.resolve().then(function(){var n=dt[t.name];return n?t.status===p?(vt(t,n),t):t.status===E?n.promise.then(function(){return t}):t.status!==v?t:(t.status=E,L(t.unload(Y(t)),"Unloading application '".concat(t.name,"'"),t.timeouts.unload).then(function(){return vt(t,n),t}).catch(function(e){return function(t,n,e){delete dt[t.name],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,c(e,t),t.status=O,n.reject(e)}(t,n,e),t})):t})}function vt(t,n){delete dt[t.name],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,t.status=p,n.resolve()}function wt(t,n,e,r){dt[t.name]={app:t,resolve:e,reject:r},Object.defineProperty(dt[t.name],"promise",{get:n})}var gt=[];function yt(){return gt.filter(P).map(x)}function bt(){return gt.map(x)}function Et(t){var n=G(gt,function(n){return n.name===t});return n?n.status:null}function Ot(t,n,e){return console.warn('declareChildApplication is deprecated and will be removed in the next major version, use "registerApplication" instead'),Pt(t,n,e)}function Pt(t,n,e){var r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if("string"!=typeof t||0===t.length)throw new Error("The first argument must be a non-empty string 'appName'");if(-1!==bt().indexOf(t))throw new Error("There is already an app declared with name ".concat(t));if("object"!==o(i)||Array.isArray(i))throw new Error("customProps must be an object");if(!n)throw new Error("The application or loading function is required");if(r="function"!=typeof n?function(){return Promise.resolve(n)}:n,"function"!=typeof e)throw new Error("The activeWhen argument must be a function");gt.push({name:t,loadImpl:r,activeWhen:e,status:p,parcels:{},devtools:{overlays:{options:{},selectors:[]}},customProps:i}),pt(),Dt()}function Tt(t){for(var n=[],e=0;e<gt.length;e++)gt[e].activeWhen(t)&&n.push(gt[e].name);return n}function At(){return gt.filter(_).filter(N).filter(S)}function Nt(t,n){return console.warn('unloadChildApplication is deprecated and will be removed in the next major version, use "unloadApplication" instead'),St(t,n)}function St(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{waitForUnmount:!1};if("string"!=typeof t)throw new Error("unloadApplication requires a string 'appName'");var e=G(gt,function(n){return n.name===t});if(!e)throw new Error("Could not unload application '".concat(t,"' because no such application has been declared"));var r,o=function(t){return dt[t]}(e.name);if(n&&n.waitForUnmount){if(o)return o.promise;var i=new Promise(function(t,n){wt(e,function(){return i},t,n)});return i}return o?(r=o.promise,Ut(e,o.resolve,o.reject)):r=new Promise(function(t,n){wt(e,function(){return r},t,n),Ut(e,t,n)}),r}function Ut(t,n,e){K(t).then(ht).then(function(){n(),setTimeout(function(){Dt()})}).catch(e)}var _t=!1,xt=[];function Dt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;if(_t)return new Promise(function(t,e){xt.push({resolve:t,reject:e,eventArguments:n})});_t=!0;var e=!0;return jt?Promise.resolve().then(function(){window.dispatchEvent(new r("single-spa:before-routing-event",a()));var n=Object.keys(dt).map(function(t){return dt[t].app}).filter(T).map(ht),u=gt.filter(_).filter(P).filter(U).map(K).map(function(t){return t.then(ht)}),c=u.concat(n);c.length>0&&(e=!1);var s=Promise.all(c),f=At(),l=f.map(function(t){return Z(t).then(W).then(function(t){return s.then(function(){return $(t)})})});l.length>0&&(e=!1);var p=gt.filter(_).filter(T).filter(A).filter(S).filter(function(t){return f.indexOf(t)<0}).map(function(t){return W(t).then(function(){return s}).then(function(){return $(t)})});return p.length>0&&(e=!1),s.catch(function(t){throw i(),t}).then(function(){return i(),Promise.all(l.concat(p)).catch(function(n){throw t.forEach(function(t){return t.reject(n)}),n}).then(function(){return o(!1)})})}):Promise.resolve().then(function(){var t=At().map(Z);return t.length>0&&(e=!1),Promise.all(t).then(o).catch(function(t){throw i(),t})});function o(){var n=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],o=yt();n&&i(),t.forEach(function(t){return t.resolve(o)});try{var u=e?"single-spa:no-app-change":"single-spa:app-change";window.dispatchEvent(new r(u,a())),window.dispatchEvent(new r("single-spa:routing-event",a()))}catch(t){setTimeout(function(){throw t})}if(_t=!1,xt.length>0){var c=xt;xt=[],Dt(c)}return o}function i(){t.forEach(function(t){rt(t.eventArguments)}),rt(n)}function a(){var t={detail:{}};return n&&n[0]&&(t.detail.originalEvent=n[0]),t}}var jt=!1;function Ct(){jt=!0,Dt()}setTimeout(function(){jt||console.warn("singleSpa.start() has not been called, ".concat(5e3,"ms after single-spa was loaded. Before start() is called, apps can be declared and loaded, but not bootstrapped or mounted. See https://github.com/CanopyTax/single-spa/blob/master/docs/single-spa-api.md#start"))},5e3);var Mt={getRawAppData:function(){return[].concat(gt)},reroute:Dt,NOT_LOADED:p,toLoadPromise:Z,toBootstrapPromise:W};window&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=Mt),t.BOOTSTRAPPING=h,t.LOADING_SOURCE_CODE=m,t.MOUNTED=g,t.MOUNTING=w,t.NOT_BOOTSTRAPPED=d,t.NOT_LOADED=p,t.NOT_MOUNTED=v,t.SKIP_BECAUSE_BROKEN=O,t.UNMOUNTING=b,t.UPDATING=y,t.addErrorHandler=s,t.checkActivityFunctions=Tt,t.declareChildApplication=Ot,t.ensureJQuerySupport=pt,t.getAppNames=bt,t.getAppStatus=Et,t.getMountedApps=yt,t.mountRootParcel=V,t.navigateToUrl=et,t.registerApplication=Pt,t.removeErrorHandler=f,t.setBootstrapMaxTime=j,t.setMountMaxTime=C,t.setUnloadMaxTime=I,t.setUnmountMaxTime=M,t.start=Ct,t.triggerAppChange=Dt,t.unloadApplication=St,t.unloadChildApplication=Nt,Object.defineProperty(t,"__esModule",{value:!0})});
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((t=t||self).singleSpa={})}(this,function(t){"use strict";var n=Object.freeze({get start(){return Mt},get ensureJQuerySupport(){return pt},get setBootstrapMaxTime(){return j},get setMountMaxTime(){return C},get setUnmountMaxTime(){return M},get setUnloadMaxTime(){return I},get registerApplication(){return Pt},get getMountedApps(){return yt},get getAppStatus(){return Et},get unloadApplication(){return St},get checkActivityFunctions(){return Tt},get getAppNames(){return bt},get declareChildApplication(){return Ot},get unloadChildApplication(){return Nt},get navigateToUrl(){return et},get triggerAppChange(){return Dt},get addErrorHandler(){return s},get removeErrorHandler(){return f},get mountRootParcel(){return V},get NOT_LOADED(){return p},get LOADING_SOURCE_CODE(){return m},get NOT_BOOTSTRAPPED(){return d},get BOOTSTRAPPING(){return h},get NOT_MOUNTED(){return v},get MOUNTING(){return g},get UPDATING(){return y},get MOUNTED(){return w},get UNMOUNTING(){return b},get SKIP_BECAUSE_BROKEN(){return O}}),e=("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{}).CustomEvent;var r=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 e=document.createEvent("CustomEvent");return n?e.initCustomEvent(t,n.bubbles,n.cancelable,n.detail):e.initCustomEvent(t,!1,!1,void 0),e}:function(t,n){var e=document.createEventObject();return e.type=t,n?(e.bubbles=Boolean(n.bubbles),e.cancelable=Boolean(n.cancelable),e.detail=n.detail):(e.bubbles=!1,e.cancelable=!1,e.detail=void 0),e};function o(t){return(o="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 i(t,n,e){return n in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e,t}function a(t){for(var n=1;n<arguments.length;n++){var e=null!=arguments[n]?arguments[n]:{},r=Object.keys(e);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(e).filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.forEach(function(n){i(t,n,e[n])})}return t}var u=[];function c(t,n){var e=l(t,n);u.length?u.forEach(function(t){return t(e)}):setTimeout(function(){throw e})}function s(t){if("function"!=typeof t)throw Error("a single-spa error handler must be a function");u.push(t)}function f(t){if("function"!=typeof t)throw Error("a single-spa error handler must be a function");var n=!1;return u=u.filter(function(e){var r=e===t;return n=n||r,!r}),n}function l(t,n){var e,r=n.unmountThisParcel?"Parcel":"Application",o="".concat(r," '").concat(n.name,"' died in status ").concat(n.status,": ");if(t instanceof Error){try{t.message=o+t.message}catch(t){}e=t}else{console.warn("While ".concat(n.status,", '").concat(n.name,"' rejected its lifecycle function promise with a non-Error. This will cause stack traces to not be accurate."));try{e=Error(o+JSON.stringify(t))}catch(n){e=t}}return e.appName=n.name,e.name=n.name,e}var p="NOT_LOADED",m="LOADING_SOURCE_CODE",d="NOT_BOOTSTRAPPED",h="BOOTSTRAPPING",v="NOT_MOUNTED",g="MOUNTING",w="MOUNTED",y="UPDATING",b="UNMOUNTING",E="UNLOADING",O="SKIP_BECAUSE_BROKEN";function P(t){return t.status===w}function T(t){return!P(t)}function A(t){return t.status!==p&&t.status!==m}function N(t){return!A(t)}function S(t){try{return t.activeWhen(window.location)}catch(n){c(n,t),t.status=O}}function U(t){try{return!t.activeWhen(window.location)}catch(n){c(n,t),t.status=O}}function _(t){return t!==O&&(!t||t.status!==O)}function x(t){return t.name}var D={bootstrap:{millis:4e3,dieOnTimeout:!1},mount:{millis:3e3,dieOnTimeout:!1},unmount:{millis:3e3,dieOnTimeout:!1},unload:{millis:3e3,dieOnTimeout:!1}};function j(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("number"!=typeof t||t<=0)throw Error("bootstrap max time must be a positive integer number of milliseconds");D.bootstrap={millis:t,dieOnTimeout:n}}function C(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("number"!=typeof t||t<=0)throw Error("mount max time must be a positive integer number of milliseconds");D.mount={millis:t,dieOnTimeout:n}}function M(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("number"!=typeof t||t<=0)throw Error("unmount max time must be a positive integer number of milliseconds");D.unmount={millis:t,dieOnTimeout:n}}function I(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("number"!=typeof t||t<=0)throw Error("unload max time must be a positive integer number of milliseconds");D.unload={millis:t,dieOnTimeout:n}}function L(t,n,e){var r=1e3;return new Promise(function(o,i){var a=!1,u=!1;function c(t){if(!a)if(!0===t)u=!0,e.dieOnTimeout?i("".concat(n," did not resolve or reject for ").concat(e.millis," milliseconds")):console.error("".concat(n," did not resolve or reject for ").concat(e.millis," milliseconds -- we're no longer going to warn you about it."));else if(!u){var o=t,s=o*r;console.warn("".concat(n," did not resolve or reject within ").concat(s," milliseconds")),s+r<e.millis&&setTimeout(function(){return c(o+1)},r)}}t.then(function(t){a=!0,o(t)}).catch(function(t){a=!0,i(t)}),setTimeout(function(){return c(1)},r),setTimeout(function(){return c(!0)},e.millis)})}function B(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a({},D,t)}function G(t,n){for(var e=0;e<t.length;e++)if(n(t[e]))return t[e];return null}function R(t){return t&&("function"==typeof t||(n=t,Array.isArray(n)&&!G(n,function(t){return"function"!=typeof t})));var n}function k(t,n){return 0===(t=Array.isArray(t)?t:[t]).length&&(t=[function(){return Promise.resolve()}]),function(e){return new Promise(function(r,o){!function i(a){var u=t[a](e);q(u)?u.then(function(){a===t.length-1?r():i(a+1)}).catch(o):o("".concat(n," at index ").concat(a," did not return a promise"))}(0)})}}function q(t){return t&&"function"==typeof t.then&&"function"==typeof t.catch}function W(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Promise.resolve().then(function(){return t.status!==d?t:(t.status=h,L(t.bootstrap(Y(t)),"Bootstrapping appOrParcel '".concat(t.name,"'"),t.timeouts.bootstrap).then(function(){return t.status=v,t}).catch(function(e){if(t.status=O,n)throw l(e,t);return c(e,t),t}))})}function K(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Promise.resolve().then(function(){if(t.status!==w)return t;t.status=b;var e=Object.keys(t.parcels).map(function(n){return t.parcels[n].unmountThisParcel()});return Promise.all(e).then(r,function(e){return r().then(function(){var r=Error(e.message);if(n){var o=l(r,t);throw t.status=O,o}c(r,t),t.status=O})}).then(function(){return t});function r(){return L(t.unmount(Y(t)),"Unmounting application ".concat(t.name,"'"),t.timeouts.unmount).then(function(){t.status=v}).catch(function(e){if(n){var r=l(e,t);throw t.status=O,r}c(e,t),t.status=O})}})}var F=!1,H=!1;function $(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Promise.resolve().then(function(){return t.status!==v?t:(F||(window.dispatchEvent(new r("single-spa:before-first-mount")),F=!0),L(t.mount(Y(t)),"Mounting application '".concat(t.name,"'"),t.timeouts.mount).then(function(){return t.status=w,H||(window.dispatchEvent(new r("single-spa:first-mount")),H=!0),t}).catch(function(e){return t.status=w,K(t).then(r,r);function r(){if(n){var r=l(e,t);throw t.status=O,r}return c(e,t),t.status=O,t}}))})}var J=0,Q={parcels:{}};function V(){return z.apply(Q,arguments)}function z(t,n){var e=this;if(!t||"object"!==o(t)&&"function"!=typeof t)throw Error("Cannot mount parcel without a config object or config loading function");if(t.name&&"string"!=typeof t.name)throw Error("Parcel name must be a string, if provided");if("object"!==o(n))throw Error("Parcel ".concat(name," has invalid customProps -- must be an object"));if(!n.domElement)throw Error("Parcel ".concat(name," cannot be mounted without a domElement provided as a prop"));var r,i=J++,a="function"==typeof t,u=a?t:function(){return Promise.resolve(t)},c={id:i,parcels:{},status:a?m:d,customProps:n,parentName:e.name,unmountThisParcel:function(){if(c.status!==w)throw Error("Cannot unmount parcel '".concat(name,"' -- it is in a ").concat(c.status," status"));return K(c,!0).then(function(t){return c.parentName&&delete e.parcels[c.id],t}).then(function(t){return f(t),t}).catch(function(t){throw c.status=O,p(t),t})}};e.parcels[i]=c;var s=u();if(!s||"function"!=typeof s.then)throw Error("When mounting a parcel, the config loading function must return a promise that resolves with the parcel config");var f,p,h=(s=s.then(function(t){if(!t)throw Error("When mounting a parcel, the config loading function returned a promise that did not resolve with a parcel config");var n=t.name||"parcel-".concat(i);if(!R(t.bootstrap))throw Error("Parcel ".concat(n," must have a valid bootstrap function"));if(!R(t.mount))throw Error("Parcel ".concat(n," must have a valid mount function"));if(!R(t.unmount))throw Error("Parcel ".concat(n," must have a valid unmount function"));if(t.update&&!R(t.update))throw Error("Parcel ".concat(n," provided an invalid update function"));var e=k(t.bootstrap),o=k(t.mount),a=k(t.unmount);c.status=d,c.name=n,c.bootstrap=e,c.mount=o,c.unmount=a,c.timeouts=B(t.timeouts),t.update&&(c.update=k(t.update),r.update=function(t){return c.customProps=t,X(function(t){return Promise.resolve().then(function(){if(t.status!==w)throw Error("Cannot update parcel '".concat(t.name,"' because it is not mounted"));return t.status=y,L(t.update(Y(t)),"Updating parcel '".concat(t.name,"'"),t.timeouts.mount).then(function(){return t.status=w,t}).catch(function(n){var e=l(n,t);throw t.status=O,e})})}(c))})})).then(function(){return W(c,!0)}),g=h.then(function(){return $(c,!0)}),b=new Promise(function(t,n){f=t,p=n});return r={mount:function(){return X(Promise.resolve().then(function(){if(c.status!==v)throw Error("Cannot mount parcel '".concat(name,"' -- it is in a ").concat(c.status," status"));return e.parcels[i]=c,$(c)}))},unmount:function(){return X(c.unmountThisParcel())},getStatus:function(){return c.status},loadPromise:X(s),bootstrapPromise:X(h),mountPromise:X(g),unmountPromise:X(b)}}function X(t){return t.then(function(){return null})}function Y(t){var e=a({},t.customProps,{name:t.name,mountParcel:z.bind(t),singleSpa:n});return t.unmountThisParcel&&(e.unmountSelf=t.unmountThisParcel),e}function Z(t){return Promise.resolve().then(function(){return t.status!==p?t:(t.status=m,Promise.resolve().then(function(){var e=t.loadImpl(Y(t));if(!q(e))throw Error("single-spa loading function did not return a promise. Check the second argument to registerApplication('".concat(t.name,"', loadingFunction, activityFunction)"));return e.then(function(e){var r;return"object"!==o(n=e)&&(r="does not export anything"),R(n.bootstrap)||(r="does not export a bootstrap function or array of functions"),R(n.mount)||(r="does not export a mount function or array of functions"),R(n.unmount)||(r="does not export an unmount function or array of functions"),r?(c(r,t),t.status=O,t):(n.devtools&&n.devtools.overlays&&(t.devtools.overlays=a({},t.devtools.overlays,n.devtools.overlays)),t.status=d,t.bootstrap=k(n.bootstrap,"App '".concat(t.name,"' bootstrap function")),t.mount=k(n.mount,"App '".concat(t.name,"' mount function")),t.unmount=k(n.unmount,"App '".concat(t.name,"' unmount function")),t.unload=k(n.unload||[],"App '".concat(t.name,"' unload function")),t.timeouts=B(n.timeouts),t)})}).catch(function(n){return c(n,t),t.status=O,t}));var n})}var tt={hashchange:[],popstate:[]},nt=["hashchange","popstate"];function et(t){var n,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};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("singleSpaNavigate must be either called with a string url, with an <a> tag as its context, or with an event whose currentTarget is an <a> tag");n=t.currentTarget.href,t.preventDefault()}var r=ft(window.location.href),o=ft(n);if(0===n.indexOf("#"))window.location.hash="#"+o.anchor;else if(r.host!==o.host&&o.host){if(e.isTestingEnv)return{wouldHaveReloadedThePage:!0};window.location.href=n}else!function(t,n){return n===t||n==="/"+t}(o.path,r.path)?window.history.pushState(null,null,n):window.location.hash="#"+o.anchor}function rt(t){var n=this;if(t){var e=t[0].type;nt.indexOf(e)>=0&&tt[e].forEach(function(e){e.apply(n,t)})}}function ot(){jt([],arguments)}window.addEventListener("hashchange",ot),window.addEventListener("popstate",ot);var it=window.addEventListener,at=window.removeEventListener;window.addEventListener=function(t,n){if(!("function"==typeof n&&nt.indexOf(t)>=0)||G(tt[t],function(t){return t===n}))return it.apply(this,arguments);tt[t].push(n)},window.removeEventListener=function(t,n){if(!("function"==typeof n&&nt.indexOf(t)>=0))return at.apply(this,arguments);tt[t]=tt[t].filter(function(t){return t!==n})};var ut=window.history.pushState;window.history.pushState=function(t){var n=ut.apply(this,arguments);return ot(st(t)),n};var ct=window.history.replaceState;function st(t){try{return new PopStateEvent("popstate",{state:t})}catch(e){var n=document.createEvent("PopStateEvent");return n.initPopStateEvent("popstate",!1,!1,t),n}}function ft(t){for(var n={strictMode:!0,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}},e=n.parser.strict.exec(t),r={},o=14;o--;)r[n.key[o]]=e[o]||"";return r[n.q.name]={},r[n.key[12]].replace(n.q.parser,function(t,e,o){e&&(r[n.q.name][e]=o)}),r}window.history.replaceState=function(t){var n=ct.apply(this,arguments);return ot(st(t)),n},window.singleSpaNavigate=et;var lt=!1;function pt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.jQuery;if(t||window.$&&window.$.fn&&window.$.fn.jquery&&(t=window.$),t&&!lt){var n=t.fn.on,e=t.fn.off;t.fn.on=function(t,e){return mt.call(this,n,window.addEventListener,t,e,arguments)},t.fn.off=function(t,n){return mt.call(this,e,window.removeEventListener,t,n,arguments)},lt=!0}}function mt(t,n,e,r,o){return"string"!=typeof e?t.apply(this,o):(e.split(/\s+/).forEach(function(t){nt.indexOf(t)>=0&&(n(t,r),e=e.replace(t,""))}),""===e.trim()?this:t.apply(this,o))}var dt={};function ht(t){return Promise.resolve().then(function(){var n=dt[t.name];return n?t.status===p?(vt(t,n),t):t.status===E?n.promise.then(function(){return t}):t.status!==v?t:(t.status=E,L(t.unload(Y(t)),"Unloading application '".concat(t.name,"'"),t.timeouts.unload).then(function(){return vt(t,n),t}).catch(function(e){return function(t,n,e){delete dt[t.name],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,c(e,t),t.status=O,n.reject(e)}(t,n,e),t})):t})}function vt(t,n){delete dt[t.name],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,t.status=p,n.resolve()}function gt(t,n,e,r){dt[t.name]={app:t,resolve:e,reject:r},Object.defineProperty(dt[t.name],"promise",{get:n})}var wt=[];function yt(){return wt.filter(P).map(x)}function bt(){return wt.map(x)}function Et(t){var n=G(wt,function(n){return n.name===t});return n?n.status:null}function Ot(t,n,e){return console.warn('declareChildApplication is deprecated and will be removed in the next major version, use "registerApplication" instead'),Pt(t,n,e)}function Pt(t,n,e){var r,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if("string"!=typeof t||0===t.length)throw Error("The first argument must be a non-empty string 'appName'");if(-1!==bt().indexOf(t))throw Error("There is already an app declared with name ".concat(t));if("object"!==o(i)||Array.isArray(i))throw Error("customProps must be an object");if(!n)throw Error("The application or loading function is required");if(r="function"!=typeof n?function(){return Promise.resolve(n)}:n,"function"!=typeof e)throw Error("The activeWhen argument must be a function");wt.push({name:t,loadImpl:r,activeWhen:e,status:p,parcels:{},devtools:{overlays:{options:{},selectors:[]}},customProps:i}),pt(),jt()}function Tt(t){for(var n=[],e=0;e<wt.length;e++)wt[e].activeWhen(t)&&n.push(wt[e].name);return n}function At(){return wt.filter(_).filter(N).filter(S)}function Nt(t,n){return console.warn('unloadChildApplication is deprecated and will be removed in the next major version, use "unloadApplication" instead'),St(t,n)}function St(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{waitForUnmount:!1};if("string"!=typeof t)throw Error("unloadApplication requires a string 'appName'");var e=G(wt,function(n){return n.name===t});if(!e)throw Error("Could not unload application '".concat(t,"' because no such application has been registered"));var r,o=function(t){return dt[t]}(e.name);if(n&&n.waitForUnmount){if(o)return o.promise;var i=new Promise(function(t,n){gt(e,function(){return i},t,n)});return i}return o?(r=o.promise,Ut(e,o.resolve,o.reject)):r=new Promise(function(t,n){gt(e,function(){return r},t,n),Ut(e,t,n)}),r}function Ut(t,n,e){K(t).then(ht).then(function(){n(),setTimeout(function(){jt()})}).catch(e)}var _t=!1,xt=[];function Dt(){return jt()}function jt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;if(_t)return new Promise(function(t,e){xt.push({resolve:t,reject:e,eventArguments:n})});_t=!0;var e=!0;return Ct?Promise.resolve().then(function(){window.dispatchEvent(new r("single-spa:before-routing-event",a()));var n=Object.keys(dt).map(function(t){return dt[t].app}).filter(T).map(ht),u=wt.filter(_).filter(P).filter(U).map(K).map(function(t){return t.then(ht)}),c=u.concat(n);c.length>0&&(e=!1);var s=Promise.all(c),f=At(),l=f.map(function(t){return Z(t).then(W).then(function(t){return s.then(function(){return $(t)})})});l.length>0&&(e=!1);var p=wt.filter(_).filter(T).filter(A).filter(S).filter(function(t){return f.indexOf(t)<0}).map(function(t){return W(t).then(function(){return s}).then(function(){return $(t)})});return p.length>0&&(e=!1),s.catch(function(t){throw i(),t}).then(function(){return i(),Promise.all(l.concat(p)).catch(function(n){throw t.forEach(function(t){return t.reject(n)}),n}).then(function(){return o(!1)})})}):Promise.resolve().then(function(){var t=At().map(Z);return t.length>0&&(e=!1),Promise.all(t).then(o).catch(function(t){throw i(),t})});function o(){var n=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],o=yt();n&&i(),t.forEach(function(t){return t.resolve(o)});try{var u=e?"single-spa:no-app-change":"single-spa:app-change";window.dispatchEvent(new r(u,a())),window.dispatchEvent(new r("single-spa:routing-event",a()))}catch(t){setTimeout(function(){throw t})}if(_t=!1,xt.length>0){var c=xt;xt=[],jt(c)}return o}function i(){t.forEach(function(t){rt(t.eventArguments)}),rt(n)}function a(){var t={detail:{}};return n&&n[0]&&(t.detail.originalEvent=n[0]),t}}var Ct=!1;function Mt(){Ct=!0,jt()}setTimeout(function(){Ct||console.warn("singleSpa.start() has not been called, ".concat(5e3,"ms after single-spa was loaded. Before start() is called, apps can be declared and loaded, but not bootstrapped or mounted. See https://github.com/CanopyTax/single-spa/blob/master/docs/single-spa-api.md#start"))},5e3);var It={getRawAppData:function(){return[].concat(wt)},reroute:jt,NOT_LOADED:p,toLoadPromise:Z,toBootstrapPromise:W,unregisterApplication:function(t){if(!wt.find(function(n){return n.name===t}))throw Error("Cannot unregister application '".concat(t,"' because no such application has been registered"));return St(t).then(function(){var n=wt.findIndex(function(n){return n.name===t});wt.splice(n,1)})}};window&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=It),t.BOOTSTRAPPING=h,t.LOADING_SOURCE_CODE=m,t.MOUNTED=w,t.MOUNTING=g,t.NOT_BOOTSTRAPPED=d,t.NOT_LOADED=p,t.NOT_MOUNTED=v,t.SKIP_BECAUSE_BROKEN=O,t.UNMOUNTING=b,t.UPDATING=y,t.addErrorHandler=s,t.checkActivityFunctions=Tt,t.declareChildApplication=Ot,t.ensureJQuerySupport=pt,t.getAppNames=bt,t.getAppStatus=Et,t.getMountedApps=yt,t.mountRootParcel=V,t.navigateToUrl=et,t.registerApplication=Pt,t.removeErrorHandler=f,t.setBootstrapMaxTime=j,t.setMountMaxTime=C,t.setUnloadMaxTime=I,t.setUnmountMaxTime=M,t.start=Mt,t.triggerAppChange=Dt,t.unloadApplication=St,t.unloadChildApplication=Nt,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=single-spa.min.js.map
{
"name": "single-spa",
"version": "4.3.2",
"version": "4.3.3",
"description": "Multiple applications, one page",
"main": "lib/umd/single-spa.min.js",
"types": "typings/single-spa.d.ts",
"module:": "lib/esm/single-spa.min.js",

@@ -15,5 +16,10 @@ "scripts": {

"test": "BABEL_ENV=test jest --config jest.config.json",
"test:debug": "BABEL_ENV=test jest --config jest.config.json --watch",
"test:watch": "BABEL_ENV=test jest --config jest.config.json --watch",
"lint": "eslint src"
},
"husky": {
"hooks": {
"pre-push": "yarn test && yarn lint"
}
},
"homepage": "https://single-spa.js.org",

@@ -45,2 +51,3 @@ "repository": "https://github.com/CanopyTax/single-spa",

"eslint-config-canopy": "2.3.0",
"husky": "^2.2.0",
"in-publish": "^2.0.0",

@@ -47,0 +54,0 @@ "jest": "^24.5.0",

@@ -17,3 +17,3 @@ let errorHandlers = []

if (typeof handler !== 'function') {
throw new Error('a single-spa error handler must be a function');
throw Error('a single-spa error handler must be a function');
}

@@ -26,3 +26,3 @@

if (typeof handler !== 'function') {
throw new Error('a single-spa error handler must be a function');
throw Error('a single-spa error handler must be a function');
}

@@ -58,3 +58,3 @@

try {
result = new Error(errPrefix + JSON.stringify(ogErr));
result = Error(errPrefix + JSON.stringify(ogErr));
} catch(err) {

@@ -61,0 +61,0 @@ // If it's not an Error and you can't stringify it, then what else can you even do to it?

@@ -35,10 +35,10 @@ import { ensureJQuerySupport } from '../jquery-support.js';

if (typeof appName !== 'string' || appName.length === 0)
throw new Error(`The first argument must be a non-empty string 'appName'`);
throw Error(`The first argument must be a non-empty string 'appName'`);
if (getAppNames().indexOf(appName) !== -1)
throw new Error(`There is already an app declared with name ${appName}`);
throw Error(`There is already an app declared with name ${appName}`);
if (typeof customProps !== 'object' || Array.isArray(customProps))
throw new Error('customProps must be an object');
throw Error('customProps must be an object');
if (!applicationOrLoadingFn)
throw new Error(`The application or loading function is required`);
throw Error(`The application or loading function is required`);

@@ -55,3 +55,3 @@ let loadImpl;

if (typeof activityFn !== 'function')
throw new Error(`The activeWhen argument must be a function`);
throw Error(`The activeWhen argument must be a function`);

@@ -110,2 +110,14 @@ apps.push({

export function unregisterApplication(appName) {
if (!apps.find(app => app.name === appName)) {
throw Error(`Cannot unregister application '${appName}' because no such application has been registered`)
}
return unloadApplication(appName)
.then(() => {
const appIndex = apps.findIndex(app => app.name === appName)
apps.splice(appIndex, 1)
})
}
export function unloadChildApplication(appName, opts) {

@@ -118,7 +130,7 @@ console.warn('unloadChildApplication is deprecated and will be removed in the next major version, use "unloadApplication" instead')

if (typeof appName !== 'string') {
throw new Error(`unloadApplication requires a string 'appName'`);
throw Error(`unloadApplication requires a string 'appName'`);
}
const app = find(apps, App => App.name === appName);
if (!app) {
throw new Error(`Could not unload application '${appName}' because no such application has been declared`);
throw Error(`Could not unload application '${appName}' because no such application has been registered`);
}

@@ -125,0 +137,0 @@

@@ -22,3 +22,3 @@ const globalTimeoutConfig = {

if (typeof time !== 'number' || time <= 0) {
throw new Error(`bootstrap max time must be a positive integer number of milliseconds`);
throw Error(`bootstrap max time must be a positive integer number of milliseconds`);
}

@@ -34,3 +34,3 @@

if (typeof time !== 'number' || time <= 0) {
throw new Error(`mount max time must be a positive integer number of milliseconds`);
throw Error(`mount max time must be a positive integer number of milliseconds`);
}

@@ -46,3 +46,3 @@

if (typeof time !== 'number' || time <= 0) {
throw new Error(`unmount max time must be a positive integer number of milliseconds`);
throw Error(`unmount max time must be a positive integer number of milliseconds`);
}

@@ -58,3 +58,3 @@

if (typeof time !== 'number' || time <= 0) {
throw new Error(`unload max time must be a positive integer number of milliseconds`);
throw Error(`unload max time must be a positive integer number of milliseconds`);
}

@@ -61,0 +61,0 @@

@@ -1,2 +0,2 @@

import {getRawAppData} from '../applications/apps'
import {getRawAppData, unregisterApplication} from '../applications/apps'
import {reroute} from '../navigation/reroute'

@@ -13,2 +13,3 @@ import {NOT_LOADED} from '../applications/app.helpers'

toBootstrapPromise,
unregisterApplication,
}

@@ -21,3 +21,3 @@ import { NOT_BOOTSTRAPPED, LOADING_SOURCE_CODE, SKIP_BECAUSE_BROKEN, NOT_LOADED } from '../applications/app.helpers.js';

// The name of the app will be prepended to this error message inside of the handleAppError function
throw new Error(`single-spa loading function did not return a promise. Check the second argument to registerApplication('${app.name}', loadingFunction, activityFunction)`);
throw Error(`single-spa loading function did not return a promise. Check the second argument to registerApplication('${app.name}', loadingFunction, activityFunction)`);
}

@@ -24,0 +24,0 @@ return loadPromise.then(val => {

@@ -26,3 +26,3 @@ import { UNMOUNTING, NOT_MOUNTED, MOUNTED, SKIP_BECAUSE_BROKEN } from '../applications/app.helpers.js';

// Unmounting the app/parcel succeeded, but unmounting its children parcels did not
const parentError = new Error(parcelError.message)
const parentError = Error(parcelError.message)
if (hardFail) {

@@ -29,0 +29,0 @@ const transformedErr = transformErr(parentError, appOrParcel)

@@ -9,3 +9,3 @@ import { UPDATING, MOUNTED, SKIP_BECAUSE_BROKEN } from '../applications/app.helpers.js';

if (parcel.status !== MOUNTED) {
throw new Error(`Cannot update parcel '${parcel.name}' because it is not mounted`)
throw Error(`Cannot update parcel '${parcel.name}' because it is not mounted`)
}

@@ -12,0 +12,0 @@

@@ -26,3 +26,3 @@ import { reroute } from './reroute.js';

} else {
throw new Error(`singleSpaNavigate must be either called with a string url, with an <a> tag as its context, or with an event whose currentTarget is an <a> tag`);
throw Error(`singleSpaNavigate must be either called with a string url, with an <a> tag as its context, or with an event whose currentTarget is an <a> tag`);
}

@@ -29,0 +29,0 @@

@@ -13,2 +13,7 @@ import CustomEvent from 'custom-event';

export function triggerAppChange() {
// Call reroute with no arguments, intentionally
return reroute()
}
export function reroute(pendingPromises = [], eventArguments) {

@@ -15,0 +20,0 @@ if (appChangeUnderway) {

@@ -22,15 +22,15 @@ import { validLifecycleFn, flattenFnArray } from '../lifecycles/lifecycle.helpers.js';

if (!config || (typeof config !== 'object' && typeof config !== 'function')) {
throw new Error('Cannot mount parcel without a config object or config loading function');
throw Error('Cannot mount parcel without a config object or config loading function');
}
if (config.name && typeof config.name !== 'string') {
throw new Error('Parcel name must be a string, if provided');
throw Error('Parcel name must be a string, if provided');
}
if (typeof customProps !== 'object') {
throw new Error(`Parcel ${name} has invalid customProps -- must be an object`);
throw Error(`Parcel ${name} has invalid customProps -- must be an object`);
}
if (!customProps.domElement) {
throw new Error(`Parcel ${name} cannot be mounted without a domElement provided as a prop`);
throw Error(`Parcel ${name} cannot be mounted without a domElement provided as a prop`);
}

@@ -52,3 +52,3 @@

if (parcel.status !== MOUNTED) {
throw new Error(`Cannot unmount parcel '${name}' -- it is in a ${parcel.status} status`);
throw Error(`Cannot unmount parcel '${name}' -- it is in a ${parcel.status} status`);
}

@@ -85,3 +85,3 @@

if (!loadPromise || typeof loadPromise.then !== 'function') {
throw new Error(`When mounting a parcel, the config loading function must return a promise that resolves with the parcel config`)
throw Error(`When mounting a parcel, the config loading function must return a promise that resolves with the parcel config`)
}

@@ -91,3 +91,3 @@

if (!config) {
throw new Error(`When mounting a parcel, the config loading function returned a promise that did not resolve with a parcel config`)
throw Error(`When mounting a parcel, the config loading function returned a promise that did not resolve with a parcel config`)
}

@@ -98,15 +98,15 @@

if (!validLifecycleFn(config.bootstrap)) {
throw new Error(`Parcel ${name} must have a valid bootstrap function`);
throw Error(`Parcel ${name} must have a valid bootstrap function`);
}
if (!validLifecycleFn(config.mount)) {
throw new Error(`Parcel ${name} must have a valid mount function`);
throw Error(`Parcel ${name} must have a valid mount function`);
}
if (!validLifecycleFn(config.unmount)) {
throw new Error(`Parcel ${name} must have a valid unmount function`);
throw Error(`Parcel ${name} must have a valid unmount function`);
}
if (config.update && !validLifecycleFn(config.update)) {
throw new Error(`Parcel ${name} provided an invalid update function`);
throw Error(`Parcel ${name} provided an invalid update function`);
}

@@ -154,3 +154,3 @@

if (parcel.status !== NOT_MOUNTED) {
throw new Error(`Cannot mount parcel '${name}' -- it is in a ${parcel.status} status`);
throw Error(`Cannot mount parcel '${name}' -- it is in a ${parcel.status} status`);
}

@@ -157,0 +157,0 @@

@@ -6,3 +6,3 @@ export { start } from './start.js';

export { navigateToUrl } from './navigation/navigation-events.js';
export { reroute as triggerAppChange } from './navigation/reroute.js';
export { triggerAppChange } from './navigation/reroute.js';
export { addErrorHandler, removeErrorHandler } from './applications/app-errors.js';

@@ -9,0 +9,0 @@ export { mountRootParcel } from './parcels/mount-parcel.js';

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc