@vue/devtools
Version:
StandAlone vue-devtools
1 lines • 1.03 MB
JavaScript
(()=>{"use strict";var __webpack_modules__={985:(__unused_webpack_module,__unused_webpack___webpack_exports__,__webpack_require__)=>{eval('\n// UNUSED EXPORTS: initialize\n\n;// CONCATENATED MODULE: ../../node_modules/monaco-editor/esm/vs/base/common/errors.js\n// Avoid circular dependency on EventEmitter by implementing a subset of the interface.\nclass ErrorHandler {\n constructor() {\n this.listeners = [];\n this.unexpectedErrorHandler = function (e) {\n setTimeout(() => {\n if (e.stack) {\n throw new Error(e.message + \'\\n\\n\' + e.stack);\n }\n throw e;\n }, 0);\n };\n }\n emit(e) {\n this.listeners.forEach((listener) => {\n listener(e);\n });\n }\n onUnexpectedError(e) {\n this.unexpectedErrorHandler(e);\n this.emit(e);\n }\n // For external errors, we don\'t want the listeners to be called\n onUnexpectedExternalError(e) {\n this.unexpectedErrorHandler(e);\n }\n}\nconst errorHandler = new ErrorHandler();\nfunction onUnexpectedError(e) {\n // ignore errors from cancelled promises\n if (!isPromiseCanceledError(e)) {\n errorHandler.onUnexpectedError(e);\n }\n return undefined;\n}\nfunction onUnexpectedExternalError(e) {\n // ignore errors from cancelled promises\n if (!isPromiseCanceledError(e)) {\n errorHandler.onUnexpectedExternalError(e);\n }\n return undefined;\n}\nfunction transformErrorForSerialization(error) {\n if (error instanceof Error) {\n let { name, message } = error;\n const stack = error.stacktrace || error.stack;\n return {\n $isError: true,\n name,\n message,\n stack\n };\n }\n // return as is\n return error;\n}\nconst canceledName = \'Canceled\';\n/**\n * Checks if the given error is a promise in canceled state\n */\nfunction isPromiseCanceledError(error) {\n return error instanceof Error && error.name === canceledName && error.message === canceledName;\n}\n/**\n * Returns an error that signals cancellation.\n */\nfunction canceled() {\n const error = new Error(canceledName);\n error.name = error.message;\n return error;\n}\nfunction errors_illegalArgument(name) {\n if (name) {\n return new Error(`Illegal argument: ${name}`);\n }\n else {\n return new Error(\'Illegal argument\');\n }\n}\nfunction illegalState(name) {\n if (name) {\n return new Error(`Illegal state: ${name}`);\n }\n else {\n return new Error(\'Illegal state\');\n }\n}\n\n;// CONCATENATED MODULE: ../../node_modules/monaco-editor/esm/vs/base/common/iterator.js\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nvar Iterable;\n(function (Iterable) {\n function is(thing) {\n return thing && typeof thing === \'object\' && typeof thing[Symbol.iterator] === \'function\';\n }\n Iterable.is = is;\n const _empty = Object.freeze([]);\n function empty() {\n return _empty;\n }\n Iterable.empty = empty;\n function* single(element) {\n yield element;\n }\n Iterable.single = single;\n function from(iterable) {\n return iterable || _empty;\n }\n Iterable.from = from;\n function isEmpty(iterable) {\n return !iterable || iterable[Symbol.iterator]().next().done === true;\n }\n Iterable.isEmpty = isEmpty;\n function first(iterable) {\n return iterable[Symbol.iterator]().next().value;\n }\n Iterable.first = first;\n function some(iterable, predicate) {\n for (const element of iterable) {\n if (predicate(element)) {\n return true;\n }\n }\n return false;\n }\n Iterable.some = some;\n function find(iterable, predicate) {\n for (const element of iterable) {\n if (predicate(element)) {\n return element;\n }\n }\n return undefined;\n }\n Iterable.find = find;\n function* filter(iterable, predicate) {\n for (const element of iterable) {\n if (predicate(element)) {\n yield element;\n }\n }\n }\n Iterable.filter = filter;\n function* map(iterable, fn) {\n for (const element of iterable) {\n yield fn(element);\n }\n }\n Iterable.map = map;\n function* concat(...iterables) {\n for (const iterable of iterables) {\n for (const element of iterable) {\n yield element;\n }\n }\n }\n Iterable.concat = concat;\n function* concatNested(iterables) {\n for (const iterable of iterables) {\n for (const element of iterable) {\n yield element;\n }\n }\n }\n Iterable.concatNested = concatNested;\n function reduce(iterable, reducer, initialValue) {\n let value = initialValue;\n for (const element of iterable) {\n value = reducer(value, element);\n }\n return value;\n }\n Iterable.reduce = reduce;\n /**\n * Returns an iterable slice of the array, with the same semantics as `array.slice()`.\n */\n function* slice(arr, from, to = arr.length) {\n if (from < 0) {\n from += arr.length;\n }\n if (to < 0) {\n to += arr.length;\n }\n else if (to > arr.length) {\n to = arr.length;\n }\n for (; from < to; from++) {\n yield arr[from];\n }\n }\n Iterable.slice = slice;\n /**\n * Consumes `atMost` elements from iterable and returns the consumed elements,\n * and an iterable for the rest of the elements.\n */\n function consume(iterable, atMost = Number.POSITIVE_INFINITY) {\n const consumed = [];\n if (atMost === 0) {\n return [consumed, iterable];\n }\n const iterator = iterable[Symbol.iterator]();\n for (let i = 0; i < atMost; i++) {\n const next = iterator.next();\n if (next.done) {\n return [consumed, Iterable.empty()];\n }\n consumed.push(next.value);\n }\n return [consumed, { [Symbol.iterator]() { return iterator; } }];\n }\n Iterable.consume = consume;\n /**\n * Returns whether the iterables are the same length and all items are\n * equal using the comparator function.\n */\n function equals(a, b, comparator = (at, bt) => at === bt) {\n const ai = a[Symbol.iterator]();\n const bi = b[Symbol.iterator]();\n while (true) {\n const an = ai.next();\n const bn = bi.next();\n if (an.done !== bn.done) {\n return false;\n }\n else if (an.done) {\n return true;\n }\n else if (!comparator(an.value, bn.value)) {\n return false;\n }\n }\n }\n Iterable.equals = equals;\n})(Iterable || (Iterable = {}));\n\n;// CONCATENATED MODULE: ../../node_modules/monaco-editor/esm/vs/base/common/lifecycle.js\n\n/**\n * Enables logging of potentially leaked disposables.\n *\n * A disposable is considered leaked if it is not disposed or not registered as the child of\n * another disposable. This tracking is very simple an only works for classes that either\n * extend Disposable or use a DisposableStore. This means there are a lot of false positives.\n */\nconst TRACK_DISPOSABLES = false;\nlet disposableTracker = null;\nif (TRACK_DISPOSABLES) {\n const __is_disposable_tracked__ = \'__is_disposable_tracked__\';\n disposableTracker = new class {\n trackDisposable(x) {\n const stack = new Error(\'Potentially leaked disposable\').stack;\n setTimeout(() => {\n if (!x[__is_disposable_tracked__]) {\n console.log(stack);\n }\n }, 3000);\n }\n markTracked(x) {\n if (x && x !== lifecycle_Disposable.None) {\n try {\n x[__is_disposable_tracked__] = true;\n }\n catch (_a) {\n // noop\n }\n }\n }\n };\n}\nfunction markTracked(x) {\n if (!disposableTracker) {\n return;\n }\n disposableTracker.markTracked(x);\n}\nfunction trackDisposable(x) {\n if (!disposableTracker) {\n return x;\n }\n disposableTracker.trackDisposable(x);\n return x;\n}\nclass MultiDisposeError extends Error {\n constructor(errors) {\n super(`Encountered errors while disposing of store. Errors: [${errors.join(\', \')}]`);\n this.errors = errors;\n }\n}\nfunction isDisposable(thing) {\n return typeof thing.dispose === \'function\' && thing.dispose.length === 0;\n}\nfunction dispose(arg) {\n if (Iterable.is(arg)) {\n let errors = [];\n for (const d of arg) {\n if (d) {\n markTracked(d);\n try {\n d.dispose();\n }\n catch (e) {\n errors.push(e);\n }\n }\n }\n if (errors.length === 1) {\n throw errors[0];\n }\n else if (errors.length > 1) {\n throw new MultiDisposeError(errors);\n }\n return Array.isArray(arg) ? [] : arg;\n }\n else if (arg) {\n markTracked(arg);\n arg.dispose();\n return arg;\n }\n}\nfunction combinedDisposable(...disposables) {\n disposables.forEach(markTracked);\n return toDisposable(() => dispose(disposables));\n}\nfunction toDisposable(fn) {\n const self = trackDisposable({\n dispose: () => {\n markTracked(self);\n fn();\n }\n });\n return self;\n}\nclass DisposableStore {\n constructor() {\n this._toDispose = new Set();\n this._isDisposed = false;\n }\n /**\n * Dispose of all registered disposables and mark this object as disposed.\n *\n * Any future disposables added to this object will be disposed of on `add`.\n */\n dispose() {\n if (this._isDisposed) {\n return;\n }\n markTracked(this);\n this._isDisposed = true;\n this.clear();\n }\n /**\n * Dispose of all registered disposables but do not mark this object as disposed.\n */\n clear() {\n try {\n dispose(this._toDispose.values());\n }\n finally {\n this._toDispose.clear();\n }\n }\n add(t) {\n if (!t) {\n return t;\n }\n if (t === this) {\n throw new Error(\'Cannot register a disposable on itself!\');\n }\n markTracked(t);\n if (this._isDisposed) {\n if (!DisposableStore.DISABLE_DISPOSED_WARNING) {\n console.warn(new Error(\'Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!\').stack);\n }\n }\n else {\n this._toDispose.add(t);\n }\n return t;\n }\n}\nDisposableStore.DISABLE_DISPOSED_WARNING = false;\nclass lifecycle_Disposable {\n constructor() {\n this._store = new DisposableStore();\n trackDisposable(this);\n }\n dispose() {\n markTracked(this);\n this._store.dispose();\n }\n _register(t) {\n if (t === this) {\n throw new Error(\'Cannot register a disposable on itself!\');\n }\n return this._store.add(t);\n }\n}\nlifecycle_Disposable.None = Object.freeze({ dispose() { } });\n/**\n * Manages the lifecycle of a disposable value that may be changed.\n *\n * This ensures that when the disposable value is changed, the previously held disposable is disposed of. You can\n * also register a `MutableDisposable` on a `Disposable` to ensure it is automatically cleaned up.\n */\nclass MutableDisposable {\n constructor() {\n this._isDisposed = false;\n trackDisposable(this);\n }\n get value() {\n return this._isDisposed ? undefined : this._value;\n }\n set value(value) {\n var _a;\n if (this._isDisposed || value === this._value) {\n return;\n }\n (_a = this._value) === null || _a === void 0 ? void 0 : _a.dispose();\n if (value) {\n markTracked(value);\n }\n this._value = value;\n }\n clear() {\n this.value = undefined;\n }\n dispose() {\n var _a;\n this._isDisposed = true;\n markTracked(this);\n (_a = this._value) === null || _a === void 0 ? void 0 : _a.dispose();\n this._value = undefined;\n }\n}\nclass ImmortalReference {\n constructor(object) {\n this.object = object;\n }\n dispose() { }\n}\n\n;// CONCATENATED MODULE: ../../node_modules/monaco-editor/esm/vs/base/common/platform.js\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nvar _a;\nconst LANGUAGE_DEFAULT = \'en\';\nlet _isWindows = false;\nlet _isMacintosh = false;\nlet _isLinux = false;\nlet _isLinuxSnap = false;\nlet _isNative = false;\nlet _isWeb = false;\nlet _isIOS = false;\nlet _locale = undefined;\nlet _language = (/* unused pure expression or super */ null && (LANGUAGE_DEFAULT));\nlet _translationsConfigFile = (/* unused pure expression or super */ null && (undefined));\nlet _userAgent = undefined;\nconst globals = (typeof self === \'object\' ? self : typeof __webpack_require__.g === \'object\' ? __webpack_require__.g : {});\nlet nodeProcess = undefined;\nif (typeof globals.vscode !== \'undefined\' && typeof globals.vscode.process !== \'undefined\') {\n // Native environment (sandboxed)\n nodeProcess = globals.vscode.process;\n}\nelse if (typeof process !== \'undefined\') {\n // Native environment (non-sandboxed)\n nodeProcess = process;\n}\nconst isElectronRenderer = typeof ((_a = nodeProcess === null || nodeProcess === void 0 ? void 0 : nodeProcess.versions) === null || _a === void 0 ? void 0 : _a.electron) === \'string\' && nodeProcess.type === \'renderer\';\nconst isElectronSandboxed = isElectronRenderer && (nodeProcess === null || nodeProcess === void 0 ? void 0 : nodeProcess.sandboxed);\nconst browserCodeLoadingCacheStrategy = (() => {\n // Always enabled when sandbox is enabled\n if (isElectronSandboxed) {\n return \'bypassHeatCheck\';\n }\n // Otherwise, only enabled conditionally\n const env = nodeProcess === null || nodeProcess === void 0 ? void 0 : nodeProcess.env[\'VSCODE_BROWSER_CODE_LOADING\'];\n if (typeof env === \'string\') {\n if (env === \'none\' || env === \'code\' || env === \'bypassHeatCheck\' || env === \'bypassHeatCheckAndEagerCompile\') {\n return env;\n }\n return \'bypassHeatCheck\';\n }\n return undefined;\n})();\nconst isPreferringBrowserCodeLoad = typeof browserCodeLoadingCacheStrategy === \'string\';\n// Web environment\nif (typeof navigator === \'object\' && !isElectronRenderer) {\n _userAgent = navigator.userAgent;\n _isWindows = _userAgent.indexOf(\'Windows\') >= 0;\n _isMacintosh = _userAgent.indexOf(\'Macintosh\') >= 0;\n _isIOS = (_userAgent.indexOf(\'Macintosh\') >= 0 || _userAgent.indexOf(\'iPad\') >= 0 || _userAgent.indexOf(\'iPhone\') >= 0) && !!navigator.maxTouchPoints && navigator.maxTouchPoints > 0;\n _isLinux = _userAgent.indexOf(\'Linux\') >= 0;\n _isWeb = true;\n _locale = navigator.language;\n _language = _locale;\n}\n// Native environment\nelse if (typeof nodeProcess === \'object\') {\n _isWindows = (nodeProcess.platform === \'win32\');\n _isMacintosh = (nodeProcess.platform === \'darwin\');\n _isLinux = (nodeProcess.platform === \'linux\');\n _isLinuxSnap = _isLinux && !!nodeProcess.env[\'SNAP\'] && !!nodeProcess.env[\'SNAP_REVISION\'];\n _locale = LANGUAGE_DEFAULT;\n _language = LANGUAGE_DEFAULT;\n const rawNlsConfig = nodeProcess.env[\'VSCODE_NLS_CONFIG\'];\n if (rawNlsConfig) {\n try {\n const nlsConfig = JSON.parse(rawNlsConfig);\n const resolved = nlsConfig.availableLanguages[\'*\'];\n _locale = nlsConfig.locale;\n // VSCode\'s default language is \'en\'\n _language = resolved ? resolved : LANGUAGE_DEFAULT;\n _translationsConfigFile = nlsConfig._translationsConfigFile;\n }\n catch (e) {\n }\n }\n _isNative = true;\n}\n// Unknown environment\nelse {\n console.error(\'Unable to resolve platform.\');\n}\nlet _platform = 0 /* Web */;\nif (_isMacintosh) {\n _platform = 1 /* Mac */;\n}\nelse if (_isWindows) {\n _platform = 3 /* Windows */;\n}\nelse if (_isLinux) {\n _platform = 2 /* Linux */;\n}\nconst isWindows = _isWindows;\nconst isMacintosh = _isMacintosh;\nconst isLinux = (/* unused pure expression or super */ null && (_isLinux));\nconst isNative = (/* unused pure expression or super */ null && (_isNative));\nconst platform_isWeb = (/* unused pure expression or super */ null && (_isWeb));\nconst isIOS = (/* unused pure expression or super */ null && (_isIOS));\nconst userAgent = (/* unused pure expression or super */ null && (_userAgent));\nconst setImmediate = (function defineSetImmediate() {\n if (globals.setImmediate) {\n return globals.setImmediate.bind(globals);\n }\n if (typeof globals.postMessage === \'function\' && !globals.importScripts) {\n let pending = [];\n globals.addEventListener(\'message\', (e) => {\n if (e.data && e.data.vscodeSetImmediateId) {\n for (let i = 0, len = pending.length; i < len; i++) {\n const candidate = pending[i];\n if (candidate.id === e.data.vscodeSetImmediateId) {\n pending.splice(i, 1);\n candidate.callback();\n return;\n }\n }\n }\n });\n let lastId = 0;\n return (callback) => {\n const myId = ++lastId;\n pending.push({\n id: myId,\n callback: callback\n });\n globals.postMessage({ vscodeSetImmediateId: myId }, \'*\');\n };\n }\n if (typeof (nodeProcess === null || nodeProcess === void 0 ? void 0 : nodeProcess.nextTick) === \'function\') {\n return nodeProcess.nextTick.bind(nodeProcess);\n }\n const _promise = Promise.resolve();\n return (callback) => _promise.then(callback);\n})();\nconst OS = (_isMacintosh || _isIOS ? 2 /* Macintosh */ : (_isWindows ? 1 /* Windows */ : 3 /* Linux */));\nlet _isLittleEndian = true;\nlet _isLittleEndianComputed = false;\nfunction isLittleEndian() {\n if (!_isLittleEndianComputed) {\n _isLittleEndianComputed = true;\n const test = new Uint8Array(2);\n test[0] = 1;\n test[1] = 2;\n const view = new Uint16Array(test.buffer);\n _isLittleEndian = (view[0] === (2 << 8) + 1);\n }\n return _isLittleEndian;\n}\n\n;// CONCATENATED MODULE: ../../node_modules/monaco-editor/esm/vs/base/common/types.js\n/**\n * @returns whether the provided parameter is a JavaScript Array or not.\n */\nfunction isArray(array) {\n return Array.isArray(array);\n}\n/**\n * @returns whether the provided parameter is a JavaScript String or not.\n */\nfunction isString(str) {\n return (typeof str === \'string\');\n}\n/**\n *\n * @returns whether the provided parameter is of type `object` but **not**\n *\t`null`, an `array`, a `regexp`, nor a `date`.\n */\nfunction isObject(obj) {\n // The method can\'t do a type cast since there are type (like strings) which\n // are subclasses of any put not positvely matched by the function. Hence type\n // narrowing results in wrong results.\n return typeof obj === \'object\'\n && obj !== null\n && !Array.isArray(obj)\n && !(obj instanceof RegExp)\n && !(obj instanceof Date);\n}\n/**\n * In **contrast** to just checking `typeof` this will return `false` for `NaN`.\n * @returns whether the provided parameter is a JavaScript Number or not.\n */\nfunction isNumber(obj) {\n return (typeof obj === \'number\' && !isNaN(obj));\n}\n/**\n * @returns whether the provided parameter is a JavaScript Boolean or not.\n */\nfunction isBoolean(obj) {\n return (obj === true || obj === false);\n}\n/**\n * @returns whether the provided parameter is undefined.\n */\nfunction isUndefined(obj) {\n return (typeof obj === \'undefined\');\n}\n/**\n * @returns whether the provided parameter is undefined or null.\n */\nfunction isUndefinedOrNull(obj) {\n return (isUndefined(obj) || obj === null);\n}\nfunction assertType(condition, type) {\n if (!condition) {\n throw new Error(type ? `Unexpected type, expected \'${type}\'` : \'Unexpected type\');\n }\n}\n/**\n * Asserts that the argument passed in is neither undefined nor null.\n */\nfunction assertIsDefined(arg) {\n if (isUndefinedOrNull(arg)) {\n throw new Error(\'Assertion Failed: argument is undefined or null\');\n }\n return arg;\n}\n/**\n * @returns whether the provided parameter is a JavaScript Function or not.\n */\nfunction isFunction(obj) {\n return (typeof obj === \'function\');\n}\nfunction validateConstraints(args, constraints) {\n const len = Math.min(args.length, constraints.length);\n for (let i = 0; i < len; i++) {\n validateConstraint(args[i], constraints[i]);\n }\n}\nfunction validateConstraint(arg, constraint) {\n if (isString(constraint)) {\n if (typeof arg !== constraint) {\n throw new Error(`argument does not match constraint: typeof ${constraint}`);\n }\n }\n else if (isFunction(constraint)) {\n try {\n if (arg instanceof constraint) {\n return;\n }\n }\n catch (_a) {\n // ignore\n }\n if (!isUndefinedOrNull(arg) && arg.constructor === constraint) {\n return;\n }\n if (constraint.length === 1 && constraint.call(undefined, arg) === true) {\n return;\n }\n throw new Error(`argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true`);\n }\n}\nfunction getAllPropertyNames(obj) {\n let res = [];\n let proto = Object.getPrototypeOf(obj);\n while (Object.prototype !== proto) {\n res = res.concat(Object.getOwnPropertyNames(proto));\n proto = Object.getPrototypeOf(proto);\n }\n return res;\n}\nfunction getAllMethodNames(obj) {\n const methods = [];\n for (const prop of getAllPropertyNames(obj)) {\n if (typeof obj[prop] === \'function\') {\n methods.push(prop);\n }\n }\n return methods;\n}\nfunction createProxyObject(methodNames, invoke) {\n const createProxyMethod = (method) => {\n return function () {\n const args = Array.prototype.slice.call(arguments, 0);\n return invoke(method, args);\n };\n };\n let result = {};\n for (const methodName of methodNames) {\n result[methodName] = createProxyMethod(methodName);\n }\n return result;\n}\n/**\n * Converts null to undefined, passes all other values through.\n */\nfunction withNullAsUndefined(x) {\n return x === null ? undefined : x;\n}\n\n;// CONCATENATED MODULE: ../../node_modules/monaco-editor/esm/vs/base/common/worker/simpleWorker.js\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n\n\n\n\nconst INITIALIZE = \'$initialize\';\nlet webWorkerWarningLogged = false;\nfunction logOnceWebWorkerWarning(err) {\n if (!isWeb) {\n // running tests\n return;\n }\n if (!webWorkerWarningLogged) {\n webWorkerWarningLogged = true;\n console.warn(\'Could not create web worker(s). Falling back to loading web worker code in main thread, which might cause UI freezes. Please see https://github.com/microsoft/monaco-editor#faq\');\n }\n console.warn(err.message);\n}\nclass SimpleWorkerProtocol {\n constructor(handler) {\n this._workerId = -1;\n this._handler = handler;\n this._lastSentReq = 0;\n this._pendingReplies = Object.create(null);\n }\n setWorkerId(workerId) {\n this._workerId = workerId;\n }\n sendMessage(method, args) {\n let req = String(++this._lastSentReq);\n return new Promise((resolve, reject) => {\n this._pendingReplies[req] = {\n resolve: resolve,\n reject: reject\n };\n this._send({\n vsWorker: this._workerId,\n req: req,\n method: method,\n args: args\n });\n });\n }\n handleMessage(message) {\n if (!message || !message.vsWorker) {\n return;\n }\n if (this._workerId !== -1 && message.vsWorker !== this._workerId) {\n return;\n }\n this._handleMessage(message);\n }\n _handleMessage(msg) {\n if (msg.seq) {\n let replyMessage = msg;\n if (!this._pendingReplies[replyMessage.seq]) {\n console.warn(\'Got reply to unknown seq\');\n return;\n }\n let reply = this._pendingReplies[replyMessage.seq];\n delete this._pendingReplies[replyMessage.seq];\n if (replyMessage.err) {\n let err = replyMessage.err;\n if (replyMessage.err.$isError) {\n err = new Error();\n err.name = replyMessage.err.name;\n err.message = replyMessage.err.message;\n err.stack = replyMessage.err.stack;\n }\n reply.reject(err);\n return;\n }\n reply.resolve(replyMessage.res);\n return;\n }\n let requestMessage = msg;\n let req = requestMessage.req;\n let result = this._handler.handleMessage(requestMessage.method, requestMessage.args);\n result.then((r) => {\n this._send({\n vsWorker: this._workerId,\n seq: req,\n res: r,\n err: undefined\n });\n }, (e) => {\n if (e.detail instanceof Error) {\n // Loading errors have a detail property that points to the actual error\n e.detail = transformErrorForSerialization(e.detail);\n }\n this._send({\n vsWorker: this._workerId,\n seq: req,\n res: undefined,\n err: transformErrorForSerialization(e)\n });\n });\n }\n _send(msg) {\n let transfer = [];\n if (msg.req) {\n const m = msg;\n for (let i = 0; i < m.args.length; i++) {\n if (m.args[i] instanceof ArrayBuffer) {\n transfer.push(m.args[i]);\n }\n }\n }\n else {\n const m = msg;\n if (m.res instanceof ArrayBuffer) {\n transfer.push(m.res);\n }\n }\n this._handler.sendMessage(msg, transfer);\n }\n}\n/**\n * Main thread side\n */\nclass SimpleWorkerClient extends (/* unused pure expression or super */ null && (Disposable)) {\n constructor(workerFactory, moduleId, host) {\n super();\n let lazyProxyReject = null;\n this._worker = this._register(workerFactory.create(\'vs/base/common/worker/simpleWorker\', (msg) => {\n this._protocol.handleMessage(msg);\n }, (err) => {\n // in Firefox, web workers fail lazily :(\n // we will reject the proxy\n if (lazyProxyReject) {\n lazyProxyReject(err);\n }\n }));\n this._protocol = new SimpleWorkerProtocol({\n sendMessage: (msg, transfer) => {\n this._worker.postMessage(msg, transfer);\n },\n handleMessage: (method, args) => {\n if (typeof host[method] !== \'function\') {\n return Promise.reject(new Error(\'Missing method \' + method + \' on main thread host.\'));\n }\n try {\n return Promise.resolve(host[method].apply(host, args));\n }\n catch (e) {\n return Promise.reject(e);\n }\n }\n });\n this._protocol.setWorkerId(this._worker.getId());\n // Gather loader configuration\n let loaderConfiguration = null;\n if (typeof self.require !== \'undefined\' && typeof self.require.getConfig === \'function\') {\n // Get the configuration from the Monaco AMD Loader\n loaderConfiguration = self.require.getConfig();\n }\n else if (typeof self.requirejs !== \'undefined\') {\n // Get the configuration from requirejs\n loaderConfiguration = self.requirejs.s.contexts._.config;\n }\n const hostMethods = types.getAllMethodNames(host);\n // Send initialize message\n this._onModuleLoaded = this._protocol.sendMessage(INITIALIZE, [\n this._worker.getId(),\n JSON.parse(JSON.stringify(loaderConfiguration)),\n moduleId,\n hostMethods,\n ]);\n // Create proxy to loaded code\n const proxyMethodRequest = (method, args) => {\n return this._request(method, args);\n };\n this._lazyProxy = new Promise((resolve, reject) => {\n lazyProxyReject = reject;\n this._onModuleLoaded.then((availableMethods) => {\n resolve(types.createProxyObject(availableMethods, proxyMethodRequest));\n }, (e) => {\n reject(e);\n this._onError(\'Worker failed to load \' + moduleId, e);\n });\n });\n }\n getProxyObject() {\n return this._lazyProxy;\n }\n _request(method, args) {\n return new Promise((resolve, reject) => {\n this._onModuleLoaded.then(() => {\n this._protocol.sendMessage(method, args).then(resolve, reject);\n }, reject);\n });\n }\n _onError(message, error) {\n console.error(message);\n console.info(error);\n }\n}\n/**\n * Worker side\n */\nclass SimpleWorkerServer {\n constructor(postMessage, requestHandlerFactory) {\n this._requestHandlerFactory = requestHandlerFactory;\n this._requestHandler = null;\n this._protocol = new SimpleWorkerProtocol({\n sendMessage: (msg, transfer) => {\n postMessage(msg, transfer);\n },\n handleMessage: (method, args) => this._handleMessage(method, args)\n });\n }\n onmessage(msg) {\n this._protocol.handleMessage(msg);\n }\n _handleMessage(method, args) {\n if (method === INITIALIZE) {\n return this.initialize(args[0], args[1], args[2], args[3]);\n }\n if (!this._requestHandler || typeof this._requestHandler[method] !== \'function\') {\n return Promise.reject(new Error(\'Missing requestHandler or method: \' + method));\n }\n try {\n return Promise.resolve(this._requestHandler[method].apply(this._requestHandler, args));\n }\n catch (e) {\n return Promise.reject(e);\n }\n }\n initialize(workerId, loaderConfig, moduleId, hostMethods) {\n this._protocol.setWorkerId(workerId);\n const proxyMethodRequest = (method, args) => {\n return this._protocol.sendMessage(method, args);\n };\n const hostProxy = createProxyObject(hostMethods, proxyMethodRequest);\n if (this._requestHandlerFactory) {\n // static request handler\n this._requestHandler = this._requestHandlerFactory(hostProxy);\n return Promise.resolve(getAllMethodNames(this._requestHandler));\n }\n if (loaderConfig) {\n // Remove \'baseUrl\', handling it is beyond scope for now\n if (typeof loaderConfig.baseUrl !== \'undefined\') {\n delete loaderConfig[\'baseUrl\'];\n }\n if (typeof loaderConfig.paths !== \'undefined\') {\n if (typeof loaderConfig.paths.vs !== \'undefined\') {\n delete loaderConfig.paths[\'vs\'];\n }\n }\n if (typeof loaderConfig.trustedTypesPolicy !== undefined) {\n // don\'t use, it has been destroyed during serialize\n delete loaderConfig[\'trustedTypesPolicy\'];\n }\n // Since this is in a web worker, enable catching errors\n loaderConfig.catchError = true;\n self.require.config(loaderConfig);\n }\n return new Promise((resolve, reject) => {\n // Use the global require to be sure to get the global config\n self.require([moduleId], (module) => {\n this._requestHandler = module.create(hostProxy);\n if (!this._requestHandler) {\n reject(new Error(`No RequestHandler!`));\n return;\n }\n resolve(getAllMethodNames(this._requestHandler));\n }, reject);\n });\n }\n}\n/**\n * Called on the worker side\n */\nfunction create(postMessage) {\n return new SimpleWorkerServer(postMessage, null);\n}\n\n;// CONCATENATED MODULE: ../../node_modules/monaco-editor/esm/vs/base/common/diff/diffChange.js\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n/**\n * Represents information about a specific difference between two sequences.\n */\nclass DiffChange {\n /**\n * Constructs a new DiffChange with the given sequence information\n * and content.\n */\n constructor(originalStart, originalLength, modifiedStart, modifiedLength) {\n //Debug.Assert(originalLength > 0 || modifiedLength > 0, "originalLength and modifiedLength cannot both be <= 0");\n this.originalStart = originalStart;\n this.originalLength = originalLength;\n this.modifiedStart = modifiedStart;\n this.modifiedLength = modifiedLength;\n }\n /**\n * The end point (exclusive) of the change in the original sequence.\n */\n getOriginalEnd() {\n return this.originalStart + this.originalLength;\n }\n /**\n * The end point (exclusive) of the change in the modified sequence.\n */\n getModifiedEnd() {\n return this.modifiedStart + this.modifiedLength;\n }\n}\n\n;// CONCATENATED MODULE: ../../node_modules/monaco-editor/esm/vs/base/common/strings.js\n/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nfunction isFalsyOrWhitespace(str) {\n if (!str || typeof str !== \'string\') {\n return true;\n }\n return str.trim().length === 0;\n}\nconst _formatRegexp = /{(\\d+)}/g;\n/**\n * Helper to produce a string with a variable number of arguments. Insert variable segments\n * into the string using the {n} notation where N is the index of the argument following the string.\n * @param value string to which formatting is applied\n * @param args replacements for {n}-entries\n */\nfunction format(value, ...args) {\n if (args.length === 0) {\n return value;\n }\n return value.replace(_formatRegexp, function (match, group) {\n const idx = parseInt(group, 10);\n return isNaN(idx) || idx < 0 || idx >= args.length ?\n match :\n args[idx];\n });\n}\n/**\n * Converts HTML characters inside the string to use entities instead. Makes the string safe from\n * being used e.g. in HTMLElement.innerHTML.\n */\nfunction strings_escape(html) {\n return html.replace(/[<>&]/g, function (match) {\n switch (match) {\n case \'<\': return \'<\';\n case \'>\': return \'>\';\n case \'&\': return \'&\';\n default: return match;\n }\n });\n}\n/**\n * Escapes regular expression characters in a given string\n */\nfunction escapeRegExpCharacters(value) {\n return value.replace(/[\\\\\\{\\}\\*\\+\\?\\|\\^\\$\\.\\[\\]\\(\\)]/g, \'\\\\$&\');\n}\n/**\n * Removes all occurrences of needle from the beginning and end of haystack.\n * @param haystack string to trim\n * @param needle the thing to trim (default is a blank)\n */\nfunction trim(haystack, needle = \' \') {\n const trimmed = ltrim(haystack, needle);\n return rtrim(trimmed, needle);\n}\n/**\n * Removes all occurrences of needle from the beginning of haystack.\n * @param haystack string to trim\n * @param needle the thing to trim\n */\nfunction ltrim(haystack, needle) {\n if (!haystack || !needle) {\n return haystack;\n }\n const needleLen = needle.length;\n if (needleLen === 0 || haystack.length === 0) {\n return haystack;\n }\n let offset = 0;\n while (haystack.indexOf(needle, offset) === offset) {\n offset = offset + needleLen;\n }\n return haystack.substring(offset);\n}\n/**\n * Removes all occurrences of needle from the end of haystack.\n * @param haystack string to trim\n * @param needle the thing to trim\n */\nfunction rtrim(haystack, needle) {\n if (!haystack || !needle) {\n return haystack;\n }\n const needleLen = needle.length, haystackLen = haystack.length;\n if (needleLen === 0 || haystackLen === 0) {\n return haystack;\n }\n let offset = haystackLen, idx = -1;\n while (true) {\n idx = haystack.lastIndexOf(needle, offset - 1);\n if (idx === -1 || idx + needleLen !== offset) {\n break;\n }\n if (idx === 0) {\n return \'\';\n }\n offset = idx;\n }\n return haystack.substring(0, offset);\n}\nfunction convertSimple2RegExpPattern(pattern) {\n return pattern.replace(/[\\-\\\\\\{\\}\\+\\?\\|\\^\\$\\.\\,\\[\\]\\(\\)\\#\\s]/g, \'\\\\$&\').replace(/[\\*]/g, \'.*\');\n}\nfunction stripWildcards(pattern) {\n return pattern.replace(/\\*/g, \'\');\n}\nfunction createRegExp(searchString, isRegex, options = {}) {\n if (!searchString) {\n throw new Error(\'Cannot create regex from empty string\');\n }\n if (!isRegex) {\n searchString = escapeRegExpCharacters(searchString);\n }\n if (options.wholeWord) {\n if (!/\\B/.test(searchString.charAt(0))) {\n searchString = \'\\\\b\' + searchString;\n }\n if (!/\\B/.test(searchString.charAt(searchString.length - 1))) {\n searchString = searchString + \'\\\\b\';\n }\n }\n let modifiers = \'\';\n if (options.global) {\n modifiers += \'g\';\n }\n if (!options.matchCase) {\n modifiers += \'i\';\n }\n if (options.multiline) {\n modifiers += \'m\';\n }\n if (options.unicode) {\n modifiers += \'u\';\n }\n return new RegExp(searchString, modifiers);\n}\nfunction regExpLeadsToEndlessLoop(regexp) {\n // Exit early if it\'s one of these special cases which are meant to match\n // against an empty string\n if (regexp.source === \'^\' || regexp.source === \'^$\' || regexp.source === \'$\' || regexp.source === \'^\\\\s*$\') {\n return false;\n }\n // We check against an empty string. If the regular expression doesn\'t advance\n // (e.g. ends in an endless loop) it will match an empty string.\n const match = regexp.exec(\'\');\n return !!(match && regexp.lastIndex === 0);\n}\nfunction regExpFlags(regexp) {\n return (regexp.global ? \'g\' : \'\')\n + (regexp.ignoreCase ? \'i\' : \'\')\n + (regexp.multiline ? \'m\' : \'\')\n + (regexp /* standalone editor compilation */.unicode ? \'u\' : \'\');\n}\nfunction splitLines(str) {\n return str.split(/\\r\\n|\\r|\\n/);\n}\n/**\n * Returns first index of the string that is not whitespace.\n * If string is empty or contains only whitespaces, returns -1\n */\nfunction firstNonWhitespaceIndex(str) {\n for (let i = 0, len = str.length; i < len; i++) {\n const chCode = str.charCodeAt(i);\n if (chCode !== 32 /* Space */ && chCode !== 9 /* Tab */) {\n return i;\n }\n }\n return -1;\n}\n/**\n * Returns the leading whitespace of the string.\n * If the string contains only whitespaces, returns entire string\n */\nfunction getLeadingWhitespace(str, start = 0, end = str.length) {\n for (let i = start; i < end; i++) {\n const chCode = str.charCodeAt(i);\n if (chCode !== 32 /* Space */ && chCode !== 9 /* Tab */) {\n return str.substring(start, i);\n }\n }\n return str.substring(start, end);\n}\n/**\n * Returns last index of the string that is not whitespace.\n * If string is empty or contains only whitespaces, returns -1\n */\nfunction lastNonWhitespaceIndex(str, startIndex = str.length - 1) {\n for (let i = startIndex; i >= 0; i--) {\n const chCode = str.charCodeAt(i);\n if (chCode !== 32 /* Space */ && chCode !== 9 /* Tab */) {\n return i;\n }\n }\n return -1;\n}\nfunction compare(a, b) {\n if (a < b) {\n return -1;\n }\n else if (a > b) {\n return 1;\n }\n else {\n return 0;\n }\n}\nfunction compareSubstring(a, b, aStart = 0, aEnd = a.length, bStart = 0, bEnd = b.length) {\n for (; aStart < aEnd && bStart < bEnd; aStart++, bStart++) {\n let codeA = a.charCodeAt(aStart);\n let codeB = b.charCodeAt(bStart);\n if (codeA < codeB) {\n return -1;\n }\n else if (codeA > codeB) {\n return 1;\n }\n }\n const aLen = aEnd - aStart;\n const bLen = bEnd - bStart;\n if (aLen < bLen) {\n return -1;\n }\n else if (aLen > bLen) {\n return 1;\n }\n return 0;\n}\nfunction compareIgnoreCase(a, b) {\n return compareSubstringIgnoreCase(a, b, 0, a.length, 0, b.length);\n}\nfunction compareSubstringIgnoreCase(a, b, aStart = 0, aEnd = a.length, bStart = 0, bEnd = b.length) {\n for (; aStart < aEnd && bStart < bEnd; aStart++, bStart++) {\n let codeA = a.charCodeAt(aStart);\n let codeB = b.charCodeAt(bStart);\n if (codeA === codeB) {\n // equal\n continue;\n }\n const diff = codeA - codeB;\n if (diff === 32 && isUpperAsciiLetter(codeB)) { //codeB =[65-90] && codeA =[97-122]\n continue;\n }\n else if (diff === -32 && isUpperAsciiLetter(codeA)) { //codeB =[97-122] && codeA =[65-90]\n continue;\n }\n if (isLowerAsciiLetter(codeA) && isLowerAsciiLetter(codeB)) {\n //\n return diff;\n }\n else {\n return compareSubstring(a.toLowerCase(), b.toLowerCase(), aStart, aEnd, bStart, bEnd);\n }\n }\n const aLen = aEnd - aStart;\n const bLen = bEnd - bStart;\n if (aLen < bLen) {\n return -1;\n }\n else if (aLen > bLen) {\n return 1;\n }\n return 0;\n}\nfunction isLowerAsciiLetter(code) {\n return code >= 97 /* a */ && code <= 122 /* z */;\n}\nfunction isUpperAsciiLetter(code) {\n return code >= 65 /* A */ && code <= 90 /* Z */;\n}\nfunction isAsciiLetter(code) {\n return isLowerAsciiLetter(code) || isUpperAsciiLetter(code);\n}\nfunction equalsIgnoreCase(a, b) {\n return a.length === b.length && doEqualsIgnoreCase(a, b);\n}\nfunction doEqualsIgnoreCase(a, b, stopAt = a.length) {\n for (let i = 0; i < stopAt; i++) {\n const codeA = a.charCodeAt(i);\n const codeB = b.charCodeAt(i);\n if (codeA === codeB) {\n continue;\n }\n // a-z A-Z\n if (isAsciiLetter(codeA) && isAsciiLetter(codeB)) {\n const diff = Math.abs(codeA - codeB);\n if (diff !== 0 && diff !== 32) {\n return false;\n }\n }\n // Any other charcode\n else {\n if (String.fromCharCode(codeA).toLowerCase() !== String.fromCharCode(codeB).toLowerCase()) {\n return false;\n }\n }\n }\n return true;\n}\nfunction startsWithIgnoreCase(str, candidate) {\n const candidateLength = candidate.length;\n if (candidate.length > str.length) {\n return false;\n }\n return doEqualsIgnoreCase(str, candidate, candidateLength);\n}\n/**\n * @returns the length of the common prefix of the two strings.\n */\nfunction commonPrefixLength(a, b) {\n let i, len = Math.min(a.length, b.length);\n for (i = 0; i < len; i++) {\n if (a.charCodeAt(i) !== b.charCodeAt(i)) {\n return i;\n }\n }\n return len;\n}\n/**\n * @returns the length of the common suffix of the two strings.\n */\nfunction commonSuffixLength(a, b) {\n let i, len = Math.min(a.length, b.length);\n const aLastIndex = a.length - 1;\n const bLastIndex = b.length - 1;\n for (i = 0; i < len; i++) {\n if (a.charCodeAt(aLastIndex - i) !== b.charCodeAt(bLastIndex - i)) {\n return i;\n }\n }\n return len;\n}\n/**\n * See http://en.wikipedia.org/wiki/Surrogate_pair\n */\nfunction isHighSurrogate(charCode) {\n return (0xD800 <= charCode && charCode <= 0xDBFF);\n}\n/**\n * See http://en.wikipedia.org/wiki/Surrogate_pair\n */\nfunction isLowSurrogate(charCode) {\n return (0xDC00 <= charCode && charCode <= 0xDFFF);\n}\n/**\n * See http://en.wikipedia.org/wiki/Surrogate_pair\n */\nfunction computeCodePoint(highSurrogate, lowSurrogate) {\n return ((highSurrogate - 0xD800) << 10) + (lowSurrogate - 0xDC00) + 0x10000;\n}\n/**\n * get the code point that begins at offset `offset`\n */\nfunction getNextCodePoint(str, len, offset) {\n const charCode = str.charCodeAt(offset);\n if (isHighSurrogate(charCode) && offset + 1 < len) {\n const nextCharCode = str.charCodeAt(offset + 1);\n if (isLowSurrogate(nextCharCode)) {\n return computeCodePoint(charCode, nextCharCode);\n }\n }\n return charCode;\n}\n/**\n * get the code point that ends right before offset `offset`\n */\nfunction getPrevCodePoint(str, offset) {\n const charCode = str.charCodeAt(offset - 1);\n if (isLowSurrogate(charCode) && offset > 1) {\n const prevCharCode = str.charCodeAt(offset - 2);\n if (isHighSurrogate(prevCharCode)) {\n return computeCodePoint(prevCharCode, charCode);\n }\n }\n return charCode;\n}\nfunction nextCharLength(str, offset) {\n const graphemeBreakTree = GraphemeBreakTree.getInstance();\n const initialOffset = offset;\n const len = str.length;\n const initialCodePoint = getNextCodePoint(str, len, offset);\n offset += (initialCodePoint >= 65536 /* UNICODE_SUPPLEMENTARY_PLANE_BEGIN */ ? 2 : 1);\n let graphemeBreakType = graphemeBreakTree.getGraphemeBreakType(initialCodePoint);\n while (offset < len) {\n const nextCodePoint = getNextCodePoint(str, len, offset);\n const nextGraphemeBreakType = graphemeBreakTree.getGraphemeBreakType(nextCodePoint);\n if (breakBetweenGraphemeBreakType(graphemeBreakType, nextGraphemeBreakType)) {\n break;\n }\n offset += (nextCodePoint >= 65536 /* UNICODE_SUPPLEMENTARY_PLANE_BEGIN */ ? 2 : 1);\n graphemeBreakType = nextGraphemeBreakType;\n }\n return (offset - initialOffset);\n}\nfunction prevCharLength(str, offset) {\n const graphemeBreakTree = GraphemeBreakTree.getInstance();\n const initialOffset = offset;\n const initialCodePoint = getPrevCodePoint(str, offset);\n offset -= (initialCodePoint >= 65536 /* UNICODE_SUPPLEMENTARY_PLANE_BEGIN */ ? 2 : 1);\n let graphemeBreakType = graphemeBreakTree.getGraphemeBreakType(initialCodePoint);\n while (offset > 0) {\n const prevCodePoint = getPrevCodePoint(str, offset);\n const prevGraphemeBreakType = graphemeBreakTree.getGraphemeBreakType(prevCodePoint);\n if (breakBetweenGraphemeBreakType(prevGraphemeBreakType, graphemeBreakType)