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.1.2 to 4.2.0

jest.config.json

2

lib/esm/single-spa.min.js

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

var t=Object.freeze({get start(){return Dt},get ensureJQuerySupport(){return ft},get setBootstrapMaxTime(){return D},get setMountMaxTime(){return U},get setUnmountMaxTime(){return C},get setUnloadMaxTime(){return L},get registerApplication(){return Et},get getMountedApps(){return wt},get getAppStatus(){return yt},get unloadApplication(){return At},get checkActivityFunctions(){return Pt},get getAppNames(){return gt},get declareChildApplication(){return bt},get unloadChildApplication(){return Tt},get navigateToUrl(){return nt},get triggerAppChange(){return xt},get addErrorHandler(){return c},get removeErrorHandler(){return s},get mountRootParcel(){return Q},get NOT_LOADED(){return l},get LOADING_SOURCE_CODE(){return m},get NOT_BOOTSTRAPPED(){return p},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",m="LOADING_SOURCE_CODE",p="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!==m}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!==p?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}))})}var W=!1,F=!1;function K(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Promise.resolve().then(function(){return t.status!==h?t:(W||(window.dispatchEvent(new e("single-spa:before-first-mount")),W=!0),I(t.mount(X(t)),"Mounting application '".concat(t.name,"'"),t.timeouts.mount).then(function(){return t.status=w,F||(window.dispatchEvent(new e("single-spa:first-mount")),F=!0),t}).catch(function(e){if(n){var r=f(e,t);throw t.status=E,r}return u(e,t),t.status=E,t}))})}function $(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 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?m:p,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 $(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=p,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 K(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,K(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=m,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=p,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=ct(window.location.href),o=ct(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(){xt([],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 xt(),n};var ut=window.history.replaceState;function ct(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(){var t=ut.apply(this,arguments);return xt(),t},window.singleSpaNavigate=nt;var st=!1;function ft(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.jQuery;if(t||window.$&&window.$.fn&&window.$.fn.jquery&&(t=window.$),t&&!st){var n=t.fn.on,e=t.fn.off;t.fn.on=function(t,e){return lt.call(this,n,window.addEventListener,t,e,arguments)},t.fn.off=function(t,n){return lt.call(this,e,window.removeEventListener,t,n,arguments)},st=!0}}function lt(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 pt(t){return Promise.resolve().then(function(){var n=mt[t.name];return n?t.status===l?(dt(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 dt(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 dt(t,n){delete mt[t.name],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,t.status=l,n.resolve()}function ht(t,n,e,r){mt[t.name]={app:t,resolve:e,reject:r},Object.defineProperty(mt[t.name],"promise",{get:n})}var vt=[];function wt(){return vt.filter(P).map(x)}function gt(){return vt.map(x)}function yt(t){var n=B(vt,function(n){return n.name===t});return n?n.status:null}function bt(t,n,e){return console.warn('declareChildApplication is deprecated and will be removed in the next major version, use "registerApplication" instead'),Et(t,n,e)}function Et(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!==gt().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");vt.push({name:t,loadImpl:o,activeWhen:e,status:l,parcels:{},devtools:{overlays:{options:{},selectors:[]}},customProps:i}),ft(),xt()}function Pt(t){for(var n=[],e=0;e<vt.length;e++)vt[e].activeWhen(t)&&n.push(vt[e].name);return n}function Ot(){return vt.filter(j).filter(A).filter(N)}function Tt(t,n){return console.warn('unloadChildApplication is deprecated and will be removed in the next major version, use "unloadApplication" instead'),At(t,n)}function At(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(vt,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){ht(e,function(){return i},t,n)});return i}return o?(r=o.promise,Nt(e,o.resolve,o.reject)):r=new Promise(function(t,n){ht(e,function(){return r},t,n),Nt(e,t,n)}),r}function Nt(t,n,e){$(t).then(pt).then(function(){n(),setTimeout(function(){xt()})}).catch(e)}var St=!1,jt=[];function xt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;if(St)return new Promise(function(t,e){jt.push({resolve:t,reject:e,eventArguments:n})});St=!0;var r=!0;return _t?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(pt),u=vt.filter(j).filter(P).filter(S).map($).map(function(t){return t.then(pt)}),c=u.concat(n);c.length>0&&(r=!1);var s=Promise.all(c),f=Ot(),l=f.map(function(t){return Y(t).then(q).then(function(t){return s.then(function(){return K(t)})})});l.length>0&&(r=!1);var m=vt.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 K(t)})});return m.length>0&&(r=!1),s.catch(function(t){throw i(),t}).then(function(){return i(),Promise.all(l.concat(m)).catch(function(n){throw t.forEach(function(t){return t.reject(n)}),n}).then(function(){return o(!1)})})}):Promise.resolve().then(function(){var t=Ot().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(St=!1,jt.length>0){var c=jt;jt=[],xt(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 _t=!1;function Dt(){_t=!0,xt()}setTimeout(function(){_t||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 Ut={getRawAppData:function(){return[].concat(vt)},reroute:xt,NOT_LOADED:l,toLoadPromise:Y,toBootstrapPromise:q};window&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=Ut);export{Dt as start,ft as ensureJQuerySupport,D as setBootstrapMaxTime,U as setMountMaxTime,C as setUnmountMaxTime,L as setUnloadMaxTime,Et as registerApplication,wt as getMountedApps,yt as getAppStatus,At as unloadApplication,Pt as checkActivityFunctions,gt as getAppNames,bt as declareChildApplication,Tt as unloadChildApplication,nt as navigateToUrl,xt as triggerAppChange,c as addErrorHandler,s as removeErrorHandler,Q as mountRootParcel,l as NOT_LOADED,m as LOADING_SOURCE_CODE,p as NOT_BOOTSTRAPPED,d as BOOTSTRAPPING,h as NOT_MOUNTED,v as MOUNTING,g as UPDATING,w as MOUNTED,y as UNMOUNTING,E as SKIP_BECAUSE_BROKEN};
var t=Object.freeze({get start(){return Dt},get ensureJQuerySupport(){return ft},get setBootstrapMaxTime(){return D},get setMountMaxTime(){return U},get setUnmountMaxTime(){return C},get setUnloadMaxTime(){return L},get registerApplication(){return Et},get getMountedApps(){return wt},get getAppStatus(){return yt},get unloadApplication(){return At},get checkActivityFunctions(){return Pt},get getAppNames(){return gt},get declareChildApplication(){return bt},get unloadChildApplication(){return Tt},get navigateToUrl(){return nt},get triggerAppChange(){return xt},get addErrorHandler(){return c},get removeErrorHandler(){return s},get mountRootParcel(){return Q},get NOT_LOADED(){return l},get LOADING_SOURCE_CODE(){return m},get NOT_BOOTSTRAPPED(){return p},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",m="LOADING_SOURCE_CODE",p="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!==m}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!==p?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?m:p,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=p,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=m,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=p,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=ct(window.location.href),o=ct(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(){xt([],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 xt(),n};var ut=window.history.replaceState;function ct(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(){var t=ut.apply(this,arguments);return xt(),t},window.singleSpaNavigate=nt;var st=!1;function ft(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.jQuery;if(t||window.$&&window.$.fn&&window.$.fn.jquery&&(t=window.$),t&&!st){var n=t.fn.on,e=t.fn.off;t.fn.on=function(t,e){return lt.call(this,n,window.addEventListener,t,e,arguments)},t.fn.off=function(t,n){return lt.call(this,e,window.removeEventListener,t,n,arguments)},st=!0}}function lt(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 pt(t){return Promise.resolve().then(function(){var n=mt[t.name];return n?t.status===l?(dt(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 dt(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 dt(t,n){delete mt[t.name],delete t.bootstrap,delete t.mount,delete t.unmount,delete t.unload,t.status=l,n.resolve()}function ht(t,n,e,r){mt[t.name]={app:t,resolve:e,reject:r},Object.defineProperty(mt[t.name],"promise",{get:n})}var vt=[];function wt(){return vt.filter(P).map(x)}function gt(){return vt.map(x)}function yt(t){var n=B(vt,function(n){return n.name===t});return n?n.status:null}function bt(t,n,e){return console.warn('declareChildApplication is deprecated and will be removed in the next major version, use "registerApplication" instead'),Et(t,n,e)}function Et(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!==gt().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");vt.push({name:t,loadImpl:o,activeWhen:e,status:l,parcels:{},devtools:{overlays:{options:{},selectors:[]}},customProps:i}),ft(),xt()}function Pt(t){for(var n=[],e=0;e<vt.length;e++)vt[e].activeWhen(t)&&n.push(vt[e].name);return n}function Ot(){return vt.filter(j).filter(A).filter(N)}function Tt(t,n){return console.warn('unloadChildApplication is deprecated and will be removed in the next major version, use "unloadApplication" instead'),At(t,n)}function At(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(vt,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){ht(e,function(){return i},t,n)});return i}return o?(r=o.promise,Nt(e,o.resolve,o.reject)):r=new Promise(function(t,n){ht(e,function(){return r},t,n),Nt(e,t,n)}),r}function Nt(t,n,e){W(t).then(pt).then(function(){n(),setTimeout(function(){xt()})}).catch(e)}var St=!1,jt=[];function xt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;if(St)return new Promise(function(t,e){jt.push({resolve:t,reject:e,eventArguments:n})});St=!0;var r=!0;return _t?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(pt),u=vt.filter(j).filter(P).filter(S).map(W).map(function(t){return t.then(pt)}),c=u.concat(n);c.length>0&&(r=!1);var s=Promise.all(c),f=Ot(),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 m=vt.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 m.length>0&&(r=!1),s.catch(function(t){throw i(),t}).then(function(){return i(),Promise.all(l.concat(m)).catch(function(n){throw t.forEach(function(t){return t.reject(n)}),n}).then(function(){return o(!1)})})}):Promise.resolve().then(function(){var t=Ot().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(St=!1,jt.length>0){var c=jt;jt=[],xt(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 _t=!1;function Dt(){_t=!0,xt()}setTimeout(function(){_t||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 Ut={getRawAppData:function(){return[].concat(vt)},reroute:xt,NOT_LOADED:l,toLoadPromise:Y,toBootstrapPromise:q};window&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=Ut);export{d as BOOTSTRAPPING,m as LOADING_SOURCE_CODE,w as MOUNTED,v as MOUNTING,p 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,Pt as checkActivityFunctions,bt as declareChildApplication,ft as ensureJQuerySupport,gt as getAppNames,yt as getAppStatus,wt as getMountedApps,Q as mountRootParcel,nt as navigateToUrl,Et as registerApplication,s as removeErrorHandler,D as setBootstrapMaxTime,U as setMountMaxTime,L as setUnloadMaxTime,C as setUnmountMaxTime,Dt as start,xt as triggerAppChange,At as unloadApplication,Tt as unloadChildApplication};
//# 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 jt},get ensureJQuerySupport(){return lt},get setBootstrapMaxTime(){return j},get setMountMaxTime(){return C},get setUnmountMaxTime(){return M},get setUnloadMaxTime(){return I},get registerApplication(){return Ot},get getMountedApps(){return gt},get getAppStatus(){return bt},get unloadApplication(){return Nt},get checkActivityFunctions(){return Tt},get getAppNames(){return yt},get declareChildApplication(){return Et},get unloadChildApplication(){return At},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="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 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 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}))})}var K=!1,F=!1;function H(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Promise.resolve().then(function(){return t.status!==v?t:(K||(window.dispatchEvent(new r("single-spa:before-first-mount")),K=!0),L(t.mount(Y(t)),"Mounting application '".concat(t.name,"'"),t.timeouts.mount).then(function(){return t.status=g,F||(window.dispatchEvent(new r("single-spa:first-mount")),F=!0),t}).catch(function(e){if(n){var r=l(e,t);throw t.status=O,r}return c(e,t),t.status=O,t}))})}function $(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 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 $(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 H(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,H(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=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 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 xt(),n};var ct=window.history.replaceState;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(){var t=ct.apply(this,arguments);return xt(),t},window.singleSpaNavigate=et;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){nt.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===p?(ht(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 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,c(e,t),t.status=O,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=p,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(T).map(x)}function yt(){return wt.map(x)}function bt(t){var n=G(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'),Ot(t,n,e)}function Ot(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!==yt().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");wt.push({name:t,loadImpl:r,activeWhen:e,status:p,parcels:{},devtools:{overlays:{options:{},selectors:[]}},customProps:i}),lt(),xt()}function Tt(t){for(var n=[],e=0;e<wt.length;e++)wt[e].activeWhen(t)&&n.push(wt[e].name);return n}function Pt(){return wt.filter(_).filter(N).filter(S)}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=G(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){$(t).then(dt).then(function(){n(),setTimeout(function(){xt()})}).catch(e)}var Ut=!1,_t=[];function xt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;if(Ut)return new Promise(function(t,e){_t.push({resolve:t,reject:e,eventArguments:n})});Ut=!0;var e=!0;return Dt?Promise.resolve().then(function(){window.dispatchEvent(new r("single-spa:before-routing-event",a()));var n=Object.keys(mt).map(function(t){return mt[t].app}).filter(P).map(dt),u=wt.filter(_).filter(T).filter(U).map($).map(function(t){return t.then(dt)}),c=u.concat(n);c.length>0&&(e=!1);var s=Promise.all(c),f=Pt(),l=f.map(function(t){return Z(t).then(W).then(function(t){return s.then(function(){return H(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 H(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=Pt().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=gt();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(Ut=!1,_t.length>0){var c=_t;_t=[],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 Dt=!1;function jt(){Dt=!0,xt()}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:xt,NOT_LOADED:p,toLoadPromise:Z,toBootstrapPromise:W};window&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=Ct),t.start=jt,t.ensureJQuerySupport=lt,t.setBootstrapMaxTime=j,t.setMountMaxTime=C,t.setUnmountMaxTime=M,t.setUnloadMaxTime=I,t.registerApplication=Ot,t.getMountedApps=gt,t.getAppStatus=bt,t.unloadApplication=Nt,t.checkActivityFunctions=Tt,t.getAppNames=yt,t.declareChildApplication=Et,t.unloadChildApplication=At,t.navigateToUrl=et,t.triggerAppChange=xt,t.addErrorHandler=s,t.removeErrorHandler=f,t.mountRootParcel=V,t.NOT_LOADED=p,t.LOADING_SOURCE_CODE=m,t.NOT_BOOTSTRAPPED=d,t.BOOTSTRAPPING=h,t.NOT_MOUNTED=v,t.MOUNTING=w,t.UPDATING=y,t.MOUNTED=g,t.UNMOUNTING=b,t.SKIP_BECAUSE_BROKEN=O,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 jt},get ensureJQuerySupport(){return lt},get setBootstrapMaxTime(){return j},get setMountMaxTime(){return C},get setUnmountMaxTime(){return M},get setUnloadMaxTime(){return I},get registerApplication(){return Ot},get getMountedApps(){return gt},get getAppStatus(){return bt},get unloadApplication(){return Nt},get checkActivityFunctions(){return Tt},get getAppNames(){return yt},get declareChildApplication(){return Et},get unloadChildApplication(){return At},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="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 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 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=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 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 xt(),n};var ct=window.history.replaceState;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(){var t=ct.apply(this,arguments);return xt(),t},window.singleSpaNavigate=et;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){nt.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===p?(ht(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 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,c(e,t),t.status=O,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=p,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(T).map(x)}function yt(){return wt.map(x)}function bt(t){var n=G(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'),Ot(t,n,e)}function Ot(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!==yt().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");wt.push({name:t,loadImpl:r,activeWhen:e,status:p,parcels:{},devtools:{overlays:{options:{},selectors:[]}},customProps:i}),lt(),xt()}function Tt(t){for(var n=[],e=0;e<wt.length;e++)wt[e].activeWhen(t)&&n.push(wt[e].name);return n}function Pt(){return wt.filter(_).filter(N).filter(S)}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=G(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){K(t).then(dt).then(function(){n(),setTimeout(function(){xt()})}).catch(e)}var Ut=!1,_t=[];function xt(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0;if(Ut)return new Promise(function(t,e){_t.push({resolve:t,reject:e,eventArguments:n})});Ut=!0;var e=!0;return Dt?Promise.resolve().then(function(){window.dispatchEvent(new r("single-spa:before-routing-event",a()));var n=Object.keys(mt).map(function(t){return mt[t].app}).filter(P).map(dt),u=wt.filter(_).filter(T).filter(U).map(K).map(function(t){return t.then(dt)}),c=u.concat(n);c.length>0&&(e=!1);var s=Promise.all(c),f=Pt(),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=Pt().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=gt();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(Ut=!1,_t.length>0){var c=_t;_t=[],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 Dt=!1;function jt(){Dt=!0,xt()}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:xt,NOT_LOADED:p,toLoadPromise:Z,toBootstrapPromise:W};window&&window.__SINGLE_SPA_DEVTOOLS__&&(window.__SINGLE_SPA_DEVTOOLS__.exposedMethods=Ct),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=Et,t.ensureJQuerySupport=lt,t.getAppNames=yt,t.getAppStatus=bt,t.getMountedApps=gt,t.mountRootParcel=V,t.navigateToUrl=et,t.registerApplication=Ot,t.removeErrorHandler=f,t.setBootstrapMaxTime=j,t.setMountMaxTime=C,t.setUnloadMaxTime=I,t.setUnmountMaxTime=M,t.start=jt,t.triggerAppChange=xt,t.unloadApplication=Nt,t.unloadChildApplication=At,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=single-spa.min.js.map
{
"name": "single-spa",
"version": "4.1.2",
"version": "4.2.0",
"description": "Multiple applications, one page",

@@ -8,3 +8,3 @@ "main": "lib/umd/single-spa.min.js",

"scripts": {
"build": "rollup -c --environment NODE_ENV:'production'",
"build": "yarn clean && rollup -c --environment NODE_ENV:'production'",
"build:dev": "rollup -c",

@@ -15,4 +15,4 @@ "build:analyze": "rollup -c --environment ANALYZER:'analyzer'",

"clean": "rm -rf lib",
"test": "BABEL_ENV=test jest",
"test:debug": "BABEL_ENV=test jest --watch",
"test": "BABEL_ENV=test jest --config jest.config.json",
"test:debug": "BABEL_ENV=test jest --config jest.config.json --watch",
"lint": "eslint src"

@@ -36,19 +36,19 @@ },

"devDependencies": {
"@babel/core": "^7.2.2",
"@babel/core": "^7.4.0",
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
"@babel/preset-env": "^7.2.3",
"@babel/preset-env": "^7.4.2",
"babel-eslint": "^10.0.1",
"babel-jest": "^24.1.0",
"babel-jest": "^24.5.0",
"babel-loader": "^8.0.4",
"babel-plugin-dynamic-import-node": "^2.2.0",
"custom-event": "^1.0.1",
"eslint": "5.11.1",
"eslint-config-canopy": "2.1.0",
"eslint": "5.15.3",
"eslint-config-canopy": "2.3.0",
"in-publish": "^2.0.0",
"jest": "^24.1.0",
"rollup": "^1.1.2",
"jest": "^24.5.0",
"rollup": "^1.7.3",
"rollup-plugin-analyzer": "^3.0.0",
"rollup-plugin-babel": "^4.3.2",
"rollup-plugin-commonjs": "^9.2.0",
"rollup-plugin-node-resolve": "^4.0.0",
"rollup-plugin-commonjs": "^9.2.2",
"rollup-plugin-node-resolve": "^4.0.1",
"rollup-plugin-terser": "^4.0.4"

@@ -55,0 +55,0 @@ },

@@ -42,6 +42,2 @@

- [CanopyTax](https://www.canopytax.com)
- [Dealer Socket](https://dealersocket.com/)
- [Beamery](https://beamery.com/)
## Contributing

@@ -48,0 +44,0 @@

@@ -44,3 +44,20 @@ import resolve from 'rollup-plugin-node-resolve'

]
}
},
{
input: './src/single-spa.js',
output: {
file: './lib/system/single-spa.min.js',
format: 'system',
sourcemap: true,
},
plugins: [
resolve(),
commonjs(),
babel({
exclude: 'node_modules/**'
}),
isProduction && (await import('rollup-plugin-terser')).terser(),
useAnalyzer && analyzer()
]
},
]))()

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

import { getProps } from './prop.helpers.js';
import { toUnmountPromise } from './unmount.js';

@@ -34,10 +35,19 @@ let beforeFirstMountFired = false;

.catch(err => {
if (!hardFail) {
handleAppError(err, appOrParcel);
appOrParcel.status = SKIP_BECAUSE_BROKEN;
return appOrParcel;
} else {
const transformedErr = transformErr(err, appOrParcel)
appOrParcel.status = SKIP_BECAUSE_BROKEN;
throw transformedErr
// If we fail to mount the appOrParcel, we should attempt to unmount it before putting in SKIP_BECAUSE_BROKEN
// We temporarily put the appOrParcel into MOUNTED status so that toUnmountPromise actually attempts to unmount it
// instead of just doing a no-op.
appOrParcel.status = MOUNTED
return toUnmountPromise(appOrParcel)
.then(setSkipBecauseBroken, setSkipBecauseBroken)
function setSkipBecauseBroken() {
if (!hardFail) {
handleAppError(err, appOrParcel);
appOrParcel.status = SKIP_BECAUSE_BROKEN;
return appOrParcel;
} else {
const transformedErr = transformErr(err, appOrParcel)
appOrParcel.status = SKIP_BECAUSE_BROKEN;
throw transformedErr
}
}

@@ -44,0 +54,0 @@ })

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