import { m as editor_api_exports } from "./editor.api-erJ7GEVs.js";
/*!-----------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
* Released under the MIT license
* https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
*-----------------------------------------------------------------------------*/
var __defProp = Object.defineProperty, __getOwnPropDesc = Object.getOwnPropertyDescriptor, __getOwnPropNames = Object.getOwnPropertyNames, __hasOwnProp = Object.prototype.hasOwnProperty, __copyProps = (s, B, V, H) => {
	if (B && typeof B == "object" || typeof B == "function") for (let U of __getOwnPropNames(B)) !__hasOwnProp.call(s, U) && U !== V && __defProp(s, U, {
		get: () => B[U],
		enumerable: !(H = __getOwnPropDesc(B, U)) || H.enumerable
	});
	return s;
}, __reExport = (s, I, L) => (__copyProps(s, I, "default"), L && __copyProps(L, I, "default")), monaco_editor_core_exports = {};
__reExport(monaco_editor_core_exports, editor_api_exports);
var STOP_WHEN_IDLE_FOR = 120 * 1e3, WorkerManager = class {
	constructor(s) {
		this._defaults = s, this._worker = null, this._client = null, this._idleCheckInterval = window.setInterval(() => this._checkIfIdle(), 30 * 1e3), this._lastUsedTime = 0, this._configChangeListener = this._defaults.onDidChange(() => this._stopWorker());
	}
	_stopWorker() {
		this._worker &&= (this._worker.dispose(), null), this._client = null;
	}
	dispose() {
		clearInterval(this._idleCheckInterval), this._configChangeListener.dispose(), this._stopWorker();
	}
	_checkIfIdle() {
		this._worker && Date.now() - this._lastUsedTime > STOP_WHEN_IDLE_FOR && this._stopWorker();
	}
	_getClient() {
		return this._lastUsedTime = Date.now(), this._client ||= (this._worker = monaco_editor_core_exports.editor.createWebWorker({
			moduleId: "vs/language/json/jsonWorker",
			label: this._defaults.languageId,
			createData: {
				languageSettings: this._defaults.diagnosticsOptions,
				languageId: this._defaults.languageId,
				enableSchemaRequest: this._defaults.diagnosticsOptions.enableSchemaRequest
			}
		}), this._worker.getProxy()), this._client;
	}
	getLanguageServiceWorker(...s) {
		let I;
		return this._getClient().then((s) => {
			I = s;
		}).then((I) => {
			if (this._worker) return this._worker.withSyncedResources(s);
		}).then((s) => I);
	}
}, DocumentUri;
(function(s) {
	function I(s) {
		return typeof s == "string";
	}
	s.is = I;
})(DocumentUri ||= {});
var URI;
(function(s) {
	function I(s) {
		return typeof s == "string";
	}
	s.is = I;
})(URI ||= {});
var integer;
(function(s) {
	s.MIN_VALUE = -2147483648, s.MAX_VALUE = 2147483647;
	function I(I) {
		return typeof I == "number" && s.MIN_VALUE <= I && I <= s.MAX_VALUE;
	}
	s.is = I;
})(integer ||= {});
var uinteger;
(function(s) {
	s.MIN_VALUE = 0, s.MAX_VALUE = 2147483647;
	function I(I) {
		return typeof I == "number" && s.MIN_VALUE <= I && I <= s.MAX_VALUE;
	}
	s.is = I;
})(uinteger ||= {});
var Position;
(function(s) {
	function I(s, I) {
		return s === Number.MAX_VALUE && (s = uinteger.MAX_VALUE), I === Number.MAX_VALUE && (I = uinteger.MAX_VALUE), {
			line: s,
			character: I
		};
	}
	s.create = I;
	function L(s) {
		let I = s;
		return Is.objectLiteral(I) && Is.uinteger(I.line) && Is.uinteger(I.character);
	}
	s.is = L;
})(Position ||= {});
var Range;
(function(s) {
	function I(s, I, L, R) {
		if (Is.uinteger(s) && Is.uinteger(I) && Is.uinteger(L) && Is.uinteger(R)) return {
			start: Position.create(s, I),
			end: Position.create(L, R)
		};
		if (Position.is(s) && Position.is(I)) return {
			start: s,
			end: I
		};
		throw Error(`Range#create called with invalid arguments[${s}, ${I}, ${L}, ${R}]`);
	}
	s.create = I;
	function L(s) {
		let I = s;
		return Is.objectLiteral(I) && Position.is(I.start) && Position.is(I.end);
	}
	s.is = L;
})(Range ||= {});
var Location;
(function(s) {
	function I(s, I) {
		return {
			uri: s,
			range: I
		};
	}
	s.create = I;
	function L(s) {
		let I = s;
		return Is.objectLiteral(I) && Range.is(I.range) && (Is.string(I.uri) || Is.undefined(I.uri));
	}
	s.is = L;
})(Location ||= {});
var LocationLink;
(function(s) {
	function I(s, I, L, R) {
		return {
			targetUri: s,
			targetRange: I,
			targetSelectionRange: L,
			originSelectionRange: R
		};
	}
	s.create = I;
	function L(s) {
		let I = s;
		return Is.objectLiteral(I) && Range.is(I.targetRange) && Is.string(I.targetUri) && Range.is(I.targetSelectionRange) && (Range.is(I.originSelectionRange) || Is.undefined(I.originSelectionRange));
	}
	s.is = L;
})(LocationLink ||= {});
var Color;
(function(s) {
	function I(s, I, L, R) {
		return {
			red: s,
			green: I,
			blue: L,
			alpha: R
		};
	}
	s.create = I;
	function L(s) {
		let I = s;
		return Is.objectLiteral(I) && Is.numberRange(I.red, 0, 1) && Is.numberRange(I.green, 0, 1) && Is.numberRange(I.blue, 0, 1) && Is.numberRange(I.alpha, 0, 1);
	}
	s.is = L;
})(Color ||= {});
var ColorInformation;
(function(s) {
	function I(s, I) {
		return {
			range: s,
			color: I
		};
	}
	s.create = I;
	function L(s) {
		let I = s;
		return Is.objectLiteral(I) && Range.is(I.range) && Color.is(I.color);
	}
	s.is = L;
})(ColorInformation ||= {});
var ColorPresentation;
(function(s) {
	function I(s, I, L) {
		return {
			label: s,
			textEdit: I,
			additionalTextEdits: L
		};
	}
	s.create = I;
	function L(s) {
		let I = s;
		return Is.objectLiteral(I) && Is.string(I.label) && (Is.undefined(I.textEdit) || TextEdit.is(I)) && (Is.undefined(I.additionalTextEdits) || Is.typedArray(I.additionalTextEdits, TextEdit.is));
	}
	s.is = L;
})(ColorPresentation ||= {});
var FoldingRangeKind;
(function(s) {
	s.Comment = "comment", s.Imports = "imports", s.Region = "region";
})(FoldingRangeKind ||= {});
var FoldingRange;
(function(s) {
	function I(s, I, L, R, z, B) {
		let V = {
			startLine: s,
			endLine: I
		};
		return Is.defined(L) && (V.startCharacter = L), Is.defined(R) && (V.endCharacter = R), Is.defined(z) && (V.kind = z), Is.defined(B) && (V.collapsedText = B), V;
	}
	s.create = I;
	function L(s) {
		let I = s;
		return Is.objectLiteral(I) && Is.uinteger(I.startLine) && Is.uinteger(I.startLine) && (Is.undefined(I.startCharacter) || Is.uinteger(I.startCharacter)) && (Is.undefined(I.endCharacter) || Is.uinteger(I.endCharacter)) && (Is.undefined(I.kind) || Is.string(I.kind));
	}
	s.is = L;
})(FoldingRange ||= {});
var DiagnosticRelatedInformation;
(function(s) {
	function I(s, I) {
		return {
			location: s,
			message: I
		};
	}
	s.create = I;
	function L(s) {
		let I = s;
		return Is.defined(I) && Location.is(I.location) && Is.string(I.message);
	}
	s.is = L;
})(DiagnosticRelatedInformation ||= {});
var DiagnosticSeverity;
(function(s) {
	s.Error = 1, s.Warning = 2, s.Information = 3, s.Hint = 4;
})(DiagnosticSeverity ||= {});
var DiagnosticTag;
(function(s) {
	s.Unnecessary = 1, s.Deprecated = 2;
})(DiagnosticTag ||= {});
var CodeDescription;
(function(s) {
	function I(s) {
		let I = s;
		return Is.objectLiteral(I) && Is.string(I.href);
	}
	s.is = I;
})(CodeDescription ||= {});
var Diagnostic;
(function(s) {
	function I(s, I, L, R, z, B) {
		let V = {
			range: s,
			message: I
		};
		return Is.defined(L) && (V.severity = L), Is.defined(R) && (V.code = R), Is.defined(z) && (V.source = z), Is.defined(B) && (V.relatedInformation = B), V;
	}
	s.create = I;
	function L(s) {
		let I = s;
		return Is.defined(I) && Range.is(I.range) && Is.string(I.message) && (Is.number(I.severity) || Is.undefined(I.severity)) && (Is.integer(I.code) || Is.string(I.code) || Is.undefined(I.code)) && (Is.undefined(I.codeDescription) || Is.string(I.codeDescription?.href)) && (Is.string(I.source) || Is.undefined(I.source)) && (Is.undefined(I.relatedInformation) || Is.typedArray(I.relatedInformation, DiagnosticRelatedInformation.is));
	}
	s.is = L;
})(Diagnostic ||= {});
var Command;
(function(s) {
	function I(s, I, ...L) {
		let R = {
			title: s,
			command: I
		};
		return Is.defined(L) && L.length > 0 && (R.arguments = L), R;
	}
	s.create = I;
	function L(s) {
		let I = s;
		return Is.defined(I) && Is.string(I.title) && Is.string(I.command);
	}
	s.is = L;
})(Command ||= {});
var TextEdit;
(function(s) {
	function I(s, I) {
		return {
			range: s,
			newText: I
		};
	}
	s.replace = I;
	function L(s, I) {
		return {
			range: {
				start: s,
				end: s
			},
			newText: I
		};
	}
	s.insert = L;
	function R(s) {
		return {
			range: s,
			newText: ""
		};
	}
	s.del = R;
	function z(s) {
		let I = s;
		return Is.objectLiteral(I) && Is.string(I.newText) && Range.is(I.range);
	}
	s.is = z;
})(TextEdit ||= {});
var ChangeAnnotation;
(function(s) {
	function I(s, I, L) {
		let R = { label: s };
		return I !== void 0 && (R.needsConfirmation = I), L !== void 0 && (R.description = L), R;
	}
	s.create = I;
	function L(s) {
		let I = s;
		return Is.objectLiteral(I) && Is.string(I.label) && (Is.boolean(I.needsConfirmation) || I.needsConfirmation === void 0) && (Is.string(I.description) || I.description === void 0);
	}
	s.is = L;
})(ChangeAnnotation ||= {});
var ChangeAnnotationIdentifier;
(function(s) {
	function I(s) {
		let I = s;
		return Is.string(I);
	}
	s.is = I;
})(ChangeAnnotationIdentifier ||= {});
var AnnotatedTextEdit;
(function(s) {
	function I(s, I, L) {
		return {
			range: s,
			newText: I,
			annotationId: L
		};
	}
	s.replace = I;
	function L(s, I, L) {
		return {
			range: {
				start: s,
				end: s
			},
			newText: I,
			annotationId: L
		};
	}
	s.insert = L;
	function R(s, I) {
		return {
			range: s,
			newText: "",
			annotationId: I
		};
	}
	s.del = R;
	function z(s) {
		let I = s;
		return TextEdit.is(I) && (ChangeAnnotation.is(I.annotationId) || ChangeAnnotationIdentifier.is(I.annotationId));
	}
	s.is = z;
})(AnnotatedTextEdit ||= {});
var TextDocumentEdit;
(function(s) {
	function I(s, I) {
		return {
			textDocument: s,
			edits: I
		};
	}
	s.create = I;
	function L(s) {
		let I = s;
		return Is.defined(I) && OptionalVersionedTextDocumentIdentifier.is(I.textDocument) && Array.isArray(I.edits);
	}
	s.is = L;
})(TextDocumentEdit ||= {});
var CreateFile;
(function(s) {
	function I(s, I, L) {
		let R = {
			kind: "create",
			uri: s
		};
		return I !== void 0 && (I.overwrite !== void 0 || I.ignoreIfExists !== void 0) && (R.options = I), L !== void 0 && (R.annotationId = L), R;
	}
	s.create = I;
	function L(s) {
		let I = s;
		return I && I.kind === "create" && Is.string(I.uri) && (I.options === void 0 || (I.options.overwrite === void 0 || Is.boolean(I.options.overwrite)) && (I.options.ignoreIfExists === void 0 || Is.boolean(I.options.ignoreIfExists))) && (I.annotationId === void 0 || ChangeAnnotationIdentifier.is(I.annotationId));
	}
	s.is = L;
})(CreateFile ||= {});
var RenameFile;
(function(s) {
	function I(s, I, L, R) {
		let z = {
			kind: "rename",
			oldUri: s,
			newUri: I
		};
		return L !== void 0 && (L.overwrite !== void 0 || L.ignoreIfExists !== void 0) && (z.options = L), R !== void 0 && (z.annotationId = R), z;
	}
	s.create = I;
	function L(s) {
		let I = s;
		return I && I.kind === "rename" && Is.string(I.oldUri) && Is.string(I.newUri) && (I.options === void 0 || (I.options.overwrite === void 0 || Is.boolean(I.options.overwrite)) && (I.options.ignoreIfExists === void 0 || Is.boolean(I.options.ignoreIfExists))) && (I.annotationId === void 0 || ChangeAnnotationIdentifier.is(I.annotationId));
	}
	s.is = L;
})(RenameFile ||= {});
var DeleteFile;
(function(s) {
	function I(s, I, L) {
		let R = {
			kind: "delete",
			uri: s
		};
		return I !== void 0 && (I.recursive !== void 0 || I.ignoreIfNotExists !== void 0) && (R.options = I), L !== void 0 && (R.annotationId = L), R;
	}
	s.create = I;
	function L(s) {
		let I = s;
		return I && I.kind === "delete" && Is.string(I.uri) && (I.options === void 0 || (I.options.recursive === void 0 || Is.boolean(I.options.recursive)) && (I.options.ignoreIfNotExists === void 0 || Is.boolean(I.options.ignoreIfNotExists))) && (I.annotationId === void 0 || ChangeAnnotationIdentifier.is(I.annotationId));
	}
	s.is = L;
})(DeleteFile ||= {});
var WorkspaceEdit;
(function(s) {
	function I(s) {
		let I = s;
		return I && (I.changes !== void 0 || I.documentChanges !== void 0) && (I.documentChanges === void 0 || I.documentChanges.every((s) => Is.string(s.kind) ? CreateFile.is(s) || RenameFile.is(s) || DeleteFile.is(s) : TextDocumentEdit.is(s)));
	}
	s.is = I;
})(WorkspaceEdit ||= {});
var TextDocumentIdentifier;
(function(s) {
	function I(s) {
		return { uri: s };
	}
	s.create = I;
	function L(s) {
		let I = s;
		return Is.defined(I) && Is.string(I.uri);
	}
	s.is = L;
})(TextDocumentIdentifier ||= {});
var VersionedTextDocumentIdentifier;
(function(s) {
	function I(s, I) {
		return {
			uri: s,
			version: I
		};
	}
	s.create = I;
	function L(s) {
		let I = s;
		return Is.defined(I) && Is.string(I.uri) && Is.integer(I.version);
	}
	s.is = L;
})(VersionedTextDocumentIdentifier ||= {});
var OptionalVersionedTextDocumentIdentifier;
(function(s) {
	function I(s, I) {
		return {
			uri: s,
			version: I
		};
	}
	s.create = I;
	function L(s) {
		let I = s;
		return Is.defined(I) && Is.string(I.uri) && (I.version === null || Is.integer(I.version));
	}
	s.is = L;
})(OptionalVersionedTextDocumentIdentifier ||= {});
var TextDocumentItem;
(function(s) {
	function I(s, I, L, R) {
		return {
			uri: s,
			languageId: I,
			version: L,
			text: R
		};
	}
	s.create = I;
	function L(s) {
		let I = s;
		return Is.defined(I) && Is.string(I.uri) && Is.string(I.languageId) && Is.integer(I.version) && Is.string(I.text);
	}
	s.is = L;
})(TextDocumentItem ||= {});
var MarkupKind;
(function(s) {
	s.PlainText = "plaintext", s.Markdown = "markdown";
	function I(I) {
		let L = I;
		return L === s.PlainText || L === s.Markdown;
	}
	s.is = I;
})(MarkupKind ||= {});
var MarkupContent;
(function(s) {
	function I(s) {
		let I = s;
		return Is.objectLiteral(s) && MarkupKind.is(I.kind) && Is.string(I.value);
	}
	s.is = I;
})(MarkupContent ||= {});
var CompletionItemKind;
(function(s) {
	s.Text = 1, s.Method = 2, s.Function = 3, s.Constructor = 4, s.Field = 5, s.Variable = 6, s.Class = 7, s.Interface = 8, s.Module = 9, s.Property = 10, s.Unit = 11, s.Value = 12, s.Enum = 13, s.Keyword = 14, s.Snippet = 15, s.Color = 16, s.File = 17, s.Reference = 18, s.Folder = 19, s.EnumMember = 20, s.Constant = 21, s.Struct = 22, s.Event = 23, s.Operator = 24, s.TypeParameter = 25;
})(CompletionItemKind ||= {});
var InsertTextFormat;
(function(s) {
	s.PlainText = 1, s.Snippet = 2;
})(InsertTextFormat ||= {});
var CompletionItemTag;
(function(s) {
	s.Deprecated = 1;
})(CompletionItemTag ||= {});
var InsertReplaceEdit;
(function(s) {
	function I(s, I, L) {
		return {
			newText: s,
			insert: I,
			replace: L
		};
	}
	s.create = I;
	function L(s) {
		let I = s;
		return I && Is.string(I.newText) && Range.is(I.insert) && Range.is(I.replace);
	}
	s.is = L;
})(InsertReplaceEdit ||= {});
var InsertTextMode;
(function(s) {
	s.asIs = 1, s.adjustIndentation = 2;
})(InsertTextMode ||= {});
var CompletionItemLabelDetails;
(function(s) {
	function I(s) {
		let I = s;
		return I && (Is.string(I.detail) || I.detail === void 0) && (Is.string(I.description) || I.description === void 0);
	}
	s.is = I;
})(CompletionItemLabelDetails ||= {});
var CompletionItem;
(function(s) {
	function I(s) {
		return { label: s };
	}
	s.create = I;
})(CompletionItem ||= {});
var CompletionList;
(function(s) {
	function I(s, I) {
		return {
			items: s || [],
			isIncomplete: !!I
		};
	}
	s.create = I;
})(CompletionList ||= {});
var MarkedString;
(function(s) {
	function I(s) {
		return s.replace(/[\\`*_{}[\]()#+\-.!]/g, "\\$&");
	}
	s.fromPlainText = I;
	function L(s) {
		let I = s;
		return Is.string(I) || Is.objectLiteral(I) && Is.string(I.language) && Is.string(I.value);
	}
	s.is = L;
})(MarkedString ||= {});
var Hover;
(function(s) {
	function I(s) {
		let I = s;
		return !!I && Is.objectLiteral(I) && (MarkupContent.is(I.contents) || MarkedString.is(I.contents) || Is.typedArray(I.contents, MarkedString.is)) && (s.range === void 0 || Range.is(s.range));
	}
	s.is = I;
})(Hover ||= {});
var ParameterInformation;
(function(s) {
	function I(s, I) {
		return I ? {
			label: s,
			documentation: I
		} : { label: s };
	}
	s.create = I;
})(ParameterInformation ||= {});
var SignatureInformation;
(function(s) {
	function I(s, I, ...L) {
		let R = { label: s };
		return Is.defined(I) && (R.documentation = I), Is.defined(L) ? R.parameters = L : R.parameters = [], R;
	}
	s.create = I;
})(SignatureInformation ||= {});
var DocumentHighlightKind;
(function(s) {
	s.Text = 1, s.Read = 2, s.Write = 3;
})(DocumentHighlightKind ||= {});
var DocumentHighlight;
(function(s) {
	function I(s, I) {
		let L = { range: s };
		return Is.number(I) && (L.kind = I), L;
	}
	s.create = I;
})(DocumentHighlight ||= {});
var SymbolKind;
(function(s) {
	s.File = 1, s.Module = 2, s.Namespace = 3, s.Package = 4, s.Class = 5, s.Method = 6, s.Property = 7, s.Field = 8, s.Constructor = 9, s.Enum = 10, s.Interface = 11, s.Function = 12, s.Variable = 13, s.Constant = 14, s.String = 15, s.Number = 16, s.Boolean = 17, s.Array = 18, s.Object = 19, s.Key = 20, s.Null = 21, s.EnumMember = 22, s.Struct = 23, s.Event = 24, s.Operator = 25, s.TypeParameter = 26;
})(SymbolKind ||= {});
var SymbolTag;
(function(s) {
	s.Deprecated = 1;
})(SymbolTag ||= {});
var SymbolInformation;
(function(s) {
	function I(s, I, L, R, z) {
		let B = {
			name: s,
			kind: I,
			location: {
				uri: R,
				range: L
			}
		};
		return z && (B.containerName = z), B;
	}
	s.create = I;
})(SymbolInformation ||= {});
var WorkspaceSymbol;
(function(s) {
	function I(s, I, L, R) {
		return R === void 0 ? {
			name: s,
			kind: I,
			location: { uri: L }
		} : {
			name: s,
			kind: I,
			location: {
				uri: L,
				range: R
			}
		};
	}
	s.create = I;
})(WorkspaceSymbol ||= {});
var DocumentSymbol;
(function(s) {
	function I(s, I, L, R, z, B) {
		let V = {
			name: s,
			detail: I,
			kind: L,
			range: R,
			selectionRange: z
		};
		return B !== void 0 && (V.children = B), V;
	}
	s.create = I;
	function L(s) {
		let I = s;
		return I && Is.string(I.name) && Is.number(I.kind) && Range.is(I.range) && Range.is(I.selectionRange) && (I.detail === void 0 || Is.string(I.detail)) && (I.deprecated === void 0 || Is.boolean(I.deprecated)) && (I.children === void 0 || Array.isArray(I.children)) && (I.tags === void 0 || Array.isArray(I.tags));
	}
	s.is = L;
})(DocumentSymbol ||= {});
var CodeActionKind;
(function(s) {
	s.Empty = "", s.QuickFix = "quickfix", s.Refactor = "refactor", s.RefactorExtract = "refactor.extract", s.RefactorInline = "refactor.inline", s.RefactorRewrite = "refactor.rewrite", s.Source = "source", s.SourceOrganizeImports = "source.organizeImports", s.SourceFixAll = "source.fixAll";
})(CodeActionKind ||= {});
var CodeActionTriggerKind;
(function(s) {
	s.Invoked = 1, s.Automatic = 2;
})(CodeActionTriggerKind ||= {});
var CodeActionContext;
(function(s) {
	function I(s, I, L) {
		let R = { diagnostics: s };
		return I != null && (R.only = I), L != null && (R.triggerKind = L), R;
	}
	s.create = I;
	function L(s) {
		let I = s;
		return Is.defined(I) && Is.typedArray(I.diagnostics, Diagnostic.is) && (I.only === void 0 || Is.typedArray(I.only, Is.string)) && (I.triggerKind === void 0 || I.triggerKind === CodeActionTriggerKind.Invoked || I.triggerKind === CodeActionTriggerKind.Automatic);
	}
	s.is = L;
})(CodeActionContext ||= {});
var CodeAction;
(function(s) {
	function I(s, I, L) {
		let R = { title: s }, z = !0;
		return typeof I == "string" ? (z = !1, R.kind = I) : Command.is(I) ? R.command = I : R.edit = I, z && L !== void 0 && (R.kind = L), R;
	}
	s.create = I;
	function L(s) {
		let I = s;
		return I && Is.string(I.title) && (I.diagnostics === void 0 || Is.typedArray(I.diagnostics, Diagnostic.is)) && (I.kind === void 0 || Is.string(I.kind)) && (I.edit !== void 0 || I.command !== void 0) && (I.command === void 0 || Command.is(I.command)) && (I.isPreferred === void 0 || Is.boolean(I.isPreferred)) && (I.edit === void 0 || WorkspaceEdit.is(I.edit));
	}
	s.is = L;
})(CodeAction ||= {});
var CodeLens;
(function(s) {
	function I(s, I) {
		let L = { range: s };
		return Is.defined(I) && (L.data = I), L;
	}
	s.create = I;
	function L(s) {
		let I = s;
		return Is.defined(I) && Range.is(I.range) && (Is.undefined(I.command) || Command.is(I.command));
	}
	s.is = L;
})(CodeLens ||= {});
var FormattingOptions;
(function(s) {
	function I(s, I) {
		return {
			tabSize: s,
			insertSpaces: I
		};
	}
	s.create = I;
	function L(s) {
		let I = s;
		return Is.defined(I) && Is.uinteger(I.tabSize) && Is.boolean(I.insertSpaces);
	}
	s.is = L;
})(FormattingOptions ||= {});
var DocumentLink;
(function(s) {
	function I(s, I, L) {
		return {
			range: s,
			target: I,
			data: L
		};
	}
	s.create = I;
	function L(s) {
		let I = s;
		return Is.defined(I) && Range.is(I.range) && (Is.undefined(I.target) || Is.string(I.target));
	}
	s.is = L;
})(DocumentLink ||= {});
var SelectionRange;
(function(s) {
	function I(s, I) {
		return {
			range: s,
			parent: I
		};
	}
	s.create = I;
	function L(I) {
		let L = I;
		return Is.objectLiteral(L) && Range.is(L.range) && (L.parent === void 0 || s.is(L.parent));
	}
	s.is = L;
})(SelectionRange ||= {});
var SemanticTokenTypes;
(function(s) {
	s.namespace = "namespace", s.type = "type", s.class = "class", s.enum = "enum", s.interface = "interface", s.struct = "struct", s.typeParameter = "typeParameter", s.parameter = "parameter", s.variable = "variable", s.property = "property", s.enumMember = "enumMember", s.event = "event", s.function = "function", s.method = "method", s.macro = "macro", s.keyword = "keyword", s.modifier = "modifier", s.comment = "comment", s.string = "string", s.number = "number", s.regexp = "regexp", s.operator = "operator", s.decorator = "decorator";
})(SemanticTokenTypes ||= {});
var SemanticTokenModifiers;
(function(s) {
	s.declaration = "declaration", s.definition = "definition", s.readonly = "readonly", s.static = "static", s.deprecated = "deprecated", s.abstract = "abstract", s.async = "async", s.modification = "modification", s.documentation = "documentation", s.defaultLibrary = "defaultLibrary";
})(SemanticTokenModifiers ||= {});
var SemanticTokens;
(function(s) {
	function I(s) {
		let I = s;
		return Is.objectLiteral(I) && (I.resultId === void 0 || typeof I.resultId == "string") && Array.isArray(I.data) && (I.data.length === 0 || typeof I.data[0] == "number");
	}
	s.is = I;
})(SemanticTokens ||= {});
var InlineValueText;
(function(s) {
	function I(s, I) {
		return {
			range: s,
			text: I
		};
	}
	s.create = I;
	function L(s) {
		let I = s;
		return I != null && Range.is(I.range) && Is.string(I.text);
	}
	s.is = L;
})(InlineValueText ||= {});
var InlineValueVariableLookup;
(function(s) {
	function I(s, I, L) {
		return {
			range: s,
			variableName: I,
			caseSensitiveLookup: L
		};
	}
	s.create = I;
	function L(s) {
		let I = s;
		return I != null && Range.is(I.range) && Is.boolean(I.caseSensitiveLookup) && (Is.string(I.variableName) || I.variableName === void 0);
	}
	s.is = L;
})(InlineValueVariableLookup ||= {});
var InlineValueEvaluatableExpression;
(function(s) {
	function I(s, I) {
		return {
			range: s,
			expression: I
		};
	}
	s.create = I;
	function L(s) {
		let I = s;
		return I != null && Range.is(I.range) && (Is.string(I.expression) || I.expression === void 0);
	}
	s.is = L;
})(InlineValueEvaluatableExpression ||= {});
var InlineValueContext;
(function(s) {
	function I(s, I) {
		return {
			frameId: s,
			stoppedLocation: I
		};
	}
	s.create = I;
	function L(s) {
		let I = s;
		return Is.defined(I) && Range.is(s.stoppedLocation);
	}
	s.is = L;
})(InlineValueContext ||= {});
var InlayHintKind;
(function(s) {
	s.Type = 1, s.Parameter = 2;
	function I(s) {
		return s === 1 || s === 2;
	}
	s.is = I;
})(InlayHintKind ||= {});
var InlayHintLabelPart;
(function(s) {
	function I(s) {
		return { value: s };
	}
	s.create = I;
	function L(s) {
		let I = s;
		return Is.objectLiteral(I) && (I.tooltip === void 0 || Is.string(I.tooltip) || MarkupContent.is(I.tooltip)) && (I.location === void 0 || Location.is(I.location)) && (I.command === void 0 || Command.is(I.command));
	}
	s.is = L;
})(InlayHintLabelPart ||= {});
var InlayHint;
(function(s) {
	function I(s, I, L) {
		let R = {
			position: s,
			label: I
		};
		return L !== void 0 && (R.kind = L), R;
	}
	s.create = I;
	function L(s) {
		let I = s;
		return Is.objectLiteral(I) && Position.is(I.position) && (Is.string(I.label) || Is.typedArray(I.label, InlayHintLabelPart.is)) && (I.kind === void 0 || InlayHintKind.is(I.kind)) && I.textEdits === void 0 || Is.typedArray(I.textEdits, TextEdit.is) && (I.tooltip === void 0 || Is.string(I.tooltip) || MarkupContent.is(I.tooltip)) && (I.paddingLeft === void 0 || Is.boolean(I.paddingLeft)) && (I.paddingRight === void 0 || Is.boolean(I.paddingRight));
	}
	s.is = L;
})(InlayHint ||= {});
var StringValue;
(function(s) {
	function I(s) {
		return {
			kind: "snippet",
			value: s
		};
	}
	s.createSnippet = I;
})(StringValue ||= {});
var InlineCompletionItem;
(function(s) {
	function I(s, I, L, R) {
		return {
			insertText: s,
			filterText: I,
			range: L,
			command: R
		};
	}
	s.create = I;
})(InlineCompletionItem ||= {});
var InlineCompletionList;
(function(s) {
	function I(s) {
		return { items: s };
	}
	s.create = I;
})(InlineCompletionList ||= {});
var InlineCompletionTriggerKind;
(function(s) {
	s.Invoked = 0, s.Automatic = 1;
})(InlineCompletionTriggerKind ||= {});
var SelectedCompletionInfo;
(function(s) {
	function I(s, I) {
		return {
			range: s,
			text: I
		};
	}
	s.create = I;
})(SelectedCompletionInfo ||= {});
var InlineCompletionContext;
(function(s) {
	function I(s, I) {
		return {
			triggerKind: s,
			selectedCompletionInfo: I
		};
	}
	s.create = I;
})(InlineCompletionContext ||= {});
var WorkspaceFolder;
(function(s) {
	function I(s) {
		let I = s;
		return Is.objectLiteral(I) && URI.is(I.uri) && Is.string(I.name);
	}
	s.is = I;
})(WorkspaceFolder ||= {});
var TextDocument;
(function(s) {
	function I(s, I, L, R) {
		return new FullTextDocument(s, I, L, R);
	}
	s.create = I;
	function L(s) {
		let I = s;
		return !!(Is.defined(I) && Is.string(I.uri) && (Is.undefined(I.languageId) || Is.string(I.languageId)) && Is.uinteger(I.lineCount) && Is.func(I.getText) && Is.func(I.positionAt) && Is.func(I.offsetAt));
	}
	s.is = L;
	function R(s, I) {
		let L = s.getText(), R = z(I, (s, I) => {
			let L = s.range.start.line - I.range.start.line;
			return L === 0 ? s.range.start.character - I.range.start.character : L;
		}), B = L.length;
		for (let I = R.length - 1; I >= 0; I--) {
			let z = R[I], V = s.offsetAt(z.range.start), H = s.offsetAt(z.range.end);
			if (H <= B) L = L.substring(0, V) + z.newText + L.substring(H, L.length);
			else throw Error("Overlapping edit");
			B = V;
		}
		return L;
	}
	s.applyEdits = R;
	function z(s, I) {
		if (s.length <= 1) return s;
		let L = s.length / 2 | 0, R = s.slice(0, L), B = s.slice(L);
		z(R, I), z(B, I);
		let V = 0, H = 0, U = 0;
		for (; V < R.length && H < B.length;) I(R[V], B[H]) <= 0 ? s[U++] = R[V++] : s[U++] = B[H++];
		for (; V < R.length;) s[U++] = R[V++];
		for (; H < B.length;) s[U++] = B[H++];
		return s;
	}
})(TextDocument ||= {});
var FullTextDocument = class {
	constructor(s, I, L, R) {
		this._uri = s, this._languageId = I, this._version = L, this._content = R, this._lineOffsets = void 0;
	}
	get uri() {
		return this._uri;
	}
	get languageId() {
		return this._languageId;
	}
	get version() {
		return this._version;
	}
	getText(s) {
		if (s) {
			let I = this.offsetAt(s.start), L = this.offsetAt(s.end);
			return this._content.substring(I, L);
		}
		return this._content;
	}
	update(s, I) {
		this._content = s.text, this._version = I, this._lineOffsets = void 0;
	}
	getLineOffsets() {
		if (this._lineOffsets === void 0) {
			let s = [], I = this._content, L = !0;
			for (let R = 0; R < I.length; R++) {
				L &&= (s.push(R), !1);
				let z = I.charAt(R);
				L = z === "\r" || z === "\n", z === "\r" && R + 1 < I.length && I.charAt(R + 1) === "\n" && R++;
			}
			L && I.length > 0 && s.push(I.length), this._lineOffsets = s;
		}
		return this._lineOffsets;
	}
	positionAt(s) {
		s = Math.max(Math.min(s, this._content.length), 0);
		let I = this.getLineOffsets(), L = 0, R = I.length;
		if (R === 0) return Position.create(0, s);
		for (; L < R;) {
			let z = Math.floor((L + R) / 2);
			I[z] > s ? R = z : L = z + 1;
		}
		let z = L - 1;
		return Position.create(z, s - I[z]);
	}
	offsetAt(s) {
		let I = this.getLineOffsets();
		if (s.line >= I.length) return this._content.length;
		if (s.line < 0) return 0;
		let L = I[s.line], R = s.line + 1 < I.length ? I[s.line + 1] : this._content.length;
		return Math.max(Math.min(L + s.character, R), L);
	}
	get lineCount() {
		return this.getLineOffsets().length;
	}
}, Is;
(function(s) {
	let I = Object.prototype.toString;
	function L(s) {
		return s !== void 0;
	}
	s.defined = L;
	function R(s) {
		return s === void 0;
	}
	s.undefined = R;
	function z(s) {
		return s === !0 || s === !1;
	}
	s.boolean = z;
	function B(s) {
		return I.call(s) === "[object String]";
	}
	s.string = B;
	function V(s) {
		return I.call(s) === "[object Number]";
	}
	s.number = V;
	function H(s, L, R) {
		return I.call(s) === "[object Number]" && L <= s && s <= R;
	}
	s.numberRange = H;
	function U(s) {
		return I.call(s) === "[object Number]" && -2147483648 <= s && s <= 2147483647;
	}
	s.integer = U;
	function W(s) {
		return I.call(s) === "[object Number]" && 0 <= s && s <= 2147483647;
	}
	s.uinteger = W;
	function G(s) {
		return I.call(s) === "[object Function]";
	}
	s.func = G;
	function K(s) {
		return typeof s == "object" && !!s;
	}
	s.objectLiteral = K;
	function q(s, I) {
		return Array.isArray(s) && s.every(I);
	}
	s.typedArray = q;
})(Is ||= {});
var DiagnosticsAdapter = class {
	constructor(s, I, L) {
		this._languageId = s, this._worker = I, this._disposables = [], this._listener = /* @__PURE__ */ Object.create(null);
		let R = (s) => {
			let I = s.getLanguageId();
			if (I !== this._languageId) return;
			let L;
			this._listener[s.uri.toString()] = s.onDidChangeContent(() => {
				window.clearTimeout(L), L = window.setTimeout(() => this._doValidate(s.uri, I), 500);
			}), this._doValidate(s.uri, I);
		}, z = (s) => {
			monaco_editor_core_exports.editor.setModelMarkers(s, this._languageId, []);
			let I = s.uri.toString(), L = this._listener[I];
			L && (L.dispose(), delete this._listener[I]);
		};
		this._disposables.push(monaco_editor_core_exports.editor.onDidCreateModel(R)), this._disposables.push(monaco_editor_core_exports.editor.onWillDisposeModel(z)), this._disposables.push(monaco_editor_core_exports.editor.onDidChangeModelLanguage((s) => {
			z(s.model), R(s.model);
		})), this._disposables.push(L((s) => {
			monaco_editor_core_exports.editor.getModels().forEach((s) => {
				s.getLanguageId() === this._languageId && (z(s), R(s));
			});
		})), this._disposables.push({ dispose: () => {
			for (let s in monaco_editor_core_exports.editor.getModels().forEach(z), this._listener) this._listener[s].dispose();
		} }), monaco_editor_core_exports.editor.getModels().forEach(R);
	}
	dispose() {
		this._disposables.forEach((s) => s && s.dispose()), this._disposables.length = 0;
	}
	_doValidate(s, I) {
		this._worker(s).then((I) => I.doValidation(s.toString())).then((L) => {
			let R = L.map((I) => toDiagnostics(s, I)), z = monaco_editor_core_exports.editor.getModel(s);
			z && z.getLanguageId() === I && monaco_editor_core_exports.editor.setModelMarkers(z, I, R);
		}).then(void 0, (s) => {
			console.error(s);
		});
	}
};
function toSeverity(s) {
	switch (s) {
		case DiagnosticSeverity.Error: return monaco_editor_core_exports.MarkerSeverity.Error;
		case DiagnosticSeverity.Warning: return monaco_editor_core_exports.MarkerSeverity.Warning;
		case DiagnosticSeverity.Information: return monaco_editor_core_exports.MarkerSeverity.Info;
		case DiagnosticSeverity.Hint: return monaco_editor_core_exports.MarkerSeverity.Hint;
		default: return monaco_editor_core_exports.MarkerSeverity.Info;
	}
}
function toDiagnostics(s, I) {
	let L = typeof I.code == "number" ? String(I.code) : I.code;
	return {
		severity: toSeverity(I.severity),
		startLineNumber: I.range.start.line + 1,
		startColumn: I.range.start.character + 1,
		endLineNumber: I.range.end.line + 1,
		endColumn: I.range.end.character + 1,
		message: I.message,
		code: L,
		source: I.source
	};
}
var CompletionAdapter = class {
	constructor(s, I) {
		this._worker = s, this._triggerCharacters = I;
	}
	get triggerCharacters() {
		return this._triggerCharacters;
	}
	provideCompletionItems(s, I, L, R) {
		let z = s.uri;
		return this._worker(z).then((s) => s.doComplete(z.toString(), fromPosition(I))).then((L) => {
			if (!L) return;
			let R = s.getWordUntilPosition(I), z = new monaco_editor_core_exports.Range(I.lineNumber, R.startColumn, I.lineNumber, R.endColumn), B = L.items.map((s) => {
				let I = {
					label: s.label,
					insertText: s.insertText || s.label,
					sortText: s.sortText,
					filterText: s.filterText,
					documentation: s.documentation,
					detail: s.detail,
					command: toCommand(s.command),
					range: z,
					kind: toCompletionItemKind(s.kind)
				};
				return s.textEdit && (isInsertReplaceEdit(s.textEdit) ? I.range = {
					insert: toRange(s.textEdit.insert),
					replace: toRange(s.textEdit.replace)
				} : I.range = toRange(s.textEdit.range), I.insertText = s.textEdit.newText), s.additionalTextEdits && (I.additionalTextEdits = s.additionalTextEdits.map(toTextEdit)), s.insertTextFormat === InsertTextFormat.Snippet && (I.insertTextRules = monaco_editor_core_exports.languages.CompletionItemInsertTextRule.InsertAsSnippet), I;
			});
			return {
				isIncomplete: L.isIncomplete,
				suggestions: B
			};
		});
	}
};
function fromPosition(s) {
	if (s) return {
		character: s.column - 1,
		line: s.lineNumber - 1
	};
}
function fromRange(s) {
	if (s) return {
		start: {
			line: s.startLineNumber - 1,
			character: s.startColumn - 1
		},
		end: {
			line: s.endLineNumber - 1,
			character: s.endColumn - 1
		}
	};
}
function toRange(s) {
	if (s) return new monaco_editor_core_exports.Range(s.start.line + 1, s.start.character + 1, s.end.line + 1, s.end.character + 1);
}
function isInsertReplaceEdit(s) {
	return s.insert !== void 0 && s.replace !== void 0;
}
function toCompletionItemKind(s) {
	let I = monaco_editor_core_exports.languages.CompletionItemKind;
	switch (s) {
		case CompletionItemKind.Text: return I.Text;
		case CompletionItemKind.Method: return I.Method;
		case CompletionItemKind.Function: return I.Function;
		case CompletionItemKind.Constructor: return I.Constructor;
		case CompletionItemKind.Field: return I.Field;
		case CompletionItemKind.Variable: return I.Variable;
		case CompletionItemKind.Class: return I.Class;
		case CompletionItemKind.Interface: return I.Interface;
		case CompletionItemKind.Module: return I.Module;
		case CompletionItemKind.Property: return I.Property;
		case CompletionItemKind.Unit: return I.Unit;
		case CompletionItemKind.Value: return I.Value;
		case CompletionItemKind.Enum: return I.Enum;
		case CompletionItemKind.Keyword: return I.Keyword;
		case CompletionItemKind.Snippet: return I.Snippet;
		case CompletionItemKind.Color: return I.Color;
		case CompletionItemKind.File: return I.File;
		case CompletionItemKind.Reference: return I.Reference;
	}
	return I.Property;
}
function toTextEdit(s) {
	if (s) return {
		range: toRange(s.range),
		text: s.newText
	};
}
function toCommand(s) {
	return s && s.command === "editor.action.triggerSuggest" ? {
		id: s.command,
		title: s.title,
		arguments: s.arguments
	} : void 0;
}
var HoverAdapter = class {
	constructor(s) {
		this._worker = s;
	}
	provideHover(s, I, L) {
		let R = s.uri;
		return this._worker(R).then((s) => s.doHover(R.toString(), fromPosition(I))).then((s) => {
			if (s) return {
				range: toRange(s.range),
				contents: toMarkedStringArray(s.contents)
			};
		});
	}
};
function isMarkupContent(s) {
	return s && typeof s == "object" && typeof s.kind == "string";
}
function toMarkdownString(s) {
	return typeof s == "string" ? { value: s } : isMarkupContent(s) ? s.kind === "plaintext" ? { value: s.value.replace(/[\\`*_{}[\]()#+\-.!]/g, "\\$&") } : { value: s.value } : { value: "```" + s.language + "\n" + s.value + "\n```\n" };
}
function toMarkedStringArray(s) {
	if (s) return Array.isArray(s) ? s.map(toMarkdownString) : [toMarkdownString(s)];
}
var DocumentHighlightAdapter = class {
	constructor(s) {
		this._worker = s;
	}
	provideDocumentHighlights(s, I, L) {
		let R = s.uri;
		return this._worker(R).then((s) => s.findDocumentHighlights(R.toString(), fromPosition(I))).then((s) => {
			if (s) return s.map((s) => ({
				range: toRange(s.range),
				kind: toDocumentHighlightKind(s.kind)
			}));
		});
	}
};
function toDocumentHighlightKind(s) {
	switch (s) {
		case DocumentHighlightKind.Read: return monaco_editor_core_exports.languages.DocumentHighlightKind.Read;
		case DocumentHighlightKind.Write: return monaco_editor_core_exports.languages.DocumentHighlightKind.Write;
		case DocumentHighlightKind.Text: return monaco_editor_core_exports.languages.DocumentHighlightKind.Text;
	}
	return monaco_editor_core_exports.languages.DocumentHighlightKind.Text;
}
var DefinitionAdapter = class {
	constructor(s) {
		this._worker = s;
	}
	provideDefinition(s, I, L) {
		let R = s.uri;
		return this._worker(R).then((s) => s.findDefinition(R.toString(), fromPosition(I))).then((s) => {
			if (s) return [toLocation(s)];
		});
	}
};
function toLocation(s) {
	return {
		uri: monaco_editor_core_exports.Uri.parse(s.uri),
		range: toRange(s.range)
	};
}
var ReferenceAdapter = class {
	constructor(s) {
		this._worker = s;
	}
	provideReferences(s, I, L, R) {
		let z = s.uri;
		return this._worker(z).then((s) => s.findReferences(z.toString(), fromPosition(I))).then((s) => {
			if (s) return s.map(toLocation);
		});
	}
}, RenameAdapter = class {
	constructor(s) {
		this._worker = s;
	}
	provideRenameEdits(s, I, L, R) {
		let z = s.uri;
		return this._worker(z).then((s) => s.doRename(z.toString(), fromPosition(I), L)).then((s) => toWorkspaceEdit(s));
	}
};
function toWorkspaceEdit(s) {
	if (!s || !s.changes) return;
	let I = [];
	for (let L in s.changes) {
		let R = monaco_editor_core_exports.Uri.parse(L);
		for (let z of s.changes[L]) I.push({
			resource: R,
			versionId: void 0,
			textEdit: {
				range: toRange(z.range),
				text: z.newText
			}
		});
	}
	return { edits: I };
}
var DocumentSymbolAdapter = class {
	constructor(s) {
		this._worker = s;
	}
	provideDocumentSymbols(s, I) {
		let L = s.uri;
		return this._worker(L).then((s) => s.findDocumentSymbols(L.toString())).then((s) => {
			if (s) return s.map((s) => isDocumentSymbol(s) ? toDocumentSymbol(s) : {
				name: s.name,
				detail: "",
				containerName: s.containerName,
				kind: toSymbolKind(s.kind),
				range: toRange(s.location.range),
				selectionRange: toRange(s.location.range),
				tags: []
			});
		});
	}
};
function isDocumentSymbol(s) {
	return "children" in s;
}
function toDocumentSymbol(s) {
	return {
		name: s.name,
		detail: s.detail ?? "",
		kind: toSymbolKind(s.kind),
		range: toRange(s.range),
		selectionRange: toRange(s.selectionRange),
		tags: s.tags ?? [],
		children: (s.children ?? []).map((s) => toDocumentSymbol(s))
	};
}
function toSymbolKind(s) {
	let I = monaco_editor_core_exports.languages.SymbolKind;
	switch (s) {
		case SymbolKind.File: return I.File;
		case SymbolKind.Module: return I.Module;
		case SymbolKind.Namespace: return I.Namespace;
		case SymbolKind.Package: return I.Package;
		case SymbolKind.Class: return I.Class;
		case SymbolKind.Method: return I.Method;
		case SymbolKind.Property: return I.Property;
		case SymbolKind.Field: return I.Field;
		case SymbolKind.Constructor: return I.Constructor;
		case SymbolKind.Enum: return I.Enum;
		case SymbolKind.Interface: return I.Interface;
		case SymbolKind.Function: return I.Function;
		case SymbolKind.Variable: return I.Variable;
		case SymbolKind.Constant: return I.Constant;
		case SymbolKind.String: return I.String;
		case SymbolKind.Number: return I.Number;
		case SymbolKind.Boolean: return I.Boolean;
		case SymbolKind.Array: return I.Array;
	}
	return I.Function;
}
var DocumentLinkAdapter = class {
	constructor(s) {
		this._worker = s;
	}
	provideLinks(s, I) {
		let L = s.uri;
		return this._worker(L).then((s) => s.findDocumentLinks(L.toString())).then((s) => {
			if (s) return { links: s.map((s) => ({
				range: toRange(s.range),
				url: s.target
			})) };
		});
	}
}, DocumentFormattingEditProvider = class {
	constructor(s) {
		this._worker = s;
	}
	provideDocumentFormattingEdits(s, I, L) {
		let R = s.uri;
		return this._worker(R).then((s) => s.format(R.toString(), null, fromFormattingOptions(I)).then((s) => {
			if (!(!s || s.length === 0)) return s.map(toTextEdit);
		}));
	}
}, DocumentRangeFormattingEditProvider = class {
	constructor(s) {
		this._worker = s, this.canFormatMultipleRanges = !1;
	}
	provideDocumentRangeFormattingEdits(s, I, L, R) {
		let z = s.uri;
		return this._worker(z).then((s) => s.format(z.toString(), fromRange(I), fromFormattingOptions(L)).then((s) => {
			if (!(!s || s.length === 0)) return s.map(toTextEdit);
		}));
	}
};
function fromFormattingOptions(s) {
	return {
		tabSize: s.tabSize,
		insertSpaces: s.insertSpaces
	};
}
var DocumentColorAdapter = class {
	constructor(s) {
		this._worker = s;
	}
	provideDocumentColors(s, I) {
		let L = s.uri;
		return this._worker(L).then((s) => s.findDocumentColors(L.toString())).then((s) => {
			if (s) return s.map((s) => ({
				color: s.color,
				range: toRange(s.range)
			}));
		});
	}
	provideColorPresentations(s, I, L) {
		let R = s.uri;
		return this._worker(R).then((s) => s.getColorPresentations(R.toString(), I.color, fromRange(I.range))).then((s) => {
			if (s) return s.map((s) => {
				let I = { label: s.label };
				return s.textEdit && (I.textEdit = toTextEdit(s.textEdit)), s.additionalTextEdits && (I.additionalTextEdits = s.additionalTextEdits.map(toTextEdit)), I;
			});
		});
	}
}, FoldingRangeAdapter = class {
	constructor(s) {
		this._worker = s;
	}
	provideFoldingRanges(s, I, L) {
		let R = s.uri;
		return this._worker(R).then((s) => s.getFoldingRanges(R.toString(), I)).then((s) => {
			if (s) return s.map((s) => {
				let I = {
					start: s.startLine + 1,
					end: s.endLine + 1
				};
				return s.kind !== void 0 && (I.kind = toFoldingRangeKind(s.kind)), I;
			});
		});
	}
};
function toFoldingRangeKind(s) {
	switch (s) {
		case FoldingRangeKind.Comment: return monaco_editor_core_exports.languages.FoldingRangeKind.Comment;
		case FoldingRangeKind.Imports: return monaco_editor_core_exports.languages.FoldingRangeKind.Imports;
		case FoldingRangeKind.Region: return monaco_editor_core_exports.languages.FoldingRangeKind.Region;
	}
}
var SelectionRangeAdapter = class {
	constructor(s) {
		this._worker = s;
	}
	provideSelectionRanges(s, I, L) {
		let R = s.uri;
		return this._worker(R).then((s) => s.getSelectionRanges(R.toString(), I.map(fromPosition))).then((s) => {
			if (s) return s.map((s) => {
				let I = [];
				for (; s;) I.push({ range: toRange(s.range) }), s = s.parent;
				return I;
			});
		});
	}
};
function createScanner(s, I = !1) {
	let L = s.length, R = 0, z = "", B = 0, V = 16, H = 0, U = 0, W = 0, G = 0, K = 0;
	function q(I, L) {
		let z = 0, B = 0;
		for (; z < I || !L;) {
			let I = s.charCodeAt(R);
			if (I >= 48 && I <= 57) B = B * 16 + I - 48;
			else if (I >= 65 && I <= 70) B = B * 16 + I - 65 + 10;
			else if (I >= 97 && I <= 102) B = B * 16 + I - 97 + 10;
			else break;
			R++, z++;
		}
		return z < I && (B = -1), B;
	}
	function J(s) {
		R = s, z = "", B = 0, V = 16, K = 0;
	}
	function Y() {
		let I = R;
		if (s.charCodeAt(R) === 48) R++;
		else for (R++; R < s.length && isDigit(s.charCodeAt(R));) R++;
		if (R < s.length && s.charCodeAt(R) === 46) if (R++, R < s.length && isDigit(s.charCodeAt(R))) for (R++; R < s.length && isDigit(s.charCodeAt(R));) R++;
		else return K = 3, s.substring(I, R);
		let L = R;
		if (R < s.length && (s.charCodeAt(R) === 69 || s.charCodeAt(R) === 101)) if (R++, (R < s.length && s.charCodeAt(R) === 43 || s.charCodeAt(R) === 45) && R++, R < s.length && isDigit(s.charCodeAt(R))) {
			for (R++; R < s.length && isDigit(s.charCodeAt(R));) R++;
			L = R;
		} else K = 3;
		return s.substring(I, L);
	}
	function X() {
		let I = "", z = R;
		for (;;) {
			if (R >= L) {
				I += s.substring(z, R), K = 2;
				break;
			}
			let B = s.charCodeAt(R);
			if (B === 34) {
				I += s.substring(z, R), R++;
				break;
			}
			if (B === 92) {
				if (I += s.substring(z, R), R++, R >= L) {
					K = 2;
					break;
				}
				switch (s.charCodeAt(R++)) {
					case 34:
						I += "\"";
						break;
					case 92:
						I += "\\";
						break;
					case 47:
						I += "/";
						break;
					case 98:
						I += "\b";
						break;
					case 102:
						I += "\f";
						break;
					case 110:
						I += "\n";
						break;
					case 114:
						I += "\r";
						break;
					case 116:
						I += "	";
						break;
					case 117:
						let s = q(4, !0);
						s >= 0 ? I += String.fromCharCode(s) : K = 4;
						break;
					default: K = 5;
				}
				z = R;
				continue;
			}
			if (B >= 0 && B <= 31) if (isLineBreak(B)) {
				I += s.substring(z, R), K = 2;
				break;
			} else K = 6;
			R++;
		}
		return I;
	}
	function Z() {
		if (z = "", K = 0, B = R, U = H, G = W, R >= L) return B = L, V = 17;
		let I = s.charCodeAt(R);
		if (isWhiteSpace(I)) {
			do
				R++, z += String.fromCharCode(I), I = s.charCodeAt(R);
			while (isWhiteSpace(I));
			return V = 15;
		}
		if (isLineBreak(I)) return R++, z += String.fromCharCode(I), I === 13 && s.charCodeAt(R) === 10 && (R++, z += "\n"), H++, W = R, V = 14;
		switch (I) {
			case 123: return R++, V = 1;
			case 125: return R++, V = 2;
			case 91: return R++, V = 3;
			case 93: return R++, V = 4;
			case 58: return R++, V = 6;
			case 44: return R++, V = 5;
			case 34: return R++, z = X(), V = 10;
			case 47:
				let U = R - 1;
				if (s.charCodeAt(R + 1) === 47) {
					for (R += 2; R < L && !isLineBreak(s.charCodeAt(R));) R++;
					return z = s.substring(U, R), V = 12;
				}
				if (s.charCodeAt(R + 1) === 42) {
					R += 2;
					let I = L - 1, B = !1;
					for (; R < I;) {
						let I = s.charCodeAt(R);
						if (I === 42 && s.charCodeAt(R + 1) === 47) {
							R += 2, B = !0;
							break;
						}
						R++, isLineBreak(I) && (I === 13 && s.charCodeAt(R) === 10 && R++, H++, W = R);
					}
					return B || (R++, K = 1), z = s.substring(U, R), V = 13;
				}
				return z += String.fromCharCode(I), R++, V = 16;
			case 45: if (z += String.fromCharCode(I), R++, R === L || !isDigit(s.charCodeAt(R))) return V = 16;
			case 48:
			case 49:
			case 50:
			case 51:
			case 52:
			case 53:
			case 54:
			case 55:
			case 56:
			case 57: return z += Y(), V = 11;
			default:
				for (; R < L && Q(I);) R++, I = s.charCodeAt(R);
				if (B !== R) {
					switch (z = s.substring(B, R), z) {
						case "true": return V = 8;
						case "false": return V = 9;
						case "null": return V = 7;
					}
					return V = 16;
				}
				return z += String.fromCharCode(I), R++, V = 16;
		}
	}
	function Q(s) {
		if (isWhiteSpace(s) || isLineBreak(s)) return !1;
		switch (s) {
			case 125:
			case 93:
			case 123:
			case 91:
			case 34:
			case 58:
			case 44:
			case 47: return !1;
		}
		return !0;
	}
	function $() {
		let s;
		do
			s = Z();
		while (s >= 12 && s <= 15);
		return s;
	}
	return {
		setPosition: J,
		getPosition: () => R,
		scan: I ? $ : Z,
		getToken: () => V,
		getTokenValue: () => z,
		getTokenOffset: () => B,
		getTokenLength: () => R - B,
		getTokenStartLine: () => U,
		getTokenStartCharacter: () => B - G,
		getTokenError: () => K
	};
}
function isWhiteSpace(s) {
	return s === 32 || s === 9;
}
function isLineBreak(s) {
	return s === 10 || s === 13;
}
function isDigit(s) {
	return s >= 48 && s <= 57;
}
var CharacterCodes;
(function(s) {
	s[s.lineFeed = 10] = "lineFeed", s[s.carriageReturn = 13] = "carriageReturn", s[s.space = 32] = "space", s[s._0 = 48] = "_0", s[s._1 = 49] = "_1", s[s._2 = 50] = "_2", s[s._3 = 51] = "_3", s[s._4 = 52] = "_4", s[s._5 = 53] = "_5", s[s._6 = 54] = "_6", s[s._7 = 55] = "_7", s[s._8 = 56] = "_8", s[s._9 = 57] = "_9", s[s.a = 97] = "a", s[s.b = 98] = "b", s[s.c = 99] = "c", s[s.d = 100] = "d", s[s.e = 101] = "e", s[s.f = 102] = "f", s[s.g = 103] = "g", s[s.h = 104] = "h", s[s.i = 105] = "i", s[s.j = 106] = "j", s[s.k = 107] = "k", s[s.l = 108] = "l", s[s.m = 109] = "m", s[s.n = 110] = "n", s[s.o = 111] = "o", s[s.p = 112] = "p", s[s.q = 113] = "q", s[s.r = 114] = "r", s[s.s = 115] = "s", s[s.t = 116] = "t", s[s.u = 117] = "u", s[s.v = 118] = "v", s[s.w = 119] = "w", s[s.x = 120] = "x", s[s.y = 121] = "y", s[s.z = 122] = "z", s[s.A = 65] = "A", s[s.B = 66] = "B", s[s.C = 67] = "C", s[s.D = 68] = "D", s[s.E = 69] = "E", s[s.F = 70] = "F", s[s.G = 71] = "G", s[s.H = 72] = "H", s[s.I = 73] = "I", s[s.J = 74] = "J", s[s.K = 75] = "K", s[s.L = 76] = "L", s[s.M = 77] = "M", s[s.N = 78] = "N", s[s.O = 79] = "O", s[s.P = 80] = "P", s[s.Q = 81] = "Q", s[s.R = 82] = "R", s[s.S = 83] = "S", s[s.T = 84] = "T", s[s.U = 85] = "U", s[s.V = 86] = "V", s[s.W = 87] = "W", s[s.X = 88] = "X", s[s.Y = 89] = "Y", s[s.Z = 90] = "Z", s[s.asterisk = 42] = "asterisk", s[s.backslash = 92] = "backslash", s[s.closeBrace = 125] = "closeBrace", s[s.closeBracket = 93] = "closeBracket", s[s.colon = 58] = "colon", s[s.comma = 44] = "comma", s[s.dot = 46] = "dot", s[s.doubleQuote = 34] = "doubleQuote", s[s.minus = 45] = "minus", s[s.openBrace = 123] = "openBrace", s[s.openBracket = 91] = "openBracket", s[s.plus = 43] = "plus", s[s.slash = 47] = "slash", s[s.formFeed = 12] = "formFeed", s[s.tab = 9] = "tab";
})(CharacterCodes ||= {}), Array(20).fill(0).map((s, I) => " ".repeat(I));
var maxCachedValues = 200;
Array(maxCachedValues).fill(0).map((s, I) => "\n" + " ".repeat(I)), Array(maxCachedValues).fill(0).map((s, I) => "\r" + " ".repeat(I)), Array(maxCachedValues).fill(0).map((s, I) => "\r\n" + " ".repeat(I)), Array(maxCachedValues).fill(0).map((s, I) => "\n" + "	".repeat(I)), Array(maxCachedValues).fill(0).map((s, I) => "\r" + "	".repeat(I)), Array(maxCachedValues).fill(0).map((s, I) => "\r\n" + "	".repeat(I));
var ParseOptions;
(function(s) {
	s.DEFAULT = { allowTrailingComma: !1 };
})(ParseOptions ||= {});
var createScanner2 = createScanner, ScanError;
(function(s) {
	s[s.None = 0] = "None", s[s.UnexpectedEndOfComment = 1] = "UnexpectedEndOfComment", s[s.UnexpectedEndOfString = 2] = "UnexpectedEndOfString", s[s.UnexpectedEndOfNumber = 3] = "UnexpectedEndOfNumber", s[s.InvalidUnicode = 4] = "InvalidUnicode", s[s.InvalidEscapeCharacter = 5] = "InvalidEscapeCharacter", s[s.InvalidCharacter = 6] = "InvalidCharacter";
})(ScanError ||= {});
var SyntaxKind;
(function(s) {
	s[s.OpenBraceToken = 1] = "OpenBraceToken", s[s.CloseBraceToken = 2] = "CloseBraceToken", s[s.OpenBracketToken = 3] = "OpenBracketToken", s[s.CloseBracketToken = 4] = "CloseBracketToken", s[s.CommaToken = 5] = "CommaToken", s[s.ColonToken = 6] = "ColonToken", s[s.NullKeyword = 7] = "NullKeyword", s[s.TrueKeyword = 8] = "TrueKeyword", s[s.FalseKeyword = 9] = "FalseKeyword", s[s.StringLiteral = 10] = "StringLiteral", s[s.NumericLiteral = 11] = "NumericLiteral", s[s.LineCommentTrivia = 12] = "LineCommentTrivia", s[s.BlockCommentTrivia = 13] = "BlockCommentTrivia", s[s.LineBreakTrivia = 14] = "LineBreakTrivia", s[s.Trivia = 15] = "Trivia", s[s.Unknown = 16] = "Unknown", s[s.EOF = 17] = "EOF";
})(SyntaxKind ||= {});
var ParseErrorCode;
(function(s) {
	s[s.InvalidSymbol = 1] = "InvalidSymbol", s[s.InvalidNumberFormat = 2] = "InvalidNumberFormat", s[s.PropertyNameExpected = 3] = "PropertyNameExpected", s[s.ValueExpected = 4] = "ValueExpected", s[s.ColonExpected = 5] = "ColonExpected", s[s.CommaExpected = 6] = "CommaExpected", s[s.CloseBraceExpected = 7] = "CloseBraceExpected", s[s.CloseBracketExpected = 8] = "CloseBracketExpected", s[s.EndOfFileExpected = 9] = "EndOfFileExpected", s[s.InvalidCommentToken = 10] = "InvalidCommentToken", s[s.UnexpectedEndOfComment = 11] = "UnexpectedEndOfComment", s[s.UnexpectedEndOfString = 12] = "UnexpectedEndOfString", s[s.UnexpectedEndOfNumber = 13] = "UnexpectedEndOfNumber", s[s.InvalidUnicode = 14] = "InvalidUnicode", s[s.InvalidEscapeCharacter = 15] = "InvalidEscapeCharacter", s[s.InvalidCharacter = 16] = "InvalidCharacter";
})(ParseErrorCode ||= {});
function createTokenizationSupport(s) {
	return {
		getInitialState: () => new JSONState(null, null, !1, null),
		tokenize: (I, L) => tokenize(s, I, L)
	};
}
var TOKEN_DELIM_OBJECT = "delimiter.bracket.json", TOKEN_DELIM_ARRAY = "delimiter.array.json", TOKEN_DELIM_COLON = "delimiter.colon.json", TOKEN_DELIM_COMMA = "delimiter.comma.json", TOKEN_VALUE_BOOLEAN = "keyword.json", TOKEN_VALUE_NULL = "keyword.json", TOKEN_VALUE_STRING = "string.value.json", TOKEN_VALUE_NUMBER = "number.json", TOKEN_PROPERTY_NAME = "string.key.json", TOKEN_COMMENT_BLOCK = "comment.block.json", TOKEN_COMMENT_LINE = "comment.line.json", ParentsStack = class s {
	constructor(s, I) {
		this.parent = s, this.type = I;
	}
	static pop(s) {
		return s ? s.parent : null;
	}
	static push(I, L) {
		return new s(I, L);
	}
	static equals(s, I) {
		if (!s && !I) return !0;
		if (!s || !I) return !1;
		for (; s && I;) {
			if (s === I) return !0;
			if (s.type !== I.type) return !1;
			s = s.parent, I = I.parent;
		}
		return !0;
	}
}, JSONState = class s {
	constructor(s, I, L, R) {
		this._state = s, this.scanError = I, this.lastWasColon = L, this.parents = R;
	}
	clone() {
		return new s(this._state, this.scanError, this.lastWasColon, this.parents);
	}
	equals(I) {
		return I === this ? !0 : !I || !(I instanceof s) ? !1 : this.scanError === I.scanError && this.lastWasColon === I.lastWasColon && ParentsStack.equals(this.parents, I.parents);
	}
	getStateData() {
		return this._state;
	}
	setStateData(s) {
		this._state = s;
	}
};
function tokenize(s, I, L, R = 0) {
	let z = 0, B = !1;
	switch (L.scanError) {
		case 2:
			I = "\"" + I, z = 1;
			break;
		case 1:
			I = "/*" + I, z = 2;
			break;
	}
	let V = createScanner2(I), H = L.lastWasColon, U = L.parents, W = {
		tokens: [],
		endState: L.clone()
	};
	for (;;) {
		let G = R + V.getPosition(), K = "", q = V.scan();
		if (q === 17) break;
		if (G === R + V.getPosition()) throw Error("Scanner did not advance, next 3 characters are: " + I.substr(V.getPosition(), 3));
		switch (B && (G -= z), B = z > 0, q) {
			case 1:
				U = ParentsStack.push(U, 0), K = TOKEN_DELIM_OBJECT, H = !1;
				break;
			case 2:
				U = ParentsStack.pop(U), K = TOKEN_DELIM_OBJECT, H = !1;
				break;
			case 3:
				U = ParentsStack.push(U, 1), K = TOKEN_DELIM_ARRAY, H = !1;
				break;
			case 4:
				U = ParentsStack.pop(U), K = TOKEN_DELIM_ARRAY, H = !1;
				break;
			case 6:
				K = TOKEN_DELIM_COLON, H = !0;
				break;
			case 5:
				K = TOKEN_DELIM_COMMA, H = !1;
				break;
			case 8:
			case 9:
				K = TOKEN_VALUE_BOOLEAN, H = !1;
				break;
			case 7:
				K = TOKEN_VALUE_NULL, H = !1;
				break;
			case 10:
				let s = (U ? U.type : 0) === 1;
				K = H || s ? TOKEN_VALUE_STRING : TOKEN_PROPERTY_NAME, H = !1;
				break;
			case 11:
				K = TOKEN_VALUE_NUMBER, H = !1;
				break;
		}
		if (s) switch (q) {
			case 12:
				K = TOKEN_COMMENT_LINE;
				break;
			case 13:
				K = TOKEN_COMMENT_BLOCK;
				break;
		}
		W.endState = new JSONState(L.getStateData(), V.getTokenError(), H, U), W.tokens.push({
			startIndex: G,
			scopes: K
		});
	}
	return W;
}
var worker;
function getWorker() {
	return new Promise((s, I) => {
		if (!worker) return I("JSON not registered!");
		s(worker);
	});
}
var JSONDiagnosticsAdapter = class extends DiagnosticsAdapter {
	constructor(s, I, L) {
		super(s, I, L.onDidChange), this._disposables.push(monaco_editor_core_exports.editor.onWillDisposeModel((s) => {
			this._resetSchema(s.uri);
		})), this._disposables.push(monaco_editor_core_exports.editor.onDidChangeModelLanguage((s) => {
			this._resetSchema(s.model.uri);
		}));
	}
	_resetSchema(s) {
		this._worker().then((I) => {
			I.resetSchema(s.toString());
		});
	}
};
function setupMode(s) {
	let I = [], L = [], R = new WorkerManager(s);
	I.push(R), worker = (...s) => R.getLanguageServiceWorker(...s);
	function z() {
		let { languageId: I, modeConfiguration: R } = s;
		disposeAll(L), R.documentFormattingEdits && L.push(monaco_editor_core_exports.languages.registerDocumentFormattingEditProvider(I, new DocumentFormattingEditProvider(worker))), R.documentRangeFormattingEdits && L.push(monaco_editor_core_exports.languages.registerDocumentRangeFormattingEditProvider(I, new DocumentRangeFormattingEditProvider(worker))), R.completionItems && L.push(monaco_editor_core_exports.languages.registerCompletionItemProvider(I, new CompletionAdapter(worker, [
			" ",
			":",
			"\""
		]))), R.hovers && L.push(monaco_editor_core_exports.languages.registerHoverProvider(I, new HoverAdapter(worker))), R.documentSymbols && L.push(monaco_editor_core_exports.languages.registerDocumentSymbolProvider(I, new DocumentSymbolAdapter(worker))), R.tokens && L.push(monaco_editor_core_exports.languages.setTokensProvider(I, createTokenizationSupport(!0))), R.colors && L.push(monaco_editor_core_exports.languages.registerColorProvider(I, new DocumentColorAdapter(worker))), R.foldingRanges && L.push(monaco_editor_core_exports.languages.registerFoldingRangeProvider(I, new FoldingRangeAdapter(worker))), R.diagnostics && L.push(new JSONDiagnosticsAdapter(I, worker, s)), R.selectionRanges && L.push(monaco_editor_core_exports.languages.registerSelectionRangeProvider(I, new SelectionRangeAdapter(worker)));
	}
	z(), I.push(monaco_editor_core_exports.languages.setLanguageConfiguration(s.languageId, richEditConfiguration));
	let B = s.modeConfiguration;
	return s.onDidChange((s) => {
		s.modeConfiguration !== B && (B = s.modeConfiguration, z());
	}), I.push(asDisposable(L)), asDisposable(I);
}
function asDisposable(s) {
	return { dispose: () => disposeAll(s) };
}
function disposeAll(s) {
	for (; s.length;) s.pop().dispose();
}
var richEditConfiguration = {
	wordPattern: /(-?\d*\.\d\w*)|([^\[\{\]\}\:\"\,\s]+)/g,
	comments: {
		lineComment: "//",
		blockComment: ["/*", "*/"]
	},
	brackets: [["{", "}"], ["[", "]"]],
	autoClosingPairs: [
		{
			open: "{",
			close: "}",
			notIn: ["string"]
		},
		{
			open: "[",
			close: "]",
			notIn: ["string"]
		},
		{
			open: "\"",
			close: "\"",
			notIn: ["string"]
		}
	]
};
export { CompletionAdapter, DefinitionAdapter, DiagnosticsAdapter, DocumentColorAdapter, DocumentFormattingEditProvider, DocumentHighlightAdapter, DocumentLinkAdapter, DocumentRangeFormattingEditProvider, DocumentSymbolAdapter, FoldingRangeAdapter, HoverAdapter, ReferenceAdapter, RenameAdapter, SelectionRangeAdapter, WorkerManager, fromPosition, fromRange, getWorker, setupMode, toRange, toTextEdit };
