blecsd 0.4.0 → 0.6.2
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/README.md +169 -147
- package/dist/blend-BZDmQFAm.d.ts +1215 -0
- package/dist/{border-DGNDfT6T.d.ts → border-Br-Jc027.d.ts} +2 -2
- package/dist/{cell-DwIu2ryP.d.ts → cell-5Ty_3yMs.d.ts} +1 -1
- package/dist/cellRenderer-D0-DJXWl.d.ts +374 -0
- package/dist/chunk-3PGACJB6.js +1 -0
- package/dist/{chunk-DNRXW56C.js → chunk-4EV3YS7F.js} +1 -1
- package/dist/chunk-4XW4WIPH.js +1 -0
- package/dist/chunk-7CLV3LTZ.js +4 -0
- package/dist/chunk-7ZFQO3OQ.js +1 -0
- package/dist/chunk-AM6IDSXI.js +1 -0
- package/dist/chunk-APPZ3YHO.js +0 -0
- package/dist/chunk-EHYOVHRL.js +2 -0
- package/dist/chunk-EKE2BXPS.js +1 -0
- package/dist/chunk-EOFT3PNU.js +1 -0
- package/dist/chunk-ESMSDY3P.js +1 -0
- package/dist/chunk-FJLSHFCF.js +1 -0
- package/dist/chunk-FUW7OD3H.js +1 -0
- package/dist/chunk-GIMWA5WA.js +1 -0
- package/dist/chunk-GRMSEMU7.js +1 -0
- package/dist/chunk-I7AUKTXE.js +1 -0
- package/dist/chunk-IXUFU6TE.js +3 -0
- package/dist/chunk-JB5KFQPD.js +1 -0
- package/dist/chunk-JCLNGU3K.js +1 -0
- package/dist/chunk-JN2OGNK3.js +1 -0
- package/dist/chunk-JRRJCATR.js +1 -0
- package/dist/chunk-JWIVZCKW.js +1 -0
- package/dist/chunk-K5UMVDQX.js +1 -0
- package/dist/chunk-KYNS3GBJ.js +2 -0
- package/dist/chunk-L4FIDOS6.js +1 -0
- package/dist/chunk-LIVVHEOU.js +1 -0
- package/dist/chunk-LNEISTXM.js +1 -0
- package/dist/chunk-M5FXA5FL.js +1 -0
- package/dist/chunk-MEJJLDEQ.js +1 -0
- package/dist/chunk-NYIMY4UV.js +1 -0
- package/dist/chunk-PQZTNWLA.js +1 -0
- package/dist/chunk-QS5QXZNJ.js +1 -0
- package/dist/chunk-SXOBHRXF.js +2 -0
- package/dist/chunk-T2EQLWMN.js +1 -0
- package/dist/chunk-T62UPG63.js +4 -0
- package/dist/chunk-TPBILYDM.js +10 -0
- package/dist/chunk-UWS6FIU5.js +1 -0
- package/dist/chunk-W64J7C25.js +4 -0
- package/dist/chunk-W6RELN6A.js +1 -0
- package/dist/chunk-XYMPBCYW.js +1 -0
- package/dist/chunk-ZAJI53SZ.js +1 -0
- package/dist/cli/init.js +1 -1
- package/dist/{componentStorage-CJTh-TPO.d.ts → componentStorage-CXJvx4Lt.d.ts} +2 -2
- package/dist/components/index.d.ts +7762 -7682
- package/dist/components/index.js +5 -1
- package/dist/core/index.d.ts +4851 -4261
- package/dist/core/index.js +1 -1
- package/dist/debug/index.d.ts +310 -84
- package/dist/debug/index.js +8 -1
- package/dist/{dirtyTracking-C4v8MmM9.d.ts → dirtyTracking-D0SQrEeo.d.ts} +2 -2
- package/dist/{doubleBuffer-CKQFmlPN.d.ts → doubleBuffer-d9yVNtj1.d.ts} +22 -2
- package/dist/errors/index.js +1 -1
- package/dist/{events-9ForpTfM.d.ts → events-CGqK6LGt.d.ts} +2 -2
- package/dist/{inputActions-Fyw14_Gm.d.ts → factories-vW7bn_He.d.ts} +21 -786
- package/dist/{gameLoop-CSTb7e0L.d.ts → gameLoop-C1AyRWyP.d.ts} +3 -3
- package/dist/index.d.ts +25 -1217
- package/dist/index.js +1 -3
- package/dist/input/index.d.ts +1 -1
- package/dist/input/index.js +1 -1
- package/dist/inputStream-BoFAEJ7g.d.ts +1385 -0
- package/dist/interactiveSystem-Dtv3xERg.d.ts +2292 -0
- package/dist/{keyParser-m7fWto6g.d.ts → keyParser-DReXe2j-.d.ts} +28 -28
- package/dist/{mouseParser-B7p5ow7K.d.ts → mouseParser-CTNGolIA.d.ts} +1 -1
- package/dist/{packedStore-BgvnEdE7.d.ts → packedStore-480t2X74.d.ts} +1 -1
- package/dist/panelMovement-DSLYdNOL.d.ts +1909 -0
- package/dist/{parser-iMHmQuUh.d.ts → parser-Q1YLXYpF.d.ts} +1 -1
- package/dist/positioning-DiUivJXa.d.ts +917 -0
- package/dist/{renderable-CwqGwrEV.d.ts → renderable-IbSJao5y.d.ts} +2 -2
- package/dist/{scheduler-DeeZleia.d.ts → scheduler-NbHT3-D2.d.ts} +1 -1
- package/dist/schemas/index.d.ts +6 -6
- package/dist/schemas/index.js +1 -1
- package/dist/style/index.d.ts +851 -0
- package/dist/style/index.js +1 -0
- package/dist/styleInheritance-CuRb5Dmp.d.ts +251 -0
- package/dist/systems/index.d.ts +786 -1882
- package/dist/systems/index.js +1 -1
- package/dist/terminal/index.d.ts +5542 -2460
- package/dist/terminal/index.js +1 -1
- package/dist/terminalBuffer-BbUz27qM.d.ts +691 -0
- package/dist/{terminus-14-bold-HWSPRLJD.js → terminus-14-bold-ZS4IH465.js} +1 -1
- package/dist/{terminus-14-normal-T3SWMH4D.js → terminus-14-normal-HD5N7F5W.js} +1 -1
- package/dist/testing/index.d.ts +923 -0
- package/dist/testing/index.js +7 -0
- package/dist/text/index.d.ts +263 -0
- package/dist/text/index.js +3 -0
- package/dist/textWrap-sY-PZzE7.d.ts +761 -0
- package/dist/{tilemap-BirMJdbu.d.ts → tilemap-ByvTsepD.d.ts} +5 -5
- package/dist/{types-CPB4CpbH.d.ts → types-B8LmNkzG.d.ts} +1 -1
- package/dist/utils/index.d.ts +829 -782
- package/dist/utils/index.js +32 -1
- package/dist/{virtualScrollback-D9uLFe8l.d.ts → virtualScrollback-CiooIebp.d.ts} +4 -4
- package/dist/virtualViewport-fIlbIGPt.d.ts +657 -0
- package/dist/{virtualizedLineStore-DwPEvPkk.d.ts → virtualizedLineStore-DfyhojPZ.d.ts} +1 -1
- package/dist/widgets/bigText.d.ts +13 -13
- package/dist/widgets/bigText.js +1 -1
- package/dist/widgets/fonts/index.d.ts +1 -1
- package/dist/widgets/fonts/index.js +1 -1
- package/dist/widgets/index.d.ts +1620 -910
- package/dist/widgets/index.js +24 -1
- package/package.json +23 -22
- package/dist/3d/index.d.ts +0 -5
- package/dist/3d/index.js +0 -1
- package/dist/audio/index.d.ts +0 -177
- package/dist/audio/index.js +0 -1
- package/dist/chunk-25OEBENM.js +0 -3
- package/dist/chunk-26STV7ZS.js +0 -1
- package/dist/chunk-2NMGUEFC.js +0 -4
- package/dist/chunk-35LCBY6P.js +0 -1
- package/dist/chunk-4PRDJTCM.js +0 -1
- package/dist/chunk-5PELJRUQ.js +0 -1
- package/dist/chunk-5VEKHA3B.js +0 -5
- package/dist/chunk-6KEM3OS2.js +0 -11
- package/dist/chunk-6XWY6GB7.js +0 -1
- package/dist/chunk-735KKTP3.js +0 -1
- package/dist/chunk-7SWJNDOL.js +0 -26
- package/dist/chunk-APKUNIMB.js +0 -1
- package/dist/chunk-CJCSZRV6.js +0 -1
- package/dist/chunk-DMBMCCLN.js +0 -1
- package/dist/chunk-DQTVJITR.js +0 -1
- package/dist/chunk-DSKQ5J4R.js +0 -1
- package/dist/chunk-E4CJRSND.js +0 -1
- package/dist/chunk-EF4DC6IN.js +0 -1
- package/dist/chunk-EJAKECSN.js +0 -1
- package/dist/chunk-FNQRUMFD.js +0 -1
- package/dist/chunk-GJ3RS2VG.js +0 -1
- package/dist/chunk-KTVEMB2I.js +0 -1
- package/dist/chunk-KYAPE44E.js +0 -8
- package/dist/chunk-LI4Y7TBZ.js +0 -1
- package/dist/chunk-NHOL4BN6.js +0 -1
- package/dist/chunk-NPNUUSIB.js +0 -1
- package/dist/chunk-NZ55KBM6.js +0 -1
- package/dist/chunk-OFRWGW2G.js +0 -1
- package/dist/chunk-OMMJ7B5P.js +0 -1
- package/dist/chunk-OMU5BSAS.js +0 -2
- package/dist/chunk-P3ZLIQJP.js +0 -1
- package/dist/chunk-PWI36BQJ.js +0 -1
- package/dist/chunk-QQMUDJ32.js +0 -2
- package/dist/chunk-R3ICZOE4.js +0 -1
- package/dist/chunk-RZ7FGVI6.js +0 -1
- package/dist/chunk-S6WS46FE.js +0 -1
- package/dist/chunk-TSARUU56.js +0 -1
- package/dist/chunk-WJRVUAZR.js +0 -33
- package/dist/chunk-WY5EZOOL.js +0 -1
- package/dist/chunk-YY6RZCZH.js +0 -4
- package/dist/chunk-ZPGJCHXH.js +0 -1
- package/dist/chunk-ZPL2J25N.js +0 -1
- package/dist/game/index.d.ts +0 -486
- package/dist/game/index.js +0 -1
- package/dist/index-DBS5Uefn.d.ts +0 -3156
- package/dist/viewport3d-xI33-_wq.d.ts +0 -182
- package/dist/virtualViewport-DTSN6jFk.d.ts +0 -1856
package/dist/chunk-R3ICZOE4.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {ja,r,v as v$1,P as P$1,Q,D as D$1,b,k as k$1,d as d$1,f as f$1}from'./chunk-DSKQ5J4R.js';import {f,e}from'./chunk-735KKTP3.js';import {g as g$1,q,r as r$1,p as p$1}from'./chunk-APKUNIMB.js';import {oa,u}from'./chunk-GJ3RS2VG.js';import {m as m$1,n}from'./chunk-Z4EZERNE.js';import {z}from'zod';var zt=1e4,ut=1,ft=2;function Yt(e=zt){return {isForm:new Uint8Array(e),flags:new Uint8Array(e)}}var d=Yt(),p=new Map,O=new Map,S=new Map,h=new Map;function Pe(){d.isForm.fill(0),d.flags.fill(0),p.clear(),O.clear(),S.clear(),h.clear();}function Ie(e,t,n={}){d.isForm[t]=1;let r=0;n.keys!==false&&(r|=ut),n.submitOnEnter!==false&&(r|=ft),d.flags[t]=r,p.set(t,new Map),O.set(t,new Map),oa(e,t);}function dt(e,t){return d.isForm[t]===1}function $t(e){return (d.flags[e]&ut)!==0}function Xt(e){return (d.flags[e]&ft)!==0}function jt(e,t,n,r,o){if(!dt(e,t))return;let i=p.get(t),c=O.get(t);i&&c&&(i.set(n,r),o!==void 0?c.set(n,o):c.set(n,gt(e,n)));}function Me(e,t,n){let r=p.get(t),o=O.get(t);r&&r.delete(n),o&&o.delete(n);}function pt(e,t){let n=p.get(t);return n?Array.from(n.keys()):[]}function Be(e,t){return p.get(e)?.get(t)}function gt(e,t){return ja(e,t)?f(e,t)??"":r(e,t)?v$1(e,t):P$1(e,t)?Q(e,t)==="pressed":f(e,t)??null}function qt(e$1,t,n){if(ja(e$1,t)){e(e$1,t,String(n??""));return}if(r(e$1,t)){D$1(e$1,t,!!n);return}n!==null&&e(e$1,t,String(n));}function Jt(e,t){let n={},r=p.get(t);if(!r)return n;for(let[o,i]of r)n[i]=gt(e,o);return n}function Oe(e,t){let n=O.get(t);if(!n)return;for(let[o,i]of n)qt(e,o,i);let r=h.get(t);if(r)for(let o of r)o();oa(e,t);}function Qt(e,t){let n=Jt(e,t),r=S.get(t);if(r)for(let o of r)o(n);return n}function De(e,t){let n=S.get(e)??[];return n.push(t),S.set(e,n),()=>{let r=S.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1);}}}function Te(e,t){let n=h.get(e)??[];return n.push(t),h.set(e,n),()=>{let r=h.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1);}}}function we(e){S.delete(e),h.delete(e);}function Zt(e,t){let r=pt(e,t).filter(o=>g$1(e,o));return q(e,r)}function te(e,t){let r=pt(e,t).filter(o=>g$1(e,o));return r$1(e,r)}function Ve(e,t){let r=u(e,t).filter(o=>g$1(e,o));return p$1(e,r)}function Le(e,t,n,r){return !dt(e,t)||!$t(t)?false:n==="tab"?(r?te(e,t):Zt(e,t),true):(n==="return"||n==="enter")&&Xt(t)?(Qt(e,t),true):false}function Ue(e,t,n="field_"){let r$1=u(e,t);for(let o of r$1)if(ja(e,o)||r(e,o)){let i=`${n}${o}`;jt(e,t,o,i);}}var ee=1e4,D={Horizontal:0,Vertical:1};function ne(e=ee){return {isProgressBar:new Uint8Array(e),value:new Float32Array(e),min:new Float32Array(e),max:new Float32Array(e),orientation:new Uint8Array(e),showPercentage:new Uint8Array(e)}}var a=ne(),yt="\u2588",mt="\u2591",xt="\u2588",bt="\u2591",T=new Map,E=new Map,F=new Map;function Ne(){a.isProgressBar.fill(0),a.value.fill(0),a.min.fill(0),a.max.fill(0),a.orientation.fill(0),a.showPercentage.fill(0),T.clear(),E.clear(),F.clear();}function Ge(e,t,n={}){a.isProgressBar[t]=1,a.min[t]=n.min??0,a.max[t]=n.max??100,a.value[t]=n.value??0,a.orientation[t]=n.orientation??D.Horizontal,a.showPercentage[t]=n.showPercentage?1:0,re(e,t,{}),oa(e,t);}function Ke(e,t){return a.isProgressBar[t]===1}function ze(e,t){return a.value[t]}function Ye(e,t){return a.min[t]}function $e(e,t){return a.max[t]}function St(e,t){let n=a.min[t],r=a.max[t],o=a.value[t];return r===n?0:(o-n)/(r-n)*100}function Xe(e,t){return a.orientation[t]}function je(e,t){return a.showPercentage[t]===1}function w(e,t,n){let r=a.min[t],o=a.max[t],i=a.value[t],c=Math.max(r,Math.min(o,n));if(a.value[t]=c,oa(e,t),c!==i){let f=St(e,t);ie(e,t,c,f),c===o&&i<o&&oe(e,t);}}function qe(e,t,n=1){let r=a.value[t];w(e,t,r+n);}function Je(e,t,n=1){let r=a.value[t];w(e,t,r-n);}function Qe(e,t){let n=a.min[t];w(e,t,n);}function Ze(e,t){let n=a.max[t];w(e,t,n);}function tn(e,t){let n=a.max[t];return a.value[t]>=n}function re(e,t,n){let r=T.get(t),o=a.orientation[t],i=o===D.Vertical?xt:yt,c=o===D.Vertical?bt:mt;T.set(t,{fillChar:n.fillChar??r?.fillChar??i,emptyChar:n.emptyChar??r?.emptyChar??c,fillFg:n.fillFg??r?.fillFg??16711935,fillBg:n.fillBg??r?.fillBg??255,emptyFg:n.emptyFg??r?.emptyFg??1717987071,emptyBg:n.emptyBg??r?.emptyBg??255});}function Z(e,t){let n=T.get(t);if(n)return n;let r=a.orientation[t],o=r===D.Vertical?xt:yt,i=r===D.Vertical?bt:mt;return {fillChar:o,emptyChar:i,fillFg:16711935,fillBg:255,emptyFg:1717987071,emptyBg:255}}function en(e,t){T.delete(t);}function nn(e,t){return Z(e,t).fillChar}function rn(e,t){return Z(e,t).emptyChar}function on(e,t,n){let r=St(e,t)/100,o=Z(e,t),i=Math.round(n*r),c=n-i;return o.fillChar.repeat(i)+o.emptyChar.repeat(c)}function ln(e,t,n){let r=E.get(t)??[];return r.push(n),E.set(t,r),()=>{let o=E.get(t);if(o){let i=o.indexOf(n);i!==-1&&o.splice(i,1);}}}function an(e,t,n){let r=F.get(t)??[];return r.push(n),F.set(t,r),()=>{let o=F.get(t);if(o){let i=o.indexOf(n);i!==-1&&o.splice(i,1);}}}function oe(e,t){let n=E.get(t);if(n)for(let r of n)r();}function ie(e,t,n,r){let o=F.get(t);if(o)for(let i of o)i(n,r);}function sn(e,t){E.delete(t),F.delete(t);}function cn(e,t,n){a.orientation[t]=n,oa(e,t);}function un(e,t,n){a.showPercentage[t]=n?1:0,oa(e,t);}function fn(e,t,n,r){a.min[t]=n,a.max[t]=r;let o=a.value[t];(o<n||o>r)&&w(e,t,Math.max(n,Math.min(r,o))),oa(e,t);}var Et="\u25BC",Ft="\u25B2",Ct="\u25CF",vt=" ",Y=1e4,s={isSelect:new Uint8Array(Y),selectedIndex:new Int32Array(Y).fill(-1),highlightedIndex:new Int32Array(Y).fill(0),optionCount:new Uint32Array(Y)},g=new Map,V=new Map,C=new Map,v=new Map,W=new Map,le={initial:"closed",states:{closed:{on:{open:"open",toggle:"open",disable:"disabled"}},open:{on:{close:"closed",select:"closed",toggle:"closed",disable:"disabled"}},disabled:{on:{enable:"closed"}}}};function yn(e,t,n=[],r=-1){s.isSelect[t]=1,s.selectedIndex[t]=r,s.highlightedIndex[t]=r>=0?r:0,s.optionCount[t]=n.length,g.set(t,[...n]),b(e,t,le);}function Wt(e,t){return s.isSelect[t]===1&&k$1(e,t)}function $(e,t){return d$1(e,t)??"closed"}function At(e,t,n){return $(e,t)===n}function ae(e,t){return At(e,t,"open")}function se(e,t){return At(e,t,"disabled")}function ht(e,t){let n=t.get(e);if(n)for(let r of n)r();}function ce(e,t,n){t!=="open"&&n==="open"?ht(e,v):t==="open"&&n!=="open"&&ht(e,W);}function A(e,t,n){if(!Wt(e,t))return false;let r=$(e,t),o=f$1(e,t,n);if(o){let i=$(e,t);oa(e,t),ce(t,r,i);}return o}function mn(e,t){return A(e,t,"open")}function xn(e,t){return A(e,t,"close")}function bn(e,t){return A(e,t,"toggle")}function Sn(e,t){return A(e,t,"disable")}function hn(e,t){return A(e,t,"enable")}function En(e,t){return g.get(t)??[]}function Fn(e,t,n){g.set(t,[...n]),s.optionCount[t]=n.length,(s.selectedIndex[t]??-1)>=n.length&&(s.selectedIndex[t]=n.length>0?0:-1),s.highlightedIndex[t]=0,oa(e,t);}function Cn(e,t){return s.optionCount[t]??0}function ue(e,t,n){return g.get(t)?.[n]}function vn(e,t){return s.selectedIndex[t]??-1}function _t(e,t){let n=s.selectedIndex[t]??-1;if(!(n<0))return ue(e,t,n)}function Wn(e,t){return _t(e,t)?.value}function An(e,t){return _t(e,t)?.label}function kt(e,t,n){let r=g.get(t);if(!r||n<0||n>=r.length||(s.selectedIndex[t]??-1)===n)return false;s.selectedIndex[t]=n,s.highlightedIndex[t]=n,oa(e,t);let i=r[n],c=C.get(t);if(c&&i)for(let f of c)f(i.value,i.label,n);return A(e,t,"select"),true}function _n(e,t,n){let r=g.get(t);if(!r)return false;let o=r.findIndex(i=>i.value===n);return o<0?false:kt(e,t,o)}function kn(e,t){s.selectedIndex[t]=-1,oa(e,t);}function fe(e,t){return s.highlightedIndex[t]??0}function Pt(e,t,n){let r=s.optionCount[t]??0;if(r===0)return;let o=Math.max(0,Math.min(n,r-1));s.highlightedIndex[t]=o,oa(e,t);}function Pn(e,t,n=true){let r=s.optionCount[t]??0;if(r===0)return;let o=(s.highlightedIndex[t]??0)+1;o>=r&&(o=n?0:r-1),Pt(e,t,o);}function In(e,t,n=true){let r=s.optionCount[t]??0;if(r===0)return;let o=(s.highlightedIndex[t]??0)-1;o<0&&(o=n?r-1:0),Pt(e,t,o);}function Mn(e,t){let n=s.highlightedIndex[t]??0;return kt(e,t,n)}function Bn(e,t,n){let r=V.get(t);V.set(t,{closedIndicator:n.closedIndicator??r?.closedIndicator??Et,openIndicator:n.openIndicator??r?.openIndicator??Ft,selectedMark:n.selectedMark??r?.selectedMark??Ct,separator:n.separator??r?.separator??vt});}function de(e,t){return V.get(t)??{closedIndicator:Et,openIndicator:Ft,selectedMark:Ct,separator:vt}}function On(e,t){V.delete(t);}function Dn(e,t){let n=de(e,t);return $(e,t)==="open"?n.openIndicator:n.closedIndicator}function Tn(e,t,n){let r=C.get(t)??[];return r.push(n),C.set(t,r),()=>{let o=C.get(t);if(o){let i=o.indexOf(n);i!==-1&&o.splice(i,1);}}}function wn(e,t,n){let r=v.get(t)??[];return r.push(n),v.set(t,r),()=>{let o=v.get(t);if(o){let i=o.indexOf(n);i!==-1&&o.splice(i,1);}}}function Vn(e,t,n){let r=W.get(t)??[];return r.push(n),W.set(t,r),()=>{let o=W.get(t);if(o){let i=o.indexOf(n);i!==-1&&o.splice(i,1);}}}function Ln(e,t){C.delete(t),v.delete(t),W.delete(t);}function Un(e,t,n){if(!Wt(e,t)||se(e,t))return null;let r=ae(e,t);switch(n){case "return":case "enter":case "space":return r?{type:"select",index:fe(e,t)}:{type:"open"};case "escape":return r?{type:"close"}:null;case "up":return r?{type:"highlightPrev"}:{type:"open"};case "down":return r?{type:"highlightNext"}:{type:"open"};case "home":return r?{type:"highlightFirst"}:null;case "end":return r?{type:"highlightLast"}:null;default:return null}}function Rn(){s.isSelect.fill(0),s.selectedIndex.fill(-1),s.highlightedIndex.fill(0),s.optionCount.fill(0),g.clear(),V.clear(),C.clear(),v.clear(),W.clear();}var m={Horizontal:0,Vertical:1},Mt="\u2500",Bt="\u2502",Ot="\u25CF",Dt="\u2501",Tt="\u2503",wt=1717987071,Vt=255,Lt=4294967295,Ut=6750207,Rt=16711935,Ht=255,y=1e4,l={isSlider:new Uint8Array(y),value:new Float32Array(y),min:new Float32Array(y),max:new Float32Array(y).fill(100),step:new Float32Array(y).fill(1),orientation:new Uint8Array(y),showValue:new Uint8Array(y)},L=new Map,_=new Map,k=new Map,P=new Map,ge={initial:"idle",states:{idle:{on:{focus:"focused",disable:"disabled"}},focused:{on:{blur:"idle",dragStart:"dragging",disable:"disabled"}},dragging:{on:{dragEnd:"focused",blur:"idle",disable:"disabled"}},disabled:{on:{enable:"idle"}}}};function Yn(e,t,n=0,r=100,o=0,i=1){l.isSlider[t]=1,l.min[t]=n,l.max[t]=r,l.value[t]=tt(o,n,r),l.step[t]=i,l.orientation[t]=m.Horizontal,l.showValue[t]=0,b(e,t,ge);}function tt(e,t,n){return Math.max(t,Math.min(n,e))}function Nt(e,t,n){return t<=0?e:n+Math.round((e-n)/t)*t}function Gt(e,t){return l.isSlider[t]===1&&k$1(e,t)}function X(e,t){return d$1(e,t)??"idle"}function Kt(e,t,n){return X(e,t)===n}function $n(e,t){let n=X(e,t);return n==="focused"||n==="dragging"}function Xn(e,t){return Kt(e,t,"dragging")}function ye(e,t){return Kt(e,t,"disabled")}function It(e,t){let n=t.get(e);if(n)for(let r of n)r();}function me(e,t,n){t!=="dragging"&&n==="dragging"?It(e,k):t==="dragging"&&n!=="dragging"&&It(e,P);}function I(e,t,n){if(!Gt(e,t))return false;let r=X(e,t),o=f$1(e,t,n);if(o){let i=X(e,t);oa(e,t),me(t,r,i);}return o}function jn(e,t){return I(e,t,"focus")}function qn(e,t){return I(e,t,"blur")}function Jn(e,t){return I(e,t,"dragStart")}function Qn(e,t){return I(e,t,"dragEnd")}function Zn(e,t){return I(e,t,"disable")}function tr(e,t){return I(e,t,"enable")}function xe(e,t){return l.value[t]??0}function x(e,t,n){let r=l.min[t]??0,o=l.max[t]??100,i=l.step[t]??1,c=tt(Nt(n,i,r),r,o),f=l.value[t]??0;if(c!==f){l.value[t]=c,oa(e,t);let M=_.get(t);if(M)for(let b of M)b(c);}}function er(e,t){return l.min[t]??0}function nr(e,t){return l.max[t]??100}function rr(e,t){return l.step[t]??1}function or(e,t,n,r){m$1.parse({min:n,max:r}),l.min[t]=n,l.max[t]=r;let o=l.value[t]??0,i=tt(o,n,r);i!==o&&x(e,t,i),oa(e,t);}function ir(e,t,n$1){n.parse(n$1),l.step[t]=n$1;let r=l.value[t]??0,o=l.min[t]??0,i=Nt(r,n$1,o);i!==r&&x(e,t,i),oa(e,t);}function be(e,t){let n=l.min[t]??0,r=l.max[t]??100,o=l.value[t]??0;return r===n?0:(o-n)/(r-n)}function lr(e,t,n){z.number().finite().parse(n);let r=l.min[t]??0,o=l.max[t]??100,i=Math.max(0,Math.min(1,n)),c=r+i*(o-r);x(e,t,c);}function ar(e,t,n=1){let r=l.step[t]??1,o=l.value[t]??0;x(e,t,o+r*n);}function sr(e,t,n=1){let r=l.step[t]??1,o=l.value[t]??0;x(e,t,o-r*n);}function cr(e,t){x(e,t,l.min[t]??0);}function ur(e,t){x(e,t,l.max[t]??100);}function j(e,t){return l.orientation[t]}function fr(e,t,n){l.orientation[t]=n,oa(e,t);}function Se(e,t){return j(e,t)===m.Horizontal}function dr(e,t){return j(e,t)===m.Vertical}function he(e,t){return l.showValue[t]===1}function pr(e,t,n){l.showValue[t]=n?1:0,oa(e,t);}function gr(e,t,n){let r=L.get(t),o=j(e,t),i=o===m.Vertical?Bt:Mt,c=o===m.Vertical?Tt:Dt;L.set(t,{trackChar:n.trackChar??r?.trackChar??i,thumbChar:n.thumbChar??r?.thumbChar??Ot,fillChar:n.fillChar??r?.fillChar??c,trackFg:n.trackFg??r?.trackFg??wt,trackBg:n.trackBg??r?.trackBg??Vt,thumbFg:n.thumbFg??r?.thumbFg??Lt,thumbBg:n.thumbBg??r?.thumbBg??Ut,fillFg:n.fillFg??r?.fillFg??Rt,fillBg:n.fillBg??r?.fillBg??Ht});}function Ee(e,t){let n=j(e,t),r=n===m.Vertical?Bt:Mt,o=n===m.Vertical?Tt:Dt;return L.get(t)??{trackChar:r,thumbChar:Ot,fillChar:o,trackFg:wt,trackBg:Vt,thumbFg:Lt,thumbBg:Ut,fillFg:Rt,fillBg:Ht}}function yr(e,t){L.delete(t);}function mr(e,t,n){let r=_.get(t)??[];return r.push(n),_.set(t,r),()=>{let o=_.get(t);if(o){let i=o.indexOf(n);i!==-1&&o.splice(i,1);}}}function xr(e,t,n){let r=k.get(t)??[];return r.push(n),k.set(t,r),()=>{let o=k.get(t);if(o){let i=o.indexOf(n);i!==-1&&o.splice(i,1);}}}function br(e,t,n){let r=P.get(t)??[];return r.push(n),P.set(t,r),()=>{let o=P.get(t);if(o){let i=o.indexOf(n);i!==-1&&o.splice(i,1);}}}function Sr(e,t){_.delete(t),k.delete(t),P.delete(t);}function hr(e,t,n){if(!Gt(e,t)||ye(e,t))return null;let r=Se(e,t);switch(n){case "right":return r?{type:"increment",multiplier:1}:null;case "left":return r?{type:"decrement",multiplier:1}:null;case "up":return r?null:{type:"increment",multiplier:1};case "down":return r?null:{type:"decrement",multiplier:1};case "pageup":return {type:"increment",multiplier:10};case "pagedown":return {type:"decrement",multiplier:10};case "home":return {type:"toMin"};case "end":return {type:"toMax"};default:return null}}function Er(e,t,n){if(n<=0)return "";let r=be(e,t),o=Ee(e,t),i=he(e,t),c="",f=n;i&&(c=` ${xe(e,t)}`,f=Math.max(1,n-c.length));let M=Math.round(r*(f-1)),b="";for(let B=0;B<f;B++)B===M?b+=o.thumbChar:B<M?b+=o.fillChar:b+=o.trackChar;return b+c}function Fr(){l.isSlider.fill(0),l.value.fill(0),l.min.fill(0),l.max.fill(100),l.step.fill(1),l.orientation.fill(0),l.showValue.fill(0),L.clear(),_.clear(),k.clear(),P.clear();}export{cn as $,Vt as $a,mt as A,Wn as Aa,ir as Ab,xt as B,An as Ba,be as Bb,bt as C,kt as Ca,lr as Cb,Ne as D,_n as Da,ar as Db,Ge as E,kn as Ea,sr as Eb,Ke as F,fe as Fa,cr as Fb,ze as G,Pt as Ga,ur as Gb,Ye as H,Pn as Ha,j as Hb,$e as I,In as Ia,fr as Ib,St as J,Mn as Ja,Se as Jb,Xe as K,Bn as Ka,dr as Kb,je as L,de as La,he as Lb,w as M,On as Ma,pr as Mb,qe as N,Dn as Na,gr as Nb,Je as O,Tn as Oa,Ee as Ob,Qe as P,wn as Pa,yr as Pb,Ze as Q,Vn as Qa,mr as Qb,tn as R,Ln as Ra,xr as Rb,re as S,Un as Sa,br as Sb,Z as T,Rn as Ta,Sr as Tb,en as U,m as Ua,hr as Ub,nn as V,Mt as Va,Er as Vb,rn as W,Bt as Wa,Fr as Wb,on as X,Ot as Xa,ln as Y,Dt as Ya,an as Z,Tt as Za,sn as _,wt as _a,d as a,un as aa,Lt as ab,Pe as b,fn as ba,Ut as bb,Ie as c,Et as ca,Rt as cb,dt as d,Ft as da,Ht as db,$t as e,Ct as ea,l as eb,Xt as f,vt as fa,ge as fb,jt as g,s as ga,Yn as gb,Me as h,le as ha,Gt as hb,pt as i,yn as ia,X as ib,Be as j,Wt as ja,Kt as jb,gt as k,$ as ka,$n as kb,qt as l,At as la,Xn as lb,Jt as m,ae as ma,ye as mb,Oe as n,se as na,I as nb,Qt as o,A as oa,jn as ob,De as p,mn as pa,qn as pb,Te as q,xn as qa,Jn as qb,we as r,bn as ra,Qn as rb,Zt as s,Sn as sa,Zn as sb,te as t,hn as ta,tr as tb,Ve as u,En as ua,xe as ub,Le as v,Fn as va,x as vb,Ue as w,Cn as wa,er as wb,D as x,ue as xa,nr as xb,a as y,vn as ya,rr as yb,yt as z,_t as za,or as zb};
|
package/dist/chunk-RZ7FGVI6.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var E=Symbol.for("blecsd.error");var t={INVALID_INPUT:"VALIDATION_INVALID_INPUT",INVALID_HEX_COLOR:"VALIDATION_INVALID_HEX_COLOR",INVALID_HEX_LENGTH:"VALIDATION_INVALID_HEX_LENGTH",INVALID_COLOR_OBJECT:"VALIDATION_INVALID_COLOR_OBJECT",INVALID_COLOR_VALUE:"VALIDATION_INVALID_COLOR_VALUE",INVALID_PALETTE_INDEX:"VALIDATION_INVALID_PALETTE_INDEX",INVALID_CUBE_INDEX:"VALIDATION_INVALID_CUBE_INDEX",INVALID_GRAYSCALE_INDEX:"VALIDATION_INVALID_GRAYSCALE_INDEX",INVALID_DIMENSION:"VALIDATION_INVALID_DIMENSION",INVALID_BUFFER_DIMENSIONS:"VALIDATION_INVALID_BUFFER_DIMENSIONS",INVALID_SURROGATE_PAIR:"VALIDATION_INVALID_SURROGATE_PAIR",SCHEMA_VALIDATION_FAILED:"VALIDATION_SCHEMA_FAILED",REQUIRED_FIELD_MISSING:"VALIDATION_REQUIRED_FIELD_MISSING",VALUE_OUT_OF_RANGE:"VALIDATION_VALUE_OUT_OF_RANGE"},i={TERMINAL_ERROR:"TERMINAL_ERROR",NOT_INITIALIZED:"TERMINAL_NOT_INITIALIZED",ALREADY_INITIALIZED:"TERMINAL_ALREADY_INITIALIZED",TERMINFO_NOT_FOUND:"TERMINAL_TERMINFO_NOT_FOUND",NEGOTIATION_NOT_STARTED:"TERMINAL_NEGOTIATION_NOT_STARTED",NEGOTIATION_ALREADY_STARTED:"TERMINAL_NEGOTIATION_ALREADY_STARTED",CAPABILITY_NOT_SUPPORTED:"TERMINAL_CAPABILITY_NOT_SUPPORTED",WRITE_FAILED:"TERMINAL_WRITE_FAILED",READ_FAILED:"TERMINAL_READ_FAILED",CLEANUP_FAILED:"TERMINAL_CLEANUP_FAILED"},d={SYSTEM_ERROR:"SYSTEM_ERROR",LOOP_ALREADY_RUNNING:"SYSTEM_LOOP_ALREADY_RUNNING",LOOP_NOT_RUNNING:"SYSTEM_LOOP_NOT_RUNNING",CANNOT_CHANGE_WORLD:"SYSTEM_CANNOT_CHANGE_WORLD",SYSTEM_EXECUTION_FAILED:"SYSTEM_EXECUTION_FAILED",PHASE_NOT_FOUND:"SYSTEM_PHASE_NOT_FOUND",PHASE_ALREADY_EXISTS:"SYSTEM_PHASE_ALREADY_EXISTS",INVALID_PHASE_ORDER:"SYSTEM_INVALID_PHASE_ORDER",SCHEDULER_NOT_INITIALIZED:"SYSTEM_SCHEDULER_NOT_INITIALIZED"},I={ENTITY_ERROR:"ENTITY_ERROR",NOT_FOUND:"ENTITY_NOT_FOUND",ALREADY_EXISTS:"ENTITY_ALREADY_EXISTS",SCREEN_ALREADY_EXISTS:"ENTITY_SCREEN_ALREADY_EXISTS",INVALID_ID:"ENTITY_INVALID_ID",MISSING_COMPONENT:"ENTITY_MISSING_COMPONENT",HIERARCHY_ERROR:"ENTITY_HIERARCHY_ERROR"},a={COMPONENT_ERROR:"COMPONENT_ERROR",NOT_FOUND:"COMPONENT_NOT_FOUND",ALREADY_EXISTS:"COMPONENT_ALREADY_EXISTS",INVALID_DATA:"COMPONENT_INVALID_DATA",STORE_NOT_INITIALIZED:"COMPONENT_STORE_NOT_INITIALIZED"},T={INPUT_ERROR:"INPUT_ERROR",INVALID_KEY_SEQUENCE:"INPUT_INVALID_KEY_SEQUENCE",INVALID_MOUSE_EVENT:"INPUT_INVALID_MOUSE_EVENT",HANDLER_NOT_REGISTERED:"INPUT_HANDLER_NOT_REGISTERED",BUFFER_OVERFLOW:"INPUT_BUFFER_OVERFLOW"},p={RENDER_ERROR:"RENDER_ERROR",BUFFER_NOT_INITIALIZED:"RENDER_BUFFER_NOT_INITIALIZED",INVALID_COORDINATES:"RENDER_INVALID_COORDINATES",BUFFER_OVERFLOW:"RENDER_BUFFER_OVERFLOW",CYCLE_TIMEOUT:"RENDER_CYCLE_TIMEOUT"},s={CONFIG_ERROR:"CONFIG_ERROR",INVALID_GAME_CONFIG:"CONFIG_INVALID_GAME_CONFIG",INVALID_SCREEN_CONFIG:"CONFIG_INVALID_SCREEN_CONFIG",INVALID_WIDGET_CONFIG:"CONFIG_INVALID_WIDGET_CONFIG",MISSING_REQUIRED:"CONFIG_MISSING_REQUIRED"},C={INTERNAL_ERROR:"INTERNAL_ERROR",UNEXPECTED_STATE:"INTERNAL_UNEXPECTED_STATE",ASSERTION_FAILED:"INTERNAL_ASSERTION_FAILED",NOT_IMPLEMENTED:"INTERNAL_NOT_IMPLEMENTED",UNREACHABLE:"INTERNAL_UNREACHABLE"},O={...t,...i,...d,...I,...a,...T,...p,...s,...C};function S(r,e,o){return {kind:"validation",code:r,message:e,timestamp:Date.now(),cause:o?.cause,context:o?.zodIssues?{...o.context,zodIssues:o.zodIssues}:o?.context}}function A(r,e,o){return {kind:"terminal",code:r,message:e,timestamp:Date.now(),cause:o?.cause,context:o?.context}}function c(r,e,o){return {kind:"system",code:r,message:e,timestamp:Date.now(),cause:o?.cause,context:o?.context}}function f(r,e,o){return {kind:"entity",code:r,message:e,timestamp:Date.now(),cause:o?.cause,context:o?.context}}function D(r,e,o){return {kind:"component",code:r,message:e,timestamp:Date.now(),cause:o?.cause,context:o?.context}}function L(r,e,o){return {kind:"input",code:r,message:e,timestamp:Date.now(),cause:o?.cause,context:o?.context}}function m(r,e,o){return {kind:"render",code:r,message:e,timestamp:Date.now(),cause:o?.cause,context:o?.context}}function x(r,e,o){return {kind:"config",code:r,message:e,timestamp:Date.now(),cause:o?.cause,context:o?.context}}function N(r,e,o){return {kind:"internal",code:r,message:e,timestamp:Date.now(),cause:o?.cause,context:o?.context}}function B(r){let e=new Error(r.message);return e.name=`BlECSd${k(r.kind)}Error`,e[E]=r,r.cause&&(e.cause=r.cause),e}function _(r){return r==null||typeof r!="object"?null:E in r?r[E]:null}function V(r,e,o){let n=_(r);if(n)return n;let y=r instanceof Error?r:void 0,u=r instanceof Error?`${o}: ${r.message}`:`${o}: ${String(r)}`;return N(e,u,{cause:y})}function k(r){return r.charAt(0).toUpperCase()+r.slice(1)}function U(r){return r.kind==="validation"}function g(r){return r.kind==="terminal"}function M(r){return r.kind==="system"}function F(r){return r.kind==="entity"}function Y(r){return r.kind==="component"}function P(r){return r.kind==="input"}function G(r){return r.kind==="render"}function w(r){return r.kind==="config"}function H(r){return r.kind==="internal"}function v(r,e){return r.kind===e}function X(r,e){return r.code===e}function h(r){return r!=null&&typeof r=="object"&&E in r}function K(r){if(r==null||typeof r!="object")return false;let e=r;return typeof e.kind=="string"&&typeof e.code=="string"&&typeof e.message=="string"&&typeof e.timestamp=="number"}function Z(r){return r.context!=null}function b(r){return r.cause!=null}function z(r){return r.context!=null&&r.context.zodIssues!=null&&r.context.zodIssues.length>0}function R(r){return {ok:true,value:r}}function l(r){return {ok:false,error:r}}function W(r){return r.ok===true}function $(r){return r.ok===false}function Q(r){if(r.ok)return r.value;let e=r.error instanceof Error?r.error.message:typeof r.error=="object"&&r.error!==null&&"message"in r.error?String(r.error.message):String(r.error);throw new Error(`Called unwrap on Err: ${e}`)}function j(r,e){return r.ok?r.value:e}function J(r,e){return r.ok?r.value:e(r.error)}function q(r,e){return r.ok?R(e(r.value)):r}function rr(r,e){return r.ok?r:l(e(r.error))}function er(r,e){return r.ok?e(r.value):r}export{F as A,Y as B,P as C,G as D,w as E,H as F,v as G,X as H,h as I,K as J,Z as K,b as L,z as M,R as N,l as O,W as P,$ as Q,Q as R,j as S,J as T,q as U,rr as V,er as W,E as a,t as b,i as c,d,I as e,a as f,T as g,p as h,s as i,C as j,O as k,S as l,A as m,c as n,f as o,D as p,L as q,m as r,x as s,N as t,B as u,_ as v,V as w,U as x,g as y,M as z};
|
package/dist/chunk-S6WS46FE.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {n,f,i}from'./chunk-P3ZLIQJP.js';n();function m(t){let n=new Error(t);return n.name="EntityValidationError",n}function g(t){return t instanceof Error&&t.name==="EntityValidationError"}var a=new WeakMap;function l(t,n){a.set(t,n);}function y(t){let n=a.get(t);if(n)return n;if(t&&typeof t=="object"){let o=Object.keys(t);if(o.length>0)return `Component(${o.slice(0,2).join(", ")}${o.length>2?", ...":""})`}return "Component"}function u(t,n,o,r){if(!f(t,n))throw m(`Entity ${n} does not exist in the world (context: ${r}). The entity may have been removed or never created.`);let e=[];for(let i$1 of o)i(t,n,i$1)||e.push(y(i$1));if(e.length>0){let i=e.join(", "),p=e[0];throw m(`Entity ${n} is missing required component${e.length>1?"s":""} for ${r}: ${i}. Did you forget to call addComponent(world, ${n}, ${p})?`)}}function d(t,n,o){if(!f(t,n))return false;for(let r of o)if(!i(t,n,r))return false;return true}export{m as a,g as b,l as c,u as d,d as e};
|
package/dist/chunk-TSARUU56.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {n,i,h as h$1}from'./chunk-P3ZLIQJP.js';import {z as z$1}from'zod';n();var c=1e4,E=5,C=5,x=1,g=z$1.object({firstVisibleLine:z$1.number().int().nonnegative().optional(),visibleLineCount:z$1.number().int().nonnegative().optional(),totalLineCount:z$1.number().int().nonnegative().optional(),overscanBefore:z$1.number().int().min(0).max(255).optional(),overscanAfter:z$1.number().int().min(0).max(255).optional(),estimatedLineHeight:z$1.number().int().min(1).max(255).optional(),isVariableHeight:z$1.boolean().optional(),selectedLine:z$1.number().int().min(-1).optional(),cursorLine:z$1.number().int().min(-1).optional()}),D=z$1.object({start:z$1.number().int().nonnegative(),end:z$1.number().int().nonnegative(),visibleStart:z$1.number().int().nonnegative(),visibleEnd:z$1.number().int().nonnegative(),count:z$1.number().int().nonnegative()}),M=z$1.object({currentLine:z$1.number().int().nonnegative(),totalLines:z$1.number().int().nonnegative(),viewportSize:z$1.number().int().nonnegative(),maxScrollLine:z$1.number().int().nonnegative(),scrollPercent:z$1.number().min(0).max(100),atTop:z$1.boolean(),atBottom:z$1.boolean()}),t={firstVisibleLine:new Uint32Array(c),visibleLineCount:new Uint32Array(c),totalLineCount:new Uint32Array(c),overscanBefore:new Uint8Array(c),overscanAfter:new Uint8Array(c),estimatedLineHeight:new Uint8Array(c),isVariableHeight:new Uint8Array(c),isDirty:new Uint8Array(c),selectedLine:new Int32Array(c),cursorLine:new Int32Array(c)};function h(e){t.firstVisibleLine[e]=0,t.visibleLineCount[e]=0,t.totalLineCount[e]=0,t.overscanBefore[e]=E,t.overscanAfter[e]=C,t.estimatedLineHeight[e]=x,t.isVariableHeight[e]=0,t.isDirty[e]=1,t.selectedLine[e]=-1,t.cursorLine[e]=-1;}function b(e,n){i(e,n,t)||(h$1(e,n,t),h(n));}function f(e){let n=t.totalLineCount[e],i=t.visibleLineCount[e],r=t.firstVisibleLine[e],s=Math.max(0,n-i);t.firstVisibleLine[e]=Math.max(0,Math.min(s,r));}function u(e){t.isDirty[e]=1;}function T(e,n,i){let r=g.parse(i);return b(e,n),r.totalLineCount!==void 0&&(t.totalLineCount[n]=r.totalLineCount),r.visibleLineCount!==void 0&&(t.visibleLineCount[n]=r.visibleLineCount),r.firstVisibleLine!==void 0&&(t.firstVisibleLine[n]=r.firstVisibleLine),r.overscanBefore!==void 0&&(t.overscanBefore[n]=r.overscanBefore),r.overscanAfter!==void 0&&(t.overscanAfter[n]=r.overscanAfter),r.estimatedLineHeight!==void 0&&(t.estimatedLineHeight[n]=r.estimatedLineHeight),r.isVariableHeight!==void 0&&(t.isVariableHeight[n]=r.isVariableHeight?1:0),r.selectedLine!==void 0&&(t.selectedLine[n]=r.selectedLine),r.cursorLine!==void 0&&(t.cursorLine[n]=r.cursorLine),f(n),u(n),n}function U(e,n){if(i(e,n,t))return {firstVisibleLine:t.firstVisibleLine[n],visibleLineCount:t.visibleLineCount[n],totalLineCount:t.totalLineCount[n],overscanBefore:t.overscanBefore[n],overscanAfter:t.overscanAfter[n],estimatedLineHeight:t.estimatedLineHeight[n],isVariableHeight:t.isVariableHeight[n]===1,isDirty:t.isDirty[n]===1,selectedLine:t.selectedLine[n],cursorLine:t.cursorLine[n]}}function F(e,n){return i(e,n,t)}function A(e,n,i){return b(e,n),t.firstVisibleLine[n]=i,f(n),u(n),n}function w(e,n){if(!i(e,n,t))return;let i$1=t.firstVisibleLine[n],r=t.visibleLineCount[n],s=t.totalLineCount[n],l=t.overscanBefore[n],m=t.overscanAfter[n],L=Math.min(s,i$1+r),y=Math.max(0,i$1-l),v=Math.min(s,L+m);return {start:y,end:v,visibleStart:i$1,visibleEnd:L,count:v-y}}function R(e,n,i$1){if(!i(e,n,t))return false;let r=t.firstVisibleLine[n],s=t.visibleLineCount[n];return i$1>=r&&i$1<r+s}function I(e,n,i){let r=w(e,n);return r?i>=r.start&&i<r.end:false}function O(e,n,i){b(e,n);let r=t.visibleLineCount[n],s=Math.max(0,i-Math.floor(r/2));return t.firstVisibleLine[n]=s,f(n),u(n),n}function W(e,n,i){b(e,n);let r=t.firstVisibleLine[n],s=t.totalLineCount[n],l=t.visibleLineCount[n],m=r+i,L=Math.max(0,s-l);return t.firstVisibleLine[n]=Math.max(0,Math.min(L,m)),u(n),n}function _(e,n,i){b(e,n);let r=t.visibleLineCount[n],s=i*Math.max(1,r-1);return W(e,n,s)}function d(e,n){return A(e,n,0)}function P(e,n){b(e,n);let i=t.totalLineCount[n],r=t.visibleLineCount[n];return t.firstVisibleLine[n]=Math.max(0,i-r),u(n),n}function z(e,n){if(!i(e,n,t))return;let i$1=t.firstVisibleLine[n],r=t.totalLineCount[n],s=t.visibleLineCount[n],l=Math.max(0,r-s),m=l>0?i$1/l*100:0;return {currentLine:i$1,totalLines:r,viewportSize:s,maxScrollLine:l,scrollPercent:Math.min(100,Math.max(0,m)),atTop:i$1<=0,atBottom:i$1>=l}}function j(e,n,i){return b(e,n),t.totalLineCount[n]=i,f(n),u(n),n}function N(e,n,i){return b(e,n),t.visibleLineCount[n]=i,f(n),u(n),n}function k(e,n,i,r){return b(e,n),t.overscanBefore[n]=i,t.overscanAfter[n]=r,u(n),n}function G(e,n,i){return b(e,n),t.selectedLine[n]=i,u(n),n}function Y(e,n){return i(e,n,t)?t.selectedLine[n]:-1}function q(e,n,i){return b(e,n),t.cursorLine[n]=i,u(n),n}function J(e,n){return i(e,n,t)?t.cursorLine[n]:-1}function K(e,n,i){b(e,n);let r=t.totalLineCount[n],s=t.cursorLine[n],l=s<0?0:s,m=Math.max(0,Math.min(r-1,l+i));return t.cursorLine[n]=m,H(e,n),u(n),n}function H(e,n){if(!i(e,n,t))return n;let i$1=t.cursorLine[n];if(i$1<0)return n;let r=t.firstVisibleLine[n],s=t.visibleLineCount[n];i$1<r&&(t.firstVisibleLine[n]=i$1,u(n));let l=r+s-1;return i$1>l&&(t.firstVisibleLine[n]=i$1-s+1,f(n),u(n)),n}function Q(e,n){return i(e,n,t)?t.isDirty[n]===1:false}function X(e,n){return i(e,n,t)&&(t.isDirty[n]=0),n}function Z(e,n){return i(e,n,t)&&(t.isDirty[n]=1),n}export{Q as A,X as B,Z as C,g as a,D as b,M as c,t as d,T as e,U as f,F as g,A as h,w as i,R as j,I as k,O as l,W as m,_ as n,d as o,P as p,z as q,j as r,N as s,k as t,G as u,Y as v,q as w,J as x,K as y,H as z};
|
package/dist/chunk-WJRVUAZR.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import {u,b as b$1,c as c$1,d,e}from'./chunk-ZPGJCHXH.js';import {t}from'./chunk-P3ZLIQJP.js';import {c}from'./chunk-5PELJRUQ.js';import {z as z$1}from'zod';import*as On from'fs';import*as L from'path';u();function _(e){return {topLeft:String.fromCodePoint(e.topLeft),topRight:String.fromCodePoint(e.topRight),bottomLeft:String.fromCodePoint(e.bottomLeft),bottomRight:String.fromCodePoint(e.bottomRight),horizontal:String.fromCodePoint(e.horizontal),vertical:String.fromCodePoint(e.vertical)}}var Lr=_(b$1),kr=_(c$1),Tr=_(d),Rr=_(e),Ar={topLeft:"+",topRight:"+",bottomLeft:"+",bottomRight:"+",horizontal:"-",vertical:"|"},wr={topLeft:"\u250C",topRight:"\u2510",bottomLeft:"\u2514",bottomRight:"\u2518",horizontal:"\u254C",vertical:"\u254E"};function Er(e,t,n=4294967295,r=0){let o=[];for(let i=0;i<t;i++){let a=[];for(let l=0;l<e;l++)a.push({char:" ",fg:n,bg:r});o.push(a);}return {width:e,height:t,cells:o,setCell(i,a,l,s,u){if(i<0||i>=e||a<0||a>=t)return;let d=o[a]?.[i];d&&(d.char=l,s!==void 0&&(d.fg=s),u!==void 0&&(d.bg=u));}}}function Wr(e,t,n,r,o,i,a,l,s,u){e.setCell(t,n,l.topLeft,s,u),i>1&&e.setCell(r,n,l.topRight,s,u),a>1&&e.setCell(t,o,l.bottomLeft,s,u),i>1&&a>1&&e.setCell(r,o,l.bottomRight,s,u);}function Mr(e,t,n,r,o,i,a,l,s,u){for(let d=t+1;d<r;d++)e.setCell(d,n,l.horizontal,s,u),a>1&&e.setCell(d,o,l.horizontal,s,u);for(let d=n+1;d<o;d++)e.setCell(t,d,l.vertical,s,u),i>1&&e.setCell(r,d,l.vertical,s,u);}function Ir(e,t,n,r,o,i,a={}){let{fg:l,bg:s,fill:u=false,fillChar:d=" "}=a;if(r<1||o<1)return;let f=t+r-1,c=n+o-1;Wr(e,t,n,f,c,r,o,i,l,s),Mr(e,t,n,f,c,r,o,i,l,s),u&&r>2&&o>2&&kt(e,t+1,n+1,r-2,o-2,d,l,s);}function Dr(e,t,n,r,o="\u2500",i,a){for(let l=0;l<r;l++)e.setCell(t+l,n,o,i,a);}function vr(e,t,n,r,o="\u2502",i,a){for(let l=0;l<r;l++)e.setCell(t,n+l,o,i,a);}function kt(e,t,n,r,o,i=" ",a,l){for(let s=0;s<o;s++)for(let u=0;u<r;u++)e.setCell(t+u,n+s,i,a,l);}function Br(e,t,n,r,o,i){for(let a=0;a<r.length;a++){let l=r[a];l!==void 0&&e.setCell(t+a,n,l,o,i);}}function Pr(e){let t=[];for(let n=0;n<e.height;n++){let r="";for(let o=0;o<e.width;o++)r+=e.cells[n]?.[o]?.char??" ";t.push(r);}return t.join(`
|
|
2
|
-
`)}var _r={maxDelayMs:16,maxBatchSize:100,immediateCursor:true};function Fr(e,t){return {config:{..._r,...t},pending:[],flushCallback:e,flushTimer:null,totalProcessed:0,totalFlushes:0}}function Or(e,t){if(e.pending.push(t),e.pending.length>=e.config.maxBatchSize){X(e);return}e.flushTimer||(e.flushTimer=setTimeout(()=>{X(e);},e.config.maxDelayMs));}function X(e){if(e.flushTimer&&(clearTimeout(e.flushTimer),e.flushTimer=null),e.pending.length===0)return;let t=[...e.pending];e.pending=[];let n=Vr(t),r=t.length>1?(t[t.length-1]?.timestamp??0)-(t[0]?.timestamp??0):0,o={dirtyRegion:n,changeCount:t.length,timeSpanMs:r,changes:t};return e.totalProcessed+=t.length,e.totalFlushes++,e.flushCallback&&e.flushCallback(o),o}function Nr(e){return {config:e.config,pendingCount:e.pending.length,flushScheduled:e.flushTimer!==null,totalProcessed:e.totalProcessed,totalFlushes:e.totalFlushes,avgChangesPerFlush:e.totalFlushes>0?e.totalProcessed/e.totalFlushes:0}}function Hr(e,t,n){return {startLine:e,startColumn:t,endLine:e,endColumn:t,text:n,timestamp:Date.now()}}function Gr(e,t,n,r){return {startLine:e,startColumn:t,endLine:n,endColumn:r,text:"",timestamp:Date.now()}}function zr(e,t,n,r,o){return {startLine:e,startColumn:t,endLine:n,endColumn:r,text:o,timestamp:Date.now()}}function Ur(e){let t=X(e);return e.flushCallback=null,t}function Vr(e){if(e.length===0)return {startLine:0,endLine:0,lineCountChanged:false,lineDelta:0};let t=Number.POSITIVE_INFINITY,n=0,r=0;for(let o of e){t=Math.min(t,o.startLine),n=Math.max(n,o.endLine);let i=0;for(let l=0;l<o.text.length;l++)o.text[l]===`
|
|
3
|
-
`&&i++;let a=o.endLine-o.startLine;r+=i-a,n=Math.max(n,o.startLine+i);}return {startLine:t===Number.POSITIVE_INFINITY?0:t,endLine:n,lineCountChanged:r!==0,lineDelta:r}}t();var J={scrollPadding:5,horizontalPadding:5,lineWrap:true,tabWidth:4};function jr(e){let t=[0];for(let n=0;n<e.length;n++)e[n]===`
|
|
4
|
-
`&&t.push(n+1);return {offsets:t,lineCount:t.length}}function $r(e){let t=[0],n=0;for(let r=0;r<e.length-1;r++)n+=e[r]??0,t.push(n);return {offsets:t,lineCount:e.length}}function Zr(e,t){let n=e.offsets,r=0,o=n.length-1;for(;r<=o;){let i=r+o>>>1;(n[i]??0)<=t?r=i+1:o=i-1;}return Math.max(0,r-1)}function Kr(e,t){return t<0||t>=e.lineCount?-1:e.offsets[t]??-1}function Y(e=0,t=0){return {line:Math.max(0,e),column:Math.max(0,t)}}function qr(e=0,t=24,n=0,r=80){return {topLine:Math.max(0,e),height:Math.max(1,t),leftColumn:Math.max(0,n),width:Math.max(1,r)}}function Xr(e){return {...J,...e}}function M(e,t,n,r){let o={...J,...r},{topLine:i,leftColumn:a}=t,l=false,s=e.line-t.height+1+o.scrollPadding,u=e.line-o.scrollPadding;i>u&&(i=Math.max(0,u),l=true),i<s&&(i=Math.min(Math.max(0,n-t.height),Math.max(0,s)),l=true);let d=e.column-t.width+1+o.horizontalPadding,f=e.column-o.horizontalPadding;return a>f&&(a=Math.max(0,f),l=true),a<d&&(a=Math.max(0,d),l=true),l?{viewport:{...t,topLine:i,leftColumn:a},scrolled:true}:{viewport:t,scrolled:false}}function Ae(e,t,n){let r=Math.max(0,Math.min(e.line,t-1)),o=r<t?n(r):0,i=Math.max(0,Math.min(e.column,o));return {line:r,column:i}}function Tt(e,t,n,r,o){let i=Y(e.line-t,e.column),a=Ae(i,r,()=>e.column),{viewport:l,scrolled:s}=M(a,n,r,o);return {cursor:a,viewport:l,scrolled:s}}function Rt(e,t,n,r,o){let i=Y(e.line+t,e.column),a=Ae(i,r,()=>e.column),{viewport:l,scrolled:s}=M(a,n,r,o);return {cursor:a,viewport:l,scrolled:s}}function we(e,t,n,r){let o=Math.max(0,Math.min(e,n-1)),i=Y(o,0),{viewport:a,scrolled:l}=M(i,t,n,r);return {cursor:i,viewport:a,scrolled:l}}function Jr(e,t,n,r){return Tt(e,t.height-1,t,n,r)}function Yr(e,t,n,r){return Rt(e,t.height-1,t,n,r)}function Qr(e,t,n){return we(0,e,t,n)}function eo(e,t,n){return we(t-1,e,t,n)}function to(e,t,n,r,o,i){let a={...J,...i},{line:l,column:s}=e;s-=t,s<0&&a.lineWrap&&l>0?(l--,s=o(l)):s=Math.max(0,s);let u={line:l,column:s},{viewport:d,scrolled:f}=M(u,n,r,i);return {cursor:u,viewport:d,scrolled:f}}function no(e,t,n,r,o,i){let a={...J,...i},{line:l,column:s}=e,u=o(l);s+=t,s>u&&a.lineWrap&&l<r-1?(l++,s=0):s=Math.min(s,u);let d={line:l,column:s},{viewport:f,scrolled:c}=M(d,n,r,i);return {cursor:d,viewport:f,scrolled:c}}var ro=3,oo=10;function At(e){let t=0;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);t=(t<<5)-t+r|0;}return t}function io(e,t){let n=e.length,r=t.length,o=n+r,i=ko(e,t);if(i)return i;let a=To(e,t,o);return ao(a.trace,e,t,a.offset)}function ao(e,t,n,r){let o=[],i=t.length,a=n.length;for(let l=e.length-1;l>=0;l--){let s=e[l]??[],u=i-a,d=wo(u,l,s,r),f=s[d+r]??0,c=f-d,m=Eo(o,t,i,a,f,c);i=m.x,a=m.y;let h=Wo(o,t,n,l,i,a,f);i=h.x,a=h.y;}return o}function lo(e,t){let n=e.length,r=t.length,o=Array.from({length:n+1},()=>Array(r+1).fill(0));for(let i=1;i<=n;i++){let a=o[i];if(a)for(let l=1;l<=r;l++)e[i-1]===t[l-1]?a[l]=(o[i-1]?.[l-1]??0)+1:a[l]=Math.max(o[i-1]?.[l]??0,a[l-1]??0);}return o}function so(e,t,n){let r=[],o=t.length,i=n.length,a=[];for(;o>0||i>0;){let l=Po(e,t,n,o,i);a.unshift(l.op),o=l.nextI,i=l.nextJ;}for(let l of a)r.push({type:l.type,content:l.line,oldLineNo:l.oldNo,newLineNo:l.newNo});return r}function uo(e,t){let n=e.length,r=t.length;if(n>100||r>100)return io(e,t);let o=lo(e,t);return so(o,e,t)}function fo(e,t,n){if(e.length===0)return [];let r=[],o=[],i=0,a=1,l=1,s=0,u=0;function d(){if(o.length===0)return;let f=o.filter(m=>m.type==="remove"||m.type==="context").length,c=o.filter(m=>m.type==="add"||m.type==="context").length;r.push({id:i++,oldStart:a,oldCount:f,newStart:l,newCount:c,lines:o,collapsed:false,contextBefore:u,contextAfter:s}),a+=f,l+=c,o=[],u=0;}for(let f of e)if(f.type==="context")if(s++,s>t*2+n){let c=o.slice(-t);o=o.slice(0,-t),o.length>0&&(s=t,d()),o=[...c,f],u=c.length+1,s=1;}else o.push(f);else s=0,o.push(f);return d(),r}function Wt(e,t,n={}){let r=performance.now(),o=n.contextLines??3,i=n.collapseThreshold??10,{oldLines:a,newLines:l}=Mo(e,t),s=uo(a,l),u=fo(s,o,i);n.initiallyCollapsed&&Io(u);let d=Do(s);return {chunks:u,additions:d.additions,deletions:d.deletions,contextLines:d.contextLines,computeTimeMs:performance.now()-r}}function co(){return {oldHash:0,newHash:0,result:null,expandedChunks:new Set}}function mo(e){e.oldHash=0,e.newHash=0,e.result=null,e.expandedChunks.clear();}function ho(e,t,n,r={}){let o=At(t),i=At(n);if(e.oldHash===o&&e.newHash===i&&e.result)return e.result;let a=Wt(t,n,r);e.oldHash=o,e.newHash=i,e.result=a;for(let l of a.chunks)e.expandedChunks.has(l.id)&&(l.collapsed=false);return a}function Mt(e,t,n){let r=t.chunks.find(o=>o.id===n);r&&(r.collapsed=false,e.expandedChunks.add(n));}function It(e,t,n){let r=t.chunks.find(o=>o.id===n);r&&(r.collapsed=true,e.expandedChunks.delete(n));}function go(e,t,n){let r=t.chunks.find(o=>o.id===n);return r?r.collapsed?(Mt(e,t,n),false):(It(e,t,n),true):false}function po(e,t){for(let n of t.chunks)n.collapsed=false,e.expandedChunks.add(n.id);}function bo(e,t){for(let n of t.chunks)n.lines.some(o=>o.type==="add"||o.type==="remove")||(n.collapsed=true,e.expandedChunks.delete(n.id));}function xo(e,t,n){let r=[];for(let l of e.chunks)if(l.collapsed)r.push({line:{type:"header",content:`... ${l.lines.length} lines hidden ...`},chunkId:l.id,collapsed:true});else for(let s of l.lines)r.push({line:s,chunkId:l.id,collapsed:false});let o=Math.max(0,t),i=Math.min(r.length,t+n),a=r.slice(o,i);return {lines:a.map(l=>l.line),startIndex:o,totalLines:r.length,chunkInfo:a.map(l=>({chunkId:l.chunkId,collapsed:l.collapsed}))}}function yo(e){let t=0;for(let n of e.chunks)n.collapsed?t+=1:t+=n.lines.length;return t}function Co(e,t,n){let r=vo(e),o=Math.max(0,t),i=Math.min(r.length,t+n);return r.slice(o,i)}function So(e,t="a",n="b"){let r=[];r.push(`--- ${t}`),r.push(`+++ ${n}`);for(let o of e.chunks){r.push(`@@ -${o.oldStart},${o.oldCount} +${o.newStart},${o.newCount} @@`);for(let i of o.lines){let a=i.type==="add"?"+":i.type==="remove"?"-":" ";r.push(a+i.content);}}return r.join(`
|
|
5
|
-
`)}function Lo(e){let t=performance.now(),n=e.split(`
|
|
6
|
-
`),r=[],o=null,i=[],a=0,l=0,s=0,u=0,d=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/;for(let f of n){if(f.startsWith("---")||f.startsWith("+++"))continue;let c=d.exec(f);if(c){let h=Bo(c,a);a+=1;let g=Et(r,o,i);o=h,i=g;continue}if(!o)continue;let m=_o(f);m&&(i.push(m.line),l+=m.additions,s+=m.deletions,u+=m.contextLines);}return Et(r,o,i),{chunks:r,additions:l,deletions:s,contextLines:u,computeTimeMs:performance.now()-t}}function ko(e,t){let n=e.length,r=t.length;return n===0&&r===0?[]:n===0?t.map((o,i)=>({type:"add",content:o,newLineNo:i+1})):r===0?e.map((o,i)=>({type:"remove",content:o,oldLineNo:i+1})):null}function To(e,t,n){let r=e.length,o=t.length,i=2*n+1,a=new Array(i).fill(0),l=n,s=[];e:for(let u=0;u<=n;u++){s.push(a.slice());for(let d=-u;d<=u;d+=2){let f=Ro(a,d,u,l),c=Ao(e,t,f,d);if(a[d+l]=c.x,c.x>=r&&c.y>=o)break e}}return {trace:s,offset:l}}function Ro(e,t,n,r){return t===-n||t!==n&&(e[t-1+r]??0)<(e[t+1+r]??0)?e[t+1+r]??0:(e[t-1+r]??0)+1}function Ao(e,t,n,r){let o=n,i=o-r;for(;o<e.length&&i<t.length&&e[o]===t[i];)o++,i++;return {x:o,y:i}}function wo(e,t,n,r){return e===-t||e!==t&&(n[e-1+r]??0)<(n[e+1+r]??0)?e+1:e-1}function Eo(e,t,n,r,o,i){let a=n,l=r;for(;a>o&&l>i;)a--,l--,e.unshift({type:"context",content:t[a]??"",oldLineNo:a+1,newLineNo:l+1});return {x:a,y:l}}function Wo(e,t,n,r,o,i,a){if(r<=0)return {x:o,y:i};if(o===a){let s=i-1;return e.unshift({type:"add",content:n[s]??"",newLineNo:s+1}),{x:o,y:s}}let l=o-1;return e.unshift({type:"remove",content:t[l]??"",oldLineNo:l+1}),{x:l,y:i}}function Mo(e,t){return {oldLines:e===""?[]:e.split(`
|
|
7
|
-
`),newLines:t===""?[]:t.split(`
|
|
8
|
-
`)}}function Io(e){for(let t of e)t.lines.some(r=>r.type==="add"||r.type==="remove")||(t.collapsed=true);}function Do(e){let t=0,n=0,r=0;for(let o of e)o.type==="add"?t++:o.type==="remove"?n++:o.type==="context"&&r++;return {additions:t,deletions:n,contextLines:r}}function vo(e){let t=[];for(let n of e.chunks){if(n.collapsed){t.push({left:void 0,right:void 0});continue}let r=[],o=[];for(let i of n.lines){if(i.type==="context"){wt(t,r,o),t.push({left:Q(i,"context","left"),right:Q(i,"context","right")});continue}if(i.type==="remove"){r.push(i);continue}i.type==="add"&&o.push(i);}wt(t,r,o);}return t}function wt(e,t,n){for(;t.length>0||n.length>0;){let r=t.shift(),o=n.shift();e.push({left:r?Q(r,"remove","left"):void 0,right:o?Q(o,"add","right"):void 0});}}function Q(e,t,n){return {lineNo:(n==="left"?e.oldLineNo:e.newLineNo)??0,content:e.content,type:t}}function Bo(e,t){return {id:t,oldStart:parseInt(e[1]??"0",10),oldCount:parseInt(e[2]??"1",10),newStart:parseInt(e[3]??"0",10),newCount:parseInt(e[4]??"1",10),lines:[],collapsed:false,contextBefore:0,contextAfter:0}}function Po(e,t,n,r,o){let i=r>0?t[r-1]:void 0,a=o>0?n[o-1]:void 0;return i!==void 0&&a!==void 0&&i===a?{op:{type:"context",line:i,oldNo:r,newNo:o},nextI:r-1,nextJ:o-1}:a!==void 0&&(r===0||(e[r]?.[o-1]??0)>=(e[r-1]?.[o]??0))?{op:{type:"add",line:a,newNo:o},nextI:r,nextJ:o-1}:{op:{type:"remove",line:i??"",oldNo:r},nextI:r-1,nextJ:o}}function Et(e,t,n){return !t||n.length===0?n:(e.push({...t,lines:n}),[])}function _o(e){return e.startsWith("+")?{line:{type:"add",content:e.slice(1)},additions:1,deletions:0,contextLines:0}:e.startsWith("-")?{line:{type:"remove",content:e.slice(1)},additions:0,deletions:1,contextLines:0}:e.startsWith(" ")?{line:{type:"context",content:e.slice(1)},additions:0,deletions:0,contextLines:1}:null}function Fo(e){return {additions:e.additions,deletions:e.deletions,totalChanges:e.additions+e.deletions,chunks:e.chunks.length,collapsedChunks:e.chunks.filter(t=>t.collapsed).length}}var Nt={};c(Nt,{CP1252_HIGH_BYTES:()=>Ie,CP437_CONTROL_CHARS:()=>F,CP437_HIGH_BYTES:()=>Ee,CP850_HIGH_BYTES:()=>We,CP866_HIGH_BYTES:()=>Me,CodePageSchema:()=>C,ConversionOptionsSchema:()=>Oo,UnmappableModeSchema:()=>Bt,bufferToString:()=>zo,byteToChar:()=>ve,charToByte:()=>Go,getCodePageMap:()=>$o,getSupportedCodePages:()=>jo,isCodePageSupported:()=>Vo,stringToBuffer:()=>Uo});var Ee=["\xC7","\xFC","\xE9","\xE2","\xE4","\xE0","\xE5","\xE7","\xEA","\xEB","\xE8","\xEF","\xEE","\xEC","\xC4","\xC5","\xC9","\xE6","\xC6","\xF4","\xF6","\xF2","\xFB","\xF9","\xFF","\xD6","\xDC","\xA2","\xA3","\xA5","\u20A7","\u0192","\xE1","\xED","\xF3","\xFA","\xF1","\xD1","\xAA","\xBA","\xBF","\u2310","\xAC","\xBD","\xBC","\xA1","\xAB","\xBB","\u2591","\u2592","\u2593","\u2502","\u2524","\u2561","\u2562","\u2556","\u2555","\u2563","\u2551","\u2557","\u255D","\u255C","\u255B","\u2510","\u2514","\u2534","\u252C","\u251C","\u2500","\u253C","\u255E","\u255F","\u255A","\u2554","\u2569","\u2566","\u2560","\u2550","\u256C","\u2567","\u2568","\u2564","\u2565","\u2559","\u2558","\u2552","\u2553","\u256B","\u256A","\u2518","\u250C","\u2588","\u2584","\u258C","\u2590","\u2580","\u03B1","\xDF","\u0393","\u03C0","\u03A3","\u03C3","\xB5","\u03C4","\u03A6","\u0398","\u03A9","\u03B4","\u221E","\u03C6","\u03B5","\u2229","\u2261","\xB1","\u2265","\u2264","\u2320","\u2321","\xF7","\u2248","\xB0","\u2219","\xB7","\u221A","\u207F","\xB2","\u25A0","\xA0"],F=["\0","\u263A","\u263B","\u2665","\u2666","\u2663","\u2660","\u2022","\u25D8","\u25CB","\u25D9","\u2642","\u2640","\u266A","\u266B","\u263C","\u25BA","\u25C4","\u2195","\u203C","\xB6","\xA7","\u25AC","\u21A8","\u2191","\u2193","\u2192","\u2190","\u221F","\u2194","\u25B2","\u25BC"],We=["\xC7","\xFC","\xE9","\xE2","\xE4","\xE0","\xE5","\xE7","\xEA","\xEB","\xE8","\xEF","\xEE","\xEC","\xC4","\xC5","\xC9","\xE6","\xC6","\xF4","\xF6","\xF2","\xFB","\xF9","\xFF","\xD6","\xDC","\xF8","\xA3","\xD8","\xD7","\u0192","\xE1","\xED","\xF3","\xFA","\xF1","\xD1","\xAA","\xBA","\xBF","\xAE","\xAC","\xBD","\xBC","\xA1","\xAB","\xBB","\u2591","\u2592","\u2593","\u2502","\u2524","\xC1","\xC2","\xC0","\xA9","\u2563","\u2551","\u2557","\u255D","\xA2","\xA5","\u2510","\u2514","\u2534","\u252C","\u251C","\u2500","\u253C","\xE3","\xC3","\u255A","\u2554","\u2569","\u2566","\u2560","\u2550","\u256C","\xA4","\xF0","\xD0","\xCA","\xCB","\xC8","\u0131","\xCD","\xCE","\xCF","\u2518","\u250C","\u2588","\u2584","\xA6","\xCC","\u2580","\xD3","\xDF","\xD4","\xD2","\xF5","\xD5","\xB5","\xFE","\xDE","\xDA","\xDB","\xD9","\xFD","\xDD","\xAF","\xB4","\xAD","\xB1","\u2017","\xBE","\xB6","\xA7","\xF7","\xB8","\xB0","\xA8","\xB7","\xB9","\xB3","\xB2","\u25A0","\xA0"],Me=["\u0410","\u0411","\u0412","\u0413","\u0414","\u0415","\u0416","\u0417","\u0418","\u0419","\u041A","\u041B","\u041C","\u041D","\u041E","\u041F","\u0420","\u0421","\u0422","\u0423","\u0424","\u0425","\u0426","\u0427","\u0428","\u0429","\u042A","\u042B","\u042C","\u042D","\u042E","\u042F","\u0430","\u0431","\u0432","\u0433","\u0434","\u0435","\u0436","\u0437","\u0438","\u0439","\u043A","\u043B","\u043C","\u043D","\u043E","\u043F","\u2591","\u2592","\u2593","\u2502","\u2524","\u2561","\u2562","\u2556","\u2555","\u2563","\u2551","\u2557","\u255D","\u255C","\u255B","\u2510","\u2514","\u2534","\u252C","\u251C","\u2500","\u253C","\u255E","\u255F","\u255A","\u2554","\u2569","\u2566","\u2560","\u2550","\u256C","\u2567","\u2568","\u2564","\u2565","\u2559","\u2558","\u2552","\u2553","\u256B","\u256A","\u2518","\u250C","\u2588","\u2584","\u258C","\u2590","\u2580","\u0440","\u0441","\u0442","\u0443","\u0444","\u0445","\u0446","\u0447","\u0448","\u0449","\u044A","\u044B","\u044C","\u044D","\u044E","\u044F","\u0401","\u0451","\u0404","\u0454","\u0407","\u0457","\u040E","\u045E","\xB0","\u2219","\xB7","\u221A","\u2116","\xA4","\u25A0","\xA0"],Ie=["\u20AC","\x81","\u201A","\u0192","\u201E","\u2026","\u2020","\u2021","\u02C6","\u2030","\u0160","\u2039","\u0152","\x8D","\u017D","\x8F","\x90","\u2018","\u2019","\u201C","\u201D","\u2022","\u2013","\u2014","\u02DC","\u2122","\u0161","\u203A","\u0153","\x9D","\u017E","\u0178","\xA0","\xA1","\xA2","\xA3","\xA4","\xA5","\xA6","\xA7","\xA8","\xA9","\xAA","\xAB","\xAC","\xAD","\xAE","\xAF","\xB0","\xB1","\xB2","\xB3","\xB4","\xB5","\xB6","\xB7","\xB8","\xB9","\xBA","\xBB","\xBC","\xBD","\xBE","\xBF","\xC0","\xC1","\xC2","\xC3","\xC4","\xC5","\xC6","\xC7","\xC8","\xC9","\xCA","\xCB","\xCC","\xCD","\xCE","\xCF","\xD0","\xD1","\xD2","\xD3","\xD4","\xD5","\xD6","\xD7","\xD8","\xD9","\xDA","\xDB","\xDC","\xDD","\xDE","\xDF","\xE0","\xE1","\xE2","\xE3","\xE4","\xE5","\xE6","\xE7","\xE8","\xE9","\xEA","\xEB","\xEC","\xED","\xEE","\xEF","\xF0","\xF1","\xF2","\xF3","\xF4","\xF5","\xF6","\xF7","\xF8","\xF9","\xFA","\xFB","\xFC","\xFD","\xFE","\xFF"],De={cp437:Ee,cp850:We,cp866:Me,cp1252:Ie},Dt={cp437:F,cp850:void 0,cp866:void 0,cp1252:void 0};var C=z$1.enum(["cp437","cp850","cp866","cp1252"]),Bt=z$1.enum(["replace","skip","error"]),Oo=z$1.object({codepage:C,unmappable:Bt.default("replace"),replacement:z$1.string().default("\uFFFD"),interpretControlChars:z$1.boolean().default(false)}).strict(),Pt=128,_t=32,No=128,Ft=255;function Ho(e,t){let n=new Map;for(let r=0;r<e.length;r++){let o=e[r];o&&n.set(o,Pt+r);}if(t)for(let r=0;r<t.length;r++){let o=t[r];o&&o!=="\0"&&n.set(o,r);}for(let r=0;r<_t;r++)n.set(String.fromCharCode(r),r);for(let r=32;r<=126;r++)n.set(String.fromCharCode(r),r);return n.set("\x7F",127),n}var vt=new Map;function Ot(e){let t=vt.get(e);if(t)return t;let n=De[e],r=Dt[e];if(!n)throw new Error(`Unknown codepage: ${e}`);let o=Ho(n,r);return vt.set(e,o),o}function ve(e,t,n){let r=C.parse(t);if(e<0||e>Ft)throw new RangeError(`Byte value must be 0-255, got: ${e}`);let o=e|0;if(o<_t){if(n?.interpretControlChars&&r==="cp437"){let s=F[o];if(s)return s}return String.fromCharCode(o)}if(o<No)return String.fromCharCode(o);let i=De[r];if(!i)throw new Error(`Unknown codepage: ${r}`);let a=o-Pt,l=i[a];return l||(n?.replacement??"\uFFFD")}function Go(e,t){let n=C.parse(t),r=Ot(n),i=[...e][0];if(i)return r.get(i)}function zo(e,t,n){let r=C.parse(t),o={replacement:"\uFFFD",interpretControlChars:false,...n},i=[];for(let a=0;a<e.length;a++){let l=e[a];if(l===void 0)continue;let s=ve(l,r,o);i.push(s);}return i.join("")}function Uo(e,t,n){let r=C.parse(t),o={unmappable:"replace",replacement:"?",...n},i=Ot(r),a=[],l=[...e];for(let s=0;s<l.length;s++){let u=l[s];if(!u)continue;let d=i.get(u);if(d!==void 0){a.push(d);continue}switch(o.unmappable){case "error":throw new Error(`Character '${u}' (U+${u.codePointAt(0)?.toString(16).toUpperCase().padStart(4,"0")}) cannot be encoded in ${r}`);case "skip":break;default:{let f=o.replacement??"?",c=i.get(f);c!==void 0?a.push(c):a.push(63);break}}}return Buffer.from(a)}function Vo(e){return C.safeParse(e).success}function jo(){return ["cp437","cp850","cp866","cp1252"]}function $o(e,t){let n=C.parse(e),r=[];for(let o=0;o<=Ft;o++)r.push(ve(o,n,t));return r}var Ht=55296,Gt=56319,zt=56320,Ut=57343;function Be(e){return e>=55296&&e<=56319}function Pe(e){return e>=56320&&e<=57343}function N(e){return e>=55296&&e<=57343}function Vt(e,t){if(t<0||t>=e.length)return false;let n=e.charCodeAt(t);return N(n)}function jt(e,t){if(!Be(e))throw new Error(`Invalid high surrogate: 0x${e.toString(16)}`);if(!Pe(t))throw new Error(`Invalid low surrogate: 0x${t.toString(16)}`);return (e-55296)*1024+(t-56320)+65536}function $t(e){if(e<=65535)throw new Error(`Code point 0x${e.toString(16)} doesn't need surrogate encoding`);if(e>1114111)throw new Error(`Invalid code point: 0x${e.toString(16)} (exceeds U+10FFFF)`);let t=e-65536,n=(t>>10)+55296,r=(t&1023)+56320;return [n,r]}function Zt(e,t){if(t<0||t>=e.length)return -1;let n=e.codePointAt(t);return n===void 0?-1:n}function Kt(...e){return String.fromCodePoint(...e)}function*_e(e){for(let t of e){let n=t.codePointAt(0);n!==void 0&&(yield n);}}function qt(e){return [..._e(e)]}function*Xt(e){for(let t of e)yield t;}function Jt(e){let t=0;for(let n of e)t++;return t}function Yt(e){return !(e<0||e>1114111||e>=55296&&e<=57343)}function Qt(e){return e>=0&&e<=65535}function ee(e){return e>=65536&&e<=1114111}function en(e,t){if(t<0)return "";let n=0;for(let r of e){if(n===t)return r;n++;}return ""}function tn(e,t,n){let r=t<0?0:t,o="",i=0;for(let a of e){if(n!==void 0&&i>=n)break;i>=r&&(o+=a),i++;}return o}var te=[[768,879],[6832,6911],[7616,7679],[8400,8447],[65056,65071],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1552,1562],[1611,1631],[1648,1648],[1750,1756],[1759,1764],[1767,1768],[1770,1773],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2260,2273],[2275,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2901,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6159,6159],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[65024,65039],[917760,917999]],ne=new Set((function*(){for(let[e,t]of te)for(let n=e;n<=t;n++)yield n;})());function Zo(e,t){let n=0,r=t.length-1;for(;n<=r;){let o=Math.floor((n+r)/2),i=t[o];if(!i)break;let[a,l]=i;if(e<a)r=o-1;else if(e>l)n=o+1;else return true}return false}function H(e){return e<768?false:ne.has(e)}function nn(e){return e<768?false:Zo(e,te)}function rn(){return ne.size}var Fe=[[11904,12031],[12032,12255],[12272,12287],[12288,12351],[12352,12447],[12448,12543],[12544,12591],[12592,12687],[12688,12703],[12704,12735],[12736,12783],[12784,12799],[12800,13055],[13056,13311],[13312,19903],[19968,40959],[40960,42127],[42128,42191],[44032,55203],[63744,64255],[65040,65055],[65072,65103],[65104,65135],[65280,65376],[65504,65510],[131072,173791],[173824,177983],[177984,178207],[178208,183983],[183984,191471],[194560,195103],[196608,201551],[201552,205743]],on=[[65281,65374],[65504,65510]],Oe=[[0,31],[127,159],[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1552,1562],[1611,1631],[1648,1648],[1750,1756],[1759,1764],[1767,1768],[1770,1773],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2260,2273],[2275,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[6832,6845],[6846,6846],[6847,6848],[7616,7679],[8203,8207],[8288,8292],[8294,8303],[8400,8447],[65024,65039],[65056,65071],[65279,65279],[917760,917999]],Ne=[[161,161],[164,164],[167,168],[170,170],[173,174],[176,180],[182,186],[188,191],[198,198],[208,208],[215,216],[222,225],[230,230],[232,234],[236,237],[240,240],[242,243],[247,250],[252,252],[254,254],[913,929],[931,937],[945,961],[963,969],[1025,1025],[1040,1103],[1105,1105],[9472,9599],[9600,9631],[9632,9727],[9728,9983],[9984,10175]],He=[[127744,128511],[128512,128591],[128640,128767],[129280,129535],[129536,129647],[129648,129791]];function re(e,t){let n=0,r=t.length-1;for(;n<=r;){let o=Math.floor((n+r)/2),i=t[o];if(!i)break;let[a,l]=i;if(e<a)r=o-1;else if(e>l)n=o+1;else return true}return false}function I(e){return e<4352?false:!!(re(e,Fe)||re(e,He))}function S(e){return re(e,Oe)}function Ge(e){return re(e,Ne)}function p(e,t=false){return S(e)?0:I(e)||t&&Ge(e)?2:1}var an=typeof Intl<"u"&&"Segmenter"in Intl,ze=null;function ln(){return an?(ze||(ze=new Intl.Segmenter(void 0,{granularity:"grapheme"})),ze):null}function*R(e){if(e.length===0)return;let t=ln();if(t)for(let n of t.segment(e))yield n.segment;else for(let n of e)yield n;}function Ue(e){return [...R(e)]}function sn(e){if(e.length===0)return 0;let t=ln();if(t){let r=0;for(let o of t.segment(e))r++;return r}let n=0;for(let r of e)n++;return n}function un(e,t){if(t<0)return;let n=0;for(let r of R(e)){if(n===t)return r;n++;}}function dn(e,t,n){let r=t<0?0:t,o="",i=0;for(let a of R(e)){if(n!==void 0&&i>=n)break;i>=r&&(o+=a),i++;}return o}function ae(e){if(e.length===0)return 0;let t=e.codePointAt(0);return t===void 0?0:Ko(e)?2:p(t)}function Ko(e){if(e.length===0)return false;let t=e.codePointAt(0);return t===void 0?false:!!(t>=127462&&t<=127487||t>=127744&&t<=129535||t>=129536&&t<=129791||t>=9728&&t<=9983||t>=9984&&t<=10175||e.includes("\uFE0F")||e.includes("\u200D"))}function oe(e){let t=0;for(let n of R(e))t+=ae(n);return t}function ie(e,t){let n=0,r="";for(let o of R(e)){let i=ae(o);if(n+i>t)return {text:r,width:n,truncated:true};n+=i,r+=o;}return {text:r,width:n,truncated:false}}function fn(e,t,n="\u2026"){if(oe(e)<=t)return e;let o=oe(n);if(o>=t)return ie(n,t).text;let i=t-o;return ie(e,i).text+n}function cn(){return an}function mn(e){return Ue(e).reverse().join("")}var qo={replacement:"?",dropWide:true,dropCombining:true,dropAstral:true,dropZeroWidth:true,dropControl:false};function hn(e){return e>=0&&e<=31?e!==9&&e!==10&&e!==13:e===127||e>=128&&e<=159}function Xo(e){return e===9||e===10||e===13}function Jo(e,t,n){return n&&S(t)?Xo(t)?e:"":null}function Yo(e,t,n,r,o){return ee(t)?n||r&&I(t)?o:e:null}function Qo(e,t,n){if(N(t))return n.replacement;if(H(t))return n.dropCombining?"":e;if(hn(t))return n.dropControl?"":e;let r=Jo(e,t,n.dropZeroWidth);if(r!==null)return r;let o=Yo(e,t,n.dropAstral,n.dropWide,n.replacement);return o!==null?o:n.dropWide&&I(t)?n.replacement:e}function gn(e,t){let n={...qo,...t},r="";for(let o of e){let i=o.codePointAt(0);if(i===void 0){r+=n.replacement;continue}r+=Qo(o,i,n);}return r}function pn(e,t="?"){let n="";for(let r of e){let o=r.codePointAt(0);if(o===void 0){n+=t;continue}o>=32&&o<=126||o===9||o===10||o===13?n+=r:n+=t;}return n}function bn(e){let t="";for(let n of e){let r=n.codePointAt(0);r!==void 0&&!S(r)&&(t+=n);}return t}function xn(e){let t="";for(let n of e){let r=n.codePointAt(0);r!==void 0&&!H(r)&&(t+=n);}return t}function yn(e){let t="";for(let n of e){let r=n.codePointAt(0);r!==void 0&&!hn(r)&&(t+=n);}return t}function Cn(e){return e.normalize("NFC")}function Sn(e){return e.normalize("NFD")}function Ln(e){return e.normalize("NFKC")}function kn(e){return e.normalize("NFKD")}function Tn(e,t=false){return p(e,t)}function G(e,t=false){if(e.length===0)return 0;let n=e.codePointAt(0);return n===void 0?0:p(n,t)}function Rn(e,t,n=false){if(t<0)return -1;let r=0;for(let o of e){if(r===t){let i=o.codePointAt(0);return i===void 0?0:p(i,n)}r++;}return -1}var se=8,ue=9;function b(e,t){let n=t?.tabWidth??se,r=t?.ambiguousAsWide??false,o=0;for(let i of e){let a=i.codePointAt(0);if(a!==void 0){if(a===ue){let l=o%n;o+=n-l;continue}o+=p(a,r);}}return o}function An(e,t){return b(e,t)}function Ve(e,t,n){let r=n?.ambiguousAsWide??false,o=n?.tabWidth??se,i=0,a="";for(let l of e){let s=l.codePointAt(0);if(s===void 0)continue;let u;if(s===ue){let d=i%o;u=o-d;}else u=p(s,r);if(i+u>t)return {text:a,width:i,truncated:true};i+=u,a+=l;}return {text:a,width:i,truncated:false}}function le(e,t,n){return Ve(e,t,n).text}function wn(e,t,n="\u2026",r){if(b(e,r)<=t)return e;let i=b(n,r);if(i>=t)return le(n,t,r);let a=t-i;return le(e,a,r)+n}function En(e,t,n=" ",r){let o=b(e,r);if(o>=t)return e;let i=G(n,r?.ambiguousAsWide);if(i===0)return e;let a=t-o,l=Math.floor(a/i);return e+n.repeat(l)}function Wn(e,t,n=" ",r){let o=b(e,r);if(o>=t)return e;let i=G(n,r?.ambiguousAsWide);if(i===0)return e;let a=t-o,l=Math.floor(a/i);return n.repeat(l)+e}function Mn(e,t,n=" ",r){let o=b(e,r);if(o>=t)return e;let i=G(n,r?.ambiguousAsWide);if(i===0)return e;let a=t-o,l=Math.floor(a/2),s=a-l,u=Math.floor(l/i),d=Math.floor(s/i);return n.repeat(u)+e+n.repeat(d)}function In(e,t,n){let r=n?.ambiguousAsWide??false,o=n?.tabWidth??se;if(t<0)return -1;let i=0,a=0;for(let l of e){let s=l.codePointAt(0);if(s===void 0){a++;continue}let u;if(s===ue){let d=i%o;u=o-d;}else u=p(s,r);if(t>=i&&t<i+u||u===0&&t===i)return a;i+=u,a++;}return -1}function Dn(e,t,n){let r=n?.ambiguousAsWide??false,o=n?.tabWidth??se;if(t<0)return -1;let i=0,a=0;for(let l of e){if(a===t)return i;let s=l.codePointAt(0);if(s===void 0){a++;continue}let u;if(s===ue){let d=i%o;u=o-d;}else u=p(s,r);i+=u,a++;}return -1}function vn(e){for(let t of e){let n=t.codePointAt(0);if(n!==void 0&&p(n)===2)return true}return false}function Bn(e){for(let t of e){let n=t.codePointAt(0);if(n!==void 0&&S(n))return true}return false}var Pn=z$1.object({codePoint:z$1.number().int().nonnegative(),width:z$1.number().int().min(0).max(2)}),_n=z$1.object({terminal:z$1.string().min(1),overrides:z$1.array(Pn)});function ei(){return [{label:"Family emoji (ZWJ sequence)",input:"\u{1F468}\u200D\u{1F469}\u200D\u{1F467}\u200D\u{1F466}",expectedWidth:2,category:"emoji-zwj",notes:"Most terminals render as single 2-wide glyph, some render 8-wide"},{label:"Couple with heart (ZWJ)",input:"\u{1F469}\u200D\u2764\uFE0F\u200D\u{1F468}",expectedWidth:2,category:"emoji-zwj",notes:"ZWJ joins three characters into one grapheme"},{label:"Person with white hair (ZWJ)",input:"\u{1F9D1}\u200D\u{1F9B3}",expectedWidth:2,category:"emoji-zwj"},{label:"Pirate flag (ZWJ)",input:"\u{1F3F4}\u200D\u2620\uFE0F",expectedWidth:2,category:"emoji-zwj"},{label:"ZWJ character alone",input:"\u200D",expectedWidth:0,category:"emoji-zwj"},{label:"US flag (regional indicators)",input:"\u{1F1FA}\u{1F1F8}",expectedWidth:2,category:"regional-indicators",notes:"Two regional indicators form a flag"},{label:"Japan flag",input:"\u{1F1EF}\u{1F1F5}",expectedWidth:2,category:"regional-indicators"},{label:"Single regional indicator",input:"\u{1F1FA}",expectedWidth:2,category:"regional-indicators",notes:"Unpaired regional indicators vary by terminal"},{label:"Text presentation (VS15)",input:"\u2764\uFE0E",expectedWidth:1,category:"variation-selectors",notes:"VS15 forces text presentation (narrow)"},{label:"Emoji presentation (VS16)",input:"\u2764\uFE0F",expectedWidth:2,category:"variation-selectors",notes:"VS16 forces emoji presentation (wide)"},{label:"Number sign with VS16",input:"#\uFE0F\u20E3",expectedWidth:2,category:"variation-selectors",notes:"Keycap sequence"},{label:"Variation selector alone",input:"\uFE0F",expectedWidth:0,category:"variation-selectors"},{label:"CJK ideograph (U+4E2D)",input:"\u4E2D",expectedWidth:2,category:"cjk"},{label:'CJK string "\u4E2D\u6587\u6D4B\u8BD5"',input:"\u4E2D\u6587\u6D4B\u8BD5",expectedWidth:8,category:"cjk"},{label:"Hangul syllable (\uAC00)",input:"\uAC00",expectedWidth:2,category:"cjk"},{label:"Katakana (\u30AB\u30BF\u30AB\u30CA)",input:"\u30AB\u30BF\u30AB\u30CA",expectedWidth:8,category:"cjk"},{label:"CJK compatibility ideograph",input:"\uF900",expectedWidth:2,category:"cjk"},{label:"Latin a + combining acute",input:"a\u0301",expectedWidth:1,category:"combining"},{label:"Multiple combining marks (Zalgo-style)",input:"a\u0300\u0301\u0302\u0303",expectedWidth:1,category:"combining",notes:"All combining marks are zero-width"},{label:"Devanagari with combining",input:"\u0915\u094D\u0937",expectedWidth:2,category:"combining",notes:"Consonant cluster"},{label:"Korean jamo with combining",input:"\u1100\u1161",expectedWidth:2,category:"combining",notes:"Lead + vowel jamo"},{label:"Single tab",input:" ",expectedWidth:8,category:"tabs",notes:"Default tab width is 8"},{label:"Tab after 3 chars",input:"abc ",expectedWidth:8,category:"tabs",notes:"Tab extends to next 8-column boundary"},{label:"Null character",input:"\0",expectedWidth:0,category:"control"},{label:"Bell character",input:"\x07",expectedWidth:0,category:"control"},{label:"Backspace",input:"\b",expectedWidth:0,category:"control"},{label:"Soft hyphen",input:"\xAD",expectedWidth:1,category:"control",notes:"Soft hyphen is technically a format character but width=1 in most terminals"},{label:"Fullwidth A",input:"\uFF21",expectedWidth:2,category:"fullwidth"},{label:"Fullwidth digits",input:"\uFF10\uFF11\uFF12",expectedWidth:6,category:"fullwidth"},{label:"Fullwidth exclamation mark",input:"\uFF01",expectedWidth:2,category:"fullwidth"},{label:"Halfwidth katakana",input:"\uFF66",expectedWidth:1,category:"halfwidth"},{label:"Halfwidth Hangul",input:"\uFFA0",expectedWidth:1,category:"halfwidth"},{label:"Greek alpha",input:"\u03B1",expectedWidth:1,category:"ambiguous",notes:"Ambiguous width - 1 in Western locale, 2 in CJK locale"},{label:"Box drawing (light horizontal)",input:"\u2500",expectedWidth:1,category:"ambiguous"},{label:"Bullet (\u2022)",input:"\u2022",expectedWidth:1,category:"ambiguous"},{label:"Musical symbol (U+1D11E)",input:"\u{1D11E}",expectedWidth:1,category:"surrogate-pairs"},{label:"Emoji face (U+1F600)",input:"\u{1F600}",expectedWidth:2,category:"surrogate-pairs"},{label:"Skin tone modifier (U+1F3FD)",input:"\u{1F44B}\u{1F3FD}",expectedWidth:2,category:"surrogate-pairs",notes:"Waving hand + medium skin tone"},{label:"ASCII + CJK mixed",input:"Hello\u4E16\u754C",expectedWidth:9,category:"mixed"},{label:"Emoji + text mixed",input:"\u{1F389} Party!",expectedWidth:9,category:"mixed"},{label:"Empty string",input:"",expectedWidth:0,category:"mixed"},{label:"Newline only",input:`
|
|
9
|
-
`,expectedWidth:0,category:"mixed"}]}function ti(){return [{label:"Family ZWJ emoji",input:"\u{1F468}\u200D\u{1F469}\u200D\u{1F467}\u200D\u{1F466}",expectedWidth:2,terminalWidths:{"xterm-256color":8,kitty:2,alacritty:2,wezterm:2,"gnome-terminal":2,iterm2:2,"windows-terminal":2},severity:"major"},{label:"Flag sequence (regional indicators)",input:"\u{1F1FA}\u{1F1F8}",expectedWidth:2,terminalWidths:{"xterm-256color":4,kitty:2,alacritty:2,wezterm:2,iterm2:2},severity:"major"},{label:"Unpaired regional indicator",input:"\u{1F1FA}",expectedWidth:2,terminalWidths:{"xterm-256color":2,kitty:1,alacritty:2},severity:"minor"},{label:"Skin tone emoji",input:"\u{1F44B}\u{1F3FD}",expectedWidth:2,terminalWidths:{"xterm-256color":4,kitty:2,alacritty:2,iterm2:2},severity:"major"},{label:"VS16 heart emoji",input:"\u2764\uFE0F",expectedWidth:2,terminalWidths:{"xterm-256color":1,kitty:2,alacritty:2,iterm2:2},severity:"minor"},{label:"Keycap sequence #\uFE0F\u20E3",input:"#\uFE0F\u20E3",expectedWidth:2,terminalWidths:{"xterm-256color":2,kitty:2,alacritty:1},severity:"minor"},{label:"Devanagari conjunct",input:"\u0915\u094D\u0937",expectedWidth:2,terminalWidths:{"xterm-256color":1,kitty:2,alacritty:1},severity:"minor"},{label:"Zalgo text (heavy combining)",input:"a\u0300\u0301\u0302\u0303\u0304\u0305\u0306\u0307",expectedWidth:1,terminalWidths:{"xterm-256color":1,kitty:1,alacritty:1},severity:"critical"}]}var v=new Map;function ni(e){let t=_n.parse(e);for(let n of t.overrides)v.set(n.codePoint,n.width);}function ri(){v.clear();}function oi(){return v.size}function ii(e){return v.get(e)??null}function ai(e,t){if(v.size===0)return b(e,t);let n=t?.tabWidth??8,r=0,o=0;for(let i=0;i<e.length;i++){let a=e.codePointAt(i);if(a===void 0)continue;if(a===10){o=0;continue}if(a===9){let s=n-o%n;r+=s,o+=s;continue}let l=v.get(a);if(l!==void 0)r+=l,o+=l;else {let s=p(a);r+=s,o+=s;}a>65535&&i++;}return r}function li(e,t){let n=[],r=0;for(let o of e){let i=b(o.input,t);i===o.expectedWidth?r++:n.push({testCase:o,actualWidth:i});}return {total:e.length,passed:r,failed:n.length,failures:n}}function si(e,t){return e.filter(n=>n.category===t)}function ui(e){let t=new Set;for(let n of e)t.add(n.category);return [...t]}function di(e){let t=[];if(t.push(`Width Test Results: ${e.passed}/${e.total} passed`),t.push(""),e.failures.length===0)return t.push("All tests passed!"),t.join(`
|
|
10
|
-
`);t.push(`Failures (${e.failed}):`);for(let n of e.failures)t.push(` [${n.testCase.category}] ${n.testCase.label}`),t.push(` Expected: ${n.testCase.expectedWidth}, Got: ${n.actualWidth}`),t.push(` Input: ${JSON.stringify(n.testCase.input)}`),n.testCase.notes&&t.push(` Note: ${n.testCase.notes}`);return t.join(`
|
|
11
|
-
`)}var fi=1e3,Fn=100;function de(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t^e.charCodeAt(n);return t>>>0}function ci(e){return {width:e,entries:new Map,dirty:new Set,totalLines:0,lineOffsets:[],fullInvalidate:true}}function mi(e){e.entries.clear(),e.dirty.clear(),e.totalLines=0,e.lineOffsets.length=0,e.fullInvalidate=true;}function hi(e,t){if(e.width!==t){e.width=t,e.fullInvalidate=true;for(let[n]of e.entries)e.dirty.add(n);}}function gi(e,t,n,r){if(t<=0)return {lines:[""],breakPoints:[0]};if(e.length===0)return {lines:[""],breakPoints:[0]};let o=pi();for(let i=0;i<=e.length;i++)Li(o,e,i,t,n,r);return {lines:o.lines,breakPoints:o.breakPoints}}function pi(){return {lines:[],breakPoints:[0],lineStart:0,lineWidth:0,wordWidth:0,lastBreakable:-1,lastBreakableWidth:0}}function bi(e,t,n,r){let o=t.slice(e.lineStart,n);(o.length>0||e.lines.length===0)&&(e.lines.push(o),r||e.breakPoints.push(n+1)),xi(e,n+1);}function xi(e,t){e.lineStart=t,e.lineWidth=0,e.wordWidth=0,e.lastBreakable=-1,e.lastBreakableWidth=0;}function yi(e,t,n){e.lastBreakable=t,e.lastBreakableWidth=e.lineWidth,e.wordWidth=0,e.lineWidth+=n;}function Ci(e,t){e.wordWidth+=t,e.lineWidth+=t;}function Si(e,t,n,r,o,i){if(e.lastBreakable>=e.lineStart&&!i){let a=t.slice(e.lineStart,e.lastBreakable);e.lines.push(a),e.breakPoints.push(e.lastBreakable+1),e.lineStart=e.lastBreakable+1,e.lineWidth=e.lineWidth-e.lastBreakableWidth-1,e.lastBreakable=-1;return}if(i||e.wordWidth>o){let a=t.slice(e.lineStart,n);e.lines.push(a),e.breakPoints.push(n),e.lineStart=n,e.lineWidth=r,e.wordWidth=r,e.lastBreakable=-1;}}function Li(e,t,n,r,o,i){let a=n<t.length?t[n]:void 0,l=n===t.length;if(a===`
|
|
12
|
-
`||l){bi(e,t,n,l);return}let u=i?b(a??""):1;a===" "||a===" "?yi(e,n,u):Ci(e,u),e.lineWidth>r&&Si(e,t,n,u,r,o);}function je(e,t,n,r){let{lines:o,breakPoints:i}=gi(e,t,n,r);return {text:e,hash:de(e),width:t,lines:o,breakPoints:i}}function ki(e,t,n){let r=n?.width??e.width,o=n?.breakWord??false,i=n?.unicodeWidth??true,a=t.split(`
|
|
13
|
-
`),l=[];e.lineOffsets.length=0;let s=0;for(let u=0;u<a.length;u++){let d=a[u];if(d===void 0)continue;e.lineOffsets.push(s);let f=e.entries.get(u),c=de(d);if(f&&f.hash===c&&f.width===r&&!e.dirty.has(u)&&!e.fullInvalidate){l.push(...f.lines),s+=f.lines.length;continue}let m=je(d,r,o,i);e.entries.set(u,m),e.dirty.delete(u),l.push(...m.lines),s+=m.lines.length;}e.totalLines=s,e.fullInvalidate=false;for(let[u]of e.entries)u>=a.length&&e.entries.delete(u);return l}function Ti(e,t,n,r,o){let i=performance.now(),a=o?.width??e.width,l=o?.breakWord??false,s=o?.unicodeWidth??true,u=t.split(`
|
|
14
|
-
`),d=[],f=Ri(e,n),c=f.currentLine,m=f.targetParagraph,h=0,g=u.length;for(let x=m;x<g&&c<r;x++){let xt=u[x];if(xt===void 0)continue;let xr=Ai(e,x,xt,a,l,s);c=wi(d,xr.lines,c,n,r),h=x+1;}let W=performance.now()-i;return {lines:d,hasMore:h<g,nextParagraph:h,timeMs:W}}function Ri(e,t){let n=0,r=0;if(e.lineOffsets.length===0||e.fullInvalidate)return {targetParagraph:n,currentLine:r};for(let o=0;o<e.lineOffsets.length;o++){let i=e.lineOffsets[o];if(i!==void 0&&i<=t)n=o,r=i;else break}return {targetParagraph:n,currentLine:r}}function Ai(e,t,n,r,o,i){let a=e.entries.get(t),l=de(n);if(a&&a.hash===l&&a.width===r&&!e.dirty.has(t)&&!e.fullInvalidate)return a;let s=je(n,r,o,i);return e.entries.set(t,s),e.dirty.delete(t),s}function wi(e,t,n,r,o){let i=n;for(let a=0;a<t.length;a++){if(i>=r&&i<o){let l=t[a];l!==void 0&&e.push(l);}i++;}return i}function Ei(e,t,n,r=Fn,o){let i=performance.now(),a=o?.width??e.width,l=o?.breakWord??false,s=o?.unicodeWidth??true,u=t.split(`
|
|
15
|
-
`),d=[],f=Math.min(n+r,u.length);for(let m=n;m<f;m++){let h=u[m];if(h===void 0)continue;let g=e.entries.get(m),W=de(h),x;g&&g.hash===W&&g.width===a&&!e.dirty.has(m)&&!e.fullInvalidate?x=g:(x=je(h,a,l,s),e.entries.set(m,x),e.dirty.delete(m)),d.push(...x.lines);}let c=performance.now()-i;return {lines:d,hasMore:f<u.length,nextParagraph:f,timeMs:c}}function Wi(e,t,n){for(let r=t;r<n;r++)e.dirty.add(r);}function Mi(e,t){e.dirty.add(t);}function Ii(e){e.fullInvalidate=true;}function Di(e,t){if(t<0||t>=e.totalLines)return;let n=0,r=e.lineOffsets.length-1,o=0;for(;n<=r;){let u=Math.floor((n+r)/2),d=e.lineOffsets[u];if(d===void 0)break;d<=t?(o=u,n=u+1):r=u-1;}let i=e.lineOffsets[o]??0,a=t-i,s=e.entries.get(o)?.breakPoints[a]??0;return {paragraph:o,lineInParagraph:a,charOffset:s}}function vi(e,t,n=0){if(t<0||t>=e.lineOffsets.length)return -1;let r=e.lineOffsets[t];return r===void 0?-1:r+n}function Bi(e){return {cachedParagraphs:e.entries.size,dirtyParagraphs:e.dirty.size,totalLines:e.totalLines,width:e.width,fullInvalidate:e.fullInvalidate}}var Pi={minFoldableLines:2,labelTemplate:"... {count} lines",maxDepth:10};function _i(e,t){return {config:{...Pi,...t},regions:new Map,totalDocumentLines:e,nextId:0}}function Fi(e,t,n,r){let o=n-t;if(o<e.config.minFoldableLines||t<0||n>=e.totalDocumentLines||t>=n)return;let i=`fold-${e.nextId++}`,a=Yi(e,t,n);if(a>=e.config.maxDepth)return;let l=r??e.config.labelTemplate.replace("{count}",String(o)),s={id:i,startLine:t,endLine:n,folded:false,label:l,depth:a};return e.regions.set(i,s),i}function Oi(e,t){return e.regions.delete(t)}function Ni(e,t){let n=e.regions.get(t);return !n||n.folded?false:(e.regions.set(t,{...n,folded:true}),true)}function Hi(e,t){let n=e.regions.get(t);return !n||!n.folded?false:(e.regions.set(t,{...n,folded:false}),true)}function Gi(e,t){let n=e.regions.get(t);if(!n)return;let r=!n.folded;return e.regions.set(t,{...n,folded:r}),r}function zi(e){let t=0;for(let[n,r]of e.regions)r.folded||(e.regions.set(n,{...r,folded:true}),t++);return t}function Ui(e){let t=0;for(let[n,r]of e.regions)r.folded&&(e.regions.set(n,{...r,folded:false}),t++);return t}function Vi(e,t){let n=0;for(let[r,o]of e.regions)o.depth>=t&&!o.folded&&(e.regions.set(r,{...o,folded:true}),n++);return n}function ji(e,t){let n;for(let r of e.regions.values())t>=r.startLine&&t<=r.endLine&&(!n||r.depth>n.depth)&&(n=r);return n}function $i(e){return Array.from(e.regions.values()).sort((t,n)=>t.startLine-n.startLine)}function Zi(e,t,n){let r=ce(e),o=[],i=0,a=0;for(;i<t&&a<e.totalDocumentLines;){let l=fe(r,a);l?(i++,a=l.endLine+1):(i++,a++);}for(;o.length<n&&a<e.totalDocumentLines;){let l=fe(r,a);l?(o.push({originalLine:l.startLine,isFoldPlaceholder:true,foldId:l.id,foldLabel:l.label,hiddenLines:l.endLine-l.startLine}),a=l.endLine+1):(o.push({originalLine:a,isFoldPlaceholder:false,foldId:void 0,foldLabel:void 0,hiddenLines:0}),a++);}return o}function Ki(e,t){let n=ce(e),r=0,o=0;for(;r<t&&o<e.totalDocumentLines;){let i=fe(n,o);i?(r++,o=i.endLine+1):(r++,o++);}return o}function qi(e,t){let n=ce(e),r=0,o=0;for(;o<t&&o<e.totalDocumentLines;){let i=fe(n,o);if(i){if(r++,t>i.startLine&&t<=i.endLine)return -1;o=i.endLine+1;}else r++,o++;}return r}function Xi(e){let t=0,n=0,r=0,o=ce(e);for(let i of o)t++,n+=i.endLine-i.startLine;for(let i of e.regions.values())i.depth>r&&(r=i.depth),i.folded&&(t=Math.max(t,t));return {totalRegions:e.regions.size,foldedRegions:t,hiddenLines:n,visibleLines:e.totalDocumentLines-n,maxDepth:r}}function Ji(e,t){e.totalDocumentLines=t;for(let[n,r]of e.regions)(r.startLine>=t||r.endLine>=t)&&e.regions.delete(n);}function Yi(e,t,n){let r=0;for(let o of e.regions.values())o.startLine<=t&&o.endLine>=n&&(r=Math.max(r,o.depth+1));return r}function ce(e){let t=[];for(let r of e.regions.values())r.folded&&t.push({id:r.id,startLine:r.startLine,endLine:r.endLine,label:r.label});t.sort((r,o)=>r.startLine-o.startLine);let n=[];for(let r of t){let o=n[n.length-1];if(o&&r.startLine<=o.endLine){r.endLine>o.endLine&&(n[n.length-1]={...o,endLine:r.endLine});continue}n.push(r);}return n}function fe(e,t){let n=0,r=e.length-1;for(;n<=r;){let o=n+r>>>1,i=e[o];if(!i)break;if(t<i.startLine)r=o-1;else if(t>i.endLine)n=o+1;else return i}}function Nn(e,t){let n={...e};for(let r in t)if(Object.hasOwn(t,r)){let o=t[r],i=n[r];o!==null&&typeof o=="object"&&!Array.isArray(o)&&i!==null&&typeof i=="object"&&!Array.isArray(i)?n[r]=Nn(i,o):n[r]=o;}return n}function Qi(e,t){return {...e,...t}}function ea(e){return [...e].sort((t,n)=>{let r=t.name.startsWith("."),o=n.name.startsWith(".");return r&&!o?1:!r&&o?-1:t.name.toLowerCase().localeCompare(n.name.toLowerCase())})}function ta(e){return [...e].sort((t,n)=>t.index-n.index)}function na(e){return [...e].sort((t,n)=>n.priority-t.priority)}function ra(e,t,n=false){return [...e].sort((r,o)=>{let i=t(r),a=t(o),l;return typeof i=="string"&&typeof a=="string"?l=i.localeCompare(a):l=i-a,n?-l:l})}var Hn=new Set(["node_modules",".git",".svn",".hg","dist","build","coverage",".cache",".next","__pycache__"]);function oa(e,t,n){let r=n?.maxDepth??10,o=new Set([...Hn,...n?.excludeDirs??[]]);function i(a,l){if(l>r)return null;let s=Gn(a);if(!s)return null;let u=aa(s,a,t);return u||la(s,a,l,r,o,i)}return i(L.resolve(e),0)}function ia(e,t,n){let r=n?.maxDepth??10,o=new Set([...Hn,...n?.excludeDirs??[]]),i=n?.maxResults??Number.POSITIVE_INFINITY,a=[];function l(s,u){if(u>r||a.length>=i)return;let d=Gn(s);d&&(sa(d,s,t,a,i),ua(d,s,u,r,o,a,i,l));}return l(L.resolve(e),0),a}function Gn(e){try{return On.readdirSync(e,{withFileTypes:!0})}catch{return null}}function aa(e,t,n){for(let r of e)if(r.name===n&&r.isFile())return L.join(t,r.name);return null}function la(e,t,n,r,o,i){for(let a of e){if(!a.isDirectory()||o.has(a.name))continue;let l=i(L.join(t,a.name),n+1);if(l)return l}return null}function sa(e,t,n,r,o){for(let i of e){if(r.length>=o)return;i.name===n&&i.isFile()&&r.push(L.join(t,i.name));}}function ua(e,t,n,r,o,i,a,l){for(let s of e){if(i.length>=a)return;!s.isDirectory()||o.has(s.name)||l(L.join(t,s.name),n+1);}}function da(e){return [...new Set(e)]}function fa(e,t){let n=new Set,r=[];for(let o of e){let i=t(o);n.has(i)||(n.add(i),r.push(o));}return r}function ca(e,t){let n=new Map;for(let r of e){let o=t(r),i=n.get(o);i?i.push(r):n.set(o,[r]);}return n}function ma(e,t){let n=[],r=[];for(let o of e)t(o)?n.push(o):r.push(o);return [n,r]}var ha={chunkSize:1e3,maxCachedChunks:50,readAheadLines:500,readBehindLines:200,maxMemoryBytes:104857600};function ga(e,t){return {config:{...ha,...t},source:e,chunks:new Map,accessOrder:[],hits:0,misses:0}}function pa(e,t,n){let r={start:Math.max(0,t),end:Math.min(n,e.source.totalLines)},o=[],i=e.config.chunkSize,a=Math.floor(r.start/i),l=Math.floor(Math.max(0,r.end-1)/i);for(let s=a;s<=l;s++){let u=Un(e,s);if(!u)continue;let d=s*i,f=Math.max(0,r.start-d),c=Math.min(u.lines.length,r.end-d);for(let m=f;m<c;m++){let h=u.lines[m];h!==void 0&&o.push(h);}}return o}function ba(e,t,n){let{readAheadLines:r,readBehindLines:o,chunkSize:i}=e.config,a=Math.max(0,t-o),l=Math.min(e.source.totalLines,n+r),s=Math.floor(a/i),u=Math.floor(Math.max(0,l-1)/i);for(let d=s;d<=u;d++)Un(e,d);}function zn(e,t){let n=t??e.config.maxCachedChunks,r=0;for(;e.chunks.size>n&&e.accessOrder.length>0;){let o=e.accessOrder.shift();if(o===void 0)break;e.chunks.has(o)&&(e.chunks.delete(o),r++);}return r}function xa(e){e.chunks.clear(),e.accessOrder=[],e.hits=0,e.misses=0;}function ya(e){let t=0;for(let r of e.chunks.values())t+=r.byteSize;let n=e.hits+e.misses;return {config:e.config,totalLines:e.source.totalLines,loadedChunks:e.chunks.size,memoryUsage:t,hitRate:n>0?e.hits/n:0}}function Ca(e,t,n){let r=e.config.chunkSize,o=Math.floor(t/r),i=Math.floor(Math.max(0,n-1)/r);for(let a=o;a<=i;a++)if(!e.chunks.has(a))return false;return true}function Sa(e){return {totalLines:e.length,isExactCount:true,loadRange:(t,n)=>e.slice(t,n)}}function Un(e,t){let n=e.chunks.get(t);if(n)return e.hits++,La(e,t),{...n,lastAccessedAt:Date.now()};e.misses++;let r=e.config.chunkSize,o=t*r,i=Math.min(o+r,e.source.totalLines);if(o>=e.source.totalLines)return;e.chunks.size>=e.config.maxCachedChunks&&zn(e,e.config.maxCachedChunks-1);let a=e.source.loadRange(o,i),l=0;for(let u of a)l+=u.length*2;let s={index:t,startLine:o,endLine:i,lines:a,byteSize:l,lastAccessedAt:Date.now()};return e.chunks.set(t,s),e.accessOrder.push(t),s}function La(e,t){let n=e.accessOrder.indexOf(t);n>=0&&e.accessOrder.splice(n,1),e.accessOrder.push(t);}var $e={mode:"absolute",minWidth:3,rightPadding:1,padChar:" ",separator:"\u2502",highlightCurrent:true};function me(e,t){if(e<=0)return t;let n=Math.floor(Math.log10(e))+1;return Math.max(n,t)}function Vn(e,t){let n={...$e,...t};return e+n.rightPadding+1}function ka(e){return {...$e,...e}}function jn(e,t,n,r){let o=e===t;if(r==="absolute")return String(e).padStart(n," ");if(r==="relative"){if(o)return String(e).padStart(n," ");let a=Math.abs(e-t);return String(a).padStart(n," ")}if(o)return String(e).padStart(n," ");let i=Math.abs(e-t);return String(i).padStart(n," ")}function Ta(e,t,n,r,o){let i={...$e,...o},a=me(e,i.minWidth),l=Vn(a,i),s=[],u=Math.min(t+n,e);for(let d=t;d<u;d++){let f=d+1,c=f===r,h=jn(f,r,a,i.mode)+i.padChar.repeat(i.rightPadding)+i.separator;s.push({text:h,isCurrent:c,lineNumber:f,width:l});}return {lines:s,gutterWidth:l,digitWidth:a,totalLines:e}}function Ra(e,t,n=3){return me(e,n)!==me(t,n)}function Aa(e,t,n,r="\x1B[0m"){return e.lines.map(o=>`${o.isCurrent?t:n}${o.text}${r}`)}var wa=100,he={inString:null,inComment:false,templateDepth:0,commentDepth:0},z={name:"javascript",extensions:[".js",".jsx",".ts",".tsx",".mjs",".cjs"],keywords:new Set(["async","await","break","case","catch","class","const","continue","debugger","default","delete","do","else","enum","export","extends","finally","for","from","function","if","implements","import","in","instanceof","interface","let","new","of","package","private","protected","public","return","static","super","switch","this","throw","try","type","typeof","var","void","while","with","yield","as","is","keyof","readonly","declare","namespace","abstract","satisfies"]),builtins:new Set(["Array","Boolean","Date","Error","Function","JSON","Math","Number","Object","Promise","RegExp","String","Symbol","Map","Set","WeakMap","WeakSet","console","window","document","globalThis","process","require","module","exports","Buffer","setTimeout","setInterval","clearTimeout","clearInterval","fetch","Response","Request","Headers","URL","URLSearchParams","FormData","Blob","File","FileReader","Intl","Proxy","Reflect","BigInt"]),types:new Set(["any","boolean","number","string","void","never","unknown","null","undefined","object","symbol","bigint"]),constants:new Set(["true","false","null","undefined","NaN","Infinity"]),operators:/[+\-*/%=<>!&|^~?:]+/,lineComment:"//",blockCommentStart:"/*",blockCommentEnd:"*/",stringDelimiters:["'",'"'],templateLiteralStart:"`",templateLiteralEnd:"`",numberPattern:/\b(?:0[xX][0-9a-fA-F_]+|0[oO][0-7_]+|0[bB][01_]+|(?:\d[\d_]*)?\.?\d[\d_]*(?:[eE][+-]?\d[\d_]*)?n?)\b/,identifierPattern:/[a-zA-Z_$][a-zA-Z0-9_$]*/,nestedComments:false},U={name:"python",extensions:[".py",".pyw",".pyi"],keywords:new Set(["and","as","assert","async","await","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","nonlocal","not","or","pass","raise","return","try","while","with","yield","match","case"]),builtins:new Set(["abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip","__import__"]),types:new Set(["int","float","str","bool","list","dict","set","tuple","bytes","None"]),constants:new Set(["True","False","None","Ellipsis","NotImplemented","__debug__"]),operators:/[+\-*/%=<>!@&|^~:]+/,lineComment:"#",blockCommentStart:null,blockCommentEnd:null,stringDelimiters:["'",'"',"'''",'"""'],templateLiteralStart:null,templateLiteralEnd:null,numberPattern:/\b(?:0[xX][0-9a-fA-F_]+|0[oO][0-7_]+|0[bB][01_]+|(?:\d[\d_]*)?\.?\d[\d_]*(?:[eE][+-]?\d[\d_]*)?[jJ]?)\b/,identifierPattern:/[a-zA-Z_][a-zA-Z0-9_]*/,nestedComments:false},ge={name:"rust",extensions:[".rs"],keywords:new Set(["as","async","await","break","const","continue","crate","dyn","else","enum","extern","false","fn","for","if","impl","in","let","loop","match","mod","move","mut","pub","ref","return","self","Self","static","struct","super","trait","true","type","union","unsafe","use","where","while","macro_rules"]),builtins:new Set(["Option","Some","None","Result","Ok","Err","Box","Vec","String","HashMap","HashSet","Rc","Arc","RefCell","Cell","Mutex","RwLock","println","eprintln","print","eprint","format","panic","assert","assert_eq","assert_ne","debug_assert","todo","unimplemented","unreachable","cfg","derive"]),types:new Set(["bool","char","str","u8","u16","u32","u64","u128","usize","i8","i16","i32","i64","i128","isize","f32","f64","()"]),constants:new Set(["true","false"]),operators:/[+\-*/%=<>!&|^~?:@]+/,lineComment:"//",blockCommentStart:"/*",blockCommentEnd:"*/",stringDelimiters:['"'],templateLiteralStart:null,templateLiteralEnd:null,numberPattern:/\b(?:0[xX][0-9a-fA-F_]+|0[oO][0-7_]+|0[bB][01_]+|(?:\d[\d_]*)?\.?\d[\d_]*(?:[eE][+-]?\d[\d_]*)?(?:_?(?:u8|u16|u32|u64|u128|usize|i8|i16|i32|i64|i128|isize|f32|f64))?)\b/,identifierPattern:/[a-zA-Z_][a-zA-Z0-9_]*/,nestedComments:true},Ze={name:"go",extensions:[".go"],keywords:new Set(["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"]),builtins:new Set(["append","cap","close","complex","copy","delete","imag","len","make","new","panic","print","println","real","recover"]),types:new Set(["bool","byte","complex64","complex128","error","float32","float64","int","int8","int16","int32","int64","rune","string","uint","uint8","uint16","uint32","uint64","uintptr"]),constants:new Set(["true","false","nil","iota"]),operators:/[+\-*/%=<>!&|^~:]+/,lineComment:"//",blockCommentStart:"/*",blockCommentEnd:"*/",stringDelimiters:['"',"'","`"],templateLiteralStart:null,templateLiteralEnd:null,numberPattern:/\b(?:0[xX][0-9a-fA-F_]+|0[oO][0-7_]+|0[bB][01_]+|(?:\d[\d_]*)?\.?\d[\d_]*(?:[eE][+-]?\d[\d_]*)?i?)\b/,identifierPattern:/[a-zA-Z_][a-zA-Z0-9_]*/,nestedComments:false},pe={name:"shell",extensions:[".sh",".bash",".zsh",".fish"],keywords:new Set(["if","then","else","elif","fi","case","esac","for","while","until","do","done","in","function","select","time","coproc","return","exit","break","continue","local","declare","typeset","readonly","export","unset","shift","source","alias","unalias"]),builtins:new Set(["echo","printf","read","cd","pwd","pushd","popd","dirs","set","shopt","test","eval","exec","trap","wait","kill","jobs","fg","bg","suspend","disown","builtin","command","type","hash","help","let","true","false","getopts","bind","complete","compgen","compopt","caller","enable","mapfile","readarray","ulimit","umask"]),types:new Set([]),constants:new Set(["true","false"]),operators:/[+\-*/%=<>!&|^~?:;]+/,lineComment:"#",blockCommentStart:null,blockCommentEnd:null,stringDelimiters:['"',"'"],templateLiteralStart:null,templateLiteralEnd:null,numberPattern:/\b\d+\b/,identifierPattern:/[a-zA-Z_][a-zA-Z0-9_]*/,nestedComments:false},Ke={name:"json",extensions:[".json",".jsonc",".json5"],keywords:new Set([]),builtins:new Set([]),types:new Set([]),constants:new Set(["true","false","null"]),operators:/[:]/,lineComment:null,blockCommentStart:null,blockCommentEnd:null,stringDelimiters:['"'],templateLiteralStart:null,templateLiteralEnd:null,numberPattern:/\b-?(?:\d+)?\.?\d+(?:[eE][+-]?\d+)?\b/,identifierPattern:/[a-zA-Z_][a-zA-Z0-9_]*/,nestedComments:false},j={name:"plaintext",extensions:[".txt",".text"],keywords:new Set([]),builtins:new Set([]),types:new Set([]),constants:new Set([]),operators:/(?!)/,lineComment:null,blockCommentStart:null,blockCommentEnd:null,stringDelimiters:[],templateLiteralStart:null,templateLiteralEnd:null,numberPattern:/(?!)/,identifierPattern:/(?!)/,nestedComments:false},qe=[z,U,ge,Ze,pe,Ke,j];function Xe(e){return {grammar:e,entries:new Map,dirty:new Set,lineCount:0,fullInvalidate:true}}function Ea(e){e.entries.clear(),e.dirty.clear(),e.lineCount=0,e.fullInvalidate=true;}function Je(e,t){if(e.grammar.name!==t.name){e.grammar=t,e.fullInvalidate=true;for(let n=0;n<e.lineCount;n++)e.dirty.add(n);}}function Wa(e){return {cachedLines:e.entries.size,dirtyLines:e.dirty.size,grammar:e.grammar.name,lineCount:e.lineCount,fullInvalidate:e.fullInvalidate}}function Ma(e,t,n){for(let r=t;r<n;r++)e.dirty.add(r);}function Ia(e,t){e.dirty.add(t);}function Da(e){e.fullInvalidate=true;for(let t=0;t<e.lineCount;t++)e.dirty.add(t);}function V(e,t){return e.inString===t.inString&&e.inComment===t.inComment&&e.templateDepth===t.templateDepth&&e.commentDepth===t.commentDepth}function B(e,t,n){let o=Pa(e,t,n,[]),i=_a(e),a=va(i);for(;o.pos<t.length;)Ba(o,a)||o.pos++;return {text:t,tokens:o.tokens,startState:n,endState:o.state}}function va(e){return [Fa,Oa,Na,Ha,Ga,za,Ua,t=>Va(t,e),Ka,qa,Xa,Ja]}function Ba(e,t){for(let n of t)if(n(e))return true;return false}function Pa(e,t,n,r){return {grammar:e,line:t,tokens:r,pos:0,state:{...n},addToken:(o,i,a)=>{a>i&&r.push({type:o,start:i,end:a,text:t.slice(i,a)});},startsWithAt:(o,i)=>t.slice(i,i+o.length)===o}}function _a(e){return [...e.stringDelimiters].sort((t,n)=>n.length-t.length)}function Fa(e){if(e.state.inString===null)return false;let t=e.state.inString,n=e.pos;for(;e.pos<e.line.length;){let r=e.line[e.pos];if(r==="\\"&&e.pos+1<e.line.length)e.pos+=2;else if(t.length===3&&e.startsWithAt(t,e.pos)||t.length===1&&r===t){e.pos+=t.length,e.state={...e.state,inString:null};break}else e.pos++;}return e.addToken("string",n,e.pos),true}function Oa(e){if(!e.state.inComment||!e.grammar.blockCommentEnd)return false;let t=e.pos;for(;e.pos<e.line.length;)if(e.grammar.nestedComments&&e.grammar.blockCommentStart&&e.startsWithAt(e.grammar.blockCommentStart,e.pos))e.state={...e.state,commentDepth:e.state.commentDepth+1},e.pos+=e.grammar.blockCommentStart.length;else if(e.startsWithAt(e.grammar.blockCommentEnd,e.pos))if(e.grammar.nestedComments&&e.state.commentDepth>0)e.state={...e.state,commentDepth:e.state.commentDepth-1},e.pos+=e.grammar.blockCommentEnd.length;else {e.pos+=e.grammar.blockCommentEnd.length,e.state={...e.state,inComment:false,commentDepth:0};break}else e.pos++;return e.addToken("comment",t,e.pos),true}function Na(e){if(e.state.templateDepth<=0||!e.grammar.templateLiteralEnd)return false;let t=e.pos;for(;e.pos<e.line.length;)if(e.line[e.pos]==="\\"&&e.pos+1<e.line.length)e.pos+=2;else if(e.startsWithAt("${",e.pos)){e.addToken("string",t,e.pos),e.pos+=2,e.addToken("punctuation",e.pos-2,e.pos);break}else if(e.startsWithAt(e.grammar.templateLiteralEnd,e.pos)){e.pos+=e.grammar.templateLiteralEnd.length,e.state={...e.state,templateDepth:e.state.templateDepth-1};break}else e.pos++;return e.pos>t&&e.addToken("string",t,e.pos),true}function Ha(e){if(!/\s/.test(e.line[e.pos]||""))return false;let t=e.pos;for(;e.pos<e.line.length&&/\s/.test(e.line[e.pos]||"");)e.pos++;return e.addToken("text",t,e.pos),true}function Ga(e){return !e.grammar.lineComment||!e.startsWithAt(e.grammar.lineComment,e.pos)?false:(e.addToken("comment",e.pos,e.line.length),e.pos=e.line.length,true)}function za(e){if(!e.grammar.blockCommentStart||!e.startsWithAt(e.grammar.blockCommentStart,e.pos))return false;let t=e.pos;return ja(e)||(e.state={...e.state,inComment:true}),e.addToken("comment",t,e.pos),true}function Ua(e){if(!e.grammar.templateLiteralStart||!e.startsWithAt(e.grammar.templateLiteralStart,e.pos))return false;let t=e.pos;for(e.pos+=e.grammar.templateLiteralStart.length;e.pos<e.line.length&&e.grammar.templateLiteralEnd;)if(e.line[e.pos]==="\\"&&e.pos+1<e.line.length)e.pos+=2;else if(e.startsWithAt("${",e.pos)){e.addToken("string",t,e.pos),e.pos+=2,e.addToken("punctuation",e.pos-2,e.pos),e.state={...e.state,templateDepth:e.state.templateDepth+1};break}else if(e.startsWithAt(e.grammar.templateLiteralEnd,e.pos)){e.pos+=e.grammar.templateLiteralEnd.length,e.addToken("string",t,e.pos);break}else e.pos++;return e.pos>=e.line.length&&e.pos>t+1&&(e.state={...e.state,templateDepth:e.state.templateDepth+1},e.addToken("string",t,e.pos)),true}function Va(e,t){let n=$a(e,t);if(!n)return false;let r=e.pos;return e.pos+=n.length,Za(e,n),e.pos>=e.line.length&&n.length===3&&(e.state={...e.state,inString:n}),e.addToken("string",r,e.pos),true}function ja(e){if(!e.grammar.blockCommentStart||!e.grammar.blockCommentEnd)return false;for(e.pos+=e.grammar.blockCommentStart.length;e.pos<e.line.length;){if(e.grammar.nestedComments&&e.startsWithAt(e.grammar.blockCommentStart,e.pos)){e.state={...e.state,commentDepth:e.state.commentDepth+1},e.pos+=e.grammar.blockCommentStart.length;continue}if(e.startsWithAt(e.grammar.blockCommentEnd,e.pos)){if(e.grammar.nestedComments&&e.state.commentDepth>0){e.state={...e.state,commentDepth:e.state.commentDepth-1},e.pos+=e.grammar.blockCommentEnd.length;continue}return e.pos+=e.grammar.blockCommentEnd.length,true}e.pos++;}return false}function $a(e,t){for(let n of t)if(e.startsWithAt(n,e.pos))return n;return null}function Za(e,t){for(;e.pos<e.line.length;){if(e.line[e.pos]==="\\"&&e.pos+1<e.line.length){e.pos+=2;continue}if(t.length===3&&e.startsWithAt(t,e.pos)||t.length===1&&e.line[e.pos]===t){e.pos+=t.length;break}e.pos++;}}function Ka(e){let t=e.grammar.numberPattern.exec(e.line.slice(e.pos));return !t||t.index!==0?false:(e.addToken("number",e.pos,e.pos+t[0].length),e.pos+=t[0].length,true)}function qa(e){let t=e.grammar.identifierPattern.exec(e.line.slice(e.pos));if(!t||t.index!==0)return false;let n=t[0],r="identifier";return e.grammar.keywords.has(n)?r="keyword":e.grammar.constants.has(n)?r="constant":e.grammar.builtins.has(n)?r="builtin":(e.grammar.types.has(n)||/^[A-Z]/.test(n))&&(r="type"),e.line.slice(e.pos+n.length).trimStart().startsWith("(")&&r==="identifier"&&(r="function"),e.addToken(r,e.pos,e.pos+n.length),e.pos+=n.length,true}function Xa(e){let t=e.grammar.operators.exec(e.line.slice(e.pos));return !t||t.index!==0?false:(e.addToken("operator",e.pos,e.pos+t[0].length),e.pos+=t[0].length,true)}function Ja(e){let t=e.line[e.pos]||"";return /[()[\]{},;.]/.test(t)?(e.addToken("punctuation",e.pos,e.pos+1),e.pos++,true):false}function Ye(e,t){let n=t.split(`
|
|
16
|
-
`);e.lineCount=n.length,e.fullInvalidate&&(e.entries.clear(),e.dirty.clear(),e.fullInvalidate=false);let r=[],o=he;for(let i=0;i<n.length;i++){let a=n[i]??"",l=e.entries.get(i);if(l&&l.text===a&&V(l.startState,o)&&!e.dirty.has(i))r.push(l),o=l.endState;else {let s=B(e.grammar,a,o);e.entries.set(i,s),e.dirty.delete(i),r.push(s),o=s.endState;let u=e.entries.get(i+1);u&&!V(o,u.startState)&&e.dirty.add(i+1);}}return r}function Ya(e,t,n,r){let o=performance.now(),i=t.split(`
|
|
17
|
-
`);e.lineCount=i.length;let a=Math.max(0,n),l=Math.min(i.length,r);e.fullInvalidate&&(e.entries.clear(),e.dirty.clear(),e.fullInvalidate=false);let s=he;for(let c=0;c<a;c++){let m=i[c]??"",h=e.entries.get(c);if(h&&h.text===m&&V(h.startState,s)&&!e.dirty.has(c))s=h.endState;else {let g=B(e.grammar,m,s);e.entries.set(c,g),e.dirty.delete(c),s=g.endState;}}let u=[];for(let c=a;c<l;c++){let m=i[c]??"",h=e.entries.get(c);if(h&&h.text===m&&V(h.startState,s)&&!e.dirty.has(c))u.push(h),s=h.endState;else {let g=B(e.grammar,m,s);e.entries.set(c,g),e.dirty.delete(c),u.push(g),s=g.endState;}}let d=l<i.length,f=performance.now()-o;return {lines:u,hasMore:d,nextLine:l,timeMs:f}}function Qa(e,t,n,r=100){let o=performance.now(),i=t.split(`
|
|
18
|
-
`);e.lineCount=i.length;let a=Math.max(0,Math.min(n,i.length)),l=Math.min(a+r,i.length),s=he,u=e.entries.get(a-1);if(a>0&&u)s=u.endState;else if(a>0)for(let m=0;m<a;m++){let h=i[m]??"",g=e.entries.get(m);if(g&&g.text===h&&V(g.startState,s))s=g.endState;else {let W=B(e.grammar,h,s);e.entries.set(m,W),s=W.endState;}}let d=[];for(let m=a;m<l;m++){let h=i[m]??"",g=B(e.grammar,h,s);e.entries.set(m,g),e.dirty.delete(m),d.push(g),s=g.endState;}let f=l<i.length,c=performance.now()-o;return {lines:d,hasMore:f,nextLine:l,timeMs:c}}function Qe(e){let t=e.slice(e.lastIndexOf(".")).toLowerCase();for(let n of qe)if(n.extensions.includes(t))return n;return j}function el(e){let t=e.split(`
|
|
19
|
-
`)[0]||"";if(t.startsWith("#!")){if(/python/.test(t))return U;if(/node|deno|bun/.test(t))return z;if(/bash|sh|zsh/.test(t))return pe}return /^package\s+\w+/.test(t)?Ze:/^(use\s+|mod\s+|fn\s+|struct\s+|impl\s+|pub\s+)/.test(t)?ge:/^(import|from|def|class)\s+/.test(t)?U:/^(import|export|const|let|var|function|class)\s+/.test(t)?z:/^\s*\{/.test(t)?Ke:j}function et(e){let t=e.toLowerCase();for(let n of qe)if(n.name===t)return n;return t==="ts"||t==="typescript"||t==="tsx"||t==="jsx"?z:t==="py"?U:t==="rs"?ge:t==="bash"||t==="sh"||t==="zsh"?pe:j}var tl=100,Kn=/^(#{1,6})\s+(.+)$/,qn=/^(`{3,}|~{3,})(\w*)?$/,Xn=/^([-*_])\s*\1\s*\1\s*(\1|\s)*$/,be=/^(\s*)[-*+]\s+(.*)$/,xe=/^(\s*)(\d+)[.)]\s+(.*)$/,nl=/^\[([ xX])\]\s+(.*)$/,tt=/^>\s?(.*)$/,rl=/^\|?[\s:-]+\|[\s:|+-]+\|?$/,$n=/^\|(.+)\|$/;function k(e){let t=5381;for(let n=0;n<e.length;n++)t=(t<<5)+t+e.charCodeAt(n)|0;return t}function A(e){let t=[],n=e,r=0;for(;r<n.length;){let o=il(n.slice(r));if(o){r>0&&(t.push({type:"text",content:n.slice(0,r)}),n=n.slice(r),r=0),t.push(o.element),n=n.slice(o.length);continue}r++;}return n.length>0&&t.push({type:"text",content:n}),t}var ol=[al,ll,sl,ul,dl,fl];function il(e){for(let t of ol){let n=t(e);if(n)return n}return null}function al(e){let t=e.match(/^`([^`]+)`/);return t?{element:{type:"code",content:t[1]??""},length:t[0].length}:null}function ll(e){let t=e.match(/^(\*\*|__)(.+?)\1/);if(!t)return null;let n=t[2]??"";return {element:{type:"bold",content:n,children:A(n)},length:t[0].length}}function sl(e){let t=e.match(/^(\*|_)(.+?)\1/);if(!t)return null;let n=t[2]??"";return {element:{type:"italic",content:n,children:A(n)},length:t[0].length}}function ul(e){let t=e.match(/^\[([^\]]+)\]\(([^)]+)\)/);return t?{element:{type:"link",content:t[1]??"",href:t[2]??""},length:t[0].length}:null}function dl(e){let t=e.match(/^!\[([^\]]*)\]\(([^)]+)\)/);return t?{element:{type:"image",content:t[1]??"",href:t[2]??""},length:t[0].length}:null}function fl(e){let t=e.match(/^~~(.+?)~~/);return t?{element:{type:"strikethrough",content:t[1]??""},length:t[0].length}:null}function nt(e){let t=performance.now(),n=e.split(`
|
|
20
|
-
`),r=[],o=0;for(;o<n.length;){let i=n[o];if(i===void 0){o++;continue}if(i.trim()===""){o++;continue}let a=ml(n,o);if(a){r.push(a.block),o=a.nextIndex;continue}o++;}return {blocks:r,parseTimeMs:performance.now()-t}}var cl=[hl,gl,pl,bl,xl,yl,Cl];function ml(e,t){for(let n of cl){let r=n(e,t);if(r)return r}return null}function hl(e,t){let n=e[t];if(n===void 0)return null;let r=n.match(Kn);if(!r)return null;let o=r[2]??"";return {block:{type:"heading",source:n,lineStart:t,lineEnd:t+1,hash:k(n),data:{kind:"heading",level:r[1]?.length??1,text:o,inline:A(o)}},nextIndex:t+1}}function gl(e,t){let n=e[t];return n===void 0||!Xn.test(n)?null:{block:{type:"hr",source:n,lineStart:t,lineEnd:t+1,hash:k(n),data:{kind:"hr"}},nextIndex:t+1}}function pl(e,t){let n=e[t];if(n===void 0)return null;let r=n.match(qn);if(!r)return null;let o=r[1]??"",i=r[2]??"",a=[],l=t,s=t+1;for(;s<e.length;){let d=e[s];if(d===void 0)break;if(d.startsWith(o)&&d.trim()===o){s++;break}a.push(d),s++;}let u=a.join(`
|
|
21
|
-
`);return {block:{type:"code",source:e.slice(l,s).join(`
|
|
22
|
-
`),lineStart:l,lineEnd:s,hash:k(u+i),data:{kind:"code",language:i||Qe("code.txt").name||"",code:u}},nextIndex:s}}function bl(e,t){let n=e[t];if(n===void 0||!tt.test(n))return null;let r=[],o=t,i=t;for(;i<e.length;){let s=e[i];if(s===void 0)break;let u=s.match(tt);if(!u&&s.trim()!=="")break;r.push(u?u[1]??"":""),i++;}let a=r.join(`
|
|
23
|
-
`),l=nt(a);return {block:{type:"blockquote",source:e.slice(o,i).join(`
|
|
24
|
-
`),lineStart:o,lineEnd:i,hash:k(a),data:{kind:"blockquote",content:a,blocks:l.blocks}},nextIndex:i}}function xl(e,t){let n=e[t],r=e[t+1];if(n===void 0||r===void 0||!$n.test(n)||!rl.test(r))return null;let o=t,i=Zn(n),a=Sl(r),l=[],s=t+2;for(;s<e.length;){let u=e[s];if(u===void 0||!$n.test(u))break;l.push(Zn(u)),s++;}return {block:{type:"table",source:e.slice(o,s).join(`
|
|
25
|
-
`),lineStart:o,lineEnd:s,hash:k(e.slice(o,s).join(`
|
|
26
|
-
`)),data:{kind:"table",headers:i,alignments:a,rows:l}},nextIndex:s}}function yl(e,t){let n=e[t];if(n===void 0)return null;let r=kl(n);if(!r)return null;let o=t,i=Tl(e,t,r.ordered);return {block:{type:"list",source:e.slice(o,i.nextIndex).join(`
|
|
27
|
-
`),lineStart:o,lineEnd:i.nextIndex,hash:k(e.slice(o,i.nextIndex).join(`
|
|
28
|
-
`)),data:{kind:"list",ordered:r.ordered,start:r.start,items:i.items}},nextIndex:i.nextIndex}}function Cl(e,t){let n=[],r=t,o=t;for(;o<e.length;){let a=e[o];if(a===void 0||a.trim()===""||n.length>0&&Al(a))break;n.push(a),o++;}if(n.length===0)return null;let i=n.join(" ");return {block:{type:"paragraph",source:n.join(`
|
|
29
|
-
`),lineStart:r,lineEnd:o,hash:k(i),data:{kind:"paragraph",text:i,inline:A(i)}},nextIndex:o}}function Zn(e){return Jn(e).map(t=>{let n=t.trim();return {content:n,inline:A(n)}})}function Sl(e){return Jn(e).map(t=>{let n=t.trim();return n.startsWith(":")&&n.endsWith(":")?"center":n.endsWith(":")?"right":n.startsWith(":")?"left":null})}function Jn(e){return e.slice(1,-1).split("|")}function Ll(e,t,n){let r=e[t];return r===void 0?false:n?xe.test(r):be.test(r)}function kl(e){let t=e.match(be),n=e.match(xe);return !t&&!n?null:{ordered:!!n,start:n?parseInt(n[2]??"1",10):void 0}}function Tl(e,t,n){let r=[],o=t;for(;o<e.length;){let i=e[o];if(i===void 0)break;let a=n?i.match(xe):i.match(be);if(!a&&i.trim()===""){if(!Ll(e,o+1,n))break;o++;continue}if(!a)break;r.push(Rl(a,n)),o++;}return {items:r,nextIndex:o}}function Rl(e,t){let n=(e[1]??"").length,r=t?e[3]??"":e[2]??"",o=r.match(nl),i=o?o[2]??"":r;return {content:i,inline:A(i),indent:n,checked:o?o[1]?.toLowerCase()==="x":void 0}}function Al(e){return Kn.test(e)||Xn.test(e)||qn.test(e)||be.test(e)||xe.test(e)||tt.test(e)}function wl(){return {blocks:new Map,sourceHash:0,highlightCaches:new Map,renderedLines:null}}function El(e){e.blocks.clear(),e.sourceHash=0,e.highlightCaches.clear(),e.renderedLines=null;}function Wl(e,t){let n=k(t);if(e.sourceHash===n&&e.renderedLines)return {blocks:Array.from(e.blocks.values()),parseTimeMs:0};let r=nt(t);e.blocks.clear();for(let o of r.blocks){let i=`${o.lineStart}-${o.lineEnd}`;e.blocks.set(i,o);}return e.sourceHash=n,e.renderedLines=null,r}function Ml(e,t,n){for(let[r,o]of e.blocks)o.lineStart<n&&o.lineEnd>t&&e.blocks.delete(r);e.renderedLines=null;}function rt(e,t){let n=[],r={},o=Il[e.data.kind];return o&&o(e,t,n,r),n}function ot(e,t){if(t.renderedLines)return t.renderedLines;let n=[],r=0;for(let[o,i]of e.blocks.entries()){let a=rt(i,t);for(let l of a)n.push({...l,blockIndex:o}),r++;o<e.blocks.length-1&&(n.push({content:"",style:{},blockIndex:o,lineInBlock:-1}),r++);}return t.renderedLines=n,n}var Il={heading:Dl,paragraph:vl,code:Bl,list:Pl,table:_l,blockquote:Fl,hr:Ol,html:Nl};function Dl(e,t,n,r){let o=e.data;o.kind==="heading"&&n.push({content:`${"#".repeat(o.level)} ${o.text}`,style:{bold:true},blockIndex:0,lineInBlock:0});}function vl(e,t,n,r){let o=e.data;o.kind==="paragraph"&&n.push({content:o.text,style:r,blockIndex:0,lineInBlock:0});}function Bl(e,t,n,r){let o=e.data;if(o.kind!=="code")return;let i=et(o.language||"plaintext"),a=t.highlightCaches.get(e.hash.toString());a?a.grammar.name!==i.name&&Je(a,i):(a=Xe(i),t.highlightCaches.set(e.hash.toString(),a)),Ye(a,o.code);for(let[l,s]of o.code.split(`
|
|
30
|
-
`).entries())n.push({content:s,style:{dim:true},blockIndex:0,lineInBlock:l});}function Pl(e,t,n,r){let o=e.data;if(o.kind==="list")for(let[i,a]of o.items.entries()){let l=o.ordered?`${(o.start||1)+i}. `:`${" ".repeat(a.indent/2)}- `,s=a.checked!==void 0?a.checked?"[x] ":"[ ] ":"";n.push({content:l+s+a.content,style:r,blockIndex:0,lineInBlock:i});}}function _l(e,t,n,r){let o=e.data;if(o.kind!=="table")return;let i=o.headers.map(l=>l.content).join(" | ");n.push({content:`| ${i} |`,style:{bold:true},blockIndex:0,lineInBlock:0});let a=o.headers.map((l,s)=>{let u=o.alignments[s];return u==="center"?":---:":u==="right"?"---:":u==="left"?":---":"---"}).join(" | ");n.push({content:`| ${a} |`,style:r,blockIndex:0,lineInBlock:1});for(let[l,s]of o.rows.entries()){let u=s.map(d=>d.content).join(" | ");n.push({content:`| ${u} |`,style:r,blockIndex:0,lineInBlock:l+2});}}function Fl(e,t,n,r){let o=e.data;if(o.kind==="blockquote"){for(let i of o.blocks){let a=rt(i,t);for(let l of a)n.push({...l,content:`> ${l.content}`,style:{...l.style,italic:true}});}n.length===0&&n.push({content:">",style:{italic:true},blockIndex:0,lineInBlock:0});}}function Ol(e,t,n,r){e.data.kind==="hr"&&n.push({content:"---",style:{dim:true},blockIndex:0,lineInBlock:0});}function Nl(e,t,n,r){let o=e.data;if(o.kind==="html")for(let[i,a]of o.html.split(`
|
|
31
|
-
`).entries())n.push({content:a,style:{dim:true},blockIndex:0,lineInBlock:i});}function Hl(e,t,n,r){let o=ot(e,t),i=Math.min(n+r,o.length);return {lines:o.slice(n,i),totalLines:o.length,startIndex:n,endIndex:i}}function Gl(e,t){return ot(e,t).length}function zl(e){let t=0,n=0,r=0,o=0,i=0,a=0;for(let l of e.blocks){switch(a+=l.lineEnd-l.lineStart,l.type){case "heading":t++;break;case "code":n++;break;case "list":r++;break;case "table":o++;break}let s=u=>{let d=0;for(let f of u)f.type==="link"&&d++,f.children&&(d+=s(f.children));return d};(l.data.kind==="paragraph"||l.data.kind==="heading")&&(i+=s(l.data.inline));}return {blockCount:e.blocks.length,lineCount:a,headingCount:t,codeBlockCount:n,listCount:r,tableCount:o,linkCount:i}}var Ul=512,Vl=256,jl=48;function $l(e){let t=0;for(let n=0;n<e.length;n++)e.charCodeAt(n)===10&&t++;return t}function Zl(e){let t=[];for(let n=0;n<e.length;n++)e.charCodeAt(n)===10&&t.push(n);return t}function $(e){let t=Zl(e);return {type:"leaf",text:e,length:e.length,newlines:t.length,lineBreaks:t}}function Z(){return {type:"leaf",text:"",length:0,newlines:0,lineBreaks:[]}}function ye(e,t){let n=e.type==="node"?e.depth:0,r=t.type==="node"?t.depth:0;return {type:"node",left:e,right:t,leftLength:e.length,length:e.length+t.length,newlines:e.newlines+t.newlines,depth:Math.max(n,r)+1}}function Kl(e){let t=e.left.type==="node"?e.left.depth:0,n=e.right.type==="node"?e.right.depth:0;return Math.abs(t-n)>1||e.depth>48}function Ce(e,t){if(e.type==="leaf"){e.length>0&&t.push(e.text);return}Ce(e.left,t),Ce(e.right,t);}function Se(e){if(e.length===0)return Z();if(e.length===1){let o=e[0];return o===void 0?Z():$(o)}let t=Math.floor(e.length/2),n=Se(e.slice(0,t)),r=Se(e.slice(t));return ye(n,r)}function ql(e){if(e.type==="leaf"||!Kl(e))return e;let t=[];Ce(e,t);let n=[];for(let r of t)if(r.length<=512)n.push(r);else for(let o=0;o<r.length;o+=512)n.push(r.slice(o,o+512));return Se(n)}function Yn(e=""){if(e.length===0)return Z();if(e.length<=512)return $(e);let t=[];for(let n=0;n<e.length;n+=512)t.push(e.slice(n,n+512));return Se(t)}function Xl(){return Z()}function Jl(e){return e.length}function Yl(e){return e.newlines}function Ql(e){return e.newlines+1}function es(e){return e.length===0}function it(e,t){if(!(t<0||t>=e.length))return e.type==="leaf"?e.text.charAt(t):t<e.leftLength?it(e.left,t):it(e.right,t-e.leftLength)}function T(e,t,n){let r=n??e.length,o=t;if(o<0&&(o=0),r>e.length)return T(e,o,e.length);if(o>=r)return "";if(e.type==="leaf")return e.text.slice(o,r);let i=e.leftLength;if(r<=i)return T(e.left,o,r);if(o>=i)return T(e.right,o-i,r-i);let a=T(e.left,o,i),l=T(e.right,0,r-i);return a+l}function ts(e){if(e.type==="leaf")return e.text;let t=[];return Ce(e,t),t.join("")}function at(e,t){if(t<=0)return 0;if(t>=e.length)return e.newlines;if(e.type==="leaf"){let r=0;for(let o of e.lineBreaks){if(o>=t)break;r++;}return r}return t<e.leftLength?at(e.left,t):e.left.newlines+at(e.right,t-e.leftLength)}function Qn(e,t){return t<0?-1:t===0?0:t>e.newlines?-1:lt(e,t,0)}function lt(e,t,n){if(e.type==="leaf"){let o=0;for(let i of e.lineBreaks)if(o++,o===t)return n+i+1;return -1}let r=e.left.newlines;return t<=r?lt(e.left,t,n):lt(e.right,t-r,n+e.leftLength)}function er(e,t){return t<0||t>e.newlines?-1:t===e.newlines?e.length:st(e,t,0)}function st(e,t,n){if(e.type==="leaf"){let o=0;for(let i of e.lineBreaks){if(o===t)return n+i;o++;}return -1}let r=e.left.newlines;return t<r?st(e.left,t,n):st(e.right,t-r,n+e.leftLength)}function tr(e,t){if(t<0||t>e.newlines)return;let n=Qn(e,t),r=er(e,t);return n===-1?{text:T(e,0,r===-1?e.length:r),start:0,end:r===-1?e.length:r,lineNumber:t}:{text:T(e,n,r===-1?e.length:r),start:n,end:r===-1?e.length:r,lineNumber:t}}function ns(e,t,n){let r=[],o=e.newlines+1;for(let i=t;i<n&&i<o;i++){let a=tr(e,i);a&&r.push(a);}return r}function K(e,t){if(t<=0)return {left:null,right:e};if(t>=e.length)return {left:e,right:null};if(e.type==="leaf"){let o=e.text.slice(0,t),i=e.text.slice(t);return {left:o.length>0?$(o):null,right:i.length>0?$(i):null}}if(t<=e.leftLength){let{left:o,right:i}=K(e.left,t);return i===null?{left:o,right:e.right}:{left:o,right:ye(i,e.right)}}let{left:n,right:r}=K(e.right,t-e.leftLength);return n===null?{left:e.left,right:r}:{left:ye(e.left,n),right:r}}function ut(e,t){if(e===null||e.length===0)return t??Z();if(t===null||t.length===0)return e;if(e.type==="leaf"&&t.type==="leaf"&&e.length+t.length<=512)return $(e.text+t.text);let n=ye(e,t);return ql(n)}function Le(e,t,n){if(n.length===0)return e;let r=t;r<0&&(r=0),r>e.length&&(r=e.length);let o=Yn(n),{left:i,right:a}=K(e,r);return ut(ut(i,o),a)}function rs(e,t){return Le(e,e.length,t)}function os(e,t){return Le(e,0,t)}function nr(e,t,n){let r=t,o=n;if(r<0&&(r=0),o>e.length&&(o=e.length),r>=o)return e;let{left:i}=K(e,r),{right:a}=K(e,o);return ut(i,a)}function is(e,t,n,r){let o=nr(e,t,n);return Le(o,t,r)}function as(e){let t=0,n=0,r=0;function o(i,a){if(i.type==="leaf"){t++,n+=i.length,r=Math.max(r,a);return}o(i.left,a+1),o(i.right,a+1);}return o(e,0),{length:e.length,newlines:e.newlines,leafCount:t,depth:r,avgLeafSize:t>0?n/t:0}}function dt(e){return e.type==="leaf"?e.length===e.text.length&&e.newlines===$l(e.text)&&e.lineBreaks.length===e.newlines:e.leftLength!==e.left.length||e.length!==e.left.length+e.right.length||e.newlines!==e.left.newlines+e.right.newlines?false:dt(e.left)&&dt(e.right)}var rr=(u=>(u[u.NONE=0]="NONE",u[u.BOLD=1]="BOLD",u[u.UNDERLINE=2]="UNDERLINE",u[u.BLINK=4]="BLINK",u[u.INVERSE=8]="INVERSE",u[u.INVISIBLE=16]="INVISIBLE",u[u.DIM=32]="DIM",u[u.ITALIC=64]="ITALIC",u[u.STRIKETHROUGH=128]="STRIKETHROUGH",u))(rr||{});function ft(e){let t=0;return e.bold&&(t|=1),e.underline&&(t|=2),e.blink&&(t|=4),e.inverse&&(t|=8),e.invisible&&(t|=16),e.dim&&(t|=32),e.italic&&(t|=64),e.strikethrough&&(t|=128),t}function ls(e){return {bold:(e&1)!==0,underline:(e&2)!==0,blink:(e&4)!==0,inverse:(e&8)!==0,invisible:(e&16)!==0,dim:(e&32)!==0,italic:(e&64)!==0,strikethrough:(e&128)!==0}}function ss(e,t=4294967295,n=0){return {fg:e.fg??t,bg:e.bg??n,attrs:ft(e)}}function us(e){return {fg:e.fg,bg:e.bg,attrs:ft(e)}}function ds(e,t){return e.fg===t.fg&&e.bg===t.bg&&e.attrs===t.attrs}function fs(e){return {fg:e.fg,bg:e.bg,attrs:e.attrs}}function cs(e,t){return {fg:t.fg??e.fg,bg:t.bg??e.bg,attrs:t.attrs!==void 0?t.attrs:e.attrs}}function ms(e,t){return (e.attrs&t)!==0}function hs(e,t){return {fg:e.fg,bg:e.bg,attrs:e.attrs|t}}function gs(e,t){return {fg:e.fg,bg:e.bg,attrs:e.attrs&~t}}function ps(e){return {fg:e.bg,bg:e.fg,attrs:e.attrs}}function bs(){return {fg:4294967295,bg:0,attrs:0}}function xs(e){let t=BigInt(e.fg>>>0),n=BigInt(e.bg>>>0)<<32n,r=BigInt(e.attrs)<<64n;return t|n|r}function ys(e){let t=Number(e&0xffffffffn),n=Number(e>>32n&0xffffffffn),r=Number(e>>64n&0xffn);return {fg:t,bg:n,attrs:r}}var w=4294967295,E=0,P=/\{(\/?[a-zA-Z0-9_#-]+|\/)\}/g,ke="\0LBRACE\0",Te="\0RBRACE\0",ct={black:255,red:4278190335,green:16711935,yellow:4294902015,blue:65535,magenta:4278255615,cyan:16777215,white:4294967295,"bright-black":2155905279,gray:2155905279,grey:2155905279,"bright-red":4286611711,"bright-green":2164228351,"bright-yellow":4294934783,"bright-blue":2155937791,"bright-magenta":4286644223,"bright-cyan":2164260863,"bright-white":4294967295,orange:4289003775,pink:4290825215,purple:2147516671,brown:2771004159,lime:852308735,navy:33023,teal:8421631,olive:2155872511,maroon:2147483903,aqua:16777215,silver:3233857791,default:0,transparent:0},or={bold:1,underline:2,ul:2,blink:4,inverse:8,invisible:16,hidden:16,dim:32,italic:64,strikethrough:128,strike:128},ir={left:"left",center:"center",right:"right"};function Cs(e){let t=e.startsWith("#")?e.slice(1):e;if(!/^[0-9a-fA-F]{3}$|^[0-9a-fA-F]{6}$/.test(t))return null;let n,r,o;if(t.length===3){let i=t[0]??"0",a=t[1]??"0",l=t[2]??"0";n=Number.parseInt(i+i,16),r=Number.parseInt(a+a,16),o=Number.parseInt(l+l,16);}else n=Number.parseInt(t.slice(0,2),16),r=Number.parseInt(t.slice(2,4),16),o=Number.parseInt(t.slice(4,6),16);return (n<<24|r<<16|o<<8|255)>>>0}function ht(e){let t=e.toLowerCase();if(t in ct)return ct[t]??null;let n=Cs(e);if(n!==null)return n;let r=Number.parseInt(e,10);return !Number.isNaN(r)&&r>=0&&r<=255?Ss(r):null}function Ss(e){if(e<8)return [255,2147483903,8388863,2155872511,33023,2147516671,8421631,3233857791][e]??255;if(e<16)return [2155905279,4278190335,16711935,4294902015,65535,4278255615,16777215,4294967295][e-8]??2155905279;if(e<232){let n=e-16,r=Math.floor(n/36)*51,o=Math.floor(n/6)%6*51,i=n%6*51;return (r<<24|o<<16|i<<8|255)>>>0}let t=(e-232)*10+8;return (t<<24|t<<16|t<<8|255)>>>0}function Ls(){return {fg:[],bg:[],attrs:new Map}}function ks(e,t){e.fg=w,e.bg=E,e.attrs=0,t.fg=[],t.bg=[],t.attrs.clear();}function Ts(e,t,n){n.attrs.get(e)?.pop()?.prevValue?t.attrs|=e:t.attrs&=~e;}function Rs(e,t,n,r){let o=r.attrs.get(e);o||(o=[],r.attrs.set(e,o)),o.push({type:"attr",prevValue:n.attrs&e,tagName:t}),n.attrs|=e;}function As(e,t,n,r){if(!(e in or))return false;let o=or[e];return o===void 0?false:(t?Ts(o,n,r):Rs(o,e,n,r),true)}function ws(e,t,n,r){let o=e.match(/^(.+)-fg$/);if(!o?.[1])return false;if(t)if(r.fg.length>0){let i=r.fg.pop();i&&(n.fg=i.prevValue);}else n.fg=w;else {let i=ht(o[1]);i!==null&&(r.fg.push({type:"fg",prevValue:n.fg,tagName:e}),n.fg=i);}return true}function Es(e,t,n,r){let o=e.match(/^(.+)-bg$/);if(!o?.[1])return false;if(t)if(r.bg.length>0){let i=r.bg.pop();i&&(n.bg=i.prevValue);}else n.bg=E;else {let i=ht(o[1]);i!==null&&(r.bg.push({type:"bg",prevValue:n.bg,tagName:e}),n.bg=i);}return true}function Ws(e,t,n,r){if(t)return false;let o=ht(e);return o===null?false:(r.fg.push({type:"fg",prevValue:n.fg,tagName:e}),n.fg=o,true)}function Ms(e,t,n){if(e==="/")return ks(t,n),null;let r=e.startsWith("/"),o=r?e.slice(1):e;return o in ir?ir[o]??null:(As(o,r,t,n)||ws(o,r,t,n)||Es(o,r,t,n)||Ws(o,r,t,n),null)}function Is(e){let t=[],n="left",r="",o=e.replace(/\{\{/g,ke).replace(/\}\}/g,Te),i={fg:w,bg:E,attrs:0},a=Ls(),l=0,s;for(P.lastIndex=0;(s=P.exec(o))!==null;){if(s.index>l){let d=ar(o.slice(l,s.index));r=lr(t,i,d,r);}let u=s[1];if(u!==void 0){let d=Ms(u,i,a);d!==null&&(n=d);}l=P.lastIndex;}if(l<o.length){let u=ar(o.slice(l));r=lr(t,i,u,r);}return t.length===0&&e.length===0?{segments:[],alignment:n,plainText:""}:{segments:t,alignment:n,plainText:r}}function ar(e){return e.replaceAll(ke,"{").replaceAll(Te,"}")}function lr(e,t,n,r){return n.length===0?r:(e.push({text:n,fg:t.fg,bg:t.bg,attrs:t.attrs}),r+n)}function gt(e){return e.replace(/\{\{/g,ke).replace(/\}\}/g,Te).replace(P,"").replaceAll(ke,"{").replaceAll(Te,"}")}function Ds(e){return gt(e).trim()}function Re(e){return e.replace(/\{/g,"{{").replace(/\}/g,"}}")}function vs(e,t){let n=[];if(t.bold&&n.push("{bold}"),t.underline&&n.push("{underline}"),t.blink&&n.push("{blink}"),t.inverse&&n.push("{inverse}"),t.invisible&&n.push("{invisible}"),t.dim&&n.push("{dim}"),t.italic&&n.push("{italic}"),t.strikethrough&&n.push("{strikethrough}"),t.fg!==void 0&&t.fg!==w){let o=mt(t.fg);n.push(`{#${o}-fg}`);}if(t.bg!==void 0&&t.bg!==E){let o=mt(t.bg);n.push(`{#${o}-bg}`);}let r=Re(e);return n.length===0?r:`${n.join("")}${r}{/}`}function mt(e){let t=e>>>24&255,n=e>>>16&255,r=e>>>8&255;return t.toString(16).padStart(2,"0")+n.toString(16).padStart(2,"0")+r.toString(16).padStart(2,"0")}function Bs(e){if(e.length===0)return [];let t=e[0];if(!t)return [];let n=[],r={...t};for(let o=1;o<e.length;o++){let i=e[o];i&&(i.fg===r.fg&&i.bg===r.bg&&i.attrs===r.attrs?r={...r,text:r.text+i.text}:(n.push(r),r={...i}));}return n.push(r),n}function Ps(e){return gt(e).length}function _s(e){let t=e.replace(/\{\{/g,"").replace(/\}\}/g,"");return P.lastIndex=0,P.test(t)}var sr=z$1.enum(["left","center","right"]);function q(e,t){for(let[r,o]of Object.entries(ct))if(o===e)return `{${r}-${t}}`;return `{#${mt(e)}-${t}}`}function Fs(e){return e&1?"{bold}":e&2?"{underline}":e&4?"{blink}":e&8?"{inverse}":e&16?"{invisible}":e&32?"{dim}":e&64?"{italic}":e&128?"{strikethrough}":""}function Os(e){let t=[];return e.bold&&t.push("{bold}"),e.underline&&t.push("{underline}"),e.blink&&t.push("{blink}"),e.inverse&&t.push("{inverse}"),e.invisible&&t.push("{invisible}"),e.dim&&t.push("{dim}"),e.italic&&t.push("{italic}"),e.strikethrough&&t.push("{strikethrough}"),e.fg!==void 0&&e.fg!==w&&t.push(q(e.fg,"fg")),e.bg!==void 0&&e.bg!==E&&t.push(q(e.bg,"bg")),t}function Ns(e){let t=[];return e.bg!==void 0&&e.bg!==E&&t.push("{/bg}"),e.fg!==void 0&&e.fg!==w&&t.push("{/fg}"),e.strikethrough&&t.push("{/strikethrough}"),e.italic&&t.push("{/italic}"),e.dim&&t.push("{/dim}"),e.invisible&&t.push("{/invisible}"),e.inverse&&t.push("{/inverse}"),e.blink&&t.push("{/blink}"),e.underline&&t.push("{/underline}"),e.bold&&t.push("{/bold}"),t}function Hs(e,t,n){let r=Re(e),o=t.join(""),i=n?n.join(""):"{/}";return `${o}${r}${i}`}function ur(e){let t=[];return e&1&&t.push("{bold}"),e&2&&t.push("{underline}"),e&4&&t.push("{blink}"),e&8&&t.push("{inverse}"),e&16&&t.push("{invisible}"),e&32&&t.push("{dim}"),e&64&&t.push("{italic}"),e&128&&t.push("{strikethrough}"),t}function dr(e){let t=[],n=ur(e.attrs);t.push(...n),e.fg!==w&&t.push(q(e.fg,"fg")),e.bg!==E&&t.push(q(e.bg,"bg"));let r=Re(e.text);return t.length===0?r:`${t.join("")}${r}{/}`}function Gs(e){let t=[];e.alignment!=="left"&&t.push(`{${e.alignment}}`);for(let n of e.segments)t.push(dr(n));return t.join("")}var fr=z$1.object({text:z$1.string(),fg:z$1.number(),bg:z$1.number(),attrs:z$1.number()}),zs=z$1.object({segments:z$1.array(fr),alignment:sr,plainText:z$1.string()});var Us=5e3,Vs=1e5,js=/(?:^|[^\w])/,$s=/(?:$|[^\w])/;function Zs(e){let t=new Map,n=e.length;for(let r=0;r<n-1;r++){let o=e[r];o!==void 0&&t.set(o,n-1-r);}return t}function cr(e,t,n=true,r=0){if(t.length===0)return [];let o=n?e:e.toLowerCase(),i=n?t:t.toLowerCase(),a=o.length,l=i.length,s=[];if(l>a)return s;let u=Zs(i),d=r+l-1;for(;d<a;){let f=l-1,c=d;for(;f>=0&&o[c]===i[f];)f--,c--;if(f<0)s.push(c+1),d++;else {let m=o[d],h=m!==void 0?u.get(m)??l:l;d+=Math.max(1,h);}}return s}function Ks(e){let t=0,n=Math.min(e.length,1e3);for(let r=0;r<n;r++){let o=e.charCodeAt(r);t=(t<<5)-t+o|0;}return t=(t<<5)-t+e.length|0,t}function qs(e,t){let n=0,r=0;for(let o=0;o<t&&o<e.length;o++)e[o]===`
|
|
32
|
-
`&&(n++,r=o+1);return {line:n,column:t-r}}function mr(e){let t=[0];for(let n=0;n<e.length;n++)e[n]===`
|
|
33
|
-
`&&t.push(n+1);return t}function Xs(e,t){let n=0,r=e.length-1;for(;n<r;){let o=Math.floor((n+r+1)/2),i=e[o];i!==void 0&&i<=t?n=o:r=o-1;}return n}function hr(e,t,n={}){let r=performance.now(),o=n.caseSensitive??false,i=n.wholeWord??false,a=n.maxMatches,l=n.startPosition??0;if(t.length===0)return pt(t,r);let s=cr(e,t,o,l),u=mr(e),{matches:d,truncated:f}=Ys(e,t,s,u,i,a);return {matches:d,totalCount:f?s.length:d.length,truncated:f,timedOut:false,timeMs:performance.now()-r,query:t}}function gr(e,t,n={}){let r=performance.now(),o=n.caseSensitive??false,i=n.maxMatches,a=n.timeout??5e3,l=n.startPosition??0;if(t.length===0)return pt(t,r);let s=Js(t,o);if(!s)return pt(t,r);let u=mr(e),d=eu(e,s,u,l,r+a,i);return {matches:d.matches,totalCount:d.matches.length,truncated:d.truncated,timedOut:d.timedOut,timeMs:performance.now()-r,query:t}}function pt(e,t){return {matches:[],totalCount:0,truncated:false,timedOut:false,timeMs:performance.now()-t,query:e}}function Js(e,t){try{let n=t?"g":"gi";return new RegExp(e,n)}catch{return null}}function Ys(e,t,n,r,o,i){let a=[],l=false;for(let s of n)if(!(o&&!Qs(e,s,t.length))&&(a.push(pr(e,r,s,t.length)),i&&a.length>=i)){l=true;break}return {matches:a,truncated:l}}function Qs(e,t,n){let r=t>0?e[t-1]:"",o=e[t+n]??"";return !(r&&/\w/.test(r)||o&&/\w/.test(o))}function pr(e,t,n,r){let o=Xs(t,n),i=t[o]??0,a=e.slice(n,n+r);return {start:n,end:n+r,line:o,column:n-i,text:a}}function eu(e,t,n,r,o,i){let a=[],l=false,s=false,u=r;t.lastIndex=r;let d=t.exec(e);for(;d!==null;){if(a.length%1e3===0&&performance.now()>o){s=true;break}if(d.index===u&&(t.lastIndex=u+1),u=t.lastIndex,a.push(pr(e,n,d.index,d[0].length)),i&&a.length>=i){l=true;break}d=t.exec(e);}return {matches:a,truncated:l,timedOut:s}}function bt(e,t,n={}){return n.regex?gr(e,t,n):hr(e,t,n)}function br(e,t,n,r=1e5,o={}){let i=performance.now();if(t.length===0||n>=e.length)return {matches:[],hasMore:false,nextPosition:e.length,timeMs:performance.now()-i};let a=Math.min(n+r,e.length),l=e.slice(0,a),u=bt(l,t,{...o,startPosition:n}).matches.filter(f=>f.start>=n&&f.start<a),d=a<e.length;return {matches:u,hasMore:d,nextPosition:a,timeMs:performance.now()-i}}function tu(){return {query:"",options:{},matches:[],textHash:0,currentIndex:-1,complete:false,lastPosition:0}}function nu(e){e.query="",e.options={},e.matches=[],e.textHash=0,e.currentIndex=-1,e.complete=false,e.lastPosition=0;}function ru(e,t,n,r={}){let o=Ks(t),i=e.query!==n,a=e.options.caseSensitive!==r.caseSensitive||e.options.wholeWord!==r.wholeWord||e.options.regex!==r.regex,l=e.textHash!==o;return i||a||l?(e.query=n,e.options=r,e.matches=[],e.textHash=o,e.currentIndex=-1,e.complete=false,e.lastPosition=0,true):false}function ou(e,t,n=1e5){let r=performance.now();if(e.query.length===0)return {matches:e.matches,totalCount:0,truncated:false,timedOut:false,timeMs:performance.now()-r,query:e.query};if(e.complete)return {matches:e.matches,totalCount:e.matches.length,truncated:false,timedOut:false,timeMs:performance.now()-r,query:e.query};let o=br(t,e.query,e.lastPosition,n,e.options);return e.matches.push(...o.matches),e.lastPosition=o.nextPosition,e.complete=!o.hasMore,{matches:e.matches,totalCount:e.matches.length,truncated:false,timedOut:false,timeMs:performance.now()-r,query:e.query}}function iu(e){if(e.matches.length!==0)return e.currentIndex=(e.currentIndex+1)%e.matches.length,e.matches[e.currentIndex]}function au(e){if(e.matches.length!==0)return e.currentIndex=e.currentIndex<=0?e.matches.length-1:e.currentIndex-1,e.matches[e.currentIndex]}function lu(e,t){if(!(t<0||t>=e.matches.length))return e.currentIndex=t,e.matches[t]}function su(e,t,n=true){if(e.matches.length===0)return;let r=0,o=e.matches.length-1;for(;r<o;){let l=Math.floor((r+o)/2),s=e.matches[l];s&&s.start<t?r=l+1:o=l;}let i=e.matches[r],a=r>0?e.matches[r-1]:void 0;if(n&&i)return e.currentIndex=r,{match:i,index:r};if(!n&&a)return e.currentIndex=r-1,{match:a,index:r-1};if(i)return e.currentIndex=r,{match:i,index:r};if(a)return e.currentIndex=r-1,{match:a,index:r-1}}function uu(e,t,n){return e.matches.filter(r=>r.line>=t&&r.line<n)}function du(e){return {current:e.currentIndex+1,total:e.matches.length,complete:e.complete}}function fu(e,t,n={}){let r=bt(e,t,n);return {...r,matches:[...r.matches].reverse()}}export{Co as $,xn as $a,zi as $b,B as $c,ps as $d,Y as A,ne as Aa,oi as Ab,ya as Ac,es as Ad,cr as Ae,qr as B,H as Ba,ii as Bb,Ca as Bc,it as Bd,qs as Be,Xr as C,nn as Ca,ai as Cb,Sa as Cc,T as Cd,hr as Ce,M as D,rn as Da,li as Db,me as Dc,ts as Dd,gr as De,Ae as E,Fe as Ea,si as Eb,Vn as Ec,at as Ed,bt as Ee,Tt as F,on as Fa,ui as Fb,ka as Fc,Qn as Fd,br as Fe,Rt as G,Oe as Ga,di as Gb,jn as Gc,er as Gd,tu as Ge,we as H,Ne as Ha,fi as Hb,Ta as Hc,tr as Hd,nu as He,Jr as I,He as Ia,Fn as Ib,Ra as Ic,ns as Id,ru as Ie,Yr as J,I as Ja,ci as Jb,Aa as Jc,Le as Jd,ou as Je,Qr as K,S as Ka,mi as Kb,wa as Kc,rs as Kd,iu as Ke,eo as L,Ge as La,hi as Lb,he as Lc,os as Ld,au as Le,to as M,p as Ma,ki as Mb,z as Mc,nr as Md,lu as Me,no as N,R as Na,Ti as Nb,U as Nc,is as Nd,su as Ne,ro as O,Ue as Oa,Ei as Ob,ge as Oc,as as Od,uu as Oe,oo as P,sn as Pa,Wi as Pb,Ze as Pc,dt as Pd,du as Pe,Wt as Q,un as Qa,Mi as Qb,pe as Qc,rr as Qd,fu as Qe,co as R,dn as Ra,Ii as Rb,Ke as Rc,ft as Rd,mo as S,ae as Sa,Di as Sb,j as Sc,ls as Sd,ho as T,oe as Ta,vi as Tb,qe as Tc,ss as Td,Mt as U,ie as Ua,Bi as Ub,Xe as Uc,us as Ud,It as V,fn as Va,_i as Vb,Ea as Vc,ds as Vd,go as W,cn as Wa,Fi as Wb,Je as Wc,fs as Wd,po as X,mn as Xa,Oi as Xb,Wa as Xc,cs as Xd,bo as Y,gn as Ya,Ni as Yb,Ma as Yc,ms as Yd,xo as Z,pn as Za,Hi as Zb,Ia as Zc,hs as Zd,yo as _,bn as _a,Gi as _b,Da as _c,gs as _d,_ as a,So as aa,yn as ab,Ui as ac,Ye as ad,bs as ae,Lr as b,Lo as ba,Cn as bb,Vi as bc,Ya as bd,xs as be,kr as c,Fo as ca,Sn as cb,ji as cc,Qa as cd,ys as ce,Tr as d,Nt as da,Ln as db,$i as dc,Qe as dd,Is as de,Rr as e,Ht as ea,kn as eb,Zi as ec,el as ed,gt as ee,Ar as f,Gt as fa,Tn as fb,Ki as fc,et as fd,Ds as fe,wr as g,zt as ga,G as gb,qi as gc,tl as gd,Re as ge,Er as h,Ut as ha,Rn as hb,Xi as hc,A as hd,vs as he,Ir as i,Be as ia,b as ib,Ji as ic,nt as id,Bs as ie,Dr as j,Pe as ja,An as jb,Nn as jc,wl as jd,Ps as je,vr as k,N as ka,Ve as kb,Qi as kc,El as kd,_s as ke,kt as l,Vt as la,le as lb,ea as lc,Wl as ld,sr as le,Br as m,jt as ma,wn as mb,ta as mc,Ml as md,q as me,Pr as n,$t as na,En as nb,na as nc,rt as nd,Fs as ne,Fr as o,Zt as oa,Wn as ob,ra as oc,ot as od,Os as oe,Or as p,Kt as pa,Mn as pb,oa as pc,Hl as pd,Ns as pe,X as q,_e as qa,In as qb,ia as qc,Gl as qd,Hs as qe,Nr as r,qt as ra,Dn as rb,da as rc,zl as rd,ur as re,Hr as s,Xt as sa,vn as sb,fa as sc,Ul as sd,dr as se,Gr as t,Jt as ta,Bn as tb,ca as tc,Vl as td,Gs as te,zr as u,Yt as ua,Pn as ub,ma as uc,jl as ud,fr as ue,Ur as v,Qt as va,_n as vb,ga as vc,Yn as vd,zs as ve,jr as w,ee as wa,ei as wb,pa as wc,Xl as wd,Us as we,$r as x,en as xa,ti as xb,ba as xc,Jl as xd,Vs as xe,Zr as y,tn as ya,ni as yb,zn as yc,Yl as yd,js as ye,Kr as z,te as za,ri as zb,xa as zc,Ql as zd,$s as ze};
|
package/dist/chunk-WY5EZOOL.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {T as T$1,Y as Y$1}from'./chunk-GJ3RS2VG.js';import {l}from'./chunk-Z4EZERNE.js';import {n,i as i$1,h as h$1,j as j$1}from'./chunk-P3ZLIQJP.js';n();var T=1e4,H=1,h={sheets:new Map,nameToId:new Map};function pn(){h.sheets.clear(),h.nameToId.clear(),H=1;}function xn(t){let n=H++,e=t.frames[0],o=t.height??e?.length??0,m=t.width??e?.[0]?.length??0,s={id:n,name:t.name,frames:t.frames,width:m,height:o};return h.sheets.set(n,s),h.nameToId.set(t.name,n),n}function B(t){return h.sheets.get(t)}function bn(t){let n=h.nameToId.get(t);if(n!==void 0)return h.sheets.get(n)}function q(t){return h.nameToId.get(t)}function dn(t){let n=h.sheets.get(t);return n?(h.nameToId.delete(n.name),h.sheets.delete(t),true):false}var f={frameIndex:new Uint16Array(T),frameCount:new Uint16Array(T),frameWidth:new Uint8Array(T),frameHeight:new Uint8Array(T),spriteSheetId:new Uint32Array(T)};function K(t,n,e,o=0){let m=B(e);if(m)return i$1(t,n,f)||h$1(t,n,f),f.spriteSheetId[n]=e,f.frameCount[n]=m.frames.length,f.frameWidth[n]=m.width,f.frameHeight[n]=m.height,f.frameIndex[n]=Math.min(o,m.frames.length-1),n}function hn(t,n,e,o=0){let m=q(e);if(m!==void 0)return K(t,n,m,o)}function En(t,n){if(i$1(t,n,f))return {frameIndex:f.frameIndex[n],frameCount:f.frameCount[n],frameWidth:f.frameWidth[n],frameHeight:f.frameHeight[n],spriteSheetId:f.spriteSheetId[n]}}function An(t,n){if(!i$1(t,n,f))return;let e=f.spriteSheetId[n],o=B(e);if(!o)return;let m=f.frameIndex[n];return o.frames[m]}function O(t,n,e){if(!i$1(t,n,f))return n;let o=f.frameCount[n],m=Math.max(0,Math.min(e,o-1));return f.frameIndex[n]=m,n}function gn(t,n){if(!i$1(t,n,f))return n;let e=f.frameCount[n],o=f.frameIndex[n];return f.frameIndex[n]=(o+1)%e,n}function In(t,n){if(!i$1(t,n,f))return n;let e=f.frameCount[n],o=f.frameIndex[n];return f.frameIndex[n]=o===0?e-1:o-1,n}function Sn(t,n){return i$1(t,n,f)}function Cn(t,n){if(!i$1(t,n,f))return;let e=f.spriteSheetId[n];return B(e)}function Wn(t,n){return i$1(t,n,f)&&(f.spriteSheetId[n]=0,f.frameIndex[n]=0,f.frameCount[n]=0,f.frameWidth[n]=0,f.frameHeight[n]=0),n}n();var W=1e4,N=1,E={animations:new Map,nameToId:new Map};function Xn(){E.animations.clear(),E.nameToId.clear(),N=1;}function Yn(t){l.parse(t);let n=N++,e=t.frames.reduce((m,s)=>m+s.duration,0),o={id:n,name:t.name,frames:t.frames,totalDuration:e};return E.animations.set(n,o),E.nameToId.set(t.name,n),n}function R(t){return E.animations.get(t)}function vn(t){let n=E.nameToId.get(t);if(n!==void 0)return E.animations.get(n)}function $(t){return E.nameToId.get(t)}function Bn(t){let n=E.animations.get(t);return n?(E.nameToId.delete(n.name),E.animations.delete(t),true):false}var j=(e=>(e[e.FORWARD=1]="FORWARD",e[e.REVERSE=-1]="REVERSE",e))(j||{}),r={animationId:new Uint32Array(W),playing:new Uint8Array(W),loop:new Uint8Array(W),speed:new Float32Array(W),elapsed:new Float32Array(W),currentFrameIndex:new Uint16Array(W),direction:new Int8Array(W)};function z(t){r.animationId[t]=0,r.playing[t]=0,r.loop[t]=1,r.speed[t]=1,r.elapsed[t]=0,r.currentFrameIndex[t]=0,r.direction[t]=1;}function G(t,n,e,o={}){let m=R(e);if(!m||m.frames.length===0)return;i$1(t,n,r)||(h$1(t,n,r),z(n));let{loop:s=true,speed:p=1,direction:l=1,startFrame:b}=o,y=b;y===void 0&&(y=l===1?0:m.frames.length-1),y=Math.max(0,Math.min(y,m.frames.length-1)),r.animationId[n]=e,r.playing[n]=1,r.loop[n]=s?1:0,r.speed[n]=p,r.elapsed[n]=0,r.currentFrameIndex[n]=y,r.direction[n]=l;let d=m.frames[y];return d&&i$1(t,n,f)&&O(t,n,d.frameIndex),n}function On(t,n,e,o={}){let m=$(e);if(m!==void 0)return G(t,n,m,o)}function Rn(t,n){return i$1(t,n,r)&&(r.playing[n]=0,r.elapsed[n]=0,r.currentFrameIndex[n]=0),n}function Mn(t,n){return i$1(t,n,r)&&(r.playing[n]=0),n}function Un(t,n){return i$1(t,n,r)&&(r.playing[n]=1),n}function Ln(t,n){if(i$1(t,n,r))return {animationId:r.animationId[n],playing:r.playing[n]===1,loop:r.loop[n]===1,speed:r.speed[n],elapsed:r.elapsed[n],currentFrameIndex:r.currentFrameIndex[n],direction:r.direction[n]}}function Pn(t,n){return i$1(t,n,r)?r.playing[n]===1:false}function Vn(t,n){return i$1(t,n,r)}function kn(t,n,e){return i$1(t,n,r)&&(r.speed[n]=e),n}function Hn(t,n,e){return i$1(t,n,r)&&(r.loop[n]=e?1:0),n}function Nn(t,n,e){return i$1(t,n,r)&&(r.direction[n]=e),n}function _n(t,n){if(!i$1(t,n,r))return;let e=r.animationId[n];return R(e)}function qn(t,n){return i$1(t,n,r)&&(r.animationId[n]=0,r.playing[n]=0,r.loop[n]=1,r.speed[n]=1,r.elapsed[n]=0,r.currentFrameIndex[n]=0,r.direction[n]=1),n}function J(t,n,e,o){return n>=e?o?(r.currentFrameIndex[t]=0,false):(r.playing[t]=0,r.currentFrameIndex[t]=e-1,true):(r.currentFrameIndex[t]=n,false)}function Q(t,n,e,o){return n<0?o?(r.currentFrameIndex[t]=e-1,false):(r.playing[t]=0,r.currentFrameIndex[t]=0,true):(r.currentFrameIndex[t]=n,false)}function Z(t,n,e){let o=r.currentFrameIndex[n],m=e[o];m&&i$1(t,n,f)&&O(t,n,m.frameIndex);}function Kn(t,n,e){if(!i$1(t,n,r)||r.playing[n]!==1)return false;let o=r.animationId[n],m=R(o);if(!m||m.frames.length===0)return false;let s=r.speed[n],p=r.direction[n],l=r.loop[n]===1,b=r.elapsed[n]+e*s;r.elapsed[n]=b;let y=r.currentFrameIndex[n],d=m.frames[y];if(!d||b<d.duration)return false;r.elapsed[n]=b-d.duration;let I=y+p,A=p===1?J(n,I,m.frames.length,l):Q(n,I,m.frames.length,l);return A||Z(t,n,m.frames),A}n();var g=1e4,nn=(e=>(e[e.BOX=0]="BOX",e[e.CIRCLE=1]="CIRCLE",e))(nn||{}),i={type:new Uint8Array(g),width:new Float32Array(g),height:new Float32Array(g),offsetX:new Float32Array(g),offsetY:new Float32Array(g),layer:new Uint16Array(g),mask:new Uint16Array(g),isTrigger:new Uint8Array(g)},tn=1,en=65535;function v(t){i.type[t]=0,i.width[t]=1,i.height[t]=1,i.offsetX[t]=0,i.offsetY[t]=0,i.layer[t]=tn,i.mask[t]=en,i.isTrigger[t]=0;}function zn(t,n,e={}){return i$1(t,n,i)||(h$1(t,n,i),v(n)),e.type!==void 0&&(i.type[n]=e.type),e.width!==void 0&&(i.width[n]=e.width),e.height!==void 0&&(i.height[n]=e.height),e.offsetX!==void 0&&(i.offsetX[n]=e.offsetX),e.offsetY!==void 0&&(i.offsetY[n]=e.offsetY),e.layer!==void 0&&(i.layer[n]=e.layer),e.mask!==void 0&&(i.mask[n]=e.mask),e.isTrigger!==void 0&&(i.isTrigger[n]=e.isTrigger?1:0),n}function Gn(t,n){if(i$1(t,n,i))return {type:i.type[n],width:i.width[n],height:i.height[n],offsetX:i.offsetX[n],offsetY:i.offsetY[n],layer:i.layer[n],mask:i.mask[n],isTrigger:i.isTrigger[n]===1}}function Jn(t,n){return i$1(t,n,i)}function Qn(t,n){return i$1(t,n,i)&&j$1(t,n,i),n}function Zn(t,n,e){return i$1(t,n,i)||(h$1(t,n,i),v(n)),i.layer[n]=e,n}function nt(t,n,e){return i$1(t,n,i)||(h$1(t,n,i),v(n)),i.mask[n]=e,n}function tt(t,n,e){return i$1(t,n,i)||(h$1(t,n,i),v(n)),i.isTrigger[n]=e?1:0,n}function et(t,n){return i$1(t,n,i)?i.isTrigger[n]===1:false}function rt(t,n,e,o){return (n&e)!==0&&(o&t)!==0}function Y(t,n,e){let o=i.type[t],m=i.width[t],s=i.height[t],p=i.offsetX[t],l=i.offsetY[t],b=n+p,y=e+l;if(o===1){let A=m/2;return {minX:b-A,minY:y-A,maxX:b+A,maxY:y+A}}let d=m/2,I=s/2;return {minX:b-d,minY:y-I,maxX:b+d,maxY:y+I}}function rn(t,n){return t.minX<n.maxX&&t.maxX>n.minX&&t.minY<n.maxY&&t.maxY>n.minY}function on(t,n,e,o,m,s){let p=o-t,l=m-n,b=p*p+l*l,y=e+s;return b<y*y}function _(t,n,e,o){let m=Math.max(o.minX,Math.min(t,o.maxX)),s=Math.max(o.minY,Math.min(n,o.maxY)),p=t-m,l=n-s;return p*p+l*l<e*e}function ot(t,n,e,o,m,s){let p=i.type[t],l=i.type[o],b=i.offsetX[t],y=i.offsetY[t],d=i.offsetX[o],I=i.offsetY[o],A=n+b,M=e+y,U=m+d,L=s+I;if(p===1&&l===1){let S=i.width[t]/2,C=i.width[o]/2;return on(A,M,S,U,L,C)}if(p===0&&l===0){let S=Y(t,n,e),C=Y(o,m,s);return rn(S,C)}if(p===1&&l===0){let S=i.width[t]/2,C=Y(o,m,s);return _(A,M,S,C)}if(p===0&&l===1){let S=Y(t,n,e),C=i.width[o]/2;return _(U,L,C,S)}return false}function at(t,n,e){return t<n?{entityA:t,entityB:n,isTrigger:e}:{entityA:n,entityB:t,isTrigger:e}}function it(t){return `${t.entityA}:${t.entityB}`}n();var D=1e4,a={x:new Float32Array(D),y:new Float32Array(D),maxSpeed:new Float32Array(D),friction:new Float32Array(D)};function w(t){a.x[t]=0,a.y[t]=0,a.maxSpeed[t]=0,a.friction[t]=0;}function st(t,n,e,o){return i$1(t,n,a)||(h$1(t,n,a),w(n)),a.x[n]=e,a.y[n]=o,n}function yt(t,n,e){return i$1(t,n,a)||(h$1(t,n,a),w(n)),e.x!==void 0&&(a.x[n]=e.x),e.y!==void 0&&(a.y[n]=e.y),e.maxSpeed!==void 0&&(a.maxSpeed[n]=e.maxSpeed),e.friction!==void 0&&(a.friction[n]=e.friction),n}function ct(t,n){if(i$1(t,n,a))return {x:a.x[n],y:a.y[n],maxSpeed:a.maxSpeed[n],friction:a.friction[n]}}function an(t,n){return i$1(t,n,a)}function lt(t,n,e){return i$1(t,n,a)||(h$1(t,n,a),w(n)),a.maxSpeed[n]=e,n}function pt(t,n,e){return i$1(t,n,a)||(h$1(t,n,a),w(n)),a.friction[n]=Math.max(0,Math.min(1,e)),n}function xt(t,n,e,o){return i$1(t,n,a)||(h$1(t,n,a),w(n)),a.x[n]=a.x[n]+e,a.y[n]=a.y[n]+o,n}function bt(t,n){if(!i$1(t,n,a))return 0;let e=a.x[n],o=a.y[n];return Math.sqrt(e*e+o*o)}function dt(t,n){return i$1(t,n,a)&&(a.x[n]=0,a.y[n]=0),n}function ht(t,n){return i$1(t,n,a)&&(a.x[n]=0,a.y[n]=0,a.maxSpeed[n]=0,a.friction[n]=0),n}var c={x:new Float32Array(D),y:new Float32Array(D)};function un(t){c.x[t]=0,c.y[t]=0;}function Et(t,n,e,o){return i$1(t,n,c)||(h$1(t,n,c),un(n)),c.x[n]=e,c.y[n]=o,n}function At(t,n){if(i$1(t,n,c))return {x:c.x[n],y:c.y[n]}}function mn(t,n){return i$1(t,n,c)}function gt(t,n){return i$1(t,n,c)&&(c.x[n]=0,c.y[n]=0),n}function It(t,n){return i$1(t,n,c)&&(c.x[n]=0,c.y[n]=0),n}function fn(t,n){c.x[t]===void 0||a.x[t]===void 0||(a.x[t]=a.x[t]+c.x[t]*n,a.y[t]=a.y[t]+c.y[t]*n);}function sn(t,n){let e=a.friction[t];if(e<=0)return;let o=1-e*n;if(o<=0){a.x[t]=0,a.y[t]=0;return}a.x[t]=a.x[t]*o,a.y[t]=a.y[t]*o;}function yn(t){let n=a.maxSpeed[t];if(n<=0)return;let e=a.x[t],o=a.y[t],m=Math.sqrt(e*e+o*o);if(m>n){let s=n/m;a.x[t]=e*s,a.y[t]=o*s;}}function cn(t,n){T$1.x[t]===void 0||a.x[t]===void 0||(T$1.x[t]=T$1.x[t]+a.x[t]*n,T$1.y[t]=T$1.y[t]+a.y[t]*n);}function St(t,n,e){an(t,n)&&(mn(t,n)&&fn(n,e),sn(n,e),yn(n),Y$1(t,n)&&cn(n,e));}export{rt as $,r as A,yn as Aa,G as B,cn as Ba,On as C,St as Ca,Rn as D,Mn as E,Un as F,Ln as G,Pn as H,Vn as I,kn as J,Hn as K,Nn as L,_n as M,qn as N,Kn as O,nn as P,i as Q,tn as R,en as S,zn as T,Gn as U,Jn as V,Qn as W,Zn as X,nt as Y,tt as Z,et as _,h as a,Y as aa,pn as b,rn as ba,xn as c,on as ca,B as d,_ as da,bn as e,ot as ea,q as f,at as fa,dn as g,it as ga,f as h,a as ha,K as i,st as ia,hn as j,yt as ja,En as k,ct as ka,An as l,an as la,O as m,lt as ma,gn as n,pt as na,In as o,xt as oa,Sn as p,bt as pa,Cn as q,dt as qa,Wn as r,ht as ra,E as s,c as sa,Xn as t,Et as ta,Yn as u,At as ua,R as v,mn as va,vn as w,gt as wa,$ as x,It as xa,Bn as y,fn as ya,j as z,sn as za};
|
package/dist/chunk-YY6RZCZH.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import {l}from'./chunk-OFRWGW2G.js';import {c as c$1,a as a$1}from'./chunk-FNQRUMFD.js';import {m}from'./chunk-RJULLVTH.js';import {a}from'./chunk-5N3O25O7.js';import {f as f$1,v,d as d$2}from'./chunk-LI4Y7TBZ.js';import {e,k as k$4,a as a$2,f as f$5,g as g$3,h as h$2}from'./chunk-6XWY6GB7.js';import {v as v$2,c as c$3,i as i$1}from'./chunk-DQTVJITR.js';import {u,o,k,p as p$1}from'./chunk-ZPGJCHXH.js';import {d,l as l$1,f as f$3}from'./chunk-735KKTP3.js';import {k as k$2,c as c$2,f as f$2}from'./chunk-APKUNIMB.js';import {b,f as f$4}from'./chunk-NPDPBAW6.js';import {W,V,U as U$1,g as g$1,n as n$1,v as v$1,Y,o as o$1,k as k$1,T,s,r,oa as oa$1,ka as ka$1,e as e$2,j as j$1,ta as ta$1,ia as ia$1,x,t}from'./chunk-GJ3RS2VG.js';import {n,c,i,e as e$1,k as k$3,g as g$2,a as a$3,d as d$1,h as h$1}from'./chunk-P3ZLIQJP.js';import {z as z$1}from'zod';function pt(e){if(!d$2(e))return {width:80,height:24};let t=f$1(e);return !t||!k$1(e,t)?{width:80,height:24}:{width:e$2.width[t],height:e$2.height[t]}}function un(e,t,n){W(e,t,true);let o=V(e,t)?.y??0;return U$1(e,t,n,o),t}function fn(e,t,n){let r=pt(e),i=g$1(e,t)?.width??0;W(e,t,true);let a=r.width-n-i,l=V(e,t)?.y??0;return U$1(e,t,a,l),t}function dn(e,t,n){W(e,t,true);let o=V(e,t)?.x??0;return U$1(e,t,o,n),t}function pn(e,t,n){let r=pt(e),i=g$1(e,t)?.height??0;W(e,t,true);let a=r.height-n-i,l=V(e,t)?.x??0;return U$1(e,t,l,a),t}function br(e,t,n){let{left:r,right:o,top:i,bottom:a}=n;return W(e,t,true),r!==void 0?un(e,t,r):o!==void 0&&fn(e,t,o),i!==void 0?dn(e,t,i):a!==void 0&&pn(e,t,a),t}function hr(e,t){let n=V(e,t);if(!n||!n.absolute)return;let r=g$1(e,t),o=r?.width??0,i=r?.height??0,a=pt(e),s=n.x,l=a.width-s-o,c=n.y,m=a.height-c-i;return {left:s,right:l,top:c,bottom:m}}u();function yn(e){let t=f$1(e);return t?v(e,t):false}function yt(e,t){let n={left:0,top:0,right:0,bottom:0};return !yn(e)||!o(e,t)||k.type[t]===0?n:{left:k.left[t]===1?1:0,top:k.top[t]===1?1:0,right:k.right[t]===1?1:0,bottom:k.bottom[t]===1?1:0}}function mn(e$1,t){let n=e(e$1,t),r=n?.left??0,o=n?.top??0,i=n?.right??0,a=n?.bottom??0,s=yt(e$1,t),l=r+s.left,c=o+s.top,m=i+s.right,I=a+s.bottom;return {left:l,top:c,right:m,bottom:I,horizontal:l+m,vertical:c+I}}function xr(e,t){let n=mn(e,t);return n.left+n.top+n.right+n.bottom}function vr(e,t){let n=yt(e,t);return n.left>0||n.top>0||n.right>0||n.bottom>0}var mt={teeRight:9500,teeLeft:9508,teeDown:9516,teeUp:9524,cross:9532,horizontal:9472,vertical:9474},gn={teeRight:9568,teeLeft:9571,teeDown:9574,teeUp:9577,cross:9580,horizontal:9552,vertical:9553},bn={teeRight:9507,teeLeft:9515,teeDown:9523,teeUp:9531,cross:9547,horizontal:9473,vertical:9475},hn={teeRight:43,teeLeft:43,teeDown:43,teeUp:43,cross:43,horizontal:45,vertical:124};function Cr(e,t,n={}){return {width:e,height:t,edges:new Map,enabled:n.enabled??true}}function Sr(e){e.edges.clear();}function Dr(e,t,n){return {...e,width:t,height:n}}function ne(e,t){return `${e},${t}`}function En(e){let[t,n]=e.split(",");return {x:Number.parseInt(t??"0",10),y:Number.parseInt(n??"0",10)}}function gt(e){return e===9472||e===9474||e===9484||e===9488||e===9492||e===9496||e===9500||e===9508||e===9516||e===9524||e===9532?"single":e===9552||e===9553||e===9556||e===9559||e===9562||e===9565||e===9568||e===9571||e===9574||e===9577||e===9580?"double":e===9473||e===9475||e===9487||e===9491||e===9495||e===9499||e===9507||e===9515||e===9523||e===9531||e===9547?"bold":e===45||e===124||e===43?"ascii":"unknown"}function bt(e){switch(e){case "single":return mt;case "double":return gn;case "bold":return bn;case "ascii":return hn;default:return mt}}function L(e,t,n,r,o,i,a){let s=ne(t,n),l={x:t,y:n,type:r,char:o,fg:i,bg:a,style:gt(o)},c=e.edges.get(s);c?c.push(l):e.edges.set(s,[l]);}function Pr(e,t,n,r,o,i,a,s,l){for(let c=1;c<r-1;c++)L(e,t+c,n,"h",i,s,l);for(let c=1;c<r-1;c++)L(e,t+c,n+o-1,"h",i,s,l);for(let c=1;c<o-1;c++)L(e,t,n+c,"v",a,s,l);for(let c=1;c<o-1;c++)L(e,t+r-1,n+c,"v",a,s,l);L(e,t,n,"c",0,s,l),L(e,t+r-1,n,"c",0,s,l),L(e,t,n+o-1,"c",0,s,l),L(e,t+r-1,n+o-1,"c",0,s,l);}function ht(e,t,n){let r=e.edges.get(ne(t-1,n)),o=e.edges.get(ne(t+1,n)),i=e.edges.get(ne(t,n-1)),a=e.edges.get(ne(t,n+1));return {left:r?.some(s=>s.type==="h"||s.type==="c")??false,right:o?.some(s=>s.type==="h"||s.type==="c")??false,top:i?.some(s=>s.type==="v"||s.type==="c")??false,bottom:a?.some(s=>s.type==="v"||s.type==="c")??false}}function Et(e,t){let{left:n,top:r,right:o,bottom:i}=e;return (n?1:0)+(r?1:0)+(o?1:0)+(i?1:0)<3?null:n&&r&&o&&i?t.cross:n&&r&&i?t.teeLeft:o&&r&&i?t.teeRight:n&&o&&i?t.teeDown:n&&o&&r?t.teeUp:null}function Ir(e){if(!e.enabled)return [];let t=[],n=new Set;for(let[r,o]of e.edges){if(n.has(r)||(n.add(r),o.length<2))continue;let{x:i,y:a}=En(r),s=ht(e,i,a),l=o[0];if(!l)continue;let c=bt(l.style),m=Et(s,c);m!==null&&t.push({x:i,y:a,char:m,fg:l.fg,bg:l.bg});}return t}function Ar(e,t){let n=t.some(o=>o.type==="h"),r=t.some(o=>o.type==="v");return {left:e.left||n,right:e.right||n,top:e.top||r,bottom:e.bottom||r}}function Rr(e,t,n,r){if(!e.some(l=>l.type==="c")||e.length<=1)return null;let i=e[0];if(!i)return null;let a=bt(i.style),s=Et(t,a);return s===null?null:{x:n,y:r,char:s,fg:i.fg,bg:i.bg}}function Tr(e){if(!e.enabled)return [];let t=[],n=new Set;for(let[r,o]of e.edges){if(n.has(r))continue;n.add(r);let{x:i,y:a}=En(r),s=ht(e,i,a),l=Ar(s,o),c=Rr(o,l,i,a);c&&t.push(c);}return t}function kr(e,t){for(let n of t)n.x>=0&&n.x<e.width&&n.y>=0&&n.y<e.height&&e.setCell(n.x,n.y,{char:String.fromCodePoint(n.char),fg:n.fg,bg:n.bg});}function Wr(e){return e.map(t=>({x:t.x,y:t.y,char:String.fromCodePoint(t.char),fg:t.fg,bg:t.bg}))}function Br(e){return gt(e)!=="unknown"}function Mr(e){return e>=9500&&e<=9532||e>=9568&&e<=9580||e>=9507&&e<=9547||e===43}function Or(e){return e.edges.size}function Lr(e,t,n){return e.edges.get(ne(t,n))??[]}u();n();var Ne=1e4,K={HIDDEN:0,VISIBLE:1,SCROLL:2},g={overflow:new Uint8Array(Ne),overflowX:new Uint8Array(Ne),overflowY:new Uint8Array(Ne),hasIndependentOverflow:new Uint8Array(Ne)};function wr(e,t){i(e,t,g)||(h$1(e,t,g),g.overflow[t]=K.HIDDEN,g.overflowX[t]=K.HIDDEN,g.overflowY[t]=K.HIDDEN,g.hasIndependentOverflow[t]=0);}function zr(e,t){return i(e,t,g)}function Nr(e,t,n){return wr(e,t),typeof n=="number"?(g.overflow[t]=n,g.overflowX[t]=n,g.overflowY[t]=n,g.hasIndependentOverflow[t]=0):(n.overflow!==void 0&&(g.overflow[t]=n.overflow,g.overflowX[t]=n.overflow,g.overflowY[t]=n.overflow),n.overflowX!==void 0&&(g.overflowX[t]=n.overflowX,g.hasIndependentOverflow[t]=1),n.overflowY!==void 0&&(g.overflowY[t]=n.overflowY,g.hasIndependentOverflow[t]=1)),t}function Fe(e,t){return i(e,t,g)?g.overflow[t]:K.HIDDEN}function Fr(e,t){if(i(e,t,g))return {overflow:g.overflow[t],overflowX:g.overflowX[t],overflowY:g.overflowY[t]}}function _r(e,t,n,r){return {x1:e,y1:t,x2:e+n,y2:t+r}}function Ce(){return {x1:-1/0,y1:-1/0,x2:1/0,y2:1/0}}function Kr(e){return e.x1>=e.x2||e.y1>=e.y2}function Ur(e,t,n){return t>=e.x1&&t<e.x2&&n>=e.y1&&n<e.y2}function Hr(e,t,n,r,o){return t<e.x2&&t+r>e.x1&&n<e.y2&&n+o>e.y1}function _e(e,t){return {x1:Math.max(e.x1,t.x1),y1:Math.max(e.y1,t.y1),x2:Math.min(e.x2,t.x2),y2:Math.min(e.y2,t.y2)}}function Vr(e,t,n){return {x:Math.max(e.x1,Math.min(e.x2-1,t)),y:Math.max(e.y1,Math.min(e.y2-1,n))}}function Zr(e){return e.x2-e.x1}function Jr(e){return e.y2-e.y1}function Yr(e,t){return p$1(e,t)?{top:k.top[t]===1?1:0,right:k.right[t]===1?1:0,bottom:k.bottom[t]===1?1:0,left:k.left[t]===1?1:0}:{top:0,right:0,bottom:0,left:0}}function xn(e,t){if(!c$1(e,t))return null;let n=a$1.x[t],r=a$1.y[t],o=a$1.width[t],i=a$1.height[t],a=Yr(e,t);return {x1:n+a.left,y1:r+a.top,x2:n+o-a.right,y2:r+i-a.bottom}}function $r(e,t){let n=Ce(),r=t;for(;r!==n$1;){if(Fe(e,r)!==K.VISIBLE){let a=xn(e,r);a&&(n=_e(n,a));}r=v$1(e,r)??n$1;}return n}function Gr(e,t,n){let r=Ce(),o=t;for(;o!==n$1&&o!==n;){if(Fe(e,o)!==K.VISIBLE){let s=xn(e,o);s&&(r=_e(r,s));}o=v$1(e,o)??n$1;}return r}function Xr(e,t){return Fe(e,t)!==K.VISIBLE}function qr(){return {stack:[],current:Ce()}}function jr(e,t){let n=[...e.stack,e.current],r=_e(e.current,t);return {stack:n,current:r}}function Qr(e){if(e.stack.length===0)return e;let t=e.stack.slice(0,-1),n=e.stack[e.stack.length-1];return {stack:t,current:n??Ce()}}function eo(e){return e.current}u();n();function xt(e,t){return o(e,t)?k.type[t]===0?0:1:0}function vt(e,t){if(!k$1(e,t))return {width:0,height:0};let n=g$1(e,t);return {width:n?.width??0,height:n?.height??0}}function to(e$1,t){let n=xt(e$1,t),r=n,o=e(e$1,t);return o&&(n+=o.left,r+=o.top),{x:n,y:r}}function vn(e,t){let n=0,r=0;if(!i(e,t,o$1))return {x:n,y:r};let o=v$1(e,t);for(;o!==n$1;){if(!Y(e,o)){o=v$1(e,o);continue}let i=V(e,o);if(!i){o=v$1(e,o);continue}n+=i.x,r+=i.y;let a=to(e,o);if(n+=a.x,r+=a.y,i.absolute)break;o=v$1(e,o);}return {x:n,y:r}}function Ke(e,t){if(!Y(e,t))return;let n=V(e,t);if(!n)return;let r=vt(e,t);if(n.absolute)return {left:n.x,top:n.y,right:n.x+r.width-1,bottom:n.y+r.height-1};let o=vn(e,t),i=n.x+o.x,a=n.y+o.y;return {left:i,top:a,right:i+r.width-1,bottom:a+r.height-1}}function Cn(e,t){if(!Y(e,t))return;let n=V(e,t);if(!n)return;let r=vt(e,t),o=0,i$1=0;if(i(e,t,o$1)){let a=v$1(e,t);if(a!==n$1){let s=Ue(e,a);s&&(o=s.width,i$1=s.height);}}return {left:n.x,top:n.y,right:Math.max(0,o-n.x-r.width),bottom:Math.max(0,i$1-n.y-r.height)}}function Ct(e$1,t){let n=Ke(e$1,t);if(!n)return;let r=xt(e$1,t),o=e(e$1,t),i=o?.left??0,a=o?.top??0,s=o?.right??0,l=o?.bottom??0;return {left:n.left+r+i,top:n.top+r+a,right:n.right-r-s,bottom:n.bottom-r-l}}function Ue(e$1,t){if(!k$1(e$1,t))return;let n=g$1(e$1,t);if(!n)return;let r=xt(e$1,t),o=e(e$1,t),i=(o?.left??0)+(o?.right??0),a=(o?.top??0)+(o?.bottom??0);return {width:Math.max(0,n.width-r*2-i),height:Math.max(0,n.height-r*2-a)}}function Sn(e$1,t){let n=e(e$1,t),r=n?.left??0,o=n?.right??0,i=n?.top??0,a=n?.bottom??0;return {horizontal:r+o,vertical:i+a,total:r+o+i+a}}function no(e,t,n,r){let o=vn(e,t),i=n-o.x,a=r-o.y;return T.x[t]=i,T.y[t]=a,t}function ro(e,t,n){let r=vt(e,t),o=0,i$1=0;if(i(e,t,o$1)){let l=v$1(e,t);if(l!==n$1){let c=Ue(e,l);c&&(o=c.width,i$1=c.height);}}let a;n.left!==void 0?a=n.left:n.right!==void 0?a=o-r.width-n.right:a=T.x[t];let s;return n.top!==void 0?s=n.top:n.bottom!==void 0?s=i$1-r.height-n.bottom:s=T.y[t],T.x[t]=a,T.y[t]=s,t}function oo(e,t){let n=Ke(e,t);if(!n)return;let r=Cn(e,t);if(!r)return;let o=Ct(e,t);if(!o)return;let i=Ue(e,t)??{width:0,height:0},a=Sn(e,t);return {absolute:n,relative:r,inner:o,innerDimensions:i,totalPadding:a}}function St(e,t,n,r){let o=Ke(e,t);return o?n>=o.left&&n<=o.right&&r>=o.top&&r<=o.bottom:false}function io(e,t,n,r){let o=Ct(e,t);return o?n>=o.left&&n<=o.right&&r>=o.top&&r<=o.bottom:false}function Pn(e,t){let n=e*t,r=Math.ceil(n/8);return {width:e,height:t,dirtyCells:new Uint8Array(r),dirtyEntities:new Set,entityBounds:m({iterable:true}),dirtyRegions:[],regionsStale:true,forceFullRedraw:true,frameCount:0}}function ao(e,t,n){let r=Pn(t,n);return e.entityBounds.forEach((o,i)=>{o.prevX<t&&o.prevY<n&&r.entityBounds.set(i,{...o});}),r.forceFullRedraw=true,r}function so(e,t,n){if(t<0||t>=e.width||n<0||n>=e.height)return;let r=n*e.width+t,o=r>>3,i=r&7,a=e.dirtyCells[o];a!==void 0&&(e.dirtyCells[o]=a|1<<i),e.regionsStale=true;}function lo(e,t,n){if(t<0||t>=e.width||n<0||n>=e.height)return false;let r=n*e.width+t,o=r>>3,i=r&7,a=e.dirtyCells[o];return a===void 0?false:(a&1<<i)!==0}function He(e,t,n,r,o){let i=Math.max(0,Math.floor(t)),a=Math.max(0,Math.floor(n)),s=Math.min(e.width,Math.floor(t+r)),l=Math.min(e.height,Math.floor(n+o));if(!(s<=i||l<=a)){for(let c=a;c<l;c++)for(let m=i;m<s;m++){let I=c*e.width+m,V=I>>3,Te=I&7,ke=e.dirtyCells[V];ke!==void 0&&(e.dirtyCells[V]=ke|1<<Te);}e.regionsStale=true;}}function In(e,t,n){if(e.dirtyEntities.add(n),!c$1(t,n))return;let r=a$1.x[n],o=a$1.y[n],i=a$1.width[n],a=a$1.height[n],s=e.entityBounds.get(n);s&&(s.prevX!==r||s.prevY!==o||s.prevWidth!==i||s.prevHeight!==a)&&He(e,s.prevX,s.prevY,s.prevWidth,s.prevHeight),He(e,r,o,i,a),e.regionsStale=true;}function co(e,t,n,r){if(!c$1(t,n)){e.entityBounds.delete(n);return}let o={prevX:a$1.x[n],prevY:a$1.y[n],prevWidth:a$1.width[n],prevHeight:a$1.height[n],wasVisible:r};e.entityBounds.set(n,o);}function uo(e,t){let n=e.entityBounds.get(t);n?.wasVisible&&He(e,n.prevX,n.prevY,n.prevWidth,n.prevHeight),e.dirtyEntities.delete(t),e.entityBounds.delete(t);}function fo(e,t){return e.dirtyEntities.has(t)}function Ve(e,t,n){let r=t*n+e;return {byteIndex:r>>3,bitIndex:r&7}}function Dn(e,t,n){let r=e[t];if(r!==void 0)return (r&1<<n)!==0}function po(e,t,n){let r=e[t];r!==void 0&&(e[t]=r|1<<n);}function Dt(e,t,n,r){let o=Dn(e,n,r),i=Dn(t,n,r);return o===void 0||i===void 0?false:o&&!i}function yo(e){if(e.forceFullRedraw)return [{x:0,y:0,width:e.width,height:e.height}];let t=[],n=new Uint8Array(e.dirtyCells.length);for(let r=0;r<e.height;r++)for(let o=0;o<e.width;o++){let{byteIndex:i,bitIndex:a}=Ve(o,r,e.width);if(Dt(e.dirtyCells,n,i,a)){let s=ho(e,n,o,r);s.width>0&&s.height>0&&t.push(s);}}return xo(t)}function mo(e,t,n,r,o,i){let a=n;for(;a<i;){let{byteIndex:s,bitIndex:l}=Ve(a,r,o);if(!Dt(e,t,s,l))break;a++;}return a}function go(e,t,n,r,o,i){for(let a=n;a<r;a++){let{byteIndex:s,bitIndex:l}=Ve(a,o,i);if(!Dt(e,t,s,l))return false}return true}function bo(e,t,n,r,o,i){for(let a=n;a<o;a++)for(let s=t;s<r;s++){let{byteIndex:l,bitIndex:c}=Ve(s,a,i);po(e,l,c);}}function ho(e,t,n,r){let o=mo(e.dirtyCells,t,n,r,e.width,e.width),i=o-n;if(i===0)return {x:n,y:r,width:0,height:0};let a=r;for(;a<e.height&&go(e.dirtyCells,t,n,o,a,e.width);)a++;return bo(t,n,r,o,a,e.width),{x:n,y:r,width:i,height:a-r}}function Eo(e,t,n,r){let o=e,i=false;for(let a=r;a<t.length;a++){if(n.has(a))continue;let s=t[a];s&&vo(o,s)&&(o=Co(o,s),n.add(a),i=true);}return {merged:o,didMerge:i}}function xo(e){if(e.length<2)return e;let t=[...e].sort((o,i)=>i.width*i.height-o.width*o.height),n=[],r=new Set;for(let o=0;o<t.length;o++){if(r.has(o))continue;let i=t[o];if(!i)continue;r.add(o);let a=true;for(;a;){let s=Eo(i,t,r,o+1);i=s.merged,a=s.didMerge;}n.push(i);}return n}function vo(e,t){let n=e.x+e.width,r=e.y+e.height,o=t.x+t.width,i=t.y+t.height;return !(t.x>n+1||o<e.x-1||t.y>r+1||i<e.y-1)}function Co(e,t){let n=Math.min(e.x,t.x),r=Math.min(e.y,t.y),o=Math.max(e.x+e.width,t.x+t.width),i=Math.max(e.y+e.height,t.y+t.height);return {x:n,y:r,width:o-n,height:i-r}}function Ze(e){return e.regionsStale&&(e.dirtyRegions.length=0,e.dirtyRegions.push(...yo(e)),e.regionsStale=false),e.dirtyRegions}function So(e){return e.forceFullRedraw?true:e.dirtyEntities.size>0}function Do(e){return e.forceFullRedraw}function Po(e){return e.dirtyEntities}function Io(e){let t=Ze(e),n=e.width*e.height,r=0;for(let o of t)r+=o.width*o.height;return {dirtyEntityCount:e.dirtyEntities.size,dirtyRegionCount:t.length,dirtyArea:r,dirtyPercent:n>0?r/n*100:0,fullRedraw:e.forceFullRedraw,trackedEntityCount:e.entityBounds.size}}function Ao(e){e.dirtyCells.fill(0),e.dirtyEntities.clear(),e.dirtyRegions.length=0,e.regionsStale=true,e.forceFullRedraw=false,e.frameCount++;}function Ro(e){e.forceFullRedraw=true,e.regionsStale=true;}function To(e,t){e.entityBounds.forEach((n,r)=>{In(e,t,r);});}function ko(e,t,n,r,o){if(e.forceFullRedraw)return true;let i=Ze(e);for(let a of i)if(t<a.x+a.width&&t+r>a.x&&n<a.y+a.height&&n+o>a.y)return true;return false}function Wo(e,t,n,r,o){let i=Ze(e),a=[];for(let s of i){let l=Math.max(s.x,t),c=Math.max(s.y,n),m=Math.min(s.x+s.width,t+r),I=Math.min(s.y+s.height,n+o);m>l&&I>c&&a.push({x:l,y:c,width:m-l,height:I-c});}return a}n();var Je=new Map;function w(e,t){let n=Je.get(e);return n||(n=t(),Je.set(e,n)),n}function Pt(e){Je.delete(e);}function Bo(){Je.clear();}function Mo(e,t,n,r){e.emit("reparent",{entity:t,oldParent:n,newParent:r});}function Oo(e,t,n){e.emit("adopt",{parent:t,child:n});}function Lo(e,t,n){e.emit("attach",{entity:t,screen:n});}function wo(e,t,n){e.emit("detach",{entity:t,screen:n});}function zo(e,t,n){e.emit("remove",{parent:t,child:n});}function It(e,t){e.emit("destroy",{entity:t});}function No(e,t,n){return w(e,n).on("reparent",t)}function Fo(e,t,n){return w(e,n).on("adopt",t)}function _o(e,t,n){return w(e,n).on("attach",t)}function Ko(e,t,n){return w(e,n).on("detach",t)}function Uo(e,t,n){return w(e,n).on("remove",t)}function Ho(e,t,n){return w(e,n).on("destroy",t)}var z=new Set,At=new WeakMap,re=[];function Ye(e){let t=At.get(e);return t||(t=new Set,At.set(e,t)),t}function Vo(e){return re.push(e),()=>{let t=re.indexOf(e);t!==-1&&re.splice(t,1);}}function An(){re.length=0;}function Rn(e,t,n={}){let{immediate:r=false,destroyChildren:o=true,emitEvent:i$1=true}=n;if(r)Rt(e,t,o,i$1);else {let a=Ye(e);if(a.add(t),z.add(t),o&&i(e,t,o$1)){let s$1=s(e,t);for(let l of s$1)a.add(l),z.add(l);}}}function Zo(e,t,n={}){if(!i(e,t,o$1))return;let r=s(e,t);for(let o of r)Rn(e,o,n);}function Jo(e){return z.has(e)}function Yo(e){let t=Ye(e),n=t.size;if(n===0)return 0;let r=Array.from(t);r.sort((o,i$1)=>{let a=i(e,o,o$1)?o$1.depth[o]??0:0;return (i(e,i$1,o$1)?o$1.depth[i$1]??0:0)-a});for(let o of r)z.has(o)&&Rt(e,o,false,true);return t.clear(),n}function Rt(e,t,n,r$1){if(z.delete(t),r$1)try{let o=w(t,()=>l());It(o,t);}catch{}if(n&&i(e,t,o$1)){let o=s(e,t);for(let i of o)Rt(e,i,true,r$1);}if(i(e,t,o$1)){let o=v$1(e,t);o!==n$1&&r(e,o,t);}for(let o of re)try{o(e,t);}catch{}Pt(t);try{e$1(e,t);}catch{}}function $o(e){Ye(e).clear(),z.clear(),An();}function Go(e){return e?At.get(e)?.size??0:z.size}function Xo(e){let t=Ye(e);for(let n of t)z.delete(n);t.clear();}function qo(){z.clear(),re.length=0;}n();var S=new Map;function oe(e,t,n){return typeof n=="function"?n(e,t):n}function ie(e,t,n){let r={};return n.fg!==void 0&&(r.fg=oe(e,t,n.fg)),n.bg!==void 0&&(r.bg=oe(e,t,n.bg)),n.bold!==void 0&&(r.bold=oe(e,t,n.bold)),n.underline!==void 0&&(r.underline=oe(e,t,n.underline)),n.blink!==void 0&&(r.blink=oe(e,t,n.blink)),n.inverse!==void 0&&(r.inverse=oe(e,t,n.inverse)),r}function jo(e,t){return ta$1(e,t)?{fg:ka$1.fg[t],bg:ka$1.bg[t],bold:ka$1.bold[t]===1,underline:ka$1.underline[t]===1,blink:ka$1.blink[t]===1,inverse:ka$1.inverse[t]===1,transparent:ka$1.transparent[t]===1,opacity:ka$1.opacity[t]??1}:{fg:ka$1.fg[t],bg:ka$1.bg[t],bold:false,underline:false,blink:false,inverse:false,transparent:false,opacity:1}}function Se(e,t){let n=S.get(t);return n||(n={original:jo(e,t),focusApplied:false,hoverApplied:false},S.set(t,n)),n}function Qo(e){return S.get(e)}function ei(e){return S.has(e)}function ti(e){S.delete(e);}function ni(){S.clear();}function G(e,t){t.fg!==void 0&&(ka$1.fg[e]=t.fg),t.bg!==void 0&&(ka$1.bg[e]=t.bg),t.bold!==void 0&&(ka$1.bold[e]=t.bold?1:0),t.underline!==void 0&&(ka$1.underline[e]=t.underline?1:0),t.blink!==void 0&&(ka$1.blink[e]=t.blink?1:0),t.inverse!==void 0&&(ka$1.inverse[e]=t.inverse?1:0);}function De(e,t){ka$1.fg[e]=t.fg,ka$1.bg[e]=t.bg,ka$1.bold[e]=t.bold?1:0,ka$1.underline[e]=t.underline?1:0,ka$1.blink[e]=t.blink?1:0,ka$1.inverse[e]=t.inverse?1:0,ka$1.transparent[e]=t.transparent?1:0;}function Tn(e,t){if(!k$2(e,t))return;let n=Se(e,t);if(n.focusApplied)return;let r={},o=c$2.focusEffectFg[t],i=c$2.focusEffectBg[t];(o&4278190080)!==0&&(r.fg=o),(i&4278190080)!==0&&(r.bg=i),G(t,r),n.focusApplied=true,oa$1(e,t);}function kn(e,t){let n=S.get(t);!n||!n.focusApplied||(n.focusApplied=false,n.hoverApplied?ri(e,t,n):(De(t,n.original),S.delete(t)),oa$1(e,t));}function $e(e){return S.get(e)?.focusApplied??false}function ri(e,t,n){if(!v$2(e,t))return;De(t,n.original);let r={},o=c$3.hoverEffectFg[t],i=c$3.hoverEffectBg[t];(o&4278190080)!==0&&(r.fg=o),(i&4278190080)!==0&&(r.bg=i),G(t,r);}function Wn(e,t){if(!v$2(e,t))return;let n=Se(e,t);if(n.hoverApplied)return;let r={},o=c$3.hoverEffectFg[t],i=c$3.hoverEffectBg[t];(o&4278190080)!==0&&(r.fg=o),(i&4278190080)!==0&&(r.bg=i),G(t,r),n.hoverApplied=true,oa$1(e,t);}function Bn(e,t){let n=S.get(t);!n||!n.hoverApplied||(n.hoverApplied=false,n.focusApplied?oi(e,t,n):(De(t,n.original),S.delete(t)),oa$1(e,t));}function oi(e,t,n){if(!k$2(e,t))return;De(t,n.original);let r={},o=c$2.focusEffectFg[t],i=c$2.focusEffectBg[t];(o&4278190080)!==0&&(r.fg=o),(i&4278190080)!==0&&(r.bg=i),G(t,r);}function Ge(e){return S.get(e)?.hoverApplied??false}function ii(e,t,n){Se(e,t);let r=ie(e,t,n);G(t,r),oa$1(e,t);}function Mn(e,t){let n=S.get(t);n&&(De(t,n.original),S.delete(t),oa$1(e,t));}function Xe(e,t){let n=k$2(e,t)&&f$2(e,t),r=v$2(e,t)&&i$1(e,t),o=$e(t),i=Ge(t);n&&!o?Tn(e,t):!n&&o&&kn(e,t),r&&!i?Wn(e,t):!r&&i&&Bn(e,t);}function On(e,t){return {fg:ka$1.fg[t],bg:ka$1.bg[t],bold:ka$1.bold[t]===1,underline:ka$1.underline[t]===1,blink:ka$1.blink[t]===1,inverse:ka$1.inverse[t]===1,transparent:ka$1.transparent[t]===1,opacity:ka$1.opacity[t]??1}}function ai(e,t){let n=S.get(t);return n?n.original:On(e,t)}var X=new Map,N=new Map;function si(e,t,n){if(X.set(t,n),n.focus&&k$2(e,t)){let r=ie(e,t,n.focus);r.fg!==void 0&&(c$2.focusEffectFg[t]=r.fg),r.bg!==void 0&&(c$2.focusEffectBg[t]=r.bg);}if(n.hover&&v$2(e,t)){let r=ie(e,t,n.hover);r.fg!==void 0&&(c$3.hoverEffectFg[t]=r.fg),r.bg!==void 0&&(c$3.hoverEffectBg[t]=r.bg);}Xe(e,t);}function li(e){return X.get(e)}function ci(e,t){X.delete(t),N.delete(t),Mn(e,t);}function Ln(e){let t=N.get(e);return t||(t={pressApplied:false,disabledApplied:false},N.set(e,t)),t}function ui(e,t){let n=X.get(t);if(!n?.press)return;let r=Ln(t);if(r.pressApplied)return;Se(e,t);let o=ie(e,t,n.press);G(t,o),r.pressApplied=true,oa$1(e,t);}function fi(e,t){let n=N.get(t);n?.pressApplied&&(n.pressApplied=false,Xe(e,t));}function di(e,t){let n=X.get(t);if(!n?.disabled)return;let r=Ln(t);if(r.disabledApplied)return;Se(e,t);let o=ie(e,t,n.disabled);G(t,o),r.disabledApplied=true,oa$1(e,t);}function pi(e,t){let n=N.get(t);n?.disabledApplied&&(n.disabledApplied=false,Xe(e,t));}function Tt(e){return N.get(e)?.pressApplied??false}function kt(e){return N.get(e)?.disabledApplied??false}function yi(e){return $e(e)||Ge(e)||Tt(e)||kt(e)}function mi(e){return {focus:$e(e),hover:Ge(e),press:Tt(e),disabled:kt(e)}}function gi(e){S.delete(e),X.delete(e),N.delete(e);}function bi(){X.clear(),N.clear();}n();function hi(e){let{type:t,target:n,payload:r,bubbles:o=true}=e,i={type:t,target:n,currentTarget:n,bubbles:o,defaultPrevented:false,propagationStopped:false,immediatePropagationStopped:false,payload:r,stopPropagation(){i.propagationStopped=true;},stopImmediatePropagation(){i.propagationStopped=true,i.immediatePropagationStopped=true;},preventDefault(){i.defaultPrevented=true;}};return i}function Ei(e,t,n){let r=0,o=t.target;for(;o!==n$1;){t.currentTarget=o;let i$1=n(e,o);if(i$1&&(i$1.emit(t.type,t),r++,t.immediatePropagationStopped)||t.propagationStopped||!t.bubbles||!i(e,o,o$1))break;o=v$1(e,o);}return {defaultPrevented:t.defaultPrevented,propagationStopped:t.propagationStopped,dispatchCount:r}}n();var wn=z$1.object({dispatchCount:z$1.number().int().nonnegative(),maxDepth:z$1.number().int().nonnegative(),circularReferenceDetected:z$1.boolean()}),zn=z$1.object({maxDepth:z$1.number().int().positive().optional(),includeRoot:z$1.boolean().optional()});function xi(e,t,n,r,o,i$1){let a=i$1?zn.parse(i$1):{includeRoot:true,maxDepth:Number.POSITIVE_INFINITY},s=a.maxDepth??Number.POSITIVE_INFINITY,l=a.includeRoot??true,c=new Set,m=0,I=0,V=false;function Te(ye,We){if(We>s)return;if(c.has(ye)){V=true;return}if(c.add(ye),I=Math.max(I,We),We>0||l){let Jt=o(e,ye);Jt&&(Jt.emit(n,r),m++);}if(!i(e,ye,o$1))return;let Be=o$1.firstChild[ye];for(;Be!==n$1;)Te(Be,We+1),Be=o$1.nextSibling[Be];}Te(t,0);let ke={dispatchCount:m,maxDepth:I,circularReferenceDetected:V};return wn.parse(ke)}n();var p={xi:new Float32Array(1e4),xl:new Float32Array(1e4),yi:new Float32Array(1e4),yl:new Float32Array(1e4),base:new Float32Array(1e4),valid:new Uint8Array(1e4)};function vi(e,t,n){p.xi[t]=n.xi,p.xl[t]=n.xl,p.yi[t]=n.yi,p.yl[t]=n.yl,p.base[t]=n.base,p.valid[t]=1;}function Ci(e,t){if(p.valid[t]===1)return {xi:p.xi[t],xl:p.xl[t],yi:p.yi[t],yl:p.yl[t],base:p.base[t]}}function Si(e,t){return p.valid[t]===1}function Di(e,t){p.valid[t]=0;}function Pi(e,t,n){p.valid[t]=0;let r=n(e,t);for(let o of r)p.valid[o]=0;}function Ii(e){p.valid.fill(0);}function Ai(e,t){return p.valid[t]!==1?0:p.xl[t]-p.xi[t]}function Ri(e,t){return p.valid[t]!==1?0:p.yl[t]-p.yi[t]}function Ti(e,t,n){p.valid[t]===1&&(p.base[t]=n);}function Wt(e,t,n,r){if(p.valid[t]!==1)return false;let o=p.xi[t],i=p.xl[t],a=p.yi[t],s=p.yl[t];return n>=o&&n<i&&r>=a&&r<s}u();n();function ki(e){return k$3(e,[T,e$2,ka$1])}function Wi(e){return k$3(e,[c$2])}function ae(e){return k$3(e,[c$3])}function Bi(e){return k$3(e,[k$4])}function Mi(e){return k$3(e,[T,e$2,ka$1,d])}function Oi(e){return k$3(e,[T,e$2,ka$1,k])}function Li(e){return k$3(e,[T,e$2,ka$1,a$2])}function Nn(e){return k$3(e,[o$1])}function wi(e,t){return t.filter(n=>ka$1.visible[n]===1)}function zi(e,t){return t.filter(n=>ka$1.dirty[n]===1)}function Ni(e,t){return t.filter(n=>ka$1.visible[n]===1&&ka$1.dirty[n]===1)}function Fn(e,t){let n=[],r=o$1.firstChild[t];for(;r!==0;)n.push(r),r=o$1.nextSibling[r];return n}function Fi(e,t){let n=[],r=[t];for(;r.length>0;){let o=r.pop(),i=Fn(e,o);for(let a of i)n.push(a),r.push(a);}return n}function _i(e){return Nn(e).filter(n=>o$1.parent[n]===0)}function Ki(e,t){return t.filter(n=>c$2.focusable[n]===1)}function Ui(e,t){return t.filter(n=>c$3.clickable[n]===1)}function Hi(e,t){return [...t].sort((n,r)=>{let o=c$2.tabIndex[n]??0,i=c$2.tabIndex[r]??0;return o===0&&i!==0?1:i===0&&o!==0?-1:o-i})}function Vi(e,t){return [...t].sort((n,r)=>(o$1.depth[n]??0)-(o$1.depth[r]??0))}n();var h=0,qe=2147483647,je=-2147483648,_n=1e4,f={zIndex:new Int32Array(_n),localZ:new Int32Array(_n)};function Zi(e){f.zIndex[e]=h,f.localZ[e]=h;}function j(e,t){i(e,t,f)||(h$1(e,t,f),Zi(t));}function se(e,t){return i(e,t,f)?f.zIndex[t]??h:h}function Ji(e,t){return i(e,t,f)?f.localZ[t]??h:h}function Qe(e,t){return i(e,t,f)}function Yi(e,t,n){j(e,t),f.zIndex[t]=Math.max(je,Math.min(qe,Math.floor(n)));}function $i(e,t,n){j(e,t),f.localZ[t]=Math.max(je,Math.min(qe,Math.floor(n)));}function Gi(e,t){j(e,t);let n=et(e,t);if(n.length===0)return;let r=f.zIndex[t]??h;for(let o of n)if(i(e,o,f)){let i=f.zIndex[o]??h;i>=r&&(r=i+1);}f.zIndex[t]=r;}function Xi(e,t){j(e,t);let n=et(e,t);if(n.length===0)return;let r=f.zIndex[t]??h;for(let o of n)if(i(e,o,f)){let i=f.zIndex[o]??h;i<=r&&(r=i-1);}f.zIndex[t]=r;}function qi(e,t){j(e,t);let n=et(e,t),r=f.zIndex[t]??h,o=null,i$1=qe;for(let a of n)if(i(e,a,f)){let s=f.zIndex[a]??h;s>r&&s<i$1&&(o=a,i$1=s);}return o!==null?(f.zIndex[t]=i$1,f.zIndex[o]=r,true):false}function ji(e,t){j(e,t);let n=et(e,t),r=f.zIndex[t]??h,o=null,i$1=je;for(let a of n)if(i(e,a,f)){let s=f.zIndex[a]??h;s<r&&s>i$1&&(o=a,i$1=s);}return o!==null?(f.zIndex[t]=i$1,f.zIndex[o]=r,true):false}function Kn(e,t){return [...t].sort((n,r)=>{let o=i(e,n,f)?f.zIndex[n]??h:h,i$1=i(e,r,f)?f.zIndex[r]??h:h;return o-i$1})}function Un(e,t){let n=s(e,t);return Kn(e,n)}function et(e,t){if(!i(e,t,o$1))return [];let n=v$1(e,t);return n===n$1?[]:s(e,n).filter(o=>o!==t)}function Qi(e,t){let n=Un(e,t);for(let r=0;r<n.length;r++){let o=n[r];o!==void 0&&(j(e,o),f.zIndex[o]=r);}}function ea(e){f.zIndex[e]=h,f.localZ[e]=h;}function ta(){return {entities:[],dirty:true,lastCount:0}}function na(e){e.dirty=true;}function ra(e){return e.dirty}function ue(e,t){if(!t.dirty)return;let r=ae(e).filter(o=>c$3.clickable[o]===1||c$3.hoverable[o]===1);r.sort((o,i)=>{let a=Qe(e,o)?f.zIndex[o]??0:0;return (Qe(e,i)?f.zIndex[i]??0:0)-a}),t.entities=r,t.lastCount=r.length,t.dirty=false;}function oa(e,t){return ue(e,t),t.entities}function ia(e,t){return ue(e,t),t.entities.length}var Bt={useCachedPositions:true,clickableOnly:true,hoverableOnly:false,interactiveOnly:false};function le(e,t,n){return i(e,t,c$3)?n.interactiveOnly?c$3.clickable[t]===1||c$3.hoverable[t]===1:n.clickableOnly&&n.hoverableOnly?c$3.clickable[t]===1&&c$3.hoverable[t]===1:n.clickableOnly?c$3.clickable[t]===1:n.hoverableOnly?c$3.hoverable[t]===1:true:false}function ce(e,t,n,r,o){return o?Wt(e,t,n,r):St(e,t,n,r)}function aa(e,t,n,r,o){let i=o.useCachedPositions??true;ue(e,t);for(let a of t.entities)if(le(e,a,o)&&ce(e,a,n,r,i))return a;return null}function sa(e,t,n,r){let o=r.useCachedPositions??true,i=ae(e),a=[];for(let s of i)le(e,s,r)&&ce(e,s,t,n,o)&&a.push({eid:s,z:se(e,s)});return a.length===0?null:(a.sort((s,l)=>l.z-s.z),a[0]?.eid??null)}function Pe(e,t,n,r,o=Bt){return r?aa(e,r,t,n,o):sa(e,t,n,o)}function Mt(e,t,n,r,o=Bt){let i=o.useCachedPositions??true,a=[];if(r){ue(e,r);for(let c of r.entities)le(e,c,o)&&ce(e,c,t,n,i)&&a.push(c);return a}let s=ae(e),l=[];for(let c of s)le(e,c,o)&&ce(e,c,t,n,i)&&l.push({eid:c,z:se(e,c)});return l.sort((c,m)=>m.z-c.z),l.map(c=>c.eid)}function la(e,t,n,r,o=Bt){let i=o.useCachedPositions??true,a=[];if(r){ue(e,r);for(let l of r.entities)le(e,l,o)&&ce(e,l,t,n,i)&&a.push({entity:l,zIndex:se(e,l)});return a}let s=ae(e);for(let l of s)le(e,l,o)&&ce(e,l,t,n,i)&&a.push({entity:l,zIndex:se(e,l)});return a.sort((l,c)=>c.zIndex-l.zIndex),a}function ca(e,t,n,r){return Pe(e,t,n,r,{clickableOnly:true,useCachedPositions:true})!==null}function ua(e,t,n,r){return Pe(e,t,n,r,{hoverableOnly:true,clickableOnly:false,useCachedPositions:true})!==null}function fa(e,t,n,r){return Pe(e,t,n,r,{clickableOnly:true,useCachedPositions:true})}function da(e,t,n,r){return Pe(e,t,n,r,{hoverableOnly:true,clickableOnly:false,useCachedPositions:true})}function pa(e,t,n,r){return Mt(e,t,n,r,{clickableOnly:true,useCachedPositions:true})}function ya(e,t,n,r){return Mt(e,t,n,r,{hoverableOnly:true,clickableOnly:false,useCachedPositions:true})}var Hn=z$1.object({keys:z$1.union([z$1.string(),z$1.array(z$1.string()).readonly()]),action:z$1.string().min(1),when:z$1.string().optional(),preventDefault:z$1.boolean().optional(),description:z$1.string().optional()}),ma=z$1.array(Hn),ga={esc:"escape",ret:"return",cr:"return",lf:"enter",bs:"backspace",del:"delete",ins:"insert",pgup:"pageup",pgdn:"pagedown",pgdown:"pagedown",arrow_up:"up",arrow_down:"down",arrow_left:"left",arrow_right:"right"},ba={control:"ctrl",cmd:"meta",command:"meta",option:"meta",alt:"meta",win:"meta",super:"meta"};function ha(e,t){t==="ctrl"?e.ctrl=true:t==="meta"?e.meta=true:t==="shift"&&(e.shift=true);}function Ea(e,t,n){if(t){let r=xa(e);if(!r)return false;n.name=r;}else {let r=va(e);if(!r)return false;ha(n,r);}return true}function Lt(e){if(!e)return null;let t=e.toLowerCase().split("+").map(r=>r.trim());if(t.length===0)return null;let n={name:"undefined",ctrl:false,meta:false,shift:false};for(let r=0;r<t.length;r++){let o=t[r];if(o&&!Ea(o,r===t.length-1,n))return null}return n.name==="undefined"?null:n}function xa(e){let t=e.toLowerCase(),n=ga[t];return n||(t.length===1||/^f(1[0-2]|[1-9])$/.test(t)||new Set(["up","down","left","right","home","end","pageup","pagedown","insert","delete","clear","return","enter","tab","backspace","escape","space"]).has(t)?t:null)}function va(e){let t=e.toLowerCase();return t==="ctrl"||t==="meta"||t==="shift"?t:ba[t]??null}function wt(e){let t=[];return e.ctrl&&t.push("ctrl"),e.meta&&t.push("meta"),e.shift&&t.push("shift"),t.push(e.name),t.join("+")}function Vn(e){let t=[];return e.ctrl&&t.push("ctrl"),e.meta&&t.push("meta"),e.shift&&t.push("shift"),t.push(e.name),t.join("+")}function Ca(){return {bindings:new Map,keyIndex:new Map}}function Zn(e,t){let n=new Map(e.bindings),r=new Map;for(let[i,a]of e.keyIndex)r.set(i,[...a]);n.set(t.action,t);let o=Array.isArray(t.keys)?t.keys:[t.keys];for(let i of o){let a=Lt(i);if(!a)continue;let s=wt(a),l=r.get(s)??[];r.set(s,[...l,t]);}return {bindings:n,keyIndex:r}}function Sa(e,t){return t.reduce((n,r)=>Zn(n,r),e)}function Da(e,t){if(!e.bindings.get(t))return e;let r=new Map(e.bindings),o=new Map;for(let[i,a]of e.keyIndex){let s=a.filter(l=>l.action!==t);s.length>0&&o.set(i,s);}return r.delete(t),{bindings:r,keyIndex:o}}function Pa(e,t){return e.bindings.get(t)}function Ia(e,t){let n=wt(t);return e.keyIndex.get(n)??[]}function Aa(e,t){let n=Array.isArray(e.keys)?e.keys:[e.keys];for(let r of n){let o=Lt(r);if(o&&o.name===t.name&&o.ctrl===t.ctrl&&o.meta===t.meta&&o.shift===t.shift)return true}return false}function Jn(e,t){if(!e)return true;let n=e.split("&&").map(r=>r.trim());for(let r of n)if(!Yn(r,t))return false;return true}function Yn(e,t){let n=e.trim();if(n.startsWith("!"))return !Yn(n.slice(1),t);if(n.includes("==")){let o=n.split("==").map(c=>c.trim()),i=o[0],a=o[1];if(!i||!a)return false;let s=Ot(i,t),l=a.replace(/^['"]|['"]$/g,"");return String(s)===l}if(n.includes("!=")){let o=n.split("!=").map(c=>c.trim()),i=o[0],a=o[1];if(!i||!a)return false;let s=Ot(i,t),l=a.replace(/^['"]|['"]$/g,"");return String(s)!==l}return !!Ot(n,t)}function Ot(e,t){let n=e.trim();return t[n]}function Ra(e,t,n={}){let r=Vn(t),o=e.keyIndex.get(r)??[],i=[];for(let a of o)a.when&&!Jn(a.when,n)||i.push({binding:a,action:a.action,preventDefault:a.preventDefault??true});return i}function Ta(e){return wt(e)}function ka(e){return Vn(e)}function Wa(e){return [...e.bindings.values()]}var Ba=[{keys:["ctrl+c"],action:"copy",description:"Copy selection"},{keys:["ctrl+v"],action:"paste",description:"Paste clipboard"},{keys:["ctrl+x"],action:"cut",description:"Cut selection"},{keys:["ctrl+z"],action:"undo",description:"Undo"},{keys:["ctrl+shift+z","ctrl+y"],action:"redo",description:"Redo"},{keys:["ctrl+a"],action:"selectAll",description:"Select all"},{keys:["backspace"],action:"deleteBack",description:"Delete backwards"},{keys:["delete"],action:"deleteForward",description:"Delete forwards"},{keys:["home"],action:"moveToLineStart",description:"Move to line start"},{keys:["end"],action:"moveToLineEnd",description:"Move to line end"},{keys:["ctrl+home"],action:"moveToStart",description:"Move to document start"},{keys:["ctrl+end"],action:"moveToEnd",description:"Move to document end"}],Ma=[{keys:["tab"],action:"focusNext",description:"Focus next element"},{keys:["shift+tab"],action:"focusPrev",description:"Focus previous element"},{keys:["escape"],action:"cancel",description:"Cancel/close"},{keys:["enter","return"],action:"confirm",description:"Confirm/submit"},{keys:["up"],action:"moveUp",description:"Move up"},{keys:["down"],action:"moveDown",description:"Move down"},{keys:["left"],action:"moveLeft",description:"Move left"},{keys:["right"],action:"moveRight",description:"Move right"},{keys:["pageup"],action:"pageUp",description:"Page up"},{keys:["pagedown"],action:"pageDown",description:"Page down"}];var $n={CRITICAL:0,HIGH:1,NORMAL:2,LOW:3};function Oa(e){let t,n=false;return {get(){return n||(t=e(),n=true),t},isInitialized(){return n},reset(){t=void 0,n=false;}}}var Q=[],fe=null,tt=null;function La(e,t,n){Q.find(o=>o.name===e)||Q.push({name:e,priority:t,initFn:n,initialized:false,initTimeMs:null});}function Gn(e){let t=Q.find(o=>o.name===e);if(!t||t.initialized)return null;fe===null&&(fe=performance.now());let n=performance.now();t.initFn();let r=performance.now()-n;return t.initialized=true,t.initTimeMs=r,tt===null&&(tt=performance.now()-fe),r}function wa(e=$n.LOW){fe===null&&(fe=performance.now());let t=0,n=[...Q].filter(r=>!r.initialized&&r.priority<=e).sort((r,o)=>r.priority-o.priority);for(let r of n){let o=Gn(r.name);o!==null&&(t+=o);}return t}function za(){return {totalMs:Q.filter(n=>n.initialized).reduce((n,r)=>n+(r.initTimeMs??0),0),subsystems:Q.map(n=>({name:n.name,priority:n.priority,initTimeMs:n.initTimeMs??0,lazy:!n.initialized})),timeToFirstInit:tt??0}}function Na(e){let t=[],n=["CRITICAL","HIGH","NORMAL","LOW"];t.push("Startup Report"),t.push("\u2550".repeat(40)),t.push(`Total init time: ${e.totalMs.toFixed(1)}ms`),t.push(`Time to first init: ${e.timeToFirstInit.toFixed(1)}ms`),t.push("");for(let r of e.subsystems){let o=r.lazy?"(lazy)":`${r.initTimeMs.toFixed(1)}ms`,i=n[r.priority]??"UNKNOWN";t.push(` [${i}] ${r.name}: ${o}`);}return t.join(`
|
|
2
|
-
`)}function Fa(){Q.length=0,fe=null,tt=null;}function _a(e=6e4){let t=zt.value;if(t&&Date.now()-t.cachedAt<e)return t;let n=process.env,r=n.TERM??"",o=n.COLORTERM??"",i=o==="truecolor"||o==="24bit"||r.includes("24bit")||r.includes("truecolor"),a=i||r.includes("256color")||o==="256color",s=(n.LANG??"").includes("UTF-8")||(n.LC_ALL??"").includes("UTF-8"),l={term:r,trueColor:i,color256:a,unicode:s,width:process.stdout.columns??80,height:process.stdout.rows??24,cachedAt:Date.now()};return zt.value=l,l}var zt={value:null};function Ka(){zt.value=null;}var qn={0:"INPUT",1:"EARLY_UPDATE",2:"UPDATE",3:"LATE_UPDATE",4:"PHYSICS",5:"LAYOUT",6:"RENDER",7:"POST_RENDER"};function Ua(e){return typeof e=="number"&&e>=0&&e<=7}function Xn(e){for(let t=0;t<=7;t++)e.set(t,{id:t,name:qn[t]??`PHASE_${t}`,order:t*1e3,isBuiltin:true});}function jn(){let e=new Map,t=0,n=true,r=[];Xn(e);function o(a){let s=Number.MAX_SAFE_INTEGER;for(let l of e.values())l.order>a&&l.order<s&&(s=l.order);return s===Number.MAX_SAFE_INTEGER&&(s=a+1e3),s}function i(){let a=Array.from(e.values());a.sort((s,l)=>s.order-l.order),r=a.map(s=>s.id),n=false;}return {registerPhase(a,s){let l=e.get(s);if(!l)throw new Error(`Cannot register phase after unknown phase: ${String(s)}`);let c=`custom_${a}_${++t}`,m=l.order,I=o(m),V=m+(I-m)/2;return e.set(c,{id:c,name:a,order:V,isBuiltin:false}),n=true,c},unregisterPhase(a){let s=e.get(a);if(!s)return false;if(s.isBuiltin)throw new Error(`Cannot remove built-in phase: ${s.name}`);return e.delete(a),n=true,true},getPhaseOrder(){return n&&i(),r},getPhaseName(a){return e.get(a)?.name},hasPhase(a){return e.has(a)},isBuiltin(a){return e.get(a)?.isBuiltin??false},getPhaseCount(){return e.size},getCustomPhaseCount(){let a=0;for(let s of e.values())s.isBuiltin||a++;return a},getCustomPhases(){let a=[];for(let s of e.values())!s.isBuiltin&&typeof s.id=="string"&&a.push(s.id);return a},clearCustomPhases(){for(let[a,s]of e)s.isBuiltin||e.delete(a);t=0,n=true;},reset(){e.clear(),t=0,Xn(e),n=true;}}}var Ha=jn();var Qn=z$1.object({name:z$1.string().min(1),store:z$1.unknown()}),er=z$1.object({system:z$1.function(),phase:z$1.nativeEnum(a),priority:z$1.number().optional()}),tr=z$1.object({name:z$1.string().min(1),version:z$1.string().min(1),dependencies:z$1.array(z$1.string().min(1)).readonly().optional(),components:z$1.array(Qn).readonly().optional(),systems:z$1.array(er).readonly().optional(),init:z$1.function().optional(),cleanup:z$1.function().optional()});function Va(){return {_plugins:new Map}}function Za(e,t,n,r){let o=tr.safeParse(r);if(!o.success)return {success:false,error:`Invalid plugin manifest: ${o.error.message}`,systemsRegistered:0,componentsRegistered:0};let i=e._plugins;if(i.has(r.name))return {success:false,error:`Plugin "${r.name}" is already registered`,systemsRegistered:0,componentsRegistered:0};if(r.dependencies){for(let s of r.dependencies)if(!i.has(s))return {success:false,error:`Missing dependency: "${s}" (required by "${r.name}")`,systemsRegistered:0,componentsRegistered:0}}let a=[];if(r.systems)for(let s of r.systems)t.registerSystem(s.phase,s.system,s.priority??0),a.push(s);return i.set(r.name,{plugin:r,registeredSystems:a}),r.init&&r.init(n),{success:true,systemsRegistered:a.length,componentsRegistered:r.components?.length??0}}function Ja(e,t,n,r){let o=e._plugins,i=o.get(r);if(!i)return false;for(let[a,s]of o)if(a!==r&&s.plugin.dependencies?.includes(r))return false;for(let a of i.registeredSystems)t.unregisterSystem(a.system);return i.plugin.cleanup&&i.plugin.cleanup(n),o.delete(r),true}function Ya(e){let t=[];for(let n of e._plugins.values())t.push({name:n.plugin.name,version:n.plugin.version,dependencies:n.plugin.dependencies??[],componentCount:n.plugin.components?.length??0,systemCount:n.registeredSystems.length});return t}function $a(e,t){return e._plugins.has(t)}function Ga(e){return e._plugins.size}function Xa(e,t,n){let r=e._plugins,o=[...r.keys()].reverse();for(let i of o){let a=r.get(i);if(a){for(let s of a.registeredSystems)t.unregisterSystem(s.system);a.plugin.cleanup&&a.plugin.cleanup(n);}}r.clear();}var qa=z$1.union([z$1.number(),z$1.string().refine(e=>!!(["center","half","left","right","top","bottom"].includes(e)||/^\d+(\.\d+)?%$/.test(e)||/^(\d+(\.\d+)?%?)([-+]\d+(\.\d+)?)?$/.test(e)),{message:'Position must be a number, percentage (e.g. "50%"), expression (e.g. "50%-5"), or keyword (center, half)'})]),nr={center:"center",half:"half",left:"start",right:"end",top:"start",bottom:"end"};function ja(e){let t=e.match(/^(\d+(?:\.\d+)?)(%?)(([+-])(\d+(?:\.\d+)?))?$/);if(!t)return null;let n=Number.parseFloat(t[1]),r=t[2]==="%",o=0;if(t[3]){let i=t[4],a=Number.parseFloat(t[5]);o=i==="-"?-a:a;}return {base:n,isPercent:r,offset:o}}function nt(e,t,n=0){if(typeof e=="number")return Math.floor(e)||0;let r=nr[e];if(r)switch(r){case "center":return Math.floor((t-n)/2);case "half":return Math.floor(t/2);case "start":return 0;case "end":return t-n}let o=ja(e);if(!o)return 0;let i;return o.isPercent?i=o.base/100*t:i=o.base,i+=o.offset,Math.floor(i)}function Qa(e,t,n=0){if(typeof e=="number"&&e<0)return t+e-n;if(typeof e=="string"&&e.startsWith("-")){let r=e.match(/^-(\d+(?:\.\d+)?)$/);if(r){let o=Number.parseFloat(r[1]);return t-o-n}}return nt(e,t,n)}function Ft(e,t,n=0){let r=t-n;return e<0?0:e>r?Math.max(0,r):e}function es(e){return typeof e=="number"?false:e.includes("%")}function ts(e){return typeof e=="number"?false:e in nr}function ns(){return "center"}function rs(e){return `${e}%`}function os(e,t){return t>=0?`${e}%+${t}`:`${e}%${t}`}function rr(e,t,n,r,o=0,i=0){return {x:nt(e,n,o),y:nt(t,r,i)}}function is(e,t,n,r,o=0,i=0){let a=rr(e,t,n,r,o,i);return {x:Ft(a.x,n,o),y:Ft(a.y,r,i)}}function _t(e,t,n,r,o){e.transition={transition:o,elapsed:0,fromScene:n,toScene:r},o.onStart?.(t);}function as(e,t){e.transition&&(e.transition.transition.onComplete?.(t),e.transition=null);}function Kt(e,t){e.created||(e.scene.onCreate?.(t),e.created=true);}function rt(e,t){Kt(e,t),e.scene.onEnter?.(t);}function U(e,t){e.onExit?.(t);}function ss(e,t,n){for(let r=e.stack.length-1;r>=0;r--){let o=e.stack[r];o&&U(o,t);}e.stack=[n.scene],rt(n,t);}function ls(e,t,n){let r=e.stack[e.stack.length-1];r&&U(r,t),e.stack.push(n.scene),rt(n,t);}function cs(e,t){if(e.stack.length<=0)return false;let n=e.stack[e.stack.length-1];n&&U(n,t),e.stack.pop();let r=e.stack[e.stack.length-1];if(r){let o=e.registry.get(r.name);o&&rt(o,t);}return true}function us(){let e={registry:new Map,stack:[],transition:null};return {registerScene(t){return e.registry.has(t.name)?false:(e.registry.set(t.name,{scene:t,created:false}),true)},unregisterScene(t,n){let r=e.registry.get(n);if(!r)return false;let o=e.stack.indexOf(r.scene);return o!==-1&&(U(r.scene,t),e.stack.splice(o,1)),r.created&&r.scene.onDestroy?.(t),e.registry.delete(n),true},switchTo(t,n,r){let o=e.registry.get(n);if(!o)return false;if(r){let i=e.stack[e.stack.length-1]??null;for(let a=e.stack.length-1;a>=0;a--){let s=e.stack[a];s&&U(s,t);}e.stack=[o.scene],Kt(o,t),_t(e,t,i,o.scene,r);}else ss(e,t,o);return true},push(t,n,r){let o=e.registry.get(n);if(!o)return false;if(r){let i=e.stack[e.stack.length-1]??null;i&&U(i,t),e.stack.push(o.scene),Kt(o,t),_t(e,t,i,o.scene,r);}else ls(e,t,o);return true},pop(t,n){if(e.stack.length<=0)return false;if(n){let r=e.stack[e.stack.length-1]??null;r&&U(r,t),e.stack.pop();let o=e.stack[e.stack.length-1]??null;return o?_t(e,t,r,o,n):e.transition=null,true}return cs(e,t)},getCurrentScene(){return e.stack[e.stack.length-1]??null},getSceneStack(){return [...e.stack]},getRegisteredScenes(){return Array.from(e.registry.keys())},isTransitioning(){return e.transition!==null},getTransitionState(){return e.transition},updateTransition(t,n){if(!e.transition)return;e.transition.elapsed+=n;let r=Math.min(1,e.transition.elapsed/e.transition.transition.duration);if(e.transition.transition.onUpdate?.(t,r),r>=1){let o=e.transition.toScene;as(e,t);let i=e.registry.get(o.name);i&&rt(i,t);}},reset(t){e.transition=null;for(let n=e.stack.length-1;n>=0;n--){let r=e.stack[n];r&&U(r,t);}for(let n of e.registry.values())n.created&&n.scene.onDestroy?.(t);e.registry.clear(),e.stack=[];}}}function fs(e,t){return {duration:e,onUpdate:t}}function ds(e,t,n){return {duration:e,onUpdate(r,o){n?.(r,o,t);}}}function ps(e,t){return n=>{let r=t();return e.isTransitioning()&&e.updateTransition(n,r),e.isTransitioning()||e.getCurrentScene()?.onUpdate?.(n,r),n}}n();c();var H=new Map;function ys(e){H.set(e.name,e);}function ms(e){return H.delete(e)}function gs(e){return H.get(e)}function bs(){return Array.from(H.keys())}function hs(){H.clear();}function or(e){return e instanceof Float32Array||e instanceof Float64Array||e instanceof Int8Array||e instanceof Int16Array||e instanceof Int32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Uint32Array}function Es(e,t){let n={};for(let[o,i]of Object.entries(e.store))or(i)&&(n[o]=i[t]);let r={fields:n};return e.serialize&&(r.custom=e.serialize(t)),r}function ir(e,t){let n=g$2(e),r=t?.entityFilter?n.filter(a=>t.entityFilter.includes(a)):n,o=Ss(t?.componentFilter),i$1=[];for(let a of r){let s={},l=false;for(let c of o)i(e,a,c.store)&&(s[c.name]=Es(c,a),l=true);l&&i$1.push({id:a,components:s});}return {version:1,timestamp:Date.now(),entities:i$1,metadata:t?.metadata}}function xs(e,t){return JSON.stringify(ir(e,t))}function vs(e,t,n){for(let[r,o]of Object.entries(n.fields)){let i=e.store[r];or(i)&&(i[t]=o);}e.deserialize&&n.custom!==void 0&&e.deserialize(t,n.custom);}function ar(e,t,n){let r=t;if(n?.createNew)r=a$3();else if(n?.clearWorld){let a=g$2(r);for(let s of a)e$1(r,s);}let o=new Map,i=0;for(let a of e.entities){let s=d$1(r);o.set(a.id,s);for(let[l,c]of Object.entries(a.components)){let m=H.get(l);m&&(h$1(r,s,m.store),vs(m,s,c),i++);}}return {world:r,entityMap:o,entityCount:o.size,componentCount:i}}function Cs(e,t,n){let r=JSON.parse(e);return ar(r,t,n)}function Ss(e){if(!e)return Array.from(H.values());let t=[];for(let n of e){let r=H.get(n);r&&t.push(r);}return t}function Ds(e){return JSON.parse(JSON.stringify(e))}var Ps=1;u();function lr(e,t){return o(e,t)?{h:2,v:2}:{h:0,v:0}}function ot(e,t){let n=lr(e,t),r=f$5(e,t)?g$3(e,t):0;return n.h+r}function sr(e,t){let n=lr(e,t),r=f$5(e,t)?h$2(e,t):0;return n.v+r}function cr(e,t){if(!l$1(e,t))return ot(e,t);let n=f$3(e,t);if(!n)return ot(e,t);let r=n.split(`
|
|
3
|
-
`),o=0;for(let i of r){let a=b(i);a>o&&(o=a);}return o+ot(e,t)}function ur(e,t,n){if(!l$1(e,t))return sr(e,t);let r=f$3(e,t),o=ot(e,t),i=n?n-o:void 0,a;return i&&i>0?a=f$4(r,{width:i,wrap:true}).length:a=r.split(`
|
|
4
|
-
`).length,a+sr(e,t)}function Ut(e,t){let n=cr(e,t),r=ur(e,t,n);return {width:n,height:r}}function Is(e,t){if(!j$1(e,t)||!k$1(e,t))return false;let n=Ut(e,t),r=e$2.minWidth[t],o=e$2.minHeight[t],i=e$2.maxWidth[t],a=e$2.maxHeight[t],s=Math.min(Math.max(n.width,r),i),l=Math.min(Math.max(n.height,o),a);return e$2.width[t]=s,e$2.height[t]=l,true}function As(e,t){if(!k$1(e,t))return;let n=Ut(e,t),r=e$2.minWidth[t],o=e$2.minHeight[t],i=e$2.maxWidth[t],a=e$2.maxHeight[t];return {width:Math.min(Math.max(n.width,r),i),height:Math.min(Math.max(n.height,o),a)}}var dr=["fg","bold","underline","blink","inverse"],Rs=["bg","transparent"],pe=new Map,Ie=0;function Ts(){return Ie}function ks(e){pe.delete(e);}function Ws(){Ie++,pe.clear();}function Bs(){pe.clear();}function Ms(e){let t=pe.get(e);return t!==void 0&&t.timestamp===Ie}function de(e,t){return ta$1(e,t)?{fg:ka$1.fg[t],bg:ka$1.bg[t],bold:ka$1.bold[t]===1,underline:ka$1.underline[t]===1,blink:ka$1.blink[t]===1,inverse:ka$1.inverse[t]===1,transparent:ka$1.transparent[t]===1,opacity:ka$1.opacity[t]??1}:Zt()}function Zt(){return {fg:ia$1,bg:0,bold:false,underline:false,blink:false,inverse:false,transparent:false,opacity:1}}function Vt(e,t){return {fg:t.fg!==ia$1?t.fg:e.fg,bold:t.bold||e.bold,underline:t.underline||e.underline,blink:t.blink||e.blink,inverse:t.inverse||e.inverse,bg:t.bg,transparent:t.transparent,opacity:t.opacity}}function Os(e){return e===ia$1||e===0}function Ae(e,t$1){let n=pe.get(t$1);if(n!==void 0&&n.timestamp===Ie)return n.style;let r=de(e,t$1);if(!x(e,t$1))return Ht(t$1,r),r;let o=t(e,t$1);if(o.length===0)return Ht(t$1,r),r;let i=Ls(e,o,r);return Ht(t$1,i),i}function Ls(e,t,n){let r=de(e,t[t.length-1]);for(let o=t.length-2;o>=0;o--){let i=de(e,t[o]);r=Vt(r,i);}return Vt(r,n)}function Ht(e,t){pe.set(e,{style:t,timestamp:Ie});}function ws(e,t){return Ae(e,t)}function zs(e){return dr.includes(e)}function Ns(e,t,n){return Ae(e,t)[n]}function Fs(e,t$1,n){let r=de(e,t$1);if(fr(r,n))return t$1;if(!x(e,t$1))return 0;let o=t(e,t$1);for(let i of o){let a=de(e,i);if(fr(a,n))return i}return 0}function fr(e,t){let n=Zt();switch(t){case "fg":return e.fg!==n.fg;case "bg":return e.bg!==n.bg;case "bold":return e.bold!==n.bold;case "underline":return e.underline!==n.underline;case "blink":return e.blink!==n.blink;case "inverse":return e.inverse!==n.inverse;case "transparent":return e.transparent!==n.transparent;default:return false}}function _s(e,t){for(let n of t)Ae(e,n);}function Ks(e,t){let n=new Map;for(let r of t)n.set(r,Ae(e,r));return n}var F={TERMINAL_TOO_SMALL:"terminal-too-small",UNSUPPORTED_CAPABILITY:"unsupported-capability",DEPRECATED_API:"deprecated-api",PERFORMANCE_ISSUE:"performance-issue"},pr=z$1.object({width:z$1.number().int().nonnegative(),height:z$1.number().int().nonnegative(),minWidth:z$1.number().int().positive(),minHeight:z$1.number().int().positive()}),yr=z$1.object({capability:z$1.string(),fallback:z$1.string().optional()}),mr=z$1.object({api:z$1.string(),replacement:z$1.string(),since:z$1.string()}),gr=z$1.object({metric:z$1.string(),value:z$1.number(),threshold:z$1.number(),frameTime:z$1.number().optional()}),Re=z$1.object({type:z$1.enum([F.TERMINAL_TOO_SMALL,F.UNSUPPORTED_CAPABILITY,F.DEPRECATED_API,F.PERFORMANCE_ISSUE]),message:z$1.string(),metadata:z$1.union([pr,yr,mr,gr]),timestamp:z$1.number()});function Us(){return l()}function Hs(e,t,n,r,o){let i={width:t,height:n,minWidth:r,minHeight:o},a={type:F.TERMINAL_TOO_SMALL,message:`Terminal size (${t}x${n}) is smaller than recommended (${r}x${o})`,metadata:i,timestamp:Date.now()};e.emit("warning",Re.parse(a));}function Vs(e,t,n){let r={capability:t,fallback:n},o={type:F.UNSUPPORTED_CAPABILITY,message:`Terminal capability '${t}' is not supported${n?`. ${n}`:""}`,metadata:r,timestamp:Date.now()};e.emit("warning",Re.parse(o));}function Zs(e,t,n,r){let o={api:t,replacement:n,since:r},i={type:F.DEPRECATED_API,message:`API '${t}' is deprecated since ${r}. Use '${n}' instead.`,metadata:o,timestamp:Date.now()};e.emit("warning",Re.parse(i));}function Js(e,t,n,r,o){let i={metric:t,value:n,threshold:r,frameTime:o},a={type:F.PERFORMANCE_ISSUE,message:`Performance issue: ${t} (${n.toFixed(2)}) exceeds threshold (${r.toFixed(2)})`,metadata:i,timestamp:Date.now()};e.emit("warning",Re.parse(a));}c();export{eo as $,qo as $a,wi as $b,Ta as $c,Ps as $d,kr as A,To as Aa,mi as Ab,ta as Ac,Ga as Ad,mr as Ae,Wr as B,ko as Ba,gi as Bb,na as Bc,Xa as Bd,gr as Be,Br as C,Wo as Ca,bi as Cb,ra as Cc,qa as Cd,Re as Ce,Mr as D,w as Da,hi as Db,ue as Dc,nt as Dd,Us as De,Or as E,Pt as Ea,Ei as Eb,oa as Ec,Qa as Ed,Hs as Ee,Lr as F,Bo as Fa,wn as Fb,ia as Fc,Ft as Fd,Vs as Fe,K as G,Mo as Ga,zn as Gb,Pe as Gc,es as Gd,Zs as Ge,g as H,Oo as Ha,xi as Hb,Mt as Hc,ts as Hd,Js as He,zr as I,Lo as Ia,p as Ib,la as Ic,ns as Id,Nr as J,wo as Ja,vi as Jb,ca as Jc,rs as Jd,Fe as K,zo as Ka,Ci as Kb,ua as Kc,os as Kd,Fr as L,It as La,Si as Lb,fa as Lc,rr as Ld,_r as M,No as Ma,Di as Mb,da as Mc,is as Md,Ce as N,Fo as Na,Pi as Nb,pa as Nc,us as Nd,Kr as O,_o as Oa,Ii as Ob,ya as Oc,fs as Od,Ur as P,Ko as Pa,Ai as Pb,Hn as Pc,ds as Pd,Hr as Q,Uo as Qa,Ri as Qb,ma as Qc,ps as Qd,_e as R,Ho as Ra,Ti as Rb,Lt as Rc,ys as Rd,Vr as S,Vo as Sa,Wt as Sb,Ca as Sc,ms as Sd,Zr as T,An as Ta,ki as Tb,Zn as Tc,gs as Td,Jr as U,Rn as Ua,Wi as Ub,Sa as Uc,bs as Ud,$r as V,Zo as Va,ae as Vb,Da as Vc,hs as Vd,Gr as W,Jo as Wa,Bi as Wb,Pa as Wc,ir as Wd,Xr as X,Yo as Xa,Mi as Xb,Ia as Xc,xs as Xd,qr as Y,$o as Ya,Oi as Yb,Aa as Yc,ar as Yd,jr as Z,Go as Za,Li as Zb,Jn as Zc,Cs as Zd,Qr as _,Xo as _a,Nn as _b,Ra as _c,Ds as _d,un as a,Ke as aa,ie as ab,zi as ac,ka as ad,cr as ae,fn as b,Cn as ba,Qo as bb,Ni as bc,Wa as bd,ur as be,dn as c,Ct as ca,ei as cb,Fn as cc,Ba as cd,Ut as ce,pn as d,Ue as da,ti as db,Fi as dc,Ma as dd,Is as de,br as e,Sn as ea,ni as eb,_i as ec,$n as ed,As as ee,hr as f,no as fa,Tn as fb,Ki as fc,Oa as fd,dr as fe,yn as g,ro as ga,kn as gb,Ui as gc,La as gd,Rs as ge,yt as h,oo as ha,$e as hb,Hi as hc,Gn as hd,Ts as he,mn as i,St as ia,Wn as ib,Vi as ic,wa as id,ks as ie,xr as j,io as ja,Bn as jb,h as jc,za as jd,Ws as je,vr as k,Pn as ka,Ge as kb,qe as kc,Na as kd,Bs as ke,mt as l,ao as la,ii as lb,je as lc,Fa as ld,Ms as le,gn as m,so as ma,Mn as mb,f as mc,_a as md,de as me,bn as n,lo as na,Xe as nb,se as nc,Ka as nd,Zt as ne,hn as o,He as oa,On as ob,Ji as oc,qn as od,Vt as oe,Cr as p,In as pa,ai as pb,Qe as pc,Ua as pd,Os as pe,Sr as q,co as qa,si as qb,Yi as qc,jn as qd,Ae as qe,Dr as r,uo as ra,li as rb,$i as rc,Ha as rd,ws as re,gt as s,fo as sa,ci as sb,Gi as sc,Qn as sd,zs as se,bt as t,Ze as ta,ui as tb,Xi as tc,er as td,Ns as te,L as u,So as ua,fi as ub,qi as uc,tr as ud,Fs as ue,Pr as v,Do as va,di as vb,ji as vc,Va as vd,_s as ve,ht as w,Po as wa,pi as wb,Kn as wc,Za as wd,Ks as we,Et as x,Io as xa,Tt as xb,Un as xc,Ja as xd,F as xe,Ir as y,Ao as ya,kt as yb,Qi as yc,Ya as yd,pr as ye,Tr as z,Ro as za,yi as zb,ea as zc,$a as zd,yr as ze};
|
package/dist/chunk-ZPGJCHXH.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {i as i$1,n,t,h,s as s$1}from'./chunk-P3ZLIQJP.js';import {c as c$1,b}from'./chunk-5PELJRUQ.js';var V={};c$1(V,{BORDER_ASCII:()=>L,BORDER_BOLD:()=>d,BORDER_DASHED:()=>E,BORDER_DASHED_HEAVY:()=>A,BORDER_DOUBLE:()=>B,BORDER_ROUNDED:()=>s,BORDER_SINGLE:()=>a,Border:()=>r,BorderType:()=>c,DEFAULT_BORDER_BG:()=>u,DEFAULT_BORDER_FG:()=>m,disableAllBorders:()=>H,enableAllBorders:()=>_,getBorder:()=>O,getBorderChar:()=>W,hasBorder:()=>T,hasBorderVisible:()=>w,setBorder:()=>U,setBorderChars:()=>v});function D(o){r.type[o]=0,r.left[o]=1,r.top[o]=1,r.right[o]=1,r.bottom[o]=1,r.fg[o]=m,r.bg[o]=u,r.charTopLeft[o]=a.topLeft,r.charTopRight[o]=a.topRight,r.charBottomLeft[o]=a.bottomLeft,r.charBottomRight[o]=a.bottomRight,r.charHorizontal[o]=a.horizontal,r.charVertical[o]=a.vertical;}function i(o,t){i$1(o,t,r)||(h(o,t,r),D(t));}function C(o,t){t.left!==void 0&&(r.left[o]=t.left?1:0),t.top!==void 0&&(r.top[o]=t.top?1:0),t.right!==void 0&&(r.right[o]=t.right?1:0),t.bottom!==void 0&&(r.bottom[o]=t.bottom?1:0);}function z(o,t){t.type!==void 0&&(r.type[o]=t.type),C(o,t),t.fg!==void 0&&(r.fg[o]=s$1(t.fg)),t.bg!==void 0&&(r.bg[o]=s$1(t.bg)),t.chars!==void 0&&p(o,t.chars);}function U(o,t,h){return i(o,t),z(t,h),t}function p(o,t){r.charTopLeft[o]=t.topLeft,r.charTopRight[o]=t.topRight,r.charBottomLeft[o]=t.bottomLeft,r.charBottomRight[o]=t.bottomRight,r.charHorizontal[o]=t.horizontal,r.charVertical[o]=t.vertical;}function v(o,t,h){return i(o,t),p(t,h),t}function O(o,t){if(i$1(o,t,r))return {type:r.type[t],left:r.left[t]===1,top:r.top[t]===1,right:r.right[t]===1,bottom:r.bottom[t]===1,fg:r.fg[t],bg:r.bg[t],charTopLeft:r.charTopLeft[t],charTopRight:r.charTopRight[t],charBottomLeft:r.charBottomLeft[t],charBottomRight:r.charBottomRight[t],charHorizontal:r.charHorizontal[t],charVertical:r.charVertical[t]}}function T(o,t){return i$1(o,t,r)}function w(o,t){return !i$1(o,t,r)||r.type[t]===0?false:r.left[t]===1||r.top[t]===1||r.right[t]===1||r.bottom[t]===1}function _(o,t){return i(o,t),r.left[t]=1,r.top[t]=1,r.right[t]=1,r.bottom[t]=1,t}function H(o,t){return i(o,t),r.left[t]=0,r.top[t]=0,r.right[t]=0,r.bottom[t]=0,t}function W(o,t,h){if(i$1(o,t,r))switch(h){case "topLeft":return r.charTopLeft[t];case "topRight":return r.charTopRight[t];case "bottomLeft":return r.charBottomLeft[t];case "bottomRight":return r.charBottomRight[t];case "horizontal":return r.charHorizontal[t];case "vertical":return r.charVertical[t]}}var e,c,a,B,s,d,L,E,A,m,u,r,N=b(()=>{n();t();e=1e4,c=(n=>(n[n.None=0]="None",n[n.Line=1]="Line",n[n.Background=2]="Background",n[n.Custom=3]="Custom",n))(c||{}),a={topLeft:9484,topRight:9488,bottomLeft:9492,bottomRight:9496,horizontal:9472,vertical:9474},B={topLeft:9556,topRight:9559,bottomLeft:9562,bottomRight:9565,horizontal:9552,vertical:9553},s={topLeft:9581,topRight:9582,bottomLeft:9584,bottomRight:9583,horizontal:9472,vertical:9474},d={topLeft:9487,topRight:9491,bottomLeft:9495,bottomRight:9499,horizontal:9473,vertical:9475},L={topLeft:43,topRight:43,bottomLeft:43,bottomRight:43,horizontal:45,vertical:124},E={topLeft:43,topRight:43,bottomLeft:43,bottomRight:43,horizontal:9476,vertical:9478},A={topLeft:43,topRight:43,bottomLeft:43,bottomRight:43,horizontal:9477,vertical:9479},m=4294967295,u=0,r={type:new Uint8Array(e),left:new Uint8Array(e),top:new Uint8Array(e),right:new Uint8Array(e),bottom:new Uint8Array(e),fg:new Uint32Array(e),bg:new Uint32Array(e),charTopLeft:new Uint32Array(e),charTopRight:new Uint32Array(e),charBottomLeft:new Uint32Array(e),charBottomRight:new Uint32Array(e),charHorizontal:new Uint32Array(e),charVertical:new Uint32Array(e)};});export{c as a,a as b,B as c,s as d,d as e,L as f,E as g,A as h,m as i,u as j,r as k,U as l,v as m,O as n,T as o,w as p,_ as q,H as r,W as s,V as t,N as u};
|
package/dist/chunk-ZPL2J25N.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import {n,t,s,i,h}from'./chunk-P3ZLIQJP.js';n();t();var d=1e4,g=1,O=1,_=4281545523,D=128,B=9608,Y=9618,M=9617,v=9619,r={enabled:new Uint8Array(d),offsetX:new Int8Array(d),offsetY:new Int8Array(d),color:new Uint32Array(d),opacity:new Uint8Array(d),char:new Uint32Array(d),blendWithBg:new Uint8Array(d)};function p(t){r.enabled[t]=0,r.offsetX[t]=g,r.offsetY[t]=O,r.color[t]=_,r.opacity[t]=D,r.char[t]=B,r.blendWithBg[t]=1;}function l(t,n){i(t,n,r)||(h(t,n,r),p(n));}function L(t,n,o){return l(t,n),H(n,o),n}function H(t,n){n.enabled!==void 0&&(r.enabled[t]=n.enabled?1:0),n.offsetX!==void 0&&(r.offsetX[t]=n.offsetX),n.offsetY!==void 0&&(r.offsetY[t]=n.offsetY),n.color!==void 0&&(r.color[t]=s(n.color)),n.opacity!==void 0&&(r.opacity[t]=Math.max(0,Math.min(255,n.opacity))),n.char!==void 0&&(r.char[t]=n.char),n.blendWithBg!==void 0&&(r.blendWithBg[t]=n.blendWithBg?1:0);}function X(t,n){if(i(t,n,r))return {enabled:r.enabled[n]===1,offsetX:r.offsetX[n],offsetY:r.offsetY[n],color:r.color[n],opacity:r.opacity[n],char:r.char[n],blendWithBg:r.blendWithBg[n]===1}}function R(t,n){return i(t,n,r)}function I(t,n){return i(t,n,r)?r.enabled[n]===1:false}function G(t,n){return l(t,n),r.enabled[n]=1,n}function K(t,n){return i(t,n,r)&&(r.enabled[n]=0),n}function j(t,n){return l(t,n),r.enabled[n]=r.enabled[n]===1?0:1,n}function k(t,n,o,e){return l(t,n),r.offsetX[n]=o,r.offsetY[n]=e,n}function q(t,n){if(i(t,n,r))return {x:r.offsetX[n],y:r.offsetY[n]}}function z(t,n,o){return l(t,n),r.color[n]=s(o),n}function J(t,n){if(i(t,n,r))return r.color[n]}function N(t,n,o){return l(t,n),r.opacity[n]=Math.max(0,Math.min(255,o)),n}function Q(t,n){if(i(t,n,r))return r.opacity[n]}function V(t,n,o){return l(t,n),r.char[n]=o,n}function Z(t,n){if(i(t,n,r))return r.char[n]}function $(t,n,o){return l(t,n),r.blendWithBg[n]=o?1:0,n}function nn(t,n){return i(t,n,r)?r.blendWithBg[n]===1:false}function tn(t,n){return i(t,n,r)&&p(n),n}function C(t,n,o,e,a,u,b){for(let f=0;f<a;f++)for(let i=0;i<u;i++)t.push({x:n+e+i,y:o+f+b,type:"right"});}function P(t,n,o,e,a,u,b){for(let f=0;f<b;f++)for(let i=0;i<e;i++)t.push({x:n+i+u,y:o+a+f,type:"bottom"});}function U(t,n,o,e,a,u,b){for(let f=0;f<b;f++)for(let i=0;i<u;i++)t.push({x:n+e+i,y:o+a+f,type:"corner"});}function rn(t,n,o,e,a,u){let b=[];return a>0&&C(b,t,n,o,e,a,u),u>0&&P(b,t,n,o,e,a,u),a>0&&u>0&&U(b,t,n,o,e,a,u),b}function on(t,n,o){let e=t>>16&255,a=t>>8&255,u=t&255,b=n>>16&255,f=n>>8&255,i=n&255,x=n>>24&255,s=o/255,m=1-s,S=Math.round(e*s+b*m),E=Math.round(a*s+f*m),w=Math.round(u*s+i*m);return (x&255)<<24|(S&255)<<16|(E&255)<<8|w&255}export{tn as A,rn as B,on as C,g as a,O as b,_ as c,D as d,B as e,Y as f,M as g,v as h,r as i,L as j,X as k,R as l,I as m,G as n,K as o,j as p,k as q,q as r,z as s,J as t,N as u,Q as v,V as w,Z as x,$ as y,nn as z};
|