smart-home-engine 1.51.1 → 1.51.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,78 +1,75 @@
1
- # she - smart home engine
2
-
3
- Your home, your rules - written in plain JavaScript.
4
-
5
- **she** is a Node.js daemon that loads your `.js` scripts into a sandboxed VM and wires them up to MQTT, Matter, and everything else your smart home throws at them. No cloud, no lock-in, no YAML sprawl, no opinionated bloated schemata. Just scripts that do exactly what you (if you want: with the help of the integrated AI assisstant) tell them.
6
-
7
- - **Scripts** — Monaco-based Script IDE, AI assistant, git integration, autocompletion, hot-reload without process restart
8
- - **MQTT** — subscribe, publish, react to state changes with wildcards, conditions, and delays
9
- - **Matter** — control Matter devices directly from your scripts
10
- - **sheDB** — lightweight document store with map/reduce views, right in the daemon
11
- - **Scheduler** — cron expressions and solar events (`sunrise`, `sunset`, …) in one call
12
- - **Script HTTP routes** — scripts can register their own REST endpoints under `/api/<scriptName>/`
13
- - **`require()`** — load npm packages from `~/.she/node_modules/` or relative files inside scripts
14
- - Supports **InfluxDB**, **Elasticsearch** and **Redis** — convenience methods for time series, full text indexing, shared states across multiple she instances
1
+ # she - smart home engine
2
+
3
+ Your home, your rules - written in plain JavaScript.
4
+
5
+ **she** is a Node.js daemon that loads your `.js` scripts into a sandboxed VM and wires them up to MQTT, Matter, and everything else your smart home throws at them. No cloud, no lock-in, no YAML sprawl, no opinionated bloated schemata. Just scripts that do exactly what you (if you want: with the help of the integrated AI assisstant) tell them.
6
+
7
+ - **Scripts** — Monaco-based Script IDE, AI assistant, git integration, autocompletion, hot-reload without process restart
8
+ - **MQTT** — subscribe, publish, react to state changes with wildcards, conditions, and delays
9
+ - **Matter** — control Matter devices directly from your scripts
10
+ - **sheDB** — lightweight document store with map/reduce views, right in the daemon
11
+ - **Scheduler** — cron expressions and solar events (`sunrise`, `sunset`, …) in one call
12
+ - **Script HTTP routes** — scripts can register their own REST endpoints under `/api/<scriptName>/`
13
+ - **`require()`** — load npm packages from `~/.she/node_modules/` or relative files inside scripts
14
+ - Supports **InfluxDB**, **Elasticsearch** and **Redis** — convenience methods for time series, full text indexing, shared states across multiple she instances
15
15
  - **Secrets** — encrypted store for the passwords and tokens scripts need (`she.secrets.get('smtp/password')`), write-only from the UI, redacted in logs
16
16
  - **Services** — optional management of the `xyz2mqtt` adapter instances of your home (mqtt-interfaces-core convention): inventory, restart and log level over MQTT, systemd control, journal logs, config forms generated from the adapter's `--config-schema`, install/uninstall/update on the she host
17
- - **Broker management** — optional Mosquitto management: dynamic user/ACL management via the dynsec plugin (`she.broker.*` script API), listener and TLS configuration, TLS certificate management (server cert self-signed / CSR / import, trusted CA store), SSH-based remote file deployment
18
- - **Web UI** — script editor, package manager, MQTT browser, Matter device manager, sheDB frontend, log viewer, broker manager, services manager
19
-
20
- ## Documentation
21
-
22
- ### Getting started
23
- - [Getting started](doc/getting-started.md) — install, first script, systemd service, Docker
24
- - [Concepts](doc/concept.md) — zero-boilerplate scripting, MQTT vs. sheDB, broker access control, git integration
25
-
26
- ### Scripting
27
- - [Script Engine](doc/script-engine.md) — execution model, hot-reload, module system, ESM limitations
28
- - [Sandbox API](doc/sandbox-api.md) — everything available inside a script (`she.mqtt`, `she.schedule`, `she.db`, …)
29
- - [Examples](doc/examples.md) — real-world script patterns
30
-
31
- ### sheDB
32
- - [sheDB overview](doc/db/README.md) — when and why to use the embedded document store
33
- - [Documents](doc/db/documents.md) — CRUD, deep merge, nested property mutations
34
- - [Views](doc/db/views.md) — map/reduce queries
35
- - [View examples](doc/db/view-examples.md)
36
- - [Sandbox API](doc/db/sandbox.md) — `she.db.*` reference
37
-
38
- ### Operations & integration
39
- - [Security](doc/security.md) — trust model, auth modes, reverse proxy, Mosquitto ACLs, network segmentation
17
+ - **Broker management** — optional Mosquitto management: dynamic user/ACL management via the dynsec plugin (`she.broker.*` script API), listener and TLS configuration, TLS certificate management (server cert self-signed / CSR / import, trusted CA store), SSH-based remote file deployment
18
+ - **Web UI** — script editor, package manager, MQTT browser, Matter device manager, sheDB frontend, log viewer, broker manager, services manager
19
+
20
+ ## Documentation
21
+
22
+ ### Getting started
23
+ - [Getting started](doc/getting-started.md) — install, first script, systemd service, Docker
24
+ - [Concepts](doc/concept.md) — zero-boilerplate scripting, MQTT vs. sheDB, broker access control, git integration
25
+
26
+ ### Scripting
27
+ - [Script Engine](doc/script-engine.md) — execution model, hot-reload, module system, ESM limitations
28
+ - [Sandbox API](doc/sandbox-api.md) — everything available inside a script (`she.mqtt`, `she.schedule`, `she.db`, …)
29
+ - [Examples](doc/examples.md) — real-world script patterns
30
+
31
+ ### sheDB
32
+ - [sheDB overview](doc/db/README.md) — when and why to use the embedded document store
33
+ - [Documents](doc/db/documents.md) — CRUD, deep merge, nested property mutations
34
+ - [Views](doc/db/views.md) — map/reduce queries
35
+ - [View examples](doc/db/view-examples.md)
36
+ - [Sandbox API](doc/db/sandbox.md) — `she.db.*` reference
37
+
38
+ ### Operations & integration
39
+ - [Security](doc/security.md) — trust model, auth modes, reverse proxy, Mosquitto ACLs, network segmentation
40
40
  - [Broker management](doc/broker-management.md) — Mosquitto, dynsec, TLS, certificates, SSH deploy
41
- - [Services](doc/services.md) — managing xyz2mqtt adapter instances: MQTT inventory, systemd, config forms, the `she-servicectl` helper
42
- - [HTTP API](doc/http-api.md) — REST API reference
43
- - [CLI](doc/cli.md) — all command-line flags
44
-
45
- ### Development
46
- - [Roadmap](ROADMAP.md) — planned features, deferred ideas, open design questions
47
-
48
- ## Quick look
49
-
50
- ![AI assistant proposing changes to an existing script with inline diff](doc/screenshots/she-ai-2.png) [... more screenshots](doc/screenshots.md)
51
-
52
- ## Motivation
53
-
54
- She is built around a simple idea: home automation should stay understandable, even as it grows. Instead of collecting adapters, bindings, integrations, and configuration layers, you work directly with devices, events, and logic. The result is a system that scales with your home without turning into a project of its own.
55
-
56
- At some point every smart home platform starts promising simplicity and ends up teaching you its own ecosystem. She takes a different approach. She's built around devices, messages, and automation logic - not around ever-growing collections of adapters, bindings, and abstractions.
57
-
58
- Spend your time automating your home, not maintaining your automation software. Less clicking through configuration screens, fewer plugins talking to plugins, and no need for YAML archaeology when something stops working. Just a straightforward path from devices to automations, built on open standards and designed for people who prefer understanding their system over managing it.
59
-
60
- The ideas behind **she** are the result of more than a decade of building smart home software. I started publishing home automation projects on GitHub in 2012 with ccu.io and later initiated the ioBroker project before leaving it in 2014. Shortly after I worked on [mqtt-smarthome](https://github.com/mqtt-smarthome/mqtt-smarthome), contributed to the Node-RED ecosystem and created [mqtt-scripts](https://github.com/hobbyquaker/mqtt-scripts), which has been running my own home automation ever since. Over the years I have continued working professionally in the smart home industry.
61
-
62
- Recently, while experimenting with GitHub Copilot, I started modernizing parts of my existing software stack. What began as a small refactoring exercise quickly evolved into a bigger idea: replacing my twelve-year-old automation engine with a modern successor. The result is **she** - a combination of the proven concepts from mqtt-scripts, the architecture of mqttDB, a built-in Matter controller and a modern web interface with AI assistance. A system that embraces open standards, integrates the growing Matter ecosystem, and remains true to the principles that made mqtt-scripts reliable enough to run a home for more than a decade.
63
-
64
- The goal is simple: a smart home that remains understandable years later. No migration-guide marathons, no plugin jungles. Just automation infrastructure that grows with your home instead of growing into a hobby of its own.
65
-
66
- ## Trademark and Certification Notices
67
-
68
- > [!IMPORTANT]
69
- > This project implements/supports the Matter protocol. Matter™ is a trademark of the Connectivity Standards Alliance.
70
- >
71
- > This project is **not** certified by, endorsed by, supported by, or affiliated with the Connectivity Standards Alliance.
72
-
73
- ## License
74
-
75
- GPL-3.0 © [Sebastian Raff](https://github.com/hobbyquaker)
76
-
77
- [license-badge]: https://img.shields.io/badge/License-GPL--3.0-blue.svg?style=flat
78
- [license-url]: LICENSE
41
+ - [Services](doc/services.md) — managing xyz2mqtt adapter instances: MQTT inventory, systemd, config forms, the `she-servicectl` helper
42
+ - [HTTP API](doc/http-api.md) — REST API reference
43
+ - [CLI](doc/cli.md) — all command-line flags
44
+
45
+ ## Quick look
46
+
47
+ ![AI assistant proposing changes to an existing script with inline diff](doc/screenshots/she-ai-2.png) [... more screenshots](doc/screenshots.md)
48
+
49
+ ## Motivation
50
+
51
+ She is built around a simple idea: home automation should stay understandable, even as it grows. Instead of collecting adapters, bindings, integrations, and configuration layers, you work directly with devices, events, and logic. The result is a system that scales with your home without turning into a project of its own.
52
+
53
+ At some point every smart home platform starts promising simplicity and ends up teaching you its own ecosystem. She takes a different approach. She's built around devices, messages, and automation logic - not around ever-growing collections of adapters, bindings, and abstractions.
54
+
55
+ Spend your time automating your home, not maintaining your automation software. Less clicking through configuration screens, fewer plugins talking to plugins, and no need for YAML archaeology when something stops working. Just a straightforward path from devices to automations, built on open standards and designed for people who prefer understanding their system over managing it.
56
+
57
+ The ideas behind **she** are the result of more than a decade of building smart home software. I started publishing home automation projects on GitHub in 2012 with ccu.io and later initiated the ioBroker project before leaving it in 2014. Shortly after I worked on [mqtt-smarthome](https://github.com/mqtt-smarthome/mqtt-smarthome), contributed to the Node-RED ecosystem and created [mqtt-scripts](https://github.com/hobbyquaker/mqtt-scripts), which has been running my own home automation ever since. Over the years I have continued working professionally in the smart home industry.
58
+
59
+ Recently, while experimenting with GitHub Copilot, I started modernizing parts of my existing software stack. What began as a small refactoring exercise quickly evolved into a bigger idea: replacing my twelve-year-old automation engine with a modern successor. The result is **she** - a combination of the proven concepts from mqtt-scripts, the architecture of mqttDB, a built-in Matter controller and a modern web interface with AI assistance. A system that embraces open standards, integrates the growing Matter ecosystem, and remains true to the principles that made mqtt-scripts reliable enough to run a home for more than a decade.
60
+
61
+ The goal is simple: a smart home that remains understandable years later. No migration-guide marathons, no plugin jungles. Just automation infrastructure that grows with your home instead of growing into a hobby of its own.
62
+
63
+ ## Trademark and Certification Notices
64
+
65
+ > [!IMPORTANT]
66
+ > This project implements/supports the Matter protocol. Matter™ is a trademark of the Connectivity Standards Alliance.
67
+ >
68
+ > This project is **not** certified by, endorsed by, supported by, or affiliated with the Connectivity Standards Alliance.
69
+
70
+ ## License
71
+
72
+ GPL-3.0 © [Sebastian Raff](https://github.com/hobbyquaker)
73
+
74
+ [license-badge]: https://img.shields.io/badge/License-GPL--3.0-blue.svg?style=flat
75
+ [license-url]: LICENSE
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/jsonMode-BRIqcXAV.js","assets/monaco-langs-DKJI_o9J.js","assets/monaco-langs-DyX1CsEw.css","assets/tsMode-Csag9_qB.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/jsonMode-BRIqcXAV.js","assets/monaco-langs-DKJI_o9J.js","assets/monaco-langs-DyX1CsEw.css","assets/tsMode-4A8DZYIU.js"])))=>i.map(i=>d[i]);
2
2
  var mF=Object.defineProperty;var F2=r=>{throw TypeError(r)};var _F=(r,e,t)=>e in r?mF(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var is=(r,e,t)=>_F(r,typeof e!="symbol"?e+"":e,t),Eb=(r,e,t)=>e.has(r)||F2("Cannot "+t);var Vt=(r,e,t)=>(Eb(r,e,"read from private field"),t?t.call(r):e.get(r)),Qn=(r,e,t)=>e.has(r)?F2("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),Jn=(r,e,t,i)=>(Eb(r,e,"write to private field"),i?i.call(r,t):e.set(r,t),t),Ts=(r,e,t)=>(Eb(r,e,"access private method"),t);import{_ as n6,m as s6,l as Zi,A as cr,C as si,I as Os,D as K0,a as oo,g as o6,M as Ni,b as _n,E as Za,c as fe,r as vs,d as ba,e as F,f as bF,h as Ls,R as es,S as fn,i as Wo,j as Ca,k as os,n as $n,o as Yt,p as Ci,K as ao,q as Gi,s as Li,t as po,u as Ze,v as Kn,O as Sl,w as ho,P as Xi,x as Sb,y as Z0,z as r6,B as ac,F as Ya,G as iy,H as Ao,U as ms,J as rp,L as Qi,N as fc,Q as CF,T as sr,V as ny,W as yF,X as a6,$ as Ui,Y as ls,Z as ss,a0 as Us,a1 as Pn,a2 as Hr,a3 as e0,a4 as Fi,a5 as yx,a6 as wF,a7 as EF,a8 as fo,a9 as SF,aa as Xa,ab as dr,ac as nn,ad as l6,ae as Ms,af as kF,ag as DF,ah as rr,ai as Op,aj as lo,ak as f1,al as Qo,am as Id,an as FS,ao as p1,ap as yo,aq as ap,ar as wo,as as g1,at as v1,au as AF,av as Y0,aw as Hp,ax as Ec,ay as BF,az as zp,aA as FF,aB as LS,aC as LF,aD as IF,aE as L2,aF as so,aG as lc,aH as Jo,aI as Wn,aJ as ic,aK as PF,aL as Fl,aM as Rr,aN as _o,aO as Qa,aP as IS,aQ as go,aR as to,aS as Xx,aT as zn,aU as c6,aV as TF,aW as PS,aX as x1,aY as TS,aZ as MS,a_ as lu,a$ as MF,b0 as RS,b1 as RF,b2 as NS,b3 as Sc,b4 as kc,b5 as lp,b6 as t0,b7 as yr,b8 as X0,b9 as Qx,ba as kb,bb as ks,bc as OS,bd as Q0,be as m1,bf as NF,bg as d6,bh as i0,bi as cp,bj as n0,bk as J0,bl as _1,bm as rs,bn as Pd,bo as ev,bp as OF,bq as HF,br as HS,bs as zF,bt as Jx,bu as Xr,bv as zS,bw as dp,bx as Dc,by as Wp,bz as Gn,bA as up,bB as u6,bC as tv,bD as WF,bE as cu,bF as zi,bG as I2,bH as wx,bI as h6,bJ as Ea,bK as qa,bL as As,bM as hp,bN as fa,bO as fp,bP as qs,bQ as s0,bR as Eh,bS as sy,bT as f6,bU as p6,bV as g6,bW as WS,bX as vr,bY as ps,bZ as iv,b_ as v6,b$ as cc,c0 as b1,c1 as jF,c2 as pf,c3 as P2,c4 as nv,c5 as x6,c6 as gf,c7 as VF,c8 as sa,c9 as C1,ca as $F,cb as ur,cc as Ja,cd as sv,ce as o0,cf as m6,cg as Gr,ch as ov,ci as y1,cj as qF,ck as UF,cl as GF,cm as jp,cn as Ll,co as bo,cp as KF,cq as jS,cr as ZF,cs as YF,ct as T2,cu as XF,cv as rv,cw as pc,cx as oy,cy as oh,cz as gc,cA as QF,cB as kl,cC as pa,cD as Pr,cE as M2,cF as $o,cG as av,cH as yd,cI as Il,cJ as JF,cK as el,cL as r0,cM as w1,cN as _6,cO as eL,cP as tL,cQ as VS,cR as iL,cS as a0,cT as nL,cU as Xc,cV as l0,cW as R2,cX as sL,cY as oL,cZ as Ml,c_ as rL,c$ as $S,d0 as b6,d1 as C6,d2 as y6,d3 as w6,d4 as aL,d5 as lL,d6 as E6,d7 as S6,d8 as cL,d9 as qS,da as dL,db as uL,dc as Ys,dd as hL,de as US,df as fL,dg as vf,dh as N2,di as pL,dj as gL,dk as vL,dl as xL,dm as mL,dn as _L,dp as pp,dq as E1,dr as ry,ds as bL,dt as CL,du as O2,dv as ay,dw as yL,dx as H2,dy as Db,dz as wL,dA as k6,dB as EL,dC as D6,dD as ly,dE as SL,dF as kL,dG as DL,dH as A6,dI as B6,dJ as AL,dK as em,dL as F6,dM as S1,dN as BL,dO as FL,dP as wd,dQ as GS,dR as LL,dS as z2,dT as W2,dU as IL,dV as xf,dW as L6,dX as PL,dY as TL,dZ as ML,d_ as RL,d$ as I6,e0 as P6,e1 as T6,e2 as M6,e3 as NL,e4 as Dl,e5 as j2,e6 as OL,e7 as lv,e8 as HL,e9 as xg,ea as R6,eb as V2,ec as c0,ed as N6,ee as tm,ef as zL,eg as O6,eh as WL,ei as H6,ej as jL,ek as VL,el as z6,em as W6,en as vc,eo as k1,ep as $L,eq as j6,er as Nr,es as du,et as V6,eu as qL,ev as UL,ew as $6,ex as q6,ey as GL,ez as U6,eA as G6,eB as d0,eC as KL,eD as ZL,eE as YL,eF as XL,eG as rg,eH as $2,eI as QL,eJ as JL,eK as eI,eL as im,eM as Po,eN as tI,eO as cy,eP as Sh,eQ as iI,eR as tc,eS as nI,eT as sI,eU as K6,eV as oI,eW as Tg,eX as rI,eY as aI,eZ as lI,e_ as cI,e$ as q2,f0 as U2,f1 as G2,f2 as kh,f3 as KS,f4 as Z6,f5 as dy,f6 as Ex,f7 as Y6,f8 as nm,f9 as dI,fa as uI,fb as hI,fc as fI,fd as ZS,fe as X6,ff as pI,fg as sm,fh as Q6,fi as J6,fj as gI,fk as vI,fl as xI,fm as mI,fn as _I,fo as bI,fp as CI,fq as yI,fr as e5,fs as wI,ft as om,fu as t5,fv as EI,fw as i5,fx as SI,fy as n5,fz as s5,fA as kI,fB as K2,fC as o5,fD as Z2,fE as DI,fF as Ab,fG as Y2,fH as AI,fI as BI,fJ as FI,fK as _l,fL as Ed,fM as LI,fN as X2,fO as Sx,fP as II,fQ as nc,fR as D1,fS as uy,fT as PI,fU as r5,fV as a5,fW as qo,fX as Q2,fY as zv,fZ as YS,f_ as TI,f$ as MI,g0 as RI,g1 as NI,g2 as OI,g3 as HI,g4 as zI,g5 as WI,g6 as J2,g7 as jI,g8 as VI,g9 as $I,ga as gp,gb as Mg,gc as l5,gd as qI,ge as XS,gf as kx,gg as Wv,gh as Bb,gi as UI,gj as GI,gk as c5,gl as KI,gm as QS,gn as ZI,go as YI,gp as d5,gq as A1,gr as XI,gs as rm,gt as JS,gu as e9,gv as t9,gw as u5,gx as h5,gy as f5,gz as p5,gA as g5,gB as v5,gC as x5,gD as e8,gE as m5,gF as $h,gG as QI,gH as JI,gI as eP,gJ as tP,gK as _5,gL as iP,gM as nP,gN as t8,gO as hy,gP as nd,gQ as sP,gR as oP,gS as rP,gT as aP,gU as lP,gV as cP,gW as i8,gX as i9,gY as fy,gZ as dP,g_ as py,g$ as uP,h0 as hP,h1 as fP,h2 as pP,h3 as n9,h4 as b5,h5 as n8,h6 as s8,h7 as gP,h8 as vP,h9 as xP,ha as o8,hb as Fb,hc as mP,hd as _P,he as bP,hf as Lb,hg as C5,hh as y5,hi as w5,hj as E5,hk as xc,hl as S5,hm as s9,hn as r8,ho as CP,hp as k5,hq as yP,hr as wP,hs as B1,ht as F1,hu as Dh,hv as L1,hw as cv,hx as EP,hy as I1,hz as SP,hA as kP,hB as DP,hC as D5,hD as ag,hE as AP,hF as BP,hG as FP,hH as LP,hI as dv,hJ as IP,hK as A5,hL as B5,hM as F5,hN as gy,hO as PP,hP as TP,hQ as MP,hR as RP,hS as NP,hT as vy,hU as OP,hV as HP,hW as zP,hX as WP,hY as jP,hZ as VP,h_ as $P,h$ as qP,i0 as L5,i1 as UP,i2 as GP,i3 as KP,i4 as a8,i5 as ZP,i6 as YP,i7 as Va,i8 as zo,i9 as xy,ia as I5,ib as XP,ic as QP}from"./monaco-langs-DKJI_o9J.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))i(n);new MutationObserver(n=>{for(const s of n)if(s.type==="childList")for(const a of s.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&i(a)}).observe(document,{childList:!0,subtree:!0});function t(n){const s={};return n.integrity&&(s.integrity=n.integrity),n.referrerPolicy&&(s.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?s.credentials="include":n.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(n){if(n.ep)return;n.ep=!0;const s=t(n);fetch(n.href,s)}})();const P5=!1;var o9=Array.isArray,JP=Array.prototype.indexOf,am=Array.prototype.includes,P1=Array.from,eT=Object.defineProperty,Pf=Object.getOwnPropertyDescriptor,tT=Object.getOwnPropertyDescriptors,iT=Object.prototype,nT=Array.prototype,T5=Object.getPrototypeOf,l8=Object.isExtensible;const jo=()=>{};function sT(r){for(var e=0;e<r.length;e++)r[e]()}function M5(){var r,e,t=new Promise((i,n)=>{r=i,e=n});return{promise:t,resolve:r,reject:e}}function oT(r,e,t=!1){return r===void 0?t?e():e:r}function lm(r,e){if(Array.isArray(r))return r;if(!(Symbol.iterator in r))return Array.from(r);const t=[];for(const i of r)if(t.push(i),t.length===e)break;return t}const Yo=2,vp=4,T1=8,R5=1<<24,Ua=16,Ka=32,Sd=64,my=128,xa=512,To=1024,No=2048,Pl=4096,mr=8192,ma=16384,Vp=32768,_y=1<<25,xp=65536,cm=1<<17,rT=1<<18,$p=1<<19,aT=1<<20,wl=1<<25,rh=65536,dm=1<<21,Tf=1<<22,sd=1<<23,uu=Symbol("$state"),lT=Symbol("legacy props"),cT=Symbol(""),Dx=Symbol("attributes"),by=Symbol("class"),Cy=Symbol("style"),mg=Symbol("text"),Ax=Symbol("form reset"),M1=new class extends Error{constructor(){super(...arguments);is(this,"name","StaleReactionError");is(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};var e6;const dT=!!((e6=globalThis.document)!=null&&e6.contentType)&&globalThis.document.contentType.includes("xml");function N5(r){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function uT(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function hT(r,e,t){throw new Error("https://svelte.dev/e/each_key_duplicate")}function fT(r){throw new Error("https://svelte.dev/e/effect_in_teardown")}function pT(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function gT(r){throw new Error("https://svelte.dev/e/effect_orphan")}function vT(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function xT(r){throw new Error("https://svelte.dev/e/props_invalid_value")}function mT(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function _T(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function bT(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function CT(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const yT=1,wT=2,O5=4,ET=8,ST=16,kT=1,DT=4,AT=8,BT=16,H5=1,FT=2,Io=Symbol("uninitialized"),z5="http://www.w3.org/1999/xhtml",LT="http://www.w3.org/2000/svg",IT="http://www.w3.org/1998/Math/MathML";function PT(){console.warn("https://svelte.dev/e/derived_inert")}function TT(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function MT(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function W5(r){return r===this.v}function RT(r,e){return r!=r?e==e:r!==e||r!==null&&typeof r=="object"||typeof r=="function"}function j5(r){return!RT(r,this.v)}let NT=!1,Zo=null;function mp(r){Zo=r}function cs(r,e=!1,t){Zo={p:Zo,i:!1,c:null,e:null,s:r,x:null,r:gs,l:null}}function ds(r){var e=Zo,t=e.e;if(t!==null){e.e=null;for(var i of t)u3(i)}return r!==void 0&&(e.x=r),e.i=!0,Zo=e.p,r??{}}function V5(){return!0}let Jd=[];function $5(){var r=Jd;Jd=[],sT(r)}function Al(r){if(Jd.length===0&&!Ng){var e=Jd;queueMicrotask(()=>{e===Jd&&$5()})}Jd.push(r)}function OT(){for(;Jd.length>0;)$5()}function q5(r){var e=gs;if(e===null)return fs.f|=sd,r;if((e.f&Vp)===0&&(e.f&vp)===0)throw r;Qc(r,e)}function Qc(r,e){for(;e!==null;){if((e.f&my)!==0){if((e.f&Vp)===0)throw r;try{e.b.error(r);return}catch(t){r=t}}e=e.parent}throw r}const HT=-7169;function xo(r,e){r.f=r.f&HT|e}function r9(r){(r.f&xa)!==0||r.deps===null?xo(r,To):xo(r,Pl)}function U5(r){if(r!==null)for(const e of r)(e.f&Yo)===0||(e.f&rh)===0||(e.f^=rh,U5(e.deps))}function G5(r,e,t){(r.f&No)!==0?e.add(r):(r.f&Pl)!==0&&t.add(r),U5(r.deps),xo(r,To)}let jv=!1;function zT(r){var e=jv;try{return jv=!1,[r(),jv]}finally{jv=e}}let Ib=null,qh=null,Nn=null,Rg=null,Vo=null,yy=null,Ng=!1,Pb=!1,mf=null,Bx=null;var c8=0;let WT=1;var jf,Kc,nu,Vf,$f,qf,Xl,Uf,Fr,j0,Ql,Ta,gl,Gf,su,Xs,wy,_g,Ey,K5,Z5,lf,jT,bg;const b_=class b_{constructor(){Qn(this,Xs);is(this,"id",WT++);Qn(this,jf,!1);is(this,"linked",!0);Qn(this,Kc,null);Qn(this,nu,null);is(this,"async_deriveds",new Map);is(this,"current",new Map);is(this,"previous",new Map);Qn(this,Vf,new Set);Qn(this,$f,new Set);Qn(this,qf,0);Qn(this,Xl,new Map);Qn(this,Uf,null);Qn(this,Fr,[]);Qn(this,j0,[]);Qn(this,Ql,new Set);Qn(this,Ta,new Set);Qn(this,gl,new Map);Qn(this,Gf,new Set);is(this,"is_fork",!1);Qn(this,su,!1);qh===null?Ib=qh=this:(Jn(qh,nu,this),Jn(this,Kc,qh)),qh=this}skip_effect(e){Vt(this,gl).has(e)||Vt(this,gl).set(e,{d:[],m:[]}),Vt(this,Gf).delete(e)}unskip_effect(e,t=i=>this.schedule(i)){var i=Vt(this,gl).get(e);if(i){Vt(this,gl).delete(e);for(var n of i.d)xo(n,No),t(n);for(n of i.m)xo(n,Pl),t(n)}Vt(this,Gf).add(e)}capture(e,t,i=!1){e.v!==Io&&!this.previous.has(e)&&this.previous.set(e,e.v),(e.f&sd)===0&&(this.current.set(e,[t,i]),Vo==null||Vo.set(e,t)),this.is_fork||(e.v=t)}activate(){Nn=this}deactivate(){Nn=null,Vo=null}flush(){try{Pb=!0,Nn=this,Ts(this,Xs,_g).call(this)}finally{c8=0,yy=null,mf=null,Bx=null,Pb=!1,Nn=null,Vo=null,hu.clear()}}discard(){var e;for(const t of Vt(this,$f))t(this);Vt(this,$f).clear(),Ts(this,Xs,bg).call(this),(e=Vt(this,Uf))==null||e.resolve()}register_created_effect(e){Vt(this,j0).push(e)}increment(e,t){if(Jn(this,qf,Vt(this,qf)+1),e){let i=Vt(this,Xl).get(t)??0;Vt(this,Xl).set(t,i+1)}}decrement(e,t){if(Jn(this,qf,Vt(this,qf)-1),e){let i=Vt(this,Xl).get(t)??0;i===1?Vt(this,Xl).delete(t):Vt(this,Xl).set(t,i-1)}Vt(this,su)||(Jn(this,su,!0),Al(()=>{Jn(this,su,!1),this.linked&&this.flush()}))}transfer_effects(e,t){for(const i of e)Vt(this,Ql).add(i);for(const i of t)Vt(this,Ta).add(i);e.clear(),t.clear()}oncommit(e){Vt(this,Vf).add(e)}ondiscard(e){Vt(this,$f).add(e)}settled(){return(Vt(this,Uf)??Jn(this,Uf,M5())).promise}static ensure(){if(Nn===null){const e=Nn=new b_;!Pb&&!Ng&&Al(()=>{Vt(e,jf)||e.flush()})}return Nn}apply(){{Vo=null;return}}schedule(e){var n;if(yy=e,(n=e.b)!=null&&n.is_pending&&(e.f&(vp|T1|R5))!==0&&(e.f&Vp)===0){e.b.defer_effect(e);return}for(var t=e;t.parent!==null;){t=t.parent;var i=t.f;if(mf!==null&&t===gs&&(fs===null||(fs.f&Yo)===0))return;if((i&(Sd|Ka))!==0){if((i&To)===0)return;t.f^=To}}Vt(this,Fr).push(t)}};jf=new WeakMap,Kc=new WeakMap,nu=new WeakMap,Vf=new WeakMap,$f=new WeakMap,qf=new WeakMap,Xl=new WeakMap,Uf=new WeakMap,Fr=new WeakMap,j0=new WeakMap,Ql=new WeakMap,Ta=new WeakMap,gl=new WeakMap,Gf=new WeakMap,su=new WeakMap,Xs=new WeakSet,wy=function(){if(this.is_fork)return!0;for(const i of Vt(this,Xl).keys()){for(var e=i,t=!1;e.parent!==null;){if(Vt(this,gl).has(e)){t=!0;break}e=e.parent}if(!t)return!0}return!1},_g=function(){var d,u,g,x;Jn(this,jf,!0),c8++>1e3&&(Ts(this,Xs,bg).call(this),$T());for(const m of Vt(this,Ql))Vt(this,Ta).delete(m),xo(m,No),this.schedule(m);for(const m of Vt(this,Ta))xo(m,Pl),this.schedule(m);const e=Vt(this,Fr);Jn(this,Fr,[]),this.apply();var t=mf=[],i=[],n=Bx=[];for(const m of e)try{Ts(this,Xs,Ey).call(this,m,t,i)}catch(C){throw Q5(m),Ts(this,Xs,wy).call(this)||this.discard(),C}if(Nn=null,n.length>0){var s=b_.ensure();for(const m of n)s.schedule(m)}if(mf=null,Bx=null,Ts(this,Xs,wy).call(this)){Ts(this,Xs,lf).call(this,i),Ts(this,Xs,lf).call(this,t);for(const[m,C]of Vt(this,gl))X5(m,C);n.length>0&&Ts(d=Nn,Xs,_g).call(d);return}const a=Ts(this,Xs,K5).call(this);if(a){Ts(this,Xs,lf).call(this,i),Ts(this,Xs,lf).call(this,t),Ts(u=a,Xs,Z5).call(u,this);return}Vt(this,Ql).clear(),Vt(this,Ta).clear();for(const m of Vt(this,Vf))m(this);Vt(this,Vf).clear(),Rg=this,d8(i),d8(t),Rg=null,(g=Vt(this,Uf))==null||g.resolve();var l=Nn;if(Vt(this,qf)===0&&(Vt(this,Fr).length===0||l!==null)&&Ts(this,Xs,bg).call(this),Vt(this,Fr).length>0)if(l!==null){const m=l;Vt(m,Fr).push(...Vt(this,Fr).filter(C=>!Vt(m,Fr).includes(C)))}else l=this;l!==null&&Ts(x=l,Xs,_g).call(x)},Ey=function(e,t,i){e.f^=To;for(var n=e.first;n!==null;){var s=n.f,a=(s&(Ka|Sd))!==0,l=a&&(s&To)!==0,d=l||(s&mr)!==0||Vt(this,gl).has(n);if(!d&&n.fn!==null){a?n.f^=To:(s&vp)!==0?t.push(n):fv(n)&&((s&Ua)!==0&&Vt(this,Ta).add(n),bp(n));var u=n.first;if(u!==null){n=u;continue}}for(;n!==null;){var g=n.next;if(g!==null){n=g;break}n=n.parent}}},K5=function(){for(var e=Vt(this,Kc);e!==null;){if(!e.is_fork){for(const[t,[,i]]of this.current)if(e.current.has(t)&&!i)return e}e=Vt(e,Kc)}return null},Z5=function(e){var i;for(const[n,s]of e.current)!this.previous.has(n)&&e.previous.has(n)&&this.previous.set(n,e.previous.get(n)),this.current.set(n,s);for(const[n,s]of e.async_deriveds){const a=this.async_deriveds.get(n);a&&s.promise.then(a.resolve).catch(a.reject)}this.transfer_effects(Vt(e,Ql),Vt(e,Ta));const t=n=>{var s=n.reactions;if(s!==null)for(const d of s){var a=d.f;if((a&Yo)!==0)t(d);else{var l=d;a&(Tf|Ua)&&!this.async_deriveds.has(l)&&(Vt(this,Ta).delete(l),xo(l,No),this.schedule(l))}}};for(const n of this.current.keys())t(n);this.oncommit(()=>e.discard()),Ts(i=e,Xs,bg).call(i),Nn=this,Ts(this,Xs,_g).call(this)},lf=function(e){for(var t=0;t<e.length;t+=1)G5(e[t],Vt(this,Ql),Vt(this,Ta))},jT=function(){var g;for(let x=Ib;x!==null;x=Vt(x,nu)){var e=x.id<this.id,t=[];for(const[m,[C,_]]of this.current){if(x.current.has(m)){var i=x.current.get(m)[0];if(e&&C!==i)x.current.set(m,[C,_]);else continue}t.push(m)}if(e)for(const[m,C]of this.async_deriveds){const _=x.async_deriveds.get(m);_&&C.promise.then(_.resolve).catch(_.reject)}if(Vt(x,jf)){var n=[...x.current.keys()].filter(m=>!x.current.get(m)[1]&&!this.current.has(m));if(n.length===0)e&&x.discard();else if(t.length>0){if(e)for(const m of Vt(this,Gf))x.unskip_effect(m,C=>{var _;(C.f&(Ua|Tf))!==0?x.schedule(C):Ts(_=x,Xs,lf).call(_,[C])});x.activate();var s=new Set,a=new Map;for(var l of t)Y5(l,n,s,a);a=new Map;var d=[...x.current].filter(([m,C])=>{const _=this.current.get(m);return _?_[0]!==C[0]||_[1]!==C[1]:!0}).map(([m])=>m);if(d.length>0)for(const m of Vt(this,j0))(m.f&(ma|mr|cm))===0&&a9(m,d,a)&&((m.f&(Tf|Ua))!==0?(xo(m,No),x.schedule(m)):Vt(x,Ql).add(m));if(Vt(x,Fr).length>0&&!Vt(x,su)){x.apply();for(var u of Vt(x,Fr))Ts(g=x,Xs,Ey).call(g,u,[],[]);Jn(x,Fr,[])}x.deactivate()}}}},bg=function(){if(this.linked){var e=Vt(this,Kc),t=Vt(this,nu);e===null?Ib=t:Jn(e,nu,t),t===null?qh=e:Jn(t,Kc,e),this.linked=!1}};let ah=b_;function VT(r){var e=Ng;Ng=!0;try{for(var t;;){if(OT(),Nn===null)return t;Nn.flush()}}finally{Ng=e}}function $T(){try{vT()}catch(r){Qc(r,yy)}}let La=null;function d8(r){var e=r.length;if(e!==0){for(var t=0;t<e;){var i=r[t++];if((i.f&(ma|mr))===0&&fv(i)&&(La=new Set,bp(i),i.deps===null&&i.first===null&&i.nodes===null&&i.teardown===null&&i.ac===null&&p3(i),(La==null?void 0:La.size)>0)){hu.clear();for(const n of La){if((n.f&(ma|mr))!==0)continue;const s=[n];let a=n.parent;for(;a!==null;)La.has(a)&&(La.delete(a),s.push(a)),a=a.parent;for(let l=s.length-1;l>=0;l--){const d=s[l];(d.f&(ma|mr))===0&&bp(d)}}La.clear()}}La=null}}function Y5(r,e,t,i){if(!t.has(r)&&(t.add(r),r.reactions!==null))for(const n of r.reactions){const s=n.f;(s&Yo)!==0?Y5(n,e,t,i):(s&(Tf|Ua))!==0&&(s&No)===0&&a9(n,e,i)&&(xo(n,No),l9(n))}}function a9(r,e,t){const i=t.get(r);if(i!==void 0)return i;if(r.deps!==null)for(const n of r.deps){if(am.call(e,n))return!0;if((n.f&Yo)!==0&&a9(n,e,t))return t.set(n,!0),!0}return t.set(r,!1),!1}function l9(r){Nn.schedule(r)}function X5(r,e){if(!((r.f&Ka)!==0&&(r.f&To)!==0)){(r.f&No)!==0?e.d.push(r):(r.f&Pl)!==0&&e.m.push(r),xo(r,To);for(var t=r.first;t!==null;)X5(t,e),t=t.next}}function Q5(r){xo(r,To);for(var e=r.first;e!==null;)Q5(e),e=e.next}function qT(r){let e=0,t=lh(0),i;return()=>{u9()&&(o(t),hv(()=>(e===0&&(i=Eo(()=>r(()=>Og(t)))),e+=1,()=>{Al(()=>{e-=1,e===0&&(i==null||i(),i=void 0,Og(t))})})))}}var UT=xp|$p;function GT(r,e,t,i){new KT(r,e,t,i)}var ra,BS,aa,ou,Lr,la,pr,Vr,Jl,ru,Zc,Kf,V0,$0,ec,C_,mo,ZT,YT,XT,Sy,Fx,Lx,ky,Dy;class KT{constructor(e,t,i,n){Qn(this,mo);is(this,"parent");is(this,"is_pending",!1);is(this,"transform_error");Qn(this,ra);Qn(this,BS,null);Qn(this,aa);Qn(this,ou);Qn(this,Lr);Qn(this,la,null);Qn(this,pr,null);Qn(this,Vr,null);Qn(this,Jl,null);Qn(this,ru,0);Qn(this,Zc,0);Qn(this,Kf,!1);Qn(this,V0,new Set);Qn(this,$0,new Set);Qn(this,ec,null);Qn(this,C_,qT(()=>(Jn(this,ec,lh(Vt(this,ru))),()=>{Jn(this,ec,null)})));var s;Jn(this,ra,e),Jn(this,aa,t),Jn(this,ou,a=>{var l=gs;l.b=this,l.f|=my,i(a)}),this.parent=gs.b,this.transform_error=n??((s=this.parent)==null?void 0:s.transform_error)??(a=>a),Jn(this,Lr,H1(()=>{Ts(this,mo,Sy).call(this)},UT))}defer_effect(e){G5(e,Vt(this,V0),Vt(this,$0))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!Vt(this,aa).pending}update_pending_count(e,t){Ts(this,mo,ky).call(this,e,t),Jn(this,ru,Vt(this,ru)+e),!(!Vt(this,ec)||Vt(this,Kf))&&(Jn(this,Kf,!0),Al(()=>{Jn(this,Kf,!1),Vt(this,ec)&&_p(Vt(this,ec),Vt(this,ru))}))}get_effect_pending(){return Vt(this,C_).call(this),o(Vt(this,ec))}error(e){if(!Vt(this,aa).onerror&&!Vt(this,aa).failed)throw e;Nn!=null&&Nn.is_fork?(Vt(this,la)&&Nn.skip_effect(Vt(this,la)),Vt(this,pr)&&Nn.skip_effect(Vt(this,pr)),Vt(this,Vr)&&Nn.skip_effect(Vt(this,Vr)),Nn.oncommit(()=>{Ts(this,mo,Dy).call(this,e)})):Ts(this,mo,Dy).call(this,e)}}ra=new WeakMap,BS=new WeakMap,aa=new WeakMap,ou=new WeakMap,Lr=new WeakMap,la=new WeakMap,pr=new WeakMap,Vr=new WeakMap,Jl=new WeakMap,ru=new WeakMap,Zc=new WeakMap,Kf=new WeakMap,V0=new WeakMap,$0=new WeakMap,ec=new WeakMap,C_=new WeakMap,mo=new WeakSet,ZT=function(){try{Jn(this,la,ca(()=>Vt(this,ou).call(this,Vt(this,ra))))}catch(e){this.error(e)}},YT=function(e){const t=Vt(this,aa).failed;t&&Jn(this,Vr,ca(()=>{t(Vt(this,ra),()=>e,()=>()=>{})}))},XT=function(){const e=Vt(this,aa).pending;e&&(this.is_pending=!0,Jn(this,pr,ca(()=>e(Vt(this,ra)))),Al(()=>{var t=Jn(this,Jl,document.createDocumentFragment()),i=dc();t.append(i),Jn(this,la,Ts(this,mo,Lx).call(this,()=>ca(()=>Vt(this,ou).call(this,i)))),Vt(this,Zc)===0&&(Vt(this,ra).before(t),Jn(this,Jl,null),fu(Vt(this,pr),()=>{Jn(this,pr,null)}),Ts(this,mo,Fx).call(this,Nn))}))},Sy=function(){try{if(this.is_pending=this.has_pending_snippet(),Jn(this,Zc,0),Jn(this,ru,0),Jn(this,la,ca(()=>{Vt(this,ou).call(this,Vt(this,ra))})),Vt(this,Zc)>0){var e=Jn(this,Jl,document.createDocumentFragment());p9(Vt(this,la),e);const t=Vt(this,aa).pending;Jn(this,pr,ca(()=>t(Vt(this,ra))))}else Ts(this,mo,Fx).call(this,Nn)}catch(t){this.error(t)}},Fx=function(e){this.is_pending=!1,e.transfer_effects(Vt(this,V0),Vt(this,$0))},Lx=function(e){var t=gs,i=fs,n=Zo;Tl(Vt(this,Lr)),ya(Vt(this,Lr)),mp(Vt(this,Lr).ctx);try{return ah.ensure(),e()}catch(s){return q5(s),null}finally{Tl(t),ya(i),mp(n)}},ky=function(e,t){var i;if(!this.has_pending_snippet()){this.parent&&Ts(i=this.parent,mo,ky).call(i,e,t);return}Jn(this,Zc,Vt(this,Zc)+e),Vt(this,Zc)===0&&(Ts(this,mo,Fx).call(this,t),Vt(this,pr)&&fu(Vt(this,pr),()=>{Jn(this,pr,null)}),Vt(this,Jl)&&(Vt(this,ra).before(Vt(this,Jl)),Jn(this,Jl,null)))},Dy=function(e){Vt(this,la)&&(Or(Vt(this,la)),Jn(this,la,null)),Vt(this,pr)&&(Or(Vt(this,pr)),Jn(this,pr,null)),Vt(this,Vr)&&(Or(Vt(this,Vr)),Jn(this,Vr,null));var t=Vt(this,aa).onerror;let i=Vt(this,aa).failed;var n=!1,s=!1;const a=()=>{if(n){MT();return}n=!0,s&&CT(),Vt(this,Vr)!==null&&fu(Vt(this,Vr),()=>{Jn(this,Vr,null)}),Ts(this,mo,Lx).call(this,()=>{Ts(this,mo,Sy).call(this)})},l=d=>{try{s=!0,t==null||t(d,a),s=!1}catch(u){Qc(u,Vt(this,Lr)&&Vt(this,Lr).parent)}i&&Jn(this,Vr,Ts(this,mo,Lx).call(this,()=>{try{return ca(()=>{var u=gs;u.b=this,u.f|=my,i(Vt(this,ra),()=>d,()=>a)})}catch(u){return Qc(u,Vt(this,Lr).parent),null}}))};Al(()=>{var d;try{d=this.transform_error(e)}catch(u){Qc(u,Vt(this,Lr)&&Vt(this,Lr).parent);return}d!==null&&typeof d=="object"&&typeof d.then=="function"?d.then(l,u=>Qc(u,Vt(this,Lr)&&Vt(this,Lr).parent)):l(d)})};function QT(r,e,t,i){const n=u0;var s=r.filter(m=>!m.settled);if(t.length===0&&s.length===0){i(e.map(n));return}var a=gs,l=JT(),d=s.length===1?s[0].promise:s.length>1?Promise.all(s.map(m=>m.promise)):null;function u(m){if((a.f&ma)===0){l();try{i(m)}catch(C){Qc(C,a)}um()}}var g=J5();if(t.length===0){d.then(()=>u(e.map(n))).finally(g);return}function x(){Promise.all(t.map(m=>eM(m))).then(m=>u([...e.map(n),...m])).catch(m=>Qc(m,a)).finally(g)}d?d.then(()=>{l(),x(),um()}):x()}function JT(){var r=gs,e=fs,t=Zo,i=Nn;return function(s=!0){Tl(r),ya(e),mp(t),s&&(r.f&ma)===0&&(i==null||i.activate(),i==null||i.apply())}}function um(r=!0){Tl(null),ya(null),mp(null),r&&(Nn==null||Nn.deactivate())}function J5(){var r=gs,e=r.b,t=Nn,i=!!(e!=null&&e.is_rendered());return e==null||e.update_pending_count(1,t),t.increment(i,r),()=>{e==null||e.update_pending_count(-1,t),t.decrement(i,r)}}function u0(r){var e=Yo|No;return gs!==null&&(gs.f|=$p),{ctx:Zo,deps:null,effects:null,equals:W5,f:e,fn:r,reactions:null,rv:0,v:Io,wv:0,parent:gs,ac:null}}const Vv=Symbol("obsolete");function eM(r,e,t){let i=gs;i===null&&uT();var n=void 0,s=lh(Io),a=!fs,l=new Set;return uM(()=>{var C,_;var d=gs,u=M5();n=u.promise;try{Promise.resolve(r()).then(u.resolve,E=>{E!==M1&&u.reject(E)}).finally(um)}catch(E){u.reject(E),um()}var g=Nn;if(a){if((d.f&Vp)!==0)var x=J5();if((C=i.b)!=null&&C.is_rendered())(_=g.async_deriveds.get(d))==null||_.reject(Vv);else for(const E of l.values())E.reject(Vv);l.add(u),g.async_deriveds.set(d,u)}const m=(E,S=void 0)=>{x==null||x(),l.delete(u),S!==Vv&&(g.activate(),S?(s.f|=sd,_p(s,S)):((s.f&sd)!==0&&(s.f^=sd),_p(s,E)),g.deactivate())};u.promise.then(m,E=>m(null,E||"unknown"))}),O1(()=>{for(const d of l)d.reject(Vv)}),new Promise(d=>{function u(g){function x(){g===n?d(s):u(n)}g.then(x,x)}u(n)})}function ot(r){const e=u0(r);return x3(e),e}function c9(r){const e=u0(r);return e.equals=j5,e}function tM(r){var e=r.effects;if(e!==null){r.effects=null;for(var t=0;t<e.length;t+=1)Or(e[t])}}function d9(r){var e,t=gs,i=r.parent;if(!mc&&i!==null&&r.v!==Io&&(i.f&(ma|mr))!==0)return PT(),r.v;Tl(i);try{r.f&=~rh,tM(r),e=C3(r)}finally{Tl(t)}return e}function e3(r){var e=d9(r);if(!r.equals(e)&&(r.wv=_3(),(!(Nn!=null&&Nn.is_fork)||r.deps===null)&&(Nn!==null?(Nn.capture(r,e,!0),Rg==null||Rg.capture(r,e,!0)):r.v=e,r.deps===null))){xo(r,To);return}mc||(Vo!==null?(u9()||Nn!=null&&Nn.is_fork)&&Vo.set(r,e):r9(r))}function iM(r){var e,t;if(r.effects!==null)for(const i of r.effects)(i.teardown||i.ac)&&((e=i.teardown)==null||e.call(i),(t=i.ac)==null||t.abort(M1),i.fn!==null&&(i.teardown=jo),i.ac=null,h0(i,0),f9(i))}function t3(r){if(r.effects!==null)for(const e of r.effects)e.teardown&&e.fn!==null&&bp(e)}let hm=new Set;const hu=new Map;let i3=!1;function lh(r,e){var t={f:0,v:r,reactions:null,equals:W5,rv:0,wv:0};return t}function A(r,e){const t=lh(r);return x3(t),t}function nM(r,e=!1,t=!0){const i=lh(r);return e||(i.equals=j5),i}function p(r,e,t=!1){fs!==null&&(!Ga||(fs.f&cm)!==0)&&V5()&&(fs.f&(Yo|Ua|Tf|cm))!==0&&(Bl===null||!Bl.has(r))&&bT();let i=t?_i(e):e;return _p(r,i,Bx)}function _p(r,e,t=null){if(!r.equals(e)){hu.set(r,mc?e:r.v);var i=ah.ensure();if(i.capture(r,e),(r.f&Yo)!==0){const n=r;(r.f&No)!==0&&d9(n),Vo===null&&r9(n)}r.wv=_3(),n3(r,No,t),gs!==null&&(gs.f&To)!==0&&(gs.f&(Ka|Sd))===0&&(oa===null?fM([r]):oa.push(r)),!i.is_fork&&hm.size>0&&!i3&&sM()}return e}function sM(){i3=!1;for(const r of hm){(r.f&To)!==0&&xo(r,Pl);let e;try{e=fv(r)}catch{e=!0}e&&bp(r)}hm.clear()}function Ay(r,e=1){var t=o(r),i=e===1?t++:t--;return p(r,t),i}function Og(r){p(r,r.v+1)}function n3(r,e,t){var i=r.reactions;if(i!==null)for(var n=i.length,s=0;s<n;s++){var a=i[s],l=a.f,d=(l&No)===0;if(d&&xo(a,e),(l&cm)!==0)hm.add(a);else if((l&Yo)!==0){var u=a;Vo==null||Vo.delete(u),(l&rh)===0&&(l&xa&&(gs===null||(gs.f&dm)===0)&&(a.f|=rh),n3(u,Pl,t))}else if(d){var g=a;(l&Ua)!==0&&La!==null&&La.add(g),t!==null?t.push(g):l9(g)}}}function _i(r){if(typeof r!="object"||r===null||uu in r)return r;const e=T5(r);if(e!==iT&&e!==nT)return r;var t=new Map,i=o9(r),n=A(0),s=pu,a=l=>{if(pu===s)return l();var d=fs,u=pu;ya(null),p8(s);var g=l();return ya(d),p8(u),g};return i&&t.set("length",A(r.length)),new Proxy(r,{defineProperty(l,d,u){(!("value"in u)||u.configurable===!1||u.enumerable===!1||u.writable===!1)&&mT();var g=t.get(d);return g===void 0?a(()=>{var x=A(u.value);return t.set(d,x),x}):p(g,u.value,!0),!0},deleteProperty(l,d){var u=t.get(d);if(u===void 0){if(d in l){const g=a(()=>A(Io));t.set(d,g),Og(n)}}else p(u,Io),Og(n);return!0},get(l,d,u){var C;if(d===uu)return r;var g=t.get(d),x=d in l;if(g===void 0&&(!x||(C=Pf(l,d))!=null&&C.writable)&&(g=a(()=>{var _=_i(x?l[d]:Io),E=A(_);return E}),t.set(d,g)),g!==void 0){var m=o(g);return m===Io?void 0:m}return Reflect.get(l,d,u)},getOwnPropertyDescriptor(l,d){var u=Reflect.getOwnPropertyDescriptor(l,d);if(u&&"value"in u){var g=t.get(d);g&&(u.value=o(g))}else if(u===void 0){var x=t.get(d),m=x==null?void 0:x.v;if(x!==void 0&&m!==Io)return{enumerable:!0,configurable:!0,value:m,writable:!0}}return u},has(l,d){var m;if(d===uu)return!0;var u=t.get(d),g=u!==void 0&&u.v!==Io||Reflect.has(l,d);if(u!==void 0||gs!==null&&(!g||(m=Pf(l,d))!=null&&m.writable)){u===void 0&&(u=a(()=>{var C=g?_i(l[d]):Io,_=A(C);return _}),t.set(d,u));var x=o(u);if(x===Io)return!1}return g},set(l,d,u,g){var O;var x=t.get(d),m=d in l;if(i&&d==="length")for(var C=u;C<x.v;C+=1){var _=t.get(C+"");_!==void 0?p(_,Io):C in l&&(_=a(()=>A(Io)),t.set(C+"",_))}if(x===void 0)(!m||(O=Pf(l,d))!=null&&O.writable)&&(x=a(()=>A(void 0)),p(x,_i(u)),t.set(d,x));else{m=x.v!==Io;var E=a(()=>_i(u));p(x,E)}var S=Reflect.getOwnPropertyDescriptor(l,d);if(S!=null&&S.set&&S.set.call(g,u),!m){if(i&&typeof d=="string"){var I=t.get("length"),M=Number(d);Number.isInteger(M)&&M>=I.v&&p(I,M+1)}Og(n)}return!0},ownKeys(l){o(n);var d=Reflect.ownKeys(l).filter(x=>{var m=t.get(x);return m===void 0||m.v!==Io});for(var[u,g]of t)g.v!==Io&&!(u in l)&&d.push(u);return d},setPrototypeOf(){_T()}})}function u8(r){try{if(r!==null&&typeof r=="object"&&uu in r)return r[uu]}catch{}return r}function s3(r,e){return Object.is(u8(r),u8(e))}var _a,o3,r3,a3,l3;function oM(){if(_a===void 0){_a=window,o3=document,r3=/Firefox/.test(navigator.userAgent);var r=Element.prototype,e=Node.prototype,t=Text.prototype;a3=Pf(e,"firstChild").get,l3=Pf(e,"nextSibling").get,l8(r)&&(r[by]=void 0,r[Dx]=null,r[Cy]=void 0,r.__e=void 0),l8(t)&&(t[mg]=void 0)}}function dc(r=""){return document.createTextNode(r)}function Zr(r){return a3.call(r)}function uv(r){return l3.call(r)}function f(r,e){return Zr(r)}function yt(r,e=!1){{var t=Zr(r);return t instanceof Comment&&t.data===""?uv(t):t}}function h(r,e=1,t=!1){let i=r;for(;e--;)i=uv(i);return i}function rM(r){r.textContent=""}function c3(){return!1}function d3(r,e,t){return e==null||e===z5?t?document.createElement(r,{is:t}):document.createElement(r):t?document.createElementNS(e,r,{is:t}):document.createElementNS(e,r)}let h8=!1;function aM(){h8||(h8=!0,document.addEventListener("reset",r=>{Promise.resolve().then(()=>{var e;if(!r.defaultPrevented)for(const t of r.target.elements)(e=t[Ax])==null||e.call(t)})},{capture:!0}))}function R1(r){var e=fs,t=gs;ya(null),Tl(null);try{return r()}finally{ya(e),Tl(t)}}function N1(r,e,t,i=t){r.addEventListener(e,()=>R1(t));const n=r[Ax];n?r[Ax]=()=>{n(),i(!0)}:r[Ax]=()=>i(!0),aM()}function lM(r){gs===null&&(fs===null&&gT(),pT()),mc&&fT()}function cM(r,e){var t=e.last;t===null?e.last=e.first=r:(t.next=r,r.prev=t,e.last=r)}function Ac(r,e){var t=gs;t!==null&&(t.f&mr)!==0&&(r|=mr);var i={ctx:Zo,deps:null,nodes:null,f:r|No|xa,first:null,fn:e,last:null,next:null,parent:t,b:t&&t.b,prev:null,teardown:null,wv:0,ac:null};Nn==null||Nn.register_created_effect(i);var n=i;if((r&vp)!==0)mf!==null?mf.push(i):ah.ensure().schedule(i);else if(e!==null){try{bp(i)}catch(a){throw Or(i),a}n.deps===null&&n.teardown===null&&n.nodes===null&&n.first===n.last&&(n.f&$p)===0&&(n=n.first,(r&Ua)!==0&&(r&xp)!==0&&n!==null&&(n.f|=xp))}if(n!==null&&(n.parent=t,t!==null&&cM(n,t),fs!==null&&(fs.f&Yo)!==0&&(r&Sd)===0)){var s=fs;(s.effects??(s.effects=[])).push(n)}return i}function u9(){return fs!==null&&!Ga}function O1(r){const e=Ac(T1,null);return xo(e,To),e.teardown=r,e}function tn(r){lM();var e=gs.f,t=!fs&&(e&Ka)!==0&&Zo!==null&&!Zo.i;if(t){var i=Zo;(i.e??(i.e=[])).push(r)}else return u3(r)}function u3(r){return Ac(vp|aT,r)}function dM(r){ah.ensure();const e=Ac(Sd|$p,r);return(t={})=>new Promise(i=>{t.outro?fu(e,()=>{Or(e),i(void 0)}):(Or(e),i(void 0))})}function h9(r){return Ac(vp,r)}function uM(r){return Ac(Tf|$p,r)}function hv(r,e=0){return Ac(T1|e,r)}function P(r,e=[],t=[],i=[]){QT(i,e,t,n=>{Ac(T1,()=>r(...n.map(o)))})}function H1(r,e=0){var t=Ac(Ua|e,r);return t}function ca(r){return Ac(Ka|$p,r)}function h3(r){var e=r.teardown;if(e!==null){const t=mc,i=fs;f8(!0),ya(null);try{e.call(null)}finally{f8(t),ya(i)}}}function f9(r,e=!1){var t=r.first;for(r.first=r.last=null;t!==null;){const n=t.ac;n!==null&&R1(()=>{n.abort(M1)});var i=t.next;(t.f&Sd)!==0?t.parent=null:Or(t,e),t=i}}function hM(r){for(var e=r.first;e!==null;){var t=e.next;(e.f&Ka)===0&&Or(e),e=t}}function Or(r,e=!0){var t=!1;(e||(r.f&rT)!==0)&&r.nodes!==null&&r.nodes.end!==null&&(f3(r.nodes.start,r.nodes.end),t=!0),xo(r,_y),f9(r,e&&!t),h0(r,0);var i=r.nodes&&r.nodes.t;if(i!==null)for(const s of i)s.stop();h3(r),r.f^=_y,r.f|=ma;var n=r.parent;n!==null&&n.first!==null&&p3(r),r.next=r.prev=r.teardown=r.ctx=r.deps=r.fn=r.nodes=r.ac=r.b=null}function f3(r,e){for(;r!==null;){var t=r===e?null:uv(r);r.remove(),r=t}}function p3(r){var e=r.parent,t=r.prev,i=r.next;t!==null&&(t.next=i),i!==null&&(i.prev=t),e!==null&&(e.first===r&&(e.first=i),e.last===r&&(e.last=t))}function fu(r,e,t=!0){var i=[];g3(r,i,!0);var n=()=>{t&&Or(r),e&&e()},s=i.length;if(s>0){var a=()=>--s||n();for(var l of i)l.out(a)}else n()}function g3(r,e,t){if((r.f&mr)===0){r.f^=mr;var i=r.nodes&&r.nodes.t;if(i!==null)for(const l of i)(l.is_global||t)&&e.push(l);for(var n=r.first;n!==null;){var s=n.next;if((n.f&Sd)===0){var a=(n.f&xp)!==0||(n.f&Ka)!==0&&(r.f&Ua)!==0;g3(n,e,a?t:!1)}n=s}}}function fm(r){v3(r,!0)}function v3(r,e){if((r.f&mr)!==0){r.f^=mr,(r.f&To)===0&&(xo(r,No),ah.ensure().schedule(r));for(var t=r.first;t!==null;){var i=t.next,n=(t.f&xp)!==0||(t.f&Ka)!==0;v3(t,n?e:!1),t=i}var s=r.nodes&&r.nodes.t;if(s!==null)for(const a of s)(a.is_global||e)&&a.in()}}function p9(r,e){if(r.nodes)for(var t=r.nodes.start,i=r.nodes.end;t!==null;){var n=t===i?null:uv(t);e.append(t),t=n}}let Ix=!1,mc=!1;function f8(r){mc=r}let fs=null,Ga=!1;function ya(r){fs=r}let gs=null;function Tl(r){gs=r}let Bl=null;function x3(r){fs!==null&&(Bl??(Bl=new Set)).add(r)}let Ir=null,Wr=0,oa=null;function fM(r){oa=r}let m3=1,eu=0,pu=eu;function p8(r){pu=r}function _3(){return++m3}function fv(r){var e=r.f;if((e&No)!==0)return!0;if(e&Yo&&(r.f&=~rh),(e&Pl)!==0){for(var t=r.deps,i=t.length,n=0;n<i;n++){var s=t[n];if(fv(s)&&e3(s),s.wv>r.wv)return!0}(e&xa)!==0&&Vo===null&&xo(r,To)}return!1}function b3(r,e,t=!0){var i=r.reactions;if(i!==null&&!(Bl!==null&&Bl.has(r)))for(var n=0;n<i.length;n++){var s=i[n];(s.f&Yo)!==0?b3(s,e,!1):e===s&&(t?xo(s,No):(s.f&To)!==0&&xo(s,Pl),l9(s))}}function C3(r){var E;var e=Ir,t=Wr,i=oa,n=fs,s=Bl,a=Zo,l=Ga,d=pu,u=r.f;Ir=null,Wr=0,oa=null,fs=(u&(Ka|Sd))===0?r:null,Bl=null,mp(r.ctx),Ga=!1,pu=++eu,r.ac!==null&&(R1(()=>{r.ac.abort(M1)}),r.ac=null);try{r.f|=dm;var g=r.fn,x=g();r.f|=Vp;var m=r.deps,C=Nn==null?void 0:Nn.is_fork;if(Ir!==null){var _;if(C||h0(r,Wr),m!==null&&Wr>0)for(m.length=Wr+Ir.length,_=0;_<Ir.length;_++)m[Wr+_]=Ir[_];else r.deps=m=Ir;if(u9()&&(r.f&xa)!==0)for(_=Wr;_<m.length;_++)((E=m[_]).reactions??(E.reactions=[])).push(r)}else!C&&m!==null&&Wr<m.length&&(h0(r,Wr),m.length=Wr);if(V5()&&oa!==null&&!Ga&&m!==null&&(r.f&(Yo|Pl|No))===0)for(_=0;_<oa.length;_++)b3(oa[_],r);if(n!==null&&n!==r){if(eu++,n.deps!==null)for(let S=0;S<t;S+=1)n.deps[S].rv=eu;if(e!==null)for(const S of e)S.rv=eu;oa!==null&&(i===null?i=oa:i.push(...oa))}return(r.f&sd)!==0&&(r.f^=sd),x}catch(S){return q5(S)}finally{r.f^=dm,Ir=e,Wr=t,oa=i,fs=n,Bl=s,mp(a),Ga=l,pu=d}}function pM(r,e){let t=e.reactions;if(t!==null){var i=JP.call(t,r);if(i!==-1){var n=t.length-1;n===0?t=e.reactions=null:(t[i]=t[n],t.pop())}}if(t===null&&(e.f&Yo)!==0&&(Ir===null||!am.call(Ir,e))){var s=e;(s.f&xa)!==0&&(s.f^=xa,s.f&=~rh),s.v!==Io&&r9(s),iM(s),h0(s,0)}}function h0(r,e){var t=r.deps;if(t!==null)for(var i=e;i<t.length;i++)pM(r,t[i])}function bp(r){var e=r.f;if((e&ma)===0){xo(r,To);var t=gs,i=Ix;gs=r,Ix=!0;try{(e&(Ua|R5))!==0?hM(r):f9(r),h3(r);var n=C3(r);r.teardown=typeof n=="function"?n:null,r.wv=m3;var s;P5&&NT&&(r.f&No)!==0&&r.deps}finally{Ix=i,gs=t}}}async function ua(){await Promise.resolve(),VT()}function o(r){var e=r.f,t=(e&Yo)!==0;if(fs!==null&&!Ga){var i=gs!==null&&(gs.f&ma)!==0;if(!i&&(Bl===null||!Bl.has(r))){var n=fs.deps;if((fs.f&dm)!==0)r.rv<eu&&(r.rv=eu,Ir===null&&n!==null&&n[Wr]===r?Wr++:Ir===null?Ir=[r]:Ir.push(r));else{fs.deps??(fs.deps=[]),am.call(fs.deps,r)||fs.deps.push(r);var s=r.reactions;s===null?r.reactions=[fs]:am.call(s,fs)||s.push(fs)}}}if(mc&&hu.has(r))return hu.get(r);if(t){var a=r;if(mc){var l=a.v;return((a.f&To)===0&&a.reactions!==null||w3(a))&&(l=d9(a)),hu.set(a,l),l}var d=(a.f&xa)===0&&!Ga&&fs!==null&&(Ix||(fs.f&xa)!==0),u=(a.f&Vp)===0;fv(a)&&(d&&(a.f|=xa),e3(a)),d&&!u&&(t3(a),y3(a))}if(Vo!=null&&Vo.has(r))return Vo.get(r);if((r.f&sd)!==0)throw r.v;return r.v}function y3(r){if(r.f|=xa,r.deps!==null)for(const e of r.deps)(e.reactions??(e.reactions=[])).push(r),(e.f&Yo)!==0&&(e.f&xa)===0&&(t3(e),y3(e))}function w3(r){if(r.v===Io)return!0;if(r.deps===null)return!1;for(const e of r.deps)if(hu.has(e)||(e.f&Yo)!==0&&w3(e))return!0;return!1}function Eo(r){var e=Ga;try{return Ga=!0,r()}finally{Ga=e}}const gM=["touchstart","touchmove"];function vM(r){return gM.includes(r)}const tu=Symbol("events"),E3=new Set,By=new Set;function xM(r,e,t,i={}){function n(s){if(i.capture||Fy.call(e,s),!s.cancelBubble)return R1(()=>t==null?void 0:t.call(this,s))}return r.startsWith("pointer")||r.startsWith("touch")||r==="wheel"?Al(()=>{e.addEventListener(r,n,i)}):e.addEventListener(r,n,i),n}function ys(r,e,t,i,n){var s={capture:i,passive:n},a=xM(r,e,t,s);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&O1(()=>{e.removeEventListener(r,a,s)})}function z(r,e,t){(e[tu]??(e[tu]={}))[r]=t}function _s(r){for(var e=0;e<r.length;e++)E3.add(r[e]);for(var t of By)t(r)}let g8=null;function Fy(r){var E,S;var e=this,t=e.ownerDocument,i=r.type,n=((E=r.composedPath)==null?void 0:E.call(r))||[],s=n[0]||r.target;g8=r;var a=0,l=g8===r&&r[tu];if(l){var d=n.indexOf(l);if(d!==-1&&(e===document||e===window)){r[tu]=e;return}var u=n.indexOf(e);if(u===-1)return;d<=u&&(a=d)}if(s=n[a]||r.target,s!==e){eT(r,"currentTarget",{configurable:!0,get(){return s||t}});var g=fs,x=gs;ya(null),Tl(null);try{for(var m,C=[];s!==null&&s!==e;){try{var _=(S=s[tu])==null?void 0:S[i];_!=null&&(!s.disabled||r.target===s)&&_.call(s,r)}catch(I){m?C.push(I):m=I}if(r.cancelBubble)break;a++,s=a<n.length?n[a]:null}if(m){for(let I of C)queueMicrotask(()=>{throw I});throw m}}finally{r[tu]=e,delete r.currentTarget,ya(g),Tl(x)}}}var t6;const Tb=((t6=globalThis==null?void 0:globalThis.window)==null?void 0:t6.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:r=>r});function mM(r){return(Tb==null?void 0:Tb.createHTML(r))??r}function S3(r){var e=d3("template");return e.innerHTML=mM(r.replaceAll("<!>","<!---->")),e.content}function kd(r,e){var t=gs;t.nodes===null&&(t.nodes={start:r,end:e,a:null,t:null})}function k(r,e){var t=(e&H5)!==0,i=(e&FT)!==0,n,s=!r.startsWith("<!>");return()=>{n===void 0&&(n=S3(s?r:"<!>"+r),t||(n=Zr(n)));var a=i||r3?document.importNode(n,!0):n.cloneNode(!0);if(t){var l=Zr(a),d=a.lastChild;kd(l,d)}else kd(a,a);return a}}function _M(r,e,t="svg"){var i=!r.startsWith("<!>"),n=(e&H5)!==0,s=`<${t}>${i?r:"<!>"+r}</${t}>`,a;return()=>{if(!a){var l=S3(s),d=Zr(l);if(n)for(a=document.createDocumentFragment();Zr(d);)a.appendChild(Zr(d));else a=Zr(d)}var u=a.cloneNode(!0);if(n){var g=Zr(u),x=u.lastChild;kd(g,x)}else kd(u,u);return u}}function Ho(r,e){return _M(r,e,"svg")}function An(r=""){{var e=dc(r+"");return kd(e,e),e}}function Ss(){var r=document.createDocumentFragment(),e=document.createComment(""),t=dc();return r.append(e,t),kd(e,t),r}function y(r,e){r!==null&&r.before(e)}function B(r,e){var t=e==null?"":typeof e=="object"?`${e}`:e;t!==(r[mg]??(r[mg]=r.nodeValue))&&(r[mg]=t,r.nodeValue=`${t}`)}function bM(r,e){return CM(r,e)}const $v=new Map;function CM(r,{target:e,anchor:t,props:i={},events:n,context:s,intro:a=!0,transformError:l}){oM();var d=void 0,u=dM(()=>{var g=t??e.appendChild(dc());GT(g,{pending:()=>{}},C=>{cs({});var _=Zo;s&&(_.c=s),n&&(i.$$events=n),d=r(C,i)||{},ds()},l);var x=new Set,m=C=>{for(var _=0;_<C.length;_++){var E=C[_];if(!x.has(E)){x.add(E);var S=vM(E);for(const O of[e,document]){var I=$v.get(O);I===void 0&&(I=new Map,$v.set(O,I));var M=I.get(E);M===void 0?(O.addEventListener(E,Fy,{passive:S}),I.set(E,1)):I.set(E,M+1)}}}};return m(P1(E3)),By.add(m),()=>{var S;for(var C of x)for(const I of[e,document]){var _=$v.get(I),E=_.get(C);--E==0?(I.removeEventListener(C,Fy),_.delete(C),_.size===0&&$v.delete(I)):_.set(C,E)}By.delete(m),g!==t&&((S=g.parentNode)==null||S.removeChild(g))}});return yM.set(d,u),d}let yM=new WeakMap;var Ma,vl,$r,au,q0,U0,y_;class k3{constructor(e,t=!0){is(this,"anchor");Qn(this,Ma,new Map);Qn(this,vl,new Map);Qn(this,$r,new Map);Qn(this,au,new Set);Qn(this,q0,!0);Qn(this,U0,e=>{if(Vt(this,Ma).has(e)){var t=Vt(this,Ma).get(e),i=Vt(this,vl).get(t);if(i)fm(i),Vt(this,au).delete(t);else{var n=Vt(this,$r).get(t);n&&(fm(n.effect),Vt(this,vl).set(t,n.effect),Vt(this,$r).delete(t),n.fragment.lastChild.remove(),this.anchor.before(n.fragment),i=n.effect)}for(const[s,a]of Vt(this,Ma)){if(Vt(this,Ma).delete(s),s===e)break;const l=Vt(this,$r).get(a);l&&(Or(l.effect),Vt(this,$r).delete(a))}for(const[s,a]of Vt(this,vl)){if(s===t||Vt(this,au).has(s))continue;const l=()=>{if(Array.from(Vt(this,Ma).values()).includes(s)){var u=document.createDocumentFragment();p9(a,u),u.append(dc()),Vt(this,$r).set(s,{effect:a,fragment:u})}else Or(a);Vt(this,au).delete(s),Vt(this,vl).delete(s)};Vt(this,q0)||!i?(Vt(this,au).add(s),fu(a,l,!1)):l()}}});Qn(this,y_,e=>{Vt(this,Ma).delete(e);const t=Array.from(Vt(this,Ma).values());for(const[i,n]of Vt(this,$r))t.includes(i)||(Or(n.effect),Vt(this,$r).delete(i))});this.anchor=e,Jn(this,q0,t)}ensure(e,t){var i=Nn,n=c3();if(t&&!Vt(this,vl).has(e)&&!Vt(this,$r).has(e))if(n){var s=document.createDocumentFragment(),a=dc();s.append(a),Vt(this,$r).set(e,{effect:ca(()=>t(a)),fragment:s})}else Vt(this,vl).set(e,ca(()=>t(this.anchor)));if(Vt(this,Ma).set(i,e),n){for(const[l,d]of Vt(this,vl))l===e?i.unskip_effect(d):i.skip_effect(d);for(const[l,d]of Vt(this,$r))l===e?i.unskip_effect(d.effect):i.skip_effect(d.effect);i.oncommit(Vt(this,U0)),i.ondiscard(Vt(this,y_))}else Vt(this,U0).call(this,i)}}Ma=new WeakMap,vl=new WeakMap,$r=new WeakMap,au=new WeakMap,q0=new WeakMap,U0=new WeakMap,y_=new WeakMap;function T(r,e,t=!1){var i=new k3(r),n=t?xp:0;function s(a,l){i.ensure(a,l)}H1(()=>{var a=!1;e((l,d=0)=>{a=!0,s(d,l)}),a||s(-1,null)},n)}const wM=Symbol("NaN");function D3(r,e,t){var i=new k3(r);H1(()=>{var n=e();n!==n&&(n=wM),i.ensure(n,t)})}function Ki(r,e){return e}function EM(r,e,t){for(var i=[],n=e.length,s,a=e.length,l=0;l<n;l++){let x=e[l];fu(x,()=>{if(s){if(s.pending.delete(x),s.done.add(x),s.pending.size===0){var m=r.outrogroups;Ly(r,P1(s.done)),m.delete(s),m.size===0&&(r.outrogroups=null)}}else a-=1},!1)}if(a===0){var d=i.length===0&&t!==null;if(d){var u=t,g=u.parentNode;rM(g),g.append(u),r.items.clear()}Ly(r,e,!d)}else s={pending:new Set(e),done:new Set},(r.outrogroups??(r.outrogroups=new Set)).add(s)}function Ly(r,e,t=!0){var i;if(r.pending.size>0){i=new Set;for(const a of r.pending.values())for(const l of a)i.add(r.items.get(l).e)}for(var n=0;n<e.length;n++){var s=e[n];if(i!=null&&i.has(s)){s.f|=wl;const a=document.createDocumentFragment();p9(s,a)}else Or(e[n],t)}}var v8;function pi(r,e,t,i,n,s=null){var a=r,l=new Map,d=(e&O5)!==0;if(d){var u=r;a=u.appendChild(dc())}var g=null,x=c9(()=>{var O=t();return o9(O)?O:O==null?[]:P1(O)}),m,C=new Map,_=!0;function E(O){(M.effect.f&ma)===0&&(M.pending.delete(O),M.fallback=g,SM(M,m,a,e,i),g!==null&&(m.length===0?(g.f&wl)===0?fm(g):(g.f^=wl,Cg(g,null,a)):fu(g,()=>{g=null})))}function S(O){M.pending.delete(O)}var I=H1(()=>{m=o(x);for(var O=m.length,R=new Set,H=Nn,G=c3(),U=0;U<O;U+=1){var re=m[U],we=i(re,U),Me=_?null:l.get(we);Me?(Me.v&&_p(Me.v,re),Me.i&&_p(Me.i,U),G&&H.unskip_effect(Me.e)):(Me=kM(l,_?a:v8??(v8=dc()),re,we,U,n,e,t),_||(Me.e.f|=wl),l.set(we,Me)),R.add(we)}if(O===0&&s&&!g&&(_?g=ca(()=>s(a)):(g=ca(()=>s(v8??(v8=dc()))),g.f|=wl)),O>R.size&&hT(),!_)if(C.set(H,R),G){for(const[be,$e]of l)R.has(be)||H.skip_effect($e.e);H.oncommit(E),H.ondiscard(S)}else E(H);o(x)}),M={effect:I,items:l,pending:C,outrogroups:null,fallback:g};_=!1}function lg(r){for(;r!==null&&(r.f&Ka)===0;)r=r.next;return r}function SM(r,e,t,i,n){var Me,be,$e,lt,de,Ve,ve,je,pe;var s=(i&ET)!==0,a=e.length,l=r.items,d=lg(r.effect.first),u,g=null,x,m=[],C=[],_,E,S,I;if(s)for(I=0;I<a;I+=1)_=e[I],E=n(_,I),S=l.get(E).e,(S.f&wl)===0&&((be=(Me=S.nodes)==null?void 0:Me.a)==null||be.measure(),(x??(x=new Set)).add(S));for(I=0;I<a;I+=1){if(_=e[I],E=n(_,I),S=l.get(E).e,r.outrogroups!==null)for(const Et of r.outrogroups)Et.pending.delete(S),Et.done.delete(S);if((S.f&mr)!==0&&(fm(S),s&&((lt=($e=S.nodes)==null?void 0:$e.a)==null||lt.unfix(),(x??(x=new Set)).delete(S))),(S.f&wl)!==0)if(S.f^=wl,S===d)Cg(S,null,t);else{var M=g?g.next:d;S===r.effect.last&&(r.effect.last=S.prev),S.prev&&(S.prev.next=S.next),S.next&&(S.next.prev=S.prev),Pc(r,g,S),Pc(r,S,M),Cg(S,M,t),g=S,m=[],C=[],d=lg(g.next);continue}if(S!==d){if(u!==void 0&&u.has(S)){if(m.length<C.length){var O=C[0],R;g=O.prev;var H=m[0],G=m[m.length-1];for(R=0;R<m.length;R+=1)Cg(m[R],O,t);for(R=0;R<C.length;R+=1)u.delete(C[R]);Pc(r,H.prev,G.next),Pc(r,g,H),Pc(r,G,O),d=O,g=G,I-=1,m=[],C=[]}else u.delete(S),Cg(S,d,t),Pc(r,S.prev,S.next),Pc(r,S,g===null?r.effect.first:g.next),Pc(r,g,S),g=S;continue}for(m=[],C=[];d!==null&&d!==S;)(u??(u=new Set)).add(d),C.push(d),d=lg(d.next);if(d===null)continue}(S.f&wl)===0&&m.push(S),g=S,d=lg(S.next)}if(r.outrogroups!==null){for(const Et of r.outrogroups)Et.pending.size===0&&(Ly(r,P1(Et.done)),(de=r.outrogroups)==null||de.delete(Et));r.outrogroups.size===0&&(r.outrogroups=null)}if(d!==null||u!==void 0){var U=[];if(u!==void 0)for(S of u)(S.f&mr)===0&&U.push(S);for(;d!==null;)(d.f&mr)===0&&d!==r.fallback&&U.push(d),d=lg(d.next);var re=U.length;if(re>0){var we=(i&O5)!==0&&a===0?t:null;if(s){for(I=0;I<re;I+=1)(ve=(Ve=U[I].nodes)==null?void 0:Ve.a)==null||ve.measure();for(I=0;I<re;I+=1)(pe=(je=U[I].nodes)==null?void 0:je.a)==null||pe.fix()}EM(r,U,we)}}s&&Al(()=>{var Et,Te;if(x!==void 0)for(S of x)(Te=(Et=S.nodes)==null?void 0:Et.a)==null||Te.apply()})}function kM(r,e,t,i,n,s,a,l){var d=(a&yT)!==0?(a&ST)===0?nM(t,!1,!1):lh(t):null,u=(a&wT)!==0?lh(n):null;return{v:d,i:u,e:ca(()=>(s(e,d??t,u??n,l),()=>{r.delete(i)}))}}function Cg(r,e,t){if(r.nodes)for(var i=r.nodes.start,n=r.nodes.end,s=e&&(e.f&wl)===0?e.nodes.start:t;i!==null;){var a=uv(i);if(s.before(i),i===n)return;i=a}}function Pc(r,e,t){e===null?r.effect.first=t:e.next=t,t===null?r.effect.last=e:t.prev=e}function Jc(r,e,t=!1,i=!1,n=!1,s=!1){var a=r,l="";if(t)var d=r;P(()=>{var u=gs;if(l!==(l=e()??"")){if(t){u.nodes=null,d.innerHTML=l,l!==""&&kd(Zr(d),d.lastChild);return}if(u.nodes!==null&&(f3(u.nodes.start,u.nodes.end),u.nodes=null),l!==""){var g=i?LT:n?IT:void 0,x=d3(i?"svg":n?"math":"template",g);x.innerHTML=l;var m=i||n?x:x.content;if(kd(Zr(m),m.lastChild),i||n)for(;Zr(m);)a.before(Zr(m));else a.before(m)}}})}function A3(r){var e,t,i="";if(typeof r=="string"||typeof r=="number")i+=r;else if(typeof r=="object")if(Array.isArray(r)){var n=r.length;for(e=0;e<n;e++)r[e]&&(t=A3(r[e]))&&(i&&(i+=" "),i+=t)}else for(t in r)r[t]&&(i&&(i+=" "),i+=t);return i}function DM(){for(var r,e,t=0,i="",n=arguments.length;t<n;t++)(r=arguments[t])&&(e=A3(r))&&(i&&(i+=" "),i+=e);return i}function Mf(r){return typeof r=="object"?DM(r):r??""}const x8=[...`
3
3
  \r\f \v\uFEFF`];function AM(r,e,t){var i=r==null?"":""+r;if(e&&(i=i?i+" "+e:e),t){for(var n of Object.keys(t))if(t[n])i=i?i+" "+n:n;else if(i.length)for(var s=n.length,a=0;(a=i.indexOf(n,a))>=0;){var l=a+s;(a===0||x8.includes(i[a-1]))&&(l===i.length||x8.includes(i[l]))?i=(a===0?"":i.substring(0,a))+i.substring(l+1):a=l}}return i===""?null:i}function m8(r,e=!1){var t=e?" !important;":";",i="";for(var n of Object.keys(r)){var s=r[n];s!=null&&s!==""&&(i+=" "+n+": "+s+t)}return i}function Mb(r){return r[0]!=="-"||r[1]!=="-"?r.toLowerCase():r}function BM(r,e){if(e){var t="",i,n;if(Array.isArray(e)?(i=e[0],n=e[1]):i=e,r){r=String(r).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var s=!1,a=0,l=!1,d=[];i&&d.push(...Object.keys(i).map(Mb)),n&&d.push(...Object.keys(n).map(Mb));var u=0,g=-1;const E=r.length;for(var x=0;x<E;x++){var m=r[x];if(l?m==="/"&&r[x-1]==="*"&&(l=!1):s?s===m&&(s=!1):m==="/"&&r[x+1]==="*"?l=!0:m==='"'||m==="'"?s=m:m==="("?a++:m===")"&&a--,!l&&s===!1&&a===0){if(m===":"&&g===-1)g=x;else if(m===";"||x===E-1){if(g!==-1){var C=Mb(r.substring(u,g).trim());if(!d.includes(C)){m!==";"&&x++;var _=r.substring(u,x).trim();t+=" "+_+";"}}u=x+1,g=-1}}}}return i&&(t+=m8(i)),n&&(t+=m8(n,!0)),t=t.trim(),t===""?null:t}return r==null?null:String(r)}function Ut(r,e,t,i,n,s){var a=r[by];if(a!==t||a===void 0){var l=AM(t,i,s);l==null?r.removeAttribute("class"):e?r.className=l:r.setAttribute("class",l),r[by]=t}else if(s&&n!==s)for(var d in s){var u=!!s[d];(n==null||u!==!!n[d])&&r.classList.toggle(d,u)}return s}function Rb(r,e={},t,i){for(var n in t){var s=t[n];e[n]!==s&&(t[n]==null?r.style.removeProperty(n):r.style.setProperty(n,s,i))}}function Do(r,e,t,i){var n=r[Cy];if(n!==e){var s=BM(e,i);s==null?r.removeAttribute("style"):r.style.cssText=s,r[Cy]=e}else i&&(Array.isArray(i)?(Rb(r,t==null?void 0:t[0],i[0]),Rb(r,t==null?void 0:t[1],i[1],"important")):Rb(r,t,i));return i}function ch(r,e,t=!1){if(r.multiple){if(e==null)return;if(!o9(e))return TT();for(var i of r.options)i.selected=e.includes(Hg(i));return}for(i of r.options){var n=Hg(i);if(s3(n,e)){i.selected=!0;return}}(!t||e!==void 0)&&(r.selectedIndex=-1)}function Cp(r){var e=new MutationObserver(()=>{ch(r,r.__value)});e.observe(r,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),O1(()=>{e.disconnect()})}function eo(r,e,t=e){var i=new WeakSet,n=!0;N1(r,"change",s=>{var a=s?"[selected]":":checked",l;if(r.multiple)l=[].map.call(r.querySelectorAll(a),Hg);else{var d=r.querySelector(a)??r.querySelector("option:not([disabled])");l=d&&Hg(d)}t(l),r.__value=l,Nn!==null&&i.add(Nn)}),h9(()=>{var s=e();if(r===document.activeElement){var a=Nn;if(i.has(a))return}if(ch(r,s,n),n&&s===void 0){var l=r.querySelector(":checked");l!==null&&(s=Hg(l),t(s))}r.__value=s,n=!1}),Cp(r)}function Hg(r){return"__value"in r?r.__value:r.value}const FM=Symbol("is custom element"),LM=Symbol("is html"),IM=dT?"progress":"PROGRESS";function $a(r,e){var t=g9(r);t.value===(t.value=e??void 0)||r.value===e&&(e!==0||r.nodeName!==IM)||(r.value=e??"")}function Uo(r,e){var t=g9(r);t.checked!==(t.checked=e??void 0)&&(r.checked=e)}function vi(r,e,t,i){var n=g9(r);n[e]!==(n[e]=t)&&(e==="loading"&&(r[cT]=t),t==null?r.removeAttribute(e):typeof t!="string"&&PM(r).includes(e)?r[e]=t:r.setAttribute(e,t))}function g9(r){return r[Dx]??(r[Dx]={[FM]:r.nodeName.includes("-"),[LM]:r.namespaceURI===z5})}var _8=new Map;function PM(r){var e=r.getAttribute("is")||r.nodeName,t=_8.get(e);if(t)return t;_8.set(e,t=[]);for(var i,n=r,s=Element.prototype;s!==n;){i=tT(n);for(var a in i)i[a].set&&a!=="innerHTML"&&a!=="textContent"&&a!=="innerText"&&t.push(a);n=T5(n)}return t}function li(r,e,t=e){var i=new WeakSet;N1(r,"input",async n=>{var s=n?r.defaultValue:r.value;if(s=Ob(r)?Hb(s):s,t(s),Nn!==null&&i.add(Nn),await ua(),s!==(s=e())){var a=r.selectionStart,l=r.selectionEnd,d=r.value.length;if(r.value=s??"",l!==null){var u=r.value.length;a===l&&l===d&&u>d?(r.selectionStart=u,r.selectionEnd=u):(r.selectionStart=a,r.selectionEnd=Math.min(l,u))}}}),Eo(e)==null&&r.value&&(t(Ob(r)?Hb(r.value):r.value),Nn!==null&&i.add(Nn)),hv(()=>{var n=e();if(r===document.activeElement){var s=Nn;if(i.has(s))return}Ob(r)&&n===Hb(r.value)||r.type==="date"&&!n&&!r.value||n!==r.value&&(r.value=n??"")})}const Nb=new Set;function Rf(r,e,t,i,n=i){var s=t.getAttribute("type")==="checkbox",a=r;if(e!==null)for(var l of e)a=a[l]??(a[l]=[]);a.push(t),N1(t,"change",()=>{var d=t.__value;s&&(d=TM(a,d,t.checked)),n(d)},()=>n(s?[]:null)),hv(()=>{var d=i();s?(d=d||[],t.checked=d.includes(t.__value)):t.checked=s3(t.__value,d)}),O1(()=>{var d=a.indexOf(t);d!==-1&&a.splice(d,1)}),Nb.has(a)||(Nb.add(a),Al(()=>{a.sort((d,u)=>d.compareDocumentPosition(u)===4?-1:1),Nb.delete(a)})),Al(()=>{})}function Es(r,e,t=e){N1(r,"change",i=>{var n=i?r.defaultChecked:r.checked;t(n)}),Eo(e)==null&&t(r.checked),hv(()=>{var i=e();r.checked=!!i})}function TM(r,e,t){for(var i=new Set,n=0;n<r.length;n+=1)r[n].checked&&i.add(r[n].__value);return t||i.delete(e),Array.from(i)}function Ob(r){var e=r.type;return e==="number"||e==="range"}function Hb(r){return r===""?null:+r}var Yc,Zf,G0,w_,B3;const E_=class E_{constructor(e){Qn(this,w_);Qn(this,Yc,new WeakMap);Qn(this,Zf);Qn(this,G0);Jn(this,G0,e)}observe(e,t){var i=Vt(this,Yc).get(e)||new Set;return i.add(t),Vt(this,Yc).set(e,i),Ts(this,w_,B3).call(this).observe(e,Vt(this,G0)),()=>{var n=Vt(this,Yc).get(e);n.delete(t),n.size===0&&(Vt(this,Yc).delete(e),Vt(this,Zf).unobserve(e))}}};Yc=new WeakMap,Zf=new WeakMap,G0=new WeakMap,w_=new WeakSet,B3=function(){return Vt(this,Zf)??Jn(this,Zf,new ResizeObserver(e=>{for(var t of e){E_.entries.set(t.target,t);for(var i of Vt(this,Yc).get(t.target)||[])i(t)}}))},is(E_,"entries",new WeakMap);let Iy=E_;var MM=new Iy({box:"border-box"});function RM(r,e,t){var i=MM.observe(r,()=>t(r[e]));h9(()=>(Eo(()=>t(r[e])),i))}function zb(r,e){return r===e||(r==null?void 0:r[uu])===e}function ns(r={},e,t,i){var n=Zo.r,s=gs;return h9(()=>{var a,l;return hv(()=>{a=l,l=[],Eo(()=>{zb(t(...l),r)||(e(r,...l),a&&zb(t(...a),r)&&e(null,...a))})}),()=>{let d=s;for(;d!==n&&d.parent!==null&&d.parent.f&_y;)d=d.parent;const u=()=>{l&&zb(t(...l),r)&&e(null,...l)},g=d.teardown;d.teardown=()=>{u(),g==null||g()}}}),r}function On(r,e,t,i){var R;var n=!0,s=(t&AT)!==0,a=(t&BT)!==0,l=i,d=!0,u=void 0,g=()=>a&&n?(u??(u=u0(i)),o(u)):(d&&(d=!1,l=a?Eo(i):i),l);let x;if(s){var m=uu in r||lT in r;x=((R=Pf(r,e))==null?void 0:R.set)??(m&&e in r?H=>r[e]=H:void 0)}var C,_=!1;s?[C,_]=zT(()=>r[e]):C=r[e],C===void 0&&i!==void 0&&(C=g(),x&&(xT(),x(C)));var E;if(E=()=>{var H=r[e];return H===void 0?g():(d=!0,H)},(t&DT)===0)return E;if(x){var S=r.$$legacy;return(function(H,G){return arguments.length>0?((!G||S||_)&&x(G?E():H),H):E()})}var I=!1,M=((t&kT)!==0?u0:c9)(()=>(I=!1,E()));s&&o(M);var O=gs;return(function(H,G){if(arguments.length>0){const U=G?o(M):s?_i(H):H;return p(M,U),I=!0,l!==void 0&&(l=U),H}return mc&&I||(O.f&ma)!==0?M.v:o(M)})}function Ns(r){Zo===null&&N5(),tn(()=>{const e=Eo(r);if(typeof e=="function")return e})}function Ah(r){Zo===null&&N5(),Ns(()=>()=>Eo(r))}const NM="5";var i6;typeof window<"u"&&((i6=window.__svelte??(window.__svelte={})).v??(i6.v=new Set)).add(NM);/*!-----------------------------------------------------------------------------
4
4
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -10,7 +10,7 @@ var mF=Object.defineProperty;var F2=r=>{throw TypeError(r)};var _F=(r,e,t)=>e in
10
10
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
11
11
  * Released under the MIT license
12
12
  * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt
13
- *-----------------------------------------------------------------------------*/var KM=Object.defineProperty,ZM=Object.getOwnPropertyDescriptor,YM=Object.getOwnPropertyNames,XM=Object.prototype.hasOwnProperty,QM=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of YM(e))!XM.call(r,n)&&n!==t&&KM(r,n,{get:()=>e[n],enumerable:!(i=ZM(e,n))||i.enumerable});return r},JM=(r,e,t)=>(QM(r,e,"default"),t),eR="5.4.5",yp={};JM(yp,s6);var I3=(r=>(r[r.None=0]="None",r[r.CommonJS=1]="CommonJS",r[r.AMD=2]="AMD",r[r.UMD=3]="UMD",r[r.System=4]="System",r[r.ES2015=5]="ES2015",r[r.ESNext=99]="ESNext",r))(I3||{}),P3=(r=>(r[r.None=0]="None",r[r.Preserve=1]="Preserve",r[r.React=2]="React",r[r.ReactNative=3]="ReactNative",r[r.ReactJSX=4]="ReactJSX",r[r.ReactJSXDev=5]="ReactJSXDev",r))(P3||{}),T3=(r=>(r[r.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",r[r.LineFeed=1]="LineFeed",r))(T3||{}),M3=(r=>(r[r.ES3=0]="ES3",r[r.ES5=1]="ES5",r[r.ES2015=2]="ES2015",r[r.ES2016=3]="ES2016",r[r.ES2017=4]="ES2017",r[r.ES2018=5]="ES2018",r[r.ES2019=6]="ES2019",r[r.ES2020=7]="ES2020",r[r.ESNext=99]="ESNext",r[r.JSON=100]="JSON",r[r.Latest=99]="Latest",r))(M3||{}),R3=(r=>(r[r.Classic=1]="Classic",r[r.NodeJs=2]="NodeJs",r))(R3||{}),N3=class{constructor(r,e,t,i,n){this._onDidChange=new yp.Emitter,this._onDidExtraLibsChange=new yp.Emitter,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(r),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(i),this.setModeConfiguration(n),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(r,e){let t;if(typeof e>"u"?t=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t=e,this._extraLibs[t]&&this._extraLibs[t].content===r)return{dispose:()=>{}};let i=1;return this._removedExtraLibs[t]&&(i=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(i=this._extraLibs[t].version+1),this._extraLibs[t]={content:r,version:i},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let n=this._extraLibs[t];n&&n.version===i&&(delete this._extraLibs[t],this._removedExtraLibs[t]=i,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(r){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),r&&r.length>0)for(const e of r){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,i=e.content;let n=1;this._removedExtraLibs[t]&&(n=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:i,version:n}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(r){this._compilerOptions=r||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(r){this._diagnosticsOptions=r||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(r){this._workerOptions=r||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(r){this._inlayHintsOptions=r||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(r){}setEagerModelSync(r){this._eagerModelSync=r}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(r){this._modeConfiguration=r||Object.create(null),this._onDidChange.fire(void 0)}},tR=eR,O3={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,diagnostics:!0,documentRangeFormattingEdits:!0,signatureHelp:!0,onTypeFormattingEdits:!0,codeActions:!0,inlayHints:!0},H3=new N3({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},O3),z3=new N3({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},O3),iR=()=>z1().then(r=>r.getTypeScriptWorker()),nR=()=>z1().then(r=>r.getJavaScriptWorker());yp.languages.typescript={ModuleKind:I3,JsxEmit:P3,NewLineKind:T3,ScriptTarget:M3,ModuleResolutionKind:R3,typescriptVersion:tR,typescriptDefaults:H3,javascriptDefaults:z3,getTypeScriptWorker:iR,getJavaScriptWorker:nR};function z1(){return n6(()=>import("./tsMode-Csag9_qB.js"),__vite__mapDeps([3,1,2]))}yp.languages.onLanguage("typescript",()=>z1().then(r=>r.setupTypeScript(H3)));yp.languages.onLanguage("javascript",()=>z1().then(r=>r.setupJavaScript(z3)));class sR extends cr{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:Zi("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),icon:_n.map,toggled:si.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:si.has("isInDiffEditor"),menu:{when:si.has("isInDiffEditor"),id:Ni.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(Os),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}class W3 extends cr{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:Zi("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),precondition:si.has("isInDiffEditor")})}run(e,...t){const i=e.get(Os),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}class j3 extends cr{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:Zi("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),precondition:si.has("isInDiffEditor")})}run(e,...t){const i=e.get(Os),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}const gv=Zi("diffEditor","Diff Editor");class oR extends Za{constructor(){super({id:"diffEditor.switchSide",title:Zi("switchSide","Switch Side"),icon:_n.arrowSwap,precondition:si.has("isInDiffEditor"),f1:!0,category:gv})}runEditorCommand(e,t,i){const n=qp(e);if(n instanceof K0){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}class rR extends Za{constructor(){super({id:"diffEditor.exitCompareMove",title:Zi("exitCompareMove","Exit Compare Move"),icon:_n.close,precondition:fe.comparingMovedCode,f1:!1,category:gv,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=qp(e);n instanceof K0&&n.exitCompareMove()}}class aR extends Za{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:Zi("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),icon:_n.fold,precondition:si.has("isInDiffEditor"),f1:!0,category:gv})}runEditorCommand(e,t,...i){const n=qp(e);n instanceof K0&&n.collapseAllUnchangedRegions()}}class lR extends Za{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:Zi("showAllUnchangedRegions","Show All Unchanged Regions"),icon:_n.unfold,precondition:si.has("isInDiffEditor"),f1:!0,category:gv})}runEditorCommand(e,t,...i){const n=qp(e);n instanceof K0&&n.showAllUnchangedRegions()}}class Py extends cr{constructor(){super({id:"diffEditor.revert",title:Zi("revert","Revert"),f1:!1,category:gv})}run(e,t){const i=cR(e,t.originalUri,t.modifiedUri);i instanceof K0&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const V3=Zi("accessibleDiffViewer","Accessible Diff Viewer"),S_=class S_ extends cr{constructor(){super({id:S_.id,title:Zi("editor.action.accessibleDiffViewer.next","Go to Next Difference"),category:V3,precondition:si.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=qp(e);t==null||t.accessibleDiffViewerNext()}};S_.id="editor.action.accessibleDiffViewer.next";let f0=S_;const k_=class k_ extends cr{constructor(){super({id:k_.id,title:Zi("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),category:V3,precondition:si.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=qp(e);t==null||t.accessibleDiffViewerPrev()}};k_.id="editor.action.accessibleDiffViewer.prev";let pm=k_;function cR(r,e,t){return r.get(oo).listDiffEditors().find(s=>{var d,u;const a=s.getModifiedEditor(),l=s.getOriginalEditor();return a&&((d=a.getModel())==null?void 0:d.uri.toString())===t.toString()&&l&&((u=l.getModel())==null?void 0:u.uri.toString())===e.toString()})||null}function qp(r){const t=r.get(oo).listDiffEditors(),i=o6();if(i)for(const n of t){const s=n.getContainerDomNode();if(dR(s,i))return n}return null}function dR(r,e){let t=e;for(;t;){if(t===r)return!0;t=t.parentElement}return!1}vs(sR);vs(W3);vs(j3);ba.appendMenuItem(Ni.EditorTitle,{command:{id:new j3().desc.id,title:F("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:si.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:si.has("isInDiffEditor")},order:11,group:"1_diff",when:si.and(fe.diffEditorRenderSideBySideInlineBreakpointReached,si.has("isInDiffEditor"))});ba.appendMenuItem(Ni.EditorTitle,{command:{id:new W3().desc.id,title:F("showMoves","Show Moved Code Blocks"),icon:_n.move,toggled:bF.create("config.diffEditor.experimental.showMoves",!0),precondition:si.has("isInDiffEditor")},order:10,group:"1_diff",when:si.has("isInDiffEditor")});vs(Py);for(const r of[{icon:_n.arrowRight,key:fe.diffEditorInlineMode.toNegated()},{icon:_n.discard,key:fe.diffEditorInlineMode}])ba.appendMenuItem(Ni.DiffEditorHunkToolbar,{command:{id:new Py().desc.id,title:F("revertHunk","Revert Block"),icon:r.icon},when:si.and(fe.diffEditorModifiedWritable,r.key),order:5,group:"primary"}),ba.appendMenuItem(Ni.DiffEditorSelectionToolbar,{command:{id:new Py().desc.id,title:F("revertSelection","Revert Selection"),icon:r.icon},when:si.and(fe.diffEditorModifiedWritable,r.key),order:5,group:"primary"});vs(oR);vs(rR);vs(aR);vs(lR);ba.appendMenuItem(Ni.EditorTitle,{command:{id:f0.id,title:F("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:si.has("isInDiffEditor")},order:10,group:"2_diff",when:si.and(fe.accessibleDiffViewerVisible.negate(),si.has("isInDiffEditor"))});Ls.registerCommandAlias("editor.action.diffReview.next",f0.id);vs(f0);Ls.registerCommandAlias("editor.action.diffReview.prev",pm.id);vs(pm);var uR=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},hR=function(r,e){return function(t,i){e(t,i,r)}},Ty;const W1=new es("selectionAnchorSet",!1);var mu;let Dd=(mu=class{static get(e){return e.getContribution(Ty.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=W1.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition();this.editor.changeDecorations(t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(fn.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new Wo().appendText(F("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),Ca(F("anchorSet","Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){const t=this.editor.getPosition();this.editor.setSelection(fn.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){const e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}},Ty=mu,mu.ID="editor.contrib.selectionAnchorController",mu);Dd=Ty=uR([hR(1,os)],Dd);class fR extends Ci{constructor(){super({id:"editor.action.setSelectionAnchor",label:F("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:fe.editorTextFocus,primary:ao(2089,2080),weight:100}})}async run(e,t){var i;(i=Dd.get(t))==null||i.setSelectionAnchor()}}class pR extends Ci{constructor(){super({id:"editor.action.goToSelectionAnchor",label:F("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:W1})}async run(e,t){var i;(i=Dd.get(t))==null||i.goToSelectionAnchor()}}class gR extends Ci{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:F("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:W1,kbOpts:{kbExpr:fe.editorTextFocus,primary:ao(2089,2089),weight:100}})}async run(e,t){var i;(i=Dd.get(t))==null||i.selectFromAnchorToCursor()}}class vR extends Ci{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:F("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:W1,kbOpts:{kbExpr:fe.editorTextFocus,primary:9,weight:100}})}async run(e,t){var i;(i=Dd.get(t))==null||i.cancelSelectionAnchor()}}$n(Dd.ID,Dd,4);Yt(fR);Yt(pR);Yt(gR);Yt(vR);const xR=Gi("editorOverviewRuler.bracketMatchForeground","#A0A0A0",F("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class mR extends Ci{constructor(){super({id:"editor.action.jumpToBracket",label:F("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:fe.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=dh.get(t))==null||i.jumpToBracket()}}class _R extends Ci{constructor(){super({id:"editor.action.selectToBracket",label:F("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:Zi("smartSelect.selectToBracketDescription","Select the text inside and including the brackets or curly braces"),args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){var s;let n=!0;i&&i.selectBrackets===!1&&(n=!1),(s=dh.get(t))==null||s.selectToBracket(n)}}class bR extends Ci{constructor(){super({id:"editor.action.removeBrackets",label:F("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:fe.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=dh.get(t))==null||i.removeBrackets(this.id)}}class CR{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const jc=class jc extends Li{static get(e){return e.getContribution(jc.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new po(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(72),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(72)&&(this._matchBrackets=this._editor.getOption(72),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(i=>{const n=i.getStartPosition(),s=e.bracketPairs.matchBracket(n);let a=null;if(s)s[0].containsPosition(n)&&!s[1].containsPosition(n)?a=s[1].getStartPosition():s[1].containsPosition(n)&&(a=s[0].getStartPosition());else{const l=e.bracketPairs.findEnclosingBrackets(n);if(l)a=l[1].getStartPosition();else{const d=e.bracketPairs.findNextBracket(n);d&&d.range&&(a=d.range.getStartPosition())}}return a?new fn(a.lineNumber,a.column,a.lineNumber,a.column):new fn(n.lineNumber,n.column,n.lineNumber,n.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(n=>{const s=n.getStartPosition();let a=t.bracketPairs.matchBracket(s);if(!a&&(a=t.bracketPairs.findEnclosingBrackets(s),!a)){const u=t.bracketPairs.findNextBracket(s);u&&u.range&&(a=t.bracketPairs.matchBracket(u.range.getStartPosition()))}let l=null,d=null;if(a){a.sort(Ze.compareRangesUsingStarts);const[u,g]=a;if(l=e?u.getStartPosition():u.getEndPosition(),d=e?g.getEndPosition():g.getStartPosition(),g.containsPosition(s)){const x=l;l=d,d=x}}l&&d&&i.push(new fn(l.lineNumber,l.column,d.lineNumber,d.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(i=>{const n=i.getPosition();let s=t.bracketPairs.matchBracket(n);s||(s=t.bracketPairs.findEnclosingBrackets(n)),s&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:s[0],text:""},{range:s[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const i of this._lastBracketsData){const n=i.brackets;n&&(e[t++]={range:n[0],options:i.options},e[t++]={range:n[1],options:i.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),i=t.getVersionId();let n=[];this._lastVersionId===i&&(n=this._lastBracketsData);const s=[];let a=0;for(let x=0,m=e.length;x<m;x++){const C=e[x];C.isEmpty()&&(s[a++]=C.getStartPosition())}s.length>1&&s.sort(Xi.compare);const l=[];let d=0,u=0;const g=n.length;for(let x=0,m=s.length;x<m;x++){const C=s[x];for(;u<g&&n[u].position.isBefore(C);)u++;if(u<g&&n[u].position.equals(C))l[d++]=n[u];else{let _=t.bracketPairs.matchBracket(C,20),E=jc._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!_&&this._matchBrackets==="always"&&(_=t.bracketPairs.findEnclosingBrackets(C,20),E=jc._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),l[d++]=new CR(C,_,E)}}this._lastBracketsData=l,this._lastVersionId=i}};jc.ID="editor.contrib.bracketMatchingController",jc._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=Kn.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:ho(xR),position:Sl.Center}}),jc._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=Kn.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});let dh=jc;$n(dh.ID,dh,1);Yt(_R);Yt(mR);Yt(bR);ba.appendMenuItem(Ni.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:F({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});class yR{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;const i=this._selection.startLineNumber,n=this._selection.startColumn,s=this._selection.endColumn;if(!(this._isMovingLeft&&n===1)&&!(!this._isMovingLeft&&s===e.getLineMaxColumn(i)))if(this._isMovingLeft){const a=new Ze(i,n-1,i,n),l=e.getValueInRange(a);t.addEditOperation(a,null),t.addEditOperation(new Ze(i,s,i,s),l)}else{const a=new Ze(i,s,i,s+1),l=e.getValueInRange(a);t.addEditOperation(a,null),t.addEditOperation(new Ze(i,n,i,n),l)}}computeCursorState(e,t){return this._isMovingLeft?new fn(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new fn(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class $3 extends Ci{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;const i=[],n=t.getSelections();for(const s of n)i.push(new yR(s,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class wR extends $3{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:F("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:fe.writable})}}class ER extends $3{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:F("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:fe.writable})}}Yt(wR);Yt(ER);class SR extends Ci{constructor(){super({id:"editor.action.transposeLetters",label:F("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:fe.writable,kbOpts:{kbExpr:fe.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=[],s=t.getSelections();for(const a of s){if(!a.isEmpty())continue;const l=a.startLineNumber,d=a.startColumn,u=i.getLineMaxColumn(l);if(l===1&&(d===1||d===2&&u===2))continue;const g=d===u?a.getPosition():Sb.rightPosition(i,a.getPosition().lineNumber,a.getPosition().column),x=Sb.leftPosition(i,g),m=Sb.leftPosition(i,x),C=i.getValueInRange(Ze.fromPositions(m,x)),_=i.getValueInRange(Ze.fromPositions(x,g)),E=Ze.fromPositions(m,g);n.push(new Z0(E,_+C))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}Yt(SR);const j1=(function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let r;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?r=crypto.getRandomValues.bind(crypto):r=function(i){for(let n=0;n<i.length;n++)i[n]=Math.floor(Math.random()*256);return i};const e=new Uint8Array(16),t=[];for(let i=0;i<256;i++)t.push(i.toString(16).padStart(2,"0"));return function(){r(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let n=0,s="";return s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s}})();function v9(r){return{asString:async()=>r,asFile:()=>{},value:typeof r=="string"?r:void 0}}function kR(r,e,t){const i={id:j1(),name:r,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class q3{constructor(){this._entries=new Map}get size(){let e=0;for(const t of this._entries)e++;return e}has(e){return this._entries.has(this.toKey(e))}matches(e){const t=[...this._entries.keys()];return ac.some(this,([i,n])=>n.asFile())&&t.push("files"),G3(gm(e),t)}get(e){var t;return(t=this._entries.get(this.toKey(e)))==null?void 0:t[0]}append(e,t){const i=this._entries.get(e);i?i.push(t):this._entries.set(this.toKey(e),[t])}replace(e,t){this._entries.set(this.toKey(e),[t])}delete(e){this._entries.delete(this.toKey(e))}*[Symbol.iterator](){for(const[e,t]of this._entries)for(const i of t)yield[e,i]}toKey(e){return gm(e)}}function gm(r){return r.toLowerCase()}function U3(r,e){return G3(gm(r),e.map(gm))}function G3(r,e){if(r==="*/*")return e.length>0;if(e.includes(r))return!0;const t=r.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,n,s]=t;return s==="*"?e.some(a=>a.startsWith(n+"/")):!1}const V1=Object.freeze({create:r=>r6(r.map(e=>e.toString())).join(`\r
13
+ *-----------------------------------------------------------------------------*/var KM=Object.defineProperty,ZM=Object.getOwnPropertyDescriptor,YM=Object.getOwnPropertyNames,XM=Object.prototype.hasOwnProperty,QM=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of YM(e))!XM.call(r,n)&&n!==t&&KM(r,n,{get:()=>e[n],enumerable:!(i=ZM(e,n))||i.enumerable});return r},JM=(r,e,t)=>(QM(r,e,"default"),t),eR="5.4.5",yp={};JM(yp,s6);var I3=(r=>(r[r.None=0]="None",r[r.CommonJS=1]="CommonJS",r[r.AMD=2]="AMD",r[r.UMD=3]="UMD",r[r.System=4]="System",r[r.ES2015=5]="ES2015",r[r.ESNext=99]="ESNext",r))(I3||{}),P3=(r=>(r[r.None=0]="None",r[r.Preserve=1]="Preserve",r[r.React=2]="React",r[r.ReactNative=3]="ReactNative",r[r.ReactJSX=4]="ReactJSX",r[r.ReactJSXDev=5]="ReactJSXDev",r))(P3||{}),T3=(r=>(r[r.CarriageReturnLineFeed=0]="CarriageReturnLineFeed",r[r.LineFeed=1]="LineFeed",r))(T3||{}),M3=(r=>(r[r.ES3=0]="ES3",r[r.ES5=1]="ES5",r[r.ES2015=2]="ES2015",r[r.ES2016=3]="ES2016",r[r.ES2017=4]="ES2017",r[r.ES2018=5]="ES2018",r[r.ES2019=6]="ES2019",r[r.ES2020=7]="ES2020",r[r.ESNext=99]="ESNext",r[r.JSON=100]="JSON",r[r.Latest=99]="Latest",r))(M3||{}),R3=(r=>(r[r.Classic=1]="Classic",r[r.NodeJs=2]="NodeJs",r))(R3||{}),N3=class{constructor(r,e,t,i,n){this._onDidChange=new yp.Emitter,this._onDidExtraLibsChange=new yp.Emitter,this._extraLibs=Object.create(null),this._removedExtraLibs=Object.create(null),this._eagerModelSync=!1,this.setCompilerOptions(r),this.setDiagnosticsOptions(e),this.setWorkerOptions(t),this.setInlayHintsOptions(i),this.setModeConfiguration(n),this._onDidExtraLibsChangeTimeout=-1}get onDidChange(){return this._onDidChange.event}get onDidExtraLibsChange(){return this._onDidExtraLibsChange.event}get modeConfiguration(){return this._modeConfiguration}get workerOptions(){return this._workerOptions}get inlayHintsOptions(){return this._inlayHintsOptions}getExtraLibs(){return this._extraLibs}addExtraLib(r,e){let t;if(typeof e>"u"?t=`ts:extralib-${Math.random().toString(36).substring(2,15)}`:t=e,this._extraLibs[t]&&this._extraLibs[t].content===r)return{dispose:()=>{}};let i=1;return this._removedExtraLibs[t]&&(i=this._removedExtraLibs[t]+1),this._extraLibs[t]&&(i=this._extraLibs[t].version+1),this._extraLibs[t]={content:r,version:i},this._fireOnDidExtraLibsChangeSoon(),{dispose:()=>{let n=this._extraLibs[t];n&&n.version===i&&(delete this._extraLibs[t],this._removedExtraLibs[t]=i,this._fireOnDidExtraLibsChangeSoon())}}}setExtraLibs(r){for(const e in this._extraLibs)this._removedExtraLibs[e]=this._extraLibs[e].version;if(this._extraLibs=Object.create(null),r&&r.length>0)for(const e of r){const t=e.filePath||`ts:extralib-${Math.random().toString(36).substring(2,15)}`,i=e.content;let n=1;this._removedExtraLibs[t]&&(n=this._removedExtraLibs[t]+1),this._extraLibs[t]={content:i,version:n}}this._fireOnDidExtraLibsChangeSoon()}_fireOnDidExtraLibsChangeSoon(){this._onDidExtraLibsChangeTimeout===-1&&(this._onDidExtraLibsChangeTimeout=window.setTimeout(()=>{this._onDidExtraLibsChangeTimeout=-1,this._onDidExtraLibsChange.fire(void 0)},0))}getCompilerOptions(){return this._compilerOptions}setCompilerOptions(r){this._compilerOptions=r||Object.create(null),this._onDidChange.fire(void 0)}getDiagnosticsOptions(){return this._diagnosticsOptions}setDiagnosticsOptions(r){this._diagnosticsOptions=r||Object.create(null),this._onDidChange.fire(void 0)}setWorkerOptions(r){this._workerOptions=r||Object.create(null),this._onDidChange.fire(void 0)}setInlayHintsOptions(r){this._inlayHintsOptions=r||Object.create(null),this._onDidChange.fire(void 0)}setMaximumWorkerIdleTime(r){}setEagerModelSync(r){this._eagerModelSync=r}getEagerModelSync(){return this._eagerModelSync}setModeConfiguration(r){this._modeConfiguration=r||Object.create(null),this._onDidChange.fire(void 0)}},tR=eR,O3={completionItems:!0,hovers:!0,documentSymbols:!0,definitions:!0,references:!0,documentHighlights:!0,rename:!0,diagnostics:!0,documentRangeFormattingEdits:!0,signatureHelp:!0,onTypeFormattingEdits:!0,codeActions:!0,inlayHints:!0},H3=new N3({allowNonTsExtensions:!0,target:99},{noSemanticValidation:!1,noSyntaxValidation:!1,onlyVisible:!1},{},{},O3),z3=new N3({allowNonTsExtensions:!0,allowJs:!0,target:99},{noSemanticValidation:!0,noSyntaxValidation:!1,onlyVisible:!1},{},{},O3),iR=()=>z1().then(r=>r.getTypeScriptWorker()),nR=()=>z1().then(r=>r.getJavaScriptWorker());yp.languages.typescript={ModuleKind:I3,JsxEmit:P3,NewLineKind:T3,ScriptTarget:M3,ModuleResolutionKind:R3,typescriptVersion:tR,typescriptDefaults:H3,javascriptDefaults:z3,getTypeScriptWorker:iR,getJavaScriptWorker:nR};function z1(){return n6(()=>import("./tsMode-4A8DZYIU.js"),__vite__mapDeps([3,1,2]))}yp.languages.onLanguage("typescript",()=>z1().then(r=>r.setupTypeScript(H3)));yp.languages.onLanguage("javascript",()=>z1().then(r=>r.setupJavaScript(z3)));class sR extends cr{constructor(){super({id:"diffEditor.toggleCollapseUnchangedRegions",title:Zi("toggleCollapseUnchangedRegions","Toggle Collapse Unchanged Regions"),icon:_n.map,toggled:si.has("config.diffEditor.hideUnchangedRegions.enabled"),precondition:si.has("isInDiffEditor"),menu:{when:si.has("isInDiffEditor"),id:Ni.EditorTitle,order:22,group:"navigation"}})}run(e,...t){const i=e.get(Os),n=!i.getValue("diffEditor.hideUnchangedRegions.enabled");i.updateValue("diffEditor.hideUnchangedRegions.enabled",n)}}class W3 extends cr{constructor(){super({id:"diffEditor.toggleShowMovedCodeBlocks",title:Zi("toggleShowMovedCodeBlocks","Toggle Show Moved Code Blocks"),precondition:si.has("isInDiffEditor")})}run(e,...t){const i=e.get(Os),n=!i.getValue("diffEditor.experimental.showMoves");i.updateValue("diffEditor.experimental.showMoves",n)}}class j3 extends cr{constructor(){super({id:"diffEditor.toggleUseInlineViewWhenSpaceIsLimited",title:Zi("toggleUseInlineViewWhenSpaceIsLimited","Toggle Use Inline View When Space Is Limited"),precondition:si.has("isInDiffEditor")})}run(e,...t){const i=e.get(Os),n=!i.getValue("diffEditor.useInlineViewWhenSpaceIsLimited");i.updateValue("diffEditor.useInlineViewWhenSpaceIsLimited",n)}}const gv=Zi("diffEditor","Diff Editor");class oR extends Za{constructor(){super({id:"diffEditor.switchSide",title:Zi("switchSide","Switch Side"),icon:_n.arrowSwap,precondition:si.has("isInDiffEditor"),f1:!0,category:gv})}runEditorCommand(e,t,i){const n=qp(e);if(n instanceof K0){if(i&&i.dryRun)return{destinationSelection:n.mapToOtherSide().destinationSelection};n.switchSide()}}}class rR extends Za{constructor(){super({id:"diffEditor.exitCompareMove",title:Zi("exitCompareMove","Exit Compare Move"),icon:_n.close,precondition:fe.comparingMovedCode,f1:!1,category:gv,keybinding:{weight:1e4,primary:9}})}runEditorCommand(e,t,...i){const n=qp(e);n instanceof K0&&n.exitCompareMove()}}class aR extends Za{constructor(){super({id:"diffEditor.collapseAllUnchangedRegions",title:Zi("collapseAllUnchangedRegions","Collapse All Unchanged Regions"),icon:_n.fold,precondition:si.has("isInDiffEditor"),f1:!0,category:gv})}runEditorCommand(e,t,...i){const n=qp(e);n instanceof K0&&n.collapseAllUnchangedRegions()}}class lR extends Za{constructor(){super({id:"diffEditor.showAllUnchangedRegions",title:Zi("showAllUnchangedRegions","Show All Unchanged Regions"),icon:_n.unfold,precondition:si.has("isInDiffEditor"),f1:!0,category:gv})}runEditorCommand(e,t,...i){const n=qp(e);n instanceof K0&&n.showAllUnchangedRegions()}}class Py extends cr{constructor(){super({id:"diffEditor.revert",title:Zi("revert","Revert"),f1:!1,category:gv})}run(e,t){const i=cR(e,t.originalUri,t.modifiedUri);i instanceof K0&&i.revertRangeMappings(t.mapping.innerChanges??[])}}const V3=Zi("accessibleDiffViewer","Accessible Diff Viewer"),S_=class S_ extends cr{constructor(){super({id:S_.id,title:Zi("editor.action.accessibleDiffViewer.next","Go to Next Difference"),category:V3,precondition:si.has("isInDiffEditor"),keybinding:{primary:65,weight:100},f1:!0})}run(e){const t=qp(e);t==null||t.accessibleDiffViewerNext()}};S_.id="editor.action.accessibleDiffViewer.next";let f0=S_;const k_=class k_ extends cr{constructor(){super({id:k_.id,title:Zi("editor.action.accessibleDiffViewer.prev","Go to Previous Difference"),category:V3,precondition:si.has("isInDiffEditor"),keybinding:{primary:1089,weight:100},f1:!0})}run(e){const t=qp(e);t==null||t.accessibleDiffViewerPrev()}};k_.id="editor.action.accessibleDiffViewer.prev";let pm=k_;function cR(r,e,t){return r.get(oo).listDiffEditors().find(s=>{var d,u;const a=s.getModifiedEditor(),l=s.getOriginalEditor();return a&&((d=a.getModel())==null?void 0:d.uri.toString())===t.toString()&&l&&((u=l.getModel())==null?void 0:u.uri.toString())===e.toString()})||null}function qp(r){const t=r.get(oo).listDiffEditors(),i=o6();if(i)for(const n of t){const s=n.getContainerDomNode();if(dR(s,i))return n}return null}function dR(r,e){let t=e;for(;t;){if(t===r)return!0;t=t.parentElement}return!1}vs(sR);vs(W3);vs(j3);ba.appendMenuItem(Ni.EditorTitle,{command:{id:new j3().desc.id,title:F("useInlineViewWhenSpaceIsLimited","Use Inline View When Space Is Limited"),toggled:si.has("config.diffEditor.useInlineViewWhenSpaceIsLimited"),precondition:si.has("isInDiffEditor")},order:11,group:"1_diff",when:si.and(fe.diffEditorRenderSideBySideInlineBreakpointReached,si.has("isInDiffEditor"))});ba.appendMenuItem(Ni.EditorTitle,{command:{id:new W3().desc.id,title:F("showMoves","Show Moved Code Blocks"),icon:_n.move,toggled:bF.create("config.diffEditor.experimental.showMoves",!0),precondition:si.has("isInDiffEditor")},order:10,group:"1_diff",when:si.has("isInDiffEditor")});vs(Py);for(const r of[{icon:_n.arrowRight,key:fe.diffEditorInlineMode.toNegated()},{icon:_n.discard,key:fe.diffEditorInlineMode}])ba.appendMenuItem(Ni.DiffEditorHunkToolbar,{command:{id:new Py().desc.id,title:F("revertHunk","Revert Block"),icon:r.icon},when:si.and(fe.diffEditorModifiedWritable,r.key),order:5,group:"primary"}),ba.appendMenuItem(Ni.DiffEditorSelectionToolbar,{command:{id:new Py().desc.id,title:F("revertSelection","Revert Selection"),icon:r.icon},when:si.and(fe.diffEditorModifiedWritable,r.key),order:5,group:"primary"});vs(oR);vs(rR);vs(aR);vs(lR);ba.appendMenuItem(Ni.EditorTitle,{command:{id:f0.id,title:F("Open Accessible Diff Viewer","Open Accessible Diff Viewer"),precondition:si.has("isInDiffEditor")},order:10,group:"2_diff",when:si.and(fe.accessibleDiffViewerVisible.negate(),si.has("isInDiffEditor"))});Ls.registerCommandAlias("editor.action.diffReview.next",f0.id);vs(f0);Ls.registerCommandAlias("editor.action.diffReview.prev",pm.id);vs(pm);var uR=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},hR=function(r,e){return function(t,i){e(t,i,r)}},Ty;const W1=new es("selectionAnchorSet",!1);var mu;let Dd=(mu=class{static get(e){return e.getContribution(Ty.ID)}constructor(e,t){this.editor=e,this.selectionAnchorSetContextKey=W1.bindTo(t),this.modelChangeListener=e.onDidChangeModel(()=>this.selectionAnchorSetContextKey.reset())}setSelectionAnchor(){if(this.editor.hasModel()){const e=this.editor.getPosition();this.editor.changeDecorations(t=>{this.decorationId&&t.removeDecoration(this.decorationId),this.decorationId=t.addDecoration(fn.fromPositions(e,e),{description:"selection-anchor",stickiness:1,hoverMessage:new Wo().appendText(F("selectionAnchor","Selection Anchor")),className:"selection-anchor"})}),this.selectionAnchorSetContextKey.set(!!this.decorationId),Ca(F("anchorSet","Anchor set at {0}:{1}",e.lineNumber,e.column))}}goToSelectionAnchor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);e&&this.editor.setPosition(e.getStartPosition())}}selectFromAnchorToCursor(){if(this.editor.hasModel()&&this.decorationId){const e=this.editor.getModel().getDecorationRange(this.decorationId);if(e){const t=this.editor.getPosition();this.editor.setSelection(fn.fromPositions(e.getStartPosition(),t)),this.cancelSelectionAnchor()}}}cancelSelectionAnchor(){if(this.decorationId){const e=this.decorationId;this.editor.changeDecorations(t=>{t.removeDecoration(e),this.decorationId=void 0}),this.selectionAnchorSetContextKey.set(!1)}}dispose(){this.cancelSelectionAnchor(),this.modelChangeListener.dispose()}},Ty=mu,mu.ID="editor.contrib.selectionAnchorController",mu);Dd=Ty=uR([hR(1,os)],Dd);class fR extends Ci{constructor(){super({id:"editor.action.setSelectionAnchor",label:F("setSelectionAnchor","Set Selection Anchor"),alias:"Set Selection Anchor",precondition:void 0,kbOpts:{kbExpr:fe.editorTextFocus,primary:ao(2089,2080),weight:100}})}async run(e,t){var i;(i=Dd.get(t))==null||i.setSelectionAnchor()}}class pR extends Ci{constructor(){super({id:"editor.action.goToSelectionAnchor",label:F("goToSelectionAnchor","Go to Selection Anchor"),alias:"Go to Selection Anchor",precondition:W1})}async run(e,t){var i;(i=Dd.get(t))==null||i.goToSelectionAnchor()}}class gR extends Ci{constructor(){super({id:"editor.action.selectFromAnchorToCursor",label:F("selectFromAnchorToCursor","Select from Anchor to Cursor"),alias:"Select from Anchor to Cursor",precondition:W1,kbOpts:{kbExpr:fe.editorTextFocus,primary:ao(2089,2089),weight:100}})}async run(e,t){var i;(i=Dd.get(t))==null||i.selectFromAnchorToCursor()}}class vR extends Ci{constructor(){super({id:"editor.action.cancelSelectionAnchor",label:F("cancelSelectionAnchor","Cancel Selection Anchor"),alias:"Cancel Selection Anchor",precondition:W1,kbOpts:{kbExpr:fe.editorTextFocus,primary:9,weight:100}})}async run(e,t){var i;(i=Dd.get(t))==null||i.cancelSelectionAnchor()}}$n(Dd.ID,Dd,4);Yt(fR);Yt(pR);Yt(gR);Yt(vR);const xR=Gi("editorOverviewRuler.bracketMatchForeground","#A0A0A0",F("overviewRulerBracketMatchForeground","Overview ruler marker color for matching brackets."));class mR extends Ci{constructor(){super({id:"editor.action.jumpToBracket",label:F("smartSelect.jumpBracket","Go to Bracket"),alias:"Go to Bracket",precondition:void 0,kbOpts:{kbExpr:fe.editorTextFocus,primary:3165,weight:100}})}run(e,t){var i;(i=dh.get(t))==null||i.jumpToBracket()}}class _R extends Ci{constructor(){super({id:"editor.action.selectToBracket",label:F("smartSelect.selectToBracket","Select to Bracket"),alias:"Select to Bracket",precondition:void 0,metadata:{description:Zi("smartSelect.selectToBracketDescription","Select the text inside and including the brackets or curly braces"),args:[{name:"args",schema:{type:"object",properties:{selectBrackets:{type:"boolean",default:!0}}}}]}})}run(e,t,i){var s;let n=!0;i&&i.selectBrackets===!1&&(n=!1),(s=dh.get(t))==null||s.selectToBracket(n)}}class bR extends Ci{constructor(){super({id:"editor.action.removeBrackets",label:F("smartSelect.removeBrackets","Remove Brackets"),alias:"Remove Brackets",precondition:void 0,kbOpts:{kbExpr:fe.editorTextFocus,primary:2561,weight:100}})}run(e,t){var i;(i=dh.get(t))==null||i.removeBrackets(this.id)}}class CR{constructor(e,t,i){this.position=e,this.brackets=t,this.options=i}}const jc=class jc extends Li{static get(e){return e.getContribution(jc.ID)}constructor(e){super(),this._editor=e,this._lastBracketsData=[],this._lastVersionId=0,this._decorations=this._editor.createDecorationsCollection(),this._updateBracketsSoon=this._register(new po(()=>this._updateBrackets(),50)),this._matchBrackets=this._editor.getOption(72),this._updateBracketsSoon.schedule(),this._register(e.onDidChangeCursorPosition(t=>{this._matchBrackets!=="never"&&this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelContent(t=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModel(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeModelLanguageConfiguration(t=>{this._lastBracketsData=[],this._updateBracketsSoon.schedule()})),this._register(e.onDidChangeConfiguration(t=>{t.hasChanged(72)&&(this._matchBrackets=this._editor.getOption(72),this._decorations.clear(),this._lastBracketsData=[],this._lastVersionId=0,this._updateBracketsSoon.schedule())})),this._register(e.onDidBlurEditorWidget(()=>{this._updateBracketsSoon.schedule()})),this._register(e.onDidFocusEditorWidget(()=>{this._updateBracketsSoon.schedule()}))}jumpToBracket(){if(!this._editor.hasModel())return;const e=this._editor.getModel(),t=this._editor.getSelections().map(i=>{const n=i.getStartPosition(),s=e.bracketPairs.matchBracket(n);let a=null;if(s)s[0].containsPosition(n)&&!s[1].containsPosition(n)?a=s[1].getStartPosition():s[1].containsPosition(n)&&(a=s[0].getStartPosition());else{const l=e.bracketPairs.findEnclosingBrackets(n);if(l)a=l[1].getStartPosition();else{const d=e.bracketPairs.findNextBracket(n);d&&d.range&&(a=d.range.getStartPosition())}}return a?new fn(a.lineNumber,a.column,a.lineNumber,a.column):new fn(n.lineNumber,n.column,n.lineNumber,n.column)});this._editor.setSelections(t),this._editor.revealRange(t[0])}selectToBracket(e){if(!this._editor.hasModel())return;const t=this._editor.getModel(),i=[];this._editor.getSelections().forEach(n=>{const s=n.getStartPosition();let a=t.bracketPairs.matchBracket(s);if(!a&&(a=t.bracketPairs.findEnclosingBrackets(s),!a)){const u=t.bracketPairs.findNextBracket(s);u&&u.range&&(a=t.bracketPairs.matchBracket(u.range.getStartPosition()))}let l=null,d=null;if(a){a.sort(Ze.compareRangesUsingStarts);const[u,g]=a;if(l=e?u.getStartPosition():u.getEndPosition(),d=e?g.getEndPosition():g.getStartPosition(),g.containsPosition(s)){const x=l;l=d,d=x}}l&&d&&i.push(new fn(l.lineNumber,l.column,d.lineNumber,d.column))}),i.length>0&&(this._editor.setSelections(i),this._editor.revealRange(i[0]))}removeBrackets(e){if(!this._editor.hasModel())return;const t=this._editor.getModel();this._editor.getSelections().forEach(i=>{const n=i.getPosition();let s=t.bracketPairs.matchBracket(n);s||(s=t.bracketPairs.findEnclosingBrackets(n)),s&&(this._editor.pushUndoStop(),this._editor.executeEdits(e,[{range:s[0],text:""},{range:s[1],text:""}]),this._editor.pushUndoStop())})}_updateBrackets(){if(this._matchBrackets==="never")return;this._recomputeBrackets();const e=[];let t=0;for(const i of this._lastBracketsData){const n=i.brackets;n&&(e[t++]={range:n[0],options:i.options},e[t++]={range:n[1],options:i.options})}this._decorations.set(e)}_recomputeBrackets(){if(!this._editor.hasModel()||!this._editor.hasWidgetFocus()){this._lastBracketsData=[],this._lastVersionId=0;return}const e=this._editor.getSelections();if(e.length>100){this._lastBracketsData=[],this._lastVersionId=0;return}const t=this._editor.getModel(),i=t.getVersionId();let n=[];this._lastVersionId===i&&(n=this._lastBracketsData);const s=[];let a=0;for(let x=0,m=e.length;x<m;x++){const C=e[x];C.isEmpty()&&(s[a++]=C.getStartPosition())}s.length>1&&s.sort(Xi.compare);const l=[];let d=0,u=0;const g=n.length;for(let x=0,m=s.length;x<m;x++){const C=s[x];for(;u<g&&n[u].position.isBefore(C);)u++;if(u<g&&n[u].position.equals(C))l[d++]=n[u];else{let _=t.bracketPairs.matchBracket(C,20),E=jc._DECORATION_OPTIONS_WITH_OVERVIEW_RULER;!_&&this._matchBrackets==="always"&&(_=t.bracketPairs.findEnclosingBrackets(C,20),E=jc._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER),l[d++]=new CR(C,_,E)}}this._lastBracketsData=l,this._lastVersionId=i}};jc.ID="editor.contrib.bracketMatchingController",jc._DECORATION_OPTIONS_WITH_OVERVIEW_RULER=Kn.register({description:"bracket-match-overview",stickiness:1,className:"bracket-match",overviewRuler:{color:ho(xR),position:Sl.Center}}),jc._DECORATION_OPTIONS_WITHOUT_OVERVIEW_RULER=Kn.register({description:"bracket-match-no-overview",stickiness:1,className:"bracket-match"});let dh=jc;$n(dh.ID,dh,1);Yt(_R);Yt(mR);Yt(bR);ba.appendMenuItem(Ni.MenubarGoMenu,{group:"5_infile_nav",command:{id:"editor.action.jumpToBracket",title:F({key:"miGoToBracket",comment:["&& denotes a mnemonic"]},"Go to &&Bracket")},order:2});class yR{constructor(e,t){this._selection=e,this._isMovingLeft=t}getEditOperations(e,t){if(this._selection.startLineNumber!==this._selection.endLineNumber||this._selection.isEmpty())return;const i=this._selection.startLineNumber,n=this._selection.startColumn,s=this._selection.endColumn;if(!(this._isMovingLeft&&n===1)&&!(!this._isMovingLeft&&s===e.getLineMaxColumn(i)))if(this._isMovingLeft){const a=new Ze(i,n-1,i,n),l=e.getValueInRange(a);t.addEditOperation(a,null),t.addEditOperation(new Ze(i,s,i,s),l)}else{const a=new Ze(i,s,i,s+1),l=e.getValueInRange(a);t.addEditOperation(a,null),t.addEditOperation(new Ze(i,n,i,n),l)}}computeCursorState(e,t){return this._isMovingLeft?new fn(this._selection.startLineNumber,this._selection.startColumn-1,this._selection.endLineNumber,this._selection.endColumn-1):new fn(this._selection.startLineNumber,this._selection.startColumn+1,this._selection.endLineNumber,this._selection.endColumn+1)}}class $3 extends Ci{constructor(e,t){super(t),this.left=e}run(e,t){if(!t.hasModel())return;const i=[],n=t.getSelections();for(const s of n)i.push(new yR(s,this.left));t.pushUndoStop(),t.executeCommands(this.id,i),t.pushUndoStop()}}class wR extends $3{constructor(){super(!0,{id:"editor.action.moveCarretLeftAction",label:F("caret.moveLeft","Move Selected Text Left"),alias:"Move Selected Text Left",precondition:fe.writable})}}class ER extends $3{constructor(){super(!1,{id:"editor.action.moveCarretRightAction",label:F("caret.moveRight","Move Selected Text Right"),alias:"Move Selected Text Right",precondition:fe.writable})}}Yt(wR);Yt(ER);class SR extends Ci{constructor(){super({id:"editor.action.transposeLetters",label:F("transposeLetters.label","Transpose Letters"),alias:"Transpose Letters",precondition:fe.writable,kbOpts:{kbExpr:fe.textInputFocus,primary:0,mac:{primary:306},weight:100}})}run(e,t){if(!t.hasModel())return;const i=t.getModel(),n=[],s=t.getSelections();for(const a of s){if(!a.isEmpty())continue;const l=a.startLineNumber,d=a.startColumn,u=i.getLineMaxColumn(l);if(l===1&&(d===1||d===2&&u===2))continue;const g=d===u?a.getPosition():Sb.rightPosition(i,a.getPosition().lineNumber,a.getPosition().column),x=Sb.leftPosition(i,g),m=Sb.leftPosition(i,x),C=i.getValueInRange(Ze.fromPositions(m,x)),_=i.getValueInRange(Ze.fromPositions(x,g)),E=Ze.fromPositions(m,g);n.push(new Z0(E,_+C))}n.length>0&&(t.pushUndoStop(),t.executeCommands(this.id,n),t.pushUndoStop())}}Yt(SR);const j1=(function(){if(typeof crypto=="object"&&typeof crypto.randomUUID=="function")return crypto.randomUUID.bind(crypto);let r;typeof crypto=="object"&&typeof crypto.getRandomValues=="function"?r=crypto.getRandomValues.bind(crypto):r=function(i){for(let n=0;n<i.length;n++)i[n]=Math.floor(Math.random()*256);return i};const e=new Uint8Array(16),t=[];for(let i=0;i<256;i++)t.push(i.toString(16).padStart(2,"0"));return function(){r(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let n=0,s="";return s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+="-",s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s+=t[e[n++]],s}})();function v9(r){return{asString:async()=>r,asFile:()=>{},value:typeof r=="string"?r:void 0}}function kR(r,e,t){const i={id:j1(),name:r,uri:e,data:t};return{asString:async()=>"",asFile:()=>i,value:void 0}}class q3{constructor(){this._entries=new Map}get size(){let e=0;for(const t of this._entries)e++;return e}has(e){return this._entries.has(this.toKey(e))}matches(e){const t=[...this._entries.keys()];return ac.some(this,([i,n])=>n.asFile())&&t.push("files"),G3(gm(e),t)}get(e){var t;return(t=this._entries.get(this.toKey(e)))==null?void 0:t[0]}append(e,t){const i=this._entries.get(e);i?i.push(t):this._entries.set(this.toKey(e),[t])}replace(e,t){this._entries.set(this.toKey(e),[t])}delete(e){this._entries.delete(this.toKey(e))}*[Symbol.iterator](){for(const[e,t]of this._entries)for(const i of t)yield[e,i]}toKey(e){return gm(e)}}function gm(r){return r.toLowerCase()}function U3(r,e){return G3(gm(r),e.map(gm))}function G3(r,e){if(r==="*/*")return e.length>0;if(e.includes(r))return!0;const t=r.match(/^([a-z]+)\/([a-z]+|\*)$/i);if(!t)return!1;const[i,n,s]=t;return s==="*"?e.some(a=>a.startsWith(n+"/")):!1}const V1=Object.freeze({create:r=>r6(r.map(e=>e.toString())).join(`\r
14
14
  `),split:r=>r.split(`\r
15
15
  `),parse:r=>V1.split(r).filter(e=>!e.startsWith("#"))}),ul=class ul{constructor(e){this.value=e}equals(e){return this.value===e.value}contains(e){return this.equals(e)||this.value===""||e.value.startsWith(this.value+ul.sep)}intersects(e){return this.contains(e)||e.contains(this)}append(...e){return new ul((this.value?[this.value,...e]:e).join(ul.sep))}};ul.sep=".",ul.None=new ul("@@none@@"),ul.Empty=new ul("");let Rs=ul;const b8={EDITORS:"CodeEditors",FILES:"CodeFiles"};class DR{}const AR={DragAndDropContribution:"workbench.contributions.dragAndDrop"};Ya.add(AR.DragAndDropContribution,new DR);const Yg=class Yg{constructor(){}static getInstance(){return Yg.INSTANCE}hasData(e){return e&&e===this.proto}getData(e){if(this.hasData(e))return this.data}};Yg.INSTANCE=new Yg;let My=Yg;function K3(r){const e=new q3;for(const t of r.items){const i=t.type;if(t.kind==="string"){const n=new Promise(s=>t.getAsString(s));e.append(i,v9(n))}else if(t.kind==="file"){const n=t.getAsFile();n&&e.append(i,BR(n))}}return e}function BR(r){const e=r.path?ms.parse(r.path):void 0;return kR(r.name,e,async()=>new Uint8Array(await r.arrayBuffer()))}const FR=Object.freeze([b8.EDITORS,b8.FILES,iy.RESOURCES,iy.INTERNAL_URI_LIST]);function Z3(r,e=!1){const t=K3(r),i=t.get(iy.INTERNAL_URI_LIST);if(i)t.replace(Ao.uriList,i);else if(e||!t.has(Ao.uriList)){const n=[];for(const s of r.items){const a=s.getAsFile();if(a){const l=a.path;try{l?n.push(ms.file(l).toString()):n.push(ms.parse(a.name,!0).toString())}catch{}}}n.length&&t.replace(Ao.uriList,v9(V1.create(n)))}for(const n of FR)t.delete(n);return t}var x9=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},p0=function(r,e){return function(t,i){e(t,i,r)}};class m9{async provideDocumentPasteEdits(e,t,i,n,s){const a=await this.getEdit(i,s);if(a)return{edits:[{insertText:a.insertText,title:a.title,kind:a.kind,handledMimeType:a.handledMimeType,yieldTo:a.yieldTo}],dispose(){}}}async provideDocumentDropEdits(e,t,i,n){const s=await this.getEdit(i,n);if(s)return{edits:[{insertText:s.insertText,title:s.title,kind:s.kind,handledMimeType:s.handledMimeType,yieldTo:s.yieldTo}],dispose(){}}}}const Xg=class Xg extends m9{constructor(){super(...arguments),this.kind=Xg.kind,this.dropMimeTypes=[Ao.text],this.pasteMimeTypes=[Ao.text]}async getEdit(e,t){const i=e.get(Ao.text);if(!i||e.has(Ao.uriList))return;const n=await i.asString();return{handledMimeType:Ao.text,title:F("text.label","Insert Plain Text"),insertText:n,kind:this.kind}}};Xg.id="text",Xg.kind=new Rs("text.plain");let uh=Xg;class Y3 extends m9{constructor(){super(...arguments),this.kind=new Rs("uri.absolute"),this.dropMimeTypes=[Ao.uriList],this.pasteMimeTypes=[Ao.uriList]}async getEdit(e,t){const i=await X3(e);if(!i.length||t.isCancellationRequested)return;let n=0;const s=i.map(({uri:l,originalText:d})=>l.scheme===sr.file?l.fsPath:(n++,d)).join(" ");let a;return n>0?a=i.length>1?F("defaultDropProvider.uriList.uris","Insert Uris"):F("defaultDropProvider.uriList.uri","Insert Uri"):a=i.length>1?F("defaultDropProvider.uriList.paths","Insert Paths"):F("defaultDropProvider.uriList.path","Insert Path"),{handledMimeType:Ao.uriList,insertText:s,title:a,kind:this.kind}}}let vm=class extends m9{constructor(e){super(),this._workspaceContextService=e,this.kind=new Rs("uri.relative"),this.dropMimeTypes=[Ao.uriList],this.pasteMimeTypes=[Ao.uriList]}async getEdit(e,t){const i=await X3(e);if(!i.length||t.isCancellationRequested)return;const n=fc(i.map(({uri:s})=>{const a=this._workspaceContextService.getWorkspaceFolder(s);return a?CF(a.uri,s):void 0}));if(n.length)return{handledMimeType:Ao.uriList,insertText:n.join(" "),title:i.length>1?F("defaultDropProvider.uriList.relativePaths","Insert Relative Paths"):F("defaultDropProvider.uriList.relativePath","Insert Relative Path"),kind:this.kind}}};vm=x9([p0(0,rp)],vm);class LR{constructor(){this.kind=new Rs("html"),this.pasteMimeTypes=["text/html"],this._yieldTo=[{mimeType:Ao.text}]}async provideDocumentPasteEdits(e,t,i,n,s){var d;if(n.triggerKind!==ny.PasteAs&&!((d=n.only)!=null&&d.contains(this.kind)))return;const a=i.get("text/html"),l=await(a==null?void 0:a.asString());if(!(!l||s.isCancellationRequested))return{dispose(){},edits:[{insertText:l,yieldTo:this._yieldTo,title:F("pasteHtmlLabel","Insert HTML"),kind:this.kind}]}}}async function X3(r){const e=r.get(Ao.uriList);if(!e)return[];const t=await e.asString(),i=[];for(const n of V1.parse(t))try{i.push({uri:ms.parse(n),originalText:n})}catch{}return i}let Ry=class extends Li{constructor(e,t){super(),this._register(e.documentDropEditProvider.register("*",new uh)),this._register(e.documentDropEditProvider.register("*",new Y3)),this._register(e.documentDropEditProvider.register("*",new vm(t)))}};Ry=x9([p0(0,Qi),p0(1,rp)],Ry);let Ny=class extends Li{constructor(e,t){super(),this._register(e.documentPasteEditProvider.register("*",new uh)),this._register(e.documentPasteEditProvider.register("*",new Y3)),this._register(e.documentPasteEditProvider.register("*",new vm(t))),this._register(e.documentPasteEditProvider.register("*",new LR))}};Ny=x9([p0(0,Qi),p0(1,rp)],Ny);const ta=class ta{constructor(){this.value="",this.pos=0}static isDigitCharacter(e){return e>=48&&e<=57}static isVariableCharacter(e){return e===95||e>=97&&e<=122||e>=65&&e<=90}text(e){this.value=e,this.pos=0}tokenText(e){return this.value.substr(e.pos,e.len)}next(){if(this.pos>=this.value.length)return{type:14,pos:this.pos,len:0};const e=this.pos;let t=0,i=this.value.charCodeAt(e),n;if(n=ta._table[i],typeof n=="number")return this.pos+=1,{type:n,pos:e,len:1};if(ta.isDigitCharacter(i)){n=8;do t+=1,i=this.value.charCodeAt(e+t);while(ta.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}if(ta.isVariableCharacter(i)){n=9;do i=this.value.charCodeAt(e+ ++t);while(ta.isVariableCharacter(i)||ta.isDigitCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}n=10;do t+=1,i=this.value.charCodeAt(e+t);while(!isNaN(i)&&typeof ta._table[i]>"u"&&!ta.isDigitCharacter(i)&&!ta.isVariableCharacter(i));return this.pos+=t,{type:n,pos:e,len:t}}};ta._table={36:0,58:1,44:2,123:3,125:4,92:5,47:6,124:7,43:11,45:12,63:13};let Oy=ta;class Up{constructor(){this._children=[]}appendChild(e){return e instanceof xr&&this._children[this._children.length-1]instanceof xr?this._children[this._children.length-1].value+=e.value:(e.parent=this,this._children.push(e)),this}replace(e,t){const{parent:i}=e,n=i.children.indexOf(e),s=i.children.slice(0);s.splice(n,1,...t),i._children=s,(function a(l,d){for(const u of l)u.parent=d,a(u.children,u)})(t,i)}get children(){return this._children}get rightMostDescendant(){return this._children.length>0?this._children[this._children.length-1].rightMostDescendant:this}get snippet(){let e=this;for(;;){if(!e)return;if(e instanceof vv)return e;e=e.parent}}toString(){return this.children.reduce((e,t)=>e+t.toString(),"")}len(){return 0}}let xr=class Q3 extends Up{constructor(e){super(),this.value=e}toString(){return this.value}len(){return this.value.length}clone(){return new Q3(this.value)}};class J3 extends Up{}class Kr extends J3{static compareByIndex(e,t){return e.index===t.index?0:e.isFinalTabstop?1:t.isFinalTabstop||e.index<t.index?-1:e.index>t.index?1:0}constructor(e){super(),this.index=e}get isFinalTabstop(){return this.index===0}get choice(){return this._children.length===1&&this._children[0]instanceof Gp?this._children[0]:void 0}clone(){const e=new Kr(this.index);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}class Gp extends Up{constructor(){super(...arguments),this.options=[]}appendChild(e){return e instanceof xr&&(e.parent=this,this.options.push(e)),this}toString(){return this.options[0].value}len(){return this.options[0].len()}clone(){const e=new Gp;return this.options.forEach(e.appendChild,e),e}}class _9 extends Up{constructor(){super(...arguments),this.regexp=new RegExp("")}resolve(e){const t=this;let i=!1,n=e.replace(this.regexp,function(){return i=!0,t._replace(Array.prototype.slice.call(arguments,0,-2))});return!i&&this._children.some(s=>s instanceof Ra&&!!s.elseValue)&&(n=this._replace([])),n}_replace(e){let t="";for(const i of this._children)if(i instanceof Ra){let n=e[i.index]||"";n=i.resolve(n),t+=n}else t+=i.toString();return t}toString(){return""}clone(){const e=new _9;return e.regexp=new RegExp(this.regexp.source,(this.regexp.ignoreCase?"i":"")+(this.regexp.global?"g":"")),e._children=this.children.map(t=>t.clone()),e}}class Ra extends Up{constructor(e,t,i,n){super(),this.index=e,this.shorthandName=t,this.ifValue=i,this.elseValue=n}resolve(e){return this.shorthandName==="upcase"?e?e.toLocaleUpperCase():"":this.shorthandName==="downcase"?e?e.toLocaleLowerCase():"":this.shorthandName==="capitalize"?e?e[0].toLocaleUpperCase()+e.substr(1):"":this.shorthandName==="pascalcase"?e?this._toPascalCase(e):"":this.shorthandName==="camelcase"?e?this._toCamelCase(e):"":e&&typeof this.ifValue=="string"?this.ifValue:!e&&typeof this.elseValue=="string"?this.elseValue:e||""}_toPascalCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map(i=>i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}_toCamelCase(e){const t=e.match(/[a-z0-9]+/gi);return t?t.map((i,n)=>n===0?i.charAt(0).toLowerCase()+i.substr(1):i.charAt(0).toUpperCase()+i.substr(1)).join(""):e}clone(){return new Ra(this.index,this.shorthandName,this.ifValue,this.elseValue)}}class g0 extends J3{constructor(e){super(),this.name=e}resolve(e){let t=e.resolve(this);return this.transform&&(t=this.transform.resolve(t||"")),t!==void 0?(this._children=[new xr(t)],!0):!1}clone(){const e=new g0(this.name);return this.transform&&(e.transform=this.transform.clone()),e._children=this.children.map(t=>t.clone()),e}}function C8(r,e){const t=[...r];for(;t.length>0;){const i=t.shift();if(!e(i))break;t.unshift(...i.children)}}class vv extends Up{get placeholderInfo(){if(!this._placeholders){const e=[];let t;this.walk(function(i){return i instanceof Kr&&(e.push(i),t=!t||t.index<i.index?i:t),!0}),this._placeholders={all:e,last:t}}return this._placeholders}get placeholders(){const{all:e}=this.placeholderInfo;return e}offset(e){let t=0,i=!1;return this.walk(n=>n===e?(i=!0,!1):(t+=n.len(),!0)),i?t:-1}fullLen(e){let t=0;return C8([e],i=>(t+=i.len(),!0)),t}enclosingPlaceholders(e){const t=[];let{parent:i}=e;for(;i;)i instanceof Kr&&t.push(i),i=i.parent;return t}resolveVariables(e){return this.walk(t=>(t instanceof g0&&t.resolve(e)&&(this._placeholders=void 0),!0)),this}appendChild(e){return this._placeholders=void 0,super.appendChild(e)}replace(e,t){return this._placeholders=void 0,super.replace(e,t)}clone(){const e=new vv;return this._children=this.children.map(t=>t.clone()),e}walk(e){C8(this.children,e)}}class hh{constructor(){this._scanner=new Oy,this._token={type:14,pos:0,len:0}}static escape(e){return e.replace(/\$|}|\\/g,"\\$&")}static guessNeedsClipboard(e){return/\${?CLIPBOARD/.test(e)}parse(e,t,i){const n=new vv;return this.parseFragment(e,n),this.ensureFinalTabstop(n,i??!1,t??!1),n}parseFragment(e,t){const i=t.children.length;for(this._scanner.text(e),this._token=this._scanner.next();this._parse(t););const n=new Map,s=[];t.walk(d=>(d instanceof Kr&&(d.isFinalTabstop?n.set(0,void 0):!n.has(d.index)&&d.children.length>0?n.set(d.index,d.children):s.push(d)),!0));const a=(d,u)=>{const g=n.get(d.index);if(!g)return;const x=new Kr(d.index);x.transform=d.transform;for(const m of g){const C=m.clone();x.appendChild(C),C instanceof Kr&&n.has(C.index)&&!u.has(C.index)&&(u.add(C.index),a(C,u),u.delete(C.index))}t.replace(d,[x])},l=new Set;for(const d of s)a(d,l);return t.children.slice(i)}ensureFinalTabstop(e,t,i){(t||i&&e.placeholders.length>0)&&(e.placeholders.find(s=>s.index===0)||e.appendChild(new Kr(0)))}_accept(e,t){if(e===void 0||this._token.type===e){const i=t?this._scanner.tokenText(this._token):!0;return this._token=this._scanner.next(),i}return!1}_backTo(e){return this._scanner.pos=e.pos+e.len,this._token=e,!1}_until(e){const t=this._token;for(;this._token.type!==e;){if(this._token.type===14)return!1;if(this._token.type===5){const n=this._scanner.next();if(n.type!==0&&n.type!==4&&n.type!==5)return!1}this._token=this._scanner.next()}const i=this._scanner.value.substring(t.pos,this._token.pos).replace(/\\(\$|}|\\)/g,"$1");return this._token=this._scanner.next(),i}_parse(e){return this._parseEscaped(e)||this._parseTabstopOrVariableName(e)||this._parseComplexPlaceholder(e)||this._parseComplexVariable(e)||this._parseAnything(e)}_parseEscaped(e){let t;return(t=this._accept(5,!0))?(t=this._accept(0,!0)||this._accept(4,!0)||this._accept(5,!0)||t,e.appendChild(new xr(t)),!0):!1}_parseTabstopOrVariableName(e){let t;const i=this._token;return this._accept(0)&&(t=this._accept(9,!0)||this._accept(8,!0))?(e.appendChild(/^\d+$/.test(t)?new Kr(Number(t)):new g0(t)),!0):this._backTo(i)}_parseComplexPlaceholder(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(8,!0))))return this._backTo(i);const s=new Kr(Number(t));if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(s),!0;if(!this._parse(s))return e.appendChild(new xr("${"+t+":")),s.children.forEach(e.appendChild,e),!0}else if(s.index>0&&this._accept(7)){const a=new Gp;for(;;){if(this._parseChoiceElement(a)){if(this._accept(2))continue;if(this._accept(7)&&(s.appendChild(a),this._accept(4)))return e.appendChild(s),!0}return this._backTo(i),!1}}else return this._accept(6)?this._parseTransform(s)?(e.appendChild(s),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(s),!0):this._backTo(i)}_parseChoiceElement(e){const t=this._token,i=[];for(;!(this._token.type===2||this._token.type===7);){let n;if((n=this._accept(5,!0))?n=this._accept(2,!0)||this._accept(7,!0)||this._accept(5,!0)||n:n=this._accept(void 0,!0),!n)return this._backTo(t),!1;i.push(n)}return i.length===0?(this._backTo(t),!1):(e.appendChild(new xr(i.join(""))),!0)}_parseComplexVariable(e){let t;const i=this._token;if(!(this._accept(0)&&this._accept(3)&&(t=this._accept(9,!0))))return this._backTo(i);const s=new g0(t);if(this._accept(1))for(;;){if(this._accept(4))return e.appendChild(s),!0;if(!this._parse(s))return e.appendChild(new xr("${"+t+":")),s.children.forEach(e.appendChild,e),!0}else return this._accept(6)?this._parseTransform(s)?(e.appendChild(s),!0):(this._backTo(i),!1):this._accept(4)?(e.appendChild(s),!0):this._backTo(i)}_parseTransform(e){const t=new _9;let i="",n="";for(;!this._accept(6);){let s;if(s=this._accept(5,!0)){s=this._accept(6,!0)||s,i+=s;continue}if(this._token.type!==14){i+=this._accept(void 0,!0);continue}return!1}for(;!this._accept(6);){let s;if(s=this._accept(5,!0)){s=this._accept(5,!0)||this._accept(6,!0)||s,t.appendChild(new xr(s));continue}if(!(this._parseFormatString(t)||this._parseAnything(t)))return!1}for(;!this._accept(4);){if(this._token.type!==14){n+=this._accept(void 0,!0);continue}return!1}try{t.regexp=new RegExp(i,n)}catch{return!1}return e.transform=t,!0}_parseFormatString(e){const t=this._token;if(!this._accept(0))return!1;let i=!1;this._accept(3)&&(i=!0);const n=this._accept(8,!0);if(n)if(i){if(this._accept(4))return e.appendChild(new Ra(Number(n))),!0;if(!this._accept(1))return this._backTo(t),!1}else return e.appendChild(new Ra(Number(n))),!0;else return this._backTo(t),!1;if(this._accept(6)){const s=this._accept(9,!0);return!s||!this._accept(4)?(this._backTo(t),!1):(e.appendChild(new Ra(Number(n),s)),!0)}else if(this._accept(11)){const s=this._until(4);if(s)return e.appendChild(new Ra(Number(n),void 0,s,void 0)),!0}else if(this._accept(12)){const s=this._until(4);if(s)return e.appendChild(new Ra(Number(n),void 0,void 0,s)),!0}else if(this._accept(13)){const s=this._until(1);if(s){const a=this._until(4);if(a)return e.appendChild(new Ra(Number(n),void 0,s,a)),!0}}else{const s=this._until(4);if(s)return e.appendChild(new Ra(Number(n),void 0,void 0,s)),!0}return this._backTo(t),!1}_parseAnything(e){return this._token.type!==14?(e.appendChild(new xr(this._scanner.tokenText(this._token))),this._accept(void 0),!0):!1}}function e4(r,e,t){var i,n;return(typeof t.insertText=="string"?t.insertText==="":t.insertText.snippet==="")?{edits:((i=t.additionalEdit)==null?void 0:i.edits)??[]}:{edits:[...e.map(s=>new yF(r,{range:s,text:typeof t.insertText=="string"?hh.escape(t.insertText)+"$0":t.insertText.snippet,insertAsSnippet:!0})),...((n=t.additionalEdit)==null?void 0:n.edits)??[]]}}function t4(r){function e(a,l){return"mimeType"in a?a.mimeType===l.handledMimeType:!!l.kind&&a.kind.contains(l.kind)}const t=new Map;for(const a of r)for(const l of a.yieldTo??[])for(const d of r)if(d!==a&&e(l,d)){let u=t.get(a);u||(u=[],t.set(a,u)),u.push(d)}if(!t.size)return Array.from(r);const i=new Set,n=[];function s(a){if(!a.length)return[];const l=a[0];if(n.includes(l))return console.warn("Yield to cycle detected",l),a;if(i.has(l))return s(a.slice(1));let d=[];const u=t.get(l);return u&&(n.push(l),d=s(u),n.pop()),i.add(l),[...d,l,...s(a.slice(1))]}return s(Array.from(r))}var IR=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},PR=function(r,e){return function(t,i){e(t,i,r)}};const TR=Kn.register({description:"inline-progress-widget",stickiness:1,showIfCollapsed:!0,after:{content:a6,inlineClassName:"inline-editor-progress-decoration",inlineClassNameAffectsLetterSpacing:!0}}),D_=class D_ extends Li{constructor(e,t,i,n,s){super(),this.typeId=e,this.editor=t,this.range=i,this.delegate=s,this.allowEditorOverflow=!1,this.suppressMouseDown=!0,this.create(n),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this)}create(e){this.domNode=Ui(".inline-progress-widget"),this.domNode.role="button",this.domNode.title=e;const t=Ui("span.icon");this.domNode.append(t),t.classList.add(...ls.asClassNameArray(_n.loading),"codicon-modifier-spin");const i=()=>{const n=this.editor.getOption(67);this.domNode.style.height=`${n}px`,this.domNode.style.width=`${Math.ceil(.8*n)}px`};i(),this._register(this.editor.onDidChangeConfiguration(n=>{(n.hasChanged(52)||n.hasChanged(67))&&i()})),this._register(ss(this.domNode,Us.CLICK,n=>{this.delegate.cancel()}))}getId(){return D_.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:{lineNumber:this.range.startLineNumber,column:this.range.startColumn},preference:[0]}}dispose(){super.dispose(),this.editor.removeContentWidget(this)}};D_.baseId="editor.widget.inlineProgressWidget";let Hy=D_,xm=class extends Li{constructor(e,t,i){super(),this.id=e,this._editor=t,this._instantiationService=i,this._showDelay=500,this._showPromise=this._register(new Hr),this._currentWidget=this._register(new Hr),this._operationIdPool=0,this._currentDecorations=t.createDecorationsCollection()}dispose(){super.dispose(),this._currentDecorations.clear()}async showWhile(e,t,i,n,s){const a=this._operationIdPool++;this._currentOperation=a,this.clear(),this._showPromise.value=e0(()=>{const l=Ze.fromPositions(e);this._currentDecorations.set([{range:l,options:TR}]).length>0&&(this._currentWidget.value=this._instantiationService.createInstance(Hy,this.id,this._editor,l,t,n))},s??this._showDelay);try{return await i}finally{this._currentOperation===a&&(this.clear(),this._currentOperation=void 0)}}clear(){this._showPromise.clear(),this._currentDecorations.clear(),this._currentWidget.clear()}};xm=IR([PR(2,Pn)],xm);var MR=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},y8=function(r,e){return function(t,i){e(t,i,r)}},Px,rd;let _r=(rd=class{static get(e){return e.getContribution(Px.ID)}constructor(e,t,i){this._openerService=i,this._messageWidget=new Hr,this._messageListeners=new Fi,this._mouseOverMessage=!1,this._editor=e,this._visible=Px.MESSAGE_VISIBLE.bindTo(t)}dispose(){var e;(e=this._message)==null||e.dispose(),this._messageListeners.dispose(),this._messageWidget.dispose(),this._visible.reset()}showMessage(e,t){Ca(yx(e)?e.value:e),this._visible.set(!0),this._messageWidget.clear(),this._messageListeners.clear(),this._message=yx(e)?wF(e,{actionHandler:{callback:n=>{this.closeMessage(),EF(this._openerService,n,yx(e)?e.isTrusted:void 0)},disposables:this._messageListeners}}):void 0,this._messageWidget.value=new w8(this._editor,t,typeof e=="string"?e:this._message.element),this._messageListeners.add(fo.debounce(this._editor.onDidBlurEditorText,(n,s)=>s,0)(()=>{this._mouseOverMessage||this._messageWidget.value&&SF(o6(),this._messageWidget.value.getDomNode())||this.closeMessage()})),this._messageListeners.add(this._editor.onDidChangeCursorPosition(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidDispose(()=>this.closeMessage())),this._messageListeners.add(this._editor.onDidChangeModel(()=>this.closeMessage())),this._messageListeners.add(ss(this._messageWidget.value.getDomNode(),Us.MOUSE_ENTER,()=>this._mouseOverMessage=!0,!0)),this._messageListeners.add(ss(this._messageWidget.value.getDomNode(),Us.MOUSE_LEAVE,()=>this._mouseOverMessage=!1,!0));let i;this._messageListeners.add(this._editor.onMouseMove(n=>{n.target.position&&(i?i.containsPosition(n.target.position)||this.closeMessage():i=new Ze(t.lineNumber-3,1,n.target.position.lineNumber+3,1))}))}closeMessage(){this._visible.reset(),this._messageListeners.clear(),this._messageWidget.value&&this._messageListeners.add(w8.fadeOut(this._messageWidget.value))}},Px=rd,rd.ID="editor.contrib.messageController",rd.MESSAGE_VISIBLE=new es("messageVisible",!1,F("messageVisible","Whether the editor is currently showing an inline message")),rd);_r=Px=MR([y8(1,os),y8(2,Xa)],_r);const RR=dr.bindToContribution(_r.get);nn(new RR({id:"leaveEditorMessage",precondition:_r.MESSAGE_VISIBLE,handler:r=>r.closeMessage(),kbOpts:{weight:130,primary:9}}));let w8=class{static fadeOut(e){const t=()=>{e.dispose(),clearTimeout(i),e.getDomNode().removeEventListener("animationend",t)},i=setTimeout(t,110);return e.getDomNode().addEventListener("animationend",t),e.getDomNode().classList.add("fadeOut"),{dispose:t}}constructor(e,{lineNumber:t,column:i},n){this.allowEditorOverflow=!0,this.suppressMouseDown=!1,this._editor=e,this._editor.revealLinesInCenterIfOutsideViewport(t,t,0),this._position={lineNumber:t,column:i},this._domNode=document.createElement("div"),this._domNode.classList.add("monaco-editor-overlaymessage"),this._domNode.style.marginLeft="-6px";const s=document.createElement("div");s.classList.add("anchor","top"),this._domNode.appendChild(s);const a=document.createElement("div");typeof n=="string"?(a.classList.add("message"),a.textContent=n):(n.classList.add("message"),a.appendChild(n)),this._domNode.appendChild(a);const l=document.createElement("div");l.classList.add("anchor","below"),this._domNode.appendChild(l),this._editor.addContentWidget(this),this._domNode.classList.add("fadeIn")}dispose(){this._editor.removeContentWidget(this)}getId(){return"messageoverlay"}getDomNode(){return this._domNode}getPosition(){return{position:this._position,preference:[1,2],positionAffinity:1}}afterRender(e){this._domNode.classList.toggle("below",e===2)}};$n(_r.ID,_r,4);function Wb(r,e){return e&&(r.stack||r.stacktrace)?F("stackTrace.format","{0}: {1}",S8(r),E8(r.stack)||E8(r.stacktrace)):S8(r)}function E8(r){return Array.isArray(r)?r.join(`
16
16
  `):r}function S8(r){return r.code==="ERR_UNC_HOST_NOT_ALLOWED"?`${r.message}. Please update the 'security.allowedUNCHosts' setting if you want to allow this host.`:typeof r.code=="string"&&typeof r.errno=="number"&&typeof r.syscall=="string"?F("nodeExceptionMessage","A system error occurred ({0})",r.message):r.message||F("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}function mm(r=null,e=!1){if(!r)return F("error.defaultMessage","An unknown error occurred. Please consult the log for more details.");if(Array.isArray(r)){const t=fc(r),i=mm(t[0],e);return t.length>1?F("error.moreErrors","{0} ({1} errors in total)",i,t.length):i}if(l6(r))return r;if(r.detail){const t=r.detail;if(t.error)return Wb(t.error,e);if(t.exception)return Wb(t.exception,e)}return r.stack?Wb(r,e):r.message?r.message:F("error.defaultMessage","An unknown error occurred. Please consult the log for more details.")}var i4=function(r,e,t,i){var n=arguments.length,s=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(r,e,t,i);else for(var l=r.length-1;l>=0;l--)(a=r[l])&&(s=(n<3?a(s):n>3?a(e,t,s):a(e,t))||s);return n>3&&s&&Object.defineProperty(e,t,s),s},Nf=function(r,e){return function(t,i){e(t,i,r)}},zy,_u;let Wy=(_u=class extends Li{constructor(e,t,i,n,s,a,l,d,u,g){super(),this.typeId=e,this.editor=t,this.showCommand=n,this.range=s,this.edits=a,this.onSelectNewEdit=l,this._contextMenuService=d,this._keybindingService=g,this.allowEditorOverflow=!0,this.suppressMouseDown=!0,this.create(),this.visibleContext=i.bindTo(u),this.visibleContext.set(!0),this._register(Ms(()=>this.visibleContext.reset())),this.editor.addContentWidget(this),this.editor.layoutContentWidget(this),this._register(Ms((()=>this.editor.removeContentWidget(this)))),this._register(this.editor.onDidChangeCursorPosition(x=>{s.containsPosition(x.position)||this.dispose()})),this._register(fo.runAndSubscribe(g.onDidUpdateKeybindings,()=>{this._updateButtonTitle()}))}_updateButtonTitle(){var t;const e=(t=this._keybindingService.lookupKeybinding(this.showCommand.id))==null?void 0:t.getLabel();this.button.element.title=this.showCommand.label+(e?` (${e})`:"")}create(){this.domNode=Ui(".post-edit-widget"),this.button=this._register(new kF(this.domNode,{supportIcons:!0})),this.button.label="$(insert)",this._register(ss(this.domNode,Us.CLICK,()=>this.showSelector()))}getId(){return zy.baseId+"."+this.typeId}getDomNode(){return this.domNode}getPosition(){return{position:this.range.getEndPosition(),preference:[2]}}showSelector(){this._contextMenuService.showContextMenu({getAnchor:()=>{const e=rr(this.button.element);return{x:e.left+e.width,y:e.top+e.height}},getActions:()=>this.edits.allEdits.map((e,t)=>DF({id:"",label:e.title,checked:t===this.edits.activeEditIndex,run:()=>{if(t!==this.edits.activeEditIndex)return this.onSelectNewEdit(t)}}))})}},zy=_u,_u.baseId="editor.widget.postEditWidget",_u);Wy=zy=i4([Nf(7,Op),Nf(8,os),Nf(9,lo)],Wy);let _m=class extends Li{constructor(e,t,i,n,s,a,l){super(),this._id=e,this._editor=t,this._visibleContext=i,this._showCommand=n,this._instantiationService=s,this._bulkEditService=a,this._notificationService=l,this._currentWidget=this._register(new Hr),this._register(fo.any(t.onDidChangeModel,t.onDidChangeModelContent)(()=>this.clear()))}async applyEditAndShowIfNeeded(e,t,i,n,s){const a=this._editor.getModel();if(!a||!e.length)return;const l=t.allEdits.at(t.activeEditIndex);if(!l)return;const d=async S=>{const I=this._editor.getModel();I&&(await I.undo(),this.applyEditAndShowIfNeeded(e,{activeEditIndex:S,allEdits:t.allEdits},i,n,s))},u=(S,I)=>{Id(S)||(this._notificationService.error(I),i&&this.show(e[0],t,d))};let g;try{g=await n(l,s)}catch(S){return u(S,F("resolveError",`Error resolving edit '{0}':
@@ -292,4 +292,4 @@ ${Xe.length===1?"There is an instance":"There are "+Xe.length+" instances"} of i
292
292
  `)]),y(We,kt)};T(ti,We=>{"error"in o(St)&&o(St).error&&!("ok"in o(St))?We(mi):"ok"in o(St)&&o(St).ok?We(Ai,1):"ok"in o(St)&&We(ee,2)})}P(()=>qe=Ut(wt,1,"deploy-box in-card svelte-ns6riw",null,qe,{"deploy-ok":"ok"in o(St)&&o(St).ok})),y(Je,wt)};T(Ae,Je=>{o(re)[te()]&&Je(rt)})}y(ce,K)};let a=On(e,"generation",3,0),l=On(e,"origin",3,null),d=A(_i([])),u=A(""),g=A(_i([])),x=A(!0),m=A(!1),C=A(""),_=A(""),E=A(""),S=A(void 0),I=A("list"),M=A(null),O=A(null),R=A(_i({})),H=A(null),G=ot(()=>o(g).filter(ce=>ce.ok&&ce.helperOutdated).length);tn(()=>{var ce;(ce=e.onupdates)==null||ce.call(e,o(G))});let U=A(null),re=A(_i({}));async function we(ce){var te;p(U,ce,!0);try{const K=await CD(ce);p(re,{...o(re),[ce]:K},!0),K.ok&&(p(g,(await da(!0)).hosts,!0),(te=e.onchanged)==null||te.call(e))}catch(K){p(re,{...o(re),[ce]:{error:K.message??String(K)}},!0)}finally{p(U,null)}}let Me=A(!1),be=A(""),$e=ot(()=>o(g).filter(ce=>ce.ok&&ce.helperOutdated).map(ce=>ce.name));async function lt(){var te;const ce=o($e);if(!(ce.length===0||o(Me))){p(Me,!0);try{for(const[K,Ae]of ce.entries()){p(be,`${K+1} of ${ce.length}: ${Ae}`);try{p(re,{...o(re),[Ae]:await CD(Ae)},!0)}catch(rt){p(re,{...o(re),[Ae]:{error:rt.message??String(rt)}},!0)}}p(g,(await da(!0)).hosts,!0),(te=e.onchanged)==null||te.call(e)}finally{p(Me,!1),p(be,"")}}}let de=A(null),Ve=A(_i({})),ve=A(null),je=A(_i({})),pe=A(null);const Et=[{key:"stable",label:"stable"},{key:"lts",label:"LTS"},{key:"latest",label:"latest"}],Te=ce=>{var te,K;return(ce==null?void 0:ce.arch)&&((K=(te=o(pe))==null?void 0:te.byArch)==null?void 0:K[ce.arch])||o(pe)||null},Ie=(ce,te)=>{const K=Te(te);return(ce==="latest"?K==null?void 0:K.latest:K==null?void 0:K.lts)??null};function Xe(ce,te){if(!ce||!te)return null;const K=Je=>Je.replace(/^v/,"").split(".").map(St=>Number(St)||0),[Ae,rt]=[K(ce),K(te)];for(let Je=0;Je<Math.max(Ae.length,rt.length);Je++)if((Ae[Je]??0)!==(rt[Je]??0))return(Ae[Je]??0)<(rt[Je]??0)?-1:1;return 0}const Dt=ce=>ce&&Number(ce.replace(/^v/,"").split(".")[0])||0;let me=ot(()=>o(g).filter(ce=>{if(!ce.ok||!ce.node||!o(pe))return!1;const te=Te(ce),Ae=!!(te!=null&&te.latest)&&Dt(ce.node)===Dt(te.latest)?te==null?void 0:te.latest:te==null?void 0:te.lts;return!!Ae&&Xe(Ae,ce.node)===1}).length);tn(()=>{var ce;(ce=e.onnodeupdates)==null||ce.call(e,o(me))});function ke(ce){return Et.map(te=>{const K=Ie(te.key,ce);return{...te,target:K,current:!!K&&K===ce.node,downgrade:Xe(K,ce.node)===-1}})}async function Ne(ce,te){var St,wt;const K=Wt(ce)??null,Ae=(K==null?void 0:K.local)===!0,rt=Ie(te,K);if(await((St=o(S))==null?void 0:St.show(`Install Node.js ${rt??`"${te}"`} on ${ce} with n install ${rt??te}? This replaces the host's node binary; running adapters keep the current version until they are restarted.`+(Ae?" she runs on this host too — it keeps the old binary until the daemon itself is restarted.":""),{confirm:"Update Node.js"}))){p(de,ce,!0),p(je,{...o(je),[ce]:void 0},!0);try{const qe=await qK(ce,te,rt);p(Ve,{...o(Ve),[ce]:qe},!0),p(g,(await da(!0)).hosts,!0),(wt=e.onchanged)==null||wt.call(e)}catch(qe){p(Ve,{...o(Ve),[ce]:{error:qe.message??String(qe)}},!0)}finally{p(de,null)}}}async function Qe(ce){var te;p(ve,ce,!0);try{p(je,{...o(je),[ce]:await GK(ce)},!0),(te=e.onchanged)==null||te.call(e)}catch(K){p(je,{...o(je),[ce]:{error:K.message??String(K)}},!0)}finally{p(ve,null)}}let Ke=A(null),vt=A(""),ni=A(!1),zt=A(!1),ze=A(_i({host:"",port:"",user:"",identityFile:"",hostname:""})),ct=A(null),jt=A(!1),Bt=A(_i(location.origin)),ri=A(null),X=A(null),ae=A(""),q=A(!1),_e=A(""),Re=A(!1),bt=null;const ft=ot(()=>JSON.stringify({remotes:o(d)})!==o(u)),Wt=ce=>o(g).find(te=>te.name===ce)??null,qt=ot(()=>o(g).find(ce=>ce.local)??null),xt=(ce,te)=>(ce.hostname||ce.host).localeCompare(te.hostname||te.host,void 0,{numeric:!0,sensitivity:"base"});function dt(ce){const te=ce.services,K=Array.isArray(te==null?void 0:te.hosts)?te.hosts:null;p(d,(K??[]).filter(Ae=>Ae&&Ae.ssh).map(Ae=>({host:String(Ae.ssh.host??""),port:typeof Ae.ssh.port=="number"?Ae.ssh.port:"",user:String(Ae.ssh.user??""),identityFile:String(Ae.ssh.identityFile??""),hostname:String(Ae.hostname??"")})).sort(xt),!0),p(u,JSON.stringify({remotes:o(d)}),!0)}async function w(ce=!1){p(x,!0),p(C,"");try{const[te,K]=await Promise.all([wc(),da(ce).catch(()=>({hosts:[]}))]);dt(te),p(g,K.hosts,!0)}catch(te){p(C,te.message??String(te),!0)}finally{p(x,!1)}j()}async function j(){try{const ce=await jK();p(Ke,ce.publicKey,!0),p(vt,ce.identityFile,!0)}catch{}try{p(E,(await Gc()).user??"",!0)}catch{}}Ns(()=>w());let ie=0;tn(()=>{const ce=a();ce!==ie&&(ie=ce,Eo(()=>{l()!=="hostsconf"&&(async()=>{if(o(ft))try{p(g,(await da(!0)).hosts,!0)}catch{}else await w(!0)})()}))}),Ns(async()=>{try{p(pe,await UK(),!0)}catch{}}),Ah(()=>Ct());function ue(ce){p(_,ce,!0),setTimeout(()=>{o(_)===ce&&p(_,"")},3e3)}async function De(){var ce;p(m,!0),p(C,"");try{const te=[{name:"local"}];for(const K of o(d)){if(!K.host.trim())continue;const Ae={host:K.host.trim()};K.port!==""&&Number(K.port)>0&&(Ae.port=Number(K.port)),K.user.trim()&&(Ae.user=K.user.trim()),K.identityFile.trim()&&(Ae.identityFile=K.identityFile.trim()),te.push({...K.hostname.trim()?{hostname:K.hostname.trim()}:{},ssh:Ae})}await W0("services.hosts",te),window.dispatchEvent(new CustomEvent("she:config-changed")),p(u,JSON.stringify({remotes:o(d)}),!0),p(M,null),ue("saved"),(ce=e.onchanged)==null||ce.call(e),p(g,(await da(!0)).hosts,!0)}catch(te){p(C,te.message??String(te),!0)}finally{p(m,!1)}}function it(){const ce=JSON.parse(o(u));p(d,ce.remotes,!0),p(M,null)}async function V(ce){const te=ce.host;p(H,te,!0);try{const K=await bD({host:ce.host.trim(),port:ce.port,user:ce.user.trim(),identityFile:ce.identityFile.trim()});p(R,{...o(R),[te]:K.ok?{ok:!0,msg:`helper v${K.helper??"?"}`}:{ok:!1,msg:`${K.code}: ${K.error}`}},!0)}catch(K){p(R,{...o(R),[te]:{ok:!1,msg:K.message??String(K)}},!0)}finally{p(H,null)}}async function Ue(){p(H,"local");try{const ce=await $K("local");p(R,{...o(R),local:ce.ok?{ok:!0,msg:`helper v${ce.helper??"?"}`}:{ok:!1,msg:`${ce.code}: ${ce.error}`}},!0)}catch(ce){p(R,{...o(R),local:{ok:!1,msg:ce.message??String(ce)}},!0)}finally{p(H,null)}}async function pt(ce){var K;const te=o(d)[ce];await((K=o(S))==null?void 0:K.show(`Remove ${te.hostname||te.host} from the list? she stops managing it; nothing on the host is changed (use "Remove from host…" for that).`,{confirm:"Remove",danger:!0}))&&(p(d,o(d).filter((Ae,rt)=>rt!==ce),!0),o(M)===ce&&p(M,null))}function ge(){p(ze,{host:"",port:"",user:"",identityFile:"",hostname:""},!0),p(ct,null),p(_e,""),p(I,"add")}async function Ge(){if(!o(ze).host.trim()){p(ct,{ok:!1,msg:"enter a host first"},!0);return}p(jt,!0);try{const ce=await bD({host:o(ze).host.trim(),port:o(ze).port,user:o(ze).user.trim(),identityFile:o(ze).identityFile.trim()});p(ct,ce.ok?{ok:!0,msg:`helper v${ce.helper??"?"}`}:{ok:!1,msg:`${ce.code}: ${ce.error}`},!0)}catch(ce){p(ct,{ok:!1,msg:ce.message??String(ce)},!0)}finally{p(jt,!1)}}function ut(){o(ze).host.trim()&&(p(d,[...o(d),{...o(ze),host:o(ze).host.trim(),user:o(ze).user.trim(),identityFile:o(ze).identityFile.trim(),hostname:o(ze).hostname.trim()}].sort(xt),!0),p(I,"list"),ue("host added — Save to keep it"))}function Ct(){bt&&(clearInterval(bt),bt=null)}async function Rt(){p(q,!0),p(_e,""),p(ri,null),p(X,null),p(ae,""),p(Re,!1),Ct();try{p(ri,await KK(o(Bt).trim().replace(/\/+$/,"")),!0),p(X,"pending"),j(),bt=setInterval(async()=>{var ce;if(!o(ri))return Ct();try{const te=await ZK(o(ri).token);p(X,te.status,!0),te.status==="done"?(p(ae,te.host??"",!0),Ct(),dt(await wc()),p(g,(await da(!0)).hosts,!0),(ce=e.onchanged)==null||ce.call(e)):te.status==="expired"&&Ct()}catch{}},3e3)}catch(ce){p(_e,ce.message??String(ce),!0)}finally{p(q,!1)}}async function Fe(ce,te){try{await navigator.clipboard.writeText(ce),te(!0),setTimeout(()=>te(!1),2e3)}catch{}}async function nt(){var ce;if(!(o(Ke)&&!await((ce=o(S))==null?void 0:ce.show("Regenerate the services SSH key? Every remote host then needs the new public key (re-run the setup command, or replace it in authorized_keys).",{confirm:"Regenerate",danger:!0})))){p(ni,!0);try{const te=await VK();p(Ke,te.publicKey,!0),p(vt,te.identityFile,!0),ue("key generated")}catch(te){p(C,te.message??String(te),!0)}finally{p(ni,!1)}}}var $=Sde(),Ce=yt($);ns(Er(Ce,{}),ce=>p(S,ce,!0),()=>o(S));var He=h(Ce,2),mt=f(He);{var gt=ce=>{var te=ade(),K=yt(te),Ae=f(K),rt=h(K,2),Je=f(rt),St=h(f(Je),4),wt=h(f(St),2),qe=h(wt,2),Zt=f(qe),ti=h(St,2);{var mi=Ee=>{var tt=ide(),at=f(tt);P(()=>B(at,o(_e))),y(Ee,tt)};T(ti,Ee=>{o(_e)&&Ee(mi)})}var Ai=h(ti,2);{var ee=Ee=>{var tt=rde(),at=yt(tt),Ft=f(at),Nt=f(Ft),Pt=h(Ft),It=f(Pt),Tt=h(at,2),Jt=f(Tt),Ei=h(Jt),Be=f(Ei),Oe=h(Ei,2),Mt=f(Oe),ci=h(Tt,2),Se=f(ci);{var Xt=At=>{var xe=nde();y(At,xe)},Qt=At=>{var xe=sde();y(At,xe)},di=At=>{var xe=ode(),st=yt(xe),$t=f(st),wi=h($t),xi=f(wi),ki=h(st,2);P(()=>{B($t,`✓ ${o(ae)??""} registered as `),B(xi,o(ri).user)}),z("click",ki,()=>p(I,"list")),y(At,xe)},ei=At=>{var xe=An("command expired — create a new one.");y(At,xe)};T(Se,At=>{o(X)==="pending"?At(Xt):o(X)==="fetched"?At(Qt,1):o(X)==="done"?At(di,2):o(X)==="expired"&&At(ei,3)})}P(At=>{B(Nt,o(ri).command),B(It,o(Re)?"Copied":"Copy"),B(Jt,`Valid until ${At??""}, single use. To read it first: `),B(Be,`curl -fsSL '${o(ri).scriptUrl??""}' -o she-setup.sh`),B(Mt,o(ri).sha256)},[()=>new Date(o(ri).expires).toLocaleTimeString()]),z("click",Pt,()=>Fe(o(ri).command,At=>p(Re,At,!0))),y(Ee,tt)};T(Ai,Ee=>{o(ri)&&Ee(ee)})}var We=h(Je,2),kt=h(f(We),4),Lt=f(kt),J=h(f(Lt)),le=h(Lt,2),ne=h(f(le)),se=h(le,2),Le=h(f(se)),ye=h(se,2),_t=h(f(ye)),Z=h(kt,2),Ye=f(Z),W=f(Ye),Q=h(Ye,2);{var he=Ee=>{var tt=YA();let at;var Ft=f(tt);P(()=>{at=Ut(tt,1,"test-mark svelte-ns6riw",null,at,{ok:o(ct).ok,err:!o(ct).ok}),B(Ft,o(ct).ok?`✓ ${o(ct).msg}`:`✗ ${o(ct).msg}`)}),y(Ee,tt)};T(Q,Ee=>{o(ct)&&Ee(he)})}var Pe=h(Q,4);P(Ee=>{qe.disabled=o(q),B(Zt,o(q)?"Preparing…":"Create setup command"),vi(Le,"placeholder",o(E)?`${o(E)} (default)`:"user she runs as"),Ye.disabled=o(jt),B(W,o(jt)?"Testing…":"Test connection"),Pe.disabled=Ee},[()=>!o(ze).host.trim()]),z("click",Ae,()=>p(I,"list")),li(wt,()=>o(Bt),Ee=>p(Bt,Ee)),z("click",qe,Rt),li(J,()=>o(ze).host,Ee=>o(ze).host=Ee),li(ne,()=>o(ze).port,Ee=>o(ze).port=Ee),li(Le,()=>o(ze).user,Ee=>o(ze).user=Ee),li(_t,()=>o(ze).identityFile,Ee=>o(ze).identityFile=Ee),z("click",Ye,Ge),z("click",Pe,ut),y(ce,te)},Kt=ce=>{var te=Ede(),K=yt(te),Ae=f(K),rt=f(Ae);let Je;var St=h(Ae,2),wt=h(St,2),qe=f(wt),Zt=h(wt,2);{var ti=At=>{var xe=lde();y(At,xe)};T(Zt,At=>{o(x)&&At(ti)})}var mi=h(Zt,2);{var Ai=At=>{var xe=cde(),st=f(xe);P(()=>{xe.disabled=o(Me)||o(U)!==null,B(st,o(Me)?`Updating ${o(be)}…`:`Update all helpers (${o($e).length})`)}),z("click",xe,lt),y(At,xe)};T(mi,At=>{o($e).length>1&&At(Ai)})}var ee=h(mi,4);{var We=At=>{var xe=dde(),st=f(xe);P(()=>B(st,o(_))),y(At,xe)};T(ee,At=>{o(_)&&At(We)})}var kt=h(ee,2);{var Lt=At=>{var xe=ude(),st=h(yt(xe),2),$t=h(st,2),wi=f($t);P(()=>{st.disabled=o(m),$t.disabled=o(m),B(wi,o(m)?"Saving…":"Save")}),z("click",st,it),z("click",$t,De),y(At,xe)};T(kt,At=>{o(ft)&&At(Lt)})}var J=h(K,2);{var le=At=>{var xe=hde(),st=f(xe);P(()=>B(st,o(C))),y(At,xe)};T(J,At=>{o(C)&&At(le)})}var ne=h(J,2),se=f(ne),Le=f(se),ye=f(Le);let _t;var Z=h(ye,2),Ye=f(Z),W=h(Z,2);{var Q=At=>{ZA(At,()=>o(qt).arch)};T(W,At=>{var xe;(xe=o(qt))!=null&&xe.arch&&At(Q)})}var he=h(W,6);{var Pe=At=>{i(At,()=>"local",()=>o(qt))};T(he,At=>{var xe;(xe=o(qt))!=null&&xe.ok&&At(Pe)})}var Ee=h(he,2),tt=h(Ee);t(tt,()=>"local");var at=h(Le,2);{var Ft=At=>{n(At,()=>"local",()=>o(qt))};T(at,At=>{var xe;(xe=o(qt))!=null&&xe.ok&&At(Ft)})}var Nt=h(at,2);s(Nt,()=>"local");var Pt=h(Nt,2);{var It=At=>{var xe=pde(),st=f(xe),$t=h(st);{var wi=xi=>{var ki=fde(),Ot=yt(ki);Ot.nodeValue=" — run ",y(xi,ki)};T($t,xi=>{o(qt).code==="HELPER_MISSING"&&xi(wi)})}P(()=>B(st,o(qt).error)),y(At,xe)};T(Pt,At=>{o(qt)&&!o(qt).ok&&At(It)})}var Tt=h(se,2);pi(Tt,17,()=>o(d),Ki,(At,xe,st)=>{const $t=ot(()=>Wt(o(xe).host));var wi=bde(),xi=f(wi),ki=f(xi);let Ot;var ii=h(ki,2),yi=f(ii),Ti=h(ii,2);{var Di=Si=>{ZA(Si,()=>o($t).arch)};T(Ti,Si=>{var Ri;(Ri=o($t))!=null&&Ri.arch&&Si(Di)})}var Vi=h(Ti,2),$i=f(Vi),xn=h(Vi,2);{var sn=Si=>{var Ri=gde();P(()=>vi(Ri,"title",o(xe).identityFile)),y(Si,Ri)};T(xn,Si=>{o(xe).identityFile&&Si(sn)})}var Pi=h(xn,4);{var Tn=Si=>{i(Si,()=>o(xe).host,()=>o($t))},an=Si=>{var Ri=vde(),cn=f(Ri);P(()=>{Ri.disabled=o(U)!==null,B(cn,o(U)===o(xe).host?"Deploying…":"Deploy helper")}),z("click",Ri,()=>we(o(xe).host)),y(Si,Ri)};T(Pi,Si=>{var Ri;(Ri=o($t))!=null&&Ri.ok?Si(Tn):o($t)&&!o($t).ok&&Si(an,1)})}var Ji=h(Pi,2),Zn=h(Ji);t(Zn,()=>o(xe).host);var Sn=h(Zn,2);let bs;var Is=h(Sn,2);let co;var gi=h(Is,2),Yi=h(xi,2);{var Wi=Si=>{n(Si,()=>o(xe).host,()=>o($t))};T(Yi,Si=>{var Ri;(Ri=o($t))!=null&&Ri.ok&&Si(Wi)})}var dn=h(Yi,2);s(dn,()=>o(xe).host);var Bn=h(dn,2);{var bi=Si=>{var Ri=xde(),cn=f(Ri);P(()=>B(cn,o($t).error)),y(Si,Ri)};T(Bn,Si=>{o($t)&&!o($t).ok&&Si(bi)})}var Oi=h(Bn,2);{var Hi=Si=>{var Ri=mde(),cn=f(Ri),bn=h(f(cn)),En=h(cn,2),Cn=h(f(En)),on=h(En,2),hn=h(f(on)),ln=h(on,2),as=h(f(ln)),yn=h(ln,2),wn=h(f(yn));P(()=>vi(hn,"placeholder",o(E)?`${o(E)} (default)`:"user she runs as")),li(bn,()=>o(xe).host,kn=>o(xe).host=kn),li(Cn,()=>o(xe).port,kn=>o(xe).port=kn),li(hn,()=>o(xe).user,kn=>o(xe).user=kn),li(as,()=>o(xe).identityFile,kn=>o(xe).identityFile=kn),li(wn,()=>o(xe).hostname,kn=>o(xe).hostname=kn),y(Si,Ri)};T(Oi,Si=>{o(M)===st&&Si(Hi)})}var ji=h(Oi,2);{var en=Si=>{var Ri=_de(),cn=f(Ri);{let bn=ot(()=>o(xe).hostname||o(xe).host);Oce(cn,{get host(){return o(xe).host},get label(){return o(bn)},onclose:()=>p(O,null),ondone:()=>{var En;p(O,null),w(!0),(En=e.onchanged)==null||En.call(e)}})}y(Si,Ri)};T(ji,Si=>{o(O)===st&&Si(en)})}P(Si=>{var Ri,cn;Ot=Ut(ki,1,"dot svelte-ns6riw",null,Ot,{ok:(Ri=o($t))==null?void 0:Ri.ok,err:o($t)&&!o($t).ok}),B(yi,o(xe).hostname||((cn=o($t))==null?void 0:cn.hostname)||o(xe).host),B($i,`${(o(xe).user||o(E)||"?")??""}@${o(xe).host??""}${o(xe).port?`:${o(xe).port}`:""}`),Ji.disabled=Si,bs=Ut(Sn,1,"ghost sm svelte-ns6riw",null,bs,{active:o(M)===st}),co=Ut(Is,1,"ghost sm svelte-ns6riw",null,co,{active:o(O)===st})},[()=>o(H)!==null||!o(xe).host.trim()]),z("click",Ji,()=>V(o(xe))),z("click",Sn,()=>p(M,o(M)===st?null:st,!0)),z("click",Is,()=>p(O,o(O)===st?null:st,!0)),z("click",gi,()=>pt(st)),y(At,wi)});var Jt=h(Tt,2);{var Ei=At=>{var xe=Cde();y(At,xe)};T(Jt,At=>{o(d).length===0&&!o(x)&&At(Ei)})}var Be=h(Jt,2),Oe=f(Be),Mt=h(f(Oe),6);{var ci=At=>{var xe=yde(),st=f(xe);P(()=>B(st,o(zt)?"Copied":"Copy public key")),z("click",xe,()=>Fe(o(Ke),$t=>p(zt,$t,!0))),y(At,xe)};T(Mt,At=>{o(Ke)&&At(ci)})}var Se=h(Mt,2),Xt=f(Se),Qt=h(Oe,2);{var di=At=>{var xe=wde(),st=yt(xe),$t=f(st),wi=h(st,2),xi=f(wi);P(()=>{B($t,o(Ke)),B(xi,o(vt))}),y(At,xe)},ei=At=>{var xe=XA(),st=f(xe);P(()=>B(st,`No services key yet (${(o(vt)||"data-dir/ssh/services_id_ed25519")??""}) — the setup command creates it.`)),y(At,xe)};T(Qt,At=>{o(Ke)?At(di):At(ei,-1)})}P(()=>{var At,xe;Ae.disabled=o(x),Je=Ut(rt,1,"svelte-ns6riw",null,Je,{spinning:o(x)}),B(qe,`${o(d).length+1} host${o(d).length===0?"":"s"}`),_t=Ut(ye,1,"dot svelte-ns6riw",null,_t,{ok:(At=o(qt))==null?void 0:At.ok,err:o(qt)&&!o(qt).ok}),B(Ye,((xe=o(qt))==null?void 0:xe.hostname)??"this host"),Ee.disabled=o(H)!==null,Se.disabled=o(ni),B(Xt,o(ni)?"Generating…":o(Ke)?"Regenerate":"Generate key")}),z("click",Ae,()=>w(!0)),z("click",St,ge),z("click",Ee,Ue),z("click",Se,nt),y(ce,te)};T(mt,ce=>{o(I)==="add"?ce(gt):ce(Kt,-1)})}y(r,$),ds()}_s(["click"]);var QA=k('<span class="tab-dot svelte-ymmv06"></span>'),Dde=k('<div class="services-page svelte-ymmv06"><div class="sub-nav svelte-ymmv06"><button>Instances</button> <button>Installations <!></button> <button>Catalog</button> <button>Hosts <!></button></div> <div><!></div> <div><!></div> <div><!></div> <div><!></div></div>');function Ade(r,e){cs(e,!0);let t=On(e,"active",3,!1),i=On(e,"sub",3,null);const n=["instances","hosts","catalog","hostsconf"],s="she-services-tab",a=localStorage.getItem(s);let l=A(_i(a&&n.includes(a)?a:"instances"));tn(()=>{localStorage.setItem(s,o(l))});const d={instances:"instances",hosts:"installations",catalog:"catalog",hostsconf:"hosts"},u=ct=>Object.keys(d).find(jt=>d[jt]===ct)??null;let g;tn(()=>{if(i()===g)return;g=i();const ct=u(i());ct&&Eo(()=>{ct!==o(l)&&p(l,ct,!0)})}),tn(()=>{var ct;t()&&((ct=e.onsub)==null||ct.call(e,d[o(l)]))});let x=A(0),m=A(null);function C(ct){p(m,ct,!0),Ay(x)}let _=A(null),E=0;function S(ct,jt){p(_,{host:ct,adapter:jt,n:++E},!0),C("catalog"),p(l,"hosts")}let I=A(0),M=A(0),O=A(0),R=A("none"),H=A(""),G=ot(()=>[o(I)>0?`${o(I)} adapter update${o(I)===1?"":"s"} available`:"",o(M)>0?`${o(M)} host${o(M)===1?"":"s"} with an outdated helper`:"",o(O)>0?`${o(O)} host${o(O)===1?"":"s"} with a newer Node.js`:""].filter(Boolean).join(" · "));tn(()=>{var ct,jt;o(G)?(ct=e.onstatus)==null||ct.call(e,"warn",o(G)):(jt=e.onstatus)==null||jt.call(e,o(R),o(H))});var U=Dde(),re=f(U),we=f(re);let Me;var be=h(we,2);let $e;var lt=h(f(be));{var de=ct=>{var jt=QA();P(()=>vi(jt,"title",`${o(I)??""} adapter update${o(I)===1?"":"s"} available`)),y(ct,jt)};T(lt,ct=>{o(I)>0&&ct(de)})}var Ve=h(be,2);let ve;var je=h(Ve,2);let pe;var Et=h(f(je));{var Te=ct=>{var jt=QA();P(Bt=>vi(jt,"title",Bt),[()=>[o(M)>0?`${o(M)} host${o(M)===1?"":"s"} running an outdated she-servicectl`:"",o(O)>0?`${o(O)} host${o(O)===1?"":"s"} with a newer Node.js available`:""].filter(Boolean).join(" · ")]),y(ct,jt)};T(Et,ct=>{o(M)+o(O)>0&&ct(Te)})}var Ie=h(re,2);let Xe;var Dt=f(Ie);Gae(Dt,{onstatus:(ct,jt)=>{p(R,ct,!0),p(H,jt,!0)},get generation(){return o(x)},get origin(){return o(m)},onchanged:()=>C("instances")});var me=h(Ie,2);let ke;var Ne=f(me);rce(Ne,{onchanged:()=>C("hosts"),onupdates:ct=>p(I,ct,!0),get generation(){return o(x)},get origin(){return o(m)},get addPreset(){return o(_)}});var Qe=h(me,2);let Ke;var vt=f(Qe);{let ct=ot(()=>t()&&o(l)==="catalog");Pce(vt,{get active(){return o(ct)},oninstalled:S,get generation(){return o(x)},get origin(){return o(m)}})}var ni=h(Qe,2);let zt;var ze=f(ni);kde(ze,{onchanged:()=>C("hostsconf"),onupdates:ct=>p(M,ct,!0),onnodeupdates:ct=>p(O,ct,!0),get generation(){return o(x)},get origin(){return o(m)}}),P(()=>{Me=Ut(we,1,"svelte-ymmv06",null,Me,{active:o(l)==="instances"}),$e=Ut(be,1,"svelte-ymmv06",null,$e,{active:o(l)==="hosts"}),ve=Ut(Ve,1,"svelte-ymmv06",null,ve,{active:o(l)==="catalog"}),pe=Ut(je,1,"svelte-ymmv06",null,pe,{active:o(l)==="hostsconf"}),Xe=Ut(Ie,1,"tab-wrap svelte-ymmv06",null,Xe,{hidden:o(l)!=="instances"}),ke=Ut(me,1,"tab-wrap svelte-ymmv06",null,ke,{hidden:o(l)!=="hosts"}),Ke=Ut(Qe,1,"tab-wrap svelte-ymmv06",null,Ke,{hidden:o(l)!=="catalog"}),zt=Ut(ni,1,"tab-wrap svelte-ymmv06",null,zt,{hidden:o(l)!=="hostsconf"})}),z("click",we,()=>p(l,"instances")),z("click",be,()=>p(l,"hosts")),z("click",Ve,()=>p(l,"catalog")),z("click",je,()=>p(l,"hostsconf")),y(r,U),ds()}_s(["click"]);const ty=(r,e=jo)=>{var t=Lde(),i=h(f(t));{var n=a=>{var l=Bde();y(a,l)},s=a=>{var l=Fde();y(a,l)};T(i,a=>{e()?a(n):a(s,-1)})}y(r,t)};var Bde=Ho('<path d="M5.5 7V5a2.5 2.5 0 0 1 5 0v2"></path>'),Fde=Ho('<path d="M5.5 7V5a2.5 2.5 0 0 1 5 0"></path>'),Lde=Ho('<svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="7" width="10" height="7" rx="1.5"></rect><!></svg>'),Ide=k('<span class="ok svelte-1az45ix"> </span>'),Pde=k('<span class="muted svelte-1az45ix"> </span>'),Tde=k('<div class="err-box svelte-1az45ix"> <button class="ghost sm svelte-1az45ix">×</button></div>'),Mde=k(`<div class="err-box svelte-1az45ix"><b>Secrets store locked:</b> <code class="svelte-1az45ix">SHE_SECRETS_KEY</code> in the daemon's environment or restore <code class="svelte-1az45ix"> </code>, then restart she. Starting over means deleting <code class="svelte-1az45ix"> </code>.</div>`),Rde=k('<button><span class="name svelte-1az45ix"> </span> <span class="count svelte-1az45ix"> </span></button>'),Nde=k('<div class="muted empty svelte-1az45ix">No secrets yet.</div>'),Ode=k("<!> <!>",1),Hde=k('<button type="button" class="lock is-secret svelte-1az45ix" disabled="" title="secret — write-only, never shown again"><!></button> <input placeholder="•••••• (type to replace)" autocomplete="off" spellcheck="false" class="svelte-1az45ix"/>',1),zde=k('<textarea spellcheck="false" class="svelte-1az45ix"></textarea>'),Wde=k('<input type="text" autocomplete="off" spellcheck="false" class="svelte-1az45ix"/>'),jde=k('<button type="button" class="lock svelte-1az45ix" title="plain — shown in clear; click to mark it secret (never shown again)"><!></button> <!>',1),Vde=k('<tr><td class="mono svelte-1az45ix"> </td><td class="svelte-1az45ix"><form class="val svelte-1az45ix"><!> <button type="submit" class="sm svelte-1az45ix">Save</button></form></td><td class="muted svelte-1az45ix"> </td><td class="c-act svelte-1az45ix"><button class="ghost sm svelte-1az45ix" title="Delete">×</button></td></tr>'),$de=k('<textarea placeholder="value" spellcheck="false" class="svelte-1az45ix"></textarea>'),qde=k('<input type="password" placeholder="value" autocomplete="off" class="svelte-1az45ix"/>'),Ude=k('<div class="fields-head svelte-1az45ix"><span class="title svelte-1az45ix"> </span> <span class="muted svelte-1az45ix"> </span> <span class="spacer svelte-1az45ix"></span> <label class="reveal check-label svelte-1az45ix"><input type="checkbox" class="svelte-1az45ix"/><span class="checkmark svelte-1az45ix"></span> show while typing</label> <button class="ghost sm danger svelte-1az45ix">Delete group</button></div> <table class="svelte-1az45ix"><colgroup><col class="c-name svelte-1az45ix"/><col class="c-value"/><col class="c-changed svelte-1az45ix"/><col class="c-act svelte-1az45ix"/></colgroup><thead><tr><th class="svelte-1az45ix">field</th><th class="svelte-1az45ix">value</th><th class="svelte-1az45ix">changed</th><th class="svelte-1az45ix"></th></tr></thead><tbody><!><tr class="new svelte-1az45ix"><td class="svelte-1az45ix"><input type="text" placeholder="new field" spellcheck="false" class="svelte-1az45ix"/></td><td class="svelte-1az45ix"><form class="val svelte-1az45ix"><button type="button"><!></button> <!> <button type="submit" class="sm svelte-1az45ix">Add</button></form></td><td class="muted svelte-1az45ix" colspan="2">the lock decides the kind: secret fields are write-only forever, plain fields (user names, hosts) stay readable here. Multi-line values: tick <i>show while typing</i> and paste.</td></tr></tbody></table> <div class="hint svelte-1az45ix"><code class="svelte-1az45ix"> </code> returns the string, <code class="svelte-1az45ix"> </code> the whole group as a frozen object, <code class="svelte-1az45ix">she.secrets.has(…)</code> checks without a warning. Scripts that read a secret at load time keep the old value until they are reloaded.</div>',1),Gde=k('Create a group on the left, then add fields to it — e.g. group <code class="svelte-1az45ix">smtp</code> with <code class="svelte-1az45ix">host</code>, <code class="svelte-1az45ix">user</code>, <code class="svelte-1az45ix">password</code>.',1),Kde=k('<div class="muted empty svelte-1az45ix"><!></div>'),Zde=k(`<!> <div class="sec-shell svelte-1az45ix"><div class="bar svelte-1az45ix"><span class="muted svelte-1az45ix">Values are stored encrypted and never sent back to the browser — scripts read them with <code class="svelte-1az45ix">she.secrets.get('group/field')</code>.</span> <span class="spacer svelte-1az45ix"></span> <!> <!> <button class="ghost svelte-1az45ix" title="Reload">↺</button></div> <!> <!> <div class="body svelte-1az45ix"><div class="groups svelte-1az45ix"><div class="groups-head svelte-1az45ix">Groups</div> <!> <form class="add-group svelte-1az45ix"><input type="text" placeholder="new group" spellcheck="false" class="svelte-1az45ix"/> <button type="submit" class="ghost sm svelte-1az45ix">+</button></form></div> <div class="fields svelte-1az45ix"><!></div></div></div>`,1);function Yde(r,e){cs(e,!0);let t=On(e,"active",3,!0),i=On(e,"sub",3,null),n=A(null),s=A(null),a=A(""),l=A(""),d=A(!1),u=A(""),g=A(""),x=A(""),m=A(!0),C=A(_i({})),_=A(!1),E=A(void 0),S=!1;const I=/^[A-Za-z0-9_.-]{1,64}$/,M=ot(()=>{var X;return((X=o(n))==null?void 0:X.groups.find(ae=>ae.name===o(s)))??null}),O=ot(()=>{var X,ae;return((X=o(n))==null?void 0:X.status)==="locked"||((ae=o(n))==null?void 0:ae.status)==="error"});async function R(){try{p(n,await uG(),!0),p(a,""),o(s)&&!o(n).groups.some(X=>X.name===o(s))&&p(s,null),!o(s)&&o(n).groups.length>0&&p(s,o(n).groups[0].name,!0)}catch(X){p(a,X.message??String(X),!0)}}tn(()=>{t()&&!S&&(S=!0,R())});let H;tn(()=>{const X=i();X!==H&&(H=X,X&&X!==o(s)&&p(s,X,!0))}),tn(()=>{var X;t()&&(H=o(s)??"",(X=e.onsub)==null||X.call(e,o(s)??""))});function G(X){p(l,X,!0),setTimeout(()=>{o(l)===X&&p(l,"")},2500)}async function U(X,ae,q,_e=!0){if(q){p(d,!0);try{await hG(X,ae,q,_e),p(C,{...o(C),[`${X}/${ae}`]:""},!0),p(g,""),p(x,""),p(m,!0),G(`saved ${X}/${ae}`),await R(),p(s,X,!0)}catch(Re){p(a,Re.message??String(Re),!0)}finally{p(d,!1)}}}async function re(){var ae;const X=o(u).trim();if(!I.test(X)){p(a,"group name: letters, digits, _ . - (max 64)");return}(ae=o(n))!=null&&ae.groups.some(q=>q.name===X)||p(n,o(n)?{...o(n),groups:[...o(n).groups,{name:X,changed:0,fields:[]}].sort((q,_e)=>q.name.localeCompare(_e.name))}:o(n),!0),p(s,X,!0),p(u,""),p(a,"")}async function we(X,ae){var q;if(await((q=o(E))==null?void 0:q.show(`Mark ${X}/${ae} as secret? Its value will never be shown again — not here, not through the API. Scripts keep reading it. This cannot be undone (delete and re-create to change your mind).`,{confirm:"Mark secret",danger:!0}))){p(d,!0);try{await fG(X,ae),p(C,{...o(C),[`${X}/${ae}`]:""},!0),G(`${X}/${ae} is secret now`),await R()}catch(_e){p(a,_e.message??String(_e),!0)}finally{p(d,!1)}}}async function Me(X,ae){var q;if(await((q=o(E))==null?void 0:q.show(`Delete secret ${X}/${ae}? Scripts reading it get undefined from now on.`,{confirm:"Delete",danger:!0}))){p(d,!0);try{await aD(X,ae),G(`deleted ${X}/${ae}`),await R()}catch(_e){p(a,_e.message??String(_e),!0)}finally{p(d,!1)}}}async function be(X){var q,_e,Re,bt;const ae=((q=o(M))==null?void 0:q.fields.length)??0;if(ae===0){p(n,o(n)?{...o(n),groups:o(n).groups.filter(ft=>ft.name!==X)}:o(n),!0),p(s,((Re=(_e=o(n))==null?void 0:_e.groups[0])==null?void 0:Re.name)??null,!0);return}if(await((bt=o(E))==null?void 0:bt.show(`Delete the group ${X} with its ${ae} secret${ae===1?"":"s"}?`,{confirm:"Delete group",danger:!0}))){p(d,!0);try{await aD(X),G(`deleted ${X}`),p(s,null),await R()}catch(ft){p(a,ft.message??String(ft),!0)}finally{p(d,!1)}}}function $e(X){return X?new Date(X).toLocaleString():"—"}var lt=Zde(),de=yt(lt);ns(Er(de,{}),X=>p(E,X,!0),()=>o(E));var Ve=h(de,2),ve=f(Ve),je=h(f(ve),4);{var pe=X=>{var ae=Ide(),q=f(ae);P(()=>B(q,o(l))),y(X,ae)};T(je,X=>{o(l)&&X(pe)})}var Et=h(je,2);{var Te=X=>{var ae=Pde(),q=f(ae);P(()=>{vi(ae,"title",o(n).file),B(q,`key: ${(o(n).keySource==="env"?"SHE_SECRETS_KEY":o(n).keySource==="file"?o(n).keyFile:"none yet — generated on first save")??""}`)}),y(X,ae)};T(Et,X=>{o(n)&&X(Te)})}var Ie=h(Et,2),Xe=h(ve,2);{var Dt=X=>{var ae=Tde(),q=f(ae),_e=h(q);P(()=>B(q,`${o(a)??""} `)),z("click",_e,()=>p(a,"")),y(X,ae)};T(Xe,X=>{o(a)&&X(Dt)})}var me=h(Xe,2);{var ke=X=>{var ae=Mde(),q=h(f(ae)),_e=h(q,3),Re=f(_e),bt=h(_e,2),ft=f(bt);P(()=>{B(q,` ${o(n).error??""}. Values cannot be read or changed until the key is back — set `),B(Re,o(n).keyFile),B(ft,o(n).file)}),y(X,ae)};T(me,X=>{o(O)&&o(n)&&X(ke)})}var Ne=h(me,2),Qe=f(Ne),Ke=h(f(Qe),2);{var vt=X=>{var ae=Ode(),q=yt(ae);pi(q,17,()=>o(n).groups,bt=>bt.name,(bt,ft)=>{var Wt=Rde();let qt;var xt=f(Wt),dt=f(xt),w=h(xt,2),j=f(w);P(()=>{qt=Ut(Wt,1,"group svelte-1az45ix",null,qt,{active:o(s)===o(ft).name}),B(dt,o(ft).name),B(j,o(ft).fields.length)}),z("click",Wt,()=>p(s,o(ft).name,!0)),y(bt,Wt)});var _e=h(q,2);{var Re=bt=>{var ft=Nde();y(bt,ft)};T(_e,bt=>{o(n).groups.length===0&&bt(Re)})}y(X,ae)};T(Ke,X=>{o(n)&&X(vt)})}var ni=h(Ke,2),zt=f(ni),ze=h(zt,2),ct=h(Qe,2),jt=f(ct);{var Bt=X=>{var ae=Ude(),q=yt(ae),_e=f(q),Re=f(_e),bt=h(_e,2),ft=f(bt),Wt=h(bt,4),qt=f(Wt),xt=h(Wt,2),dt=h(q,2),w=h(f(dt),2),j=f(w);pi(j,17,()=>o(M).fields,gt=>gt.name,(gt,Kt)=>{const ce=ot(()=>`${o(M).name}/${o(Kt).name}`),te=ot(()=>o(C)[o(ce)]??(o(Kt).secret?"":o(Kt).value??"")),K=ot(()=>o(Kt).secret?o(te)!=="":o(te)!==(o(Kt).value??""));var Ae=Vde(),rt=f(Ae),Je=f(rt),St=h(rt),wt=f(St),qe=f(wt);{var Zt=Lt=>{var J=Hde(),le=yt(J),ne=f(le);ty(ne,()=>!0);var se=h(le,2);P(()=>{vi(se,"type",o(_)?"text":"password"),$a(se,o(te)),se.disabled=o(O)}),z("input",se,Le=>p(C,{...o(C),[o(ce)]:Le.target.value},!0)),y(Lt,J)},ti=Lt=>{var J=jde(),le=yt(J),ne=f(le);ty(ne,()=>!1);var se=h(le,2);{var Le=Z=>{var Ye=zde();vi(Ye,"rows",4),P(()=>{$a(Ye,o(te)),Ye.disabled=o(O)}),z("input",Ye,W=>p(C,{...o(C),[o(ce)]:W.target.value},!0)),y(Z,Ye)},ye=ot(()=>o(te).includes(`
293
293
  `)),_t=Z=>{var Ye=Wde();P(()=>{$a(Ye,o(te)),Ye.disabled=o(O)}),z("input",Ye,W=>p(C,{...o(C),[o(ce)]:W.target.value},!0)),y(Z,Ye)};T(se,Z=>{o(ye)?Z(Le):Z(_t,-1)})}P(()=>le.disabled=o(d)||o(O)),z("click",le,()=>we(o(M).name,o(Kt).name)),y(Lt,J)};T(qe,Lt=>{o(Kt).secret?Lt(Zt):Lt(ti,-1)})}var mi=h(qe,2),Ai=h(St),ee=f(Ai),We=h(Ai),kt=f(We);P(Lt=>{vi(rt,"title",`she.secrets.get('${o(ce)??""}')`),B(Je,o(Kt).name),mi.disabled=o(d)||o(O)||!o(K)||!o(te),B(ee,Lt),kt.disabled=o(d)||o(O)},[()=>$e(o(Kt).changed)]),ys("submit",wt,Lt=>{Lt.preventDefault(),o(K)&&U(o(M).name,o(Kt).name,o(te),o(Kt).secret)}),z("click",kt,()=>Me(o(M).name,o(Kt).name)),y(gt,Ae)});var ie=h(j),ue=f(ie),De=f(ue),it=h(ue),V=f(it),Ue=f(V);let pt;var ge=f(Ue);ty(ge,()=>o(m));var Ge=h(Ue,2);{var ut=gt=>{var Kt=$de();P(ce=>{vi(Kt,"rows",ce),Kt.disabled=o(O)},[()=>o(x).includes(`
294
294
  `)?4:1]),li(Kt,()=>o(x),ce=>p(x,ce)),y(gt,Kt)},Ct=ot(()=>o(x).includes(`
295
- `)||o(_)||!o(m)),Rt=gt=>{var Kt=qde();P(()=>Kt.disabled=o(O)),li(Kt,()=>o(x),ce=>p(x,ce)),y(gt,Kt)};T(Ge,gt=>{o(Ct)?gt(ut):gt(Rt,-1)})}var Fe=h(Ge,2),nt=h(dt,2),$=f(nt),Ce=f($),He=h($,2),mt=f(He);P((gt,Kt)=>{B(Re,o(M).name),B(ft,`changed ${gt??""}`),xt.disabled=o(d)||o(O),De.disabled=o(O),pt=Ut(Ue,1,"lock svelte-1az45ix",null,pt,{"is-secret":o(m)}),Ue.disabled=o(O),vi(Ue,"title",o(m)?"secret — write-only once saved (click for a plain field, e.g. a user name)":"plain — shown in clear (click for a secret)"),Fe.disabled=Kt,B(Ce,`she.secrets.get('${o(M).name??""}/<field>')`),B(mt,`she.secrets.get('${o(M).name??""}')`)},[()=>$e(o(M).changed),()=>o(d)||o(O)||!o(g).trim()||!o(x)]),Es(qt,()=>o(_),gt=>p(_,gt)),z("click",xt,()=>be(o(M).name)),li(De,()=>o(g),gt=>p(g,gt)),ys("submit",V,gt=>{gt.preventDefault(),I.test(o(g).trim())?U(o(M).name,o(g).trim(),o(x),o(m)):p(a,"field name: letters, digits, _ . - (max 64)")}),z("click",Ue,()=>p(m,!o(m))),y(X,ae)},ri=X=>{var ae=Kde(),q=f(ae);{var _e=bt=>{var ft=Gde();y(bt,ft)},Re=bt=>{var ft=An("Select a group.");y(bt,ft)};T(q,bt=>{o(n).groups.length===0?bt(_e):bt(Re,-1)})}y(X,ae)};T(jt,X=>{o(M)?X(Bt):o(n)&&!o(O)&&X(ri,1)})}P(X=>{zt.disabled=o(O),ze.disabled=X},[()=>o(O)||!o(u).trim()]),z("click",Ie,R),ys("submit",ni,X=>{X.preventDefault(),re()}),li(zt,()=>o(u),X=>p(u,X)),y(r,lt),ds()}_s(["click","input"]);var Xde=k('<div class="safe-banner svelte-1n46o8q"><strong class="svelte-1n46o8q">⚠ SAFE MODE</strong> — no user script is running and the script directory is not watched. She was killed instead of stopped last time, which usually means a script blocked the event loop. Edit or delete it, then restart. <button class="safe-restart svelte-1n46o8q">Restart daemon</button></div>'),JA=k('<span class="nav-dot nav-dot--warn svelte-1n46o8q"></span>'),Qde=k('<span class="nav-dot nav-dot--err svelte-1n46o8q" title="MQTT broker not connected"></span>'),Jde=k('<span class="nav-dot nav-dot--warn nav-dot--blink svelte-1n46o8q" title="Waiting for retained MQTT state"></span>'),eue=k('<span class="nav-dot nav-dot--ok svelte-1n46o8q" title="MQTT connected"></span>'),tue=k('<button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" class="svelte-1n46o8q"><path d="M8.36,5.73 A2.6,2.6 0 0,1 9.38,10.50" class="svelte-1n46o8q"></path><path d="M7.64,5.73 A2.6,2.6 0 0,0 6.62,10.50" class="svelte-1n46o8q"></path><path d="M9.16,3.95 A4.5,4.5 0 0,1 10.38,12.12" class="svelte-1n46o8q"></path><path d="M6.84,3.95 A4.5,4.5 0 0,0 5.62,12.12" class="svelte-1n46o8q"></path><path d="M10.40,2.37 A6.4,6.4 0 0,1 11.39,13.73" class="svelte-1n46o8q"></path><path d="M5.60,2.37 A6.4,6.4 0 0,0 4.61,13.73" class="svelte-1n46o8q"></path><path d="M7.15,8.3 L8,15.4 L8.85,8.3 Z" fill="currentColor" stroke="none" class="svelte-1n46o8q"></path><circle cx="8" cy="8.3" r="1.45" fill="currentColor" stroke="none" class="svelte-1n46o8q"></circle></svg> Broker</button>'),iue=k('<span class="nav-dot nav-dot--none svelte-1n46o8q"></span>'),nue=k('<button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><rect x="2" y="2" width="12" height="4" rx="1" class="svelte-1n46o8q"></rect><rect x="2" y="10" width="12" height="4" rx="1" class="svelte-1n46o8q"></rect><circle cx="4.5" cy="4" r="0.6" fill="currentColor" class="svelte-1n46o8q"></circle><circle cx="4.5" cy="12" r="0.6" fill="currentColor" class="svelte-1n46o8q"></circle></svg> Adapters <!></button>'),sue=k('<span class="nav-dot nav-dot--ok svelte-1n46o8q" title="All Matter devices online"></span>'),oue=k('<span class="nav-dot nav-dot--warn svelte-1n46o8q" title="Some Matter devices offline"></span>'),rue=k('<span class="nav-dot nav-dot--err svelte-1n46o8q" title="No Matter devices online"></span>'),aue=k('<button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><path d="M8,2 L8,7" class="svelte-1n46o8q"></path><path d="M6,5 L8,7.5 L10,5" class="svelte-1n46o8q"></path><path d="M2.5,14 L6,10" class="svelte-1n46o8q"></path><path d="M6.2,12.8 L6,10 L3.2,10.2" class="svelte-1n46o8q"></path><path d="M13.5,14 L10,10" class="svelte-1n46o8q"></path><path d="M9.8,12.8 L10,10 L12.8,10.2" class="svelte-1n46o8q"></path></svg> Matter <!></button>'),lue=k('<button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><ellipse cx="8" cy="4.5" rx="5" ry="1.8" class="svelte-1n46o8q"></ellipse><path d="M3,4.5 v7 a5,1.8 0,0,0 10,0 v-7" class="svelte-1n46o8q"></path><path d="M3,8 a5,1.8 0,0,0 10,0" class="svelte-1n46o8q"></path></svg> DB</button>'),cue=k('<span class="nav-dot nav-dot--err svelte-1n46o8q" title="Errors in recent logs"></span>'),due=k('<span class="nav-dot nav-dot--warn svelte-1n46o8q" title="Warnings in recent logs"></span>'),uue=k('<span class="update-dot svelte-1n46o8q" title="Update available"></span>'),hue=k('<dt class="svelte-1n46o8q">Latest</dt><dd style="color: #f90" class="svelte-1n46o8q"> </dd>',1),fue=k('<dt class="svelte-1n46o8q">Latest</dt><dd class="svelte-1n46o8q">up to date</dd>',1),pue=k('<button class="svelte-1n46o8q"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><polyline points="4 4 4 10 10 10" class="svelte-1n46o8q"></polyline><path d="M4 10A9 9 0 1 0 6.5 5" class="svelte-1n46o8q"></path></svg> </button>'),gue=k('<div class="version-popup svelte-1n46o8q"><dl class="svelte-1n46o8q"><dt class="svelte-1n46o8q">Installed</dt><dd class="svelte-1n46o8q"></dd> <!></dl> <div class="version-actions svelte-1n46o8q"><!> <button class="check-btn svelte-1n46o8q" title="Check for updates now"><svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><polyline points="4 4 4 10 10 10" class="svelte-1n46o8q"></polyline><path d="M4 10A9 9 0 1 0 6.5 5" class="svelte-1n46o8q"></path></svg> </button></div></div>'),vue=k('<dt class="svelte-1n46o8q">Uptime</dt><dd class="svelte-1n46o8q"> </dd>',1),xue=k('<dt class="svelte-1n46o8q">Matter nodes</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">Matter endpoints</dt><dd class="svelte-1n46o8q"> </dd>',1),mue=k('<dt class="svelte-1n46o8q">DB docs</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">DB views</dt><dd class="svelte-1n46o8q"> </dd>',1),_ue=k('<dl class="svelte-1n46o8q"><!> <dt class="svelte-1n46o8q">Scripts</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">MQTT topics</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">MQTT msg/s</dt><dd class="svelte-1n46o8q"> </dd> <!> <!> <dt class="svelte-1n46o8q">Handlers</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">Memory</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">CPU</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">EL util</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">EL lag mean</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">EL lag max</dt><dd class="svelte-1n46o8q"> </dd></dl>'),bue=k('<span class="stats-empty svelte-1n46o8q">Loading…</span>'),Cue=k('<button class="svelte-1n46o8q"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><path d="M18.36 6.64a9 9 0 1 1-12.73 0" class="svelte-1n46o8q"></path><line x1="12" y1="2" x2="12" y2="12" class="svelte-1n46o8q"></line></svg> Restart daemon</button>'),yue=k('<div class="stats-popup svelte-1n46o8q"><!> <div class="stats-actions svelte-1n46o8q"><!></div></div>'),wue=k('<button class="nav-logout svelte-1n46o8q" title="Logout"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" class="svelte-1n46o8q"></path><polyline points="16 17 21 12 16 7" class="svelte-1n46o8q"></polyline><line x1="21" y1="12" x2="9" y2="12" class="svelte-1n46o8q"></line></svg></button>'),Eue=k("<div><!></div>"),Sue=k('<div class="shell svelte-1n46o8q"><!> <nav class="svelte-1n46o8q"><span class="brand svelte-1n46o8q">she</span> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><polyline points="5,3 1,8 5,13" class="svelte-1n46o8q"></polyline><polyline points="11,3 15,8 11,13" class="svelte-1n46o8q"></polyline></svg> Scripts</button> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="square" stroke-linejoin="miter" class="svelte-1n46o8q"><rect x="0.75" y="0.75" width="14.5" height="14.5" rx="1" class="svelte-1n46o8q"></rect><path d="M2,11 V5 H5 V11" class="svelte-1n46o8q"></path><path d="M6,12 V5 H9 V8 H6" class="svelte-1n46o8q"></path><path d="M10,11 V5 H15 V11" class="svelte-1n46o8q"></path><line x1="12.5" y1="5" x2="12.5" y2="11" class="svelte-1n46o8q"></line></svg> Packages <!></button> <button><svg width="12" height="12" viewBox="0 0 16 16" fill="currentColor" stroke="none" style="vertical-align: middle" class="svelte-1n46o8q"><path fill-rule="evenodd" d="M2,0 H14 A2,2 0 0,1 16,2 V14 A2,2 0 0,1 14,16 H0 V2 A2,2 0 0,1 2,0 Z M0,16 L0,12 A4,4 0 0,1 4,16 Z M0,10.5 A5.5,5.5 0 0,1 5.5,16 L9,16 A9,9 0 0,0 0,7 Z M0,5.5 A10.5,10.5 0 0,1 10.5,16 L13.5,16 A13.5,13.5 0 0,0 0,2.5 Z" class="svelte-1n46o8q"></path></svg> MQTT <!></button> <!> <!> <!> <!> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><rect x="3" y="7" width="10" height="7" rx="1.5" class="svelte-1n46o8q"></rect><path d="M5.5 7V5a2.5 2.5 0 0 1 5 0v2" class="svelte-1n46o8q"></path><circle cx="8" cy="9.9" r="1.15" stroke-width="1.1" class="svelte-1n46o8q"></circle><path d="M8 11v1.2" stroke-width="1.1" class="svelte-1n46o8q"></path></svg> Secrets</button> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" class="svelte-1n46o8q"><line x1="2" y1="5" x2="14" y2="5" class="svelte-1n46o8q"></line><line x1="2" y1="8" x2="14" y2="8" class="svelte-1n46o8q"></line><line x1="2" y1="11" x2="9" y2="11" class="svelte-1n46o8q"></line></svg> Logs <!></button> <div class="nav-spacer svelte-1n46o8q"></div> <div class="nav-right svelte-1n46o8q"><a class="nav-icon svelte-1n46o8q" href="https://github.com/hobbyquaker/she" target="_blank" rel="noopener" title="GitHub"><svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor" class="svelte-1n46o8q"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z" class="svelte-1n46o8q"></path></svg></a> <div class="version-wrap svelte-1n46o8q"><button class="version svelte-1n46o8q"> <!></button> <!></div> <div class="stats-wrap svelte-1n46o8q"><button class="nav-icon svelte-1n46o8q" title="Daemon status"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><line x1="18" y1="20" x2="18" y2="10" class="svelte-1n46o8q"></line><line x1="12" y1="20" x2="12" y2="4" class="svelte-1n46o8q"></line><line x1="6" y1="20" x2="6" y2="14" class="svelte-1n46o8q"></line></svg></button> <!></div> <button title="Settings"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" class="svelte-1n46o8q"></path><circle cx="12" cy="12" r="3" class="svelte-1n46o8q"></circle></svg></button> <!></div></nav> <main class="svelte-1n46o8q"><!> <div><!></div> <div><!></div> <div><!></div> <div><!></div> <div><!></div> <!> <div><!></div> <div><!></div> <div><!></div> <div><!></div></main></div>'),kue=k('<div class="login-error svelte-1n46o8q"> </div>'),Due=k('<div class="login-overlay svelte-1n46o8q"><form class="login-box svelte-1n46o8q"><div class="login-brand svelte-1n46o8q">she</div> <h2 class="svelte-1n46o8q">Sign in</h2> <div class="login-field svelte-1n46o8q"><label for="she-password" class="svelte-1n46o8q">Password</label> <input id="she-password" type="password" placeholder="Enter password" autocomplete="current-password" class="svelte-1n46o8q"/></div> <!> <button type="submit" class="login-btn svelte-1n46o8q"> </button></form></div>'),Aue=k('<div class="updating-overlay svelte-1n46o8q"><div class="updating-box svelte-1n46o8q"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><polyline points="4 4 4 10 10 10" class="svelte-1n46o8q"></polyline><path d="M4 10A9 9 0 1 0 6.5 5" class="svelte-1n46o8q"></path></svg> Restarting smart-home-engine…</div></div>'),Bue=k('<div class="updating-overlay svelte-1n46o8q"><div class="updating-box svelte-1n46o8q"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><polyline points="4 4 4 10 10 10" class="svelte-1n46o8q"></polyline><path d="M4 10A9 9 0 1 0 6.5 5" class="svelte-1n46o8q"></path></svg> Updating smart-home-engine…</div></div>'),Fue=k("<!> <!> <!> <!>",1);function Lue(r,e){cs(e,!0);const t=["scripts","mqtt","matter","broker","adapters","secrets","db","logs","config","packages"],i={services:"adapters",security:"broker"};function n(){const Re=location.hash.replace(/^#\/?/,""),[bt,...ft]=Re.split("/"),Wt=i[bt]??bt;if(!t.includes(Wt))return{page:"scripts",sub:null};const qt=ft.map(xt=>{try{return decodeURIComponent(xt)}catch{return xt}}).join("/");return{page:Wt,sub:qt||null}}let s=A(_i(n().page)),a=A(_i(n().sub)),l=A(null),d=A(!1),u=A(!1),g=A(!1),x=A(!1),m=A("none"),C=A(""),_=A(!1),E=A(""),S=A(""),I=A(!1),M=A(!1);nG(()=>{p(_,!0)});async function O(){p(S,""),p(I,!0);try{await rG(o(E)),p(E,""),p(_,!1)}catch(Re){p(S,Re.message??"Login failed",!0)}finally{p(I,!1)}}async function R(){if(o(m)==="proxy"&&o(C)){window.location.href=o(C);return}await aG(),p(_,!0)}let H=A(null),G=A(!1),U=A(!1),re=A(!1),we=A(!1),Me=A(_i([])),be=A(0),$e=A(!1),lt=A(!1),de=A("none"),Ve=A(""),ve=A(_i([]));const je=ot(()=>o(ve).filter(Re=>Re.online).length),pe=ot(()=>o(ve).length===0?"none":o(je)===o(ve).length?"all":o(je)>0?"some":"offline");let Et=A(!1),Te=A(!1);async function Ie(){if(!await o(H).show("Restart the she daemon? The page will reload after a moment.",{confirm:"Restart"}))return;p(G,!0);let Re;try{Re=(await Gc()).startedAt}catch{}try{await _7()}catch{}const bt=Date.now()+6e4;for(;Date.now()<bt;){await new Promise(ft=>setTimeout(ft,250));try{const ft=await Gc();if(Re===void 0||ft.startedAt!==Re){location.reload();return}}catch{}}location.reload()}async function Xe(){p(g,!0);try{const Re=await gG();o(l)&&p(l,{...o(l),latestVersion:Re.latestVersion??void 0},!0)}catch{}finally{p(g,!1)}}async function Dt(){var ft,Wt;if(!await o(H).show(`Update to v${(ft=o(l))==null?void 0:ft.latestVersion}? The daemon will restart after the update completes.`,{confirm:"Update"}))return;p(u,!1),p(x,!0);const Re=(Wt=o(l))==null?void 0:Wt.startedAt;try{await pG()}catch{}const bt=Date.now()+18e4;for(;Date.now()<bt;){await new Promise(qt=>setTimeout(qt,1e3));try{const qt=await Gc();if(Re===void 0||qt.startedAt!==Re){location.reload();return}}catch{p(x,!1),p(G,!0)}}location.reload()}let me=A(void 0),ke=A(0);function Ne(){if(!o(me))return;const Re=getComputedStyle(o(me)),bt=parseFloat(Re.columnGap)||0,ft=[...o(me).children];let Wt=parseFloat(Re.paddingLeft)+parseFloat(Re.paddingRight)+bt*Math.max(0,ft.length-1);for(const xt of ft)xt.classList.contains("nav-spacer")||(Wt+=xt.getBoundingClientRect().width);const qt=Math.ceil(Wt)+8;qt>0&&qt!==o(ke)&&p(ke,qt)}let Qe=null;function Ke(){if(!(!o(me)||!Qe)){Qe.disconnect(),Qe.observe(o(me));for(const Re of o(me).children)Qe.observe(Re);Ne()}}Ns(()=>(Qe=new ResizeObserver(()=>Ne()),Ke(),()=>{Qe==null||Qe.disconnect(),Qe=null})),tn(()=>{var Re,bt,ft,Wt;o($e),o(lt),(Re=o(l))==null||Re.matterEnabled,(bt=o(l))==null||bt.dbEnabled,(ft=o(l))==null||ft.latestVersion,(Wt=o(l))==null||Wt.docker,ua().then(()=>Eo(Ke))});function vt(Re){p(s,Re,!0),p(a,null),location.hash=ni(Re,null)}function ni(Re,bt){const ft=bt?bt.split("/").map(encodeURIComponent).join("/"):"";return`#/${Re}${ft?"/"+ft:""}`}function zt(Re,bt){const ft=bt||null;o(s)!==Re||o(a)===ft||(p(a,ft,!0),history.replaceState(null,"",ni(Re,ft)))}Ns(async()=>{const Re=ni(o(s),o(a));location.hash!==Re&&history.replaceState(null,"",Re);const bt=()=>{const ue=n();p(s,ue.page,!0),p(a,ue.sub,!0)};window.addEventListener("hashchange",bt);const ft=()=>{document.visibilityState==="visible"&&(lZ(),Gc().then(ue=>{p(l,ue,!0)}).catch(()=>{}),requestAnimationFrame(()=>{document.body.style.display="none",document.body.offsetHeight,document.body.style.display="",window.dispatchEvent(new Event("she:visible"))}))};document.addEventListener("visibilitychange",ft);try{const ue=await oG();p(m,ue.mode,!0),p(C,ue.proxyLogoutUrl??"",!0),o(m)==="password"&&(await fetch("/she/scripts")).status===401&&p(_,!0)}catch{}p(M,!0);async function Wt(){var ue,De,it,V;try{p(l,await Gc(),!0)}catch{}try{const[Ue,pt]=await Promise.all([y7(),wc()]);p(Me,Array.isArray(pt.pinnedPackages)?pt.pinnedPackages:[],!0),p(be,Object.keys(Ue).filter(ut=>!o(Me).includes(ut)).length,!0);const ge=o($e);p($e,((ue=pt.broker)==null?void 0:ue.enabled)===!0),ge&&!o($e)&&o(s)==="broker"&&vt("scripts");const Ge=o(lt);p(lt,((De=pt.services)==null?void 0:De.enabled)===!0),Ge&&!o(lt)&&o(s)==="adapters"&&vt("scripts")}catch{}!((it=o(l))!=null&&it.matterEnabled)&&o(s)==="matter"&&vt("scripts"),!((V=o(l))!=null&&V.dbEnabled)&&o(s)==="db"&&vt("scripts")}Wt();const qt=setInterval(Wt,5e3),xt=Ko("mqtt:status",ue=>{ue.connected===!1?(p(we,!0),p(U,!1),p(re,!1)):(p(we,!1),p(U,ue.ready===!1),p(re,ue.ready===!0))}),dt=Ko("matter:deviceList",ue=>{Array.isArray(ue.devices)&&p(ve,ue.devices.map(De=>({nodeId:String(De.nodeId),online:!!De.online})),!0)}),w=Ko("matter:deviceStatus",ue=>{if(ue.nodeId===void 0)return;const De=String(ue.nodeId),it=!!ue.online;p(ve,o(ve).map(V=>V.nodeId===De?{...V,online:it}:V),!0)}),j=L7();p(Et,j.some(ue=>ue.level==="error"),!0),p(Te,!o(Et)&&j.some(ue=>ue.level==="warn"),!0);const ie=d2(ue=>{ue.level==="error"?(p(Et,!0),p(Te,!1)):ue.level==="warn"&&!o(Et)&&p(Te,!0)});return()=>{window.removeEventListener("hashchange",bt),document.removeEventListener("visibilitychange",ft),clearInterval(qt),xt(),dt(),w(),ie()}});var ze=Fue();ys("click",o3,()=>{o(d)&&p(d,!1),o(u)&&p(u,!1)});var ct=yt(ze);{var jt=Re=>{var bt=Sue(),ft=f(bt);{var Wt=xe=>{var st=Xde(),$t=h(f(st),2);z("click",$t,Ie),y(xe,st)};T(ft,xe=>{var st;(st=o(l))!=null&&st.safeMode&&xe(Wt)})}var qt=h(ft,2),xt=h(f(qt),2);let dt;var w=h(xt,2);let j;var ie=h(f(w),2);{var ue=xe=>{var st=JA();P(()=>vi(st,"title",`${o(be)??""} package update${o(be)===1?"":"s"} available`)),y(xe,st)};T(ie,xe=>{o(be)>0&&xe(ue)})}var De=h(w,2);let it;var V=h(f(De),2);{var Ue=xe=>{var st=Qde();y(xe,st)},pt=xe=>{var st=Jde();y(xe,st)},ge=xe=>{var st=eue();y(xe,st)};T(V,xe=>{o(we)?xe(Ue):o(U)?xe(pt,1):o(re)&&xe(ge,2)})}var Ge=h(De,2);{var ut=xe=>{var st=tue();let $t;P(()=>$t=Ut(st,1,"svelte-1n46o8q",null,$t,{active:o(s)==="broker"})),z("click",st,()=>vt("broker")),y(xe,st)};T(Ge,xe=>{o($e)&&xe(ut)})}var Ct=h(Ge,2);{var Rt=xe=>{var st=nue();let $t;var wi=h(f(st),2);{var xi=Ot=>{var ii=JA();P(()=>vi(ii,"title",o(Ve))),y(Ot,ii)},ki=Ot=>{var ii=iue();y(Ot,ii)};T(wi,Ot=>{o(de)==="warn"?Ot(xi):Ot(ki,-1)})}P(()=>$t=Ut(st,1,"svelte-1n46o8q",null,$t,{active:o(s)==="adapters"})),z("click",st,()=>vt("adapters")),y(xe,st)};T(Ct,xe=>{o(lt)&&xe(Rt)})}var Fe=h(Ct,2);{var nt=xe=>{var st=aue();let $t;var wi=h(f(st),2);{var xi=ii=>{var yi=sue();y(ii,yi)},ki=ii=>{var yi=oue();y(ii,yi)},Ot=ii=>{var yi=rue();y(ii,yi)};T(wi,ii=>{o(pe)==="all"?ii(xi):o(pe)==="some"?ii(ki,1):o(pe)==="offline"&&ii(Ot,2)})}P(()=>$t=Ut(st,1,"svelte-1n46o8q",null,$t,{active:o(s)==="matter"})),z("click",st,()=>vt("matter")),y(xe,st)};T(Fe,xe=>{var st;(st=o(l))!=null&&st.matterEnabled&&xe(nt)})}var $=h(Fe,2);{var Ce=xe=>{var st=lue();let $t;P(()=>$t=Ut(st,1,"svelte-1n46o8q",null,$t,{active:o(s)==="db"})),z("click",st,()=>vt("db")),y(xe,st)};T($,xe=>{var st;(st=o(l))!=null&&st.dbEnabled&&xe(Ce)})}var He=h($,2);let mt;var gt=h(He,2);let Kt;var ce=h(f(gt),2);{var te=xe=>{var st=cue();y(xe,st)},K=xe=>{var st=due();y(xe,st)};T(ce,xe=>{o(Et)?xe(te):o(Te)&&xe(K,1)})}var Ae=h(gt,4),rt=h(f(Ae),2),Je=f(rt),St=f(Je);St.nodeValue="v1.51.1 ";var wt=h(St);{var qe=xe=>{var st=uue();y(xe,st)};T(wt,xe=>{var st,$t;(st=o(l))!=null&&st.latestVersion&&!(($t=o(l))!=null&&$t.docker)&&xe(qe)})}var Zt=h(Je,2);{var ti=xe=>{var st=gue(),$t=f(st),wi=h(f($t));wi.textContent="v1.51.1";var xi=h(wi,2);{var ki=sn=>{var Pi=hue(),Tn=h(yt(Pi)),an=f(Tn);P(()=>B(an,`v${o(l).latestVersion??""}`)),y(sn,Pi)},Ot=sn=>{var Pi=fue();y(sn,Pi)};T(xi,sn=>{var Pi;(Pi=o(l))!=null&&Pi.latestVersion?sn(ki):sn(Ot,-1)})}var ii=h($t,2),yi=f(ii);{var Ti=sn=>{var Pi=pue(),Tn=h(f(Pi));P(()=>B(Tn,` Update to v${o(l).latestVersion??""}`)),z("click",Pi,Dt),y(sn,Pi)};T(yi,sn=>{var Pi;(Pi=o(l))!=null&&Pi.latestVersion&&sn(Ti)})}var Di=h(yi,2),Vi=f(Di);let $i;var xn=h(Vi);P(()=>{Di.disabled=o(g),$i=Ut(Vi,0,"svelte-1n46o8q",null,$i,{spinning:o(g)}),B(xn,` ${o(g)?"Checking…":"Check for updates"}`)}),z("click",st,sn=>sn.stopPropagation()),z("click",Di,Xe),y(xe,st)};T(Zt,xe=>{var st;o(u)&&!((st=o(l))!=null&&st.docker)&&xe(ti)})}var mi=h(rt,2),Ai=f(mi),ee=h(Ai,2);{var We=xe=>{var st=yue(),$t=f(st);{var wi=yi=>{var Ti=_ue(),Di=f(Ti);{var Vi=Si=>{const Ri=ot(()=>Math.floor((Date.now()-o(l).startedAt)/1e3)),cn=ot(()=>Math.floor(o(Ri)/86400)),bn=ot(()=>Math.floor(o(Ri)%86400/3600)),En=ot(()=>Math.floor(o(Ri)%3600/60));var Cn=vue(),on=h(yt(Cn)),hn=f(on);P(()=>B(hn,`${o(cn)>0?o(cn)+"d ":""}${o(bn)>0||o(cn)>0?o(bn)+"h ":""}${o(En)??""}m`)),y(Si,Cn)};T(Di,Si=>{o(l).startedAt&&Si(Vi)})}var $i=h(Di,3),xn=f($i),sn=h($i,3),Pi=f(sn),Tn=h(sn,3),an=f(Tn),Ji=h(Tn,2);{var Zn=Si=>{var Ri=xue(),cn=h(yt(Ri)),bn=f(cn),En=h(cn,3),Cn=f(En);P(()=>{B(bn,o(l).matterNodes??0),B(Cn,o(l).matterEndpoints??0)}),y(Si,Ri)};T(Ji,Si=>{o(l).matterEnabled&&Si(Zn)})}var Sn=h(Ji,2);{var bs=Si=>{var Ri=mue(),cn=h(yt(Ri)),bn=f(cn),En=h(cn,3),Cn=f(En);P(()=>{B(bn,o(l).dbDocs??"—"),B(Cn,o(l).dbViews??"—")}),y(Si,Ri)};T(Sn,Si=>{o(l).dbEnabled&&Si(bs)})}var Is=h(Sn,3),co=f(Is),gi=h(Is,3),Yi=f(gi),Wi=h(gi,3),dn=f(Wi),Bn=h(Wi,3),bi=f(Bn),Oi=h(Bn,3),Hi=f(Oi),ji=h(Oi,3),en=f(ji);P(()=>{B(xn,o(l).scripts),B(Pi,o(l).topics),B(an,o(l).mqttMsgPerSec??"—"),B(co,o(l).handlers??"—"),B(Yi,o(l).memMb!=null?o(l).memMb+" MB":"—"),B(dn,o(l).cpuPercent!=null?o(l).cpuPercent+" %":"—"),B(bi,o(l).eluPercent!=null?o(l).eluPercent+" %":"—"),B(Hi,o(l).elMeanMs!=null?o(l).elMeanMs+" ms":"—"),B(en,o(l).elMaxMs!=null?o(l).elMaxMs+" ms":"—")}),y(yi,Ti)},xi=yi=>{var Ti=bue();y(yi,Ti)};T($t,yi=>{o(l)?yi(wi):yi(xi,-1)})}var ki=h($t,2),Ot=f(ki);{var ii=yi=>{var Ti=Cue();z("click",Ti,()=>{p(d,!1),Ie()}),y(yi,Ti)};T(Ot,yi=>{var Ti;(Ti=o(l))!=null&&Ti.docker||yi(ii)})}z("click",st,yi=>yi.stopPropagation()),y(xe,st)};T(ee,xe=>{o(d)&&xe(We)})}var kt=h(mi,2);let Lt;var J=h(kt,2);{var le=xe=>{var st=wue();z("click",st,R),y(xe,st)};T(J,xe=>{o(m)==="password"&&xe(le)})}ns(qt,xe=>p(me,xe),()=>o(me));var ne=h(qt,2),se=f(ne);ns(Er(se,{}),xe=>p(H,xe,!0),()=>o(H));var Le=h(se,2);let ye;var _t=f(Le);{let xe=ot(()=>o(s)==="scripts"),st=ot(()=>o(s)==="scripts"?o(a):null);EQ(_t,{get active(){return o(xe)},get sub(){return o(st)},onsub:$t=>zt("scripts",$t)})}var Z=h(Le,2);let Ye;var W=f(Z);Jie(W,{});var Q=h(Z,2);let he;var Pe=f(Q);{let xe=ot(()=>o(s)==="mqtt"),st=ot(()=>o(s)==="mqtt"?o(a):null);Tie(Pe,{get active(){return o(xe)},get sub(){return o(st)},onsub:$t=>zt("mqtt",$t)})}var Ee=h(Q,2);let tt;var at=f(Ee);{let xe=ot(()=>o(s)==="matter"),st=ot(()=>o(s)==="matter"?o(a):null);Ate(at,{get active(){return o(xe)},get sub(){return o(st)},onsub:$t=>zt("matter",$t)})}var Ft=h(Ee,2);let Nt;var Pt=f(Ft);{let xe=ot(()=>o(s)==="broker"),st=ot(()=>o(s)==="broker"?o(a):null);Loe(Pt,{get active(){return o(xe)},get sub(){return o(st)},onsub:$t=>zt("broker",$t)})}var It=h(Ft,2);{var Tt=xe=>{var st=Eue();let $t;var wi=f(st);{let xi=ot(()=>o(s)==="adapters"),ki=ot(()=>o(s)==="adapters"?o(a):null);Ade(wi,{onstatus:(Ot,ii)=>{p(de,Ot,!0),p(Ve,ii,!0)},get active(){return o(xi)},get sub(){return o(ki)},onsub:Ot=>zt("adapters",Ot)})}P(()=>$t=Ut(st,1,"page-wrap svelte-1n46o8q",null,$t,{hidden:o(s)!=="adapters"})),y(xe,st)};T(It,xe=>{o(lt)&&xe(Tt)})}var Jt=h(It,2);let Ei;var Be=f(Jt);{let xe=ot(()=>o(s)==="secrets"),st=ot(()=>o(s)==="secrets"?o(a):null);Yde(Be,{get active(){return o(xe)},get sub(){return o(st)},onsub:$t=>zt("secrets",$t)})}var Oe=h(Jt,2);let Mt;var ci=f(Oe);{let xe=ot(()=>o(s)==="db"),st=ot(()=>o(s)==="db"?o(a):null);Bee(ci,{get active(){return o(xe)},get sub(){return o(st)},onsub:$t=>zt("db",$t)})}var Se=h(Oe,2);let Xt;var Qt=f(Se);xJ(Qt,{});var di=h(Se,2);let ei;var At=f(di);wJ(At,{}),P(()=>{Do(bt,o(ke)?`min-width: ${o(ke)}px`:void 0),dt=Ut(xt,1,"svelte-1n46o8q",null,dt,{active:o(s)==="scripts"}),j=Ut(w,1,"svelte-1n46o8q",null,j,{active:o(s)==="packages"}),it=Ut(De,1,"svelte-1n46o8q",null,it,{active:o(s)==="mqtt"}),mt=Ut(He,1,"svelte-1n46o8q",null,mt,{active:o(s)==="secrets"}),Kt=Ut(gt,1,"svelte-1n46o8q",null,Kt,{active:o(s)==="logs"}),Lt=Ut(kt,1,"nav-settings svelte-1n46o8q",null,Lt,{active:o(s)==="config"}),ye=Ut(Le,1,"page-wrap svelte-1n46o8q",null,ye,{hidden:o(s)!=="scripts"}),Ye=Ut(Z,1,"page-wrap svelte-1n46o8q",null,Ye,{hidden:o(s)!=="packages"}),he=Ut(Q,1,"page-wrap svelte-1n46o8q",null,he,{hidden:o(s)!=="mqtt"}),tt=Ut(Ee,1,"page-wrap svelte-1n46o8q",null,tt,{hidden:o(s)!=="matter"}),Nt=Ut(Ft,1,"page-wrap svelte-1n46o8q",null,Nt,{hidden:o(s)!=="broker"}),Ei=Ut(Jt,1,"page-wrap svelte-1n46o8q",null,Ei,{hidden:o(s)!=="secrets"}),Mt=Ut(Oe,1,"page-wrap svelte-1n46o8q",null,Mt,{hidden:o(s)!=="db"}),Xt=Ut(Se,1,"page-wrap svelte-1n46o8q",null,Xt,{hidden:o(s)!=="config"}),ei=Ut(di,1,"page-wrap svelte-1n46o8q",null,ei,{hidden:o(s)!=="logs"})}),z("click",xt,()=>vt("scripts")),z("click",w,()=>vt("packages")),z("click",De,()=>vt("mqtt")),z("click",He,()=>vt("secrets")),z("click",gt,()=>{vt("logs"),p(Et,!1),p(Te,!1)}),z("click",Je,xe=>{xe.stopPropagation(),p(u,!o(u)),p(d,!1)}),z("click",Ai,xe=>{xe.stopPropagation(),p(d,!o(d)),p(u,!1)}),z("click",kt,()=>vt("config")),y(Re,bt)};T(ct,Re=>{o(M)&&!o(_)&&Re(jt)})}var Bt=h(ct,2);{var ri=Re=>{var bt=Due(),ft=f(bt),Wt=h(f(ft),4),qt=h(f(Wt),2),xt=h(Wt,2);{var dt=ie=>{var ue=kue(),De=f(ue);P(()=>B(De,o(S))),y(ie,ue)};T(xt,ie=>{o(S)&&ie(dt)})}var w=h(xt,2),j=f(w);P(()=>{qt.disabled=o(I),w.disabled=o(I)||!o(E),B(j,o(I)?"Signing in…":"Sign in")}),ys("submit",ft,ie=>{ie.preventDefault(),O()}),li(qt,()=>o(E),ie=>p(E,ie)),y(Re,bt)};T(Bt,Re=>{o(_)&&Re(ri)})}var X=h(Bt,2);{var ae=Re=>{var bt=Aue();y(Re,bt)};T(X,Re=>{o(G)&&Re(ae)})}var q=h(X,2);{var _e=Re=>{var bt=Bue();y(Re,bt)};T(q,Re=>{o(x)&&Re(_e)})}y(r,ze),ds()}_s(["click"]);bM(Lue,{target:document.getElementById("app")});export{H3 as t};
295
+ `)||o(_)||!o(m)),Rt=gt=>{var Kt=qde();P(()=>Kt.disabled=o(O)),li(Kt,()=>o(x),ce=>p(x,ce)),y(gt,Kt)};T(Ge,gt=>{o(Ct)?gt(ut):gt(Rt,-1)})}var Fe=h(Ge,2),nt=h(dt,2),$=f(nt),Ce=f($),He=h($,2),mt=f(He);P((gt,Kt)=>{B(Re,o(M).name),B(ft,`changed ${gt??""}`),xt.disabled=o(d)||o(O),De.disabled=o(O),pt=Ut(Ue,1,"lock svelte-1az45ix",null,pt,{"is-secret":o(m)}),Ue.disabled=o(O),vi(Ue,"title",o(m)?"secret — write-only once saved (click for a plain field, e.g. a user name)":"plain — shown in clear (click for a secret)"),Fe.disabled=Kt,B(Ce,`she.secrets.get('${o(M).name??""}/<field>')`),B(mt,`she.secrets.get('${o(M).name??""}')`)},[()=>$e(o(M).changed),()=>o(d)||o(O)||!o(g).trim()||!o(x)]),Es(qt,()=>o(_),gt=>p(_,gt)),z("click",xt,()=>be(o(M).name)),li(De,()=>o(g),gt=>p(g,gt)),ys("submit",V,gt=>{gt.preventDefault(),I.test(o(g).trim())?U(o(M).name,o(g).trim(),o(x),o(m)):p(a,"field name: letters, digits, _ . - (max 64)")}),z("click",Ue,()=>p(m,!o(m))),y(X,ae)},ri=X=>{var ae=Kde(),q=f(ae);{var _e=bt=>{var ft=Gde();y(bt,ft)},Re=bt=>{var ft=An("Select a group.");y(bt,ft)};T(q,bt=>{o(n).groups.length===0?bt(_e):bt(Re,-1)})}y(X,ae)};T(jt,X=>{o(M)?X(Bt):o(n)&&!o(O)&&X(ri,1)})}P(X=>{zt.disabled=o(O),ze.disabled=X},[()=>o(O)||!o(u).trim()]),z("click",Ie,R),ys("submit",ni,X=>{X.preventDefault(),re()}),li(zt,()=>o(u),X=>p(u,X)),y(r,lt),ds()}_s(["click","input"]);var Xde=k('<div class="safe-banner svelte-1n46o8q"><strong class="svelte-1n46o8q">⚠ SAFE MODE</strong> — no user script is running and the script directory is not watched. She was killed instead of stopped last time, which usually means a script blocked the event loop. Edit or delete it, then restart. <button class="safe-restart svelte-1n46o8q">Restart daemon</button></div>'),JA=k('<span class="nav-dot nav-dot--warn svelte-1n46o8q"></span>'),Qde=k('<span class="nav-dot nav-dot--err svelte-1n46o8q" title="MQTT broker not connected"></span>'),Jde=k('<span class="nav-dot nav-dot--warn nav-dot--blink svelte-1n46o8q" title="Waiting for retained MQTT state"></span>'),eue=k('<span class="nav-dot nav-dot--ok svelte-1n46o8q" title="MQTT connected"></span>'),tue=k('<button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" class="svelte-1n46o8q"><path d="M8.36,5.73 A2.6,2.6 0 0,1 9.38,10.50" class="svelte-1n46o8q"></path><path d="M7.64,5.73 A2.6,2.6 0 0,0 6.62,10.50" class="svelte-1n46o8q"></path><path d="M9.16,3.95 A4.5,4.5 0 0,1 10.38,12.12" class="svelte-1n46o8q"></path><path d="M6.84,3.95 A4.5,4.5 0 0,0 5.62,12.12" class="svelte-1n46o8q"></path><path d="M10.40,2.37 A6.4,6.4 0 0,1 11.39,13.73" class="svelte-1n46o8q"></path><path d="M5.60,2.37 A6.4,6.4 0 0,0 4.61,13.73" class="svelte-1n46o8q"></path><path d="M7.15,8.3 L8,15.4 L8.85,8.3 Z" fill="currentColor" stroke="none" class="svelte-1n46o8q"></path><circle cx="8" cy="8.3" r="1.45" fill="currentColor" stroke="none" class="svelte-1n46o8q"></circle></svg> Broker</button>'),iue=k('<span class="nav-dot nav-dot--none svelte-1n46o8q"></span>'),nue=k('<button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><rect x="2" y="2" width="12" height="4" rx="1" class="svelte-1n46o8q"></rect><rect x="2" y="10" width="12" height="4" rx="1" class="svelte-1n46o8q"></rect><circle cx="4.5" cy="4" r="0.6" fill="currentColor" class="svelte-1n46o8q"></circle><circle cx="4.5" cy="12" r="0.6" fill="currentColor" class="svelte-1n46o8q"></circle></svg> Adapters <!></button>'),sue=k('<span class="nav-dot nav-dot--ok svelte-1n46o8q" title="All Matter devices online"></span>'),oue=k('<span class="nav-dot nav-dot--warn svelte-1n46o8q" title="Some Matter devices offline"></span>'),rue=k('<span class="nav-dot nav-dot--err svelte-1n46o8q" title="No Matter devices online"></span>'),aue=k('<button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><path d="M8,2 L8,7" class="svelte-1n46o8q"></path><path d="M6,5 L8,7.5 L10,5" class="svelte-1n46o8q"></path><path d="M2.5,14 L6,10" class="svelte-1n46o8q"></path><path d="M6.2,12.8 L6,10 L3.2,10.2" class="svelte-1n46o8q"></path><path d="M13.5,14 L10,10" class="svelte-1n46o8q"></path><path d="M9.8,12.8 L10,10 L12.8,10.2" class="svelte-1n46o8q"></path></svg> Matter <!></button>'),lue=k('<button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><ellipse cx="8" cy="4.5" rx="5" ry="1.8" class="svelte-1n46o8q"></ellipse><path d="M3,4.5 v7 a5,1.8 0,0,0 10,0 v-7" class="svelte-1n46o8q"></path><path d="M3,8 a5,1.8 0,0,0 10,0" class="svelte-1n46o8q"></path></svg> DB</button>'),cue=k('<span class="nav-dot nav-dot--err svelte-1n46o8q" title="Errors in recent logs"></span>'),due=k('<span class="nav-dot nav-dot--warn svelte-1n46o8q" title="Warnings in recent logs"></span>'),uue=k('<span class="update-dot svelte-1n46o8q" title="Update available"></span>'),hue=k('<dt class="svelte-1n46o8q">Latest</dt><dd style="color: #f90" class="svelte-1n46o8q"> </dd>',1),fue=k('<dt class="svelte-1n46o8q">Latest</dt><dd class="svelte-1n46o8q">up to date</dd>',1),pue=k('<button class="svelte-1n46o8q"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><polyline points="4 4 4 10 10 10" class="svelte-1n46o8q"></polyline><path d="M4 10A9 9 0 1 0 6.5 5" class="svelte-1n46o8q"></path></svg> </button>'),gue=k('<div class="version-popup svelte-1n46o8q"><dl class="svelte-1n46o8q"><dt class="svelte-1n46o8q">Installed</dt><dd class="svelte-1n46o8q"></dd> <!></dl> <div class="version-actions svelte-1n46o8q"><!> <button class="check-btn svelte-1n46o8q" title="Check for updates now"><svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round"><polyline points="4 4 4 10 10 10" class="svelte-1n46o8q"></polyline><path d="M4 10A9 9 0 1 0 6.5 5" class="svelte-1n46o8q"></path></svg> </button></div></div>'),vue=k('<dt class="svelte-1n46o8q">Uptime</dt><dd class="svelte-1n46o8q"> </dd>',1),xue=k('<dt class="svelte-1n46o8q">Matter nodes</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">Matter endpoints</dt><dd class="svelte-1n46o8q"> </dd>',1),mue=k('<dt class="svelte-1n46o8q">DB docs</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">DB views</dt><dd class="svelte-1n46o8q"> </dd>',1),_ue=k('<dl class="svelte-1n46o8q"><!> <dt class="svelte-1n46o8q">Scripts</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">MQTT topics</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">MQTT msg/s</dt><dd class="svelte-1n46o8q"> </dd> <!> <!> <dt class="svelte-1n46o8q">Handlers</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">Memory</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">CPU</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">EL util</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">EL lag mean</dt><dd class="svelte-1n46o8q"> </dd> <dt class="svelte-1n46o8q">EL lag max</dt><dd class="svelte-1n46o8q"> </dd></dl>'),bue=k('<span class="stats-empty svelte-1n46o8q">Loading…</span>'),Cue=k('<button class="svelte-1n46o8q"><svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><path d="M18.36 6.64a9 9 0 1 1-12.73 0" class="svelte-1n46o8q"></path><line x1="12" y1="2" x2="12" y2="12" class="svelte-1n46o8q"></line></svg> Restart daemon</button>'),yue=k('<div class="stats-popup svelte-1n46o8q"><!> <div class="stats-actions svelte-1n46o8q"><!></div></div>'),wue=k('<button class="nav-logout svelte-1n46o8q" title="Logout"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" class="svelte-1n46o8q"></path><polyline points="16 17 21 12 16 7" class="svelte-1n46o8q"></polyline><line x1="21" y1="12" x2="9" y2="12" class="svelte-1n46o8q"></line></svg></button>'),Eue=k("<div><!></div>"),Sue=k('<div class="shell svelte-1n46o8q"><!> <nav class="svelte-1n46o8q"><span class="brand svelte-1n46o8q">she</span> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><polyline points="5,3 1,8 5,13" class="svelte-1n46o8q"></polyline><polyline points="11,3 15,8 11,13" class="svelte-1n46o8q"></polyline></svg> Scripts</button> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="square" stroke-linejoin="miter" class="svelte-1n46o8q"><rect x="0.75" y="0.75" width="14.5" height="14.5" rx="1" class="svelte-1n46o8q"></rect><path d="M2,11 V5 H5 V11" class="svelte-1n46o8q"></path><path d="M6,12 V5 H9 V8 H6" class="svelte-1n46o8q"></path><path d="M10,11 V5 H15 V11" class="svelte-1n46o8q"></path><line x1="12.5" y1="5" x2="12.5" y2="11" class="svelte-1n46o8q"></line></svg> Packages <!></button> <button><svg width="12" height="12" viewBox="0 0 16 16" fill="currentColor" stroke="none" style="vertical-align: middle" class="svelte-1n46o8q"><path fill-rule="evenodd" d="M2,0 H14 A2,2 0 0,1 16,2 V14 A2,2 0 0,1 14,16 H0 V2 A2,2 0 0,1 2,0 Z M0,16 L0,12 A4,4 0 0,1 4,16 Z M0,10.5 A5.5,5.5 0 0,1 5.5,16 L9,16 A9,9 0 0,0 0,7 Z M0,5.5 A10.5,10.5 0 0,1 10.5,16 L13.5,16 A13.5,13.5 0 0,0 0,2.5 Z" class="svelte-1n46o8q"></path></svg> MQTT <!></button> <!> <!> <!> <!> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><rect x="3" y="7" width="10" height="7" rx="1.5" class="svelte-1n46o8q"></rect><path d="M5.5 7V5a2.5 2.5 0 0 1 5 0v2" class="svelte-1n46o8q"></path><circle cx="8" cy="9.9" r="1.15" stroke-width="1.1" class="svelte-1n46o8q"></circle><path d="M8 11v1.2" stroke-width="1.1" class="svelte-1n46o8q"></path></svg> Secrets</button> <button><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" class="svelte-1n46o8q"><line x1="2" y1="5" x2="14" y2="5" class="svelte-1n46o8q"></line><line x1="2" y1="8" x2="14" y2="8" class="svelte-1n46o8q"></line><line x1="2" y1="11" x2="9" y2="11" class="svelte-1n46o8q"></line></svg> Logs <!></button> <div class="nav-spacer svelte-1n46o8q"></div> <div class="nav-right svelte-1n46o8q"><a class="nav-icon svelte-1n46o8q" href="https://github.com/hobbyquaker/she" target="_blank" rel="noopener" title="GitHub"><svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor" class="svelte-1n46o8q"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z" class="svelte-1n46o8q"></path></svg></a> <div class="version-wrap svelte-1n46o8q"><button class="version svelte-1n46o8q"> <!></button> <!></div> <div class="stats-wrap svelte-1n46o8q"><button class="nav-icon svelte-1n46o8q" title="Daemon status"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><line x1="18" y1="20" x2="18" y2="10" class="svelte-1n46o8q"></line><line x1="12" y1="20" x2="12" y2="4" class="svelte-1n46o8q"></line><line x1="6" y1="20" x2="6" y2="14" class="svelte-1n46o8q"></line></svg></button> <!></div> <button title="Settings"><svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z" class="svelte-1n46o8q"></path><circle cx="12" cy="12" r="3" class="svelte-1n46o8q"></circle></svg></button> <!></div></nav> <main class="svelte-1n46o8q"><!> <div><!></div> <div><!></div> <div><!></div> <div><!></div> <div><!></div> <!> <div><!></div> <div><!></div> <div><!></div> <div><!></div></main></div>'),kue=k('<div class="login-error svelte-1n46o8q"> </div>'),Due=k('<div class="login-overlay svelte-1n46o8q"><form class="login-box svelte-1n46o8q"><div class="login-brand svelte-1n46o8q">she</div> <h2 class="svelte-1n46o8q">Sign in</h2> <div class="login-field svelte-1n46o8q"><label for="she-password" class="svelte-1n46o8q">Password</label> <input id="she-password" type="password" placeholder="Enter password" autocomplete="current-password" class="svelte-1n46o8q"/></div> <!> <button type="submit" class="login-btn svelte-1n46o8q"> </button></form></div>'),Aue=k('<div class="updating-overlay svelte-1n46o8q"><div class="updating-box svelte-1n46o8q"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><polyline points="4 4 4 10 10 10" class="svelte-1n46o8q"></polyline><path d="M4 10A9 9 0 1 0 6.5 5" class="svelte-1n46o8q"></path></svg> Restarting smart-home-engine…</div></div>'),Bue=k('<div class="updating-overlay svelte-1n46o8q"><div class="updating-box svelte-1n46o8q"><svg width="22" height="22" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1n46o8q"><polyline points="4 4 4 10 10 10" class="svelte-1n46o8q"></polyline><path d="M4 10A9 9 0 1 0 6.5 5" class="svelte-1n46o8q"></path></svg> Updating smart-home-engine…</div></div>'),Fue=k("<!> <!> <!> <!>",1);function Lue(r,e){cs(e,!0);const t=["scripts","mqtt","matter","broker","adapters","secrets","db","logs","config","packages"],i={services:"adapters",security:"broker"};function n(){const Re=location.hash.replace(/^#\/?/,""),[bt,...ft]=Re.split("/"),Wt=i[bt]??bt;if(!t.includes(Wt))return{page:"scripts",sub:null};const qt=ft.map(xt=>{try{return decodeURIComponent(xt)}catch{return xt}}).join("/");return{page:Wt,sub:qt||null}}let s=A(_i(n().page)),a=A(_i(n().sub)),l=A(null),d=A(!1),u=A(!1),g=A(!1),x=A(!1),m=A("none"),C=A(""),_=A(!1),E=A(""),S=A(""),I=A(!1),M=A(!1);nG(()=>{p(_,!0)});async function O(){p(S,""),p(I,!0);try{await rG(o(E)),p(E,""),p(_,!1)}catch(Re){p(S,Re.message??"Login failed",!0)}finally{p(I,!1)}}async function R(){if(o(m)==="proxy"&&o(C)){window.location.href=o(C);return}await aG(),p(_,!0)}let H=A(null),G=A(!1),U=A(!1),re=A(!1),we=A(!1),Me=A(_i([])),be=A(0),$e=A(!1),lt=A(!1),de=A("none"),Ve=A(""),ve=A(_i([]));const je=ot(()=>o(ve).filter(Re=>Re.online).length),pe=ot(()=>o(ve).length===0?"none":o(je)===o(ve).length?"all":o(je)>0?"some":"offline");let Et=A(!1),Te=A(!1);async function Ie(){if(!await o(H).show("Restart the she daemon? The page will reload after a moment.",{confirm:"Restart"}))return;p(G,!0);let Re;try{Re=(await Gc()).startedAt}catch{}try{await _7()}catch{}const bt=Date.now()+6e4;for(;Date.now()<bt;){await new Promise(ft=>setTimeout(ft,250));try{const ft=await Gc();if(Re===void 0||ft.startedAt!==Re){location.reload();return}}catch{}}location.reload()}async function Xe(){p(g,!0);try{const Re=await gG();o(l)&&p(l,{...o(l),latestVersion:Re.latestVersion??void 0},!0)}catch{}finally{p(g,!1)}}async function Dt(){var ft,Wt;if(!await o(H).show(`Update to v${(ft=o(l))==null?void 0:ft.latestVersion}? The daemon will restart after the update completes.`,{confirm:"Update"}))return;p(u,!1),p(x,!0);const Re=(Wt=o(l))==null?void 0:Wt.startedAt;try{await pG()}catch{}const bt=Date.now()+18e4;for(;Date.now()<bt;){await new Promise(qt=>setTimeout(qt,1e3));try{const qt=await Gc();if(Re===void 0||qt.startedAt!==Re){location.reload();return}}catch{p(x,!1),p(G,!0)}}location.reload()}let me=A(void 0),ke=A(0);function Ne(){if(!o(me))return;const Re=getComputedStyle(o(me)),bt=parseFloat(Re.columnGap)||0,ft=[...o(me).children];let Wt=parseFloat(Re.paddingLeft)+parseFloat(Re.paddingRight)+bt*Math.max(0,ft.length-1);for(const xt of ft)xt.classList.contains("nav-spacer")||(Wt+=xt.getBoundingClientRect().width);const qt=Math.ceil(Wt)+8;qt>0&&qt!==o(ke)&&p(ke,qt)}let Qe=null;function Ke(){if(!(!o(me)||!Qe)){Qe.disconnect(),Qe.observe(o(me));for(const Re of o(me).children)Qe.observe(Re);Ne()}}Ns(()=>(Qe=new ResizeObserver(()=>Ne()),Ke(),()=>{Qe==null||Qe.disconnect(),Qe=null})),tn(()=>{var Re,bt,ft,Wt;o($e),o(lt),(Re=o(l))==null||Re.matterEnabled,(bt=o(l))==null||bt.dbEnabled,(ft=o(l))==null||ft.latestVersion,(Wt=o(l))==null||Wt.docker,ua().then(()=>Eo(Ke))});function vt(Re){p(s,Re,!0),p(a,null),location.hash=ni(Re,null)}function ni(Re,bt){const ft=bt?bt.split("/").map(encodeURIComponent).join("/"):"";return`#/${Re}${ft?"/"+ft:""}`}function zt(Re,bt){const ft=bt||null;o(s)!==Re||o(a)===ft||(p(a,ft,!0),history.replaceState(null,"",ni(Re,ft)))}Ns(async()=>{const Re=ni(o(s),o(a));location.hash!==Re&&history.replaceState(null,"",Re);const bt=()=>{const ue=n();p(s,ue.page,!0),p(a,ue.sub,!0)};window.addEventListener("hashchange",bt);const ft=()=>{document.visibilityState==="visible"&&(lZ(),Gc().then(ue=>{p(l,ue,!0)}).catch(()=>{}),requestAnimationFrame(()=>{document.body.style.display="none",document.body.offsetHeight,document.body.style.display="",window.dispatchEvent(new Event("she:visible"))}))};document.addEventListener("visibilitychange",ft);try{const ue=await oG();p(m,ue.mode,!0),p(C,ue.proxyLogoutUrl??"",!0),o(m)==="password"&&(await fetch("/she/scripts")).status===401&&p(_,!0)}catch{}p(M,!0);async function Wt(){var ue,De,it,V;try{p(l,await Gc(),!0)}catch{}try{const[Ue,pt]=await Promise.all([y7(),wc()]);p(Me,Array.isArray(pt.pinnedPackages)?pt.pinnedPackages:[],!0),p(be,Object.keys(Ue).filter(ut=>!o(Me).includes(ut)).length,!0);const ge=o($e);p($e,((ue=pt.broker)==null?void 0:ue.enabled)===!0),ge&&!o($e)&&o(s)==="broker"&&vt("scripts");const Ge=o(lt);p(lt,((De=pt.services)==null?void 0:De.enabled)===!0),Ge&&!o(lt)&&o(s)==="adapters"&&vt("scripts")}catch{}!((it=o(l))!=null&&it.matterEnabled)&&o(s)==="matter"&&vt("scripts"),!((V=o(l))!=null&&V.dbEnabled)&&o(s)==="db"&&vt("scripts")}Wt();const qt=setInterval(Wt,5e3),xt=Ko("mqtt:status",ue=>{ue.connected===!1?(p(we,!0),p(U,!1),p(re,!1)):(p(we,!1),p(U,ue.ready===!1),p(re,ue.ready===!0))}),dt=Ko("matter:deviceList",ue=>{Array.isArray(ue.devices)&&p(ve,ue.devices.map(De=>({nodeId:String(De.nodeId),online:!!De.online})),!0)}),w=Ko("matter:deviceStatus",ue=>{if(ue.nodeId===void 0)return;const De=String(ue.nodeId),it=!!ue.online;p(ve,o(ve).map(V=>V.nodeId===De?{...V,online:it}:V),!0)}),j=L7();p(Et,j.some(ue=>ue.level==="error"),!0),p(Te,!o(Et)&&j.some(ue=>ue.level==="warn"),!0);const ie=d2(ue=>{ue.level==="error"?(p(Et,!0),p(Te,!1)):ue.level==="warn"&&!o(Et)&&p(Te,!0)});return()=>{window.removeEventListener("hashchange",bt),document.removeEventListener("visibilitychange",ft),clearInterval(qt),xt(),dt(),w(),ie()}});var ze=Fue();ys("click",o3,()=>{o(d)&&p(d,!1),o(u)&&p(u,!1)});var ct=yt(ze);{var jt=Re=>{var bt=Sue(),ft=f(bt);{var Wt=xe=>{var st=Xde(),$t=h(f(st),2);z("click",$t,Ie),y(xe,st)};T(ft,xe=>{var st;(st=o(l))!=null&&st.safeMode&&xe(Wt)})}var qt=h(ft,2),xt=h(f(qt),2);let dt;var w=h(xt,2);let j;var ie=h(f(w),2);{var ue=xe=>{var st=JA();P(()=>vi(st,"title",`${o(be)??""} package update${o(be)===1?"":"s"} available`)),y(xe,st)};T(ie,xe=>{o(be)>0&&xe(ue)})}var De=h(w,2);let it;var V=h(f(De),2);{var Ue=xe=>{var st=Qde();y(xe,st)},pt=xe=>{var st=Jde();y(xe,st)},ge=xe=>{var st=eue();y(xe,st)};T(V,xe=>{o(we)?xe(Ue):o(U)?xe(pt,1):o(re)&&xe(ge,2)})}var Ge=h(De,2);{var ut=xe=>{var st=tue();let $t;P(()=>$t=Ut(st,1,"svelte-1n46o8q",null,$t,{active:o(s)==="broker"})),z("click",st,()=>vt("broker")),y(xe,st)};T(Ge,xe=>{o($e)&&xe(ut)})}var Ct=h(Ge,2);{var Rt=xe=>{var st=nue();let $t;var wi=h(f(st),2);{var xi=Ot=>{var ii=JA();P(()=>vi(ii,"title",o(Ve))),y(Ot,ii)},ki=Ot=>{var ii=iue();y(Ot,ii)};T(wi,Ot=>{o(de)==="warn"?Ot(xi):Ot(ki,-1)})}P(()=>$t=Ut(st,1,"svelte-1n46o8q",null,$t,{active:o(s)==="adapters"})),z("click",st,()=>vt("adapters")),y(xe,st)};T(Ct,xe=>{o(lt)&&xe(Rt)})}var Fe=h(Ct,2);{var nt=xe=>{var st=aue();let $t;var wi=h(f(st),2);{var xi=ii=>{var yi=sue();y(ii,yi)},ki=ii=>{var yi=oue();y(ii,yi)},Ot=ii=>{var yi=rue();y(ii,yi)};T(wi,ii=>{o(pe)==="all"?ii(xi):o(pe)==="some"?ii(ki,1):o(pe)==="offline"&&ii(Ot,2)})}P(()=>$t=Ut(st,1,"svelte-1n46o8q",null,$t,{active:o(s)==="matter"})),z("click",st,()=>vt("matter")),y(xe,st)};T(Fe,xe=>{var st;(st=o(l))!=null&&st.matterEnabled&&xe(nt)})}var $=h(Fe,2);{var Ce=xe=>{var st=lue();let $t;P(()=>$t=Ut(st,1,"svelte-1n46o8q",null,$t,{active:o(s)==="db"})),z("click",st,()=>vt("db")),y(xe,st)};T($,xe=>{var st;(st=o(l))!=null&&st.dbEnabled&&xe(Ce)})}var He=h($,2);let mt;var gt=h(He,2);let Kt;var ce=h(f(gt),2);{var te=xe=>{var st=cue();y(xe,st)},K=xe=>{var st=due();y(xe,st)};T(ce,xe=>{o(Et)?xe(te):o(Te)&&xe(K,1)})}var Ae=h(gt,4),rt=h(f(Ae),2),Je=f(rt),St=f(Je);St.nodeValue="v1.51.2 ";var wt=h(St);{var qe=xe=>{var st=uue();y(xe,st)};T(wt,xe=>{var st,$t;(st=o(l))!=null&&st.latestVersion&&!(($t=o(l))!=null&&$t.docker)&&xe(qe)})}var Zt=h(Je,2);{var ti=xe=>{var st=gue(),$t=f(st),wi=h(f($t));wi.textContent="v1.51.2";var xi=h(wi,2);{var ki=sn=>{var Pi=hue(),Tn=h(yt(Pi)),an=f(Tn);P(()=>B(an,`v${o(l).latestVersion??""}`)),y(sn,Pi)},Ot=sn=>{var Pi=fue();y(sn,Pi)};T(xi,sn=>{var Pi;(Pi=o(l))!=null&&Pi.latestVersion?sn(ki):sn(Ot,-1)})}var ii=h($t,2),yi=f(ii);{var Ti=sn=>{var Pi=pue(),Tn=h(f(Pi));P(()=>B(Tn,` Update to v${o(l).latestVersion??""}`)),z("click",Pi,Dt),y(sn,Pi)};T(yi,sn=>{var Pi;(Pi=o(l))!=null&&Pi.latestVersion&&sn(Ti)})}var Di=h(yi,2),Vi=f(Di);let $i;var xn=h(Vi);P(()=>{Di.disabled=o(g),$i=Ut(Vi,0,"svelte-1n46o8q",null,$i,{spinning:o(g)}),B(xn,` ${o(g)?"Checking…":"Check for updates"}`)}),z("click",st,sn=>sn.stopPropagation()),z("click",Di,Xe),y(xe,st)};T(Zt,xe=>{var st;o(u)&&!((st=o(l))!=null&&st.docker)&&xe(ti)})}var mi=h(rt,2),Ai=f(mi),ee=h(Ai,2);{var We=xe=>{var st=yue(),$t=f(st);{var wi=yi=>{var Ti=_ue(),Di=f(Ti);{var Vi=Si=>{const Ri=ot(()=>Math.floor((Date.now()-o(l).startedAt)/1e3)),cn=ot(()=>Math.floor(o(Ri)/86400)),bn=ot(()=>Math.floor(o(Ri)%86400/3600)),En=ot(()=>Math.floor(o(Ri)%3600/60));var Cn=vue(),on=h(yt(Cn)),hn=f(on);P(()=>B(hn,`${o(cn)>0?o(cn)+"d ":""}${o(bn)>0||o(cn)>0?o(bn)+"h ":""}${o(En)??""}m`)),y(Si,Cn)};T(Di,Si=>{o(l).startedAt&&Si(Vi)})}var $i=h(Di,3),xn=f($i),sn=h($i,3),Pi=f(sn),Tn=h(sn,3),an=f(Tn),Ji=h(Tn,2);{var Zn=Si=>{var Ri=xue(),cn=h(yt(Ri)),bn=f(cn),En=h(cn,3),Cn=f(En);P(()=>{B(bn,o(l).matterNodes??0),B(Cn,o(l).matterEndpoints??0)}),y(Si,Ri)};T(Ji,Si=>{o(l).matterEnabled&&Si(Zn)})}var Sn=h(Ji,2);{var bs=Si=>{var Ri=mue(),cn=h(yt(Ri)),bn=f(cn),En=h(cn,3),Cn=f(En);P(()=>{B(bn,o(l).dbDocs??"—"),B(Cn,o(l).dbViews??"—")}),y(Si,Ri)};T(Sn,Si=>{o(l).dbEnabled&&Si(bs)})}var Is=h(Sn,3),co=f(Is),gi=h(Is,3),Yi=f(gi),Wi=h(gi,3),dn=f(Wi),Bn=h(Wi,3),bi=f(Bn),Oi=h(Bn,3),Hi=f(Oi),ji=h(Oi,3),en=f(ji);P(()=>{B(xn,o(l).scripts),B(Pi,o(l).topics),B(an,o(l).mqttMsgPerSec??"—"),B(co,o(l).handlers??"—"),B(Yi,o(l).memMb!=null?o(l).memMb+" MB":"—"),B(dn,o(l).cpuPercent!=null?o(l).cpuPercent+" %":"—"),B(bi,o(l).eluPercent!=null?o(l).eluPercent+" %":"—"),B(Hi,o(l).elMeanMs!=null?o(l).elMeanMs+" ms":"—"),B(en,o(l).elMaxMs!=null?o(l).elMaxMs+" ms":"—")}),y(yi,Ti)},xi=yi=>{var Ti=bue();y(yi,Ti)};T($t,yi=>{o(l)?yi(wi):yi(xi,-1)})}var ki=h($t,2),Ot=f(ki);{var ii=yi=>{var Ti=Cue();z("click",Ti,()=>{p(d,!1),Ie()}),y(yi,Ti)};T(Ot,yi=>{var Ti;(Ti=o(l))!=null&&Ti.docker||yi(ii)})}z("click",st,yi=>yi.stopPropagation()),y(xe,st)};T(ee,xe=>{o(d)&&xe(We)})}var kt=h(mi,2);let Lt;var J=h(kt,2);{var le=xe=>{var st=wue();z("click",st,R),y(xe,st)};T(J,xe=>{o(m)==="password"&&xe(le)})}ns(qt,xe=>p(me,xe),()=>o(me));var ne=h(qt,2),se=f(ne);ns(Er(se,{}),xe=>p(H,xe,!0),()=>o(H));var Le=h(se,2);let ye;var _t=f(Le);{let xe=ot(()=>o(s)==="scripts"),st=ot(()=>o(s)==="scripts"?o(a):null);EQ(_t,{get active(){return o(xe)},get sub(){return o(st)},onsub:$t=>zt("scripts",$t)})}var Z=h(Le,2);let Ye;var W=f(Z);Jie(W,{});var Q=h(Z,2);let he;var Pe=f(Q);{let xe=ot(()=>o(s)==="mqtt"),st=ot(()=>o(s)==="mqtt"?o(a):null);Tie(Pe,{get active(){return o(xe)},get sub(){return o(st)},onsub:$t=>zt("mqtt",$t)})}var Ee=h(Q,2);let tt;var at=f(Ee);{let xe=ot(()=>o(s)==="matter"),st=ot(()=>o(s)==="matter"?o(a):null);Ate(at,{get active(){return o(xe)},get sub(){return o(st)},onsub:$t=>zt("matter",$t)})}var Ft=h(Ee,2);let Nt;var Pt=f(Ft);{let xe=ot(()=>o(s)==="broker"),st=ot(()=>o(s)==="broker"?o(a):null);Loe(Pt,{get active(){return o(xe)},get sub(){return o(st)},onsub:$t=>zt("broker",$t)})}var It=h(Ft,2);{var Tt=xe=>{var st=Eue();let $t;var wi=f(st);{let xi=ot(()=>o(s)==="adapters"),ki=ot(()=>o(s)==="adapters"?o(a):null);Ade(wi,{onstatus:(Ot,ii)=>{p(de,Ot,!0),p(Ve,ii,!0)},get active(){return o(xi)},get sub(){return o(ki)},onsub:Ot=>zt("adapters",Ot)})}P(()=>$t=Ut(st,1,"page-wrap svelte-1n46o8q",null,$t,{hidden:o(s)!=="adapters"})),y(xe,st)};T(It,xe=>{o(lt)&&xe(Tt)})}var Jt=h(It,2);let Ei;var Be=f(Jt);{let xe=ot(()=>o(s)==="secrets"),st=ot(()=>o(s)==="secrets"?o(a):null);Yde(Be,{get active(){return o(xe)},get sub(){return o(st)},onsub:$t=>zt("secrets",$t)})}var Oe=h(Jt,2);let Mt;var ci=f(Oe);{let xe=ot(()=>o(s)==="db"),st=ot(()=>o(s)==="db"?o(a):null);Bee(ci,{get active(){return o(xe)},get sub(){return o(st)},onsub:$t=>zt("db",$t)})}var Se=h(Oe,2);let Xt;var Qt=f(Se);xJ(Qt,{});var di=h(Se,2);let ei;var At=f(di);wJ(At,{}),P(()=>{Do(bt,o(ke)?`min-width: ${o(ke)}px`:void 0),dt=Ut(xt,1,"svelte-1n46o8q",null,dt,{active:o(s)==="scripts"}),j=Ut(w,1,"svelte-1n46o8q",null,j,{active:o(s)==="packages"}),it=Ut(De,1,"svelte-1n46o8q",null,it,{active:o(s)==="mqtt"}),mt=Ut(He,1,"svelte-1n46o8q",null,mt,{active:o(s)==="secrets"}),Kt=Ut(gt,1,"svelte-1n46o8q",null,Kt,{active:o(s)==="logs"}),Lt=Ut(kt,1,"nav-settings svelte-1n46o8q",null,Lt,{active:o(s)==="config"}),ye=Ut(Le,1,"page-wrap svelte-1n46o8q",null,ye,{hidden:o(s)!=="scripts"}),Ye=Ut(Z,1,"page-wrap svelte-1n46o8q",null,Ye,{hidden:o(s)!=="packages"}),he=Ut(Q,1,"page-wrap svelte-1n46o8q",null,he,{hidden:o(s)!=="mqtt"}),tt=Ut(Ee,1,"page-wrap svelte-1n46o8q",null,tt,{hidden:o(s)!=="matter"}),Nt=Ut(Ft,1,"page-wrap svelte-1n46o8q",null,Nt,{hidden:o(s)!=="broker"}),Ei=Ut(Jt,1,"page-wrap svelte-1n46o8q",null,Ei,{hidden:o(s)!=="secrets"}),Mt=Ut(Oe,1,"page-wrap svelte-1n46o8q",null,Mt,{hidden:o(s)!=="db"}),Xt=Ut(Se,1,"page-wrap svelte-1n46o8q",null,Xt,{hidden:o(s)!=="config"}),ei=Ut(di,1,"page-wrap svelte-1n46o8q",null,ei,{hidden:o(s)!=="logs"})}),z("click",xt,()=>vt("scripts")),z("click",w,()=>vt("packages")),z("click",De,()=>vt("mqtt")),z("click",He,()=>vt("secrets")),z("click",gt,()=>{vt("logs"),p(Et,!1),p(Te,!1)}),z("click",Je,xe=>{xe.stopPropagation(),p(u,!o(u)),p(d,!1)}),z("click",Ai,xe=>{xe.stopPropagation(),p(d,!o(d)),p(u,!1)}),z("click",kt,()=>vt("config")),y(Re,bt)};T(ct,Re=>{o(M)&&!o(_)&&Re(jt)})}var Bt=h(ct,2);{var ri=Re=>{var bt=Due(),ft=f(bt),Wt=h(f(ft),4),qt=h(f(Wt),2),xt=h(Wt,2);{var dt=ie=>{var ue=kue(),De=f(ue);P(()=>B(De,o(S))),y(ie,ue)};T(xt,ie=>{o(S)&&ie(dt)})}var w=h(xt,2),j=f(w);P(()=>{qt.disabled=o(I),w.disabled=o(I)||!o(E),B(j,o(I)?"Signing in…":"Sign in")}),ys("submit",ft,ie=>{ie.preventDefault(),O()}),li(qt,()=>o(E),ie=>p(E,ie)),y(Re,bt)};T(Bt,Re=>{o(_)&&Re(ri)})}var X=h(Bt,2);{var ae=Re=>{var bt=Aue();y(Re,bt)};T(X,Re=>{o(G)&&Re(ae)})}var q=h(X,2);{var _e=Re=>{var bt=Bue();y(Re,bt)};T(q,Re=>{o(x)&&Re(_e)})}y(r,ze),ds()}_s(["click"]);bM(Lue,{target:document.getElementById("app")});export{H3 as t};
@@ -1,4 +1,4 @@
1
- import{m as O}from"./monaco-langs-DKJI_o9J.js";import{t as I}from"./index-ByddOkpo.js";/*!-----------------------------------------------------------------------------
1
+ import{m as O}from"./monaco-langs-DKJI_o9J.js";import{t as I}from"./index-CSKTxEh5.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
4
4
  * Released under the MIT license
@@ -175,7 +175,7 @@
175
175
  }
176
176
  })();
177
177
  </script>
178
- <script type="module" crossorigin src="/assets/index-ByddOkpo.js"></script>
178
+ <script type="module" crossorigin src="/assets/index-CSKTxEh5.js"></script>
179
179
  <link rel="modulepreload" crossorigin href="/assets/monaco-langs-DKJI_o9J.js">
180
180
  <link rel="stylesheet" crossorigin href="/assets/monaco-langs-DyX1CsEw.css">
181
181
  <link rel="stylesheet" crossorigin href="/assets/index-DPDW78ru.css">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smart-home-engine",
3
- "version": "1.51.1",
3
+ "version": "1.51.2",
4
4
  "description": "Node.js based script runner for use in MQTT based Smart Home environments",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/index.js CHANGED
@@ -259,6 +259,7 @@ const { domain, vm, fs, path, suncalc } = modules;
259
259
  const scheduler = modules['node-schedule'];
260
260
 
261
261
  const StateStore = require('./lib/state-store');
262
+ const { trackTimeout } = require('./lib/script-timers');
262
263
  const sandboxModules = [];
263
264
  const store = new StateStore();
264
265
  if (typeof config.port !== 'undefined') require('./web/broker-api').setStore(store);
@@ -1061,8 +1062,7 @@ function runScript(script, name, _origin) {
1061
1062
  scheduler.scheduleJob(pattern, () => {
1062
1063
  // Track the random-delay timer so it is cancelled on unload
1063
1064
  // if the job fires in the same tick as the script is reloaded.
1064
- const id = setTimeout(() => _dispatch(name, scriptDomain.bind(callback)), (parseFloat(options.random) || 0) * 1000 * Math.random());
1065
- _myTimers.add(id);
1065
+ trackTimeout(_myTimers, () => _dispatch(name, scriptDomain.bind(callback)), (parseFloat(options.random) || 0) * 1000 * Math.random());
1066
1066
  }),
1067
1067
  );
1068
1068
  } else {
@@ -1211,9 +1211,7 @@ function runScript(script, name, _origin) {
1211
1211
  const Sandbox = {
1212
1212
  setTimeout: (fn, delay, ...args) => {
1213
1213
  const wrapped = args.length ? () => fn(...args) : fn;
1214
- const id = setTimeout(() => _dispatch(name, wrapped), delay);
1215
- _myTimers.add(id);
1216
- return id;
1214
+ return trackTimeout(_myTimers, () => _dispatch(name, wrapped), delay);
1217
1215
  },
1218
1216
  setInterval: (fn, delay, ...args) => {
1219
1217
  const wrapped = args.length ? () => fn(...args) : fn;
@@ -1296,9 +1294,7 @@ function runScript(script, name, _origin) {
1296
1294
  // sandbox modules that don't have direct access to the Sandbox context.
1297
1295
  she.setTimeout = (fn, delay, ...args) => {
1298
1296
  const wrapped = args.length ? () => fn(...args) : fn;
1299
- const id = setTimeout(() => _dispatch(name, wrapped), delay);
1300
- _myTimers.add(id);
1301
- return id;
1297
+ return trackTimeout(_myTimers, () => _dispatch(name, wrapped), delay);
1302
1298
  };
1303
1299
  she.clearTimeout = (id) => {
1304
1300
  _myTimers.delete(id);
@@ -0,0 +1,26 @@
1
+ 'use strict';
2
+ /**
3
+ * One-shot timers a script started, tracked in the script's set so that unloading the script can
4
+ * clear the ones still pending (roadmap B9).
5
+ *
6
+ * The id leaves the set when the timer fires. Before, only an explicit clearTimeout removed it, so
7
+ * every timeout that ran normally stayed in the set for the life of the daemon — with its callback
8
+ * and everything the callback captured. A script that starts a "switch off after N minutes" timer
9
+ * per event leaked hundreds of them an hour, and the heap ran full after about twelve days.
10
+ *
11
+ * @param {Set} timers the script's timer set
12
+ * @param {Function} fn called when the timer fires
13
+ * @param {number} delay ms
14
+ * @param {Function} [setTimeoutFn] for tests
15
+ * @returns the timer id (what clearTimeout takes)
16
+ */
17
+ function trackTimeout(timers, fn, delay, setTimeoutFn = setTimeout) {
18
+ const id = setTimeoutFn(() => {
19
+ timers.delete(id);
20
+ fn();
21
+ }, delay);
22
+ timers.add(id);
23
+ return id;
24
+ }
25
+
26
+ module.exports = { trackTimeout };