UNPKG

omii-ui

Version:

使用OMII开发的WebComponents库,样式采用bootstrap。可以作为标准的esmodule使用

1,634 lines (1,624 loc) 6.98 MB
var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __esm = (fn, res) => function __init() { return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; }; var __commonJS = (cb, mod) => function __require2() { return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; }; var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; var __copyProps = (to, from, except, desc) => { if (from && typeof from === "object" || typeof from === "function") { for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } return to; }; var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, mod )); // node_modules/monaco-editor/esm/vs/nls.js function _format(message, args) { let result; if (args.length === 0) { result = message; } else { result = message.replace(/\{(\d+)\}/g, (match2, rest) => { const index = rest[0]; const arg = args[index]; let result2 = match2; if (typeof arg === "string") { result2 = arg; } else if (typeof arg === "number" || typeof arg === "boolean" || arg === void 0 || arg === null) { result2 = String(arg); } return result2; }); } if (isPseudo) { result = "\uFF3B" + result.replace(/[aouei]/g, "$&$&") + "\uFF3D"; } return result; } function localize(data, message, ...args) { return _format(message, args); } function getConfiguredDefaultLocale(_) { return void 0; } var isPseudo; var init_nls = __esm({ "node_modules/monaco-editor/esm/vs/nls.js"() { isPseudo = typeof document !== "undefined" && document.location && document.location.hash.indexOf("pseudo=true") >= 0; } }); // node_modules/monaco-editor/esm/vs/base/common/platform.js function isLittleEndian() { if (!_isLittleEndianComputed) { _isLittleEndianComputed = true; const test = new Uint8Array(2); test[0] = 1; test[1] = 2; const view = new Uint16Array(test.buffer); _isLittleEndian = view[0] === (2 << 8) + 1; } return _isLittleEndian; } var _a, LANGUAGE_DEFAULT, _isWindows, _isMacintosh, _isLinux, _isLinuxSnap, _isNative, _isWeb, _isElectron, _isIOS, _isCI, _locale, _language, _translationsConfigFile, _userAgent, globals, nodeProcess, isElectronProcess, isElectronRenderer, _platform, isWindows, isMacintosh, isLinux, isNative, isWeb, isWebWorker, isIOS, userAgent, language, setTimeout0IsFaster, setTimeout0, OS, _isLittleEndian, _isLittleEndianComputed, isChrome, isFirefox, isSafari, isEdge, isAndroid; var init_platform = __esm({ "node_modules/monaco-editor/esm/vs/base/common/platform.js"() { init_nls(); LANGUAGE_DEFAULT = "en"; _isWindows = false; _isMacintosh = false; _isLinux = false; _isLinuxSnap = false; _isNative = false; _isWeb = false; _isElectron = false; _isIOS = false; _isCI = false; _locale = void 0; _language = LANGUAGE_DEFAULT; _translationsConfigFile = void 0; _userAgent = void 0; globals = typeof self === "object" ? self : typeof global === "object" ? global : {}; nodeProcess = void 0; if (typeof globals.vscode !== "undefined" && typeof globals.vscode.process !== "undefined") { nodeProcess = globals.vscode.process; } else if (typeof process !== "undefined") { nodeProcess = process; } isElectronProcess = typeof ((_a = nodeProcess === null || nodeProcess === void 0 ? void 0 : nodeProcess.versions) === null || _a === void 0 ? void 0 : _a.electron) === "string"; isElectronRenderer = isElectronProcess && (nodeProcess === null || nodeProcess === void 0 ? void 0 : nodeProcess.type) === "renderer"; if (typeof navigator === "object" && !isElectronRenderer) { _userAgent = navigator.userAgent; _isWindows = _userAgent.indexOf("Windows") >= 0; _isMacintosh = _userAgent.indexOf("Macintosh") >= 0; _isIOS = (_userAgent.indexOf("Macintosh") >= 0 || _userAgent.indexOf("iPad") >= 0 || _userAgent.indexOf("iPhone") >= 0) && !!navigator.maxTouchPoints && navigator.maxTouchPoints > 0; _isLinux = _userAgent.indexOf("Linux") >= 0; _isWeb = true; const configuredLocale = getConfiguredDefaultLocale( // This call _must_ be done in the file that calls `nls.getConfiguredDefaultLocale` // to ensure that the NLS AMD Loader plugin has been loaded and configured. // This is because the loader plugin decides what the default locale is based on // how it's able to resolve the strings. localize({ key: "ensureLoaderPluginIsLoaded", comment: ["{Locked}"] }, "_") ); _locale = configuredLocale || LANGUAGE_DEFAULT; _language = _locale; } else if (typeof nodeProcess === "object") { _isWindows = nodeProcess.platform === "win32"; _isMacintosh = nodeProcess.platform === "darwin"; _isLinux = nodeProcess.platform === "linux"; _isLinuxSnap = _isLinux && !!nodeProcess.env["SNAP"] && !!nodeProcess.env["SNAP_REVISION"]; _isElectron = isElectronProcess; _isCI = !!nodeProcess.env["CI"] || !!nodeProcess.env["BUILD_ARTIFACTSTAGINGDIRECTORY"]; _locale = LANGUAGE_DEFAULT; _language = LANGUAGE_DEFAULT; const rawNlsConfig = nodeProcess.env["VSCODE_NLS_CONFIG"]; if (rawNlsConfig) { try { const nlsConfig = JSON.parse(rawNlsConfig); const resolved = nlsConfig.availableLanguages["*"]; _locale = nlsConfig.locale; _language = resolved ? resolved : LANGUAGE_DEFAULT; _translationsConfigFile = nlsConfig._translationsConfigFile; } catch (e) { } } _isNative = true; } else { console.error("Unable to resolve platform."); } _platform = 0; if (_isMacintosh) { _platform = 1; } else if (_isWindows) { _platform = 3; } else if (_isLinux) { _platform = 2; } isWindows = _isWindows; isMacintosh = _isMacintosh; isLinux = _isLinux; isNative = _isNative; isWeb = _isWeb; isWebWorker = _isWeb && typeof globals.importScripts === "function"; isIOS = _isIOS; userAgent = _userAgent; language = _language; setTimeout0IsFaster = typeof globals.postMessage === "function" && !globals.importScripts; setTimeout0 = (() => { if (setTimeout0IsFaster) { const pending = []; globals.addEventListener("message", (e) => { if (e.data && e.data.vscodeScheduleAsyncWork) { for (let i = 0, len = pending.length; i < len; i++) { const candidate = pending[i]; if (candidate.id === e.data.vscodeScheduleAsyncWork) { pending.splice(i, 1); candidate.callback(); return; } } } }); let lastId = 0; return (callback) => { const myId = ++lastId; pending.push({ id: myId, callback }); globals.postMessage({ vscodeScheduleAsyncWork: myId }, "*"); }; } return (callback) => setTimeout(callback); })(); OS = _isMacintosh || _isIOS ? 2 : _isWindows ? 1 : 3; _isLittleEndian = true; _isLittleEndianComputed = false; isChrome = !!(userAgent && userAgent.indexOf("Chrome") >= 0); isFirefox = !!(userAgent && userAgent.indexOf("Firefox") >= 0); isSafari = !!(!isChrome && (userAgent && userAgent.indexOf("Safari") >= 0)); isEdge = !!(userAgent && userAgent.indexOf("Edg/") >= 0); isAndroid = !!(userAgent && userAgent.indexOf("Android") >= 0); } }); // node_modules/monaco-editor/esm/vs/base/common/iterator.js var Iterable; var init_iterator = __esm({ "node_modules/monaco-editor/esm/vs/base/common/iterator.js"() { (function(Iterable2) { function is(thing) { return thing && typeof thing === "object" && typeof thing[Symbol.iterator] === "function"; } Iterable2.is = is; const _empty2 = Object.freeze([]); function empty2() { return _empty2; } Iterable2.empty = empty2; function* single(element) { yield element; } Iterable2.single = single; function from(iterable) { return iterable || _empty2; } Iterable2.from = from; function isEmpty(iterable) { return !iterable || iterable[Symbol.iterator]().next().done === true; } Iterable2.isEmpty = isEmpty; function first2(iterable) { return iterable[Symbol.iterator]().next().value; } Iterable2.first = first2; function some(iterable, predicate) { for (const element of iterable) { if (predicate(element)) { return true; } } return false; } Iterable2.some = some; function find(iterable, predicate) { for (const element of iterable) { if (predicate(element)) { return element; } } return void 0; } Iterable2.find = find; function* filter(iterable, predicate) { for (const element of iterable) { if (predicate(element)) { yield element; } } } Iterable2.filter = filter; function* map(iterable, fn) { let index = 0; for (const element of iterable) { yield fn(element, index++); } } Iterable2.map = map; function* concat3(...iterables) { for (const iterable of iterables) { for (const element of iterable) { yield element; } } } Iterable2.concat = concat3; function* concatNested(iterables) { for (const iterable of iterables) { for (const element of iterable) { yield element; } } } Iterable2.concatNested = concatNested; function reduce(iterable, reducer, initialValue) { let value = initialValue; for (const element of iterable) { value = reducer(value, element); } return value; } Iterable2.reduce = reduce; function forEach(iterable, fn) { let index = 0; for (const element of iterable) { fn(element, index++); } } Iterable2.forEach = forEach; function* slice(arr, from2, to = arr.length) { if (from2 < 0) { from2 += arr.length; } if (to < 0) { to += arr.length; } else if (to > arr.length) { to = arr.length; } for (; from2 < to; from2++) { yield arr[from2]; } } Iterable2.slice = slice; function consume(iterable, atMost = Number.POSITIVE_INFINITY) { const consumed = []; if (atMost === 0) { return [consumed, iterable]; } const iterator = iterable[Symbol.iterator](); for (let i = 0; i < atMost; i++) { const next = iterator.next(); if (next.done) { return [consumed, Iterable2.empty()]; } consumed.push(next.value); } return [consumed, { [Symbol.iterator]() { return iterator; } }]; } Iterable2.consume = consume; function collect(iterable) { return consume(iterable)[0]; } Iterable2.collect = collect; function equals3(a, b, comparator = (at, bt) => at === bt) { const ai = a[Symbol.iterator](); const bi = b[Symbol.iterator](); while (true) { const an = ai.next(); const bn = bi.next(); if (an.done !== bn.done) { return false; } else if (an.done) { return true; } else if (!comparator(an.value, bn.value)) { return false; } } } Iterable2.equals = equals3; })(Iterable || (Iterable = {})); } }); // node_modules/monaco-editor/esm/vs/base/common/linkedList.js var Node2, LinkedList; var init_linkedList = __esm({ "node_modules/monaco-editor/esm/vs/base/common/linkedList.js"() { Node2 = class { constructor(element) { this.element = element; this.next = Node2.Undefined; this.prev = Node2.Undefined; } }; Node2.Undefined = new Node2(void 0); LinkedList = class { constructor() { this._first = Node2.Undefined; this._last = Node2.Undefined; this._size = 0; } get size() { return this._size; } isEmpty() { return this._first === Node2.Undefined; } clear() { let node = this._first; while (node !== Node2.Undefined) { const next = node.next; node.prev = Node2.Undefined; node.next = Node2.Undefined; node = next; } this._first = Node2.Undefined; this._last = Node2.Undefined; this._size = 0; } unshift(element) { return this._insert(element, false); } push(element) { return this._insert(element, true); } _insert(element, atTheEnd) { const newNode = new Node2(element); if (this._first === Node2.Undefined) { this._first = newNode; this._last = newNode; } else if (atTheEnd) { const oldLast = this._last; this._last = newNode; newNode.prev = oldLast; oldLast.next = newNode; } else { const oldFirst = this._first; this._first = newNode; newNode.next = oldFirst; oldFirst.prev = newNode; } this._size += 1; let didRemove = false; return () => { if (!didRemove) { didRemove = true; this._remove(newNode); } }; } shift() { if (this._first === Node2.Undefined) { return void 0; } else { const res = this._first.element; this._remove(this._first); return res; } } pop() { if (this._last === Node2.Undefined) { return void 0; } else { const res = this._last.element; this._remove(this._last); return res; } } _remove(node) { if (node.prev !== Node2.Undefined && node.next !== Node2.Undefined) { const anchor = node.prev; anchor.next = node.next; node.next.prev = anchor; } else if (node.prev === Node2.Undefined && node.next === Node2.Undefined) { this._first = Node2.Undefined; this._last = Node2.Undefined; } else if (node.next === Node2.Undefined) { this._last = this._last.prev; this._last.next = Node2.Undefined; } else if (node.prev === Node2.Undefined) { this._first = this._first.next; this._first.prev = Node2.Undefined; } this._size -= 1; } *[Symbol.iterator]() { let node = this._first; while (node !== Node2.Undefined) { yield node.element; node = node.next; } } }; } }); // node_modules/monaco-editor/esm/vs/editor/common/core/wordHelper.js function createWordRegExp(allowInWords = "") { let source = "(-?\\d*\\.\\d\\w*)|([^"; for (const sep2 of USUAL_WORD_SEPARATORS) { if (allowInWords.indexOf(sep2) >= 0) { continue; } source += "\\" + sep2; } source += "\\s]+)"; return new RegExp(source, "g"); } function ensureValidWordDefinition(wordDefinition) { let result = DEFAULT_WORD_REGEXP; if (wordDefinition && wordDefinition instanceof RegExp) { if (!wordDefinition.global) { let flags = "g"; if (wordDefinition.ignoreCase) { flags += "i"; } if (wordDefinition.multiline) { flags += "m"; } if (wordDefinition.unicode) { flags += "u"; } result = new RegExp(wordDefinition.source, flags); } else { result = wordDefinition; } } result.lastIndex = 0; return result; } function getWordAtText(column, wordDefinition, text2, textOffset, config) { if (!config) { config = Iterable.first(_defaultConfig); } if (text2.length > config.maxLen) { let start = column - config.maxLen / 2; if (start < 0) { start = 0; } else { textOffset += start; } text2 = text2.substring(start, column + config.maxLen / 2); return getWordAtText(column, wordDefinition, text2, textOffset, config); } const t1 = Date.now(); const pos = column - 1 - textOffset; let prevRegexIndex = -1; let match2 = null; for (let i = 1; ; i++) { if (Date.now() - t1 >= config.timeBudget) { break; } const regexIndex = pos - config.windowSize * i; wordDefinition.lastIndex = Math.max(0, regexIndex); const thisMatch = _findRegexMatchEnclosingPosition(wordDefinition, text2, pos, prevRegexIndex); if (!thisMatch && match2) { break; } match2 = thisMatch; if (regexIndex <= 0) { break; } prevRegexIndex = regexIndex; } if (match2) { const result = { word: match2[0], startColumn: textOffset + 1 + match2.index, endColumn: textOffset + 1 + match2.index + match2[0].length }; wordDefinition.lastIndex = 0; return result; } return null; } function _findRegexMatchEnclosingPosition(wordDefinition, text2, pos, stopPos) { let match2; while (match2 = wordDefinition.exec(text2)) { const matchIndex = match2.index || 0; if (matchIndex <= pos && wordDefinition.lastIndex >= pos) { return match2; } else if (stopPos > 0 && matchIndex > stopPos) { return null; } } return null; } var USUAL_WORD_SEPARATORS, DEFAULT_WORD_REGEXP, _defaultConfig; var init_wordHelper = __esm({ "node_modules/monaco-editor/esm/vs/editor/common/core/wordHelper.js"() { init_iterator(); init_linkedList(); USUAL_WORD_SEPARATORS = "`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/?"; DEFAULT_WORD_REGEXP = createWordRegExp(); _defaultConfig = new LinkedList(); _defaultConfig.unshift({ maxLen: 1e3, windowSize: 15, timeBudget: 150 }); } }); // node_modules/monaco-editor/esm/vs/base/common/arrays.js function tail(array2, n = 0) { return array2[array2.length - (1 + n)]; } function tail2(arr) { if (arr.length === 0) { throw new Error("Invalid tail call"); } return [arr.slice(0, arr.length - 1), arr[arr.length - 1]]; } function equals(one, other, itemEquals = (a, b) => a === b) { if (one === other) { return true; } if (!one || !other) { return false; } if (one.length !== other.length) { return false; } for (let i = 0, len = one.length; i < len; i++) { if (!itemEquals(one[i], other[i])) { return false; } } return true; } function removeFastWithoutKeepingOrder(array2, index) { const last = array2.length - 1; if (index < last) { array2[index] = array2[last]; } array2.pop(); } function binarySearch(array2, key, comparator) { return binarySearch2(array2.length, (i) => comparator(array2[i], key)); } function binarySearch2(length, compareToKey) { let low = 0, high = length - 1; while (low <= high) { const mid = (low + high) / 2 | 0; const comp = compareToKey(mid); if (comp < 0) { low = mid + 1; } else if (comp > 0) { high = mid - 1; } else { return mid; } } return -(low + 1); } function findFirstInSorted(array2, p) { let low = 0, high = array2.length; if (high === 0) { return 0; } while (low < high) { const mid = Math.floor((low + high) / 2); if (p(array2[mid])) { high = mid; } else { low = mid + 1; } } return low; } function quickSelect(nth, data, compare2) { nth = nth | 0; if (nth >= data.length) { throw new TypeError("invalid index"); } const pivotValue = data[Math.floor(data.length * Math.random())]; const lower = []; const higher = []; const pivots = []; for (const value of data) { const val = compare2(value, pivotValue); if (val < 0) { lower.push(value); } else if (val > 0) { higher.push(value); } else { pivots.push(value); } } if (nth < lower.length) { return quickSelect(nth, lower, compare2); } else if (nth < lower.length + pivots.length) { return pivots[0]; } else { return quickSelect(nth - (lower.length + pivots.length), higher, compare2); } } function groupBy(data, compare2) { const result = []; let currentGroup = void 0; for (const element of data.slice(0).sort(compare2)) { if (!currentGroup || compare2(currentGroup[0], element) !== 0) { currentGroup = [element]; result.push(currentGroup); } else { currentGroup.push(element); } } return result; } function coalesce(array2) { return array2.filter((e) => !!e); } function isFalsyOrEmpty(obj) { return !Array.isArray(obj) || obj.length === 0; } function isNonEmptyArray(obj) { return Array.isArray(obj) && obj.length > 0; } function distinct(array2, keyFn = (value) => value) { const seen = /* @__PURE__ */ new Set(); return array2.filter((element) => { const key = keyFn(element); if (seen.has(key)) { return false; } seen.add(key); return true; }); } function findLast(arr, predicate) { const idx = lastIndex(arr, predicate); if (idx === -1) { return void 0; } return arr[idx]; } function lastIndex(array2, fn) { for (let i = array2.length - 1; i >= 0; i--) { const element = array2[i]; if (fn(element)) { return i; } } return -1; } function firstOrDefault(array2, notFoundValue) { return array2.length > 0 ? array2[0] : notFoundValue; } function range(arg, to) { let from = typeof to === "number" ? arg : 0; if (typeof to === "number") { from = arg; } else { from = 0; to = arg; } const result = []; if (from <= to) { for (let i = from; i < to; i++) { result.push(i); } } else { for (let i = from; i > to; i--) { result.push(i); } } return result; } function arrayInsert(target, insertIndex, insertArr) { const before = target.slice(0, insertIndex); const after = target.slice(insertIndex); return before.concat(insertArr, after); } function pushToStart(arr, value) { const index = arr.indexOf(value); if (index > -1) { arr.splice(index, 1); arr.unshift(value); } } function pushToEnd(arr, value) { const index = arr.indexOf(value); if (index > -1) { arr.splice(index, 1); arr.push(value); } } function pushMany(arr, items) { for (const item of items) { arr.push(item); } } function asArray(x) { return Array.isArray(x) ? x : [x]; } function insertInto(array2, start, newItems) { const startIdx = getActualStartIndex(array2, start); const originalLength = array2.length; const newItemsLength = newItems.length; array2.length = originalLength + newItemsLength; for (let i = originalLength - 1; i >= startIdx; i--) { array2[i + newItemsLength] = array2[i]; } for (let i = 0; i < newItemsLength; i++) { array2[i + startIdx] = newItems[i]; } } function splice(array2, start, deleteCount, newItems) { const index = getActualStartIndex(array2, start); const result = array2.splice(index, deleteCount); insertInto(array2, index, newItems); return result; } function getActualStartIndex(array2, start) { return start < 0 ? Math.max(start + array2.length, 0) : Math.min(start, array2.length); } function compareBy(selector, comparator) { return (a, b) => comparator(selector(a), selector(b)); } function findMaxBy(items, comparator) { if (items.length === 0) { return void 0; } let max = items[0]; for (let i = 1; i < items.length; i++) { const item = items[i]; if (comparator(item, max) > 0) { max = item; } } return max; } function findLastMaxBy(items, comparator) { if (items.length === 0) { return void 0; } let max = items[0]; for (let i = 1; i < items.length; i++) { const item = items[i]; if (comparator(item, max) >= 0) { max = item; } } return max; } function findMinBy(items, comparator) { return findMaxBy(items, (a, b) => -comparator(a, b)); } var CompareResult, numberComparator, ArrayQueue; var init_arrays = __esm({ "node_modules/monaco-editor/esm/vs/base/common/arrays.js"() { (function(CompareResult2) { function isLessThan(result) { return result < 0; } CompareResult2.isLessThan = isLessThan; function isGreaterThan(result) { return result > 0; } CompareResult2.isGreaterThan = isGreaterThan; function isNeitherLessOrGreaterThan(result) { return result === 0; } CompareResult2.isNeitherLessOrGreaterThan = isNeitherLessOrGreaterThan; CompareResult2.greaterThan = 1; CompareResult2.lessThan = -1; CompareResult2.neitherLessOrGreaterThan = 0; })(CompareResult || (CompareResult = {})); numberComparator = (a, b) => a - b; ArrayQueue = class { /** * Constructs a queue that is backed by the given array. Runtime is O(1). */ constructor(items) { this.items = items; this.firstIdx = 0; this.lastIdx = this.items.length - 1; } get length() { return this.lastIdx - this.firstIdx + 1; } /** * Consumes elements from the beginning of the queue as long as the predicate returns true. * If no elements were consumed, `null` is returned. Has a runtime of O(result.length). */ takeWhile(predicate) { let startIdx = this.firstIdx; while (startIdx < this.items.length && predicate(this.items[startIdx])) { startIdx++; } const result = startIdx === this.firstIdx ? null : this.items.slice(this.firstIdx, startIdx); this.firstIdx = startIdx; return result; } /** * Consumes elements from the end of the queue as long as the predicate returns true. * If no elements were consumed, `null` is returned. * The result has the same order as the underlying array! */ takeFromEndWhile(predicate) { let endIdx = this.lastIdx; while (endIdx >= 0 && predicate(this.items[endIdx])) { endIdx--; } const result = endIdx === this.lastIdx ? null : this.items.slice(endIdx + 1, this.lastIdx + 1); this.lastIdx = endIdx; return result; } peek() { if (this.length === 0) { return void 0; } return this.items[this.firstIdx]; } dequeue() { const result = this.items[this.firstIdx]; this.firstIdx++; return result; } takeCount(count) { const result = this.items.slice(this.firstIdx, this.firstIdx + count); this.firstIdx += count; return result; } }; } }); // node_modules/monaco-editor/esm/vs/base/common/types.js function isArray(array2) { return Array.isArray(array2); } function isString(str) { return typeof str === "string"; } function isObject(obj) { return typeof obj === "object" && obj !== null && !Array.isArray(obj) && !(obj instanceof RegExp) && !(obj instanceof Date); } function isTypedArray(obj) { const TypedArray = Object.getPrototypeOf(Uint8Array); return typeof obj === "object" && obj instanceof TypedArray; } function isNumber(obj) { return typeof obj === "number" && !isNaN(obj); } function isIterable(obj) { return !!obj && typeof obj[Symbol.iterator] === "function"; } function isBoolean(obj) { return obj === true || obj === false; } function isUndefined(obj) { return typeof obj === "undefined"; } function isDefined(arg) { return !isUndefinedOrNull(arg); } function isUndefinedOrNull(obj) { return isUndefined(obj) || obj === null; } function assertType(condition, type) { if (!condition) { throw new Error(type ? `Unexpected type, expected '${type}'` : "Unexpected type"); } } function assertIsDefined(arg) { if (isUndefinedOrNull(arg)) { throw new Error("Assertion Failed: argument is undefined or null"); } return arg; } function isFunction(obj) { return typeof obj === "function"; } function validateConstraints(args, constraints) { const len = Math.min(args.length, constraints.length); for (let i = 0; i < len; i++) { validateConstraint(args[i], constraints[i]); } } function validateConstraint(arg, constraint) { if (isString(constraint)) { if (typeof arg !== constraint) { throw new Error(`argument does not match constraint: typeof ${constraint}`); } } else if (isFunction(constraint)) { try { if (arg instanceof constraint) { return; } } catch (_a15) { } if (!isUndefinedOrNull(arg) && arg.constructor === constraint) { return; } if (constraint.length === 1 && constraint.call(void 0, arg) === true) { return; } throw new Error(`argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true`); } } function getAllPropertyNames(obj) { let res = []; let proto = Object.getPrototypeOf(obj); while (Object.prototype !== proto) { res = res.concat(Object.getOwnPropertyNames(proto)); proto = Object.getPrototypeOf(proto); } return res; } function getAllMethodNames(obj) { const methods = []; for (const prop of getAllPropertyNames(obj)) { if (typeof obj[prop] === "function") { methods.push(prop); } } return methods; } function createProxyObject(methodNames, invoke) { const createProxyMethod = (method) => { return function() { const args = Array.prototype.slice.call(arguments, 0); return invoke(method, args); }; }; const result = {}; for (const methodName of methodNames) { result[methodName] = createProxyMethod(methodName); } return result; } function withNullAsUndefined(x) { return x === null ? void 0 : x; } function assertNever(value, message = "Unreachable") { throw new Error(message); } var init_types = __esm({ "node_modules/monaco-editor/esm/vs/base/common/types.js"() { } }); // node_modules/monaco-editor/esm/vs/base/common/objects.js function deepClone(obj) { if (!obj || typeof obj !== "object") { return obj; } if (obj instanceof RegExp) { return obj; } const result = Array.isArray(obj) ? [] : {}; Object.keys(obj).forEach((key) => { if (obj[key] && typeof obj[key] === "object") { result[key] = deepClone(obj[key]); } else { result[key] = obj[key]; } }); return result; } function deepFreeze(obj) { if (!obj || typeof obj !== "object") { return obj; } const stack = [obj]; while (stack.length > 0) { const obj2 = stack.shift(); Object.freeze(obj2); for (const key in obj2) { if (_hasOwnProperty.call(obj2, key)) { const prop = obj2[key]; if (typeof prop === "object" && !Object.isFrozen(prop) && !isTypedArray(prop)) { stack.push(prop); } } } } return obj; } function cloneAndChange(obj, changer) { return _cloneAndChange(obj, changer, /* @__PURE__ */ new Set()); } function _cloneAndChange(obj, changer, seen) { if (isUndefinedOrNull(obj)) { return obj; } const changed = changer(obj); if (typeof changed !== "undefined") { return changed; } if (isArray(obj)) { const r1 = []; for (const e of obj) { r1.push(_cloneAndChange(e, changer, seen)); } return r1; } if (isObject(obj)) { if (seen.has(obj)) { throw new Error("Cannot clone recursive data-structure"); } seen.add(obj); const r2 = {}; for (const i2 in obj) { if (_hasOwnProperty.call(obj, i2)) { r2[i2] = _cloneAndChange(obj[i2], changer, seen); } } seen.delete(obj); return r2; } return obj; } function mixin(destination, source, overwrite = true) { if (!isObject(destination)) { return source; } if (isObject(source)) { Object.keys(source).forEach((key) => { if (key in destination) { if (overwrite) { if (isObject(destination[key]) && isObject(source[key])) { mixin(destination[key], source[key], overwrite); } else { destination[key] = source[key]; } } } else { destination[key] = source[key]; } }); } return destination; } function equals2(one, other) { if (one === other) { return true; } if (one === null || one === void 0 || other === null || other === void 0) { return false; } if (typeof one !== typeof other) { return false; } if (typeof one !== "object") { return false; } if (Array.isArray(one) !== Array.isArray(other)) { return false; } let i; let key; if (Array.isArray(one)) { if (one.length !== other.length) { return false; } for (i = 0; i < one.length; i++) { if (!equals2(one[i], other[i])) { return false; } } } else { const oneKeys = []; for (key in one) { oneKeys.push(key); } oneKeys.sort(); const otherKeys = []; for (key in other) { otherKeys.push(key); } otherKeys.sort(); if (!equals2(oneKeys, otherKeys)) { return false; } for (i = 0; i < oneKeys.length; i++) { if (!equals2(one[oneKeys[i]], other[oneKeys[i]])) { return false; } } } return true; } var _hasOwnProperty; var init_objects = __esm({ "node_modules/monaco-editor/esm/vs/base/common/objects.js"() { init_types(); _hasOwnProperty = Object.prototype.hasOwnProperty; } }); // node_modules/monaco-editor/esm/vs/editor/common/core/textModelDefaults.js var EDITOR_MODEL_DEFAULTS; var init_textModelDefaults = __esm({ "node_modules/monaco-editor/esm/vs/editor/common/core/textModelDefaults.js"() { EDITOR_MODEL_DEFAULTS = { tabSize: 4, indentSize: 4, insertSpaces: true, detectIndentation: true, trimAutoWhitespace: true, largeFileOptimizations: true, bracketPairColorizationOptions: { enabled: true, independentColorPoolPerBracketType: false } }; } }); // node_modules/monaco-editor/esm/vs/editor/common/config/editorOptions.js function applyUpdate(value, update) { if (typeof value !== "object" || typeof update !== "object" || !value || !update) { return new ApplyUpdateResult(update, value !== update); } if (Array.isArray(value) || Array.isArray(update)) { const arrayEquals = Array.isArray(value) && Array.isArray(update) && equals(value, update); return new ApplyUpdateResult(update, !arrayEquals); } let didChange = false; for (const key in update) { if (update.hasOwnProperty(key)) { const result = applyUpdate(value[key], update[key]); if (result.didChange) { value[key] = result.newValue; didChange = true; } } } return new ApplyUpdateResult(value, didChange); } function boolean(value, defaultValue) { if (typeof value === "undefined") { return defaultValue; } if (value === "false") { return false; } return Boolean(value); } function clampedInt(value, defaultValue, minimum, maximum) { if (typeof value === "undefined") { return defaultValue; } let r = parseInt(value, 10); if (isNaN(r)) { return defaultValue; } r = Math.max(minimum, r); r = Math.min(maximum, r); return r | 0; } function stringSet(value, defaultValue, allowedValues) { if (typeof value !== "string") { return defaultValue; } if (allowedValues.indexOf(value) === -1) { return defaultValue; } return value; } function _autoIndentFromString(autoIndent) { switch (autoIndent) { case "none": return 0; case "keep": return 1; case "brackets": return 2; case "advanced": return 3; case "full": return 4; } } function _cursorBlinkingStyleFromString(cursorBlinkingStyle) { switch (cursorBlinkingStyle) { case "blink": return 1; case "smooth": return 2; case "phase": return 3; case "expand": return 4; case "solid": return 5; } } function _cursorStyleFromString(cursorStyle) { switch (cursorStyle) { case "line": return TextEditorCursorStyle.Line; case "block": return TextEditorCursorStyle.Block; case "underline": return TextEditorCursorStyle.Underline; case "line-thin": return TextEditorCursorStyle.LineThin; case "block-outline": return TextEditorCursorStyle.BlockOutline; case "underline-thin": return TextEditorCursorStyle.UnderlineThin; } } function _multiCursorModifierFromString(multiCursorModifier) { if (multiCursorModifier === "ctrlCmd") { return isMacintosh ? "metaKey" : "ctrlKey"; } return "altKey"; } function filterValidationDecorations(options) { const renderValidationDecorations = options.get( 89 /* EditorOption.renderValidationDecorations */ ); if (renderValidationDecorations === "editable") { return options.get( 83 /* EditorOption.readOnly */ ); } return renderValidationDecorations === "on" ? false : true; } function _scrollbarVisibilityFromString(visibility, defaultValue) { if (typeof visibility !== "string") { return defaultValue; } switch (visibility) { case "hidden": return 2; case "visible": return 3; default: return 1; } } function primitiveSet(value, defaultValue, allowedValues) { const idx = allowedValues.indexOf(value); if (idx === -1) { return defaultValue; } return allowedValues[idx]; } function _wrappingIndentFromString(wrappingIndent) { switch (wrappingIndent) { case "none": return 0; case "same": return 1; case "indent": return 2; case "deepIndent": return 3; } } function register(option) { editorOptionsRegistry[option.id] = option; return option; } var MINIMAP_GUTTER_WIDTH, ConfigurationChangedEvent, ComputeOptionsMemory, BaseEditorOption, ApplyUpdateResult, ComputedEditorOption, SimpleEditorOption, EditorBooleanOption, EditorIntOption, EditorFloatOption, EditorStringOption, EditorStringEnumOption, EditorEnumOption, EditorAccessibilitySupport, EditorComments, TextEditorCursorStyle, EditorClassName, EditorEmptySelectionClipboard, EditorFind, EditorFontLigatures, EditorFontInfo, EditorFontSize, EditorFontWeight, EditorGoToLocation, EditorHover, EditorLayoutInfoComputer, EditorLightbulb, EditorExperimental, EditorInlayHints, EditorLineHeight, EditorMinimap, EditorPadding, EditorParameterHints, EditorPixelRatio, EditorQuickSuggestions, EditorRenderLineNumbersOption, EditorRulers, EditorScrollbar, inUntrustedWorkspace, unicodeHighlightConfigKeys, UnicodeHighlight, InlineEditorSuggest, BracketPairColorization, GuideOptions, EditorSuggest, SmartSelect, EditorTabFocusMode, EditorWrappingInfoComputer, EditorDropIntoEditor, DEFAULT_WINDOWS_FONT_FAMILY, DEFAULT_MAC_FONT_FAMILY, DEFAULT_LINUX_FONT_FAMILY, EDITOR_FONT_DEFAULTS, editorOptionsRegistry, EditorOptions; var init_editorOptions = __esm({ "node_modules/monaco-editor/esm/vs/editor/common/config/editorOptions.js"() { init_nls(); init_platform(); init_wordHelper(); init_arrays(); init_objects(); init_textModelDefaults(); MINIMAP_GUTTER_WIDTH = 8; ConfigurationChangedEvent = class { /** * @internal */ constructor(values) { this._values = values; } hasChanged(id) { return this._values[id]; } }; ComputeOptionsMemory = class { constructor() { this.stableMinimapLayoutInput = null; this.stableFitMaxMinimapScale = 0; this.stableFitRemainingWidth = 0; } }; BaseEditorOption = class { constructor(id, name, defaultValue, schema) { this.id = id; this.name = name; this.defaultValue = defaultValue; this.schema = schema; } applyUpdate(value, update) { return applyUpdate(value, update); } compute(env2, options, value) { return value; } }; ApplyUpdateResult = class { constructor(newValue, didChange) { this.newValue = newValue; this.didChange = didChange; } }; ComputedEditorOption = class { constructor(id) { this.schema = void 0; this.id = id; this.name = "_never_"; this.defaultValue = void 0; } applyUpdate(value, update) { return applyUpdate(value, update); } validate(input) { return this.defaultValue; } }; SimpleEditorOption = class { constructor(id, name, defaultValue, schema) { this.id = id; this.name = name; this.defaultValue = defaultValue; this.schema = schema; } applyUpdate(value, update) { return applyUpdate(value, update); } validate(input) { if (typeof input === "undefined") { return this.defaultValue; } return input; } compute(env2, options, value) { return value; } }; EditorBooleanOption = class extends SimpleEditorOption { constructor(id, name, defaultValue, schema = void 0) { if (typeof schema !== "undefined") { schema.type = "boolean"; schema.default = defaultValue; } super(id, name, defaultValue, schema); } validate(input) { return boolean(input, this.defaultValue); } }; EditorIntOption = class extends SimpleEditorOption { constructor(id, name, defaultValue, minimum, maximum, schema = void 0) { if (typeof schema !== "undefined") { schema.type = "integer"; schema.default = defaultValue; schema.minimum = minimum; schema.maximum = maximum; } super(id, name, defaultValue, schema); this.minimum = minimum; this.maximum = maximum; } static clampedInt(value, defaultValue, minimum, maximum) { return clampedInt(value, defaultValue, minimum, maximum); } validate(input) { return EditorIntOption.clampedInt(input, this.defaultValue, this.minimum, this.maximum); } }; EditorFloatOption = class extends SimpleEditorOption { constructor(id, name, defaultValue, validationFn, schema) { if (typeof schema !== "undefined") { schema.type = "number"; schema.default = defaultValue; } super(id, name, defaultValue, schema); this.validationFn = validationFn; } static clamp(n, min, max) { if (n < min) { return min; } if (n > max) { return max; } return n; } static float(value, defaultValue) { if (typeof value === "number") { return value; } if (typeof value === "undefined") { return defaultValue; } const r = parseFloat(value); return isNaN(r) ? defaultValue : r; } validate(input) { return this.validationFn(EditorFloatOption.float(input, this.defaultValue)); } }; EditorStringOption = class extends SimpleEditorOption { static string(value, defaultValue) { if (typeof value !== "string") { return defaultValue; } return value; } constructor(id, name, defaultValue, schema = void 0) { if (typeof schema !== "undefined") { schema.type = "string"; schema.default = defaultValue; } super(id, name, defaultValue, schema); } validate(input) { return EditorStringOption.string(input, this.defaultValue); } }; EditorStringEnumOption = class extends SimpleEditorOption { constructor(id, name, defaultValue, allowedValues, schema = void 0) { if (typeof schema !== "undefined") { schema.type = "string"; schema.enum = allowedValues; schema.default = defaultValue; } super(id, name, defaultValue, schema); this._allowedValues = allowedValues; } validate(input) { return stringSet(input, this.defaultValue, this._allowedValues); } }; EditorEnumOption = class extends BaseEditorOption { constructor(id, name, defaultValue, defaultStringValue, allowedValues, convert, schema = void 0) { if (typeof schema !== "undefined") { schema.type = "string"; schema.enum = allowedValues; schema.default = defaultStringValue; } super(id, name, defaultValue, schema); this._allowedValues = allowedValues; this._convert = convert; } validate(input) { if (typeof input !== "string") { return this.defaultValue; } if (this._allowedValues.indexOf(input) === -1) { return this.defaultValue; } return this._convert(input); } }; EditorAccessibilitySupport = class extends BaseEditorOption { constructor() { super(2, "accessibilitySupport", 0, { type: "string", enum: ["auto", "on", "off"], enumDescriptions: [ localize("accessibilitySupport.auto", "The editor will use platform APIs to detect when a Screen Reader is attached."), localize("accessibilitySupport.on", "The editor will be permanently optimized for usage with a Screen Reader. Word wrapping will be disabled."), localize("accessibilitySupport.off", "The editor will never be optimized for usage with a Screen Reader.") ], default: "auto", description: localize("accessibilitySupport", "Controls whether the editor should run in a mode where it is optimized for screen readers. Setting to on will disable word wrapping.") }); } validate(input) { switch (input) { case "auto": return 0; case "off": return 1; case "on": return 2; } return this.defaultValue; } compute(env2, options, value) { if (value === 0) { return env2.accessibilitySupport; } return value; } }; EditorComments = class extends BaseEditorOption { constructor() { const defaults = { insertSpace: true, ignoreEmptyLines: true }; super(19, "comments", defaults, { "editor.comments.insertSpace": { type: "boolean", default: defaults.insertSpace, description: localize("comments.insertSpace", "Controls whether a space character is inserted when commenting.") }, "editor.comments.ignoreEmptyLines": { type: "boolean", default: defaults.ignoreEmptyLines, description: localize("comments.ignoreEmptyLines", "Controls if empty lines should be ignored with toggle, add or remove actions for line comments.") } }); } validate(_input) { if (!_input || typeof _input !== "object") { return this.defaultValue; } const input = _input; return { insertSpace: boolean(input.insertSpace, this.defaultValue.insertSpace), ignoreEmptyLines: boolean(input.ignoreEmptyLines, this.defaultValue.ignoreEmptyLines) }; } }; (function(TextEditorCursorStyle3) { TextEditorCursorStyle3[TextEditorCursorStyle3["Line"] = 1] = "Line"; TextEditorCursorStyle3[TextEditorCursorStyle3["Block"] = 2] = "Block"; TextEditorCursorStyle3[TextEditorCursorStyle3["Underline"] = 3] = "Underline"; TextEditorCursorStyle3[TextEditorCursorStyle3["LineThin"] = 4] = "LineThin"; TextEditorCursorStyle3[TextEditorCursorStyle3["BlockOutline"] = 5] = "BlockOutline"; TextEditorCursorStyle3[TextEditorCursorStyle3["UnderlineThin"] = 6] = "UnderlineThin"; })(TextEditorCursorStyle || (TextEditorCursorStyle = {})); EditorClassName = class extends ComputedEditorOption { constructor() { super( 130 /* EditorOption.editorClassName */ ); } compute(env2, options, _) { const classNames = ["monaco-editor"]; if (options.get( 35 /* EditorOption.extraEditorClassName */ )) { classNames.push(options.get( 35 /* EditorOption.extraEditorClassName */ )); } if (env2.extraEditorClassName) { classNames.push(env2.extraEditorClassName); } if (options.get( 68 /* EditorOption.mouseStyle */ ) === "default") { classNames.push("mouse-default"); } else if (options.get( 68 /* EditorOption.mouseStyle */ ) === "copy") { classNames.push("mouse-copy"); } if (op