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BH,OAAOG,gBAAgBD,KAAKF,QAG5B,SAAUlM,GACxB,IAAK,IAAI3B,EAAI,EAAGA,EAAI2B,EAAO3F,OAAQgE,IAC/B2B,EAAO3B,GAAK3B,KAAK4P,MAAsB,IAAhB5P,KAAK6P,UAEhC,OAAOvM,CACX,EAGJ,MAAMwM,EAAQ,IAAIlG,WAAW,IACvBmG,EAAO,GACb,IAAK,IAAIpO,EAAI,EAAGA,EAAI,IAAKA,IACrBoO,EAAK9Q,KAAK0C,EAAEoK,SAAS,IAAIiE,SAAS,EAAG,MAEzC,OAAO,WAEHL,EAAgBG,GAEhBA,EAAM,GAAiB,GAAXA,EAAM,GAAa,GAC/BA,EAAM,GAAiB,GAAXA,EAAM,GAAa,IAE/B,IAAInO,EAAI,EACJyB,EAAS,GAqBb,OApBAA,GAAU2M,EAAKD,EAAMnO,MACrByB,GAAU2M,EAAKD,EAAMnO,MACrByB,GAAU2M,EAAKD,EAAMnO,MACrByB,GAAU2M,EAAKD,EAAMnO,MACrByB,GAAU,IACVA,GAAU2M,EAAKD,EAAMnO,MACrByB,GAAU2M,EAAKD,EAAMnO,MACrByB,GAAU,IACVA,GAAU2M,EAAKD,EAAMnO,MACrByB,GAAU2M,EAAKD,EAAMnO,MACrByB,GAAU,IACVA,GAAU2M,EAAKD,EAAMnO,MACrByB,GAAU2M,EAAKD,EAAMnO,MACrByB,GAAU,IACVA,GAAU2M,EAAKD,EAAMnO,MACrByB,GAAU2M,EAAKD,EAAMnO,MACrByB,GAAU2M,EAAKD,EAAMnO,MACrByB,GAAU2M,EAAKD,EAAMnO,MACrByB,GAAU2M,EAAKD,EAAMnO,MACrByB,GAAU2M,EAAKD,EAAMnO,MACdyB,CACX,CACH,CAvD2B,E","sources":["file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/base/common/ternarySearchTree.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/base/common/tfIdf.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/base/common/themables.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/base/common/types.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/base/common/uint.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/base/common/uri.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/monaco-editor@0.50.0/node_modules/monaco-editor/esm/vs/base/common/uuid.js"],"sourcesContent":["import { compare, compareIgnoreCase, compareSubstring, compareSubstringIgnoreCase } from './strings.js';\nexport class StringIterator {\n constructor() {\n this._value = '';\n this._pos = 0;\n }\n reset(key) {\n this._value = key;\n this._pos = 0;\n return this;\n }\n next() {\n this._pos += 1;\n return this;\n }\n hasNext() {\n return this._pos < this._value.length - 1;\n }\n cmp(a) {\n const aCode = a.charCodeAt(0);\n const thisCode = this._value.charCodeAt(this._pos);\n return aCode - thisCode;\n }\n value() {\n return this._value[this._pos];\n }\n}\nexport class ConfigKeysIterator {\n constructor(_caseSensitive = true) {\n this._caseSensitive = _caseSensitive;\n }\n reset(key) {\n this._value = key;\n this._from = 0;\n this._to = 0;\n return this.next();\n }\n hasNext() {\n return this._to < this._value.length;\n }\n next() {\n // this._data = key.split(/[\\\\/]/).filter(s => !!s);\n this._from = this._to;\n let justSeps = true;\n for (; this._to < this._value.length; this._to++) {\n const ch = this._value.charCodeAt(this._to);\n if (ch === 46 /* CharCode.Period */) {\n if (justSeps) {\n this._from++;\n }\n else {\n break;\n }\n }\n else {\n justSeps = false;\n }\n }\n return this;\n }\n cmp(a) {\n return this._caseSensitive\n ? compareSubstring(a, this._value, 0, a.length, this._from, this._to)\n : compareSubstringIgnoreCase(a, this._value, 0, a.length, this._from, this._to);\n }\n value() {\n return this._value.substring(this._from, this._to);\n }\n}\nexport class PathIterator {\n constructor(_splitOnBackslash = true, _caseSensitive = true) {\n this._splitOnBackslash = _splitOnBackslash;\n this._caseSensitive = _caseSensitive;\n }\n reset(key) {\n this._from = 0;\n this._to = 0;\n this._value = key;\n this._valueLen = key.length;\n for (let pos = key.length - 1; pos >= 0; pos--, this._valueLen--) {\n const ch = this._value.charCodeAt(pos);\n if (!(ch === 47 /* CharCode.Slash */ || this._splitOnBackslash && ch === 92 /* CharCode.Backslash */)) {\n break;\n }\n }\n return this.next();\n }\n hasNext() {\n return this._to < this._valueLen;\n }\n next() {\n // this._data = key.split(/[\\\\/]/).filter(s => !!s);\n this._from = this._to;\n let justSeps = true;\n for (; this._to < this._valueLen; this._to++) {\n const ch = this._value.charCodeAt(this._to);\n if (ch === 47 /* CharCode.Slash */ || this._splitOnBackslash && ch === 92 /* CharCode.Backslash */) {\n if (justSeps) {\n this._from++;\n }\n else {\n break;\n }\n }\n else {\n justSeps = false;\n }\n }\n return this;\n }\n cmp(a) {\n return this._caseSensitive\n ? compareSubstring(a, this._value, 0, a.length, this._from, this._to)\n : compareSubstringIgnoreCase(a, this._value, 0, a.length, this._from, this._to);\n }\n value() {\n return this._value.substring(this._from, this._to);\n }\n}\nexport class UriIterator {\n constructor(_ignorePathCasing, _ignoreQueryAndFragment) {\n this._ignorePathCasing = _ignorePathCasing;\n this._ignoreQueryAndFragment = _ignoreQueryAndFragment;\n this._states = [];\n this._stateIdx = 0;\n }\n reset(key) {\n this._value = key;\n this._states = [];\n if (this._value.scheme) {\n this._states.push(1 /* UriIteratorState.Scheme */);\n }\n if (this._value.authority) {\n this._states.push(2 /* UriIteratorState.Authority */);\n }\n if (this._value.path) {\n this._pathIterator = new PathIterator(false, !this._ignorePathCasing(key));\n this._pathIterator.reset(key.path);\n if (this._pathIterator.value()) {\n this._states.push(3 /* UriIteratorState.Path */);\n }\n }\n if (!this._ignoreQueryAndFragment(key)) {\n if (this._value.query) {\n this._states.push(4 /* UriIteratorState.Query */);\n }\n if (this._value.fragment) {\n this._states.push(5 /* UriIteratorState.Fragment */);\n }\n }\n this._stateIdx = 0;\n return this;\n }\n next() {\n if (this._states[this._stateIdx] === 3 /* UriIteratorState.Path */ && this._pathIterator.hasNext()) {\n this._pathIterator.next();\n }\n else {\n this._stateIdx += 1;\n }\n return this;\n }\n hasNext() {\n return (this._states[this._stateIdx] === 3 /* UriIteratorState.Path */ && this._pathIterator.hasNext())\n || this._stateIdx < this._states.length - 1;\n }\n cmp(a) {\n if (this._states[this._stateIdx] === 1 /* UriIteratorState.Scheme */) {\n return compareIgnoreCase(a, this._value.scheme);\n }\n else if (this._states[this._stateIdx] === 2 /* UriIteratorState.Authority */) {\n return compareIgnoreCase(a, this._value.authority);\n }\n else if (this._states[this._stateIdx] === 3 /* UriIteratorState.Path */) {\n return this._pathIterator.cmp(a);\n }\n else if (this._states[this._stateIdx] === 4 /* UriIteratorState.Query */) {\n return compare(a, this._value.query);\n }\n else if (this._states[this._stateIdx] === 5 /* UriIteratorState.Fragment */) {\n return compare(a, this._value.fragment);\n }\n throw new Error();\n }\n value() {\n if (this._states[this._stateIdx] === 1 /* UriIteratorState.Scheme */) {\n return this._value.scheme;\n }\n else if (this._states[this._stateIdx] === 2 /* UriIteratorState.Authority */) {\n return this._value.authority;\n }\n else if (this._states[this._stateIdx] === 3 /* UriIteratorState.Path */) {\n return this._pathIterator.value();\n }\n else if (this._states[this._stateIdx] === 4 /* UriIteratorState.Query */) {\n return this._value.query;\n }\n else if (this._states[this._stateIdx] === 5 /* UriIteratorState.Fragment */) {\n return this._value.fragment;\n }\n throw new Error();\n }\n}\nclass TernarySearchTreeNode {\n constructor() {\n this.height = 1;\n }\n rotateLeft() {\n const tmp = this.right;\n this.right = tmp.left;\n tmp.left = this;\n this.updateHeight();\n tmp.updateHeight();\n return tmp;\n }\n rotateRight() {\n const tmp = this.left;\n this.left = tmp.right;\n tmp.right = this;\n this.updateHeight();\n tmp.updateHeight();\n return tmp;\n }\n updateHeight() {\n this.height = 1 + Math.max(this.heightLeft, this.heightRight);\n }\n balanceFactor() {\n return this.heightRight - this.heightLeft;\n }\n get heightLeft() {\n var _a, _b;\n return (_b = (_a = this.left) === null || _a === void 0 ? void 0 : _a.height) !== null && _b !== void 0 ? _b : 0;\n }\n get heightRight() {\n var _a, _b;\n return (_b = (_a = this.right) === null || _a === void 0 ? void 0 : _a.height) !== null && _b !== void 0 ? _b : 0;\n }\n}\nexport class TernarySearchTree {\n static forUris(ignorePathCasing = () => false, ignoreQueryAndFragment = () => false) {\n return new TernarySearchTree(new UriIterator(ignorePathCasing, ignoreQueryAndFragment));\n }\n static forStrings() {\n return new TernarySearchTree(new StringIterator());\n }\n static forConfigKeys() {\n return new TernarySearchTree(new ConfigKeysIterator());\n }\n constructor(segments) {\n this._iter = segments;\n }\n clear() {\n this._root = undefined;\n }\n set(key, element) {\n const iter = this._iter.reset(key);\n let node;\n if (!this._root) {\n this._root = new TernarySearchTreeNode();\n this._root.segment = iter.value();\n }\n const stack = [];\n // find insert_node\n node = this._root;\n while (true) {\n const val = iter.cmp(node.segment);\n if (val > 0) {\n // left\n if (!node.left) {\n node.left = new TernarySearchTreeNode();\n node.left.segment = iter.value();\n }\n stack.push([-1 /* Dir.Left */, node]);\n node = node.left;\n }\n else if (val < 0) {\n // right\n if (!node.right) {\n node.right = new TernarySearchTreeNode();\n node.right.segment = iter.value();\n }\n stack.push([1 /* Dir.Right */, node]);\n node = node.right;\n }\n else if (iter.hasNext()) {\n // mid\n iter.next();\n if (!node.mid) {\n node.mid = new TernarySearchTreeNode();\n node.mid.segment = iter.value();\n }\n stack.push([0 /* Dir.Mid */, node]);\n node = node.mid;\n }\n else {\n break;\n }\n }\n // set value\n const oldElement = node.value;\n node.value = element;\n node.key = key;\n // balance\n for (let i = stack.length - 1; i >= 0; i--) {\n const node = stack[i][1];\n node.updateHeight();\n const bf = node.balanceFactor();\n if (bf < -1 || bf > 1) {\n // needs rotate\n const d1 = stack[i][0];\n const d2 = stack[i + 1][0];\n if (d1 === 1 /* Dir.Right */ && d2 === 1 /* Dir.Right */) {\n //right, right -> rotate left\n stack[i][1] = node.rotateLeft();\n }\n else if (d1 === -1 /* Dir.Left */ && d2 === -1 /* Dir.Left */) {\n // left, left -> rotate right\n stack[i][1] = node.rotateRight();\n }\n else if (d1 === 1 /* Dir.Right */ && d2 === -1 /* Dir.Left */) {\n // right, left -> double rotate right, left\n node.right = stack[i + 1][1] = stack[i + 1][1].rotateRight();\n stack[i][1] = node.rotateLeft();\n }\n else if (d1 === -1 /* Dir.Left */ && d2 === 1 /* Dir.Right */) {\n // left, right -> double rotate left, right\n node.left = stack[i + 1][1] = stack[i + 1][1].rotateLeft();\n stack[i][1] = node.rotateRight();\n }\n else {\n throw new Error();\n }\n // patch path to parent\n if (i > 0) {\n switch (stack[i - 1][0]) {\n case -1 /* Dir.Left */:\n stack[i - 1][1].left = stack[i][1];\n break;\n case 1 /* Dir.Right */:\n stack[i - 1][1].right = stack[i][1];\n break;\n case 0 /* Dir.Mid */:\n stack[i - 1][1].mid = stack[i][1];\n break;\n }\n }\n else {\n this._root = stack[0][1];\n }\n }\n }\n return oldElement;\n }\n get(key) {\n var _a;\n return (_a = this._getNode(key)) === null || _a === void 0 ? void 0 : _a.value;\n }\n _getNode(key) {\n const iter = this._iter.reset(key);\n let node = this._root;\n while (node) {\n const val = iter.cmp(node.segment);\n if (val > 0) {\n // left\n node = node.left;\n }\n else if (val < 0) {\n // right\n node = node.right;\n }\n else if (iter.hasNext()) {\n // mid\n iter.next();\n node = node.mid;\n }\n else {\n break;\n }\n }\n return node;\n }\n has(key) {\n const node = this._getNode(key);\n return !((node === null || node === void 0 ? void 0 : node.value) === undefined && (node === null || node === void 0 ? void 0 : node.mid) === undefined);\n }\n delete(key) {\n return this._delete(key, false);\n }\n deleteSuperstr(key) {\n return this._delete(key, true);\n }\n _delete(key, superStr) {\n var _a;\n const iter = this._iter.reset(key);\n const stack = [];\n let node = this._root;\n // find node\n while (node) {\n const val = iter.cmp(node.segment);\n if (val > 0) {\n // left\n stack.push([-1 /* Dir.Left */, node]);\n node = node.left;\n }\n else if (val < 0) {\n // right\n stack.push([1 /* Dir.Right */, node]);\n node = node.right;\n }\n else if (iter.hasNext()) {\n // mid\n iter.next();\n stack.push([0 /* Dir.Mid */, node]);\n node = node.mid;\n }\n else {\n break;\n }\n }\n if (!node) {\n // node not found\n return;\n }\n if (superStr) {\n // removing children, reset height\n node.left = undefined;\n node.mid = undefined;\n node.right = undefined;\n node.height = 1;\n }\n else {\n // removing element\n node.key = undefined;\n node.value = undefined;\n }\n // BST node removal\n if (!node.mid && !node.value) {\n if (node.left && node.right) {\n // full node\n // replace deleted-node with the min-node of the right branch.\n // If there is no true min-node leave things as they are\n const min = this._min(node.right);\n if (min.key) {\n const { key, value, segment } = min;\n this._delete(min.key, false);\n node.key = key;\n node.value = value;\n node.segment = segment;\n }\n }\n else {\n // empty or half empty\n const newChild = (_a = node.left) !== null && _a !== void 0 ? _a : node.right;\n if (stack.length > 0) {\n const [dir, parent] = stack[stack.length - 1];\n switch (dir) {\n case -1 /* Dir.Left */:\n parent.left = newChild;\n break;\n case 0 /* Dir.Mid */:\n parent.mid = newChild;\n break;\n case 1 /* Dir.Right */:\n parent.right = newChild;\n break;\n }\n }\n else {\n this._root = newChild;\n }\n }\n }\n // AVL balance\n for (let i = stack.length - 1; i >= 0; i--) {\n const node = stack[i][1];\n node.updateHeight();\n const bf = node.balanceFactor();\n if (bf > 1) {\n // right heavy\n if (node.right.balanceFactor() >= 0) {\n // right, right -> rotate left\n stack[i][1] = node.rotateLeft();\n }\n else {\n // right, left -> double rotate\n node.right = node.right.rotateRight();\n stack[i][1] = node.rotateLeft();\n }\n }\n else if (bf < -1) {\n // left heavy\n if (node.left.balanceFactor() <= 0) {\n // left, left -> rotate right\n stack[i][1] = node.rotateRight();\n }\n else {\n // left, right -> double rotate\n node.left = node.left.rotateLeft();\n stack[i][1] = node.rotateRight();\n }\n }\n // patch path to parent\n if (i > 0) {\n switch (stack[i - 1][0]) {\n case -1 /* Dir.Left */:\n stack[i - 1][1].left = stack[i][1];\n break;\n case 1 /* Dir.Right */:\n stack[i - 1][1].right = stack[i][1];\n break;\n case 0 /* Dir.Mid */:\n stack[i - 1][1].mid = stack[i][1];\n break;\n }\n }\n else {\n this._root = stack[0][1];\n }\n }\n }\n _min(node) {\n while (node.left) {\n node = node.left;\n }\n return node;\n }\n findSubstr(key) {\n const iter = this._iter.reset(key);\n let node = this._root;\n let candidate = undefined;\n while (node) {\n const val = iter.cmp(node.segment);\n if (val > 0) {\n // left\n node = node.left;\n }\n else if (val < 0) {\n // right\n node = node.right;\n }\n else if (iter.hasNext()) {\n // mid\n iter.next();\n candidate = node.value || candidate;\n node = node.mid;\n }\n else {\n break;\n }\n }\n return node && node.value || candidate;\n }\n findSuperstr(key) {\n return this._findSuperstrOrElement(key, false);\n }\n _findSuperstrOrElement(key, allowValue) {\n const iter = this._iter.reset(key);\n let node = this._root;\n while (node) {\n const val = iter.cmp(node.segment);\n if (val > 0) {\n // left\n node = node.left;\n }\n else if (val < 0) {\n // right\n node = node.right;\n }\n else if (iter.hasNext()) {\n // mid\n iter.next();\n node = node.mid;\n }\n else {\n // collect\n if (!node.mid) {\n if (allowValue) {\n return node.value;\n }\n else {\n return undefined;\n }\n }\n else {\n return this._entries(node.mid);\n }\n }\n }\n return undefined;\n }\n forEach(callback) {\n for (const [key, value] of this) {\n callback(value, key);\n }\n }\n *[Symbol.iterator]() {\n yield* this._entries(this._root);\n }\n _entries(node) {\n const result = [];\n this._dfsEntries(node, result);\n return result[Symbol.iterator]();\n }\n _dfsEntries(node, bucket) {\n // DFS\n if (!node) {\n return;\n }\n if (node.left) {\n this._dfsEntries(node.left, bucket);\n }\n if (node.value) {\n bucket.push([node.key, node.value]);\n }\n if (node.mid) {\n this._dfsEntries(node.mid, bucket);\n }\n if (node.right) {\n this._dfsEntries(node.right, bucket);\n }\n }\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nfunction countMapFrom(values) {\n var _a;\n const map = new Map();\n for (const value of values) {\n map.set(value, ((_a = map.get(value)) !== null && _a !== void 0 ? _a : 0) + 1);\n }\n return map;\n}\n/**\n * Implementation of tf-idf (term frequency-inverse document frequency) for a set of\n * documents where each document contains one or more chunks of text.\n * Each document is identified by a key, and the score for each document is computed\n * by taking the max score over all the chunks in the document.\n */\nexport class TfIdfCalculator {\n constructor() {\n /**\n * Total number of chunks\n */\n this.chunkCount = 0;\n this.chunkOccurrences = new Map();\n this.documents = new Map();\n }\n calculateScores(query, token) {\n const embedding = this.computeEmbedding(query);\n const idfCache = new Map();\n const scores = [];\n // For each document, generate one score\n for (const [key, doc] of this.documents) {\n if (token.isCancellationRequested) {\n return [];\n }\n for (const chunk of doc.chunks) {\n const score = this.computeSimilarityScore(chunk, embedding, idfCache);\n if (score > 0) {\n scores.push({ key, score });\n }\n }\n }\n return scores;\n }\n /**\n * Count how many times each term (word) appears in a string.\n */\n static termFrequencies(input) {\n return countMapFrom(TfIdfCalculator.splitTerms(input));\n }\n /**\n * Break a string into terms (words).\n */\n static *splitTerms(input) {\n const normalize = (word) => word.toLowerCase();\n // Only match on words that are at least 3 characters long and start with a letter\n for (const [word] of input.matchAll(/\\b\\p{Letter}[\\p{Letter}\\d]{2,}\\b/gu)) {\n yield normalize(word);\n const camelParts = word.replace(/([a-z])([A-Z])/g, '$1 $2').split(/\\s+/g);\n if (camelParts.length > 1) {\n for (const part of camelParts) {\n // Require at least 3 letters in the parts of a camel case word\n if (part.length > 2 && /\\p{Letter}{3,}/gu.test(part)) {\n yield normalize(part);\n }\n }\n }\n }\n }\n updateDocuments(documents) {\n var _a;\n for (const { key } of documents) {\n this.deleteDocument(key);\n }\n for (const doc of documents) {\n const chunks = [];\n for (const text of doc.textChunks) {\n // TODO: See if we can compute the tf lazily\n // The challenge is that we need to also update the `chunkOccurrences`\n // and all of those updates need to get flushed before the real TF-IDF of\n // anything is computed.\n const tf = TfIdfCalculator.termFrequencies(text);\n // Update occurrences list\n for (const term of tf.keys()) {\n this.chunkOccurrences.set(term, ((_a = this.chunkOccurrences.get(term)) !== null && _a !== void 0 ? _a : 0) + 1);\n }\n chunks.push({ text, tf });\n }\n this.chunkCount += chunks.length;\n this.documents.set(doc.key, { chunks });\n }\n return this;\n }\n deleteDocument(key) {\n const doc = this.documents.get(key);\n if (!doc) {\n return;\n }\n this.documents.delete(key);\n this.chunkCount -= doc.chunks.length;\n // Update term occurrences for the document\n for (const chunk of doc.chunks) {\n for (const term of chunk.tf.keys()) {\n const currentOccurrences = this.chunkOccurrences.get(term);\n if (typeof currentOccurrences === 'number') {\n const newOccurrences = currentOccurrences - 1;\n if (newOccurrences <= 0) {\n this.chunkOccurrences.delete(term);\n }\n else {\n this.chunkOccurrences.set(term, newOccurrences);\n }\n }\n }\n }\n }\n computeSimilarityScore(chunk, queryEmbedding, idfCache) {\n // Compute the dot product between the chunk's embedding and the query embedding\n // Note that the chunk embedding is computed lazily on a per-term basis.\n // This lets us skip a large number of calculations because the majority\n // of chunks do not share any terms with the query.\n let sum = 0;\n for (const [term, termTfidf] of Object.entries(queryEmbedding)) {\n const chunkTf = chunk.tf.get(term);\n if (!chunkTf) {\n // Term does not appear in chunk so it has no contribution\n continue;\n }\n let chunkIdf = idfCache.get(term);\n if (typeof chunkIdf !== 'number') {\n chunkIdf = this.computeIdf(term);\n idfCache.set(term, chunkIdf);\n }\n const chunkTfidf = chunkTf * chunkIdf;\n sum += chunkTfidf * termTfidf;\n }\n return sum;\n }\n computeEmbedding(input) {\n const tf = TfIdfCalculator.termFrequencies(input);\n return this.computeTfidf(tf);\n }\n computeIdf(term) {\n var _a;\n const chunkOccurrences = (_a = this.chunkOccurrences.get(term)) !== null && _a !== void 0 ? _a : 0;\n return chunkOccurrences > 0\n ? Math.log((this.chunkCount + 1) / chunkOccurrences)\n : 0;\n }\n computeTfidf(termFrequencies) {\n const embedding = Object.create(null);\n for (const [word, occurrences] of termFrequencies) {\n const idf = this.computeIdf(word);\n if (idf > 0) {\n embedding[word] = occurrences * idf;\n }\n }\n return embedding;\n }\n}\n/**\n * Normalize the scores to be between 0 and 1 and sort them decending.\n * @param scores array of scores from {@link TfIdfCalculator.calculateScores}\n * @returns normalized scores\n */\nexport function normalizeTfIdfScores(scores) {\n var _a, _b;\n // copy of scores\n const result = scores.slice(0);\n // sort descending\n result.sort((a, b) => b.score - a.score);\n // normalize\n const max = (_b = (_a = result[0]) === null || _a === void 0 ? void 0 : _a.score) !== null && _b !== void 0 ? _b : 0;\n if (max > 0) {\n for (const score of result) {\n score.score /= max;\n }\n }\n return result;\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport { Codicon } from './codicons.js';\nexport var ThemeColor;\n(function (ThemeColor) {\n function isThemeColor(obj) {\n return obj && typeof obj === 'object' && typeof obj.id === 'string';\n }\n ThemeColor.isThemeColor = isThemeColor;\n})(ThemeColor || (ThemeColor = {}));\nexport var ThemeIcon;\n(function (ThemeIcon) {\n ThemeIcon.iconNameSegment = '[A-Za-z0-9]+';\n ThemeIcon.iconNameExpression = '[A-Za-z0-9-]+';\n ThemeIcon.iconModifierExpression = '~[A-Za-z]+';\n ThemeIcon.iconNameCharacter = '[A-Za-z0-9~-]';\n const ThemeIconIdRegex = new RegExp(`^(${ThemeIcon.iconNameExpression})(${ThemeIcon.iconModifierExpression})?$`);\n function asClassNameArray(icon) {\n const match = ThemeIconIdRegex.exec(icon.id);\n if (!match) {\n return asClassNameArray(Codicon.error);\n }\n const [, id, modifier] = match;\n const classNames = ['codicon', 'codicon-' + id];\n if (modifier) {\n classNames.push('codicon-modifier-' + modifier.substring(1));\n }\n return classNames;\n }\n ThemeIcon.asClassNameArray = asClassNameArray;\n function asClassName(icon) {\n return asClassNameArray(icon).join(' ');\n }\n ThemeIcon.asClassName = asClassName;\n function asCSSSelector(icon) {\n return '.' + asClassNameArray(icon).join('.');\n }\n ThemeIcon.asCSSSelector = asCSSSelector;\n function isThemeIcon(obj) {\n return obj && typeof obj === 'object' && typeof obj.id === 'string' && (typeof obj.color === 'undefined' || ThemeColor.isThemeColor(obj.color));\n }\n ThemeIcon.isThemeIcon = isThemeIcon;\n const _regexFromString = new RegExp(`^\\\\$\\\\((${ThemeIcon.iconNameExpression}(?:${ThemeIcon.iconModifierExpression})?)\\\\)$`);\n function fromString(str) {\n const match = _regexFromString.exec(str);\n if (!match) {\n return undefined;\n }\n const [, name] = match;\n return { id: name };\n }\n ThemeIcon.fromString = fromString;\n function fromId(id) {\n return { id };\n }\n ThemeIcon.fromId = fromId;\n function modify(icon, modifier) {\n let id = icon.id;\n const tildeIndex = id.lastIndexOf('~');\n if (tildeIndex !== -1) {\n id = id.substring(0, tildeIndex);\n }\n if (modifier) {\n id = `${id}~${modifier}`;\n }\n return { id };\n }\n ThemeIcon.modify = modify;\n function getModifier(icon) {\n const tildeIndex = icon.id.lastIndexOf('~');\n if (tildeIndex !== -1) {\n return icon.id.substring(tildeIndex + 1);\n }\n return undefined;\n }\n ThemeIcon.getModifier = getModifier;\n function isEqual(ti1, ti2) {\n var _a, _b;\n return ti1.id === ti2.id && ((_a = ti1.color) === null || _a === void 0 ? void 0 : _a.id) === ((_b = ti2.color) === null || _b === void 0 ? void 0 : _b.id);\n }\n ThemeIcon.isEqual = isEqual;\n})(ThemeIcon || (ThemeIcon = {}));\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\n/**\n * @returns whether the provided parameter is a JavaScript String or not.\n */\nexport function isString(str) {\n return (typeof str === 'string');\n}\n/**\n * @returns whether the provided parameter is of type `object` but **not**\n *\t`null`, an `array`, a `regexp`, nor a `date`.\n */\nexport function isObject(obj) {\n // The method can't do a type cast since there are type (like strings) which\n // are subclasses of any put not positvely matched by the function. Hence type\n // narrowing results in wrong results.\n return typeof obj === 'object'\n && obj !== null\n && !Array.isArray(obj)\n && !(obj instanceof RegExp)\n && !(obj instanceof Date);\n}\n/**\n * @returns whether the provided parameter is of type `Buffer` or Uint8Array dervived type\n */\nexport function isTypedArray(obj) {\n const TypedArray = Object.getPrototypeOf(Uint8Array);\n return typeof obj === 'object'\n && obj instanceof TypedArray;\n}\n/**\n * In **contrast** to just checking `typeof` this will return `false` for `NaN`.\n * @returns whether the provided parameter is a JavaScript Number or not.\n */\nexport function isNumber(obj) {\n return (typeof obj === 'number' && !isNaN(obj));\n}\n/**\n * @returns whether the provided parameter is an Iterable, casting to the given generic\n */\nexport function isIterable(obj) {\n return !!obj && typeof obj[Symbol.iterator] === 'function';\n}\n/**\n * @returns whether the provided parameter is a JavaScript Boolean or not.\n */\nexport function isBoolean(obj) {\n return (obj === true || obj === false);\n}\n/**\n * @returns whether the provided parameter is undefined.\n */\nexport function isUndefined(obj) {\n return (typeof obj === 'undefined');\n}\n/**\n * @returns whether the provided parameter is defined.\n */\nexport function isDefined(arg) {\n return !isUndefinedOrNull(arg);\n}\n/**\n * @returns whether the provided parameter is undefined or null.\n */\nexport function isUndefinedOrNull(obj) {\n return (isUndefined(obj) || obj === null);\n}\nexport function assertType(condition, type) {\n if (!condition) {\n throw new Error(type ? `Unexpected type, expected '${type}'` : 'Unexpected type');\n }\n}\n/**\n * Asserts that the argument passed in is neither undefined nor null.\n */\nexport function assertIsDefined(arg) {\n if (isUndefinedOrNull(arg)) {\n throw new Error('Assertion Failed: argument is undefined or null');\n }\n return arg;\n}\n/**\n * @returns whether the provided parameter is a JavaScript Function or not.\n */\nexport function isFunction(obj) {\n return (typeof obj === 'function');\n}\nexport function validateConstraints(args, constraints) {\n const len = Math.min(args.length, constraints.length);\n for (let i = 0; i < len; i++) {\n validateConstraint(args[i], constraints[i]);\n }\n}\nexport function validateConstraint(arg, constraint) {\n if (isString(constraint)) {\n if (typeof arg !== constraint) {\n throw new Error(`argument does not match constraint: typeof ${constraint}`);\n }\n }\n else if (isFunction(constraint)) {\n try {\n if (arg instanceof constraint) {\n return;\n }\n }\n catch (_a) {\n // ignore\n }\n if (!isUndefinedOrNull(arg) && arg.constructor === constraint) {\n return;\n }\n if (constraint.length === 1 && constraint.call(undefined, arg) === true) {\n return;\n }\n throw new Error(`argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true`);\n }\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nexport function toUint8(v) {\n if (v < 0) {\n return 0;\n }\n if (v > 255 /* Constants.MAX_UINT_8 */) {\n return 255 /* Constants.MAX_UINT_8 */;\n }\n return v | 0;\n}\nexport function toUint32(v) {\n if (v < 0) {\n return 0;\n }\n if (v > 4294967295 /* Constants.MAX_UINT_32 */) {\n return 4294967295 /* Constants.MAX_UINT_32 */;\n }\n return v | 0;\n}\n","/*---------------------------------------------------------------------------------------------\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for license information.\n *--------------------------------------------------------------------------------------------*/\nimport * as paths from './path.js';\nimport { isWindows } from './platform.js';\nconst _schemePattern = /^\\w[\\w\\d+.-]*$/;\nconst _singleSlashStart = /^\\//;\nconst _doubleSlashStart = /^\\/\\//;\nfunction _validateUri(ret, _strict) {\n // scheme, must be set\n if (!ret.scheme && _strict) {\n throw new Error(`[UriError]: Scheme is missing: {scheme: \"\", authority: \"${ret.authority}\", path: \"${ret.path}\", query: \"${ret.query}\", fragment: \"${ret.fragment}\"}`);\n }\n // scheme, https://tools.ietf.org/html/rfc3986#section-3.1\n // ALPHA *( ALPHA / DIGIT / \"+\" / \"-\" / \".\" )\n if (ret.scheme && !_schemePattern.test(ret.scheme)) {\n throw new Error('[UriError]: Scheme contains illegal characters.');\n }\n // path, http://tools.ietf.org/html/rfc3986#section-3.3\n // If a URI contains an authority component, then the path component\n // must either be empty or begin with a slash (\"/\") character. If a URI\n // does not contain an authority component, then the path cannot begin\n // with two slash characters (\"//\").\n if (ret.path) {\n if (ret.authority) {\n if (!_singleSlashStart.test(ret.path)) {\n throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash (\"/\") character');\n }\n }\n else {\n if (_doubleSlashStart.test(ret.path)) {\n throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters (\"//\")');\n }\n }\n }\n}\n// for a while we allowed uris *without* schemes and this is the migration\n// for them, e.g. an uri without scheme and without strict-mode warns and falls\n// back to the file-scheme. that should cause the least carnage and still be a\n// clear warning\nfunction _schemeFix(scheme, _strict) {\n if (!scheme && !_strict) {\n return 'file';\n }\n return scheme;\n}\n// implements a bit of https://tools.ietf.org/html/rfc3986#section-5\nfunction _referenceResolution(scheme, path) {\n // the slash-character is our 'default base' as we don't\n // support constructing URIs relative to other URIs. This\n // also means that we alter and potentially break paths.\n // see https://tools.ietf.org/html/rfc3986#section-5.1.4\n switch (scheme) {\n case 'https':\n case 'http':\n case 'file':\n if (!path) {\n path = _slash;\n }\n else if (path[0] !== _slash) {\n path = _slash + path;\n }\n break;\n }\n return path;\n}\nconst _empty = '';\nconst _slash = '/';\nconst _regexp = /^(([^:/?#]+?):)?(\\/\\/([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?/;\n/**\n * Uniform Resource Identifier (URI) http://tools.ietf.org/html/rfc3986.\n * This class is a simple parser which creates the basic component parts\n * (http://tools.ietf.org/html/rfc3986#section-3) with minimal validation\n * and encoding.\n *\n * ```txt\n * foo://example.com:8042/over/there?name=ferret#nose\n * \\_/ \\______________/\\_________/ \\_________/ \\__/\n * | | | | |\n * scheme authority path query fragment\n * | _____________________|__\n * / \\ / \\\n * urn:example:animal:ferret:nose\n * ```\n */\nexport class URI {\n static isUri(thing) {\n if (thing instanceof URI) {\n return true;\n }\n if (!thing) {\n return false;\n }\n return typeof thing.authority === 'string'\n && typeof thing.fragment === 'string'\n && typeof thing.path === 'string'\n && typeof thing.query === 'string'\n && typeof thing.scheme === 'string'\n && typeof thing.fsPath === 'string'\n && typeof thing.with === 'function'\n && typeof thing.toString === 'function';\n }\n /**\n * @internal\n */\n constructor(schemeOrData, authority, path, query, fragment, _strict = false) {\n if (typeof schemeOrData === 'object') {\n this.scheme = schemeOrData.scheme || _empty;\n this.authority = schemeOrData.authority || _empty;\n this.path = schemeOrData.path || _empty;\n this.query = schemeOrData.query || _empty;\n this.fragment = schemeOrData.fragment || _empty;\n // no validation because it's this URI\n // that creates uri components.\n // _validateUri(this);\n }\n else {\n this.scheme = _schemeFix(schemeOrData, _strict);\n this.authority = authority || _empty;\n this.path = _referenceResolution(this.scheme, path || _empty);\n this.query = query || _empty;\n this.fragment = fragment || _empty;\n _validateUri(this, _strict);\n }\n }\n // ---- filesystem path -----------------------\n /**\n * Returns a string representing the corresponding file system path of this URI.\n * Will handle UNC paths, normalizes windows drive letters to lower-case, and uses the\n * platform specific path separator.\n *\n * * Will *not* validate the path for invalid characters and semantics.\n * * Will *not* look at the scheme of this URI.\n * * The result shall *not* be used for display purposes but for accessing a file on disk.\n *\n *\n * The *difference* to `URI#path` is the use of the platform specific separator and the handling\n * of UNC paths. See the below sample of a file-uri with an authority (UNC path).\n *\n * ```ts\n const u = URI.parse('file://server/c$/folder/file.txt')\n u.authority === 'server'\n u.path === '/shares/c$/file.txt'\n u.fsPath === '\\\\server\\c$\\folder\\file.txt'\n ```\n *\n * Using `URI#path` to read a file (using fs-apis) would not be enough because parts of the path,\n * namely the server name, would be missing. Therefore `URI#fsPath` exists - it's sugar to ease working\n * with URIs that represent files on disk (`file` scheme).\n */\n get fsPath() {\n // if (this.scheme !== 'file') {\n // \tconsole.warn(`[UriError] calling fsPath with scheme ${this.scheme}`);\n // }\n return uriToFsPath(this, false);\n }\n // ---- modify to new -------------------------\n with(change) {\n if (!change) {\n return this;\n }\n let { scheme, authority, path, query, fragment } = change;\n if (scheme === undefined) {\n scheme = this.scheme;\n }\n else if (scheme === null) {\n scheme = _empty;\n }\n if (authority === undefined) {\n authority = this.authority;\n }\n else if (authority === null) {\n authority = _empty;\n }\n if (path === undefined) {\n path = this.path;\n }\n else if (path === null) {\n path = _empty;\n }\n if (query === undefined) {\n query = this.query;\n }\n else if (query === null) {\n query = _empty;\n }\n if (fragment === undefined) {\n fragment = this.fragment;\n }\n else if (fragment === null) {\n fragment = _empty;\n }\n if (scheme === this.scheme\n && authority === this.authority\n && path === this.path\n && query === this.query\n && fragment === this.fragment) {\n return this;\n }\n return new Uri(scheme, authority, path, query, fragment);\n }\n // ---- parse & validate ------------------------\n /**\n * Creates a new URI from a string, e.g. `http://www.example.com/some/path`,\n * `file:///usr/home`, or `scheme:with/path`.\n *\n * @param value A string which represents an URI (see `URI#toString`).\n */\n static parse(value, _strict = false) {\n const match = _regexp.exec(value);\n if (!match) {\n return new Uri(_empty, _empty, _empty, _empty, _empty);\n }\n return new Uri(match[2] || _empty, percentDecode(match[4] || _empty), percentDecode(match[5] || _empty), percentDecode(match[7] || _empty), percentDecode(match[9] || _empty), _strict);\n }\n /**\n * Creates a new URI from a file system path, e.g. `c:\\my\\files`,\n * `/usr/home`, or `\\\\server\\share\\some\\path`.\n *\n * The *difference* between `URI#parse` and `URI#file` is that the latter treats the argument\n * as path, not as stringified-uri. E.g. `URI.file(path)` is **not the same as**\n * `URI.parse('file://' + path)` because the path might contain characters that are\n * interpreted (# and ?). See the following sample:\n * ```ts\n const good = URI.file('/coding/c#/project1');\n good.scheme === 'file';\n good.path === '/coding/c#/project1';\n good.fragment === '';\n const bad = URI.parse('file://' + '/coding/c#/project1');\n bad.scheme === 'file';\n bad.path === '/coding/c'; // path is now broken\n bad.fragment === '/project1';\n ```\n *\n * @param path A file system path (see `URI#fsPath`)\n */\n static file(path) {\n let authority = _empty;\n // normalize to fwd-slashes on windows,\n // on other systems bwd-slashes are valid\n // filename character, eg /f\\oo/ba\\r.txt\n if (isWindows) {\n path = path.replace(/\\\\/g, _slash);\n }\n // check for authority as used in UNC shares\n // or use the path as given\n if (path[0] === _slash && path[1] === _slash) {\n const idx = path.indexOf(_slash, 2);\n if (idx === -1) {\n authority = path.substring(2);\n path = _slash;\n }\n else {\n authority = path.substring(2, idx);\n path = path.substring(idx) || _slash;\n }\n }\n return new Uri('file', authority, path, _empty, _empty);\n }\n /**\n * Creates new URI from uri components.\n *\n * Unless `strict` is `true` the scheme is defaults to be `file`. This function performs\n * validation and should be used for untrusted uri components retrieved from storage,\n * user input, command arguments etc\n */\n static from(components, strict) {\n const result = new Uri(components.scheme, components.authority, components.path, components.query, components.fragment, strict);\n return result;\n }\n /**\n * Join a URI path with path fragments and normalizes the resulting path.\n *\n * @param uri The input URI.\n * @param pathFragment The path fragment to add to the URI path.\n * @returns The resulting URI.\n */\n static joinPath(uri, ...pathFragment) {\n if (!uri.path) {\n throw new Error(`[UriError]: cannot call joinPath on URI without path`);\n }\n let newPath;\n if (isWindows && uri.scheme === 'file') {\n newPath = URI.file(paths.win32.join(uriToFsPath(uri, true), ...pathFragment)).path;\n }\n else {\n newPath = paths.posix.join(uri.path, ...pathFragment);\n }\n return uri.with({ path: newPath });\n }\n // ---- printing/externalize ---------------------------\n /**\n * Creates a string representation for this URI. It's guaranteed that calling\n * `URI.parse` with the result of this function creates an URI which is equal\n * to this URI.\n *\n * * The result shall *not* be used for display purposes but for externalization or transport.\n * * The result will be encoded using the percentage encoding and encoding happens mostly\n * ignore the scheme-specific encoding rules.\n *\n * @param skipEncoding Do not encode the result, default is `false`\n */\n toString(skipEncoding = false) {\n return _asFormatted(this, skipEncoding);\n }\n toJSON() {\n return this;\n }\n static revive(data) {\n var _a, _b;\n if (!data) {\n return data;\n }\n else if (data instanceof URI) {\n return data;\n }\n else {\n const result = new Uri(data);\n result._formatted = (_a = data.external) !== null && _a !== void 0 ? _a : null;\n result._fsPath = data._sep === _pathSepMarker ? (_b = data.fsPath) !== null && _b !== void 0 ? _b : null : null;\n return result;\n }\n }\n}\nconst _pathSepMarker = isWindows ? 1 : undefined;\n// This class exists so that URI is compatible with vscode.Uri (API).\nclass Uri extends URI {\n constructor() {\n super(...arguments);\n this._formatted = null;\n this._fsPath = null;\n }\n get fsPath() {\n if (!this._fsPath) {\n this._fsPath = uriToFsPath(this, false);\n }\n return this._fsPath;\n }\n toString(skipEncoding = false) {\n if (!skipEncoding) {\n if (!this._formatted) {\n this._formatted = _asFormatted(this, false);\n }\n return this._formatted;\n }\n else {\n // we don't cache that\n return _asFormatted(this, true);\n }\n }\n toJSON() {\n const res = {\n $mid: 1 /* MarshalledId.Uri */\n };\n // cached state\n if (this._fsPath) {\n res.fsPath = this._fsPath;\n res._sep = _pathSepMarker;\n }\n if (this._formatted) {\n res.external = this._formatted;\n }\n //--- uri components\n if (this.path) {\n res.path = this.path;\n }\n // TODO\n // this isn't correct and can violate the UriComponents contract but\n // this is part of the vscode.Uri API and we shouldn't change how that\n // works anymore\n if (this.scheme) {\n res.scheme = this.scheme;\n }\n if (this.authority) {\n res.authority = this.authority;\n }\n if (this.query) {\n res.query = this.query;\n }\n if (this.fragment) {\n res.fragment = this.fragment;\n }\n return res;\n }\n}\n// reserved characters: https://tools.ietf.org/html/rfc3986#section-2.2\nconst encodeTable = {\n [58 /* CharCode.Colon */]: '%3A', // gen-delims\n [47 /* CharCode.Slash */]: '%2F',\n [63 /* CharCode.QuestionMark */]: '%3F',\n [35 /* CharCode.Hash */]: '%23',\n [91 /* CharCode.OpenSquareBracket */]: '%5B',\n [93 /* CharCode.CloseSquareBracket */]: '%5D',\n [64 /* CharCode.AtSign */]: '%40',\n [33 /* CharCode.ExclamationMark */]: '%21', // sub-delims\n [36 /* CharCode.DollarSign */]: '%24',\n [38 /* CharCode.Ampersand */]: '%26',\n [39 /* CharCode.SingleQuote */]: '%27',\n [40 /* CharCode.OpenParen */]: '%28',\n [41 /* CharCode.CloseParen */]: '%29',\n [42 /* CharCode.Asterisk */]: '%2A',\n [43 /* CharCode.Plus */]: '%2B',\n [44 /* CharCode.Comma */]: '%2C',\n [59 /* CharCode.Semicolon */]: '%3B',\n [61 /* CharCode.Equals */]: '%3D',\n [32 /* CharCode.Space */]: '%20',\n};\nfunction encodeURIComponentFast(uriComponent, isPath, isAuthority) {\n let res = undefined;\n let nativeEncodePos = -1;\n for (let pos = 0; pos < uriComponent.length; pos++) {\n const code = uriComponent.charCodeAt(pos);\n // unreserved characters: https://tools.ietf.org/html/rfc3986#section-2.3\n if ((code >= 97 /* CharCode.a */ && code <= 122 /* CharCode.z */)\n || (code >= 65 /* CharCode.A */ && code <= 90 /* CharCode.Z */)\n || (code >= 48 /* CharCode.Digit0 */ && code <= 57 /* CharCode.Digit9 */)\n || code === 45 /* CharCode.Dash */\n || code === 46 /* CharCode.Period */\n || code === 95 /* CharCode.Underline */\n || code === 126 /* CharCode.Tilde */\n || (isPath && code === 47 /* CharCode.Slash */)\n || (isAuthority && code === 91 /* CharCode.OpenSquareBracket */)\n || (isAuthority && code === 93 /* CharCode.CloseSquareBracket */)\n || (isAuthority && code === 58 /* CharCode.Colon */)) {\n // check if we are delaying native encode\n if (nativeEncodePos !== -1) {\n res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos));\n nativeEncodePos = -1;\n }\n // check if we write into a new string (by default we try to return the param)\n if (res !== undefined) {\n res += uriComponent.charAt(pos);\n }\n }\n else {\n // encoding needed, we need to allocate a new string\n if (res === undefined) {\n res = uriComponent.substr(0, pos);\n }\n // check with default table first\n const escaped = encodeTable[code];\n if (escaped !== undefined) {\n // check if we are delaying native encode\n if (nativeEncodePos !== -1) {\n res += encodeURIComponent(uriComponent.substring(nativeEncodePos, pos));\n nativeEncodePos = -1;\n }\n // append escaped variant to result\n res += escaped;\n }\n else if (nativeEncodePos === -1) {\n // use native encode only when needed\n nativeEncodePos = pos;\n }\n }\n }\n if (nativeEncodePos !== -1) {\n res += encodeURIComponent(uriComponent.substring(nativeEncodePos));\n }\n return res !== undefined ? res : uriComponent;\n}\nfunction encodeURIComponentMinimal(path) {\n let res = undefined;\n for (let pos = 0; pos < path.length; pos++) {\n const code = path.charCodeAt(pos);\n if (code === 35 /* CharCode.Hash */ || code === 63 /* CharCode.QuestionMark */) {\n if (res === undefined) {\n res = path.substr(0, pos);\n }\n res += encodeTable[code];\n }\n else {\n if (res !== undefined) {\n res += path[pos];\n }\n }\n }\n return res !== undefined ? res : path;\n}\n/**\n * Compute `fsPath` for the given uri\n */\nexport function uriToFsPath(uri, keepDriveLetterCasing) {\n let value;\n if (uri.authority && uri.path.length > 1 && uri.scheme === 'file') {\n // unc path: file://shares/c$/far/boo\n value = `//${uri.authority}${uri.path}`;\n }\n else if (uri.path.charCodeAt(0) === 47 /* CharCode.Slash */\n && (uri.path.charCodeAt(1) >= 65 /* CharCode.A */ && uri.path.charCodeAt(1) <= 90 /* CharCode.Z */ || uri.path.charCodeAt(1) >= 97 /* CharCode.a */ && uri.path.charCodeAt(1) <= 122 /* CharCode.z */)\n && uri.path.charCodeAt(2) === 58 /* CharCode.Colon */) {\n if (!keepDriveLetterCasing) {\n // windows drive letter: file:///c:/far/boo\n value = uri.path[1].toLowerCase() + uri.path.substr(2);\n }\n else {\n value = uri.path.substr(1);\n }\n }\n else {\n // other path\n value = uri.path;\n }\n if (isWindows) {\n value = value.replace(/\\//g, '\\\\');\n }\n return value;\n}\n/**\n * Create the external version of a uri\n */\nfunction _asFormatted(uri, skipEncoding) {\n const encoder = !skipEncoding\n ? encodeURIComponentFast\n : encodeURIComponentMinimal;\n let res = '';\n let { scheme, authority, path, query, fragment } = uri;\n if (scheme) {\n res += scheme;\n res += ':';\n }\n if (authority || scheme === 'file') {\n res += _slash;\n res += _slash;\n }\n if (authority) {\n let idx = authority.indexOf('@');\n if (idx !== -1) {\n // @\n const userinfo = authority.substr(0, idx);\n authority = authority.substr(idx + 1);\n idx = userinfo.lastIndexOf(':');\n if (idx === -1) {\n res += encoder(userinfo, false, false);\n }\n else {\n // :@\n res += encoder(userinfo.substr(0, idx), false, false);\n res += ':';\n res += encoder(userinfo.substr(idx + 1), false, true);\n }\n res += '@';\n }\n authority = authority.toLowerCase();\n idx = authority.lastIndexOf(':');\n if (idx === -1) {\n res += encoder(authority, false, true);\n }\n else {\n // :\n res += encoder(authority.substr(0, idx), false, true);\n res += authority.substr(idx);\n }\n }\n if (path) {\n // lower-case windows drive letters in /C:/fff or C:/fff\n if (path.length >= 3 && path.charCodeAt(0) === 47 /* CharCode.Slash */ && path.charCodeAt(2) === 58 /* CharCode.Colon */) {\n const code = path.charCodeAt(1);\n if (code >= 65 /* CharCode.A */ && code <= 90 /* CharCode.Z */) {\n path = `/${String.fromCharCode(code + 32)}:${path.substr(3)}`; // \"/c:\".length === 3\n }\n }\n else if (path.length >= 2 && path.charCodeAt(1) === 58 /* CharCode.Colon */) {\n const code = path.charCodeAt(0);\n if (code >= 65 /* CharCode.A */ && code <= 90 /* CharCode.Z */) {\n path = `${String.fromCharCode(code + 32)}:${path.substr(2)}`; // \"/c:\".length === 3\n }\n }\n // encode the rest of the path\n res += encoder(path, true, false);\n }\n if (query) {\n res += '?';\n res += encoder(query, false, false);\n }\n if (fragment) {\n res += '#';\n res += !skipEncoding ? encodeURIComponentFast(fragment, false, false) : fragment;\n }\n return res;\n}\n// --- decode\nfunction decodeURIComponentGraceful(str) {\n try {\n return decodeURIComponent(str);\n }\n catch (_a) {\n if (str.length > 3) {\n return str.substr(0, 3) + decodeURIComponentGraceful(str.substr(3));\n }\n else {\n return str;\n }\n }\n}\nconst _rEncodedAsHex = /(%[0-9A-Za-z][0-9A-Za-z])+/g;\nfunction percentDecode(str) {\n if (!str.match(_rEncodedAsHex)) {\n return str;\n }\n return str.replace(_rEncodedAsHex, (match) => decodeURIComponentGraceful(match));\n}\n","export const generateUuid = (function () {\n // use `randomUUID` if possible\n if (typeof crypto === 'object' && typeof crypto.randomUUID === 'function') {\n return crypto.randomUUID.bind(crypto);\n }\n // use `randomValues` if possible\n let getRandomValues;\n if (typeof crypto === 'object' && typeof crypto.getRandomValues === 'function') {\n getRandomValues = crypto.getRandomValues.bind(crypto);\n }\n else {\n getRandomValues = function (bucket) {\n for (let i = 0; i < bucket.length; i++) {\n bucket[i] = Math.floor(Math.random() * 256);\n }\n return bucket;\n };\n }\n // prep-work\n const _data = new Uint8Array(16);\n const _hex = [];\n for (let i = 0; i < 256; i++) {\n _hex.push(i.toString(16).padStart(2, '0'));\n }\n return function generateUuid() {\n // get data\n getRandomValues(_data);\n // set version bits\n _data[6] = (_data[6] & 0x0f) | 0x40;\n _data[8] = (_data[8] & 0x3f) | 0x80;\n // print as string\n let i = 0;\n let result = '';\n result += _hex[_data[i++]];\n result += _hex[_data[i++]];\n result += _hex[_data[i++]];\n result += _hex[_data[i++]];\n result += '-';\n result += _hex[_data[i++]];\n result += _hex[_data[i++]];\n result += '-';\n result += _hex[_data[i++]];\n result += _hex[_data[i++]];\n result += '-';\n result += _hex[_data[i++]];\n result += _hex[_data[i++]];\n result += '-';\n result += _hex[_data[i++]];\n result += _hex[_data[i++]];\n result += _hex[_data[i++]];\n result += _hex[_data[i++]];\n result += _hex[_data[i++]];\n result += _hex[_data[i++]];\n return result;\n };\n})();\n"],"names":["StringIterator","constructor","this","_value","_pos","reset","key","next","hasNext","length","cmp","a","charCodeAt","value","ConfigKeysIterator","_caseSensitive","_from","_to","justSeps","substring","PathIterator","_splitOnBackslash","_valueLen","pos","ch","UriIterator","_ignorePathCasing","_ignoreQueryAndFragment","_states","_stateIdx","scheme","push","authority","path","_pathIterator","query","fragment","Error","TernarySearchTreeNode","height","rotateLeft","tmp","right","left","updateHeight","rotateRight","Math","max","heightLeft","heightRight","balanceFactor","_a","_b","TernarySearchTree","forUris","ignorePathCasing","ignoreQueryAndFragment","forStrings","forConfigKeys","segments","_iter","clear","_root","undefined","set","element","iter","node","segment","stack","val","mid","oldElement","i","bf","d1","d2","get","_getNode","has","_delete","deleteSuperstr","superStr","min","_min","newChild","dir","parent","findSubstr","candidate","findSuperstr","_findSuperstrOrElement","allowValue","_entries","forEach","callback","Symbol","iterator","result","_dfsEntries","bucket","TfIdfCalculator","chunkCount","chunkOccurrences","Map","documents","calculateScores","token","embedding","computeEmbedding","idfCache","scores","doc","isCancellationRequested","chunk","chunks","score","computeSimilarityScore","termFrequencies","input","values","map","countMapFrom","splitTerms","normalize","word","toLowerCase","matchAll","camelParts","replace","split","part","test","updateDocuments","deleteDocument","text","textChunks","tf","term","keys","delete","currentOccurrences","newOccurrences","queryEmbedding","sum","termTfidf","Object","entries","chunkTf","chunkIdf","computeIdf","computeTfidf","log","create","occurrences","idf","normalizeTfIdfScores","slice","sort","b","ThemeColor","ThemeIcon","isThemeColor","obj","id","iconNameSegment","iconNameExpression","iconModifierExpression","iconNameCharacter","ThemeIconIdRegex","RegExp","asClassNameArray","icon","match","exec","modifier","classNames","asClassName","join","asCSSSelector","isThemeIcon","color","_regexFromString","fromString","str","name","fromId","modify","tildeIndex","lastIndexOf","getModifier","isEqual","ti1","ti2","isString","isObject","Array","isArray","Date","isTypedArray","TypedArray","getPrototypeOf","Uint8Array","isNumber","isNaN","isIterable","isBoolean","isUndefined","isDefined","arg","isUndefinedOrNull","assertType","condition","type","assertIsDefined","isFunction","validateConstraints","args","constraints","len","validateConstraint","constraint","call","toUint8","v","toUint32","_schemePattern","_singleSlashStart","_doubleSlashStart","_empty","_slash","_regexp","URI","isUri","thing","fsPath","with","toString","schemeOrData","_strict","_schemeFix","_referenceResolution","ret","_validateUri","uriToFsPath","change","Uri","parse","percentDecode","file","idx","indexOf","from","components","strict","joinPath","uri","pathFragment","newPath","skipEncoding","_asFormatted","toJSON","revive","data","_formatted","external","_fsPath","_sep","_pathSepMarker","super","arguments","res","$mid","encodeTable","encodeURIComponentFast","uriComponent","isPath","isAuthority","nativeEncodePos","code","encodeURIComponent","charAt","substr","escaped","encodeURIComponentMinimal","keepDriveLetterCasing","encoder","userinfo","String","fromCharCode","decodeURIComponentGraceful","decodeURIComponent","_rEncodedAsHex","generateUuid","crypto","randomUUID","bind","getRandomValues","floor","random","_data","_hex","padStart"],"sourceRoot":""}