open-webui/static/pyscript/codemirror-Dr2Hgejs.js

3 lines
30 KiB
JavaScript
Raw Normal View History

2024-05-17 03:49:28 +00:00
import{V as e,a as t,E as i,b as s,c as n,r as o,h as r,W as a,d as l,e as c,f as h,i as d,j as u,m as f,n as m,o as p,k as g}from"./codemirror_view-C0PMO2z_.js";import{codePointAt as v,fromCodePoint as x,codePointSize as b,StateEffect as w,Facet as y,combineConfig as k,CharCategory as S,EditorSelection as C,Prec as M,StateField as A,EditorState as L,findClusterBreak as q,RangeSetBuilder as R}from"./codemirror_state-BKbyfKsm.js";import{k as D,l as W,m as F,n as I,o as P,p as E}from"./codemirror_language-_XiX6II0.js";import{history as $,defaultKeymap as T,historyKeymap as O}from"./codemirror_commands-MgxtVkrD.js";import{a as z,b as j,d as B,e as _}from"./index-CTWZX_TW.js";function V(){var e=arguments[0];"string"==typeof e&&(e=document.createElement(e));var t=1,i=arguments[1];if(i&&"object"==typeof i&&null==i.nodeType&&!Array.isArray(i)){for(var s in i)if(Object.prototype.hasOwnProperty.call(i,s)){var n=i[s];"string"==typeof n?e.setAttribute(s,n):null!=n&&(e[s]=n)}t++}for(;t<arguments.length;t++)H(e,arguments[t]);return e}function H(e,t){if("string"==typeof t)e.appendChild(document.createTextNode(t));else if(null==t);else if(null!=t.nodeType)e.appendChild(t);else{if(!Array.isArray(t))throw new RangeError("Unsupported child node: "+t);for(var i=0;i<t.length;i++)H(e,t[i])}}const N="function"==typeof String.prototype.normalize?e=>e.normalize("NFKD"):e=>e;class U{constructor(e,t,i=0,s=e.length,n,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(i,s),this.bufferStart=i,this.normalize=n?e=>n(N(e)):N,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return v(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=x(e),i=this.bufferStart+this.bufferPos;this.bufferPos+=b(e);let s=this.normalize(t);for(let e=0,n=i;;e++){let o=s.charCodeAt(e),r=this.match(o,n,this.bufferPos+this.bufferStart);if(e==s.length-1){if(r)return this.value=r,this;break}n==i&&e<t.length&&t.charCodeAt(e)==o&&n++}}}match(e,t,i){let s=null;for(let t=0;t<this.matches.length;t+=2){let n=this.matches[t],o=!1;this.query.charCodeAt(n)==e&&(n==this.query.length-1?s={from:this.matches[t+1],to:i}:(this.matches[t]++,o=!0)),o||(this.matches.splice(t,2),t-=2)}return this.query.charCodeAt(0)==e&&(1==this.query.length?s={from:t,to:i}:this.matches.push(1,t)),s&&this.test&&!this.test(s.from,s.to,this.buffer,this.bufferStart)&&(s=null),s}}"undefined"!=typeof Symbol&&(U.prototype[Symbol.iterator]=function(){return this});const K={from:-1,to:-1,match:/.*/.exec("")},Q="gm"+(null==/x/.unicode?"":"u");class G{constructor(e,t,i,s=0,n=e.length){if(this.text=e,this.to=n,this.curLine="",this.done=!1,this.value=K,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new J(e,t,i,s,n);this.re=new RegExp(t,Q+((null==i?void 0:i.ignoreCase)?"i":"")),this.test=null==i?void 0:i.test,this.iter=e.iter();let o=e.lineAt(s);this.curLineStart=o.from,this.matchPos=X(e,s),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let i=this.curLineStart+t.index,s=i+t[0].length;if(this.matchPos=X(this.text,s+(i==s?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(i<s||i>this.value.to)&&(!this.test||this.test(i,s,t)))return this.value={from:i,to:s,match:t},this;e=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length<this.to))return this.done=!0,this;this.nextLine(),e=0}}}}con
//# sourceMappingURL=codemirror-Dr2Hgejs.js.map