@i14ks/ccv 0.7.2 → 0.8.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 +32 -12
- package/package.json +1 -1
- package/web/assets/{codemirror-CT_I9W8V.js → codemirror-CVvP6QQT.js} +1 -1
- package/web/assets/{index-orsieMzN.js → index-B0rzOjTL.js} +1 -1
- package/web/assets/{index-DK3fr1-H.js → index-B3dv9BC8.js} +1 -1
- package/web/assets/{index-C7BowCu_.js → index-B6uiazpS.js} +1 -1
- package/web/assets/{index-BsWsF3Fl.js → index-BLhSyH7z.js} +1 -1
- package/web/assets/{index-BXGO38V0.js → index-BanFfa7t.js} +1 -1
- package/web/assets/{index-BJxrsvYI.js → index-BqbJNxEr.js} +1 -1
- package/web/assets/{index-DZONC7G0.js → index-C8oP-mil.js} +1 -1
- package/web/assets/index-CLOINL5U.js +132 -0
- package/web/assets/{index-BfEIguB2.js → index-CY7q3Ck1.js} +1 -1
- package/web/assets/{index-NSr-7K-t.js → index-Cp0MuKrW.js} +1 -1
- package/web/assets/{index-C37A4Z6a.js → index-CtMm0L-o.js} +1 -1
- package/web/assets/{index-BUPafoiW.js → index-D0hI9vYs.js} +1 -1
- package/web/assets/{index-D6dXU68i.js → index-D7QJyPiW.js} +1 -1
- package/web/assets/{index-BypqjF8L.js → index-DA4Vv71z.js} +1 -1
- package/web/assets/index-DDcm1yfV.css +1 -0
- package/web/assets/{index-CGu7N9dH.js → index-DF-nqlZE.js} +1 -1
- package/web/assets/{index-BhbDxjJk.js → index-DPvZ-hhz.js} +1 -1
- package/web/assets/{index-C73L6h-_.js → index-DbdZObbo.js} +1 -1
- package/web/assets/{index-DQd5QKK5.js → index-DcacXtlQ.js} +1 -1
- package/web/assets/{index-BWCkRrtJ.js → index-DyhSCR-0.js} +1 -1
- package/web/assets/{index-Ds7Lfmpa.js → index-NKG2aix5.js} +1 -1
- package/web/index.html +2 -2
- package/web/assets/index-DecijLh5.css +0 -1
- package/web/assets/index-P6iAB9yV.js +0 -134
|
@@ -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-DPvZ-hhz.js";import{history as we,defaultKeymap as Le,historyKeymap as Re}from"./index-BqbJNxEr.js";import{c as ot,a as at,b as ct,d as ht}from"./index-B0rzOjTL.js";import"./index-CLOINL5U.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{P as L,b as $,a as E,D as j,N as y,c as S,I as G}from"./index-P6iAB9yV.js";var N={};class v{constructor(t,e,s,i,h,r,n,o,a,u=0,f){this.p=t,this.stack=e,this.state=s,this.reducePos=i,this.pos=h,this.score=r,this.buffer=n,this.bufferBase=o,this.curContext=a,this.lookAhead=u,this.parent=f}toString(){return`[${this.stack.filter((t,e)=>e%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(t,e,s=0){let i=t.parser.context;return new v(t,[],e,s,s,0,[],0,i?new R(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(t,e){this.stack.push(this.state,e,this.bufferBase+this.buffer.length),this.state=t}reduce(t){var e;let s=t>>19,i=t&65535,{parser:h}=this.p,r=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),n=h.dynamicPrecedence(i);if(n&&(this.score+=n),s==0){i<h.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(h.getGoto(this.state,i,!0),this.reducePos),i<h.minRepeatTerm&&this.storeNode(i,this.reducePos,this.reducePos,r?8:4,!0),this.reduceContext(i,this.reducePos);return}let o=this.stack.length-(s-1)*3-(t&262144?6:0),a=o?this.stack[o-2]:this.p.ranges[0].from;i<h.minRepeatTerm&&a==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let u=this.reducePos-a;u>=2e3&&!(!((e=this.p.parser.nodeSet.types[i])===null||e===void 0)&&e.isAnonymous)&&(a==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSize<u&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=a,this.p.lastBigReductionSize=u));let f=o?this.stack[o-1]:0,d=this.bufferBase+this.buffer.length-f;if(i<h.minRepeatTerm||t&131072){let c=h.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(i,a,c,d+4,!0)}if(t&262144)this.state=this.stack[o];else{let c=this.stack[o-3];this.state=h.getGoto(c,i,!0)}for(;this.stack.length>o;)this.stack.pop();this.reduceContext(i,a)}storeNode(t,e,s,i=4,h=!1){if(t==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let r=this.buffer.length;if(r>0&&this.buffer[r-4]==0&&this.buffer[r-1]>-1){if(e==s)return;if(this.buffer[r-2]>=e){this.buffer[r-2]=s;return}}}if(!h||this.pos==s)this.buffer.push(t,e,s,i);else{let r=this.buffer.length;if(r>0&&(this.buffer[r-4]!=0||this.buffer[r-1]<0)){let n=!1;for(let o=r;o>0&&this.buffer[o-2]>s;o-=4)if(this.buffer[o-1]>=0){n=!0;break}if(n)for(;r>0&&this.buffer[r-2]>s;)this.buffer[r]=this.buffer[r-4],this.buffer[r+1]=this.buffer[r-3],this.buffer[r+2]=this.buffer[r-2],this.buffer[r+3]=this.buffer[r-1],r-=4,i>4&&(i-=4)}this.buffer[r]=t,this.buffer[r+1]=e,this.buffer[r+2]=s,this.buffer[r+3]=i}}shift(t,e,s,i){if(t&131072)this.pushState(t&65535,this.pos);else if((t&262144)==0){let h=t,{parser:r}=this.p;this.pos=i;let n=r.stateFlag(h,1);!n&&(i>s||e<=r.maxNode)&&(this.reducePos=i),this.pushState(h,n?s:Math.min(s,this.reducePos)),this.shiftContext(e,s),e<=r.maxNode&&this.buffer.push(e,s,i,4)}else this.pos=i,this.shiftContext(e,s),e<=this.p.parser.maxNode&&this.buffer.push(e,s,i,4)}apply(t,e,s,i){t&65536?this.reduce(t):this.shift(t,e,s,i)}useNode(t,e){let s=this.p.reused.length-1;(s<0||this.p.reused[s]!=t)&&(this.p.reused.push(t),s++);let i=this.pos;this.reducePos=this.pos=i+t.length,this.pushState(e,i),this.buffer.push(s,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,t,this,this.p.stream.reset(this.pos-t.length)))}split(){let t=this,e=t.buffer.length;for(e&&t.buffer[e-4]==0&&(e-=4);e>0&&t.buffer[e-2]>t.reducePos;)e-=4;let s=t.buffer.slice(e),i=t.bufferBase+e;for(;t&&i==t.bufferBase;)t=t.parent;return new v(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,s,i,this.curContext,this.lookAhead,t)}recoverByDelete(t,e){let s=t<=this.p.parser.maxNode;s&&this.storeNode(t,this.pos,e,4),this.storeNode(0,this.pos,e,s?8:4),this.pos=this.reducePos=e,this.score-=190}canShift(t){for(let e=new U(this);;){let s=this.p.parser.stateSlot(e.state,4)||this.p.parser.hasAction(e.state,t);if(s==0)return!1;if((s&65536)==0)return!0;e.reduce(s)}}recoverByInsert(t){if(this.stack.length>=300)return[];let e=this.p.parser.nextStates(this.state);if(e.length>8||this.stack.length>=120){let i=[];for(let h=0,r;h<e.length;h+=2)(r=e[h+1])!=this.state&&this.p.parser.hasAction(r,t)&&i.push(e[h],r);if(this.stack.length<120)for(let h=0;i.length<8&&h<e.length;h+=2){let r=e[h+1];i.some((n,o)=>o&1&&n==r)||i.push(e[h],r)}e=i}let s=[];for(let i=0;i<e.length&&s.length<4;i+=2){let h=e[i+1];if(h==this.state)continue;let r=this.split();r.pushState(h,this.pos),r.storeNode(0,r.pos,r.pos,4,!0),r.shiftContext(e[i],this.pos),r.reducePos=this.pos,r.score-=200,s.push(r)}return s}forceReduce(){let{parser:t}=this.p,e=t.stateSlot(this.state,5);if((e&65536)==0)return!1;if(!t.validAction(this.state,e)){let s=e>>19,i=e&65535,h=this.stack.length-s*3;if(h<0||t.getGoto(this.stack[h],i,!1)<0){let r=this.findForcedReduction();if(r==null)return!1;e=r}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(e),!0}findForcedReduction(){let{parser:t}=this.p,e=[],s=(i,h)=>{if(!e.includes(i))return e.push(i),t.allActions(i,r=>{if(!(r&393216))if(r&65536){let n=(r>>19)-h;if(n>1){let o=r&65535,a=this.stack.length-n*3;if(a>=0&&t.getGoto(this.stack[a],o,!1)>=0)return n<<19|65536|o}}else{let n=s(r,h+1);if(n!=null)return n}})};return s(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:t}=this.p;return t.data[t.stateSlot(this.state,1)]==65535&&!t.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(t){if(this.state!=t.state||this.stack.length!=t.stack.length)return!1;for(let e=0;e<this.stack.length;e+=3)if(this.stack[e]!=t.stack[e])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(t){return this.p.parser.dialect.flags[t]}shiftContext(t,e){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,t,this,this.p.stream.reset(e)))}reduceContext(t,e){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,t,this,this.p.stream.reset(e)))}emitContext(){let t=this.buffer.length-1;(t<0||this.buffer[t]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let t=this.buffer.length-1;(t<0||this.buffer[t]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(t){if(t!=this.curContext.context){let e=new R(this.curContext.tracker,t);e.hash!=this.curContext.hash&&this.emitContext(),this.curContext=e}}setLookAhead(t){return t<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=t,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class R{constructor(t,e){this.tracker=t,this.context=e,this.hash=t.strict?t.hash(e):0}}class U{constructor(t){this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}reduce(t){let e=t&65535,s=t>>19;s==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(s-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],e,!0);this.state=i}}class A{constructor(t,e,s){this.stack=t,this.pos=e,this.index=s,this.buffer=t.buffer,this.index==0&&this.maybeNext()}static create(t,e=t.bufferBase+t.buffer.length){return new A(t,e,e-t.bufferBase)}maybeNext(){let t=this.stack.parent;t!=null&&(this.index=this.stack.bufferBase-t.bufferBase,this.stack=t,this.buffer=t.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new A(this.stack,this.pos,this.index)}}function x(l,t=Uint16Array){if(typeof l!="string")return l;let e=null;for(let s=0,i=0;s<l.length;){let h=0;for(;;){let r=l.charCodeAt(s++),n=!1;if(r==126){h=65535;break}r>=92&&r--,r>=34&&r--;let o=r-32;if(o>=46&&(o-=46,n=!0),h+=o,n)break;h*=46}e?e[i++]=h:e=new t(h)}return e}class P{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const z=new P;class H{constructor(t,e){this.input=t,this.ranges=e,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=z,this.rangeIndex=0,this.pos=this.chunkPos=e[0].from,this.range=e[0],this.end=e[e.length-1].to,this.readNext()}resolveOffset(t,e){let s=this.range,i=this.rangeIndex,h=this.pos+t;for(;h<s.from;){if(!i)return null;let r=this.ranges[--i];h-=s.from-r.to,s=r}for(;e<0?h>s.to:h>=s.to;){if(i==this.ranges.length-1)return null;let r=this.ranges[++i];h+=r.from-s.to,s=r}return h}clipPos(t){if(t>=this.range.from&&t<this.range.to)return t;for(let e of this.ranges)if(e.to>t)return Math.max(t,e.from);return this.end}peek(t){let e=this.chunkOff+t,s,i;if(e>=0&&e<this.chunk.length)s=this.pos+t,i=this.chunk.charCodeAt(e);else{let h=this.resolveOffset(t,1);if(h==null)return-1;if(s=h,s>=this.chunk2Pos&&s<this.chunk2Pos+this.chunk2.length)i=this.chunk2.charCodeAt(s-this.chunk2Pos);else{let r=this.rangeIndex,n=this.range;for(;n.to<=s;)n=this.ranges[++r];this.chunk2=this.input.chunk(this.chunk2Pos=s),s+this.chunk2.length>n.to&&(this.chunk2=this.chunk2.slice(0,n.to-s)),i=this.chunk2.charCodeAt(0)}}return s>=this.token.lookAhead&&(this.token.lookAhead=s+1),i}acceptToken(t,e=0){let s=e?this.resolveOffset(e,-1):this.pos;if(s==null||s<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=t,this.token.end=s}acceptTokenTo(t,e){this.token.value=t,this.token.end=e}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:t,chunkPos:e}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=t,this.chunk2Pos=e,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let t=this.input.chunk(this.pos),e=this.pos+t.length;this.chunk=e>this.range.to?t.slice(0,this.range.to-this.pos):t,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(t=1){for(this.chunkOff+=t;this.pos+t>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();t-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=t,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(t,e){if(e?(this.token=e,e.start=t,e.lookAhead=t+1,e.value=e.extended=-1):this.token=z,this.pos!=t){if(this.pos=t,t==this.end)return this.setDone(),this;for(;t<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;t>=this.range.to;)this.range=this.ranges[++this.rangeIndex];t>=this.chunkPos&&t<this.chunkPos+this.chunk.length?this.chunkOff=t-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(t,e){if(t>=this.chunkPos&&e<=this.chunkPos+this.chunk.length)return this.chunk.slice(t-this.chunkPos,e-this.chunkPos);if(t>=this.chunk2Pos&&e<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(t-this.chunk2Pos,e-this.chunk2Pos);if(t>=this.range.from&&e<=this.range.to)return this.input.read(t,e);let s="";for(let i of this.ranges){if(i.from>=e)break;i.to>t&&(s+=this.input.read(Math.max(i.from,t),Math.min(i.to,e)))}return s}}class m{constructor(t,e){this.data=t,this.id=e}token(t,e){let{parser:s}=e.p;O(this.data,t,e,this.id,s.data,s.tokenPrecTable)}}m.prototype.contextual=m.prototype.fallback=m.prototype.extend=!1;class W{constructor(t,e,s){this.precTable=e,this.elseToken=s,this.data=typeof t=="string"?x(t):t}token(t,e){let s=t.pos,i=0;for(;;){let h=t.next<0,r=t.resolveOffset(1,1);if(O(this.data,t,e,0,this.data,this.precTable),t.token.value>-1)break;if(this.elseToken==null)return;if(h||i++,r==null)break;t.reset(r,t.token)}i&&(t.reset(s,t.token),t.acceptToken(this.elseToken,i))}}W.prototype.contextual=m.prototype.fallback=m.prototype.extend=!1;class Z{constructor(t,e={}){this.token=t,this.contextual=!!e.contextual,this.fallback=!!e.fallback,this.extend=!!e.extend}}function O(l,t,e,s,i,h){let r=0,n=1<<s,{dialect:o}=e.p.parser;t:for(;(n&l[r])!=0;){let a=l[r+1];for(let c=r+3;c<a;c+=2)if((l[c+1]&n)>0){let p=l[c];if(o.allows(p)&&(t.token.value==-1||t.token.value==p||q(p,t.token.value,i,h))){t.acceptToken(p);break}}let u=t.next,f=0,d=l[r+2];if(t.next<0&&d>f&&l[a+d*3-3]==65535){r=l[a+d*3-1];continue t}for(;f<d;){let c=f+d>>1,p=a+c+(c<<1),b=l[p],M=l[p+1]||65536;if(u<b)d=c;else if(u>=M)f=c+1;else{r=l[p+2],t.advance();continue t}}break}}function I(l,t,e){for(let s=t,i;(i=l[s])!=65535;s++)if(i==e)return s-t;return-1}function q(l,t,e,s){let i=I(e,s,t);return i<0||I(e,s,l)<i}const g=typeof process<"u"&&N&&/\bparse\b/.test(N.LOG);let T=null;function D(l,t,e){let s=l.cursor(G.IncludeAnonymous);for(s.moveTo(t);;)if(!(e<0?s.childBefore(t):s.childAfter(t)))for(;;){if((e<0?s.to<t:s.from>t)&&!s.type.isError)return e<0?Math.max(0,Math.min(s.to-1,t-25)):Math.min(l.length,Math.max(s.from+1,t+25));if(e<0?s.prevSibling():s.nextSibling())break;if(!s.parent())return e<0?0:l.length}}class J{constructor(t,e){this.fragments=t,this.nodeSet=e,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let t=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(t){for(this.safeFrom=t.openStart?D(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?D(t.tree,t.to+t.offset,-1)-t.offset:t.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(t.tree),this.start.push(-t.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(t<this.nextStart)return null;for(;this.fragment&&this.safeTo<=t;)this.nextFragment();if(!this.fragment)return null;for(;;){let e=this.trees.length-1;if(e<0)return this.nextFragment(),null;let s=this.trees[e],i=this.index[e];if(i==s.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let h=s.children[i],r=this.start[e]+s.positions[i];if(r>t)return this.nextStart=r,null;if(h instanceof S){if(r==t){if(r<this.safeFrom)return null;let n=r+h.length;if(n<=this.safeTo){let o=h.prop(y.lookAhead);if(!o||n+o<this.fragment.to)return h}}this.index[e]++,r+h.length>=Math.max(this.safeFrom,t)&&(this.trees.push(h),this.start.push(r),this.index.push(0))}else this.index[e]++,this.nextStart=r+h.length}}}class K{constructor(t,e){this.stream=e,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map(s=>new P)}getActions(t){let e=0,s=null,{parser:i}=t.p,{tokenizers:h}=i,r=i.stateSlot(t.state,3),n=t.curContext?t.curContext.hash:0,o=0;for(let a=0;a<h.length;a++){if((1<<a&r)==0)continue;let u=h[a],f=this.tokens[a];if(!(s&&!u.fallback)&&((u.contextual||f.start!=t.pos||f.mask!=r||f.context!=n)&&(this.updateCachedToken(f,u,t),f.mask=r,f.context=n),f.lookAhead>f.end+25&&(o=Math.max(f.lookAhead,o)),f.value!=0)){let d=e;if(f.extended>-1&&(e=this.addActions(t,f.extended,f.end,e)),e=this.addActions(t,f.value,f.end,e),!u.extend&&(s=f,e>d))break}}for(;this.actions.length>e;)this.actions.pop();return o&&t.setLookAhead(o),!s&&t.pos==this.stream.end&&(s=new P,s.value=t.p.parser.eofTerm,s.start=s.end=t.pos,e=this.addActions(t,s.value,s.end,e)),this.mainToken=s,this.actions}getMainToken(t){if(this.mainToken)return this.mainToken;let e=new P,{pos:s,p:i}=t;return e.start=s,e.end=Math.min(s+1,i.stream.end),e.value=s==i.stream.end?i.parser.eofTerm:0,e}updateCachedToken(t,e,s){let i=this.stream.clipPos(s.pos);if(e.token(this.stream.reset(i,t),s),t.value>-1){let{parser:h}=s.p;for(let r=0;r<h.specialized.length;r++)if(h.specialized[r]==t.value){let n=h.specializers[r](this.stream.read(t.start,t.end),s);if(n>=0&&s.p.parser.dialect.allows(n>>1)){(n&1)==0?t.value=n>>1:t.extended=n>>1;break}}}else t.value=0,t.end=this.stream.clipPos(i+1)}putAction(t,e,s,i){for(let h=0;h<i;h+=3)if(this.actions[h]==t)return i;return this.actions[i++]=t,this.actions[i++]=e,this.actions[i++]=s,i}addActions(t,e,s,i){let{state:h}=t,{parser:r}=t.p,{data:n}=r;for(let o=0;o<2;o++)for(let a=r.stateSlot(h,o?2:1);;a+=3){if(n[a]==65535)if(n[a+1]==1)a=k(n,a+2);else{i==0&&n[a+1]==2&&(i=this.putAction(k(n,a+2),e,s,i));break}n[a]==e&&(i=this.putAction(k(n,a+1),e,s,i))}return i}}class Q{constructor(t,e,s,i){this.parser=t,this.input=e,this.ranges=i,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new H(e,i),this.tokens=new K(t,this.stream),this.topTerm=t.top[1];let{from:h}=i[0];this.stacks=[v.start(this,t.top[0],h)],this.fragments=s.length&&this.stream.end-h>t.bufferLength*4?new J(s,t.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let t=this.stacks,e=this.minStackPos,s=this.stacks=[],i,h;if(this.bigReductionCount>300&&t.length==1){let[r]=t;for(;r.forceReduce()&&r.stack.length&&r.stack[r.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let r=0;r<t.length;r++){let n=t[r];for(;;){if(this.tokens.mainToken=null,n.pos>e)s.push(n);else{if(this.advanceStack(n,s,t))continue;{i||(i=[],h=[]),i.push(n);let o=this.tokens.getMainToken(n);h.push(o.value,o.end)}}break}}if(!s.length){let r=i&&X(i);if(r)return g&&console.log("Finish with "+this.stackID(r)),this.stackToTree(r);if(this.parser.strict)throw g&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+e);this.recovering||(this.recovering=5)}if(this.recovering&&i){let r=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,h,s);if(r)return g&&console.log("Force-finish "+this.stackID(r)),this.stackToTree(r.forceAll())}if(this.recovering){let r=this.recovering==1?1:this.recovering*3;if(s.length>r)for(s.sort((n,o)=>o.score-n.score);s.length>r;)s.pop();s.some(n=>n.reducePos>e)&&this.recovering--}else if(s.length>1){t:for(let r=0;r<s.length-1;r++){let n=s[r];for(let o=r+1;o<s.length;o++){let a=s[o];if(n.sameState(a)||n.buffer.length>500&&a.buffer.length>500)if((n.score-a.score||n.buffer.length-a.buffer.length)>0)s.splice(o--,1);else{s.splice(r--,1);continue t}}}s.length>12&&(s.sort((r,n)=>n.score-r.score),s.splice(12,s.length-12))}this.minStackPos=s[0].pos;for(let r=1;r<s.length;r++)s[r].pos<this.minStackPos&&(this.minStackPos=s[r].pos);return null}stopAt(t){if(this.stoppedAt!=null&&this.stoppedAt<t)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=t}advanceStack(t,e,s){let i=t.pos,{parser:h}=this,r=g?this.stackID(t)+" -> ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return t.forceReduce()?t:null;if(this.fragments){let a=t.curContext&&t.curContext.tracker.strict,u=a?t.curContext.hash:0;for(let f=this.fragments.nodeAt(i);f;){let d=this.parser.nodeSet.types[f.type.id]==f.type?h.getGoto(t.state,f.type.id):-1;if(d>-1&&f.length&&(!a||(f.prop(y.contextHash)||0)==u))return t.useNode(f,d),g&&console.log(r+this.stackID(t)+` (via reuse of ${h.getName(f.type.id)})`),!0;if(!(f instanceof S)||f.children.length==0||f.positions[0]>0)break;let c=f.children[0];if(c instanceof S&&f.positions[0]==0)f=c;else break}}let n=h.stateSlot(t.state,4);if(n>0)return t.reduce(n),g&&console.log(r+this.stackID(t)+` (via always-reduce ${h.getName(n&65535)})`),!0;if(t.stack.length>=8400)for(;t.stack.length>6e3&&t.forceReduce(););let o=this.tokens.getActions(t);for(let a=0;a<o.length;){let u=o[a++],f=o[a++],d=o[a++],c=a==o.length||!s,p=c?t:t.split(),b=this.tokens.mainToken;if(p.apply(u,f,b?b.start:p.pos,d),g&&console.log(r+this.stackID(p)+` (via ${(u&65536)==0?"shift":`reduce of ${h.getName(u&65535)}`} for ${h.getName(f)} @ ${i}${p==t?"":", split"})`),c)return!0;p.pos>i?e.push(p):s.push(p)}return!1}advanceFully(t,e){let s=t.pos;for(;;){if(!this.advanceStack(t,null,null))return!1;if(t.pos>s)return B(t,e),!0}}runRecovery(t,e,s){let i=null,h=!1;for(let r=0;r<t.length;r++){let n=t[r],o=e[r<<1],a=e[(r<<1)+1],u=g?this.stackID(n)+" -> ":"";if(n.deadEnd&&(h||(h=!0,n.restart(),g&&console.log(u+this.stackID(n)+" (restarted)"),this.advanceFully(n,s))))continue;let f=n.split(),d=u;for(let c=0;c<10&&f.forceReduce()&&(g&&console.log(d+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,s));c++)g&&(d=this.stackID(f)+" -> ");for(let c of n.recoverByInsert(o))g&&console.log(u+this.stackID(c)+" (via recover-insert)"),this.advanceFully(c,s);this.stream.end>n.pos?(a==n.pos&&(a++,o=0),n.recoverByDelete(o,a),g&&console.log(u+this.stackID(n)+` (via recover-delete ${this.parser.getName(o)})`),B(n,s)):(!i||i.score<f.score)&&(i=f)}return i}stackToTree(t){return t.close(),S.build({buffer:A.create(t),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:t.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(t){let e=(T||(T=new WeakMap)).get(t);return e||T.set(t,e=String.fromCodePoint(this.nextStackID++)),e+t}}function B(l,t){for(let e=0;e<t.length;e++){let s=t[e];if(s.pos==l.pos&&s.sameState(l)){t[e].score<l.score&&(t[e]=l);return}}t.push(l)}class V{constructor(t,e,s){this.source=t,this.flags=e,this.disabled=s}allows(t){return!this.disabled||this.disabled[t]==0}}const C=l=>l;class _{constructor(t){this.start=t.start,this.shift=t.shift||C,this.reduce=t.reduce||C,this.reuse=t.reuse||C,this.hash=t.hash||(()=>0),this.strict=t.strict!==!1}}class w extends L{constructor(t){if(super(),this.wrappers=[],t.version!=14)throw new RangeError(`Parser version (${t.version}) doesn't match runtime version (14)`);let e=t.nodeNames.split(" ");this.minRepeatTerm=e.length;for(let n=0;n<t.repeatNodeCount;n++)e.push("");let s=Object.keys(t.topRules).map(n=>t.topRules[n][1]),i=[];for(let n=0;n<e.length;n++)i.push([]);function h(n,o,a){i[n].push([o,o.deserialize(String(a))])}if(t.nodeProps)for(let n of t.nodeProps){let o=n[0];typeof o=="string"&&(o=y[o]);for(let a=1;a<n.length;){let u=n[a++];if(u>=0)h(u,o,n[a++]);else{let f=n[a+-u];for(let d=-u;d>0;d--)h(n[a++],o,f);a++}}}this.nodeSet=new $(e.map((n,o)=>E.define({name:o>=this.minRepeatTerm?void 0:n,id:o,props:i[o],top:s.indexOf(o)>-1,error:o==0,skipped:t.skippedNodes&&t.skippedNodes.indexOf(o)>-1}))),t.propSources&&(this.nodeSet=this.nodeSet.extend(...t.propSources)),this.strict=!1,this.bufferLength=j;let r=x(t.tokenData);this.context=t.context,this.specializerSpecs=t.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let n=0;n<this.specializerSpecs.length;n++)this.specialized[n]=this.specializerSpecs[n].term;this.specializers=this.specializerSpecs.map(F),this.states=x(t.states,Uint32Array),this.data=x(t.stateData),this.goto=x(t.goto),this.maxTerm=t.maxTerm,this.tokenizers=t.tokenizers.map(n=>typeof n=="number"?new m(r,n):n),this.topRules=t.topRules,this.dialects=t.dialects||{},this.dynamicPrecedences=t.dynamicPrecedences||null,this.tokenPrecTable=t.tokenPrec,this.termNames=t.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(t,e,s){let i=new Q(this,t,e,s);for(let h of this.wrappers)i=h(i,t,e,s);return i}getGoto(t,e,s=!1){let i=this.goto;if(e>=i[0])return-1;for(let h=i[e+1];;){let r=i[h++],n=r&1,o=i[h++];if(n&&s)return o;for(let a=h+(r>>1);h<a;h++)if(i[h]==t)return o;if(n)return-1}}hasAction(t,e){let s=this.data;for(let i=0;i<2;i++)for(let h=this.stateSlot(t,i?2:1),r;;h+=3){if((r=s[h])==65535)if(s[h+1]==1)r=s[h=k(s,h+2)];else{if(s[h+1]==2)return k(s,h+2);break}if(r==e||r==0)return k(s,h+1)}return 0}stateSlot(t,e){return this.states[t*6+e]}stateFlag(t,e){return(this.stateSlot(t,0)&e)>0}validAction(t,e){return!!this.allActions(t,s=>s==e?!0:null)}allActions(t,e){let s=this.stateSlot(t,4),i=s?e(s):void 0;for(let h=this.stateSlot(t,1);i==null;h+=3){if(this.data[h]==65535)if(this.data[h+1]==1)h=k(this.data,h+2);else break;i=e(k(this.data,h+1))}return i}nextStates(t){let e=[];for(let s=this.stateSlot(t,1);;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=k(this.data,s+2);else break;if((this.data[s+2]&1)==0){let i=this.data[s+1];e.some((h,r)=>r&1&&h==i)||e.push(this.data[s],i)}}return e}configure(t){let e=Object.assign(Object.create(w.prototype),this);if(t.props&&(e.nodeSet=this.nodeSet.extend(...t.props)),t.top){let s=this.topRules[t.top];if(!s)throw new RangeError(`Invalid top rule name ${t.top}`);e.top=s}return t.tokenizers&&(e.tokenizers=this.tokenizers.map(s=>{let i=t.tokenizers.find(h=>h.from==s);return i?i.to:s})),t.specializers&&(e.specializers=this.specializers.slice(),e.specializerSpecs=this.specializerSpecs.map((s,i)=>{let h=t.specializers.find(n=>n.from==s.external);if(!h)return s;let r=Object.assign(Object.assign({},s),{external:h.to});return e.specializers[i]=F(r),r})),t.contextTracker&&(e.context=t.contextTracker),t.dialect&&(e.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(e.strict=t.strict),t.wrap&&(e.wrappers=e.wrappers.concat(t.wrap)),t.bufferLength!=null&&(e.bufferLength=t.bufferLength),e}hasWrappers(){return this.wrappers.length>0}getName(t){return this.termNames?this.termNames[t]:String(t<=this.maxNode&&this.nodeSet.types[t].name||t)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(t){let e=this.dynamicPrecedences;return e==null?0:e[t]||0}parseDialect(t){let e=Object.keys(this.dialects),s=e.map(()=>!1);if(t)for(let h of t.split(" ")){let r=e.indexOf(h);r>=0&&(s[r]=!0)}let i=null;for(let h=0;h<e.length;h++)if(!s[h])for(let r=this.dialects[e[h]],n;(n=this.data[r++])!=65535;)(i||(i=new Uint8Array(this.maxTerm+1)))[n]=1;return new V(t,s,i)}static deserialize(t){return new w(t)}}function k(l,t){return l[t]|l[t+1]<<16}function X(l){let t=null;for(let e of l){let s=e.p.stoppedAt;(e.pos==e.p.stream.end||s!=null&&e.pos>s)&&e.p.parser.stateFlag(e.state,2)&&(!t||t.score<e.score)&&(t=e)}return t}function F(l){if(l.external){let t=l.extend?1:0;return(e,s)=>l.external(e,s)<<1|t}return l.get}export{_ as C,Z as E,w as L,W as a};
|
|
1
|
+
import{P as L,b as $,a as E,D as j,N as y,c as S,I as G}from"./index-CLOINL5U.js";var N={};class v{constructor(t,e,s,i,h,r,n,o,a,u=0,f){this.p=t,this.stack=e,this.state=s,this.reducePos=i,this.pos=h,this.score=r,this.buffer=n,this.bufferBase=o,this.curContext=a,this.lookAhead=u,this.parent=f}toString(){return`[${this.stack.filter((t,e)=>e%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(t,e,s=0){let i=t.parser.context;return new v(t,[],e,s,s,0,[],0,i?new R(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(t,e){this.stack.push(this.state,e,this.bufferBase+this.buffer.length),this.state=t}reduce(t){var e;let s=t>>19,i=t&65535,{parser:h}=this.p,r=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),n=h.dynamicPrecedence(i);if(n&&(this.score+=n),s==0){i<h.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(h.getGoto(this.state,i,!0),this.reducePos),i<h.minRepeatTerm&&this.storeNode(i,this.reducePos,this.reducePos,r?8:4,!0),this.reduceContext(i,this.reducePos);return}let o=this.stack.length-(s-1)*3-(t&262144?6:0),a=o?this.stack[o-2]:this.p.ranges[0].from;i<h.minRepeatTerm&&a==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let u=this.reducePos-a;u>=2e3&&!(!((e=this.p.parser.nodeSet.types[i])===null||e===void 0)&&e.isAnonymous)&&(a==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSize<u&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=a,this.p.lastBigReductionSize=u));let f=o?this.stack[o-1]:0,d=this.bufferBase+this.buffer.length-f;if(i<h.minRepeatTerm||t&131072){let c=h.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(i,a,c,d+4,!0)}if(t&262144)this.state=this.stack[o];else{let c=this.stack[o-3];this.state=h.getGoto(c,i,!0)}for(;this.stack.length>o;)this.stack.pop();this.reduceContext(i,a)}storeNode(t,e,s,i=4,h=!1){if(t==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let r=this.buffer.length;if(r>0&&this.buffer[r-4]==0&&this.buffer[r-1]>-1){if(e==s)return;if(this.buffer[r-2]>=e){this.buffer[r-2]=s;return}}}if(!h||this.pos==s)this.buffer.push(t,e,s,i);else{let r=this.buffer.length;if(r>0&&(this.buffer[r-4]!=0||this.buffer[r-1]<0)){let n=!1;for(let o=r;o>0&&this.buffer[o-2]>s;o-=4)if(this.buffer[o-1]>=0){n=!0;break}if(n)for(;r>0&&this.buffer[r-2]>s;)this.buffer[r]=this.buffer[r-4],this.buffer[r+1]=this.buffer[r-3],this.buffer[r+2]=this.buffer[r-2],this.buffer[r+3]=this.buffer[r-1],r-=4,i>4&&(i-=4)}this.buffer[r]=t,this.buffer[r+1]=e,this.buffer[r+2]=s,this.buffer[r+3]=i}}shift(t,e,s,i){if(t&131072)this.pushState(t&65535,this.pos);else if((t&262144)==0){let h=t,{parser:r}=this.p;this.pos=i;let n=r.stateFlag(h,1);!n&&(i>s||e<=r.maxNode)&&(this.reducePos=i),this.pushState(h,n?s:Math.min(s,this.reducePos)),this.shiftContext(e,s),e<=r.maxNode&&this.buffer.push(e,s,i,4)}else this.pos=i,this.shiftContext(e,s),e<=this.p.parser.maxNode&&this.buffer.push(e,s,i,4)}apply(t,e,s,i){t&65536?this.reduce(t):this.shift(t,e,s,i)}useNode(t,e){let s=this.p.reused.length-1;(s<0||this.p.reused[s]!=t)&&(this.p.reused.push(t),s++);let i=this.pos;this.reducePos=this.pos=i+t.length,this.pushState(e,i),this.buffer.push(s,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,t,this,this.p.stream.reset(this.pos-t.length)))}split(){let t=this,e=t.buffer.length;for(e&&t.buffer[e-4]==0&&(e-=4);e>0&&t.buffer[e-2]>t.reducePos;)e-=4;let s=t.buffer.slice(e),i=t.bufferBase+e;for(;t&&i==t.bufferBase;)t=t.parent;return new v(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,s,i,this.curContext,this.lookAhead,t)}recoverByDelete(t,e){let s=t<=this.p.parser.maxNode;s&&this.storeNode(t,this.pos,e,4),this.storeNode(0,this.pos,e,s?8:4),this.pos=this.reducePos=e,this.score-=190}canShift(t){for(let e=new U(this);;){let s=this.p.parser.stateSlot(e.state,4)||this.p.parser.hasAction(e.state,t);if(s==0)return!1;if((s&65536)==0)return!0;e.reduce(s)}}recoverByInsert(t){if(this.stack.length>=300)return[];let e=this.p.parser.nextStates(this.state);if(e.length>8||this.stack.length>=120){let i=[];for(let h=0,r;h<e.length;h+=2)(r=e[h+1])!=this.state&&this.p.parser.hasAction(r,t)&&i.push(e[h],r);if(this.stack.length<120)for(let h=0;i.length<8&&h<e.length;h+=2){let r=e[h+1];i.some((n,o)=>o&1&&n==r)||i.push(e[h],r)}e=i}let s=[];for(let i=0;i<e.length&&s.length<4;i+=2){let h=e[i+1];if(h==this.state)continue;let r=this.split();r.pushState(h,this.pos),r.storeNode(0,r.pos,r.pos,4,!0),r.shiftContext(e[i],this.pos),r.reducePos=this.pos,r.score-=200,s.push(r)}return s}forceReduce(){let{parser:t}=this.p,e=t.stateSlot(this.state,5);if((e&65536)==0)return!1;if(!t.validAction(this.state,e)){let s=e>>19,i=e&65535,h=this.stack.length-s*3;if(h<0||t.getGoto(this.stack[h],i,!1)<0){let r=this.findForcedReduction();if(r==null)return!1;e=r}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(e),!0}findForcedReduction(){let{parser:t}=this.p,e=[],s=(i,h)=>{if(!e.includes(i))return e.push(i),t.allActions(i,r=>{if(!(r&393216))if(r&65536){let n=(r>>19)-h;if(n>1){let o=r&65535,a=this.stack.length-n*3;if(a>=0&&t.getGoto(this.stack[a],o,!1)>=0)return n<<19|65536|o}}else{let n=s(r,h+1);if(n!=null)return n}})};return s(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:t}=this.p;return t.data[t.stateSlot(this.state,1)]==65535&&!t.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(t){if(this.state!=t.state||this.stack.length!=t.stack.length)return!1;for(let e=0;e<this.stack.length;e+=3)if(this.stack[e]!=t.stack[e])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(t){return this.p.parser.dialect.flags[t]}shiftContext(t,e){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,t,this,this.p.stream.reset(e)))}reduceContext(t,e){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,t,this,this.p.stream.reset(e)))}emitContext(){let t=this.buffer.length-1;(t<0||this.buffer[t]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let t=this.buffer.length-1;(t<0||this.buffer[t]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(t){if(t!=this.curContext.context){let e=new R(this.curContext.tracker,t);e.hash!=this.curContext.hash&&this.emitContext(),this.curContext=e}}setLookAhead(t){return t<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=t,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class R{constructor(t,e){this.tracker=t,this.context=e,this.hash=t.strict?t.hash(e):0}}class U{constructor(t){this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}reduce(t){let e=t&65535,s=t>>19;s==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(s-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],e,!0);this.state=i}}class A{constructor(t,e,s){this.stack=t,this.pos=e,this.index=s,this.buffer=t.buffer,this.index==0&&this.maybeNext()}static create(t,e=t.bufferBase+t.buffer.length){return new A(t,e,e-t.bufferBase)}maybeNext(){let t=this.stack.parent;t!=null&&(this.index=this.stack.bufferBase-t.bufferBase,this.stack=t,this.buffer=t.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new A(this.stack,this.pos,this.index)}}function x(l,t=Uint16Array){if(typeof l!="string")return l;let e=null;for(let s=0,i=0;s<l.length;){let h=0;for(;;){let r=l.charCodeAt(s++),n=!1;if(r==126){h=65535;break}r>=92&&r--,r>=34&&r--;let o=r-32;if(o>=46&&(o-=46,n=!0),h+=o,n)break;h*=46}e?e[i++]=h:e=new t(h)}return e}class P{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const z=new P;class H{constructor(t,e){this.input=t,this.ranges=e,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=z,this.rangeIndex=0,this.pos=this.chunkPos=e[0].from,this.range=e[0],this.end=e[e.length-1].to,this.readNext()}resolveOffset(t,e){let s=this.range,i=this.rangeIndex,h=this.pos+t;for(;h<s.from;){if(!i)return null;let r=this.ranges[--i];h-=s.from-r.to,s=r}for(;e<0?h>s.to:h>=s.to;){if(i==this.ranges.length-1)return null;let r=this.ranges[++i];h+=r.from-s.to,s=r}return h}clipPos(t){if(t>=this.range.from&&t<this.range.to)return t;for(let e of this.ranges)if(e.to>t)return Math.max(t,e.from);return this.end}peek(t){let e=this.chunkOff+t,s,i;if(e>=0&&e<this.chunk.length)s=this.pos+t,i=this.chunk.charCodeAt(e);else{let h=this.resolveOffset(t,1);if(h==null)return-1;if(s=h,s>=this.chunk2Pos&&s<this.chunk2Pos+this.chunk2.length)i=this.chunk2.charCodeAt(s-this.chunk2Pos);else{let r=this.rangeIndex,n=this.range;for(;n.to<=s;)n=this.ranges[++r];this.chunk2=this.input.chunk(this.chunk2Pos=s),s+this.chunk2.length>n.to&&(this.chunk2=this.chunk2.slice(0,n.to-s)),i=this.chunk2.charCodeAt(0)}}return s>=this.token.lookAhead&&(this.token.lookAhead=s+1),i}acceptToken(t,e=0){let s=e?this.resolveOffset(e,-1):this.pos;if(s==null||s<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=t,this.token.end=s}acceptTokenTo(t,e){this.token.value=t,this.token.end=e}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:t,chunkPos:e}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=t,this.chunk2Pos=e,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let t=this.input.chunk(this.pos),e=this.pos+t.length;this.chunk=e>this.range.to?t.slice(0,this.range.to-this.pos):t,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(t=1){for(this.chunkOff+=t;this.pos+t>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();t-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=t,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(t,e){if(e?(this.token=e,e.start=t,e.lookAhead=t+1,e.value=e.extended=-1):this.token=z,this.pos!=t){if(this.pos=t,t==this.end)return this.setDone(),this;for(;t<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;t>=this.range.to;)this.range=this.ranges[++this.rangeIndex];t>=this.chunkPos&&t<this.chunkPos+this.chunk.length?this.chunkOff=t-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(t,e){if(t>=this.chunkPos&&e<=this.chunkPos+this.chunk.length)return this.chunk.slice(t-this.chunkPos,e-this.chunkPos);if(t>=this.chunk2Pos&&e<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(t-this.chunk2Pos,e-this.chunk2Pos);if(t>=this.range.from&&e<=this.range.to)return this.input.read(t,e);let s="";for(let i of this.ranges){if(i.from>=e)break;i.to>t&&(s+=this.input.read(Math.max(i.from,t),Math.min(i.to,e)))}return s}}class m{constructor(t,e){this.data=t,this.id=e}token(t,e){let{parser:s}=e.p;O(this.data,t,e,this.id,s.data,s.tokenPrecTable)}}m.prototype.contextual=m.prototype.fallback=m.prototype.extend=!1;class W{constructor(t,e,s){this.precTable=e,this.elseToken=s,this.data=typeof t=="string"?x(t):t}token(t,e){let s=t.pos,i=0;for(;;){let h=t.next<0,r=t.resolveOffset(1,1);if(O(this.data,t,e,0,this.data,this.precTable),t.token.value>-1)break;if(this.elseToken==null)return;if(h||i++,r==null)break;t.reset(r,t.token)}i&&(t.reset(s,t.token),t.acceptToken(this.elseToken,i))}}W.prototype.contextual=m.prototype.fallback=m.prototype.extend=!1;class Z{constructor(t,e={}){this.token=t,this.contextual=!!e.contextual,this.fallback=!!e.fallback,this.extend=!!e.extend}}function O(l,t,e,s,i,h){let r=0,n=1<<s,{dialect:o}=e.p.parser;t:for(;(n&l[r])!=0;){let a=l[r+1];for(let c=r+3;c<a;c+=2)if((l[c+1]&n)>0){let p=l[c];if(o.allows(p)&&(t.token.value==-1||t.token.value==p||q(p,t.token.value,i,h))){t.acceptToken(p);break}}let u=t.next,f=0,d=l[r+2];if(t.next<0&&d>f&&l[a+d*3-3]==65535){r=l[a+d*3-1];continue t}for(;f<d;){let c=f+d>>1,p=a+c+(c<<1),b=l[p],M=l[p+1]||65536;if(u<b)d=c;else if(u>=M)f=c+1;else{r=l[p+2],t.advance();continue t}}break}}function I(l,t,e){for(let s=t,i;(i=l[s])!=65535;s++)if(i==e)return s-t;return-1}function q(l,t,e,s){let i=I(e,s,t);return i<0||I(e,s,l)<i}const g=typeof process<"u"&&N&&/\bparse\b/.test(N.LOG);let T=null;function D(l,t,e){let s=l.cursor(G.IncludeAnonymous);for(s.moveTo(t);;)if(!(e<0?s.childBefore(t):s.childAfter(t)))for(;;){if((e<0?s.to<t:s.from>t)&&!s.type.isError)return e<0?Math.max(0,Math.min(s.to-1,t-25)):Math.min(l.length,Math.max(s.from+1,t+25));if(e<0?s.prevSibling():s.nextSibling())break;if(!s.parent())return e<0?0:l.length}}class J{constructor(t,e){this.fragments=t,this.nodeSet=e,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let t=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(t){for(this.safeFrom=t.openStart?D(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?D(t.tree,t.to+t.offset,-1)-t.offset:t.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(t.tree),this.start.push(-t.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(t<this.nextStart)return null;for(;this.fragment&&this.safeTo<=t;)this.nextFragment();if(!this.fragment)return null;for(;;){let e=this.trees.length-1;if(e<0)return this.nextFragment(),null;let s=this.trees[e],i=this.index[e];if(i==s.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let h=s.children[i],r=this.start[e]+s.positions[i];if(r>t)return this.nextStart=r,null;if(h instanceof S){if(r==t){if(r<this.safeFrom)return null;let n=r+h.length;if(n<=this.safeTo){let o=h.prop(y.lookAhead);if(!o||n+o<this.fragment.to)return h}}this.index[e]++,r+h.length>=Math.max(this.safeFrom,t)&&(this.trees.push(h),this.start.push(r),this.index.push(0))}else this.index[e]++,this.nextStart=r+h.length}}}class K{constructor(t,e){this.stream=e,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map(s=>new P)}getActions(t){let e=0,s=null,{parser:i}=t.p,{tokenizers:h}=i,r=i.stateSlot(t.state,3),n=t.curContext?t.curContext.hash:0,o=0;for(let a=0;a<h.length;a++){if((1<<a&r)==0)continue;let u=h[a],f=this.tokens[a];if(!(s&&!u.fallback)&&((u.contextual||f.start!=t.pos||f.mask!=r||f.context!=n)&&(this.updateCachedToken(f,u,t),f.mask=r,f.context=n),f.lookAhead>f.end+25&&(o=Math.max(f.lookAhead,o)),f.value!=0)){let d=e;if(f.extended>-1&&(e=this.addActions(t,f.extended,f.end,e)),e=this.addActions(t,f.value,f.end,e),!u.extend&&(s=f,e>d))break}}for(;this.actions.length>e;)this.actions.pop();return o&&t.setLookAhead(o),!s&&t.pos==this.stream.end&&(s=new P,s.value=t.p.parser.eofTerm,s.start=s.end=t.pos,e=this.addActions(t,s.value,s.end,e)),this.mainToken=s,this.actions}getMainToken(t){if(this.mainToken)return this.mainToken;let e=new P,{pos:s,p:i}=t;return e.start=s,e.end=Math.min(s+1,i.stream.end),e.value=s==i.stream.end?i.parser.eofTerm:0,e}updateCachedToken(t,e,s){let i=this.stream.clipPos(s.pos);if(e.token(this.stream.reset(i,t),s),t.value>-1){let{parser:h}=s.p;for(let r=0;r<h.specialized.length;r++)if(h.specialized[r]==t.value){let n=h.specializers[r](this.stream.read(t.start,t.end),s);if(n>=0&&s.p.parser.dialect.allows(n>>1)){(n&1)==0?t.value=n>>1:t.extended=n>>1;break}}}else t.value=0,t.end=this.stream.clipPos(i+1)}putAction(t,e,s,i){for(let h=0;h<i;h+=3)if(this.actions[h]==t)return i;return this.actions[i++]=t,this.actions[i++]=e,this.actions[i++]=s,i}addActions(t,e,s,i){let{state:h}=t,{parser:r}=t.p,{data:n}=r;for(let o=0;o<2;o++)for(let a=r.stateSlot(h,o?2:1);;a+=3){if(n[a]==65535)if(n[a+1]==1)a=k(n,a+2);else{i==0&&n[a+1]==2&&(i=this.putAction(k(n,a+2),e,s,i));break}n[a]==e&&(i=this.putAction(k(n,a+1),e,s,i))}return i}}class Q{constructor(t,e,s,i){this.parser=t,this.input=e,this.ranges=i,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new H(e,i),this.tokens=new K(t,this.stream),this.topTerm=t.top[1];let{from:h}=i[0];this.stacks=[v.start(this,t.top[0],h)],this.fragments=s.length&&this.stream.end-h>t.bufferLength*4?new J(s,t.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let t=this.stacks,e=this.minStackPos,s=this.stacks=[],i,h;if(this.bigReductionCount>300&&t.length==1){let[r]=t;for(;r.forceReduce()&&r.stack.length&&r.stack[r.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let r=0;r<t.length;r++){let n=t[r];for(;;){if(this.tokens.mainToken=null,n.pos>e)s.push(n);else{if(this.advanceStack(n,s,t))continue;{i||(i=[],h=[]),i.push(n);let o=this.tokens.getMainToken(n);h.push(o.value,o.end)}}break}}if(!s.length){let r=i&&X(i);if(r)return g&&console.log("Finish with "+this.stackID(r)),this.stackToTree(r);if(this.parser.strict)throw g&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+e);this.recovering||(this.recovering=5)}if(this.recovering&&i){let r=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,h,s);if(r)return g&&console.log("Force-finish "+this.stackID(r)),this.stackToTree(r.forceAll())}if(this.recovering){let r=this.recovering==1?1:this.recovering*3;if(s.length>r)for(s.sort((n,o)=>o.score-n.score);s.length>r;)s.pop();s.some(n=>n.reducePos>e)&&this.recovering--}else if(s.length>1){t:for(let r=0;r<s.length-1;r++){let n=s[r];for(let o=r+1;o<s.length;o++){let a=s[o];if(n.sameState(a)||n.buffer.length>500&&a.buffer.length>500)if((n.score-a.score||n.buffer.length-a.buffer.length)>0)s.splice(o--,1);else{s.splice(r--,1);continue t}}}s.length>12&&(s.sort((r,n)=>n.score-r.score),s.splice(12,s.length-12))}this.minStackPos=s[0].pos;for(let r=1;r<s.length;r++)s[r].pos<this.minStackPos&&(this.minStackPos=s[r].pos);return null}stopAt(t){if(this.stoppedAt!=null&&this.stoppedAt<t)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=t}advanceStack(t,e,s){let i=t.pos,{parser:h}=this,r=g?this.stackID(t)+" -> ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return t.forceReduce()?t:null;if(this.fragments){let a=t.curContext&&t.curContext.tracker.strict,u=a?t.curContext.hash:0;for(let f=this.fragments.nodeAt(i);f;){let d=this.parser.nodeSet.types[f.type.id]==f.type?h.getGoto(t.state,f.type.id):-1;if(d>-1&&f.length&&(!a||(f.prop(y.contextHash)||0)==u))return t.useNode(f,d),g&&console.log(r+this.stackID(t)+` (via reuse of ${h.getName(f.type.id)})`),!0;if(!(f instanceof S)||f.children.length==0||f.positions[0]>0)break;let c=f.children[0];if(c instanceof S&&f.positions[0]==0)f=c;else break}}let n=h.stateSlot(t.state,4);if(n>0)return t.reduce(n),g&&console.log(r+this.stackID(t)+` (via always-reduce ${h.getName(n&65535)})`),!0;if(t.stack.length>=8400)for(;t.stack.length>6e3&&t.forceReduce(););let o=this.tokens.getActions(t);for(let a=0;a<o.length;){let u=o[a++],f=o[a++],d=o[a++],c=a==o.length||!s,p=c?t:t.split(),b=this.tokens.mainToken;if(p.apply(u,f,b?b.start:p.pos,d),g&&console.log(r+this.stackID(p)+` (via ${(u&65536)==0?"shift":`reduce of ${h.getName(u&65535)}`} for ${h.getName(f)} @ ${i}${p==t?"":", split"})`),c)return!0;p.pos>i?e.push(p):s.push(p)}return!1}advanceFully(t,e){let s=t.pos;for(;;){if(!this.advanceStack(t,null,null))return!1;if(t.pos>s)return B(t,e),!0}}runRecovery(t,e,s){let i=null,h=!1;for(let r=0;r<t.length;r++){let n=t[r],o=e[r<<1],a=e[(r<<1)+1],u=g?this.stackID(n)+" -> ":"";if(n.deadEnd&&(h||(h=!0,n.restart(),g&&console.log(u+this.stackID(n)+" (restarted)"),this.advanceFully(n,s))))continue;let f=n.split(),d=u;for(let c=0;c<10&&f.forceReduce()&&(g&&console.log(d+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,s));c++)g&&(d=this.stackID(f)+" -> ");for(let c of n.recoverByInsert(o))g&&console.log(u+this.stackID(c)+" (via recover-insert)"),this.advanceFully(c,s);this.stream.end>n.pos?(a==n.pos&&(a++,o=0),n.recoverByDelete(o,a),g&&console.log(u+this.stackID(n)+` (via recover-delete ${this.parser.getName(o)})`),B(n,s)):(!i||i.score<f.score)&&(i=f)}return i}stackToTree(t){return t.close(),S.build({buffer:A.create(t),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:t.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(t){let e=(T||(T=new WeakMap)).get(t);return e||T.set(t,e=String.fromCodePoint(this.nextStackID++)),e+t}}function B(l,t){for(let e=0;e<t.length;e++){let s=t[e];if(s.pos==l.pos&&s.sameState(l)){t[e].score<l.score&&(t[e]=l);return}}t.push(l)}class V{constructor(t,e,s){this.source=t,this.flags=e,this.disabled=s}allows(t){return!this.disabled||this.disabled[t]==0}}const C=l=>l;class _{constructor(t){this.start=t.start,this.shift=t.shift||C,this.reduce=t.reduce||C,this.reuse=t.reuse||C,this.hash=t.hash||(()=>0),this.strict=t.strict!==!1}}class w extends L{constructor(t){if(super(),this.wrappers=[],t.version!=14)throw new RangeError(`Parser version (${t.version}) doesn't match runtime version (14)`);let e=t.nodeNames.split(" ");this.minRepeatTerm=e.length;for(let n=0;n<t.repeatNodeCount;n++)e.push("");let s=Object.keys(t.topRules).map(n=>t.topRules[n][1]),i=[];for(let n=0;n<e.length;n++)i.push([]);function h(n,o,a){i[n].push([o,o.deserialize(String(a))])}if(t.nodeProps)for(let n of t.nodeProps){let o=n[0];typeof o=="string"&&(o=y[o]);for(let a=1;a<n.length;){let u=n[a++];if(u>=0)h(u,o,n[a++]);else{let f=n[a+-u];for(let d=-u;d>0;d--)h(n[a++],o,f);a++}}}this.nodeSet=new $(e.map((n,o)=>E.define({name:o>=this.minRepeatTerm?void 0:n,id:o,props:i[o],top:s.indexOf(o)>-1,error:o==0,skipped:t.skippedNodes&&t.skippedNodes.indexOf(o)>-1}))),t.propSources&&(this.nodeSet=this.nodeSet.extend(...t.propSources)),this.strict=!1,this.bufferLength=j;let r=x(t.tokenData);this.context=t.context,this.specializerSpecs=t.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let n=0;n<this.specializerSpecs.length;n++)this.specialized[n]=this.specializerSpecs[n].term;this.specializers=this.specializerSpecs.map(F),this.states=x(t.states,Uint32Array),this.data=x(t.stateData),this.goto=x(t.goto),this.maxTerm=t.maxTerm,this.tokenizers=t.tokenizers.map(n=>typeof n=="number"?new m(r,n):n),this.topRules=t.topRules,this.dialects=t.dialects||{},this.dynamicPrecedences=t.dynamicPrecedences||null,this.tokenPrecTable=t.tokenPrec,this.termNames=t.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(t,e,s){let i=new Q(this,t,e,s);for(let h of this.wrappers)i=h(i,t,e,s);return i}getGoto(t,e,s=!1){let i=this.goto;if(e>=i[0])return-1;for(let h=i[e+1];;){let r=i[h++],n=r&1,o=i[h++];if(n&&s)return o;for(let a=h+(r>>1);h<a;h++)if(i[h]==t)return o;if(n)return-1}}hasAction(t,e){let s=this.data;for(let i=0;i<2;i++)for(let h=this.stateSlot(t,i?2:1),r;;h+=3){if((r=s[h])==65535)if(s[h+1]==1)r=s[h=k(s,h+2)];else{if(s[h+1]==2)return k(s,h+2);break}if(r==e||r==0)return k(s,h+1)}return 0}stateSlot(t,e){return this.states[t*6+e]}stateFlag(t,e){return(this.stateSlot(t,0)&e)>0}validAction(t,e){return!!this.allActions(t,s=>s==e?!0:null)}allActions(t,e){let s=this.stateSlot(t,4),i=s?e(s):void 0;for(let h=this.stateSlot(t,1);i==null;h+=3){if(this.data[h]==65535)if(this.data[h+1]==1)h=k(this.data,h+2);else break;i=e(k(this.data,h+1))}return i}nextStates(t){let e=[];for(let s=this.stateSlot(t,1);;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=k(this.data,s+2);else break;if((this.data[s+2]&1)==0){let i=this.data[s+1];e.some((h,r)=>r&1&&h==i)||e.push(this.data[s],i)}}return e}configure(t){let e=Object.assign(Object.create(w.prototype),this);if(t.props&&(e.nodeSet=this.nodeSet.extend(...t.props)),t.top){let s=this.topRules[t.top];if(!s)throw new RangeError(`Invalid top rule name ${t.top}`);e.top=s}return t.tokenizers&&(e.tokenizers=this.tokenizers.map(s=>{let i=t.tokenizers.find(h=>h.from==s);return i?i.to:s})),t.specializers&&(e.specializers=this.specializers.slice(),e.specializerSpecs=this.specializerSpecs.map((s,i)=>{let h=t.specializers.find(n=>n.from==s.external);if(!h)return s;let r=Object.assign(Object.assign({},s),{external:h.to});return e.specializers[i]=F(r),r})),t.contextTracker&&(e.context=t.contextTracker),t.dialect&&(e.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(e.strict=t.strict),t.wrap&&(e.wrappers=e.wrappers.concat(t.wrap)),t.bufferLength!=null&&(e.bufferLength=t.bufferLength),e}hasWrappers(){return this.wrappers.length>0}getName(t){return this.termNames?this.termNames[t]:String(t<=this.maxNode&&this.nodeSet.types[t].name||t)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(t){let e=this.dynamicPrecedences;return e==null?0:e[t]||0}parseDialect(t){let e=Object.keys(this.dialects),s=e.map(()=>!1);if(t)for(let h of t.split(" ")){let r=e.indexOf(h);r>=0&&(s[r]=!0)}let i=null;for(let h=0;h<e.length;h++)if(!s[h])for(let r=this.dialects[e[h]],n;(n=this.data[r++])!=65535;)(i||(i=new Uint8Array(this.maxTerm+1)))[n]=1;return new V(t,s,i)}static deserialize(t){return new w(t)}}function k(l,t){return l[t]|l[t+1]<<16}function X(l){let t=null;for(let e of l){let s=e.p.stoppedAt;(e.pos==e.p.stream.end||s!=null&&e.pos>s)&&e.p.parser.stateFlag(e.state,2)&&(!t||t.score<e.score)&&(t=e)}return t}function F(l){if(l.external){let t=l.extend?1:0;return(e,s)=>l.external(e,s)<<1|t}return l.get}export{_ as C,Z as E,w as L,W as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{color-scheme:light;--bg: #faf9f5;--surface: #ffffff;--surface-2: #f2f0e8;--surface-3: #e9e6db;--sidebar: #f0eee6;--border: #e2dfd3;--border-soft: #edebe1;--text: #1f1e1d;--text-2: #3d3d3a;--muted: #7c7a73;--accent: #c96442;--accent-hover: #b1553a;--accent-fg: #fffdf9;--accent-soft: rgba(201, 100, 66, .1);--accent-line: rgba(201, 100, 66, .36);--select: rgba(201, 100, 66, .28);--warn: #b0762c;--warn-soft: rgba(176, 118, 44, .12);--warn-line: rgba(176, 118, 44, .42);--danger: #bf4d43;--danger-soft: rgba(191, 77, 67, .1);--ok: #5b7f45;--add-bg: rgba(91, 127, 69, .13);--add-fg: #35512b;--del-bg: rgba(191, 77, 67, .1);--del-fg: #7d2f2a;--code-fg: #3d3d3a;--scroll: rgba(31, 30, 29, .2);--scroll-hover: rgba(31, 30, 29, .36);--shadow-sm: 0 1px 2px rgba(31, 30, 29, .07);--shadow-md: 0 6px 18px rgba(31, 30, 29, .1);--shadow-lg: 0 18px 44px rgba(31, 30, 29, .18);--ring: 0 0 0 3px rgba(201, 100, 66, .18);--mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;--sans: ui-sans-serif, system-ui, "Segoe UI", Inter, Roboto, sans-serif;--serif: ui-serif, "Iowan Old Style", Georgia, "Times New Roman", serif;--radius: 10px;--radius-lg: 16px;--sidebar-w: 276px;--files-w: 260px;--search-w: 320px;--git-w: 320px;--ask-w: 380px;--cm-key: #9a5bb0;--cm-str: #5b7f45;--cm-num: #b0762c;--cm-comment: #8a8880;--cm-fn: #4f7cac;--cm-type: #3f8f8a;--cm-prop: #a05063;--cm-const: #b1553a;--cm-op: #7c7a73;--cm-selection: rgba(201, 100, 66, .28);--cm-active: rgba(31, 30, 29, .035);--cm-match: rgba(176, 118, 44, .26);--lane-0: #c96442;--lane-1: #4f7cac;--lane-2: #5b7f45;--lane-3: #9a6bb0;--lane-4: #b0762c;--lane-5: #3f8f8a;--lane-6: #a05063}:root[data-theme=dark]{color-scheme:dark;--bg: #262624;--surface: #30302e;--surface-2: #3a3a37;--surface-3: #454542;--sidebar: #1f1e1d;--border: #3e3e3b;--border-soft: #343432;--text: #f5f4ee;--text-2: #d4d1c8;--muted: #918e86;--accent: #d97757;--accent-hover: #e08b6e;--accent-fg: #251610;--accent-soft: rgba(217, 119, 87, .14);--accent-line: rgba(217, 119, 87, .42);--select: rgba(217, 119, 87, .34);--warn: #d9a05b;--warn-soft: rgba(217, 160, 91, .14);--warn-line: rgba(217, 160, 91, .42);--danger: #e0776a;--danger-soft: rgba(224, 119, 106, .13);--ok: #8fb06b;--add-bg: rgba(143, 176, 107, .13);--add-fg: #cfe0b8;--del-bg: rgba(224, 119, 106, .13);--del-fg: #f0c6c0;--code-fg: #d4d1c8;--scroll: rgba(245, 244, 238, .16);--scroll-hover: rgba(245, 244, 238, .3);--shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);--shadow-md: 0 6px 18px rgba(0, 0, 0, .36);--shadow-lg: 0 18px 44px rgba(0, 0, 0, .5);--ring: 0 0 0 3px rgba(217, 119, 87, .22);--lane-0: #d97757;--lane-1: #7aa5d2;--lane-2: #8fb06b;--lane-3: #b98fd0;--lane-4: #d9a05b;--lane-5: #6fbdb6;--lane-6: #d2818f;--cm-key: #c39ad8;--cm-str: #a3c47f;--cm-num: #e0b276;--cm-comment: #86837b;--cm-fn: #8db6e2;--cm-type: #74c9c2;--cm-prop: #e0949f;--cm-const: #e79674;--cm-op: #a9a69d;--cm-selection: rgba(217, 119, 87, .34);--cm-active: rgba(245, 244, 238, .045);--cm-match: rgba(217, 160, 91, .3)}*{box-sizing:border-box}html,body,#root{height:100%}html,body{overflow:hidden;overscroll-behavior:none}body{margin:0;background:var(--bg);color:var(--text);font-family:var(--sans);font-size:14px;line-height:1.6;-webkit-font-smoothing:antialiased}button{font:inherit;color:inherit;background:none;border:none;cursor:pointer}:focus-visible{outline:2px solid var(--accent);outline-offset:2px}::selection{background:var(--select)}*{scrollbar-width:thin;scrollbar-color:var(--scroll) transparent}::-webkit-scrollbar{width:11px;height:11px}::-webkit-scrollbar-track,::-webkit-scrollbar-corner{background:transparent}::-webkit-scrollbar-thumb{background:var(--scroll);border:3px solid transparent;background-clip:content-box;border-radius:999px}::-webkit-scrollbar-thumb:hover{background:var(--scroll-hover);background-clip:content-box}.app{display:grid;grid-template-columns:[sidebar] var(--sidebar-w) [files] auto [search] auto [git] auto [main] minmax(0,1fr) [ask] auto;height:100%}.sidebar,.main,.sidepane{grid-row:1}.sidebar{grid-column:sidebar}.sidepane--files{grid-column:files;width:var(--files-w)}.sidepane--search{grid-column:search;width:var(--search-w)}.sidepane--git{grid-column:git;width:var(--git-w)}.main{grid-column:main}.sidepane--ask{grid-column:ask;width:var(--ask-w)}.pane-resizer{grid-row:1;display:flex;justify-content:center;position:relative;z-index:5;width:9px;cursor:col-resize;touch-action:none}.pane-resizer--left{justify-self:end;margin-right:-4px}.pane-resizer--right{justify-self:start;margin-left:-4px}.pane-resizer--sidebar{grid-column:sidebar}.pane-resizer--files{grid-column:files}.pane-resizer--search{grid-column:search}.pane-resizer--git{grid-column:git}.pane-resizer--ask{grid-column:ask}.pane-resizer__line{width:2px;border-radius:2px;background:transparent;transition:background .12s ease}.pane-resizer:hover .pane-resizer__line,.pane-resizer:active .pane-resizer__line,.pane-resizer:focus-visible .pane-resizer__line{background:var(--accent)}.pane-resizer:focus-visible{outline:none}body.is-resizing{cursor:col-resize;-webkit-user-select:none;user-select:none}.main{display:flex;flex-direction:column;min-width:0;min-height:0;background:var(--bg);container-type:inline-size}.main--zoomed{position:fixed;top:0;right:0;bottom:0;left:0;z-index:32}.sidebar{display:flex;flex-direction:column;min-height:0;background:var(--sidebar);border-right:1px solid var(--border)}.sidebar__head{display:flex;align-items:center;gap:9px;padding:14px 14px 14px 16px}.brand{font-family:var(--serif);font-size:16px;letter-spacing:-.01em;flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.dot{width:7px;height:7px;border-radius:50%;background:var(--danger);flex:none}.dot--on{background:var(--ok)}.sidebar__section{display:flex;align-items:center;gap:6px;width:100%;padding:14px 16px 6px 10px;font-size:11px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);text-align:left}.sidebar__section--btn:hover{color:var(--text-2)}.sidebar__section-name{flex:1;min-width:0}.sidebar__count{font-family:var(--mono);font-weight:500;letter-spacing:0;font-size:11px;color:var(--muted);opacity:.75}.sidebar__chev{flex:none;width:12px;height:12px;transition:transform .15s ease}.sidebar__chev--open{transform:rotate(90deg)}.fssearch--sidebar{margin:2px 12px 4px}.sidebar__scroll{overflow-y:auto;flex:1;min-height:0;padding-bottom:8px}.row{display:flex;align-items:center;gap:2px;width:calc(100% - 16px);margin:1px 8px;padding:7px 8px 7px 10px;border-radius:8px}.row:hover{background:var(--surface-2)}.sidebar .row{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}.row--active{background:var(--surface-2)}.row--active .row__title{color:var(--text);font-weight:560}.row--active{box-shadow:inset 2px 0 0 var(--accent)}.row--selected,.row--selected:hover{background:var(--select)}.row__main{display:block;text-align:left;padding:0;min-width:0;flex:1}.row__edit{flex:none;display:grid;place-items:center;width:24px;height:24px;border-radius:6px;color:var(--muted);font-size:13px;opacity:0;transition:opacity .12s ease,background .12s ease}.row:hover .row__edit{opacity:1}.row__edit:hover{color:var(--text);background:var(--surface-3)}.row__edit:focus-visible{opacity:1}@media(hover:none){.row__edit{opacity:1}}.row__restore{flex:none;padding:4px 10px;border-radius:999px;border:1px solid var(--border);color:var(--text-2);font-size:11.5px;white-space:nowrap}.row__restore:hover{background:var(--surface-2);color:var(--text);border-color:var(--surface-3)}@media(max-width:860px){.row__restore{min-height:40px;padding:0 12px;display:inline-flex;align-items:center}}.row__head{display:flex;align-items:center;gap:8px;min-width:0}.row__title{display:block;min-width:0;flex:1 1 auto;color:var(--text-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.row__pin{width:11px;height:11px;margin:0 4px -1px 0;color:var(--accent);opacity:.8}.row__project{flex:none;max-width:42%;color:var(--muted);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.row__meta{display:block;font-size:12px;line-height:1.45;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.row__state{display:inline-flex;align-items:center;gap:5px}.row__state-dot{width:6px;height:6px;flex:none;border-radius:50%;background:currentColor}.row__state--running{color:var(--accent)}.row__state--starting{color:var(--accent);opacity:.6}.row__state--reconnecting{color:var(--accent);animation:state-breathe 1.9s ease-in-out infinite}.row__state--waiting{color:var(--warn)}.row__state--halted{color:var(--warn);opacity:.8}.row__state--ready{color:var(--ok)}.row__state--error{color:var(--danger)}.row__state--closed,.row__state--fresh{color:var(--muted)}@keyframes state-breathe{0%,to{opacity:.72}50%{opacity:.32}}.sidebar__foot{padding:12px 12px calc(12px + env(safe-area-inset-bottom));border-top:1px solid var(--border);display:flex;gap:8px}.sidebar__foot .btn{flex:1;justify-content:center}.rename{width:100%;background:var(--surface);color:var(--text);border:1px solid var(--accent);border-radius:7px;padding:3px 7px;font:inherit;box-shadow:var(--ring)}.rename:focus{outline:none}.rename--title{font-weight:560;max-width:420px}.btn{display:inline-flex;align-items:center;gap:6px;padding:7px 13px;border-radius:8px;border:1px solid var(--border);background:var(--surface);color:var(--text-2);font-size:13px;font-weight:500;white-space:nowrap;text-decoration:none;transition:background .12s ease,border-color .12s ease,color .12s ease}.btn:hover{background:var(--surface-2);color:var(--text)}.btn--primary{background:var(--accent);border-color:var(--accent);color:var(--accent-fg)}.btn--primary:hover{background:var(--accent-hover);border-color:var(--accent-hover);color:var(--accent-fg)}.btn--warn{background:var(--warn);border-color:var(--warn);color:var(--accent-fg);font-weight:600}.btn--warn:hover{filter:brightness(1.06);color:var(--accent-fg)}.btn--ghost{background:transparent;border-color:transparent;color:var(--text-2)}.btn--ghost:hover{background:var(--surface-2)}.btn:disabled{opacity:.4;cursor:default;background:var(--surface);border-color:var(--border);color:var(--text-2)}.btn--primary:disabled{background:var(--accent);border-color:var(--accent);color:var(--accent-fg)}.theme-btn{flex:none;display:grid;place-items:center;width:28px;height:28px;border-radius:8px;color:var(--muted)}.theme-btn:hover{background:var(--surface-2);color:var(--text)}.theme-btn svg{width:16px;height:16px}.theme-btn[aria-pressed=true]{color:var(--accent);background:var(--accent-soft)}.topbar{display:flex;align-items:center;gap:10px;padding:10px 16px;border-bottom:1px solid var(--border);background:var(--bg);flex:none;flex-wrap:wrap;min-width:0}.topbar__tools{display:flex;align-items:center;gap:10px;min-width:0;margin-left:auto;flex-wrap:wrap;justify-content:flex-end;row-gap:6px}@container (max-width: 780px){.topbar .clock{display:none}}@container (max-width: 660px){.topbar .badge--cost{display:none}}@container (max-width: 520px){.topbar .usage{display:none}}.topbar .select__trigger{max-width:min(40vw,190px)}.topbar__id{display:flex;flex-direction:column;min-width:0;flex:0 1 auto;line-height:1.3}.topbar__head{display:flex;align-items:center;gap:8px;min-width:0}.topbar__title{display:block;text-align:left;font-family:var(--serif);font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0;max-width:100%;padding:0}.topbar__title:hover:not(:disabled){color:var(--accent)}.topbar__title:disabled{cursor:default}.topbar__project{flex:0 1 auto;min-width:0;max-width:12em;padding-left:8px;border-left:1px solid var(--border);color:var(--muted);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cwd{position:relative;min-width:0;z-index:20}.cwd__toggle{display:flex;align-items:center;gap:3px;width:100%;min-width:0;padding:0;text-align:left;color:var(--muted)}.cwd__toggle:hover{color:var(--text-2)}.cwd__chev{flex:none;width:10px;height:10px;transition:transform .15s ease}.cwd__chev--open{transform:rotate(90deg)}.cwd__short{font-family:var(--mono);font-size:11.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cwd__pop{position:absolute;top:calc(100% + 6px);left:0;display:flex;align-items:flex-end;gap:10px;width:max-content;min-width:min(320px,88vw);max-width:min(620px,88vw);padding:9px 10px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-lg);animation:pop .12s ease-out}.cwd__full{flex:1;min-width:0;font-family:var(--mono);font-size:12px;line-height:1.5;color:var(--text-2);word-break:break-all;-webkit-user-select:text;user-select:text}.cwd__copy{flex:none;padding:3px 9px;font-size:12px;white-space:nowrap}.badge{font-size:12px;font-family:var(--mono);color:var(--muted);background:var(--surface);padding:4px 10px;border:1px solid var(--border);border-radius:999px;white-space:nowrap;flex:none;max-width:40vw;overflow:hidden;text-overflow:ellipsis}.badge--live{color:var(--accent);border-color:var(--accent-line);background:var(--accent-soft)}.badge--wait{color:var(--warn);border-color:var(--warn-line);background:var(--warn-soft)}.menu-btn{display:none}.meters-refresh{display:grid;place-items:center;flex:none;width:26px;height:26px;border-radius:8px;color:var(--muted);transition:background .12s ease,color .12s ease}.meters-refresh:hover:not(:disabled){background:var(--surface-2);color:var(--accent)}.meters-refresh:disabled{opacity:.4;cursor:default}.meters-refresh svg{width:14px;height:14px}.meters-refresh.is-busy svg{animation:meters-spin .8s linear infinite}@keyframes meters-spin{to{transform:rotate(360deg)}}.usage{display:grid;grid-template-columns:auto minmax(44px,72px) auto auto;align-items:center;gap:2px 7px;flex:none;padding:4px 11px;border:1px solid var(--border);border-radius:12px;background:var(--surface);font-size:11px;line-height:1.3;color:var(--muted);cursor:default}.usage__label{font-family:var(--mono);white-space:nowrap}.usage__track{height:4px;border-radius:999px;background:var(--surface-3);overflow:hidden}.usage__fill{display:block;height:100%;border-radius:999px;background:var(--accent);transition:width .3s ease,background .2s ease}.usage__fill--warn{background:var(--warn)}.usage__fill--over{background:var(--danger)}.usage__pct{font-family:var(--mono);font-variant-numeric:tabular-nums;text-align:right;color:var(--text-2);white-space:nowrap}.usage__reset{font-family:var(--mono);font-variant-numeric:tabular-nums;color:var(--muted);white-space:nowrap;padding-left:2px}.contextbar{display:flex;align-items:center;gap:9px;flex:none;padding:7px 16px;border-bottom:1px solid var(--border);background:var(--bg);font-size:11px;line-height:1.3;color:var(--muted)}.contextbar__label{font-family:var(--mono);white-space:nowrap}.contextbar__track{flex:1 1 auto;min-width:0;height:4px;border-radius:999px;background:var(--surface-3);overflow:hidden}.contextbar__fill{display:block;height:100%;border-radius:999px;background:var(--accent);transition:width .3s ease,background .2s ease}.contextbar__fill--warn{background:var(--warn)}.contextbar__fill--over{background:var(--danger)}.contextbar__pct{font-family:var(--mono);font-variant-numeric:tabular-nums;text-align:right;color:var(--text-2);white-space:nowrap}.clock{display:flex;flex-direction:column;align-items:flex-end;flex:none;font-family:var(--mono);font-variant-numeric:tabular-nums;line-height:1.3;cursor:default}.clock__time{font-size:13px;color:var(--text-2)}.clock__date{font-size:10.5px;color:var(--muted);white-space:nowrap}.select{position:relative;flex:none}.select__trigger{display:flex;align-items:center;gap:6px;max-width:40vw;padding:4px 8px 4px 11px;border:1px solid var(--border);border-radius:999px;background:var(--surface);color:var(--text-2);font-size:12px;font-family:var(--mono);transition:background .12s ease,border-color .12s ease}.select__trigger:hover{background:var(--surface-2);border-color:var(--surface-3)}.select--open .select__trigger{border-color:var(--accent-line);background:var(--accent-soft);color:var(--text)}.select__value{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select__chev{flex:none;width:12px;height:12px;color:var(--muted);transition:transform .15s ease}.select--open .select__chev{transform:rotate(180deg)}.select__menu{position:absolute;top:calc(100% + 6px);right:0;z-index:25;min-width:232px;max-width:min(340px,92vw);max-height:min(320px,60vh);overflow-y:auto;padding:5px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-lg);animation:pop .12s ease-out}@keyframes pop{0%{opacity:0;transform:translateY(-4px)}}.select__option{display:grid;grid-template-columns:16px 1fr;gap:2px 8px;width:100%;padding:7px 9px;border-radius:7px;text-align:left}.select__option.is-cursor{background:var(--surface-2)}.select__option.is-on .select__label{color:var(--accent)}.select__check{grid-row:1;color:var(--accent);font-size:12px;line-height:1.5}.select__label{grid-row:1;font-family:var(--mono);font-size:12.5px;color:var(--text);overflow-wrap:anywhere}.select__hint{grid-row:2;grid-column:2;font-size:11.5px;line-height:1.4;color:var(--muted)}.select__suffix{flex:none;padding:1px 6px;border-radius:999px;background:var(--accent-soft);color:var(--accent);font-size:11px}.select__suffix--hot{background:var(--accent);color:var(--accent-fg);font-weight:560}.modelmenu{min-width:296px}.modelmenu__head{padding:4px 9px 6px;font-size:11px;letter-spacing:.04em;text-transform:uppercase;color:var(--muted)}.modelmenu__sep{height:1px;margin:5px 4px;background:var(--border-soft)}.modelmenu__row{display:flex;align-items:center;gap:10px;width:100%;padding:7px 9px;border-radius:7px;text-align:left}.modelmenu__row--btn:hover{background:var(--surface-2)}.modelmenu__label{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0;font-size:12.5px;color:var(--text)}.modelmenu__desc{font-size:11.5px;line-height:1.35;color:var(--muted)}.modelmenu__levels{flex:none;display:flex;gap:2px;padding:2px;border:1px solid var(--border);border-radius:999px;background:var(--surface-2)}.modelmenu__level{padding:3px 8px;border-radius:999px;font-family:var(--mono);font-size:11px;color:var(--muted);transition:background .12s ease,color .12s ease}.modelmenu__level:hover{color:var(--text)}.modelmenu__level.is-on{background:var(--accent);color:var(--accent-fg)}.switch{flex:none;position:relative;width:30px;height:17px;border-radius:999px;background:var(--surface-3);transition:background .14s ease}.switch.is-on{background:var(--accent)}.switch__knob{position:absolute;top:2px;left:2px;width:13px;height:13px;border-radius:999px;background:var(--surface);box-shadow:var(--shadow-sm);transition:transform .14s ease}.switch.is-on .switch__knob{transform:translate(13px)}.transcript{flex:1;min-height:0;overflow-y:auto;padding:24px 16px 8px}.stream{max-width:760px;margin:0 auto;display:flex;flex-direction:column;gap:16px}.msg--user{align-self:flex-end;max-width:82%;background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius-lg) var(--radius-lg) 4px var(--radius-lg);padding:10px 15px;color:var(--text);white-space:pre-wrap;overflow-wrap:anywhere}.msg--user__images{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:8px}.msg--user__image{width:88px;height:88px;object-fit:cover;border-radius:10px;border:1px solid var(--border);background:var(--surface)}.msg--assistant{color:var(--text);line-height:1.72;overflow-wrap:anywhere}.markdown-preview.msg--assistant__body{padding:0;font-family:inherit;font-size:inherit;line-height:inherit;color:inherit}.copybtn{flex:none;padding:3px 9px;border:1px solid var(--border);border-radius:7px;background:var(--surface);color:var(--muted);font-size:11.5px;line-height:1.45;white-space:nowrap;transition:opacity .12s ease,background .12s ease,color .12s ease,border-color .12s ease}.copybtn:hover{background:var(--surface-2);color:var(--text)}.copybtn--done{color:var(--ok);border-color:var(--ok)}.codeblock{position:relative}.codeblock__copy{position:absolute;top:8px;right:8px;z-index:1;opacity:0}.codeblock:hover .codeblock__copy,.codeblock__copy:focus-visible{opacity:1}.markdown-preview .codeblock{margin:1em 0}.markdown-preview .codeblock>pre{margin:0}.markdown-preview.msg--assistant__body>:last-child{margin-bottom:0}.msg--assistant__foot{display:flex;justify-content:flex-end;margin-top:4px}.msg--assistant__foot .copybtn{opacity:0}.msg--assistant:hover .msg--assistant__foot .copybtn,.msg--assistant__foot .copybtn:focus-visible{opacity:1}@media(hover:none){.codeblock{display:flex;flex-direction:column;align-items:flex-end;gap:6px}.codeblock>pre{width:100%}.codeblock__copy{position:static;order:-1;opacity:1}.msg--assistant__foot .copybtn{opacity:1}}.caret{display:inline-block;width:7px;height:1.05em;vertical-align:text-bottom;background:var(--accent);border-radius:1px;animation:blink 1s steps(2,start) infinite}@keyframes blink{50%{opacity:0}}.thinking{border-left:2px solid var(--border);padding-left:14px;color:var(--muted);font-size:13px;font-style:italic;white-space:pre-wrap}.transcript__more{align-self:center;display:inline-flex;align-items:center;padding:6px 16px;border-radius:999px;border:1px solid var(--border);background:var(--surface);color:var(--muted);font-size:12.5px}.transcript__more:hover:not(:disabled){background:var(--surface-2);color:var(--text);border-color:var(--surface-3)}.transcript__more:disabled{opacity:.7;cursor:default}.transcript__divider{display:flex;align-items:center;gap:12px;color:var(--muted);font-size:12px}.transcript__divider:before,.transcript__divider:after{content:"";flex:1;height:1px;background:var(--border-soft)}.work{display:flex;align-items:center;gap:10px;font-size:13px;color:var(--muted)}.work__dots{display:flex;gap:4px}.work__dot{width:6px;height:6px;border-radius:50%;background:var(--accent);animation:work-bounce 1.15s ease-in-out infinite}.work__dot:nth-child(2){animation-delay:.16s}.work__dot:nth-child(3){animation-delay:.32s}@keyframes work-bounce{0%,75%,to{transform:translateY(0);opacity:.3}35%{transform:translateY(-4px);opacity:1}}.work__label{background:linear-gradient(90deg,var(--muted) 25%,var(--text) 50%,var(--muted) 75%);background-size:220% 100%;-webkit-background-clip:text;background-clip:text;color:transparent;animation:work-shimmer 2.1s linear infinite}@keyframes work-shimmer{0%{background-position:110% 0}to{background-position:-110% 0}}.work__time{font-family:var(--mono);font-size:12px}.work--wait .work__dot{background:var(--warn);animation:none;opacity:1}.work--wait .work__label{color:var(--warn);background:none;-webkit-background-clip:border-box;background-clip:border-box;animation:none}.badge--live{animation:badge-pulse 2s ease-in-out infinite}@keyframes badge-pulse{50%{opacity:.55}}@media(prefers-reduced-motion:reduce){.work__dot,.work__label,.badge--live,.caret,.select__menu,.modal,.modal-backdrop,.oplog,.cwd__pop,.micbtn.is-on,.row__state--reconnecting,.relink,.relink__dot{animation:none}.row__state--reconnecting{opacity:.6}.work__dot{opacity:1}.work__label{color:var(--text);background:none}.oplog--leaving,.usage__fill,.sidebar__chev,.cwd__chev{transition:none}.meters-refresh.is-busy svg,.sessionmenu__refresh.is-busy svg{animation:none}}.tool{border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);box-shadow:var(--shadow-sm);overflow:hidden}.tool--wait{border-color:var(--warn-line)}.tool--error{border-color:var(--danger)}.tool__head{display:flex;align-items:center;gap:9px;width:100%;padding:9px 12px;text-align:left}.tool__head:hover{background:var(--surface-2)}.tool__name{font-family:var(--mono);font-size:12.5px;font-weight:600;color:var(--accent);flex:none}.tool__arg{font-family:var(--mono);font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1;min-width:0}.tool__status{font-size:12px;color:var(--muted);flex:none}.tool__body{border-top:1px solid var(--border-soft);padding:11px 12px;background:var(--bg)}.tool__questions{display:flex;flex-direction:column;gap:12px}.tool__question+.tool__question{padding-top:12px;border-top:1px solid var(--border-soft)}.tool__question-head{display:flex;align-items:baseline;flex-wrap:wrap;gap:5px 8px;margin-bottom:5px}.tool__question-text{font-size:13px;line-height:1.45;color:var(--text)}.tool__question-answer{font-size:12.5px}.tool__answer-value{color:var(--text-2)}.tool__answer-value:before{content:"→ ";color:var(--accent);font-weight:600}.tool__answer-empty{color:var(--muted);font-style:italic}pre.code{margin:0;font-family:var(--mono);font-size:12.5px;line-height:1.55;white-space:pre-wrap;overflow-wrap:anywhere;max-height:340px;overflow-y:auto;color:var(--code-fg)}.diff{border:1px solid var(--border);border-radius:8px;overflow:hidden;background:var(--surface)}.diff__head{display:flex;align-items:center;gap:10px;padding:7px 10px;background:var(--surface-2);border-bottom:1px solid var(--border-soft);font-family:var(--mono);font-size:12px}.diff__path{min-width:0;flex:1;overflow-wrap:anywhere;color:var(--text-2)}.diff__stat{flex:none;display:flex;gap:8px;font-weight:600}.diff__stat--add{color:var(--ok)}.diff__stat--del{color:var(--danger)}.diff__note{padding:5px 10px;font-size:12px;color:var(--muted);border-bottom:1px solid var(--border-soft)}.diff__body{max-height:min(340px,46vh);overflow-y:auto;padding:4px 0;background:var(--bg)}.diff__row{display:flex;align-items:flex-start;gap:6px;padding:0 10px 0 6px;font-family:var(--mono);font-size:12.5px;line-height:1.55;color:var(--code-fg)}.diff__mark{flex:none;width:10px;text-align:center;color:var(--muted);-webkit-user-select:none;user-select:none}.diff__text{min-width:0;flex:1;white-space:pre-wrap;overflow-wrap:anywhere;-moz-tab-size:2;tab-size:2}.diff__row--add{background:var(--add-bg);color:var(--add-fg)}.diff__row--add .diff__mark{color:var(--ok)}.diff__row--del{background:var(--del-bg);color:var(--del-fg)}.diff__row--del .diff__mark{color:var(--danger)}.diff__row--gap{color:var(--muted);font-size:12px;padding-top:2px;padding-bottom:2px}.result-line{display:flex;gap:14px;font-size:12px;color:var(--muted);font-family:var(--mono);border-top:1px dashed var(--border);padding-top:10px}.notice{font-size:13px;color:var(--muted);border-left:2px solid var(--border);padding-left:14px}.notice--error{color:var(--danger);border-left-color:var(--danger)}.empty{color:var(--muted);text-align:center;padding:64px 16px;max-width:460px;margin:0 auto;font-family:var(--serif);font-size:16px;line-height:1.6}.relink{flex:none;width:min(760px,100% - 32px);margin:0 auto 8px;display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:8px 9px 8px 12px;border:1px solid var(--border);border-left:2px solid var(--accent);border-radius:var(--radius);background:var(--surface-2);color:var(--text-2);font-size:12.5px;animation:relink-in .18s ease-out}.relink__msg{flex:1;min-width:210px;display:flex;align-items:center;gap:10px;line-height:1.45}.relink .btn{flex:none}.relink__dot{width:6px;height:6px;flex:none;border-radius:50%;background:var(--accent);animation:state-breathe 1.9s ease-in-out infinite}.relink--error{border-left-color:var(--danger)}.relink--error .relink__dot{background:var(--danger);animation:none}@keyframes relink-in{0%{opacity:0;transform:translateY(4px)}}.composer{flex:none;background:var(--bg);padding:8px 16px calc(14px + env(safe-area-inset-bottom))}.composer__inner{max-width:760px;margin:0 auto;position:relative}.composer__field{display:flex;gap:8px;align-items:flex-end;padding:8px 8px 8px 4px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:var(--shadow-sm);transition:border-color .14s ease,box-shadow .14s ease}.composer__field:focus-within{border-color:var(--accent-line);box-shadow:var(--ring)}.composer textarea{flex:1;resize:none;background:none;color:var(--text);border:none;padding:7px 8px 7px 12px;font:inherit;line-height:1.55;max-height:190px;min-height:38px}.composer textarea:focus{outline:none}.composer textarea::placeholder{color:var(--muted)}.composer .btn{flex:none;border-radius:999px;padding:7px 16px}.sendbtn__icon{display:none;flex:none}.addbtn{flex:none;display:grid;place-items:center;width:30px;height:30px;margin-left:4px;border-radius:999px;color:var(--muted);transition:background .12s ease,color .12s ease}.addbtn:hover:not(:disabled){background:var(--surface-2);color:var(--text)}.addbtn:disabled{opacity:.4}.addbtn svg{width:16px;height:16px}.composer__fileinput{display:none}.attachbtn{flex:none;display:grid;place-items:center;width:30px;height:30px;border-radius:999px;color:var(--muted);transition:background .12s ease,color .12s ease}.attachbtn:hover:not(:disabled){background:var(--surface-2);color:var(--text)}.attachbtn:disabled{opacity:.4}.attachbtn svg{width:16px;height:16px}.composer__attachments{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 8px 4px}.composer__thumb{position:relative;flex:none;width:60px;height:60px;border-radius:var(--radius);overflow:hidden;border:1px solid var(--border);background:var(--surface-2)}.composer__thumb img{display:block;width:100%;height:100%;object-fit:cover}.composer__thumb-remove{position:absolute;top:3px;right:3px;display:grid;place-items:center;width:18px;height:18px;border-radius:999px;background:#14131299;color:#fdfcfa;transition:background .12s ease}.composer__thumb-remove:hover{background:#141312d1}.composer__thumb-remove svg{width:9px;height:9px}.micbtn{flex:none;display:grid;place-items:center;width:32px;height:32px;border-radius:999px;color:var(--muted);transition:background .12s ease,color .12s ease}.micbtn:hover:not(:disabled){background:var(--surface-2);color:var(--text)}.micbtn:disabled{opacity:.4}.micbtn svg{width:16px;height:16px}.micbtn.is-on{color:var(--danger);background:color-mix(in srgb,var(--danger) 14%,transparent);animation:mic-pulse 1.6s ease-in-out infinite}.micbtn.is-on:hover:not(:disabled){color:var(--danger);background:color-mix(in srgb,var(--danger) 22%,transparent)}@keyframes mic-pulse{0%,to{box-shadow:0 0 color-mix(in srgb,var(--danger) 40%,transparent)}70%{box-shadow:0 0 0 5px transparent}}.composer .oplog{margin:0 0 8px}.cmdmenu{position:absolute;left:0;right:0;bottom:calc(100% + 8px);z-index:10;padding:5px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-lg);max-height:min(320px,46vh);overflow-y:auto;overflow-x:hidden;animation:pop .12s ease-out}.cmdmenu__row{display:flex;align-items:baseline;gap:8px;width:100%;padding:7px 10px;border-radius:7px;text-align:left}.cmdmenu__row.is-on{background:var(--surface-2)}.cmdmenu__name{font-family:var(--mono);font-size:13px;color:var(--accent);flex:none}.cmdmenu__hint{font-family:var(--mono);font-size:12px;color:var(--warn);flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cmdmenu__desc{font-size:12px;color:var(--muted);min-width:0;flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cmdmenu__empty{padding:9px 10px;font-size:12px;color:var(--muted)}.ctxmenu{position:fixed;z-index:45;min-width:224px;max-width:min(320px,92vw);padding:5px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow-lg);animation:pop .12s ease-out}.ctxmenu:focus{outline:none}.ctxmenu__note{padding:7px 9px 10px;margin-bottom:3px;border-bottom:1px solid var(--border-soft);font-size:12px;line-height:1.45;color:var(--muted)}.ctxmenu__item{display:flex;align-items:baseline;gap:8px;width:100%;padding:8px 9px;border-radius:7px;text-align:left;color:var(--text);font-size:13px}.ctxmenu__item.is-cursor{background:var(--surface-2)}.ctxmenu__label{flex:1;min-width:0}.ctxmenu__hint{font-size:11.5px;color:var(--muted)}@media(max-width:860px){.ctxmenu__item{min-height:40px}}@media(hover:none){.ctxmenu__item{min-height:40px}}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:40;display:flex;align-items:center;justify-content:center;padding:16px;background:#1f1e1d6b;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);animation:fade .14s ease-out}.modal-backdrop--sheet{align-items:flex-end;overflow-y:auto}@keyframes fade{0%{opacity:0}}.modal{width:100%;max-width:460px;display:flex;flex-direction:column;max-height:calc(100vh - 32px);background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:var(--shadow-lg);overflow:hidden;animation:rise .16s cubic-bezier(.2,.8,.3,1)}@keyframes rise{0%{opacity:0;transform:translateY(10px) scale(.985)}}.modal__head{display:flex;align-items:center;gap:10px;padding:16px 16px 0}.modal__title{margin:0;flex:1;min-width:0;font-family:var(--serif);font-size:17px;font-weight:500}.modal__close{flex:none;display:grid;place-items:center;width:28px;height:28px;margin:-4px -4px 0 0;border-radius:8px;color:var(--muted);font-size:16px;line-height:1}.modal__close:hover{background:var(--surface-2);color:var(--text)}.modal__body{padding:10px 16px 16px;flex:1 1 auto;min-height:0;overflow-y:auto}.modal__text{margin:0 0 12px;font-size:13px;color:var(--muted)}.modal__text--dim{color:var(--muted);opacity:.75}.modal__error{margin:10px 0 0;padding:8px 10px;border:1px solid var(--warn);border-radius:8px;background:var(--surface-2);font-size:12.5px;color:var(--text)}.modal__actions{display:flex;justify-content:flex-end;gap:8px;padding:12px 16px;background:var(--surface-2);border-top:1px solid var(--border-soft)}.modal__actions .btn{padding:8px 16px}.modal__actions .btn:not(.btn--primary){background:var(--surface)}.modal__actions .btn.btn--warn{background:var(--warn);border-color:var(--warn)}.modal--sheet{max-width:480px;max-height:none;border-radius:var(--radius-lg) var(--radius-lg) 0 0;overflow:visible;margin-bottom:env(safe-area-inset-bottom)}.modal--sheet .modal__body{flex:none;overflow:visible}.sessionmenu__row{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:11px 2px;border-bottom:1px solid var(--border-soft)}.sessionmenu__row:last-child{border-bottom:none}.sessionmenu__label{min-width:0;font-size:13.5px;color:var(--text-2)}.sessionmenu__row .select,.sessionmenu__row .cwd{flex:1;min-width:0}.sessionmenu__row .select__trigger{max-width:none;width:100%}.sessionmenu__row .cwd__pop{left:auto;right:0}.sessionmenu__rename{width:100%;margin-top:4px;padding:11px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface-2);color:var(--text);font-size:13.5px;font-weight:520;text-align:center}.sessionmenu__rename:hover{background:var(--surface-3)}.sessionmenu__refresh{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:44px;margin-top:4px;padding:8px 11px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface-2);color:var(--text);font-size:13.5px;font-weight:520;text-align:center}.sessionmenu__refresh:hover:not(:disabled){background:var(--surface-3)}.sessionmenu__refresh:disabled{opacity:.6;cursor:default}.sessionmenu__refresh svg{flex:none;width:15px;height:15px}.sessionmenu__refresh.is-busy svg{animation:meters-spin .8s linear infinite}.sessionmenu__refresh-text{display:flex;flex-direction:column;line-height:1.35}.sessionmenu__refresh-time{font-size:11.5px;font-weight:400;color:var(--muted)}.field{display:block;font-size:12px;font-weight:500;color:var(--muted);margin-bottom:6px}.input{width:100%;padding:9px 12px;background:var(--bg);color:var(--text);border:1px solid var(--border);border-radius:9px;font:inherit;transition:border-color .12s ease,box-shadow .12s ease}.input:focus{outline:none;border-color:var(--accent-line);box-shadow:var(--ring)}.input::placeholder{color:var(--muted)}.input--mono{font-family:var(--mono);font-size:13px}.finds{list-style:none;margin:12px 0 0;padding:0;max-height:240px;overflow-y:auto;border:1px solid var(--border-soft);border-radius:10px}.finds li+li{border-top:1px solid var(--border-soft)}.find{display:grid;grid-template-columns:1fr auto;gap:2px 10px;width:100%;padding:8px 10px;background:none;border:none;border-radius:0;text-align:left;cursor:pointer;color:var(--text);font:inherit}.find:hover:not(:disabled){background:var(--surface-2)}.find:disabled{cursor:default;opacity:.55}.find__name{font-size:13px;font-weight:500}.find__path{grid-column:1;font-family:var(--mono);font-size:11.5px;color:var(--muted);overflow-wrap:anywhere}.find__note{grid-column:2;grid-row:1 / span 2;align-self:center;max-width:45%;font-size:11.5px;color:var(--muted);text-align:right}.finds__agent{margin-top:12px;height:260px;border:1px solid var(--border-soft);border-radius:10px;overflow:hidden}.finds__agent .transcript{height:100%}.newproj__roots{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}.newproj__root{padding:4px 9px;border:1px solid var(--border);border-radius:999px;background:var(--surface-2);color:var(--muted);font-family:var(--mono);font-size:11.5px;cursor:pointer}.newproj__root:hover{color:var(--text)}.newproj__root.is-on{border-color:var(--accent-line);color:var(--text)}.newproj__field{margin-top:14px}.newproj__preview{margin:8px 0 0;font-family:var(--mono);font-size:12px;color:var(--muted);overflow-wrap:anywhere}.newproj__opts{margin-top:14px;border:1px solid var(--border-soft);border-radius:10px;overflow:hidden}.newproj__opt+.newproj__opt{border-top:1px solid var(--border-soft)}.newproj__opt{display:flex;align-items:center;gap:10px;width:100%;padding:9px 11px;background:none;border:none;text-align:left;cursor:pointer;color:var(--text);font:inherit;font-size:13px}.newproj__opt:hover{background:var(--surface-2)}.newproj__optlabel{flex:1;display:flex;flex-direction:column;gap:1px}.newproj__optdesc{font-size:11.5px;color:var(--muted)}.newproj__warnings{margin:0;padding:0;list-style:none}.newproj__warnings li+li{margin-top:4px}.modal--wide{max-width:620px}.tabs{display:flex;gap:4px;margin-bottom:14px;padding-bottom:2px;border-bottom:1px solid var(--border-soft)}.tabs__tab{display:inline-flex;align-items:center;gap:7px;padding:7px 12px;border-radius:8px 8px 0 0;color:var(--muted);font-size:13px;font-weight:500;position:relative}.tabs__tab:hover,.tabs__tab.is-on{color:var(--text)}.tabs__tab.is-on:after{content:"";position:absolute;left:8px;right:8px;bottom:-3px;height:2px;border-radius:2px;background:var(--accent)}.tabs__count{padding:1px 6px;border-radius:999px;background:var(--surface-2);font-size:11px;font-variant-numeric:tabular-nums}.extlist{list-style:none;margin:0 0 12px;padding:0;display:flex;flex-direction:column;gap:8px}.extlist__row{padding:10px 12px;border:1px solid var(--border);border-radius:10px;background:var(--surface-2)}.extlist__head{display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin-bottom:4px}.extlist__name{font-family:var(--mono);font-size:13px;font-weight:600;color:var(--text);margin-right:2px}.extlist__meta{font-family:var(--mono);font-size:11.5px;color:var(--muted);overflow-wrap:anywhere}.extlist__error{margin-top:3px;font-size:12px;color:var(--danger);overflow-wrap:anywhere}.extlist__actions{display:flex;flex-wrap:wrap;gap:4px;margin-top:7px}.chip{padding:2px 7px;border:1px solid var(--border);border-radius:999px;background:var(--surface);color:var(--muted);font-size:11px;white-space:nowrap}.chip--ok{color:var(--ok);border-color:var(--ok)}.chip--bad{color:var(--danger);border-color:var(--danger)}.chip--warn{color:var(--warn);border-color:var(--warn-line);background:var(--warn-soft)}.chip--mute{opacity:.75}.btn--sm{padding:4px 9px;font-size:12px}.btn--danger{color:var(--danger)}.btn--danger:hover{background:var(--danger-soft);color:var(--danger)}.extform{margin-bottom:12px}.extform .field{margin-top:10px}.extform .field:first-child{margin-top:0}.extform--card{padding:12px;border:1px solid var(--border);border-radius:10px;background:var(--surface-2)}.extform--card .input{background:var(--surface)}.extbar{display:flex;justify-content:flex-end;align-items:center;flex-wrap:wrap;gap:8px;margin-bottom:12px}.extform--card .extbar{margin:12px 0 0}.extbar .btn{padding:8px 16px}.extform__row{display:flex;gap:8px;align-items:center}.extform__row .input{flex:1;min-width:0}.extform__row .btn{flex:none}.input--area{min-height:62px;resize:vertical}.oplog{margin:12px 0;padding:9px 11px;border-radius:9px;border:1px solid var(--border);background:var(--surface-2);font-size:12.5px;white-space:pre-wrap;overflow-wrap:anywhere;animation:oplog-in .18s ease-out}.oplog:last-child{margin-bottom:0}.oplog--ok{border-color:var(--ok);color:var(--text-2)}.oplog--bad{border-color:var(--danger);color:var(--danger)}.oplog__link{display:block;margin-top:3px;color:var(--accent);font-family:var(--mono);font-size:12px;overflow-wrap:anywhere}.oplog__link:hover{text-decoration:underline}.oplog--dismissible{position:relative;padding-right:28px}.oplog__dismiss{position:absolute;top:7px;right:7px;display:grid;place-items:center;width:18px;height:18px;border-radius:5px;color:var(--muted);font-size:10.5px;line-height:1}.oplog__dismiss:hover{background:var(--surface-3);color:var(--text)}.oplog--leaving{opacity:0;transform:translateY(-4px);transition:opacity .22s ease,transform .22s ease;pointer-events:none}@keyframes oplog-in{0%{opacity:0;transform:translateY(5px)}}.sidebar__foot{flex-wrap:wrap}.sidebar__wide{flex-basis:100%}.catalog__filters{display:flex;gap:8px;margin-bottom:12px}.catalog__filters .input{flex:1;min-width:0}.catalog__desc{margin:2px 0 4px;font-size:12.5px;line-height:1.5;color:var(--text-2);display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}.linkish{padding:0;color:var(--accent);text-decoration:underline;text-underline-offset:2px}.account-btn{display:flex;align-items:center;gap:8px;width:100%;padding:8px 10px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);font-size:13px;text-align:left}.account-btn:hover{background:var(--surface-2)}.account-btn__id{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.account{padding:12px;margin-bottom:12px;border:1px solid var(--border);border-radius:10px;background:var(--surface-2)}.account__id{font-family:var(--mono);font-size:13.5px;font-weight:600;overflow-wrap:anywhere}.account__chips{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0 4px}.account__flow .field{margin-top:12px}.account__link{display:block;padding:9px 11px;border:1px solid var(--accent-line);border-radius:9px;background:var(--accent-soft);color:var(--accent);font-family:var(--mono);font-size:12px;line-height:1.5;overflow-wrap:anywhere}.account__step{margin:8px 0 0;color:var(--muted);font-size:12.5px;line-height:1.55}.account__go{justify-content:center;width:100%;margin-top:10px;padding:11px 16px;font-size:14px}.account__raw{display:flex;align-items:center;gap:8px;margin-top:8px}.account__rawurl{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font-family:var(--mono);font-size:11.5px}.account__fallback{margin-top:10px;font-size:12.5px}.account__fallback summary{cursor:pointer;color:var(--muted)}.account__fallback summary:hover{color:var(--text-2)}.account__fallback .account__link{margin-top:8px}.account__coderow{flex-wrap:wrap}.account__coderow .input{flex:1 1 100%}.account__coderow .btn{flex:1 1 0;justify-content:center;min-height:40px}.account__note--code{margin:8px 0 0}.account__log{margin:12px 0;padding:9px 11px;max-height:180px;overflow:auto;border:1px solid var(--border);border-radius:9px;background:var(--surface-2);color:var(--muted);font-family:var(--mono);font-size:11.5px;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere}.account__warn{margin:0 0 12px;padding:9px 11px;border:1px solid var(--warn-line);border-radius:9px;background:var(--warn-soft);color:var(--warn);font-size:12.5px;line-height:1.5}.account__note{margin:0 0 6px;color:var(--muted);font-size:12.5px;line-height:1.5}.account__bar{flex-wrap:nowrap}.account__bar .btn{padding:8px 13px}.account__bar .account__relink{margin-inline-end:auto}@media(max-width:459.98px){.account__bar{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}.account__bar .account__relink{margin-inline-end:0}.account__bar>.account__relink,.account__bar>.btn--warn~.btn{grid-column:1 / -1}.account__bar .btn{justify-content:center}}.account__relink svg{flex:none;width:15px;height:15px;color:var(--muted)}.account__relink:hover:not(:disabled) svg{color:var(--warn)}.sheet{width:100%;max-width:560px;background:var(--surface);border:1px solid var(--warn-line);border-radius:var(--radius-lg);box-shadow:var(--shadow-lg);overflow:hidden;margin-bottom:env(safe-area-inset-bottom);animation:rise .16s cubic-bezier(.2,.8,.3,1)}.sheet__head{display:flex;align-items:center;gap:8px;padding:13px 16px;background:var(--warn-soft);border-bottom:1px solid var(--border-soft);font-weight:600;color:var(--text)}.sheet__body{padding:14px 16px}.sheet__tool{font-family:var(--mono);font-size:13px;color:var(--warn);margin-bottom:8px}.sheet__reason{margin:0 0 10px;font-size:13px;line-height:1.45;color:var(--text-2)}.sheet__actions{display:flex;gap:10px;padding:0 16px 16px}.sheet__actions .btn{flex:1;justify-content:center;padding:11px}.qsheet{width:100%;max-width:620px;max-height:calc(100vh - 32px);display:flex;flex-direction:column;background:var(--surface);border:1px solid var(--accent-line);border-radius:var(--radius-lg);box-shadow:var(--shadow-lg);overflow:hidden;margin-bottom:env(safe-area-inset-bottom);animation:rise .16s cubic-bezier(.2,.8,.3,1)}.qsheet__head{display:flex;align-items:center;gap:10px;padding:13px 16px;background:var(--accent-soft);border-bottom:1px solid var(--border-soft);font-weight:600;color:var(--text);flex:none}.qsheet__head-icon{display:grid;place-items:center;flex:none;width:22px;height:22px;border-radius:999px;border:1.5px solid var(--accent);color:var(--accent);font-family:var(--serif);font-size:13px;font-weight:700}.qsheet__body{padding:14px 16px 6px;overflow-y:auto;flex:1}.qsheet__reason{margin:0 0 12px;font-size:13px;line-height:1.45;color:var(--text-2)}.qsheet__question+.qsheet__question{margin-top:20px;padding-top:18px;border-top:1px solid var(--border-soft)}.qsheet__question{margin-bottom:10px}.qsheet__qhead{display:flex;align-items:baseline;flex-wrap:wrap;gap:8px 9px;margin-bottom:10px}.qsheet__qtext{font-family:var(--serif);font-size:15px;font-weight:500;line-height:1.4;color:var(--text)}.chip--accent{color:var(--accent);border-color:var(--accent-line);background:var(--accent-soft)}.qsheet__options{display:flex;flex-direction:column;gap:6px}.qsheet__option{display:flex;align-items:flex-start;gap:10px;width:100%;padding:9px 11px;text-align:left;border:1px solid var(--border);border-radius:10px;background:var(--surface);transition:border-color .12s ease,background .12s ease}.qsheet__option:hover{background:var(--surface-2)}.qsheet__option:focus-visible{outline:none;box-shadow:var(--ring)}.qsheet__option.is-selected{border-color:var(--accent);background:var(--accent-soft)}.qsheet__opt-mark{position:relative;flex:none;margin-top:2px;width:15px;height:15px;border:1.5px solid var(--border);background:var(--surface)}.qsheet__options--radio .qsheet__opt-mark{border-radius:999px}.qsheet__options:not(.qsheet__options--radio) .qsheet__opt-mark{border-radius:5px}.qsheet__option.is-selected .qsheet__opt-mark{border-color:var(--accent);background:var(--accent)}.qsheet__options--radio .qsheet__option.is-selected .qsheet__opt-mark{box-shadow:inset 0 0 0 3px var(--surface)}.qsheet__options:not(.qsheet__options--radio) .qsheet__option.is-selected .qsheet__opt-mark:after{content:"✓";position:absolute;top:0;right:0;bottom:0;left:0;display:grid;place-items:center;font-size:10px;line-height:1;color:var(--accent-fg)}.qsheet__opt-body{min-width:0}.qsheet__opt-label{display:block;font-size:13.5px;font-weight:560;color:var(--text)}.qsheet__opt-desc{display:block;margin-top:2px;font-size:12.5px;line-height:1.4;color:var(--muted)}.qsheet__other{display:flex;flex-direction:column}.qsheet__other-input{margin-top:6px;width:100%;padding:8px 10px;border:1px solid var(--accent-line);border-radius:8px;background:var(--surface);color:var(--text);font:inherit;font-size:13px}.qsheet__other-input:focus{outline:none;box-shadow:var(--ring)}.qsheet__other-input::placeholder{color:var(--muted)}.qsheet__preview{margin:10px 0 0;padding:10px 12px;border:1px solid var(--border-soft);border-radius:8px;background:var(--bg);color:var(--code-fg);font-family:var(--mono);font-size:12px;line-height:1.5;white-space:pre;overflow:auto;max-height:220px}.qsheet__actions{display:flex;gap:10px;padding:12px 16px;border-top:1px solid var(--border-soft);flex:none}.qsheet__actions .btn{flex:1;justify-content:center;padding:11px}.pane-btn{flex:none;display:grid;place-items:center;width:30px;height:30px;border-radius:8px;color:var(--muted);transition:background .12s ease,color .12s ease}.pane-btn:hover{background:var(--surface-2);color:var(--text)}.pane-btn.is-on{background:var(--accent-soft);color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent-line)}.pane-btn svg{width:16px;height:16px}.sidepane{display:none;flex-direction:column;min-height:0;min-width:0;background:var(--sidebar)}.sidepane--open{display:flex}.sidepane--git{border-right:1px solid var(--border)}.sidepane--ask{border-left:1px solid var(--border)}.sidepane.sidepane--zoomed{position:fixed;top:0;right:0;bottom:0;left:0;z-index:32;width:auto}.sidepane__head{display:flex;align-items:center;gap:8px;flex:none;padding:12px 10px 12px 14px;border-bottom:1px solid var(--border-soft)}.sidepane__icon{flex:none;width:15px;height:15px;color:var(--muted)}.sidepane__title{flex:1;min-width:0;font-family:var(--serif);font-size:15px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sidepane__btn{flex:none;display:grid;place-items:center;width:26px;height:26px;border-radius:7px;color:var(--muted);font-size:13px;line-height:1}.sidepane__btn:hover{background:var(--surface-2);color:var(--text)}.sidepane__btn:disabled{opacity:.35;cursor:default;background:none}.sidepane__btn svg{width:15px;height:15px}.sidepane__scroll{flex:1;min-height:0;overflow-y:auto;padding:6px 0 10px}.sidepane__empty{margin:0;padding:22px 16px;color:var(--muted);font-size:13px;line-height:1.55}.gitempty{padding:22px 16px}.gitempty__text{margin:0 0 14px;color:var(--muted);font-size:13px;line-height:1.55}.gitempty__btn{width:100%;justify-content:center}.gitempty__hint{margin:8px 0 0;color:var(--muted);font-size:12px;line-height:1.45}.sidepane__tools{display:flex;align-items:center;gap:8px;flex:none;padding:0 10px 8px;border-bottom:1px solid var(--border-soft)}.sidepane__note{font-size:11px;color:var(--muted);white-space:nowrap;cursor:default}.select--compact{min-width:0}.select--compact .select__trigger{max-width:100%;padding:3px 7px 3px 10px;font-size:11.5px}.select--compact .select__menu{left:0;right:auto;max-width:min(340px,calc(100vw - 24px))}.composer--side{padding:8px 10px calc(10px + env(safe-area-inset-bottom));border-top:1px solid var(--border-soft)}.composer--side .composer__inner{max-width:none}.composer--side .composer__field{flex-wrap:wrap;gap:4px 6px;padding:5px 6px;border-radius:var(--radius)}.composer--side textarea{order:-1;flex:1 0 100%;padding:4px 4px 2px 6px;font-size:13px;line-height:1.5;min-height:26px;max-height:140px}.composer--side .btn{padding:5px 13px;font-size:12.5px}.composer--side .addbtn{width:26px;height:26px;margin:0 auto 0 0}.composer--side .addbtn svg{width:14px;height:14px}.composer--side .micbtn{width:28px;height:28px}.composer--side .micbtn svg{width:14px;height:14px}.sidepane--ask .transcript{padding:14px 12px 4px}.sidepane--ask .stream{gap:12px}.sidepane--ask .msg--user{max-width:94%}.sidepane--ask .empty{padding:28px 4px;font-size:14px;text-align:left}.sidepane--files,.sidepane--search{border-right:1px solid var(--border)}.fssearch{display:flex;flex:none;align-items:center;gap:7px;margin:10px 10px 2px;padding:6px 9px;border:1px solid var(--border-soft);border-radius:8px;background:var(--surface)}.fssearch:focus-within{border-color:var(--accent-line);box-shadow:var(--ring)}.fssearch svg{flex:none;width:14px;height:14px;color:var(--muted)}.fssearch__input{flex:1;min-width:0;background:none;border:none;color:var(--text);font:inherit;font-size:12.5px}.fssearch__input:focus{outline:none}.fssearch__input::placeholder{color:var(--muted)}.fssearch__clear{flex:none;display:grid;place-items:center;width:18px;height:18px;border-radius:5px;color:var(--muted);font-size:10px;line-height:1}.fssearch__clear:hover{background:var(--surface-3);color:var(--text)}.fstree{padding:4px 0 clamp(96px,26vh,160px);overflow-x:auto}.fstree:focus{outline:none}.fsrow{display:flex;align-items:center;min-width:100%;width:max-content;padding-left:calc(8px + var(--depth, 0) * 13px);padding-right:4px;height:25px}.fsrow:hover,.fsrow.is-selected{background:var(--surface-2)}.fsrow.is-open{background:var(--accent-soft);box-shadow:inset 2px 0 0 var(--accent)}.fsrow--dragging{opacity:.4}.fsrow--drop-target{background:var(--accent-soft);box-shadow:inset 0 0 0 1px var(--accent-line)}.fsrow--cut{opacity:.4}.fstree--drop-target{background:var(--surface-2)}.fsrow__main{display:flex;align-items:center;gap:6px;flex:1;min-width:0;height:100%;padding:0;text-align:left}.fsrow__icon{flex:none;display:grid;place-items:center;width:15px;height:15px;color:var(--muted)}.fsrow__icon svg{width:15px;height:15px}.fsrow.is-open .fsrow__icon{color:var(--accent)}.fsrow__name{font-size:13px;color:var(--text-2);white-space:nowrap;min-width:0;overflow:hidden;text-overflow:ellipsis}.fsrow.is-open .fsrow__name{color:var(--text)}.fsrow__icon--git-added,.fsrow__name--git-added{color:var(--ok)}.fsrow__icon--git-modified,.fsrow__name--git-modified{color:var(--warn)}.fsrow--ignored .fsrow__icon,.fsrow--ignored .fsrow__name{color:var(--muted);opacity:.72}.fsrow__tag,.cmdmenu__tag{flex:none;margin-left:6px;font-family:var(--mono);font-size:10px;letter-spacing:.02em;color:var(--muted);opacity:.8;white-space:nowrap}.fsrow__dot{flex:none;width:6px;height:6px;margin-left:2px;border-radius:50%;background:var(--accent)}.fsrow__act{flex:none;display:none;place-items:center;width:20px;height:20px;border-radius:6px;color:var(--muted);font-size:11px;line-height:1}.fsrow:hover .fsrow__act{display:grid}.fsrow__act:hover{background:var(--surface-3);color:var(--text)}.fsrow__act:focus-visible{display:grid}@media(hover:none){.fsrow__act{display:grid}}.fsrow--search{gap:6px;width:100%;color:inherit;font:inherit;text-align:left;padding-right:8px}.fsrow--search:hover{background:var(--surface-2)}.fsrow__path{flex:1;min-width:0;margin-left:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font-size:11.5px}.fsrow--draft{gap:6px}.rename--file{flex:1;min-width:0;height:21px;padding:0 6px;font-size:13px}.fsrow__pending{margin:0;padding:2px 0 2px calc(8px + var(--depth) * 13px + 21px);color:var(--muted);font-size:12px}.searchgroup__path{margin:10px 0 0;padding:3px 10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text-2);font-size:12px;font-weight:600}.searchgroup__path:first-child{margin-top:0}.searchmatch{display:flex;width:100%;align-items:baseline;gap:10px;padding:3px 10px 3px 14px;border:none;background:none;color:inherit;font:inherit;text-align:left;cursor:pointer}.searchmatch:hover{background:var(--surface-2)}.searchmatch__line{flex:none;min-width:2ch;color:var(--muted);font-family:var(--mono);font-size:11.5px;text-align:right}.searchmatch__text{flex:1;min-width:0;overflow:hidden;color:var(--text-2);font-family:var(--mono);font-size:12.5px;white-space:pre;text-overflow:ellipsis}.searchmatch__text mark{background:var(--accent-soft);color:var(--text);border-radius:3px}.worktabs{display:flex;flex:none;align-items:stretch;gap:2px;padding:4px 8px 0;overflow-x:auto;background:var(--bg);border-bottom:1px solid var(--border)}.worktabs__spacer{flex:1;min-width:8px}.worktabs__zoom{flex:none;align-self:center;display:grid;place-items:center;width:26px;height:26px;margin:0 2px;border-radius:7px;color:var(--muted)}.worktabs__zoom:hover{background:var(--surface-2);color:var(--text)}.worktabs__zoom svg{width:15px;height:15px}.worktab{display:flex;align-items:center;gap:5px;flex:none;max-width:220px;padding:0 8px 0 10px;height:30px;border:1px solid transparent;border-bottom:none;border-radius:8px 8px 0 0;color:var(--muted);font-size:12.5px}.worktab:hover{background:var(--surface-2);color:var(--text-2)}.worktab.is-on{background:var(--surface);border-color:var(--border);color:var(--text);margin-bottom:-1px;padding-bottom:1px}.worktab__name{min-width:0;padding:0;color:inherit;font:inherit;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.worktab__close{flex:none;display:grid;place-items:center;width:17px;height:17px;border-radius:5px;color:var(--muted);font-size:10px;line-height:1}.worktab__close:hover{background:var(--surface-3);color:var(--text)}.worktab__dot{flex:none;width:7px;height:7px;margin:0 5px;border-radius:50%;background:var(--accent);padding:0}.worktab__dot--busy{background:var(--ok);cursor:default;animation:badge-pulse 2s ease-in-out infinite}.editor{display:flex;flex-direction:column;flex:1;min-height:0;background:var(--bg)}.editor__bar{display:flex;align-items:center;gap:10px;flex:none;padding:7px 14px;border-bottom:1px solid var(--border-soft)}.editor__path{min-width:0;flex:1;font-family:var(--mono);font-size:12px;color:var(--text-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;direction:rtl;text-align:left}.editor__meta{flex:none;font-family:var(--mono);font-size:11.5px;color:var(--muted)}.editor__warn{display:flex;align-items:center;gap:10px;flex-wrap:wrap;flex:none;padding:8px 14px;background:var(--warn-soft);border-bottom:1px solid var(--warn-line);color:var(--warn);font-size:12.5px}.editor__code{flex:1;min-height:0;overflow:hidden}.editor__code-surface{width:100%;height:100%}.editor__code-surface.is-hidden{display:none}.editor__state{display:grid;justify-items:center;align-content:center;gap:10px;height:100%;color:var(--muted);font-size:13.5px}.editor__fallback{display:flex;flex-direction:column;height:100%;min-height:0}.editor__fallback-banner{display:flex;align-items:center;gap:10px;flex-wrap:wrap;flex:none;padding:8px 14px;background:var(--danger-soft);border-bottom:1px solid color-mix(in srgb,var(--danger) 40%,transparent);color:var(--danger);font-size:12.5px}.editor__fallback-text{flex:1;min-height:0;margin:0;padding:14px;overflow:auto;font-family:var(--mono);font-size:12.5px;line-height:1.6;color:var(--text-2);white-space:pre-wrap;word-break:break-word}.editor__empty{margin:0;padding:28px 20px;color:var(--muted);font-size:13.5px;line-height:1.6}.editor__viewtoggle{display:flex;flex:none;gap:2px;padding:2px;background:var(--surface-2);border-radius:var(--radius)}.editor__viewtoggle .btn{border:none;background:transparent;color:var(--muted)}.editor__viewtoggle .btn:hover{background:var(--surface-3);color:var(--text-2)}.editor__viewtoggle .btn.is-on{background:var(--surface);color:var(--text);box-shadow:var(--shadow-sm)}.markdown-preview{flex:1;min-height:0;overflow:auto;padding:28px 32px;font-family:var(--serif);font-size:15px;line-height:1.65;color:var(--text)}.markdown-preview>:first-child{margin-top:0}.markdown-preview h1,.markdown-preview h2,.markdown-preview h3,.markdown-preview h4,.markdown-preview h5,.markdown-preview h6{font-family:var(--sans);font-weight:600;line-height:1.3;margin:1.4em 0 .5em}.markdown-preview h1{font-size:1.6em;border-bottom:1px solid var(--border-soft);padding-bottom:.3em}.markdown-preview h2{font-size:1.3em}.markdown-preview h3{font-size:1.1em}.markdown-preview p,.markdown-preview ul,.markdown-preview ol,.markdown-preview blockquote{margin:.8em 0}.markdown-preview ul,.markdown-preview ol{padding-left:1.6em}.markdown-preview li+li{margin-top:.3em}.markdown-preview a{color:var(--accent)}.markdown-preview blockquote{border-left:3px solid var(--border);padding-left:1em;color:var(--text-2)}.markdown-preview code{font-family:var(--mono);font-size:.87em;background:var(--surface-2);padding:.15em .4em;border-radius:4px}.markdown-preview pre{background:var(--surface-2);padding:12px 14px;border-radius:var(--radius);overflow:auto}.markdown-preview pre code{background:none;padding:0}.markdown-preview pre code .cmh-key{color:var(--cm-key)}.markdown-preview pre code .cmh-prop{color:var(--cm-prop)}.markdown-preview pre code .cmh-fn{color:var(--cm-fn)}.markdown-preview pre code .cmh-const{color:var(--cm-const)}.markdown-preview pre code .cmh-type{color:var(--cm-type)}.markdown-preview pre code .cmh-num{color:var(--cm-num)}.markdown-preview pre code .cmh-str{color:var(--cm-str)}.markdown-preview pre code .cmh-op{color:var(--cm-op)}.markdown-preview pre code .cmh-comment{color:var(--cm-comment);font-style:italic}.markdown-preview pre code .cmh-invalid{color:var(--danger)}.markdown-preview table{border-collapse:collapse;width:100%;font-size:.92em}.markdown-preview th,.markdown-preview td{border:1px solid var(--border-soft);padding:6px 10px;text-align:left}.markdown-preview th{background:var(--surface-2)}.markdown-preview img{max-width:100%}.markdown-preview hr{border:none;border-top:1px solid var(--border-soft);margin:1.6em 0}.gitbar{display:flex;align-items:center;gap:6px;flex:none;padding:10px 12px;border-bottom:1px solid var(--border-soft)}.gitbar__branch{flex:1;min-width:0}.gitbar__branch .select__trigger{width:100%;max-width:none}.gitbar__branch .select__menu{left:0;right:auto;min-width:100%}.gitbar__note{margin:0;padding:8px 14px;background:var(--warn-soft);border-bottom:1px solid var(--border-soft);color:var(--warn);font-size:12px;line-height:1.45}.gitbar__actions{display:flex;flex-wrap:wrap;align-items:center;gap:6px;padding:8px 12px;border-bottom:1px solid var(--border-soft)}.gitbar__group{display:inline-flex;gap:3px}.gitbar__check{padding-left:7px;padding-right:7px}.gitbar__check svg{width:13px;height:13px}.gitbar__actions svg{width:13px;height:13px;flex:none}.gitbar__count{padding:0 5px;border-radius:999px;background:var(--accent-soft);color:var(--accent);font-size:11px;font-variant-numeric:tabular-nums}.btn--primary .gitbar__count{background:#ffffff38;color:inherit}.gitbar__busy{display:flex;align-items:center;gap:7px;margin:0;color:var(--muted);font-size:12.5px}.gitbar__busy svg{animation:meters-spin .8s linear infinite}.gitrow{display:flex;align-items:center;gap:2px;width:100%;height:50px;padding:0 10px 0 0;text-align:left}.gitrow:hover{background:var(--surface-2)}.gitrow.is-on{background:var(--surface-2);box-shadow:inset 2px 0 0 var(--accent)}.gitrow--work{height:46px;padding-left:14px;border-bottom:1px solid var(--border-soft);margin-bottom:4px}.gitrow__body{min-width:0;flex:1;display:flex;flex-direction:column;gap:1px}.gitrow__subject{display:block;font-size:13px;color:var(--text-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gitrow.is-on .gitrow__subject{color:var(--text)}.gitrow__meta{display:block;font-family:var(--mono);font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.gitrow__ref{display:inline-block;margin-right:5px;padding:0 5px;border:1px solid var(--accent-line);border-radius:999px;background:var(--accent-soft);color:var(--accent);font-family:var(--mono);font-size:10.5px;vertical-align:1px}.gitgraph{flex:none}.gitgraph line,.gitgraph path{stroke-width:1.6;fill:none}.gitgraph__dot{fill:var(--sidebar);stroke-width:2}.gitrow:hover .gitgraph__dot{fill:var(--surface-2)}.gitgraph__head{fill:none;stroke:var(--accent);stroke-width:1.4;opacity:.65}.gitrow__local{margin-left:5px;color:var(--warn)}.commit__head{padding-bottom:12px;margin-bottom:12px;border-bottom:1px solid var(--border-soft)}.commit__subject{margin:0 0 6px;font-size:15px;font-weight:560;overflow-wrap:anywhere}.commit__meta{margin:0;font-size:12px;color:var(--muted);overflow-wrap:anywhere}.commit__hash{font-family:var(--mono);font-size:11.5px}.commit__meta--local{margin-top:4px;color:var(--warn)}.commit__body{margin:10px 0 0;padding:9px 11px;border-radius:9px;background:var(--surface-2);font-family:var(--mono);font-size:12px;line-height:1.55;white-space:pre-wrap;overflow-wrap:anywhere;color:var(--text-2)}.commit__file{margin-bottom:8px}.commit__filehead{display:flex;align-items:center;gap:10px;width:100%;padding:7px 10px;border:1px solid var(--border);border-radius:8px;background:var(--surface-2);font-family:var(--mono);font-size:12px;text-align:left}.commit__filehead:hover{background:var(--surface-3)}.commit__filepath{min-width:0;flex:1;color:var(--text-2);overflow-wrap:anywhere}.commit__file .diff{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.commit__file .diff__head{display:none}.publish__section{margin-top:20px;padding-top:18px;border-top:1px solid var(--border-soft)}.publish__section--first{margin-top:0;padding-top:0;border-top:none}.publish__heading{margin:0 0 10px;font-size:13px;font-weight:650;color:var(--text)}.publish__field{margin-top:10px}.publish__static{margin:0;padding:9px 12px;background:var(--surface-2);border-radius:9px;font-family:var(--mono);font-size:13px;color:var(--text-2)}.publish__account{display:flex;align-items:center;flex-wrap:wrap;gap:9px}.publish__accountvia{font-size:12.5px;color:var(--muted)}.publish__connect .modal__text{margin-bottom:10px}.publish__tokenhint{margin:8px 0 0;font-size:12px;line-height:1.5;color:var(--muted)}.publish__tokenhint code{font-family:var(--mono);font-size:.95em}.publish__tokenhint a{color:var(--accent)}.publish__filehead{display:flex;align-items:center;gap:8px;margin-bottom:8px}.publish__filecount{flex:1;font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}.publish__filter{margin-bottom:8px;font-size:12.5px}.publish__filelist{max-height:240px;overflow-y:auto;border:1px solid var(--border-soft);border-radius:9px}.publish__file{display:flex;align-items:center;gap:9px;width:100%;padding:6px 10px;text-align:left;font-family:var(--mono);font-size:12px;color:var(--text-2)}.publish__file:hover{background:var(--surface-2)}.publish__file+.publish__file{border-top:1px solid var(--border-soft)}.publish__box{flex:none;display:grid;place-items:center;width:15px;height:15px;border:1.5px solid var(--border);border-radius:4px;font-size:10px;color:var(--accent-fg);transition:background .12s ease,border-color .12s ease}.publish__box.is-on{background:var(--accent);border-color:var(--accent)}.publish__filepath{min-width:0;overflow-wrap:anywhere}.publish__filesempty{margin:0;padding:10px}.publish__truncated{margin:8px 0 0;font-size:12px;color:var(--warn)}.pwfield{position:relative}.pwfield__input{padding-right:34px}.pwfield__input::-ms-reveal,.pwfield__input::-ms-clear{display:none}.pwfield__toggle{position:absolute;right:4px;top:50%;transform:translateY(-50%);display:grid;place-items:center;width:26px;height:26px;border-radius:6px;color:var(--muted)}.pwfield__toggle svg{width:15px;height:15px}.pwfield__toggle:hover{background:var(--surface-2);color:var(--text)}.pwfield__toggle[aria-pressed=true]{color:var(--accent)}.scrim{display:none}@media(max-width:860px){.app{grid-template-columns:1fr}.sidebar,.main,.sidepane{grid-column:1}.pane-resizer{display:none}.sidepane--open{position:fixed;top:0;bottom:0;width:min(var(--ask-w),calc(100vw - 44px));z-index:30;box-shadow:var(--shadow-lg)}.sidepane--open.sidepane--git,.sidepane--open.sidepane--files,.sidepane--open.sidepane--search{left:0;width:min(var(--git-w),calc(100vw - 44px))}.sidepane--open.sidepane--ask{right:0}.scrim--pane{display:block}.sidebar{position:fixed;inset:0 auto 0 0;width:var(--sidebar-w);z-index:30;transform:translate(-100%);transition:transform .18s ease;box-shadow:var(--shadow-lg)}.sidebar--open{transform:none}.scrim{display:block;position:fixed;top:0;right:0;bottom:0;left:0;background:#1f1e1d6b;z-index:20}.menu-btn{display:grid;place-items:center;width:40px;height:40px;padding:0}.pane-btn{width:40px;height:40px}.pane-btn svg{width:18px;height:18px}.topbar{gap:6px}.topbar__id{flex:1 1 100%;flex-direction:row;align-items:center;gap:10px}.topbar__head,.topbar__title{flex:1 1 auto;min-width:0}.msg--user{max-width:92%}.transcript{padding:16px 12px 4px}.composer{padding:6px 12px calc(10px + env(safe-area-inset-bottom))}.composer .sendbtn{width:32px;height:32px;padding:0;justify-content:center;border-radius:999px}.sendbtn__label{display:none}.sendbtn__icon{display:block;width:16px;height:16px}.composer--side .sendbtn{width:28px;height:28px}.composer--side .sendbtn__icon{width:14px;height:14px}.worktabs{padding:4px 6px 0}.worktab{max-width:150px}.editor__bar{padding:6px 10px}.editor__path{font-size:11.5px}}@media(max-width:380px){.menu-btn,.pane-btn{width:36px;height:36px}.pane-btn svg{width:16px;height:16px}.topbar{gap:4px}}.term-resizer{flex:none;display:flex;align-items:center;justify-content:center;position:relative;z-index:5;height:9px;margin:-4px 0;cursor:row-resize;touch-action:none}.term-resizer__line{width:100%;height:2px;margin:0 10px;border-radius:2px;background:transparent;transition:background .12s ease}.term-resizer:hover .term-resizer__line,.term-resizer:active .term-resizer__line,.term-resizer:focus-visible .term-resizer__line{background:var(--accent)}.term-resizer:focus-visible{outline:none}body.is-resizing-row{cursor:row-resize;-webkit-user-select:none;user-select:none}.termpanel{display:flex;flex-direction:column;flex:none;min-height:0;background:var(--surface);border-top:1px solid var(--border)}.termpanel--mobile{position:fixed;inset:0 0 auto 0;z-index:35;border-top:none;overscroll-behavior:none;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}.termpanel--zoomed{position:fixed;top:0;right:0;bottom:0;left:0;z-index:32;border-top:none}.termpanel__tabbar{display:flex;align-items:stretch;flex:none;gap:2px;padding:4px 6px;background:var(--bg);border-bottom:1px solid var(--border)}.termpanel--mobile .termpanel__tabbar{touch-action:pan-x}.termpanel__tabs{display:flex;align-items:stretch;gap:2px;min-width:0;overflow-x:auto}.termpanel--mobile .termpanel__tabs{touch-action:pan-x}.termtab{display:flex;align-items:center;gap:6px;flex:none;max-width:180px;padding:0 6px 0 11px;height:28px;border-radius:7px;color:var(--muted);font-size:12.5px}.termtab:hover{background:var(--surface-2);color:var(--text-2)}.termtab.is-on{background:var(--surface-3);color:var(--text)}.termtab--exited{opacity:.62}.termtab--exited.is-on{opacity:.85}.termtab__name{min-width:0;padding:0;color:inherit;font:inherit;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.termtab__code{flex:none;padding:0 5px;border-radius:999px;background:var(--danger-soft);color:var(--danger);font-family:var(--mono);font-size:10.5px;line-height:16px}.termtab__close{flex:none;display:grid;place-items:center;width:17px;height:17px;border-radius:5px;color:var(--muted);font-size:10px;line-height:1}.termtab__close:hover{background:var(--surface-3);color:var(--text)}.termpanel__add{flex:none;display:grid;place-items:center;width:26px;height:28px;margin-left:2px;border-radius:7px;color:var(--muted);font-size:16px;line-height:1}.termpanel__add:hover:not(:disabled){background:var(--surface-2);color:var(--text)}.termpanel__add:disabled{opacity:.4;cursor:default}.termpanel__spacer{flex:1}.termpanel__zoom,.termpanel__hide{flex:none;display:grid;place-items:center;width:26px;height:28px;border-radius:7px;color:var(--muted);font-size:11px}.termpanel__zoom:hover,.termpanel__hide:hover{background:var(--surface-2);color:var(--text)}.termpanel__zoom svg{width:15px;height:15px}.termpanel--mobile .termpanel__hide{width:44px;height:44px;font-size:15px}.termpanel__body{position:relative;flex:1;min-height:0}.termview{display:none;width:100%;height:100%;padding:4px 0 4px 10px}.termview.is-active{display:block}.termpanel--mobile .xterm-viewport{overscroll-behavior:contain}.termpanel--mobile .termview{touch-action:pinch-zoom}.termview__surface{width:100%;height:100%}.termview__surface.is-hidden{display:none}.termview__state{display:grid;justify-items:center;align-content:center;gap:10px;height:100%;color:var(--muted);font-size:13.5px;text-align:center}.termview__state p{margin:0}.termview__state--error p:first-child{color:var(--text-2);font-weight:550}.termpanel__empty{display:grid;justify-items:center;align-content:center;gap:10px;height:100%;color:var(--muted);font-size:13.5px}.termpanel__empty p{margin:0}.termpanel--mobile .termpanel__empty,.termpanel--mobile .termview__state{touch-action:none}.termpanel__hint{max-width:46ch;text-align:center;font-size:12.5px;line-height:1.5}.termfail{display:flex;flex-direction:column;align-items:center;gap:10px;height:100%;padding:12px 16px;overflow:auto;color:var(--muted);font-size:13.5px;text-align:center}.termfail>:first-child{margin-top:auto}.termfail>:last-child{margin-bottom:auto}.termfail__text{display:grid;gap:6px;max-width:52ch}.termfail__lede{margin:0;color:var(--danger);font-weight:550;line-height:1.45}.termfail__hint{margin:0;font-size:12.5px;line-height:1.5}.termfail__bar{display:flex;flex-wrap:wrap;justify-content:center;gap:8px}.termfail__bar .btn{padding:9px 15px}.termfail__details{font-size:12px}.termfail__details summary{cursor:pointer;color:var(--muted);text-align:center}.termfail__details summary:hover{color:var(--text-2)}.termfail__details pre{margin:6px 0 0;padding:8px 10px;max-height:96px;overflow:auto;border-radius:8px;background:var(--surface-2);color:var(--muted);font-family:var(--mono);font-size:11.5px;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere;text-align:left}.termfail--strip{flex-direction:row;align-items:flex-start;gap:10px;height:auto;max-height:40%;padding:8px 10px;border-bottom:1px solid var(--border);background:var(--danger-soft);text-align:left}.termfail--strip>:first-child,.termfail--strip>:last-child{margin:0}.termfail--strip .termfail__text{flex:1;min-width:0;max-width:none}.termfail--strip .termfail__details summary{text-align:left}.termfail--strip .termfail__bar{flex:none}.termpanel--mobile .termfail{touch-action:pan-y}.relay{display:grid;gap:16px}.relay__lede{margin:0;color:var(--text-2);line-height:1.55}.relay__steps{margin:0;padding-left:20px;display:grid;gap:7px;color:var(--text-2);font-size:14px;line-height:1.5}.relay__form{display:grid;gap:14px}.relay__code{font-family:var(--mono);font-size:20px;letter-spacing:.16em;text-align:center;text-transform:uppercase}.relay__facts{margin:0;display:grid;gap:10px;padding:14px 16px;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface-2)}.relay__facts>div{display:flex;align-items:center;gap:12px;font-size:14px}.relay__facts dt{color:var(--muted);min-width:96px}.relay__facts dd{margin:0;color:var(--text)}.relay__error{margin:0;padding:10px 12px;border:1px solid var(--danger);border-radius:var(--radius);background:var(--danger-soft);color:var(--danger);font-size:13.5px}.relay__note{margin:0;color:var(--muted);font-size:13px;line-height:1.5}.settings{display:grid;gap:22px}.settings__section{display:grid;gap:10px}.settings__heading{margin:0;font-size:13px;font-weight:600;color:var(--text)}.settings__hint{margin:0;color:var(--muted);font-size:13px;line-height:1.5}.settings__field{display:grid;gap:6px}.settings__field-label{font-size:12.5px;color:var(--text-2)}.settings__select{width:100%}.settings__select .select__trigger{width:100%;max-width:none;justify-content:space-between}.settings__select .select__menu{left:0;right:0;max-width:none}.settings__select-skeleton{display:flex;align-items:center;height:33px;padding:4px 8px 4px 11px;border:1px solid var(--border);border-radius:999px;background:var(--surface);color:var(--muted);font-size:12px;font-family:var(--mono)}.access{display:grid;gap:8px}.access__card{display:flex;align-items:flex-start;gap:11px;width:100%;padding:12px 13px;text-align:left;border:1px solid var(--border);border-radius:var(--radius);background:var(--surface);transition:border-color .12s ease,background .12s ease}.access__card:hover:not(:disabled){background:var(--surface-2)}.access__card:disabled{opacity:.55;cursor:default}.access__card.is-on{border-color:var(--accent-line);background:var(--accent-soft)}.access__card--risky{border-color:var(--warn-line)}.access__card--risky.is-on{border-color:var(--warn);background:var(--warn-soft)}.access__radio{position:relative;flex:none;margin-top:2px;width:15px;height:15px;border-radius:50%;border:1.5px solid var(--border);background:var(--surface);transition:border-color .12s ease}.access__card.is-on .access__radio{border-color:var(--accent)}.access__card--risky.is-on .access__radio{border-color:var(--warn)}.access__card.is-on .access__radio:after{content:"";position:absolute;top:3px;right:3px;bottom:3px;left:3px;border-radius:50%;background:var(--accent)}.access__card--risky.is-on .access__radio:after{background:var(--warn)}.access__body{display:grid;gap:3px;min-width:0}.access__title{display:flex;align-items:center;gap:8px;font-size:13.5px;font-weight:560;color:var(--text)}.access__risk{padding:1px 7px;border:1px solid var(--warn-line);border-radius:999px;background:var(--warn-soft);color:var(--warn);font-size:10.5px;font-weight:600;text-transform:uppercase;letter-spacing:.02em}.access__desc{font-size:12.5px;line-height:1.45;color:var(--muted)}.settings__switch-row{display:flex;align-items:flex-start;justify-content:space-between;gap:16px}.settings__switch-copy{display:grid;gap:4px;min-width:0}.settings__switch-row>.switch,.settings__switch-row>.settings__switch-skeleton{margin-top:3px}.settings__switch-skeleton{flex:none;width:30px;height:17px;border-radius:999px;background:var(--surface-3);opacity:.55}.settings__nested{display:grid;gap:10px;padding-top:10px;border-top:1px dashed var(--border)}.settings__nested-heading{margin:0;font-size:13px;font-weight:600;color:var(--text)}.settings__nested.is-disabled{opacity:.5}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Prec as st,EditorSelection as P,countColumn as z,EditorState as it}from"./index-BHot-lnj.js";import{n as ot,E as at}from"./index-891wE-Rj.js";import{L as fe,q as lt,e as X,r as ht,j as ft,t as ut,o as Ee,l as dt,u as pt,v as ue,P as ct}from"./index-BhbDxjJk.js";import{C as mt}from"./index-orsieMzN.js";import{P as gt,a as Q,N as v,T as kt,b as Ie,s as Me,c as H,p as Lt,t as m}from"./index-P6iAB9yV.js";import{html as bt,htmlCompletionSource as wt}from"./index-C73L6h-_.js";import"./index-BypqjF8L.js";import"./index-BXGO38V0.js";import"./index-C7BowCu_.js";class U{static create(e,r,n,s,i){let o=s+(s<<8)+e+(r<<4)|0;return new U(e,r,n,o,i,[],[])}constructor(e,r,n,s,i,o,a){this.type=e,this.value=r,this.from=n,this.hash=s,this.end=i,this.children=o,this.positions=a,this.hashProp=[[v.contextHash,s]]}addChild(e,r){e.prop(v.contextHash)!=this.hash&&(e=new H(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(r)}toTree(e,r=this.end){let n=this.children.length-1;return n>=0&&(r=Math.max(r,this.positions[n]+this.children[n].length+this.from)),new H(e.types[this.type],this.children,this.positions,r-this.from).balance({makeTree:(s,i,o)=>new H(Q.none,s,i,o,this.hashProp)})}}var u;(function(t){t[t.Document=1]="Document",t[t.CodeBlock=2]="CodeBlock",t[t.FencedCode=3]="FencedCode",t[t.Blockquote=4]="Blockquote",t[t.HorizontalRule=5]="HorizontalRule",t[t.BulletList=6]="BulletList",t[t.OrderedList=7]="OrderedList",t[t.ListItem=8]="ListItem",t[t.ATXHeading1=9]="ATXHeading1",t[t.ATXHeading2=10]="ATXHeading2",t[t.ATXHeading3=11]="ATXHeading3",t[t.ATXHeading4=12]="ATXHeading4",t[t.ATXHeading5=13]="ATXHeading5",t[t.ATXHeading6=14]="ATXHeading6",t[t.SetextHeading1=15]="SetextHeading1",t[t.SetextHeading2=16]="SetextHeading2",t[t.HTMLBlock=17]="HTMLBlock",t[t.LinkReference=18]="LinkReference",t[t.Paragraph=19]="Paragraph",t[t.CommentBlock=20]="CommentBlock",t[t.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",t[t.Escape=22]="Escape",t[t.Entity=23]="Entity",t[t.HardBreak=24]="HardBreak",t[t.Emphasis=25]="Emphasis",t[t.StrongEmphasis=26]="StrongEmphasis",t[t.Link=27]="Link",t[t.Image=28]="Image",t[t.InlineCode=29]="InlineCode",t[t.HTMLTag=30]="HTMLTag",t[t.Comment=31]="Comment",t[t.ProcessingInstruction=32]="ProcessingInstruction",t[t.Autolink=33]="Autolink",t[t.HeaderMark=34]="HeaderMark",t[t.QuoteMark=35]="QuoteMark",t[t.ListMark=36]="ListMark",t[t.LinkMark=37]="LinkMark",t[t.EmphasisMark=38]="EmphasisMark",t[t.CodeMark=39]="CodeMark",t[t.CodeText=40]="CodeText",t[t.CodeInfo=41]="CodeInfo",t[t.LinkTitle=42]="LinkTitle",t[t.LinkLabel=43]="LinkLabel",t[t.URL=44]="URL"})(u||(u={}));class St{constructor(e,r){this.start=e,this.content=r,this.marks=[],this.parsers=[]}}class Ct{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return O(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,r=0,n=0){for(let s=r;s<e;s++)n+=this.text.charCodeAt(s)==9?4-n%4:1;return n}findColumn(e){let r=0;for(let n=0;r<this.text.length&&n<e;r++)n+=this.text.charCodeAt(r)==9?4-n%4:1;return r}scrub(){if(!this.baseIndent)return this.text;let e="";for(let r=0;r<this.basePos;r++)e+=" ";return e+this.text.slice(this.basePos)}}function de(t,e,r){if(r.pos==r.text.length||t!=e.block&&r.indent>=e.stack[r.depth+1].value+r.baseIndent)return!0;if(r.indent>=r.baseIndent+4)return!1;let n=(t.type==u.OrderedList?oe:ie)(r,e,!1);return n>0&&(t.type!=u.BulletList||se(r,e,!1)<0)&&r.text.charCodeAt(r.pos+n-1)==t.value}const He={[u.Blockquote](t,e,r){return r.next!=62?!1:(r.markers.push(k(u.QuoteMark,e.lineStart+r.pos,e.lineStart+r.pos+1)),r.moveBase(r.pos+(x(r.text.charCodeAt(r.pos+1))?2:1)),t.end=e.lineStart+r.text.length,!0)},[u.ListItem](t,e,r){return r.indent<r.baseIndent+t.value&&r.next>-1?!1:(r.moveBaseColumn(r.baseIndent+t.value),!0)},[u.OrderedList]:de,[u.BulletList]:de,[u.Document](){return!0}};function x(t){return t==32||t==9||t==10||t==13}function O(t,e=0){for(;e<t.length&&x(t.charCodeAt(e));)e++;return e}function pe(t,e,r){for(;e>r&&x(t.charCodeAt(e-1));)e--;return e}function Pe(t){if(t.next!=96&&t.next!=126)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==t.next;)e++;if(e<t.pos+3)return-1;if(t.next==96){for(let r=e;r<t.text.length;r++)if(t.text.charCodeAt(r)==96)return-1}return e}function ve(t){return t.next!=62?-1:t.text.charCodeAt(t.pos+1)==32?2:1}function se(t,e,r){if(t.next!=42&&t.next!=45&&t.next!=95)return-1;let n=1;for(let s=t.pos+1;s<t.text.length;s++){let i=t.text.charCodeAt(s);if(i==t.next)n++;else if(!x(i))return-1}return r&&t.next==45&&Re(t)>-1&&t.depth==e.stack.length&&e.parser.leafBlockParsers.indexOf(De.SetextHeading)>-1||n<3?-1:1}function Ne(t,e){for(let r=t.stack.length-1;r>=0;r--)if(t.stack[r].type==e)return!0;return!1}function ie(t,e,r){return(t.next==45||t.next==43||t.next==42)&&(t.pos==t.text.length-1||x(t.text.charCodeAt(t.pos+1)))&&(!r||Ne(e,u.BulletList)||t.skipSpace(t.pos+2)<t.text.length)?1:-1}function oe(t,e,r){let n=t.pos,s=t.next;for(;s>=48&&s<=57;){n++;if(n==t.text.length)return-1;s=t.text.charCodeAt(n)}return n==t.pos||n>t.pos+9||s!=46&&s!=41||n<t.text.length-1&&!x(t.text.charCodeAt(n+1))||r&&!Ne(e,u.OrderedList)&&(t.skipSpace(n+1)==t.text.length||n>t.pos+1||t.next!=49)?-1:n+1-t.pos}function ye(t){if(t.next!=35)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==35;)e++;if(e<t.text.length&&t.text.charCodeAt(e)!=32)return-1;let r=e-t.pos;return r>6?-1:r}function Re(t){if(t.next!=45&&t.next!=61||t.indent>=t.baseIndent+4)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==t.next;)e++;let r=e;for(;e<t.text.length&&x(t.text.charCodeAt(e));)e++;return e==t.text.length?r:-1}const W=/^[ \t]*$/,Oe=/-->/,Te=/\?>/,ee=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,Oe],[/^\s*<\?/,Te],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,W],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,W]];function ze(t,e,r){if(t.next!=60)return-1;let n=t.text.slice(t.pos);for(let s=0,i=ee.length-(r?1:0);s<i;s++)if(ee[s][0].test(n))return s;return-1}function ce(t,e){let r=t.countIndent(e,t.pos,t.indent),n=t.skipSpace(e),s=t.countIndent(n,e,r);return s>=r+5||n==t.text.length?r+1:s}function A(t,e,r){let n=t.length-1;n>=0&&t[n].to==e&&t[n].type==u.CodeText?t[n].to=r:t.push(k(u.CodeText,e,r))}const $={LinkReference:void 0,IndentedCode(t,e){let r=e.baseIndent+4;if(e.indent<r)return!1;let n=e.findColumn(r),s=t.lineStart+n,i=t.lineStart+e.text.length,o=[],a=[];for(A(o,s,i);t.nextLine()&&e.depth>=t.stack.length;)if(e.pos==e.text.length){A(a,t.lineStart-1,t.lineStart);for(let l of e.markers)a.push(l)}else{if(e.indent<r)break;{if(a.length){for(let h of a)h.type==u.CodeText?A(o,h.from,h.to):o.push(h);a=[]}A(o,t.lineStart-1,t.lineStart);for(let h of e.markers)o.push(h);i=t.lineStart+e.text.length;let l=t.lineStart+e.findColumn(e.baseIndent+4);l<i&&A(o,l,i)}}return a.length&&(a=a.filter(l=>l.type!=u.CodeText),a.length&&(e.markers=a.concat(e.markers))),t.addNode(t.buffer.writeElements(o,-s).finish(u.CodeBlock,i-s),s),!0},FencedCode(t,e){let r=Pe(e);if(r<0)return!1;let n=t.lineStart+e.pos,s=e.next,i=r-e.pos,o=e.skipSpace(r),a=pe(e.text,e.text.length,o),l=[k(u.CodeMark,n,n+i)];o<a&&l.push(k(u.CodeInfo,t.lineStart+o,t.lineStart+a));for(let h=!0,f=!0,p=!1;t.nextLine()&&e.depth>=t.stack.length;h=!1){let d=e.pos;if(e.indent-e.baseIndent<4)for(;d<e.text.length&&e.text.charCodeAt(d)==s;)d++;if(d-e.pos>=i&&e.skipSpace(d)==e.text.length){for(let c of e.markers)l.push(c);f&&p&&A(l,t.lineStart-1,t.lineStart),l.push(k(u.CodeMark,t.lineStart+e.pos,t.lineStart+d)),t.nextLine();break}else{p=!0,h||(A(l,t.lineStart-1,t.lineStart),f=!1);for(let g of e.markers)l.push(g);let c=t.lineStart+e.basePos,L=t.lineStart+e.text.length;c<L&&(A(l,c,L),f=!1)}}return t.addNode(t.buffer.writeElements(l,-n).finish(u.FencedCode,t.prevLineEnd()-n),n),!0},Blockquote(t,e){let r=ve(e);return r<0?!1:(t.startContext(u.Blockquote,e.pos),t.addNode(u.QuoteMark,t.lineStart+e.pos,t.lineStart+e.pos+1),e.moveBase(e.pos+r),null)},HorizontalRule(t,e){if(se(e,t,!1)<0)return!1;let r=t.lineStart+e.pos;return t.nextLine(),t.addNode(u.HorizontalRule,r),!0},BulletList(t,e){let r=ie(e,t,!1);if(r<0)return!1;t.block.type!=u.BulletList&&t.startContext(u.BulletList,e.basePos,e.next);let n=ce(e,e.pos+1);return t.startContext(u.ListItem,e.basePos,n-e.baseIndent),t.addNode(u.ListMark,t.lineStart+e.pos,t.lineStart+e.pos+r),e.moveBaseColumn(n),null},OrderedList(t,e){let r=oe(e,t,!1);if(r<0)return!1;t.block.type!=u.OrderedList&&t.startContext(u.OrderedList,e.basePos,e.text.charCodeAt(e.pos+r-1));let n=ce(e,e.pos+r);return t.startContext(u.ListItem,e.basePos,n-e.baseIndent),t.addNode(u.ListMark,t.lineStart+e.pos,t.lineStart+e.pos+r),e.moveBaseColumn(n),null},ATXHeading(t,e){let r=ye(e);if(r<0)return!1;let n=e.pos,s=t.lineStart+n,i=pe(e.text,e.text.length,n),o=i;for(;o>n&&e.text.charCodeAt(o-1)==e.next;)o--;(o==i||o==n||!x(e.text.charCodeAt(o-1)))&&(o=e.text.length);let a=t.buffer.write(u.HeaderMark,0,r).writeElements(t.parser.parseInline(e.text.slice(n+r+1,o),s+r+1),-s);o<e.text.length&&a.write(u.HeaderMark,o-n,i-n);let l=a.finish(u.ATXHeading1-1+r,e.text.length-n);return t.nextLine(),t.addNode(l,s),!0},HTMLBlock(t,e){let r=ze(e,t,!1);if(r<0)return!1;let n=t.lineStart+e.pos,s=ee[r][1],i=[],o=s!=W;for(;!s.test(e.text)&&t.nextLine();){if(e.depth<t.stack.length){o=!1;break}for(let h of e.markers)i.push(h)}o&&t.nextLine();let a=s==Oe?u.CommentBlock:s==Te?u.ProcessingInstructionBlock:u.HTMLBlock,l=t.prevLineEnd();return t.addNode(t.buffer.writeElements(i,-n).finish(a,l-n),n),!0},SetextHeading:void 0};class xt{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,r,n){if(this.stage==-1)return!1;let s=n.content+`
|
|
1
|
+
import{Prec as st,EditorSelection as P,countColumn as z,EditorState as it}from"./index-BHot-lnj.js";import{n as ot,E as at}from"./index-891wE-Rj.js";import{L as fe,q as lt,e as X,r as ht,j as ft,t as ut,o as Ee,l as dt,u as pt,v as ue,P as ct}from"./index-DPvZ-hhz.js";import{C as mt}from"./index-B0rzOjTL.js";import{P as gt,a as Q,N as v,T as kt,b as Ie,s as Me,c as H,p as Lt,t as m}from"./index-CLOINL5U.js";import{html as bt,htmlCompletionSource as wt}from"./index-DbdZObbo.js";import"./index-DA4Vv71z.js";import"./index-BanFfa7t.js";import"./index-B6uiazpS.js";class U{static create(e,r,n,s,i){let o=s+(s<<8)+e+(r<<4)|0;return new U(e,r,n,o,i,[],[])}constructor(e,r,n,s,i,o,a){this.type=e,this.value=r,this.from=n,this.hash=s,this.end=i,this.children=o,this.positions=a,this.hashProp=[[v.contextHash,s]]}addChild(e,r){e.prop(v.contextHash)!=this.hash&&(e=new H(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(r)}toTree(e,r=this.end){let n=this.children.length-1;return n>=0&&(r=Math.max(r,this.positions[n]+this.children[n].length+this.from)),new H(e.types[this.type],this.children,this.positions,r-this.from).balance({makeTree:(s,i,o)=>new H(Q.none,s,i,o,this.hashProp)})}}var u;(function(t){t[t.Document=1]="Document",t[t.CodeBlock=2]="CodeBlock",t[t.FencedCode=3]="FencedCode",t[t.Blockquote=4]="Blockquote",t[t.HorizontalRule=5]="HorizontalRule",t[t.BulletList=6]="BulletList",t[t.OrderedList=7]="OrderedList",t[t.ListItem=8]="ListItem",t[t.ATXHeading1=9]="ATXHeading1",t[t.ATXHeading2=10]="ATXHeading2",t[t.ATXHeading3=11]="ATXHeading3",t[t.ATXHeading4=12]="ATXHeading4",t[t.ATXHeading5=13]="ATXHeading5",t[t.ATXHeading6=14]="ATXHeading6",t[t.SetextHeading1=15]="SetextHeading1",t[t.SetextHeading2=16]="SetextHeading2",t[t.HTMLBlock=17]="HTMLBlock",t[t.LinkReference=18]="LinkReference",t[t.Paragraph=19]="Paragraph",t[t.CommentBlock=20]="CommentBlock",t[t.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",t[t.Escape=22]="Escape",t[t.Entity=23]="Entity",t[t.HardBreak=24]="HardBreak",t[t.Emphasis=25]="Emphasis",t[t.StrongEmphasis=26]="StrongEmphasis",t[t.Link=27]="Link",t[t.Image=28]="Image",t[t.InlineCode=29]="InlineCode",t[t.HTMLTag=30]="HTMLTag",t[t.Comment=31]="Comment",t[t.ProcessingInstruction=32]="ProcessingInstruction",t[t.Autolink=33]="Autolink",t[t.HeaderMark=34]="HeaderMark",t[t.QuoteMark=35]="QuoteMark",t[t.ListMark=36]="ListMark",t[t.LinkMark=37]="LinkMark",t[t.EmphasisMark=38]="EmphasisMark",t[t.CodeMark=39]="CodeMark",t[t.CodeText=40]="CodeText",t[t.CodeInfo=41]="CodeInfo",t[t.LinkTitle=42]="LinkTitle",t[t.LinkLabel=43]="LinkLabel",t[t.URL=44]="URL"})(u||(u={}));class St{constructor(e,r){this.start=e,this.content=r,this.marks=[],this.parsers=[]}}class Ct{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return O(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,r=0,n=0){for(let s=r;s<e;s++)n+=this.text.charCodeAt(s)==9?4-n%4:1;return n}findColumn(e){let r=0;for(let n=0;r<this.text.length&&n<e;r++)n+=this.text.charCodeAt(r)==9?4-n%4:1;return r}scrub(){if(!this.baseIndent)return this.text;let e="";for(let r=0;r<this.basePos;r++)e+=" ";return e+this.text.slice(this.basePos)}}function de(t,e,r){if(r.pos==r.text.length||t!=e.block&&r.indent>=e.stack[r.depth+1].value+r.baseIndent)return!0;if(r.indent>=r.baseIndent+4)return!1;let n=(t.type==u.OrderedList?oe:ie)(r,e,!1);return n>0&&(t.type!=u.BulletList||se(r,e,!1)<0)&&r.text.charCodeAt(r.pos+n-1)==t.value}const He={[u.Blockquote](t,e,r){return r.next!=62?!1:(r.markers.push(k(u.QuoteMark,e.lineStart+r.pos,e.lineStart+r.pos+1)),r.moveBase(r.pos+(x(r.text.charCodeAt(r.pos+1))?2:1)),t.end=e.lineStart+r.text.length,!0)},[u.ListItem](t,e,r){return r.indent<r.baseIndent+t.value&&r.next>-1?!1:(r.moveBaseColumn(r.baseIndent+t.value),!0)},[u.OrderedList]:de,[u.BulletList]:de,[u.Document](){return!0}};function x(t){return t==32||t==9||t==10||t==13}function O(t,e=0){for(;e<t.length&&x(t.charCodeAt(e));)e++;return e}function pe(t,e,r){for(;e>r&&x(t.charCodeAt(e-1));)e--;return e}function Pe(t){if(t.next!=96&&t.next!=126)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==t.next;)e++;if(e<t.pos+3)return-1;if(t.next==96){for(let r=e;r<t.text.length;r++)if(t.text.charCodeAt(r)==96)return-1}return e}function ve(t){return t.next!=62?-1:t.text.charCodeAt(t.pos+1)==32?2:1}function se(t,e,r){if(t.next!=42&&t.next!=45&&t.next!=95)return-1;let n=1;for(let s=t.pos+1;s<t.text.length;s++){let i=t.text.charCodeAt(s);if(i==t.next)n++;else if(!x(i))return-1}return r&&t.next==45&&Re(t)>-1&&t.depth==e.stack.length&&e.parser.leafBlockParsers.indexOf(De.SetextHeading)>-1||n<3?-1:1}function Ne(t,e){for(let r=t.stack.length-1;r>=0;r--)if(t.stack[r].type==e)return!0;return!1}function ie(t,e,r){return(t.next==45||t.next==43||t.next==42)&&(t.pos==t.text.length-1||x(t.text.charCodeAt(t.pos+1)))&&(!r||Ne(e,u.BulletList)||t.skipSpace(t.pos+2)<t.text.length)?1:-1}function oe(t,e,r){let n=t.pos,s=t.next;for(;s>=48&&s<=57;){n++;if(n==t.text.length)return-1;s=t.text.charCodeAt(n)}return n==t.pos||n>t.pos+9||s!=46&&s!=41||n<t.text.length-1&&!x(t.text.charCodeAt(n+1))||r&&!Ne(e,u.OrderedList)&&(t.skipSpace(n+1)==t.text.length||n>t.pos+1||t.next!=49)?-1:n+1-t.pos}function ye(t){if(t.next!=35)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==35;)e++;if(e<t.text.length&&t.text.charCodeAt(e)!=32)return-1;let r=e-t.pos;return r>6?-1:r}function Re(t){if(t.next!=45&&t.next!=61||t.indent>=t.baseIndent+4)return-1;let e=t.pos+1;for(;e<t.text.length&&t.text.charCodeAt(e)==t.next;)e++;let r=e;for(;e<t.text.length&&x(t.text.charCodeAt(e));)e++;return e==t.text.length?r:-1}const W=/^[ \t]*$/,Oe=/-->/,Te=/\?>/,ee=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,Oe],[/^\s*<\?/,Te],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,W],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,W]];function ze(t,e,r){if(t.next!=60)return-1;let n=t.text.slice(t.pos);for(let s=0,i=ee.length-(r?1:0);s<i;s++)if(ee[s][0].test(n))return s;return-1}function ce(t,e){let r=t.countIndent(e,t.pos,t.indent),n=t.skipSpace(e),s=t.countIndent(n,e,r);return s>=r+5||n==t.text.length?r+1:s}function A(t,e,r){let n=t.length-1;n>=0&&t[n].to==e&&t[n].type==u.CodeText?t[n].to=r:t.push(k(u.CodeText,e,r))}const $={LinkReference:void 0,IndentedCode(t,e){let r=e.baseIndent+4;if(e.indent<r)return!1;let n=e.findColumn(r),s=t.lineStart+n,i=t.lineStart+e.text.length,o=[],a=[];for(A(o,s,i);t.nextLine()&&e.depth>=t.stack.length;)if(e.pos==e.text.length){A(a,t.lineStart-1,t.lineStart);for(let l of e.markers)a.push(l)}else{if(e.indent<r)break;{if(a.length){for(let h of a)h.type==u.CodeText?A(o,h.from,h.to):o.push(h);a=[]}A(o,t.lineStart-1,t.lineStart);for(let h of e.markers)o.push(h);i=t.lineStart+e.text.length;let l=t.lineStart+e.findColumn(e.baseIndent+4);l<i&&A(o,l,i)}}return a.length&&(a=a.filter(l=>l.type!=u.CodeText),a.length&&(e.markers=a.concat(e.markers))),t.addNode(t.buffer.writeElements(o,-s).finish(u.CodeBlock,i-s),s),!0},FencedCode(t,e){let r=Pe(e);if(r<0)return!1;let n=t.lineStart+e.pos,s=e.next,i=r-e.pos,o=e.skipSpace(r),a=pe(e.text,e.text.length,o),l=[k(u.CodeMark,n,n+i)];o<a&&l.push(k(u.CodeInfo,t.lineStart+o,t.lineStart+a));for(let h=!0,f=!0,p=!1;t.nextLine()&&e.depth>=t.stack.length;h=!1){let d=e.pos;if(e.indent-e.baseIndent<4)for(;d<e.text.length&&e.text.charCodeAt(d)==s;)d++;if(d-e.pos>=i&&e.skipSpace(d)==e.text.length){for(let c of e.markers)l.push(c);f&&p&&A(l,t.lineStart-1,t.lineStart),l.push(k(u.CodeMark,t.lineStart+e.pos,t.lineStart+d)),t.nextLine();break}else{p=!0,h||(A(l,t.lineStart-1,t.lineStart),f=!1);for(let g of e.markers)l.push(g);let c=t.lineStart+e.basePos,L=t.lineStart+e.text.length;c<L&&(A(l,c,L),f=!1)}}return t.addNode(t.buffer.writeElements(l,-n).finish(u.FencedCode,t.prevLineEnd()-n),n),!0},Blockquote(t,e){let r=ve(e);return r<0?!1:(t.startContext(u.Blockquote,e.pos),t.addNode(u.QuoteMark,t.lineStart+e.pos,t.lineStart+e.pos+1),e.moveBase(e.pos+r),null)},HorizontalRule(t,e){if(se(e,t,!1)<0)return!1;let r=t.lineStart+e.pos;return t.nextLine(),t.addNode(u.HorizontalRule,r),!0},BulletList(t,e){let r=ie(e,t,!1);if(r<0)return!1;t.block.type!=u.BulletList&&t.startContext(u.BulletList,e.basePos,e.next);let n=ce(e,e.pos+1);return t.startContext(u.ListItem,e.basePos,n-e.baseIndent),t.addNode(u.ListMark,t.lineStart+e.pos,t.lineStart+e.pos+r),e.moveBaseColumn(n),null},OrderedList(t,e){let r=oe(e,t,!1);if(r<0)return!1;t.block.type!=u.OrderedList&&t.startContext(u.OrderedList,e.basePos,e.text.charCodeAt(e.pos+r-1));let n=ce(e,e.pos+r);return t.startContext(u.ListItem,e.basePos,n-e.baseIndent),t.addNode(u.ListMark,t.lineStart+e.pos,t.lineStart+e.pos+r),e.moveBaseColumn(n),null},ATXHeading(t,e){let r=ye(e);if(r<0)return!1;let n=e.pos,s=t.lineStart+n,i=pe(e.text,e.text.length,n),o=i;for(;o>n&&e.text.charCodeAt(o-1)==e.next;)o--;(o==i||o==n||!x(e.text.charCodeAt(o-1)))&&(o=e.text.length);let a=t.buffer.write(u.HeaderMark,0,r).writeElements(t.parser.parseInline(e.text.slice(n+r+1,o),s+r+1),-s);o<e.text.length&&a.write(u.HeaderMark,o-n,i-n);let l=a.finish(u.ATXHeading1-1+r,e.text.length-n);return t.nextLine(),t.addNode(l,s),!0},HTMLBlock(t,e){let r=ze(e,t,!1);if(r<0)return!1;let n=t.lineStart+e.pos,s=ee[r][1],i=[],o=s!=W;for(;!s.test(e.text)&&t.nextLine();){if(e.depth<t.stack.length){o=!1;break}for(let h of e.markers)i.push(h)}o&&t.nextLine();let a=s==Oe?u.CommentBlock:s==Te?u.ProcessingInstructionBlock:u.HTMLBlock,l=t.prevLineEnd();return t.addNode(t.buffer.writeElements(i,-n).finish(a,l-n),n),!0},SetextHeading:void 0};class xt{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,r,n){if(this.stage==-1)return!1;let s=n.content+`
|
|
2
2
|
`+r.scrub(),i=this.advance(s);return i>-1&&i<s.length?this.complete(e,n,i):!1}finish(e,r){return(this.stage==2||this.stage==3)&&O(r.content,this.pos)==r.content.length?this.complete(e,r,r.content.length):!1}complete(e,r,n){return e.addLeafElement(r,k(u.LinkReference,this.start,this.start+n,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;){if(this.stage==-1)return-1;if(this.stage==0){if(!this.nextStage(Ze(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(k(u.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(qe(e,O(e,this.pos),this.start)))return-1}else if(this.stage==2){let r=O(e,this.pos),n=0;if(r>this.pos){let s=Qe(e,r,this.start);if(s){let i=V(e,s.to-this.start);i>0&&(this.nextStage(s),n=i)}}return n||(n=V(e,this.pos)),n>0&&n<e.length?n:-1}else return V(e,this.pos)}}}function V(t,e){for(;e<t.length;e++){let r=t.charCodeAt(e);if(r==10)break;if(!x(r))return-1}return e}class At{nextLine(e,r,n){let s=r.depth<e.stack.length?-1:Re(r),i=r.next;if(s<0)return!1;let o=k(u.HeaderMark,e.lineStart+r.pos,e.lineStart+s);return e.nextLine(),e.addLeafElement(n,k(i==61?u.SetextHeading1:u.SetextHeading2,n.start,e.prevLineEnd(),[...e.parser.parseInline(n.content,n.start),o])),!0}finish(){return!1}}const De={LinkReference(t,e){return e.content.charCodeAt(0)==91?new xt(e):null},SetextHeading(){return new At}},Bt=[(t,e)=>ye(e)>=0,(t,e)=>Pe(e)>=0,(t,e)=>ve(e)>=0,(t,e)=>ie(e,t,!0)>=0,(t,e)=>oe(e,t,!0)>=0,(t,e)=>se(e,t,!0)>=0,(t,e)=>ze(e,t,!0)>=0],Et={text:"",end:0};class It{constructor(e,r,n,s){this.parser=e,this.input=r,this.ranges=s,this.line=new Ct,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=s[s.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=s[0].from,this.block=U.create(u.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=n.length?new Pt(n,r):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let n=0;;){let s=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;n<e.markers.length&&(!s||e.markers[n].from<s.end);){let i=e.markers[n++];this.addNode(i.type,i.from,i.to)}if(!s)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;e:for(;;){for(let n of this.parser.blockParsers)if(n){let s=n(this,e);if(s!=!1){if(s==!0)return null;e.forward();continue e}}break}if(e.pos==e.text.length)return this.nextLine()?null:this.finish();let r=new St(this.lineStart+e.pos,e.text.slice(e.pos));for(let n of this.parser.leafBlockParsers)if(n){let s=n(this,r);s&&r.parsers.push(s)}e:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let n of this.parser.endLeafBlock)if(n(this,e,r))break e}for(let n of r.parsers)if(n.nextLine(this,e,r))return null;r.content+=`
|
|
3
3
|
`+e.scrub();for(let n of e.markers)r.marks.push(n)}return this.finishLeaf(r),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let r=this.fragments.takeNodes(this);return r?(this.absoluteLineStart+=r,this.lineStart=Ve(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let r=Et;if(r.end=e,e>=this.to)r.text="";else if(r.text=this.lineChunkAt(e),r.end+=r.text.length,this.ranges.length>1){let n=this.absoluteLineStart,s=this.rangeI;for(;this.ranges[s].to<r.end;){s++;let i=this.ranges[s].from,o=this.lineChunkAt(i);r.end=i+o.length,r.text=r.text.slice(0,this.ranges[s-1].to-n)+o,n=r.end-r.text.length}}return r}readLine(){let{line:e}=this,{text:r,end:n}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=n,e.reset(r);e.depth<this.stack.length;e.depth++){let s=this.stack[e.depth],i=this.parser.skipContextMarkup[s.type];if(!i)throw new Error("Unhandled block context "+u[s.type]);let o=this.line.markers.length;if(!i(s,this,e)){this.line.markers.length>o&&(s.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let r=this.input.chunk(e),n;if(this.input.lineChunks)n=r==`
|
|
4
4
|
`?"":r;else{let s=r.indexOf(`
|