mirror of
https://github.com/open-webui/open-webui
synced 2024-11-23 00:27:40 +00:00
1 line
130 KiB
Plaintext
1 line
130 KiB
Plaintext
|
{"version":3,"file":"codemirror-Dr2Hgejs.js","sources":["../node_modules/crelt/index.js","../node_modules/@codemirror/search/dist/index.js","../node_modules/@codemirror/lint/dist/index.js","../node_modules/codemirror/dist/index.js"],"sourcesContent":["export default function crelt() {\n var elt = arguments[0]\n if (typeof elt == \"string\") elt = document.createElement(elt)\n var i = 1, next = arguments[1]\n if (next && typeof next == \"object\" && next.nodeType == null && !Array.isArray(next)) {\n for (var name in next) if (Object.prototype.hasOwnProperty.call(next, name)) {\n var value = next[name]\n if (typeof value == \"string\") elt.setAttribute(name, value)\n else if (value != null) elt[name] = value\n }\n i++\n }\n for (; i < arguments.length; i++) add(elt, arguments[i])\n return elt\n}\n\nfunction add(elt, child) {\n if (typeof child == \"string\") {\n elt.appendChild(document.createTextNode(child))\n } else if (child == null) {\n } else if (child.nodeType != null) {\n elt.appendChild(child)\n } else if (Array.isArray(child)) {\n for (var i = 0; i < child.length; i++) add(elt, child[i])\n } else {\n throw new RangeError(\"Unsupported child node: \" + child)\n }\n}\n","import { showPanel, EditorView, getPanel, Decoration, ViewPlugin, runScopeHandlers } from '@codemirror/view';\nimport { codePointAt, fromCodePoint, codePointSize, StateEffect, StateField, EditorSelection, Facet, combineConfig, CharCategory, RangeSetBuilder, Prec, EditorState, findClusterBreak } from '@codemirror/state';\nimport elt from 'crelt';\n\nconst basicNormalize = typeof String.prototype.normalize == \"function\"\n ? x => x.normalize(\"NFKD\") : x => x;\n/**\nA search cursor provides an iterator over text matches in a\ndocument.\n*/\nclass SearchCursor {\n /**\n Create a text cursor. The query is the search string, `from` to\n `to` provides the region to search.\n \n When `normalize` is given, it will be called, on both the query\n string and the content it is matched against, before comparing.\n You can, for example, create a case-insensitive search by\n passing `s => s.toLowerCase()`.\n \n Text is always normalized with\n [`.normalize(\"NFKD\")`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize)\n (when supported).\n */\n constructor(text, query, from = 0, to = text.length, normalize, test) {\n this.test = test;\n /**\n The current match (only holds a meaningful value after\n [`next`](https://codemirror.net/6/docs/ref/#search.SearchCursor.next) has been called and when\n `done` is false).\n */\n this.value = { from: 0, to: 0 };\n /**\n Whether the end of the iterated region has been reached.\n */\n this.done = false;\n this.matches = [];\n this.buffer = \"\";\n this.bufferPos = 0;\n this.iter = text.iterRange(from, to);\n this.bufferStart = from;\n this.normalize = normalize ? x => normalize(basicNormalize(x)) : basicNormalize;\n this.query = this.normalize(query);\n }\n peek() {\n if (this.bufferPos == this.buffer.length) {\n this.bufferStart += this.buffer.length;\n this.iter.next();\n if (this.iter.done)\n return -1;\n this.bufferPos = 0;\n this.buffer = this.iter.value;\n }\n return codePointAt(this.buffer, this.bufferPos);\n }\n /**\n Look for the next match. Updates the iterator's\n [`value`](https://codemirror.net/6/docs/ref/#search.SearchCursor.value) and\n [`done`](https://codemirror.net/6/docs/ref/#search.SearchCursor.done) properties. Should be called\n at least once before using the cursor.\n */\n next() {\n while (this.matches.length)\n this.matches.pop();\n return this.nextOverlapping();\n }\n /**\n The `next` method will ignore matches that partially overlap a\n previous match. This method behaves like `ne
|