lecodes-design 0.1.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 +86 -0
- package/dist/app/assets/__vite-browser-external-B-F28LA_.js +1 -0
- package/dist/app/assets/creator-ui-DBh5lzcv.wasm +0 -0
- package/dist/app/assets/creator-ui-IOlJLP4k.wasm +0 -0
- package/dist/app/assets/creator-ui-VMQTvHQj.js +1 -0
- package/dist/app/assets/index-OduKGRgC.js +3 -0
- package/dist/app/assets/index-W-QgLn7p.css +1 -0
- package/dist/app/assets/loadCreatorUiNode-ZiTBq5Mt.js +1 -0
- package/dist/app/index.html +13 -0
- package/dist/server.js +863 -0
- package/package.json +35 -0
package/README.md
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# lecodes-design
|
|
2
|
+
|
|
3
|
+
**LeCodes Design** — a live canvas of app screens for AI-driven prototyping. An intent-capture
|
|
4
|
+
layer: each screen on the canvas is an executable LeCodes render (real code on mock data), the
|
|
5
|
+
edges between them are drawn navigation intent, and the whole folder is the spec an AI builds the
|
|
6
|
+
real app from. See `lecodes-design-concept.md` at the repo root for the full concept.
|
|
7
|
+
|
|
8
|
+
Launched through the CLI — this package is the dev server + the browser board. It works inside a
|
|
9
|
+
cloned lecodes project or **standalone in any folder** (no login or server project needed):
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
npm i -D lecodes-design # alongside lecodes-cli
|
|
13
|
+
lecodes design init # scaffold design/ (screens/, shared/, meta.json, CLAUDE.md)
|
|
14
|
+
lecodes design # start the dev server + open the canvas
|
|
15
|
+
lecodes design snapshot # headless JSON/PNG of every screen (Claude's eyes)
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## How it works
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
design/
|
|
22
|
+
screens/login.ts ← one file = one screen; default-exports UIScreen([...]); islands
|
|
23
|
+
shared/tokens.ts ← design tokens + reusable components (only allowed import)
|
|
24
|
+
meta.json ← the human-owned graph: positions, descriptions, edges
|
|
25
|
+
CLAUDE.md ← the conventions, written for the AI
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
- The **dev server** (`src/server`, zero runtime deps) watches the design folder, compiles each
|
|
29
|
+
screen on demand through the CLI's pipeline (chisel + the vendored SDK — the CLI injects
|
|
30
|
+
`compileScreen`), serves the project files for `asset()` urls, and pushes SSE change events.
|
|
31
|
+
- The **board** (`src/app`, Vue 3) renders every screen live via **lecodes-renderer** (canvas-ui):
|
|
32
|
+
each tile is its own creator-ui WASM instance + `<canvas>`, executing the compiled bundle with
|
|
33
|
+
`_creatorUI` bound to it — the browser twin of the renderer's headless entry. Pan/zoom the
|
|
34
|
+
board (wheel / two-finger scroll = pan, ctrl+wheel / pinch = zoom, middle-button drag = pan
|
|
35
|
+
from anywhere — even over a screen, double-click = fit, bottom-right cluster: −/+/fit, click
|
|
36
|
+
the % to reset to 100%); the dot grid lives in world space; edges draw as labeled arrows.
|
|
37
|
+
- Tiles follow a **select-to-interact** model: an unselected tile is a solid object — drag it
|
|
38
|
+
*anywhere* (not just the header) to reposition it (the release writes `pos` into `meta.json`),
|
|
39
|
+
and a plain click selects it. A **selected** tile (blue ring) is a working prototype: the body
|
|
40
|
+
forwards pointer input (buttons, scroll, router, drags), and focusing an in-screen input shows
|
|
41
|
+
the simulated keyboard band + captures real keystrokes. Arrow keys nudge the selected screen
|
|
42
|
+
(Shift = ×10), the header ↻ restarts its prototype state, Escape / clicking the background
|
|
43
|
+
deselects. The header always drags, selected or not.
|
|
44
|
+
- The **flow graph is edited on the canvas** too: drag the connect handle (right edge of a tile,
|
|
45
|
+
on hover) onto another screen to draw an edge; click an edge (or its label) to edit its
|
|
46
|
+
label/activator or delete it — the activator field offers a dropdown of the source screen's
|
|
47
|
+
live named elements; click a tile's header note to edit the screen description.
|
|
48
|
+
Everything writes back into `meta.json` — the file Claude reads as the app map. Edges between
|
|
49
|
+
the same pair of screens fan out instead of overlapping.
|
|
50
|
+
- **Text is edited on the canvas**: double-click any rendered text to edit it in place — the
|
|
51
|
+
edit rewrites the string literal in the screen's **source file** (Enter commits, Escape
|
|
52
|
+
cancels, Shift+Enter inserts a newline). This works through the SDK's creation-site capture +
|
|
53
|
+
the bundle's source map, so it lands exactly where `UIText(...)` was called — including through
|
|
54
|
+
`shared/` component wrappers. Only literal strings are editable: text computed at runtime
|
|
55
|
+
(interpolation, `node.text = …`) is declined with a notice instead of guessed at.
|
|
56
|
+
- **Images are replaced on the canvas**: double-click an image to pick a file, or **drag an
|
|
57
|
+
image file from your OS onto it** (the target highlights). The upload is stored under
|
|
58
|
+
`design/assets/` (names deduped; byte-identical files reused) and the image's source reference
|
|
59
|
+
is rewritten — an inline `asset("…")` argument, an asset held in a variable
|
|
60
|
+
(`const man = asset("…")`), a hand-written `import man from "../assets/man.png"`, or an asset
|
|
61
|
+
exported from a `shared/` file; a remote-URL literal is converted to a local `asset()`
|
|
62
|
+
reference. The tile previews the new image instantly; dynamic or ambiguous sources are
|
|
63
|
+
declined safely.
|
|
64
|
+
- **Hint mode** (the ◎ button or `H`) outlines what the canvas can do something with, on every
|
|
65
|
+
tile: interactive elements in blue, in-place-editable texts in green, replaceable images in
|
|
66
|
+
purple (a legend appears next to the controls).
|
|
67
|
+
- **Edges and their activators cross-highlight**: selecting or hovering an edge lights up the
|
|
68
|
+
element its activator names on the source screen (amber pulsing ring + ⚡ tag — dropdown
|
|
69
|
+
options preview live while the editor is open); hovering that element on the tile lights the
|
|
70
|
+
edge(s) up in return, so the flow graph reads from either end.
|
|
71
|
+
- Screens **hot-reload**: edit `screens/x.ts` → only that tile recompiles and re-runs; edit
|
|
72
|
+
`shared/` → all tiles reload; edit `meta.json` → positions/edges update.
|
|
73
|
+
|
|
74
|
+
Because the same render tree drives the board, `lecodes design snapshot` (JSON/PNG, via
|
|
75
|
+
lecodes-renderer headless), and the future app — what Claude "sees" is what you see.
|
|
76
|
+
|
|
77
|
+
## Development (of this package)
|
|
78
|
+
|
|
79
|
+
```sh
|
|
80
|
+
bun run build # vite build (dist/app) + server bundle (dist/server.js)
|
|
81
|
+
bun run typecheck # vue-tsc
|
|
82
|
+
bun run dev # vite dev server for the board, proxying to a running design server
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
`src/app/wasm/` holds a copy of creator-ui's emscripten glue + wasm (same pattern as the viewer);
|
|
86
|
+
re-copy from `lecodes-renderer/src/layout/creatorUi/` when the layout engine is rebuilt.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./loadCreatorUiNode-ZiTBq5Mt.js";var t=e(((e,t)=>{t.exports={}}));export default t();
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
async function e(e={}){var t=e,n=!0,r=!1,i=import.meta.url,a=``;function o(e){return t.locateFile?t.locateFile(e,a):a+e}var s,c;if(n||r){try{a=new URL(`.`,i).href}catch{}s=async e=>{var t=await fetch(e,{credentials:`same-origin`});if(t.ok)return t.arrayBuffer();throw Error(t.status+` : `+t.url)}}var l=console.log.bind(console),u=console.error.bind(console),d,f=!1;class p{}function m(){var e=X.buffer;y=new Int8Array(e),le=new Int16Array(e),t.HEAPU8=x=new Uint8Array(e),pe=new Uint16Array(e),ue=new Int32Array(e),t.HEAPU32=b=new Uint32Array(e),t.HEAPF32=de=new Float32Array(e),fe=new Float64Array(e),v=new BigInt64Array(e),me=new BigUint64Array(e)}function h(){if(t.preRun)for(typeof t.preRun==`function`&&(t.preRun=[t.preRun]);t.preRun.length;)ge(t.preRun.shift());S(w)}function ee(){$.O()}function te(){if(t.postRun)for(typeof t.postRun==`function`&&(t.postRun=[t.postRun]);t.postRun.length;)he(t.postRun.shift());S(C)}function g(e){throw t.onAbort?.(e),e=`Aborted(${e})`,u(e),f=!0,e+=`. Build with -sASSERTIONS for more info.`,new WebAssembly.RuntimeError(e)}var _;function ne(){return t.locateFile?o(`creator-ui.wasm`):new URL(`/assets/creator-ui-IOlJLP4k.wasm`,``+import.meta.url).href}function re(e){if(e==_&&d)return new Uint8Array(d);if(c)return c(e);throw`both async and sync fetching of the wasm failed`}async function ie(e){if(!d)try{var t=await s(e);return new Uint8Array(t)}catch{}return re(e)}async function ae(e,t){try{var n=await ie(e);return await WebAssembly.instantiate(n,t)}catch(e){u(`failed to asynchronously prepare wasm: ${e}`),g(e)}}async function oe(e,t,n){if(!e)try{var r=fetch(t,{credentials:`same-origin`});return await WebAssembly.instantiateStreaming(r,n)}catch(e){u(`wasm streaming compile failed: ${e}`),u(`falling back to ArrayBuffer instantiation`)}return ae(t,n)}function se(){return{a:He}}async function ce(){function e(e,t){return $=e.exports,Ve($),m(),$}function n(t){return e(t.instance)}var r=se();return t.instantiateWasm?new Promise((n,i)=>{t.instantiateWasm(r,(t,r)=>{n(e(t,r))})}):(_??=ne(),n(await oe(d,_,r)))}var le,ue,v,y,de,fe,pe,b,me,x,S=e=>{for(;e.length>0;)e.shift()(t)},C=[],he=e=>C.push(e),w=[],ge=e=>w.push(e),T=e=>K(e),E=()=>q(),D=[],O=0,_e=e=>{var t=new N(e);return t.get_caught()||(t.set_caught(!0),O--),t.set_rethrown(!1),D.push(t),Y(e)},ve=()=>{G(0,0);var e=D.pop();J(e.excPtr)},k=e=>(setTempRet0(0),0),A=()=>k([]),j=e=>k([e]),M=()=>{D.length||g(`no exception to throw`);var e=D.at(-1);e.excPtr,e.set_rethrown(!0),e.set_caught(!1),O++,g()};class N{constructor(e){this.excPtr=e,this.ptr=e-24}set_type(e){b[this.ptr+4>>2]=e}get_type(){return b[this.ptr+4>>2]}set_destructor(e){b[this.ptr+8>>2]=e}get_destructor(){return b[this.ptr+8>>2]}set_caught(e){e=+!!e,y[this.ptr+12]=e}get_caught(){return y[this.ptr+12]!=0}set_rethrown(e){e=+!!e,y[this.ptr+13]=e}get_rethrown(){return y[this.ptr+13]!=0}init(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t)}set_adjusted_ptr(e){b[this.ptr+16>>2]=e}get_adjusted_ptr(){return b[this.ptr+16>>2]}}var P=(e,t,n)=>{new N(e).init(t,n),O++,g()},F=e=>{g()},ye=()=>g(``),be=e=>{g(`OOM`)},xe=e=>{x.length,e>>>=0,be(e)},Se=e=>52,Ce=9007199254740992,we=-9007199254740992,Te=e=>e<we||e>Ce?NaN:Number(e);function Ee(e,t,n,r){return t=Te(t),70}var De=[null,[],[]],I=new TextDecoder,L=(e,t,n,r)=>{var i=t+n;if(r)return i;for(;e[t]&&!(t>=i);)++t;return t},Oe=(e,t=0,n,r)=>{var i=L(e,t,n,r);return I.decode(e.buffer?e.subarray(t,i):new Uint8Array(e.slice(t,i)))},ke=(e,t)=>{var n=De[e];t===0||t===10?((e===1?l:u)(Oe(n)),n.length=0):n.push(t)},R=(e,t,n)=>{if(!e)return``;var r=L(x,e,t,n);return I.decode(x.subarray(e,r))},Ae=(e,t,n,r)=>{for(var i=0,a=0;a<n;a++){var o=b[t>>2],s=b[t+4>>2];t+=8;for(var c=0;c<s;c++)ke(e,x[o+c]);i+=s}return b[r>>2]=i,0},z=e=>Z.get(e),je=(e,t)=>{if(B)for(var n=e;n<e+t;n++){var r=z(n);r&&B.set(r,n)}},B,Me=e=>(B||(B=new WeakMap,je(0,Z.length)),B.get(e)||0),V=[],Ne=()=>V.length?V.pop():Z.grow(1),H=(e,t)=>Z.set(e,t),U=e=>{let t=e.length;return[t%128|128,t>>7,...e]},Pe={i:127,p:127,j:126,f:125,d:124,e:111},W=e=>U(Array.from(e,e=>Pe[e])),Fe=(e,t)=>{var n=Uint8Array.of(0,97,115,109,1,0,0,0,1,...U([1,96,...W(t.slice(1)),...W(t[0]===`v`?``:t[0])]),2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0),r=new WebAssembly.Module(n);return new WebAssembly.Instance(r,{e:{f:e}}).exports.f},Ie=(e,t)=>{var n=Me(e);if(n)return n;var r=Ne();try{H(r,e)}catch(n){if(!(n instanceof TypeError))throw n;H(r,Fe(e,t))}return B.set(e,r),r},Le=(e,t,n,r)=>{if(!(r>0))return 0;for(var i=n,a=n+r-1,o=0;o<e.length;++o){var s=e.codePointAt(o);if(s<=127){if(n>=a)break;t[n++]=s}else if(s<=2047){if(n+1>=a)break;t[n++]=192|s>>6,t[n++]=128|s&63}else if(s<=65535){if(n+2>=a)break;t[n++]=224|s>>12,t[n++]=128|s>>6&63,t[n++]=128|s&63}else{if(n+3>=a)break;t[n++]=240|s>>18,t[n++]=128|s>>12&63,t[n++]=128|s>>6&63,t[n++]=128|s&63,o++}}return t[n]=0,n-i},Re=(e,t,n)=>Le(e,x,t,n),ze=e=>{for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);r<=127?t++:r<=2047?t+=2:r>=55296&&r<=57343?(t+=4,++n):t+=3}return t};if(t.noExitRuntime&&t.noExitRuntime,t.print&&(l=t.print),t.printErr&&(u=t.printErr),t.wasmBinary&&(d=t.wasmBinary),t.arguments&&t.arguments,t.thisProgram&&t.thisProgram,t.preInit)for(typeof t.preInit==`function`&&(t.preInit=[t.preInit]);t.preInit.length>0;)t.preInit.shift()();t.UTF8ToString=R,t.addFunction=Ie,t.stringToUTF8=Re,t.lengthBytesUTF8=ze;function Be(e){console.error(R(e))}var G,K,q,J,Y,X,Z;function Ve(e){t._setMeasureFunc=e.Q,t._getScreenId=e.R,t._createNodeRoot=e.S,t._createNode=e.T,t._freeNode=e.U,t._removeNode=e.V,t._addStringHandler=e.W,t._addFloatHandler=e.X,t._addUIntHandler=e.Y,t._addResetHandler=e.Z,t._setMatrixHandler=e._,t._setGradientHandler=e.$,t._setGradientsHandler=e.aa,t._resetProp=e.ba,t._setFloat=e.ca,t._setFloatExt=e.da,t._setString=e.ea,t._setStringExt=e.fa,t._enableNodeLayer=e.ga,t._disableNodeLayer=e.ha,t._resetNodeLayer=e.ia,t._mergeNodeLayer=e.ja,t._calculate=e.ka,t._setConditionValue=e.la,t._calculateWidget=e.ma,t._freeWidget=e.na,t._setSafePaddings=e.oa,t._setComfortInset=e.pa,t._recalculate=e.qa,t._markNodeDirty=e.ra,t._nodeHasFixedSize=e.sa,t._getOffset=e.ta,t._getParentNode=e.ua,t._getContentHeight=e.va,t._getContentWidth=e.wa,t._getLayer=e.xa,t._getLayoutPointer=e.ya,t._getLayoutDOMPointer=e.za,t._getPaddingPointer=e.Aa,t._setVListHandlers=e.Ba,t._vlistInit=e.Ca,t._vlistExists=e.Da,t._vlistFree=e.Ea,t._vlistSetKeys=e.Fa,t._vlistInsertKeys=e.Ga,t._vlistRemoveKeys=e.Ha,t._vlistInvalidate=e.Ia,t._vlistCreateItemRoot=e.Ja,t._vlistItemMounted=e.Ka,t._vlistItemUnmounted=e.La,t._vlistOnScroll=e.Ma,t._vlistUpdateLayout=e.Na,t._vlistToPhysical=e.Oa,t._vlistOffsetOf=e.Pa,t._vlistItemOffsetOf=e.Qa,t._free=e.Ra,t._malloc=e.Sa,G=e.Ta,K=e.Ua,q=e.Va,J=e.Wa,Y=e.Xa,X=e.N,Z=e.P}var He={v:_e,I:ve,a:A,n:j,J:M,t:P,e:F,C:ye,H:Be,B:xe,E:Se,D:Ee,x:Ae,o:Qe,k:rt,h:Q,g:nt,z:ct,c:Ge,r:it,d:Ue,u:ut,q:ot,F:ft,w:Ye,G:lt,b:We,j:qe,A:tt,m:Ze,i:$e,y:pt,L:et,l:st,K:at,M:Xe,f:Ke,s:Je,p:dt};function Ue(e,t,n){var r=E();try{return z(e)(t,n)}catch(e){if(T(r),!(e instanceof p))throw e;G(1,0)}}function We(e){var t=E();try{z(e)()}catch(e){if(T(t),!(e instanceof p))throw e;G(1,0)}}function Ge(e,t){var n=E();try{return z(e)(t)}catch(e){if(T(n),!(e instanceof p))throw e;G(1,0)}}function Ke(e,t,n,r,i){var a=E();try{z(e)(t,n,r,i)}catch(e){if(T(a),!(e instanceof p))throw e;G(1,0)}}function qe(e,t){var n=E();try{z(e)(t)}catch(e){if(T(n),!(e instanceof p))throw e;G(1,0)}}function Je(e,t,n,r,i,a){var o=E();try{z(e)(t,n,r,i,a)}catch(e){if(T(o),!(e instanceof p))throw e;G(1,0)}}function Ye(e,t,n,r,i,a,o,s,c,l,u,d){var f=E();try{return z(e)(t,n,r,i,a,o,s,c,l,u,d)}catch(e){if(T(f),!(e instanceof p))throw e;G(1,0)}}function Xe(e,t,n,r,i,a,o,s,c,l,u){var d=E();try{z(e)(t,n,r,i,a,o,s,c,l,u)}catch(e){if(T(d),!(e instanceof p))throw e;G(1,0)}}function Ze(e,t,n,r){var i=E();try{z(e)(t,n,r)}catch(e){if(T(i),!(e instanceof p))throw e;G(1,0)}}function Qe(e,t){var n=E();try{return z(e)(t)}catch(e){if(T(n),!(e instanceof p))throw e;G(1,0)}}function $e(e,t,n){var r=E();try{z(e)(t,n)}catch(e){if(T(r),!(e instanceof p))throw e;G(1,0)}}function et(e,t,n,r,i){var a=E();try{z(e)(t,n,r,i)}catch(e){if(T(a),!(e instanceof p))throw e;G(1,0)}}function tt(e,t,n){var r=E();try{z(e)(t,n)}catch(e){if(T(r),!(e instanceof p))throw e;G(1,0)}}function nt(e,t,n,r,i,a){var o=E();try{return z(e)(t,n,r,i,a)}catch(e){if(T(o),!(e instanceof p))throw e;G(1,0)}}function Q(e,t,n,r,i){var a=E();try{return z(e)(t,n,r,i)}catch(e){if(T(a),!(e instanceof p))throw e;G(1,0)}}function rt(e,t,n,r){var i=E();try{return z(e)(t,n,r)}catch(e){if(T(i),!(e instanceof p))throw e;G(1,0)}}function it(e,t,n,r,i,a,o,s,c,l,u,d,f,m){var h=E();try{return z(e)(t,n,r,i,a,o,s,c,l,u,d,f,m)}catch(e){if(T(h),!(e instanceof p))throw e;G(1,0)}}function at(e,t,n,r,i,a,o,s,c,l){var u=E();try{z(e)(t,n,r,i,a,o,s,c,l)}catch(e){if(T(u),!(e instanceof p))throw e;G(1,0)}}function ot(e,t,n,r,i){var a=E();try{return z(e)(t,n,r,i)}catch(e){if(T(a),!(e instanceof p))throw e;G(1,0)}}function st(e,t,n,r){var i=E();try{z(e)(t,n,r)}catch(e){if(T(i),!(e instanceof p))throw e;G(1,0)}}function ct(e,t,n,r,i,a,o){var s=E();try{return z(e)(t,n,r,i,a,o)}catch(e){if(T(s),!(e instanceof p))throw e;G(1,0)}}function lt(e,t,n,r,i,a,o,s,c,l){var u=E();try{return z(e)(t,n,r,i,a,o,s,c,l)}catch(e){if(T(u),!(e instanceof p))throw e;G(1,0)}}function ut(e,t,n,r){var i=E();try{return z(e)(t,n,r)}catch(e){if(T(i),!(e instanceof p))throw e;G(1,0)}}function dt(e,t,n,r,i,a,o){var s=E();try{z(e)(t,n,r,i,a,o)}catch(e){if(T(s),!(e instanceof p))throw e;G(1,0)}}function ft(e,t,n,r,i,a){var o=E();try{return z(e)(t,n,r,i,a)}catch(e){if(T(o),!(e instanceof p))throw e;G(1,0)}}function pt(e,t,n,r){var i=E();try{z(e)(t,n,r)}catch(e){if(T(i),!(e instanceof p))throw e;G(1,0)}}async function mt(){h();var e=t.setStatus;e&&(e(`Running...`),await new Promise(e=>setTimeout(e,1)),setTimeout(e,1,``)),!f&&(ee(),t.onRuntimeInitialized?.(),te())}var $=await ce();return await mt(),t}export{e as default};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function e(e){let t=Object.create(null);for(let n of e.split(`,`))t[n]=1;return e=>e in t}var t={},n=[],r=()=>{},i=()=>!1,a=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),o=e=>e.startsWith(`onUpdate:`),s=Object.assign,c=(e,t)=>{let n=e.indexOf(t);n>-1&&e.splice(n,1)},l=Object.prototype.hasOwnProperty,u=(e,t)=>l.call(e,t),d=Array.isArray,f=e=>x(e)===`[object Map]`,p=e=>x(e)===`[object Set]`,m=e=>x(e)===`[object Date]`,h=e=>typeof e==`function`,g=e=>typeof e==`string`,_=e=>typeof e==`symbol`,v=e=>typeof e==`object`&&!!e,y=e=>(v(e)||h(e))&&h(e.then)&&h(e.catch),b=Object.prototype.toString,x=e=>b.call(e),S=e=>x(e).slice(8,-1),C=e=>x(e)===`[object Object]`,w=e=>g(e)&&e!==`NaN`&&e[0]!==`-`&&``+parseInt(e,10)===e,T=e(`,key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted`),ee=e=>{let t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},te=/-\w/g,E=ee(e=>e.replace(te,e=>e.slice(1).toUpperCase())),ne=/\B([A-Z])/g,D=ee(e=>e.replace(ne,`-$1`).toLowerCase()),re=ee(e=>e.charAt(0).toUpperCase()+e.slice(1)),ie=ee(e=>e?`on${re(e)}`:``),O=(e,t)=>!Object.is(e,t),ae=(e,...t)=>{for(let n=0;n<e.length;n++)e[n](...t)},k=(e,t,n,r=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},A=e=>{let t=parseFloat(e);return isNaN(t)?e:t},oe,se=()=>oe||=typeof globalThis<`u`?globalThis:typeof self<`u`?self:typeof window<`u`?window:typeof global<`u`?global:{};function j(e){if(d(e)){let t={};for(let n=0;n<e.length;n++){let r=e[n],i=g(r)?ue(r):j(r);if(i)for(let e in i)t[e]=i[e]}return t}else if(g(e)||v(e))return e}var ce=/;(?![^(]*\))/g,le=/:([^]+)/,M=/\/\*[^]*?\*\//g;function ue(e){let t={};return e.replace(M,``).split(ce).forEach(e=>{if(e){let n=e.split(le);n.length>1&&(t[n[0].trim()]=n[1].trim())}}),t}function N(e){let t=``;if(g(e))t=e;else if(d(e))for(let n=0;n<e.length;n++){let r=N(e[n]);r&&(t+=r+` `)}else if(v(e))for(let n in e)e[n]&&(t+=n+` `);return t.trim()}var P=`itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`,de=e(P);P+``;function F(e){return!!e||e===``}function fe(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&r<e.length;r++)n=I(e[r],t[r]);return n}function I(e,t){if(e===t)return!0;let n=m(e),r=m(t);if(n||r)return n&&r?e.getTime()===t.getTime():!1;if(n=_(e),r=_(t),n||r)return e===t;if(n=d(e),r=d(t),n||r)return n&&r?fe(e,t):!1;if(n=v(e),r=v(t),n||r){if(!n||!r||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e){let r=e.hasOwnProperty(n),i=t.hasOwnProperty(n);if(r&&!i||!r&&i||!I(e[n],t[n]))return!1}}return String(e)===String(t)}var pe=e=>!!(e&&e.__v_isRef===!0),L=e=>g(e)?e:e==null?``:d(e)||v(e)&&(e.toString===b||!h(e.toString))?pe(e)?L(e.value):JSON.stringify(e,me,2):String(e),me=(e,t)=>pe(t)?me(e,t.value):f(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((e,[t,n],r)=>(e[he(t,r)+` =>`]=n,e),{})}:p(t)?{[`Set(${t.size})`]:[...t.values()].map(e=>he(e))}:_(t)?he(t):v(t)&&!d(t)&&!C(t)?String(t):t,he=(e,t=``)=>_(e)?`Symbol(${e.description??t})`:e,R,ge=class{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&R&&(R.active?(this.parent=R,this.index=(R.scopes||=[]).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].pause();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].resume();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].resume()}}run(e){if(this._active){let t=R;try{return R=this,e()}finally{R=t}}}on(){++this._on===1&&(this.prevScope=R,R=this)}off(){if(this._on>0&&--this._on===0){if(R===this)R=this.prevScope;else{let e=R;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let t,n;for(t=0,n=this.effects.length;t<n;t++)this.effects[t].stop();for(this.effects.length=0,t=0,n=this.cleanups.length;t<n;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){for(t=0,n=this.scopes.length;t<n;t++)this.scopes[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){let e=this.parent.scopes.pop();e&&e!==this&&(this.parent.scopes[this.index]=e,e.index=this.index)}this.parent=void 0}}};function _e(){return R}var z,ve=new WeakSet,ye=class{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,R&&(R.active?R.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,ve.has(this)&&(ve.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||V(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Ne(this),Ce(this);let e=z,t=ke;z=this,ke=!0;try{return this.fn()}finally{we(this),z=e,ke=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)De(e);this.deps=this.depsTail=void 0,Ne(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?ve.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Te(this)&&this.run()}get dirty(){return Te(this)}},be=0,xe,B;function V(e,t=!1){if(e.flags|=8,t){e.next=B,B=e;return}e.next=xe,xe=e}function H(){be++}function Se(){if(--be>0)return;if(B){let e=B;for(B=void 0;e;){let t=e.next;e.next=void 0,e.flags&=-9,e=t}}let e;for(;xe;){let t=xe;for(xe=void 0;t;){let n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(t){e||=t}t=n}}if(e)throw e}function Ce(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function we(e){let t,n=e.depsTail,r=n;for(;r;){let e=r.prevDep;r.version===-1?(r===n&&(n=e),De(r),Oe(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=e}e.deps=t,e.depsTail=n}function Te(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Ee(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Ee(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Pe)||(e.globalVersion=Pe,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!Te(e))))return;e.flags|=2;let t=e.dep,n=z,r=ke;z=e,ke=!0;try{Ce(e);let n=e.fn(e._value);(t.version===0||O(n,e._value))&&(e.flags|=128,e._value=n,t.version++)}catch(e){throw t.version++,e}finally{z=n,ke=r,we(e),e.flags&=-3}}function De(e,t=!1){let{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let e=n.computed.deps;e;e=e.nextDep)De(e,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Oe(e){let{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}var ke=!0,Ae=[];function je(){Ae.push(ke),ke=!1}function Me(){let e=Ae.pop();ke=e===void 0?!0:e}function Ne(e){let{cleanup:t}=e;if(e.cleanup=void 0,t){let e=z;z=void 0;try{t()}finally{z=e}}}var Pe=0,Fe=class{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}},Ie=class{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!z||!ke||z===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==z)t=this.activeLink=new Fe(z,this),z.deps?(t.prevDep=z.depsTail,z.depsTail.nextDep=t,z.depsTail=t):z.deps=z.depsTail=t,Le(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){let e=t.nextDep;e.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=e),t.prevDep=z.depsTail,t.nextDep=void 0,z.depsTail.nextDep=t,z.depsTail=t,z.deps===t&&(z.deps=e)}return t}trigger(e){this.version++,Pe++,this.notify(e)}notify(e){H();try{for(let e=this.subs;e;e=e.prevSub)e.sub.notify()&&e.sub.dep.notify()}finally{Se()}}};function Le(e){if(e.dep.sc++,e.sub.flags&4){let t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let e=t.deps;e;e=e.nextDep)Le(e)}let n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}var Re=new WeakMap,ze=Symbol(``),Be=Symbol(``),Ve=Symbol(``);function U(e,t,n){if(ke&&z){let t=Re.get(e);t||Re.set(e,t=new Map);let r=t.get(n);r||(t.set(n,r=new Ie),r.map=t,r.key=n),r.track()}}function He(e,t,n,r,i,a){let o=Re.get(e);if(!o){Pe++;return}let s=e=>{e&&e.trigger()};if(H(),t===`clear`)o.forEach(s);else{let i=d(e),a=i&&w(n);if(i&&n===`length`){let e=Number(r);o.forEach((t,n)=>{(n===`length`||n===Ve||!_(n)&&n>=e)&&s(t)})}else switch((n!==void 0||o.has(void 0))&&s(o.get(n)),a&&s(o.get(Ve)),t){case`add`:i?a&&s(o.get(`length`)):(s(o.get(ze)),f(e)&&s(o.get(Be)));break;case`delete`:i||(s(o.get(ze)),f(e)&&s(o.get(Be)));break;case`set`:f(e)&&s(o.get(ze));break}}Se()}function Ue(e){let t=K(e);return t===e?t:(U(t,`iterate`,Ve),Et(e)?t:t.map(kt))}function We(e){return U(e=K(e),`iterate`,Ve),e}function Ge(e,t){return Tt(e)?At(wt(e)?kt(t):t):kt(t)}var Ke={__proto__:null,[Symbol.iterator](){return qe(this,Symbol.iterator,e=>Ge(this,e))},concat(...e){return Ue(this).concat(...e.map(e=>d(e)?Ue(e):e))},entries(){return qe(this,`entries`,e=>(e[1]=Ge(this,e[1]),e))},every(e,t){return Ye(this,`every`,e,t,void 0,arguments)},filter(e,t){return Ye(this,`filter`,e,t,e=>e.map(e=>Ge(this,e)),arguments)},find(e,t){return Ye(this,`find`,e,t,e=>Ge(this,e),arguments)},findIndex(e,t){return Ye(this,`findIndex`,e,t,void 0,arguments)},findLast(e,t){return Ye(this,`findLast`,e,t,e=>Ge(this,e),arguments)},findLastIndex(e,t){return Ye(this,`findLastIndex`,e,t,void 0,arguments)},forEach(e,t){return Ye(this,`forEach`,e,t,void 0,arguments)},includes(...e){return Xe(this,`includes`,e)},indexOf(...e){return Xe(this,`indexOf`,e)},join(e){return Ue(this).join(e)},lastIndexOf(...e){return Xe(this,`lastIndexOf`,e)},map(e,t){return Ye(this,`map`,e,t,void 0,arguments)},pop(){return Ze(this,`pop`)},push(...e){return Ze(this,`push`,e)},reduce(e,...t){return W(this,`reduce`,e,t)},reduceRight(e,...t){return W(this,`reduceRight`,e,t)},shift(){return Ze(this,`shift`)},some(e,t){return Ye(this,`some`,e,t,void 0,arguments)},splice(...e){return Ze(this,`splice`,e)},toReversed(){return Ue(this).toReversed()},toSorted(e){return Ue(this).toSorted(e)},toSpliced(...e){return Ue(this).toSpliced(...e)},unshift(...e){return Ze(this,`unshift`,e)},values(){return qe(this,`values`,e=>Ge(this,e))}};function qe(e,t,n){let r=We(e),i=r[t]();return r!==e&&!Et(e)&&(i._next=i.next,i.next=()=>{let e=i._next();return e.done||(e.value=n(e.value)),e}),i}var Je=Array.prototype;function Ye(e,t,n,r,i,a){let o=We(e),s=o!==e&&!Et(e),c=o[t];if(c!==Je[t]){let t=c.apply(e,a);return s?kt(t):t}let l=n;o!==e&&(s?l=function(t,r){return n.call(this,Ge(e,t),r,e)}:n.length>2&&(l=function(t,r){return n.call(this,t,r,e)}));let u=c.call(o,l,r);return s&&i?i(u):u}function W(e,t,n,r){let i=We(e),a=i!==e&&!Et(e),o=n,s=!1;i!==e&&(a?(s=r.length===0,o=function(t,r,i){return s&&(s=!1,t=Ge(e,t)),n.call(this,t,Ge(e,r),i,e)}):n.length>3&&(o=function(t,r,i){return n.call(this,t,r,i,e)}));let c=i[t](o,...r);return s?Ge(e,c):c}function Xe(e,t,n){let r=K(e);U(r,`iterate`,Ve);let i=r[t](...n);return(i===-1||i===!1)&&Dt(n[0])?(n[0]=K(n[0]),r[t](...n)):i}function Ze(e,t,n=[]){je(),H();let r=K(e)[t].apply(e,n);return Se(),Me(),r}var Qe=e(`__proto__,__v_isRef,__isVue`),$e=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!==`arguments`&&e!==`caller`).map(e=>Symbol[e]).filter(_));function et(e){_(e)||(e=String(e));let t=K(this);return U(t,`has`,e),t.hasOwnProperty(e)}var tt=class{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,n){if(t===`__v_skip`)return e.__v_skip;let r=this._isReadonly,i=this._isShallow;if(t===`__v_isReactive`)return!r;if(t===`__v_isReadonly`)return r;if(t===`__v_isShallow`)return i;if(t===`__v_raw`)return n===(r?i?vt:_t:i?gt:ht).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;let a=d(e);if(!r){let e;if(a&&(e=Ke[t]))return e;if(t===`hasOwnProperty`)return et}let o=Reflect.get(e,t,q(e)?e:n);if((_(t)?$e.has(t):Qe(t))||(r||U(e,`get`,t),i))return o;if(q(o)){let e=a&&w(t)?o:o.value;return r&&v(e)?St(e):e}return v(o)?r?St(o):bt(o):o}},nt=class extends tt{constructor(e=!1){super(!1,e)}set(e,t,n,r){let i=e[t],a=d(e)&&w(t);if(!this._isShallow){let e=Tt(i);if(!Et(n)&&!Tt(n)&&(i=K(i),n=K(n)),!a&&q(i)&&!q(n))return e||(i.value=n),!0}let o=a?Number(t)<e.length:u(e,t),s=Reflect.set(e,t,n,q(e)?e:r);return e===K(r)&&(o?O(n,i)&&He(e,`set`,t,n,i):He(e,`add`,t,n)),s}deleteProperty(e,t){let n=u(e,t),r=e[t],i=Reflect.deleteProperty(e,t);return i&&n&&He(e,`delete`,t,void 0,r),i}has(e,t){let n=Reflect.has(e,t);return(!_(t)||!$e.has(t))&&U(e,`has`,t),n}ownKeys(e){return U(e,`iterate`,d(e)?`length`:ze),Reflect.ownKeys(e)}},rt=class extends tt{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}},it=new nt,at=new rt,ot=new nt(!0),st=e=>e,ct=e=>Reflect.getPrototypeOf(e);function lt(e,t,n){return function(...r){let i=this.__v_raw,a=K(i),o=f(a),c=e===`entries`||e===Symbol.iterator&&o,l=e===`keys`&&o,u=i[e](...r),d=n?st:t?At:kt;return!t&&U(a,`iterate`,l?Be:ze),s(Object.create(u),{next(){let{value:e,done:t}=u.next();return t?{value:e,done:t}:{value:c?[d(e[0]),d(e[1])]:d(e),done:t}}})}}function ut(e){return function(...t){return e===`delete`?!1:e===`clear`?void 0:this}}function dt(e,t){let n={get(n){let r=this.__v_raw,i=K(r),a=K(n);e||(O(n,a)&&U(i,`get`,n),U(i,`get`,a));let{has:o}=ct(i),s=t?st:e?At:kt;if(o.call(i,n))return s(r.get(n));if(o.call(i,a))return s(r.get(a));r!==i&&r.get(n)},get size(){let t=this.__v_raw;return!e&&U(K(t),`iterate`,ze),t.size},has(t){let n=this.__v_raw,r=K(n),i=K(t);return e||(O(t,i)&&U(r,`has`,t),U(r,`has`,i)),t===i?n.has(t):n.has(t)||n.has(i)},forEach(n,r){let i=this,a=i.__v_raw,o=K(a),s=t?st:e?At:kt;return!e&&U(o,`iterate`,ze),a.forEach((e,t)=>n.call(r,s(e),s(t),i))}};return s(n,e?{add:ut(`add`),set:ut(`set`),delete:ut(`delete`),clear:ut(`clear`)}:{add(e){let n=K(this),r=ct(n),i=K(e),a=!t&&!Et(e)&&!Tt(e)?i:e;return r.has.call(n,a)||O(e,a)&&r.has.call(n,e)||O(i,a)&&r.has.call(n,i)||(n.add(a),He(n,`add`,a,a)),this},set(e,n){!t&&!Et(n)&&!Tt(n)&&(n=K(n));let r=K(this),{has:i,get:a}=ct(r),o=i.call(r,e);o||=(e=K(e),i.call(r,e));let s=a.call(r,e);return r.set(e,n),o?O(n,s)&&He(r,`set`,e,n,s):He(r,`add`,e,n),this},delete(e){let t=K(this),{has:n,get:r}=ct(t),i=n.call(t,e);i||=(e=K(e),n.call(t,e));let a=r?r.call(t,e):void 0,o=t.delete(e);return i&&He(t,`delete`,e,void 0,a),o},clear(){let e=K(this),t=e.size!==0,n=e.clear();return t&&He(e,`clear`,void 0,void 0,void 0),n}}),[`keys`,`values`,`entries`,Symbol.iterator].forEach(r=>{n[r]=lt(r,e,t)}),n}function ft(e,t){let n=dt(e,t);return(t,r,i)=>r===`__v_isReactive`?!e:r===`__v_isReadonly`?e:r===`__v_raw`?t:Reflect.get(u(n,r)&&r in t?n:t,r,i)}var G={get:ft(!1,!1)},pt={get:ft(!1,!0)},mt={get:ft(!0,!1)},ht=new WeakMap,gt=new WeakMap,_t=new WeakMap,vt=new WeakMap;function yt(e){switch(e){case`Object`:case`Array`:return 1;case`Map`:case`Set`:case`WeakMap`:case`WeakSet`:return 2;default:return 0}}function bt(e){return Tt(e)?e:Ct(e,!1,it,G,ht)}function xt(e){return Ct(e,!1,ot,pt,gt)}function St(e){return Ct(e,!0,at,mt,_t)}function Ct(e,t,n,r,i){if(!v(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;let a=i.get(e);if(a)return a;let o=yt(S(e));if(o===0)return e;let s=new Proxy(e,o===2?r:n);return i.set(e,s),s}function wt(e){return Tt(e)?wt(e.__v_raw):!!(e&&e.__v_isReactive)}function Tt(e){return!!(e&&e.__v_isReadonly)}function Et(e){return!!(e&&e.__v_isShallow)}function Dt(e){return e?!!e.__v_raw:!1}function K(e){let t=e&&e.__v_raw;return t?K(t):e}function Ot(e){return!u(e,`__v_skip`)&&Object.isExtensible(e)&&k(e,`__v_skip`,!0),e}var kt=e=>v(e)?bt(e):e,At=e=>v(e)?St(e):e;function q(e){return e?e.__v_isRef===!0:!1}function J(e){return jt(e,!1)}function jt(e,t){return q(e)?e:new Mt(e,t)}var Mt=class{constructor(e,t){this.dep=new Ie,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:K(e),this._value=t?e:kt(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){let t=this._rawValue,n=this.__v_isShallow||Et(e)||Tt(e);e=n?e:K(e),O(e,t)&&(this._rawValue=e,this._value=n?e:kt(e),this.dep.trigger())}};function Nt(e){return q(e)?e.value:e}var Pt={get:(e,t,n)=>t===`__v_raw`?e:Nt(Reflect.get(e,t,n)),set:(e,t,n,r)=>{let i=e[t];return q(i)&&!q(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function Ft(e){return wt(e)?e:new Proxy(e,Pt)}var It=class{constructor(e,t,n){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Ie(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Pe-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=n}notify(){if(this.flags|=16,!(this.flags&8)&&z!==this)return V(this,!0),!0}get value(){let e=this.dep.track();return Ee(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}};function Lt(e,t,n=!1){let r,i;return h(e)?r=e:(r=e.get,i=e.set),new It(r,i,n)}var Rt={},zt=new WeakMap,Bt=void 0;function Vt(e,t=!1,n=Bt){if(n){let t=zt.get(n);t||zt.set(n,t=[]),t.push(e)}}function Ht(e,n,i=t){let{immediate:a,deep:o,once:s,scheduler:l,augmentJob:u,call:f}=i,p=e=>o?e:Et(e)||o===!1||o===0?Ut(e,1):Ut(e),m,g,_,v,y=!1,b=!1;if(q(e)?(g=()=>e.value,y=Et(e)):wt(e)?(g=()=>p(e),y=!0):d(e)?(b=!0,y=e.some(e=>wt(e)||Et(e)),g=()=>e.map(e=>{if(q(e))return e.value;if(wt(e))return p(e);if(h(e))return f?f(e,2):e()})):g=h(e)?n?f?()=>f(e,2):e:()=>{if(_){je();try{_()}finally{Me()}}let t=Bt;Bt=m;try{return f?f(e,3,[v]):e(v)}finally{Bt=t}}:r,n&&o){let e=g,t=o===!0?1/0:o;g=()=>Ut(e(),t)}let x=_e(),S=()=>{m.stop(),x&&x.active&&c(x.effects,m)};if(s&&n){let e=n;n=(...t)=>{e(...t),S()}}let C=b?Array(e.length).fill(Rt):Rt,w=e=>{if(!(!(m.flags&1)||!m.dirty&&!e))if(n){let e=m.run();if(o||y||(b?e.some((e,t)=>O(e,C[t])):O(e,C))){_&&_();let t=Bt;Bt=m;try{let t=[e,C===Rt?void 0:b&&C[0]===Rt?[]:C,v];C=e,f?f(n,3,t):n(...t)}finally{Bt=t}}}else m.run()};return u&&u(w),m=new ye(g),m.scheduler=l?()=>l(w,!1):w,v=e=>Vt(e,!1,m),_=m.onStop=()=>{let e=zt.get(m);if(e){if(f)f(e,4);else for(let t of e)t();zt.delete(m)}},n?a?w(!0):C=m.run():l?l(w.bind(null,!0),!0):m.run(),S.pause=m.pause.bind(m),S.resume=m.resume.bind(m),S.stop=S,S}function Ut(e,t=1/0,n){if(t<=0||!v(e)||e.__v_skip||(n||=new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,q(e))Ut(e.value,t,n);else if(d(e))for(let r=0;r<e.length;r++)Ut(e[r],t,n);else if(p(e)||f(e))e.forEach(e=>{Ut(e,t,n)});else if(C(e)){for(let r in e)Ut(e[r],t,n);for(let r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&Ut(e[r],t,n)}return e}function Wt(e,t,n,r){try{return r?e(...r):e()}catch(e){Kt(e,t,n)}}function Gt(e,t,n,r){if(h(e)){let i=Wt(e,t,n,r);return i&&y(i)&&i.catch(e=>{Kt(e,t,n)}),i}if(d(e)){let i=[];for(let a=0;a<e.length;a++)i.push(Gt(e[a],t,n,r));return i}}function Kt(e,n,r,i=!0){let a=n?n.vnode:null,{errorHandler:o,throwUnhandledErrorInProduction:s}=n&&n.appContext.config||t;if(n){let t=n.parent,i=n.proxy,a=`https://vuejs.org/error-reference/#runtime-${r}`;for(;t;){let n=t.ec;if(n){for(let t=0;t<n.length;t++)if(n[t](e,i,a)===!1)return}t=t.parent}if(o){je(),Wt(o,null,10,[e,i,a]),Me();return}}qt(e,r,a,i,s)}function qt(e,t,n,r=!0,i=!1){if(i)throw e;console.error(e)}var Jt=[],Yt=-1,Xt=[],Zt=null,Qt=0,$t=Promise.resolve(),en=null;function tn(e){let t=en||$t;return e?t.then(this?e.bind(this):e):t}function nn(e){let t=Yt+1,n=Jt.length;for(;t<n;){let r=t+n>>>1,i=Jt[r],a=ln(i);a<e||a===e&&i.flags&2?t=r+1:n=r}return t}function rn(e){if(!(e.flags&1)){let t=ln(e),n=Jt[Jt.length-1];!n||!(e.flags&2)&&t>=ln(n)?Jt.push(e):Jt.splice(nn(t),0,e),e.flags|=1,an()}}function an(){en||=$t.then(un)}function on(e){d(e)?Xt.push(...e):Zt&&e.id===-1?Zt.splice(Qt+1,0,e):e.flags&1||(Xt.push(e),e.flags|=1),an()}function sn(e,t,n=Yt+1){for(;n<Jt.length;n++){let t=Jt[n];if(t&&t.flags&2){if(e&&t.id!==e.uid)continue;Jt.splice(n,1),n--,t.flags&4&&(t.flags&=-2),t(),t.flags&4||(t.flags&=-2)}}}function cn(e){if(Xt.length){let e=[...new Set(Xt)].sort((e,t)=>ln(e)-ln(t));if(Xt.length=0,Zt){Zt.push(...e);return}for(Zt=e,Qt=0;Qt<Zt.length;Qt++){let e=Zt[Qt];e.flags&4&&(e.flags&=-2),e.flags&8||e(),e.flags&=-2}Zt=null,Qt=0}}var ln=e=>e.id==null?e.flags&2?-1:1/0:e.id;function un(e){try{for(Yt=0;Yt<Jt.length;Yt++){let e=Jt[Yt];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),Wt(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;Yt<Jt.length;Yt++){let e=Jt[Yt];e&&(e.flags&=-2)}Yt=-1,Jt.length=0,cn(e),en=null,(Jt.length||Xt.length)&&un(e)}}var dn=null,fn=null;function pn(e){let t=dn;return dn=e,fn=e&&e.type.__scopeId||null,t}function mn(e,t=dn,n){if(!t||e._n)return e;let r=(...n)=>{r._d&&xi(-1);let i=pn(t),a;try{a=e(...n)}finally{pn(i),r._d&&xi(1)}return a};return r._n=!0,r._c=!0,r._d=!0,r}function hn(e,n){if(dn===null)return e;let r=aa(dn),i=e.dirs||=[];for(let e=0;e<n.length;e++){let[a,o,s,c=t]=n[e];a&&(h(a)&&(a={mounted:a,updated:a}),a.deep&&Ut(o),i.push({dir:a,instance:r,value:o,oldValue:void 0,arg:s,modifiers:c}))}return e}function gn(e,t,n,r){let i=e.dirs,a=t&&t.dirs;for(let o=0;o<i.length;o++){let s=i[o];a&&(s.oldValue=a[o].value);let c=s.dir[r];c&&(je(),Gt(c,n,8,[e.el,s,e,t]),Me())}}function _n(e,t){if(Ui){let n=Ui.provides,r=Ui.parent&&Ui.parent.provides;r===n&&(n=Ui.provides=Object.create(r)),n[e]=t}}function vn(e,t,n=!1){let r=Wi();if(r||wr){let i=wr?wr._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(i&&e in i)return i[e];if(arguments.length>1)return n&&h(t)?t.call(r&&r.proxy):t}}var yn=Symbol.for(`v-scx`),bn=()=>vn(yn);function xn(e,t,n){return Sn(e,t,n)}function Sn(e,n,i=t){let{immediate:a,deep:o,flush:c,once:l}=i,u=s({},i),d=n&&a||!n&&c!==`post`,f;if(Xi){if(c===`sync`){let e=bn();f=e.__watcherHandles||=[]}else if(!d){let e=()=>{};return e.stop=r,e.resume=r,e.pause=r,e}}let p=Ui;u.call=(e,t,n)=>Gt(e,p,t,n);let m=!1;c===`post`?u.scheduler=e=>{ti(e,p&&p.suspense)}:c!==`sync`&&(m=!0,u.scheduler=(e,t)=>{t?e():rn(e)}),u.augmentJob=e=>{n&&(e.flags|=4),m&&(e.flags|=2,p&&(e.id=p.uid,e.i=p))};let h=Ht(e,n,u);return Xi&&(f?f.push(h):d&&h()),h}function Cn(e,t,n){let r=this.proxy,i=g(e)?e.includes(`.`)?wn(r,e):()=>r[e]:e.bind(r,r),a;h(t)?a=t:(a=t.handler,n=t);let o=qi(this),s=Sn(i,a.bind(r),n);return o(),s}function wn(e,t){let n=t.split(`.`);return()=>{let t=e;for(let e=0;e<n.length&&t;e++)t=t[n[e]];return t}}var Tn=Symbol(`_vte`),En=e=>e.__isTeleport,Dn=Symbol(`_leaveCb`);function On(e,t){e.shapeFlag&6&&e.component?(e.transition=t,On(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function kn(e,t){return h(e)?s({name:e.name},t,{setup:e}):e}function An(e){e.ids=[e.ids[0]+ e.ids[2]+++`-`,0,0]}function jn(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}var Mn=new WeakMap;function Nn(e,n,r,a,o=!1){if(d(e)){e.forEach((e,t)=>Nn(e,n&&(d(n)?n[t]:n),r,a,o));return}if(Fn(a)&&!o){a.shapeFlag&512&&a.type.__asyncResolved&&a.component.subTree.component&&Nn(e,n,r,a.component.subTree);return}let s=a.shapeFlag&4?aa(a.component):a.el,l=o?null:s,{i:f,r:p}=e,m=n&&n.r,_=f.refs===t?f.refs={}:f.refs,v=f.setupState,y=K(v),b=v===t?i:e=>jn(_,e)?!1:u(y,e),x=(e,t)=>!(t&&jn(_,t));if(m!=null&&m!==p){if(Pn(n),g(m))_[m]=null,b(m)&&(v[m]=null);else if(q(m)){let e=n;x(m,e.k)&&(m.value=null),e.k&&(_[e.k]=null)}}if(h(p))Wt(p,f,12,[l,_]);else{let t=g(p),n=q(p);if(t||n){let i=()=>{if(e.f){let n=t?b(p)?v[p]:_[p]:x(p)||!e.k?p.value:_[e.k];if(o)d(n)&&c(n,s);else if(d(n))n.includes(s)||n.push(s);else if(t)_[p]=[s],b(p)&&(v[p]=_[p]);else{let t=[s];x(p,e.k)&&(p.value=t),e.k&&(_[e.k]=t)}}else t?(_[p]=l,b(p)&&(v[p]=l)):n&&(x(p,e.k)&&(p.value=l),e.k&&(_[e.k]=l))};if(l){let t=()=>{i(),Mn.delete(e)};t.id=-1,Mn.set(e,t),ti(t,r)}else Pn(e),i()}}}function Pn(e){let t=Mn.get(e);t&&(t.flags|=8,Mn.delete(e))}se().requestIdleCallback,se().cancelIdleCallback;var Fn=e=>!!e.type.__asyncLoader,In=e=>e.type.__isKeepAlive;function Ln(e,t){zn(e,`a`,t)}function Rn(e,t){zn(e,`da`,t)}function zn(e,t,n=Ui){let r=e.__wdc||=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()};if(Vn(t,r,n),n){let e=n.parent;for(;e&&e.parent;)In(e.parent.vnode)&&Bn(r,t,n,e),e=e.parent}}function Bn(e,t,n,r){let i=Vn(t,e,r,!0);Jn(()=>{c(r[t],i)},n)}function Vn(e,t,n=Ui,r=!1){if(n){let i=n[e]||(n[e]=[]),a=t.__weh||=(...r)=>{je();let i=qi(n),a=Gt(t,n,e,r);return i(),Me(),a};return r?i.unshift(a):i.push(a),a}}var Hn=e=>(t,n=Ui)=>{(!Xi||e===`sp`)&&Vn(e,(...e)=>t(...e),n)},Un=Hn(`bm`),Wn=Hn(`m`),Gn=Hn(`bu`),Kn=Hn(`u`),qn=Hn(`bum`),Jn=Hn(`um`),Yn=Hn(`sp`),Xn=Hn(`rtg`),Zn=Hn(`rtc`);function Qn(e,t=Ui){Vn(`ec`,e,t)}var $n=Symbol.for(`v-ndc`);function er(e,t,n,r){let i,a=n&&n[r],o=d(e);if(o||g(e)){let n=o&&wt(e),r=!1,s=!1;n&&(r=!Et(e),s=Tt(e),e=We(e)),i=Array(e.length);for(let n=0,o=e.length;n<o;n++)i[n]=t(r?s?At(kt(e[n])):kt(e[n]):e[n],n,void 0,a&&a[n])}else if(typeof e==`number`){i=Array(e);for(let n=0;n<e;n++)i[n]=t(n+1,n,void 0,a&&a[n])}else if(v(e))if(e[Symbol.iterator])i=Array.from(e,(e,n)=>t(e,n,void 0,a&&a[n]));else{let n=Object.keys(e);i=Array(n.length);for(let r=0,o=n.length;r<o;r++){let o=n[r];i[r]=t(e[o],o,r,a&&a[r])}}else i=[];return n&&(n[r]=i),i}var tr=e=>e?Yi(e)?aa(e):tr(e.parent):null,nr=s(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>tr(e.parent),$root:e=>tr(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>dr(e),$forceUpdate:e=>e.f||=()=>{rn(e.update)},$nextTick:e=>e.n||=tn.bind(e.proxy),$watch:e=>Cn.bind(e)}),rr=(e,n)=>e!==t&&!e.__isScriptSetup&&u(e,n),ir={get({_:e},n){if(n===`__v_skip`)return!0;let{ctx:r,setupState:i,data:a,props:o,accessCache:s,type:c,appContext:l}=e;if(n[0]!==`$`){let e=s[n];if(e!==void 0)switch(e){case 1:return i[n];case 2:return a[n];case 4:return r[n];case 3:return o[n]}else if(rr(i,n))return s[n]=1,i[n];else if(a!==t&&u(a,n))return s[n]=2,a[n];else if(u(o,n))return s[n]=3,o[n];else if(r!==t&&u(r,n))return s[n]=4,r[n];else or&&(s[n]=0)}let d=nr[n],f,p;if(d)return n===`$attrs`&&U(e.attrs,`get`,``),d(e);if((f=c.__cssModules)&&(f=f[n]))return f;if(r!==t&&u(r,n))return s[n]=4,r[n];if(p=l.config.globalProperties,u(p,n))return p[n]},set({_:e},n,r){let{data:i,setupState:a,ctx:o}=e;return rr(a,n)?(a[n]=r,!0):i!==t&&u(i,n)?(i[n]=r,!0):u(e.props,n)||n[0]===`$`&&n.slice(1)in e?!1:(o[n]=r,!0)},has({_:{data:e,setupState:n,accessCache:r,ctx:i,appContext:a,props:o,type:s}},c){let l;return!!(r[c]||e!==t&&c[0]!==`$`&&u(e,c)||rr(n,c)||u(o,c)||u(i,c)||u(nr,c)||u(a.config.globalProperties,c)||(l=s.__cssModules)&&l[c])},defineProperty(e,t,n){return n.get==null?u(n,`value`)&&this.set(e,t,n.value,null):e._.accessCache[t]=0,Reflect.defineProperty(e,t,n)}};function ar(e){return d(e)?e.reduce((e,t)=>(e[t]=null,e),{}):e}var or=!0;function sr(e){let t=dr(e),n=e.proxy,i=e.ctx;or=!1,t.beforeCreate&&lr(t.beforeCreate,e,`bc`);let{data:a,computed:o,methods:s,watch:c,provide:l,inject:u,created:f,beforeMount:p,mounted:m,beforeUpdate:g,updated:_,activated:y,deactivated:b,beforeDestroy:x,beforeUnmount:S,destroyed:C,unmounted:w,render:T,renderTracked:ee,renderTriggered:te,errorCaptured:E,serverPrefetch:ne,expose:D,inheritAttrs:re,components:ie,directives:O,filters:ae}=t;if(u&&cr(u,i,null),s)for(let e in s){let t=s[e];h(t)&&(i[e]=t.bind(n))}if(a){let t=a.call(n,n);v(t)&&(e.data=bt(t))}if(or=!0,o)for(let e in o){let t=o[e],a=sa({get:h(t)?t.bind(n,n):h(t.get)?t.get.bind(n,n):r,set:!h(t)&&h(t.set)?t.set.bind(n):r});Object.defineProperty(i,e,{enumerable:!0,configurable:!0,get:()=>a.value,set:e=>a.value=e})}if(c)for(let e in c)ur(c[e],i,n,e);if(l){let e=h(l)?l.call(n):l;Reflect.ownKeys(e).forEach(t=>{_n(t,e[t])})}f&&lr(f,e,`c`);function k(e,t){d(t)?t.forEach(t=>e(t.bind(n))):t&&e(t.bind(n))}if(k(Un,p),k(Wn,m),k(Gn,g),k(Kn,_),k(Ln,y),k(Rn,b),k(Qn,E),k(Zn,ee),k(Xn,te),k(qn,S),k(Jn,w),k(Yn,ne),d(D))if(D.length){let t=e.exposed||={};D.forEach(e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t,enumerable:!0})})}else e.exposed||={};T&&e.render===r&&(e.render=T),re!=null&&(e.inheritAttrs=re),ie&&(e.components=ie),O&&(e.directives=O),ne&&An(e)}function cr(e,t,n=r){d(e)&&(e=gr(e));for(let n in e){let r=e[n],i;i=v(r)?`default`in r?vn(r.from||n,r.default,!0):vn(r.from||n):vn(r),q(i)?Object.defineProperty(t,n,{enumerable:!0,configurable:!0,get:()=>i.value,set:e=>i.value=e}):t[n]=i}}function lr(e,t,n){Gt(d(e)?e.map(e=>e.bind(t.proxy)):e.bind(t.proxy),t,n)}function ur(e,t,n,r){let i=r.includes(`.`)?wn(n,r):()=>n[r];if(g(e)){let n=t[e];h(n)&&xn(i,n)}else if(h(e))xn(i,e.bind(n));else if(v(e))if(d(e))e.forEach(e=>ur(e,t,n,r));else{let r=h(e.handler)?e.handler.bind(n):t[e.handler];h(r)&&xn(i,r,e)}}function dr(e){let t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:a,config:{optionMergeStrategies:o}}=e.appContext,s=a.get(t),c;return s?c=s:!i.length&&!n&&!r?c=t:(c={},i.length&&i.forEach(e=>fr(c,e,o,!0)),fr(c,t,o)),v(t)&&a.set(t,c),c}function fr(e,t,n,r=!1){let{mixins:i,extends:a}=t;a&&fr(e,a,n,!0),i&&i.forEach(t=>fr(e,t,n,!0));for(let i in t)if(!(r&&i===`expose`)){let r=pr[i]||n&&n[i];e[i]=r?r(e[i],t[i]):t[i]}return e}var pr={data:mr,props:yr,emits:yr,methods:vr,computed:vr,beforeCreate:_r,created:_r,beforeMount:_r,mounted:_r,beforeUpdate:_r,updated:_r,beforeDestroy:_r,beforeUnmount:_r,destroyed:_r,unmounted:_r,activated:_r,deactivated:_r,errorCaptured:_r,serverPrefetch:_r,components:vr,directives:vr,watch:br,provide:mr,inject:hr};function mr(e,t){return t?e?function(){return s(h(e)?e.call(this,this):e,h(t)?t.call(this,this):t)}:t:e}function hr(e,t){return vr(gr(e),gr(t))}function gr(e){if(d(e)){let t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function _r(e,t){return e?[...new Set([].concat(e,t))]:t}function vr(e,t){return e?s(Object.create(null),e,t):t}function yr(e,t){return e?d(e)&&d(t)?[...new Set([...e,...t])]:s(Object.create(null),ar(e),ar(t??{})):t}function br(e,t){if(!e)return t;if(!t)return e;let n=s(Object.create(null),e);for(let r in t)n[r]=_r(e[r],t[r]);return n}function xr(){return{app:null,config:{isNativeTag:i,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}var Sr=0;function Cr(e,t){return function(n,r=null){h(n)||(n=s({},n)),r!=null&&!v(r)&&(r=null);let i=xr(),a=new WeakSet,o=[],c=!1,l=i.app={_uid:Sr++,_component:n,_props:r,_container:null,_context:i,_instance:null,version:ca,get config(){return i.config},set config(e){},use(e,...t){return a.has(e)||(e&&h(e.install)?(a.add(e),e.install(l,...t)):h(e)&&(a.add(e),e(l,...t))),l},mixin(e){return i.mixins.includes(e)||i.mixins.push(e),l},component(e,t){return t?(i.components[e]=t,l):i.components[e]},directive(e,t){return t?(i.directives[e]=t,l):i.directives[e]},mount(a,o,s){if(!c){let u=l._ceVNode||Oi(n,r);return u.appContext=i,s===!0?s=`svg`:s===!1&&(s=void 0),o&&t?t(u,a):e(u,a,s),c=!0,l._container=a,a.__vue_app__=l,aa(u.component)}},onUnmount(e){o.push(e)},unmount(){c&&(Gt(o,l._instance,16),e(null,l._container),delete l._container.__vue_app__)},provide(e,t){return i.provides[e]=t,l},runWithContext(e){let t=wr;wr=l;try{return e()}finally{wr=t}}};return l}}var wr=null,Tr=(e,t)=>t===`modelValue`||t===`model-value`?e.modelModifiers:e[`${t}Modifiers`]||e[`${E(t)}Modifiers`]||e[`${D(t)}Modifiers`];function Er(e,n,...r){if(e.isUnmounted)return;let i=e.vnode.props||t,a=r,o=n.startsWith(`update:`),s=o&&Tr(i,n.slice(7));s&&(s.trim&&(a=r.map(e=>g(e)?e.trim():e)),s.number&&(a=r.map(A)));let c,l=i[c=ie(n)]||i[c=ie(E(n))];!l&&o&&(l=i[c=ie(D(n))]),l&&Gt(l,e,6,a);let u=i[c+`Once`];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[c])return;e.emitted[c]=!0,Gt(u,e,6,a)}}var Dr=new WeakMap;function Or(e,t,n=!1){let r=n?Dr:t.emitsCache,i=r.get(e);if(i!==void 0)return i;let a=e.emits,o={},c=!1;if(!h(e)){let r=e=>{let n=Or(e,t,!0);n&&(c=!0,s(o,n))};!n&&t.mixins.length&&t.mixins.forEach(r),e.extends&&r(e.extends),e.mixins&&e.mixins.forEach(r)}return!a&&!c?(v(e)&&r.set(e,null),null):(d(a)?a.forEach(e=>o[e]=null):s(o,a),v(e)&&r.set(e,o),o)}function kr(e,t){return!e||!a(t)?!1:(t=t.slice(2).replace(/Once$/,``),u(e,t[0].toLowerCase()+t.slice(1))||u(e,D(t))||u(e,t))}function Ar(e){let{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[a],slots:s,attrs:c,emit:l,render:u,renderCache:d,props:f,data:p,setupState:m,ctx:h,inheritAttrs:g}=e,_=pn(e),v,y;try{if(n.shapeFlag&4){let e=i||r,t=e;v=Fi(u.call(t,e,d,f,m,p,h)),y=c}else{let e=t;v=Fi(e.length>1?e(f,{attrs:c,slots:s,emit:l}):e(f,null)),y=t.props?c:jr(c)}}catch(t){_i.length=0,Kt(t,e,1),v=Oi(hi)}let b=v;if(y&&g!==!1){let e=Object.keys(y),{shapeFlag:t}=b;e.length&&t&7&&(a&&e.some(o)&&(y=Mr(y,a)),b=ji(b,y,!1,!0))}return n.dirs&&(b=ji(b,null,!1,!0),b.dirs=b.dirs?b.dirs.concat(n.dirs):n.dirs),n.transition&&On(b,n.transition),v=b,pn(_),v}var jr=e=>{let t;for(let n in e)(n===`class`||n===`style`||a(n))&&((t||={})[n]=e[n]);return t},Mr=(e,t)=>{let n={};for(let r in e)(!o(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Nr(e,t,n){let{props:r,children:i,component:a}=e,{props:o,children:s,patchFlag:c}=t,l=a.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?Pr(r,o,l):!!o;if(c&8){let e=t.dynamicProps;for(let t=0;t<e.length;t++){let n=e[t];if(Fr(o,r,n)&&!kr(l,n))return!0}}}else return(i||s)&&(!s||!s.$stable)?!0:r===o?!1:r?o?Pr(r,o,l):!0:!!o;return!1}function Pr(e,t,n){let r=Object.keys(t);if(r.length!==Object.keys(e).length)return!0;for(let i=0;i<r.length;i++){let a=r[i];if(Fr(t,e,a)&&!kr(n,a))return!0}return!1}function Fr(e,t,n){let r=e[n],i=t[n];return n===`style`&&v(r)&&v(i)?!I(r,i):r!==i}function Ir({vnode:e,parent:t,suspense:n},r){for(;t;){let n=t.subTree;if(n.suspense&&n.suspense.activeBranch===e&&(n.suspense.vnode.el=n.el=r,e=n),n===e)(e=t.vnode).el=r,t=t.parent;else break}n&&n.activeBranch===e&&(n.vnode.el=r)}var Lr={},Rr=()=>Object.create(Lr),zr=e=>Object.getPrototypeOf(e)===Lr;function Br(e,t,n,r=!1){let i={},a=Rr();e.propsDefaults=Object.create(null),Hr(e,t,i,a);for(let t in e.propsOptions[0])t in i||(i[t]=void 0);n?e.props=r?i:xt(i):e.type.props?e.props=i:e.props=a,e.attrs=a}function Vr(e,t,n,r){let{props:i,attrs:a,vnode:{patchFlag:o}}=e,s=K(i),[c]=e.propsOptions,l=!1;if((r||o>0)&&!(o&16)){if(o&8){let n=e.vnode.dynamicProps;for(let r=0;r<n.length;r++){let o=n[r];if(kr(e.emitsOptions,o))continue;let d=t[o];if(c)if(u(a,o))d!==a[o]&&(a[o]=d,l=!0);else{let t=E(o);i[t]=Ur(c,s,t,d,e,!1)}else d!==a[o]&&(a[o]=d,l=!0)}}}else{Hr(e,t,i,a)&&(l=!0);let r;for(let a in s)(!t||!u(t,a)&&((r=D(a))===a||!u(t,r)))&&(c?n&&(n[a]!==void 0||n[r]!==void 0)&&(i[a]=Ur(c,s,a,void 0,e,!0)):delete i[a]);if(a!==s)for(let e in a)(!t||!u(t,e))&&(delete a[e],l=!0)}l&&He(e.attrs,`set`,``)}function Hr(e,n,r,i){let[a,o]=e.propsOptions,s=!1,c;if(n)for(let t in n){if(T(t))continue;let l=n[t],d;a&&u(a,d=E(t))?!o||!o.includes(d)?r[d]=l:(c||={})[d]=l:kr(e.emitsOptions,t)||(!(t in i)||l!==i[t])&&(i[t]=l,s=!0)}if(o){let n=K(r),i=c||t;for(let t=0;t<o.length;t++){let s=o[t];r[s]=Ur(a,n,s,i[s],e,!u(i,s))}}return s}function Ur(e,t,n,r,i,a){let o=e[n];if(o!=null){let e=u(o,`default`);if(e&&r===void 0){let e=o.default;if(o.type!==Function&&!o.skipFactory&&h(e)){let{propsDefaults:a}=i;if(n in a)r=a[n];else{let o=qi(i);r=a[n]=e.call(null,t),o()}}else r=e;i.ce&&i.ce._setProp(n,r)}o[0]&&(a&&!e?r=!1:o[1]&&(r===``||r===D(n))&&(r=!0))}return r}var Wr=new WeakMap;function Gr(e,r,i=!1){let a=i?Wr:r.propsCache,o=a.get(e);if(o)return o;let c=e.props,l={},f=[],p=!1;if(!h(e)){let t=e=>{p=!0;let[t,n]=Gr(e,r,!0);s(l,t),n&&f.push(...n)};!i&&r.mixins.length&&r.mixins.forEach(t),e.extends&&t(e.extends),e.mixins&&e.mixins.forEach(t)}if(!c&&!p)return v(e)&&a.set(e,n),n;if(d(c))for(let e=0;e<c.length;e++){let n=E(c[e]);Kr(n)&&(l[n]=t)}else if(c)for(let e in c){let t=E(e);if(Kr(t)){let n=c[e],r=l[t]=d(n)||h(n)?{type:n}:s({},n),i=r.type,a=!1,o=!0;if(d(i))for(let e=0;e<i.length;++e){let t=i[e],n=h(t)&&t.name;if(n===`Boolean`){a=!0;break}else n===`String`&&(o=!1)}else a=h(i)&&i.name===`Boolean`;r[0]=a,r[1]=o,(a||u(r,`default`))&&f.push(t)}}let m=[l,f];return v(e)&&a.set(e,m),m}function Kr(e){return e[0]!==`$`&&!T(e)}var qr=e=>e===`_`||e===`_ctx`||e===`$stable`,Jr=e=>d(e)?e.map(Fi):[Fi(e)],Yr=(e,t,n)=>{if(t._n)return t;let r=mn((...e)=>Jr(t(...e)),n);return r._c=!1,r},Xr=(e,t,n)=>{let r=e._ctx;for(let n in e){if(qr(n))continue;let i=e[n];if(h(i))t[n]=Yr(n,i,r);else if(i!=null){let e=Jr(i);t[n]=()=>e}}},Zr=(e,t)=>{let n=Jr(t);e.slots.default=()=>n},Qr=(e,t,n)=>{for(let r in t)(n||!qr(r))&&(e[r]=t[r])},$r=(e,t,n)=>{let r=e.slots=Rr();if(e.vnode.shapeFlag&32){let e=t._;e?(Qr(r,t,n),n&&k(r,`_`,e,!0)):Xr(t,r)}else t&&Zr(e,t)},ei=(e,n,r)=>{let{vnode:i,slots:a}=e,o=!0,s=t;if(i.shapeFlag&32){let e=n._;e?r&&e===1?o=!1:Qr(a,n,r):(o=!n.$stable,Xr(n,a)),s=n}else n&&(Zr(e,n),s={default:1});if(o)for(let e in a)!qr(e)&&s[e]==null&&delete a[e]},ti=pi;function ni(e){return ri(e)}function ri(e,i){let a=se();a.__VUE__=!0;let{insert:o,remove:s,patchProp:c,createElement:l,createText:u,createComment:d,setText:f,setElementText:p,parentNode:m,nextSibling:h,setScopeId:g=r,insertStaticContent:_}=e,v=(e,t,n,r=null,i=null,a=null,o=void 0,s=null,c=!!t.dynamicChildren)=>{if(e===t)return;e&&!Ti(e,t)&&(r=I(e),N(e,i,a,!0),e=null),t.patchFlag===-2&&(c=!1,t.dynamicChildren=null);let{type:l,ref:u,shapeFlag:d}=t;switch(l){case mi:y(e,t,n,r);break;case hi:b(e,t,n,r);break;case gi:e??x(t,n,r,o);break;case Y:ie(e,t,n,r,i,a,o,s,c);break;default:d&1?w(e,t,n,r,i,a,o,s,c):d&6?O(e,t,n,r,i,a,o,s,c):(d&64||d&128)&&l.process(e,t,n,r,i,a,o,s,c,me)}u!=null&&i?Nn(u,e&&e.ref,a,t||e,!t):u==null&&e&&e.ref!=null&&Nn(e.ref,null,a,e,!0)},y=(e,t,n,r)=>{if(e==null)o(t.el=u(t.children),n,r);else{let n=t.el=e.el;t.children!==e.children&&f(n,t.children)}},b=(e,t,n,r)=>{e==null?o(t.el=d(t.children||``),n,r):t.el=e.el},x=(e,t,n,r)=>{[e.el,e.anchor]=_(e.children,t,n,r,e.el,e.anchor)},S=({el:e,anchor:t},n,r)=>{let i;for(;e&&e!==t;)i=h(e),o(e,n,r),e=i;o(t,n,r)},C=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=h(e),s(e),e=n;s(t)},w=(e,t,n,r,i,a,o,s,c)=>{if(t.type===`svg`?o=`svg`:t.type===`math`&&(o=`mathml`),e==null)ee(t,n,r,i,a,o,s,c);else{let n=e.el&&e.el._isVueCE?e.el:null;try{n&&n._beginPatch(),ne(e,t,i,a,o,s,c)}finally{n&&n._endPatch()}}},ee=(e,t,n,r,i,a,s,u)=>{let d,f,{props:m,shapeFlag:h,transition:g,dirs:_}=e;if(d=e.el=l(e.type,a,m&&m.is,m),h&8?p(d,e.children):h&16&&E(e.children,d,null,r,i,ii(e,a),s,u),_&&gn(e,null,r,`created`),te(d,e,e.scopeId,s,r),m){for(let e in m)e!==`value`&&!T(e)&&c(d,e,null,m[e],a,r);`value`in m&&c(d,`value`,null,m.value,a),(f=m.onVnodeBeforeMount)&&zi(f,r,e)}_&&gn(e,null,r,`beforeMount`);let v=oi(i,g);v&&g.beforeEnter(d),o(d,t,n),((f=m&&m.onVnodeMounted)||v||_)&&ti(()=>{try{f&&zi(f,r,e),v&&g.enter(d),_&&gn(e,null,r,`mounted`)}finally{}},i)},te=(e,t,n,r,i)=>{if(n&&g(e,n),r)for(let t=0;t<r.length;t++)g(e,r[t]);if(i){let n=i.subTree;if(t===n||fi(n.type)&&(n.ssContent===t||n.ssFallback===t)){let t=i.vnode;te(e,t,t.scopeId,t.slotScopeIds,i.parent)}}},E=(e,t,n,r,i,a,o,s,c=0)=>{for(let l=c;l<e.length;l++)v(null,e[l]=s?Ii(e[l]):Fi(e[l]),t,n,r,i,a,o,s)},ne=(e,n,r,i,a,o,s)=>{let l=n.el=e.el,{patchFlag:u,dynamicChildren:d,dirs:f}=n;u|=e.patchFlag&16;let m=e.props||t,h=n.props||t,g;if(r&&ai(r,!1),(g=h.onVnodeBeforeUpdate)&&zi(g,r,n,e),f&&gn(n,e,r,`beforeUpdate`),r&&ai(r,!0),(m.innerHTML&&h.innerHTML==null||m.textContent&&h.textContent==null)&&p(l,``),d?D(e.dynamicChildren,d,l,r,i,ii(n,a),o):s||ce(e,n,l,null,r,i,ii(n,a),o,!1),u>0){if(u&16)re(l,m,h,r,a);else if(u&2&&m.class!==h.class&&c(l,`class`,null,h.class,a),u&4&&c(l,`style`,m.style,h.style,a),u&8){let e=n.dynamicProps;for(let t=0;t<e.length;t++){let n=e[t],i=m[n],o=h[n];(o!==i||n===`value`)&&c(l,n,i,o,a,r)}}u&1&&e.children!==n.children&&p(l,n.children)}else !s&&d==null&&re(l,m,h,r,a);((g=h.onVnodeUpdated)||f)&&ti(()=>{g&&zi(g,r,n,e),f&&gn(n,e,r,`updated`)},i)},D=(e,t,n,r,i,a,o)=>{for(let s=0;s<t.length;s++){let c=e[s],l=t[s];v(c,l,c.el&&(c.type===Y||!Ti(c,l)||c.shapeFlag&198)?m(c.el):n,null,r,i,a,o,!0)}},re=(e,n,r,i,a)=>{if(n!==r){if(n!==t)for(let t in n)!T(t)&&!(t in r)&&c(e,t,n[t],null,a,i);for(let t in r){if(T(t))continue;let o=r[t],s=n[t];o!==s&&t!==`value`&&c(e,t,s,o,a,i)}`value`in r&&c(e,`value`,n.value,r.value,a)}},ie=(e,t,n,r,i,a,s,c,l)=>{let d=t.el=e?e.el:u(``),f=t.anchor=e?e.anchor:u(``),{patchFlag:p,dynamicChildren:m,slotScopeIds:h}=t;h&&(c=c?c.concat(h):h),e==null?(o(d,n,r),o(f,n,r),E(t.children||[],n,f,i,a,s,c,l)):p>0&&p&64&&m&&e.dynamicChildren&&e.dynamicChildren.length===m.length?(D(e.dynamicChildren,m,n,i,a,s,c),(t.key!=null||i&&t===i.subTree)&&si(e,t,!0)):ce(e,t,n,f,i,a,s,c,l)},O=(e,t,n,r,i,a,o,s,c)=>{t.slotScopeIds=s,e==null?t.shapeFlag&512?i.ctx.activate(t,n,r,o,c):k(t,n,r,i,a,o,c):A(e,t,c)},k=(e,t,n,r,i,a,o)=>{let s=e.component=Hi(e,r,i);if(In(e)&&(s.ctx.renderer=me),Zi(s,!1,o),s.asyncDep){if(i&&i.registerDep(s,oe,o),!e.el){let r=s.subTree=Oi(hi);b(null,r,t,n),e.placeholder=r.el}}else oe(s,e,t,n,i,a,o)},A=(e,t,n)=>{let r=t.component=e.component;if(Nr(e,t,n))if(r.asyncDep&&!r.asyncResolved){j(r,t,n);return}else r.next=t,r.update();else t.el=e.el,r.vnode=t},oe=(e,t,n,r,i,a,o)=>{let s=()=>{if(e.isMounted){let{next:t,bu:n,u:r,parent:s,vnode:c}=e;{let n=li(e);if(n){t&&(t.el=c.el,j(e,t,o)),n.asyncDep.then(()=>{ti(()=>{e.isUnmounted||l()},i)});return}}let u=t,d;ai(e,!1),t?(t.el=c.el,j(e,t,o)):t=c,n&&ae(n),(d=t.props&&t.props.onVnodeBeforeUpdate)&&zi(d,s,t,c),ai(e,!0);let f=Ar(e),p=e.subTree;e.subTree=f,v(p,f,m(p.el),I(p),e,i,a),t.el=f.el,u===null&&Ir(e,f.el),r&&ti(r,i),(d=t.props&&t.props.onVnodeUpdated)&&ti(()=>zi(d,s,t,c),i)}else{let o,{el:s,props:c}=t,{bm:l,m:u,parent:d,root:f,type:p}=e,m=Fn(t);if(ai(e,!1),l&&ae(l),!m&&(o=c&&c.onVnodeBeforeMount)&&zi(o,d,t),ai(e,!0),s&&R){let t=()=>{e.subTree=Ar(e),R(s,e.subTree,e,i,null)};m&&p.__asyncHydrate?p.__asyncHydrate(s,e,t):t()}else{f.ce&&f.ce._hasShadowRoot()&&f.ce._injectChildStyle(p,e.parent?e.parent.type:void 0);let o=e.subTree=Ar(e);v(null,o,n,r,e,i,a),t.el=o.el}if(u&&ti(u,i),!m&&(o=c&&c.onVnodeMounted)){let e=t;ti(()=>zi(o,d,e),i)}(t.shapeFlag&256||d&&Fn(d.vnode)&&d.vnode.shapeFlag&256)&&e.a&&ti(e.a,i),e.isMounted=!0,t=n=r=null}};e.scope.on();let c=e.effect=new ye(s);e.scope.off();let l=e.update=c.run.bind(c),u=e.job=c.runIfDirty.bind(c);u.i=e,u.id=e.uid,c.scheduler=()=>rn(u),ai(e,!0),l()},j=(e,t,n)=>{t.component=e;let r=e.vnode.props;e.vnode=t,e.next=null,Vr(e,t.props,r,n),ei(e,t.children,n),je(),sn(e),Me()},ce=(e,t,n,r,i,a,o,s,c=!1)=>{let l=e&&e.children,u=e?e.shapeFlag:0,d=t.children,{patchFlag:f,shapeFlag:m}=t;if(f>0){if(f&128){M(l,d,n,r,i,a,o,s,c);return}else if(f&256){le(l,d,n,r,i,a,o,s,c);return}}m&8?(u&16&&fe(l,i,a),d!==l&&p(n,d)):u&16?m&16?M(l,d,n,r,i,a,o,s,c):fe(l,i,a,!0):(u&8&&p(n,``),m&16&&E(d,n,r,i,a,o,s,c))},le=(e,t,r,i,a,o,s,c,l)=>{e||=n,t||=n;let u=e.length,d=t.length,f=Math.min(u,d),p;for(p=0;p<f;p++){let n=t[p]=l?Ii(t[p]):Fi(t[p]);v(e[p],n,r,null,a,o,s,c,l)}u>d?fe(e,a,o,!0,!1,f):E(t,r,i,a,o,s,c,l,f)},M=(e,t,r,i,a,o,s,c,l)=>{let u=0,d=t.length,f=e.length-1,p=d-1;for(;u<=f&&u<=p;){let n=e[u],i=t[u]=l?Ii(t[u]):Fi(t[u]);if(Ti(n,i))v(n,i,r,null,a,o,s,c,l);else break;u++}for(;u<=f&&u<=p;){let n=e[f],i=t[p]=l?Ii(t[p]):Fi(t[p]);if(Ti(n,i))v(n,i,r,null,a,o,s,c,l);else break;f--,p--}if(u>f){if(u<=p){let e=p+1,n=e<d?t[e].el:i;for(;u<=p;)v(null,t[u]=l?Ii(t[u]):Fi(t[u]),r,n,a,o,s,c,l),u++}}else if(u>p)for(;u<=f;)N(e[u],a,o,!0),u++;else{let m=u,h=u,g=new Map;for(u=h;u<=p;u++){let e=t[u]=l?Ii(t[u]):Fi(t[u]);e.key!=null&&g.set(e.key,u)}let _,y=0,b=p-h+1,x=!1,S=0,C=Array(b);for(u=0;u<b;u++)C[u]=0;for(u=m;u<=f;u++){let n=e[u];if(y>=b){N(n,a,o,!0);continue}let i;if(n.key!=null)i=g.get(n.key);else for(_=h;_<=p;_++)if(C[_-h]===0&&Ti(n,t[_])){i=_;break}i===void 0?N(n,a,o,!0):(C[i-h]=u+1,i>=S?S=i:x=!0,v(n,t[i],r,null,a,o,s,c,l),y++)}let w=x?ci(C):n;for(_=w.length-1,u=b-1;u>=0;u--){let e=h+u,n=t[e],f=t[e+1],p=e+1<d?f.el||di(f):i;C[u]===0?v(null,n,r,p,a,o,s,c,l):x&&(_<0||u!==w[_]?ue(n,r,p,2):_--)}}},ue=(e,t,n,r,i=null)=>{let{el:a,type:c,transition:l,children:u,shapeFlag:d}=e;if(d&6){ue(e.component.subTree,t,n,r);return}if(d&128){e.suspense.move(t,n,r);return}if(d&64){c.move(e,t,n,me);return}if(c===Y){o(a,t,n);for(let e=0;e<u.length;e++)ue(u[e],t,n,r);o(e.anchor,t,n);return}if(c===gi){S(e,t,n);return}if(r!==2&&d&1&&l)if(r===0)l.persisted&&!a[Dn]?o(a,t,n):(l.beforeEnter(a),o(a,t,n),ti(()=>l.enter(a),i));else{let{leave:r,delayLeave:i,afterLeave:c}=l,u=()=>{e.ctx.isUnmounted?s(a):o(a,t,n)},d=()=>{let e=a._isLeaving||!!a[Dn];a._isLeaving&&a[Dn](!0),l.persisted&&!e?u():r(a,()=>{u(),c&&c()})};i?i(a,u,d):d()}else o(a,t,n)},N=(e,t,n,r=!1,i=!1)=>{let{type:a,props:o,ref:s,children:c,dynamicChildren:l,shapeFlag:u,patchFlag:d,dirs:f,cacheIndex:p,memo:m}=e;if(d===-2&&(i=!1),s!=null&&(je(),Nn(s,null,n,e,!0),Me()),p!=null&&(t.renderCache[p]=void 0),u&256){t.ctx.deactivate(e);return}let h=u&1&&f,g=!Fn(e),_;if(g&&(_=o&&o.onVnodeBeforeUnmount)&&zi(_,t,e),u&6)F(e.component,n,r);else{if(u&128){e.suspense.unmount(n,r);return}h&&gn(e,null,t,`beforeUnmount`),u&64?e.type.remove(e,t,n,me,r):l&&!l.hasOnce&&(a!==Y||d>0&&d&64)?fe(l,t,n,!1,!0):(a===Y&&d&384||!i&&u&16)&&fe(c,t,n),r&&P(e)}let v=m!=null&&p==null;(g&&(_=o&&o.onVnodeUnmounted)||h||v)&&ti(()=>{_&&zi(_,t,e),h&&gn(e,null,t,`unmounted`),v&&(e.el=null)},n)},P=e=>{let{type:t,el:n,anchor:r,transition:i}=e;if(t===Y){de(n,r);return}if(t===gi){C(e);return}let a=()=>{s(n),i&&!i.persisted&&i.afterLeave&&i.afterLeave()};if(e.shapeFlag&1&&i&&!i.persisted){let{leave:t,delayLeave:r}=i,o=()=>t(n,a);r?r(e.el,a,o):o()}else a()},de=(e,t)=>{let n;for(;e!==t;)n=h(e),s(e),e=n;s(t)},F=(e,t,n)=>{let{bum:r,scope:i,job:a,subTree:o,um:s,m:c,a:l}=e;ui(c),ui(l),r&&ae(r),i.stop(),a&&(a.flags|=8,N(o,e,t,n)),s&&ti(s,t),ti(()=>{e.isUnmounted=!0},t)},fe=(e,t,n,r=!1,i=!1,a=0)=>{for(let o=a;o<e.length;o++)N(e[o],t,n,r,i)},I=e=>{if(e.shapeFlag&6)return I(e.component.subTree);if(e.shapeFlag&128)return e.suspense.next();let t=h(e.anchor||e.el),n=t&&t[Tn];return n?h(n):t},pe=!1,L=(e,t,n)=>{let r;e==null?t._vnode&&(N(t._vnode,null,null,!0),r=t._vnode.component):v(t._vnode||null,e,t,null,null,null,n),t._vnode=e,pe||=(pe=!0,sn(r),cn(),!1)},me={p:v,um:N,m:ue,r:P,mt:k,mc:E,pc:ce,pbc:D,n:I,o:e},he,R;return i&&([he,R]=i(me)),{render:L,hydrate:he,createApp:Cr(L,he)}}function ii({type:e,props:t},n){return n===`svg`&&e===`foreignObject`||n===`mathml`&&e===`annotation-xml`&&t&&t.encoding&&t.encoding.includes(`html`)?void 0:n}function ai({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function oi(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function si(e,t,n=!1){let r=e.children,i=t.children;if(d(r)&&d(i))for(let e=0;e<r.length;e++){let t=r[e],a=i[e];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=i[e]=Ii(i[e]),a.el=t.el),!n&&a.patchFlag!==-2&&si(t,a)),a.type===mi&&(a.patchFlag===-1&&(a=i[e]=Ii(a)),a.el=t.el),a.type===hi&&!a.el&&(a.el=t.el)}}function ci(e){let t=e.slice(),n=[0],r,i,a,o,s,c=e.length;for(r=0;r<c;r++){let c=e[r];if(c!==0){if(i=n[n.length-1],e[i]<c){t[r]=i,n.push(r);continue}for(a=0,o=n.length-1;a<o;)s=a+o>>1,e[n[s]]<c?a=s+1:o=s;c<e[n[a]]&&(a>0&&(t[r]=n[a-1]),n[a]=r)}}for(a=n.length,o=n[a-1];a-- >0;)n[a]=o,o=t[o];return n}function li(e){let t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:li(t)}function ui(e){if(e)for(let t=0;t<e.length;t++)e[t].flags|=8}function di(e){if(e.placeholder)return e.placeholder;let t=e.component;return t?di(t.subTree):null}var fi=e=>e.__isSuspense;function pi(e,t){t&&t.pendingBranch?d(e)?t.effects.push(...e):t.effects.push(e):on(e)}var Y=Symbol.for(`v-fgt`),mi=Symbol.for(`v-txt`),hi=Symbol.for(`v-cmt`),gi=Symbol.for(`v-stc`),_i=[],vi=null;function X(e=!1){_i.push(vi=e?null:[])}function yi(){_i.pop(),vi=_i[_i.length-1]||null}var bi=1;function xi(e,t=!1){bi+=e,e<0&&vi&&t&&(vi.hasOnce=!0)}function Si(e){return e.dynamicChildren=bi>0?vi||n:null,yi(),bi>0&&vi&&vi.push(e),e}function Z(e,t,n,r,i,a){return Si(Q(e,t,n,r,i,a,!0))}function Ci(e,t,n,r,i){return Si(Oi(e,t,n,r,i,!0))}function wi(e){return e?e.__v_isVNode===!0:!1}function Ti(e,t){return e.type===t.type&&e.key===t.key}var Ei=({key:e})=>e??null,Di=({ref:e,ref_key:t,ref_for:n})=>(typeof e==`number`&&(e=``+e),e==null?null:g(e)||q(e)||h(e)?{i:dn,r:e,k:t,f:!!n}:e);function Q(e,t=null,n=null,r=0,i=null,a=e===Y?0:1,o=!1,s=!1){let c={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Ei(t),ref:t&&Di(t),scopeId:fn,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:a,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:dn};return s?(Li(c,n),a&128&&e.normalize(c)):n&&(c.shapeFlag|=g(n)?8:16),bi>0&&!o&&vi&&(c.patchFlag>0||a&6)&&c.patchFlag!==32&&vi.push(c),c}var Oi=ki;function ki(e,t=null,n=null,r=0,i=null,a=!1){if((!e||e===$n)&&(e=hi),wi(e)){let r=ji(e,t,!0);return n&&Li(r,n),bi>0&&!a&&vi&&(r.shapeFlag&6?vi[vi.indexOf(e)]=r:vi.push(r)),r.patchFlag=-2,r}if(oa(e)&&(e=e.__vccOpts),t){t=Ai(t);let{class:e,style:n}=t;e&&!g(e)&&(t.class=N(e)),v(n)&&(Dt(n)&&!d(n)&&(n=s({},n)),t.style=j(n))}let o=g(e)?1:fi(e)?128:En(e)?64:v(e)?4:h(e)?2:0;return Q(e,t,n,r,i,o,a,!0)}function Ai(e){return e?Dt(e)||zr(e)?s({},e):e:null}function ji(e,t,n=!1,r=!1){let{props:i,ref:a,patchFlag:o,children:s,transition:c}=e,l=t?Ri(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:l,key:l&&Ei(l),ref:t&&t.ref?n&&a?d(a)?a.concat(Di(t)):[a,Di(t)]:Di(t):a,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:s,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Y?o===-1?16:o|16:o,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:c,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&ji(e.ssContent),ssFallback:e.ssFallback&&ji(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return c&&r&&On(u,c.clone(u)),u}function Mi(e=` `,t=0){return Oi(mi,null,e,t)}function Ni(e,t){let n=Oi(gi,null,e);return n.staticCount=t,n}function Pi(e=``,t=!1){return t?(X(),Ci(hi,null,e)):Oi(hi,null,e)}function Fi(e){return e==null||typeof e==`boolean`?Oi(hi):d(e)?Oi(Y,null,e.slice()):wi(e)?Ii(e):Oi(mi,null,String(e))}function Ii(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:ji(e)}function Li(e,t){let n=0,{shapeFlag:r}=e;if(t==null)t=null;else if(d(t))n=16;else if(typeof t==`object`)if(r&65){let n=t.default;n&&(n._c&&(n._d=!1),Li(e,n()),n._c&&(n._d=!0));return}else{n=32;let r=t._;!r&&!zr(t)?t._ctx=dn:r===3&&dn&&(dn.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else h(t)?(t={default:t,_ctx:dn},n=32):(t=String(t),r&64?(n=16,t=[Mi(t)]):n=8);e.children=t,e.shapeFlag|=n}function Ri(...e){let t={};for(let n=0;n<e.length;n++){let r=e[n];for(let e in r)if(e===`class`)t.class!==r.class&&(t.class=N([t.class,r.class]));else if(e===`style`)t.style=j([t.style,r.style]);else if(a(e)){let n=t[e],i=r[e];i&&n!==i&&!(d(n)&&n.includes(i))?t[e]=n?[].concat(n,i):i:i==null&&n==null&&!o(e)&&(t[e]=i)}else e!==``&&(t[e]=r[e])}return t}function zi(e,t,n,r=null){Gt(e,t,7,[n,r])}var Bi=xr(),Vi=0;function Hi(e,n,r){let i=e.type,a=(n?n.appContext:e.appContext)||Bi,o={uid:Vi++,vnode:e,type:i,parent:n,appContext:a,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new ge(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:n?n.provides:Object.create(a.provides),ids:n?n.ids:[``,0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:Gr(i,a),emitsOptions:Or(i,a),emit:null,emitted:null,propsDefaults:t,inheritAttrs:i.inheritAttrs,ctx:t,data:t,props:t,attrs:t,slots:t,refs:t,setupState:t,setupContext:null,suspense:r,suspenseId:r?r.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return o.ctx={_:o},o.root=n?n.root:o,o.emit=Er.bind(null,o),e.ce&&e.ce(o),o}var Ui=null,Wi=()=>Ui||dn,Gi,Ki;{let e=se(),t=(t,n)=>{let r;return(r=e[t])||(r=e[t]=[]),r.push(n),e=>{r.length>1?r.forEach(t=>t(e)):r[0](e)}};Gi=t(`__VUE_INSTANCE_SETTERS__`,e=>Ui=e),Ki=t(`__VUE_SSR_SETTERS__`,e=>Xi=e)}var qi=e=>{let t=Ui;return Gi(e),e.scope.on(),()=>{e.scope.off(),Gi(t)}},Ji=()=>{Ui&&Ui.scope.off(),Gi(null)};function Yi(e){return e.vnode.shapeFlag&4}var Xi=!1;function Zi(e,t=!1,n=!1){t&&Ki(t);let{props:r,children:i}=e.vnode,a=Yi(e);Br(e,r,a,t),$r(e,i,n||t);let o=a?Qi(e,t):void 0;return t&&Ki(!1),o}function Qi(e,t){let n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,ir);let{setup:r}=n;if(r){je();let n=e.setupContext=r.length>1?ia(e):null,i=qi(e),a=Wt(r,e,0,[e.props,n]),o=y(a);if(Me(),i(),(o||e.sp)&&!Fn(e)&&An(e),o){if(a.then(Ji,Ji),t)return a.then(n=>{$i(e,n,t)}).catch(t=>{Kt(t,e,0)});e.asyncDep=a}else $i(e,a,t)}else na(e,t)}function $i(e,t,n){h(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:v(t)&&(e.setupState=Ft(t)),na(e,n)}var ea,ta;function na(e,t,n){let i=e.type;if(!e.render){if(!t&&ea&&!i.render){let t=i.template||dr(e).template;if(t){let{isCustomElement:n,compilerOptions:r}=e.appContext.config,{delimiters:a,compilerOptions:o}=i;i.render=ea(t,s(s({isCustomElement:n,delimiters:a},r),o))}}e.render=i.render||r,ta&&ta(e)}{let t=qi(e);je();try{sr(e)}finally{Me(),t()}}}var ra={get(e,t){return U(e,`get`,``),e[t]}};function ia(e){return{attrs:new Proxy(e.attrs,ra),slots:e.slots,emit:e.emit,expose:t=>{e.exposed=t||{}}}}function aa(e){return e.exposed?e.exposeProxy||=new Proxy(Ft(Ot(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in nr)return nr[n](e)},has(e,t){return t in e||t in nr}}):e.proxy}function oa(e){return h(e)&&`__vccOpts`in e}var sa=(e,t)=>Lt(e,t,Xi),ca=`3.5.35`,la=void 0,ua=typeof window<`u`&&window.trustedTypes;if(ua)try{la=ua.createPolicy(`vue`,{createHTML:e=>e})}catch{}var da=la?e=>la.createHTML(e):e=>e,fa=`http://www.w3.org/2000/svg`,pa=`http://www.w3.org/1998/Math/MathML`,ma=typeof document<`u`?document:null,ha=ma&&ma.createElement(`template`),ga={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{let t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{let i=t===`svg`?ma.createElementNS(fa,e):t===`mathml`?ma.createElementNS(pa,e):n?ma.createElement(e,{is:n}):ma.createElement(e);return e===`select`&&r&&r.multiple!=null&&i.setAttribute(`multiple`,r.multiple),i},createText:e=>ma.createTextNode(e),createComment:e=>ma.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ma.querySelector(e),setScopeId(e,t){e.setAttribute(t,``)},insertStaticContent(e,t,n,r,i,a){let o=n?n.previousSibling:t.lastChild;if(i&&(i===a||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===a||!(i=i.nextSibling)););else{ha.innerHTML=da(r===`svg`?`<svg>${e}</svg>`:r===`mathml`?`<math>${e}</math>`:e);let i=ha.content;if(r===`svg`||r===`mathml`){let e=i.firstChild;for(;e.firstChild;)i.appendChild(e.firstChild);i.removeChild(e)}t.insertBefore(i,n)}return[o?o.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},_a=Symbol(`_vtc`);function va(e,t,n){let r=e[_a];r&&(t=(t?[t,...r]:[...r]).join(` `)),t==null?e.removeAttribute(`class`):n?e.setAttribute(`class`,t):e.className=t}var ya=Symbol(`_vod`),ba=Symbol(`_vsh`),xa=Symbol(``),Sa=/(?:^|;)\s*display\s*:/;function Ca(e,t,n){let r=e.style,i=g(n),a=!1;if(n&&!i){if(t)if(g(t))for(let e of t.split(`;`)){let t=e.slice(0,e.indexOf(`:`)).trim();n[t]??Ta(r,t,``)}else for(let e in t)n[e]??Ta(r,e,``);for(let i in n){i===`display`&&(a=!0);let o=n[i];o==null?Ta(r,i,``):ka(e,i,!g(t)&&t?t[i]:void 0,o)||Ta(r,i,o)}}else if(i){if(t!==n){let e=r[xa];e&&(n+=`;`+e),r.cssText=n,a=Sa.test(n)}}else t&&e.removeAttribute(`style`);ya in e&&(e[ya]=a?r.display:``,e[ba]&&(r.display=`none`))}var wa=/\s*!important$/;function Ta(e,t,n){if(d(n))n.forEach(n=>Ta(e,t,n));else if(n??=``,t.startsWith(`--`))e.setProperty(t,n);else{let r=Oa(e,t);wa.test(n)?e.setProperty(D(r),n.replace(wa,``),`important`):e[r]=n}}var Ea=[`Webkit`,`Moz`,`ms`],Da={};function Oa(e,t){let n=Da[t];if(n)return n;let r=E(t);if(r!==`filter`&&r in e)return Da[t]=r;r=re(r);for(let n=0;n<Ea.length;n++){let i=Ea[n]+r;if(i in e)return Da[t]=i}return t}function ka(e,t,n,r){return e.tagName===`TEXTAREA`&&(t===`width`||t===`height`)&&g(r)&&n===r}var Aa=`http://www.w3.org/1999/xlink`;function ja(e,t,n,r,i,a=de(t)){r&&t.startsWith(`xlink:`)?n==null?e.removeAttributeNS(Aa,t.slice(6,t.length)):e.setAttributeNS(Aa,t,n):n==null||a&&!F(n)?e.removeAttribute(t):e.setAttribute(t,a?``:_(n)?String(n):n)}function Ma(e,t,n,r,i){if(t===`innerHTML`||t===`textContent`){n!=null&&(e[t]=t===`innerHTML`?da(n):n);return}let a=e.tagName;if(t===`value`&&a!==`PROGRESS`&&!a.includes(`-`)){let r=a===`OPTION`?e.getAttribute(`value`)||``:e.value,i=n==null?e.type===`checkbox`?`on`:``:String(n);(r!==i||!(`_value`in e))&&(e.value=i),n??e.removeAttribute(t),e._value=n;return}let o=!1;if(n===``||n==null){let r=typeof e[t];r===`boolean`?n=F(n):n==null&&r===`string`?(n=``,o=!0):r===`number`&&(n=0,o=!0)}try{e[t]=n}catch{}o&&e.removeAttribute(i||t)}function Na(e,t,n,r){e.addEventListener(t,n,r)}function Pa(e,t,n,r){e.removeEventListener(t,n,r)}var Fa=Symbol(`_vei`);function Ia(e,t,n,r,i=null){let a=e[Fa]||(e[Fa]={}),o=a[t];if(r&&o)o.value=r;else{let[n,s]=Ra(t);r?Na(e,n,a[t]=Ha(r,i),s):o&&(Pa(e,n,o,s),a[t]=void 0)}}var La=/(?:Once|Passive|Capture)$/;function Ra(e){let t;if(La.test(e)){t={};let n;for(;n=e.match(La);)e=e.slice(0,e.length-n[0].length),t[n[0].toLowerCase()]=!0}return[e[2]===`:`?e.slice(3):D(e.slice(2)),t]}var za=0,Ba=Promise.resolve(),Va=()=>za||=(Ba.then(()=>za=0),Date.now());function Ha(e,t){let n=e=>{if(!e._vts)e._vts=Date.now();else if(e._vts<=n.attached)return;let r=n.value;if(d(r)){let n=e.stopImmediatePropagation;e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0};let i=r.slice(),a=[e];for(let n=0;n<i.length&&!e._stopped;n++){let e=i[n];e&&Gt(e,t,5,a)}}else Gt(r,t,5,[e])};return n.value=e,n.attached=Va(),n}var Ua=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Wa=(e,t,n,r,i,s)=>{let c=i===`svg`;t===`class`?va(e,r,c):t===`style`?Ca(e,n,r):a(t)?o(t)||Ia(e,t,n,r,s):(t[0]===`.`?(t=t.slice(1),!0):t[0]===`^`?(t=t.slice(1),!1):Ga(e,t,r,c))?(Ma(e,t,r),!e.tagName.includes(`-`)&&(t===`value`||t===`checked`||t===`selected`)&&ja(e,t,r,c,s,t!==`value`)):e._isVueCE&&(Ka(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!g(r)))?Ma(e,E(t),r,s,t):(t===`true-value`?e._trueValue=r:t===`false-value`&&(e._falseValue=r),ja(e,t,r,c))};function Ga(e,t,n,r){if(r)return!!(t===`innerHTML`||t===`textContent`||t in e&&Ua(t)&&h(n));if(t===`spellcheck`||t===`draggable`||t===`translate`||t===`autocorrect`||t===`sandbox`&&e.tagName===`IFRAME`||t===`form`||t===`list`&&e.tagName===`INPUT`||t===`type`&&e.tagName===`TEXTAREA`)return!1;if(t===`width`||t===`height`){let t=e.tagName;if(t===`IMG`||t===`VIDEO`||t===`CANVAS`||t===`SOURCE`)return!1}return Ua(t)&&g(n)?!1:t in e}function Ka(e,t){let n=e._def.props;if(!n)return!1;let r=E(t);return Array.isArray(n)?n.some(e=>E(e)===r):Object.keys(n).some(e=>E(e)===r)}var qa=e=>{let t=e.props[`onUpdate:modelValue`]||!1;return d(t)?e=>ae(t,e):t};function Ja(e){e.target.composing=!0}function Ya(e){let t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event(`input`)))}var Xa=Symbol(`_assign`);function Za(e,t,n){return t&&(e=e.trim()),n&&(e=A(e)),e}var Qa={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e[Xa]=qa(i);let a=r||i.props&&i.props.type===`number`;Na(e,t?`change`:`input`,t=>{t.target.composing||e[Xa](Za(e.value,n,a))}),(n||a)&&Na(e,`change`,()=>{e.value=Za(e.value,n,a)}),t||(Na(e,`compositionstart`,Ja),Na(e,`compositionend`,Ya),Na(e,`change`,Ya))},mounted(e,{value:t}){e.value=t??``},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:a}},o){if(e[Xa]=qa(o),e.composing)return;let s=(a||e.type===`number`)&&!/^0\d/.test(e.value)?A(e.value):e.value,c=t??``;if(s===c)return;let l=e.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===e&&e.type!==`range`&&(r&&t===n||i&&e.value.trim()===c)||(e.value=c)}},$a=[`ctrl`,`shift`,`alt`,`meta`],eo={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>`button`in e&&e.button!==0,middle:e=>`button`in e&&e.button!==1,right:e=>`button`in e&&e.button!==2,exact:(e,t)=>$a.some(n=>e[`${n}Key`]&&!t.includes(n))},$=(e,t)=>{if(!e)return e;let n=e._withMods||={},r=t.join(`.`);return n[r]||(n[r]=((n,...r)=>{for(let e=0;e<t.length;e++){let r=eo[t[e]];if(r&&r(n,t))return}return e(n,...r)}))},to={esc:`escape`,space:` `,up:`arrow-up`,left:`arrow-left`,right:`arrow-right`,down:`arrow-down`,delete:`backspace`},no=(e,t)=>{let n=e._withKeys||={},r=t.join(`.`);return n[r]||(n[r]=(n=>{if(!(`key`in n))return;let r=D(n.key);if(t.some(e=>e===r||to[e]===r))return e(n)}))},ro=s({patchProp:Wa},ga),io;function ao(){return io||=ni(ro)}var oo=((...e)=>{let t=ao().createApp(...e),{mount:n}=t;return t.mount=e=>{let r=co(e);if(!r)return;let i=t._component;!h(i)&&!i.render&&!i.template&&(i.template=r.innerHTML),r.nodeType===1&&(r.textContent=``);let a=n(r,!1,so(r));return r instanceof Element&&(r.removeAttribute(`v-cloak`),r.setAttribute(`data-v-app`,``)),a},t});function so(e){if(e instanceof SVGElement)return`svg`;if(typeof MathMLElement==`function`&&e instanceof MathMLElement)return`mathml`}function co(e){return g(e)?document.querySelector(e):e}var lo=async()=>{let e=await fetch(`/api/state`);if(!e.ok)throw Error(`GET /api/state → ${e.status}`);return e.json()},uo=async e=>{let t=await fetch(`/api/screen/${encodeURIComponent(e)}`);if(!t.ok)throw Error(`GET /api/screen/${e} → ${t.status}`);return t.json()},fo=async(e,t,n)=>{let r=await fetch(e,{method:t,headers:{"content-type":`application/json`},body:n===void 0?void 0:JSON.stringify(n)});if(!r.ok)throw Error(`${t} ${e} → ${r.status}`);return r.json()},po=(e,t)=>fo(`/api/screen/${encodeURIComponent(e)}/meta`,`POST`,t),mo=async e=>(await fo(`/api/edges`,`POST`,e)).index,ho=(e,t)=>fo(`/api/edges/${e}`,`PUT`,t),go=e=>fo(`/api/edges/${e}`,`DELETE`),_o=async(e,t)=>{let n=await fetch(`/api/screen/${encodeURIComponent(e)}/text`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t)}),r=await n.json().catch(()=>null);return n.ok&&r?.ok?r:{ok:!1,reason:r?.reason??r?.error??`POST /api/screen/${e}/text → ${n.status}`}},vo=async(e,t)=>{let n=await fetch(`/api/screen/${encodeURIComponent(e)}/image`,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify(t)}),r=await n.json().catch(()=>null);return n.ok&&r?.ok?r:{ok:!1,reason:r?.reason??r?.error??`POST /api/screen/${e}/image → ${n.status}`}},yo=(e,t)=>{let n=new EventSource(`/events`);return n.onopen=()=>t?.(!0),n.onerror=()=>t?.(!1),n.onmessage=t=>{try{e(JSON.parse(t.data))}catch{}},()=>n.close()},bo=(async function(e={}){var t,n=e,r,i,a=new Promise((e,t)=>{r=e,i=t}),o=!0,s=!1,c=!1,l=!1,u=import.meta.url,d=``;function f(e){return n.locateFile?n.locateFile(e,d):d+e}var p,m;if(l){if(typeof process==`object`&&process.versions?.node&&process.type!=`renderer`||typeof window==`object`||typeof WorkerGlobalScope<`u`)throw Error(`not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)`)}else if(o||s){try{d=new URL(`.`,u).href}catch{}if(!(typeof window==`object`||typeof WorkerGlobalScope<`u`))throw Error(`not compiled for this environment (did you build to HTML and try to run it not on the web, or set ENVIRONMENT to something - like node - and run it someplace else - like on the web?)`);p=async e=>{b(!T(e),`readAsync does not work with file:// URLs`);var t=await fetch(e,{credentials:`same-origin`});if(t.ok)return t.arrayBuffer();throw Error(t.status+` : `+t.url)}}else throw Error(`environment detection error`);var h=console.log.bind(console),g=console.error.bind(console);b(!s,"worker environment detected but not enabled at build time. Add `worker` to `-sENVIRONMENT` to enable."),b(!c,"node environment detected but not enabled at build time. Add `node` to `-sENVIRONMENT` to enable."),b(!l,"shell environment detected but not enabled at build time. Add `shell` to `-sENVIRONMENT` to enable.");var _;typeof WebAssembly!=`object`&&g(`no native wasm support detected`);var v,y=!1;function b(e,t){e||P(`Assertion failed`+(t?`: `+t:``))}var x,S,C,w=!1,T=e=>e.startsWith(`file://`);function ee(){var e=ft();b((e&3)==0),e==0&&(e+=4),C[e>>2]=34821223,C[e+4>>2]=2310721022,C[0]=1668509029}function te(){if(!y){var e=ft();e==0&&(e+=4);var t=C[e>>2],n=C[e+4>>2];(t!=34821223||n!=2310721022)&&P(`Stack overflow! Stack cookie has been overwritten at ${xe(e)}, expected hex dwords 0x89BACDFE and 0x2135467, but received ${xe(n)} ${xe(t)}`),C[0]!=1668509029&&P(`Runtime error: The application has corrupted its heap memory area (address zero)!`)}}(()=>{var e=new Int16Array(1),t=new Int8Array(e.buffer);if(e[0]=25459,t[0]!==115||t[1]!==99)throw`Runtime error: expected the system to be little-endian! (Run with -sSUPPORT_BIG_ENDIAN to bypass)`})();function E(e){Object.getOwnPropertyDescriptor(n,e)||Object.defineProperty(n,e,{configurable:!0,set(){P(`Attempt to set \`Module.${e}\` after it has already been processed. This can happen, for example, when code is injected via '--post-js' rather than '--pre-js'`)}})}function ne(e){Object.getOwnPropertyDescriptor(n,e)&&P(`\`Module.${e}\` was supplied but \`${e}\` not included in INCOMING_MODULE_JS_API`)}function D(e){return e===`FS_createPath`||e===`FS_createDataFile`||e===`FS_createPreloadedFile`||e===`FS_unlink`||e===`addRunDependency`||e===`FS_createLazyFile`||e===`FS_createDevice`||e===`removeRunDependency`}function re(e,t){typeof globalThis<`u`&&!Object.getOwnPropertyDescriptor(globalThis,e)&&Object.defineProperty(globalThis,e,{configurable:!0,get(){t()}})}function ie(e,t){re(e,()=>{H(`\`${e}\` is not longer defined by emscripten. ${t}`)})}ie(`buffer`,`Please use HEAP8.buffer or wasmMemory.buffer`),ie(`asm`,`Please use wasmExports instead`);function O(e){re(e,()=>{var t=`\`${e}\` is a library symbol and not included by default; add it to your library.js __deps or to DEFAULT_LIBRARY_FUNCS_TO_INCLUDE on the command line`,n=e;n.startsWith(`_`)||(n=`$`+e),t+=` (e.g. -sDEFAULT_LIBRARY_FUNCS_TO_INCLUDE='${n}')`,D(e)&&(t+=`. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you`),H(t)}),ae(e)}function ae(e){Object.getOwnPropertyDescriptor(n,e)||Object.defineProperty(n,e,{configurable:!0,get(){var t=`'${e}' was not exported. add it to EXPORTED_RUNTIME_METHODS (see the Emscripten FAQ)`;D(e)&&(t+=`. Alternatively, forcing filesystem support (-sFORCE_FILESYSTEM) can export this for you`),P(t)}})}function k(){var e=v.buffer;x=new Int8Array(e),new Int16Array(e),n.HEAPU8=S=new Uint8Array(e),new Uint16Array(e),new Int32Array(e),n.HEAPU32=C=new Uint32Array(e),n.HEAPF32=new Float32Array(e),new Float64Array(e),new BigInt64Array(e),new BigUint64Array(e)}b(typeof Int32Array<`u`&&typeof Float64Array<`u`&&Int32Array.prototype.subarray!=null&&Int32Array.prototype.set!=null,`JS engine does not provide full typed array support`);function A(){if(n.preRun)for(typeof n.preRun==`function`&&(n.preRun=[n.preRun]);n.preRun.length;)be(n.preRun.shift());E(`preRun`),_e(ye)}function oe(){b(!w),w=!0,te(),dt.__wasm_call_ctors()}function se(){if(te(),n.postRun)for(typeof n.postRun==`function`&&(n.postRun=[n.postRun]);n.postRun.length;)ve(n.postRun.shift());E(`postRun`),_e(z)}var j=0,ce=null,le={},M=null;function ue(e){j++,n.monitorRunDependencies?.(j),e?(b(!le[e]),le[e]=1,M===null&&typeof setInterval<`u`&&(M=setInterval(()=>{if(y){clearInterval(M),M=null;return}var e=!1;for(var t in le)e||(e=!0,g(`still waiting on run dependencies:`)),g(`dependency: ${t}`);e&&g(`(end of list)`)},1e4))):g(`warning: run dependency added without ID`)}function N(e){if(j--,n.monitorRunDependencies?.(j),e?(b(le[e]),delete le[e]):g(`warning: run dependency removed without ID`),j==0&&(M!==null&&(clearInterval(M),M=null),ce)){var t=ce;ce=null,t()}}function P(e){n.onAbort?.(e),e=`Aborted(`+e+`)`,g(e),y=!0;var t=new WebAssembly.RuntimeError(e);throw i(t),t}var de={error(){P(`Filesystem support (FS) was not included. The problem is that you are using files from JS, but files were not used from C/C++, so filesystem support was not auto-included. You can force-include filesystem support with -sFORCE_FILESYSTEM`)},init(){de.error()},createDataFile(){de.error()},createPreloadedFile(){de.error()},createLazyFile(){de.error()},open(){de.error()},mkdev(){de.error()},registerDevice(){de.error()},analyzePath(){de.error()},ErrnoError(){de.error()}};function F(e,t){return(...n)=>{b(w,`native function \`${e}\` called before runtime initialization`);var r=dt[e];return b(r,`exported native function \`${e}\` not found`),b(n.length<=t,`native function \`${e}\` called with ${n.length} args but expects ${t}`),r(...n)}}var fe;function I(){return n.locateFile?f(`creator-ui.wasm`):new URL(`/assets/creator-ui-DBh5lzcv.wasm`,``+import.meta.url).href}function pe(e){if(e==fe&&_)return new Uint8Array(_);if(m)return m(e);throw`both async and sync fetching of the wasm failed`}async function L(e){if(!_)try{var t=await p(e);return new Uint8Array(t)}catch{}return pe(e)}async function me(e,t){try{var n=await L(e);return await WebAssembly.instantiate(n,t)}catch(e){g(`failed to asynchronously prepare wasm: ${e}`),T(fe)&&g(`warning: Loading from a file URI (${fe}) is not supported in most browsers. See https://emscripten.org/docs/getting_started/FAQ.html#how-do-i-run-a-local-webserver-for-testing-why-does-my-program-stall-in-downloading-or-preparing`),P(e)}}async function he(e,t,n){if(!e&&typeof WebAssembly.instantiateStreaming==`function`)try{var r=fetch(t,{credentials:`same-origin`});return await WebAssembly.instantiateStreaming(r,n)}catch(e){g(`wasm streaming compile failed: ${e}`),g(`falling back to ArrayBuffer instantiation`)}return me(t,n)}function R(){return{env:ut,wasi_snapshot_preview1:ut}}async function ge(){function e(e,t){return dt=e.exports,v=dt.memory,b(v,`memory not found in wasm exports`),k(),Ye=dt.__indirect_function_table,b(Ye,`table not found in wasm exports`),N(`wasm-instantiate`),dt}ue(`wasm-instantiate`);var t=n;function r(r){return b(n===t,`the Module object should not be replaced during async compilation - perhaps the order of HTML elements is wrong?`),t=null,e(r.instance)}var a=R();if(n.instantiateWasm)return new Promise((t,r)=>{try{n.instantiateWasm(a,(n,r)=>{t(e(n,r))})}catch(e){g(`Module.instantiateWasm callback failed with error: ${e}`),r(e)}});fe??=I();try{return r(await he(_,fe,a))}catch(e){return i(e),Promise.reject(e)}}var _e=e=>{for(;e.length>0;)e.shift()(n)},z=[],ve=e=>z.push(e),ye=[],be=e=>ye.push(e),xe=e=>(b(typeof e==`number`),e>>>=0,`0x`+e.toString(16).padStart(8,`0`)),B=e=>ht(e),V=()=>gt(),H=e=>{H.shown||={},H.shown[e]||(H.shown[e]=1,g(e))},Se=new TextDecoder,Ce=(e,t)=>{if(b(typeof e==`number`,`UTF8ToString expects a number (got ${typeof e})`),!e)return``;for(var n=e+t,r=e;!(r>=n)&&S[r];)++r;return Se.decode(S.subarray(e,r))},we=(e,t,n,r)=>P(`Assertion failed: ${Ce(e)}, at: `+[t?Ce(t):`unknown filename`,n,r?Ce(r):`unknown function`]),Te=[],Ee=0,De=e=>{var t=new Ae(e);return t.get_caught()||(t.set_caught(!0),Ee--),t.set_rethrown(!1),Te.push(t),_t(e),bt(e)},Oe=0,ke=()=>{G(0,0),b(Te.length>0),vt(Te.pop().excPtr),Oe=0};class Ae{constructor(e){this.excPtr=e,this.ptr=e-24}set_type(e){C[this.ptr+4>>2]=e}get_type(){return C[this.ptr+4>>2]}set_destructor(e){C[this.ptr+8>>2]=e}get_destructor(){return C[this.ptr+8>>2]}set_caught(e){e=+!!e,x[this.ptr+12]=e}get_caught(){return x[this.ptr+12]!=0}set_rethrown(e){e=+!!e,x[this.ptr+13]=e}get_rethrown(){return x[this.ptr+13]!=0}init(e,t){this.set_adjusted_ptr(0),this.set_type(e),this.set_destructor(t)}set_adjusted_ptr(e){C[this.ptr+16>>2]=e}get_adjusted_ptr(){return C[this.ptr+16>>2]}}var je=e=>pt(e),Me=e=>{var t=Oe;if(!t)return je(0),0;var n=new Ae(t);n.set_adjusted_ptr(t);var r=n.get_type();if(!r)return je(0),t;for(var i of e){if(i===0||i===r)break;if(yt(i,r,n.ptr+16))return je(i),t}return je(r),t},Ne=()=>Me([]),Pe=e=>Me([e]),Fe=()=>{var e=Te.pop();e||P(`no exception to throw`);var t=e.excPtr;e.get_rethrown()||(Te.push(e),e.set_rethrown(!0),e.set_caught(!1),Ee++),Oe=t,b(!1,`Exception thrown, but exception catching is not enabled. Compile with -sNO_DISABLE_EXCEPTION_CATCHING or -sEXCEPTION_CATCHING_ALLOWED=[..] to catch.`)},Ie=(e,t,n)=>{new Ae(e).init(t,n),Oe=e,Ee++,b(!1,`Exception thrown, but exception catching is not enabled. Compile with -sNO_DISABLE_EXCEPTION_CATCHING or -sEXCEPTION_CATCHING_ALLOWED=[..] to catch.`)},Le=e=>{Oe||=e,b(!1,`Exception thrown, but exception catching is not enabled. Compile with -sNO_DISABLE_EXCEPTION_CATCHING or -sEXCEPTION_CATCHING_ALLOWED=[..] to catch.`)},Re=()=>P(`native code called abort()`),ze=e=>{P(`Cannot enlarge memory arrays to size ${e} bytes (OOM). Either (1) compile with -sINITIAL_MEMORY=X with X higher than the current value ${x.length}, (2) compile with -sALLOW_MEMORY_GROWTH which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with -sABORTING_MALLOC=0`)},Be=e=>{S.length,e>>>=0,ze(e)},Ve=e=>{P(`fd_close called without SYSCALLS_REQUIRE_FILESYSTEM`)},U=9007199254740992,He=-9007199254740992,Ue=e=>e<He||e>U?NaN:Number(e);function We(e,t,n,r){return t=Ue(t),70}var Ge=[null,[],[]],Ke=(e,t=0,n=NaN)=>{for(var r=t+n,i=t;e[i]&&!(i>=r);)++i;return Se.decode(e.buffer?e.subarray(t,i):new Uint8Array(e.slice(t,i)))},qe=(e,t)=>{var n=Ge[e];b(n),t===0||t===10?((e===1?h:g)(Ke(n)),n.length=0):n.push(t)},Je=(e,t,n,r)=>{for(var i=0,a=0;a<n;a++){var o=C[t>>2],s=C[t+4>>2];t+=8;for(var c=0;c<s;c++)qe(e,S[o+c]);i+=s}return C[r>>2]=i,0},Ye,W=e=>Ye.get(e),Xe=(e,t)=>{b(e<16384),e<128?t.push(e):t.push(e%128|128,e>>7)},Ze=e=>{for(var t={i:`i32`,j:`i64`,f:`f32`,d:`f64`,e:`externref`,p:`i32`},n={parameters:[],results:e[0]==`v`?[]:[t[e[0]]]},r=1;r<e.length;++r)b(e[r]in t,`invalid signature char: `+e[r]),n.parameters.push(t[e[r]]);return n},Qe=(e,t)=>{var n=e.slice(0,1),r=e.slice(1),i={i:127,p:127,j:126,f:125,d:124,e:111};t.push(96),Xe(r.length,t);for(var a of r)b(a in i,`invalid signature char: ${a}`),t.push(i[a]);n==`v`?t.push(0):t.push(1,i[n])},$e=(e,t)=>{if(typeof WebAssembly.Function==`function`)return new WebAssembly.Function(Ze(t),e);var n=[1];Qe(t,n);var r=[0,97,115,109,1,0,0,0,1];Xe(n.length,r),r.push(...n),r.push(2,7,1,1,101,1,102,0,0,7,5,1,1,102,0,0);var i=new WebAssembly.Module(new Uint8Array(r));return new WebAssembly.Instance(i,{e:{f:e}}).exports.f},et=(e,t)=>{if(tt)for(var n=e;n<e+t;n++){var r=W(n);r&&tt.set(r,n)}},tt,nt=e=>(tt||(tt=new WeakMap,et(0,Ye.length)),tt.get(e)||0),rt=[],it=()=>{if(rt.length)return rt.pop();try{Ye.grow(1)}catch(e){throw e instanceof RangeError?`Unable to grow wasm table. Set ALLOW_TABLE_GROWTH.`:e}return Ye.length-1},at=(e,t)=>Ye.set(e,t),ot=(e,t)=>{b(e!==void 0);var n=nt(e);if(n)return n;var r=it();try{at(r,e)}catch(n){if(!(n instanceof TypeError))throw n;b(t!==void 0,`Missing signature argument to addFunction: `+e),at(r,$e(e,t))}return tt.set(e,r),r},st=(e,t,n,r)=>{if(b(typeof e==`string`,`stringToUTF8Array expects a string (got ${typeof e})`),!(r>0))return 0;for(var i=n,a=n+r-1,o=0;o<e.length;++o){var s=e.charCodeAt(o);if(s>=55296&&s<=57343){var c=e.charCodeAt(++o);s=65536+((s&1023)<<10)|c&1023}if(s<=127){if(n>=a)break;t[n++]=s}else if(s<=2047){if(n+1>=a)break;t[n++]=192|s>>6,t[n++]=128|s&63}else if(s<=65535){if(n+2>=a)break;t[n++]=224|s>>12,t[n++]=128|s>>6&63,t[n++]=128|s&63}else{if(n+3>=a)break;s>1114111&&H(`Invalid Unicode code point `+xe(s)+` encountered when serializing a JS string to a UTF-8 string in wasm memory! (Valid unicode code points should be in range 0-0x10FFFF).`),t[n++]=240|s>>18,t[n++]=128|s>>12&63,t[n++]=128|s>>6&63,t[n++]=128|s&63}}return t[n]=0,n-i};n.noExitRuntime&&n.noExitRuntime,n.print&&(h=n.print),n.printErr&&(g=n.printErr),n.wasmBinary&&(_=n.wasmBinary),n.FS_createDataFile=de.createDataFile,n.FS_createPreloadedFile=de.createPreloadedFile,ct(),n.arguments&&n.arguments,n.thisProgram&&n.thisProgram,b(n.memoryInitializerPrefixURL===void 0,`Module.memoryInitializerPrefixURL option was removed, use Module.locateFile instead`),b(n.pthreadMainPrefixURL===void 0,`Module.pthreadMainPrefixURL option was removed, use Module.locateFile instead`),b(n.cdInitializerPrefixURL===void 0,`Module.cdInitializerPrefixURL option was removed, use Module.locateFile instead`),b(n.filePackagePrefixURL===void 0,`Module.filePackagePrefixURL option was removed, use Module.locateFile instead`),b(n.read===void 0,`Module.read option was removed`),b(n.readAsync===void 0,`Module.readAsync option was removed (modify readAsync in JS)`),b(n.readBinary===void 0,`Module.readBinary option was removed (modify readBinary in JS)`),b(n.setWindowTitle===void 0,`Module.setWindowTitle option was removed (modify emscripten_set_window_title in JS)`),b(n.TOTAL_MEMORY===void 0,`Module.TOTAL_MEMORY has been renamed Module.INITIAL_MEMORY`),b(n.ENVIRONMENT===void 0,`Module.ENVIRONMENT has been deprecated. To force the environment, use the ENVIRONMENT compile-time option (for example, -sENVIRONMENT=web or -sENVIRONMENT=node)`),b(n.STACK_SIZE===void 0,`STACK_SIZE can no longer be set at runtime. Use -sSTACK_SIZE at link time`),b(n.wasmMemory===void 0,"Use of `wasmMemory` detected. Use -sIMPORTED_MEMORY to define wasmMemory externally"),b(n.INITIAL_MEMORY===void 0,`Detected runtime INITIAL_MEMORY setting. Use -sIMPORTED_MEMORY to define wasmMemory dynamically`),`writeI53ToI64.writeI53ToI64Clamped.writeI53ToI64Signaling.writeI53ToU64Clamped.writeI53ToU64Signaling.readI53FromI64.readI53FromU64.convertI32PairToI53.convertI32PairToI53Checked.convertU32PairToI53.stackAlloc.getTempRet0.zeroMemory.exitJS.getHeapMax.growMemory.strError.inetPton4.inetNtop4.inetPton6.inetNtop6.readSockaddr.writeSockaddr.emscriptenLog.readEmAsmArgs.jstoi_q.getExecutableName.listenOnce.autoResumeAudioContext.getDynCaller.dynCall.handleException.keepRuntimeAlive.runtimeKeepalivePush.runtimeKeepalivePop.callUserCallback.maybeExit.asmjsMangle.asyncLoad.alignMemory.mmapAlloc.HandleAllocator.getNativeTypeSize.addOnInit.addOnPostCtor.addOnPreMain.addOnExit.STACK_SIZE.STACK_ALIGN.POINTER_SIZE.ASSERTIONS.ccall.cwrap.removeFunction.reallyNegative.unSign.strLen.reSign.formatString.intArrayFromString.intArrayToString.AsciiToString.stringToAscii.UTF16ToString.stringToUTF16.lengthBytesUTF16.UTF32ToString.stringToUTF32.lengthBytesUTF32.stringToNewUTF8.stringToUTF8OnStack.writeArrayToMemory.registerKeyEventCallback.maybeCStringToJsString.findEventTarget.getBoundingClientRect.fillMouseEventData.registerMouseEventCallback.registerWheelEventCallback.registerUiEventCallback.registerFocusEventCallback.fillDeviceOrientationEventData.registerDeviceOrientationEventCallback.fillDeviceMotionEventData.registerDeviceMotionEventCallback.screenOrientation.fillOrientationChangeEventData.registerOrientationChangeEventCallback.fillFullscreenChangeEventData.registerFullscreenChangeEventCallback.JSEvents_requestFullscreen.JSEvents_resizeCanvasForFullscreen.registerRestoreOldStyle.hideEverythingExceptGivenElement.restoreHiddenElements.setLetterbox.softFullscreenResizeWebGLRenderTarget.doRequestFullscreen.fillPointerlockChangeEventData.registerPointerlockChangeEventCallback.registerPointerlockErrorEventCallback.requestPointerLock.fillVisibilityChangeEventData.registerVisibilityChangeEventCallback.registerTouchEventCallback.fillGamepadEventData.registerGamepadEventCallback.registerBeforeUnloadEventCallback.fillBatteryEventData.battery.registerBatteryEventCallback.setCanvasElementSize.getCanvasElementSize.jsStackTrace.getCallstack.convertPCtoSourceLocation.getEnvStrings.checkWasiClock.wasiRightsToMuslOFlags.wasiOFlagsToMuslOFlags.initRandomFill.randomFill.safeSetTimeout.setImmediateWrapped.safeRequestAnimationFrame.clearImmediateWrapped.registerPostMainLoop.registerPreMainLoop.getPromise.makePromise.idsToPromises.makePromiseCallback.Browser_asyncPrepareDataCounter.isLeapYear.ydayFromDate.arraySum.addDays.getSocketFromFD.getSocketAddress.FS_createPreloadedFile.FS_modeStringToFlags.FS_getMode.FS_stdin_getChar.FS_mkdirTree._setNetworkCallback.heapObjectForWebGLType.toTypedArrayIndex.webgl_enable_ANGLE_instanced_arrays.webgl_enable_OES_vertex_array_object.webgl_enable_WEBGL_draw_buffers.webgl_enable_WEBGL_multi_draw.webgl_enable_EXT_polygon_offset_clamp.webgl_enable_EXT_clip_control.webgl_enable_WEBGL_polygon_mode.emscriptenWebGLGet.computeUnpackAlignedImageSize.colorChannelsInGlTextureFormat.emscriptenWebGLGetTexPixelData.emscriptenWebGLGetUniform.webglGetUniformLocation.webglPrepareUniformLocationsBeforeFirstUse.webglGetLeftBracePos.emscriptenWebGLGetVertexAttrib.__glGetActiveAttribOrUniform.writeGLArray.registerWebGlEventCallback.runAndAbortIfError.ALLOC_NORMAL.ALLOC_STACK.allocate.writeStringToMemory.writeAsciiToMemory.demangle.stackTrace`.split(`.`).forEach(O),`run.addRunDependency.removeRunDependency.out.err.callMain.abort.wasmMemory.wasmExports.HEAPF64.HEAP8.HEAP16.HEAPU16.HEAP32.HEAP64.HEAPU64.writeStackCookie.checkStackCookie.INT53_MAX.INT53_MIN.bigintToI53Checked.stackSave.stackRestore.setTempRet0.ptrToString.abortOnCannotGrowMemory.ENV.ERRNO_CODES.DNS.Protocols.Sockets.timers.warnOnce.readEmAsmArgsArray.setWasmTableEntry.getWasmTableEntry.wasmTable.noExitRuntime.addOnPreRun.addOnPostRun.uleb128Encode.sigToWasmTypes.generateFuncType.convertJsFunctionToWasm.freeTableIndexes.functionsInTableMap.getEmptyTableSlot.updateTableMap.getFunctionAddress.setValue.getValue.PATH.PATH_FS.UTF8Decoder.UTF8ArrayToString.stringToUTF8Array.UTF16Decoder.JSEvents.specialHTMLTargets.findCanvasEventTarget.currentFullscreenStrategy.restoreOldWindowedStyle.UNWIND_CACHE.ExitStatus.flush_NO_FILESYSTEM.emSetImmediate.emClearImmediate_deps.emClearImmediate.promiseMap.uncaughtExceptionCount.exceptionLast.exceptionCaught.ExceptionInfo.findMatchingCatch.Browser.requestFullscreen.requestFullScreen.setCanvasSize.getUserMedia.createContext.getPreloadedImageData__data.wget.MONTH_DAYS_REGULAR.MONTH_DAYS_LEAP.MONTH_DAYS_REGULAR_CUMULATIVE.MONTH_DAYS_LEAP_CUMULATIVE.SYSCALLS.preloadPlugins.FS_stdin_getChar_buffer.FS_unlink.FS_createPath.FS_createDevice.FS_readFile.FS.FS_root.FS_mounts.FS_devices.FS_streams.FS_nextInode.FS_nameTable.FS_currentPath.FS_initialized.FS_ignorePermissions.FS_filesystems.FS_syncFSRequests.FS_readFiles.FS_lookupPath.FS_getPath.FS_hashName.FS_hashAddNode.FS_hashRemoveNode.FS_lookupNode.FS_createNode.FS_destroyNode.FS_isRoot.FS_isMountpoint.FS_isFile.FS_isDir.FS_isLink.FS_isChrdev.FS_isBlkdev.FS_isFIFO.FS_isSocket.FS_flagsToPermissionString.FS_nodePermissions.FS_mayLookup.FS_mayCreate.FS_mayDelete.FS_mayOpen.FS_checkOpExists.FS_nextfd.FS_getStreamChecked.FS_getStream.FS_createStream.FS_closeStream.FS_dupStream.FS_doSetAttr.FS_chrdev_stream_ops.FS_major.FS_minor.FS_makedev.FS_registerDevice.FS_getDevice.FS_getMounts.FS_syncfs.FS_mount.FS_unmount.FS_lookup.FS_mknod.FS_statfs.FS_statfsStream.FS_statfsNode.FS_create.FS_mkdir.FS_mkdev.FS_symlink.FS_rename.FS_rmdir.FS_readdir.FS_readlink.FS_stat.FS_fstat.FS_lstat.FS_doChmod.FS_chmod.FS_lchmod.FS_fchmod.FS_doChown.FS_chown.FS_lchown.FS_fchown.FS_doTruncate.FS_truncate.FS_ftruncate.FS_utime.FS_open.FS_close.FS_isClosed.FS_llseek.FS_read.FS_write.FS_mmap.FS_msync.FS_ioctl.FS_writeFile.FS_cwd.FS_chdir.FS_createDefaultDirectories.FS_createDefaultDevices.FS_createSpecialDirectories.FS_createStandardStreams.FS_staticInit.FS_init.FS_quit.FS_findObject.FS_analyzePath.FS_createFile.FS_createDataFile.FS_forceLoadFile.FS_createLazyFile.FS_absolutePath.FS_createFolder.FS_createLink.FS_joinPath.FS_mmapAlloc.FS_standardizePath.MEMFS.TTY.PIPEFS.SOCKFS.tempFixedLengthArray.miniTempWebGLFloatBuffers.miniTempWebGLIntBuffers.GL.AL.GLUT.EGL.GLEW.IDBStore.SDL.SDL_gfx.allocateUTF8.allocateUTF8OnStack.print.printErr.jstoi_s`.split(`.`).forEach(ae),n.UTF8ToString=Ce,n.addFunction=ot,n.stringToUTF8=(e,t,n)=>(b(typeof n==`number`,`stringToUTF8(str, outPtr, maxBytesToWrite) is missing the third parameter that specifies the length of the output buffer!`),st(e,S,t,n)),n.lengthBytesUTF8=e=>{for(var t=0,n=0;n<e.length;++n){var r=e.charCodeAt(n);r<=127?t++:r<=2047?t+=2:r>=55296&&r<=57343?(t+=4,++n):t+=3}return t};function ct(){ne(`fetchSettings`)}function lt(e){console.error(Ce(e))}var ut={__assert_fail:we,__cxa_begin_catch:De,__cxa_end_catch:ke,__cxa_find_matching_catch_2:Ne,__cxa_find_matching_catch_3:Pe,__cxa_rethrow:Fe,__cxa_throw:Ie,__resumeException:Le,_abort_js:Re,cuiConsoleError:lt,emscripten_resize_heap:Be,fd_close:Ve,fd_seek:We,fd_write:Je,invoke_fi:Ot,invoke_fii:Tt,invoke_fiif:Mt,invoke_fiiif:jt,invoke_fiiiff:J,invoke_fiiifff:Lt,invoke_ii:Ct,invoke_iiffiiiffiiiii:Nt,invoke_iii:xt,invoke_iiii:Ut,invoke_iiiii:Ft,invoke_iiiiii:Vt,invoke_iiiiiiiiffff:K,invoke_v:Rt,invoke_vi:St,invoke_vif:q,invoke_vifi:Dt,invoke_vii:kt,invoke_viif:Ht,invoke_viiff:At,invoke_viii:It,invoke_viiiffffii:Pt,invoke_viiiffiiiii:Et,invoke_viiii:wt,invoke_viiiii:zt,invoke_viiiiii:Bt},dt=await ge();n._setMeasureFunc=F(`setMeasureFunc`,1),n._getScreenId=F(`getScreenId`,1),n._createNodeRoot=F(`createNodeRoot`,1),n._createNode=F(`createNode`,3),n._freeNode=F(`freeNode`,1),n._removeNode=F(`removeNode`,2),n._addStringHandler=F(`addStringHandler`,2),n._addFloatHandler=F(`addFloatHandler`,2),n._addUIntHandler=F(`addUIntHandler`,2),n._addResetHandler=F(`addResetHandler`,2),n._setMatrixHandler=F(`setMatrixHandler`,1),n._setGradientHandler=F(`setGradientHandler`,1),n._resetProp=F(`resetProp`,2),n._setFloat=F(`setFloat`,3),n._setFloatExt=F(`setFloatExt`,4),n._setString=F(`setString`,3),n._setStringExt=F(`setStringExt`,4),n._enableNodeLayer=F(`enableNodeLayer`,2),n._disableNodeLayer=F(`disableNodeLayer`,2),n._resetNodeLayer=F(`resetNodeLayer`,2),n._mergeNodeLayer=F(`mergeNodeLayer`,3),n._calculate=F(`calculate`,3),n._setConditionValue=F(`setConditionValue`,2),n._calculateWidget=F(`calculateWidget`,3),n._freeWidget=F(`freeWidget`,1),n._setSafePaddings=F(`setSafePaddings`,5),n._setComfortInset=F(`setComfortInset`,2),n._recalculate=F(`recalculate`,0),n._markNodeDirty=F(`markNodeDirty`,1),n._getOffset=F(`getOffset`,2),n._getParentNode=F(`getParentNode`,1),n._getContentHeight=F(`getContentHeight`,1),n._getContentWidth=F(`getContentWidth`,1),n._getLayer=F(`getLayer`,2),n._getLayoutPointer=F(`getLayoutPointer`,2),n._getLayoutDOMPointer=F(`getLayoutDOMPointer`,2),n._getPaddingPointer=F(`getPaddingPointer`,2),n._setVListHandlers=F(`setVListHandlers`,3),n._vlistInit=F(`vlistInit`,5),n._vlistExists=F(`vlistExists`,1),n._vlistFree=F(`vlistFree`,1),n._vlistSetKeys=F(`vlistSetKeys`,4),n._vlistInsertKeys=F(`vlistInsertKeys`,5),n._vlistRemoveKeys=F(`vlistRemoveKeys`,3),n._vlistInvalidate=F(`vlistInvalidate`,2),n._vlistCreateItemRoot=F(`vlistCreateItemRoot`,2),n._vlistItemMounted=F(`vlistItemMounted`,2),n._vlistItemUnmounted=F(`vlistItemUnmounted`,2),n._vlistOnScroll=F(`vlistOnScroll`,2),n._vlistUpdateLayout=F(`vlistUpdateLayout`,1),n._vlistToPhysical=F(`vlistToPhysical`,1),n._vlistOffsetOf=F(`vlistOffsetOf`,2),n._vlistItemOffsetOf=F(`vlistItemOffsetOf`,2);var ft=dt.emscripten_stack_get_end;dt.emscripten_stack_get_base,n._free=F(`free`,1),n._malloc=F(`malloc`,1);var G=F(`setThrew`,2),pt=F(`_emscripten_tempret_set`,1),mt=dt.emscripten_stack_init;dt.emscripten_stack_get_free;var ht=dt._emscripten_stack_restore;dt._emscripten_stack_alloc;var gt=dt.emscripten_stack_get_current,_t=F(`__cxa_increment_exception_refcount`,1),vt=F(`__cxa_decrement_exception_refcount`,1),yt=F(`__cxa_can_catch`,3),bt=F(`__cxa_get_exception_ptr`,1);function xt(e,t,n){var r=V();try{return W(e)(t,n)}catch(e){if(B(r),e!==e+0)throw e;G(1,0)}}function St(e,t){var n=V();try{W(e)(t)}catch(e){if(B(n),e!==e+0)throw e;G(1,0)}}function Ct(e,t){var n=V();try{return W(e)(t)}catch(e){if(B(n),e!==e+0)throw e;G(1,0)}}function wt(e,t,n,r,i){var a=V();try{W(e)(t,n,r,i)}catch(e){if(B(a),e!==e+0)throw e;G(1,0)}}function Tt(e,t,n){var r=V();try{return W(e)(t,n)}catch(e){if(B(r),e!==e+0)throw e;G(1,0)}}function Et(e,t,n,r,i,a,o,s,c,l,u){var d=V();try{W(e)(t,n,r,i,a,o,s,c,l,u)}catch(e){if(B(d),e!==e+0)throw e;G(1,0)}}function Dt(e,t,n,r){var i=V();try{W(e)(t,n,r)}catch(e){if(B(i),e!==e+0)throw e;G(1,0)}}function K(e,t,n,r,i,a,o,s,c,l,u,d){var f=V();try{return W(e)(t,n,r,i,a,o,s,c,l,u,d)}catch(e){if(B(f),e!==e+0)throw e;G(1,0)}}function Ot(e,t){var n=V();try{return W(e)(t)}catch(e){if(B(n),e!==e+0)throw e;G(1,0)}}function kt(e,t,n){var r=V();try{W(e)(t,n)}catch(e){if(B(r),e!==e+0)throw e;G(1,0)}}function At(e,t,n,r,i){var a=V();try{W(e)(t,n,r,i)}catch(e){if(B(a),e!==e+0)throw e;G(1,0)}}function q(e,t,n){var r=V();try{W(e)(t,n)}catch(e){if(B(r),e!==e+0)throw e;G(1,0)}}function J(e,t,n,r,i,a){var o=V();try{return W(e)(t,n,r,i,a)}catch(e){if(B(o),e!==e+0)throw e;G(1,0)}}function jt(e,t,n,r,i){var a=V();try{return W(e)(t,n,r,i)}catch(e){if(B(a),e!==e+0)throw e;G(1,0)}}function Mt(e,t,n,r){var i=V();try{return W(e)(t,n,r)}catch(e){if(B(i),e!==e+0)throw e;G(1,0)}}function Nt(e,t,n,r,i,a,o,s,c,l,u,d,f,p){var m=V();try{return W(e)(t,n,r,i,a,o,s,c,l,u,d,f,p)}catch(e){if(B(m),e!==e+0)throw e;G(1,0)}}function Pt(e,t,n,r,i,a,o,s,c,l){var u=V();try{W(e)(t,n,r,i,a,o,s,c,l)}catch(e){if(B(u),e!==e+0)throw e;G(1,0)}}function Ft(e,t,n,r,i){var a=V();try{return W(e)(t,n,r,i)}catch(e){if(B(a),e!==e+0)throw e;G(1,0)}}function It(e,t,n,r){var i=V();try{W(e)(t,n,r)}catch(e){if(B(i),e!==e+0)throw e;G(1,0)}}function Lt(e,t,n,r,i,a,o){var s=V();try{return W(e)(t,n,r,i,a,o)}catch(e){if(B(s),e!==e+0)throw e;G(1,0)}}function Rt(e){var t=V();try{W(e)()}catch(e){if(B(t),e!==e+0)throw e;G(1,0)}}function zt(e,t,n,r,i,a){var o=V();try{W(e)(t,n,r,i,a)}catch(e){if(B(o),e!==e+0)throw e;G(1,0)}}function Bt(e,t,n,r,i,a,o){var s=V();try{W(e)(t,n,r,i,a,o)}catch(e){if(B(s),e!==e+0)throw e;G(1,0)}}function Vt(e,t,n,r,i,a){var o=V();try{return W(e)(t,n,r,i,a)}catch(e){if(B(o),e!==e+0)throw e;G(1,0)}}function Ht(e,t,n,r){var i=V();try{W(e)(t,n,r)}catch(e){if(B(i),e!==e+0)throw e;G(1,0)}}function Ut(e,t,n,r){var i=V();try{return W(e)(t,n,r)}catch(e){if(B(i),e!==e+0)throw e;G(1,0)}}var Wt;function Gt(){mt(),ee()}function Kt(){if(j>0){ce=Kt;return}if(Gt(),A(),j>0){ce=Kt;return}function e(){b(!Wt),Wt=!0,n.calledRun=!0,!y&&(oe(),r(n),n.onRuntimeInitialized?.(),E(`onRuntimeInitialized`),b(!n._main,`compiled without a main, but one is present. if you added it from JS, use Module["onRuntimeInitialized"]`),se())}n.setStatus?(n.setStatus(`Running...`),setTimeout(()=>{setTimeout(()=>n.setStatus(``),1),e()},1)):e(),te()}function qt(){if(n.preInit)for(typeof n.preInit==`function`&&(n.preInit=[n.preInit]);n.preInit.length>0;)n.preInit.shift()();E(`preInit`)}qt(),Kt(),t=a;for(let t of Object.keys(n))t in e||Object.defineProperty(e,t,{configurable:!0,get(){P(`Access to module property ('${t}') is no longer possible via the module constructor argument; Instead, use the result of the module constructor.`)}});return t}),xo=`/assets/creator-ui-DBh5lzcv.wasm`,So=class{id;type;jsNode;parent=null;children=[];style={};layoutRect=null;measured;scrollOffset=0;sourceRect;name;value=``;wrapCache;constructor(e,t,n){this.id=e,this.type=t,this.jsNode=n,this.measured=t===`text`||t===`image`,typeof n?.name==`string`&&n.name.length>0&&(this.name=n.name),t===`image`&&Array.isArray(n?._sourceRect)&&(this.sourceRect=n._sourceRect.slice())}get text(){return this.type===`text`?this.jsNode?._text??this.jsNode?.text??``:void 0}get imageSrcRaw(){return this.type===`image`?this.jsNode?._src??this.jsNode?.src:void 0}get scrollable(){return this.type===`scrollable`||this.type===`vlist`||this.jsNode?.scrollable===!0}get editable(){return this.type===`input`||this.type===`textarea`}get scrollAxis(){return this.style.scrollAxis===`x`?`x`:`y`}get interactive(){let e=this.jsNode;return e?typeof e._emitClick==`function`||typeof e._emitTouchStart==`function`||Array.isArray(e.touchStartListeners)&&e.touchStartListeners.length>0:!1}};function Co(e){return typeof e==`object`&&!!e&&`svg`in e}function wo(e){return typeof e==`object`&&!!e&&`_id`in e}function To(e){return typeof e==`object`&&!!e&&`canvasSurface`in e}var Eo=`lecodes-canvas://`;function Do(e){return e.startsWith(`lecodes-canvas://`)?Number(e.slice(17)):void 0}function Oo(e){return typeof File<`u`&&e instanceof File}function ko(e){let t=e.trim();/\sxmlns\s*=/.test(t)||(t=t.replace(/<svg\b/,`<svg xmlns="http://www.w3.org/2000/svg"`));let n=new TextEncoder().encode(t),r=``;for(let e of n)r+=String.fromCharCode(e);return`data:image/svg+xml;base64,${btoa(r)}`}function Ao(e){return!!e&&(e.startsWith(`data:image/svg+xml`)||/\.svg(\?|#|$)/i.test(e))}function jo(e){let t=e.match(/<svg\b[^>]*>/i)?.[0]??``,n=t.match(/viewBox\s*=\s*["']\s*[\d.+-]+\s+[\d.+-]+\s+([\d.+-]+)\s+([\d.+-]+)\s*["']/i);if(n){let e=parseFloat(n[1]),t=parseFloat(n[2]);if(e>0&&t>0)return{width:e,height:t}}let r=parseFloat(t.match(/\bwidth\s*=\s*["']?([\d.]+)/i)?.[1]??``),i=parseFloat(t.match(/\bheight\s*=\s*["']?([\d.]+)/i)?.[1]??``);return r>0&&i>0?{width:r,height:i}:null}function Mo(e){let t=/^data:image\/svg\+xml(;[^,]*)?,([\s\S]*)$/.exec(e);if(!t)return null;let n=t[2];try{if(/;base64/i.test(t[1]??``)){let e=atob(n),t=new Uint8Array(e.length);for(let n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return new TextDecoder().decode(t)}return decodeURIComponent(n)}catch{return null}}async function No(e,t){if(!Ao(e))return null;let n=Mo(e);if(n)return jo(n);if(!t)return null;let r=await t(e).catch(()=>null);return r?jo(r):null}function Po(e={}){let t=new WeakMap;return n=>{if(n==null)return;if(typeof n==`string`)return n;if(typeof n!=`object`)return;let r=n,i=t.get(r);if(i!==void 0)return i;let a;return Co(r)?a=ko(r.svg):To(r)?a=Eo+r.canvasSurface:wo(r)?a=e.assetUrl?.(r._id):Oo(r)&&(a=e.fileUrl?.(r)),a!==void 0&&t.set(r,a),a}}var Fo={color:255,fontSize:14,fontFamily:`Inter`,fontWeight:400,fontStyle:`normal`,letterSpacing:0,textAlign:`start`,textDecoration:`none`};function Io(e){let t,n,r,i,a,o,s,c,l;for(let u=e;u;u=u.parent){let e=u.style;t??=e.color,n??=e.fontSize,r??=e.fontFamily,i??=e.fontWeight,a??=e.fontStyle,o??=e.lineHeight,s??=e.letterSpacing,c??=e.textAlign,l??=e.textDecoration}let u=n??Fo.fontSize;return{color:t??Fo.color,fontSize:u,fontFamily:r??Fo.fontFamily,fontWeight:i??Fo.fontWeight,fontStyle:a??Fo.fontStyle,lineHeight:o??u*1.2,letterSpacing:s??Fo.letterSpacing,textAlign:c??Fo.textAlign,textDecoration:l??Fo.textDecoration}}function Lo(e){return{family:e.fontFamily,size:e.fontSize,weight:e.fontWeight,italic:e.fontStyle===`italic`,letterSpacing:e.letterSpacing}}function Ro(e,t,n){let r=[],i=0;for(let a of e.split(`
|
|
2
|
+
`)){if(a.length===0){r.push(``);continue}let e=a;for(;e;){if(n(e)<=t){r.push(e),i=Math.max(i,n(e));break}let a=0,o=-1,s=0;for(;(s=e.indexOf(` `,s+1))!==-1&&!(n(e.substring(0,s))>t);)o=s;if(o>0)a=o;else{let r=e.indexOf(` `);r===-1&&(r=e.length);let i=e.substring(0,r);if(n(i)>t){for(let e=1;e<=i.length;e++)if(n(i.substring(0,e))>t){a=e-1;break}}else for(let i=r+1;i<=e.length;i++)if(n(e.substring(0,i))>t){a=i-1;break}}a<=0&&(a=1);let c=e.substring(0,a);r.push(c),i=Math.max(i,n(c)),e=e.substring(a+ +(o>0))}}return{lines:r,maxWidth:i}}function zo(e,t,n){let r=Io(e),i=Lo(r),a=isNaN(n)?1/0:n,o=Ro(e.text??``,a,e=>t.measureText(e,i));return{width:Math.ceil(o.maxWidth),height:Math.ceil(o.lines.length*r.lineHeight)}}function Bo(e,t,n,r){let i=e.imageSrcRaw,a=0,o=0,s=!1;if(e.sourceRect)a=e.sourceRect[2],o=e.sourceRect[3];else if(Co(i)){s=!0;let e=jo(i.svg);if(e)a=e.width,o=e.height;else{let e=t.getImage(t.resolveSrc(i)??``);a=e?.naturalWidth??0,o=e?.naturalHeight??0}}else{let e=t.resolveSrc(i),n=e?t.getImage(e):void 0;a=n?.naturalWidth??0,o=n?.naturalHeight??0,s=Ao(e)}if(a===0||o===0)return{width:0,height:0};let c=Math.min(n/a,r/o),l=isNaN(n)&&isNaN(r)?1:isNaN(n)?r/o:isNaN(r)?n/a:s?c:Math.min(c,1);return{width:a*l,height:o*l}}function Vo(e,t){return Ho(e,t.rootRect.x,t.rootRect.y,!0,t)}function Ho(e,t,n,r,i){if(e.style.display===`none`)return null;let a,o,s,c;if(r)a=i.rootRect.x,o=i.rootRect.y,s=i.rootRect.width,c=i.rootRect.height;else{let r=e.layoutRect;if(!r)return null;a=t+r.x,o=n+r.y,s=r.width,c=r.height}let l={x:a,y:o,width:s,height:c},u={id:e.id,type:e.type,rect:l,style:e.style,children:[]};if(e.name&&(u.name=e.name),e.type===`text`){let t=Io(e),n=Lo(t),r=e.text??``;u.text=r;let a=i.layout.getPadding(e.id);(a[0]||a[1]||a[2]||a[3])&&(u.padding=a);let o=s-a[0]-a[2],c=`${o}|${n.size}|${n.weight}|${+!!n.italic}|${n.letterSpacing}|${n.family}|${r}`;if(e.wrapCache?.key===c)u.lines=e.wrapCache.lines;else{let t=Ro(r,o,e=>i.host.measureText(e,n)).lines;e.wrapCache={key:c,lines:t},u.lines=t}u.style={...e.style,color:t.color,fontSize:t.fontSize,fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontStyle:t.fontStyle,lineHeight:t.lineHeight,letterSpacing:t.letterSpacing,textAlign:t.textAlign,textDecoration:t.textDecoration}}else if(e.type===`image`){let t=i.host.resolveSrc(e.imageSrcRaw);u.image=(t?i.host.getImage(t):void 0)??(t?{src:t,naturalWidth:0,naturalHeight:0}:void 0),e.sourceRect&&(u.sourceRect=e.sourceRect)}else if(e.editable){u.value=e.value;let t=i.layout.getPadding(e.id);(t[0]||t[1]||t[2]||t[3])&&(u.padding=t);let n=Io(e);u.style={...e.style,color:n.color,fontSize:n.fontSize,fontFamily:n.fontFamily,fontWeight:n.fontWeight,fontStyle:n.fontStyle,lineHeight:n.lineHeight,letterSpacing:n.letterSpacing,textAlign:n.textAlign,textDecoration:n.textDecoration}}e.interactive&&(u.state={pressed:i.isPressed(e)}),e.editable&&i.isFocused(e)&&(u.state={...u.state,focused:!0});let d=e.jsNode?._classes;d&&d.size>0&&(u.state={...u.state,classes:[...d]}),e.style.overflow===`hidden`&&(u.clip=!0);let f=a,p=o;if(e.scrollable){let t=e.scrollAxis,n=t===`x`?i.layout.getContentWidth(e.id):i.layout.getContentHeight(e.id);u.clip=!0,u.scroll={offset:e.scrollOffset,content:n,axis:t},t===`x`?f=a-e.scrollOffset:p=o-e.scrollOffset}for(let t of e.children){let e=Ho(t,f,p,!1,i);e&&u.children.push(e)}return u}var Uo=256,Wo=new Set([`duration`,`delay`,`layer`,`commit`]);function Go(e,t,n,r,i=Uo,a){if(r===null){e.setStyle(t,n,null,i);return}let o=typeof r;if(o===`number`||o===`string`||o===`boolean`){e.setStyle(t,n,r,i);return}if(o!==`object`)return;let s=r;if(`_id`in s||`svg`in s||Ko(s)){let r=a?.(s);r!=null&&e.setStyle(t,n,r,i);return}let c=e.getLayer(t,n);for(let n of Object.keys(s))Wo.has(n)||Go(e,t,n,s[n],c,a)}function Ko(e){return typeof File<`u`&&e instanceof File}function qo(e,t,n,r,i){let a=e.jsNode?.ll;if(!a||a.length===0)return;let o={left:t,top:n,width:r,height:i};for(let e of a)e(o)}function Jo(e,t,n){switch(t){case`screen`:e.setStyle(n,`color`,`#ffffffff`);break;case`row`:e.setStyle(n,`flexDirection`,`row`);break;case`box`:case`button`:e.setStyle(n,`justifyContent`,`center`),e.setStyle(n,`alignItems`,`center`);break;case`spacer`:e.setStyle(n,`flexGrow`,1);break;case`widget`:e.setStyle(n,`position`,`absolute`);break;case`vlist`:e.setStyle(n,`flexDirection`,`column`);break}}var Yo=class{screenId;isWidget;jsNode;root;layout;registry;resolveSrc;width=0;height=0;dirty=!1;cachedTree=null;firedScreenW=-1;firedScreenH=-1;constructor(e,t,n,r,i=!1,a=e=>typeof e==`string`?e:void 0){this.screenId=e,this.jsNode=t,this.layout=n,this.registry=r,this.isWidget=i,this.resolveSrc=a}mount(){this.root=this.addNode(this.jsNode,null,0)}addNode(e,t,n){let r=e.type,i=r===`text`||r===`image`,a=t===null?this.layout.createRoot(this.screenId):this.layout.createChild(t.id,n,i),o=new So(a,r,e);o.parent=t,e._id=a,this.registry.register(o),Jo(this.layout,r,a);let s=e._style??{};for(let e of Object.keys(s))this.setStyleValue(a,e,s[e]);if(e._classes)for(let t of e._classes)this.layout.enableNodeLayer(a,this.layout.getLayer(a,`$`+t));let c=e.children;if(Array.isArray(c)){let e=0;for(let t of c)t&&(o.children.push(this.addNode(t,o,e)),e++)}return this.registry.onNodeAdded?.(o),o}setStyleValue(e,t,n){Go(this.layout,e,t,n,void 0,this.resolveSrc)}applyLayout(e,t){e===this.width&&t===this.height&&!this.dirty||(this.width=e,this.height=t,this.dirty=!1,this.layout.calculate(this.root.id,e,t,this.isWidget),this.captureLayout(this.root),this.cachedTree=null)}captureLayout(e){if(e===this.root&&!this.isWidget)(this.width!==this.firedScreenW||this.height!==this.firedScreenH)&&(this.firedScreenW=this.width,this.firedScreenH=this.height,qo(e,0,0,this.width,this.height));else{let t=this.layout.getLayout(e.id);t&&(e.layoutRect=t,qo(e,t.x,t.y,t.width,t.height))}for(let t of e.children)this.captureLayout(t)}markDirty(){this.dirty=!0,this.cachedTree=null}isDirty(){return this.dirty||this.cachedTree===null}deactivate(){this.width=0,this.height=0,this.firedScreenW=-1,this.firedScreenH=-1,this.dirty=!1,this.cachedTree=null}renderTree(e,t,n=()=>!1){if(this.dirty&&this.width>0&&(this.dirty=!1,this.layout.calculate(this.root.id,this.width,this.height,this.isWidget),this.captureLayout(this.root),this.cachedTree=null),this.cachedTree)return this.cachedTree;let r=this.isWidget?this.root.layoutRect??{x:0,y:0,width:0,height:0}:{x:0,y:0,width:this.width,height:this.height};return this.cachedTree=Vo(this.root,{layout:this.layout,host:e,rootRect:r,isPressed:t,isFocused:n}),this.cachedTree}insertNode(e,t,n){let r=this.registry.get(e);if(!r)return;let i=this.addNode(n,r,t);r.children.splice(t,0,i),this.dirty=!0}removeNode(e,t){let n=this.registry.get(e);if(!n)return;let r=t._id,i=n.children.findIndex(e=>e.id===r);i>=0&&n.children.splice(i,1),this.layout.removeChild(e,r),this.releaseRecursive(t),this.dirty=!0}setContent(e,t,n){let r=this.registry.get(e);if(!r)return;for(let n of t){if(!n)continue;let t=n._id;this.layout.removeChild(e,t),this.releaseRecursive(n)}r.children.length=0;let i=0;for(let e of n)e&&(r.children.push(this.addNode(e,r,i)),i++);this.dirty=!0}releaseRecursive(e){e._id&&this.registry.unregister(e._id),e._id=0;let t=e.children;if(Array.isArray(t))for(let e of t)e&&this.releaseRecursive(e)}destroy(){this.releaseRecursive(this.jsNode),this.layout.freeTree(this.root.id,this.isWidget)}},Xo=class{onScreen;free;show=!1;stack=[];constructor(e,t){this.onScreen=e,this.free=t}init(e){this.stack=[e],this.onScreen(e),this.show=!0}push(e){this.stack.push(e),this.onScreen(e)}replace(e){let t=this.stack[this.stack.length-1];this.stack[this.stack.length-1]=e,this.onScreen(e),t&&this.free(t)}hide(){this.show=!1}pop(e){let t=e<0?Math.max(this.stack.length-1+e,0):Math.min(e,this.stack.length-1),n=this.stack.slice(t+1);this.stack.length=t+1,this.onScreen(this.stack[t]);for(let e of n)this.free(e)}restore(){this.show=!0,this.onScreen(this.stack[this.stack.length-1])}get current(){return this.stack[this.stack.length-1]}},Zo=class{host;vlists=new Map;constructor(e){this.host=e}remove(e){this.vlists.delete(e)}initVlist(e){let t={node:e,keys:[],items:new Map,endLatched:!1,startLatched:!1,invertedInitial:!!e.jsNode?._inverted};this.vlists.set(e.id,t);let n=e.jsNode?._keys??[];n.length&&this.vlistSetKeys(e.jsNode,n,e.jsNode?._estimates??[])}settle(e){for(let[t,n]of this.vlists){if(!n.invertedInitial||this.host.getScreenOf(t)!==e)continue;let r=this.host.getNode(t);r&&this.scrollVlistToEnd(r),n.invertedInitial=!1}}checkEdges(e,t,n){let r=this.vlists.get(e.id),i=e.jsNode;if(!(!r||!i)){if(Array.isArray(i.erl)&&i.erl.length){let e=n-t<=(i._endThreshold??0);if(e&&!r.endLatched){r.endLatched=!0;for(let e of i.erl)e()}else e||(r.endLatched=!1)}if(Array.isArray(i.strl)&&i.strl.length){let e=t<=(i._startThreshold??0);if(e&&!r.startLatched){r.startLatched=!0;for(let e of i.strl)e()}else e||(r.startLatched=!1)}}}vlistChildIndex(e,t){let n=e.keys.indexOf(t),r=0;for(let t of e.items.keys())e.keys.indexOf(t)<n&&r++;return r}unmountVlistItem(e,t,n){let r=e.items.get(n);r!==void 0&&(this.host.getScreenOf(t)?.removeNode(t,r),e.items.delete(n))}vlistMount(e,t,n){let r=this.vlists.get(e._id);if(!r||n==null)return;let i=this.host.getScreenOf(e._id);i?.insertNode(e._id,this.vlistChildIndex(r,t),n),this.host.preloadNew(n,i),r.items.set(t,n)}vlistSetKeys(e,t,n){let r=this.vlists.get(e._id);if(!r)return;let i=[...r.keys];for(let t of i)this.unmountVlistItem(r,e._id,t);r.keys=[...t],e._syncWindow?.(i,t)}vlistInsertKeys(e,t,n,r){let i=this.vlists.get(e._id);if(!i)return;let a=this.host.getNode(e._id),o=t<0||t>=i.keys.length,s=o?i.keys.length:Math.max(0,t),c=a?this.host.isAtScrollEnd(a):!1;i.keys.splice(s,0,...n),s===0&&a&&r&&r.length&&(a.scrollOffset+=r.reduce((e,t)=>e+(t||0),0)),e._syncWindow?.([],n),o&&a&&e._inverted&&c&&this.scrollVlistToEnd(a)}vlistRemoveKeys(e,t){let n=this.vlists.get(e._id);if(!n)return;let r=t.filter(e=>n.items.has(e));for(let r of t){this.unmountVlistItem(n,e._id,r);let t=n.keys.indexOf(r);t>=0&&n.keys.splice(t,1)}r.length&&e._syncWindow?.(r,[])}vlistInvalidate(e,t){let n=this.vlists.get(e._id);!n||!n.keys.includes(t)||(this.unmountVlistItem(n,e._id,t),e._syncWindow?.([t],[t]))}command(e,t,...n){let r=this.host.getNode(e._id);if(r){if(t===`scrollTo`)this.host.scrollBy(r.id,(n[0]??0)-r.scrollOffset);else if(t===`scrollToEnd`)this.scrollVlistToEnd(r);else if(t===`scrollToKey`){let e=this.vlists.get(r.id)?.items.get(n[0]),t=e?this.host.getNode(e._id):void 0;t?.layoutRect&&this.host.scrollBy(r.id,t.layoutRect.y-r.scrollOffset)}}}scrollVlistToEnd(e){this.host.getScreenOf(e.id)?.applyLayout(this.host.viewport().width,this.host.layoutHeight()),this.host.scrollBy(e.id,2**53-1)}},Qo=[`opacity`,`backgroundColor`,`color`,`tintColor`,`overlayColor`,`transform`],$o=new Set([`backgroundColor`,`color`,`tintColor`,`overlayColor`]),es=[1,0,0,1,0,0];function ts(e){return e<.5?4*e*e*e:1-(-2*e+2)**3/2}function ns(e,t){return Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((e,n)=>e===t[n]):e===t}var rs=(e,t,n)=>e+(t-e)*n;function is(e,t,n){let r=(e,t)=>e>>>t&255,i=Math.round(rs(r(e,24),r(t,24),n)),a=Math.round(rs(r(e,16),r(t,16),n)),o=Math.round(rs(r(e,8),r(t,8),n)),s=Math.round(rs(r(e,0),r(t,0),n));return(i<<24|a<<16|o<<8|s)>>>0}function as(e,t,n,r){return e===`transform`?t.map((e,t)=>rs(e,n[t],r)):$o.has(e)?is(t,n,r):rs(t,n,r)}function os(e,t,n){return e===`opacity`?{from:t??1,to:n??1}:e===`transform`?{from:t??es,to:n??es}:t===void 0||n===void 0?null:{from:t,to:n}}function ss(e){let t=e>>>0;return{r:t>>>24&255,g:t>>>16&255,b:t>>>8&255,a:t&255}}function cs(e){return`#`+(e>>>0).toString(16).padStart(8,`0`)}function ls(e){let{r:t,g:n,b:r,a:i}=ss(e);return`rgba(${t}, ${n}, ${r}, ${(i/255).toFixed(4)})`}function us(e){return e===void 0||(e>>>0&255)==0}var ds=class{host;tweens=[];constructor(e){this.host=e}hasActive(){return this.tweens.length>0}animateTo(e,t){let n=this.host.getNode(e);if(!n)return;let r=this.snapshot(n);this.applyAuthoring(e,t);let i=this.snapshot(n);this.startTween(e,r,i,t?.duration,t?.delay)}animateFrom(e,t){let n=this.host.getNode(e);if(!n)return;let r=this.snapshot(n);this.applyAuthoring(e,t);let i=this.snapshot(n);this.applyResolved(e,r),this.startTween(e,i,r,t?.duration,t?.delay)}tick(e){if(this.tweens.length===0)return;let t=new Set;for(let n of this.tweens){n.elapsed+=e;let r=this.host.getNode(n.nodeId);if(r){this.applyTweenFrame(n,r);let e=this.host.getScreenOf(n.nodeId);e&&t.add(e)}}this.tweens=this.tweens.filter(e=>e.elapsed<e.delay+e.duration&&this.host.getNode(e.nodeId)!==void 0);for(let e of t)e.markDirty()}snapshot(e){let t={};for(let n of Qo){let r=e.style[n];t[n]=Array.isArray(r)?[...r]:r}return t}applyAuthoring(e,t){if(!t)return;let n=!1;for(let r of Object.keys(t))r===`duration`||r===`delay`||r===`layer`||r===`commit`||(Go(this.host.layout,e,r,t[r],void 0,this.host.resolveSrc),this.host.isMeasureAffecting(r)&&(n=!0));(this.host.getNode(e)?.measured||n)&&this.host.layout.markDirty(e),this.host.getScreenOf(e)?.markDirty()}applyResolved(e,t){for(let n of Qo){let r=t[n];r===void 0?this.host.layout.setStyle(e,n,null):n===`opacity`?this.host.layout.setStyle(e,n,r):n===`transform`?this.host.layout.setStyle(e,n,`matrix(${r.join(`,`)})`):this.host.layout.setStyle(e,n,cs(r))}this.host.getScreenOf(e)?.markDirty()}startTween(e,t,n,r=225,i=0){let a=[];for(let e of Qo){let r=os(e,t[e],n[e]);!r||ns(r.from,r.to)||a.push({key:e,from:r.from,to:r.to})}if(a.length===0)return;let o=new Set(a.map(e=>e.key));for(let t of this.tweens)t.nodeId===e&&(t.props=t.props.filter(e=>!o.has(e.key)));this.tweens=this.tweens.filter(e=>e.props.length>0);let s={nodeId:e,props:a,elapsed:0,duration:Math.max(1,r),delay:Math.max(0,i)};this.tweens.push(s);let c=this.host.getNode(e);c&&this.applyTweenFrame(s,c),this.host.getScreenOf(e)?.markDirty()}applyTweenFrame(e,t){let n=ts(e.elapsed<=e.delay?0:Math.min(1,(e.elapsed-e.delay)/e.duration));for(let r of e.props)t.style[r.key]=as(r.key,r.from,r.to,n)}},fs=60270,ps=60271,ms=.32,hs=new Set([`fontSize`,`fontFamily`,`fontWeight`,`fontStyle`,`lineHeight`,`letterSpacing`]),gs=class{layout;host;nodesById=new Map;screensById=new Map;currentScreen=null;widgets=[];nextScreenId=0;nextWidgetId=1;pressed=new Set;focusedInput=null;onKeyboard=()=>{};router=new Xo(e=>this.activateScreen(e),e=>this.freeScreen(e));onRouterChange=null;tween;vlist;width=0;height=0;safeArea=null;onResize=()=>{};constructor(e,t){this.layout=e,this.host=t,e.setStyleSink(this),e.setMeasureCallback((e,t,n,r)=>this.measure(t,n,r)),this.tween=new ds({getNode:e=>this.get(e),getScreenOf:e=>this.getScreenOf(e),layout:this.layout,resolveSrc:this.resolveSrc,isMeasureAffecting:e=>hs.has(e)}),this.vlist=new Zo({getNode:e=>this.get(e),getScreenOf:e=>this.getScreenOf(e),preloadNew:(e,t)=>this.preloadNew(e,t),scrollBy:(e,t)=>this.scrollBy(e,t),isAtScrollEnd:(e,t)=>this.isAtScrollEnd(e,t),viewport:()=>({width:this.width,height:this.height}),layoutHeight:()=>this.layoutHeight()})}resolveSrc=e=>this.host.resolveSrc(e);register(e){this.nodesById.set(e.id,e)}unregister(e){this.nodesById.delete(e),this.pressed.delete(e),this.vlist.remove(e),this.focusedInput?.id===e&&(this.focusedInput=null,this.onKeyboard(null))}get(e){return this.nodesById.get(e)}onNodeAdded(e){e.type===`vlist`&&this.vlist.initVlist(e)}getStyle(e,t){return this.nodesById.get(t)?.style}measure(e,t,n){let r=this.nodesById.get(e);return r?r.type===`text`?zo(r,this.host,t):r.type===`image`?Bo(r,this.host,t,n):{width:0,height:0}:{width:0,height:0}}resize(e,t){e<=0||t<=0||(this.width=e,this.height=t,this.applySafePaddings(),this.layout.setConditionValue(e,t),this.relayout(),this.onResize(e,t),this.focusedInput&&this.emitKeyboard())}layoutHeight(){return this.focusedInput?this.height-this.keyboardRect().height:this.height}relayout(){if(this.width<=0||this.height<=0)return;let e=this.layoutHeight();this.currentScreen?.applyLayout(this.width,e);for(let t of this.widgets)t.applyLayout(this.width,e)}safeInsets(){return this.safeArea?this.safeArea:this.width>this.height?[0,8,0,20]:[20,0,8,0]}applySafePaddings(){let[e,t,n,r]=this.safeInsets();this.layout.setSafePaddings(e,t,n,r,this.currentScreen?.root.id);for(let i of this.widgets)this.layout.setSafePaddings(e,t,n,r,i.root.id)}setSafeArea(e){if(this.safeArea=e,!(this.width<=0||this.height<=0)){this.applySafePaddings(),this.currentScreen?.markDirty(),this.currentScreen?.applyLayout(this.width,this.layoutHeight());for(let e of this.widgets)e.markDirty(),e.applyLayout(this.width,this.layoutHeight())}}registerResizeEvent(e){this.onResize=e}registerFont(e,t,n={},r,i){this.host.loadFont(e,t,n).then(()=>{for(let e of this.nodesById.values())e.wrapCache=void 0;this.currentScreen?.markDirty();for(let e of this.widgets)e.markDirty();r?.()}).catch(()=>i?.())}openScreen(e){this.router.show?this.routerHide():this.currentScreen&&this.closeScreen();let t=new Yo(this.nextScreenId++,e,this.layout,this,!1,this.resolveSrc);this.screensById.set(t.screenId,t),t.mount(),this.currentScreen=t,t.applyLayout(this.width,this.layoutHeight()),this.preloadImages(t),this.vlist.settle(t);for(let t of e.ol??[])t();return t}closeScreen(){let e=this.currentScreen;if(e){for(let t of e.jsNode.cl??[])t();e.destroy(),this.screensById.delete(e.screenId),this.currentScreen=null}}newScreen(e){let t=new Yo(this.nextScreenId++,e,this.layout,this,!1,this.resolveSrc);return this.screensById.set(t.screenId,t),t.mount(),t}activateScreen(e){let t=this.currentScreen;if(t){for(let e of t.jsNode.cl??[])e();t.deactivate()}this.currentScreen=e,e.applyLayout(this.width,this.layoutHeight()),this.preloadImages(e),this.vlist.settle(e),this.onRouterChange?.(e.jsNode);for(let t of e.jsNode.ol??[])t();this.focusedInput&&this.blurInput()}freeScreen(e){this.currentScreen===e&&(this.currentScreen=null),e.destroy(),this.screensById.delete(e.screenId)}routerOpen(e,t){if(this.currentScreen){if(!this.router.stack.includes(this.currentScreen)){for(let e of this.currentScreen.jsNode.cl??[])e();this.currentScreen.destroy(),this.screensById.delete(this.currentScreen.screenId)}this.currentScreen=null}for(let e of this.router.stack)e.destroy(),this.screensById.delete(e.screenId);this.router.stack=[],this.onRouterChange=t??null,this.router.init(this.newScreen(e))}routerPush(e){this.router.push(this.newScreen(e))}routerReplace(e){this.router.replace(this.newScreen(e))}routerPop(e){this.router.pop(e)}routerHide(){if(this.router.hide(),this.currentScreen&&this.router.stack.includes(this.currentScreen)){for(let e of this.currentScreen.jsNode.cl??[])e();this.currentScreen.deactivate(),this.currentScreen=null}}routerRestore(){this.router.restore()}showWidget(e){if(this.widgets.some(t=>t.jsNode===e))return;let t=-this.nextWidgetId++,n=new Yo(t,e,this.layout,this,!0,this.resolveSrc);this.screensById.set(t,n),n.mount(),n.applyLayout(this.width,this.layoutHeight()),this.widgets.push(n),this.preloadImages(n),this.vlist.settle(n);for(let t of e.ol??[])t()}hideWidget(e){if(!e._id)return;let t=this.layout.getScreenId(e._id);if(t>=0)return;let n=this.screensById.get(t);if(n){for(let e of n.jsNode.cl??[])e();n.destroy(),this.screensById.delete(t),this.widgets=this.widgets.filter(e=>e!==n)}}getScreenOf(e){return this.screensById.get(this.layout.getScreenId(e))}preloadSubtree(e,t){let n=e=>{if(e.type===`image`){let n=this.resolveSrc(e.imageSrcRaw);n&&!this.host.getImage(n)&&this.host.loadImage(n).then(()=>{this.layout.markDirty(e.id),t.markDirty()}).catch(()=>{})}let r=e.style.backgroundImage;r&&!this.host.getImage(r)&&this.host.loadImage(r).then(()=>t.markDirty()).catch(()=>{});for(let t of e.children)n(t)};n(e)}preloadImages(e){this.preloadSubtree(e.root,e)}preloadNew(e,t){if(!t)return;let n=e?._id?this.nodesById.get(e._id):void 0;n&&this.preloadSubtree(n,t)}insertNode(e,t,n){let r=this.getScreenOf(t);r?.insertNode(t,e,n),this.preloadNew(n,r)}removeNode(e,t){this.getScreenOf(e)?.removeNode(e,t)}setContent(e,t,n){let r=this.getScreenOf(e);r?.setContent(e,t,n);for(let e of n)e&&this.preloadNew(e,r)}updateStyle(e,t,n){Go(this.layout,e,t,n,void 0,this.resolveSrc),(this.nodesById.get(e)?.measured||hs.has(t))&&this.layout.markDirty(e),this.getScreenOf(e)?.markDirty()}mergeStyle(e,t){let n=!1;for(let r of Object.keys(t))Go(this.layout,e,r,t[r],void 0,this.resolveSrc),hs.has(r)&&(n=!0);(this.nodesById.get(e)?.measured||n)&&this.layout.markDirty(e),this.getScreenOf(e)?.markDirty()}updateNode(e,t,n){let r=this.nodesById.get(e);if(r){if(t===`value`)r.value=typeof n==`string`?n:String(n??``),this.getScreenOf(e)?.markDirty(),this.focusedInput===r&&this.emitKeyboard();else if(t===`text`)this.layout.markDirty(e),this.getScreenOf(e)?.markDirty();else if(t===`src`){let t=this.resolveSrc(n??r.imageSrcRaw),i=this.getScreenOf(e);t&&!this.host.getImage(t)&&this.host.loadImage(t).then(()=>{this.layout.markDirty(e),i?.markDirty()}).catch(()=>{}),this.layout.markDirty(e),i?.markDirty()}}}setSourceRect(e,t,n,r,i){let a=this.nodesById.get(e);a&&(a.sourceRect=[t,n,r,i],this.layout.markDirty(e),this.getScreenOf(e)?.markDirty())}getTextValue(e){return this.nodesById.get(e)?.value??``}focusInput(e){let t=this.nodesById.get(e);if(!(!t||!t.editable||this.focusedInput===t)){this.focusedInput&&this.unfocus(),this.focusedInput=t,this.toggleLayer(e,ps,!0,t.jsNode?._style?.onFocused);for(let e of t.jsNode?.fl??[])e();this.relayout(),this.emitKeyboard()}}blurInput(){this.focusedInput&&(this.unfocus(),this.relayout(),this.emitKeyboard())}unfocus(){let e=this.focusedInput;if(e){this.toggleLayer(e.id,ps,!1,e.jsNode?._style?.onFocused);for(let t of e.jsNode?.bl??[])t();this.focusedInput=null}}setInputValue(e,t){let n=this.nodesById.get(e);if(n){n.value=t;for(let e of n.jsNode?.cl??[])e(t);this.getScreenOf(e)?.markDirty()}}keyboard(){let e=this.focusedInput;return e?{rect:this.keyboardRect(),input:{nodeId:e.id,rect:this.findRect(e.id)??{x:0,y:0,width:0,height:0},value:e.value,type:e.style.inputType??`text`}}:null}uiTransform(){return null}registerKeyboardEvent(e){this.onKeyboard=e}keyboardRect(){let e=Math.round(this.height*ms);return{x:0,y:this.height-e,width:this.width,height:e}}emitKeyboard(){this.onKeyboard(this.keyboard())}findRect(e){let t=n=>{if(!n)return null;if(n.id===e)return n.rect;for(let e of n.children){let n=t(e);if(n)return n}return null},n=t(this.renderTree());if(n)return n;for(let e of this.widgetTrees()){let n=t(e);if(n)return n}return null}isButtonPressed(e){return this.pressed.has(e)}isPressed=e=>this.pressed.has(e.id);isFocused=e=>this.focusedInput===e;renderTree(){return this.currentScreen?this.currentScreen.renderTree(this.host,this.isPressed,this.isFocused):null}needsPaint(){if(this.tween.hasActive()||this.currentScreen?.isDirty())return!0;for(let e of this.widgets)if(e.isDirty())return!0;return!1}frame(){let e=[],t=this.renderTree();t&&e.push({tree:t});for(let t of this.widgets){let n=t.renderTree(this.host,this.isPressed,this.isFocused),r=n.style.overlayColor;e.push({tree:n,widget:!0,backdrop:r===void 0?void 0:{color:r,jsNode:t.jsNode}})}return e}widgetTrees(){return this.widgets.map(e=>e.renderTree(this.host,this.isPressed,this.isFocused))}findAllByName(e){let t=[],n=r=>{r.name===e&&t.push(r);for(let e of r.children)n(e)},r=this.renderTree();r&&n(r);for(let e of this.widgetTrees())n(e);return t}findByName(e){return this.findAllByName(e)[0]??null}animateTo(e,t){this.tween.animateTo(e,t)}animateFrom(e,t){this.tween.animateFrom(e,t)}tick(e){this.tween.tick(e)}hasActiveAnimations(){return this.tween.hasActive()}vlistMount(e,t,n){this.vlist.vlistMount(e,t,n)}vlistSetKeys(e,t,n){this.vlist.vlistSetKeys(e,t,n)}vlistInsertKeys(e,t,n,r){this.vlist.vlistInsertKeys(e,t,n,r)}vlistRemoveKeys(e,t){this.vlist.vlistRemoveKeys(e,t)}vlistInvalidate(e,t){this.vlist.vlistInvalidate(e,t)}command(e,t,...n){this.vlist.command(e,t,...n)}scrollViewport(e){let t=e===this.currentScreen?.root;return e.scrollAxis===`x`?t?this.width:e.layoutRect?.width??0:t?this.height:e.layoutRect?.height??0}scrollMax(e){let t=e.scrollAxis===`x`?this.layout.getContentWidth(e.id):this.layout.getContentHeight(e.id);return Math.max(0,t-this.scrollViewport(e))}isAtScrollEnd(e,t=1){return e.scrollOffset>=this.scrollMax(e)-t}scrollBy(e,t){let n=this.nodesById.get(e);if(!n||!n.scrollable)return!1;let r=this.scrollMax(n),i=n.scrollOffset+t,a=Math.min(r,Math.max(0,i)),o=i<0?i:i>r?i-r:0;if(o!==0){let e=n.jsNode?.osl;if(Array.isArray(e)&&e.length)for(let t of e)t(o)}if(a===n.scrollOffset)return!1;n.scrollOffset=a,this.getScreenOf(e)?.markDirty();let s=n.jsNode?.sl;if(Array.isArray(s))for(let e of s)e(a);return n.type===`vlist`&&this.vlist.checkEdges(n,a,r),!0}toggleLayer(e,t,n,r){let i=this.nodesById.get(e);if(!i)return;let a=typeof r?.duration==`number`?r.duration:0;if(a<=0){n?this.layout.enableNodeLayer(e,t):this.layout.disableNodeLayer(e,t),this.getScreenOf(e)?.markDirty();return}let o=this.tween.snapshot(i);n?this.layout.enableNodeLayer(e,t):this.layout.disableNodeLayer(e,t);let s=this.tween.snapshot(i);this.tween.startTween(e,o,s,a,typeof r?.delay==`number`?r.delay:0),this.getScreenOf(e)?.markDirty()}setPressed(e,t){t?this.pressed.add(e):this.pressed.delete(e),this.toggleLayer(e,fs,t,this.nodesById.get(e)?.jsNode?._style?.onPressed)}setClass(e,t,n){let r=this.nodesById.get(e);if(!r)return;let i=this.layout.getLayer(e,`$`+t);this.toggleLayer(e,i,n,r.jsNode?._style?.[`$`+t])}hitTestNode(e){return this.nodesById.get(e)}get screen(){return this.currentScreen}get viewport(){return{width:this.width,height:this.height}}},_s=[`farthest-corner`,`closest-side`,`closest-corner`,`farthest-side`],vs=52;function ys(e,t,n,r){let i=[];for(let a=0;a<r;a++)i.push(bs(e,t,n+a*vs));return i}function bs(e,t,n){let r=n>>2,i=e[r],a=t[r+1],o=t[r+2],s=t[r+4],c=[];for(let n=0;n<o;n++){let r=s+n*8>>2;c.push({color:t[r]>>>0,position:e[r+1]})}if(a===1){let n=t[r+6],i={type:`radial`,shape:t[r+5]===1?`circle`:`ellipse`,cx:e[r+7],cy:e[r+8],stops:c};return n===4?{...i,extent:`explicit`,rx:e[r+9],ry:e[r+10],rxUnit:t[r+11]===1?`fraction`:`px`,ryUnit:t[r+12]===1?`fraction`:`px`}:{...i,extent:_s[n]??`farthest-corner`}}return{type:`linear`,angle:i,stops:c}}var xs=[``,`Top`,`Right`,`Bottom`,`Left`],Ss=[`TopLeft`,`TopRight`,`BottomRight`,`BottomLeft`],Cs=e=>e.toLowerCase();function ws(e,t){return e.border??={},e.border[t]??={width:0,color:0}}function Ts(e){return e.borderRadius??={tl:0,tr:0,br:0,bl:0}}function Es(e,t){let n=(t,n)=>{let r=t.length+1,i=e._malloc(r);e.stringToUTF8(t,i,r),n(i),e._free(i)},r=(r,i)=>n(r,n=>{let r=e.addFunction((e,n,r)=>{let a=t.getStyle(e,n);a&&i(a,r>>>0)},`viii`);e._addUIntHandler(n,r)}),i=(r,i)=>n(r,n=>{let r=e.addFunction((e,n,r)=>{let a=t.getStyle(e,n);a&&i(a,r)},`viif`);e._addFloatHandler(n,r)}),a=(r,i)=>n(r,n=>{let r=e.addFunction((n,r,a)=>{let o=t.getStyle(n,r);o&&i(o,e.UTF8ToString(a))},`viii`);e._addStringHandler(n,r)}),o=(r,i)=>n(r,n=>{let r=e.addFunction((e,n)=>{let r=t.getStyle(e,n);r&&i(r)},`vii`);e._addResetHandler(n,r)});r(`color`,(e,t)=>e.color=t),r(`backgroundColor`,(e,t)=>e.backgroundColor=t),r(`tintColor`,(e,t)=>e.tintColor=t),r(`overlayColor`,(e,t)=>e.overlayColor=t),i(`opacity`,(e,t)=>e.opacity=t);for(let e of xs)i(`border${e}Width`,(t,n)=>{if(e===``)for(let e of[`top`,`right`,`bottom`,`left`])ws(t,e).width=n;else ws(t,Cs(e)).width=n}),r(`border${e}Color`,(t,n)=>{if(e===``)for(let e of[`top`,`right`,`bottom`,`left`])ws(t,e).color=n;else ws(t,Cs(e)).color=n});i(`borderRadius`,(e,t)=>{e.borderRadius={tl:t,tr:t,br:t,bl:t}});let s={TopLeft:`tl`,TopRight:`tr`,BottomRight:`br`,BottomLeft:`bl`};for(let e of Ss)i(`border${e}Radius`,(t,n)=>{Ts(t)[s[e]]=n});i(`fontSize`,(e,t)=>e.fontSize=t),i(`fontWeight`,(e,t)=>e.fontWeight=t),i(`fontStyle`,(e,t)=>e.fontStyle=t===2?`italic`:`normal`),a(`fontFamily`,(e,t)=>e.fontFamily=t),i(`lineHeight`,(e,t)=>e.lineHeight=t),i(`letterSpacing`,(e,t)=>e.letterSpacing=t),a(`textAlign`,(e,t)=>e.textAlign=Ds(t)),a(`textDecoration`,(e,t)=>e.textDecoration=t),a(`objectFit`,(e,t)=>e.objectFit=t),a(`placeholder`,(e,t)=>e.placeholder=t),r(`placeholderColor`,(e,t)=>e.placeholderColor=t),a(`type`,(e,t)=>e.inputType=t),i(`scrollDirection`,(e,t)=>e.scrollAxis=t===2?`x`:`y`),a(`display`,(e,t)=>e.display=t),a(`overflow`,(e,t)=>e.overflow=t),a(`backgroundImage`,(e,t)=>e.backgroundImage=t),a(`backgroundSize`,(e,t)=>e.backgroundSize=t);let c=e.addFunction((n,r,i,a)=>{let o=t.getStyle(n,r);o&&(o.backgroundGradients=i===0||a===0?void 0:ys(e.HEAPF32,e.HEAPU32,i,a))},`viiii`);e._setGradientsHandler(c);let l=e.addFunction((n,r,i)=>{let a=t.getStyle(n,r);if(!a)return;let o=i>>2,s=e.HEAPF32,c=s[o],l=s[o+1],u=s[o+3],d=s[o+4],f=s[o+6],p=s[o+7];a.transform=c===1&&l===0&&u===0&&d===1&&f===0&&p===0?void 0:[c,l,u,d,f,p]},`viii`);e._setMatrixHandler(l),o(`color`,e=>e.color=void 0),o(`backgroundColor`,e=>e.backgroundColor=void 0),o(`tintColor`,e=>e.tintColor=void 0),o(`overlayColor`,e=>e.overlayColor=void 0),o(`opacity`,e=>e.opacity=void 0);for(let e of xs)o(`border${e}Width`,t=>{if(t.border)if(e===``)for(let e of[`top`,`right`,`bottom`,`left`])t.border[e]&&(t.border[e].width=0);else{let n=t.border[Cs(e)];n&&(n.width=0)}}),o(`border${e}Color`,t=>{if(t.border)if(e===``)for(let e of[`top`,`right`,`bottom`,`left`])t.border[e]&&(t.border[e].color=0);else{let n=t.border[Cs(e)];n&&(n.color=0)}});o(`borderRadius`,e=>e.borderRadius=void 0);for(let e of Ss)o(`border${e}Radius`,t=>{t.borderRadius&&(t.borderRadius[s[e]]=0)});o(`fontSize`,e=>e.fontSize=void 0),o(`fontWeight`,e=>e.fontWeight=void 0),o(`fontStyle`,e=>e.fontStyle=void 0),o(`fontFamily`,e=>e.fontFamily=void 0),o(`lineHeight`,e=>e.lineHeight=void 0),o(`letterSpacing`,e=>e.letterSpacing=void 0),o(`textAlign`,e=>e.textAlign=void 0),o(`textDecoration`,e=>e.textDecoration=void 0),o(`objectFit`,e=>e.objectFit=void 0),o(`placeholder`,e=>e.placeholder=void 0),o(`placeholderColor`,e=>e.placeholderColor=void 0),o(`type`,e=>e.inputType=void 0),o(`scrollDirection`,e=>e.scrollAxis=void 0),o(`overflow`,e=>e.overflow=void 0),o(`backgroundImage`,e=>e.backgroundImage=void 0),o(`backgroundSize`,e=>e.backgroundSize=void 0),o(`backgroundGradient`,e=>e.backgroundGradients=void 0)}function Ds(e){return e===`center`?`center`:e===`end`||e===`right`?`end`:`start`}var Os=`modulepreload`,ks=function(e){return`/`+e},As={},js=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}r=o(t.map(t=>{if(t=ks(t,n),t in As)return;As[t]=!0;let r=t.endsWith(`.css`),i=r?`[rel="stylesheet"]`:``;if(n)for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}else if(document.querySelector(`link[href="${t}"]${i}`))return;let o=document.createElement(`link`);if(o.rel=r?`stylesheet`:Os,r||(o.as=`script`),o.crossOrigin=``,o.href=t,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),r)return new Promise((e,n)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Ms=256,Ns=class e{module;layoutPtr;paddingPtr;keyCache=new Map;packView=new DataView(new ArrayBuffer(8));measureCb=null;constructor(e){this.module=e,this.layoutPtr=e._malloc(16),this.paddingPtr=e._malloc(16)}static async create(){let{loadCreatorUiNode:t}=await js(async()=>{let{loadCreatorUiNode:e}=await import(`./loadCreatorUiNode-ZiTBq5Mt.js`);return{loadCreatorUiNode:e}},[]);return new e(await t())}internKey(e){let t=this.keyCache.get(e);if(t===void 0){let n=e.length+1;t=this.module._malloc(n),this.module.stringToUTF8(e,t,n),this.keyCache.set(e,t)}return t}setStyleSink(e){Es(this.module,e)}setMeasureCallback(e){this.measureCb=e;let t=this.packView,n=this.module.addFunction((e,n,r,i,a,o)=>{let s=this.measureCb?.(e,n,r,a)??{width:0,height:0};return t.setFloat32(4,s.width,!0),t.setFloat32(0,s.height,!0),t.getBigUint64(0,!0)},`jiififi`);this.module._setMeasureFunc(n)}createRoot(e){return this.module._createNodeRoot(e)}createChild(e,t,n){return this.module._createNode(e,t,+!!n)}removeChild(e,t){this.module._removeNode(e,t)}freeTree(e,t){t?this.module._freeWidget(e):this.module._freeNode(e)}setStyle(e,t,n,r=Ms){let i=this.internKey(t);if(n===null)this.module._resetProp(e,i);else if(typeof n==`number`)this.module._setFloatExt(r,e,i,n);else if(typeof n==`boolean`)this.module._setFloatExt(r,e,i,+!!n);else{let t=this.module.lengthBytesUTF8(n)+1,a=this.module._malloc(t);this.module.stringToUTF8(n,a,t),this.module._setStringExt(r,e,i,a),this.module._free(a)}}markDirty(e){this.module._markNodeDirty(e)}getLayer(e,t){return this.module._getLayer(e,this.internKey(t))}enableNodeLayer(e,t){this.module._enableNodeLayer(e,t)}disableNodeLayer(e,t){this.module._disableNodeLayer(e,t)}calculate(e,t,n,r){r?this.module._calculateWidget(e,t,n):this.module._calculate(e,t,n)}getLayout(e){if(!this.module._getLayoutPointer(e,this.layoutPtr))return null;let t=this.layoutPtr>>2,n=this.module.HEAPF32;return{x:n[t],y:n[t+1],width:n[t+2],height:n[t+3]}}getPadding(e){this.module._getPaddingPointer(e,this.paddingPtr);let t=this.paddingPtr>>2,n=this.module.HEAPF32;return[n[t],n[t+1],n[t+2],n[t+3]]}getScreenId(e){return this.module._getScreenId(e)}getContentHeight(e){return this.module._getContentHeight(e)}getContentWidth(e){return this.module._getContentWidth(e)}setConditionValue(e,t){this.module._setConditionValue(e,t)}setSafePaddings(e,t,n,r,i){i===void 0?this.module._setSafePaddings(e,t,n,r):this.module._setSafePaddings(e,t,n,r,i)}};function Ps(e,t){if(!t)return;let n=Do(e);if(n===void 0)return;let r=t.getSurface(n);if(r)return{src:e,naturalWidth:r.width,naturalHeight:r.height,handle:r.canvas}}var Fs=class{factor;images=new Map;canvasSurfaces;constructor(e={}){this.factor=e.charWidthFactor??.5,this.canvasSurfaces=e.canvasSurfaces;for(let[t,n]of Object.entries(e.images??{}))this.images.set(t,{src:t,naturalWidth:n.width,naturalHeight:n.height})}setImageSize(e,t,n){this.images.set(e,{src:e,naturalWidth:t,naturalHeight:n})}measureText(e,t){return e.length===0?0:e.length*(t.size*this.factor+t.letterSpacing)}fontMetrics(e){return{ascent:e.size*.8,descent:e.size*.2}}getImage(e){return Ps(e,this.canvasSurfaces)??this.images.get(e)}loadImage(e){return Promise.resolve(Ps(e,this.canvasSurfaces)??this.images.get(e)??{src:e,naturalWidth:0,naturalHeight:0})}loadFont(){return Promise.resolve()}resolver=Po();resolveSrc(e){return this.resolver(e)}};function Is(e,t,n){let r=e.rect;return t>=r.x&&t<r.x+r.width&&n>=r.y&&n<r.y+r.height}function Ls(e,t,n,r){let i=null,a=e=>{let o=Is(e,t,n);if(o&&r(e)&&(i=e),!(e.clip&&!o))for(let t of e.children)a(t)};return a(e),i}var Rs=4,zs=e=>t=>e.get(t.id)?.interactive??!1,Bs=e=>{if(!e.scroll)return!1;let t=e.scroll.axis===`x`?e.rect.width:e.rect.height;return e.scroll.content>t+.5};function Vs(e,t,n){return e>=n.x&&e<n.x+n.width&&t>=n.y&&t<n.y+n.height}var Hs=class{renderer;tracks=new Map;onTouchStart=null;onTouchEnd=null;creator=null;constructor(e){this.renderer=e}topInteractive(e,t){let n=this.renderer.frame(),r=zs(this.renderer);for(let i=n.length-1;i>=0;i--){let a=Ls(n[i].tree,e,t,r);if(a)return a.id;if(n[i].backdrop)return null}return null}registerTouchStartEvent(e){this.onTouchStart=e}registerTouchEndEvent(e){this.onTouchEnd=e}setCreator(e){this.creator=e}raycast(e,t){return this.creator?._raycastView?.(e,t)??0}toUi(e,t){let n=this.renderer.uiTransform();return n?[(e-n.tx)/n.scale,(t-n.ty)/n.scale]:[e,t]}pointerDown(e,t,n){let[r,i]=this.toUi(t,n),a=this.renderer.frame(),o=zs(this.renderer),s=e=>this.renderer.get(e.id)?.editable??!1;for(let t=a.length-1;t>=0;t--){let n=Ls(a[t].tree,r,i,s);if(n)return this.renderer.focusInput(n.id),this.start(e,r,i,{handler:{},node:null,scrollId:null,backdrop:null});if(a[t].backdrop)break}this.renderer.blurInput();for(let t=a.length-1;t>=0;t--){let n=a[t],s=Ls(n.tree,r,i,o),c=Ls(n.tree,r,i,Bs);if(s){let t=this.renderer.get(s.id).jsNode;this.renderer.setPressed(s.id,!0);let n=t._emitTouchStart?.(e,r,i)??{};return this.start(e,r,i,{handler:n,node:t,scrollId:c?.id??null,backdrop:null})}if(c)return this.start(e,r,i,{handler:{},node:null,scrollId:c.id,backdrop:null});if(n.backdrop){let t=!Vs(r,i,n.tree.rect);return this.start(e,r,i,{handler:{},node:null,scrollId:null,backdrop:t?n.backdrop.jsNode:null})}}let c=this.onTouchStart?.(e,r,i,this.raycast(r,i))??{};this.start(e,r,i,{handler:c,node:null,scrollId:null,backdrop:null})}start(e,t,n,r){this.tracks.set(e,{...r,lastX:t,lastY:n,acc:0,scrolling:!1})}pointerMove(e,t,n){let r=this.tracks.get(e);if(!r)return;let[i,a]=this.toUi(t,n),o=i-r.lastX,s=a-r.lastY;if(r.lastX=i,r.lastY=a,r.acc+=Math.abs(o)+Math.abs(s),!r.scrolling&&r.scrollId!==null&&r.acc>Rs&&(r.scrolling=!0,r.node&&this.renderer.setPressed(r.node._id,!1)),r.scrolling){let e=this.renderer.get(r.scrollId)?.scrollAxis===`x`;this.renderer.scrollBy(r.scrollId,e?-o:-s);return}r.handler.onMove?.({clientX:i,clientY:a,deltaX:o,deltaY:s})}pointerUp(e,t,n){let r=this.tracks.get(e);if(!r)return;let[i,a]=this.toUi(t,n);this.tracks.delete(e);let o=i-r.lastX,s=a-r.lastY;if(r.handler.onEnd?.({clientX:i,clientY:a,deltaX:o,deltaY:s}),r.scrolling&&r.scrollId!==null){let e=this.renderer.get(r.scrollId)?.jsNode?.srl;if(Array.isArray(e))for(let t of e)t()}if(r.node)this.renderer.setPressed(r.node._id,!1),!r.scrolling&&this.topInteractive(i,a)===r.node._id&&r.node._emitClick?.(e,i,a);else if(r.backdrop){if(!r.scrolling)for(let e of r.backdrop.otl??[])e()}else r.scrolling||this.onTouchEnd?.(e,i,a,this.raycast(i,a))}};function Us(e,t){if(!e)return;let n=Math.min(t.width,t.height)/2;return{tl:Math.min(e.tl,n),tr:Math.min(e.tr,n),br:Math.min(e.br,n),bl:Math.min(e.bl,n)}}function Ws(e){return!!e&&(e.tl>0||e.tr>0||e.br>0||e.bl>0)}function Gs(e,t,n,r){let i={x:0,y:0,width:e,height:t};if(r===`fill`||e===0||t===0)return{src:i,dst:n};if(r===`cover`){let r=Math.max(n.width/e,n.height/t),i=n.width/r,a=n.height/r;return{src:{x:(e-i)/2,y:(t-a)/2,width:i,height:a},dst:n}}let a=Math.min(n.width/e,n.height/t),o=e*a,s=t*a;return{src:i,dst:{x:n.x+(n.width-o)/2,y:n.y+(n.height-s)/2,width:o,height:s}}}function Ks(e,t){let n=e*Math.PI/180,r=Math.sin(n),i=-Math.cos(n),a=t.x+t.width/2,o=t.y+t.height/2,s=(Math.abs(t.width*r)+Math.abs(t.height*i))/2;return{x0:a-r*s,y0:o-i*s,x1:a+r*s,y1:o+i*s}}function qs(e,t){let n=t.x+e.cx*t.width,r=t.y+e.cy*t.height;if(e.extent===`explicit`)return{cx:n,cy:r,rx:e.rxUnit===`fraction`?(e.rx??0)*t.width:e.rx??0,ry:e.ryUnit===`fraction`?(e.ry??0)*t.height:e.ry??0};let i=e.cx*t.width,a=(1-e.cx)*t.width,o=e.cy*t.height,s=(1-e.cy)*t.height,c=Math.min(i,a),l=Math.max(i,a),u=Math.min(o,s),d=Math.max(o,s),f,p;if(e.shape===`circle`){let t;switch(e.extent){case`closest-side`:t=Math.min(c,u);break;case`farthest-side`:t=Math.max(l,d);break;case`closest-corner`:t=Math.hypot(c,u);break;default:t=Math.hypot(l,d);break}f=p=t}else switch(e.extent){case`closest-side`:f=c,p=u;break;case`farthest-side`:f=l,p=d;break;case`closest-corner`:f=c*Math.SQRT2,p=u*Math.SQRT2;break;default:f=l*Math.SQRT2,p=d*Math.SQRT2;break}return{cx:n,cy:r,rx:f,ry:p}}function Js(e,t,n,r,i,a){t.beginFrame(r,i),a&&(t.save(),t.translate(a.tx,a.ty),t.scale(a.scale,a.scale));let o=e.filter(e=>e.widget);for(let r of e)r.widget||Ys(r.tree,t,n);for(let e of o)e.backdrop&&t.fillRoundRect({x:0,y:0,width:r,height:i},void 0,e.backdrop.color);for(let e of o)Ys(e.tree,t,n);a&&t.restore(),t.endFrame()}function Ys(e,t,n){let{style:r,rect:i}=e;t.save();let a=r.opacity!==void 0&&r.opacity<1?r.opacity:void 0,o=a!==void 0&&e.children.length>0;if(o?t.beginGroup(a):a!==void 0&&t.setAlpha(a),r.transform){let[e,n,a,o,s,c]=r.transform,l=i.x+i.width/2,u=i.y+i.height/2;t.translate(l,u),t.transform(e,n,a,o,s,c),t.translate(-l,-u)}let s=Us(r.borderRadius,i);if(us(r.backgroundColor)||t.fillRoundRect(i,s,r.backgroundColor),r.backgroundImage){let e=n.getImage(r.backgroundImage);e&&e.naturalWidth>0&&e.naturalHeight>0&&(t.save(),Ws(s)&&t.clipRoundRect(i,s),t.drawImage(e,null,i,{fit:Xs(r.backgroundSize)}),t.restore())}if(r.backgroundGradients)for(let e=r.backgroundGradients.length-1;e>=0;e--){let n=r.backgroundGradients[e];n.stops.length>0&&t.fillGradient(i,s,n)}if(e.image&&e.image.naturalWidth>0&&e.image.naturalHeight>0){let n=e.sourceRect;t.save(),Ws(s)&&t.clipRoundRect(i,s),t.drawImage(e.image,n?{x:n[0],y:n[1],width:n[2],height:n[3]}:null,i,{fit:n?`fill`:r.objectFit??`contain`,tint:Ao(e.image.src)?r.tintColor:void 0,radius:s}),t.restore()}e.type===`text`&&e.lines&&e.lines.length>0&&Qs(e,t,n),(e.type===`input`||e.type===`textarea`)&&ec(e,t,n,s),e.type===`video`&&$s(e,t,n,s),e.clip&&t.clipRoundRect(i,s);for(let r of e.children)Ys(r,t,n);let c=Zs(r.border);c&&t.strokeBorder(i,s,c),o&&t.endGroup(),t.restore()}function Xs(e){return e===`contain`?`contain`:`cover`}function Zs(e){if(!e)return null;let t={},n=!1;for(let r of[`top`,`right`,`bottom`,`left`]){let i=e[r];i&&i.width>0&&(i.color>>>0)%256!=0&&(t[r]=i,n=!0)}return n?t:null}function Qs(e,t,n){let r=e.style,i={family:r.fontFamily??`Inter`,size:r.fontSize??14,weight:r.fontWeight??400,italic:r.fontStyle===`italic`,letterSpacing:r.letterSpacing??0},a=r.color??255,o=r.lineHeight??i.size*1.2,s=r.textAlign??`start`,c=n.fontMetrics(i),{rect:l,lines:u}=e,d=e.padding?.[0]??0,f=e.padding?.[1]??0,p=e.padding?.[2]??0,m=l.x+d,h=l.width-d-p;for(let e=0;e<u.length;e++){let d=u[e],p=l.y+f+e*o+(o-(c.ascent+c.descent))/2+c.ascent,g=n.measureText(d,i),_=s===`center`?m+(h-g)/2:s===`end`?m+h-g:m;if(t.fillText(d,_,p,i,a),r.textDecoration===`underline`||r.textDecoration===`line-through`){let e=Math.max(1,i.size/14),n=r.textDecoration===`underline`?p+e:p-i.size*.3;t.fillRoundRect({x:_,y:n,width:g,height:e},void 0,a)}}}function $s(e,t,n,r){let{rect:i}=e;us(e.style.backgroundColor)&&t.fillRoundRect(i,r,286463999);let a=Math.min(i.width,i.height)*.3;if(a>=6){let e={family:`Inter`,size:a,weight:400,italic:!1,letterSpacing:0},r=n.fontMetrics(e),o=n.measureText(`▶`,e),s=i.x+(i.width-o)/2,c=i.y+(i.height-(r.ascent+r.descent))/2+r.ascent;t.fillText(`▶`,s,c,e,4294967244)}}function ec(e,t,n,r){let i=e.style,a={family:i.fontFamily??`Inter`,size:i.fontSize??14,weight:i.fontWeight??400,italic:i.fontStyle===`italic`,letterSpacing:i.letterSpacing??0},o=e.value??``,s=o.length===0,c=i.inputType===`password`&&!s,l=s?i.placeholder??``:c?`•`.repeat(o.length):o,u=s?i.placeholderColor??2576980479:i.color??255,{rect:d}=e,f=e.padding?.[0]??0,p=e.padding?.[1]??0,m=e.padding?.[2]??0,h=e.padding?.[3]??0,g=d.x+f,_=d.width-f-m,v=d.y+p,y=d.height-p-h,b=n.fontMetrics(a),x=i.lineHeight??a.size*1.2,S=i.textAlign??`start`,C=e.type===`textarea`,w=C?Ro(l,_,e=>n.measureText(e,a)).lines:[l],T=e=>S===`center`?g+(_-e)/2:S===`end`?g+_-e:g,ee=e=>C?v+e*x+(x-(b.ascent+b.descent))/2+b.ascent:v+(y-(b.ascent+b.descent))/2+b.ascent;t.save(),t.clipRoundRect(d,r);for(let e=0;e<w.length;e++){let r=w[e];r.length>0&&t.fillText(r,T(n.measureText(r,a)),ee(e),a,u)}if(e.state?.focused){let e=s?[``]:C?Ro(c?`•`.repeat(o.length):o,_,e=>n.measureText(e,a)).lines:[l],r=e.length-1,u=n.measureText(e[r],a),d=s?T(0):T(u)+u,f=ee(r),p=Math.max(1,a.size/14);t.fillRoundRect({x:d,y:f-b.ascent,width:p,height:b.ascent+b.descent},void 0,i.color??255)}t.restore()}function tc(e,t=[],n={}){let r=n.precision??2,i=n.includeIds??!1,a=e?ic(e,r,i):null;if(t.length===0)return a;let o=t.map(e=>ic(e,r,i));return a?(a.overlays=o,a):{type:`frame`,overlays:o}}function nc(e,t=[],n){return JSON.stringify(tc(e,t,n),null,2)}function rc(e,t){let n=10**t;return Math.round(e*n)/n}function ic(e,t,n){let r=e.rect,i={type:e.type};e.name&&(i.name=e.name),i.rect=[rc(r.x,t),rc(r.y,t),rc(r.width,t),rc(r.height,t)],n&&(i.id=e.id);let a=oc(e.style);return a&&(i.style=a),e.text!==void 0&&(i.text=e.text),e.lines&&(e.lines.length!==1||e.lines[0]!==e.text)&&(i.lines=e.lines),e.image&&(i.image={src:e.image.src,natural:[e.image.naturalWidth,e.image.naturalHeight]}),e.sourceRect&&(i.sourceRect=e.sourceRect),e.state&&(e.state.pressed||e.state.classes?.length)&&(i.state={...e.state.pressed?{pressed:!0}:{},...e.state.classes?.length?{classes:e.state.classes}:{}}),e.scroll&&(i.scroll={offset:rc(e.scroll.offset,t),content:rc(e.scroll.content,t)}),e.children.length>0&&(i.children=e.children.map(e=>ic(e,t,n))),i}function ac(e){return e.tl===e.tr&&e.tr===e.br&&e.br===e.bl?e.tl:[e.tl,e.tr,e.br,e.bl]}function oc(e){let t={};if(e.backgroundColor!==void 0&&(t.backgroundColor=cs(e.backgroundColor)),e.opacity!==void 0&&(t.opacity=e.opacity),e.color!==void 0&&(t.color=cs(e.color)),e.fontSize!==void 0&&(t.fontSize=e.fontSize),e.fontFamily!==void 0&&(t.fontFamily=e.fontFamily),e.fontWeight!==void 0&&(t.fontWeight=e.fontWeight),e.fontStyle!==void 0&&e.fontStyle!==`normal`&&(t.fontStyle=e.fontStyle),e.lineHeight!==void 0&&(t.lineHeight=e.lineHeight),e.letterSpacing&&(t.letterSpacing=e.letterSpacing),e.textAlign!==void 0&&e.textAlign!==`start`&&(t.textAlign=e.textAlign),e.textDecoration!==void 0&&e.textDecoration!==`none`&&(t.textDecoration=e.textDecoration),e.objectFit!==void 0&&(t.objectFit=e.objectFit),e.tintColor!==void 0&&(t.tintColor=cs(e.tintColor)),e.overlayColor!==void 0&&(t.overlayColor=cs(e.overlayColor)),e.backgroundImage!==void 0&&(t.backgroundImage=e.backgroundImage),e.backgroundSize!==void 0&&(t.backgroundSize=e.backgroundSize),e.backgroundGradients!==void 0&&e.backgroundGradients.length>0&&(t.backgroundGradients=e.backgroundGradients.map(e=>{let t=e.stops.map(e=>({color:cs(e.color),position:e.position}));if(e.type===`radial`){let n={type:`radial`,shape:e.shape,extent:e.extent,cx:e.cx,cy:e.cy,stops:t};return e.extent===`explicit`&&(n.rx=e.rx,n.ry=e.ry,n.rxUnit=e.rxUnit,n.ryUnit=e.ryUnit),n}return{angle:e.angle,stops:t}})),e.borderRadius&&(e.borderRadius.tl||e.borderRadius.tr||e.borderRadius.br||e.borderRadius.bl)&&(t.borderRadius=ac(e.borderRadius)),e.border){let n={};for(let t of[`top`,`right`,`bottom`,`left`]){let r=e.border[t];r&&r.width>0&&(n[t]={width:r.width,color:cs(r.color)})}Object.keys(n).length>0&&(t.border=n)}return Object.keys(t).length>0?t:void 0}async function sc(e,t){return globalThis.window===void 0&&(globalThis.window=globalThis),e({wasmBinary:t,locateFile:()=>``})}function cc(e){return`${e.italic?`italic `:``}${e.weight} ${e.size}px ${e.family}`}var lc=class{ctx;images=new Map;pending=new Map;resolver;canvasSurfaces;constructor(e={}){let t=typeof OffscreenCanvas<`u`?new OffscreenCanvas(8,8):document.createElement(`canvas`);this.ctx=t.getContext(`2d`),this.canvasSurfaces=e.canvasSurfaces,this.resolver=Po({assetUrl:e.resolveAssetUrl,fileUrl:e=>URL.createObjectURL(e)})}resolveSrc(e){return this.resolver(e)}pendingImages(){return this.pending.size}measureText(e,t){return this.ctx.font=cc(t),this.ctx.letterSpacing=`${t.letterSpacing}px`,this.ctx.measureText(e).width}fontMetrics(e){this.ctx.font=cc(e);let t=this.ctx.measureText(`Mg`);return{ascent:t.fontBoundingBoxAscent||t.actualBoundingBoxAscent||e.size*.8,descent:t.fontBoundingBoxDescent||t.actualBoundingBoxDescent||e.size*.2}}getImage(e){return Ps(e,this.canvasSurfaces)??this.images.get(e)}loadImage(e){let t=Ps(e,this.canvasSurfaces);if(t)return Promise.resolve(t);let n=this.images.get(e);if(n)return Promise.resolve(n);let r=this.pending.get(e);if(r)return r;let i=(async()=>{let t=await this.decode(e),n=t.naturalWidth,r=t.naturalHeight;if(Ao(e)){let t=await No(e,e=>fetch(e).then(e=>e.ok?e.text():null));t&&(n=t.width,r=t.height)}let i={src:e,naturalWidth:n,naturalHeight:r,handle:t};return this.images.set(e,i),this.pending.delete(e),i})();return this.pending.set(e,i),i.catch(()=>this.pending.delete(e)),i}decode(e){return new Promise((t,n)=>{let r=new Image;r.onload=()=>t(r),r.onerror=e=>n(e),r.src=e})}async loadFont(e,t,n){if(globalThis.FontFace===void 0)return;let r=new FontFace(e,`url(${t})`,n);await r.load(),document.fonts.add(r)}},uc=class{ctx;dpr;groups=[];constructor(e,t=1){this.ctx=e,this.dpr=t}beginGroup(e){let t=this.ctx,n=t.canvas.width,r=t.canvas.height,i;typeof OffscreenCanvas<`u`?i=new OffscreenCanvas(n,r):(i=document.createElement(`canvas`),i.width=n,i.height=r);let a=i.getContext(`2d`);a.setTransform(t.getTransform()),this.groups.push({parent:t,layer:i,alpha:e}),this.ctx=a}endGroup(){let e=this.groups.pop();e&&(this.ctx=e.parent,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.globalAlpha*=e.alpha,this.ctx.drawImage(e.layer,0,0),this.ctx.restore())}beginFrame(e,t){let{ctx:n,dpr:r}=this;n.setTransform(r,0,0,r,0,0),n.clearRect(0,0,e,t),n.globalAlpha=1}endFrame(){}save(){this.ctx.save()}restore(){this.ctx.restore()}setAlpha(e){this.ctx.globalAlpha*=e}translate(e,t){this.ctx.translate(e,t)}scale(e,t){this.ctx.scale(e,t)}transform(e,t,n,r,i,a){this.ctx.transform(e,t,n,r,i,a)}addRectPath(e,t){let n=this.ctx;t&&(t.tl||t.tr||t.br||t.bl)?n.roundRect(e.x,e.y,e.width,e.height,[t.tl,t.tr,t.br,t.bl]):n.rect(e.x,e.y,e.width,e.height)}path(e,t){this.ctx.beginPath(),this.addRectPath(e,t)}clipRoundRect(e,t){this.path(e,t),this.ctx.clip()}fillRoundRect(e,t,n){this.path(e,t),this.ctx.fillStyle=ls(n),this.ctx.fill()}fillGradient(e,t,n){if(n.type===`radial`){this.fillRadial(e,t,n);return}let{x0:r,y0:i,x1:a,y1:o}=Ks(n.angle,e),s=this.ctx.createLinearGradient(r,i,a,o);for(let e of n.stops)s.addColorStop(Math.max(0,Math.min(1,e.position)),ls(e.color));this.path(e,t),this.ctx.fillStyle=s,this.ctx.fill()}fillRadial(e,t,n){let{cx:r,cy:i,rx:a,ry:o}=qs(n,e),s=this.ctx,c=a||1e-6,l=o||1e-6;s.save(),this.path(e,t),s.clip(),s.translate(r,i),s.scale(c,l);let u=s.createRadialGradient(0,0,0,0,0,1);for(let e of n.stops)u.addColorStop(Math.max(0,Math.min(1,e.position)),ls(e.color));s.fillStyle=u;let d=(e.x-r)/c,f=(e.x+e.width-r)/c,p=(e.y-i)/l,m=(e.y+e.height-i)/l;s.fillRect(d,p,f-d,m-p),s.restore()}strokeBorder(e,t,n){let r=this.ctx,i=[`top`,`right`,`bottom`,`left`].filter(e=>n[e]);if(i.length===4&&i.every(e=>n[e].width===n.top.width&&n[e].color===n.top.color)){let i=n.top.width,a=Us(t,e);r.beginPath(),this.addRectPath(e,a);let o={x:e.x+i,y:e.y+i,width:e.width-2*i,height:e.height-2*i};if(o.width>0&&o.height>0){let e=a&&Us({tl:Math.max(0,a.tl-i),tr:Math.max(0,a.tr-i),br:Math.max(0,a.br-i),bl:Math.max(0,a.bl-i)},o);this.addRectPath(o,e||void 0)}r.fillStyle=ls(n.top.color),r.fill(`evenodd`);return}for(let t of i){let{width:i,color:a}=n[t];r.fillStyle=ls(a),t===`top`?r.fillRect(e.x,e.y,e.width,i):t===`bottom`?r.fillRect(e.x,e.y+e.height-i,e.width,i):t===`left`?r.fillRect(e.x,e.y,i,e.height):r.fillRect(e.x+e.width-i,e.y,i,e.height)}}scratch;scratchCtx;getScratch(e,t){return this.scratch||(this.scratch=typeof OffscreenCanvas<`u`?new OffscreenCanvas(e,t):document.createElement(`canvas`),this.scratchCtx=this.scratch.getContext(`2d`)),(this.scratch.width<e||this.scratch.height<t)&&(this.scratch.width=Math.max(this.scratch.width,e),this.scratch.height=Math.max(this.scratch.height,t)),this.scratchCtx}drawImage(e,t,n,r){let i=e.handle;if(!i)return;let{src:a,dst:o}=t?{src:t,dst:n}:Gs(e.naturalWidth,e.naturalHeight,n,r.fit),s=!t&&r.fit!==`cover`;if(r.tint===void 0){s?this.ctx.drawImage(i,o.x,o.y,o.width,o.height):this.ctx.drawImage(i,a.x,a.y,a.width,a.height,o.x,o.y,o.width,o.height);return}let c=Math.max(1,Math.ceil(o.width)),l=Math.max(1,Math.ceil(o.height)),u=this.getScratch(c,l);u.clearRect(0,0,c,l),u.globalCompositeOperation=`source-over`,s?u.drawImage(i,0,0,c,l):u.drawImage(i,a.x,a.y,a.width,a.height,0,0,c,l),u.globalCompositeOperation=`source-in`,u.fillStyle=ls(r.tint),u.fillRect(0,0,c,l),u.globalCompositeOperation=`source-over`,this.ctx.drawImage(u.canvas,0,0,c,l,o.x,o.y,o.width,o.height)}fillText(e,t,n,r,i){let a=this.ctx;a.font=`${r.italic?`italic `:``}${r.weight} ${r.size}px ${r.family}`,a.textBaseline=`alphabetic`,a.textAlign=`left`,`letterSpacing`in a&&(a.letterSpacing=`${r.letterSpacing}px`),a.fillStyle=ls(i),a.fillText(e,t,n)}},dc=new Set;function fc(e){return(...t)=>{dc.has(e)||(dc.add(e),console.warn(`[canvas-ui] "${e}" is not implemented yet (deferred feature).`))}}async function pc(e={}){let t=e.host??new Fs({canvasSurfaces:e.canvasSurfaces}),n=new gs(e.layout??await Ns.create(),t),r=new Hs(n);return{openScreen:e=>n.openScreen(e),closeScreen:()=>n.closeScreen(),insertNode:(e,t,r)=>n.insertNode(e,t,r),removeNode:(e,t)=>n.removeNode(e,t),setContent:(e,t,r)=>n.setContent(e,t,r),updateStyle:(e,t,r)=>n.updateStyle(e,t,r),mergeStyle:(e,t)=>n.mergeStyle(e,t),setClass:(e,t,r)=>n.setClass(e,t,r),updateNode:(e,t,r)=>n.updateNode(e,t,r),registerResizeEvent:e=>n.registerResizeEvent(e),registerTouchStartEvent:e=>r.registerTouchStartEvent(e),registerTouchEndEvent:e=>r.registerTouchEndEvent(e),isButtonPressed:e=>n.isButtonPressed(e),getTextValue:e=>n.getTextValue(e),routerOpen:(e,t)=>n.routerOpen(e,t),routerPush:e=>n.routerPush(e),routerReplace:e=>n.routerReplace(e),routerPop:(e=-1)=>n.routerPop(e),routerHide:()=>n.routerHide(),routerRestore:()=>n.routerRestore(),showWidget:e=>n.showWidget(e),hideWidget:e=>n.hideWidget(e),setSourceRect:(e,t,r,i,a)=>n.setSourceRect(e,t,r,i,a),registerFont:(e,t,r,i,a)=>n.registerFont(e,t,r,i,a),toast:fc(`toast`),animateTo:(e,t)=>n.animateTo(e,t),animateFrom:(e,t)=>n.animateFrom(e,t),vlistMount:(e,t,r)=>n.vlistMount(e,t,r),vlistSetKeys:(e,t,r)=>n.vlistSetKeys(e,t,r),vlistInsertKeys:(e,t,r,i)=>n.vlistInsertKeys(e,t,r,i),vlistInvalidate:(e,t)=>n.vlistInvalidate(e,t),vlistRemoveKeys:(e,t)=>n.vlistRemoveKeys(e,t),command:(e,t,...r)=>n.command(e,t,...r),_setCreator:e=>r.setCreator(e),resize:(e,t)=>n.resize(e,t),setSafeArea:e=>n.setSafeArea(e),renderTree:()=>n.renderTree(),widgets:()=>n.widgetTrees(),find:e=>n.findByName(e),findAll:e=>n.findAllByName(e),serialize:e=>tc(n.renderTree(),n.widgetTrees(),e),toText:e=>nc(n.renderTree(),n.widgetTrees(),e),paint:e=>{let{width:r,height:i}=n.viewport;Js(n.frame(),e,t,r,i)},pointerDown:(e,t,n)=>r.pointerDown(e,t,n),pointerMove:(e,t,n)=>r.pointerMove(e,t,n),pointerUp:(e,t,n)=>r.pointerUp(e,t,n),scrollBy:(e,t)=>n.scrollBy(e,t),tick:e=>n.tick(e),hasActiveAnimations:()=>n.hasActiveAnimations(),needsPaint:()=>n.needsPaint(),focusInput:e=>n.focusInput(e),blurInput:()=>n.blurInput(),setInputValue:(e,t)=>n.setInputValue(e,t),keyboard:()=>n.keyboard(),uiTransform:()=>n.uiTransform(),onKeyboardChange:e=>n.registerKeyboardEvent(e),renderer:n,host:t}}var mc=null,hc=()=>mc??=fetch(xo).then(e=>e.arrayBuffer());globalThis.__lecodesCaptureSites=!0;var gc=async()=>{let e=new Ns(await sc(bo,await hc()));return pc({host:new lc,layout:e})},_c=()=>{},vc=new Proxy(function(){},{get:()=>vc,apply:()=>vc}),yc=(e,t,n=()=>{})=>{let r=null,i=new Set,a=new Set,o=(e,t,...r)=>{let a=setTimeout((...t)=>{i.delete(a),e(...t),n()},t,...r);return i.add(a),a},s=e=>{i.delete(e),clearTimeout(e)},c=(e,t,...r)=>{let i=setInterval((...t)=>{e(...t),n()},t,...r);return a.add(i),i},l=e=>{a.delete(e),clearInterval(e)},u=new Map,d=e=>u.has(e)?u.get(e):null,f=new Proxy({language:`en`,platform:`web`,fetch:(e,t,r)=>{queueMicrotask(()=>{r(0,0),n()})},fetchLocal:()=>-1,disposeFetch:_c,fetchToJson:()=>({}),fetchToText:()=>``,fetchSlice:()=>``,localStorageSetStorage:_c,localStorageGetValue:d,localStorageSetValue:(e,t)=>{u.set(e,String(t))},localStorageRemoveValue:e=>{u.delete(e)},shareMedia:_c},{get:(e,t)=>t in e?e[t]:vc}),p={_creatorUI:new Proxy(e,{get:(e,t)=>t in e?e[t]:_c}),_creator:vc,_creator2d:vc,_creatorCanvas:vc,_creatorUtils:f,device:{platform:`web`,language:`en`,addEventListener:_c,removeEventListener:_c},toast:_c,localStorage:{getItem:d,setItem:(e,t)=>u.set(e,String(t)),removeItem:e=>u.delete(e),clear:()=>u.clear()},setTimeout:o,clearTimeout:s,setInterval:c,clearInterval:l,setLoop:_c,clearLoop:_c,fetch:()=>Promise.resolve({})};try{Function(...Object.keys(p),t)(...Object.values(p))}catch(e){r=e instanceof Error?e.stack??e.message:String(e)}return{error:r,dispose:()=>{for(let e of i)clearTimeout(e);for(let e of a)clearInterval(e);i.clear(),a.clear()}}},bc=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,xc={};for(let e=0;e<64;e++)xc[bc[e]]=e;var Sc=e=>{let t=[],n=0,r=0;for(let i of e){let e=xc[i];if(e===void 0)break;let a=e&32;if(r+=(e&31)<<n,a)n+=5;else{let e=r&1;r>>=1,t.push(e?-r:r),r=0,n=0}}return t},Cc=class{sources;lines;constructor(e){this.sources=e.sources,this.lines=[];let t=0,n=0,r=0;for(let i of e.mappings.split(`;`)){let e=[],a=0;if(i)for(let o of i.split(`,`)){let i=Sc(o);i.length!==0&&(a+=i[0],i.length>=4&&(t+=i[1],n+=i[2],r+=i[3],e.push([a,t,n,r])))}this.lines.push(e)}}originalPositionFor(e,t){let n=this.lines[e-1];if(!n||n.length===0)return null;let r=null;for(let e of n)if(e[0]<=t)r=e;else break;r??=n[0];let i=this.sources[r[1]];return i===void 0?null:{source:i,line:r[2]+1,column:r[3]}}},wc=e=>{let t=e.match(/\/\/# lecodesMap=data:application\/json;(?:charset=[^;]+;)?base64,([A-Za-z0-9+/=]+)\s*$/);if(!t)return null;try{return new Cc(JSON.parse(atob(t[1])))}catch{return null}},Tc=null,Ec=()=>{if(Tc!==null)return Tc;try{Function(`throw new Error('lecodes-calibrate')`)()}catch(e){let t=(e.stack??``).match(/<anonymous>:(\d+):\d+/);return Tc=t?parseInt(t[1],10)-1:2,Tc}return Tc=2,Tc},Dc=(e,t)=>{let n=(e instanceof Error?e.stack:``)??``,r=Ec(),i=[];for(let e of n.split(`
|
|
3
|
+
`)){let n=e.match(/<anonymous>:(\d+):(\d+)/);if(!n)continue;let a=parseInt(n[1],10)-r,o=parseInt(n[2],10)-1;if(a<1)continue;let s=t.originalPositionFor(a,o<0?0:o);if(!s)continue;let c=e.match(/at\s+([^\s(]+)\s*\(/);i.push({fn:c?c[1]:null,source:s.source,line:s.line,column:s.column})}return i},Oc=e=>{let t=wc(e);return e=>!t||!(e instanceof Error)?[]:Dc(e,t).filter(e=>!e.source.startsWith(`/__sdk/`))},kc={class:`screen-tile__name`},Ac={key:0,class:`screen-tile__hints`},jc={key:3,class:`screen-tile__notice`},Mc={key:5,class:`screen-tile__overlay screen-tile__overlay--error`},Nc={key:6,class:`screen-tile__overlay`},Pc=kn({__name:`ScreenTile`,props:{screen:{},reloadToken:{},highlight:{type:Boolean},selected:{type:Boolean},hints:{type:Boolean},activatorName:{},edgeActivators:{}},emits:[`dragStart`,`connectStart`,`activatorHover`],setup(e,{expose:t,emit:n}){let r=e,i=n,a=J(null),o=J(null),s=J(null),c=J(`loading`),l=J(null),u=J(0),d=null,f=null,p=0,m=0,h=0,g=null,_=0,v=(e=600)=>{_=Math.max(_,performance.now()+e)},y=()=>{cancelAnimationFrame(p),p=0,f?.dispose(),f=null,d=null,g=null,h=0,u.value=0,A.value=null,I.value=null,pe=null;for(let e of me)URL.revokeObjectURL(e);me=[],we.clear(),De=``,B.value=[],V.value=null,H.value&&(H.value=null,i(`activatorHover`,null))},b=async()=>{let e=++m;c.value=`loading`;try{let[t,n]=await Promise.all([uo(r.screen.id),gc()]);if(e!==m)return;if(t.error||t.js==null){y(),l.value=t.error??`Compile produced no output.`,c.value=`error`;return}y(),d=n,g=Oc(t.js);let[i,o]=r.screen.size;if(d.resize(i,o),d.onKeyboardChange(e=>{v();let t=s.value;e&&t?(h=e.input.nodeId,t.type=e.input.type===`password`?`password`:`text`,t.value!==e.input.value&&(t.value=e.input.value),t.focus({preventScroll:!0}),u.value=e.rect.height):(h=0,u.value=0,t&&document.activeElement===t&&t.blur())}),f=yc(d,t.js,()=>v()),f.error){l.value=f.error,c.value=`error`;return}let b=a.value,x=window.devicePixelRatio||1;b.width=Math.round(i*x),b.height=Math.round(o*x);let S=new uc(b.getContext(`2d`),x);v(2500);let C=()=>d.host.pendingImages?.()??0,w=!1,T=0,ee=t=>{if(e!==m)return;let n=C()>0;if(w&&!n&&v(150),w=n,t<_||n||d.hasActiveAnimations()){let e=T===0?0:t-T;d.tick(e),d.paint(S),T=t,(r.hints||r.activatorName)&&t-Oe>120&&(Oe=t,ke())}else T=0;p=requestAnimationFrame(ee)};p=requestAnimationFrame(ee),c.value=`ready`,l.value=null,b.__ui=d}catch(t){if(e!==m)return;l.value=t instanceof Error?t.message:String(t),c.value=`error`}},x=e=>{let t=o.value.getBoundingClientRect(),[n,i]=r.screen.size;return[(e.clientX-t.left)*(n/t.width),(e.clientY-t.top)*(i/t.height)]},S=e=>{if(e.button===1||(e.stopPropagation(),e.preventDefault(),e.button!==0))return;if(!r.selected){i(`dragStart`,e);return}if(!d)return;o.value.setPointerCapture(e.pointerId);let[t,n]=x(e);d.pointerDown(e.pointerId,t,n),v()},C=e=>{if(!d||(Ae(e),!r.selected))return;let[t,n]=x(e);d.pointerMove(e.pointerId,t,n),e.buttons&&v()},w=e=>{if(!d||!r.selected)return;let[t,n]=x(e);d.pointerUp(e.pointerId,t,n),v()},T=()=>{H.value&&(H.value=null,i(`activatorHover`,null))},ee=e=>{e.button!==1&&(e.stopPropagation(),e.preventDefault(),e.button===0&&i(`dragStart`,e))},te=e=>{e.button!==1&&(e.stopPropagation(),e.preventDefault(),e.button===0&&i(`connectStart`,e))},E=()=>{d&&h&&d.setInputValue(h,s.value.value),v()},ne=()=>{d&&h&&d.blurInput()},D=J(!1),re=J(``),ie=J(null),O=async()=>{re.value=r.screen.desc??``,D.value=!0,await tn(),ie.value?.focus(),ie.value?.select()},ae=()=>{if(!D.value)return;D.value=!1;let e=re.value.trim();e!==(r.screen.desc??``)&&(r.screen.desc=e||void 0,po(r.screen.id,{desc:e}))},k=()=>{D.value=!1},A=J(null),oe=J(null),se=J(null),ce,le=e=>{se.value=e,clearTimeout(ce),ce=setTimeout(()=>{se.value=null},2600)},M=(e,t,n)=>{if(!d)return null;for(let r of[...d.widgets()].reverse()){let i=Ls(r,e,t,n);if(i)return i}let r=d.renderTree();return r?Ls(r,e,t,n):null},ue=async e=>{if(e.stopPropagation(),!d||A.value)return;let[t,n]=x(e),r=M(t,n,e=>e.type===`image`||e.type===`text`&&typeof e.text==`string`&&e.text.length>0);if(!r)return;if(r.type===`image`){R(r.id);return}let i=d.renderer.get(r.id)?.jsNode?._site,a=i&&g?g(i):[];if(a.length===0){le(`No source location for this text.`);return}A.value={nodeId:r.id,rect:{...r.rect},fontSize:r.style.fontSize??14,fontWeight:r.style.fontWeight??400,align:r.style.textAlign===`center`?`center`:r.style.textAlign===`end`?`right`:`left`,value:r.text,oldText:r.text,frames:a},await tn(),oe.value?.focus(),oe.value?.select()},P=async()=>{let e=A.value;if(!e)return;A.value=null;let t=e.value;if(t===e.oldText||!d)return;let n=d.renderer.get(e.nodeId)?.jsNode;n&&(n._text=t,d.updateNode(e.nodeId,`text`,t),v());let i=await _o(r.screen.id,{frames:e.frames,oldText:e.oldText,newText:t});i.ok||(n&&(n._text=e.oldText,d.updateNode(e.nodeId,`text`,e.oldText),v()),le(i.reason))},de=()=>{A.value=null},F=e=>{e.key===`Enter`&&!e.shiftKey?(e.preventDefault(),P()):e.key===`Escape`&&(e.stopPropagation(),de())},fe=J(null),I=J(null),pe=null,me=[],he=e=>{let t=d?.renderer.get(e),n=t?.imageSrcRaw,r=t?.jsNode?._site,i=r&&g?g(r):[];return typeof n!=`string`||i.length===0?null:{nodeId:e,frames:i,oldSrc:n}},R=e=>{let t=he(e);if(!t){le(`This image's source can't be located — edit it in the code.`);return}pe=t,fe.value.value=``,fe.value.click()},ge=()=>{let e=fe.value?.files?.[0],t=pe;pe=null,e&&t&&ve(t,e)},_e=(e,t)=>{let n=d?.renderer.get(e)?.jsNode;!n||!d||(n._src=t,d.updateNode(e,`src`,t),v())},z=e=>new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result).split(`,`,2)[1]??``),r.onerror=()=>n(r.error),r.readAsDataURL(e)}),ve=async(e,t)=>{if(!t.type.startsWith(`image/`)){le(`Not an image file.`);return}let n=URL.createObjectURL(t);me.push(n),_e(e.nodeId,n);let i=await z(t),a=await vo(r.screen.id,{frames:e.frames,oldSrc:e.oldSrc,name:t.name,data:i});a.ok||(_e(e.nodeId,e.oldSrc),le(a.reason))},ye=e=>{if(!e.dataTransfer||![...e.dataTransfer.types].includes(`Files`))return;let[t,n]=x(e),r=M(t,n,e=>e.type===`image`);r?(e.preventDefault(),e.dataTransfer.dropEffect=`copy`,I.value={nodeId:r.id,rect:{...r.rect}}):I.value=null},be=()=>{I.value=null},xe=e=>{e.preventDefault(),e.stopPropagation();let t=I.value?.nodeId;I.value=null;let n=e.dataTransfer?.files?.[0];if(t===void 0||!n)return;let r=he(t);if(!r){le(`This image's source can't be located — edit it in the code.`);return}ve(r,n)};t({collectNames:()=>{if(!d)return[];let e=new Set,t=n=>{n.name&&e.add(n.name);for(let e of n.children)t(e)},n=d.renderTree();n&&t(n);for(let e of d.widgets())t(e);return[...e].sort()}});let B=J([]),V=J(null),H=J(null),Se=sa(()=>new Set(r.edgeActivators??[])),Ce=sa(()=>{let e=[];return V.value&&e.push(V.value),H.value&&H.value.name!==V.value?.name&&e.push(H.value),e}),we=new Map,Te=e=>{let t=d?.renderer.get(e)?.jsNode?._site;return!!t&&!!g&&g(t).length>0},Ee=e=>{let t=we.get(e.id);if(t!==void 0)return t;let n=d?.renderer.get(e.id),r=null;return n&&(e.type===`image`&&typeof n.imageSrcRaw==`string`&&Te(e.id)?r=`image`:e.type===`text`&&typeof e.text==`string`&&e.text.length>0&&Te(e.id)?r=`text`:(n.interactive||n.editable)&&(r=`tap`)),we.set(e.id,r),r},De=``,Oe=0,ke=()=>{if(!d)return;let[e,t]=r.screen.size,n=r.activatorName||null,i={activator:null},a=[],o=s=>{if(n&&!i.activator&&s.name===n&&(i.activator={...s.rect}),r.hints&&a.length<300){let n=Ee(s);n&&!(n===`tap`&&s.rect.width*s.rect.height>.85*e*t)&&a.push({id:s.id,kind:n,rect:{...s.rect}})}for(let e of s.children)o(e)},s=d.renderTree();s&&o(s);for(let e of d.widgets())o(e);let c=a.map(e=>`${e.id}${e.kind}${e.rect.x},${e.rect.y},${e.rect.width},${e.rect.height}`).join(`;`);c!==De&&(De=c,B.value=a),V.value=n&&i.activator?{name:n,rect:i.activator}:null};xn([()=>r.hints,()=>r.activatorName],()=>ke());let Ae=e=>{let t=null;if(d&&e.buttons===0&&Se.value.size>0){let[n,r]=x(e),i=M(n,r,e=>!!e.name&&Se.value.has(e.name));i&&(t={name:i.name,rect:{...i.rect}})}let n=H.value;n?.name===t?.name&&n?.rect.x===t?.rect.x&&n?.rect.y===t?.rect.y||(H.value=t,n?.name!==t?.name&&i(`activatorHover`,t?.name??null))},je=()=>b();return xn([()=>r.reloadToken,()=>r.screen.size[0],()=>r.screen.size[1]],()=>b()),Wn(b),Jn(()=>{m++,y()}),(t,n)=>(X(),Z(`div`,{class:N([`screen-tile`,{"screen-tile--selected":e.selected}]),style:j({left:`${e.screen.pos[0]}px`,top:`${e.screen.pos[1]}px`,width:`${e.screen.size[0]}px`})},[Q(`div`,{class:`screen-tile__header`,onPointerdown:ee},[Q(`span`,kc,L(e.screen.id),1),D.value?hn((X(),Z(`input`,{key:0,ref_key:`descEl`,ref:ie,"onUpdate:modelValue":n[0]||=e=>re.value=e,class:`screen-tile__desc-input`,placeholder:`What is this screen?`,onPointerdown:n[1]||=$(()=>{},[`stop`]),onKeydown:[no(ae,[`enter`]),no(k,[`esc`])],onBlur:ae},null,544)),[[Qa,re.value]]):(X(),Z(`span`,{key:1,class:N([`screen-tile__desc`,{"screen-tile__desc--empty":!e.screen.desc}]),title:`Click to edit the description`,onPointerdown:n[2]||=$(()=>{},[`stop`]),onClick:O},L(e.screen.desc??`add note…`),35)),Q(`button`,{class:`screen-tile__restart`,title:`Restart the prototype (reset its state)`,onPointerdown:n[3]||=$(()=>{},[`stop`]),onClick:je},`↻`,32)],32),Q(`div`,{ref_key:`bodyEl`,ref:o,class:N([`screen-tile__body`,{"screen-tile__body--highlight":e.highlight}]),style:j({height:`${e.screen.size[1]}px`}),onPointerdown:S,onPointermove:C,onPointerup:w,onPointercancel:w,onPointerleave:T,onDblclick:ue,onDragover:ye,onDragleave:be,onDrop:xe},[Q(`canvas`,{ref_key:`canvasEl`,ref:a,class:`screen-tile__canvas`},null,512),e.hints&&B.value.length?(X(),Z(`div`,Ac,[(X(!0),Z(Y,null,er(B.value,e=>(X(),Z(`div`,{key:e.id,class:N([`screen-tile__hint`,`screen-tile__hint--${e.kind}`]),style:j({left:`${e.rect.x}px`,top:`${e.rect.y}px`,width:`${e.rect.width}px`,height:`${e.rect.height}px`})},null,6))),128))])):Pi(``,!0),(X(!0),Z(Y,null,er(Ce.value,e=>(X(),Z(`div`,{key:e.name,class:`screen-tile__activator-hl`,style:j({left:`${e.rect.x}px`,top:`${e.rect.y}px`,width:`${e.rect.width}px`,height:`${e.rect.height}px`})},[Q(`span`,{class:N([`screen-tile__activator-tag`,{"screen-tile__activator-tag--below":e.rect.y<26}])},`⚡ `+L(e.name),3)],4))),128)),I.value?(X(),Z(`div`,{key:1,class:`screen-tile__drop`,style:j({left:`${I.value.rect.x}px`,top:`${I.value.rect.y}px`,width:`${I.value.rect.width}px`,height:`${I.value.rect.height}px`})},null,4)):Pi(``,!0),Q(`input`,{ref_key:`fileEl`,ref:fe,type:`file`,accept:`image/*`,class:`screen-tile__file`,onChange:ge},null,544),A.value?hn((X(),Z(`textarea`,{key:2,ref_key:`textEditEl`,ref:oe,"onUpdate:modelValue":n[4]||=e=>A.value.value=e,class:`screen-tile__text-edit`,style:j({left:`${A.value.rect.x-3}px`,top:`${A.value.rect.y-3}px`,minWidth:`${Math.max(A.value.rect.width+6,40)}px`,height:`${A.value.rect.height+6}px`,fontSize:`${A.value.fontSize}px`,fontWeight:A.value.fontWeight,textAlign:A.value.align}),spellcheck:`false`,onPointerdown:n[5]||=$(()=>{},[`stop`]),onDblclick:n[6]||=$(()=>{},[`stop`]),onKeydown:F,onBlur:P},null,36)),[[Qa,A.value.value]]):Pi(``,!0),se.value?(X(),Z(`div`,jc,L(se.value),1)):Pi(``,!0),Q(`input`,{ref_key:`captureEl`,ref:s,class:`screen-tile__capture`,autocomplete:`off`,tabindex:`-1`,onInput:E,onBlur:ne},null,544),u.value>0?(X(),Z(`div`,{key:4,class:`screen-tile__keyboard`,style:j({height:`${u.value}px`}),onPointerdown:n[7]||=$(()=>{},[`prevent`])},[(X(),Z(Y,null,er([10,9,7,5],(e,t)=>Q(`div`,{key:t,class:`screen-tile__keyboard-row`},[(X(!0),Z(Y,null,er(e,e=>(X(),Z(`span`,{key:e,class:`screen-tile__key`}))),128))])),64))],36)):Pi(``,!0),c.value===`error`?(X(),Z(`div`,Mc,L(l.value),1)):c.value===`loading`?(X(),Z(`div`,Nc,`Compiling…`)):Pi(``,!0)],38),Q(`div`,{class:`screen-tile__handle`,style:j({bottom:`${e.screen.size[1]/2-10}px`}),title:`Drag to another screen to add a flow edge`,onPointerdown:te},null,36)],6))}}),Fc={class:`edge-layer`,width:`1`,height:`1`},Ic=[`d`,`marker-end`],Lc=[`d`,`onClick`,`onPointerenter`],Rc=[`x`,`y`,`onClick`,`onPointerenter`],zc=[`x`,`y`,`onClick`,`onPointerenter`],Bc=[`d`],Vc=kn({__name:`EdgeLayer`,props:{screens:{},edges:{},selected:{},highlighted:{},draft:{}},emits:[`select`,`hover`],setup(e,{emit:t}){let n=e,r=t,i=e=>({x:e.pos[0],y:e.pos[1],w:e.size[0],h:e.size[1]}),a=(e,t,n=0)=>{let r=e.x+e.w/2,i=e.y+e.h/2,a=t.x+t.w/2,o=t.y+t.h/2,s=a-r,c=o-i,l,u,d,f,p;Math.abs(s)>=Math.abs(c)?(p=!0,l=s>=0?e.x+e.w:e.x,u=i+n,d=s>=0?t.x:t.x+t.w,f=o+n):(p=!1,l=r+n,u=c>=0?e.y+e.h:e.y,d=a+n,f=c>=0?t.y:t.y+t.h);let m=Math.max(60,Math.abs(p?d-l:f-u)/2),h=p?[l+Math.sign(d-l||1)*m,u]:[l,u+Math.sign(f-u||1)*m],g=p?[d-Math.sign(d-l||1)*m,f]:[d,f-Math.sign(f-u||1)*m];return{path:`M ${l} ${u} C ${h[0]} ${h[1]}, ${g[0]} ${g[1]}, ${d} ${f}`,mid:[(l+3*h[0]+3*g[0]+d)/8,(u+3*h[1]+3*g[1]+f)/8]}},o=sa(()=>{let e=new Map(n.screens.map(e=>[e.id,e])),t=e=>[e.from,e.to].sort().join(`\0`),r=new Map;for(let e of n.edges)r.set(t(e),(r.get(t(e))??0)+1);let o=new Map,s=[];for(let c of n.edges){let n=e.get(c.from),l=e.get(c.to);if(!n||!l)continue;let u=t(c),d=o.get(u)??0;o.set(u,d+1);let f=(d-((r.get(u)??1)-1)/2)*56,{path:p,mid:m}=a(i(n),i(l),f);s.push({index:c.index,path:p,label:c.label,activator:c.activator,mid:m})}return s}),s=sa(()=>{if(!n.draft)return null;let e=n.screens.find(e=>e.id===n.draft.from);if(!e)return null;let t=n.draft.target?n.screens.find(e=>e.id===n.draft.target):null,r=t?i(t):{x:n.draft.point[0],y:n.draft.point[1],w:0,h:0};return a(i(e),r).path});return(t,n)=>(X(),Z(`svg`,Fc,[n[6]||=Ni(`<defs><marker id="edge-arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M 0 0 L 10 5 L 0 10 z" fill="#5b6472"></path></marker><marker id="edge-arrow-selected" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M 0 0 L 10 5 L 0 10 z" fill="#5b8cff"></path></marker><marker id="edge-arrow-hover" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path d="M 0 0 L 10 5 L 0 10 z" fill="#f5a524"></path></marker></defs>`,1),(X(!0),Z(Y,null,er(o.value,t=>(X(),Z(`g`,{key:t.index},[Q(`path`,{class:N([`edge-layer__path`,{"edge-layer__path--selected":t.index===e.selected,"edge-layer__path--hover":t.index!==e.selected&&e.highlighted.includes(t.index)}]),d:t.path,"marker-end":t.index===e.selected?`url(#edge-arrow-selected)`:e.highlighted.includes(t.index)?`url(#edge-arrow-hover)`:`url(#edge-arrow)`},null,10,Ic),Q(`path`,{class:`edge-layer__hit`,d:t.path,onPointerdown:n[0]||=$(()=>{},[`stop`]),onClick:$(e=>r(`select`,t.index),[`stop`]),onPointerenter:e=>r(`hover`,t.index),onPointerleave:n[1]||=e=>r(`hover`,null)},null,40,Lc),t.label?(X(),Z(`text`,{key:0,class:`edge-layer__label`,x:t.mid[0],y:t.mid[1]-8,onPointerdown:n[2]||=$(()=>{},[`stop`]),onClick:$(e=>r(`select`,t.index),[`stop`]),onPointerenter:e=>r(`hover`,t.index),onPointerleave:n[3]||=e=>r(`hover`,null)},L(t.label),41,Rc)):Pi(``,!0),t.activator?(X(),Z(`text`,{key:1,class:N([`edge-layer__activator`,{"edge-layer__activator--hover":e.highlighted.includes(t.index)}]),x:t.mid[0],y:t.mid[1]+12,onPointerdown:n[4]||=$(()=>{},[`stop`]),onClick:$(e=>r(`select`,t.index),[`stop`]),onPointerenter:e=>r(`hover`,t.index),onPointerleave:n[5]||=e=>r(`hover`,null)},`⚡ `+L(t.activator),43,zc)):Pi(``,!0)]))),128)),s.value?(X(),Z(`path`,{key:0,class:`edge-layer__draft`,d:s.value,"marker-end":`url(#edge-arrow-selected)`},null,8,Bc)):Pi(``,!0)]))}}),Hc={class:`edge-editor__title`},Uc={class:`edge-editor__combo`},Wc=[`onPointerdown`,`onPointerenter`],Gc={class:`edge-editor__actions`},Kc={key:1,class:`board__empty`},qc={key:2,class:`board__legend`},Jc=.05,Yc=2.5,Xc=24,Zc=kn({__name:`DesignBoard`,props:{screens:{},edges:{},tokens:{}},setup(e){let t=e,n=J(null),r=J(0),i=J(0),a=J(1),o=J(!1),s=sa(()=>{let e=Xc*a.value;for(;e<12;)e*=2;return{backgroundPosition:`${r.value}px ${i.value}px`,backgroundSize:`${e}px ${e}px`}}),c=e=>{let t=n.value.getBoundingClientRect();return[(e.clientX-t.left-r.value)/a.value,(e.clientY-t.top-i.value)/a.value]},l=()=>{let e=n.value;if(!e||t.screens.length===0)return;let o=1/0,s=1/0,c=-1/0,l=-1/0;for(let e of t.screens)o=Math.min(o,e.pos[0]),s=Math.min(s,e.pos[1]-40),c=Math.max(c,e.pos[0]+e.size[0]),l=Math.max(l,e.pos[1]+e.size[1]);let u=e.clientWidth-120,d=e.clientHeight-120,f=Math.min(Math.max(Jc,Math.min(u/(c-o),d/(l-s))),1);a.value=f,r.value=(e.clientWidth-(c-o)*f)/2-o*f,i.value=(e.clientHeight-(l-s)*f)/2-s*f},u=(e,t,n)=>{n=Math.min(Yc,Math.max(Jc,n));let o=n/a.value;r.value=e-(e-r.value)*o,i.value=t-(t-i.value)*o,a.value=n},d=e=>{let t=n.value;u(t.clientWidth/2,t.clientHeight/2,e)},f=e=>{let t=e.deltaMode===1?16:1;if(e.ctrlKey||e.metaKey){let r=n.value.getBoundingClientRect();u(e.clientX-r.left,e.clientY-r.top,a.value*Math.exp(-e.deltaY*t*.0015))}else r.value-=e.deltaX*t,i.value-=e.deltaY*t},p=(e,t,r)=>{let i=n.value;i.setPointerCapture(e.pointerId);let a=n=>{n.pointerId===e.pointerId&&t(n)},o=t=>{t.pointerId===e.pointerId&&(i.removeEventListener(`pointermove`,a),i.removeEventListener(`pointerup`,o),i.removeEventListener(`pointercancel`,o),r?.(t))};i.addEventListener(`pointermove`,a),i.addEventListener(`pointerup`,o),i.addEventListener(`pointercancel`,o)},m=e=>{if(e.button!==0&&e.button!==1)return;e.preventDefault(),e.button===0&&(h.value=null),o.value=!0;let t=e.clientX,n=e.clientY;p(e,e=>{r.value+=e.clientX-t,i.value+=e.clientY-n,t=e.clientX,n=e.clientY},()=>{o.value=!1})},h=J(null),g=J(!1),_=J(null),v=J(null),y=J(null),b=sa(()=>{let e=new Map;for(let n of t.edges){if(!n.activator)continue;let t=e.get(n.from)??[];t.includes(n.activator)||t.push(n.activator),e.set(n.from,t)}return e}),x=(e,t)=>{t?v.value={screen:e,name:t}:v.value?.screen===e&&(v.value=null)},S=sa(()=>{let e=[],n=v.value;if(n)for(let r of t.edges)r.from===n.screen&&r.activator===n.name&&e.push(r.index);return _.value!==null&&!e.includes(_.value)&&e.push(_.value),e}),C=e=>{let n=ce.value;if(n&&n.from===e)return(y.value??A.value).trim()||null;let r=_.value===null?void 0:t.edges.find(e=>e.index===_.value);return r&&r.from===e&&r.activator?r.activator:null},w=new Map,T=(e,t)=>{t?w.set(e,t):w.delete(e)},ee,te=(e,n)=>{let r=t.screens.find(e=>e.id===h.value);r&&(r.pos=[r.pos[0]+e,r.pos[1]+n],clearTimeout(ee),ee=setTimeout(()=>{po(r.id,{pos:[Math.round(r.pos[0]),Math.round(r.pos[1])]})},400))},E=(e,n)=>{let r=a.value,i=e.clientX,o=e.clientY,s=null,c=null,l=null,u=i,d=o;p(e,e=>{let i=t.screens.find(e=>e.id===n);i&&(s??=[i.pos[0],i.pos[1]],c=(c??i.pos[0])+(e.clientX-u)/r,l=(l??i.pos[1])+(e.clientY-d)/r,u=e.clientX,d=e.clientY,i.pos=[c,l])},e=>{let r=t.screens.find(e=>e.id===n);if(r){if(Math.hypot(e.clientX-i,e.clientY-o)<4){s&&(r.pos=s),h.value=n;return}c===null||l===null||(r.pos=[Math.round(c),Math.round(l)],po(n,{pos:r.pos}))}})},ne=J(null),D=null,re=(e,n)=>{for(let r of t.screens)if(r.id!==n&&e[0]>=r.pos[0]&&e[0]<=r.pos[0]+r.size[0]&&e[1]>=r.pos[1]-36&&e[1]<=r.pos[1]+r.size[1])return r.id;return null},ie=(e,t)=>{F(!1),ne.value={from:t,point:c(e),target:null},p(e,e=>{let n=c(e);ne.value={from:t,point:n,target:re(n,t)}},async e=>{let n=re(c(e),t);ne.value=null,n&&(D=await mo({from:t,to:n}))})},O=J(null),ae=J([0,0]),k=J(``),A=J(``),oe=J(null),se=J(null),ce=sa(()=>t.edges.find(e=>e.index===O.value)??null),le=J([]),M=J(!1),ue=sa(()=>{let e=A.value.trim().toLowerCase();return le.value.filter(t=>t.toLowerCase().includes(e))}),P=e=>{A.value=e,M.value=!1,y.value=null},de=async(e,n)=>{let o=t.edges.find(t=>t.index===e);o&&(O.value=e,ae.value=[n[0]*a.value+r.value,n[1]*a.value+i.value],k.value=o.label??``,A.value=o.activator??``,le.value=w.get(o.from)?.collectNames()??[],M.value=!1,await tn(),se.value?.focus())},F=e=>{let t=ce.value;e&&t&&(k.value.trim()!==(t.label??``)||A.value.trim()!==(t.activator??``))&&ho(t.index,{label:k.value,activator:A.value}),O.value=null,y.value=null},fe=()=>{O.value!==null&&go(O.value),O.value=null},I=e=>{let n=t.edges.find(t=>t.index===e),r=n&&t.screens.find(e=>e.id===n.from),i=n&&t.screens.find(e=>e.id===n.to);!r||!i||de(e,[(r.pos[0]+r.size[0]/2+i.pos[0]+i.size[0]/2)/2,(r.pos[1]+r.size[1]/2+i.pos[1]+i.size[1]/2)/2])};xn(()=>t.edges,e=>{if(D===null)return;let t=e.find(e=>e.index===D);t&&(D=null,I(t.index))});let pe=e=>{O.value!==null&&(oe.value?.contains(e.target)||F(!0))},me={ArrowLeft:[-1,0],ArrowRight:[1,0],ArrowUp:[0,-1],ArrowDown:[0,1]},he=e=>{if(e.key===`Escape`){O.value===null?h.value=null:F(!1);return}let t=e.target;if(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)return;if(e.key===`h`||e.key===`H`){g.value=!g.value;return}let n=me[e.key];if(n&&h.value!==null){e.preventDefault();let t=e.shiftKey?10:1;te(n[0]*t,n[1]*t)}};return Wn(()=>{l(),window.addEventListener(`keydown`,he)}),Jn(()=>window.removeEventListener(`keydown`,he)),(t,c)=>(X(),Z(`div`,{ref_key:`rootEl`,ref:n,class:N([`board`,{"board--panning":o.value,"board--connecting":!!ne.value}]),style:j(s.value),onWheel:$(f,[`prevent`]),onPointerdown:m,onPointerdownCapture:pe,onDblclick:$(l,[`self`])},[Q(`div`,{class:`board__world`,style:j({transform:`translate(${r.value}px, ${i.value}px) scale(${a.value})`})},[Oi(Vc,{screens:e.screens,edges:e.edges,selected:O.value,highlighted:S.value,draft:ne.value,onSelect:I,onHover:c[0]||=e=>_.value=e},null,8,[`screens`,`edges`,`selected`,`highlighted`,`draft`]),(X(!0),Z(Y,null,er(e.screens,t=>(X(),Ci(Pc,{key:t.id,ref_for:!0,ref:e=>T(t.id,e),screen:t,"reload-token":e.tokens[t.id]??0,highlight:ne.value?.target===t.id,selected:h.value===t.id,hints:g.value,"activator-name":C(t.id),"edge-activators":b.value.get(t.id),onDragStart:e=>E(e,t.id),onConnectStart:e=>ie(e,t.id),onActivatorHover:e=>x(t.id,e)},null,8,[`screen`,`reload-token`,`highlight`,`selected`,`hints`,`activator-name`,`edge-activators`,`onDragStart`,`onConnectStart`,`onActivatorHover`]))),128))],4),ce.value?(X(),Z(`div`,{key:0,ref_key:`editorEl`,ref:oe,class:`edge-editor`,style:j({left:`${ae.value[0]}px`,top:`${ae.value[1]}px`}),onPointerdown:c[10]||=$(()=>{},[`stop`]),onWheel:c[11]||=$(()=>{},[`stop`])},[Q(`div`,Hc,L(ce.value.from)+` → `+L(ce.value.to),1),hn(Q(`input`,{ref_key:`labelEl`,ref:se,"onUpdate:modelValue":c[1]||=e=>k.value=e,class:`edge-editor__input`,placeholder:`Label (when does this happen?)`,onKeydown:c[2]||=no(e=>F(!0),[`enter`])},null,544),[[Qa,k.value]]),Q(`div`,Uc,[hn(Q(`input`,{"onUpdate:modelValue":c[3]||=e=>A.value=e,class:`edge-editor__input edge-editor__input--combo`,placeholder:`Activator (element name, optional)`,onFocus:c[4]||=e=>M.value=!0,onBlur:c[5]||=e=>M.value=!1,onInput:c[6]||=e=>M.value=!0,onKeydown:c[7]||=no(e=>F(!0),[`enter`])},null,544),[[Qa,A.value]]),M.value&&ue.value.length?(X(),Z(`div`,{key:0,class:`edge-editor__options`,onPointerleave:c[8]||=e=>y.value=null},[(X(!0),Z(Y,null,er(ue.value,e=>(X(),Z(`button`,{key:e,class:N([`edge-editor__option`,{"edge-editor__option--current":e===A.value.trim()}]),onPointerdown:$(t=>P(e),[`prevent`,`stop`]),onPointerenter:t=>y.value=e},L(e),43,Wc))),128))],32)):Pi(``,!0)]),Q(`div`,Gc,[Q(`button`,{class:`edge-editor__delete`,onClick:fe},`Delete`),Q(`button`,{class:`edge-editor__save`,onClick:c[9]||=e=>F(!0)},`Save`)])],36)):Pi(``,!0),e.screens.length===0?(X(),Z(`div`,Kc,[...c[18]||=[Q(`div`,{class:`board__empty-title`},`No screens yet`,-1),Q(`div`,null,[Mi(`Add a screen file — `),Q(`code`,null,`design/screens/<name>.ts`),Mi(` — and it appears here.`)],-1)]])):Pi(``,!0),g.value?(X(),Z(`div`,qc,[...c[19]||=[Q(`span`,{class:`board__legend-item board__legend-item--tap`},`interactive`,-1),Q(`span`,{class:`board__legend-item board__legend-item--text`},`editable text`,-1),Q(`span`,{class:`board__legend-item board__legend-item--image`},`replaceable image`,-1)]])):Pi(``,!0),Q(`div`,{class:`board__controls`,onPointerdown:c[16]||=$(()=>{},[`stop`]),onDblclick:c[17]||=$(()=>{},[`stop`])},[Q(`button`,{class:N([`board__control board__control--hints`,{"board__control--active":g.value}]),title:`Highlight interactive & editable elements (H)`,onClick:c[12]||=e=>g.value=!g.value},`◎`,2),Q(`button`,{class:`board__control`,title:`Zoom out`,onClick:c[13]||=e=>d(a.value/1.25)},`−`),Q(`button`,{class:`board__control board__control--zoom`,title:`Reset to 100%`,onClick:c[14]||=e=>d(1)},L(Math.round(a.value*100))+`%`,1),Q(`button`,{class:`board__control`,title:`Zoom in`,onClick:c[15]||=e=>d(a.value*1.25)},`+`),Q(`button`,{class:`board__control`,title:`Fit all screens (double-click the board)`,onClick:l},`⛶`)],32)],38))}}),Qc={class:`design-app`},$c={class:`design-app__header`},el={class:`design-app__title`},tl={key:0,class:`design-app__counts`},nl=[`title`],rl={key:0,class:`design-app__warnings`},il={key:1,class:`design-app__error`};oo(kn({__name:`App`,setup(e){let t=J(null),n=J(null),r=J(!1),i=bt({}),a=async()=>{try{t.value=await lo(),n.value=null}catch(e){n.value=e instanceof Error?e.message:String(e)}},o=e=>{let n=e??t.value?.screens.map(e=>e.id)??[];for(let e of n)i[e]=(i[e]??0)+1},s=null;return Wn(async()=>{await a(),s=yo(async e=>{await a(),o(e.screens)},e=>{r.value=e}),document.title=t.value?`${t.value.name} — LeCodes Design`:`LeCodes Design`}),Jn(()=>s?.()),(e,a)=>(X(),Z(`div`,Qc,[Q(`header`,$c,[Q(`span`,el,L(t.value?.name??`LeCodes Design`),1),t.value?(X(),Z(`span`,tl,L(t.value.screens.length)+` screen`+L(t.value.screens.length===1?``:`s`)+` · `+L(t.value.edges.length)+` edge`+L(t.value.edges.length===1?``:`s`),1)):Pi(``,!0),Q(`span`,{class:N([`design-app__status`,{"design-app__status--connected":r.value}]),title:r.value?`Watching for changes`:`Disconnected — is the dev server running?`},null,10,nl)]),t.value?.warnings.length?(X(),Z(`div`,rl,[(X(!0),Z(Y,null,er(t.value.warnings,(e,t)=>(X(),Z(`div`,{key:t,class:`design-app__warning`},L(e),1))),128))])):Pi(``,!0),n.value?(X(),Z(`div`,il,L(n.value),1)):t.value?(X(),Ci(Zc,{key:2,screens:t.value.screens,edges:t.value.edges,tokens:i},null,8,[`screens`,`edges`,`tokens`])):Pi(``,!0)]))}})).mount(`#app`);export{js as n,sc as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
*{box-sizing:border-box;margin:0;padding:0}html,body,#app{height:100%;overflow:hidden}body{color:#d7dae0;-webkit-user-select:none;user-select:none;background:#101114;font-family:Segoe UI,system-ui,-apple-system,sans-serif;font-size:14px}.design-app{flex-direction:column;height:100%;display:flex}.design-app__header{z-index:10;background:#17181c;border-bottom:1px solid #26282e;flex-shrink:0;align-items:center;gap:12px;height:44px;padding:0 16px;display:flex}.design-app__title{color:#f2f3f5;font-weight:600}.design-app__counts{color:#8a919e;font-size:13px}.design-app__status{background:#e5484d;border-radius:50%;width:8px;height:8px;margin-left:auto}.design-app__status--connected{background:#46a758}.design-app__warnings{z-index:20;flex-direction:column;gap:6px;max-width:420px;display:flex;position:absolute;top:56px;right:16px}.design-app__warning{color:#f5b273;background:#2b1d10;border:1px solid #5c3d1e;border-radius:6px;padding:8px 12px;font-size:12.5px}.design-app__error{color:#e5484d;margin:auto}.board{cursor:grab;touch-action:none;background-color:#101114;background-image:radial-gradient(circle,#22242a 1px,#0000 1px);flex:1;position:relative;overflow:hidden}.board--panning{cursor:grabbing}.board--connecting{cursor:crosshair}.edge-editor{z-index:30;background:#17181c;border:1px solid #33363d;border-radius:10px;flex-direction:column;gap:8px;width:260px;padding:10px;display:flex;position:absolute;transform:translate(-50%,12px);box-shadow:0 12px 40px #0000008c}.edge-editor__title{color:#8a919e;font-size:12px;font-weight:600}.edge-editor__input{color:#d7dae0;font:inherit;background:#101114;border:1px solid #33363d;border-radius:6px;outline:none;padding:6px 8px;font-size:13px}.edge-editor__input:focus{border-color:#5b8cff}.edge-editor__combo{flex-direction:column;display:flex;position:relative}.edge-editor__input--combo{width:100%}.edge-editor__options{z-index:5;background:#101114;border:1px solid #33363d;border-radius:6px;flex-direction:column;max-height:168px;display:flex;position:absolute;top:calc(100% + 4px);left:0;right:0;overflow-y:auto;box-shadow:0 8px 24px #00000080}.edge-editor__option{font:inherit;text-align:left;color:#d7dae0;cursor:pointer;background:0 0;border:none;padding:6px 8px;font-size:13px}.edge-editor__option:hover{background:#22242a}.edge-editor__option--current{color:#5b8cff}.edge-editor__actions{justify-content:space-between;gap:8px;display:flex}.edge-editor__save,.edge-editor__delete{font:inherit;cursor:pointer;border:none;border-radius:6px;padding:5px 12px;font-size:12.5px}.edge-editor__save{color:#fff;background:#5b8cff}.edge-editor__save:hover{background:#6f9aff}.edge-editor__delete{color:#e5484d;background:0 0}.edge-editor__delete:hover{background:#e5484d1f}.board__world{transform-origin:0 0;pointer-events:none;position:absolute;top:0;left:0}.board__controls{background:#17181c;border:1px solid #26282e;border-radius:6px;display:flex;position:absolute;bottom:12px;right:12px;overflow:hidden}.board__control{font:inherit;color:#8a919e;cursor:pointer;background:0 0;border:none;padding:5px 10px;font-size:12px}.board__control:hover{color:#d7dae0;background:#22242a}.board__control--zoom{text-align:center;min-width:52px}.board__control--active{color:#5b8cff;background:#5b8cff1f}.board__legend{color:#8a919e;pointer-events:none;background:#17181c;border:1px solid #26282e;border-radius:6px;gap:12px;padding:5px 10px;font-size:11.5px;display:flex;position:absolute;bottom:48px;right:12px}.board__legend-item{align-items:center;gap:5px;display:flex}.board__legend-item:before{content:"";border:1.5px solid;border-radius:2px;width:8px;height:8px}.board__legend-item--tap:before{background:#5b8cff40;border-color:#5b8cff}.board__legend-item--text:before{background:#46a75840;border-color:#46a758}.board__legend-item--image:before{background:#b18cff40;border-color:#b18cff}.board__empty{color:#8a919e;flex-direction:column;justify-content:center;align-items:center;gap:8px;display:flex;position:absolute;inset:0}.board__empty-title{color:#d7dae0;font-size:18px}.board__empty code{background:#17181c;border:1px solid #26282e;border-radius:4px;padding:2px 6px;font-size:12.5px}.edge-layer{position:absolute;top:0;left:0;overflow:visible}.edge-layer__path{fill:none;stroke:#5b6472;stroke-width:2px}.edge-layer__path--selected{stroke:#5b8cff}.edge-layer__path--hover{stroke:#f5a524}.edge-layer__activator--hover{fill:#f5a524}.edge-layer__hit{fill:none;stroke:#0000;stroke-width:14px;pointer-events:stroke;cursor:pointer}.edge-layer__draft{fill:none;stroke:#5b8cff;stroke-width:2px;stroke-dasharray:6 5}.edge-layer__label,.edge-layer__activator{pointer-events:auto;cursor:pointer}.edge-layer__label{fill:#aab2bf;paint-order:stroke;stroke:#101114;stroke-width:4px;stroke-linejoin:round;text-anchor:middle;font-size:13px}.edge-layer__activator{fill:#6f7987;paint-order:stroke;stroke:#101114;stroke-width:4px;stroke-linejoin:round;text-anchor:middle;font-size:11px}.screen-tile{pointer-events:auto;position:absolute}.screen-tile__header{white-space:nowrap;cursor:grab;align-items:baseline;gap:8px;padding:0 2px 6px;display:flex;overflow:hidden}.screen-tile__header:active{cursor:grabbing}.screen-tile__name{color:#f2f3f5;font-size:15px;font-weight:600}.screen-tile__desc{color:#8a919e;text-overflow:ellipsis;cursor:text;font-size:12.5px;overflow:hidden}.screen-tile__desc:hover{color:#aab2bf}.screen-tile__desc--empty{visibility:hidden;color:#5b6472;font-style:italic}.screen-tile:hover .screen-tile__desc--empty{visibility:visible}.screen-tile__desc-input{color:#d7dae0;min-width:0;font:inherit;background:#101114;border:1px solid #33363d;border-radius:4px;outline:none;flex:1;padding:1px 6px;font-size:12.5px}.screen-tile__desc-input:focus{border-color:#5b8cff}.screen-tile__body{cursor:grab;background:#000;border:1px solid #33363d;border-radius:18px;position:relative;overflow:hidden;box-shadow:0 8px 32px #00000073}.screen-tile--selected .screen-tile__body{cursor:default;border-color:#5b8cff;box-shadow:0 0 0 2px #5b8cff66,0 8px 32px #00000073}.screen-tile--selected .screen-tile__name{color:#5b8cff}.screen-tile__restart{font:inherit;color:#8a919e;cursor:pointer;visibility:hidden;background:0 0;border:none;margin-left:auto;padding:0 4px;font-size:14px;line-height:1}.screen-tile:hover .screen-tile__restart{visibility:visible}.screen-tile__restart:hover{color:#d7dae0}.screen-tile__body--highlight{border-color:#5b8cff;box-shadow:0 0 0 3px #5b8cff59,0 8px 32px #00000073}.screen-tile__handle{cursor:crosshair;opacity:0;background:#5b8cff;border:3px solid #101114;border-radius:50%;width:20px;height:20px;transition:opacity .12s;position:absolute;right:-11px}.screen-tile:hover .screen-tile__handle,.board--connecting .screen-tile__handle{opacity:1}.screen-tile__canvas{touch-action:none;width:100%;height:100%;display:block}.screen-tile__capture{opacity:0;pointer-events:none;border:0;width:1px;height:1px;padding:0;position:absolute;top:0;left:0}.screen-tile__keyboard{-webkit-user-select:none;user-select:none;touch-action:none;background:#caced6;flex-direction:column;justify-content:space-evenly;padding:6px 5px;display:flex;position:absolute;bottom:0;left:0;right:0}.screen-tile__keyboard-row{justify-content:center;align-items:center;gap:6px;display:flex}.screen-tile__key{background:#fff;border-radius:6px;flex:1 1 0;max-width:32px;height:40px;box-shadow:0 1px #00000040}.screen-tile__text-edit{z-index:3;color:#fff;resize:none;white-space:pre;background:#101114d9;border:1.5px solid #5b8cff;border-radius:4px;outline:none;padding:2px 3px;font-family:inherit;line-height:1.25;position:absolute;overflow:hidden}.screen-tile__hints{z-index:2;pointer-events:none;position:absolute;inset:0}.screen-tile__hint{border:1.5px solid;border-radius:6px;position:absolute}.screen-tile__hint--tap{background:#5b8cff12;border-color:#5b8cffe6}.screen-tile__hint--text{background:#46a75812;border-color:#46a758d9}.screen-tile__hint--image{background:#b18cff14;border-color:#b18cffe6}.screen-tile__activator-hl{z-index:3;pointer-events:none;border:2px solid #f5a524;border-radius:6px;animation:1.4s ease-in-out infinite activator-pulse;position:absolute;box-shadow:0 0 0 3px #f5a52440}@keyframes activator-pulse{50%{box-shadow:0 0 0 6px #f5a5241a}}.screen-tile__activator-tag{color:#1a1204;white-space:nowrap;background:#f5a524;border-radius:4px;padding:2px 6px;font-size:11px;font-weight:600;position:absolute;top:-24px;left:-2px}.screen-tile__activator-tag--below{top:auto;bottom:-24px}.screen-tile__drop{z-index:3;pointer-events:none;background:#5b8cff26;border:2px dashed #5b8cff;border-radius:4px;position:absolute}.screen-tile__file{display:none}.screen-tile__notice{color:#f5b273;text-align:center;z-index:4;pointer-events:none;background:#2b1d10;border:1px solid #5c3d1e;border-radius:6px;max-width:90%;padding:6px 10px;font-size:12.5px;position:absolute;bottom:14px;left:50%;transform:translate(-50%)}.screen-tile__overlay{text-align:left;color:#8a919e;background:#101114eb;justify-content:center;align-items:center;padding:16px;font-size:12.5px;display:flex;position:absolute;inset:0}.screen-tile__overlay--error{color:#ff8f8f;white-space:pre-wrap;word-break:break-word;align-items:flex-start;font-family:Consolas,monospace;overflow:auto}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./index-OduKGRgC.js";var n=Object.create,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,c=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),l=(e,t,n,o)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=a(t),l=0,u=c.length,d;l<u;l++)d=c[l],!s.call(e,d)&&d!==n&&r(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(o=i(t,d))||o.enumerable});return e},u=(e,t,i)=>(i=e==null?{}:n(o(e)),l(t||!e||!e.__esModule?r(i,`default`,{value:e,enumerable:!0}):i,e));async function d(){let{readFileSync:n}=await e(async()=>{let{readFileSync:e}=await import(`./__vite-browser-external-B-F28LA_.js`).then(e=>u(e.default,1));return{readFileSync:e}},[]),{fileURLToPath:r}=await e(async()=>{let{fileURLToPath:e}=await import(`./__vite-browser-external-B-F28LA_.js`).then(e=>u(e.default,1));return{fileURLToPath:e}},[]),i=n(r(new URL(`/assets/creator-ui-IOlJLP4k.wasm`,``+import.meta.url))),a=(await e(async()=>{let{default:e}=await import(`./creator-ui-VMQTvHQj.js`);return{default:e}},[])).default;return t(a,i)}export{d as loadCreatorUiNode,c as t};
|