@i14ks/ccv 0.6.2 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/ccv.mjs +804 -131
- package/package.json +1 -1
- package/web/assets/{codemirror-02hKfv-c.js → codemirror-4gviWJRD.js} +1 -1
- package/web/assets/{index-BybHqs37.js → index-B-8FWzpe.js} +1 -1
- package/web/assets/{index-DRMnPfA3.js → index-BiBGEAPz.js} +1 -1
- package/web/assets/{index-Bm6PUpXb.js → index-BjCwOpLW.js} +1 -1
- package/web/assets/{index-BBkJ4cEk.js → index-BleqvvQk.js} +1 -1
- package/web/assets/{index-BxcnR7Nj.js → index-Bv8vIAVO.js} +1 -1
- package/web/assets/index-Bzq-v0Dg.js +134 -0
- package/web/assets/{index-sQrmYdbi.css → index-CE1G7QxT.css} +1 -1
- package/web/assets/{index-VSDVirVT.js → index-CJo5aeRL.js} +1 -1
- package/web/assets/{index-C-8irjwh.js → index-CKz5fHXP.js} +1 -1
- package/web/assets/{index-BC8gj6P7.js → index-CR_zbJ-Z.js} +1 -1
- package/web/assets/{index-C2nhZ-ID.js → index-CYwf9t3p.js} +1 -1
- package/web/assets/{index-DZXdWq9L.js → index-C_LuD9HT.js} +1 -1
- package/web/assets/{index-ChKrBnaf.js → index-Cid3pp7b.js} +1 -1
- package/web/assets/{index-Clyg5z5Z.js → index-CkSGxu2i.js} +1 -1
- package/web/assets/{index-KEWrG50i.js → index-CrX9ldma.js} +1 -1
- package/web/assets/{index-BorlqgNX.js → index-Depy6k3N.js} +1 -1
- package/web/assets/{index-zDoB4KM7.js → index-DklW2LtN.js} +1 -1
- package/web/assets/{index-B5hgDwts.js → index-DmEjP2AP.js} +1 -1
- package/web/assets/{index-DpZcQOqI.js → index-fWVyTiSX.js} +1 -1
- package/web/assets/{index-D0UkSEon.js → index-hElc3lLb.js} +1 -1
- package/web/assets/{index-i-F6wQDa.js → index-kMdLDVpb.js} +1 -1
- package/web/index.html +2 -2
- package/web/assets/index-DFJbTCVa.js +0 -129
|
@@ -1 +1 @@
|
|
|
1
|
-
import{N as b,e as Be,c as C,h as Me,I as Z,f as M,P as Ne,a as X,t as u,s as Fe}from"./index-DFJbTCVa.js";import{RangeSetBuilder as fe,RangeSet as Ee,EditorState as I,countColumn as Le,Facet as y,StateField as ce,StateEffect as L,Prec as He,combineConfig as ue}from"./index-BHot-lnj.js";import{V as H,u as We,E as w,G as Re,D as g,S as _,q as Ue,W as he,o as ee}from"./index-891wE-Rj.js";var $;const A=new b;function $e(n){return y.define({combine:n?e=>e.concat(n):void 0})}const qe=new b;class m{constructor(e,t,r=[],i=""){this.data=e,this.name=i,I.prototype.hasOwnProperty("tree")||Object.defineProperty(I.prototype,"tree",{get(){return k(this)}}),this.parser=t,this.extension=[x.of(this),I.languageData.of((s,o,l)=>{let a=te(s,o,l),f=a.type.prop(A);if(!f)return[];let c=s.facet(f),h=a.type.prop(qe);if(h){let p=a.resolve(o-a.from,l);for(let d of h)if(d.test(p,s)){let S=s.facet(d.facet);return d.type=="replace"?S:S.concat(c)}}return c})].concat(r)}isActiveAt(e,t,r=-1){return te(e,t,r).type.prop(A)==this.data}findRegions(e){let t=e.facet(x);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let r=[],i=(s,o)=>{if(s.prop(A)==this.data){r.push({from:o,to:o+s.length});return}let l=s.prop(b.mounted);if(l){if(l.tree.prop(A)==this.data){if(l.overlay)for(let a of l.overlay)r.push({from:a.from+o,to:a.to+o});else r.push({from:o,to:o+s.length});return}else if(l.overlay){let a=r.length;if(i(l.tree,l.overlay[0].from+o),r.length>a)return}}for(let a=0;a<s.children.length;a++){let f=s.children[a];f instanceof C&&i(f,s.positions[a]+o)}};return i(k(e),0),r}get allowsNesting(){return!0}}m.setState=L.define();function te(n,e,t){let r=n.facet(x),i=k(n).topNode;if(!r||r.allowsNesting)for(let s=i;s;s=s.enter(e,t,Z.ExcludeBuffers|Z.EnterBracketed))s.type.isTop&&(i=s);return i}class V extends m{constructor(e,t,r){super(e,t,[],r),this.parser=t}static define(e){let t=$e(e.languageData);return new V(t,e.parser.configure({props:[A.add(r=>r.isTop?t:void 0)]}),e.name)}configure(e,t){return new V(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function k(n){let e=n.field(m.state,!1);return e?e.tree:C.empty}class je{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let r=this.cursorPos-this.string.length;return e<r||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-r,t-r)}}let D=null;class N{constructor(e,t,r=[],i,s,o,l,a){this.parser=e,this.state=t,this.fragments=r,this.tree=i,this.treeLen=s,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,r){return new N(e,t,[],C.empty,0,r,[],null)}startParse(){return this.parser.startParse(new je(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=C.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let i=this.parse.advance();if(i)if(this.fragments=this.withoutTempSkipped(M.addTree(i,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=i,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(M.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=D;D=this;try{return e()}finally{D=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=ne(e,t.from,t.to);return e}changes(e,t){let{fragments:r,tree:i,treeLen:s,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((f,c,h,p)=>a.push({fromA:f,toA:c,fromB:h,toB:p})),r=M.applyChanges(r,a),i=C.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let f of this.skipped){let c=e.mapPos(f.from,1),h=e.mapPos(f.to,-1);c<h&&l.push({from:c,to:h})}}}return new N(this.parser,t,r,i,s,o,l,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:i,to:s}=this.skipped[r];i<e.to&&s>e.from&&(this.fragments=ne(this.fragments,i,s),this.skipped.splice(r--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends Ne{createParse(t,r,i){let s=i[0].from,o=i[i.length-1].to;return{parsedPos:s,advance(){let a=D;if(a){for(let f of i)a.tempSkipped.push(f);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new C(X.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return D}}function ne(n,e,t){return M.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class P{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,r)||t.takeTree(),new P(t)}static init(e){let t=Math.min(3e3,e.doc.length),r=N.create(e.facet(x).parser,e,{from:0,to:t});return r.work(20,t)||r.takeTree(),new P(r)}}m.state=ce.define({create:P.init,update(n,e){for(let t of e.effects)if(t.is(m.setState))return t.value;return e.startState.facet(x)!=e.state.facet(x)?P.init(e.state):n.apply(e)}});let de=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(de=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const q=typeof navigator<"u"&&(!(($=navigator.scheduling)===null||$===void 0)&&$.isInputPending)?()=>navigator.scheduling.isInputPending():null,ze=H.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(m.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(m.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=de(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:i}}=this.view,s=r.field(m.state);if(s.tree==s.context.tree&&s.context.isDone(i+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!q?Math.max(25,e.timeRemaining()-5):1e9),l=s.context.treeLen<i&&r.doc.length>i+1e3,a=s.context.work(()=>q&&q()||Date.now()>o,i+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:m.setState.of(new P(s.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>Ue(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),x=y.define({combine(n){return n.length?n[0]:null},enables:n=>[m.state,ze,w.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class Ft{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}class pe{constructor(e,t,r,i,s,o=void 0){this.name=e,this.alias=t,this.extensions=r,this.filename=i,this.loadFunc=s,this.support=o,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:t,support:r}=e;if(!t){if(!r)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");t=()=>Promise.resolve(r)}return new pe(e.name,(e.alias||[]).concat(e.name).map(i=>i.toLowerCase()),e.extensions||[],e.filename,t,r)}static matchFilename(e,t){for(let i of e)if(i.filename&&i.filename.test(t))return i;let r=/\.([^.]+)$/.exec(t);if(r){for(let i of e)if(i.extensions.indexOf(r[1])>-1)return i}return null}static matchLanguageName(e,t,r=!0){t=t.toLowerCase();for(let i of e)if(i.alias.some(s=>s==t))return i;if(r)for(let i of e)for(let s of i.alias){let o=t.indexOf(s);if(o>-1&&(s.length>2||!/\w/.test(t[o-1])&&!/\w/.test(t[o+s.length])))return i}return null}}const Ge=y.define(),me=y.define({combine:n=>{if(!n.length)return" ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function Ve(n){let e=n.facet(me);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function Je(n,e){let t="",r=n.tabSize,i=n.facet(me)[0];if(i==" "){for(;e>=r;)t+=" ",e-=r;i=" "}for(let s=0;s<e;s++)t+=i;return t}function Ke(n,e){n instanceof I&&(n=new ge(n));for(let r of n.state.facet(Ge)){let i=r(n,e);if(i!==void 0)return i}let t=k(n.state);return t.length>=e?Xe(n,t,e):null}class ge{constructor(e,t={}){this.state=e,this.options=t,this.unit=Ve(e)}lineAt(e,t=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:s}=this.options;return i!=null&&i>=r.from&&i<=r.to?s&&i==e?{text:"",from:e}:(t<0?i<e:i<=e)?{text:r.text.slice(i-r.from),from:i}:{text:r.text.slice(0,i-r.from),from:r.from}:r}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:r,from:i}=this.lineAt(e,t);return r.slice(e-i,Math.min(r.length,e+100-i))}column(e,t=1){let{text:r,from:i}=this.lineAt(e,t),s=this.countColumn(r,e-i),o=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return o>-1&&(s+=o-this.countColumn(r,r.search(/\S|$/))),s}countColumn(e,t=e.length){return Le(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:r,from:i}=this.lineAt(e,t),s=this.options.overrideIndentation;if(s){let o=s(i);if(o>-1)return o}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Qe=new b;function Xe(n,e,t){let r=e.resolveStack(t),i=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(i!=r.node){let s=[];for(let o=i;o&&!(o.from<r.node.from||o.to>r.node.to||o.from==r.node.from&&o.type==r.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)r={node:s[o],next:r}}return ke(r,n,t)}function ke(n,e,t){for(let r=n;r;r=r.next){let i=Ze(r.node);if(i)return i(Y.create(e,t,r))}return 0}function Ye(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function Ze(n){let e=n.type.prop(Qe);if(e)return e;let t=n.firstChild,r;if(t&&(r=t.type.prop(b.closedBy))){let i=n.lastChild,s=i&&r.indexOf(i.name)>-1;return o=>be(o,!0,1,void 0,s&&!Ye(o)?i.from:void 0)}return n.parent==null?_e:null}function _e(){return 0}class Y extends ge{constructor(e,t,r){super(e.state,e.options),this.base=e,this.pos=t,this.context=r}get node(){return this.context.node}static create(e,t,r){return new Y(e,t,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(t.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(et(r,e))break;t=this.state.doc.lineAt(r.from)}return this.lineIndent(t.from)}continue(){return ke(this.context.next,this.base,this.pos)}}function et(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function tt(n){let e=n.node,t=e.childAfter(e.from),r=e.lastChild;if(!t)return null;let i=n.options.simulateBreak,s=n.state.doc.lineAt(t.from),o=i==null||i<=s.from?s.to:Math.min(s.to,i);for(let l=t.to;;){let a=e.childAfter(l);if(!a||a==r)return null;if(!a.type.isSkipped){if(a.from>=o)return null;let f=/^ */.exec(s.text.slice(t.to-s.from))[0].length;return{from:t.from,to:t.to+f}}l=a.to}}function Et({closing:n,align:e=!0,units:t=1}){return r=>be(r,e,t,n)}function be(n,e,t,r,i){let s=n.textAfter,o=s.match(/^\s*/)[0].length,l=r&&s.slice(o,o+r.length)==r||i==n.pos+o,a=e?tt(n):null;return a?l?n.column(a.from):n.column(a.to):n.baseIndent+(l?0:n.unit*t)}const Lt=n=>n.baseIndent;function Ht({except:n,units:e=1}={}){return t=>{let r=n&&n.test(t.textAfter);return t.baseIndent+(r?0:e*t.unit)}}const nt=200;function Wt(){return I.transactionFilter.of(n=>{if(!n.docChanged||!n.isUserEvent("input.type")&&!n.isUserEvent("input.complete"))return n;let e=n.startState.languageDataAt("indentOnInput",n.startState.selection.main.head);if(!e.length)return n;let t=n.newDoc,{head:r}=n.newSelection.main,i=t.lineAt(r);if(r>i.from+nt)return n;let s=t.sliceString(i.from,r);if(!e.some(f=>f.test(s)))return n;let{state:o}=n,l=-1,a=[];for(let{head:f}of o.selection.ranges){let c=o.doc.lineAt(f);if(c.from==l)continue;l=c.from;let h=Ke(o,c.from);if(h==null)continue;let p=/^\s*/.exec(c.text)[0],d=Je(o,h);p!=d&&a.push({from:c.from,to:c.from+p.length,insert:d})}return a.length?[n,{changes:a,sequential:!0}]:n})}const rt=y.define(),it=new b;function Rt(n){let e=n.firstChild,t=n.lastChild;return e&&e.to<t.from?{from:e.to,to:t.type.isError?n.to:t.from}:null}function st(n,e,t){let r=k(n);if(r.length<t)return null;let i=r.resolveStack(t,1),s=null;for(let o=i;o;o=o.next){let l=o.node;if(l.to<=t||l.from>t)continue;if(s&&l.from<e)break;let a=l.type.prop(it);if(a&&(l.to<r.length-50||r.length==n.doc.length||!ot(l))){let f=a(l,n);f&&f.from<=t&&f.from>=e&&f.to>t&&(s=f)}}return s}function ot(n){let e=n.lastChild;return e&&e.to==n.to&&e.type.isError}function F(n,e,t){for(let r of n.facet(rt)){let i=r(n,e,t);if(i)return i}return st(n,e,t)}function ye(n,e){let t=e.mapPos(n.from,1),r=e.mapPos(n.to,-1);return t>=r?void 0:{from:t,to:r}}const W=L.define({map:ye}),O=L.define({map:ye});function we(n){let e=[];for(let{head:t}of n.state.selection.ranges)e.some(r=>r.from<=t&&r.to>=t)||e.push(n.lineBlockAt(t));return e}const v=ce.define({create(){return g.none},update(n,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((r,i)=>n=re(n,r,i)),n=n.map(e.changes);let t=[];for(let r of e.effects)r.is(W)&&!at(n,r.value.from,r.value.to)?t.push(r.value):r.is(O)&&(n=n.update({filter:(i,s)=>r.value.from!=i||r.value.to!=s,filterFrom:r.value.from,filterTo:r.value.to}));if(t.length){let{preparePlaceholder:r}=e.state.facet(Se),i=t.map(s=>(r?g.replace({widget:new dt(r(e.state,s))}):ie).range(s.from,s.to));n=n.update({add:i})}return e.selection&&(n=re(n,e.selection.main.head)),n},provide:n=>w.decorations.from(n),toJSON(n,e){let t=[];return n.between(0,e.doc.length,(r,i)=>{t.push(r,i)}),t},fromJSON(n){if(!Array.isArray(n)||n.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t<n.length;){let r=n[t++],i=n[t++];if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid JSON for fold state");e.push(ie.range(r,i))}return g.set(e,!0)}});function re(n,e,t=e){let r=!1;return n.between(e,t,(i,s)=>{i<t&&s>e&&(r=!0)}),r?n.update({filterFrom:e,filterTo:t,filter:(i,s)=>i>=t||s<=e}):n}function E(n,e,t){var r;let i=null;return(r=n.field(v,!1))===null||r===void 0||r.between(e,t,(s,o)=>{(!i||i.from>s)&&(i={from:s,to:o})}),i}function at(n,e,t){let r=!1;return n.between(e,e,(i,s)=>{i==e&&s==t&&(r=!0)}),r}function xe(n,e){return n.field(v,!1)?e:e.concat(L.appendConfig.of(Te()))}const lt=n=>{for(let e of we(n)){let t=F(n.state,e.from,e.to);if(t)return n.dispatch({effects:xe(n.state,[W.of(t),ve(n,t)])}),!0}return!1},ft=n=>{if(!n.state.field(v,!1))return!1;let e=[];for(let t of we(n)){let r=E(n.state,t.from,t.to);r&&e.push(O.of(r),ve(n,r,!1))}return e.length&&n.dispatch({effects:e}),e.length>0};function ve(n,e,t=!0){let r=n.state.doc.lineAt(e.from).number,i=n.state.doc.lineAt(e.to).number;return w.announce.of(`${n.state.phrase(t?"Folded lines":"Unfolded lines")} ${r} ${n.state.phrase("to")} ${i}.`)}const ct=n=>{let{state:e}=n,t=[];for(let r=0;r<e.doc.length;){let i=n.lineBlockAt(r),s=F(e,i.from,i.to);s&&t.push(W.of(s)),r=(s?n.lineBlockAt(s.to):i).to+1}return t.length&&n.dispatch({effects:xe(n.state,t)}),!!t.length},ut=n=>{let e=n.state.field(v,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,n.state.doc.length,(r,i)=>{t.push(O.of({from:r,to:i}))}),n.dispatch({effects:t}),!0},Ut=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:lt},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:ft},{key:"Ctrl-Alt-[",run:ct},{key:"Ctrl-Alt-]",run:ut}],ht={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Se=y.define({combine(n){return ue(n,ht)}});function Te(n){return[v,mt]}function Ce(n,e){let{state:t}=n,r=t.facet(Se),i=o=>{let l=n.lineBlockAt(n.posAtDOM(o.target)),a=E(n.state,l.from,l.to);a&&n.dispatch({effects:O.of(a)}),o.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(n,i,e);let s=document.createElement("span");return s.textContent=r.placeholderText,s.setAttribute("aria-label",t.phrase("folded code")),s.title=t.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=i,s}const ie=g.replace({widget:new class extends he{toDOM(n){return Ce(n,null)}}});class dt extends he{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return Ce(e,this.value)}}const pt={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class j extends Re{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function $t(n={}){let e={...pt,...n},t=new j(e,!0),r=new j(e,!1),i=H.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(x)!=o.state.facet(x)||o.startState.field(v,!1)!=o.state.field(v,!1)||k(o.startState)!=k(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let l=new fe;for(let a of o.viewportLineBlocks){let f=E(o.state,a.from,a.to)?r:F(o.state,a.from,a.to)?t:null;f&&l.add(a.from,a.from,f)}return l.finish()}}),{domEventHandlers:s}=e;return[i,We({class:"cm-foldGutter",markers(o){var l;return((l=o.plugin(i))===null||l===void 0?void 0:l.markers)||Ee.empty},initialSpacer(){return new j(e,!1)},domEventHandlers:{...s,click:(o,l,a)=>{if(s.click&&s.click(o,l,a))return!0;let f=E(o.state,l.from,l.to);if(f)return o.dispatch({effects:O.of(f)}),!0;let c=F(o.state,l.from,l.to);return c?(o.dispatch({effects:W.of(c)}),!0):!1}}}),Te()]}const mt=w.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class R{constructor(e,t){this.specs=e;let r;function i(l){let a=_.newName();return(r||(r=Object.create(null)))["."+a]=l,a}const s=typeof t.all=="string"?t.all:t.all?i(t.all):void 0,o=t.scope;this.scope=o instanceof m?l=>l.prop(A)==o.data:o?l=>l==o:void 0,this.style=Be(e.map(l=>({tag:l.tag,class:l.class||i(Object.assign({},l,{tag:null}))})),{all:s}).style,this.module=r?new _(r):null,this.themeType=t.themeType}static define(e,t){return new R(e,t||{})}}const J=y.define(),Ae=y.define({combine(n){return n.length?[n[0]]:null}});function z(n){let e=n.facet(J);return e.length?e:n.facet(Ae)}function qt(n,e){let t=[kt],r;return n instanceof R&&(n.module&&t.push(w.styleModule.of(n.module)),r=n.themeType),e!=null&&e.fallback?t.push(Ae.of(n)):r?t.push(J.computeN([w.darkTheme],i=>i.facet(w.darkTheme)==(r=="dark")?[n]:[])):t.push(J.of(n)),t}class gt{constructor(e){this.markCache=Object.create(null),this.tree=k(e.state),this.decorations=this.buildDeco(e,z(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=k(e.state),r=z(e.state),i=r!=z(e.startState),{viewport:s}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length<s.to&&!i&&t.type==this.tree.type&&o>=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||i)&&(this.tree=t,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=s.to)}buildDeco(e,t){if(!t||!this.tree.length)return g.none;let r=new fe;for(let{from:i,to:s}of e.visibleRanges)Me(this.tree,t,(o,l,a)=>{r.add(o,l,this.markCache[a]||(this.markCache[a]=g.mark({class:a})))},i,s);return r.finish()}}const kt=He.high(H.fromClass(gt,{decorations:n=>n.decorations})),jt=R.define([{tag:u.meta,color:"#404740"},{tag:u.link,textDecoration:"underline"},{tag:u.heading,textDecoration:"underline",fontWeight:"bold"},{tag:u.emphasis,fontStyle:"italic"},{tag:u.strong,fontWeight:"bold"},{tag:u.strikethrough,textDecoration:"line-through"},{tag:u.keyword,color:"#708"},{tag:[u.atom,u.bool,u.url,u.contentSeparator,u.labelName],color:"#219"},{tag:[u.literal,u.inserted],color:"#164"},{tag:[u.string,u.deleted],color:"#a11"},{tag:[u.regexp,u.escape,u.special(u.string)],color:"#e40"},{tag:u.definition(u.variableName),color:"#00f"},{tag:u.local(u.variableName),color:"#30a"},{tag:[u.typeName,u.namespace],color:"#085"},{tag:u.className,color:"#167"},{tag:[u.special(u.variableName),u.macroName],color:"#256"},{tag:u.definition(u.propertyName),color:"#00c"},{tag:u.comment,color:"#940"},{tag:u.invalid,color:"#f00"}]),bt=w.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Pe=1e4,De="()[]{}",Ie=y.define({combine(n){return ue(n,{afterCursor:!0,brackets:De,maxScanDistance:Pe,renderMatch:xt})}}),yt=g.mark({class:"cm-matchingBracket"}),wt=g.mark({class:"cm-nonmatchingBracket"});function xt(n){let e=[],t=n.matched?yt:wt;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}function se(n){let e=[],t=n.facet(Ie);for(let r of n.selection.ranges){if(!r.empty)continue;let i=B(n,r.head,-1,t)||r.head>0&&B(n,r.head-1,1,t)||t.afterCursor&&(B(n,r.head,1,t)||r.head<n.doc.length&&B(n,r.head+1,-1,t));i&&(e=e.concat(t.renderMatch(i,n)))}return g.set(e,!0)}const vt=H.fromClass(class{constructor(n){this.paused=!1,this.decorations=se(n.state)}update(n){(n.docChanged||n.selectionSet||this.paused)&&(n.view.composing?(this.decorations=this.decorations.map(n.changes),this.paused=!0):(this.decorations=se(n.state),this.paused=!1))}},{decorations:n=>n.decorations}),St=[vt,bt];function zt(n={}){return[Ie.of(n),St]}const Tt=new b;function K(n,e,t){let r=n.prop(e<0?b.openedBy:b.closedBy);if(r)return r;if(n.name.length==1){let i=t.indexOf(n.name);if(i>-1&&i%2==(e<0?1:0))return[t[i+e]]}return null}function Q(n){let e=n.type.prop(Tt);return e?e(n.node):n}function B(n,e,t,r={}){let i=r.maxScanDistance||Pe,s=r.brackets||De,o=k(n),l=o.resolveInner(e,t);for(let a=l;a;a=a.parent){let f=K(a.type,t,s);if(f&&a.from<a.to){let c=Q(a);if(c&&(t>0?e>=c.from&&e<c.to:e>c.from&&e<=c.to))return Ct(n,e,t,a,c,f,s)}}return At(n,e,t,o,l.type,i,s)}function Ct(n,e,t,r,i,s,o){let l=r.parent,a={from:i.from,to:i.to},f=0,c=l==null?void 0:l.cursor();if(c&&(t<0?c.childBefore(r.from):c.childAfter(r.to)))do if(t<0?c.to<=r.from:c.from>=r.to){if(f==0&&s.indexOf(c.type.name)>-1&&c.from<c.to){let h=Q(c);return{start:a,end:h?{from:h.from,to:h.to}:void 0,matched:!0}}else if(K(c.type,t,o))f++;else if(K(c.type,-t,o)){if(f==0){let h=Q(c);return{start:a,end:h&&h.from<h.to?{from:h.from,to:h.to}:void 0,matched:!1}}f--}}while(t<0?c.prevSibling():c.nextSibling());return{start:a,matched:!1}}function At(n,e,t,r,i,s,o){if(t<0?!e:e==n.doc.length)return null;let l=t<0?n.sliceDoc(e-1,e):n.sliceDoc(e,e+1),a=o.indexOf(l);if(a<0||a%2==0!=t>0)return null;let f={from:t<0?e-1:e,to:t>0?e+1:e},c=n.doc.iterRange(e,t>0?n.doc.length:0),h=0;for(let p=0;!c.next().done&&p<=s;){let d=c.value;t<0&&(p+=d.length);let S=e+p*t;for(let T=t>0?0:d.length-1,Oe=t>0?d.length:-1;T!=Oe;T+=t){let U=o.indexOf(d[T]);if(!(U<0||r.resolveInner(S+T,1).type!=i))if(U%2==0==t>0)h++;else{if(h==1)return{start:f,end:{from:S+T,to:S+T+1},matched:U>>1==a>>1};h--}}t>0&&(p+=d.length)}return c.done?{start:f,matched:!1}:null}const Pt=Object.create(null),oe=[X.none],ae=[],le=Object.create(null),Dt=Object.create(null);for(let[n,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Dt[n]=It(Pt,e);function G(n,e){ae.indexOf(n)>-1||(ae.push(n),console.warn(e))}function It(n,e){let t=[];for(let l of e.split(" ")){let a=[];for(let f of l.split(".")){let c=n[f]||u[f];c?typeof c=="function"?a.length?a=a.map(c):G(f,`Modifier ${f} used at start of tag`):a.length?G(f,`Tag ${f} used as modifier`):a=Array.isArray(c)?c:[c]:G(f,`Unknown highlighting tag ${f}`)}for(let f of a)t.push(f)}if(!t.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+t.map(l=>l.id),s=le[i];if(s)return s.id;let o=le[i]=X.define({id:oe.length,name:r,props:[Fe({[r]:t})]});return oe.push(o),o.id}ee.RTL,ee.LTR;export{R as H,ge as I,Ft as L,N as P,Ut as a,zt as b,Je as c,jt as d,k as e,$t as f,Ke as g,Ve as h,Wt as i,me as j,V as k,Qe as l,B as m,Ht as n,it as o,Rt as p,rt as q,m as r,qt as s,$e as t,A as u,pe as v,Et as w,Lt as x,Tt as y,qe as z};
|
|
1
|
+
import{N as b,e as Be,c as C,h as Me,I as Z,f as M,P as Ne,a as X,t as u,s as Fe}from"./index-Bzq-v0Dg.js";import{RangeSetBuilder as fe,RangeSet as Ee,EditorState as I,countColumn as Le,Facet as y,StateField as ce,StateEffect as L,Prec as He,combineConfig as ue}from"./index-BHot-lnj.js";import{V as H,u as We,E as w,G as Re,D as g,S as _,q as Ue,W as he,o as ee}from"./index-891wE-Rj.js";var $;const A=new b;function $e(n){return y.define({combine:n?e=>e.concat(n):void 0})}const qe=new b;class m{constructor(e,t,r=[],i=""){this.data=e,this.name=i,I.prototype.hasOwnProperty("tree")||Object.defineProperty(I.prototype,"tree",{get(){return k(this)}}),this.parser=t,this.extension=[x.of(this),I.languageData.of((s,o,l)=>{let a=te(s,o,l),f=a.type.prop(A);if(!f)return[];let c=s.facet(f),h=a.type.prop(qe);if(h){let p=a.resolve(o-a.from,l);for(let d of h)if(d.test(p,s)){let S=s.facet(d.facet);return d.type=="replace"?S:S.concat(c)}}return c})].concat(r)}isActiveAt(e,t,r=-1){return te(e,t,r).type.prop(A)==this.data}findRegions(e){let t=e.facet(x);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let r=[],i=(s,o)=>{if(s.prop(A)==this.data){r.push({from:o,to:o+s.length});return}let l=s.prop(b.mounted);if(l){if(l.tree.prop(A)==this.data){if(l.overlay)for(let a of l.overlay)r.push({from:a.from+o,to:a.to+o});else r.push({from:o,to:o+s.length});return}else if(l.overlay){let a=r.length;if(i(l.tree,l.overlay[0].from+o),r.length>a)return}}for(let a=0;a<s.children.length;a++){let f=s.children[a];f instanceof C&&i(f,s.positions[a]+o)}};return i(k(e),0),r}get allowsNesting(){return!0}}m.setState=L.define();function te(n,e,t){let r=n.facet(x),i=k(n).topNode;if(!r||r.allowsNesting)for(let s=i;s;s=s.enter(e,t,Z.ExcludeBuffers|Z.EnterBracketed))s.type.isTop&&(i=s);return i}class V extends m{constructor(e,t,r){super(e,t,[],r),this.parser=t}static define(e){let t=$e(e.languageData);return new V(t,e.parser.configure({props:[A.add(r=>r.isTop?t:void 0)]}),e.name)}configure(e,t){return new V(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function k(n){let e=n.field(m.state,!1);return e?e.tree:C.empty}class je{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let r=this.cursorPos-this.string.length;return e<r||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-r,t-r)}}let D=null;class N{constructor(e,t,r=[],i,s,o,l,a){this.parser=e,this.state=t,this.fragments=r,this.tree=i,this.treeLen=s,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,r){return new N(e,t,[],C.empty,0,r,[],null)}startParse(){return this.parser.startParse(new je(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=C.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let i=this.parse.advance();if(i)if(this.fragments=this.withoutTempSkipped(M.addTree(i,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=i,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(M.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=D;D=this;try{return e()}finally{D=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=ne(e,t.from,t.to);return e}changes(e,t){let{fragments:r,tree:i,treeLen:s,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((f,c,h,p)=>a.push({fromA:f,toA:c,fromB:h,toB:p})),r=M.applyChanges(r,a),i=C.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let f of this.skipped){let c=e.mapPos(f.from,1),h=e.mapPos(f.to,-1);c<h&&l.push({from:c,to:h})}}}return new N(this.parser,t,r,i,s,o,l,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:i,to:s}=this.skipped[r];i<e.to&&s>e.from&&(this.fragments=ne(this.fragments,i,s),this.skipped.splice(r--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends Ne{createParse(t,r,i){let s=i[0].from,o=i[i.length-1].to;return{parsedPos:s,advance(){let a=D;if(a){for(let f of i)a.tempSkipped.push(f);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new C(X.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return D}}function ne(n,e,t){return M.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class P{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,r)||t.takeTree(),new P(t)}static init(e){let t=Math.min(3e3,e.doc.length),r=N.create(e.facet(x).parser,e,{from:0,to:t});return r.work(20,t)||r.takeTree(),new P(r)}}m.state=ce.define({create:P.init,update(n,e){for(let t of e.effects)if(t.is(m.setState))return t.value;return e.startState.facet(x)!=e.state.facet(x)?P.init(e.state):n.apply(e)}});let de=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(de=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const q=typeof navigator<"u"&&(!(($=navigator.scheduling)===null||$===void 0)&&$.isInputPending)?()=>navigator.scheduling.isInputPending():null,ze=H.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(m.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(m.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=de(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:i}}=this.view,s=r.field(m.state);if(s.tree==s.context.tree&&s.context.isDone(i+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!q?Math.max(25,e.timeRemaining()-5):1e9),l=s.context.treeLen<i&&r.doc.length>i+1e3,a=s.context.work(()=>q&&q()||Date.now()>o,i+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:m.setState.of(new P(s.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>Ue(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),x=y.define({combine(n){return n.length?n[0]:null},enables:n=>[m.state,ze,w.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class Ft{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}class pe{constructor(e,t,r,i,s,o=void 0){this.name=e,this.alias=t,this.extensions=r,this.filename=i,this.loadFunc=s,this.support=o,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:t,support:r}=e;if(!t){if(!r)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");t=()=>Promise.resolve(r)}return new pe(e.name,(e.alias||[]).concat(e.name).map(i=>i.toLowerCase()),e.extensions||[],e.filename,t,r)}static matchFilename(e,t){for(let i of e)if(i.filename&&i.filename.test(t))return i;let r=/\.([^.]+)$/.exec(t);if(r){for(let i of e)if(i.extensions.indexOf(r[1])>-1)return i}return null}static matchLanguageName(e,t,r=!0){t=t.toLowerCase();for(let i of e)if(i.alias.some(s=>s==t))return i;if(r)for(let i of e)for(let s of i.alias){let o=t.indexOf(s);if(o>-1&&(s.length>2||!/\w/.test(t[o-1])&&!/\w/.test(t[o+s.length])))return i}return null}}const Ge=y.define(),me=y.define({combine:n=>{if(!n.length)return" ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function Ve(n){let e=n.facet(me);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function Je(n,e){let t="",r=n.tabSize,i=n.facet(me)[0];if(i==" "){for(;e>=r;)t+=" ",e-=r;i=" "}for(let s=0;s<e;s++)t+=i;return t}function Ke(n,e){n instanceof I&&(n=new ge(n));for(let r of n.state.facet(Ge)){let i=r(n,e);if(i!==void 0)return i}let t=k(n.state);return t.length>=e?Xe(n,t,e):null}class ge{constructor(e,t={}){this.state=e,this.options=t,this.unit=Ve(e)}lineAt(e,t=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:s}=this.options;return i!=null&&i>=r.from&&i<=r.to?s&&i==e?{text:"",from:e}:(t<0?i<e:i<=e)?{text:r.text.slice(i-r.from),from:i}:{text:r.text.slice(0,i-r.from),from:r.from}:r}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:r,from:i}=this.lineAt(e,t);return r.slice(e-i,Math.min(r.length,e+100-i))}column(e,t=1){let{text:r,from:i}=this.lineAt(e,t),s=this.countColumn(r,e-i),o=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return o>-1&&(s+=o-this.countColumn(r,r.search(/\S|$/))),s}countColumn(e,t=e.length){return Le(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:r,from:i}=this.lineAt(e,t),s=this.options.overrideIndentation;if(s){let o=s(i);if(o>-1)return o}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Qe=new b;function Xe(n,e,t){let r=e.resolveStack(t),i=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(i!=r.node){let s=[];for(let o=i;o&&!(o.from<r.node.from||o.to>r.node.to||o.from==r.node.from&&o.type==r.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)r={node:s[o],next:r}}return ke(r,n,t)}function ke(n,e,t){for(let r=n;r;r=r.next){let i=Ze(r.node);if(i)return i(Y.create(e,t,r))}return 0}function Ye(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function Ze(n){let e=n.type.prop(Qe);if(e)return e;let t=n.firstChild,r;if(t&&(r=t.type.prop(b.closedBy))){let i=n.lastChild,s=i&&r.indexOf(i.name)>-1;return o=>be(o,!0,1,void 0,s&&!Ye(o)?i.from:void 0)}return n.parent==null?_e:null}function _e(){return 0}class Y extends ge{constructor(e,t,r){super(e.state,e.options),this.base=e,this.pos=t,this.context=r}get node(){return this.context.node}static create(e,t,r){return new Y(e,t,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(t.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(et(r,e))break;t=this.state.doc.lineAt(r.from)}return this.lineIndent(t.from)}continue(){return ke(this.context.next,this.base,this.pos)}}function et(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function tt(n){let e=n.node,t=e.childAfter(e.from),r=e.lastChild;if(!t)return null;let i=n.options.simulateBreak,s=n.state.doc.lineAt(t.from),o=i==null||i<=s.from?s.to:Math.min(s.to,i);for(let l=t.to;;){let a=e.childAfter(l);if(!a||a==r)return null;if(!a.type.isSkipped){if(a.from>=o)return null;let f=/^ */.exec(s.text.slice(t.to-s.from))[0].length;return{from:t.from,to:t.to+f}}l=a.to}}function Et({closing:n,align:e=!0,units:t=1}){return r=>be(r,e,t,n)}function be(n,e,t,r,i){let s=n.textAfter,o=s.match(/^\s*/)[0].length,l=r&&s.slice(o,o+r.length)==r||i==n.pos+o,a=e?tt(n):null;return a?l?n.column(a.from):n.column(a.to):n.baseIndent+(l?0:n.unit*t)}const Lt=n=>n.baseIndent;function Ht({except:n,units:e=1}={}){return t=>{let r=n&&n.test(t.textAfter);return t.baseIndent+(r?0:e*t.unit)}}const nt=200;function Wt(){return I.transactionFilter.of(n=>{if(!n.docChanged||!n.isUserEvent("input.type")&&!n.isUserEvent("input.complete"))return n;let e=n.startState.languageDataAt("indentOnInput",n.startState.selection.main.head);if(!e.length)return n;let t=n.newDoc,{head:r}=n.newSelection.main,i=t.lineAt(r);if(r>i.from+nt)return n;let s=t.sliceString(i.from,r);if(!e.some(f=>f.test(s)))return n;let{state:o}=n,l=-1,a=[];for(let{head:f}of o.selection.ranges){let c=o.doc.lineAt(f);if(c.from==l)continue;l=c.from;let h=Ke(o,c.from);if(h==null)continue;let p=/^\s*/.exec(c.text)[0],d=Je(o,h);p!=d&&a.push({from:c.from,to:c.from+p.length,insert:d})}return a.length?[n,{changes:a,sequential:!0}]:n})}const rt=y.define(),it=new b;function Rt(n){let e=n.firstChild,t=n.lastChild;return e&&e.to<t.from?{from:e.to,to:t.type.isError?n.to:t.from}:null}function st(n,e,t){let r=k(n);if(r.length<t)return null;let i=r.resolveStack(t,1),s=null;for(let o=i;o;o=o.next){let l=o.node;if(l.to<=t||l.from>t)continue;if(s&&l.from<e)break;let a=l.type.prop(it);if(a&&(l.to<r.length-50||r.length==n.doc.length||!ot(l))){let f=a(l,n);f&&f.from<=t&&f.from>=e&&f.to>t&&(s=f)}}return s}function ot(n){let e=n.lastChild;return e&&e.to==n.to&&e.type.isError}function F(n,e,t){for(let r of n.facet(rt)){let i=r(n,e,t);if(i)return i}return st(n,e,t)}function ye(n,e){let t=e.mapPos(n.from,1),r=e.mapPos(n.to,-1);return t>=r?void 0:{from:t,to:r}}const W=L.define({map:ye}),O=L.define({map:ye});function we(n){let e=[];for(let{head:t}of n.state.selection.ranges)e.some(r=>r.from<=t&&r.to>=t)||e.push(n.lineBlockAt(t));return e}const v=ce.define({create(){return g.none},update(n,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((r,i)=>n=re(n,r,i)),n=n.map(e.changes);let t=[];for(let r of e.effects)r.is(W)&&!at(n,r.value.from,r.value.to)?t.push(r.value):r.is(O)&&(n=n.update({filter:(i,s)=>r.value.from!=i||r.value.to!=s,filterFrom:r.value.from,filterTo:r.value.to}));if(t.length){let{preparePlaceholder:r}=e.state.facet(Se),i=t.map(s=>(r?g.replace({widget:new dt(r(e.state,s))}):ie).range(s.from,s.to));n=n.update({add:i})}return e.selection&&(n=re(n,e.selection.main.head)),n},provide:n=>w.decorations.from(n),toJSON(n,e){let t=[];return n.between(0,e.doc.length,(r,i)=>{t.push(r,i)}),t},fromJSON(n){if(!Array.isArray(n)||n.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t<n.length;){let r=n[t++],i=n[t++];if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid JSON for fold state");e.push(ie.range(r,i))}return g.set(e,!0)}});function re(n,e,t=e){let r=!1;return n.between(e,t,(i,s)=>{i<t&&s>e&&(r=!0)}),r?n.update({filterFrom:e,filterTo:t,filter:(i,s)=>i>=t||s<=e}):n}function E(n,e,t){var r;let i=null;return(r=n.field(v,!1))===null||r===void 0||r.between(e,t,(s,o)=>{(!i||i.from>s)&&(i={from:s,to:o})}),i}function at(n,e,t){let r=!1;return n.between(e,e,(i,s)=>{i==e&&s==t&&(r=!0)}),r}function xe(n,e){return n.field(v,!1)?e:e.concat(L.appendConfig.of(Te()))}const lt=n=>{for(let e of we(n)){let t=F(n.state,e.from,e.to);if(t)return n.dispatch({effects:xe(n.state,[W.of(t),ve(n,t)])}),!0}return!1},ft=n=>{if(!n.state.field(v,!1))return!1;let e=[];for(let t of we(n)){let r=E(n.state,t.from,t.to);r&&e.push(O.of(r),ve(n,r,!1))}return e.length&&n.dispatch({effects:e}),e.length>0};function ve(n,e,t=!0){let r=n.state.doc.lineAt(e.from).number,i=n.state.doc.lineAt(e.to).number;return w.announce.of(`${n.state.phrase(t?"Folded lines":"Unfolded lines")} ${r} ${n.state.phrase("to")} ${i}.`)}const ct=n=>{let{state:e}=n,t=[];for(let r=0;r<e.doc.length;){let i=n.lineBlockAt(r),s=F(e,i.from,i.to);s&&t.push(W.of(s)),r=(s?n.lineBlockAt(s.to):i).to+1}return t.length&&n.dispatch({effects:xe(n.state,t)}),!!t.length},ut=n=>{let e=n.state.field(v,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,n.state.doc.length,(r,i)=>{t.push(O.of({from:r,to:i}))}),n.dispatch({effects:t}),!0},Ut=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:lt},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:ft},{key:"Ctrl-Alt-[",run:ct},{key:"Ctrl-Alt-]",run:ut}],ht={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Se=y.define({combine(n){return ue(n,ht)}});function Te(n){return[v,mt]}function Ce(n,e){let{state:t}=n,r=t.facet(Se),i=o=>{let l=n.lineBlockAt(n.posAtDOM(o.target)),a=E(n.state,l.from,l.to);a&&n.dispatch({effects:O.of(a)}),o.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(n,i,e);let s=document.createElement("span");return s.textContent=r.placeholderText,s.setAttribute("aria-label",t.phrase("folded code")),s.title=t.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=i,s}const ie=g.replace({widget:new class extends he{toDOM(n){return Ce(n,null)}}});class dt extends he{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return Ce(e,this.value)}}const pt={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class j extends Re{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function $t(n={}){let e={...pt,...n},t=new j(e,!0),r=new j(e,!1),i=H.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(x)!=o.state.facet(x)||o.startState.field(v,!1)!=o.state.field(v,!1)||k(o.startState)!=k(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let l=new fe;for(let a of o.viewportLineBlocks){let f=E(o.state,a.from,a.to)?r:F(o.state,a.from,a.to)?t:null;f&&l.add(a.from,a.from,f)}return l.finish()}}),{domEventHandlers:s}=e;return[i,We({class:"cm-foldGutter",markers(o){var l;return((l=o.plugin(i))===null||l===void 0?void 0:l.markers)||Ee.empty},initialSpacer(){return new j(e,!1)},domEventHandlers:{...s,click:(o,l,a)=>{if(s.click&&s.click(o,l,a))return!0;let f=E(o.state,l.from,l.to);if(f)return o.dispatch({effects:O.of(f)}),!0;let c=F(o.state,l.from,l.to);return c?(o.dispatch({effects:W.of(c)}),!0):!1}}}),Te()]}const mt=w.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class R{constructor(e,t){this.specs=e;let r;function i(l){let a=_.newName();return(r||(r=Object.create(null)))["."+a]=l,a}const s=typeof t.all=="string"?t.all:t.all?i(t.all):void 0,o=t.scope;this.scope=o instanceof m?l=>l.prop(A)==o.data:o?l=>l==o:void 0,this.style=Be(e.map(l=>({tag:l.tag,class:l.class||i(Object.assign({},l,{tag:null}))})),{all:s}).style,this.module=r?new _(r):null,this.themeType=t.themeType}static define(e,t){return new R(e,t||{})}}const J=y.define(),Ae=y.define({combine(n){return n.length?[n[0]]:null}});function z(n){let e=n.facet(J);return e.length?e:n.facet(Ae)}function qt(n,e){let t=[kt],r;return n instanceof R&&(n.module&&t.push(w.styleModule.of(n.module)),r=n.themeType),e!=null&&e.fallback?t.push(Ae.of(n)):r?t.push(J.computeN([w.darkTheme],i=>i.facet(w.darkTheme)==(r=="dark")?[n]:[])):t.push(J.of(n)),t}class gt{constructor(e){this.markCache=Object.create(null),this.tree=k(e.state),this.decorations=this.buildDeco(e,z(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=k(e.state),r=z(e.state),i=r!=z(e.startState),{viewport:s}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length<s.to&&!i&&t.type==this.tree.type&&o>=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||i)&&(this.tree=t,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=s.to)}buildDeco(e,t){if(!t||!this.tree.length)return g.none;let r=new fe;for(let{from:i,to:s}of e.visibleRanges)Me(this.tree,t,(o,l,a)=>{r.add(o,l,this.markCache[a]||(this.markCache[a]=g.mark({class:a})))},i,s);return r.finish()}}const kt=He.high(H.fromClass(gt,{decorations:n=>n.decorations})),jt=R.define([{tag:u.meta,color:"#404740"},{tag:u.link,textDecoration:"underline"},{tag:u.heading,textDecoration:"underline",fontWeight:"bold"},{tag:u.emphasis,fontStyle:"italic"},{tag:u.strong,fontWeight:"bold"},{tag:u.strikethrough,textDecoration:"line-through"},{tag:u.keyword,color:"#708"},{tag:[u.atom,u.bool,u.url,u.contentSeparator,u.labelName],color:"#219"},{tag:[u.literal,u.inserted],color:"#164"},{tag:[u.string,u.deleted],color:"#a11"},{tag:[u.regexp,u.escape,u.special(u.string)],color:"#e40"},{tag:u.definition(u.variableName),color:"#00f"},{tag:u.local(u.variableName),color:"#30a"},{tag:[u.typeName,u.namespace],color:"#085"},{tag:u.className,color:"#167"},{tag:[u.special(u.variableName),u.macroName],color:"#256"},{tag:u.definition(u.propertyName),color:"#00c"},{tag:u.comment,color:"#940"},{tag:u.invalid,color:"#f00"}]),bt=w.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Pe=1e4,De="()[]{}",Ie=y.define({combine(n){return ue(n,{afterCursor:!0,brackets:De,maxScanDistance:Pe,renderMatch:xt})}}),yt=g.mark({class:"cm-matchingBracket"}),wt=g.mark({class:"cm-nonmatchingBracket"});function xt(n){let e=[],t=n.matched?yt:wt;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}function se(n){let e=[],t=n.facet(Ie);for(let r of n.selection.ranges){if(!r.empty)continue;let i=B(n,r.head,-1,t)||r.head>0&&B(n,r.head-1,1,t)||t.afterCursor&&(B(n,r.head,1,t)||r.head<n.doc.length&&B(n,r.head+1,-1,t));i&&(e=e.concat(t.renderMatch(i,n)))}return g.set(e,!0)}const vt=H.fromClass(class{constructor(n){this.paused=!1,this.decorations=se(n.state)}update(n){(n.docChanged||n.selectionSet||this.paused)&&(n.view.composing?(this.decorations=this.decorations.map(n.changes),this.paused=!0):(this.decorations=se(n.state),this.paused=!1))}},{decorations:n=>n.decorations}),St=[vt,bt];function zt(n={}){return[Ie.of(n),St]}const Tt=new b;function K(n,e,t){let r=n.prop(e<0?b.openedBy:b.closedBy);if(r)return r;if(n.name.length==1){let i=t.indexOf(n.name);if(i>-1&&i%2==(e<0?1:0))return[t[i+e]]}return null}function Q(n){let e=n.type.prop(Tt);return e?e(n.node):n}function B(n,e,t,r={}){let i=r.maxScanDistance||Pe,s=r.brackets||De,o=k(n),l=o.resolveInner(e,t);for(let a=l;a;a=a.parent){let f=K(a.type,t,s);if(f&&a.from<a.to){let c=Q(a);if(c&&(t>0?e>=c.from&&e<c.to:e>c.from&&e<=c.to))return Ct(n,e,t,a,c,f,s)}}return At(n,e,t,o,l.type,i,s)}function Ct(n,e,t,r,i,s,o){let l=r.parent,a={from:i.from,to:i.to},f=0,c=l==null?void 0:l.cursor();if(c&&(t<0?c.childBefore(r.from):c.childAfter(r.to)))do if(t<0?c.to<=r.from:c.from>=r.to){if(f==0&&s.indexOf(c.type.name)>-1&&c.from<c.to){let h=Q(c);return{start:a,end:h?{from:h.from,to:h.to}:void 0,matched:!0}}else if(K(c.type,t,o))f++;else if(K(c.type,-t,o)){if(f==0){let h=Q(c);return{start:a,end:h&&h.from<h.to?{from:h.from,to:h.to}:void 0,matched:!1}}f--}}while(t<0?c.prevSibling():c.nextSibling());return{start:a,matched:!1}}function At(n,e,t,r,i,s,o){if(t<0?!e:e==n.doc.length)return null;let l=t<0?n.sliceDoc(e-1,e):n.sliceDoc(e,e+1),a=o.indexOf(l);if(a<0||a%2==0!=t>0)return null;let f={from:t<0?e-1:e,to:t>0?e+1:e},c=n.doc.iterRange(e,t>0?n.doc.length:0),h=0;for(let p=0;!c.next().done&&p<=s;){let d=c.value;t<0&&(p+=d.length);let S=e+p*t;for(let T=t>0?0:d.length-1,Oe=t>0?d.length:-1;T!=Oe;T+=t){let U=o.indexOf(d[T]);if(!(U<0||r.resolveInner(S+T,1).type!=i))if(U%2==0==t>0)h++;else{if(h==1)return{start:f,end:{from:S+T,to:S+T+1},matched:U>>1==a>>1};h--}}t>0&&(p+=d.length)}return c.done?{start:f,matched:!1}:null}const Pt=Object.create(null),oe=[X.none],ae=[],le=Object.create(null),Dt=Object.create(null);for(let[n,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Dt[n]=It(Pt,e);function G(n,e){ae.indexOf(n)>-1||(ae.push(n),console.warn(e))}function It(n,e){let t=[];for(let l of e.split(" ")){let a=[];for(let f of l.split(".")){let c=n[f]||u[f];c?typeof c=="function"?a.length?a=a.map(c):G(f,`Modifier ${f} used at start of tag`):a.length?G(f,`Tag ${f} used as modifier`):a=Array.isArray(c)?c:[c]:G(f,`Unknown highlighting tag ${f}`)}for(let f of a)t.push(f)}if(!t.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+t.map(l=>l.id),s=le[i];if(s)return s.id;let o=le[i]=X.define({id:oe.length,name:r,props:[Fe({[r]:t})]});return oe.push(o),o.id}ee.RTL,ee.LTR;export{R as H,ge as I,Ft as L,N as P,Ut as a,zt as b,Je as c,jt as d,k as e,$t as f,Ke as g,Ve as h,Wt as i,me as j,V as k,Qe as l,B as m,Ht as n,it as o,Rt as p,rt as q,m as r,qt as s,$e as t,A as u,pe as v,Et as w,Lt as x,Tt as y,qe as z};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{g as Z,s as _e,E as M,V as me,D as x,a as ge,c as m,r as ze,b as Ne,h as Qe,W as Ve,l as Ge,d as je,e as pe,f as xe,i as Ue,j as Ye,k as Ze,m as Je,n as be}from"./index-891wE-Rj.js";import{StateEffect as W,EditorSelection as C,StateField as ye,Prec as Xe,codePointAt as et,fromCodePoint as tt,codePointSize as it,Facet as J,combineConfig as X,CharCategory as v,EditorState as ke,RangeSetBuilder as Se,findClusterBreak as ve}from"./index-BHot-lnj.js";import{f as nt,i as st,s as Ce,b as rt,a as lt,d as Me}from"./index-
|
|
1
|
+
import{g as Z,s as _e,E as M,V as me,D as x,a as ge,c as m,r as ze,b as Ne,h as Qe,W as Ve,l as Ge,d as je,e as pe,f as xe,i as Ue,j as Ye,k as Ze,m as Je,n as be}from"./index-891wE-Rj.js";import{StateEffect as W,EditorSelection as C,StateField as ye,Prec as Xe,codePointAt as et,fromCodePoint as tt,codePointSize as it,Facet as J,combineConfig as X,CharCategory as v,EditorState as ke,RangeSetBuilder as Se,findClusterBreak as ve}from"./index-BHot-lnj.js";import{f as nt,i as st,s as Ce,b as rt,a as lt,d as Me}from"./index-CYwf9t3p.js";import{history as we,defaultKeymap as Le,historyKeymap as Re}from"./index-CrX9ldma.js";import{c as ot,a as at,b as ct,d as ht}from"./index-BjCwOpLW.js";import"./index-Bzq-v0Dg.js";const oe=typeof String.prototype.normalize=="function"?i=>i.normalize("NFKD"):i=>i;class I{constructor(e,t,n=0,s=e.length,r,l){this.test=l,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,s),this.bufferStart=n,this.normalize=r?o=>r(oe(o)):oe,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 et(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=tt(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=it(e);let s=this.normalize(t);if(s.length)for(let r=0,l=n,o=!0;;r++){let a=s.charCodeAt(r),c=this.match(a,l,o,this.bufferPos+this.bufferStart,r==s.length-1);if(c)return this.value=c,this;if(r==s.length-1)break;o&&r<t.length&&t.charCodeAt(r)==a?l++:o=!1}}}match(e,t,n,s,r){let l=null;for(let o=0;o<this.matches.length;){let a=this.matches[o],c=!1;this.query.charCodeAt(a.index)==e&&(a.index==this.query.length-1?l={from:a.from,to:s,precise:r&&a.precise}:(a.index++,c=!0)),c?o++:this.matches.splice(o,1)}return this.query.charCodeAt(0)==e&&(this.query.length==1?l={from:t,to:s,precise:n&&r}:this.matches.push({from:t,index:1,precise:n})),l&&this.test&&!this.test(l.from,l.to,this.buffer,this.bufferStart)&&(l=null),l}}typeof Symbol<"u"&&(I.prototype[Symbol.iterator]=function(){return this});const Ae={from:-1,to:-1,match:/.*/.exec(""),precise:!0},ee="gm"+(/x/.unicode==null?"":"u");class We{constructor(e,t,n,s=0,r=e.length){if(this.text=e,this.to=r,this.curLine="",this.done=!1,this.value=Ae,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new De(e,t,n,s,r);this.re=new RegExp(t,ee+(n!=null&&n.ignoreCase?"i":"")),this.test=n==null?void 0:n.test,this.iter=e.iter();let l=e.lineAt(s);this.curLineStart=l.from,this.matchPos=z(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 n=this.curLineStart+t.index,s=n+t[0].length;if(this.matchPos=z(this.text,s+(n==s?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(n<s||n>this.value.to)&&(!this.test||this.test(n,s,t)))return this.value={from:n,to:s,precise:!0,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}const j=new WeakMap;class P{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,n){let s=j.get(e);if(!s||s.from>=n||s.to<=t){let o=new P(t,e.sliceString(t,n));return j.set(e,o),o}if(s.from==t&&s.to==n)return s;let{text:r,from:l}=s;return l>t&&(r=e.sliceString(t,l)+r,l=t),s.to<n&&(r+=e.sliceString(s.to,n)),j.set(e,new P(l,r)),new P(t,r.slice(t-l,n-l))}}class De{constructor(e,t,n,s,r){this.text=e,this.to=r,this.done=!1,this.value=Ae,this.matchPos=z(e,s),this.re=new RegExp(t,ee+(n!=null&&n.ignoreCase?"i":"")),this.test=n==null?void 0:n.test,this.flat=P.get(e,s,this.chunkEnd(s+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let n=this.flat.from+t.index,s=n+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,s,t)))return this.value={from:n,to:s,precise:!0,match:t},this.matchPos=z(this.text,s+(n==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=P.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(We.prototype[Symbol.iterator]=De.prototype[Symbol.iterator]=function(){return this});function ft(i){try{return new RegExp(i,ee),!0}catch{return!1}}function z(i,e){if(e>=i.length)return e;let t=i.lineAt(e),n;for(;e<t.to&&(n=t.text.charCodeAt(e-t.from))>=56320&&n<57344;)e++;return e}const ut=i=>{let{state:e}=i,t=String(e.doc.lineAt(i.state.selection.main.head).number),{close:n,result:s}=_e(i,{label:e.phrase("Go to line"),input:{type:"text",name:"line",value:t},focus:!0,submitLabel:e.phrase("go")});return s.then(r=>{let l=r&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(r.elements.line.value);if(!l){i.dispatch({effects:n});return}let o=e.doc.lineAt(e.selection.main.head),[,a,c,h,f]=l,p=h?+h.slice(1):0,u=c?+c:o.number;if(c&&f){let g=u/100;a&&(g=g*(a=="-"?-1:1)+o.number/e.doc.lines),u=Math.round(e.doc.lines*g)}else c&&a&&(u=u*(a=="-"?-1:1)+o.number);let y=e.doc.line(Math.max(1,Math.min(e.doc.lines,u))),b=C.cursor(y.from+Math.max(0,Math.min(p,y.length)));i.dispatch({effects:[n,M.scrollIntoView(b.from,{y:"center"})],selection:b})}),!0},dt={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},mt=J.define({combine(i){return X(i,dt,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function gt(i){return[kt,yt]}const pt=x.mark({class:"cm-selectionMatch"}),xt=x.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function ae(i,e,t,n){return(t==0||i(e.sliceDoc(t-1,t))!=v.Word)&&(n==e.doc.length||i(e.sliceDoc(n,n+1))!=v.Word)}function bt(i,e,t,n){return i(e.sliceDoc(t,t+1))==v.Word&&i(e.sliceDoc(n-1,n))==v.Word}const yt=me.fromClass(class{constructor(i){this.decorations=this.getDeco(i)}update(i){(i.selectionSet||i.docChanged||i.viewportChanged)&&(this.decorations=this.getDeco(i.view))}getDeco(i){let e=i.state.facet(mt),{state:t}=i,n=t.selection;if(n.ranges.length>1)return x.none;let s=n.main,r,l=null;if(s.empty){if(!e.highlightWordAroundCursor)return x.none;let a=t.wordAt(s.head);if(!a)return x.none;l=t.charCategorizer(s.head),r=t.sliceDoc(a.from,a.to)}else{let a=s.to-s.from;if(a<e.minSelectionLength||a>200)return x.none;if(e.wholeWords){if(r=t.sliceDoc(s.from,s.to),l=t.charCategorizer(s.head),!(ae(l,t,s.from,s.to)&&bt(l,t,s.from,s.to)))return x.none}else if(r=t.sliceDoc(s.from,s.to),!r)return x.none}let o=[];for(let a of i.visibleRanges){let c=new I(t.doc,r,a.from,a.to);for(;!c.next().done;){let{from:h,to:f}=c.value;if((!l||ae(l,t,h,f))&&(s.empty&&h<=s.from&&f>=s.to?o.push(xt.range(h,f)):(h>=s.to||f<=s.from)&&o.push(pt.range(h,f)),o.length>e.maxMatches))return x.none}}return x.set(o)}},{decorations:i=>i.decorations}),kt=M.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),St=({state:i,dispatch:e})=>{let{selection:t}=i,n=C.create(t.ranges.map(s=>i.wordAt(s.head)||C.cursor(s.head)),t.mainIndex);return n.eq(t)?!1:(e(i.update({selection:n})),!0)};function vt(i,e){let{main:t,ranges:n}=i.selection,s=i.wordAt(t.head),r=s&&s.from==t.from&&s.to==t.to;for(let l=!1,o=new I(i.doc,e,n[n.length-1].to);;)if(o.next(),o.done){if(l)return null;o=new I(i.doc,e,0,Math.max(0,n[n.length-1].from-1)),l=!0}else{if(l&&n.some(a=>a.from==o.value.from))continue;if(r){let a=i.wordAt(o.value.from);if(!a||a.from!=o.value.from||a.to!=o.value.to)continue}return o.value}}const Ct=({state:i,dispatch:e})=>{let{ranges:t}=i.selection;if(t.some(r=>r.from===r.to))return St({state:i,dispatch:e});let n=i.sliceDoc(t[0].from,t[0].to);if(i.selection.ranges.some(r=>i.sliceDoc(r.from,r.to)!=n))return!1;let s=vt(i,n);return s?(e(i.update({selection:i.selection.addRange(C.range(s.from,s.to),!1),effects:M.scrollIntoView(s.to)})),!0):!1},E=J.define({combine(i){return X(i,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new Ot(e),scrollToMatch:e=>M.scrollIntoView(e)})}});class Fe{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||ft(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,n)=>n=="n"?`
|
|
2
2
|
`:n=="r"?"\r":n=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new Wt(this):new Lt(this)}getCursor(e,t=0,n){let s=e.doc?e:ke.create({doc:e});return n==null&&(n=s.doc.length),this.regexp?F(this,s,t,n):D(this,s,t,n)}}class Pe{constructor(e){this.spec=e}}function Mt(i,e,t){return(n,s,r,l)=>{if(t&&!t(n,s,r,l))return!1;let o=n>=l&&s<=l+r.length?r.slice(n-l,s-l):e.doc.sliceString(n,s);return i(o,e,n,s)}}function D(i,e,t,n){let s;return i.wholeWord&&(s=wt(e.doc,e.charCategorizer(e.selection.main.head))),i.test&&(s=Mt(i.test,e,s)),new I(e.doc,i.unquoted,t,n,i.caseSensitive?void 0:r=>r.toLowerCase(),s)}function wt(i,e){return(t,n,s,r)=>((r>t||r+s.length<n)&&(r=Math.max(0,t-2),s=i.sliceString(r,Math.min(i.length,n+2))),(e(N(s,t-r))!=v.Word||e(Q(s,t-r))!=v.Word)&&(e(Q(s,n-r))!=v.Word||e(N(s,n-r))!=v.Word))}class Lt extends Pe{constructor(e){super(e)}nextMatch(e,t,n){let s=D(this.spec,e,n,e.doc.length).nextOverlapping();if(s.done){let r=Math.min(e.doc.length,t+this.spec.unquoted.length);s=D(this.spec,e,0,r).nextOverlapping()}return s.done||s.value.from==t&&s.value.to==n?null:s.value}prevMatchInRange(e,t,n){for(let s=n;;){let r=Math.max(t,s-1e4-this.spec.unquoted.length),l=D(this.spec,e,r,s),o=null;for(;!l.nextOverlapping().done;)o=l.value;if(o)return o;if(r==t)return null;s-=1e4}}prevMatch(e,t,n){let s=this.prevMatchInRange(e,0,t);return s||(s=this.prevMatchInRange(e,Math.max(0,n-this.spec.unquoted.length),e.doc.length)),s&&(s.from!=t||s.to!=n)?s:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let n=D(this.spec,e,0,e.doc.length),s=[];for(;!n.next().done;){if(s.length>=t)return null;s.push(n.value)}return s}highlight(e,t,n,s){let r=D(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}function Rt(i,e,t){return(n,s,r)=>(!t||t(n,s,r))&&i(r[0],e,n,s)}function F(i,e,t,n){let s;return i.wholeWord&&(s=At(e.charCategorizer(e.selection.main.head))),i.test&&(s=Rt(i.test,e,s)),new We(e.doc,i.search,{ignoreCase:!i.caseSensitive,test:s},t,n)}function N(i,e){return i.slice(ve(i,e,!1),e)}function Q(i,e){return i.slice(e,ve(i,e))}function At(i){return(e,t,n)=>!n[0].length||(i(N(n.input,n.index))!=v.Word||i(Q(n.input,n.index))!=v.Word)&&(i(Q(n.input,n.index+n[0].length))!=v.Word||i(N(n.input,n.index+n[0].length))!=v.Word)}class Wt extends Pe{nextMatch(e,t,n){let s=F(this.spec,e,n,e.doc.length).next();return s.done&&(s=F(this.spec,e,0,t).next()),s.done?null:s.value}prevMatchInRange(e,t,n){for(let s=1;;s++){let r=Math.max(t,n-s*1e4),l=F(this.spec,e,r,n),o=null;for(;!l.next().done;)o=l.value;if(o&&(r==t||o.from>r+10))return o;if(r==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if(n=="&")return e.match[0];if(n=="$")return"$";for(let s=n.length;s>0;s--){let r=+n.slice(0,s);if(r>0&&r<e.match.length)return e.match[r]+n.slice(s)}return t})}matchAll(e,t){let n=F(this.spec,e,0,e.doc.length),s=[];for(;!n.next().done;){if(s.length>=t)return null;s.push(n.value)}return s}highlight(e,t,n,s){let r=F(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}const q=W.define(),te=W.define(),L=ye.define({create(i){return new U(Y(i).create(),null)},update(i,e){for(let t of e.effects)t.is(q)?i=new U(t.value.create(),i.panel):t.is(te)&&(i=new U(i.query,t.value?ie:null));return i},provide:i=>ge.from(i,e=>e.panel)});class U{constructor(e,t){this.query=e,this.panel=t}}const Dt=x.mark({class:"cm-searchMatch"}),Ft=x.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Pt=me.fromClass(class{constructor(i){this.view=i,this.decorations=this.highlight(i.state.field(L))}update(i){let e=i.state.field(L);(e!=i.startState.field(L)||i.docChanged||i.selectionSet||i.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:i,panel:e}){if(!e||!i.spec.valid)return x.none;let{view:t}=this,n=new Se;for(let s=0,r=t.visibleRanges,l=r.length;s<l;s++){let{from:o,to:a}=r[s];for(;s<l-1&&a>r[s+1].from-500;)a=r[++s].to;i.highlight(t.state,o,a,(c,h)=>{let f=t.state.selection.ranges.some(p=>p.from==c&&p.to==h);n.add(c,h,f?Ft:Dt)})}return n.finish()}},{decorations:i=>i.decorations});function $(i){return e=>{let t=e.state.field(L,!1);return t&&t.query.spec.valid?i(e,t):qe(e)}}const V=$((i,{query:e})=>{let{to:t}=i.state.selection.main,n=e.nextMatch(i.state,t,t);if(!n)return!1;let s=C.single(n.from,n.to),r=i.state.facet(E);return i.dispatch({selection:s,effects:[ne(i,n),r.scrollToMatch(s.main,i)],userEvent:"select.search"}),Ee(i),!0}),G=$((i,{query:e})=>{let{state:t}=i,{from:n}=t.selection.main,s=e.prevMatch(t,n,n);if(!s)return!1;let r=C.single(s.from,s.to),l=i.state.facet(E);return i.dispatch({selection:r,effects:[ne(i,s),l.scrollToMatch(r.main,i)],userEvent:"select.search"}),Ee(i),!0}),It=$((i,{query:e})=>{let t=e.matchAll(i.state,1e3);return!t||!t.length?!1:(i.dispatch({selection:C.create(t.map(n=>C.range(n.from,n.to))),userEvent:"select.search.matches"}),!0)}),Et=({state:i,dispatch:e})=>{let t=i.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:n,to:s}=t.main,r=[],l=0;for(let o=new I(i.doc,i.sliceDoc(n,s));!o.next().done;){if(r.length>1e3)return!1;o.value.from==n&&(l=r.length),r.push(C.range(o.value.from,o.value.to))}return e(i.update({selection:C.create(r,l),userEvent:"select.search.matches"})),!0},ce=$((i,{query:e})=>{let{state:t}=i,{from:n,to:s}=t.selection.main;if(t.readOnly)return!1;let r=e.nextMatch(t,n,n);if(!r)return!1;let l=r,o=[],a,c,h=[];l.precise?l.from==n&&l.to==s&&(c=t.toText(e.getReplacement(l)),o.push({from:l.from,to:l.to,insert:c}),l=e.nextMatch(t,l.from,l.to),h.push(M.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(n).number)+"."))):l=e.nextMatch(t,l.from,l.to);let f=i.state.changes(o);return l&&(a=C.single(l.from,l.to).map(f),h.push(ne(i,l)),h.push(t.facet(E).scrollToMatch(a.main,i))),i.dispatch({changes:f,selection:a,effects:h,userEvent:"input.replace"}),!0}),qt=$((i,{query:e})=>{if(i.state.readOnly)return!1;let t=[];for(let s of e.matchAll(i.state,1e9)){let{from:r,to:l,precise:o}=s;o&&t.push({from:r,to:l,insert:e.getReplacement(s)})}if(!t.length)return!1;let n=i.state.phrase("replaced $ matches",t.length)+".";return i.dispatch({changes:t,effects:M.announce.of(n),userEvent:"input.replace.all"}),!0});function ie(i){return i.state.facet(E).createPanel(i)}function Y(i,e){var t,n,s,r,l;let o=i.selection.main,a=o.empty||o.to>o.from+100?"":i.sliceDoc(o.from,o.to);if(e&&!a)return e;let c=i.facet(E);return new Fe({search:((t=e==null?void 0:e.literal)!==null&&t!==void 0?t:c.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(n=e==null?void 0:e.caseSensitive)!==null&&n!==void 0?n:c.caseSensitive,literal:(s=e==null?void 0:e.literal)!==null&&s!==void 0?s:c.literal,regexp:(r=e==null?void 0:e.regexp)!==null&&r!==void 0?r:c.regexp,wholeWord:(l=e==null?void 0:e.wholeWord)!==null&&l!==void 0?l:c.wholeWord})}function Ie(i){let e=Z(i,ie);return e&&e.dom.querySelector("[main-field]")}function Ee(i){let e=Ie(i);e&&e==i.root.activeElement&&e.select()}const qe=i=>{let e=i.state.field(L,!1);if(e&&e.panel){let t=Ie(i);if(t&&t!=i.root.activeElement){let n=Y(i.state,e.query.spec);n.valid&&i.dispatch({effects:q.of(n)}),t.focus(),t.select()}}else i.dispatch({effects:[te.of(!0),e?q.of(Y(i.state,e.query.spec)):W.appendConfig.of(Bt)]});return!0},Te=i=>{let e=i.state.field(L,!1);if(!e||!e.panel)return!1;let t=Z(i,ie);return t&&t.dom.contains(i.root.activeElement)&&i.focus(),i.dispatch({effects:te.of(!1)}),!0},Tt=[{key:"Mod-f",run:qe,scope:"editor search-panel"},{key:"F3",run:V,shift:G,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:V,shift:G,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Te,scope:"editor search-panel"},{key:"Mod-Shift-l",run:Et},{key:"Mod-Alt-g",run:ut},{key:"Mod-d",run:Ct,preventDefault:!0}];class Ot{constructor(e){this.view=e;let t=this.query=e.state.field(L).query.spec;this.commit=this.commit.bind(this),this.searchField=m("input",{value:t.search,placeholder:k(e,"Find"),"aria-label":k(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=m("input",{value:t.replace,placeholder:k(e,"Replace"),"aria-label":k(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=m("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=m("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=m("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function n(s,r,l){return m("button",{class:"cm-button",name:s,onclick:r,type:"button"},l)}this.dom=m("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,n("next",()=>V(e),[k(e,"next")]),n("prev",()=>G(e),[k(e,"previous")]),n("select",()=>It(e),[k(e,"all")]),m("label",null,[this.caseField,k(e,"match case")]),m("label",null,[this.reField,k(e,"regexp")]),m("label",null,[this.wordField,k(e,"by word")]),...e.state.readOnly?[]:[m("br"),this.replaceField,n("replace",()=>ce(e),[k(e,"replace")]),n("replaceAll",()=>qt(e),[k(e,"replace all")])],m("button",{name:"close",onclick:()=>Te(e),"aria-label":k(e,"close"),type:"button"},["×"])])}commit(){let e=new Fe({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:q.of(e)}))}keydown(e){ze(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?G:V)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),ce(this.view))}update(e){for(let t of e.transactions)for(let n of t.effects)n.is(q)&&!n.value.eq(this.query)&&this.setQuery(n.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(E).top}}function k(i,e){return i.state.phrase(e)}const K=30,H=/[\s\.,:;?!]/;function ne(i,{from:e,to:t}){let n=i.state.doc.lineAt(e),s=i.state.doc.lineAt(t).to,r=Math.max(n.from,e-K),l=Math.min(s,t+K),o=i.state.sliceDoc(r,l);if(r!=n.from){for(let a=0;a<K;a++)if(!H.test(o[a+1])&&H.test(o[a])){o=o.slice(a);break}}if(l!=s){for(let a=o.length-1;a>o.length-K;a--)if(!H.test(o[a-1])&&H.test(o[a])){o=o.slice(0,a);break}}return M.announce.of(`${i.state.phrase("current match")}. ${o} ${i.state.phrase("on line")} ${n.number}.`)}const $t=M.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),Bt=[L,Xe.low(Pt),$t];class he{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}}class A{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let s=n.facet(T).markerFilter;s&&(e=s(e,n));let r=e.slice().sort((u,y)=>u.from-y.from||u.to-y.to),l=new Se,o=[],a=0,c=n.doc.iter(),h=0,f=n.doc.length;for(let u=0;;){let y=u==r.length?null:r[u];if(!y&&!o.length)break;let b,g;if(o.length)b=a,g=o.reduce((d,w)=>Math.min(d,w.to),y&&y.from>b?y.from:1e8);else{if(b=y.from,b>f)break;g=y.to,o.push(y),u++}for(;u<r.length;){let d=r[u];if(d.from==b&&(d.to>d.from||d.to==b))o.push(d),u++,g=Math.min(d.to,g);else{g=Math.min(d.from,g);break}}g=Math.min(g,f);let B=!1;if(o.some(d=>d.from==b&&(d.to==g||g==f))&&(B=b==g,!B&&g-b<10)){let d=b-(h+c.value.length);d>0&&(c.next(d),h=b);for(let w=b;;){if(w>=g){B=!0;break}if(!c.lineBreak&&h+c.value.length>w)break;w=h+c.value.length,h+=c.value.length,c.next()}}let re=Jt(o);if(B)l.add(b,b,x.widget({widget:new jt(re),diagnostics:o.slice()}));else{let d=o.reduce((w,le)=>le.markClass?w+" "+le.markClass:w,"");l.add(b,g,x.mark({class:"cm-lintRange cm-lintRange-"+re+d,diagnostics:o.slice(),inclusiveEnd:o.some(w=>w.to>g)}))}if(a=g,a==f)break;for(let d=0;d<o.length;d++)o[d].to<=a&&o.splice(d--,1)}let p=l.finish();return new A(p,t,R(p))}}function R(i,e=null,t=0){let n=null;return i.between(t,1e9,(s,r,{spec:l})=>{if(!(e&&l.diagnostics.indexOf(e)<0))if(!n)n=new he(s,r,e||l.diagnostics[0]);else{if(l.diagnostics.indexOf(n.diagnostic)<0)return!1;n=new he(n.from,r,n.diagnostic)}}),n}function Kt(i,e){let t=e.pos,n=e.end||t,s=i.state.facet(T).hideOn(i,t,n);if(s!=null)return s;let r=i.startState.doc.lineAt(e.pos);return!!(i.effects.some(l=>l.is(Oe))||i.changes.touchesRange(r.from,Math.max(r.to,n)))}function Ht(i,e){return i.field(S,!1)?e:e.concat(W.appendConfig.of(Xt))}const Oe=W.define(),se=W.define(),$e=W.define(),S=ye.define({create(){return new A(x.none,null,null)},update(i,e){if(e.docChanged&&i.diagnostics.size){let t=i.diagnostics.map(e.changes),n=null,s=i.panel;if(i.selected){let r=e.changes.mapPos(i.selected.from,1);n=R(t,i.selected.diagnostic,r)||R(t,null,r)}!t.size&&s&&e.state.facet(T).autoPanel&&(s=null),i=new A(t,s,n)}for(let t of e.effects)if(t.is(Oe)){let n=e.state.facet(T).autoPanel?t.value.length?O.open:null:i.panel;i=A.init(t.value,n,e.state)}else t.is(se)?i=new A(i.diagnostics,t.value?O.open:null,i.selected):t.is($e)&&(i=new A(i.diagnostics,i.panel,t.value));return i},provide:i=>[ge.from(i,e=>e.panel),M.decorations.from(i,e=>e.diagnostics)]}),_t=x.mark({class:"cm-lintRange cm-lintRange-active"});function zt(i,e,t){let{diagnostics:n}=i.state.field(S),s,r=-1,l=-1;n.between(e-(t<0?1:0),e+(t>0?1:0),(a,c,{spec:h})=>{if(e>=a&&e<=c&&(a==c||(e>a||t>0)&&(e<c||t<0)))return s=h.diagnostics,r=a,l=c,!1});let o=i.state.facet(T).tooltipFilter;return s&&o&&(s=o(s,i.state)),s?{pos:r,end:l,above:!0,create(){return{dom:Nt(i,s)}}}:null}function Nt(i,e){return m("ul",{class:"cm-tooltip-lint"},e.map(t=>Ke(i,t,!1)))}const Qt=i=>{let e=i.state.field(S,!1);(!e||!e.panel)&&i.dispatch({effects:Ht(i.state,[se.of(!0)])});let t=Z(i,O.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},fe=i=>{let e=i.state.field(S,!1);return!e||!e.panel?!1:(i.dispatch({effects:se.of(!1)}),!0)},Vt=i=>{let e=i.state.field(S,!1);if(!e)return!1;let t=i.state.selection.main,n=R(e.diagnostics,null,t.to+1);return!n&&(n=R(e.diagnostics,null,0),!n||n.from==t.from&&n.to==t.to)?!1:(i.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0}),Ne(i,n.from,1,{tooltip:He,until:s=>s.docChanged||s.newSelection.main.head<n.from||s.newSelection.main.head>n.to}),!0)},Gt=[{key:"Mod-Shift-m",run:Qt,preventDefault:!0},{key:"F8",run:Vt}],T=J.define({combine(i){return{sources:i.map(e=>e.source).filter(e=>e!=null),...X(i.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:ue,tooltipFilter:ue,needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t,hideOn:(e,t)=>e?t?(n,s,r)=>e(n,s,r)||t(n,s,r):e:t,autoPanel:(e,t)=>e||t})}}});function ue(i,e){return i?e?(t,n)=>e(i(t,n),n):i:e}function Be(i){let e=[];if(i)e:for(let{name:t}of i){for(let n=0;n<t.length;n++){let s=t[n];if(/[a-zA-Z]/.test(s)&&!e.some(r=>r.toLowerCase()==s.toLowerCase())){e.push(s);continue e}}e.push("")}return e}function Ke(i,e,t){var n;let s=t?Be(e.actions):[];return m("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},m("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(i):e.message),(n=e.actions)===null||n===void 0?void 0:n.map((r,l)=>{let o=!1,a=u=>{if(u.preventDefault(),o)return;o=!0;let y=R(i.state.field(S).diagnostics,e);y&&r.apply(i,y.from,y.to)},{name:c}=r,h=s[l]?c.indexOf(s[l]):-1,f=h<0?c:[c.slice(0,h),m("u",c.slice(h,h+1)),c.slice(h+1)],p=r.markClass?" "+r.markClass:"";return m("button",{type:"button",class:"cm-diagnosticAction"+p,onclick:a,onmousedown:a,"aria-label":` Action: ${c}${h<0?"":` (access key "${s[l]})"`}.`},f)}),e.source&&m("div",{class:"cm-diagnosticSource"},e.source))}class jt extends Ve{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return m("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}}class de{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=Ke(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class O{constructor(e){this.view=e,this.items=[];let t=s=>{if(!(s.ctrlKey||s.altKey||s.metaKey)){if(s.keyCode==27)fe(this.view),this.view.focus();else if(s.keyCode==38||s.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(s.keyCode==40||s.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(s.keyCode==36)this.moveSelection(0);else if(s.keyCode==35)this.moveSelection(this.items.length-1);else if(s.keyCode==13)this.view.focus();else if(s.keyCode>=65&&s.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:r}=this.items[this.selectedIndex],l=Be(r.actions);for(let o=0;o<l.length;o++)if(l[o].toUpperCase().charCodeAt(0)==s.keyCode){let a=R(this.view.state.field(S).diagnostics,r);a&&r.actions[o].apply(e,a.from,a.to)}}else return;s.preventDefault()}},n=s=>{for(let r=0;r<this.items.length;r++)this.items[r].dom.contains(s.target)&&this.moveSelection(r)};this.list=m("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t,onclick:n}),this.dom=m("div",{class:"cm-panel-lint"},this.list,m("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>fe(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(S).selected;if(!e)return-1;for(let t=0;t<this.items.length;t++)if(this.items[t].diagnostic==e.diagnostic)return t;return-1}update(){let{diagnostics:e,selected:t}=this.view.state.field(S),n=0,s=!1,r=null,l=new Set;for(e.between(0,this.view.state.doc.length,(o,a,{spec:c})=>{for(let h of c.diagnostics){if(l.has(h))continue;l.add(h);let f=-1,p;for(let u=n;u<this.items.length;u++)if(this.items[u].diagnostic==h){f=u;break}f<0?(p=new de(this.view,h),this.items.splice(n,0,p),s=!0):(p=this.items[f],f>n&&(this.items.splice(n,f-n),s=!0)),t&&p.diagnostic==t.diagnostic?p.dom.hasAttribute("aria-selected")||(p.dom.setAttribute("aria-selected","true"),r=p):p.dom.hasAttribute("aria-selected")&&p.dom.removeAttribute("aria-selected"),n++}});n<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)s=!0,this.items.pop();this.items.length==0&&(this.items.push(new de(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),s=!0),r?(this.list.setAttribute("aria-activedescendant",r.id),this.view.requestMeasure({key:this,read:()=>({sel:r.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:o,panel:a})=>{let c=a.height/this.list.offsetHeight;o.top<a.top?this.list.scrollTop-=(a.top-o.top)/c:o.bottom>a.bottom&&(this.list.scrollTop+=(o.bottom-a.bottom)/c)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),s&&this.sync()}sync(){let e=this.list.firstChild;function t(){let n=e;e=n.nextSibling,n.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(S),n=R(t.diagnostics,this.items[e].diagnostic);n&&this.view.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0,effects:$e.of(n)})}static open(e){return new O(e)}}function Ut(i,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${e}>${encodeURIComponent(i)}</svg>')`}function _(i){return Ut(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${i}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const Yt=M.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:_("#f11")},".cm-lintRange-warning":{backgroundImage:_("orange")},".cm-lintRange-info":{backgroundImage:_("#999")},".cm-lintRange-hint":{backgroundImage:_("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}},"&dark .cm-lintRange-active":{backgroundColor:"#86714a80"},"&dark .cm-panel.cm-panel-lint ul":{"& [aria-selected]":{backgroundColor:"#2e343e"}}});function Zt(i){return i=="error"?4:i=="warning"?3:i=="info"?2:1}function Jt(i){let e="hint",t=1;for(let n of i){let s=Zt(n.severity);s>t&&(t=s,e=n.severity)}return e}const He=Qe(zt,{hideOn:Kt}),Xt=[S,M.decorations.compute([S],i=>{let{selected:e,panel:t}=i.field(S);return!e||!t||e.from==e.to?x.none:x.set([_t.range(e.from,e.to)])}),He,Yt],li=[Ge(),je(),pe(),we(),nt(),xe(),Ue(),ke.allowMultipleSelections.of(!0),st(),Ce(Me,{fallback:!0}),rt(),ot(),at(),Ye(),Ze(),Je(),gt(),be.of([...ct,...Le,...Tt,...Re,...lt,...ht,...Gt])],oi=[pe(),we(),xe(),Ce(Me,{fallback:!0}),be.of([...Le,...Re])];export{M as EditorView,li as basicSetup,oi as minimalSetup};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{L as be,E as $,C as he}from"./index-DRMnPfA3.js";import{p as Te,s as Pe,t as b}from"./index-DFJbTCVa.js";import{cssLanguage as K,css as xe}from"./index-BxcnR7Nj.js";import{typescriptLanguage as Ve,jsxLanguage as ye,tsxLanguage as we,javascriptLanguage as M,javascript as ve}from"./index-BybHqs37.js";import{E as Xe}from"./index-891wE-Rj.js";import{EditorSelection as $e}from"./index-BHot-lnj.js";import{L as _e,k as qe,l as ke,o as Ce,y as Qe,e as J}from"./index-C2nhZ-ID.js";import"./index-Bm6PUpXb.js";const Ae=55,Ye=1,Me=56,Re=2,Ee=57,Ze=3,z=4,Be=5,R=6,ee=7,te=8,ae=9,le=10,ze=11,De=12,We=13,_=58,Ne=14,Ge=15,D=59,re=21,Ie=23,ne=24,je=25,A=27,se=28,Ue=29,Le=32,Fe=35,He=37,Ke=38,Je=0,et=1,tt={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},at={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},W={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function lt(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}let N=null,G=null,I=0;function Y(e,a){let r=e.pos+a;if(I==r&&G==e)return N;let l=e.peek(a),t="";for(;lt(l);)t+=String.fromCharCode(l),l=e.peek(++a);return G=e,I=r,N=t?t.toLowerCase():l==rt||l==nt?void 0:null}const oe=60,X=62,E=47,rt=63,nt=33,st=45;function j(e,a){this.name=e,this.parent=a}const ot=[R,le,ee,te,ae],it=new he({start:null,shift(e,a,r,l){return ot.indexOf(a)>-1?new j(Y(l,1)||"",e):e},reduce(e,a){return a==re&&e?e.parent:e},reuse(e,a,r,l){let t=a.type.id;return t==R||t==He?new j(Y(l,1)||"",e):e},strict:!1}),ut=new $((e,a)=>{if(e.next!=oe){e.next<0&&a.context&&e.acceptToken(_);return}e.advance();let r=e.next==E;r&&e.advance();let l=Y(e,0);if(l===void 0)return;if(!l)return e.acceptToken(r?Ge:Ne);let t=a.context?a.context.name:null;if(r){if(l==t)return e.acceptToken(ze);if(t&&at[t])return e.acceptToken(_,-2);if(a.dialectEnabled(Je))return e.acceptToken(De);for(let s=a.context;s;s=s.parent)if(s.name==l)return;e.acceptToken(We)}else{if(l=="script")return e.acceptToken(ee);if(l=="style")return e.acceptToken(te);if(l=="textarea")return e.acceptToken(ae);if(tt.hasOwnProperty(l))return e.acceptToken(le);t&&W[t]&&W[t][l]?e.acceptToken(_,-1):e.acceptToken(R)}},{contextual:!0}),Ot=new $(e=>{for(let a=0,r=0;;r++){if(e.next<0){r&&e.acceptToken(D);break}if(e.next==st)a++;else if(e.next==X&&a>=2){r>=3&&e.acceptToken(D,-2);break}else a=0;e.advance()}});function dt(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const ct=new $((e,a)=>{if(e.next==E&&e.peek(1)==X){let r=a.dialectEnabled(et)||dt(a.context);e.acceptToken(r?Be:z,2)}else e.next==X&&e.acceptToken(z,1)});function Z(e,a,r){let l=2+e.length;return new $(t=>{for(let s=0,o=0,i=0;;i++){if(t.next<0){i&&t.acceptToken(a);break}if(s==0&&t.next==oe||s==1&&t.next==E||s>=2&&s<l&&t.next==e.charCodeAt(s-2))s++,o++;else if(s==l&&t.next==X){i>o?t.acceptToken(a,-o):t.acceptToken(r,-(o-2));break}else if((t.next==10||t.next==13)&&i){t.acceptToken(a,1);break}else s=o=0;t.advance()}})}const pt=Z("script",Ae,Ye),mt=Z("style",Me,Re),ft=Z("textarea",Ee,Ze),gt=Pe({"Text RawText IncompleteTag IncompleteCloseTag":b.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":b.angleBracket,TagName:b.tagName,"MismatchedCloseTag/TagName":[b.tagName,b.invalid],AttributeName:b.attributeName,"AttributeValue UnquotedAttributeValue":b.attributeValue,Is:b.definitionOperator,"EntityReference CharacterReference":b.character,Comment:b.blockComment,ProcessingInst:b.processingInstruction,DoctypeDecl:b.documentMeta}),St=be.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G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og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:it,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[gt],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,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6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[pt,mt,ft,ct,ut,Ot,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function ie(e,a){let r=Object.create(null);for(let l of e.getChildren(ne)){let t=l.getChild(je),s=l.getChild(A)||l.getChild(se);t&&(r[a.read(t.from,t.to)]=s?s.type.id==A?a.read(s.from+1,s.to-1):a.read(s.from,s.to):"")}return r}function U(e,a){let r=e.getChild(Ie);return r?a.read(r.from,r.to):" "}function q(e,a,r){let l;for(let t of r)if(!t.attrs||t.attrs(l||(l=ie(e.node.parent.firstChild,a))))return{parser:t.parser,bracketed:!0};return null}function ue(e=[],a=[]){let r=[],l=[],t=[],s=[];for(let i of e)(i.tag=="script"?r:i.tag=="style"?l:i.tag=="textarea"?t:s).push(i);let o=a.length?Object.create(null):null;for(let i of a)(o[i.name]||(o[i.name]=[])).push(i);return Te((i,u)=>{let f=i.type.id;if(f==Ue)return q(i,u,r);if(f==Le)return q(i,u,l);if(f==Fe)return q(i,u,t);if(f==re&&s.length){let p=i.node,d=p.firstChild,m=d&&U(d,u),O;if(m){for(let c of s)if(c.tag==m&&(!c.attrs||c.attrs(O||(O=ie(d,u))))){let S=p.lastChild,h=S.type.id==Ke?S.from:p.to;if(h>d.to)return{parser:c.parser,overlay:[{from:d.to,to:h}]}}}}if(o&&f==ne){let p=i.node,d;if(d=p.firstChild){let m=o[u.read(d.from,d.to)];if(m)for(let O of m){if(O.tagName&&O.tagName!=U(p.parent,u))continue;let c=p.lastChild;if(c.type.id==A){let S=c.from+1,h=c.lastChild,T=c.to-(h&&h.isError?0:1);if(T>S)return{parser:O.parser,overlay:[{from:S,to:T}],bracketed:!0}}else if(c.type.id==se)return{parser:O.parser,overlay:[{from:c.from,to:c.to}]}}}}return null})}const V=["_blank","_self","_top","_parent"],k=["ascii","utf-8","utf-16","latin1","latin1"],C=["get","post","put","delete"],Q=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],g=["true","false"],n={},bt={a:{attrs:{href:null,ping:null,type:null,media:null,target:V,hreflang:null}},abbr:n,address:n,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:n,aside:n,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:n,base:{attrs:{href:null,target:V}},bdi:n,bdo:n,blockquote:{attrs:{cite:null}},body:n,br:n,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:Q,formmethod:C,formnovalidate:["novalidate"],formtarget:V,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:n,center:n,cite:n,code:n,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:n,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:n,div:n,dl:n,dt:n,em:n,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:n,figure:n,footer:n,form:{attrs:{action:null,name:null,"accept-charset":k,autocomplete:["on","off"],enctype:Q,method:C,novalidate:["novalidate"],target:V}},h1:n,h2:n,h3:n,h4:n,h5:n,h6:n,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:n,hgroup:n,hr:n,html:{attrs:{manifest:null}},i:n,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:Q,formmethod:C,formnovalidate:["novalidate"],formtarget:V,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:n,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:n,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:n,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:k,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:n,noscript:n,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:n,param:{attrs:{name:null,value:null}},pre:n,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:n,rt:n,ruby:n,samp:n,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:k}},section:n,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:n,source:{attrs:{src:null,type:null,media:null}},span:n,strong:n,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:n,summary:n,sup:n,table:n,tbody:n,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:n,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:n,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:n,time:{attrs:{datetime:null}},title:n,tr:n,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:n,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:n},Oe={accesskey:null,class:null,contenteditable:g,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:g,autocorrect:g,autocapitalize:g,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":g,"aria-autocomplete":["inline","list","both","none"],"aria-busy":g,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":g,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":g,"aria-hidden":g,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":g,"aria-multiselectable":g,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":g,"aria-relevant":null,"aria-required":g,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},de="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(e=>"on"+e);for(let e of de)Oe[e]=null;class y{constructor(a,r){this.tags={...bt,...a},this.globalAttrs={...Oe,...r},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}y.default=new y;function P(e,a,r=e.length){if(!a)return"";let l=a.firstChild,t=l&&l.getChild("TagName");return t?e.sliceString(t.from,Math.min(t.to,r)):""}function x(e,a=!1){for(;e;e=e.parent)if(e.name=="Element")if(a)a=!1;else return e;return null}function ce(e,a,r){let l=r.tags[P(e,x(a))];return(l==null?void 0:l.children)||r.allTags}function B(e,a){let r=[];for(let l=x(a);l&&!l.type.isTop;l=x(l.parent)){let t=P(e,l);if(t&&l.lastChild.name=="CloseTag")break;t&&r.indexOf(t)<0&&(a.name=="EndTag"||a.from>=l.firstChild.to)&&r.push(t)}return r}const pe=/^[:\-\.\w\u00b7-\uffff]*$/;function L(e,a,r,l,t){let s=/\s*>/.test(e.sliceDoc(t,t+5))?"":">",o=x(r,r.name=="StartTag"||r.name=="TagName");return{from:l,to:t,options:ce(e.doc,o,a).map(i=>({label:i,type:"type"})).concat(B(e.doc,r).map((i,u)=>({label:"/"+i,apply:"/"+i+s,type:"type",boost:99-u}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function F(e,a,r,l){let t=/\s*>/.test(e.sliceDoc(l,l+5))?"":">";return{from:r,to:l,options:B(e.doc,a).map((s,o)=>({label:s,apply:s+t,type:"type",boost:99-o})),validFor:pe}}function ht(e,a,r,l){let t=[],s=0;for(let o of ce(e.doc,r,a))t.push({label:"<"+o,type:"type"});for(let o of B(e.doc,r))t.push({label:"</"+o+">",type:"type",boost:99-s++});return{from:l,to:l,options:t,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Tt(e,a,r,l,t){let s=x(r),o=s?a.tags[P(e.doc,s)]:null,i=o&&o.attrs?Object.keys(o.attrs):[],u=o&&o.globalAttrs===!1?i:i.length?i.concat(a.globalAttrNames):a.globalAttrNames;return{from:l,to:t,options:u.map(f=>({label:f,type:"property"})),validFor:pe}}function Pt(e,a,r,l,t){var s;let o=(s=r.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),i=[],u;if(o){let f=e.sliceDoc(o.from,o.to),p=a.globalAttrs[f];if(!p){let d=x(r),m=d?a.tags[P(e.doc,d)]:null;p=(m==null?void 0:m.attrs)&&m.attrs[f]}if(p){let d=e.sliceDoc(l,t).toLowerCase(),m='"',O='"';/^['"]/.test(d)?(u=d[0]=='"'?/^[^"]*$/:/^[^']*$/,m="",O=e.sliceDoc(t,t+1)==d[0]?"":d[0],d=d.slice(1),l++):u=/^[^\s<>='"]*$/;for(let c of p)i.push({label:c,apply:m+c+O,type:"constant"})}}return{from:l,to:t,options:i,validFor:u}}function me(e,a){let{state:r,pos:l}=a,t=J(r).resolveInner(l,-1),s=t.resolve(l);for(let o=l,i;s==t&&(i=t.childBefore(o));){let u=i.lastChild;if(!u||!u.type.isError||u.from<u.to)break;s=t=i,o=u.from}return t.name=="TagName"?t.parent&&/CloseTag$/.test(t.parent.name)?F(r,t,t.from,l):L(r,e,t,t.from,l):t.name=="StartTag"||t.name=="IncompleteTag"?L(r,e,t,l,l):t.name=="StartCloseTag"||t.name=="IncompleteCloseTag"?F(r,t,l,l):t.name=="OpenTag"||t.name=="SelfClosingTag"||t.name=="AttributeName"?Tt(r,e,t,t.name=="AttributeName"?t.from:l,l):t.name=="Is"||t.name=="AttributeValue"||t.name=="UnquotedAttributeValue"?Pt(r,e,t,t.name=="Is"?l:t.from,l):a.explicit&&(s.name=="Element"||s.name=="Text"||s.name=="Document")?ht(r,e,t,l):null}function Qt(e){return me(y.default,e)}function xt(e){let{extraTags:a,extraGlobalAttributes:r}=e,l=r||a?new y(a,r):y.default;return t=>me(l,t)}const Vt=M.parser.configure({top:"SingleExpression"}),fe=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:Ve.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:ye.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:we.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:Vt},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:M.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:K.parser}],ge=[{name:"style",parser:K.parser.configure({top:"Styles"})}].concat(de.map(e=>({name:e,parser:M.parser}))),Se=qe.define({name:"html",parser:St.configure({props:[ke.add({Element(e){let a=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+a[0].length?e.continue():e.lineIndent(e.node.from)+(a[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].length<e.node.to)return e.continue();let a=null,r;for(let l=e.node;;){let t=l.lastChild;if(!t||t.name!="Element"||t.to!=l.to)break;a=l=t}return a&&!((r=a.lastChild)&&(r.name=="CloseTag"||r.name=="SelfClosingTag"))?e.lineIndent(a.from)+e.unit:null}}),Ce.add({Element(e){let a=e.firstChild,r=e.lastChild;return!a||a.name!="OpenTag"?null:{from:a.to,to:r.name=="CloseTag"?r.from:e.to}}}),Qe.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),v=Se.configure({wrap:ue(fe,ge)});function At(e={}){let a="",r;e.matchClosingTags===!1&&(a="noMatch"),e.selfClosingTags===!0&&(a=(a?a+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(r=ue((e.nestedLanguages||[]).concat(fe),(e.nestedAttributes||[]).concat(ge)));let l=r?Se.configure({wrap:r,dialect:a}):a?v.configure({dialect:a}):v;return new _e(l,[v.data.of({autocomplete:xt(e)}),e.autoCloseTags!==!1?yt:[],ve().support,xe().support])}const H=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),yt=Xe.inputHandler.of((e,a,r,l,t)=>{if(e.composing||e.state.readOnly||a!=r||l!=">"&&l!="/"||!v.isActiveAt(e.state,a,-1))return!1;let s=t(),{state:o}=s,i=o.changeByRange(u=>{var f,p,d;let m=o.doc.sliceString(u.from-1,u.to)==l,{head:O}=u,c=J(o).resolveInner(O,-1),S;if(m&&l==">"&&c.name=="EndTag"){let h=c.parent;if(((p=(f=h.parent)===null||f===void 0?void 0:f.lastChild)===null||p===void 0?void 0:p.name)!="CloseTag"&&(S=P(o.doc,h.parent,O))&&!H.has(S)){let T=O+(o.doc.sliceString(O,O+1)===">"?1:0),w=`</${S}>`;return{range:u,changes:{from:O,to:T,insert:w}}}}else if(m&&l=="/"&&c.name=="IncompleteCloseTag"){let h=c.parent;if(c.from==O-2&&((d=h.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(S=P(o.doc,h,O))&&!H.has(S)){let T=O+(o.doc.sliceString(O,O+1)===">"?1:0),w=`${S}>`;return{range:$e.cursor(O+w.length,-1),changes:{from:O,to:T,insert:w}}}}return{range:u}});return i.changes.empty?!1:(e.dispatch([s,o.update(i,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});export{yt as autoCloseTags,At as html,Qt as htmlCompletionSource,xt as htmlCompletionSourceWith,v as htmlLanguage};
|
|
1
|
+
import{L as be,E as $,C as he}from"./index-BiBGEAPz.js";import{p as Te,s as Pe,t as b}from"./index-Bzq-v0Dg.js";import{cssLanguage as K,css as xe}from"./index-Bv8vIAVO.js";import{typescriptLanguage as Ve,jsxLanguage as ye,tsxLanguage as we,javascriptLanguage as M,javascript as ve}from"./index-B-8FWzpe.js";import{E as Xe}from"./index-891wE-Rj.js";import{EditorSelection as $e}from"./index-BHot-lnj.js";import{L as _e,k as qe,l as ke,o as Ce,y as Qe,e as J}from"./index-CYwf9t3p.js";import"./index-BjCwOpLW.js";const Ae=55,Ye=1,Me=56,Re=2,Ee=57,Ze=3,z=4,Be=5,R=6,ee=7,te=8,ae=9,le=10,ze=11,De=12,We=13,_=58,Ne=14,Ge=15,D=59,re=21,Ie=23,ne=24,je=25,A=27,se=28,Ue=29,Le=32,Fe=35,He=37,Ke=38,Je=0,et=1,tt={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},at={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},W={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function lt(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}let N=null,G=null,I=0;function Y(e,a){let r=e.pos+a;if(I==r&&G==e)return N;let l=e.peek(a),t="";for(;lt(l);)t+=String.fromCharCode(l),l=e.peek(++a);return G=e,I=r,N=t?t.toLowerCase():l==rt||l==nt?void 0:null}const oe=60,X=62,E=47,rt=63,nt=33,st=45;function j(e,a){this.name=e,this.parent=a}const ot=[R,le,ee,te,ae],it=new he({start:null,shift(e,a,r,l){return ot.indexOf(a)>-1?new j(Y(l,1)||"",e):e},reduce(e,a){return a==re&&e?e.parent:e},reuse(e,a,r,l){let t=a.type.id;return t==R||t==He?new j(Y(l,1)||"",e):e},strict:!1}),ut=new $((e,a)=>{if(e.next!=oe){e.next<0&&a.context&&e.acceptToken(_);return}e.advance();let r=e.next==E;r&&e.advance();let l=Y(e,0);if(l===void 0)return;if(!l)return e.acceptToken(r?Ge:Ne);let t=a.context?a.context.name:null;if(r){if(l==t)return e.acceptToken(ze);if(t&&at[t])return e.acceptToken(_,-2);if(a.dialectEnabled(Je))return e.acceptToken(De);for(let s=a.context;s;s=s.parent)if(s.name==l)return;e.acceptToken(We)}else{if(l=="script")return e.acceptToken(ee);if(l=="style")return e.acceptToken(te);if(l=="textarea")return e.acceptToken(ae);if(tt.hasOwnProperty(l))return e.acceptToken(le);t&&W[t]&&W[t][l]?e.acceptToken(_,-1):e.acceptToken(R)}},{contextual:!0}),Ot=new $(e=>{for(let a=0,r=0;;r++){if(e.next<0){r&&e.acceptToken(D);break}if(e.next==st)a++;else if(e.next==X&&a>=2){r>=3&&e.acceptToken(D,-2);break}else a=0;e.advance()}});function dt(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const ct=new $((e,a)=>{if(e.next==E&&e.peek(1)==X){let r=a.dialectEnabled(et)||dt(a.context);e.acceptToken(r?Be:z,2)}else e.next==X&&e.acceptToken(z,1)});function Z(e,a,r){let l=2+e.length;return new $(t=>{for(let s=0,o=0,i=0;;i++){if(t.next<0){i&&t.acceptToken(a);break}if(s==0&&t.next==oe||s==1&&t.next==E||s>=2&&s<l&&t.next==e.charCodeAt(s-2))s++,o++;else if(s==l&&t.next==X){i>o?t.acceptToken(a,-o):t.acceptToken(r,-(o-2));break}else if((t.next==10||t.next==13)&&i){t.acceptToken(a,1);break}else s=o=0;t.advance()}})}const pt=Z("script",Ae,Ye),mt=Z("style",Me,Re),ft=Z("textarea",Ee,Ze),gt=Pe({"Text RawText IncompleteTag IncompleteCloseTag":b.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":b.angleBracket,TagName:b.tagName,"MismatchedCloseTag/TagName":[b.tagName,b.invalid],AttributeName:b.attributeName,"AttributeValue UnquotedAttributeValue":b.attributeValue,Is:b.definitionOperator,"EntityReference CharacterReference":b.character,Comment:b.blockComment,ProcessingInst:b.processingInstruction,DoctypeDecl:b.documentMeta}),St=be.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%l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~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:it,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[gt],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!Z$|caPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S$q#S#T&X#T;'S$q;'S;=`+z<%lO$q!R&bXaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&Xq'UVaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}P'pTaPOv'kw!^'k!_;'S'k;'S;=`(P<%lO'kP(SP;=`<%l'kp([S!dpOv(Vx;'S(V;'S;=`(h<%lO(Vp(kP;=`<%l(Vq(qP;=`<%l&}a({WaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t`)jT!b`Or)esv)ew;'S)e;'S;=`)y<%lO)e`)|P;=`<%l)ea*SP;=`<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`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[pt,mt,ft,ct,ut,Ot,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function ie(e,a){let r=Object.create(null);for(let l of e.getChildren(ne)){let t=l.getChild(je),s=l.getChild(A)||l.getChild(se);t&&(r[a.read(t.from,t.to)]=s?s.type.id==A?a.read(s.from+1,s.to-1):a.read(s.from,s.to):"")}return r}function U(e,a){let r=e.getChild(Ie);return r?a.read(r.from,r.to):" "}function q(e,a,r){let l;for(let t of r)if(!t.attrs||t.attrs(l||(l=ie(e.node.parent.firstChild,a))))return{parser:t.parser,bracketed:!0};return null}function ue(e=[],a=[]){let r=[],l=[],t=[],s=[];for(let i of e)(i.tag=="script"?r:i.tag=="style"?l:i.tag=="textarea"?t:s).push(i);let o=a.length?Object.create(null):null;for(let i of a)(o[i.name]||(o[i.name]=[])).push(i);return Te((i,u)=>{let f=i.type.id;if(f==Ue)return q(i,u,r);if(f==Le)return q(i,u,l);if(f==Fe)return q(i,u,t);if(f==re&&s.length){let p=i.node,d=p.firstChild,m=d&&U(d,u),O;if(m){for(let c of s)if(c.tag==m&&(!c.attrs||c.attrs(O||(O=ie(d,u))))){let S=p.lastChild,h=S.type.id==Ke?S.from:p.to;if(h>d.to)return{parser:c.parser,overlay:[{from:d.to,to:h}]}}}}if(o&&f==ne){let p=i.node,d;if(d=p.firstChild){let m=o[u.read(d.from,d.to)];if(m)for(let O of m){if(O.tagName&&O.tagName!=U(p.parent,u))continue;let c=p.lastChild;if(c.type.id==A){let S=c.from+1,h=c.lastChild,T=c.to-(h&&h.isError?0:1);if(T>S)return{parser:O.parser,overlay:[{from:S,to:T}],bracketed:!0}}else if(c.type.id==se)return{parser:O.parser,overlay:[{from:c.from,to:c.to}]}}}}return null})}const V=["_blank","_self","_top","_parent"],k=["ascii","utf-8","utf-16","latin1","latin1"],C=["get","post","put","delete"],Q=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],g=["true","false"],n={},bt={a:{attrs:{href:null,ping:null,type:null,media:null,target:V,hreflang:null}},abbr:n,address:n,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:n,aside:n,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:n,base:{attrs:{href:null,target:V}},bdi:n,bdo:n,blockquote:{attrs:{cite:null}},body:n,br:n,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:Q,formmethod:C,formnovalidate:["novalidate"],formtarget:V,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:n,center:n,cite:n,code:n,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:n,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:n,div:n,dl:n,dt:n,em:n,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:n,figure:n,footer:n,form:{attrs:{action:null,name:null,"accept-charset":k,autocomplete:["on","off"],enctype:Q,method:C,novalidate:["novalidate"],target:V}},h1:n,h2:n,h3:n,h4:n,h5:n,h6:n,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:n,hgroup:n,hr:n,html:{attrs:{manifest:null}},i:n,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:Q,formmethod:C,formnovalidate:["novalidate"],formtarget:V,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:n,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:n,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:n,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:k,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:n,noscript:n,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:n,param:{attrs:{name:null,value:null}},pre:n,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:n,rt:n,ruby:n,samp:n,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:k}},section:n,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:n,source:{attrs:{src:null,type:null,media:null}},span:n,strong:n,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:n,summary:n,sup:n,table:n,tbody:n,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:n,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:n,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:n,time:{attrs:{datetime:null}},title:n,tr:n,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:n,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:n},Oe={accesskey:null,class:null,contenteditable:g,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:g,autocorrect:g,autocapitalize:g,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":g,"aria-autocomplete":["inline","list","both","none"],"aria-busy":g,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":g,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":g,"aria-hidden":g,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":g,"aria-multiselectable":g,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":g,"aria-relevant":null,"aria-required":g,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},de="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(e=>"on"+e);for(let e of de)Oe[e]=null;class y{constructor(a,r){this.tags={...bt,...a},this.globalAttrs={...Oe,...r},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}y.default=new y;function P(e,a,r=e.length){if(!a)return"";let l=a.firstChild,t=l&&l.getChild("TagName");return t?e.sliceString(t.from,Math.min(t.to,r)):""}function x(e,a=!1){for(;e;e=e.parent)if(e.name=="Element")if(a)a=!1;else return e;return null}function ce(e,a,r){let l=r.tags[P(e,x(a))];return(l==null?void 0:l.children)||r.allTags}function B(e,a){let r=[];for(let l=x(a);l&&!l.type.isTop;l=x(l.parent)){let t=P(e,l);if(t&&l.lastChild.name=="CloseTag")break;t&&r.indexOf(t)<0&&(a.name=="EndTag"||a.from>=l.firstChild.to)&&r.push(t)}return r}const pe=/^[:\-\.\w\u00b7-\uffff]*$/;function L(e,a,r,l,t){let s=/\s*>/.test(e.sliceDoc(t,t+5))?"":">",o=x(r,r.name=="StartTag"||r.name=="TagName");return{from:l,to:t,options:ce(e.doc,o,a).map(i=>({label:i,type:"type"})).concat(B(e.doc,r).map((i,u)=>({label:"/"+i,apply:"/"+i+s,type:"type",boost:99-u}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function F(e,a,r,l){let t=/\s*>/.test(e.sliceDoc(l,l+5))?"":">";return{from:r,to:l,options:B(e.doc,a).map((s,o)=>({label:s,apply:s+t,type:"type",boost:99-o})),validFor:pe}}function ht(e,a,r,l){let t=[],s=0;for(let o of ce(e.doc,r,a))t.push({label:"<"+o,type:"type"});for(let o of B(e.doc,r))t.push({label:"</"+o+">",type:"type",boost:99-s++});return{from:l,to:l,options:t,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Tt(e,a,r,l,t){let s=x(r),o=s?a.tags[P(e.doc,s)]:null,i=o&&o.attrs?Object.keys(o.attrs):[],u=o&&o.globalAttrs===!1?i:i.length?i.concat(a.globalAttrNames):a.globalAttrNames;return{from:l,to:t,options:u.map(f=>({label:f,type:"property"})),validFor:pe}}function Pt(e,a,r,l,t){var s;let o=(s=r.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),i=[],u;if(o){let f=e.sliceDoc(o.from,o.to),p=a.globalAttrs[f];if(!p){let d=x(r),m=d?a.tags[P(e.doc,d)]:null;p=(m==null?void 0:m.attrs)&&m.attrs[f]}if(p){let d=e.sliceDoc(l,t).toLowerCase(),m='"',O='"';/^['"]/.test(d)?(u=d[0]=='"'?/^[^"]*$/:/^[^']*$/,m="",O=e.sliceDoc(t,t+1)==d[0]?"":d[0],d=d.slice(1),l++):u=/^[^\s<>='"]*$/;for(let c of p)i.push({label:c,apply:m+c+O,type:"constant"})}}return{from:l,to:t,options:i,validFor:u}}function me(e,a){let{state:r,pos:l}=a,t=J(r).resolveInner(l,-1),s=t.resolve(l);for(let o=l,i;s==t&&(i=t.childBefore(o));){let u=i.lastChild;if(!u||!u.type.isError||u.from<u.to)break;s=t=i,o=u.from}return t.name=="TagName"?t.parent&&/CloseTag$/.test(t.parent.name)?F(r,t,t.from,l):L(r,e,t,t.from,l):t.name=="StartTag"||t.name=="IncompleteTag"?L(r,e,t,l,l):t.name=="StartCloseTag"||t.name=="IncompleteCloseTag"?F(r,t,l,l):t.name=="OpenTag"||t.name=="SelfClosingTag"||t.name=="AttributeName"?Tt(r,e,t,t.name=="AttributeName"?t.from:l,l):t.name=="Is"||t.name=="AttributeValue"||t.name=="UnquotedAttributeValue"?Pt(r,e,t,t.name=="Is"?l:t.from,l):a.explicit&&(s.name=="Element"||s.name=="Text"||s.name=="Document")?ht(r,e,t,l):null}function Qt(e){return me(y.default,e)}function xt(e){let{extraTags:a,extraGlobalAttributes:r}=e,l=r||a?new y(a,r):y.default;return t=>me(l,t)}const Vt=M.parser.configure({top:"SingleExpression"}),fe=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:Ve.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:ye.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:we.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:Vt},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:M.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:K.parser}],ge=[{name:"style",parser:K.parser.configure({top:"Styles"})}].concat(de.map(e=>({name:e,parser:M.parser}))),Se=qe.define({name:"html",parser:St.configure({props:[ke.add({Element(e){let a=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+a[0].length?e.continue():e.lineIndent(e.node.from)+(a[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].length<e.node.to)return e.continue();let a=null,r;for(let l=e.node;;){let t=l.lastChild;if(!t||t.name!="Element"||t.to!=l.to)break;a=l=t}return a&&!((r=a.lastChild)&&(r.name=="CloseTag"||r.name=="SelfClosingTag"))?e.lineIndent(a.from)+e.unit:null}}),Ce.add({Element(e){let a=e.firstChild,r=e.lastChild;return!a||a.name!="OpenTag"?null:{from:a.to,to:r.name=="CloseTag"?r.from:e.to}}}),Qe.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),v=Se.configure({wrap:ue(fe,ge)});function At(e={}){let a="",r;e.matchClosingTags===!1&&(a="noMatch"),e.selfClosingTags===!0&&(a=(a?a+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(r=ue((e.nestedLanguages||[]).concat(fe),(e.nestedAttributes||[]).concat(ge)));let l=r?Se.configure({wrap:r,dialect:a}):a?v.configure({dialect:a}):v;return new _e(l,[v.data.of({autocomplete:xt(e)}),e.autoCloseTags!==!1?yt:[],ve().support,xe().support])}const H=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),yt=Xe.inputHandler.of((e,a,r,l,t)=>{if(e.composing||e.state.readOnly||a!=r||l!=">"&&l!="/"||!v.isActiveAt(e.state,a,-1))return!1;let s=t(),{state:o}=s,i=o.changeByRange(u=>{var f,p,d;let m=o.doc.sliceString(u.from-1,u.to)==l,{head:O}=u,c=J(o).resolveInner(O,-1),S;if(m&&l==">"&&c.name=="EndTag"){let h=c.parent;if(((p=(f=h.parent)===null||f===void 0?void 0:f.lastChild)===null||p===void 0?void 0:p.name)!="CloseTag"&&(S=P(o.doc,h.parent,O))&&!H.has(S)){let T=O+(o.doc.sliceString(O,O+1)===">"?1:0),w=`</${S}>`;return{range:u,changes:{from:O,to:T,insert:w}}}}else if(m&&l=="/"&&c.name=="IncompleteCloseTag"){let h=c.parent;if(c.from==O-2&&((d=h.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(S=P(o.doc,h,O))&&!H.has(S)){let T=O+(o.doc.sliceString(O,O+1)===">"?1:0),w=`${S}>`;return{range:$e.cursor(O+w.length,-1),changes:{from:O,to:T,insert:w}}}}return{range:u}});return i.changes.empty?!1:(e.dispatch([s,o.update(i,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});export{yt as autoCloseTags,At as html,Qt as htmlCompletionSource,xt as htmlCompletionSourceWith,v as htmlLanguage};
|