"use strict";
var __getOwnPropNames = Object.getOwnPropertyNames;
var __commonJS = (cb, mod) => function __require() {
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};

// out-build/bootstrap-node.js
var require_bootstrap_node = __commonJS({
  "out-build/bootstrap-node.js"(exports2, module2) {
    "use strict";
    var path2 = require("path");
    var fs = require("fs");
    var Module = require("module");
    Error.stackTraceLimit = 100;
    if (!process.env["VSCODE_HANDLES_SIGPIPE"]) {
      let didLogAboutSIGPIPE = false;
      process.on("SIGPIPE", () => {
        if (!didLogAboutSIGPIPE) {
          didLogAboutSIGPIPE = true;
          console.error(new Error(`Unexpected SIGPIPE`));
        }
      });
    }
    function setupCurrentWorkingDirectory() {
      try {
        if (typeof process.env["VSCODE_CWD"] !== "string") {
          process.env["VSCODE_CWD"] = process.cwd();
        }
        if (process.platform === "win32") {
          process.chdir(path2.dirname(process.execPath));
        }
      } catch (err) {
        console.error(err);
      }
    }
    setupCurrentWorkingDirectory();
    module2.exports.devInjectNodeModuleLookupPath = function(injectPath) {
      if (!process.env["VSCODE_DEV"]) {
        return;
      }
      if (!injectPath) {
        throw new Error("Missing injectPath");
      }
      const Module2 = require("node:module");
      const nodeModulesPath = path2.join(__dirname, "../node_modules");
      const originalResolveLookupPaths = Module2._resolveLookupPaths;
      Module2._resolveLookupPaths = function(moduleName, parent) {
        const paths = originalResolveLookupPaths(moduleName, parent);
        if (Array.isArray(paths)) {
          for (let i = 0, len = paths.length; i < len; i++) {
            if (paths[i] === nodeModulesPath) {
              paths.splice(i, 0, injectPath);
              break;
            }
          }
        }
        return paths;
      };
    };
    module2.exports.removeGlobalNodeJsModuleLookupPaths = function() {
      if (typeof process?.versions?.electron === "string") {
        return;
      }
      const Module2 = require("module");
      const globalPaths = Module2.globalPaths;
      const originalResolveLookupPaths = Module2._resolveLookupPaths;
      Module2._resolveLookupPaths = function(moduleName, parent) {
        const paths = originalResolveLookupPaths(moduleName, parent);
        if (Array.isArray(paths)) {
          let commonSuffixLength = 0;
          while (commonSuffixLength < paths.length && paths[paths.length - 1 - commonSuffixLength] === globalPaths[globalPaths.length - 1 - commonSuffixLength]) {
            commonSuffixLength++;
          }
          return paths.slice(0, paths.length - commonSuffixLength);
        }
        return paths;
      };
    };
    module2.exports.configurePortable = function(product2) {
      const appRoot = path2.dirname(__dirname);
      function getApplicationPath(path3) {
        if (process.env["VSCODE_DEV"]) {
          return appRoot;
        }
        if (process.platform === "darwin") {
          return path3.dirname(path3.dirname(path3.dirname(appRoot)));
        }
        return path3.dirname(path3.dirname(appRoot));
      }
      function getPortableDataPath(path3) {
        if (process.env["VSCODE_PORTABLE"]) {
          return process.env["VSCODE_PORTABLE"];
        }
        if (process.platform === "win32" || process.platform === "linux") {
          return path3.join(getApplicationPath(path3), "data");
        }
        const portableDataName = product2.portable || `${product2.applicationName}-portable-data`;
        return path3.join(path3.dirname(getApplicationPath(path3)), portableDataName);
      }
      const portableDataPath = getPortableDataPath(path2);
      const isPortable = !("target" in product2) && fs.existsSync(portableDataPath);
      const portableTempPath = path2.join(portableDataPath, "tmp");
      const isTempPortable = isPortable && fs.existsSync(portableTempPath);
      if (isPortable) {
        process.env["VSCODE_PORTABLE"] = portableDataPath;
      } else {
        delete process.env["VSCODE_PORTABLE"];
      }
      if (isTempPortable) {
        if (process.platform === "win32") {
          process.env["TMP"] = portableTempPath;
          process.env["TEMP"] = portableTempPath;
        } else {
          process.env["TMPDIR"] = portableTempPath;
        }
      }
      return {
        portableDataPath,
        isPortable
      };
    };
    module2.exports.enableASARSupport = function() {
      const NODE_MODULES_PATH = path2.join(__dirname, "../node_modules");
      const NODE_MODULES_ASAR_PATH = `${NODE_MODULES_PATH}.asar`;
      const originalResolveLookupPaths = Module._resolveLookupPaths;
      Module._resolveLookupPaths = function(request, parent) {
        const paths = originalResolveLookupPaths(request, parent);
        if (Array.isArray(paths)) {
          for (let i = 0, len = paths.length; i < len; i++) {
            if (paths[i] === NODE_MODULES_PATH) {
              paths.splice(i, 0, NODE_MODULES_ASAR_PATH);
              break;
            }
          }
        }
        return paths;
      };
    };
    module2.exports.fileUriFromPath = function(path3, config) {
      let pathName = path3.replace(/\\/g, "/");
      if (pathName.length > 0 && pathName.charAt(0) !== "/") {
        pathName = `/${pathName}`;
      }
      let uri;
      if (config.isWindows && pathName.startsWith("//")) {
        uri = encodeURI(`${config.scheme || "file"}:${pathName}`);
      } else {
        uri = encodeURI(`${config.scheme || "file"}://${config.fallbackAuthority || ""}${pathName}`);
      }
      return uri.replace(/#/g, "%23");
    };
  }
});

// out-build/bootstrap-meta.js
var require_bootstrap_meta = __commonJS({
  "out-build/bootstrap-meta.js"(exports2, module2) {
    "use strict";
    var productObj = { BUILD_INSERT_PRODUCT_CONFIGURATION: "BUILD_INSERT_PRODUCT_CONFIGURATION" };
    if (productObj["BUILD_INSERT_PRODUCT_CONFIGURATION"]) {
      productObj = require("../product.json");
    }
    var pkgObj = { BUILD_INSERT_PACKAGE_CONFIGURATION: "BUILD_INSERT_PACKAGE_CONFIGURATION" };
    if (pkgObj["BUILD_INSERT_PACKAGE_CONFIGURATION"]) {
      pkgObj = require("../package.json");
    }
    module2.exports.product = productObj;
    module2.exports.pkg = pkgObj;
  }
});

// out-build/vs/base/common/performance.js
var require_performance = __commonJS({
  "out-build/vs/base/common/performance.js"(exports2, module2) {
    "use strict";
    (function() {
      function _definePolyfillMarks(timeOrigin) {
        const _data = [];
        if (typeof timeOrigin === "number") {
          _data.push("code/timeOrigin", timeOrigin);
        }
        function mark(name) {
          _data.push(name, Date.now());
        }
        function getMarks() {
          const result = [];
          for (let i = 0; i < _data.length; i += 2) {
            result.push({
              name: _data[i],
              startTime: _data[i + 1]
            });
          }
          return result;
        }
        return { mark, getMarks };
      }
      function _define() {
        if (typeof performance === "object" && typeof performance.mark === "function" && !performance.nodeTiming) {
          if (typeof performance.timeOrigin !== "number" && !performance.timing) {
            return _definePolyfillMarks();
          } else {
            return {
              mark(name) {
                performance.mark(name);
              },
              getMarks() {
                let timeOrigin = performance.timeOrigin;
                if (typeof timeOrigin !== "number") {
                  timeOrigin = performance.timing.navigationStart || performance.timing.redirectStart || performance.timing.fetchStart;
                }
                const result = [{ name: "code/timeOrigin", startTime: Math.round(timeOrigin) }];
                for (const entry of performance.getEntriesByType("mark")) {
                  result.push({
                    name: entry.name,
                    startTime: Math.round(timeOrigin + entry.startTime)
                  });
                }
                return result;
              }
            };
          }
        } else if (typeof process === "object") {
          const timeOrigin = performance?.timeOrigin;
          return _definePolyfillMarks(timeOrigin);
        } else {
          console.trace("perf-util loaded in UNKNOWN environment");
          return _definePolyfillMarks();
        }
      }
      function _factory(sharedObj2) {
        if (!sharedObj2.MonacoPerformanceMarks) {
          sharedObj2.MonacoPerformanceMarks = _define();
        }
        return sharedObj2.MonacoPerformanceMarks;
      }
      var sharedObj;
      if (typeof global === "object") {
        sharedObj = global;
      } else if (typeof self === "object") {
        sharedObj = self;
      } else {
        sharedObj = {};
      }
      if (typeof define === "function") {
        define([], function() {
          return _factory(sharedObj);
        });
      } else if (typeof module2 === "object" && typeof module2.exports === "object") {
        module2.exports = _factory(sharedObj);
      } else {
        console.trace("perf-util defined in UNKNOWN context (neither requirejs or commonjs)");
        sharedObj.perf = _factory(sharedObj);
      }
    })();
  }
});

// out-build/vs/loader.js
var require_loader = __commonJS({
  "out-build/vs/loader.js"(exports2, module2) {
    "use strict";
    var _amdLoaderGlobal = exports2;
    var _commonjsGlobal = typeof global === "object" ? global : {};
    var AMDLoader;
    (function(AMDLoader2) {
      AMDLoader2.global = _amdLoaderGlobal;
      class Environment {
        get isWindows() {
          this._detect();
          return this._isWindows;
        }
        get isNode() {
          this._detect();
          return this._isNode;
        }
        get isElectronRenderer() {
          this._detect();
          return this._isElectronRenderer;
        }
        get isWebWorker() {
          this._detect();
          return this._isWebWorker;
        }
        get isElectronNodeIntegrationWebWorker() {
          this._detect();
          return this._isElectronNodeIntegrationWebWorker;
        }
        constructor() {
          this._detected = false;
          this._isWindows = false;
          this._isNode = false;
          this._isElectronRenderer = false;
          this._isWebWorker = false;
          this._isElectronNodeIntegrationWebWorker = false;
        }
        _detect() {
          if (this._detected) {
            return;
          }
          this._detected = true;
          this._isWindows = Environment._isWindows();
          this._isNode = typeof module2 !== "undefined" && !!module2.exports;
          this._isElectronRenderer = typeof process !== "undefined" && typeof process.versions !== "undefined" && typeof process.versions.electron !== "undefined" && process.type === "renderer";
          this._isWebWorker = typeof AMDLoader2.global.importScripts === "function";
          this._isElectronNodeIntegrationWebWorker = this._isWebWorker && (typeof process !== "undefined" && typeof process.versions !== "undefined" && typeof process.versions.electron !== "undefined" && process.type === "worker");
        }
        static _isWindows() {
          if (typeof navigator !== "undefined") {
            if (navigator.userAgent && navigator.userAgent.indexOf("Windows") >= 0) {
              return true;
            }
          }
          if (typeof process !== "undefined") {
            return process.platform === "win32";
          }
          return false;
        }
      }
      AMDLoader2.Environment = Environment;
    })(AMDLoader || (AMDLoader = {}));
    var AMDLoader;
    (function(AMDLoader2) {
      class LoaderEvent {
        constructor(type, detail, timestamp) {
          this.type = type;
          this.detail = detail;
          this.timestamp = timestamp;
        }
      }
      AMDLoader2.LoaderEvent = LoaderEvent;
      class LoaderEventRecorder {
        constructor(loaderAvailableTimestamp) {
          this._events = [new LoaderEvent(1, "", loaderAvailableTimestamp)];
        }
        record(type, detail) {
          this._events.push(new LoaderEvent(type, detail, AMDLoader2.Utilities.getHighPerformanceTimestamp()));
        }
        getEvents() {
          return this._events;
        }
      }
      AMDLoader2.LoaderEventRecorder = LoaderEventRecorder;
      class NullLoaderEventRecorder {
        record(type, detail) {
        }
        getEvents() {
          return [];
        }
      }
      NullLoaderEventRecorder.INSTANCE = new NullLoaderEventRecorder();
      AMDLoader2.NullLoaderEventRecorder = NullLoaderEventRecorder;
    })(AMDLoader || (AMDLoader = {}));
    var AMDLoader;
    (function(AMDLoader2) {
      class Utilities {
        /**
         * This method does not take care of / vs \
         */
        static fileUriToFilePath(isWindows, uri) {
          uri = decodeURI(uri).replace(/%23/g, "#");
          if (isWindows) {
            if (/^file:\/\/\//.test(uri)) {
              return uri.substr(8);
            }
            if (/^file:\/\//.test(uri)) {
              return uri.substr(5);
            }
          } else {
            if (/^file:\/\//.test(uri)) {
              return uri.substr(7);
            }
          }
          return uri;
        }
        static startsWith(haystack, needle) {
          return haystack.length >= needle.length && haystack.substr(0, needle.length) === needle;
        }
        static endsWith(haystack, needle) {
          return haystack.length >= needle.length && haystack.substr(haystack.length - needle.length) === needle;
        }
        // only check for "?" before "#" to ensure that there is a real Query-String
        static containsQueryString(url) {
          return /^[^\#]*\?/gi.test(url);
        }
        /**
         * Does `url` start with http:// or https:// or file:// or / ?
         */
        static isAbsolutePath(url) {
          return /^((http:\/\/)|(https:\/\/)|(file:\/\/)|(\/))/.test(url);
        }
        static forEachProperty(obj, callback) {
          if (obj) {
            let key;
            for (key in obj) {
              if (obj.hasOwnProperty(key)) {
                callback(key, obj[key]);
              }
            }
          }
        }
        static isEmpty(obj) {
          let isEmpty = true;
          Utilities.forEachProperty(obj, () => {
            isEmpty = false;
          });
          return isEmpty;
        }
        static recursiveClone(obj) {
          if (!obj || typeof obj !== "object" || obj instanceof RegExp) {
            return obj;
          }
          if (!Array.isArray(obj) && Object.getPrototypeOf(obj) !== Object.prototype) {
            return obj;
          }
          let result = Array.isArray(obj) ? [] : {};
          Utilities.forEachProperty(obj, (key, value) => {
            if (value && typeof value === "object") {
              result[key] = Utilities.recursiveClone(value);
            } else {
              result[key] = value;
            }
          });
          return result;
        }
        static generateAnonymousModule() {
          return "===anonymous" + Utilities.NEXT_ANONYMOUS_ID++ + "===";
        }
        static isAnonymousModule(id) {
          return Utilities.startsWith(id, "===anonymous");
        }
        static getHighPerformanceTimestamp() {
          if (!this.PERFORMANCE_NOW_PROBED) {
            this.PERFORMANCE_NOW_PROBED = true;
            this.HAS_PERFORMANCE_NOW = AMDLoader2.global.performance && typeof AMDLoader2.global.performance.now === "function";
          }
          return this.HAS_PERFORMANCE_NOW ? AMDLoader2.global.performance.now() : Date.now();
        }
      }
      Utilities.NEXT_ANONYMOUS_ID = 1;
      Utilities.PERFORMANCE_NOW_PROBED = false;
      Utilities.HAS_PERFORMANCE_NOW = false;
      AMDLoader2.Utilities = Utilities;
    })(AMDLoader || (AMDLoader = {}));
    var AMDLoader;
    (function(AMDLoader2) {
      function ensureError(err) {
        if (err instanceof Error) {
          return err;
        }
        const result = new Error(err.message || String(err) || "Unknown Error");
        if (err.stack) {
          result.stack = err.stack;
        }
        return result;
      }
      AMDLoader2.ensureError = ensureError;
      ;
      class ConfigurationOptionsUtil {
        /**
         * Ensure configuration options make sense
         */
        static validateConfigurationOptions(options) {
          function defaultOnError(err) {
            if (err.phase === "loading") {
              console.error('Loading "' + err.moduleId + '" failed');
              console.error(err);
              console.error("Here are the modules that depend on it:");
              console.error(err.neededBy);
              return;
            }
            if (err.phase === "factory") {
              console.error('The factory function of "' + err.moduleId + '" has thrown an exception');
              console.error(err);
              console.error("Here are the modules that depend on it:");
              console.error(err.neededBy);
              return;
            }
          }
          options = options || {};
          if (typeof options.baseUrl !== "string") {
            options.baseUrl = "";
          }
          if (typeof options.isBuild !== "boolean") {
            options.isBuild = false;
          }
          if (typeof options.paths !== "object") {
            options.paths = {};
          }
          if (typeof options.config !== "object") {
            options.config = {};
          }
          if (typeof options.catchError === "undefined") {
            options.catchError = false;
          }
          if (typeof options.recordStats === "undefined") {
            options.recordStats = false;
          }
          if (typeof options.urlArgs !== "string") {
            options.urlArgs = "";
          }
          if (typeof options.onError !== "function") {
            options.onError = defaultOnError;
          }
          if (!Array.isArray(options.ignoreDuplicateModules)) {
            options.ignoreDuplicateModules = [];
          }
          if (options.baseUrl.length > 0) {
            if (!AMDLoader2.Utilities.endsWith(options.baseUrl, "/")) {
              options.baseUrl += "/";
            }
          }
          if (typeof options.cspNonce !== "string") {
            options.cspNonce = "";
          }
          if (typeof options.preferScriptTags === "undefined") {
            options.preferScriptTags = false;
          }
          if (options.nodeCachedData && typeof options.nodeCachedData === "object") {
            if (typeof options.nodeCachedData.seed !== "string") {
              options.nodeCachedData.seed = "seed";
            }
            if (typeof options.nodeCachedData.writeDelay !== "number" || options.nodeCachedData.writeDelay < 0) {
              options.nodeCachedData.writeDelay = 1e3 * 7;
            }
            if (!options.nodeCachedData.path || typeof options.nodeCachedData.path !== "string") {
              const err = ensureError(new Error("INVALID cached data configuration, 'path' MUST be set"));
              err.phase = "configuration";
              options.onError(err);
              options.nodeCachedData = void 0;
            }
          }
          return options;
        }
        static mergeConfigurationOptions(overwrite = null, base = null) {
          let result = AMDLoader2.Utilities.recursiveClone(base || {});
          AMDLoader2.Utilities.forEachProperty(overwrite, (key, value) => {
            if (key === "ignoreDuplicateModules" && typeof result.ignoreDuplicateModules !== "undefined") {
              result.ignoreDuplicateModules = result.ignoreDuplicateModules.concat(value);
            } else if (key === "paths" && typeof result.paths !== "undefined") {
              AMDLoader2.Utilities.forEachProperty(value, (key2, value2) => result.paths[key2] = value2);
            } else if (key === "config" && typeof result.config !== "undefined") {
              AMDLoader2.Utilities.forEachProperty(value, (key2, value2) => result.config[key2] = value2);
            } else {
              result[key] = AMDLoader2.Utilities.recursiveClone(value);
            }
          });
          return ConfigurationOptionsUtil.validateConfigurationOptions(result);
        }
      }
      AMDLoader2.ConfigurationOptionsUtil = ConfigurationOptionsUtil;
      class Configuration {
        constructor(env, options) {
          this._env = env;
          this.options = ConfigurationOptionsUtil.mergeConfigurationOptions(options);
          this._createIgnoreDuplicateModulesMap();
          this._createSortedPathsRules();
          if (this.options.baseUrl === "") {
            if (this.options.nodeRequire && this.options.nodeRequire.main && this.options.nodeRequire.main.filename && this._env.isNode) {
              let nodeMain = this.options.nodeRequire.main.filename;
              let dirnameIndex = Math.max(nodeMain.lastIndexOf("/"), nodeMain.lastIndexOf("\\"));
              this.options.baseUrl = nodeMain.substring(0, dirnameIndex + 1);
            }
          }
        }
        _createIgnoreDuplicateModulesMap() {
          this.ignoreDuplicateModulesMap = {};
          for (let i = 0; i < this.options.ignoreDuplicateModules.length; i++) {
            this.ignoreDuplicateModulesMap[this.options.ignoreDuplicateModules[i]] = true;
          }
        }
        _createSortedPathsRules() {
          this.sortedPathsRules = [];
          AMDLoader2.Utilities.forEachProperty(this.options.paths, (from, to) => {
            if (!Array.isArray(to)) {
              this.sortedPathsRules.push({
                from,
                to: [to]
              });
            } else {
              this.sortedPathsRules.push({
                from,
                to
              });
            }
          });
          this.sortedPathsRules.sort((a, b) => {
            return b.from.length - a.from.length;
          });
        }
        /**
         * Clone current configuration and overwrite options selectively.
         * @param options The selective options to overwrite with.
         * @result A new configuration
         */
        cloneAndMerge(options) {
          return new Configuration(this._env, ConfigurationOptionsUtil.mergeConfigurationOptions(options, this.options));
        }
        /**
         * Get current options bag. Useful for passing it forward to plugins.
         */
        getOptionsLiteral() {
          return this.options;
        }
        _applyPaths(moduleId) {
          let pathRule;
          for (let i = 0, len = this.sortedPathsRules.length; i < len; i++) {
            pathRule = this.sortedPathsRules[i];
            if (AMDLoader2.Utilities.startsWith(moduleId, pathRule.from)) {
              let result = [];
              for (let j = 0, lenJ = pathRule.to.length; j < lenJ; j++) {
                result.push(pathRule.to[j] + moduleId.substr(pathRule.from.length));
              }
              return result;
            }
          }
          return [moduleId];
        }
        _addUrlArgsToUrl(url) {
          if (AMDLoader2.Utilities.containsQueryString(url)) {
            return url + "&" + this.options.urlArgs;
          } else {
            return url + "?" + this.options.urlArgs;
          }
        }
        _addUrlArgsIfNecessaryToUrl(url) {
          if (this.options.urlArgs) {
            return this._addUrlArgsToUrl(url);
          }
          return url;
        }
        _addUrlArgsIfNecessaryToUrls(urls) {
          if (this.options.urlArgs) {
            for (let i = 0, len = urls.length; i < len; i++) {
              urls[i] = this._addUrlArgsToUrl(urls[i]);
            }
          }
          return urls;
        }
        /**
         * Transform a module id to a location. Appends .js to module ids
         */
        moduleIdToPaths(moduleId) {
          if (this._env.isNode) {
            const isNodeModule = this.options.amdModulesPattern instanceof RegExp && !this.options.amdModulesPattern.test(moduleId);
            if (isNodeModule) {
              if (this.isBuild()) {
                return ["empty:"];
              } else {
                return ["node|" + moduleId];
              }
            }
          }
          let result = moduleId;
          let results;
          if (!AMDLoader2.Utilities.endsWith(result, ".js") && !AMDLoader2.Utilities.isAbsolutePath(result)) {
            results = this._applyPaths(result);
            for (let i = 0, len = results.length; i < len; i++) {
              if (this.isBuild() && results[i] === "empty:") {
                continue;
              }
              if (!AMDLoader2.Utilities.isAbsolutePath(results[i])) {
                results[i] = this.options.baseUrl + results[i];
              }
              if (!AMDLoader2.Utilities.endsWith(results[i], ".js") && !AMDLoader2.Utilities.containsQueryString(results[i])) {
                results[i] = results[i] + ".js";
              }
            }
          } else {
            if (!AMDLoader2.Utilities.endsWith(result, ".js") && !AMDLoader2.Utilities.containsQueryString(result)) {
              result = result + ".js";
            }
            results = [result];
          }
          return this._addUrlArgsIfNecessaryToUrls(results);
        }
        /**
         * Transform a module id or url to a location.
         */
        requireToUrl(url) {
          let result = url;
          if (!AMDLoader2.Utilities.isAbsolutePath(result)) {
            result = this._applyPaths(result)[0];
            if (!AMDLoader2.Utilities.isAbsolutePath(result)) {
              result = this.options.baseUrl + result;
            }
          }
          return this._addUrlArgsIfNecessaryToUrl(result);
        }
        /**
         * Flag to indicate if current execution is as part of a build.
         */
        isBuild() {
          return this.options.isBuild;
        }
        shouldInvokeFactory(strModuleId) {
          if (!this.options.isBuild) {
            return true;
          }
          if (AMDLoader2.Utilities.isAnonymousModule(strModuleId)) {
            return true;
          }
          if (this.options.buildForceInvokeFactory && this.options.buildForceInvokeFactory[strModuleId]) {
            return true;
          }
          return false;
        }
        /**
         * Test if module `moduleId` is expected to be defined multiple times
         */
        isDuplicateMessageIgnoredFor(moduleId) {
          return this.ignoreDuplicateModulesMap.hasOwnProperty(moduleId);
        }
        /**
         * Get the configuration settings for the provided module id
         */
        getConfigForModule(moduleId) {
          if (this.options.config) {
            return this.options.config[moduleId];
          }
        }
        /**
         * Should errors be caught when executing module factories?
         */
        shouldCatchError() {
          return this.options.catchError;
        }
        /**
         * Should statistics be recorded?
         */
        shouldRecordStats() {
          return this.options.recordStats;
        }
        /**
         * Forward an error to the error handler.
         */
        onError(err) {
          this.options.onError(err);
        }
      }
      AMDLoader2.Configuration = Configuration;
    })(AMDLoader || (AMDLoader = {}));
    var AMDLoader;
    (function(AMDLoader2) {
      class OnlyOnceScriptLoader {
        constructor(env) {
          this._env = env;
          this._scriptLoader = null;
          this._callbackMap = {};
        }
        load(moduleManager, scriptSrc, callback, errorback) {
          if (!this._scriptLoader) {
            if (this._env.isWebWorker) {
              this._scriptLoader = new WorkerScriptLoader();
            } else if (this._env.isElectronRenderer) {
              const { preferScriptTags } = moduleManager.getConfig().getOptionsLiteral();
              if (preferScriptTags) {
                this._scriptLoader = new BrowserScriptLoader();
              } else {
                this._scriptLoader = new NodeScriptLoader(this._env);
              }
            } else if (this._env.isNode) {
              this._scriptLoader = new NodeScriptLoader(this._env);
            } else {
              this._scriptLoader = new BrowserScriptLoader();
            }
          }
          let scriptCallbacks = {
            callback,
            errorback
          };
          if (this._callbackMap.hasOwnProperty(scriptSrc)) {
            this._callbackMap[scriptSrc].push(scriptCallbacks);
            return;
          }
          this._callbackMap[scriptSrc] = [scriptCallbacks];
          this._scriptLoader.load(moduleManager, scriptSrc, () => this.triggerCallback(scriptSrc), (err) => this.triggerErrorback(scriptSrc, err));
        }
        triggerCallback(scriptSrc) {
          let scriptCallbacks = this._callbackMap[scriptSrc];
          delete this._callbackMap[scriptSrc];
          for (let i = 0; i < scriptCallbacks.length; i++) {
            scriptCallbacks[i].callback();
          }
        }
        triggerErrorback(scriptSrc, err) {
          let scriptCallbacks = this._callbackMap[scriptSrc];
          delete this._callbackMap[scriptSrc];
          for (let i = 0; i < scriptCallbacks.length; i++) {
            scriptCallbacks[i].errorback(err);
          }
        }
      }
      class BrowserScriptLoader {
        /**
         * Attach load / error listeners to a script element and remove them when either one has fired.
         * Implemented for browsers supporting HTML5 standard 'load' and 'error' events.
         */
        attachListeners(script, callback, errorback) {
          let unbind = () => {
            script.removeEventListener("load", loadEventListener);
            script.removeEventListener("error", errorEventListener);
          };
          let loadEventListener = (e) => {
            unbind();
            callback();
          };
          let errorEventListener = (e) => {
            unbind();
            errorback(e);
          };
          script.addEventListener("load", loadEventListener);
          script.addEventListener("error", errorEventListener);
        }
        load(moduleManager, scriptSrc, callback, errorback) {
          if (/^node\|/.test(scriptSrc)) {
            let opts = moduleManager.getConfig().getOptionsLiteral();
            let nodeRequire = ensureRecordedNodeRequire(moduleManager.getRecorder(), opts.nodeRequire || AMDLoader2.global.nodeRequire);
            let pieces = scriptSrc.split("|");
            let moduleExports = null;
            try {
              moduleExports = nodeRequire(pieces[1]);
            } catch (err) {
              errorback(err);
              return;
            }
            moduleManager.enqueueDefineAnonymousModule([], () => moduleExports);
            callback();
          } else {
            let script = document.createElement("script");
            script.setAttribute("async", "async");
            script.setAttribute("type", "text/javascript");
            this.attachListeners(script, callback, errorback);
            const { trustedTypesPolicy } = moduleManager.getConfig().getOptionsLiteral();
            if (trustedTypesPolicy) {
              scriptSrc = trustedTypesPolicy.createScriptURL(scriptSrc);
            }
            script.setAttribute("src", scriptSrc);
            const { cspNonce } = moduleManager.getConfig().getOptionsLiteral();
            if (cspNonce) {
              script.setAttribute("nonce", cspNonce);
            }
            document.getElementsByTagName("head")[0].appendChild(script);
          }
        }
      }
      function canUseEval(moduleManager) {
        const { trustedTypesPolicy } = moduleManager.getConfig().getOptionsLiteral();
        try {
          const func = trustedTypesPolicy ? self.eval(trustedTypesPolicy.createScript("", "true")) : new Function("true");
          func.call(self);
          return true;
        } catch (err) {
          return false;
        }
      }
      class WorkerScriptLoader {
        constructor() {
          this._cachedCanUseEval = null;
        }
        _canUseEval(moduleManager) {
          if (this._cachedCanUseEval === null) {
            this._cachedCanUseEval = canUseEval(moduleManager);
          }
          return this._cachedCanUseEval;
        }
        load(moduleManager, scriptSrc, callback, errorback) {
          if (/^node\|/.test(scriptSrc)) {
            const opts = moduleManager.getConfig().getOptionsLiteral();
            const nodeRequire = ensureRecordedNodeRequire(moduleManager.getRecorder(), opts.nodeRequire || AMDLoader2.global.nodeRequire);
            const pieces = scriptSrc.split("|");
            let moduleExports = null;
            try {
              moduleExports = nodeRequire(pieces[1]);
            } catch (err) {
              errorback(err);
              return;
            }
            moduleManager.enqueueDefineAnonymousModule([], function() {
              return moduleExports;
            });
            callback();
          } else {
            const { trustedTypesPolicy } = moduleManager.getConfig().getOptionsLiteral();
            const isCrossOrigin = /^((http:)|(https:)|(file:))/.test(scriptSrc) && scriptSrc.substring(0, self.origin.length) !== self.origin;
            if (!isCrossOrigin && this._canUseEval(moduleManager)) {
              fetch(scriptSrc).then((response) => {
                if (response.status !== 200) {
                  throw new Error(response.statusText);
                }
                return response.text();
              }).then((text) => {
                text = `${text}
//# sourceURL=${scriptSrc}`;
                const func = trustedTypesPolicy ? self.eval(trustedTypesPolicy.createScript("", text)) : new Function(text);
                func.call(self);
                callback();
              }).then(void 0, errorback);
              return;
            }
            try {
              if (trustedTypesPolicy) {
                scriptSrc = trustedTypesPolicy.createScriptURL(scriptSrc);
              }
              importScripts(scriptSrc);
              callback();
            } catch (e) {
              errorback(e);
            }
          }
        }
      }
      class NodeScriptLoader {
        constructor(env) {
          this._env = env;
          this._didInitialize = false;
          this._didPatchNodeRequire = false;
        }
        _init(nodeRequire) {
          if (this._didInitialize) {
            return;
          }
          this._didInitialize = true;
          this._fs = nodeRequire("fs");
          this._vm = nodeRequire("vm");
          this._path = nodeRequire("path");
          this._crypto = nodeRequire("crypto");
        }
        // patch require-function of nodejs such that we can manually create a script
        // from cached data. this is done by overriding the `Module._compile` function
        _initNodeRequire(nodeRequire, moduleManager) {
          const { nodeCachedData } = moduleManager.getConfig().getOptionsLiteral();
          if (!nodeCachedData) {
            return;
          }
          if (this._didPatchNodeRequire) {
            return;
          }
          this._didPatchNodeRequire = true;
          const that = this;
          const Module = nodeRequire("module");
          function makeRequireFunction(mod) {
            const Module2 = mod.constructor;
            let require2 = function require3(path2) {
              try {
                return mod.require(path2);
              } finally {
              }
            };
            require2.resolve = function resolve(request, options) {
              return Module2._resolveFilename(request, mod, false, options);
            };
            require2.resolve.paths = function paths(request) {
              return Module2._resolveLookupPaths(request, mod);
            };
            require2.main = process.mainModule;
            require2.extensions = Module2._extensions;
            require2.cache = Module2._cache;
            return require2;
          }
          Module.prototype._compile = function(content, filename) {
            const scriptSource = Module.wrap(content.replace(/^#!.*/, ""));
            const recorder = moduleManager.getRecorder();
            const cachedDataPath = that._getCachedDataPath(nodeCachedData, filename);
            const options = { filename };
            let hashData;
            try {
              const data = that._fs.readFileSync(cachedDataPath);
              hashData = data.slice(0, 16);
              options.cachedData = data.slice(16);
              recorder.record(60, cachedDataPath);
            } catch (_e) {
              recorder.record(61, cachedDataPath);
            }
            const script = new that._vm.Script(scriptSource, options);
            const compileWrapper = script.runInThisContext(options);
            const dirname = that._path.dirname(filename);
            const require2 = makeRequireFunction(this);
            const args = [this.exports, require2, this, filename, dirname, process, _commonjsGlobal, Buffer];
            const result = compileWrapper.apply(this.exports, args);
            that._handleCachedData(script, scriptSource, cachedDataPath, !options.cachedData, moduleManager);
            that._verifyCachedData(script, scriptSource, cachedDataPath, hashData, moduleManager);
            return result;
          };
        }
        load(moduleManager, scriptSrc, callback, errorback) {
          const opts = moduleManager.getConfig().getOptionsLiteral();
          const nodeRequire = ensureRecordedNodeRequire(moduleManager.getRecorder(), opts.nodeRequire || AMDLoader2.global.nodeRequire);
          const nodeInstrumenter = opts.nodeInstrumenter || function(c) {
            return c;
          };
          this._init(nodeRequire);
          this._initNodeRequire(nodeRequire, moduleManager);
          let recorder = moduleManager.getRecorder();
          if (/^node\|/.test(scriptSrc)) {
            let pieces = scriptSrc.split("|");
            let moduleExports = null;
            try {
              moduleExports = nodeRequire(pieces[1]);
            } catch (err) {
              errorback(err);
              return;
            }
            moduleManager.enqueueDefineAnonymousModule([], () => moduleExports);
            callback();
          } else {
            scriptSrc = AMDLoader2.Utilities.fileUriToFilePath(this._env.isWindows, scriptSrc);
            const normalizedScriptSrc = this._path.normalize(scriptSrc);
            const vmScriptPathOrUri = this._getElectronRendererScriptPathOrUri(normalizedScriptSrc);
            const wantsCachedData = Boolean(opts.nodeCachedData);
            const cachedDataPath = wantsCachedData ? this._getCachedDataPath(opts.nodeCachedData, scriptSrc) : void 0;
            this._readSourceAndCachedData(normalizedScriptSrc, cachedDataPath, recorder, (err, data, cachedData, hashData) => {
              if (err) {
                errorback(err);
                return;
              }
              let scriptSource;
              if (data.charCodeAt(0) === NodeScriptLoader._BOM) {
                scriptSource = NodeScriptLoader._PREFIX + data.substring(1) + NodeScriptLoader._SUFFIX;
              } else {
                scriptSource = NodeScriptLoader._PREFIX + data + NodeScriptLoader._SUFFIX;
              }
              scriptSource = nodeInstrumenter(scriptSource, normalizedScriptSrc);
              const scriptOpts = { filename: vmScriptPathOrUri, cachedData };
              const script = this._createAndEvalScript(moduleManager, scriptSource, scriptOpts, callback, errorback);
              this._handleCachedData(script, scriptSource, cachedDataPath, wantsCachedData && !cachedData, moduleManager);
              this._verifyCachedData(script, scriptSource, cachedDataPath, hashData, moduleManager);
            });
          }
        }
        _createAndEvalScript(moduleManager, contents, options, callback, errorback) {
          const recorder = moduleManager.getRecorder();
          recorder.record(31, options.filename);
          const script = new this._vm.Script(contents, options);
          const ret = script.runInThisContext(options);
          const globalDefineFunc = moduleManager.getGlobalAMDDefineFunc();
          let receivedDefineCall = false;
          const localDefineFunc = function() {
            receivedDefineCall = true;
            return globalDefineFunc.apply(null, arguments);
          };
          localDefineFunc.amd = globalDefineFunc.amd;
          ret.call(AMDLoader2.global, moduleManager.getGlobalAMDRequireFunc(), localDefineFunc, options.filename, this._path.dirname(options.filename));
          recorder.record(32, options.filename);
          if (receivedDefineCall) {
            callback();
          } else {
            errorback(new Error(`Didn't receive define call in ${options.filename}!`));
          }
          return script;
        }
        _getElectronRendererScriptPathOrUri(path2) {
          if (!this._env.isElectronRenderer) {
            return path2;
          }
          let driveLetterMatch = path2.match(/^([a-z])\:(.*)/i);
          if (driveLetterMatch) {
            return `file:///${(driveLetterMatch[1].toUpperCase() + ":" + driveLetterMatch[2]).replace(/\\/g, "/")}`;
          } else {
            return `file://${path2}`;
          }
        }
        _getCachedDataPath(config, filename) {
          const hash = this._crypto.createHash("md5").update(filename, "utf8").update(config.seed, "utf8").update(process.arch, "").digest("hex");
          const basename = this._path.basename(filename).replace(/\.js$/, "");
          return this._path.join(config.path, `${basename}-${hash}.code`);
        }
        _handleCachedData(script, scriptSource, cachedDataPath, createCachedData, moduleManager) {
          if (script.cachedDataRejected) {
            this._fs.unlink(cachedDataPath, (err) => {
              moduleManager.getRecorder().record(62, cachedDataPath);
              this._createAndWriteCachedData(script, scriptSource, cachedDataPath, moduleManager);
              if (err) {
                moduleManager.getConfig().onError(err);
              }
            });
          } else if (createCachedData) {
            this._createAndWriteCachedData(script, scriptSource, cachedDataPath, moduleManager);
          }
        }
        // Cached data format: | SOURCE_HASH | V8_CACHED_DATA |
        // -SOURCE_HASH is the md5 hash of the JS source (always 16 bytes)
        // -V8_CACHED_DATA is what v8 produces
        _createAndWriteCachedData(script, scriptSource, cachedDataPath, moduleManager) {
          let timeout = Math.ceil(moduleManager.getConfig().getOptionsLiteral().nodeCachedData.writeDelay * (1 + Math.random()));
          let lastSize = -1;
          let iteration = 0;
          let hashData = void 0;
          const createLoop = () => {
            setTimeout(() => {
              if (!hashData) {
                hashData = this._crypto.createHash("md5").update(scriptSource, "utf8").digest();
              }
              const cachedData = script.createCachedData();
              if (cachedData.length === 0 || cachedData.length === lastSize || iteration >= 5) {
                return;
              }
              if (cachedData.length < lastSize) {
                createLoop();
                return;
              }
              lastSize = cachedData.length;
              this._fs.writeFile(cachedDataPath, Buffer.concat([hashData, cachedData]), (err) => {
                if (err) {
                  moduleManager.getConfig().onError(err);
                }
                moduleManager.getRecorder().record(63, cachedDataPath);
                createLoop();
              });
            }, timeout * Math.pow(4, iteration++));
          };
          createLoop();
        }
        _readSourceAndCachedData(sourcePath, cachedDataPath, recorder, callback) {
          if (!cachedDataPath) {
            this._fs.readFile(sourcePath, { encoding: "utf8" }, callback);
          } else {
            let source = void 0;
            let cachedData = void 0;
            let hashData = void 0;
            let steps = 2;
            const step = (err) => {
              if (err) {
                callback(err);
              } else if (--steps === 0) {
                callback(void 0, source, cachedData, hashData);
              }
            };
            this._fs.readFile(sourcePath, { encoding: "utf8" }, (err, data) => {
              source = data;
              step(err);
            });
            this._fs.readFile(cachedDataPath, (err, data) => {
              if (!err && data && data.length > 0) {
                hashData = data.slice(0, 16);
                cachedData = data.slice(16);
                recorder.record(60, cachedDataPath);
              } else {
                recorder.record(61, cachedDataPath);
              }
              step();
            });
          }
        }
        _verifyCachedData(script, scriptSource, cachedDataPath, hashData, moduleManager) {
          if (!hashData) {
            return;
          }
          if (script.cachedDataRejected) {
            return;
          }
          setTimeout(() => {
            const hashDataNow = this._crypto.createHash("md5").update(scriptSource, "utf8").digest();
            if (!hashData.equals(hashDataNow)) {
              moduleManager.getConfig().onError(new Error(`FAILED TO VERIFY CACHED DATA, deleting stale '${cachedDataPath}' now, but a RESTART IS REQUIRED`));
              this._fs.unlink(cachedDataPath, (err) => {
                if (err) {
                  moduleManager.getConfig().onError(err);
                }
              });
            }
          }, Math.ceil(5e3 * (1 + Math.random())));
        }
      }
      NodeScriptLoader._BOM = 65279;
      NodeScriptLoader._PREFIX = "(function (require, define, __filename, __dirname) { ";
      NodeScriptLoader._SUFFIX = "\n});";
      function ensureRecordedNodeRequire(recorder, _nodeRequire) {
        if (_nodeRequire.__$__isRecorded) {
          return _nodeRequire;
        }
        const nodeRequire = function nodeRequire2(what) {
          recorder.record(33, what);
          try {
            return _nodeRequire(what);
          } finally {
            recorder.record(34, what);
          }
        };
        nodeRequire.__$__isRecorded = true;
        return nodeRequire;
      }
      AMDLoader2.ensureRecordedNodeRequire = ensureRecordedNodeRequire;
      function createScriptLoader(env) {
        return new OnlyOnceScriptLoader(env);
      }
      AMDLoader2.createScriptLoader = createScriptLoader;
    })(AMDLoader || (AMDLoader = {}));
    var AMDLoader;
    (function(AMDLoader2) {
      class ModuleIdResolver {
        constructor(fromModuleId) {
          let lastSlash = fromModuleId.lastIndexOf("/");
          if (lastSlash !== -1) {
            this.fromModulePath = fromModuleId.substr(0, lastSlash + 1);
          } else {
            this.fromModulePath = "";
          }
        }
        /**
         * Normalize 'a/../name' to 'name', etc.
         */
        static _normalizeModuleId(moduleId) {
          let r = moduleId, pattern;
          pattern = /\/\.\//;
          while (pattern.test(r)) {
            r = r.replace(pattern, "/");
          }
          r = r.replace(/^\.\//g, "");
          pattern = /\/(([^\/])|([^\/][^\/\.])|([^\/\.][^\/])|([^\/][^\/][^\/]+))\/\.\.\//;
          while (pattern.test(r)) {
            r = r.replace(pattern, "/");
          }
          r = r.replace(/^(([^\/])|([^\/][^\/\.])|([^\/\.][^\/])|([^\/][^\/][^\/]+))\/\.\.\//, "");
          return r;
        }
        /**
         * Resolve relative module ids
         */
        resolveModule(moduleId) {
          let result = moduleId;
          if (!AMDLoader2.Utilities.isAbsolutePath(result)) {
            if (AMDLoader2.Utilities.startsWith(result, "./") || AMDLoader2.Utilities.startsWith(result, "../")) {
              result = ModuleIdResolver._normalizeModuleId(this.fromModulePath + result);
            }
          }
          return result;
        }
      }
      ModuleIdResolver.ROOT = new ModuleIdResolver("");
      AMDLoader2.ModuleIdResolver = ModuleIdResolver;
      class Module {
        constructor(id, strId, dependencies, callback, errorback, moduleIdResolver) {
          this.id = id;
          this.strId = strId;
          this.dependencies = dependencies;
          this._callback = callback;
          this._errorback = errorback;
          this.moduleIdResolver = moduleIdResolver;
          this.exports = {};
          this.error = null;
          this.exportsPassedIn = false;
          this.unresolvedDependenciesCount = this.dependencies.length;
          this._isComplete = false;
        }
        static _safeInvokeFunction(callback, args) {
          try {
            return {
              returnedValue: callback.apply(AMDLoader2.global, args),
              producedError: null
            };
          } catch (e) {
            return {
              returnedValue: null,
              producedError: e
            };
          }
        }
        static _invokeFactory(config, strModuleId, callback, dependenciesValues) {
          if (!config.shouldInvokeFactory(strModuleId)) {
            return {
              returnedValue: null,
              producedError: null
            };
          }
          if (config.shouldCatchError()) {
            return this._safeInvokeFunction(callback, dependenciesValues);
          }
          return {
            returnedValue: callback.apply(AMDLoader2.global, dependenciesValues),
            producedError: null
          };
        }
        complete(recorder, config, dependenciesValues, inversedependenciesProvider) {
          this._isComplete = true;
          let producedError = null;
          if (this._callback) {
            if (typeof this._callback === "function") {
              recorder.record(21, this.strId);
              let r = Module._invokeFactory(config, this.strId, this._callback, dependenciesValues);
              producedError = r.producedError;
              recorder.record(22, this.strId);
              if (!producedError && typeof r.returnedValue !== "undefined" && (!this.exportsPassedIn || AMDLoader2.Utilities.isEmpty(this.exports))) {
                this.exports = r.returnedValue;
              }
            } else {
              this.exports = this._callback;
            }
          }
          if (producedError) {
            let err = AMDLoader2.ensureError(producedError);
            err.phase = "factory";
            err.moduleId = this.strId;
            err.neededBy = inversedependenciesProvider(this.id);
            this.error = err;
            config.onError(err);
          }
          this.dependencies = null;
          this._callback = null;
          this._errorback = null;
          this.moduleIdResolver = null;
        }
        /**
         * One of the direct dependencies or a transitive dependency has failed to load.
         */
        onDependencyError(err) {
          this._isComplete = true;
          this.error = err;
          if (this._errorback) {
            this._errorback(err);
            return true;
          }
          return false;
        }
        /**
         * Is the current module complete?
         */
        isComplete() {
          return this._isComplete;
        }
      }
      AMDLoader2.Module = Module;
      class ModuleIdProvider {
        constructor() {
          this._nextId = 0;
          this._strModuleIdToIntModuleId = /* @__PURE__ */ new Map();
          this._intModuleIdToStrModuleId = [];
          this.getModuleId("exports");
          this.getModuleId("module");
          this.getModuleId("require");
        }
        getMaxModuleId() {
          return this._nextId;
        }
        getModuleId(strModuleId) {
          let id = this._strModuleIdToIntModuleId.get(strModuleId);
          if (typeof id === "undefined") {
            id = this._nextId++;
            this._strModuleIdToIntModuleId.set(strModuleId, id);
            this._intModuleIdToStrModuleId[id] = strModuleId;
          }
          return id;
        }
        getStrModuleId(moduleId) {
          return this._intModuleIdToStrModuleId[moduleId];
        }
      }
      class RegularDependency {
        constructor(id) {
          this.id = id;
        }
      }
      RegularDependency.EXPORTS = new RegularDependency(
        0
        /* ModuleId.EXPORTS */
      );
      RegularDependency.MODULE = new RegularDependency(
        1
        /* ModuleId.MODULE */
      );
      RegularDependency.REQUIRE = new RegularDependency(
        2
        /* ModuleId.REQUIRE */
      );
      AMDLoader2.RegularDependency = RegularDependency;
      class PluginDependency {
        constructor(id, pluginId, pluginParam) {
          this.id = id;
          this.pluginId = pluginId;
          this.pluginParam = pluginParam;
        }
      }
      AMDLoader2.PluginDependency = PluginDependency;
      class ModuleManager {
        constructor(env, scriptLoader, defineFunc, requireFunc, loaderAvailableTimestamp = 0) {
          this._env = env;
          this._scriptLoader = scriptLoader;
          this._loaderAvailableTimestamp = loaderAvailableTimestamp;
          this._defineFunc = defineFunc;
          this._requireFunc = requireFunc;
          this._moduleIdProvider = new ModuleIdProvider();
          this._config = new AMDLoader2.Configuration(this._env);
          this._hasDependencyCycle = false;
          this._modules2 = [];
          this._knownModules2 = [];
          this._inverseDependencies2 = [];
          this._inversePluginDependencies2 = /* @__PURE__ */ new Map();
          this._currentAnonymousDefineCall = null;
          this._recorder = null;
          this._buildInfoPath = [];
          this._buildInfoDefineStack = [];
          this._buildInfoDependencies = [];
          this._requireFunc.moduleManager = this;
        }
        reset() {
          return new ModuleManager(this._env, this._scriptLoader, this._defineFunc, this._requireFunc, this._loaderAvailableTimestamp);
        }
        getGlobalAMDDefineFunc() {
          return this._defineFunc;
        }
        getGlobalAMDRequireFunc() {
          return this._requireFunc;
        }
        static _findRelevantLocationInStack(needle, stack) {
          let normalize = (str) => str.replace(/\\/g, "/");
          let normalizedPath = normalize(needle);
          let stackPieces = stack.split(/\n/);
          for (let i = 0; i < stackPieces.length; i++) {
            let m = stackPieces[i].match(/(.*):(\d+):(\d+)\)?$/);
            if (m) {
              let stackPath = m[1];
              let stackLine = m[2];
              let stackColumn = m[3];
              let trimPathOffset = Math.max(stackPath.lastIndexOf(" ") + 1, stackPath.lastIndexOf("(") + 1);
              stackPath = stackPath.substr(trimPathOffset);
              stackPath = normalize(stackPath);
              if (stackPath === normalizedPath) {
                let r = {
                  line: parseInt(stackLine, 10),
                  col: parseInt(stackColumn, 10)
                };
                if (r.line === 1) {
                  r.col -= "(function (require, define, __filename, __dirname) { ".length;
                }
                return r;
              }
            }
          }
          throw new Error("Could not correlate define call site for needle " + needle);
        }
        getBuildInfo() {
          if (!this._config.isBuild()) {
            return null;
          }
          let result = [], resultLen = 0;
          for (let i = 0, len = this._modules2.length; i < len; i++) {
            let m = this._modules2[i];
            if (!m) {
              continue;
            }
            let location = this._buildInfoPath[m.id] || null;
            let defineStack = this._buildInfoDefineStack[m.id] || null;
            let dependencies = this._buildInfoDependencies[m.id];
            result[resultLen++] = {
              id: m.strId,
              path: location,
              defineLocation: location && defineStack ? ModuleManager._findRelevantLocationInStack(location, defineStack) : null,
              dependencies,
              shim: null,
              exports: m.exports
            };
          }
          return result;
        }
        getRecorder() {
          if (!this._recorder) {
            if (this._config.shouldRecordStats()) {
              this._recorder = new AMDLoader2.LoaderEventRecorder(this._loaderAvailableTimestamp);
            } else {
              this._recorder = AMDLoader2.NullLoaderEventRecorder.INSTANCE;
            }
          }
          return this._recorder;
        }
        getLoaderEvents() {
          return this.getRecorder().getEvents();
        }
        /**
         * Defines an anonymous module (without an id). Its name will be resolved as we receive a callback from the scriptLoader.
         * @param dependencies @see defineModule
         * @param callback @see defineModule
         */
        enqueueDefineAnonymousModule(dependencies, callback) {
          if (this._currentAnonymousDefineCall !== null) {
            throw new Error("Can only have one anonymous define call per script file");
          }
          let stack = null;
          if (this._config.isBuild()) {
            stack = new Error("StackLocation").stack || null;
          }
          this._currentAnonymousDefineCall = {
            stack,
            dependencies,
            callback
          };
        }
        /**
         * Creates a module and stores it in _modules. The manager will immediately begin resolving its dependencies.
         * @param strModuleId An unique and absolute id of the module. This must not collide with another module's id
         * @param dependencies An array with the dependencies of the module. Special keys are: "require", "exports" and "module"
         * @param callback if callback is a function, it will be called with the resolved dependencies. if callback is an object, it will be considered as the exports of the module.
         */
        defineModule(strModuleId, dependencies, callback, errorback, stack, moduleIdResolver = new ModuleIdResolver(strModuleId)) {
          let moduleId = this._moduleIdProvider.getModuleId(strModuleId);
          if (this._modules2[moduleId]) {
            if (!this._config.isDuplicateMessageIgnoredFor(strModuleId)) {
              console.warn("Duplicate definition of module '" + strModuleId + "'");
            }
            return;
          }
          let m = new Module(moduleId, strModuleId, this._normalizeDependencies(dependencies, moduleIdResolver), callback, errorback, moduleIdResolver);
          this._modules2[moduleId] = m;
          if (this._config.isBuild()) {
            this._buildInfoDefineStack[moduleId] = stack;
            this._buildInfoDependencies[moduleId] = (m.dependencies || []).map((dep) => this._moduleIdProvider.getStrModuleId(dep.id));
          }
          this._resolve(m);
        }
        _normalizeDependency(dependency, moduleIdResolver) {
          if (dependency === "exports") {
            return RegularDependency.EXPORTS;
          }
          if (dependency === "module") {
            return RegularDependency.MODULE;
          }
          if (dependency === "require") {
            return RegularDependency.REQUIRE;
          }
          let bangIndex = dependency.indexOf("!");
          if (bangIndex >= 0) {
            let strPluginId = moduleIdResolver.resolveModule(dependency.substr(0, bangIndex));
            let pluginParam = moduleIdResolver.resolveModule(dependency.substr(bangIndex + 1));
            let dependencyId = this._moduleIdProvider.getModuleId(strPluginId + "!" + pluginParam);
            let pluginId = this._moduleIdProvider.getModuleId(strPluginId);
            return new PluginDependency(dependencyId, pluginId, pluginParam);
          }
          return new RegularDependency(this._moduleIdProvider.getModuleId(moduleIdResolver.resolveModule(dependency)));
        }
        _normalizeDependencies(dependencies, moduleIdResolver) {
          let result = [], resultLen = 0;
          for (let i = 0, len = dependencies.length; i < len; i++) {
            result[resultLen++] = this._normalizeDependency(dependencies[i], moduleIdResolver);
          }
          return result;
        }
        _relativeRequire(moduleIdResolver, dependencies, callback, errorback) {
          if (typeof dependencies === "string") {
            return this.synchronousRequire(dependencies, moduleIdResolver);
          }
          this.defineModule(AMDLoader2.Utilities.generateAnonymousModule(), dependencies, callback, errorback, null, moduleIdResolver);
        }
        /**
         * Require synchronously a module by its absolute id. If the module is not loaded, an exception will be thrown.
         * @param id The unique and absolute id of the required module
         * @return The exports of module 'id'
         */
        synchronousRequire(_strModuleId, moduleIdResolver = new ModuleIdResolver(_strModuleId)) {
          let dependency = this._normalizeDependency(_strModuleId, moduleIdResolver);
          let m = this._modules2[dependency.id];
          if (!m) {
            throw new Error("Check dependency list! Synchronous require cannot resolve module '" + _strModuleId + "'. This is the first mention of this module!");
          }
          if (!m.isComplete()) {
            throw new Error("Check dependency list! Synchronous require cannot resolve module '" + _strModuleId + "'. This module has not been resolved completely yet.");
          }
          if (m.error) {
            throw m.error;
          }
          return m.exports;
        }
        configure(params, shouldOverwrite) {
          let oldShouldRecordStats = this._config.shouldRecordStats();
          if (shouldOverwrite) {
            this._config = new AMDLoader2.Configuration(this._env, params);
          } else {
            this._config = this._config.cloneAndMerge(params);
          }
          if (this._config.shouldRecordStats() && !oldShouldRecordStats) {
            this._recorder = null;
          }
        }
        getConfig() {
          return this._config;
        }
        /**
         * Callback from the scriptLoader when a module has been loaded.
         * This means its code is available and has been executed.
         */
        _onLoad(moduleId) {
          if (this._currentAnonymousDefineCall !== null) {
            let defineCall = this._currentAnonymousDefineCall;
            this._currentAnonymousDefineCall = null;
            this.defineModule(this._moduleIdProvider.getStrModuleId(moduleId), defineCall.dependencies, defineCall.callback, null, defineCall.stack);
          }
        }
        _createLoadError(moduleId, _err) {
          let strModuleId = this._moduleIdProvider.getStrModuleId(moduleId);
          let neededBy = (this._inverseDependencies2[moduleId] || []).map((intModuleId) => this._moduleIdProvider.getStrModuleId(intModuleId));
          const err = AMDLoader2.ensureError(_err);
          err.phase = "loading";
          err.moduleId = strModuleId;
          err.neededBy = neededBy;
          return err;
        }
        /**
         * Callback from the scriptLoader when a module hasn't been loaded.
         * This means that the script was not found (e.g. 404) or there was an error in the script.
         */
        _onLoadError(moduleId, err) {
          const error = this._createLoadError(moduleId, err);
          if (!this._modules2[moduleId]) {
            this._modules2[moduleId] = new Module(moduleId, this._moduleIdProvider.getStrModuleId(moduleId), [], () => {
            }, null, null);
          }
          let seenModuleId = [];
          for (let i = 0, len = this._moduleIdProvider.getMaxModuleId(); i < len; i++) {
            seenModuleId[i] = false;
          }
          let someoneNotified = false;
          let queue = [];
          queue.push(moduleId);
          seenModuleId[moduleId] = true;
          while (queue.length > 0) {
            let queueElement = queue.shift();
            let m = this._modules2[queueElement];
            if (m) {
              someoneNotified = m.onDependencyError(error) || someoneNotified;
            }
            let inverseDeps = this._inverseDependencies2[queueElement];
            if (inverseDeps) {
              for (let i = 0, len = inverseDeps.length; i < len; i++) {
                let inverseDep = inverseDeps[i];
                if (!seenModuleId[inverseDep]) {
                  queue.push(inverseDep);
                  seenModuleId[inverseDep] = true;
                }
              }
            }
          }
          if (!someoneNotified) {
            this._config.onError(error);
          }
        }
        /**
         * Walks (recursively) the dependencies of 'from' in search of 'to'.
         * Returns true if there is such a path or false otherwise.
         * @param from Module id to start at
         * @param to Module id to look for
         */
        _hasDependencyPath(fromId, toId) {
          let from = this._modules2[fromId];
          if (!from) {
            return false;
          }
          let inQueue = [];
          for (let i = 0, len = this._moduleIdProvider.getMaxModuleId(); i < len; i++) {
            inQueue[i] = false;
          }
          let queue = [];
          queue.push(from);
          inQueue[fromId] = true;
          while (queue.length > 0) {
            let element = queue.shift();
            let dependencies = element.dependencies;
            if (dependencies) {
              for (let i = 0, len = dependencies.length; i < len; i++) {
                let dependency = dependencies[i];
                if (dependency.id === toId) {
                  return true;
                }
                let dependencyModule = this._modules2[dependency.id];
                if (dependencyModule && !inQueue[dependency.id]) {
                  inQueue[dependency.id] = true;
                  queue.push(dependencyModule);
                }
              }
            }
          }
          return false;
        }
        /**
         * Walks (recursively) the dependencies of 'from' in search of 'to'.
         * Returns cycle as array.
         * @param from Module id to start at
         * @param to Module id to look for
         */
        _findCyclePath(fromId, toId, depth) {
          if (fromId === toId || depth === 50) {
            return [fromId];
          }
          let from = this._modules2[fromId];
          if (!from) {
            return null;
          }
          let dependencies = from.dependencies;
          if (dependencies) {
            for (let i = 0, len = dependencies.length; i < len; i++) {
              let path2 = this._findCyclePath(dependencies[i].id, toId, depth + 1);
              if (path2 !== null) {
                path2.push(fromId);
                return path2;
              }
            }
          }
          return null;
        }
        /**
         * Create the local 'require' that is passed into modules
         */
        _createRequire(moduleIdResolver) {
          let result = (dependencies, callback, errorback) => {
            return this._relativeRequire(moduleIdResolver, dependencies, callback, errorback);
          };
          result.toUrl = (id) => {
            return this._config.requireToUrl(moduleIdResolver.resolveModule(id));
          };
          result.getStats = () => {
            return this.getLoaderEvents();
          };
          result.hasDependencyCycle = () => {
            return this._hasDependencyCycle;
          };
          result.config = (params, shouldOverwrite = false) => {
            this.configure(params, shouldOverwrite);
          };
          result.__$__nodeRequire = AMDLoader2.global.nodeRequire;
          return result;
        }
        _loadModule(moduleId) {
          if (this._modules2[moduleId] || this._knownModules2[moduleId]) {
            return;
          }
          this._knownModules2[moduleId] = true;
          let strModuleId = this._moduleIdProvider.getStrModuleId(moduleId);
          let paths = this._config.moduleIdToPaths(strModuleId);
          let scopedPackageRegex = /^@[^\/]+\/[^\/]+$/;
          if (this._env.isNode && (strModuleId.indexOf("/") === -1 || scopedPackageRegex.test(strModuleId))) {
            paths.push("node|" + strModuleId);
          }
          let lastPathIndex = -1;
          let loadNextPath = (err) => {
            lastPathIndex++;
            if (lastPathIndex >= paths.length) {
              this._onLoadError(moduleId, err);
            } else {
              let currentPath = paths[lastPathIndex];
              let recorder = this.getRecorder();
              if (this._config.isBuild() && currentPath === "empty:") {
                this._buildInfoPath[moduleId] = currentPath;
                this.defineModule(this._moduleIdProvider.getStrModuleId(moduleId), [], null, null, null);
                this._onLoad(moduleId);
                return;
              }
              recorder.record(10, currentPath);
              this._scriptLoader.load(this, currentPath, () => {
                if (this._config.isBuild()) {
                  this._buildInfoPath[moduleId] = currentPath;
                }
                recorder.record(11, currentPath);
                this._onLoad(moduleId);
              }, (err2) => {
                recorder.record(12, currentPath);
                loadNextPath(err2);
              });
            }
          };
          loadNextPath(null);
        }
        /**
         * Resolve a plugin dependency with the plugin loaded & complete
         * @param module The module that has this dependency
         * @param pluginDependency The semi-normalized dependency that appears in the module. e.g. 'vs/css!./mycssfile'. Only the plugin part (before !) is normalized
         * @param plugin The plugin (what the plugin exports)
         */
        _loadPluginDependency(plugin, pluginDependency) {
          if (this._modules2[pluginDependency.id] || this._knownModules2[pluginDependency.id]) {
            return;
          }
          this._knownModules2[pluginDependency.id] = true;
          let load = (value) => {
            this.defineModule(this._moduleIdProvider.getStrModuleId(pluginDependency.id), [], value, null, null);
          };
          load.error = (err) => {
            this._config.onError(this._createLoadError(pluginDependency.id, err));
          };
          plugin.load(pluginDependency.pluginParam, this._createRequire(ModuleIdResolver.ROOT), load, this._config.getOptionsLiteral());
        }
        /**
         * Examine the dependencies of module 'module' and resolve them as needed.
         */
        _resolve(module3) {
          let dependencies = module3.dependencies;
          if (dependencies) {
            for (let i = 0, len = dependencies.length; i < len; i++) {
              let dependency = dependencies[i];
              if (dependency === RegularDependency.EXPORTS) {
                module3.exportsPassedIn = true;
                module3.unresolvedDependenciesCount--;
                continue;
              }
              if (dependency === RegularDependency.MODULE) {
                module3.unresolvedDependenciesCount--;
                continue;
              }
              if (dependency === RegularDependency.REQUIRE) {
                module3.unresolvedDependenciesCount--;
                continue;
              }
              let dependencyModule = this._modules2[dependency.id];
              if (dependencyModule && dependencyModule.isComplete()) {
                if (dependencyModule.error) {
                  module3.onDependencyError(dependencyModule.error);
                  return;
                }
                module3.unresolvedDependenciesCount--;
                continue;
              }
              if (this._hasDependencyPath(dependency.id, module3.id)) {
                this._hasDependencyCycle = true;
                console.warn("There is a dependency cycle between '" + this._moduleIdProvider.getStrModuleId(dependency.id) + "' and '" + this._moduleIdProvider.getStrModuleId(module3.id) + "'. The cyclic path follows:");
                let cyclePath = this._findCyclePath(dependency.id, module3.id, 0) || [];
                cyclePath.reverse();
                cyclePath.push(dependency.id);
                console.warn(cyclePath.map((id) => this._moduleIdProvider.getStrModuleId(id)).join(" => \n"));
                module3.unresolvedDependenciesCount--;
                continue;
              }
              this._inverseDependencies2[dependency.id] = this._inverseDependencies2[dependency.id] || [];
              this._inverseDependencies2[dependency.id].push(module3.id);
              if (dependency instanceof PluginDependency) {
                let plugin = this._modules2[dependency.pluginId];
                if (plugin && plugin.isComplete()) {
                  this._loadPluginDependency(plugin.exports, dependency);
                  continue;
                }
                let inversePluginDeps = this._inversePluginDependencies2.get(dependency.pluginId);
                if (!inversePluginDeps) {
                  inversePluginDeps = [];
                  this._inversePluginDependencies2.set(dependency.pluginId, inversePluginDeps);
                }
                inversePluginDeps.push(dependency);
                this._loadModule(dependency.pluginId);
                continue;
              }
              this._loadModule(dependency.id);
            }
          }
          if (module3.unresolvedDependenciesCount === 0) {
            this._onModuleComplete(module3);
          }
        }
        _onModuleComplete(module3) {
          let recorder = this.getRecorder();
          if (module3.isComplete()) {
            return;
          }
          let dependencies = module3.dependencies;
          let dependenciesValues = [];
          if (dependencies) {
            for (let i = 0, len = dependencies.length; i < len; i++) {
              let dependency = dependencies[i];
              if (dependency === RegularDependency.EXPORTS) {
                dependenciesValues[i] = module3.exports;
                continue;
              }
              if (dependency === RegularDependency.MODULE) {
                dependenciesValues[i] = {
                  id: module3.strId,
                  config: () => {
                    return this._config.getConfigForModule(module3.strId);
                  }
                };
                continue;
              }
              if (dependency === RegularDependency.REQUIRE) {
                dependenciesValues[i] = this._createRequire(module3.moduleIdResolver);
                continue;
              }
              let dependencyModule = this._modules2[dependency.id];
              if (dependencyModule) {
                dependenciesValues[i] = dependencyModule.exports;
                continue;
              }
              dependenciesValues[i] = null;
            }
          }
          const inversedependenciesProvider = (moduleId) => {
            return (this._inverseDependencies2[moduleId] || []).map((intModuleId) => this._moduleIdProvider.getStrModuleId(intModuleId));
          };
          module3.complete(recorder, this._config, dependenciesValues, inversedependenciesProvider);
          let inverseDeps = this._inverseDependencies2[module3.id];
          this._inverseDependencies2[module3.id] = null;
          if (inverseDeps) {
            for (let i = 0, len = inverseDeps.length; i < len; i++) {
              let inverseDependencyId = inverseDeps[i];
              let inverseDependency = this._modules2[inverseDependencyId];
              inverseDependency.unresolvedDependenciesCount--;
              if (inverseDependency.unresolvedDependenciesCount === 0) {
                this._onModuleComplete(inverseDependency);
              }
            }
          }
          let inversePluginDeps = this._inversePluginDependencies2.get(module3.id);
          if (inversePluginDeps) {
            this._inversePluginDependencies2.delete(module3.id);
            for (let i = 0, len = inversePluginDeps.length; i < len; i++) {
              this._loadPluginDependency(module3.exports, inversePluginDeps[i]);
            }
          }
        }
      }
      AMDLoader2.ModuleManager = ModuleManager;
    })(AMDLoader || (AMDLoader = {}));
    var define2;
    var AMDLoader;
    (function(AMDLoader2) {
      const env = new AMDLoader2.Environment();
      let moduleManager = null;
      const DefineFunc = function(id, dependencies, callback) {
        if (typeof id !== "string") {
          callback = dependencies;
          dependencies = id;
          id = null;
        }
        if (typeof dependencies !== "object" || !Array.isArray(dependencies)) {
          callback = dependencies;
          dependencies = null;
        }
        if (!dependencies) {
          dependencies = ["require", "exports", "module"];
        }
        if (id) {
          moduleManager.defineModule(id, dependencies, callback, null, null);
        } else {
          moduleManager.enqueueDefineAnonymousModule(dependencies, callback);
        }
      };
      DefineFunc.amd = {
        jQuery: true
      };
      const _requireFunc_config = function(params, shouldOverwrite = false) {
        moduleManager.configure(params, shouldOverwrite);
      };
      const RequireFunc = function() {
        if (arguments.length === 1) {
          if (arguments[0] instanceof Object && !Array.isArray(arguments[0])) {
            _requireFunc_config(arguments[0]);
            return;
          }
          if (typeof arguments[0] === "string") {
            return moduleManager.synchronousRequire(arguments[0]);
          }
        }
        if (arguments.length === 2 || arguments.length === 3) {
          if (Array.isArray(arguments[0])) {
            moduleManager.defineModule(AMDLoader2.Utilities.generateAnonymousModule(), arguments[0], arguments[1], arguments[2], null);
            return;
          }
        }
        throw new Error("Unrecognized require call");
      };
      RequireFunc.config = _requireFunc_config;
      RequireFunc.getConfig = function() {
        return moduleManager.getConfig().getOptionsLiteral();
      };
      RequireFunc.reset = function() {
        moduleManager = moduleManager.reset();
      };
      RequireFunc.getBuildInfo = function() {
        return moduleManager.getBuildInfo();
      };
      RequireFunc.getStats = function() {
        return moduleManager.getLoaderEvents();
      };
      RequireFunc.define = DefineFunc;
      function init() {
        if (typeof AMDLoader2.global.require !== "undefined" || typeof require !== "undefined") {
          const _nodeRequire = AMDLoader2.global.require || require;
          if (typeof _nodeRequire === "function" && typeof _nodeRequire.resolve === "function") {
            const nodeRequire = AMDLoader2.ensureRecordedNodeRequire(moduleManager.getRecorder(), _nodeRequire);
            AMDLoader2.global.nodeRequire = nodeRequire;
            RequireFunc.nodeRequire = nodeRequire;
            RequireFunc.__$__nodeRequire = nodeRequire;
          }
        }
        if (env.isNode && !env.isElectronRenderer && !env.isElectronNodeIntegrationWebWorker) {
          module2.exports = RequireFunc;
        } else {
          if (!env.isElectronRenderer) {
            AMDLoader2.global.define = DefineFunc;
          }
          AMDLoader2.global.require = RequireFunc;
        }
      }
      AMDLoader2.init = init;
      if (typeof AMDLoader2.global.define !== "function" || !AMDLoader2.global.define.amd) {
        moduleManager = new AMDLoader2.ModuleManager(env, AMDLoader2.createScriptLoader(env), DefineFunc, RequireFunc, AMDLoader2.Utilities.getHighPerformanceTimestamp());
        if (typeof AMDLoader2.global.require !== "undefined" && typeof AMDLoader2.global.require !== "function") {
          RequireFunc.config(AMDLoader2.global.require);
        }
        define2 = function() {
          return DefineFunc.apply(null, arguments);
        };
        define2.amd = DefineFunc.amd;
        if (typeof doNotInitLoader === "undefined") {
          init();
        }
      }
    })(AMDLoader || (AMDLoader = {}));
    define2("vs/css", ["require", "exports"], function(require2, exports3) {
      "use strict";
      Object.defineProperty(exports3, "__esModule", { value: true });
      exports3.load = load;
      function load(name, req, load2, config) {
        config = config || {};
        const cssConfig = config["vs/css"] || {};
        if (cssConfig.disabled) {
          load2({});
          return;
        }
        const cssUrl = req.toUrl(name + ".css");
        loadCSS(name, cssUrl, () => {
          load2({});
        }, (err) => {
          if (typeof load2.error === "function") {
            load2.error("Could not find " + cssUrl + ".");
          }
        });
      }
      function loadCSS(name, cssUrl, callback, errorback) {
        if (linkTagExists(name, cssUrl)) {
          callback();
          return;
        }
        createLinkTag(name, cssUrl, callback, errorback);
      }
      function linkTagExists(name, cssUrl) {
        const links = window.document.getElementsByTagName("link");
        for (let i = 0, len = links.length; i < len; i++) {
          const nameAttr = links[i].getAttribute("data-name");
          const hrefAttr = links[i].getAttribute("href");
          if (nameAttr === name || hrefAttr === cssUrl) {
            return true;
          }
        }
        return false;
      }
      function createLinkTag(name, cssUrl, callback, errorback) {
        const linkNode = document.createElement("link");
        linkNode.setAttribute("rel", "stylesheet");
        linkNode.setAttribute("type", "text/css");
        linkNode.setAttribute("data-name", name);
        attachListeners(name, linkNode, callback, errorback);
        linkNode.setAttribute("href", cssUrl);
        const head = window.document.head || window.document.getElementsByTagName("head")[0];
        head.appendChild(linkNode);
      }
      function attachListeners(name, linkNode, callback, errorback) {
        const unbind = () => {
          linkNode.removeEventListener("load", loadEventListener);
          linkNode.removeEventListener("error", errorEventListener);
        };
        const loadEventListener = (e) => {
          unbind();
          callback();
        };
        const errorEventListener = (e) => {
          unbind();
          errorback(e);
        };
        linkNode.addEventListener("load", loadEventListener);
        linkNode.addEventListener("error", errorEventListener);
      }
    });
  }
});

// out-build/bootstrap-amd.js
var require_bootstrap_amd = __commonJS({
  "out-build/bootstrap-amd.js"(exports2, module2) {
    "use strict";
    var nodeRequire = require;
    globalThis._VSCODE_NODE_MODULES = new Proxy(/* @__PURE__ */ Object.create(null), { get: (_target, mod) => nodeRequire(String(mod)) });
    globalThis._VSCODE_PRODUCT_JSON = require_bootstrap_meta().product;
    if (process.env["VSCODE_DEV"]) {
      try {
        const overrides = require("../product.overrides.json");
        globalThis._VSCODE_PRODUCT_JSON = Object.assign(globalThis._VSCODE_PRODUCT_JSON, overrides);
      } catch (error) {
      }
    }
    globalThis._VSCODE_PACKAGE_JSON = require_bootstrap_meta().pkg;
    globalThis._VSCODE_FILE_ROOT = __dirname;
    var bootstrapNode2 = require_bootstrap_node();
    var performance3 = require_performance();
    var fs = require("fs");
    var setupNLSResult = void 0;
    function setupNLS() {
      if (!setupNLSResult) {
        setupNLSResult = doSetupNLS();
      }
      return setupNLSResult;
    }
    async function doSetupNLS() {
      performance3.mark("code/amd/willLoadNls");
      let nlsConfig = void 0;
      let messagesFile;
      if (process.env["VSCODE_NLS_CONFIG"]) {
        try {
          nlsConfig = JSON.parse(process.env["VSCODE_NLS_CONFIG"]);
          if (nlsConfig?.languagePack?.messagesFile) {
            messagesFile = nlsConfig.languagePack.messagesFile;
          } else if (nlsConfig?.defaultMessagesFile) {
            messagesFile = nlsConfig.defaultMessagesFile;
          }
          globalThis._VSCODE_NLS_LANGUAGE = nlsConfig?.resolvedLanguage;
        } catch (e) {
          console.error(`Error reading VSCODE_NLS_CONFIG from environment: ${e}`);
        }
      }
      if (process.env["VSCODE_DEV"] || // no NLS support in dev mode
      !messagesFile) {
        return void 0;
      }
      try {
        globalThis._VSCODE_NLS_MESSAGES = JSON.parse((await fs.promises.readFile(messagesFile)).toString());
      } catch (error) {
        console.error(`Error reading NLS messages file ${messagesFile}: ${error}`);
        if (nlsConfig?.languagePack?.corruptMarkerFile) {
          try {
            await fs.promises.writeFile(nlsConfig.languagePack.corruptMarkerFile, "corrupted");
          } catch (error2) {
            console.error(`Error writing corrupted NLS marker file: ${error2}`);
          }
        }
        if (nlsConfig?.defaultMessagesFile && nlsConfig.defaultMessagesFile !== messagesFile) {
          try {
            globalThis._VSCODE_NLS_MESSAGES = JSON.parse((await fs.promises.readFile(nlsConfig.defaultMessagesFile)).toString());
          } catch (error2) {
            console.error(`Error reading default NLS messages file ${nlsConfig.defaultMessagesFile}: ${error2}`);
          }
        }
      }
      performance3.mark("code/amd/didLoadNls");
      return nlsConfig;
    }
    var loader = require_loader();
    loader.config({
      baseUrl: bootstrapNode2.fileUriFromPath(__dirname, { isWindows: process.platform === "win32" }),
      catchError: true,
      nodeRequire,
      amdModulesPattern: /^vs\//,
      recordStats: true
    });
    if (process.env["ELECTRON_RUN_AS_NODE"] || process.versions["electron"]) {
      loader.define("fs", ["original-fs"], function(originalFS) {
        return originalFS;
      });
    }
    module2.exports.load = function(entrypoint, onLoad, onError) {
      if (!entrypoint) {
        return;
      }
      if (process.env["VSCODE_CODE_CACHE_PATH"]) {
        loader.config({
          nodeCachedData: {
            path: process.env["VSCODE_CODE_CACHE_PATH"],
            seed: entrypoint
          }
        });
      }
      onLoad = onLoad || function() {
      };
      onError = onError || function(err) {
        console.error(err);
      };
      setupNLS().then(() => {
        performance3.mark("code/fork/willLoadCode");
        loader([entrypoint], onLoad, onError);
      });
    };
  }
});

// out-build/vs/base/node/nls.js
var require_nls = __commonJS({
  "out-build/vs/base/node/nls.js"(exports2, module2) {
    "use strict";
    (function() {
      function factory(path2, fs, perf2) {
        async function exists(path3) {
          try {
            await fs.promises.access(path3);
            return true;
          } catch {
            return false;
          }
        }
        function touch(path3) {
          const date = /* @__PURE__ */ new Date();
          return fs.promises.utimes(path3, date, date);
        }
        async function getLanguagePackConfigurations(userDataPath) {
          const configFile = path2.join(userDataPath, "languagepacks.json");
          try {
            return JSON.parse(await fs.promises.readFile(configFile, "utf-8"));
          } catch (err) {
            return void 0;
          }
        }
        function resolveLanguagePackLanguage(languagePacks, locale) {
          try {
            while (locale) {
              if (languagePacks[locale]) {
                return locale;
              }
              const index = locale.lastIndexOf("-");
              if (index > 0) {
                locale = locale.substring(0, index);
              } else {
                return void 0;
              }
            }
          } catch (error) {
            console.error("Resolving language pack configuration failed.", error);
          }
          return void 0;
        }
        function defaultNLSConfiguration(userLocale, osLocale, nlsMetadataPath) {
          perf2.mark("code/didGenerateNls");
          return {
            userLocale,
            osLocale,
            resolvedLanguage: "en",
            defaultMessagesFile: path2.join(nlsMetadataPath, "nls.messages.json"),
            // NLS: below 2 are a relic from old times only used by vscode-nls and deprecated
            locale: userLocale,
            availableLanguages: {}
          };
        }
        async function resolveNLSConfiguration2({ userLocale, osLocale, userDataPath, commit, nlsMetadataPath }) {
          perf2.mark("code/willGenerateNls");
          if (process.env["VSCODE_DEV"] || userLocale === "pseudo" || userLocale.startsWith("en") || !commit || !userDataPath) {
            return defaultNLSConfiguration(userLocale, osLocale, nlsMetadataPath);
          }
          try {
            const languagePacks = await getLanguagePackConfigurations(userDataPath);
            if (!languagePacks) {
              return defaultNLSConfiguration(userLocale, osLocale, nlsMetadataPath);
            }
            const resolvedLanguage = resolveLanguagePackLanguage(languagePacks, userLocale);
            if (!resolvedLanguage) {
              return defaultNLSConfiguration(userLocale, osLocale, nlsMetadataPath);
            }
            const languagePack = languagePacks[resolvedLanguage];
            const mainLanguagePackPath = languagePack?.translations?.["vscode"];
            if (!languagePack || typeof languagePack.hash !== "string" || !languagePack.translations || typeof mainLanguagePackPath !== "string" || !await exists(mainLanguagePackPath)) {
              return defaultNLSConfiguration(userLocale, osLocale, nlsMetadataPath);
            }
            const languagePackId = `${languagePack.hash}.${resolvedLanguage}`;
            const globalLanguagePackCachePath = path2.join(userDataPath, "clp", languagePackId);
            const commitLanguagePackCachePath = path2.join(globalLanguagePackCachePath, commit);
            const languagePackMessagesFile = path2.join(commitLanguagePackCachePath, "nls.messages.json");
            const translationsConfigFile = path2.join(globalLanguagePackCachePath, "tcf.json");
            const languagePackCorruptMarkerFile = path2.join(globalLanguagePackCachePath, "corrupted.info");
            if (await exists(languagePackCorruptMarkerFile)) {
              await fs.promises.rm(globalLanguagePackCachePath, { recursive: true, force: true, maxRetries: 3 });
            }
            const result = {
              userLocale,
              osLocale,
              resolvedLanguage,
              defaultMessagesFile: path2.join(nlsMetadataPath, "nls.messages.json"),
              languagePack: {
                translationsConfigFile,
                messagesFile: languagePackMessagesFile,
                corruptMarkerFile: languagePackCorruptMarkerFile
              },
              // NLS: below properties are a relic from old times only used by vscode-nls and deprecated
              locale: userLocale,
              availableLanguages: { "*": resolvedLanguage },
              _languagePackId: languagePackId,
              _languagePackSupport: true,
              _translationsConfigFile: translationsConfigFile,
              _cacheRoot: globalLanguagePackCachePath,
              _resolvedLanguagePackCoreLocation: commitLanguagePackCachePath,
              _corruptedFile: languagePackCorruptMarkerFile
            };
            if (await exists(commitLanguagePackCachePath)) {
              touch(commitLanguagePackCachePath).catch(() => {
              });
              perf2.mark("code/didGenerateNls");
              return result;
            }
            const [
              ,
              nlsDefaultKeys,
              nlsDefaultMessages,
              nlsPackdata
            ] = await Promise.all([
              fs.promises.mkdir(commitLanguagePackCachePath, { recursive: true }),
              JSON.parse(await fs.promises.readFile(path2.join(nlsMetadataPath, "nls.keys.json"), "utf-8")),
              JSON.parse(await fs.promises.readFile(path2.join(nlsMetadataPath, "nls.messages.json"), "utf-8")),
              JSON.parse(await fs.promises.readFile(mainLanguagePackPath, "utf-8"))
            ]);
            const nlsResult = [];
            let nlsIndex = 0;
            for (const [moduleId, nlsKeys] of nlsDefaultKeys) {
              const moduleTranslations = nlsPackdata.contents[moduleId];
              for (const nlsKey of nlsKeys) {
                nlsResult.push(moduleTranslations?.[nlsKey] || nlsDefaultMessages[nlsIndex]);
                nlsIndex++;
              }
            }
            await Promise.all([
              fs.promises.writeFile(languagePackMessagesFile, JSON.stringify(nlsResult), "utf-8"),
              fs.promises.writeFile(translationsConfigFile, JSON.stringify(languagePack.translations), "utf-8")
            ]);
            perf2.mark("code/didGenerateNls");
            return result;
          } catch (error) {
            console.error("Generating translation files failed.", error);
          }
          return defaultNLSConfiguration(userLocale, osLocale, nlsMetadataPath);
        }
        return {
          resolveNLSConfiguration: resolveNLSConfiguration2
        };
      }
      if (typeof define === "function") {
        define(["path", "fs", "vs/base/common/performance"], function(path2, fs, perf2) {
          return factory(path2, fs, perf2);
        });
      } else if (typeof module2 === "object" && typeof module2.exports === "object") {
        const path2 = require("path");
        const fs = require("fs");
        const perf2 = require_performance();
        module2.exports = factory(path2, fs, perf2);
      } else {
        throw new Error("vs/base/node/nls defined in UNKNOWN context (neither requirejs or commonjs)");
      }
    })();
  }
});

// out-build/server-main.js
delete process.env["ELECTRON_RUN_AS_NODE"];
var path = require("path");
var http = require("http");
var os = require("os");
var readline = require("readline");
var performance2 = require("perf_hooks").performance;
var bootstrapNode = require_bootstrap_node();
var bootstrapAmd = require_bootstrap_amd();
var { resolveNLSConfiguration } = require_nls();
var product = require_bootstrap_meta().product;
var perf = require_performance();
var minimist = require("minimist");
perf.mark("code/server/start");
global.vscodeServerStartTime = performance2.now();
async function start() {
  const parsedArgs = minimist(process.argv.slice(2), {
    boolean: ["start-server", "list-extensions", "print-ip-address", "help", "version", "accept-server-license-terms", "update-extensions"],
    // Start PWB:cert - adding cert and cert-key options to string arg list
    string: ["install-extension", "install-builtin-extension", "uninstall-extension", "locate-extension", "socket-path", "host", "port", "compatibility", "cert-key", "cert"],
    // End PWB:cert
    alias: { help: "h", version: "v" }
  });
  ["host", "port", "accept-server-license-terms"].forEach((e) => {
    if (!parsedArgs[e]) {
      const envValue = process.env[`VSCODE_SERVER_${e.toUpperCase().replace("-", "_")}`];
      if (envValue) {
        parsedArgs[e] = envValue;
      }
    }
  });
  const extensionLookupArgs = ["list-extensions", "locate-extension"];
  const extensionInstallArgs = ["install-extension", "install-builtin-extension", "uninstall-extension", "update-extensions"];
  const shouldSpawnCli = parsedArgs.help || parsedArgs.version || extensionLookupArgs.some((a) => !!parsedArgs[a]) || extensionInstallArgs.some((a) => !!parsedArgs[a]) && !parsedArgs["start-server"];
  const nlsConfiguration = await resolveNLSConfiguration({ userLocale: "en", osLocale: "en", commit: product.commit, userDataPath: "", nlsMetadataPath: __dirname });
  if (shouldSpawnCli) {
    loadCode(nlsConfiguration).then((mod) => {
      mod.spawnCli();
    });
    return;
  }
  let _remoteExtensionHostAgentServer = null;
  let _remoteExtensionHostAgentServerPromise = null;
  const getRemoteExtensionHostAgentServer = () => {
    if (!_remoteExtensionHostAgentServerPromise) {
      _remoteExtensionHostAgentServerPromise = loadCode(nlsConfiguration).then(async (mod) => {
        const server2 = await mod.createServer(address);
        _remoteExtensionHostAgentServer = server2;
        return server2;
      });
    }
    return _remoteExtensionHostAgentServerPromise;
  };
  const fs = require("fs");
  const http2 = require("http");
  const https = require("https");
  const os2 = require("os");
  if (Array.isArray(product.serverLicense) && product.serverLicense.length) {
    console.log(product.serverLicense.join("\n"));
    if (product.serverLicensePrompt && parsedArgs["accept-server-license-terms"] !== true) {
      if (hasStdinWithoutTty()) {
        console.log("To accept the license terms, start the server with --accept-server-license-terms");
        process.exit(1);
      }
      try {
        const accept = await prompt(product.serverLicensePrompt);
        if (!accept) {
          process.exit(1);
        }
      } catch (e) {
        console.log(e);
        process.exit(1);
      }
    }
  }
  let firstRequest = true;
  let firstWebSocket = true;
  let address = null;
  const useSSL = parsedArgs["cert-key"] && parsedArgs["cert"] ? true : false;
  const server = (useSSL ? https : http2).createServer(useSSL ? {
    key: fs.readFileSync(parsedArgs["cert-key"]),
    cert: fs.readFileSync(parsedArgs["cert"])
  } : {}, async (req, res) => {
    if (firstRequest) {
      firstRequest = false;
      perf.mark("code/server/firstRequest");
    }
    const remoteExtensionHostAgentServer = await getRemoteExtensionHostAgentServer();
    return remoteExtensionHostAgentServer.handleRequest(req, res);
  });
  server.on("upgrade", async (req, socket, upgradeHead) => {
    if (firstWebSocket) {
      firstWebSocket = false;
      perf.mark("code/server/firstWebSocket");
    }
    const remoteExtensionHostAgentServer = await getRemoteExtensionHostAgentServer();
    return remoteExtensionHostAgentServer.handleUpgrade(req, socket, upgradeHead);
  });
  server.on("error", async (err) => {
    const remoteExtensionHostAgentServer = await getRemoteExtensionHostAgentServer();
    return remoteExtensionHostAgentServer.handleServerError(err);
  });
  const host = sanitizeStringArg(parsedArgs["host"]) || (parsedArgs["compatibility"] !== "1.63" ? "localhost" : void 0);
  const nodeListenOptions = parsedArgs["socket-path"] ? { path: sanitizeStringArg(parsedArgs["socket-path"]) } : { host, port: await parsePort(host, sanitizeStringArg(parsedArgs["port"])) };
  server.listen(nodeListenOptions, async () => {
    let output = Array.isArray(product.serverGreeting) && product.serverGreeting.length ? `

${product.serverGreeting.join("\n")}

` : ``;
    if (typeof nodeListenOptions.port === "number" && parsedArgs["print-ip-address"]) {
      const ifaces = os2.networkInterfaces();
      Object.keys(ifaces).forEach(function(ifname) {
        ifaces[ifname]?.forEach(function(iface) {
          if (!iface.internal && iface.family === "IPv4") {
            output += `IP Address: ${iface.address}
`;
          }
        });
      });
    }
    address = server.address();
    if (address === null) {
      throw new Error("Unexpected server address");
    }
    output += `Server bound to ${typeof address === "string" ? address : `${address.address}:${address.port} (${address.family})`}
`;
    output += `Extension host agent listening on ${typeof address === "string" ? address : address.port}
`;
    console.log(output);
    perf.mark("code/server/started");
    global.vscodeServerListenTime = performance2.now();
    await getRemoteExtensionHostAgentServer();
  });
  process.on("exit", () => {
    server.close();
    if (_remoteExtensionHostAgentServer) {
      _remoteExtensionHostAgentServer.dispose();
    }
  });
}
function sanitizeStringArg(val) {
  if (Array.isArray(val)) {
    val = val.pop();
  }
  return typeof val === "string" ? val : void 0;
}
async function parsePort(host, strPort) {
  if (strPort) {
    let range;
    if (strPort.match(/^\d+$/)) {
      return parseInt(strPort, 10);
    } else if (range = parseRange(strPort)) {
      const port = await findFreePort(host, range.start, range.end);
      if (port !== void 0) {
        return port;
      }
      console.warn(`--port: Could not find free port in range: ${range.start} - ${range.end} (inclusive).`);
      process.exit(1);
    } else {
      console.warn(`--port "${strPort}" is not a valid number or range. Ranges must be in the form 'from-to' with 'from' an integer larger than 0 and not larger than 'end'.`);
      process.exit(1);
    }
  }
  return 8e3;
}
function parseRange(strRange) {
  const match = strRange.match(/^(\d+)-(\d+)$/);
  if (match) {
    const start2 = parseInt(match[1], 10), end = parseInt(match[2], 10);
    if (start2 > 0 && start2 <= end && end <= 65535) {
      return { start: start2, end };
    }
  }
  return void 0;
}
async function findFreePort(host, start2, end) {
  const testPort = (port) => {
    return new Promise((resolve) => {
      const server = http.createServer();
      server.listen(port, host, () => {
        server.close();
        resolve(true);
      }).on("error", () => {
        resolve(false);
      });
    });
  };
  for (let port = start2; port <= end; port++) {
    if (await testPort(port)) {
      return port;
    }
  }
  return void 0;
}
function loadCode(nlsConfiguration) {
  return new Promise((resolve, reject) => {
    process.env["VSCODE_NLS_CONFIG"] = JSON.stringify(nlsConfiguration);
    process.env["VSCODE_HANDLES_SIGPIPE"] = "true";
    if (process.env["VSCODE_DEV"]) {
      process.env["VSCODE_DEV_INJECT_NODE_MODULE_LOOKUP_PATH"] = process.env["VSCODE_DEV_INJECT_NODE_MODULE_LOOKUP_PATH"] || path.join(__dirname, "..", "remote", "node_modules");
      bootstrapNode.devInjectNodeModuleLookupPath(process.env["VSCODE_DEV_INJECT_NODE_MODULE_LOOKUP_PATH"]);
    } else {
      delete process.env["VSCODE_DEV_INJECT_NODE_MODULE_LOOKUP_PATH"];
    }
    bootstrapAmd.load("vs/server/node/server.main", resolve, reject);
  });
}
function hasStdinWithoutTty() {
  try {
    return !process.stdin.isTTY;
  } catch (error) {
  }
  return false;
}
function prompt(question) {
  const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
  });
  return new Promise((resolve, reject) => {
    rl.question(question + " ", async function(data) {
      rl.close();
      const str = data.toString().trim().toLowerCase();
      if (str === "" || str === "y" || str === "yes") {
        resolve(true);
      } else if (str === "n" || str === "no") {
        resolve(false);
      } else {
        process.stdout.write("\nInvalid Response. Answer either yes (y, yes) or no (n, no)\n");
        resolve(await prompt(question));
      }
    });
  });
}
start();
