yudao-dev/public/libs/monaco-editor/vs/loader.js

9 wiersze
31 KiB
JavaScript

2023-07-26 09:54:50 +08:00
/*!-----------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.23.0(82e8ea39fc101d639262435542c7d43bc20d8aa2)
* Released under the MIT license
* https://github.com/microsoft/vscode/blob/main/LICENSE.txt
*-----------------------------------------------------------*/"use strict";var _amdLoaderGlobal=this,_commonjsGlobal=typeof global=="object"?global:{},AMDLoader;(function(l){l.global=_amdLoaderGlobal;var E=function(){function h(){this._detected=!1,this._isWindows=!1,this._isNode=!1,this._isElectronRenderer=!1,this._isWebWorker=!1}return Object.defineProperty(h.prototype,"isWindows",{get:function(){return this._detect(),this._isWindows},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isNode",{get:function(){return this._detect(),this._isNode},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isElectronRenderer",{get:function(){return this._detect(),this._isElectronRenderer},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"isWebWorker",{get:function(){return this._detect(),this._isWebWorker},enumerable:!1,configurable:!0}),h.prototype._detect=function(){this._detected||(this._detected=!0,this._isWindows=h._isWindows(),this._isNode=typeof module!="undefined"&&!!module.exports,this._isElectronRenderer=typeof process!="undefined"&&typeof process.versions!="undefined"&&typeof process.versions.electron!="undefined"&&process.type==="renderer",this._isWebWorker=typeof l.global.importScripts=="function")},h._isWindows=function(){return typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.indexOf("Windows")>=0?!0:typeof process!="undefined"?process.platform==="win32":!1},h}();l.Environment=E})(AMDLoader||(AMDLoader={}));var AMDLoader;(function(l){var E=function(){function a(n,p,r){this.type=n,this.detail=p,this.timestamp=r}return a}();l.LoaderEvent=E;var h=function(){function a(n){this._events=[new E(1,"",n)]}return a.prototype.record=function(n,p){this._events.push(new E(n,p,l.Utilities.getHighPerformanceTimestamp()))},a.prototype.getEvents=function(){return this._events},a}();l.LoaderEventRecorder=h;var _=function(){function a(){}return a.prototype.record=function(n,p){},a.prototype.getEvents=function(){return[]},a.INSTANCE=new a,a}();l.NullLoaderEventRecorder=_})(AMDLoader||(AMDLoader={}));var AMDLoader;(function(l){var E=function(){function h(){}return h.fileUriToFilePath=function(_,a){if(a=decodeURI(a).replace(/%23/g,"#"),_){if(/^file:\/\/\//.test(a))return a.substr(8);if(/^file:\/\//.test(a))return a.substr(5)}else if(/^file:\/\//.test(a))return a.substr(7);return a},h.startsWith=function(_,a){return _.length>=a.length&&_.substr(0,a.length)===a},h.endsWith=function(_,a){return _.length>=a.length&&_.substr(_.length-a.length)===a},h.containsQueryString=function(_){return/^[^\#]*\?/gi.test(_)},h.isAbsolutePath=function(_){return/^((http:\/\/)|(https:\/\/)|(file:\/\/)|(\/))/.test(_)},h.forEachProperty=function(_,a){if(_){var n=void 0;for(n in _)_.hasOwnProperty(n)&&a(n,_[n])}},h.isEmpty=function(_){var a=!0;return h.forEachProperty(_,function(){a=!1}),a},h.recursiveClone=function(_){if(!_||typeof _!="object"||_ instanceof RegExp||!Array.isArray(_)&&Object.getPrototypeOf(_)!==Object.prototype)return _;var a=Array.isArray(_)?[]:{};return h.forEachProperty(_,function(n,p){p&&typeof p=="object"?a[n]=h.recursiveClone(p):a[n]=p}),a},h.generateAnonymousModule=function(){return"===anonymous"+h.NEXT_ANONYMOUS_ID+++"==="},h.isAnonymousModule=function(_){return h.startsWith(_,"===anonymous")},h.getHighPerformanceTimestamp=function(){return this.PERFORMANCE_NOW_PROBED||(this.PERFORMANCE_NOW_PROBED=!0,this.HAS_PERFORMANCE_NOW=l.global.performance&&typeof l.global.performance.now=="function"),this.HAS_PERFORMANCE_NOW?l.global.performance.now():Date.now()},h.NEXT_ANONYMOUS_ID=1,h.PERFORMANCE_NOW_PROBED=!1,h.HAS_PERFORMANCE_NOW=!1,h}();l.Utilities=E})(AMDLoader||(AMDLoader={}));var AMDLoader;(function(l){function E(a){if(a instanceof Error)return a;var n=new Error(a.message||String(a)||"Unknown Error");return a.stack&&(n.stack=a.stack),n}l.ensureError=E;var h=function(){function a(){}return a.validateConfigurationOptions=function(n){function p(e){if(e.phase==="loading"){console.error('Loading "'+e.moduleId+'" failed'),console.error(e),console.error("Here are the modules t
});`,r}();function n(r,e){if(e.__$__isRecorded)return e;var t=function(o){r.record(33,o);try{return e(o)}finally{r.record(34,o)}};return t.__$__isRecorded=!0,t}l.ensureRecordedNodeRequire=n;function p(r){return new E(r)}l.createScriptLoader=p})(AMDLoader||(AMDLoader={}));var AMDLoader;(function(l){var E=function(){function r(e){var t=e.lastIndexOf("/");t!==-1?this.fromModulePath=e.substr(0,t+1):this.fromModulePath=""}return r._normalizeModuleId=function(e){var t=e,i;for(i=/\/\.\//;i.test(t);)t=t.replace(i,"/");for(t=t.replace(/^\.\//g,""),i=/\/(([^\/])|([^\/][^\/\.])|([^\/\.][^\/])|([^\/][^\/][^\/]+))\/\.\.\//;i.test(t);)t=t.replace(i,"/");return t=t.replace(/^(([^\/])|([^\/][^\/\.])|([^\/\.][^\/])|([^\/][^\/][^\/]+))\/\.\.\//,""),t},r.prototype.resolveModule=function(e){var t=e;return l.Utilities.isAbsolutePath(t)||(l.Utilities.startsWith(t,"./")||l.Utilities.startsWith(t,"../"))&&(t=r._normalizeModuleId(this.fromModulePath+t)),t},r.ROOT=new r(""),r}();l.ModuleIdResolver=E;var h=function(){function r(e,t,i,o,u,s){this.id=e,this.strId=t,this.dependencies=i,this._callback=o,this._errorback=u,this.moduleIdResolver=s,this.exports={},this.error=null,this.exportsPassedIn=!1,this.unresolvedDependenciesCount=this.dependencies.length,this._isComplete=!1}return r._safeInvokeFunction=function(e,t){try{return{returnedValue:e.apply(l.global,t),producedError:null}}catch(i){return{returnedValue:null,producedError:i}}},r._invokeFactory=function(e,t,i,o){return e.isBuild()&&!l.Utilities.isAnonymousModule(t)?{returnedValue:null,producedError:null}:e.shouldCatchError()?this._safeInvokeFunction(i,o):{returnedValue:i.apply(l.global,o),producedError:null}},r.prototype.complete=function(e,t,i){this._isComplete=!0;var o=null;if(this._callback)if(typeof this._callback=="function"){e.record(21,this.strId);var u=r._invokeFactory(t,this.strId,this._callback,i);o=u.producedError,e.record(22,this.strId),!o&&typeof u.returnedValue!="undefined"&&(!this.exportsPassedIn||l.Utilities.isEmpty(this.exports))&&(this.exports=u.returnedValue)}else this.exports=this._callback;if(o){var s=l.ensureError(o);s.phase="factory",s.moduleId=this.strId,this.error=s,t.onError(s)}this.dependencies=null,this._callback=null,this._errorback=null,this.moduleIdResolver=null},r.prototype.onDependencyError=function(e){return this._isComplete=!0,this.error=e,this._errorback?(this._errorback(e),!0):!1},r.prototype.isComplete=function(){return this._isComplete},r}();l.Module=h;var _=function(){function r(){this._nextId=0,this._strModuleIdToIntModuleId=new Map,this._intModuleIdToStrModuleId=[],this.getModuleId("exports"),this.getModuleId("module"),this.getModuleId("require")}return r.prototype.getMaxModuleId=function(){return this._nextId},r.prototype.getModuleId=function(e){var t=this._strModuleIdToIntModuleId.get(e);return typeof t=="undefined"&&(t=this._nextId++,this._strModuleIdToIntModuleId.set(e,t),this._intModuleIdToStrModuleId[t]=e),t},r.prototype.getStrModuleId=function(e){return this._intModuleIdToStrModuleId[e]},r}(),a=function(){function r(e){this.id=e}return r.EXPORTS=new r(0),r.MODULE=new r(1),r.REQUIRE=new r(2),r}();l.RegularDependency=a;var n=function(){function r(e,t,i){this.id=e,this.pluginId=t,this.pluginParam=i}return r}();l.PluginDependency=n;var p=function(){function r(e,t,i,o,u){u===void 0&&(u=0),this._env=e,this._scriptLoader=t,this._loaderAvailableTimestamp=u,this._defineFunc=i,this._requireFunc=o,this._moduleIdProvider=new _,this._config=new l.Configuration(this._env),this._hasDependencyCycle=!1,this._modules2=[],this._knownModules2=[],this._inverseDependencies2=[],this._inversePluginDependencies2=new Map,this._currentAnnonymousDefineCall=null,this._recorder=null,this._buildInfoPath=[],this._buildInfoDefineStack=[],this._buildInfoDependencies=[]}return r.prototype.reset=function(){return new r(this._env,this._scriptLoader,this._defineFunc,this._requireFunc,this._loaderAvailableTimestamp)},r.prototype.getGlobalAMDDefineFunc=function(){return this._defineFunc},r.prototype.getGlobalAMDRequireFunc=function(){return this._requireFunc},r._findRelevantLocationIn
`)),e.unresolvedDependenciesCount--;continue}if(this._inverseDependencies2[s.id]=this._inverseDependencies2[s.id]||[],this._inverseDependencies2[s.id].push(e.id),s instanceof n){var d=this._modules2[s.pluginId];if(d&&d.isComplete()){this._loadPluginDependency(d.exports,s);continue}var v=this._inversePluginDependencies2.get(s.pluginId);v||(v=[],this._inversePluginDependencies2.set(s.pluginId,v)),v.push(s),this._loadModule(s.pluginId);continue}this._loadModule(s.id)}e.unresolvedDependenciesCount===0&&this._onModuleComplete(e)},r.prototype._onModuleComplete=function(e){var t=this,i=this.getRecorder();if(!e.isComplete()){var o=e.dependencies,u=[];if(o)for(var s=0,f=o.length;s<f;s++){var c=o[s];if(c===a.EXPORTS){u[s]=e.exports;continue}if(c===a.MODULE){u[s]={id:e.strId,config:function(){return t._config.getConfigForModule(e.strId)}};continue}if(c===a.REQUIRE){u[s]=this._createRequire(e.moduleIdResolver);continue}var d=this._modules2[c.id];if(d){u[s]=d.exports;continue}u[s]=null}e.complete(i,this._config,u);var v=this._inverseDependencies2[e.id];if(this._inverseDependencies2[e.id]=null,v)for(var s=0,f=v.length;s<f;s++){var g=v[s],y=this._modules2[g];y.unresolvedDependenciesCount--,y.unresolvedDependenciesCount===0&&this._onModuleComplete(y)}var m=this._inversePluginDependencies2.get(e.id);if(m){this._inversePluginDependencies2.delete(e.id);for(var s=0,f=m.length;s<f;s++)this._loadPluginDependency(e.exports,m[s])}}},r}();l.ModuleManager=p})(AMDLoader||(AMDLoader={}));var define,AMDLoader;(function(l){var E=new l.Environment,h=null,_=function(r,e,t){typeof r!="string"&&(t=e,e=r,r=null),(typeof e!="object"||!Array.isArray(e))&&(t=e,e=null),e||(e=["require","exports","module"]),r?h.defineModule(r,e,t,null,null):h.enqueueDefineAnonymousModule(e,t)};_.amd={jQuery:!0};var a=function(r,e){e===void 0&&(e=!1),h.configure(r,e)},n=function(){if(arguments.length===1){if(arguments[0]instanceof Object&&!Array.isArray(arguments[0])){a(arguments[0]);return}if(typeof arguments[0]=="string")return h.synchronousRequire(arguments[0])}if((arguments.length===2||arguments.length===3)&&Array.isArray(arguments[0])){h.defineModule(l.Utilities.generateAnonymousModule(),arguments[0],arguments[1],arguments[2],null);return}throw new Error("Unrecognized require call")};n.config=a,n.getConfig=function(){return h.getConfig().getOptionsLiteral()},n.reset=function(){h=h.reset()},n.getBuildInfo=function(){return h.getBuildInfo()},n.getStats=function(){return h.getLoaderEvents()},n.define=function(){return _.apply(null,arguments)};function p(){if(typeof l.global.require!="undefined"||typeof require!="undefined"){var r=l.global.require||require;if(typeof r=="function"&&typeof r.resolve=="function"){var e=l.ensureRecordedNodeRequire(h.getRecorder(),r);l.global.nodeRequire=e,n.nodeRequire=e,n.__$__nodeRequire=e}}E.isNode&&!E.isElectronRenderer?(module.exports=n,require=n):(E.isElectronRenderer||(l.global.define=_),l.global.require=n)}l.init=p,(typeof l.global.define!="function"||!l.global.define.amd)&&(h=new l.ModuleManager(E,l.createScriptLoader(E),_,n,l.Utilities.getHighPerformanceTimestamp()),typeof l.global.require!="undefined"&&typeof l.global.require!="function"&&n.config(l.global.require),define=function(){return _.apply(null,arguments)},define.amd=_.amd,typeof doNotInitLoader=="undefined"&&p())})(AMDLoader||(AMDLoader={}));