blecsd 0.4.0 → 0.6.0
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 +145 -145
- 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-4N7IFBRQ.js +4 -0
- package/dist/{chunk-DNRXW56C.js → chunk-4XCFTNGN.js} +1 -1
- package/dist/chunk-5YWRP2KG.js +3 -0
- package/dist/chunk-73Y45MLV.js +12 -0
- package/dist/chunk-7ZFQO3OQ.js +1 -0
- package/dist/chunk-A3GSH6MV.js +1 -0
- package/dist/chunk-A5B2BGUM.js +1 -0
- package/dist/chunk-AM6IDSXI.js +1 -0
- package/dist/chunk-EHYOVHRL.js +2 -0
- package/dist/chunk-EMZA6G2M.js +4 -0
- package/dist/chunk-EOFT3PNU.js +1 -0
- package/dist/chunk-ETFDYZVJ.js +1 -0
- package/dist/chunk-FUW7OD3H.js +1 -0
- package/dist/chunk-GRMSEMU7.js +1 -0
- package/dist/chunk-I7AUKTXE.js +1 -0
- package/dist/chunk-IANAVH2A.js +1 -0
- package/dist/chunk-JN2OGNK3.js +1 -0
- package/dist/chunk-JVMNMAHX.js +1 -0
- package/dist/chunk-K2QWNDXV.js +1 -0
- package/dist/chunk-KYNS3GBJ.js +2 -0
- package/dist/chunk-LI3ZYXUT.js +1 -0
- package/dist/chunk-LNEISTXM.js +1 -0
- package/dist/chunk-QABNK7IA.js +1 -0
- package/dist/chunk-QS5QXZNJ.js +1 -0
- package/dist/chunk-QTDRFJG2.js +1 -0
- package/dist/chunk-SVHITP3F.js +2 -0
- package/dist/chunk-UKVY43V3.js +1 -0
- package/dist/chunk-VIT4KE6Q.js +1 -0
- package/dist/chunk-XG5PVDOP.js +1 -0
- package/dist/chunk-XH5GTWCV.js +1 -0
- package/dist/chunk-XYMPBCYW.js +1 -0
- package/dist/chunk-YRSSCEAS.js +1 -0
- package/dist/chunk-ZL46COQF.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 +8172 -7777
- package/dist/components/index.js +5 -1
- package/dist/core/index.d.ts +4777 -3942
- 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-kCS9-NVF.d.ts} +2 -2
- package/dist/{doubleBuffer-CKQFmlPN.d.ts → doubleBuffer-CWASihKh.d.ts} +1 -1
- package/dist/errors/index.js +1 -1
- 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 +24 -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-COARA4CP.d.ts +1182 -0
- package/dist/interactiveSystem-h92W9W4n.d.ts +1977 -0
- package/dist/{keyParser-m7fWto6g.d.ts → keyParser-DReXe2j-.d.ts} +28 -28
- package/dist/{events-9ForpTfM.d.ts → mouseParser-CCqSEUVN.d.ts} +177 -2
- package/dist/{packedStore-BgvnEdE7.d.ts → packedStore-480t2X74.d.ts} +1 -1
- package/dist/panelMovement-DGzIQ8Ll.d.ts +1908 -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/systems/index.d.ts +785 -1882
- package/dist/systems/index.js +1 -1
- package/dist/terminal/index.d.ts +7563 -3387
- 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/text/index.d.ts +263 -0
- package/dist/text/index.js +3 -0
- package/dist/textWrap-Ct2J8gO6.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 +9 -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/mouseParser-B7p5ow7K.d.ts +0 -177
- package/dist/viewport3d-xI33-_wq.d.ts +0 -182
- package/dist/virtualViewport-DTSN6jFk.d.ts +0 -1856
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {b}from'./chunk-UKVY43V3.js';import {f as f$1,e}from'./chunk-JN2OGNK3.js';import {M as M$1,oa,ya as ya$1,za as za$1,h as h$1,xa as xa$1}from'./chunk-ETFDYZVJ.js';import {l,m as m$1,n,p as p$1,q as q$1,a}from'./chunk-7ZFQO3OQ.js';import {m as m$2,n as n$1,j as j$1}from'./chunk-Z4EZERNE.js';import {z as z$1}from'zod';function Fe(e){return typeof e=="string"?{target:e}:e}function Be(e){let t=e.initial,n=e.context,r=new Set;function o(u){if(u)for(let d of u)d(n);}function i(u){if(u!==t)for(let d of r)d(t,u);}let a=e.states[t];if(a?.entry)for(let u of a.entry)u(n);let x={get current(){return t},get context(){return n},send(u){let d=e.states[t];if(!d?.on)return false;let b=d.on[u];if(b===void 0)return false;let{target:k,actions:vn,guard:Se}=Fe(b);if(Se&&!Se(n))return false;let Wn=t;return o(d.exit),o(vn),t=k,o(e.states[t]?.entry),i(Wn),true},can(u){let d=e.states[t];if(!d?.on)return false;let b=d.on[u];if(b===void 0)return false;let{guard:k}=Fe(b);return !(k&&!k(n))},matches(u){return t===u},subscribe(u){return r.add(u),()=>{r.delete(u);}},validEvents(){let u=e.states[t];if(!u?.on)return [];let d=[];for(let b of Object.keys(u.on))x.can(b)&&d.push(b);return d},reset(){let u=t;o(e.states[t]?.exit),t=e.initial,o(e.states[t]?.entry),i(u);}};return x}var In=z$1.union([z$1.string(),z$1.object({target:z$1.string()})]),Tn=z$1.object({entry:z$1.array(z$1.function()).optional(),exit:z$1.array(z$1.function()).optional(),on:z$1.record(z$1.string(),In).optional()});z$1.object({initial:z$1.string(),states:z$1.record(z$1.string(),Tn),context:z$1.unknown().optional()});var An=1e4;function kn(e=An){return {machineId:new Uint32Array(e),currentState:new Uint16Array(e),previousState:new Uint16Array(e),stateAge:new Float32Array(e)}}var m=kn(),De=new WeakSet,Re=null;function R(e){return De.has(e)||(Re=p$1(e,q$1(()=>m)),De.add(e)),Re}var Rt=new Map,Lt=new Map,Ut=new Map,Le=1,D={register(e){let t=Le++,n=Be(e);Rt.set(t,n);let r=Object.keys(e.states),o=new Map;for(let i=0;i<r.length;i++){let a=r[i];a!==void 0&&o.set(a,i);}return Lt.set(t,o),Ut.set(t,r),t},getMachine(e){return Rt.get(e)},getStateIndex(e,t){return Lt.get(e)?.get(t)??0},getStateName(e,t){return Ut.get(e)?.[t]??""},unregister(e){Rt.delete(e),Lt.delete(e),Ut.delete(e);},clear(){Rt.clear(),Lt.clear(),Ut.clear(),Le=1;}};function I(e,t,n){let r=R(e),o=D.register(n),i=D.getStateIndex(o,n.initial);return l(e,t,r),m.machineId[t]=o,m.currentState[t]=i,m.previousState[t]=i,m.stateAge[t]=0,o}function Wo(e,t){let n$1=R(e);if(!m$1(e,t,n$1))return;let r=m.machineId[t]??0;D.unregister(r),n(e,t,n$1);}function h(e,t){let n=R(e);if(!m$1(e,t,n))return "";let r=m.machineId[t]??0,o=m.currentState[t]??0;return D.getStateName(r,o)}function Io(e,t){let n=R(e);if(!m$1(e,t,n))return "";let r=m.machineId[t]??0,o=m.previousState[t]??0;return D.getStateName(r,o)}function W(e,t,n){let r=R(e);if(!m$1(e,t,r))return false;let o=m.machineId[t]??0,i=D.getMachine(o);if(!i)return false;let a=i.current,x=i.send(n);if(x){let u=D.getStateIndex(o,i.current),d=D.getStateIndex(o,a);m.previousState[t]=d,m.currentState[t]=u,m.stateAge[t]=0;}return x}function To(e,t,n){let r=R(e);if(!m$1(e,t,r))return false;let o=m.machineId[t]??0,i=D.getMachine(o);return i?i.can(n):false}function Ao(e,t){let n=R(e);return m$1(e,t,n)?m.stateAge[t]??0:0}function P(e,t,n){return h(e,t)===n}function ko(e,t,n){let r=R(e);for(let o of t)if(m$1(e,o,r)){let i=m.stateAge[o]??0;m.stateAge[o]=i+n;}}function T(e,t){let n=R(e);return m$1(e,t,n)}var _n={initial:"unchecked",states:{unchecked:{on:{toggle:"checked",check:"checked",disable:"disabled"}},checked:{on:{toggle:"unchecked",uncheck:"unchecked",disable:"disabled"}},disabled:{on:{enable:"unchecked"}}}},Mn=1e4;function Fn(e=Mn){return {isCheckbox:new Uint8Array(e),machineId:new Uint32Array(e)}}var bt=Fn(),$=new Map,Ue="\u2611",Oe="\u2610",mt=new Map;function Bo(){bt.isCheckbox.fill(0),bt.machineId.fill(0),$.clear(),mt.clear();}function Do(e,t,n=false){let r=I(e,t,_n);return bt.isCheckbox[t]=1,bt.machineId[t]=r,n&&W(e,t,"check"),r}function L(e,t){return (bt.isCheckbox[t]??0)===1&&T(e,t)}function zt(e,t){if(L(e,t))return h(e,t)}function ht(e,t,n){if(!L(e,t))return false;let r=h(e,t),o=W(e,t,n);if(o){M$1(e,t);let i=h(e,t);(r==="checked"||r==="unchecked")&&(i==="checked"||i==="unchecked")&&r!==i&&Ln(e,t,i==="checked");}return o}function jt(e,t,n){return L(e,t)?P(e,t,n):false}function Pe(e,t){return jt(e,t,"checked")}function Ro(e,t){return jt(e,t,"unchecked")}function Lo(e,t){return jt(e,t,"disabled")}function Bn(e,t){return ht(e,t,"toggle")}function Dn(e,t){return ht(e,t,"check")}function Rn(e,t){return ht(e,t,"uncheck")}function Uo(e,t){return ht(e,t,"disable")}function Oo(e,t){return ht(e,t,"enable")}function He(e,t,n){if(!L(e,t))return false;let r=zt(e,t);return r==="disabled"?false:n&&r==="unchecked"?Dn(e,t):!n&&r==="checked"?Rn(e,t):false}function Po(e,t,n){let r=$.get(t);return r||(r=[],$.set(t,r)),r.push(n),()=>{let o=$.get(t);if(o){let i=o.indexOf(n);i!==-1&&o.splice(i,1);}}}function Ln(e,t,n){let r=$.get(t);if(r)for(let o of r)o(n);}function Ho(e,t){$.delete(t);}function Vo(e,t,n){return !L(e,t)||zt(e,t)==="disabled"?false:n==="return"||n==="enter"||n==="space"?(Bn(e,t),true):false}function wo(e,t,n){let r=mt.get(t)??{checkedChar:Ue,uncheckedChar:Oe};mt.set(t,{checkedChar:n.checkedChar??r.checkedChar,uncheckedChar:n.uncheckedChar??r.uncheckedChar});}function Un(e,t){return mt.get(t)??{checkedChar:Ue,uncheckedChar:Oe}}function No(e,t){let n=Un(e,t);return zt(e,t)==="checked"?n.checkedChar:n.uncheckedChar}function Yo(e,t){mt.delete(t);}var On={initial:"idle",states:{idle:{on:{mouseenter:"hovered",focus:"focused",disable:"disabled"}},hovered:{on:{mousedown:"pressed",mouseleave:"idle",focus:"focused",disable:"disabled"}},pressed:{on:{mouseup:"hovered",mouseleave:"idle"}},focused:{on:{blur:"idle",mouseenter:"hovered",disable:"disabled"}},disabled:{on:{enable:"idle"}}}},Pn=1e4;function Hn(e=Pn){return {isButton:new Uint8Array(e),machineId:new Uint32Array(e)}}var Et=Hn(),q=new Map;function zo(){Et.isButton.fill(0),Et.machineId.fill(0),q.clear();}function jo(e,t){let n=I(e,t,On);return Et.isButton[t]=1,Et.machineId[t]=n,n}function Y(e,t){return (Et.isButton[t]??0)===1&&T(e,t)}function Ot(e,t){if(Y(e,t))return h(e,t)}function Ve(e,t,n){if(!Y(e,t))return false;let r=h(e,t),o=W(e,t,n);return o&&(M$1(e,t),r==="pressed"&&n==="mouseup"&&we(t)),o}function Pt(e,t,n){return Y(e,t)?P(e,t,n):false}function $o(e,t){return Pt(e,t,"hovered")}function qo(e,t){return Pt(e,t,"pressed")}function Jo(e,t){return Pt(e,t,"focused")}function Qo(e,t){return Pt(e,t,"disabled")}function Zo(e,t){return Ve(e,t,"disable")}function ti(e,t){return Ve(e,t,"enable")}function ei(e,t){let n=q.get(e);return n||(n=[],q.set(e,n)),n.push(t),()=>{let r=q.get(e);if(r){let o=r.indexOf(t);o!==-1&&r.splice(o,1);}}}function we(e){let t=q.get(e);if(t)for(let n of t)n();}function Vn(e,t){return !Y(e,t)||Ot(e,t)==="disabled"?false:(we(t),true)}function ni(e){q.delete(e);}function ri(e,t,n){if(!Y(e,t))return false;let r=Ot(e,t);return r==="disabled"||r!=="focused"?false:n==="return"||n==="enter"||n==="space"?(Vn(e,t),true):false}var $t={initial:"idle",states:{idle:{on:{focus:"focused",disable:"disabled"}},focused:{on:{startEdit:"editing",blur:"idle",error:"error",disable:"disabled"}},editing:{on:{endEdit:"focused",blur:"idle",error:"error"}},error:{on:{clearError:"focused",blur:"idle",disable:"disabled"}},disabled:{on:{enable:"idle"}}}},qt=1e4,F={Line:0,Block:1},Jt=530,J="*",Q="",Qt="\u2502",Zt="\u2588",B=new Map,H=new Map,V=new Map,w=new Map,U=new Map,St=new Map;function wn(e=qt){return {isTextInput:new Uint8Array(e),machineId:new Uint32Array(e),cursorPos:new Uint32Array(e),selectionStart:new Int32Array(e).fill(-1),selectionEnd:new Int32Array(e).fill(-1),inputMode:new Uint8Array(e),cursorMode:new Uint8Array(e),cursorBlink:new Uint8Array(e).fill(1),cursorBlinkStart:new Float64Array(e)}}var f=wn();function Nn(){f.isTextInput.fill(0),f.machineId.fill(0),f.cursorPos.fill(0),f.selectionStart.fill(-1),f.selectionEnd.fill(-1),f.inputMode.fill(0),f.cursorMode.fill(0),f.cursorBlink.fill(1),f.cursorBlinkStart.fill(0),B.clear(),H.clear(),V.clear(),w.clear(),St.clear(),U.clear();}function Yn(e,t){let n=I(e,t,$t);return f.isTextInput[t]=1,f.machineId[t]=n,f.cursorPos[t]=0,f.selectionStart[t]=-1,f.selectionEnd[t]=-1,f.inputMode[t]=0,f.cursorMode[t]=F.Line,f.cursorBlink[t]=1,f.cursorBlinkStart[t]=Date.now(),B.set(t,{secret:false,censor:J,placeholder:Q,maxLength:0,multiline:false}),n}function S(e,t){return (f.isTextInput[t]??0)===1&&T(e,t)}function Z(e,t){if(S(e,t))return h(e,t)}function O(e,t,n){if(!S(e,t))return false;let r=W(e,t,n);if(r){M$1(e,t);let o=h(e,t);f.inputMode[t]=o==="editing"?1:0;}return r}function Ht(e,t,n){return S(e,t)?P(e,t,n):false}function Xn(e,t){let n=Z(e,t);return n==="focused"||n==="editing"}function Kn(e,t){return Ht(e,t,"editing")}function Gn(e,t){return Ht(e,t,"error")}function zn(e,t){return Ht(e,t,"disabled")}function te(e,t){return O(e,t,"focus")}function jn(e,t){return O(e,t,"blur")}function $n(e,t){return O(e,t,"startEdit")}function qn(e,t){return O(e,t,"endEdit")}function Jn(e,t){return O(e,t,"disable")}function Qn(e,t){return O(e,t,"enable")}function Zn(e,t){return O(e,t,"error")}function tr(e,t){return O(e,t,"clearError")}function er(e,t,n){let r=B.get(t)??{secret:false,censor:J,placeholder:Q,maxLength:0,multiline:false,validator:void 0,validationTiming:"both"};B.set(t,{secret:n.secret??r.secret,censor:n.censor??r.censor,placeholder:n.placeholder??r.placeholder,maxLength:n.maxLength??r.maxLength,multiline:n.multiline??r.multiline,validator:n.validator??r.validator,validationTiming:n.validationTiming??r.validationTiming});}function C(e,t){return B.get(t)??{secret:false,censor:J,placeholder:Q,maxLength:0,multiline:false,validator:void 0,validationTiming:"both"}}function Ne(e,t){return C(e,t).secret}function Ye(e,t){return C(e,t).censor}function nr(e,t){return C(e,t).placeholder}function rr(e,t){return C(e,t).maxLength}function or(e,t){return C(e,t).multiline}function ir(e,t,n){return Ne(e,t)?Ye(e,t).repeat(n.length):n}function ee(e,t,n){let r=C(e,t);if(!r.validator)return U.set(t,null),true;let o=r.validator(n);return o===true?(U.set(t,null),true):o===false?(U.set(t,"Invalid input"),false):(U.set(t,o),false)}function lr(e,t,n){let r=H.get(t);return r||(r=[],H.set(t,r)),r.push(n),()=>{let o=H.get(t);if(o){let i=o.indexOf(n);i!==-1&&o.splice(i,1);}}}function ar(e,t,n){let r=V.get(t);return r||(r=[],V.set(t,r)),r.push(n),()=>{let o=V.get(t);if(o){let i=o.indexOf(n);i!==-1&&o.splice(i,1);}}}function sr(e,t,n){let r=w.get(t);return r||(r=[],w.set(t,r)),r.push(n),()=>{let o=w.get(t);if(o){let i=o.indexOf(n);i!==-1&&o.splice(i,1);}}}function cr(e,t,n){let r=C(e,t);r.validator&&(r.validationTiming==="onChange"||r.validationTiming==="both")&&ee(e,t,n);let o=H.get(t);if(o)for(let i of o)i(n);}function ur(e,t,n){let r=C(e,t);if(r.validator&&(r.validationTiming==="onSubmit"||r.validationTiming==="both")&&!ee(e,t,n))return false;let o=V.get(t);if(o)for(let i of o)i(n);return true}function fr(e,t){let n=w.get(t);if(n)for(let r of n)r();}function pr(e,t){H.delete(t),V.delete(t),w.delete(t),B.delete(t),U.delete(t);}function tt(e,t){return f.cursorPos[t]??0}function Xe(e,t,n){S(e,t)&&(f.cursorPos[t]=Math.max(0,n),f.cursorBlinkStart[t]=Date.now(),M$1(e,t));}function dr(e,t,n){let r=tt(e,t);Xe(e,t,r+n);}function Vt(e,t){let n=f.selectionStart[t],r=f.selectionEnd[t];return n===void 0||r===void 0||n<0||r<0?null:[n,r]}function gr(e,t,n,r){S(e,t)&&(f.selectionStart[t]=n,f.selectionEnd[t]=r,M$1(e,t));}function xr(e,t){S(e,t)&&(f.selectionStart[t]=-1,f.selectionEnd[t]=-1,M$1(e,t));}function yr(e,t){return Vt(e,t)!==null}function Ct(e,t){return St.get(t)??{blink:true,blinkIntervalMs:Jt,lineChar:Qt,blockChar:Zt}}function br(e,t,n){let r=Ct(e,t);St.set(t,{blink:n.blink??r.blink,blinkIntervalMs:n.blinkIntervalMs??r.blinkIntervalMs,lineChar:n.lineChar??r.lineChar,blockChar:n.blockChar??r.blockChar});}function vt(e,t){return f.cursorMode[t]??0}function Ke(e,t,n){S(e,t)&&(f.cursorMode[t]=n,M$1(e,t));}function mr(e,t){let r=vt(e,t)===F.Line?F.Block:F.Line;return Ke(e,t,r),r}function ne(e,t){return (f.cursorBlink[t]??1)===1}function hr(e,t,n){S(e,t)&&(f.cursorBlink[t]=n?1:0,n&&(f.cursorBlinkStart[t]=Date.now()),M$1(e,t));}function Er(e,t){f.cursorBlinkStart[t]=Date.now();}function re(e,t){let n=Ct(e,t);return vt(e,t)===F.Block?n.blockChar:n.lineChar}function Sr(e,t,n){return e.multiline?e.maxLength>0&&n.length>=e.maxLength?null:{type:"newline",position:t}:{type:"submit",value:n}}function Cr(e,t){return e.multiline?{type:"submit",value:t}:{type:"cancel"}}function vr(e,t,n){return e==="left"&&t>0?{type:"moveCursor",position:t-1}:e==="right"&&t<n?{type:"moveCursor",position:t+1}:e==="home"&&t!==0?{type:"moveCursor",position:0}:e==="end"&&t!==n?{type:"moveCursor",position:n}:null}function Wr(e,t,n){return e==="backspace"&&t>0?{type:"delete",start:t-1,end:t}:e==="delete"&&t<n?{type:"delete",start:t,end:t+1}:null}function Ir(e,t,n){return e==="left"?{type:"moveWordLeft",text:n,position:t}:e==="right"?{type:"moveWordRight",text:n,position:t}:e==="backspace"?{type:"deleteWordBackward",text:n,position:t}:e==="delete"?{type:"deleteWordForward",text:n,position:t}:null}function Tr(e,t,n,r){return e.length!==1||n.maxLength>0&&r>=n.maxLength?null:{type:"insert",char:e,position:t}}function Ar(e,t,n,r,o=false){if(!S(e,t))return null;let i=Z(e,t);if(i==="disabled")return null;if(i==="idle")return te(e,t),null;let a=tt(e,t),x=C(e,t),u=r.length;if(n==="return"||n==="enter")return Sr(x,a,r);if(n==="escape")return Cr(x,r);if(o){let k=Ir(n,a,r);if(k)return k}let d=Wr(n,a,u);if(d)return d;let b=vr(n,a,u);return b||Tr(n,a,x,u)}function Ge(e,t){let n=Z(e,t);if(n!=="focused"&&n!=="editing")return false;if(!ne(e,t))return true;let r=Ct(e,t),o=f.cursorBlinkStart[t]??Date.now(),i=Date.now()-o;return Math.floor(i/r.blinkIntervalMs)%2===0}function kr(e,t,n){let r=C(e,t),o=tt(e,t),i=n;if(r.secret&&(i=r.censor.repeat(n.length)),i.length===0&&r.placeholder)return {displayText:r.placeholder,cursorVisible:false,cursorPosition:0};if(!Ge(e,t))return {displayText:i,cursorVisible:false,cursorPosition:o};let x=re(e,t),u=vt(e,t),d;return u===F.Block&&o<i.length?d=i.substring(0,o)+x+i.substring(o+1):d=i.substring(0,o)+x+i.substring(o),{displayText:d,cursorVisible:true,cursorPosition:o}}function _r(e,t){let n=Vt(e,t);if(!n)return null;let[r,o]=n;return {start:Math.min(r,o),end:Math.max(r,o)}}var Mr=1e4,ze=1,je=2;function Fr(e=Mr){return {isForm:new Uint8Array(e),flags:new Uint8Array(e)}}var X=Fr(),K=new Map,Wt=new Map,et=new Map,nt=new Map;function Zi(){X.isForm.fill(0),X.flags.fill(0),K.clear(),Wt.clear(),et.clear(),nt.clear();}function tl(e,t,n={}){X.isForm[t]=1;let r=0;n.keys!==false&&(r|=ze),n.submitOnEnter!==false&&(r|=je),X.flags[t]=r,K.set(t,new Map),Wt.set(t,new Map),M$1(e,t);}function $e(e,t){return X.isForm[t]===1}function Br(e,t){return (X.flags[t]&ze)!==0}function Dr(e,t){return (X.flags[t]&je)!==0}function Rr(e,t,n,r,o){if(!$e(e,t))return;let i=K.get(t),a=Wt.get(t);i&&a&&(i.set(n,r),o!==void 0?a.set(n,o):a.set(n,Je(e,n)));}function el(e,t,n){let r=K.get(t),o=Wt.get(t);r&&r.delete(n),o&&o.delete(n);}function qe(e,t){let n=K.get(t);return n?Array.from(n.keys()):[]}function nl(e,t){return K.get(e)?.get(t)}function Je(e,t){return S(e,t)?f$1(e,t)??"":L(e,t)?Pe(e,t):Y(e,t)?Ot(e,t)==="pressed":f$1(e,t)??null}function Lr(e$1,t,n){if(S(e$1,t)){e(e$1,t,String(n??""));return}if(L(e$1,t)){He(e$1,t,!!n);return}n!==null&&e(e$1,t,String(n));}function Ur(e,t){let n={},r=K.get(t);if(!r)return n;for(let[o,i]of r)n[i]=Je(e,o);return n}function rl(e,t){let n=Wt.get(t);if(!n)return;for(let[o,i]of n)Lr(e,o,i);let r=nt.get(t);if(r)for(let o of r)o();M$1(e,t);}function Or(e,t){let n=Ur(e,t),r=et.get(t);if(r)for(let o of r)o(n);return n}function ol(e,t,n){let r=et.get(t)??[];return r.push(n),et.set(t,r),()=>{let o=et.get(t);if(o){let i=o.indexOf(n);i!==-1&&o.splice(i,1);}}}function il(e,t,n){let r=nt.get(t)??[];return r.push(n),nt.set(t,r),()=>{let o=nt.get(t);if(o){let i=o.indexOf(n);i!==-1&&o.splice(i,1);}}}function ll(e,t){et.delete(t),nt.delete(t);}function Pr(e,t){let r=qe(e,t).filter(o=>oa(e,o));return ya$1(e,r)}function Hr(e,t){let r=qe(e,t).filter(o=>oa(e,o));return za$1(e,r)}function al(e,t){let r=h$1(e,t).filter(o=>oa(e,o));return xa$1(e,r)}function sl(e,t,n,r){return !$e(e,t)||!Br(e,t)?false:n==="tab"?(r?Hr(e,t):Pr(e,t),true):(n==="return"||n==="enter")&&Dr(e,t)?(Or(e,t),true):false}function cl(e,t,n="field_"){let r=h$1(e,t);for(let o of r)if(S(e,o)||L(e,o)){let i=`${n}${o}`;Rr(e,t,o,i);}}var Vr=1e4,It={Horizontal:0,Vertical:1};function wr(e=Vr){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 p=wr(),Qe="\u2588",Ze="\u2591",tn="\u2588",en="\u2591",Tt=new Map,rt=new Map,ot=new Map;function pl(){p.isProgressBar.fill(0),p.value.fill(0),p.min.fill(0),p.max.fill(0),p.orientation.fill(0),p.showPercentage.fill(0),Tt.clear(),rt.clear(),ot.clear();}function dl(e,t,n={}){p.isProgressBar[t]=1,p.min[t]=n.min??0,p.max[t]=n.max??100,p.value[t]=n.value??0,p.orientation[t]=n.orientation??It.Horizontal,p.showPercentage[t]=n.showPercentage?1:0,Nr(e,t,{}),M$1(e,t);}function gl(e,t){return p.isProgressBar[t]===1}function xl(e,t){return p.value[t]}function yl(e,t){return p.min[t]}function bl(e,t){return p.max[t]}function nn(e,t){let n=p.min[t],r=p.max[t],o=p.value[t];return r===n?0:(o-n)/(r-n)*100}function ml(e,t){return p.orientation[t]}function hl(e,t){return p.showPercentage[t]===1}function At(e,t,n){let r=p.min[t],o=p.max[t],i=p.value[t],a=Math.max(r,Math.min(o,n));if(p.value[t]=a,M$1(e,t),a!==i){let x=nn(e,t);Xr(e,t,a,x),a===o&&i<o&&Yr(e,t);}}function El(e,t,n=1){let r=p.value[t];At(e,t,r+n);}function Sl(e,t,n=1){let r=p.value[t];At(e,t,r-n);}function Cl(e,t){let n=p.min[t];At(e,t,n);}function vl(e,t){let n=p.max[t];At(e,t,n);}function Wl(e,t){let n=p.max[t];return p.value[t]>=n}function Nr(e,t,n){let r=Tt.get(t),o=p.orientation[t],i=o===It.Vertical?tn:Qe,a=o===It.Vertical?en:Ze;Tt.set(t,{fillChar:n.fillChar??r?.fillChar??i,emptyChar:n.emptyChar??r?.emptyChar??a,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 oe(e,t){let n=Tt.get(t);if(n)return n;let r=p.orientation[t],o=r===It.Vertical?tn:Qe,i=r===It.Vertical?en:Ze;return {fillChar:o,emptyChar:i,fillFg:16711935,fillBg:255,emptyFg:1717987071,emptyBg:255}}function Il(e,t){Tt.delete(t);}function Tl(e,t){return oe(e,t).fillChar}function Al(e,t){return oe(e,t).emptyChar}function kl(e,t,n){let r=nn(e,t)/100,o=oe(e,t),i=Math.round(n*r),a=n-i;return o.fillChar.repeat(i)+o.emptyChar.repeat(a)}function _l(e,t,n){let r=rt.get(t)??[];return r.push(n),rt.set(t,r),()=>{let o=rt.get(t);if(o){let i=o.indexOf(n);i!==-1&&o.splice(i,1);}}}function Ml(e,t,n){let r=ot.get(t)??[];return r.push(n),ot.set(t,r),()=>{let o=ot.get(t);if(o){let i=o.indexOf(n);i!==-1&&o.splice(i,1);}}}function Yr(e,t){let n=rt.get(t);if(n)for(let r of n)r();}function Xr(e,t,n,r){let o=ot.get(t);if(o)for(let i of o)i(n,r);}function Fl(e,t){rt.delete(t),ot.delete(t);}function Bl(e,t,n){p.orientation[t]=n,M$1(e,t);}function Dl(e,t,n){p.showPercentage[t]=n?1:0,M$1(e,t);}function Rl(e,t,n,r){p.min[t]=n,p.max[t]=r;let o=p.value[t];(o<n||o>r)&&At(e,t,Math.max(n,Math.min(r,o))),M$1(e,t);}var Kr={initial:"unselected",states:{unselected:{on:{select:"selected",disable:"disabled"}},selected:{on:{deselect:"unselected",disable:"disabled"}},disabled:{on:{enable:"unselected"}}}},rn=1e4;function Gr(e=rn){return {isRadioButton:new Uint8Array(e),machineId:new Uint32Array(e),radioSetId:new Uint32Array(e)}}var v=Gr();function zr(e=rn){return {isRadioSet:new Uint8Array(e),selectedButton:new Uint32Array(e)}}var M=zr(),on="\u25C9",ln="\u25CB",kt=new Map,lt=new Map,it=new Map;function Pl(){v.isRadioButton.fill(0),v.machineId.fill(0),v.radioSetId.fill(0),M.isRadioSet.fill(0),M.selectedButton.fill(0),kt.clear(),lt.clear(),it.clear();}function Hl(e,t){M.isRadioSet[t]=1,M.selectedButton[t]=0,M$1(e,t);}function Vl(e,t){return M.isRadioSet[t]===1}function jr(e,t){return M.selectedButton[t]}function wl(e,t){let n=M.selectedButton[t];return n===0?null:lt.get(n)??null}function Nl(e,t,n){let r=it.get(t)??[];return r.push(n),it.set(t,r),()=>{let o=it.get(t);if(o){let i=o.indexOf(n);i!==-1&&o.splice(i,1);}}}function an(e,t){let n=it.get(t);if(n){let r=jr(e,t),o=r!==0?lt.get(r)??null:null;for(let i of n)i(o,r!==0?r:null);}}function Yl(e,t){it.delete(t);}function Xl(e,t,n){v.isRadioButton[t]=1,v.radioSetId[t]=n??0;let r=I(e,t,Kr);return v.machineId[t]=r,qr(e,t,{}),M$1(e,t),r}function at(e,t){return v.isRadioButton[t]===1}function Kl(e,t){if(at(e,t)&&T(e,t))return h(e,t)}function _t(e,t,n){return at(e,t)?W(e,t,n):false}function sn(e,t,n){return at(e,t)?P(e,t,n):false}function $r(e,t){return sn(e,t,"selected")}function cn(e,t){return sn(e,t,"disabled")}function Gl(e,t){return v.radioSetId[t]}function zl(e,t,n){v.radioSetId[t]=n;}function jl(e,t){return lt.get(t)}function $l(e,t,n){lt.set(t,n);}function un(e,t){if(!at(e,t)||cn(e,t))return;let n=v.radioSetId[t];if(n!==0){let r=M.selectedButton[n];r!==0&&r!==t&&_t(e,r,"deselect"),M.selectedButton[n]=t;}_t(e,t,"select"),M$1(e,t),n!==0&&an(e,n);}function ql(e,t){if(!at(e,t))return;_t(e,t,"deselect");let n=v.radioSetId[t];n!==0&&M.selectedButton[n]===t&&(M.selectedButton[n]=0,an(e,n)),M$1(e,t);}function Jl(e,t){_t(e,t,"disable"),M$1(e,t);}function Ql(e,t){_t(e,t,"enable"),M$1(e,t);}function qr(e,t,n){let r=kt.get(t);kt.set(t,{selectedChar:n.selectedChar??r?.selectedChar??on,unselectedChar:n.unselectedChar??r?.unselectedChar??ln});}function Jr(e,t){return kt.get(t)??{selectedChar:on,unselectedChar:ln}}function Zl(e,t){let n=Jr(e,t);return $r(e,t)?n.selectedChar:n.unselectedChar}function ta(e,t){kt.delete(t);}function ea(e,t,n){return !at(e,t)||cn(e,t)?false:n==="space"||n==="return"||n==="enter"?(un(e,t),true):false}function Qr(e){let t=[];for(let n=0;n<v.isRadioButton.length;n++)v.isRadioButton[n]===1&&v.radioSetId[n]===e&&t.push(n);return t}function na(e,t,n){let r=Qr(t);for(let o of r)if(lt.get(o)===n)return un(e,o),true;return false}var ie="\u25BC",le="\u25B2",ae="\u25CF",se=" ";var g={isSelect:new Uint8Array(1e4),selectedIndex:new Int32Array(1e4).fill(-1),highlightedIndex:new Int32Array(1e4).fill(0),optionCount:new Uint32Array(1e4)},fn={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 G(e){return a(e,"select:options")}function Mt(e){return a(e,"select:display")}function st(e){return a(e,"select:changeCallbacks")}function ct(e){return a(e,"select:openCallbacks")}function ut(e){return a(e,"select:closeCallbacks")}function pn(e,t){let n=t.get(e);if(n)for(let r of n)r();}function Zr(e,t,n,r){n!=="open"&&r==="open"?pn(t,ct(e)):n==="open"&&r!=="open"&&pn(t,ut(e));}function ca(e,t,n=[],r=-1){g.isSelect[t]=1,g.selectedIndex[t]=r,g.highlightedIndex[t]=r>=0?r:0,g.optionCount[t]=n.length,G(e).set(t,[...n]),I(e,t,fn);}function dn(e,t){return g.isSelect[t]===1&&T(e,t)}function wt(e,t){return h(e,t)??"closed"}function gn(e,t,n){return wt(e,t)===n}function to(e,t){return gn(e,t,"open")}function eo(e,t){return gn(e,t,"disabled")}function ft(e,t,n){if(!dn(e,t))return false;let r=wt(e,t),o=W(e,t,n);if(o){let i=wt(e,t);M$1(e,t),Zr(e,t,r,i);}return o}function ua(e,t){return ft(e,t,"open")}function fa(e,t){return ft(e,t,"close")}function pa(e,t){return ft(e,t,"toggle")}function da(e,t){return ft(e,t,"disable")}function ga(e,t){return ft(e,t,"enable")}function xa(e,t){return G(e).get(t)??[]}function ya(e,t,n){G(e).set(t,[...n]),g.optionCount[t]=n.length,(g.selectedIndex[t]??-1)>=n.length&&(g.selectedIndex[t]=n.length>0?0:-1),g.highlightedIndex[t]=0,M$1(e,t);}function ba(e,t){return g.optionCount[t]??0}function no(e,t,n){return G(e).get(t)?.[n]}function ma(e,t){return g.selectedIndex[t]??-1}function xn(e,t){let n=g.selectedIndex[t]??-1;if(!(n<0))return no(e,t,n)}function ha(e,t){return xn(e,t)?.value}function Ea(e,t){return xn(e,t)?.label}function yn(e,t,n){let r=G(e).get(t);if(!r||n<0||n>=r.length||(g.selectedIndex[t]??-1)===n)return false;g.selectedIndex[t]=n,g.highlightedIndex[t]=n,M$1(e,t);let i=r[n],a=st(e).get(t);if(a&&i)for(let x of a)x(i.value,i.label,n);return ft(e,t,"select"),true}function Sa(e,t,n){let r=G(e).get(t);if(!r)return false;let o=r.findIndex(i=>i.value===n);return o<0?false:yn(e,t,o)}function Ca(e,t){g.selectedIndex[t]=-1,M$1(e,t);}function ro(e,t){return g.highlightedIndex[t]??0}function bn(e,t,n){let r=g.optionCount[t]??0;if(r===0)return;let o=Math.max(0,Math.min(n,r-1));g.highlightedIndex[t]=o,M$1(e,t);}function va(e,t,n=true){let r=g.optionCount[t]??0;if(r===0)return;let o=(g.highlightedIndex[t]??0)+1;o>=r&&(o=n?0:r-1),bn(e,t,o);}function Wa(e,t,n=true){let r=g.optionCount[t]??0;if(r===0)return;let o=(g.highlightedIndex[t]??0)-1;o<0&&(o=n?r-1:0),bn(e,t,o);}function Ia(e,t){let n=g.highlightedIndex[t]??0;return yn(e,t,n)}function Ta(e,t,n){let r=Mt(e).get(t);Mt(e).set(t,{closedIndicator:n.closedIndicator??r?.closedIndicator??"\u25BC",openIndicator:n.openIndicator??r?.openIndicator??"\u25B2",selectedMark:n.selectedMark??r?.selectedMark??"\u25CF",separator:n.separator??r?.separator??" "});}function oo(e,t){return Mt(e).get(t)??{closedIndicator:"\u25BC",openIndicator:"\u25B2",selectedMark:"\u25CF",separator:" "}}function Aa(e,t){Mt(e).delete(t);}function ka(e,t){let n=oo(e,t);return wt(e,t)==="open"?n.openIndicator:n.closedIndicator}function _a(e,t,n){let r=st(e).get(t)??[];return r.push(n),st(e).set(t,r),()=>{let o=st(e).get(t);if(o){let i=o.indexOf(n);i!==-1&&o.splice(i,1);}}}function Ma(e,t,n){let r=ct(e).get(t)??[];return r.push(n),ct(e).set(t,r),()=>{let o=ct(e).get(t);if(o){let i=o.indexOf(n);i!==-1&&o.splice(i,1);}}}function Fa(e,t,n){let r=ut(e).get(t)??[];return r.push(n),ut(e).set(t,r),()=>{let o=ut(e).get(t);if(o){let i=o.indexOf(n);i!==-1&&o.splice(i,1);}}}function Ba(e,t){st(e).delete(t),ct(e).delete(t),ut(e).delete(t);}function Da(e,t,n){if(!dn(e,t)||eo(e,t))return null;let r=to(e,t);switch(n){case "return":case "enter":case "space":return r?{type:"select",index:ro(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 Ra(e){g.isSelect.fill(0),g.selectedIndex.fill(-1),g.highlightedIndex.fill(0),g.optionCount.fill(0),G(e).clear(),Mt(e).clear(),st(e).clear(),ct(e).clear(),ut(e).clear();}var N={Horizontal:0,Vertical:1},ce="\u2500",ue="\u2502",fe="\u25CF",pe="\u2501",de="\u2503",ge=1717987071,xe=255,ye=4294967295,be=6750207,me=16711935,he=255,z=1e4,s={isSlider:new Uint8Array(z),value:new Float32Array(z),min:new Float32Array(z),max:new Float32Array(z).fill(100),step:new Float32Array(z).fill(1),orientation:new Uint8Array(z),showValue:new Uint8Array(z)},mn={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 Ft(e){return a(e,"slider:display")}function pt(e){return a(e,"slider:changeCallbacks")}function dt(e){return a(e,"slider:dragStartCallbacks")}function gt(e){return a(e,"slider:dragEndCallbacks")}function Ee(e,t,n){return Math.max(t,Math.min(n,e))}function En(e,t,n){return t<=0?e:n+Math.round((e-n)/t)*t}function hn(e,t){let n=t.get(e);if(n)for(let r of n)r();}function lo(e,t,n,r){n!=="dragging"&&r==="dragging"?hn(t,dt(e)):n==="dragging"&&r!=="dragging"&&hn(t,gt(e));}function Ya(e,t,n=0,r=100,o=0,i=1){s.isSlider[t]=1,s.min[t]=n,s.max[t]=r,s.value[t]=Ee(o,n,r),s.step[t]=i,s.orientation[t]=N.Horizontal,s.showValue[t]=0,I(e,t,mn);}function Sn(e,t){return s.isSlider[t]===1&&T(e,t)}function Nt(e,t){return h(e,t)??"idle"}function Cn(e,t,n){return Nt(e,t)===n}function Xa(e,t){let n=Nt(e,t);return n==="focused"||n==="dragging"}function Ka(e,t){return Cn(e,t,"dragging")}function ao(e,t){return Cn(e,t,"disabled")}function xt(e,t,n){if(!Sn(e,t))return false;let r=Nt(e,t),o=W(e,t,n);if(o){let i=Nt(e,t);M$1(e,t),lo(e,t,r,i);}return o}function Ga(e,t){return xt(e,t,"focus")}function za(e,t){return xt(e,t,"blur")}function ja(e,t){return xt(e,t,"dragStart")}function $a(e,t){return xt(e,t,"dragEnd")}function qa(e,t){return xt(e,t,"disable")}function Ja(e,t){return xt(e,t,"enable")}function so(e,t){return s.value[t]??0}function j(e,t,n){let r=s.min[t]??0,o=s.max[t]??100,i=s.step[t]??1,a=Ee(En(n,i,r),r,o),x=s.value[t]??0;if(a!==x){s.value[t]=a,M$1(e,t);let u=pt(e).get(t);if(u)for(let d of u)d(a);}}function Qa(e,t){return s.min[t]??0}function Za(e,t){return s.max[t]??100}function ts(e,t){return s.step[t]??1}function es(e,t,n,r){m$2.parse({min:n,max:r}),s.min[t]=n,s.max[t]=r;let o=s.value[t]??0,i=Ee(o,n,r);i!==o&&j(e,t,i),M$1(e,t);}function ns(e,t,n){n$1.parse(n),s.step[t]=n;let r=s.value[t]??0,o=s.min[t]??0,i=En(r,n,o);i!==r&&j(e,t,i),M$1(e,t);}function co(e,t){let n=s.min[t]??0,r=s.max[t]??100,o=s.value[t]??0;return r===n?0:(o-n)/(r-n)}function rs(e,t,n){z$1.number().finite().parse(n);let r=s.min[t]??0,o=s.max[t]??100,i=Math.max(0,Math.min(1,n)),a=r+i*(o-r);j(e,t,a);}function os(e,t,n=1){let r=s.step[t]??1,o=s.value[t]??0;j(e,t,o+r*n);}function is(e,t,n=1){let r=s.step[t]??1,o=s.value[t]??0;j(e,t,o-r*n);}function ls(e,t){j(e,t,s.min[t]??0);}function as(e,t){j(e,t,s.max[t]??100);}function Yt(e,t){return s.orientation[t]}function ss(e,t,n){s.orientation[t]=n,M$1(e,t);}function uo(e,t){return Yt(e,t)===N.Horizontal}function cs(e,t){return Yt(e,t)===N.Vertical}function fo(e,t){return s.showValue[t]===1}function us(e,t,n){s.showValue[t]=n?1:0,M$1(e,t);}function fs(e,t,n){let r=Ft(e).get(t),o=Yt(e,t),i=o===N.Vertical?ue:ce,a=o===N.Vertical?de:pe;Ft(e).set(t,{trackChar:n.trackChar??r?.trackChar??i,thumbChar:n.thumbChar??r?.thumbChar??fe,fillChar:n.fillChar??r?.fillChar??a,trackFg:n.trackFg??r?.trackFg??ge,trackBg:n.trackBg??r?.trackBg??xe,thumbFg:n.thumbFg??r?.thumbFg??ye,thumbBg:n.thumbBg??r?.thumbBg??be,fillFg:n.fillFg??r?.fillFg??me,fillBg:n.fillBg??r?.fillBg??he});}function po(e,t){let n=Yt(e,t),r=n===N.Vertical?ue:ce,o=n===N.Vertical?de:pe;return Ft(e).get(t)??{trackChar:r,thumbChar:fe,fillChar:o,trackFg:ge,trackBg:xe,thumbFg:ye,thumbBg:be,fillFg:me,fillBg:he}}function ps(e,t){Ft(e).delete(t);}function ds(e,t,n){let r=pt(e).get(t)??[];return r.push(n),pt(e).set(t,r),()=>{let o=pt(e).get(t);if(o){let i=o.indexOf(n);i!==-1&&o.splice(i,1);}}}function gs(e,t,n){let r=dt(e).get(t)??[];return r.push(n),dt(e).set(t,r),()=>{let o=dt(e).get(t);if(o){let i=o.indexOf(n);i!==-1&&o.splice(i,1);}}}function xs(e,t,n){let r=gt(e).get(t)??[];return r.push(n),gt(e).set(t,r),()=>{let o=gt(e).get(t);if(o){let i=o.indexOf(n);i!==-1&&o.splice(i,1);}}}function ys(e,t){pt(e).delete(t),dt(e).delete(t),gt(e).delete(t);}function bs(e,t,n){if(!Sn(e,t)||ao(e,t))return null;let r=uo(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 ms(e,t,n){if(n<=0)return "";let r=co(e,t),o=po(e,t),i=fo(e,t),a="",x=n;i&&(a=` ${so(e,t)}`,x=Math.max(1,n-a.length));let u=Math.round(r*(x-1)),d="";for(let b=0;b<x;b++)b===u?d+=o.thumbChar:b<u?d+=o.fillChar:d+=o.trackChar;return d+a}function hs(e){s.isSlider.fill(0),s.value.fill(0),s.min.fill(0),s.max.fill(100),s.step.fill(1),s.orientation.fill(0),s.showValue.fill(0),Ft(e).clear(),pt(e).clear(),dt(e).clear(),gt(e).clear();}function go(e){b.scrollX[e]=0,b.scrollY[e]=0,b.scrollWidth[e]=0,b.scrollHeight[e]=0,b.viewportWidth[e]=0,b.viewportHeight[e]=0,b.scrollbarVisible[e]=2,b.trackVisible[e]=1,b.alwaysScroll[e]=0,b.clampEnabled[e]=1;}function A(e,t){m$1(e,t,b)||(l(e,t,b),go(t));}function yt(e){if(!(b.clampEnabled[e]===1))return;let n=b.viewportWidth[e],r=b.viewportHeight[e],o=b.scrollWidth[e],i=b.scrollHeight[e];if(n>0){let a=Math.max(0,o-n);b.scrollX[e]=Math.max(0,Math.min(a,b.scrollX[e]));}else b.scrollX[e]=Math.max(0,b.scrollX[e]);if(r>0){let a=Math.max(0,i-r);b.scrollY[e]=Math.max(0,Math.min(a,b.scrollY[e]));}else b.scrollY[e]=Math.max(0,b.scrollY[e]);}function xo(e,t){t.scrollWidth!==void 0&&(b.scrollWidth[e]=t.scrollWidth),t.scrollHeight!==void 0&&(b.scrollHeight[e]=t.scrollHeight),t.viewportWidth!==void 0&&(b.viewportWidth[e]=t.viewportWidth),t.viewportHeight!==void 0&&(b.viewportHeight[e]=t.viewportHeight),t.scrollbarVisible!==void 0&&(b.scrollbarVisible[e]=t.scrollbarVisible);}function yo(e,t){t.trackVisible!==void 0&&(b.trackVisible[e]=t.trackVisible?1:0),t.alwaysScroll!==void 0&&(b.alwaysScroll[e]=t.alwaysScroll?1:0),t.clampEnabled!==void 0&&(b.clampEnabled[e]=t.clampEnabled?1:0);}function bo(e,t){xo(e,t),yo(e,t),t.scrollX!==void 0&&(b.scrollX[e]=t.scrollX),t.scrollY!==void 0&&(b.scrollY[e]=t.scrollY),yt(e);}function Is(e,t,n){return j$1.parse(n),A(e,t),bo(t,n),t}function mo(e,t,n,r){return A(e,t),b.scrollX[t]=n,b.scrollY[t]=r,yt(t),t}function Ts(e,t){return m$1(e,t,b)?{x:b.scrollX[t],y:b.scrollY[t]}:{x:0,y:0}}function As(e,t,n,r){return A(e,t),b.scrollX[t]=b.scrollX[t]+n,b.scrollY[t]=b.scrollY[t]+r,yt(t),t}function ks(e,t,n,r){return mo(e,t,n,r)}function _s(e,t){if(!m$1(e,t,b))return {x:0,y:0};let n=b.scrollX[t],r=b.scrollY[t],o=b.scrollWidth[t],i=b.scrollHeight[t],a=b.viewportWidth[t],x=b.viewportHeight[t],u=o-a,d=i-x,b$1=u>0?n/u*100:0,k=d>0?r/d*100:0;return {x:Math.min(100,Math.max(0,b$1)),y:Math.min(100,Math.max(0,k))}}function Ms(e,t,n,r){A(e,t);let o=b.scrollWidth[t],i=b.scrollHeight[t],a=b.viewportWidth[t],x=b.viewportHeight[t],u=Math.min(100,Math.max(0,n)),d=Math.min(100,Math.max(0,r)),b$1=Math.max(0,o-a),k=Math.max(0,i-x);return b.scrollX[t]=u/100*b$1,b.scrollY[t]=d/100*k,t}function Fs(e,t){if(m$1(e,t,b))return {scrollX:b.scrollX[t],scrollY:b.scrollY[t],scrollWidth:b.scrollWidth[t],scrollHeight:b.scrollHeight[t],viewportWidth:b.viewportWidth[t],viewportHeight:b.viewportHeight[t],scrollbarVisible:b.scrollbarVisible[t],trackVisible:b.trackVisible[t]===1,alwaysScroll:b.alwaysScroll[t]===1,clampEnabled:b.clampEnabled[t]===1}}function Bs(e,t){return m$1(e,t,b)}function Ds(e,t,n,r){return A(e,t),b.scrollWidth[t]=n,b.scrollHeight[t]=r,yt(t),t}function Rs(e,t,n,r){return A(e,t),b.viewportWidth[t]=n,b.viewportHeight[t]=r,yt(t),t}function Ls(e,t,n){return A(e,t),b.clampEnabled[t]=n?1:0,n&&yt(t),t}function Us(e,t,n){return A(e,t),b.scrollbarVisible[t]=n,t}function Os(e,t){return A(e,t),b.scrollY[t]=0,t}function Ps(e,t){A(e,t);let n=b.scrollHeight[t],r=b.viewportHeight[t];return b.scrollY[t]=Math.max(0,n-r),t}function Hs(e,t){return A(e,t),b.scrollX[t]=0,t}function Vs(e,t){A(e,t);let n=b.scrollWidth[t],r=b.viewportWidth[t];return b.scrollX[t]=Math.max(0,n-r),t}function ws(e,t){if(!m$1(e,t,b))return false;let n=b.scrollWidth[t],r=b.scrollHeight[t],o=b.viewportWidth[t],i=b.viewportHeight[t];return o>0||i>0?n>o||r>i:n>0||r>0}function Ns(e,t){if(!m$1(e,t,b))return false;let n=b.scrollWidth[t],r=b.viewportWidth[t];return n>r}function Ys(e,t){if(!m$1(e,t,b))return false;let n=b.scrollHeight[t],r=b.viewportHeight[t];return n>r}function Xs(e,t){return m$1(e,t,b)?b.scrollY[t]<=0:true}function Ks(e,t){if(!m$1(e,t,b))return true;let n=b.scrollY[t],r=b.scrollHeight[t],o=b.viewportHeight[t],i=Math.max(0,r-o);return n>=i}function Gs(e,t){return m$1(e,t,b)?b.scrollX[t]<=0:true}function zs(e,t){if(!m$1(e,t,b))return true;let n=b.scrollX[t],r=b.scrollWidth[t],o=b.viewportWidth[t],i=Math.max(0,r-o);return n>=i}export{ni as $,mr as $a,oe as $b,gn as $c,Ka as $d,Vs as $e,Rn as A,tr as Aa,Pr as Ab,sn as Ac,Aa as Ad,us as Ae,Uo as B,er as Ba,Hr as Bb,$r as Bc,ka as Bd,fs as Be,Oo as C,C as Ca,al as Cb,cn as Cc,_a as Cd,po as Ce,He as D,Ne as Da,sl as Db,Gl as Dc,Ma as Dd,ps as De,Po as E,Ye as Ea,cl as Eb,zl as Ec,Fa as Ed,ds as Ee,Ho as F,nr as Fa,It as Fb,jl as Fc,Ba as Fd,gs as Fe,Vo as G,rr as Ga,p as Gb,$l as Gc,Da as Gd,xs as Ge,wo as H,or as Ha,Qe as Hb,un as Hc,Ra as Hd,ys as He,Un as I,ir as Ia,Ze as Ib,ql as Ic,N as Id,bs as Ie,No as J,lr as Ja,tn as Jb,Jl as Jc,ce as Jd,ms as Je,Yo as K,ar as Ka,en as Kb,Ql as Kc,ue as Kd,hs as Ke,On as L,sr as La,pl as Lb,qr as Lc,fe as Ld,Is as Le,Et as M,cr as Ma,dl as Mb,Jr as Mc,pe as Md,mo as Me,zo as N,ur as Na,gl as Nb,Zl as Nc,de as Nd,Ts as Ne,jo as O,fr as Oa,xl as Ob,ta as Oc,ge as Od,As as Oe,Y as P,pr as Pa,yl as Pb,ea as Pc,xe as Pd,ks as Pe,Ot as Q,tt as Qa,bl as Qb,Qr as Qc,ye as Qd,_s as Qe,Ve as R,Xe as Ra,nn as Rb,na as Rc,be as Rd,Ms as Re,Pt as S,dr as Sa,ml as Sb,ie as Sc,me as Sd,Fs as Se,$o as T,Vt as Ta,hl as Tb,le as Tc,he as Td,Bs as Te,qo as U,gr as Ua,At as Ub,ae as Uc,s as Ud,Ds as Ue,Jo as V,xr as Va,El as Vb,se as Vc,mn as Vd,Rs as Ve,Qo as W,yr as Wa,Sl as Wb,g as Wc,Ya as Wd,Ls as We,Zo as X,Ct as Xa,Cl as Xb,fn as Xc,Sn as Xd,Us as Xe,ti as Y,br as Ya,vl as Yb,ca as Yc,Nt as Yd,Os as Ye,ei as Z,vt as Za,Wl as Zb,dn as Zc,Cn as Zd,Ps as Ze,Vn as _,Ke as _a,Nr as _b,wt as _c,Xa as _d,Hs as _e,D as a,ri as aa,ne as ab,Il as ac,to as ad,ao as ae,ws as af,I as b,$t as ba,hr as bb,Tl as bc,eo as bd,xt as be,Ns as bf,Wo as c,F as ca,Er as cb,Al as cc,ft as cd,Ga as ce,Ys as cf,h as d,Jt as da,re as db,kl as dc,ua as dd,za as de,Xs as df,Io as e,J as ea,Ar as eb,_l as ec,fa as ed,ja as ee,Ks as ef,W as f,Q as fa,Ge as fb,Ml as fc,pa as fd,$a as fe,Gs as ff,To as g,Qt as ga,kr as gb,Fl as gc,da as gd,qa as ge,zs as gf,Ao as h,Zt as ha,_r as hb,Bl as hc,ga as hd,Ja as he,P as i,f as ia,X as ib,Dl as ic,xa as id,so as ie,ko as j,Nn as ja,Zi as jb,Rl as jc,ya as jd,j as je,T as k,Yn as ka,tl as kb,Kr as kc,ba as kd,Qa as ke,_n as l,S as la,$e as lb,v as lc,no as ld,Za as le,bt as m,Z as ma,Br as mb,M as mc,ma as md,ts as me,Ue as n,O as na,Dr as nb,on as nc,xn as nd,es as ne,Oe as o,Ht as oa,Rr as ob,ln as oc,ha as od,ns as oe,Bo as p,Xn as pa,el as pb,Pl as pc,Ea as pd,co as pe,Do as q,Kn as qa,qe as qb,Hl as qc,yn as qd,rs as qe,L as r,Gn as ra,nl as rb,Vl as rc,Sa as rd,os as re,zt as s,zn as sa,Je as sb,jr as sc,Ca as sd,is as se,ht as t,te as ta,Lr as tb,wl as tc,ro as td,ls as te,jt as u,jn as ua,Ur as ub,Nl as uc,bn as ud,as as ue,Pe as v,$n as va,rl as vb,Yl as vc,va as vd,Yt as ve,Ro as w,qn as wa,Or as wb,Xl as wc,Wa as wd,ss as we,Lo as x,Jn as xa,ol as xb,at as xc,Ia as xd,uo as xe,Bn as y,Qn as ya,il as yb,Kl as yc,Ta as yd,cs as ye,Dn as z,Zn as za,ll as zb,_t as zc,oo as zd,fo as ze};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {h,m,i,e,g as g$2,l as l$1}from'./chunk-VIT4KE6Q.js';import {a}from'./chunk-5N3O25O7.js';import {a as a$1,b,j as j$1,f,g as g$1}from'./chunk-RJULLVTH.js';import {M}from'./chunk-ETFDYZVJ.js';import {h as h$1,l,m as m$1,n}from'./chunk-7ZFQO3OQ.js';import {z}from'zod';z.object({enabled:z.boolean(),historySize:z.number().int().nonnegative().optional()});z.object({enabled:z.boolean(),budgetMs:z.number().positive().optional(),skippablePhases:z.array(z.nativeEnum(a)).readonly().optional()});var w=0,Te=process.env.BLECSD_PACKED_ADAPTER==="1",_=new WeakSet;function ze(){return w}function te(t){t.sort((e,n)=>e.priority-n.priority);}function Ue(){let t=new Map,e$1=[],n=false,r=0,d=[],l=null,c=0,p=false,T=16.67,E=new Set([4]),W=null;for(let o=0;o<=7;o++)t.set(o,[]);function F(o){if(Te&&!_.has(o)){if(h(o)!==e){_.add(o);return}g$2(o,l$1()),_.add(o);}}function re(){let o=[];for(let a=0;a<=7;a++)o.push({phase:a,duration:0,systemCount:0});return {phases:o,totalFrameTime:0,frameNumber:c++,adapterSyncMs:0}}function L(o,a,s){if(!n||!l)return;let i=l.phases[o];i&&(i.duration=a,i.systemCount=s);}function ae(){if(!n||!l)return;let o=0;for(let a of l.phases)o+=a.duration;if(l.totalFrameTime=o,r>0)for(d.push(l);d.length>r;)d.shift();}function se(o){let a=h(o),s=m(a)?a:null,i$1=s?.syncMode!=="render_only";return {syncAdapter:S=>{if(!s)return;let f=S??o;if(!n||!l){i(f);return}let y=performance.now();i(f),l.adapterSyncMs+=performance.now()-y;},shouldSyncInput:i$1,shouldSyncPhase:S=>s?s.syncMode==="all"?true:S===6:false}}function ie(o,a,s){let i=o;s&&a(i);for(let u of e$1)i=u.system(i);return i}function le(o,a){return p&&a&&E.has(o)}function de(o,a,s){let i=o;s(i);for(let u of a)i=u.system(i);return i}function ce(o,a){if(n)if(o===0){let s=performance.now();L(o,s-a,e$1.length);}else L(o,0,0);}function ue(o,a){return o===0?a:n||p?performance.now():0}function fe(o,a,s,i){n&&L(o,s-a,i);}function pe(o,a,s){return !p||s?s:a-o>T}function ye(o,a,s){if(!p)return;let u=performance.now()-o;W={exceeded:a,skippedPhases:[...s],remainingMs:T-u};}function me(o,a,s,i,u,m,S,f,y){if(le(a,m))return S.push(a),n&&L(a,0,0),{world:o,budgetExceeded:m};let h=ue(a,u),ge=de(o,s,Pe=>{y(a)&&f(Pe);}),$=n||p?performance.now():0,he=a===0?e$1.length+s.length:s.length;fe(a,h,$,he);let be=pe(i,$,m);return {world:ge,budgetExceeded:be}}function Se(o,a,s,i,u){let m=o,S=[],f=false;for(let y=0;y<=7;y++){let h=t.get(y);if(!h){ce(y,s);continue}let z=me(m,y,h,a,s,f,S,i,u);m=z.world,f=z.budgetExceeded;}return {world:m,skippedPhases:S,budgetExceeded:f}}return {registerSystem(o,a,s=0){if(o===0)throw new Error("Cannot register systems to INPUT phase. INPUT phase is protected and always runs first.");let i=t.get(o);i&&(i.push({system:a,priority:s}),te(i));},registerInputSystem(o,a=0){e$1.push({system:o,priority:a}),te(e$1);},unregisterSystem(o){for(let[a,s]of t){if(a===0)continue;let i=s.findIndex(u=>u.system===o);i!==-1&&s.splice(i,1);}},unregisterInputSystem(o){let a=e$1.findIndex(s=>s.system===o);a!==-1&&e$1.splice(a,1);},run(o,a){w=a,n&&(l=re());let s=p||n?performance.now():0,i=o;F(i);let{syncAdapter:u,shouldSyncInput:m,shouldSyncPhase:S}=se(i),f=n||p?performance.now():0;i=ie(i,u,m);let y=Se(i,s,f,u,S);return i=y.world,n&&ae(),ye(s,y.budgetExceeded,y.skippedPhases),i},runInputOnly(o,a){w=a;let s=o;F(s);let i$1=h(s),m$1=(m(i$1)?i$1:null)?.syncMode!=="render_only";m$1&&i(s);for(let f of e$1)s=f.system(s);let S=t.get(0);if(S){m$1&&i(s);for(let f of S)s=f.system(s);}return s},runFixedUpdatePhases(o,a){w=a;let s=o;F(s);let i$1=h(s),u=m(i$1)?i$1:null,m$1=!!u&&u.syncMode==="all",S=[1,2,3,4];for(let f of S){let y=t.get(f);if(y){m$1&&i(s);for(let h of y)s=h.system(s);}}return s},runRenderPhases(o,a){w=a;let s=o;F(s);let i$1=h(s),u=m(i$1)?i$1:null,m$1=f=>u?u.syncMode==="all"?true:f===6:false,S=[5,6,7];for(let f of S){let y=t.get(f);if(y){m$1(f)&&i(s);for(let h of y)s=h.system(s);}}return s},getSystemsForPhase(o){if(o===0)return e$1.map(s=>s.system);let a=t.get(o);return a?a.map(s=>s.system):[]},getSystemCount(o){if(o===0)return e$1.length;let a=t.get(o);return a?a.length:0},getTotalSystemCount(){let o=e$1.length;for(let a of t.values())o+=a.length;return o},hasSystem(o){if(e$1.some(a=>a.system===o))return true;for(let a of t.values())if(a.some(s=>s.system===o))return true;return false},clearPhase(o){if(o===0)throw new Error("Cannot clear INPUT phase. INPUT phase is protected.");let a=t.get(o);a&&(a.length=0);},clearAllSystems(){for(let[o,a]of t)o!==0&&(a.length=0);},enableTelemetry(o={enabled:true}){n=o.enabled,r=o.historySize??0,n||(d.length=0,l=null);},disableTelemetry(){n=false,d.length=0,l=null;},getTelemetry(){return l},getTelemetryHistory(){return d},isTelemetryEnabled(){return n},enableFrameBudget(o={enabled:true}){p=o.enabled,T=o.budgetMs??16.67,o.skippablePhases?E=new Set(o.skippablePhases):E=new Set([4]),E.delete(0),p||(W=null);},disableFrameBudget(){p=false,W=null;},getAdaptiveFrameBudgetStatus(){return W},isFrameBudgetEnabled(){return p}}}var k=[],R=0,oe=new Set;function G(t){let e=k[k.length-1];e&&(e.dependencies.add(t),t.subscribers.add(e));}function ne(t){t.dirty=true,t.onNotify&&t.onNotify();}function D(t){if(R>0){for(let e of t.subscribers)e.dirty||(ne(e),oe.add(e),D(e));return}for(let e of t.subscribers)e.dirty||(ne(e),D(e));}function V(t){for(let e of t.dependencies)e.subscribers.delete(t);t.dependencies.clear();}function _e(t){let e={value:t,subscribers:new Set,version:0};return [()=>(G(e),e.value),d=>{let l=typeof d=="function"?d(e.value):d;Object.is(l,e.value)||(e.value=l,e.version++,D(e));}]}var O=new WeakMap;function Oe(t){let e={fn:t,value:void 0,dependencies:new Set,subscribers:new Set,dirty:true,version:0,computing:false},n=()=>{if(e.computing)throw new Error("Circular dependency detected in computed signal");if(e.dirty){e.computing=true,V(e),k.push(e);try{e.value=e.fn(),e.dirty=!1,e.version++;}finally{k.pop(),e.computing=false;}}return G(e),e.value};return n(),O.set(n,e),n}function Ge(t){R++;try{t();}finally{R--,R===0&&oe.clear();}}function Ve(t,e,n){let r={value:n,subscribers:new Set,version:0,world:t,eid:e};return [()=>(G(r),r.value),c=>{let p=typeof c=="function"?c(r.value):c;Object.is(p,r.value)||(r.value=p,r.version++,D(r),M(r.world,r.eid));}]}function je(t){let e=O.get(t);e&&(V(e),O.delete(t));}function j(t,e){let n={fn:()=>{},value:void 0,dependencies:new Set,subscribers:new Set,dirty:false,version:0,computing:false,onNotify:()=>{n.dirty=false,e();}};k.push(n);try{t();}finally{k.pop();}return ()=>{V(n);}}var C=[];function Qe(t){let e=null,n=false,r=()=>{if(n)return;e&&(e(),e=null);let l=t();typeof l=="function"&&(e=l);},d=j(r,r);return {dispose:()=>{n||(n=true,d(),e&&(e(),e=null));}}}function qe(t,e=3){let n={fn:t,phase:e,markDirty:()=>{n.disposed||(n.dirty=true);},dirty:true,cleanup:null,stopTracking:null,disposed:false};return C.push(n),{dispose:()=>{if(n.disposed)return;n.disposed=true,n.stopTracking&&(n.stopTracking(),n.stopTracking=null),n.cleanup&&(n.cleanup(),n.cleanup=null);let r=C.indexOf(n);r!==-1&&C.splice(r,1);}}}function Ke(t){t.dispose();}function Je(t){for(let e of C)if(!(e.phase!==t||e.disposed)&&e.dirty)if(e.dirty=false,e.stopTracking){e.cleanup&&(e.cleanup(),e.cleanup=null);let n=e.fn();typeof n=="function"&&(e.cleanup=n);}else {let n=()=>{if(e.disposed)return;e.cleanup&&(e.cleanup(),e.cleanup=null);let r=e.fn();typeof r=="function"&&(e.cleanup=r);};e.stopTracking=j(n,e.markDirty);}}function Xe(t){return C.filter(e=>e.phase===t&&!e.disposed).length}function Ze(){return C.filter(t=>!t.disposed).length}function ve(t=1024){let e=Math.max(1,t),n=new Uint32Array(e),r=new Int32Array(e);for(let d=0;d<e-1;d++)r[d]=d+1;return r[e-1]=-1,{generations:n,freeList:r,freeHead:0,capacity:e,size:0}}function Ee(t){let e=t.capacity,n=e*2,r=new Uint32Array(n);r.set(t.generations);let d=new Int32Array(n);d.set(t.freeList);for(let l=e;l<n-1;l++)d[l]=l+1;d[n-1]=t.freeHead,t.freeHead=e,t.generations=r,t.freeList=d,t.capacity=n;}function Ae(t){t.freeHead===-1&&Ee(t);let e=t.freeHead,n=t.freeList[e];t.freeHead=n!==void 0?n:-1,t.freeList[e]=-2,t.size++;let r=t.generations[e];return {index:e,gen:r!==void 0?r:0}}function Y(t,e){return e.index<0||e.index>=t.capacity?false:t.generations[e.index]===e.gen&&t.freeList[e.index]===-2}function xe(t,e){if(!Y(t,e))return false;let{index:n}=e,r=t.generations[n];return r!==void 0&&(t.generations[n]=r+1),t.freeList[n]=t.freeHead,t.freeHead=n,t.size--,true}function ke(t){let{capacity:e}=t;for(let n=0;n<e;n++){let r=t.generations[n];r!==void 0&&(t.generations[n]=r+1);}for(let n=0;n<e-1;n++)t.freeList[n]=n+1;t.freeList[e-1]=-1,t.freeHead=0,t.size=0;}function Ce(t){return t.size}function Ne(t){return t.capacity}function we(t,e){if(!Y(t,e))throw new Error(`Invalid entity handle: index=${e.index}, gen=${e.gen}, current_gen=${t.generations[e.index]??"out of bounds"}`)}var g=new Map,We={maxSize:0,preallocate:0};function yt(t,e){g.has(t.name)||g.set(t.name,{definition:t,config:{...We,...e},freeStore:a$1(),freeHandles:new Map,activeStore:a$1(),activeHandles:new Map,totalAllocations:0,totalRecycles:0,maxPoolSize:0});}function mt(t,e,n){let r=g.get(e);if(!r)return;let d=n??r.config.preallocate;for(let l$1=0;l$1<d;l$1++){let c=h$1(t);for(let T of r.definition.components)l(t,c,T);let p=b(r.freeStore,c);r.freeHandles.set(c,p);}r.maxPoolSize=Math.max(r.maxPoolSize,r.freeStore.size);}function St(t,e){let n=g.get(e);if(!n)return null;if(n.totalAllocations++,n.freeStore.size>0){let c=j$1(n.freeStore)[n.freeStore.size-1];if(c!==void 0){n.totalRecycles++;let p=n.freeHandles.get(c);if(p&&(f(n.freeStore,p),n.freeHandles.delete(c)),n.definition.resetFns)for(let E of n.definition.resetFns)E(t,c);let T=b(n.activeStore,c);return n.activeHandles.set(c,T),c}}let r=h$1(t);for(let l$1 of n.definition.components)l(t,r,l$1);let d=b(n.activeStore,r);return n.activeHandles.set(r,d),r}function gt(t,e,n$1){let r=g.get(e);if(!r)return false;let d=r.activeHandles.get(n$1);if(!d)return false;if(f(r.activeStore,d),r.activeHandles.delete(n$1),r.config.maxSize>0&&r.freeStore.size>=r.config.maxSize){for(let c of r.definition.components)m$1(t,n$1,c)&&n(t,n$1,c);return false}if(r.definition.resetFns)for(let c of r.definition.resetFns)c(t,n$1);let l=b(r.freeStore,n$1);return r.freeHandles.set(n$1,l),r.maxPoolSize=Math.max(r.maxPoolSize,r.freeStore.size),true}function Fe(t){let e=g.get(t);return e?{name:t,pooled:e.freeStore.size,active:e.activeStore.size,totalAllocations:e.totalAllocations,totalRecycles:e.totalRecycles,hitRate:e.totalAllocations>0?e.totalRecycles/e.totalAllocations:0,maxPoolSize:e.maxPoolSize}:null}function ht(){let t=[],e=0,n=0,r=0,d=0;for(let[l]of g){let c=Fe(l);c&&(t.push(c),e+=c.active,n+=c.pooled,r+=c.totalAllocations,d+=c.totalRecycles);}return {archetypes:t,totalActive:e,totalPooled:n,overallHitRate:r>0?d/r:0}}function bt(t){let e=g.get(t);e&&(g$1(e.freeStore),e.freeHandles.clear(),g$1(e.activeStore),e.activeHandles.clear());}function Pt(t){let e=g.get(t);e&&(g$1(e.freeStore),e.freeHandles.clear(),g$1(e.activeStore),e.activeHandles.clear(),g.delete(t));}function Tt(){for(let t of g.values())g$1(t.freeStore),t.freeHandles.clear(),g$1(t.activeStore),t.activeHandles.clear();g.clear();}export{Fe as A,ht as B,bt as C,Pt as D,Tt as E,ze as a,Ue as b,_e as c,Oe as d,Ge as e,Ve as f,je as g,j as h,Qe as i,qe as j,Ke as k,Je as l,Xe as m,Ze as n,ve as o,Ae as p,Y as q,xe as r,ke as s,Ce as t,Ne as u,we as v,yt as w,mt as x,St as y,gt as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {j,m as m$1}from'./chunk-7ZFQO3OQ.js';function m(t){let n=new Error(t);return n.name="EntityValidationError",n}function E(t){return t instanceof Error&&t.name==="EntityValidationError"}var a=new WeakMap;function g(t,n){a.set(t,n);}function c(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 l(t,n,o,r){if(!j(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 of o)m$1(t,n,i)||e.push(c(i));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 u(t,n,o){if(!j(t,n))return false;for(let r of o)if(!m$1(t,n,r))return false;return true}export{m as a,E as b,g as c,l as d,u as e};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a as a$1,f as f$1,j,b}from'./chunk-RJULLVTH.js';import {Ga,Ba}from'./chunk-ETFDYZVJ.js';import {m as m$1,l,n}from'./chunk-7ZFQO3OQ.js';var F=1e4,a={behaviorType:new Uint8Array(F),state:new Uint8Array(F),targetEntity:new Uint32Array(F),waitTimer:new Float32Array(F),patrolIndex:new Uint16Array(F),patrolCount:new Uint16Array(F),speed:new Float32Array(F),detectionRange:new Float32Array(F),fleeRange:new Float32Array(F)},M={Idle:0,Patrol:1,Chase:2,Flee:3,Custom:4},h={Inactive:0,Active:1,Waiting:2,Completed:3},Y=new Map,U=new Map;function ae(t){a.behaviorType[t]=M.Idle,a.state[t]=h.Inactive,a.targetEntity[t]=0,a.waitTimer[t]=0,a.patrolIndex[t]=0,a.patrolCount[t]=0,a.speed[t]=1,a.detectionRange[t]=10,a.fleeRange[t]=15;}function he(t,e,n={}){return m$1(t,e,a)||(l(t,e,a),ae(e)),a.behaviorType[e]=n.type??M.Idle,a.speed[e]=n.speed??1,a.targetEntity[e]=n.targetEntity??0,a.detectionRange[e]=n.detectionRange??10,a.fleeRange[e]=n.fleeRange??15,a.state[e]=h.Active,e}function ge(t,e){if(m$1(t,e,a))return {type:a.behaviorType[e],state:a.state[e],targetEntity:a.targetEntity[e],waitTimer:a.waitTimer[e],patrolIndex:a.patrolIndex[e],patrolCount:a.patrolCount[e],speed:a.speed[e],detectionRange:a.detectionRange[e],fleeRange:a.fleeRange[e]}}function xe(t,e){return m$1(t,e,a)}function Te(t,e){return m$1(t,e,a)&&n(t,e,a),Y.delete(e),U.delete(e),e}function ve(t,e){m$1(t,e,a)&&(a.behaviorType[e]=M.Idle,a.state[e]=h.Active,a.targetEntity[e]=0);}function Ee(t,e,n,o={}){m$1(t,e,a)&&n.length!==0&&(a.behaviorType[e]=M.Patrol,a.state[e]=h.Active,a.patrolIndex[e]=0,a.patrolCount[e]=n.length,a.waitTimer[e]=0,Y.set(e,{points:[...n],loop:o.loop??true,waitTime:o.waitTime??0}));}function we(t,e,n){m$1(t,e,a)&&(a.behaviorType[e]=M.Chase,a.state[e]=h.Active,a.targetEntity[e]=n);}function Ce(t,e,n){m$1(t,e,a)&&(a.behaviorType[e]=M.Flee,a.state[e]=h.Active,a.targetEntity[e]=n);}function We(t,e,n){m$1(t,e,a)&&(a.behaviorType[e]=M.Custom,a.state[e]=h.Active,U.set(e,n));}function Ae(t,e){if(m$1(t,e,a))return a.behaviorType[e]}function Ie(t,e){if(m$1(t,e,a))return a.state[e]}function Pe(t,e){return m$1(t,e,a)?a.targetEntity[e]:0}function Fe(t,e,n){m$1(t,e,a)&&(a.targetEntity[e]=n);}function Be(t,e,n){m$1(t,e,a)&&(a.speed[e]=n);}function Me(t,e,n){m$1(t,e,a)&&(a.detectionRange[e]=n);}function Ye(t,e){return m$1(t,e,a)?a.state[e]===h.Active:false}function De(t,e){return m$1(t,e,a)?a.state[e]===h.Waiting:false}function Re(t,e){return m$1(t,e,a)?a.state[e]===h.Completed:false}function Xe(t,e){if(m$1(t,e,a))return Y.get(e)}function Ue(t,e){if(!m$1(t,e,a))return;let n=Y.get(e);if(!n)return;let o=a.patrolIndex[e];return n.points[o]}function Se(t,e,n,o,u){if(!m$1(t,e,a))return;let l=Y.get(e);if(!l||l.points.length===0)return;if(a.state[e]===h.Waiting){let w=a.waitTimer[e]-u;if(w>0){a.waitTimer[e]=w;return}a.waitTimer[e]=0,a.state[e]=h.Active;}let c=a.patrolIndex[e],s=l.points[c];if(!s)return;let b=s.x-n,y=s.y-o,p=Math.sqrt(b*b+y*y),x=a.speed[e],B=x*u*.5;return p<=B?oe(e,l):{dx:b/p*x,dy:y/p*x}}function oe(t,e){let n=a.patrolIndex[t]+1;if(n>=e.points.length)if(e.loop)a.patrolIndex[t]=0;else {a.state[t]=h.Completed;return}else a.patrolIndex[t]=n;if(e.waitTime>0){a.state[t]=h.Waiting,a.waitTimer[t]=e.waitTime;return}return {dx:0,dy:0}}function Ze(t,e,n,o,u,l){if(!m$1(t,e,a))return;let c=u-n,s=l-o,b=Math.sqrt(c*c+s*s);if(b===0)return {dx:0,dy:0};let y=a.detectionRange[e];if(y>0&&b>y)return;let p=a.speed[e];return {dx:c/b*p,dy:s/b*p}}function ke(t,e,n,o,u,l){if(!m$1(t,e,a))return;let c=n-u,s=o-l,b=Math.sqrt(c*c+s*s),y=a.fleeRange[e];if(y>0&&b>=y)return;if(b===0)return {dx:1,dy:0};let p=a.speed[e];return {dx:c/b*p,dy:s/b*p}}function Oe(t,e,n){if(!m$1(t,e,a))return;let o=U.get(e);o&&o(t,e,n);}function Le(t,e,n){if(!m$1(t,e,a)||a.state[e]!==h.Waiting)return;let o=a.waitTimer[e]-n;o<=0?(a.waitTimer[e]=0,a.state[e]=h.Active):a.waitTimer[e]=o;}function Ve(){Y.clear(),U.clear();}var E=1e4,S=0,r={x:new Float32Array(E),y:new Float32Array(E),width:new Uint16Array(E),height:new Uint16Array(E),followTarget:new Uint32Array(E),smoothing:new Float32Array(E),deadZoneX:new Float32Array(E),deadZoneY:new Float32Array(E),bounded:new Uint8Array(E),minX:new Float32Array(E),maxX:new Float32Array(E),minY:new Float32Array(E),maxY:new Float32Array(E)},ie=80,ue=24;function X(t){r.x[t]=0,r.y[t]=0,r.width[t]=ie,r.height[t]=ue,r.followTarget[t]=S,r.smoothing[t]=0,r.deadZoneX[t]=0,r.deadZoneY[t]=0,r.bounded[t]=0,r.minX[t]=0,r.maxX[t]=0,r.minY[t]=0,r.maxY[t]=0;}function Ne(t,e,n={}){return m$1(t,e,r)||(l(t,e,r),X(e)),n.x!==void 0&&(r.x[e]=n.x),n.y!==void 0&&(r.y[e]=n.y),n.width!==void 0&&(r.width[e]=n.width),n.height!==void 0&&(r.height[e]=n.height),n.followTarget!==void 0&&(r.followTarget[e]=n.followTarget),n.smoothing!==void 0&&(r.smoothing[e]=Math.max(0,Math.min(1,n.smoothing))),n.deadZoneX!==void 0&&(r.deadZoneX[e]=n.deadZoneX),n.deadZoneY!==void 0&&(r.deadZoneY[e]=n.deadZoneY),e}function ze(t,e){if(m$1(t,e,r))return {x:r.x[e],y:r.y[e],width:r.width[e],height:r.height[e],followTarget:r.followTarget[e],smoothing:r.smoothing[e],deadZoneX:r.deadZoneX[e],deadZoneY:r.deadZoneY[e],bounded:r.bounded[e]===1,minX:r.minX[e],maxX:r.maxX[e],minY:r.minY[e],maxY:r.maxY[e]}}function Ge(t,e){return m$1(t,e,r)}function je(t,e){return m$1(t,e,r)&&n(t,e,r),e}function Je(t,e,n,o){return m$1(t,e,r)||(l(t,e,r),X(e)),r.followTarget[e]=n,o!==void 0&&(r.smoothing[e]=Math.max(0,Math.min(1,o))),e}function Ke(t,e){return m$1(t,e,r)?r.followTarget[e]:S}function Qe(t,e){return m$1(t,e,r)?r.followTarget[e]!==S:false}function $e(t,e,n,o){return m$1(t,e,r)||(l(t,e,r),X(e)),r.deadZoneX[e]=n,r.deadZoneY[e]=o,e}function et(t,e,n){return m$1(t,e,r)||(l(t,e,r),X(e)),r.bounded[e]=1,r.minX[e]=n.minX,r.maxX[e]=n.maxX,r.minY[e]=n.minY,r.maxY[e]=n.maxY,e}function tt(t,e){return m$1(t,e,r)&&(r.bounded[e]=0),e}function nt(t,e){return m$1(t,e,r)?r.bounded[e]===1:false}function rt(t,e,n,o){return m$1(t,e,r)||(l(t,e,r),X(e)),r.x[e]=n,r.y[e]=o,r.bounded[e]===1&&Z(e),e}function at(t,e){if(m$1(t,e,r))return {x:r.x[e],y:r.y[e]}}function ot(t,e,n,o){return m$1(t,e,r)&&(r.x[e]=r.x[e]+n,r.y[e]=r.y[e]+o,r.bounded[e]===1&&Z(e)),e}function Z(t){let e=r.width[t],n=r.height[t],o=r.minX[t],u=r.maxX[t],l=r.minY[t],c=r.maxY[t],s=u-e,b=c-n;r.x[t]=Math.max(o,Math.min(s,r.x[t])),r.y[t]=Math.max(l,Math.min(b,r.y[t]));}function it(t,e,n,o){if(!m$1(t,e,r))return;let u=r.x[e],l=r.y[e];return {x:n-u,y:o-l}}function ut(t,e,n,o){if(!m$1(t,e,r))return;let u=r.x[e],l=r.y[e];return {x:n+u,y:o+l}}function lt(t,e,n,o){if(!m$1(t,e,r))return false;let u=r.x[e],l=r.y[e],c=r.width[e],s=r.height[e];return n>=u&&n<u+c&&o>=l&&o<l+s}function mt(t,e,n,o,u,l){if(!m$1(t,e,r))return false;let c=r.x[e],s=r.y[e],b=r.width[e],y=r.height[e];return n<c+b&&n+u>c&&o<s+y&&o+l>s}function st(t,e,n){if(!m$1(t,e,r))return;let o=r.followTarget[e];if(o===S||!Ga(t,o))return;let u=Ba.x[o],l=Ba.y[o],c=r.width[e],s=r.height[e],b=r.smoothing[e],y=r.deadZoneX[e],p=r.deadZoneY[e],x=u-c/2,B=l-s/2,w=r.x[e],I=r.y[e],V=w,G=I,ne=w+c/2,re=I+s/2,j=u-ne,J=l-re;if(Math.abs(j)>y){let H=j>0?x+y:x-y;V=$(w,H,b,n);}if(Math.abs(J)>p){let H=J>0?B+p:B-p;G=$(I,H,b,n);}r.x[e]=V,r.y[e]=G,r.bounded[e]===1&&Z(e);}function $(t,e,n,o){if(n<=0)return e;let u=1-n**(o*10);return t+(e-t)*u}function ft(t,e,n,o){if(!m$1(t,e,r))return e;let u=r.width[e],l=r.height[e];return r.x[e]=n-u/2,r.y[e]=o-l/2,r.bounded[e]===1&&Z(e),e}var g=1e4,f={lifetime:new Float32Array(g),age:new Float32Array(g),fadeOut:new Uint8Array(g),char:new Uint32Array(g),startFg:new Uint32Array(g),endFg:new Uint32Array(g),emitter:new Uint32Array(g)},m={rate:new Float32Array(g),burstCount:new Uint16Array(g),lifetime:new Float32Array(g),spread:new Float32Array(g),speed:new Float32Array(g),gravity:new Float32Array(g),angle:new Float32Array(g),active:new Uint8Array(g),accumulator:new Float32Array(g)},O=new Map,C=a$1(256),A=new Map;function le(t){f.lifetime[t]=0,f.age[t]=0,f.fadeOut[t]=0,f.char[t]=0,f.startFg[t]=0,f.endFg[t]=0,f.emitter[t]=0;}function yt(t,e,n){return m$1(t,e,f)||(l(t,e,f),le(e)),f.lifetime[e]=n.lifetime,f.age[e]=0,f.fadeOut[e]=n.fadeOut?1:0,f.char[e]=n.char,f.startFg[e]=n.startFg,f.endFg[e]=n.endFg??n.startFg,f.emitter[e]=n.emitter??0,e}function pt(t,e){if(m$1(t,e,f))return {lifetime:f.lifetime[e],age:f.age[e],fadeOut:f.fadeOut[e]===1,char:f.char[e],startFg:f.startFg[e],endFg:f.endFg[e],emitter:f.emitter[e]}}function ht(t,e){return m$1(t,e,f)}function gt(t,e){if(m$1(t,e,f)){let n$1=A.get(e);n$1&&(f$1(C,n$1),A.delete(e)),n(t,e,f);}return e}function xt(t,e){return m$1(t,e,f)?f.age[e]>=f.lifetime[e]:true}function me(t,e){if(!m$1(t,e,f))return 1;let n=f.lifetime[e];return n<=0?1:Math.min(1,f.age[e]/n)}function k(t,e,n){return Math.round(t+(e-t)*n)}function se(t,e,n){let o=Math.max(0,Math.min(1,n)),u=t>>16&255,l=t>>8&255,c=t&255,s=t>>24&255,b=e>>16&255,y=e>>8&255,p=e&255,x=e>>24&255,B=k(u,b,o),w=k(l,y,o),I=k(c,p,o);return ((k(s,x,o)&255)<<24|(B&255)<<16|(w&255)<<8|I&255)>>>0}function Tt(t,e){if(!m$1(t,e,f))return 0;let n=me(t,e);return se(f.startFg[e],f.endFg[e],n)}function fe(t){m.rate[t]=0,m.burstCount[t]=0,m.lifetime[t]=1,m.spread[t]=Math.PI*2,m.speed[t]=3,m.gravity[t]=0,m.angle[t]=0,m.active[t]=1,m.accumulator[t]=0;}function vt(t,e,n){return m$1(t,e,m)||(l(t,e,m),fe(e)),m.lifetime[e]=n.lifetime,n.rate!==void 0&&(m.rate[e]=n.rate),n.burstCount!==void 0&&(m.burstCount[e]=n.burstCount),n.spread!==void 0&&(m.spread[e]=n.spread),n.speed!==void 0&&(m.speed[e]=n.speed),n.gravity!==void 0&&(m.gravity[e]=n.gravity),n.angle!==void 0&&(m.angle[e]=n.angle),n.active!==void 0&&(m.active[e]=n.active?1:0),e}function Et(t,e){if(m$1(t,e,m))return {rate:m.rate[e],burstCount:m.burstCount[e],lifetime:m.lifetime[e],spread:m.spread[e],speed:m.speed[e],gravity:m.gravity[e],angle:m.angle[e],active:m.active[e]===1}}function wt(t,e){return m$1(t,e,m)}function Ct(t,e){if(m$1(t,e,m)){n(t,e,m),O.delete(e);let n$1=j(C),o=[];for(let u=0;u<C.size;u++){let l=n$1[u];if(l&&l.emitterId===e){let c=A.get(l.particleId);c&&o.push({handle:c,particleId:l.particleId});}}for(let u of o)f$1(C,u.handle),A.delete(u.particleId);}return e}function Wt(t,e){O.set(t,e);}function At(t){return O.get(t)}function It(t){let e=new Set,n=j(C);for(let o=0;o<C.size;o++){let u=n[o];u&&u.emitterId===t&&e.add(u.particleId);}return e}function Pt(t,e){let n=A.get(e);n&&(f$1(C,n),A.delete(e));let o=b(C,{particleId:e,emitterId:t});A.set(e,o);}function Ft(t,e){let n=A.get(e);n&&(f$1(C,n),A.delete(e));}function Bt(t,e){m$1(t,e,m)&&(m.active[e]=1);}function Mt(t,e){m$1(t,e,m)&&(m.active[e]=0);}function Yt(t,e){return m$1(t,e,m)?m.active[e]===1:false}function Dt(t,e,n){m$1(t,e,m)&&(m.rate[e]=n);}function Rt(t,e,n){m$1(t,e,m)&&(m.speed[e]=n);}function Xt(t,e,n){m$1(t,e,m)&&(m.gravity[e]=n);}function Ut(){return C}function St(){O.clear(),C=a$1(256),A.clear();}var D=1e4,L=0,ee=1,W={tilesets:new Map,nameToId:new Map};function Ot(){W.tilesets.clear(),W.nameToId.clear(),ee=1;}function Lt(t){let e=ee++,n={id:e,name:t.name,tiles:t.tiles};return W.tilesets.set(e,n),W.nameToId.set(t.name,e),e}function Vt(t){return W.tilesets.get(t)}function Ht(t){let e=W.nameToId.get(t);if(e!==void 0)return W.tilesets.get(e)}function _t(t){let e=W.tilesets.get(t);return e?(W.nameToId.delete(e.name),W.tilesets.delete(t),true):false}var te=1,T={data:new Map};function qt(){T.data.clear(),te=1;}function ce(t,e,n=1){let o=te++,u=[];for(let l=0;l<n;l++)u.push({tiles:new Uint16Array(t*e),visible:true});return T.data.set(o,{width:t,height:e,layers:u}),o}function Nt(t){return T.data.get(t)}function zt(t){return T.data.delete(t)}function Gt(t,e,n,o,u){let l=T.data.get(t);if(!l)return false;let c=l.layers[e];return !c||n<0||n>=l.width||o<0||o>=l.height?false:(c.tiles[o*l.width+n]=u,true)}function jt(t,e,n,o){let u=T.data.get(t);if(!u)return L;let l=u.layers[e];return !l||n<0||n>=u.width||o<0||o>=u.height?L:l.tiles[o*u.width+n]}function Jt(t,e,n){let o=T.data.get(t);if(!o)return false;let u=o.layers[e];return u?(u.tiles.fill(n),true):false}function Kt(t,e,n,o,u,l,c){let s=T.data.get(t);if(!s)return false;let b=s.layers[e];if(!b)return false;let y=Math.max(0,n),p=Math.max(0,o),x=Math.min(s.width,n+u),B=Math.min(s.height,o+l);for(let w=p;w<B;w++)for(let I=y;I<x;I++)b.tiles[w*s.width+I]=c;return true}function Qt(t){let e=T.data.get(t);return e?e.layers.length:0}function $t(t){let e=T.data.get(t);if(!e)return -1;let n={tiles:new Uint16Array(e.width*e.height),visible:true};return e.layers.push(n),e.layers.length-1}function en(t,e,n){let o=T.data.get(t);if(!o)return false;let u=o.layers[e];return u?(u.visible=n,true):false}function tn(t,e){let n=T.data.get(t);if(!n)return false;let o=n.layers[e];return o?o.visible:false}var d={width:new Uint16Array(D),height:new Uint16Array(D),tileWidth:new Uint8Array(D),tileHeight:new Uint8Array(D),dataId:new Uint32Array(D),tilesetId:new Uint32Array(D)};function be(t){d.width[t]=0,d.height[t]=0,d.tileWidth[t]=1,d.tileHeight[t]=1,d.dataId[t]=0,d.tilesetId[t]=0;}function nn(t,e,n){if(m$1(t,e,d)||(l(t,e,d),be(e)),d.width[e]=n.width,d.height[e]=n.height,d.tileWidth[e]=n.tileWidth??1,d.tileHeight[e]=n.tileHeight??1,d.tilesetId[e]=n.tilesetId,n.dataId!==void 0)d.dataId[e]=n.dataId;else {let o=ce(n.width,n.height,n.layerCount??1);d.dataId[e]=o;}return e}function rn(t,e){if(m$1(t,e,d))return {width:d.width[e],height:d.height[e],tileWidth:d.tileWidth[e],tileHeight:d.tileHeight[e],dataId:d.dataId[e],tilesetId:d.tilesetId[e]}}function an(t,e){return m$1(t,e,d)}function on(t,e,n$1=false){if(!m$1(t,e,d))return e;if(!n$1){let o=d.dataId[e];o>0&&T.data.delete(o);}return n(t,e,d),e}function un(t,e){return m$1(t,e,d)?d.dataId[e]:0}var z={char:" ",fg:0,bg:0};function de(t){let e=[];for(let n=0;n<t;n++)e.push({...z});return e}function ye(t,e,n,o){if(n<0||n>=t.width||o<0||o>=t.height)return z;let u=z;for(let l of t.layers){if(!l.visible)continue;let c=l.tiles[o*t.width+n];if(c===L)continue;let s=e.tiles[c];s&&(u={char:s.char,fg:s.fg,bg:s.bg});}return u}function ln(t,e,n,o,u,l){let c=T.data.get(t),s=W.tilesets.get(e),b=[];if(!c||!s){for(let y=0;y<l;y++)b.push(de(u));return b}for(let y=0;y<l;y++){let p=[];for(let x=0;x<u;x++)p.push(ye(c,s,n+x,o+y));b.push(p);}return b}export{m as $,Oe as A,W as Aa,Le as B,Ot as Ba,Ve as C,Lt as Ca,r as D,Vt as Da,ie as E,Ht as Ea,ue as F,_t as Fa,Ne as G,T as Ga,ze as H,qt as Ha,Ge as I,ce as Ia,je as J,Nt as Ja,Je as K,zt as Ka,Ke as L,Gt as La,Qe as M,jt as Ma,$e as N,Jt as Na,et as O,Kt as Oa,tt as P,Qt as Pa,nt as Q,$t as Qa,rt as R,en as Ra,at as S,tn as Sa,ot as T,d as Ta,it as U,nn as Ua,ut as V,rn as Va,lt as W,an as Wa,mt as X,on as Xa,st as Y,un as Ya,ft as Z,ln as Za,f as _,a,yt as aa,M as b,pt as ba,h as c,ht as ca,he as d,gt as da,ge as e,xt as ea,xe as f,me as fa,Te as g,se as ga,ve as h,Tt as ha,Ee as i,vt as ia,we as j,Et as ja,Ce as k,wt as ka,We as l,Ct as la,Ae as m,Wt as ma,Ie as n,At as na,Pe as o,It as oa,Fe as p,Pt as pa,Be as q,Ft as qa,Me as r,Bt as ra,Ye as s,Mt as sa,De as t,Yt as ta,Re as u,Dt as ua,Xe as v,Rt as va,Ue as w,Xt as wa,Se as x,Ut as xa,Ze as y,St as ya,ke as z,L as za};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {d,f}from'./chunk-LI3ZYXUT.js';import {Ba,Ga,k,i,a,$,fa,f as f$1,Fa,X,_,Z}from'./chunk-ETFDYZVJ.js';import {m,o as o$1,l}from'./chunk-7ZFQO3OQ.js';var p=1e4,o={x:new Float32Array(p),y:new Float32Array(p),width:new Float32Array(p),height:new Float32Array(p),valid:new Uint8Array(p)};function A(n,t){if(m(n,t,o)&&o.valid[t]===1)return {x:o.x[t],y:o.y[t],width:o.width[t],height:o.height[t]}}function nt(n,t){return m(n,t,o)&&o.valid[t]===1}function et(n,t){m(n,t,o)&&(o.valid[t]=0);}function z(n,t){m(n,t,o)||(l(n,t,o),o.x[t]=0,o.y[t]=0,o.width[t]=0,o.height[t]=0,o.valid[t]=0);}function x(n){if(!d(n))return {width:80,height:24};let t=f(n);return !t||!fa(n,t)?{width:80,height:24}:{width:$.width[t],height:$.height[t]}}function I(n,t,e,i,s){let r;if(n===X)r=e;else if(_(n)){let u=Z(n);r=u!==null?u/100*t:0;}else r=n;return r=Math.max(i,r),Number.isFinite(s)&&(r=Math.min(s,r)),Math.floor(r)}function U(n,t,e,i,s,r){z(n,t);let u=Ga(n,t)?Ba.x[t]:0,m=Ga(n,t)?Ba.y[t]:0,a=Fa(n,t),f,y;a?(f=u,y=m):(f=e+u,y=i+m);let l=0,g=0;if(fa(n,t)){let _=$.width[t],k=$.height[t],O=$.minWidth[t],q=$.minHeight[t],B=$.maxWidth[t],R=$.maxHeight[t],S=$.shrink[t]===1,X=S?0:s,j=S?0:r;l=I(_,s,X,O,B),g=I(k,r,j,q,R);}a||(f+l>e+s&&(l=Math.max(0,e+s-f)),y+g>i+r&&(g=Math.max(0,i+r-y))),o.x[t]=f,o.y[t]=y,o.width[t]=l,o.height[t]=g,o.valid[t]=1;}function Y(n,t,e,i,s,r){U(n,t,e,i,s,r);let u=A(n,t);if(!u)return;let m=f$1(n,t);for(let a of m)Y(n,a,u.x,u.y,u.width,u.height);}function G(n){let t=o$1(n,[Ba]),e=[];for(let i$1 of t)k(n,i$1)?i(n,i$1)===a&&e.push(i$1):e.push(i$1);return e}var J=n=>{let t=x(n),e=G(n);for(let i of e)Y(n,i,0,0,t.width,t.height);return n};function ot(){return J}function rt(n){let t=o$1(n,[Ba]);for(let e of t)m(n,e,o)&&(o.valid[e]=0);}function K(n,t){if(!Ga(n,t))return;let e=0,i$1=0,s,r;if(k(n,t)){let u=i(n,t);if(u!==a){let m=K(n,u);if(m)e=m.x,i$1=m.y,s=m.width,r=m.height;else {let a=x(n);s=a.width,r=a.height;}}else {let m=x(n);s=m.width,r=m.height;}}else {let u=x(n);s=u.width,r=u.height;}return U(n,t,e,i$1,s,r),A(n,t)}function it(n,t){let e=A(n,t);if(e)return {left:e.x,top:e.y,right:e.x+e.width-1,bottom:e.y+e.height-1}}export{o as a,A as b,nt as c,et as d,J as e,ot as f,rt as g,K as h,it as i};
|
package/dist/cli/init.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import'../chunk-
|
|
2
|
+
import'../chunk-I7AUKTXE.js';import {execSync}from'child_process';import {existsSync,mkdirSync,writeFileSync}from'fs';import {get}from'https';import {resolve,join,basename}from'path';import {createInterface}from'readline';var c=`{
|
|
3
3
|
"compilerOptions": {
|
|
4
4
|
"target": "ES2022",
|
|
5
5
|
"module": "NodeNext",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as Entity, W as World } from './types-
|
|
1
|
+
import { E as Entity, W as World } from './types-B8LmNkzG.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Memory-efficient component storage utilities.
|
|
@@ -243,4 +243,4 @@ declare function getComponentMemoryReport(_world: World, components: Record<stri
|
|
|
243
243
|
*/
|
|
244
244
|
declare function isWithinMemoryBounds(entityCount: number, maxMemoryMB?: number, avgComponentsPerEntity?: number): boolean;
|
|
245
245
|
|
|
246
|
-
export { type
|
|
246
|
+
export { type ComponentStore as C, type SparseStorageConfig as S, type TypedArrayPool as T, createSparseStore as a, createTypedArrayPool as b, createComponentStore as c, type ComponentMemoryReport as d, estimateMemoryUsage as e, type ComponentStoreConfig as f, getComponentMemoryReport as g, type SparseStore as h, isWithinMemoryBounds as i };
|