@haxtheweb/haxcms-nodejs
Version:
HAXcms single and multisite nodejs server, api, and administration
7 lines • 32.4 kB
JavaScript
/*!-----------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.32.1(8ad5e3bceab16a4d0856c43a374b511dffb1e795)
* Released under the MIT license
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
*-----------------------------------------------------------*/
var t,l,f,p,m=this,M="object"==typeof global?global:{};!function(t){t.global=m;var l=function(){function v(){this._detected=!1,this._isWindows=!1,this._isNode=!1,this._isElectronRenderer=!1,this._isWebWorker=!1,this._isElectronNodeIntegrationWebWorker=!1}return Object.defineProperty(v.prototype,"isWindows",{get:function(){return this._detect(),this._isWindows},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"isNode",{get:function(){return this._detect(),this._isNode},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"isElectronRenderer",{get:function(){return this._detect(),this._isElectronRenderer},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"isWebWorker",{get:function(){return this._detect(),this._isWebWorker},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"isElectronNodeIntegrationWebWorker",{get:function(){return this._detect(),this._isElectronNodeIntegrationWebWorker},enumerable:!1,configurable:!0}),v.prototype._detect=function(){this._detected||(this._detected=!0,this._isWindows=v._isWindows(),this._isNode="undefined"!=typeof module&&!!module.exports,this._isElectronRenderer="undefined"!=typeof process&&void 0!==process.versions&&void 0!==process.versions.electron&&"renderer"===process.type,this._isWebWorker="function"==typeof t.global.importScripts,this._isElectronNodeIntegrationWebWorker=this._isWebWorker&&"undefined"!=typeof process&&void 0!==process.versions&&void 0!==process.versions.electron&&"worker"===process.type)},v._isWindows=function(){return!!("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.indexOf("Windows")>=0)||"undefined"!=typeof process&&"win32"===process.platform},v}();t.Environment=l}(p||(p={})),function(t){var l=function a(t,l,f){this.type=t,this.detail=l,this.timestamp=f};t.LoaderEvent=l;var f=function(){function a(t){this._events=[new l(1,"",t)]}return a.prototype.record=function(f,p){this._events.push(new l(f,p,t.Utilities.getHighPerformanceTimestamp()))},a.prototype.getEvents=function(){return this._events},a}();t.LoaderEventRecorder=f;var p=function(){function a(){}return a.prototype.record=function(t,l){},a.prototype.getEvents=function(){return[]},a.INSTANCE=new a,a}();t.NullLoaderEventRecorder=p}(p||(p={})),t=p||(p={}),l=function(){function v(){}return v.fileUriToFilePath=function(t,l){if(l=decodeURI(l).replace(/%23/g,"#"),t){if(/^file:\/\/\//.test(l))return l.substr(8);if(/^file:\/\//.test(l))return l.substr(5)}else if(/^file:\/\//.test(l))return l.substr(7);return l},v.startsWith=function(t,l){return t.length>=l.length&&t.substr(0,l.length)===l},v.endsWith=function(t,l){return t.length>=l.length&&t.substr(t.length-l.length)===l},v.containsQueryString=function(t){return/^[^\#]*\?/gi.test(t)},v.isAbsolutePath=function(t){return/^((http:\/\/)|(https:\/\/)|(file:\/\/)|(\/))/.test(t)},v.forEachProperty=function(t,l){if(t){var f=void 0;for(f in t)t.hasOwnProperty(f)&&l(f,t[f])}},v.isEmpty=function(t){var l=!0;return v.forEachProperty(t,(function(){l=!1})),l},v.recursiveClone=function(t){if(!t||"object"!=typeof t||t instanceof RegExp||!Array.isArray(t)&&Object.getPrototypeOf(t)!==Object.prototype)return t;var l=Array.isArray(t)?[]:{};return v.forEachProperty(t,(function(t,f){l[t]=f&&"object"==typeof f?v.recursiveClone(f):f})),l},v.generateAnonymousModule=function(){return"===anonymous"+v.NEXT_ANONYMOUS_ID+++"==="},v.isAnonymousModule=function(t){return v.startsWith(t,"===anonymous")},v.getHighPerformanceTimestamp=function(){return this.PERFORMANCE_NOW_PROBED||(this.PERFORMANCE_NOW_PROBED=!0,this.HAS_PERFORMANCE_NOW=t.global.performance&&"function"==typeof t.global.performance.now),this.HAS_PERFORMANCE_NOW?t.global.performance.now():Date.now()},v.NEXT_ANONYMOUS_ID=1,v.PERFORMANCE_NOW_PROBED=!1,v.HAS_PERFORMANCE_NOW=!1,v}(),t.Utilities=l,function(t){function E(t){if(t instanceof Error)return t;var l=new Error(t.message||String(t)||"Unknown Error");return t.stack&&(l.stack=t.stack),l}t.ensureError=E;var l=function(){function a(){}return a.validateConfigurationOptions=function(l){if("string"!=typeof(l=l||{}).baseUrl&&(l.baseUrl=""),"boolean"!=typeof l.isBuild&&(l.isBuild=!1),"object"!=typeof l.paths&&(l.paths={}),"object"!=typeof l.config&&(l.config={}),void 0===l.catchError&&(l.catchError=!1),void 0===l.recordStats&&(l.recordStats=!1),"string"!=typeof l.urlArgs&&(l.urlArgs=""),"function"!=typeof l.onError&&(l.onError=function _(t){return"loading"===t.phase?(console.error('Loading "'+t.moduleId+'" failed'),console.error(t),console.error("Here are the modules that depend on it:"),void console.error(t.neededBy)):"factory"===t.phase?(console.error('The factory method of "'+t.moduleId+'" has thrown an exception'),void console.error(t)):void 0}),Array.isArray(l.ignoreDuplicateModules)||(l.ignoreDuplicateModules=[]),l.baseUrl.length>0&&(t.Utilities.endsWith(l.baseUrl,"/")||(l.baseUrl+="/")),"string"!=typeof l.cspNonce&&(l.cspNonce=""),void 0===l.preferScriptTags&&(l.preferScriptTags=!1),Array.isArray(l.nodeModules)||(l.nodeModules=[]),l.nodeCachedData&&"object"==typeof l.nodeCachedData&&("string"!=typeof l.nodeCachedData.seed&&(l.nodeCachedData.seed="seed"),("number"!=typeof l.nodeCachedData.writeDelay||l.nodeCachedData.writeDelay<0)&&(l.nodeCachedData.writeDelay=7e3),!l.nodeCachedData.path||"string"!=typeof l.nodeCachedData.path)){var f=E(new Error("INVALID cached data configuration, 'path' MUST be set"));f.phase="configuration",l.onError(f),l.nodeCachedData=void 0}return l},a.mergeConfigurationOptions=function(l,f){void 0===l&&(l=null),void 0===f&&(f=null);var p=t.Utilities.recursiveClone(f||{});return t.Utilities.forEachProperty(l,(function(l,f){"ignoreDuplicateModules"===l&&void 0!==p.ignoreDuplicateModules?p.ignoreDuplicateModules=p.ignoreDuplicateModules.concat(f):"paths"===l&&void 0!==p.paths?t.Utilities.forEachProperty(f,(function(t,l){return p.paths[t]=l})):"config"===l&&void 0!==p.config?t.Utilities.forEachProperty(f,(function(t,l){return p.config[t]=l})):p[l]=t.Utilities.recursiveClone(f)})),a.validateConfigurationOptions(p)},a}();t.ConfigurationOptionsUtil=l;var f=function(){function a(t,f){if(this._env=t,this.options=l.mergeConfigurationOptions(f),this._createIgnoreDuplicateModulesMap(),this._createNodeModulesMap(),this._createSortedPathsRules(),""===this.options.baseUrl){if(this.options.nodeRequire&&this.options.nodeRequire.main&&this.options.nodeRequire.main.filename&&this._env.isNode){var p=this.options.nodeRequire.main.filename,m=Math.max(p.lastIndexOf("/"),p.lastIndexOf("\\"));this.options.baseUrl=p.substring(0,m+1)}if(this.options.nodeMain&&this._env.isNode){p=this.options.nodeMain,m=Math.max(p.lastIndexOf("/"),p.lastIndexOf("\\"));this.options.baseUrl=p.substring(0,m+1)}}}return a.prototype._createIgnoreDuplicateModulesMap=function(){this.ignoreDuplicateModulesMap={};for(var t=0;t<this.options.ignoreDuplicateModules.length;t++)this.ignoreDuplicateModulesMap[this.options.ignoreDuplicateModules[t]]=!0},a.prototype._createNodeModulesMap=function(){this.nodeModulesMap=Object.create(null);for(var t=0,l=this.options.nodeModules;t<l.length;t++){var f=l[t];this.nodeModulesMap[f]=!0}},a.prototype._createSortedPathsRules=function(){var l=this;this.sortedPathsRules=[],t.Utilities.forEachProperty(this.options.paths,(function(t,f){Array.isArray(f)?l.sortedPathsRules.push({from:t,to:f}):l.sortedPathsRules.push({from:t,to:[f]})})),this.sortedPathsRules.sort((function(t,l){return l.from.length-t.from.length}))},a.prototype.cloneAndMerge=function(t){return new a(this._env,l.mergeConfigurationOptions(t,this.options))},a.prototype.getOptionsLiteral=function(){return this.options},a.prototype._applyPaths=function(l){for(var f,p=0,m=this.sortedPathsRules.length;p<m;p++)if(f=this.sortedPathsRules[p],t.Utilities.startsWith(l,f.from)){for(var M=[],I=0,b=f.to.length;I<b;I++)M.push(f.to[I]+l.substr(f.from.length));return M}return[l]},a.prototype._addUrlArgsToUrl=function(l){return t.Utilities.containsQueryString(l)?l+"&"+this.options.urlArgs:l+"?"+this.options.urlArgs},a.prototype._addUrlArgsIfNecessaryToUrl=function(t){return this.options.urlArgs?this._addUrlArgsToUrl(t):t},a.prototype._addUrlArgsIfNecessaryToUrls=function(t){if(this.options.urlArgs)for(var l=0,f=t.length;l<f;l++)t[l]=this._addUrlArgsToUrl(t[l]);return t},a.prototype.moduleIdToPaths=function(l){if(this._env.isNode&&(!0===this.nodeModulesMap[l]||this.options.amdModulesPattern instanceof RegExp&&!this.options.amdModulesPattern.test(l)))return this.isBuild()?["empty:"]:["node|"+l];var f,p=l;if(t.Utilities.endsWith(p,".js")||t.Utilities.isAbsolutePath(p))!t.Utilities.endsWith(p,".js")&&!t.Utilities.containsQueryString(p)&&(p+=".js"),f=[p];else for(var m=0,M=(f=this._applyPaths(p)).length;m<M;m++)this.isBuild()&&"empty:"===f[m]||(t.Utilities.isAbsolutePath(f[m])||(f[m]=this.options.baseUrl+f[m]),!t.Utilities.endsWith(f[m],".js")&&!t.Utilities.containsQueryString(f[m])&&(f[m]=f[m]+".js"));return this._addUrlArgsIfNecessaryToUrls(f)},a.prototype.requireToUrl=function(l){var f=l;return t.Utilities.isAbsolutePath(f)||(f=this._applyPaths(f)[0],t.Utilities.isAbsolutePath(f)||(f=this.options.baseUrl+f)),this._addUrlArgsIfNecessaryToUrl(f)},a.prototype.isBuild=function(){return this.options.isBuild},a.prototype.isDuplicateMessageIgnoredFor=function(t){return this.ignoreDuplicateModulesMap.hasOwnProperty(t)},a.prototype.getConfigForModule=function(t){if(this.options.config)return this.options.config[t]},a.prototype.shouldCatchError=function(){return this.options.catchError},a.prototype.shouldRecordStats=function(){return this.options.recordStats},a.prototype.onError=function(t){this.options.onError(t)},a}();t.Configuration=f}(p||(p={})),function(t){var l=function(){function e(t){this._env=t,this._scriptLoader=null,this._callbackMap={}}return e.prototype.load=function(t,l,M,I){var b=this;if(!this._scriptLoader)if(this._env.isWebWorker)this._scriptLoader=new p;else if(this._env.isElectronRenderer){var D=t.getConfig().getOptionsLiteral().preferScriptTags;this._scriptLoader=D?new f:new m(this._env)}else this._env.isNode?this._scriptLoader=new m(this._env):this._scriptLoader=new f;var R={callback:M,errorback:I};this._callbackMap.hasOwnProperty(l)?this._callbackMap[l].push(R):(this._callbackMap[l]=[R],this._scriptLoader.load(t,l,(function(){return b.triggerCallback(l)}),(function(t){return b.triggerErrorback(l,t)})))},e.prototype.triggerCallback=function(t){var l=this._callbackMap[t];delete this._callbackMap[t];for(var f=0;f<l.length;f++)l[f].callback()},e.prototype.triggerErrorback=function(t,l){var f=this._callbackMap[t];delete this._callbackMap[t];for(var p=0;p<f.length;p++)f[p].errorback(l)},e}(),f=function(){function e(){}return e.prototype.attachListeners=function(t,l,f){var o=function(){t.removeEventListener("load",u),t.removeEventListener("error",c)},u=function(t){o(),l()},c=function(t){o(),f(t)};t.addEventListener("load",u),t.addEventListener("error",c)},e.prototype.load=function(l,f,p,m){if(/^node\|/.test(f)){var M=l.getConfig().getOptionsLiteral(),I=_(l.getRecorder(),M.nodeRequire||t.global.nodeRequire),b=f.split("|"),D=null;try{D=I(b[1])}catch(t){return void m(t)}l.enqueueDefineAnonymousModule([],(function(){return D})),p()}else{var R=document.createElement("script");R.setAttribute("async","async"),R.setAttribute("type","text/javascript"),this.attachListeners(R,p,m);var C=l.getConfig().getOptionsLiteral().trustedTypesPolicy;C&&(f=C.createScriptURL(f)),R.setAttribute("src",f);var P=l.getConfig().getOptionsLiteral().cspNonce;P&&R.setAttribute("nonce",P),document.getElementsByTagName("head")[0].appendChild(R)}},e}();var p=function(){function e(){this._cachedCanUseEval=null}return e.prototype._canUseEval=function(t){return null===this._cachedCanUseEval&&(this._cachedCanUseEval=function g(t){var l=t.getConfig().getOptionsLiteral().trustedTypesPolicy;try{return(l?self.eval(l.createScript("","true")):new Function("true")).call(self),!0}catch{return!1}}(t)),this._cachedCanUseEval},e.prototype.load=function(l,f,p,m){if(/^node\|/.test(f)){var M=l.getConfig().getOptionsLiteral(),I=_(l.getRecorder(),M.nodeRequire||t.global.nodeRequire),b=f.split("|"),D=null;try{D=I(b[1])}catch(t){return void m(t)}l.enqueueDefineAnonymousModule([],(function(){return D})),p()}else{var R=l.getConfig().getOptionsLiteral().trustedTypesPolicy;if(!(/^((http:)|(https:)|(file:))/.test(f)&&f.substring(0,self.origin.length)!==self.origin)&&this._canUseEval(l))return void fetch(f).then((function(t){if(200!==t.status)throw new Error(t.statusText);return t.text()})).then((function(t){t=t+"\n//# sourceURL="+f,(R?self.eval(R.createScript("",t)):new Function(t)).call(self),p()})).then(void 0,m);try{R&&(f=R.createScriptURL(f)),importScripts(f),p()}catch(t){m(t)}}},e}(),m=function(){function e(t){this._env=t,this._didInitialize=!1,this._didPatchNodeRequire=!1}return e.prototype._init=function(t){this._didInitialize||(this._didInitialize=!0,this._fs=t("fs"),this._vm=t("vm"),this._path=t("path"),this._crypto=t("crypto"))},e.prototype._initNodeRequire=function(t,l){var f=l.getConfig().getOptionsLiteral().nodeCachedData;if(f&&!this._didPatchNodeRequire){this._didPatchNodeRequire=!0;var p=this,m=t("module");m.prototype._compile=function(t,I){var b,D=m.wrap(t.replace(/^#!.*/,"")),R=l.getRecorder(),C=p._getCachedDataPath(f,I),P={filename:I};try{var A=p._fs.readFileSync(C);b=A.slice(0,16),P.cachedData=A.slice(16),R.record(60,C)}catch{R.record(61,C)}var U=new p._vm.Script(D,P),w=U.runInThisContext(P),O=p._path.dirname(I),S=function c(t){var l=t.constructor,d=function(l){try{return t.require(l)}finally{}};return(d.resolve=function(f,p){return l._resolveFilename(f,t,!1,p)}).paths=function(f){return l._resolveLookupPaths(f,t)},d.main=process.mainModule,d.extensions=l._extensions,d.cache=l._cache,d}(this),k=[this.exports,S,this,I,O,process,M,Buffer],L=w.apply(this.exports,k);return p._handleCachedData(U,D,C,!P.cachedData,l),p._verifyCachedData(U,D,C,b,l),L}}},e.prototype.load=function(l,f,p,m){var M=this,I=l.getConfig().getOptionsLiteral(),b=_(l.getRecorder(),I.nodeRequire||t.global.nodeRequire),D=I.nodeInstrumenter||function(t){return t};this._init(b),this._initNodeRequire(b,l);var R=l.getRecorder();if(/^node\|/.test(f)){var C=f.split("|"),P=null;try{P=b(C[1])}catch(t){return void m(t)}l.enqueueDefineAnonymousModule([],(function(){return P})),p()}else{f=t.Utilities.fileUriToFilePath(this._env.isWindows,f);var A=this._path.normalize(f),U=this._getElectronRendererScriptPathOrUri(A),w=Boolean(I.nodeCachedData),O=w?this._getCachedDataPath(I.nodeCachedData,f):void 0;this._readSourceAndCachedData(A,O,R,(function(t,f,I,b){if(t)m(t);else{var R;R=f.charCodeAt(0)===e._BOM?e._PREFIX+f.substring(1)+e._SUFFIX:e._PREFIX+f+e._SUFFIX,R=D(R,A);var C={filename:U,cachedData:I},P=M._createAndEvalScript(l,R,C,p,m);M._handleCachedData(P,R,O,w&&!I,l),M._verifyCachedData(P,R,O,b,l)}}))}},e.prototype._createAndEvalScript=function(l,f,p,m,M){var I=l.getRecorder();I.record(31,p.filename);var b=new this._vm.Script(f,p),D=b.runInThisContext(p),R=l.getGlobalAMDDefineFunc(),C=!1,h=function(){return C=!0,R.apply(null,arguments)};return h.amd=R.amd,D.call(t.global,l.getGlobalAMDRequireFunc(),h,p.filename,this._path.dirname(p.filename)),I.record(32,p.filename),C?m():M(new Error("Didn't receive define call in "+p.filename+"!")),b},e.prototype._getElectronRendererScriptPathOrUri=function(t){if(!this._env.isElectronRenderer)return t;var l=t.match(/^([a-z])\:(.*)/i);return l?"file:///"+(l[1].toUpperCase()+":"+l[2]).replace(/\\/g,"/"):"file://"+t},e.prototype._getCachedDataPath=function(t,l){var f=this._crypto.createHash("md5").update(l,"utf8").update(t.seed,"utf8").update(process.arch,"").digest("hex"),p=this._path.basename(l).replace(/\.js$/,"");return this._path.join(t.path,p+"-"+f+".code")},e.prototype._handleCachedData=function(t,l,f,p,m){var M=this;t.cachedDataRejected?this._fs.unlink(f,(function(p){m.getRecorder().record(62,f),M._createAndWriteCachedData(t,l,f,m),p&&m.getConfig().onError(p)})):p&&this._createAndWriteCachedData(t,l,f,m)},e.prototype._createAndWriteCachedData=function(t,l,f,p){var m=this,M=Math.ceil(p.getConfig().getOptionsLiteral().nodeCachedData.writeDelay*(1+Math.random())),I=-1,b=0,D=void 0,y=function(){setTimeout((function(){D||(D=m._crypto.createHash("md5").update(l,"utf8").digest());var M=t.createCachedData();if(!(0===M.length||M.length===I||b>=5)){if(M.length<I)return void y();I=M.length,m._fs.writeFile(f,Buffer.concat([D,M]),(function(t){t&&p.getConfig().onError(t),p.getRecorder().record(63,f),y()}))}}),M*Math.pow(4,b++))};y()},e.prototype._readSourceAndCachedData=function(t,l,f,p){if(l){var m=void 0,M=void 0,I=void 0,b=2,d=function(t){t?p(t):0==--b&&p(void 0,m,M,I)};this._fs.readFile(t,{encoding:"utf8"},(function(t,l){m=l,d(t)})),this._fs.readFile(l,(function(t,p){!t&&p&&p.length>0?(I=p.slice(0,16),M=p.slice(16),f.record(60,l)):f.record(61,l),d()}))}else this._fs.readFile(t,{encoding:"utf8"},p)},e.prototype._verifyCachedData=function(t,l,f,p,m){var M=this;!p||t.cachedDataRejected||setTimeout((function(){var t=M._crypto.createHash("md5").update(l,"utf8").digest();p.equals(t)||(m.getConfig().onError(new Error("FAILED TO VERIFY CACHED DATA, deleting stale '"+f+"' now, but a RESTART IS REQUIRED")),M._fs.unlink(f,(function(t){t&&m.getConfig().onError(t)})))}),Math.ceil(5e3*(1+Math.random())))},e._BOM=65279,e._PREFIX="(function (require, define, __filename, __dirname) { ",e._SUFFIX="\n});",e}();function _(t,l){if(l.__$__isRecorded)return l;var r=function(f){t.record(33,f);try{return l(f)}finally{t.record(34,f)}};return r.__$__isRecorded=!0,r}t.ensureRecordedNodeRequire=_,t.createScriptLoader=function s(t){return new l(t)}}(p||(p={})),function(t){var l=function(){function s(t){var l=t.lastIndexOf("/");this.fromModulePath=-1!==l?t.substr(0,l+1):""}return s._normalizeModuleId=function(t){var l,f=t;for(l=/\/\.\//;l.test(f);)f=f.replace(l,"/");for(f=f.replace(/^\.\//g,""),l=/\/(([^\/])|([^\/][^\/\.])|([^\/\.][^\/])|([^\/][^\/][^\/]+))\/\.\.\//;l.test(f);)f=f.replace(l,"/");return f=f.replace(/^(([^\/])|([^\/][^\/\.])|([^\/\.][^\/])|([^\/][^\/][^\/]+))\/\.\.\//,"")},s.prototype.resolveModule=function(l){var f=l;return t.Utilities.isAbsolutePath(f)||(t.Utilities.startsWith(f,"./")||t.Utilities.startsWith(f,"../"))&&(f=s._normalizeModuleId(this.fromModulePath+f)),f},s.ROOT=new s(""),s}();t.ModuleIdResolver=l;var f=function(){function s(t,l,f,p,m,M){this.id=t,this.strId=l,this.dependencies=f,this._callback=p,this._errorback=m,this.moduleIdResolver=M,this.exports={},this.error=null,this.exportsPassedIn=!1,this.unresolvedDependenciesCount=this.dependencies.length,this._isComplete=!1}return s._safeInvokeFunction=function(l,f){try{return{returnedValue:l.apply(t.global,f),producedError:null}}catch(t){return{returnedValue:null,producedError:t}}},s._invokeFactory=function(l,f,p,m){return l.isBuild()&&!t.Utilities.isAnonymousModule(f)?{returnedValue:null,producedError:null}:l.shouldCatchError()?this._safeInvokeFunction(p,m):{returnedValue:p.apply(t.global,m),producedError:null}},s.prototype.complete=function(l,f,p){this._isComplete=!0;var m=null;if(this._callback)if("function"==typeof this._callback){l.record(21,this.strId);var M=s._invokeFactory(f,this.strId,this._callback,p);m=M.producedError,l.record(22,this.strId),!m&&void 0!==M.returnedValue&&(!this.exportsPassedIn||t.Utilities.isEmpty(this.exports))&&(this.exports=M.returnedValue)}else this.exports=this._callback;if(m){var I=t.ensureError(m);I.phase="factory",I.moduleId=this.strId,this.error=I,f.onError(I)}this.dependencies=null,this._callback=null,this._errorback=null,this.moduleIdResolver=null},s.prototype.onDependencyError=function(t){return this._isComplete=!0,this.error=t,!!this._errorback&&(this._errorback(t),!0)},s.prototype.isComplete=function(){return this._isComplete},s}();t.Module=f;var p=function(){function s(){this._nextId=0,this._strModuleIdToIntModuleId=new Map,this._intModuleIdToStrModuleId=[],this.getModuleId("exports"),this.getModuleId("module"),this.getModuleId("require")}return s.prototype.getMaxModuleId=function(){return this._nextId},s.prototype.getModuleId=function(t){var l=this._strModuleIdToIntModuleId.get(t);return void 0===l&&(l=this._nextId++,this._strModuleIdToIntModuleId.set(t,l),this._intModuleIdToStrModuleId[l]=t),l},s.prototype.getStrModuleId=function(t){return this._intModuleIdToStrModuleId[t]},s}(),m=function(){function s(t){this.id=t}return s.EXPORTS=new s(0),s.MODULE=new s(1),s.REQUIRE=new s(2),s}();t.RegularDependency=m;var M=function s(t,l,f){this.id=t,this.pluginId=l,this.pluginParam=f};t.PluginDependency=M;var I=function(){function s(l,f,m,M,I){void 0===I&&(I=0),this._env=l,this._scriptLoader=f,this._loaderAvailableTimestamp=I,this._defineFunc=m,this._requireFunc=M,this._moduleIdProvider=new p,this._config=new t.Configuration(this._env),this._hasDependencyCycle=!1,this._modules2=[],this._knownModules2=[],this._inverseDependencies2=[],this._inversePluginDependencies2=new Map,this._currentAnonymousDefineCall=null,this._recorder=null,this._buildInfoPath=[],this._buildInfoDefineStack=[],this._buildInfoDependencies=[]}return s.prototype.reset=function(){return new s(this._env,this._scriptLoader,this._defineFunc,this._requireFunc,this._loaderAvailableTimestamp)},s.prototype.getGlobalAMDDefineFunc=function(){return this._defineFunc},s.prototype.getGlobalAMDRequireFunc=function(){return this._requireFunc},s._findRelevantLocationInStack=function(t,l){for(var r=function(t){return t.replace(/\\/g,"/")},f=r(t),p=l.split(/\n/),m=0;m<p.length;m++){var M=p[m].match(/(.*):(\d+):(\d+)\)?$/);if(M){var I=M[1],b=M[2],D=M[3],R=Math.max(I.lastIndexOf(" ")+1,I.lastIndexOf("(")+1);if((I=r(I=I.substr(R)))===f){var C={line:parseInt(b,10),col:parseInt(D,10)};return 1===C.line&&(C.col-=53),C}}}throw new Error("Could not correlate define call site for needle "+t)},s.prototype.getBuildInfo=function(){if(!this._config.isBuild())return null;for(var t=[],l=0,f=0,p=this._modules2.length;f<p;f++){var m=this._modules2[f];if(m){var M=this._buildInfoPath[m.id]||null,I=this._buildInfoDefineStack[m.id]||null,b=this._buildInfoDependencies[m.id];t[l++]={id:m.strId,path:M,defineLocation:M&&I?s._findRelevantLocationInStack(M,I):null,dependencies:b,shim:null,exports:m.exports}}}return t},s.prototype.getRecorder=function(){return this._recorder||(this._config.shouldRecordStats()?this._recorder=new t.LoaderEventRecorder(this._loaderAvailableTimestamp):this._recorder=t.NullLoaderEventRecorder.INSTANCE),this._recorder},s.prototype.getLoaderEvents=function(){return this.getRecorder().getEvents()},s.prototype.enqueueDefineAnonymousModule=function(t,l){if(null!==this._currentAnonymousDefineCall)throw new Error("Can only have one anonymous define call per script file");var f=null;this._config.isBuild()&&(f=new Error("StackLocation").stack||null),this._currentAnonymousDefineCall={stack:f,dependencies:t,callback:l}},s.prototype.defineModule=function(t,p,m,M,I,b){var D=this;void 0===b&&(b=new l(t));var R=this._moduleIdProvider.getModuleId(t);if(this._modules2[R])this._config.isDuplicateMessageIgnoredFor(t)||console.warn("Duplicate definition of module '"+t+"'");else{var C=new f(R,t,this._normalizeDependencies(p,b),m,M,b);this._modules2[R]=C,this._config.isBuild()&&(this._buildInfoDefineStack[R]=I,this._buildInfoDependencies[R]=(C.dependencies||[]).map((function(t){return D._moduleIdProvider.getStrModuleId(t.id)}))),this._resolve(C)}},s.prototype._normalizeDependency=function(t,l){if("exports"===t)return m.EXPORTS;if("module"===t)return m.MODULE;if("require"===t)return m.REQUIRE;var f=t.indexOf("!");if(f>=0){var p=l.resolveModule(t.substr(0,f)),I=l.resolveModule(t.substr(f+1)),b=this._moduleIdProvider.getModuleId(p+"!"+I),D=this._moduleIdProvider.getModuleId(p);return new M(b,D,I)}return new m(this._moduleIdProvider.getModuleId(l.resolveModule(t)))},s.prototype._normalizeDependencies=function(t,l){for(var f=[],p=0,m=0,M=t.length;m<M;m++)f[p++]=this._normalizeDependency(t[m],l);return f},s.prototype._relativeRequire=function(l,f,p,m){if("string"==typeof f)return this.synchronousRequire(f,l);this.defineModule(t.Utilities.generateAnonymousModule(),f,p,m,null,l)},s.prototype.synchronousRequire=function(t,f){void 0===f&&(f=new l(t));var p=this._normalizeDependency(t,f),m=this._modules2[p.id];if(!m)throw new Error("Check dependency list! Synchronous require cannot resolve module '"+t+"'. This is the first mention of this module!");if(!m.isComplete())throw new Error("Check dependency list! Synchronous require cannot resolve module '"+t+"'. This module has not been resolved completely yet.");if(m.error)throw m.error;return m.exports},s.prototype.configure=function(l,f){var p=this._config.shouldRecordStats();this._config=f?new t.Configuration(this._env,l):this._config.cloneAndMerge(l),this._config.shouldRecordStats()&&!p&&(this._recorder=null)},s.prototype.getConfig=function(){return this._config},s.prototype._onLoad=function(t){if(null!==this._currentAnonymousDefineCall){var l=this._currentAnonymousDefineCall;this._currentAnonymousDefineCall=null,this.defineModule(this._moduleIdProvider.getStrModuleId(t),l.dependencies,l.callback,null,l.stack)}},s.prototype._createLoadError=function(l,f){var p=this,m=this._moduleIdProvider.getStrModuleId(l),M=(this._inverseDependencies2[l]||[]).map((function(t){return p._moduleIdProvider.getStrModuleId(t)})),I=t.ensureError(f);return I.phase="loading",I.moduleId=m,I.neededBy=M,I},s.prototype._onLoadError=function(t,l){var p=this._createLoadError(t,l);this._modules2[t]||(this._modules2[t]=new f(t,this._moduleIdProvider.getStrModuleId(t),[],(function(){}),null,null));for(var m=[],M=0,I=this._moduleIdProvider.getMaxModuleId();M<I;M++)m[M]=!1;var b=!1,D=[];for(D.push(t),m[t]=!0;D.length>0;){var R=D.shift(),C=this._modules2[R];C&&(b=C.onDependencyError(p)||b);var P=this._inverseDependencies2[R];if(P)for(M=0,I=P.length;M<I;M++){var A=P[M];m[A]||(D.push(A),m[A]=!0)}}b||this._config.onError(p)},s.prototype._hasDependencyPath=function(t,l){var f=this._modules2[t];if(!f)return!1;for(var p=[],m=0,M=this._moduleIdProvider.getMaxModuleId();m<M;m++)p[m]=!1;var I=[];for(I.push(f),p[t]=!0;I.length>0;){var b=I.shift().dependencies;if(b)for(m=0,M=b.length;m<M;m++){var D=b[m];if(D.id===l)return!0;var R=this._modules2[D.id];R&&!p[D.id]&&(p[D.id]=!0,I.push(R))}}return!1},s.prototype._findCyclePath=function(t,l,f){if(t===l||50===f)return[t];var p=this._modules2[t];if(!p)return null;var m=p.dependencies;if(m)for(var M=0,I=m.length;M<I;M++){var b=this._findCyclePath(m[M].id,l,f+1);if(null!==b)return b.push(t),b}return null},s.prototype._createRequire=function(l){var f=this,r=function(t,p,m){return f._relativeRequire(l,t,p,m)};return r.toUrl=function(t){return f._config.requireToUrl(l.resolveModule(t))},r.getStats=function(){return f.getLoaderEvents()},r.hasDependencyCycle=function(){return f._hasDependencyCycle},r.config=function(t,l){void 0===l&&(l=!1),f.configure(t,l)},r.__$__nodeRequire=t.global.nodeRequire,r},s.prototype._loadModule=function(t){var l=this;if(!this._modules2[t]&&!this._knownModules2[t]){this._knownModules2[t]=!0;var f=this._moduleIdProvider.getStrModuleId(t),p=this._config.moduleIdToPaths(f);this._env.isNode&&(-1===f.indexOf("/")||/^@[^\/]+\/[^\/]+$/.test(f))&&p.push("node|"+f);var m=-1,c=function(f){if(++m>=p.length)l._onLoadError(t,f);else{var M=p[m],I=l.getRecorder();if(l._config.isBuild()&&"empty:"===M)return l._buildInfoPath[t]=M,l.defineModule(l._moduleIdProvider.getStrModuleId(t),[],null,null,null),void l._onLoad(t);I.record(10,M),l._scriptLoader.load(l,M,(function(){l._config.isBuild()&&(l._buildInfoPath[t]=M),I.record(11,M),l._onLoad(t)}),(function(t){I.record(12,M),c(t)}))}};c(null)}},s.prototype._loadPluginDependency=function(t,f){var p=this;if(!this._modules2[f.id]&&!this._knownModules2[f.id]){this._knownModules2[f.id]=!0;var i=function(t){p.defineModule(p._moduleIdProvider.getStrModuleId(f.id),[],t,null,null)};i.error=function(t){p._config.onError(p._createLoadError(f.id,t))},t.load(f.pluginParam,this._createRequire(l.ROOT),i,this._config.getOptionsLiteral())}},s.prototype._resolve=function(t){var l=this,f=t.dependencies;if(f)for(var p=0,I=f.length;p<I;p++){var b=f[p];if(b!==m.EXPORTS)if(b!==m.MODULE)if(b!==m.REQUIRE){var D=this._modules2[b.id];if(D&&D.isComplete()){if(D.error)return void t.onDependencyError(D.error);t.unresolvedDependenciesCount--}else if(this._hasDependencyPath(b.id,t.id)){this._hasDependencyCycle=!0,console.warn("There is a dependency cycle between '"+this._moduleIdProvider.getStrModuleId(b.id)+"' and '"+this._moduleIdProvider.getStrModuleId(t.id)+"'. The cyclic path follows:");var R=this._findCyclePath(b.id,t.id,0)||[];R.reverse(),R.push(b.id),console.warn(R.map((function(t){return l._moduleIdProvider.getStrModuleId(t)})).join(" => \n")),t.unresolvedDependenciesCount--}else if(this._inverseDependencies2[b.id]=this._inverseDependencies2[b.id]||[],this._inverseDependencies2[b.id].push(t.id),b instanceof M){var C=this._modules2[b.pluginId];if(C&&C.isComplete()){this._loadPluginDependency(C.exports,b);continue}var P=this._inversePluginDependencies2.get(b.pluginId);P||(P=[],this._inversePluginDependencies2.set(b.pluginId,P)),P.push(b),this._loadModule(b.pluginId)}else this._loadModule(b.id)}else t.unresolvedDependenciesCount--;else t.unresolvedDependenciesCount--;else t.exportsPassedIn=!0,t.unresolvedDependenciesCount--}0===t.unresolvedDependenciesCount&&this._onModuleComplete(t)},s.prototype._onModuleComplete=function(t){var l=this,f=this.getRecorder();if(!t.isComplete()){var p=t.dependencies,M=[];if(p)for(var I=0,b=p.length;I<b;I++){var D=p[I];if(D!==m.EXPORTS)if(D!==m.MODULE)if(D!==m.REQUIRE){var R=this._modules2[D.id];M[I]=R?R.exports:null}else M[I]=this._createRequire(t.moduleIdResolver);else M[I]={id:t.strId,config:function(){return l._config.getConfigForModule(t.strId)}};else M[I]=t.exports}t.complete(f,this._config,M);var C=this._inverseDependencies2[t.id];if(this._inverseDependencies2[t.id]=null,C)for(I=0,b=C.length;I<b;I++){var P=C[I],A=this._modules2[P];A.unresolvedDependenciesCount--,0===A.unresolvedDependenciesCount&&this._onModuleComplete(A)}var U=this._inversePluginDependencies2.get(t.id);if(U){this._inversePluginDependencies2.delete(t.id);for(I=0,b=U.length;I<b;I++)this._loadPluginDependency(t.exports,U[I])}}},s}();t.ModuleManager=I}(p||(p={})),function(t){var l=new t.Environment,p=null,g=function(t,l,f){"string"!=typeof t&&(f=l,l=t,t=null),("object"!=typeof l||!Array.isArray(l))&&(f=l,l=null),l||(l=["require","exports","module"]),t?p.defineModule(t,l,f,null,null):p.enqueueDefineAnonymousModule(l,f)};g.amd={jQuery:!0};var a=function(t,l){void 0===l&&(l=!1),p.configure(t,l)},n=function(){if(1===arguments.length){if(arguments[0]instanceof Object&&!Array.isArray(arguments[0]))return void a(arguments[0]);if("string"==typeof arguments[0])return p.synchronousRequire(arguments[0])}if(2!==arguments.length&&3!==arguments.length||!Array.isArray(arguments[0]))throw new Error("Unrecognized require call");p.defineModule(t.Utilities.generateAnonymousModule(),arguments[0],arguments[1],arguments[2],null)};function _(){if(void 0!==t.global.require||"undefined"!=typeof require){var f=t.global.require||require;if("function"==typeof f&&"function"==typeof f.resolve){var m=t.ensureRecordedNodeRequire(p.getRecorder(),f);t.global.nodeRequire=m,n.nodeRequire=m,n.__$__nodeRequire=m}}!l.isNode||l.isElectronRenderer||l.isElectronNodeIntegrationWebWorker?(l.isElectronRenderer||(t.global.define=g),t.global.require=n):(module.exports=n,require=n)}n.config=a,n.getConfig=function(){return p.getConfig().getOptionsLiteral()},n.reset=function(){p=p.reset()},n.getBuildInfo=function(){return p.getBuildInfo()},n.getStats=function(){return p.getLoaderEvents()},n.define=g,t.init=_,("function"!=typeof t.global.define||!t.global.define.amd)&&(p=new t.ModuleManager(l,t.createScriptLoader(l),g,n,t.Utilities.getHighPerformanceTimestamp()),void 0!==t.global.require&&"function"!=typeof t.global.require&&n.config(t.global.require),f=function(){return g.apply(null,arguments)},f.amd=g.amd,"undefined"==typeof doNotInitLoader&&_())}(p||(p={}));