vscode/build/loader.min

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

11 lines
32 KiB
Plaintext
Raw Normal View History

2024-11-15 06:29:18 +00:00
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
"use strict";const _amdLoaderGlobal=this,_commonjsGlobal=typeof global=="object"?global:{};var AMDLoader;(function(d){d.global=_amdLoaderGlobal;class _{get isWindows(){return this._detect(),this._isWindows}get isNode(){return this._detect(),this._isNode}get isElectronRenderer(){return this._detect(),this._isElectronRenderer}get isWebWorker(){return this._detect(),this._isWebWorker}get isElectronNodeIntegrationWebWorker(){return this._detect(),this._isElectronNodeIntegrationWebWorker}constructor(){this._detected=!1,this._isWindows=!1,this._isNode=!1,this._isElectronRenderer=!1,this._isWebWorker=!1,this._isElectronNodeIntegrationWebWorker=!1}_detect(){this._detected||(this._detected=!0,this._isWindows=_._isWindows(),this._isNode=typeof module<"u"&&!!module.exports,this._isElectronRenderer=typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.electron<"u"&&process.type==="renderer",this._isWebWorker=typeof d.global.importScripts=="function",this._isElectronNodeIntegrationWebWorker=this._isWebWorker&&typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.electron<"u"&&process.type==="worker")}static _isWindows(){return typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.indexOf("Windows")>=0?!0:typeof process<"u"?process.platform==="win32":!1}}d.Environment=_})(AMDLoader||(AMDLoader={}));var AMDLoader;(function(d){class _{constructor(n,c,a){this.type=n,this.detail=c,this.timestamp=a}}d.LoaderEvent=_;class v{constructor(n){this._events=[new _(1,"",n)]}record(n,c){this._events.push(new _(n,c,d.Utilities.getHighPerformanceTimestamp()))}getEvents(){return this._events}}d.LoaderEventRecorder=v;class f{record(n,c){}getEvents(){return[]}}f.INSTANCE=new f,d.NullLoaderEventRecorder=f})(AMDLoader||(AMDLoader={}));var AMDLoader;(function(d){class _{static fileUriToFilePath(f,h){if(h=decodeURI(h).replace(/%23/g,"#"),f){if(/^file:\/\/\//.test(h))return h.substr(8);if(/^file:\/\//.test(h))return h.substr(5)}else if(/^file:\/\//.test(h))return h.substr(7);return h}static startsWith(f,h){return f.length>=h.length&&f.substr(0,h.length)===h}static endsWith(f,h){return f.length>=h.length&&f.substr(f.length-h.length)===h}static containsQueryString(f){return/^[^\#]*\?/gi.test(f)}static isAbsolutePath(f){return/^((http:\/\/)|(https:\/\/)|(file:\/\/)|(\/))/.test(f)}static forEachProperty(f,h){if(f){let n;for(n in f)f.hasOwnProperty(n)&&h(n,f[n])}}static isEmpty(f){let h=!0;return _.forEachProperty(f,()=>{h=!1}),h}static recursiveClone(f){if(!f||typeof f!="object"||f instanceof RegExp||!Array.isArray(f)&&Object.getPrototypeOf(f)!==Object.prototype)return f;let h=Array.isArray(f)?[]:{};return _.forEachProperty(f,(n,c)=>{c&&typeof c=="object"?h[n]=_.recursiveClone(c):h[n]=c}),h}static generateAnonymousModule(){return"===anonymous"+_.NEXT_ANONYMOUS_ID+++"==="}static isAnonymousModule(f){return _.startsWith(f,"===anonymous")}static getHighPerformanceTimestamp(){return this.PERFORMANCE_NOW_PROBED||(this.PERFORMANCE_NOW_PROBED=!0,this.HAS_PERFORMANCE_NOW=d.global.performance&&typeof d.global.performance.now=="function"),this.HAS_PERFORMANCE_NOW?d.global.performance.now():Date.now()}}_.NEXT_ANONYMOUS_ID=1,_.PERFORMANCE_NOW_PROBED=!1,_.HAS_PERFORMANCE_NOW=!1,d.Utilities=_})(AMDLoader||(AMDLoader={}));var AMDLoader;(function(d){function _(h){if(h instanceof Error)return h;const n=new Error(h.message||String(h)||"Unknown Error");return h.stack&&(n.stack=h.stack),n}d.ensureError=_;class v{static validateConfigurationOptions(n){function c(a){if(a.phase==="loading"){console.error('Loading "'+a.moduleId+'" failed'),console.error(a),console.error("Here are the modules that depend on it:"),console.error(a.neededBy);return}if(a.phase==="factory"){console.error('The factory function of "'+a.moduleId+'" has thrown an exception'),console.error(a),console.error("Here are the modules that depend on it:"),console.error(a.neededBy);return}}if(n=n||{},typeof n.baseUrl!="string"&&(n.baseUrl=""),typeof n.isBuild!="boolean"&&(n.isBuild=!1),typeof n.paths!="object"&&(n.paths={}),typeof n.config!="object"&&(n.config={}),typeof n.
//# sourceURL=${i}`,(o?self.eval(o.createScript("",l)):new Function(l)).call(self),s()}).then(void 0,r);return}try{o&&(i=o.createScriptURL(i)),importScripts(i),s()}catch(l){r(l)}}}}class n{constructor(e){this._env=e,this._didInitialize=!1,this._didPatchNodeRequire=!1}_init(e){this._didInitialize||(this._didInitialize=!0,this._fs=e("fs"),this._vm=e("vm"),this._path=e("path"),this._crypto=e("crypto"))}_initNodeRequire(e,i){const{nodeCachedData:s}=i.getConfig().getOptionsLiteral();if(!s||this._didPatchNodeRequire)return;this._didPatchNodeRequire=!0;const r=this,o=e("module");function u(l){const g=l.constructor;let p=function(y){try{return l.require(y)}finally{}};return p.resolve=function(y,E){return g._resolveFilename(y,l,!1,E)},p.resolve.paths=function(y){return g._resolveLookupPaths(y,l)},p.main=process.mainModule,p.extensions=g._extensions,p.cache=g._cache,p}o.prototype._compile=function(l,g){const p=o.wrap(l.replace(/^#!.*/,"")),m=i.getRecorder(),y=r._getCachedDataPath(s,g),E={filename:g};let R;try{const x=r._fs.readFileSync(y);R=x.slice(0,16),E.cachedData=x.slice(16),m.record(60,y)}catch{m.record(61,y)}const C=new r._vm.Script(p,E),I=C.runInThisContext(E),w=r._path.dirname(g),b=u(this),U=[this.exports,b,this,g,w,process,_commonjsGlobal,Buffer],P=I.apply(this.exports,U);return r._handleCachedData(C,p,y,!E.cachedData,i),r._verifyCachedData(C,p,y,R,i),P}}load(e,i,s,r){const o=e.getConfig().getOptionsLiteral(),u=c(e.getRecorder(),o.nodeRequire||d.global.nodeRequire),l=o.nodeInstrumenter||function(p){return p};this._init(u),this._initNodeRequire(u,e);let g=e.getRecorder();if(/^node\|/.test(i)){let p=i.split("|"),m=null;try{m=u(p[1])}catch(y){r(y);return}e.enqueueDefineAnonymousModule([],()=>m),s()}else{i=d.Utilities.fileUriToFilePath(this._env.isWindows,i);const p=this._path.normalize(i),m=this._getElectronRendererScriptPathOrUri(p),y=!!o.nodeCachedData,E=y?this._getCachedDataPath(o.nodeCachedData,i):void 0;this._readSourceAndCachedData(p,E,g,(R,C,I,w)=>{if(R){r(R);return}let b;C.charCodeAt(0)===n._BOM?b=n._PREFIX+C.substring(1)+n._SUFFIX:b=n._PREFIX+C+n._SUFFIX,b=l(b,p);const U={filename:m,cachedData:I},P=this._createAndEvalScript(e,b,U,s,r);this._handleCachedData(P,b,E,y&&!I,e),this._verifyCachedData(P,b,E,w,e)})}}_createAndEvalScript(e,i,s,r,o){const u=e.getRecorder();u.record(31,s.filename);const l=new this._vm.Script(i,s),g=l.runInThisContext(s),p=e.getGlobalAMDDefineFunc();let m=!1;const y=function(){return m=!0,p.apply(null,arguments)};return y.amd=p.amd,g.call(d.global,e.getGlobalAMDRequireFunc(),y,s.filename,this._path.dirname(s.filename)),u.record(32,s.filename),m?r():o(new Error(`Didn't receive define call in ${s.filename}!`)),l}_getElectronRendererScriptPathOrUri(e){if(!this._env.isElectronRenderer)return e;let i=e.match(/^([a-z])\:(.*)/i);return i?`file:///${(i[1].toUpperCase()+":"+i[2]).replace(/\\/g,"/")}`:`file://${e}`}_getCachedDataPath(e,i){const s=this._crypto.createHash("md5").update(i,"utf8").update(e.seed,"utf8").update(process.arch,"").digest("hex"),r=this._path.basename(i).replace(/\.js$/,"");return this._path.join(e.path,`${r}-${s}.code`)}_handleCachedData(e,i,s,r,o){e.cachedDataRejected?this._fs.unlink(s,u=>{o.getRecorder().record(62,s),this._createAndWriteCachedData(e,i,s,o),u&&o.getConfig().onError(u)}):r&&this._createAndWriteCachedData(e,i,s,o)}_createAndWriteCachedData(e,i,s,r){let o=Math.ceil(r.getConfig().getOptionsLiteral().nodeCachedData.writeDelay*(1+Math.random())),u=-1,l=0,g;const p=()=>{setTimeout(()=>{g||(g=this._crypto.createHash("md5").update(i,"utf8").digest());const m=e.createCachedData();if(!(m.length===0||m.length===u||l>=5)){if(m.length<u){p();return}u=m.length,this._fs.writeFile(s,Buffer.concat([g,m]),y=>{y&&r.getConfig().onError(y),r.getRecorder().record(63,s),p()})}},o*Math.pow(4,l++))};p()}_readSourceAndCachedData(e,i,s,r){if(!i)this._fs.readFile(e,{encoding:"utf8"},r);else{let o,u,l,g=2;const p=m=>{m?r(m):--g===0&&r(void 0,o,u,l)};this._fs.readFile(e,{encoding:"utf8"},(m,y)=>{o=y,p(m)}),this._fs.readFile(i,(m,y)=>{!m&&y&&y.length>0?(l=y.slice(0,16),u=y.slice(16),s.record(6
});`;function c(t,e){if(e.__$__isRecorded)return e;const i=function(r){t.record(33,r);try{return e(r)}finally{t.record(34,r)}};return i.__$__isRecorded=!0,i}d.ensureRecordedNodeRequire=c;function a(t){return new _(t)}d.createScriptLoader=a})(AMDLoader||(AMDLoader={}));var AMDLoader;(function(d){class _{constructor(t){let e=t.lastIndexOf("/");e!==-1?this.fromModulePath=t.substr(0,e+1):this.fromModulePath=""}static _normalizeModuleId(t){let e=t,i;for(i=/\/\.\//;i.test(e);)e=e.replace(i,"/");for(e=e.replace(/^\.\//g,""),i=/\/(([^\/])|([^\/][^\/\.])|([^\/\.][^\/])|([^\/][^\/][^\/]+))\/\.\.\//;i.test(e);)e=e.replace(i,"/");return e=e.replace(/^(([^\/])|([^\/][^\/\.])|([^\/\.][^\/])|([^\/][^\/][^\/]+))\/\.\.\//,""),e}resolveModule(t){let e=t;return d.Utilities.isAbsolutePath(e)||(d.Utilities.startsWith(e,"./")||d.Utilities.startsWith(e,"../"))&&(e=_._normalizeModuleId(this.fromModulePath+e)),e}}_.ROOT=new _(""),d.ModuleIdResolver=_;class v{constructor(t,e,i,s,r,o){this.id=t,this.strId=e,this.dependencies=i,this._callback=s,this._errorback=r,this.moduleIdResolver=o,this.exports={},this.error=null,this.exportsPassedIn=!1,this.unresolvedDependenciesCount=this.dependencies.length,this._isComplete=!1}static _safeInvokeFunction(t,e){try{return{returnedValue:t.apply(d.global,e),producedError:null}}catch(i){return{returnedValue:null,producedError:i}}}static _invokeFactory(t,e,i,s){return t.shouldInvokeFactory(e)?t.shouldCatchError()?this._safeInvokeFunction(i,s):{returnedValue:i.apply(d.global,s),producedError:null}:{returnedValue:null,producedError:null}}complete(t,e,i,s){this._isComplete=!0;let r=null;if(this._callback)if(typeof this._callback=="function"){t.record(21,this.strId);let o=v._invokeFactory(e,this.strId,this._callback,i);r=o.producedError,t.record(22,this.strId),!r&&typeof o.returnedValue<"u"&&(!this.exportsPassedIn||d.Utilities.isEmpty(this.exports))&&(this.exports=o.returnedValue)}else this.exports=this._callback;if(r){let o=d.ensureError(r);o.phase="factory",o.moduleId=this.strId,o.neededBy=s(this.id),this.error=o,e.onError(o)}this.dependencies=null,this._callback=null,this._errorback=null,this.moduleIdResolver=null}onDependencyError(t){return this._isComplete=!0,this.error=t,this._errorback?(this._errorback(t),!0):!1}isComplete(){return this._isComplete}}d.Module=v;class f{constructor(){this._nextId=0,this._strModuleIdToIntModuleId=new Map,this._intModuleIdToStrModuleId=[],this.getModuleId("exports"),this.getModuleId("module"),this.getModuleId("require")}getMaxModuleId(){return this._nextId}getModuleId(t){let e=this._strModuleIdToIntModuleId.get(t);return typeof e>"u"&&(e=this._nextId++,this._strModuleIdToIntModuleId.set(t,e),this._intModuleIdToStrModuleId[e]=t),e}getStrModuleId(t){return this._intModuleIdToStrModuleId[t]}}class h{constructor(t){this.id=t}}h.EXPORTS=new h(0),h.MODULE=new h(1),h.REQUIRE=new h(2),d.RegularDependency=h;class n{constructor(t,e,i){this.id=t,this.pluginId=e,this.pluginParam=i}}d.PluginDependency=n;class c{constructor(t,e,i,s,r=0){this._env=t,this._scriptLoader=e,this._loaderAvailableTimestamp=r,this._defineFunc=i,this._requireFunc=s,this._moduleIdProvider=new f,this._config=new d.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=[],this._requireFunc.moduleManager=this}reset(){return new c(this._env,this._scriptLoader,this._defineFunc,this._requireFunc,this._loaderAvailableTimestamp)}getGlobalAMDDefineFunc(){return this._defineFunc}getGlobalAMDRequireFunc(){return this._requireFunc}static _findRelevantLocationInStack(t,e){let i=o=>o.replace(/\\/g,"/"),s=i(t),r=e.split(/\n/);for(let o=0;o<r.length;o++){let u=r[o].match(/(.*):(\d+):(\d+)\)?$/);if(u){let l=u[1],g=u[2],p=u[3],m=Math.max(l.lastIndexOf(" ")+1,l.lastIndexOf("(")+1);if(l=l.substr(m),l=i(l),l===s){let y={line:parseInt(g,10),col:parseInt(p,10)};return y.line===1&&(y.col-=53),y}}}thro
`)),t.unresolvedDependenciesCount--;continue}if(this._inverseDependencies2[r.id]=this._inverseDependencies2[r.id]||[],this._inverseDependencies2[r.id].push(t.id),r instanceof n){let u=this._modules2[r.pluginId];if(u&&u.isComplete()){this._loadPluginDependency(u.exports,r);continue}let l=this._inversePluginDependencies2.get(r.pluginId);l||(l=[],this._inversePluginDependencies2.set(r.pluginId,l)),l.push(r),this._loadModule(r.pluginId);continue}this._loadModule(r.id)}t.unresolvedDependenciesCount===0&&this._onModuleComplete(t)}_onModuleComplete(t){let e=this.getRecorder();if(t.isComplete())return;let i=t.dependencies,s=[];if(i)for(let l=0,g=i.length;l<g;l++){let p=i[l];if(p===h.EXPORTS){s[l]=t.exports;continue}if(p===h.MODULE){s[l]={id:t.strId,config:()=>this._config.getConfigForModule(t.strId)};continue}if(p===h.REQUIRE){s[l]=this._createRequire(t.moduleIdResolver);continue}let m=this._modules2[p.id];if(m){s[l]=m.exports;continue}s[l]=null}const r=l=>(this._inverseDependencies2[l]||[]).map(g=>this._moduleIdProvider.getStrModuleId(g));t.complete(e,this._config,s,r);let o=this._inverseDependencies2[t.id];if(this._inverseDependencies2[t.id]=null,o)for(let l=0,g=o.length;l<g;l++){let p=o[l],m=this._modules2[p];m.unresolvedDependenciesCount--,m.unresolvedDependenciesCount===0&&this._onModuleComplete(m)}let u=this._inversePluginDependencies2.get(t.id);if(u){this._inversePluginDependencies2.delete(t.id);for(let l=0,g=u.length;l<g;l++)this._loadPluginDependency(t.exports,u[l])}}}d.ModuleManager=c})(AMDLoader||(AMDLoader={}));var define,AMDLoader;(function(d){const _=new d.Environment;let v=null;const f=function(a,t,e){typeof a!="string"&&(e=t,t=a,a=null),(typeof t!="object"||!Array.isArray(t))&&(e=t,t=null),t||(t=["require","exports","module"]),a?v.defineModule(a,t,e,null,null):v.enqueueDefineAnonymousModule(t,e)};f.amd={jQuery:!0};const h=function(a,t=!1){v.configure(a,t)},n=function(){if(arguments.length===1){if(arguments[0]instanceof Object&&!Array.isArray(arguments[0])){h(arguments[0]);return}if(typeof arguments[0]=="string")return v.synchronousRequire(arguments[0])}if((arguments.length===2||arguments.length===3)&&Array.isArray(arguments[0])){v.defineModule(d.Utilities.generateAnonymousModule(),arguments[0],arguments[1],arguments[2],null);return}throw new Error("Unrecognized require call")};n.config=h,n.getConfig=function(){return v.getConfig().getOptionsLiteral()},n.reset=function(){v=v.reset()},n.getBuildInfo=function(){return v.getBuildInfo()},n.getStats=function(){return v.getLoaderEvents()},n.define=f;function c(){if(typeof d.global.require<"u"||typeof require<"u"){const a=d.global.require||require;if(typeof a=="function"&&typeof a.resolve=="function"){const t=d.ensureRecordedNodeRequire(v.getRecorder(),a);d.global.nodeRequire=t,n.nodeRequire=t,n.__$__nodeRequire=t}}_.isNode&&!_.isElectronRenderer&&!_.isElectronNodeIntegrationWebWorker?module.exports=n:(_.isElectronRenderer||(d.global.define=f),d.global.require=n)}d.init=c,(typeof d.global.define!="function"||!d.global.define.amd)&&(v=new d.ModuleManager(_,d.createScriptLoader(_),f,n,d.Utilities.getHighPerformanceTimestamp()),typeof d.global.require<"u"&&typeof d.global.require!="function"&&n.config(d.global.require),define=function(){return f.apply(null,arguments)},define.amd=f.amd,typeof doNotInitLoader>"u"&&c())})(AMDLoader||(AMDLoader={})),define("vs/css",["require","exports"],function(d,_){"use strict";Object.defineProperty(_,"__esModule",{value:!0}),_.load=v;function v(a,t,e,i){if(i=i||{},(i["vs/css"]||{}).disabled){e({});return}const r=t.toUrl(a+".css");f(a,r,()=>{e({})},o=>{typeof e.error=="function"&&e.error("Could not find "+r+".")})}function f(a,t,e,i){if(h(a,t)){e();return}n(a,t,e,i)}function h(a,t){const e=window.document.getElementsByTagName("link");for(let i=0,s=e.length;i<s;i++){const r=e[i].getAttribute("data-name"),o=e[i].getAttribute("href");if(r===a||o===t)return!0}return!1}function n(a,t,e,i){const s=document.createElement("link");s.setAttribute("rel","stylesheet"),s.setAttribute("type","text/css"),s.setAttribute("data-name",a),c(a,s,e,i),s.setAttrib
//# sourceMappingURL=https://main.vscode-cdn.net/sourcemaps/336db9ece67f682159078ea1b54212de7636d88a/core/vs/loader.js.map