@haxtheweb/haxcms-nodejs
Version:
HAXcms single and multisite nodejs server, api, and administration
1 lines • 3.48 kB
JavaScript
!function(){function a(t,r,u){var s=t;if(s.state=r,s.stateData=u,0<s.onNextStateChange.length){var v=s.onNextStateChange.slice();s.onNextStateChange.length=0;for(var w=0,x=v;w<x.length;w++)(0,x[w])()}return s}function b(t){function d(){try{document.head.removeChild(s)}catch(t){}}var u=a(t,"Loading",void 0),s=document.createElement("script");return s.src=t.url,null!==t.crossorigin&&s.setAttribute("crossorigin",t.crossorigin),s.onload=function(){var t,s,v;void 0===r?(s=[],v=void 0):(s=(t=r())[0],v=t[1]),c(u,s,v),d()},s.onerror=function(){g(t,new TypeError("Failed to fetch "+t.url)),d()},document.head.appendChild(s),u}function c(t,r,u){var s=d(t,r);return a(t,"WaitingForTurn",{args:s[0],deps:s[1],moduleBody:u})}function d(t,r){for(var u,s=[],v=[],w=0,x=r;w<x.length;w++)if("exports"!==(u=x[w]))if("require"!==u)if("meta"!==u){var y=k(n(t.urlBase,u),t.crossorigin);s.push(y.exports),v.push(y),"Initialized"===y.state&&b(y)}else s.push({url:!0===t.isTopLevel?t.url.substring(0,t.url.lastIndexOf("#")):t.url});else s.push((function(r,u,s){var v=d(t,r),w=v[0];h(v[1],(function(){u&&u.apply(null,w)}),s)}));else s.push(t.exports);return[s,v]}function e(t){var r=a(t,"WaitingOnDeps",t.stateData);return h(t.stateData.deps,(function(){return function f(t){var r=t.stateData;if(null!=r.moduleBody)try{r.moduleBody.apply(null,r.args)}catch(r){return g(t,r)}return a(t,"Executed",void 0)}(r)}),(function(t){return g(r,t)})),r}function g(t,r){return!0===t.isTopLevel&&setTimeout((function(){throw r})),a(t,"Failed",r)}function h(t,r,u){var s=t.shift();return void 0===s?void(r&&r()):"WaitingOnDeps"===s.state?void h(t,r,u):void i(s,(function(){h(t,r,u)}),u)}function i(t,r,u){switch(t.state){case"WaitingForTurn":return e(t),void i(t,r,u);case"Failed":return void(u&&u(t.stateData));case"Executed":return void r();case"Loading":case"WaitingOnDeps":return void t.onNextStateChange.push((function(){return i(t,r,u)}));case"Initialized":throw new Error("All dependencies should be loading already before pressureDependencyToExecute is called.");default:throw new Error("Impossible module state: "+t.state)}}function j(t,r){switch(t.state){case"Executed":case"Failed":return void r();default:t.onNextStateChange.push((function(){return j(t,r)}))}}function k(r,u){void 0===u&&(u="anonymous");var s=t[r];return void 0===s&&(s=t[r]={url:r,urlBase:m(r),exports:Object.create(null),state:"Initialized",stateData:void 0,isTopLevel:!1,crossorigin:u,onNextStateChange:[]}),s}function m(t){return(t=(t=t.split("?")[0]).split("#")[0]).substring(0,t.lastIndexOf("/")+1)}function n(t,r){return-1===r.indexOf("://")?function l(t){return w.href=t,w.href}("/"===r[0]?r:t+r):r}function o(){return document.baseURI||(document.querySelector("base")||window.location).href}if(!window.define){var t=Object.create(null),r=void 0,u=0,s=void 0,v=o();window.define=function(t,w){var x=!1;r=function(){return x=!0,r=void 0,[t,w]};var y=function p(){var t=document.currentScript;if(!t)return v;if(window.HTMLImports){var r=window.HTMLImports.importForElement(t);return r?r.href:v}var u=t.ownerDocument.createElement("a");return u.href="",u.href}(),T=document.currentScript&&document.currentScript.getAttribute("crossorigin")||"anonymous";setTimeout((function(){if(0==x){r=void 0;var v=y+"#"+u++,D=k(v,T);D.isTopLevel=!0;var E=c(D,t,w);void 0===s?e(E):j(k(s),(function(){e(E)})),s=v}}),0)},window.define._reset=function(){for(var w in t)delete t[w];r=void 0,u=0,s=void 0,v=o()};var w=document.createElement("a")}}();