skill-creator 2.4.0 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +119 -9
- package/dist/cli.js.map +2 -2
- package/dist/daemon.js +268 -21
- package/dist/daemon.js.map +4 -4
- package/dist/package.json +1 -1
- package/dist/webui/_app/immutable/assets/0.DLmCZ2fP.css +2 -0
- package/dist/webui/_app/immutable/assets/CreatorWorkspace.CvDsme_1.css +1 -0
- package/dist/webui/_app/immutable/chunks/{CdjBDc_u.js → B8aGNSaH.js} +1 -1
- package/dist/webui/_app/immutable/chunks/{CvO5eq4f.js → BDMeqoYB.js} +1 -1
- package/dist/webui/_app/immutable/chunks/{BgJCuTDs.js → BTMBuftG.js} +1 -1
- package/dist/webui/_app/immutable/chunks/Ba9GVGQ5.js +6 -0
- package/dist/webui/_app/immutable/chunks/{D6s79OPW.js → BchFBl6r.js} +1 -1
- package/dist/webui/_app/immutable/chunks/BhCD2hsN.js +8 -0
- package/dist/webui/_app/immutable/chunks/{hIGXQE4_.js → Bynub5xW.js} +1 -1
- package/dist/webui/_app/immutable/chunks/CYhuNS_d.js +11 -0
- package/dist/webui/_app/immutable/chunks/{Bd1_Ly7G.js → C_mgfJl-.js} +1 -1
- package/dist/webui/_app/immutable/chunks/{CIxXWvxF.js → ClW_LCBS.js} +1 -1
- package/dist/webui/_app/immutable/chunks/{Do_MDwCJ.js → Cy5ABld-.js} +1 -1
- package/dist/webui/_app/immutable/chunks/CzkhJhvt.js +1 -0
- package/dist/webui/_app/immutable/chunks/{BTuMeN4z.js → DBNjJ5Iw.js} +1 -1
- package/dist/webui/_app/immutable/chunks/DC5f4JBB.js +5 -0
- package/dist/webui/_app/immutable/chunks/DF_TIB7n.js +1 -0
- package/dist/webui/_app/immutable/chunks/DH8yd93-.js +1 -0
- package/dist/webui/_app/immutable/chunks/DSbDiml2.js +28 -0
- package/dist/webui/_app/immutable/chunks/{Du6-3Tbt.js → DTzqg7c9.js} +1 -1
- package/dist/webui/_app/immutable/chunks/{DGJ9QIPN.js → DVv6BdWV.js} +1 -1
- package/dist/webui/_app/immutable/chunks/{CBFLFfGb.js → DYbgoqwH.js} +1 -1
- package/dist/webui/_app/immutable/chunks/DdHvRi0A.js +1 -0
- package/dist/webui/_app/immutable/chunks/{B0stYqX9.js → DjZ7hdjX.js} +1 -1
- package/dist/webui/_app/immutable/chunks/DvWG9eQi.js +1 -0
- package/dist/webui/_app/immutable/chunks/DzfSSVEB.js +2 -0
- package/dist/webui/_app/immutable/chunks/GHFnehdP.js +5 -0
- package/dist/webui/_app/immutable/chunks/VnziGBZO.js +2 -0
- package/dist/webui/_app/immutable/chunks/a0LlqeqU.js +1 -0
- package/dist/webui/_app/immutable/chunks/eFUKcYMv.js +1 -0
- package/dist/webui/_app/immutable/chunks/{DlsPNMHX.js → pd7EK5wP.js} +2 -2
- package/dist/webui/_app/immutable/chunks/{Dcf0klrH.js → xAjQV7BZ.js} +2 -2
- package/dist/webui/_app/immutable/entry/{app.SX0t6ojk.js → app.DlQ53I3_.js} +2 -2
- package/dist/webui/_app/immutable/entry/start.CNmXm9ox.js +1 -0
- package/dist/webui/_app/immutable/nodes/0.BXeEkneG.js +229 -0
- package/dist/webui/_app/immutable/nodes/{1.BY0DmHLP.js → 1.DzYWdh98.js} +1 -1
- package/dist/webui/_app/immutable/nodes/{2._osi8D6m.js → 2.Dl1DQV0d.js} +1 -1
- package/dist/webui/_app/version.json +1 -1
- package/dist/webui/index.html +23 -21
- package/package.json +5 -5
- package/dist/webui/_app/immutable/assets/0.B4ZC2KQW.css +0 -2
- package/dist/webui/_app/immutable/chunks/B_gnhZ39.js +0 -1
- package/dist/webui/_app/immutable/chunks/BcvferwH.js +0 -8
- package/dist/webui/_app/immutable/chunks/CD-NpLjk.js +0 -6
- package/dist/webui/_app/immutable/chunks/COXgCOd9.js +0 -2
- package/dist/webui/_app/immutable/chunks/Ccj5eiVa.js +0 -1
- package/dist/webui/_app/immutable/chunks/Cp0lquqA.js +0 -1
- package/dist/webui/_app/immutable/chunks/Crg8KRap.js +0 -5
- package/dist/webui/_app/immutable/chunks/D7DTLcps.js +0 -1
- package/dist/webui/_app/immutable/chunks/oJ4aK8PG.js +0 -1
- package/dist/webui/_app/immutable/chunks/vry1W47_.js +0 -7
- package/dist/webui/_app/immutable/entry/start.gejSBBnR.js +0 -1
- package/dist/webui/_app/immutable/nodes/0.BTXc1wYu.js +0 -229
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{A as e,At as t,B as n,Ct as r,F as i,G as a,N as o,R as s,St as c,U as l,W as u,X as d,ct as f,gt as p,kt as m,lt as h,m as g,nt as _,ot as v,rt as y,st as b,z as x}from"./CmCJ0SKP.js";import{t as S}from"./
|
|
1
|
+
import{A as e,At as t,B as n,Ct as r,F as i,G as a,N as o,R as s,St as c,U as l,W as u,X as d,ct as f,gt as p,kt as m,lt as h,m as g,nt as _,ot as v,rt as y,st as b,z as x}from"./CmCJ0SKP.js";import{t as S}from"./DjZ7hdjX.js";import"./xihTtKlq.js";import"./eFUKcYMv.js";import{t as C}from"./BT2vrlul.js";import{n as w,t as T}from"./DnPeA-9c.js";import{t as E}from"./CpRvgjpe.js";import{t as D}from"./BIfnT_mK.js";import{t as O}from"./Bs27XW8_.js";import{o as k,r as A,s as j}from"./DBNjJ5Iw.js";import{t as M}from"./Bl0jjuyR.js";import{t as N}from"./CI1OXbBG.js";var P=null,F=n(`<div class="flex items-start gap-3 rounded-lg border border-destructive/40 bg-destructive/10 p-4" role="alert"><!> <div class="min-w-0 flex-1"><p class="text-sm font-medium text-destructive">Couldn't load wiki scopes</p> <p class="mt-1 break-words text-xs text-destructive/90"> </p></div> <!></div>`),I=n(`<div class="space-y-3" aria-label="Loading wiki scopes"><div class="h-16 animate-pulse rounded-lg border border-border bg-muted/50"></div> <div class="h-16 animate-pulse rounded-lg border border-border bg-muted/50"></div></div>`),L=n(`<div class="rounded-lg border border-dashed border-border p-8 text-center"><!> <p class="mt-3 text-sm font-medium">No wiki scopes yet</p> <p class="mt-1 text-xs text-muted-foreground">The global wiki appears once the daemon is reachable.</p></div>`),R=n(`<p class="flex items-center gap-2 text-xs text-muted-foreground" role="status"><!> Updating…</p>`),z=n(`<span class="block truncate text-xs text-muted-foreground"> <!></span>`),B=n(`<span class="block truncate text-xs text-muted-foreground/80">Not initialized — opens empty, first fragment creates it</span>`),V=n(`<li><button class="flex min-h-11 w-full items-center gap-2.5 px-3 py-2.5 text-left transition-colors hover:bg-muted/50"><!> <span class="min-w-0 flex-1"><span class="flex items-center gap-2"><span class="truncate text-sm font-medium"> </span> <!></span> <!></span> <!></button></li>`),H=n(`<!> <ul class="divide-y divide-border rounded-lg border border-border"></ul>`,1),U=n(`<div class="flex h-full flex-col overflow-y-auto p-5"><header class="flex shrink-0 items-start justify-between gap-3 border-b border-border pb-4"><div><h1 class="text-lg font-semibold">Wiki</h1> <p class="mt-0.5 text-xs text-muted-foreground">Fragment insights collected per wiki — global notes and workspace-local knowledge.</p></div> <div class="flex shrink-0 items-center gap-1.5"><!></div></header> <div class="mx-auto mt-5 w-full max-w-3xl space-y-4"><!></div></div>`);function W(n,u){r(u,!0);function W(e){return`/wiki/${e.id===`~`?`%7E`:e.id}`}function G(e){P=e.id,S(W(e))}async function K(){await A()}y(()=>{A()}),y(()=>()=>k()),y(()=>{let e=P;e&&(P=null,document.querySelector(`button[data-scope-id="${CSS.escape(e)}"]`)?.focus())});var q=U(),J=v(q),Y=h(v(J),2),X=v(Y);w(X,{variant:`ghost`,size:`icon`,class:`h-9 w-9`,title:`Refresh wiki scopes`,"aria-label":`Refresh wiki scopes`,get disabled(){return j.loading},onclick:()=>void K(),children:(e,t)=>{var n=x(),r=b(n),i=e=>{T(e,{class:`h-4 w-4 animate-spin`})},a=e=>{D(e,{class:`h-4 w-4`})};o(r,e=>{j.loading?e(i):e(a,-1)}),s(e,n)},$$slots:{default:!0}}),t(Y),t(J);var Z=h(J,2),Q=v(Z),$=e=>{var n=F(),r=v(n);O(r,{class:`mt-0.5 h-4 w-4 shrink-0 text-destructive`});var a=h(r,2),o=h(v(a),2),c=f(o,!0);t(a);var u=h(a,2);w(u,{variant:`outline`,size:`sm`,onclick:()=>void K(),children:(e,t)=>{m();var n=l(`Retry`);s(e,n)},$$slots:{default:!0}}),t(n),_(()=>i(c,j.error)),s(e,n)},ee=e=>{var t=I();s(e,t)},te=e=>{var n=L(),r=v(n);C(r,{class:`mx-auto h-8 w-8 text-muted-foreground`}),m(4),t(n),s(e,n)},ne=n=>{var r=H(),c=b(r),u=e=>{var n=R(),r=v(n);T(r,{class:`h-3.5 w-3.5 animate-spin`}),m(),t(n),s(e,n)};o(c,e=>{j.loading&&e(u)});var y=h(c,2);e(y,21,()=>j.scopes,e=>e.id,(e,n)=>{var r=V(),c=v(r),u=v(c),y=e=>{E(e,{class:`h-4 w-4 shrink-0 text-primary`})},b=e=>{N(e,{class:`h-4 w-4 shrink-0 text-muted-foreground`})};o(u,e=>{d(n).id===`~`?e(y):e(b,-1)});var x=h(u,2),S=v(x),C=v(S),w=f(C,!0),T=h(C,2),D=e=>{M(e,{variant:`secondary`,class:`shrink-0 text-xs`,children:(e,t)=>{m();var n=l(`~ global`);s(e,n)},$$slots:{default:!0}})};o(T,e=>{d(n).id===`~`&&e(D)}),t(S);var O=h(S,2),k=e=>{var r=z(),a=v(r),c=h(a),u=e=>{var t=l();_(e=>i(t,`· updated ${e??``}`),[()=>d(n).lastUpdated.slice(0,10)]),s(e,t)};o(c,e=>{d(n).lastUpdated&&e(u)}),t(r),_(()=>i(a,`${d(n).patternCount??``}
|
|
2
2
|
${d(n).patternCount===1?`fragment`:`fragments`} captured`)),s(e,r)},A=e=>{var t=B();s(e,t)};o(O,e=>{d(n).exists?e(k):e(A,-1)}),t(x);var j=h(x,2);{let e=p(()=>d(n).exists?`secondary`:`outline`);M(j,{get variant(){return d(e)},class:`shrink-0 tabular-nums`,children:(e,t)=>{m();var r=l();_(()=>i(r,d(n).patternCount)),s(e,r)},$$slots:{default:!0}})}t(c),t(r),_(()=>{g(c,`data-scope-id`,d(n).id),i(w,d(n).label)}),a(`click`,c,()=>G(d(n))),s(e,r)}),t(y),s(n,r)};o(Q,e=>{j.error?e($):j.loading&&j.scopes.length===0?e(ee,1):j.scopes.length===0?e(te,2):e(ne,-1)}),t(Z),t(q),s(n,q),c()}u([`click`]);export{W as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e,At as t,B as n,Ct as r,D as i,F as a,G as o,N as s,R as c,St as l,W as u,X as d,ct as f,gt as p,kt as m,lt as h,nt as g,o as _,ot as v,s as y,st as b,z as x}from"./CmCJ0SKP.js";import{t as S}from"./
|
|
1
|
+
import{A as e,At as t,B as n,Ct as r,D as i,F as a,G as o,N as s,R as c,St as l,W as u,X as d,ct as f,gt as p,kt as m,lt as h,nt as g,o as _,ot as v,s as y,st as b,z as x}from"./CmCJ0SKP.js";import{t as S}from"./DjZ7hdjX.js";import"./xihTtKlq.js";import"./eFUKcYMv.js";import{t as C}from"./BkEnd9_Z.js";import"./B8aGNSaH.js";import{o as w}from"./BTMBuftG.js";import{t as T}from"./DApmS1g_.js";import{t as E}from"./HopcQwhZ.js";import{n as D,t as O}from"./BYNWtKcf.js";var k=new Set([`$$slots`,`$$events`,`$$legacy`]);function A(e,t){let n=_(t,k),r=[[`path`,{d:`m16 18 6-6-6-6`}],[`path`,{d:`m8 6-6 6 6 6`}]];C(e,y({name:`code`},()=>n,{get iconNode(){return r}}))}var j=new Set([`$$slots`,`$$events`,`$$legacy`]);function M(e,t){let n=_(t,j),r=[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`}]];C(e,y({name:`pen`},()=>n,{get iconNode(){return r}}))}var N=new Set([`$$slots`,`$$events`,`$$legacy`]);function P(e,t){let n=_(t,N),r=[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`}]];C(e,y({name:`database`},()=>n,{get iconNode(){return r}}))}var F=new Set([`$$slots`,`$$events`,`$$legacy`]);function I(e,t){let n=_(t,F),r=[[`path`,{d:`M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`}]];C(e,y({name:`palette`},()=>n,{get iconNode(){return r}}))}var L=new Set([`$$slots`,`$$events`,`$$legacy`]);function R(e,t){let n=_(t,L),r=[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`}]];C(e,y({name:`server`},()=>n,{get iconNode(){return r}}))}var z=new Set([`$$slots`,`$$events`,`$$legacy`]);function B(e,t){let n=_(t,z),r=[[`path`,{d:`M12 3v18`}],[`path`,{d:`m19 8 3 8a5 5 0 0 1-6 0zV7`}],[`path`,{d:`M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1`}],[`path`,{d:`m5 8 3 8a5 5 0 0 1-6 0zV7`}],[`path`,{d:`M7 21h10`}]];C(e,y({name:`scale`},()=>n,{get iconNode(){return r}}))}var V=new Set([`$$slots`,`$$events`,`$$legacy`]);function H(e,t){let n=_(t,V),r=[[`path`,{d:`M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z`}],[`path`,{d:`m3.3 7 8.7 5 8.7-5`}],[`path`,{d:`M12 22V12`}]];C(e,y({name:`box`},()=>n,{get iconNode(){return r}}))}var U=n(`<button class="rounded-lg border border-border p-3 text-left transition-colors hover:bg-muted/50"><div class="text-sm font-medium"> </div> <p class="mt-1 text-xs text-muted-foreground line-clamp-2"> </p></button>`),W=n(`<section><div class="mb-2 flex items-center gap-2"><!> <h2 class="text-sm font-medium"> </h2></div> <div class="grid grid-cols-1 gap-2 sm:grid-cols-2 lg:grid-cols-3"></div></section>`),G=n(`<div class="flex h-full flex-col overflow-y-auto"><header class="shrink-0 border-b border-border px-5 py-4"><h1 class="text-lg font-semibold">Creator</h1> <p class="mt-0.5 text-xs text-muted-foreground">Write skills with AI assistance, test them in context, and iterate.</p></header> <div class="mx-auto w-full max-w-4xl space-y-6 p-5"><div class="flex gap-3"><button class="flex items-center gap-2 rounded-lg border border-border px-4 py-2 text-sm font-medium transition-colors hover:bg-muted/50"><!> New skill</button> <button class="flex items-center gap-2 rounded-lg border border-border px-4 py-2 text-sm font-medium transition-colors hover:bg-muted/50"><!> Open existing</button></div> <div class="space-y-5"></div></div></div>`);function K(n,u){r(u,!0);let _={coding:A,writing:M,data:P,design:I,devops:R,legal:B,general:H},y=p(()=>Object.entries(D).map(([e,t])=>({category:e,label:t.label,icon:_[e]??H,templates:O.filter(t=>t.category===e)}))),C=p(w);function k(e){let t=d(C)[0];if(!t){S(`/workspaces`);return}S(`/creator/new/${t.target.workspaceId}/${t.target.providerId}?template=${e}`)}function j(){let e=d(C)[0];if(!e){S(`/workspaces`);return}S(`/creator/new/${e.target.workspaceId}/${e.target.providerId}`)}var N=G(),F=h(v(N),2),L=v(F),z=v(L),V=v(z);E(V,{class:`h-4 w-4`}),m(),t(z);var K=h(z,2),q=v(K);T(q,{class:`h-4 w-4`}),m(),t(K),t(L);var J=h(L,2);e(J,21,()=>d(y),e=>e.category,(n,r)=>{var l=x(),u=b(l),p=n=>{var s=W(),l=v(s),u=v(l);i(u,()=>d(r).icon,(e,t)=>{t(e,{class:`h-4 w-4 text-muted-foreground`})});var p=h(u,2),m=f(p,!0);t(l);var _=h(l,2);e(_,21,()=>d(r).templates,e=>e.id,(e,n)=>{var r=U(),i=v(r),s=f(i,!0),l=h(i,2),u=f(l,!0);t(r),g(()=>{a(s,d(n).name),a(u,d(n).description)}),o(`click`,r,()=>k(d(n).id)),c(e,r)}),t(_),t(s),g(()=>a(m,d(r).label)),c(n,s)};s(u,e=>{d(r).templates.length>0&&e(p)}),c(n,l)}),t(J),t(F),t(N),o(`click`,z,j),o(`click`,K,()=>void S(`/workspaces`)),c(n,N),l()}u([`click`]);export{K as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{At as e,B as t,Ct as n,F as r,N as i,R as a,St as o,U as s,X as c,_t as l,a as u,ct as d,d as f,f as p,ft as m,gt as h,kt as g,l as _,lt as v,mt as y,nt as b,o as x,ot as S}from"./CmCJ0SKP.js";import"./xihTtKlq.js";import{s as C}from"./
|
|
1
|
+
import{At as e,B as t,Ct as n,F as r,N as i,R as a,St as o,U as s,X as c,_t as l,a as u,ct as d,d as f,f as p,ft as m,gt as h,kt as g,l as _,lt as v,mt as y,nt as b,o as x,ot as S}from"./CmCJ0SKP.js";import"./xihTtKlq.js";import{s as C}from"./pd7EK5wP.js";import{n as w}from"./1aUphu7Y.js";import{i as T,n as E}from"./DnPeA-9c.js";var D=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`value`,`class`,`data-slot`]),O=t(`<textarea></textarea>`);function k(e,t){n(t,!0);let r=u(t,`ref`,15,null),i=u(t,`value`,15),s=u(t,`data-slot`,3,`textarea`),c=x(t,D);var d=O();l(d),p(d,e=>({"data-slot":s(),class:e,...c}),[()=>T(`border-input bg-input/20 dark:bg-input/30 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 resize-none rounded-md border px-2 py-2 text-sm transition-colors focus-visible:ring-2 aria-invalid:ring-2 md:text-xs/relaxed placeholder:text-muted-foreground flex field-sizing-content min-h-16 w-full outline-none disabled:cursor-not-allowed disabled:opacity-50`,t.class)]),_(d,e=>r(e),()=>r()),f(d,i),a(e,d),o()}var A=t(`<div class="mt-2 flex justify-end gap-1.5"><!> <!></div>`),j=t(`<div class="rounded-lg border border-amber-500/40 bg-amber-500/5 px-3 py-2.5 text-xs" role="group" aria-label="Mutation proposal"><div class="mb-1.5 flex items-center gap-1.5 font-medium text-amber-600 dark:text-amber-400"> </div> <div class="font-mono text-[11px]"> </div> <pre class="mt-1 max-h-32 overflow-auto rounded bg-muted/40 p-1.5 font-mono text-[10px] whitespace-pre-wrap"> </pre> <!></div>`);function M(t,l){n(l,!0);let u=y(!1),f=y(null),p=h(()=>c(f)??l.status),_=h(()=>{try{return JSON.stringify(l.input,null,2)}catch{return String(l.input)}});async function x(e){m(u,!0);try{let t=C(),n=e===`approve`?await t.agent.proposals.approve({proposalId:l.proposalId}):await t.agent.proposals.reject({proposalId:l.proposalId});m(f,n.proposal.status,!0),w(e===`approve`?c(p)===`executed`?`Proposal executed: ${l.capability}`:`Proposal failed: ${l.capability}`:`Proposal rejected: ${l.capability}`)}catch(e){w(e instanceof Error?e.message:String(e))}finally{m(u,!1)}}var T=j(),D=S(T),O=d(D),k=v(D,2),M=d(k,!0),N=v(k,2),P=d(N,!0),F=v(N,2),I=t=>{var n=A(),r=S(n);E(r,{size:`sm`,variant:`outline`,get disabled(){return c(u)},onclick:()=>void x(`reject`),children:(e,t)=>{g();var n=s(`Reject`);a(e,n)},$$slots:{default:!0}});var i=v(r,2);E(i,{size:`sm`,get disabled(){return c(u)},onclick:()=>void x(`approve`),children:(e,t)=>{g();var n=s(`Approve`);a(e,n)},$$slots:{default:!0}}),e(n),a(t,n)};i(F,e=>{c(p)===`pending`&&e(I)}),e(T),b(()=>{r(O,`Proposal — ${c(p)??``}`),r(M,l.capability),r(P,c(_))}),a(t,T),o()}export{k as n,M as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{X as e,ft as t,mt as n,o as r,s as i,ut as a}from"./CmCJ0SKP.js";import"./xihTtKlq.js";import{t as o}from"./BkEnd9_Z.js";import{n as s,r as c,s as l}from"./DF_TIB7n.js";var u=[`general`,`model`,`agent`,`sessions`];function d(e=`general`){l(`settings.section`,{section:e})}var f=n(a(h())),p=n(a(s().sidebarCollapsed)),m=null;function h(){return typeof document>`u`?`system`:s().theme}function g(){return m?.matches??!1}function _(){if(typeof document>`u`)return;let t=e(f)===`dark`||e(f)===`system`&&g();document.documentElement.classList.toggle(`dark`,t)}function v(){typeof matchMedia>`u`||m!==null||(m=matchMedia(`(prefers-color-scheme: dark)`),m.addEventListener(`change`,()=>{e(f)===`system`&&_()}))}v(),_();function y(){return e(f)}function b(){return e(p)}function x(e){t(f,e,!0),c({theme:e}),_()}function S(){t(p,!e(p)),c({sidebarCollapsed:e(p)})}var C=new Set([`$$slots`,`$$events`,`$$legacy`]);function w(e,t){let n=r(t,C),a=[[`path`,{d:`M12 8V4H8`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`}],[`path`,{d:`M2 14h2`}],[`path`,{d:`M20 14h2`}],[`path`,{d:`M15 13v2`}],[`path`,{d:`M9 13v2`}]];o(e,i({name:`bot`},()=>n,{get iconNode(){return a}}))}function T(e){let t=0;for(let n of e)t=(t*31+n.charCodeAt(0))%360;return t}function E(e){return`hsl(${T(e)} 55% 45%)`}var D=`sc-letter-avatar`;function O(e){return e.includes(D)}function k(e,t){return e.iconSuppressed===!0?null:e.icon??t?.icon??null}function A(e,t){return e.iconLetter!==void 0&&e.iconLetter.length>0?e.iconLetter:(t||e.provider).slice(0,1).toUpperCase()}function j(e){return e.iconColor??E(e.provider)}var M={svg:`image/svg+xml`,png:`image/png`,webp:`image/webp`};function N(e,t){let n=e.indexOf(`,`);return!e.startsWith(`data:`)||n<0?null:`data:${t};base64,${e.slice(n+1)}`}var P=new Set([`$$slots`,`$$events`,`$$legacy`]);function F(e,t){let n=r(t,P),a=[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`}],[`path`,{d:`m15 5 4 4`}]];o(e,i({name:`pencil`},()=>n,{get iconNode(){return a}}))}export{O as a,A as c,b as d,y as f,d as g,u as h,E as i,N as l,S as m,M as n,k as o,x as p,T as r,j as s,F as t,w as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ut as e}from"./CmCJ0SKP.js";import{a as t,o as n,s as r,t as i}from"./
|
|
1
|
+
import{ut as e}from"./CmCJ0SKP.js";import{a as t,o as n,s as r,t as i}from"./pd7EK5wP.js";var a=i(t),o=i(t),s=i(t),c=e({scope:`~`,patterns:[],loading:!1,error:null});async function l(e){let t=a.issue(),r=n();if(!r)return t.isLatest()&&(c.loading=!1),c.error=`The Skill Creator daemon is not connected.`,`failed`;c.scope=e,c.loading=!0,c.error=null;try{let{patterns:n}=await r.wiki.list({scope:e});return t.isCurrent()?(c.patterns=n,`loaded`):`superseded`}catch(e){return t.isCurrent()?(c.error=e instanceof Error?e.message:String(e),`failed`):`superseded`}finally{t.isLatest()&&(c.loading=!1)}}async function u(e,t){let n=o.issue(),i;try{i=await r().wiki.append({scope:e,...t})}catch(e){if(!n.isCurrent())return null;throw e}return n.isCurrent()?(a.invalidate(),c.loading=!1,c.scope===e&&!i.deduplicated&&!c.patterns.some(e=>e.name===i.item.name)&&(c.patterns=[i.item,...c.patterns]),i):null}async function d(e,t){return r().wiki.read({scope:e,name:t})}var f=e({scopes:[],loading:!1,error:null});async function p(){let e=s.issue(),t=n();if(!t)return e.isLatest()&&(f.loading=!1),f.error=`The Skill Creator daemon is not connected.`,`failed`;f.loading=!0,f.error=null;try{let{scopes:n}=await t.wiki.scopes({});return e.isCurrent()?(f.scopes=n,`loaded`):`superseded`}catch(t){return e.isCurrent()?(f.error=t instanceof Error?t.message:String(t),`failed`):`superseded`}finally{e.isLatest()&&(f.loading=!1)}}function m(){a.invalidate(),o.invalidate(),c.scope=`~`,c.patterns=[],c.loading=!1,c.error=null}function h(){s.invalidate(),f.scopes=[],f.loading=!1,f.error=null}export{m as a,c,d as i,l as n,h as o,p as r,f as s,u as t};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{$ as e,At as t,B as n,C as r,Ct as i,D as a,H as o,I as s,L as c,M as l,N as u,O as d,P as f,Q as p,R as m,St as h,U as g,X as _,Y as v,a as y,bt as b,dt as x,et as ee,f as S,ft as C,gt as w,it as T,jt as E,kt as te,l as ne,lt as re,mt as D,o as O,ot as k,pt as ie,q as A,rt as j,s as M,st as N,tt as ae,ut as oe,wt as se,xt as ce,yt as le,z as P}from"./CmCJ0SKP.js";import"./xihTtKlq.js";import{i as F,n as ue}from"./DnPeA-9c.js";import{t as de}from"./BEPs9Z9s.js";function fe(e){return typeof e==`function`}function pe(e){return typeof e==`object`&&!!e}var me=[`string`,`number`,`bigint`,`boolean`];function he(e){return e==null||me.includes(typeof e)?!0:Array.isArray(e)?e.every(e=>he(e)):typeof e==`object`&&Object.getPrototypeOf(e)===Object.prototype}var I=Symbol(`box`),ge=Symbol(`is-writable`);function L(e,t){let n=w(e);return t?{[I]:!0,[ge]:!0,get current(){return _(n)},set current(e){t(e)}}:{[I]:!0,get current(){return e()}}}function _e(e){return pe(e)&&I in e}function ve(e){return _e(e)&&ge in e}function ye(e){return _e(e)?e:fe(e)?L(e):Se(e)}function be(e){return Object.entries(e).reduce((e,[t,n])=>_e(n)?(ve(n)?Object.defineProperty(e,t,{get(){return n.current},set(e){n.current=e}}):Object.defineProperty(e,t,{get(){return n.current}}),e):Object.assign(e,{[t]:n}),{})}function xe(e){return ve(e)?{[I]:!0,get current(){return e.current}}:e}function Se(e){let t=D(oe(e));return{[I]:!0,[ge]:!0,get current(){return _(t)},set current(e){C(t,e,!0)}}}function R(e){let t=D(oe(e));return{[I]:!0,[ge]:!0,get current(){return _(t)},set current(e){C(t,e,!0)}}}R.from=ye,R.with=L,R.flatten=be,R.readonly=xe,R.isBox=_e,R.isWritableBox=ve;function Ce(...e){return function(t){for(let n of e)if(n){if(t.defaultPrevented)return;typeof n==`function`?n.call(this,t):n.current?.call(this,t)}}}var we=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Te=/\n/g,Ee=/^\s*/,De=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Oe=/^:\s*/,ke=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Ae=/^[;\s]*/,je=/^\s+|\s+$/g,Me=`
|
|
2
|
+
`,Ne=`/`,Pe=`*`,z=``,Fe=`comment`,Ie=`declaration`;function Le(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var n=1,r=1;function i(e){var t=e.match(Te);t&&(n+=t.length);var i=e.lastIndexOf(Me);r=~i?e.length-i:r+e.length}function a(){var e={line:n,column:r};return function(t){return t.position=new o(e),l(),t}}function o(e){this.start=e,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function s(i){var a=Error(t.source+`:`+n+`:`+r+`: `+i);if(a.reason=i,a.filename=t.source,a.line=n,a.column=r,a.source=e,!t.silent)throw a}function c(t){var n=t.exec(e);if(n){var r=n[0];return i(r),e=e.slice(r.length),n}}function l(){c(Ee)}function u(e){var t;for(e||=[];t=d();)t!==!1&&e.push(t);return e}function d(){var t=a();if(Ne==e.charAt(0)&&Pe==e.charAt(1)){for(var n=2;z!=e.charAt(n)&&(Pe!=e.charAt(n)||Ne!=e.charAt(n+1));)++n;if(n+=2,z===e.charAt(n-1))return s(`End of comment missing`);var o=e.slice(2,n-2);return r+=2,i(o),e=e.slice(n),r+=2,t({type:Fe,comment:o})}}function f(){var e=a(),t=c(De);if(t){if(d(),!c(Oe))return s(`property missing ':'`);var n=c(ke),r=e({type:Ie,property:Re(t[0].replace(we,z)),value:n?Re(n[0].replace(we,z)):z});return c(Ae),r}}function p(){var e=[];u(e);for(var t;t=f();)t!==!1&&(e.push(t),u(e));return e}return l(),p()}function Re(e){return e?e.replace(je,z):z}function ze(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=Le(e),i=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:a}=e;i?t(r,a,e):a&&(n||={},n[r]=a)}),n}var Be=/\d/,Ve=[`-`,`_`,`/`,`.`];function He(e=``){if(!Be.test(e))return e!==e.toLowerCase()}function Ue(e){let t=[],n=``,r,i;for(let a of e){let e=Ve.includes(a);if(e===!0){t.push(n),n=``,r=void 0;continue}let o=He(a);if(i===!1){if(r===!1&&o===!0){t.push(n),n=a,r=o;continue}if(r===!0&&o===!1&&n.length>1){let e=n.at(-1);t.push(n.slice(0,Math.max(0,n.length-1))),n=e+a,r=o;continue}}n+=a,r=o,i=e}return t.push(n),t}function We(e){return e?Ue(e).map(e=>Ke(e)).join(``):``}function Ge(e){return qe(We(e||``))}function Ke(e){return e?e[0].toUpperCase()+e.slice(1):``}function qe(e){return e?e[0].toLowerCase()+e.slice(1):``}function Je(e){if(!e)return{};let t={};function n(e,n){if(e.startsWith(`-moz-`)||e.startsWith(`-webkit-`)||e.startsWith(`-ms-`)||e.startsWith(`-o-`)){t[We(e)]=n;return}if(e.startsWith(`--`)){t[e]=n;return}t[Ge(e)]=n}return ze(e,n),t}function B(...e){return(...t)=>{for(let n of e)typeof n==`function`&&n(...t)}}function Ye(e,t){let n=RegExp(e,`g`);return e=>{if(typeof e!=`string`)throw TypeError(`expected an argument of type string, but got ${typeof e}`);return e.match(n)?e.replace(n,t):e}}var Xe=Ye(/[A-Z]/,e=>`-${e.toLowerCase()}`);function Ze(e){if(!e||typeof e!=`object`||Array.isArray(e))throw TypeError(`expected an argument of type object, but got ${typeof e}`);return Object.keys(e).map(t=>`${Xe(t)}: ${e[t]};`).join(`
|
|
3
|
+
`)}function Qe(e={}){return Ze(e).replace(`
|
|
4
|
+
`,` `)}var $e=new Set(`onabort.onanimationcancel.onanimationend.onanimationiteration.onanimationstart.onauxclick.onbeforeinput.onbeforetoggle.onblur.oncancel.oncanplay.oncanplaythrough.onchange.onclick.onclose.oncompositionend.oncompositionstart.oncompositionupdate.oncontextlost.oncontextmenu.oncontextrestored.oncopy.oncuechange.oncut.ondblclick.ondrag.ondragend.ondragenter.ondragleave.ondragover.ondragstart.ondrop.ondurationchange.onemptied.onended.onerror.onfocus.onfocusin.onfocusout.onformdata.ongotpointercapture.oninput.oninvalid.onkeydown.onkeypress.onkeyup.onload.onloadeddata.onloadedmetadata.onloadstart.onlostpointercapture.onmousedown.onmouseenter.onmouseleave.onmousemove.onmouseout.onmouseover.onmouseup.onpaste.onpause.onplay.onplaying.onpointercancel.onpointerdown.onpointerenter.onpointerleave.onpointermove.onpointerout.onpointerover.onpointerup.onprogress.onratechange.onreset.onresize.onscroll.onscrollend.onsecuritypolicyviolation.onseeked.onseeking.onselect.onselectionchange.onselectstart.onslotchange.onstalled.onsubmit.onsuspend.ontimeupdate.ontoggle.ontouchcancel.ontouchend.ontouchmove.ontouchstart.ontransitioncancel.ontransitionend.ontransitionrun.ontransitionstart.onvolumechange.onwaiting.onwebkitanimationend.onwebkitanimationiteration.onwebkitanimationstart.onwebkittransitionend.onwheel`.split(`.`));function et(e){return $e.has(e)}function V(...e){let t={...e[0]};for(let n=1;n<e.length;n++){let i=e[n];if(i){for(let e of Object.keys(i)){let n=t[e],a=i[e],o=typeof n==`function`,s=typeof a==`function`;if(o&&typeof s&&et(e))t[e]=Ce(n,a);else if(o&&s)t[e]=B(n,a);else if(e===`class`){let i=he(n),o=he(a);i&&o?t[e]=r(n,a):i?t[e]=r(n):o&&(t[e]=r(a))}else if(e===`style`){let r=typeof n==`object`,i=typeof a==`object`,o=typeof n==`string`,s=typeof a==`string`;if(r&&i)t[e]={...n,...a};else if(r&&s){let r=Je(a);t[e]={...n,...r}}else if(o&&i)t[e]={...Je(n),...a};else if(o&&s){let r=Je(n),i=Je(a);t[e]={...r,...i}}else r?t[e]=n:i?t[e]=a:o?t[e]=n:s&&(t[e]=a)}else t[e]=a===void 0?n:a}for(let e of Object.getOwnPropertySymbols(i)){let n=t[e],r=i[e];t[e]=r===void 0?n:r}}}return typeof t.style==`object`&&(t.style=Qe(t.style).replaceAll(`
|
|
5
|
+
`,` `)),t.hidden===!1&&(t.hidden=void 0,delete t.hidden),t.disabled===!1&&(t.disabled=void 0,delete t.disabled),t}var tt=typeof window<`u`?window:void 0;typeof window<`u`&&window.document,typeof window<`u`&&window.navigator,typeof window<`u`&&window.location;function nt(e){let t=e.activeElement;for(;t?.shadowRoot;){let e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}var rt=class extends Map{#e=new Map;#t=D(0);#n=D(0);#r=ee||-1;constructor(e){if(super(),e){for(var[t,n]of e)super.set(t,n);this.#n.v=super.size}}#i(e){return ee===this.#r?D(e):ie(e)}has(e){var t=this.#e,n=t.get(e);if(n===void 0){if(super.has(e))n=this.#i(0),t.set(e,n);else return _(this.#t),!1}return _(n),!0}forEach(e,t){this.#a(),super.forEach(e,t)}get(e){var t=this.#e,n=t.get(e);if(n===void 0){if(super.has(e))n=this.#i(0),t.set(e,n);else{_(this.#t);return}}return _(n),super.get(e)}getOrInsert(e,t){return super.has(e)||this.set(e,t),this.get(e)}getOrInsertComputed(e,t){return super.has(e)||this.set(e,t(e)),this.get(e)}set(e,t){var n=this.#e,r=n.get(e),i=super.get(e),a=super.set(e,t),o=this.#t;if(r===void 0)r=this.#i(0),n.set(e,r),C(this.#n,super.size),x(o);else if(i!==t){x(r);var s=o.reactions===null?null:new Set(o.reactions);(s===null||!r.reactions?.every(e=>s.has(e)))&&x(o)}return a}delete(e){var t=this.#e,n=t.get(e),r=super.delete(e);return n!==void 0&&(t.delete(e),C(n,-1)),r&&(C(this.#n,super.size),x(this.#t)),r}clear(){if(super.size!==0){super.clear();var e=this.#e;C(this.#n,0);for(var t of e.values())C(t,-1);x(this.#t),e.clear()}}#a(){_(this.#t);var e=this.#e;if(this.#n.v!==e.size){for(var t of super.keys())if(!e.has(t)){var n=this.#i(0);e.set(t,n)}}for([,n]of this.#e)_(n)}keys(){return _(this.#t),super.keys()}values(){return this.#a(),super.values()}entries(){return this.#a(),super.entries()}[Symbol.iterator](){return this.entries()}get size(){return _(this.#n),super.size}};new class{#e;#t;constructor(e={}){let{window:t=tt,document:n=t?.document}=e;t!==void 0&&(this.#e=n,this.#t=c(e=>{let n=A(t,`focusin`,e),r=A(t,`focusout`,e);return()=>{n(),r()}}))}get current(){return this.#t?.(),this.#e?nt(this.#e):null}};function it(e){return typeof e==`function`}var H=class{#e;#t;constructor(e){this.#e=e,this.#t=Symbol(e)}get key(){return this.#t}exists(){return ce(this.#t)}get(){let e=b(this.#t);if(e===void 0)throw Error(`Context "${this.#e}" not found`);return e}getOr(e){let t=b(this.#t);return t===void 0?e:t}set(e){return se(this.#t,e)}};function at(e,t){switch(e){case`post`:j(t);break;case`pre`:T(t)}}function ot(t,n,r,i={}){let{lazy:a=!1}=i,o=!a,s=Array.isArray(t)?[]:void 0;at(n,()=>{let n=Array.isArray(t)?t.map(e=>e()):t();if(!o){o=!0,s=n;return}let i=e(()=>r(n,s));return s=n,i})}function U(e,t,n){ot(e,`post`,t,n)}function st(e,t,n){ot(e,`pre`,t,n)}U.pre=st;function ct(e){return it(e)?e():e}var lt=class{#e={width:0,height:0};#t=!1;#n;#r;#i;#a=w(()=>(_(this.#s)?.(),this.getSize().width));#o=w(()=>(_(this.#s)?.(),this.getSize().height));#s=w(()=>{let e=ct(this.#r);if(e)return c(t=>{if(!this.#i)return;let n=new this.#i.ResizeObserver(e=>{this.#t=!0;for(let t of e){let e=this.#n.box===`content-box`?t.contentBoxSize:t.borderBoxSize,n=Array.isArray(e)?e:[e];this.#e.width=n.reduce((e,t)=>Math.max(e,t.inlineSize),0),this.#e.height=n.reduce((e,t)=>Math.max(e,t.blockSize),0)}t()});return n.observe(e),()=>{this.#t=!1,n.disconnect()}})});constructor(e,t={box:`border-box`}){this.#i=t.window??tt,this.#n=t,this.#r=e,this.#e={width:0,height:0}}calculateSize(){let e=ct(this.#r);if(!e||!this.#i)return;let t=e.offsetWidth,n=e.offsetHeight;if(this.#n.box===`border-box`)return{width:t,height:n};let r=this.#i.getComputedStyle(e),i=parseFloat(r.paddingLeft)+parseFloat(r.paddingRight),a=parseFloat(r.paddingTop)+parseFloat(r.paddingBottom),o=parseFloat(r.borderLeftWidth)+parseFloat(r.borderRightWidth),s=parseFloat(r.borderTopWidth)+parseFloat(r.borderBottomWidth);return{width:t-i-o,height:n-a-s}}getSize(){return this.#t?this.#e:this.calculateSize()??this.#e}get current(){return _(this.#s)?.(),this.getSize()}get width(){return _(this.#a)}get height(){return _(this.#o)}};function W(e){j(()=>()=>{e()})}function ut(e,t){return setTimeout(t,e)}function G(e){p().then(e)}var dt=1,ft=9,pt=11;function mt(e){return pe(e)&&e.nodeType===dt&&typeof e.nodeName==`string`}function ht(e){return pe(e)&&e.nodeType===ft}function gt(e){return pe(e)&&e.constructor?.name===`VisualViewport`}function _t(e){return pe(e)&&e.nodeType!==void 0}function vt(e){return _t(e)&&e.nodeType===pt&&`host`in e}function yt(e,t){if(!e||!t||!mt(e)||!mt(t))return!1;let n=t.getRootNode?.();if(e===t||e.contains(t))return!0;if(n&&vt(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function bt(e){return ht(e)?e:gt(e)?e.document:e?.ownerDocument??document}function xt(e){return vt(e)?xt(e.host):ht(e)?e.defaultView??window:mt(e)?e.ownerDocument?.defaultView??window:window}function St(e){let t=e.activeElement;for(;t?.shadowRoot;){let e=t.shadowRoot.activeElement;if(e===t)break;t=e}return t}var Ct=class{element;#e=w(()=>this.element.current?this.element.current.getRootNode()??document:document);get root(){return _(this.#e)}set root(e){C(this.#e,e)}constructor(e){this.element=typeof e==`function`?L(e):e}getDocument=()=>bt(this.root);getWindow=()=>this.getDocument().defaultView??window;getActiveElement=()=>St(this.root);isActiveElement=e=>e===this.getActiveElement();getElementById(e){return this.root.getElementById(e)}querySelector=e=>this.root?this.root.querySelector(e):null;querySelectorAll=e=>this.root?this.root.querySelectorAll(e):[];setTimeout=(e,t)=>this.getWindow().setTimeout(e,t);clearTimeout=e=>this.getWindow().clearTimeout(e)};function K(t,n){return{[v()]:r=>_e(t)?(t.current=r,e(()=>n?.(r)),()=>{`isConnected`in r&&r.isConnected||(t.current=null,n?.(null))}):(t(r),e(()=>n?.(r)),()=>{`isConnected`in r&&r.isConnected||(t(null),n?.(null))})}}function wt(e){return e?`true`:`false`}function q(e){return e?``:void 0}function Tt(e){return e?!0:void 0}function Et(e){return e?`open`:`closed`}function Dt(e){return e?`checked`:`unchecked`}function Ot(e){return e===`starting`?{"data-starting-style":``}:e===`ending`?{"data-ending-style":``}:{}}function kt(e,t){return t?`mixed`:e?`true`:`false`}var At=class{#e;#t;attrs;constructor(e){this.#e=e.getVariant?e.getVariant():null,this.#t=this.#e?`data-${this.#e}-`:`data-${e.component}-`,this.getAttr=this.getAttr.bind(this),this.selector=this.selector.bind(this),this.attrs=Object.fromEntries(e.parts.map(e=>[e,this.getAttr(e)]))}getAttr(e,t){return t?`data-${t}-${e}`:`${this.#t}${e}`}selector(e,t){return`[${this.getAttr(e,t)}]`}};function jt(e){let t=new At(e);return{...t.attrs,selector:t.selector,getAttr:t.getAttr}}var Mt=`ArrowDown`,Nt=`ArrowLeft`,Pt=`ArrowRight`,Ft=`ArrowUp`,It=`Enter`,Lt=`Home`,Rt=`PageDown`,zt=`PageUp`;function Bt(e){return window.getComputedStyle(e).getPropertyValue(`direction`)}var Vt=[Mt,zt,Lt],Ht=[Ft,Rt,`End`];[...Vt,...Ht];function Ut(e=`ltr`,t=`horizontal`){return{horizontal:e===`rtl`?Nt:Pt,vertical:Mt}[t]}function Wt(e=`ltr`,t=`horizontal`){return{horizontal:e===`rtl`?Pt:Nt,vertical:Ft}[t]}function Gt(e=`ltr`,t=`horizontal`){return[`ltr`,`rtl`].includes(e)||(e=`ltr`),[`horizontal`,`vertical`].includes(t)||(t=`horizontal`),{nextKey:Ut(e,t),prevKey:Wt(e,t)}}var Kt=typeof document<`u`,qt=Jt();function Jt(){return Kt&&window?.navigator?.userAgent&&(/iP(ad|hone|od)/.test(window.navigator.userAgent)||window?.navigator?.maxTouchPoints>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function J(e){return e instanceof HTMLElement}function Yt(e){return e instanceof Element}function Xt(e){return e instanceof Element||e instanceof SVGElement}function Zt(e){return e!==null}function Qt(e){return e instanceof HTMLInputElement&&`select`in e}var $t=class{#e;#t=R(null);constructor(e){this.#e=e}getCandidateNodes(){return this.#e.rootNode.current?this.#e.candidateSelector?Array.from(this.#e.rootNode.current.querySelectorAll(this.#e.candidateSelector)):this.#e.candidateAttr?Array.from(this.#e.rootNode.current.querySelectorAll(`[${this.#e.candidateAttr}]:not([data-disabled])`)):[]:[]}focusFirstCandidate(){let e=this.getCandidateNodes();e.length&&e[0]?.focus()}handleKeydown(e,t,n=!1){let r=this.#e.rootNode.current;if(!r||!e)return;let i=this.getCandidateNodes();if(!i.length)return;let a=i.indexOf(e),{nextKey:o,prevKey:s}=Gt(Bt(r),this.#e.orientation.current),c=this.#e.loop.current,l={[o]:a+1,[s]:a-1,[Lt]:0,End:i.length-1};if(n){let e=o===`ArrowDown`?Pt:Mt,t=s===`ArrowUp`?Nt:Ft;l[e]=a+1,l[t]=a-1}let u=l[t.key];if(u===void 0)return;t.preventDefault(),u<0&&c?u=i.length-1:u===i.length&&c&&(u=0);let d=i[u];if(d)return d.focus(),this.#t.current=d.id,this.#e.onCandidateFocus?.(d),d}getTabIndex(e){let t=this.getCandidateNodes(),n=this.#t.current!==null;return e&&!n&&t[0]===e?(this.#t.current=e.id,0):e?.id===this.#t.current?0:-1}setCurrentTabStopId(e){this.#t.current=e}focusCurrentTabStop(){let e=this.#t.current;if(!e)return;let t=this.#e.rootNode.current?.querySelector(`#${e}`);t&&J(t)&&t.focus()}},en=class{#e;#t=null;#n=null;#r=0;constructor(e){this.#e=e,W(()=>this.#i())}#i(){this.#t!==null&&(window.cancelAnimationFrame(this.#t),this.#t=null),this.#n?.disconnect(),this.#n=null,this.#r++}run(e){this.#i();let t=this.#e.ref.current;if(!t)return;if(typeof t.getAnimations!=`function`){this.#a(e);return}let n=this.#r,r=()=>{n===this.#r&&this.#a(e)},i=()=>{if(n!==this.#r)return;let e=t.getAnimations();if(e.length===0){r();return}Promise.all(e.map(e=>e.finished)).then(()=>{r()}).catch(()=>{if(n===this.#r){if(t.getAnimations().some(e=>e.pending||e.playState!==`finished`)){i();return}r()}})},a=()=>{this.#t=window.requestAnimationFrame(()=>{this.#t=null,i()})};if(!this.#e.afterTick.current){a();return}this.#t=window.requestAnimationFrame(()=>{this.#t=null;let e=`data-starting-style`;if(!t.hasAttribute(e)){a();return}this.#n=new MutationObserver(()=>{n===this.#r&&(t.hasAttribute(e)||(this.#n?.disconnect(),this.#n=null,a()))}),this.#n.observe(t,{attributes:!0,attributeFilter:[e]})})}#a(e){let t=()=>{e()};this.#e.afterTick?G(t):t()}},tn=class{#e;#t;#n;#r=D(!1);#i=D(void 0);#a=!1;#o=null;constructor(e){this.#e=e,C(this.#r,e.open.current,!0),this.#t=e.enabled??!0,this.#n=new en({ref:this.#e.ref,afterTick:this.#e.open}),W(()=>this.#s()),U(()=>this.#e.open.current,e=>{if(!this.#a){this.#a=!0;return}if(this.#s(),!e&&this.#e.shouldSkipExitAnimation?.()){C(this.#r,!1),C(this.#i,void 0),this.#e.onComplete?.();return}if(e&&C(this.#r,!0),C(this.#i,e?`starting`:`ending`,!0),e&&(this.#o=window.requestAnimationFrame(()=>{this.#o=null,this.#e.open.current&&C(this.#i,void 0)})),!this.#t){e||C(this.#r,!1),C(this.#i,void 0),this.#e.onComplete?.();return}this.#n.run(()=>{e===this.#e.open.current&&(this.#e.open.current||C(this.#r,!1),C(this.#i,void 0),this.#e.onComplete?.())})})}get shouldRender(){return _(this.#r)}get transitionStatus(){return _(this.#i)}#s(){this.#o!==null&&(window.cancelAnimationFrame(this.#o),this.#o=null)}};function Y(){}function X(e,t){return t===void 0?`bits-${e}`:`bits-${e}-${t}`}var nn=jt({component:`dialog`,parts:[`content`,`trigger`,`overlay`,`title`,`description`,`close`,`cancel`,`action`]}),Z=new H(`Dialog.Root | AlertDialog.Root`),rn=class e{static create(t){let n=Z.getOr(null);return Z.set(new e(t,n))}opts;#e=D(null);get triggerNode(){return _(this.#e)}set triggerNode(e){C(this.#e,e,!0)}#t=D(null);get contentNode(){return _(this.#t)}set contentNode(e){C(this.#t,e,!0)}#n=D(null);get overlayNode(){return _(this.#n)}set overlayNode(e){C(this.#n,e,!0)}#r=D(null);get descriptionNode(){return _(this.#r)}set descriptionNode(e){C(this.#r,e,!0)}#i=D(void 0);get contentId(){return _(this.#i)}set contentId(e){C(this.#i,e,!0)}#a=D(void 0);get titleId(){return _(this.#a)}set titleId(e){C(this.#a,e,!0)}#o=D(void 0);get triggerId(){return _(this.#o)}set triggerId(e){C(this.#o,e,!0)}#s=D(void 0);get descriptionId(){return _(this.#s)}set descriptionId(e){C(this.#s,e,!0)}#c=D(null);get cancelNode(){return _(this.#c)}set cancelNode(e){C(this.#c,e,!0)}#l=D(0);get nestedOpenCount(){return _(this.#l)}set nestedOpenCount(e){C(this.#l,e,!0)}depth;parent;contentPresence;overlayPresence;constructor(e,t){this.opts=e,this.parent=t,this.depth=t?t.depth+1:0,this.handleOpen=this.handleOpen.bind(this),this.handleClose=this.handleClose.bind(this),this.contentPresence=new tn({ref:L(()=>this.contentNode),open:this.opts.open,enabled:!0,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)}}),this.overlayPresence=new tn({ref:L(()=>this.overlayNode),open:this.opts.open,enabled:!0}),U(()=>this.opts.open.current,e=>{this.parent&&(e?this.parent.incrementNested():this.parent.decrementNested())},{lazy:!0}),W(()=>{this.opts.open.current&&this.parent?.decrementNested()})}handleOpen(){this.opts.open.current||(this.opts.open.current=!0)}handleClose(){this.opts.open.current&&(this.opts.open.current=!1)}getBitsAttr=e=>nn.getAttr(e,this.opts.variant.current);incrementNested(){this.nestedOpenCount++,this.parent?.incrementNested()}decrementNested(){this.nestedOpenCount!==0&&(this.nestedOpenCount--,this.parent?.decrementNested())}#u=w(()=>({"data-state":Et(this.opts.open.current)}));get sharedProps(){return _(this.#u)}set sharedProps(e){C(this.#u,e)}},an=class e{static create(t){return new e(t,Z.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=K(this.opts.ref),this.onclick=this.onclick.bind(this),this.onkeydown=this.onkeydown.bind(this)}onclick(e){this.opts.disabled.current||e.button>0||this.root.handleClose()}onkeydown(e){this.opts.disabled.current||(e.key===` `||e.key===`Enter`)&&(e.preventDefault(),this.root.handleClose())}#e=w(()=>({id:this.opts.id.current,[this.root.getBitsAttr(this.opts.variant.current)]:``,onclick:this.onclick,onkeydown:this.onkeydown,disabled:this.opts.disabled.current?!0:void 0,tabindex:0,...this.root.sharedProps,...this.attachment}));get props(){return _(this.#e)}set props(e){C(this.#e,e)}},on=class e{static create(t){return new e(t,Z.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.root.titleId=this.opts.id.current,this.attachment=K(this.opts.ref),U.pre(()=>this.opts.id.current,e=>{this.root.titleId=e})}#e=w(()=>({id:this.opts.id.current,role:`heading`,"aria-level":this.opts.level.current,[this.root.getBitsAttr(`title`)]:``,...this.root.sharedProps,...this.attachment}));get props(){return _(this.#e)}set props(e){C(this.#e,e)}},sn=class e{static create(t){return new e(t,Z.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.root.descriptionId=this.opts.id.current,this.attachment=K(this.opts.ref,e=>{this.root.descriptionNode=e}),U.pre(()=>this.opts.id.current,e=>{this.root.descriptionId=e})}#e=w(()=>({id:this.opts.id.current,[this.root.getBitsAttr(`description`)]:``,...this.root.sharedProps,...this.attachment}));get props(){return _(this.#e)}set props(e){C(this.#e,e)}},cn=class e{static create(t){return new e(t,Z.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=K(this.opts.ref,e=>{this.root.contentNode=e,this.root.contentId=e?.id})}#e=w(()=>({open:this.root.opts.open.current}));get snippetProps(){return _(this.#e)}set snippetProps(e){C(this.#e,e)}#t=w(()=>({id:this.opts.id.current,role:this.root.opts.variant.current===`alert-dialog`?`alertdialog`:`dialog`,"aria-modal":`true`,"aria-describedby":this.root.descriptionId,"aria-labelledby":this.root.titleId,[this.root.getBitsAttr(`content`)]:``,style:{pointerEvents:`auto`,outline:this.root.opts.variant.current===`alert-dialog`?`none`:void 0,"--bits-dialog-depth":this.root.depth,"--bits-dialog-nested-count":this.root.nestedOpenCount,contain:`layout style`},tabindex:this.root.opts.variant.current===`alert-dialog`?-1:void 0,"data-nested-open":q(this.root.nestedOpenCount>0),"data-nested":q(this.root.parent!==null),...Ot(this.root.contentPresence.transitionStatus),...this.root.sharedProps,...this.attachment}));get props(){return _(this.#t)}set props(e){C(this.#t,e)}get shouldRender(){return this.root.contentPresence.shouldRender}},ln=class e{static create(t){return new e(t,Z.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=K(this.opts.ref,e=>this.root.overlayNode=e)}#e=w(()=>({open:this.root.opts.open.current}));get snippetProps(){return _(this.#e)}set snippetProps(e){C(this.#e,e)}#t=w(()=>({id:this.opts.id.current,[this.root.getBitsAttr(`overlay`)]:``,style:{pointerEvents:`auto`,"--bits-dialog-depth":this.root.depth,"--bits-dialog-nested-count":this.root.nestedOpenCount},"data-nested-open":q(this.root.nestedOpenCount>0),"data-nested":q(this.root.parent!==null),...Ot(this.root.overlayPresence.transitionStatus),...this.root.sharedProps,...this.attachment}));get props(){return _(this.#t)}set props(e){C(this.#t,e)}get shouldRender(){return this.root.overlayPresence.shouldRender}},un=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`ref`,`child`,`children`,`level`]),dn=n(`<div><!></div>`);function fn(e,n){let r=o();i(n,!0);let a=y(n,`id`,19,()=>X(r)),s=y(n,`ref`,15,null),c=y(n,`level`,3,2),l=O(n,un),f=on.create({id:L(()=>a()),level:L(()=>c()),ref:L(()=>s(),e=>s(e))}),p=w(()=>V(l,f.props));var g=P(),v=N(g),b=e=>{var t=P(),r=N(t);d(r,()=>n.child,()=>({props:_(p)})),m(e,t)},x=e=>{var r=dn();S(r,()=>({..._(p)}));var i=k(r);d(i,()=>n.children??E),t(r),m(e,r)};u(v,e=>{n.child?e(b):e(x,-1)}),m(e,g),h()}function pn(e,t){var n=P(),r=N(n);l(r,()=>t.children,e=>{var n=P(),r=N(n);d(r,()=>t.children??E),m(e,n)}),m(e,n)}var mn=new H(`BitsConfig`);function hn(){let e=new gn(null,{});return mn.getOr(e).opts}var gn=class{opts;constructor(e,t){let n=_n(e,t);this.opts={defaultPortalTo:n(e=>e.defaultPortalTo),defaultLocale:n(e=>e.defaultLocale)}}};function _n(e,t){return n=>L(()=>{let r=n(t)?.current;if(r!==void 0)return r;if(e!==null)return n(e.opts)?.current})}function vn(e,t){return n=>{let r=hn();return L(()=>{let i=n();if(i!==void 0)return i;let a=e(r).current;return a===void 0?t:a})}}var yn=vn(e=>e.defaultPortalTo,`body`);function bn(e,t){i(t,!0);let n=yn(()=>t.to),r=le(),a=w(o);function o(){if(!Kt||t.disabled)return null;let e=null;return e=typeof n.current==`string`?document.querySelector(n.current):n.current,e}let c;function l(){c&&=(s(c),null)}U([()=>_(a),()=>t.disabled],([e,n])=>{if(!e||n){l();return}return c=f(pn,{target:e,props:{children:t.children},context:r}),()=>{l()}});var p=P(),g=N(p),v=e=>{var n=P(),r=N(n);d(r,()=>t.children??E),m(e,n)};u(g,e=>{t.disabled&&e(v)}),m(e,p),h()}var xn=class{eventName;options;constructor(e,t={bubbles:!0,cancelable:!0}){this.eventName=e,this.options=t}createEvent(e){return new CustomEvent(this.eventName,{...this.options,detail:e})}dispatch(e,t){let n=this.createEvent(t);return e.dispatchEvent(n),n}listen(e,t,n){return A(e,this.eventName,e=>{t(e)},n)}};function Sn(e,t=500){let n=null,r=(...r)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...r)},t)};return r.destroy=()=>{n!==null&&(clearTimeout(n),n=null)},r}function Cn(e,t){return e===t||e.contains(t)}function wn(e){return e?.ownerDocument??document}function Tn(e){if(!e)return null;for(let t of e.childNodes)if(t.nodeType!==Node.COMMENT_NODE)return t;return null}function En(e,t){let{clientX:n,clientY:r}=e,i=t.getBoundingClientRect();return n<i.left||n>i.right||r<i.top||r>i.bottom}var Dn=[It,` `],On=[Mt,zt,Lt],kn=[Ft,Rt,`End`],An=[...On,...kn];[...Dn],[...Dn];function Q(e){return e.pointerType===`mouse`}function jn(e,{select:t=!1}={}){if(!e||!e.focus)return;let n=bt(e);if(n.activeElement===e)return;let r=n.activeElement;e.focus({preventScroll:!0}),e!==r&&Qt(e)&&t&&e.select()}function Mn(e,{select:t=!1}={},n){let r=n();for(let i of e)if(jn(i,{select:t}),n()!==r)return!0}var Nn=D(!1),Pn=class e{static _refs=0;static _cleanup;constructor(){j(()=>(e._refs===0&&(e._cleanup=ae(()=>{let e=[],t=e=>{C(Nn,!1)};return e.push(A(document,`pointerdown`,t,{capture:!0}),A(document,`pointermove`,t,{capture:!0}),A(document,`keydown`,e=>{C(Nn,!0)},{capture:!0})),B(...e)})),e._refs++,()=>{e._refs--,e._refs===0&&(C(Nn,!1),e._cleanup?.())}))}get current(){return _(Nn)}set current(e){C(Nn,e,!0)}},Fn=[`input:not([inert]):not([inert] *)`,`select:not([inert]):not([inert] *)`,`textarea:not([inert]):not([inert] *)`,`a[href]:not([inert]):not([inert] *)`,`area[href]:not([inert]):not([inert] *)`,`button:not([inert]):not([inert] *)`,`[tabindex]:not(slot):not([inert]):not([inert] *)`,`audio[controls]:not([inert]):not([inert] *)`,`video[controls]:not([inert]):not([inert] *)`,`[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)`,`details>summary:first-of-type:not([inert]):not([inert] *)`,`details:not([inert]):not([inert] *)`],In=Fn.join(`,`),Ln=typeof Element>`u`,$=Ln?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Rn=!Ln&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},zn=function(e,t){t===void 0&&(t=!0);var n=e?.getAttribute?.call(e,`inert`);return n===``||n===`true`||t&&e&&(typeof e.closest==`function`?e.closest(`[inert]`):zn(e.parentNode))},Bn=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},Vn=function(e,t,n){if(zn(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(In));return t&&$.call(e,In)&&r.unshift(e),r=r.filter(n),r},Hn=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!zn(a,!1)){if(a.tagName===`SLOT`){var o=a.assignedElements(),s=Hn(o.length?o:a.children,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{$.call(a,In)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!zn(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=Hn(c===!0?a.children:c.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}}return r},Un=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},Wn=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||Bn(e))&&!Un(e)?0:e.tabIndex},Gn=function(e,t){var n=Wn(e);return n<0&&t&&!Un(e)?0:n},Kn=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},qn=function(e){return e.tagName===`INPUT`},Jn=function(e){return qn(e)&&e.type===`hidden`},Yn=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},Xn=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},Zn=function(e){if(!e.name)return!0;var t=e.form||Rn(e),n=function(e){return t.querySelectorAll(`input[type="radio"][name="`+e+`"]`)},r;if(typeof window<`u`&&window.CSS!==void 0&&typeof window.CSS.escape==`function`)r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(e){return console.error(`Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s`,e.message),!1}var i=Xn(r,e.form);return!i||i===e},Qn=function(e){return qn(e)&&e.type===`radio`},$n=function(e){return Qn(e)&&!Zn(e)},er=function(e){var t=e&&Rn(e),n=t?.host,r=!1;if(t&&t!==e){var i,a,o;for(r=!!((i=n)!=null&&(a=i.ownerDocument)!=null&&a.contains(n)||e!=null&&(o=e.ownerDocument)!=null&&o.contains(e));!r&&n;){var s,c;t=Rn(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},tr=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},nr=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(n===`full-native`&&`checkVisibility`in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});var i=getComputedStyle(e).visibility;if(i===`hidden`||i===`collapse`)return!0;var a=$.call(e,`details>summary:first-of-type`)?e.parentElement:e;if($.call(a,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`full-native`||n===`legacy-full`){if(typeof r==`function`){for(var o=e;e;){var s=e.parentElement,c=Rn(e);if(s&&!s.shadowRoot&&r(s)===!0)return tr(e);e=e.assignedSlot?e.assignedSlot:!s&&c!==e.ownerDocument?c.host:s}e=o}if(er(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return tr(e);return!1},rr=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName===`LEGEND`)return $.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},ir=function(e,t){return!(t.disabled||Jn(t)||nr(t,e)||Yn(t)||rr(t))},ar=function(e,t){return!($n(t)||Wn(t)<0||!ir(e,t))},or=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},sr=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=Gn(a,i),s=i?sr(e.candidates):a;o===0?i?t.push.apply(t,s):t.push(a):n.push({documentOrder:r,tabIndex:o,item:e,isScope:i,content:s})}),n.sort(Kn).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},cr=function(e,t){return t||={},sr(t.getShadowRoot?Hn([e],t.includeContainer,{filter:ar.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:or}):Vn(e,t.includeContainer,ar.bind(null,t)))},lr=function(e,t){return t||={},t.getShadowRoot?Hn([e],t.includeContainer,{filter:ir.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):Vn(e,t.includeContainer,ir.bind(null,t))},ur=function(e,t){if(t||={},!e)throw Error(`No node provided`);return $.call(e,In)!==!1&&ar(t,e)},dr=Fn.concat(`iframe:not([inert]):not([inert] *)`).join(`,`),fr=function(e,t){if(t||={},!e)throw Error(`No node provided`);return $.call(e,dr)!==!1&&ir(t,e)};function pr(){return{getShadowRoot:!0,displayCheck:typeof ResizeObserver==`function`&&ResizeObserver.toString().includes(`[native code]`)?`full`:`none`}}function mr(e,t){if(!ur(e,pr()))return hr(e,t);let n=bt(e),r=cr(n.body,pr());t===`prev`&&r.reverse();let i=r.indexOf(e);return i===-1?n.body:r.slice(i+1)[0]}function hr(e,t){let n=bt(e);if(!fr(e,pr()))return n.body;let r=lr(n.body,pr());t===`prev`&&r.reverse();let i=r.indexOf(e);return i===-1?n.body:r.slice(i+1).find(e=>ur(e,pr()))??n.body}function gr(e,t,n){let r=t.toLowerCase();if(r.endsWith(` `)){let i=r.slice(0,-1);if(e.filter(e=>e.toLowerCase().startsWith(i)).length<=1)return gr(e,i,n);let a=n?.toLowerCase();if(a&&a.startsWith(i)&&a.charAt(i.length)===` `&&t.trim()===i)return n;let o=e.filter(e=>e.toLowerCase().startsWith(r));if(o.length>0){let t=n?e.indexOf(n):-1;return _r(o,Math.max(t,0)).find(e=>e!==n)||n}}let i=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,a=i.toLowerCase(),o=n?e.indexOf(n):-1,s=_r(e,Math.max(o,0));i.length===1&&(s=s.filter(e=>e!==n));let c=s.find(e=>e?.toLowerCase().startsWith(a));return c===n?void 0:c}function _r(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var vr={afterMs:1e4,onChange:Y};function yr(e,t){let{afterMs:n,onChange:r,getWindow:i}={...vr,...t},a=null,o=D(oe(e));function s(){return i().setTimeout(()=>{C(o,e,!0),r?.(e)},n)}return j(()=>()=>{a&&i().clearTimeout(a)}),L(()=>_(o),e=>{C(o,e,!0),r?.(e),a&&i().clearTimeout(a),a=s()})}var br=class{#e;#t;#n=w(()=>this.#e.onMatch?this.#e.onMatch:e=>e.focus());#r=w(()=>this.#e.getCurrentItem?this.#e.getCurrentItem:this.#e.getActiveElement);constructor(e){this.#e=e,this.#t=yr(``,{afterMs:1e3,getWindow:e.getWindow}),this.handleTypeaheadSearch=this.handleTypeaheadSearch.bind(this),this.resetTypeahead=this.resetTypeahead.bind(this)}handleTypeaheadSearch(e,t){if(!t.length)return;this.#t.current=this.#t.current+e;let n=_(this.#r)(),r=t.find(e=>e===n)?.textContent?.trim()??``,i=gr(t.map(e=>e.textContent?.trim()??``),this.#t.current,r),a=t.find(e=>e.textContent?.trim()===i);return a&&_(this.#n)(a),a}resetTypeahead(){this.#t.current=``}get search(){return this.#t.current}},xr=`data-context-menu-trigger`,Sr=`data-context-menu-content`,Cr=new H(`Menu.Root`),wr=new H(`Menu.Root | Menu.Sub`),Tr=new H(`Menu.Content`),Er=new H(`Menu.Group | Menu.RadioGroup`),Dr=new H(`Menu.RadioGroup`),Or=new H(`Menu.CheckboxGroup`),kr=new xn(`bitsmenuopen`,{bubbles:!1,cancelable:!0}),Ar=jt({component:`menu`,parts:[`trigger`,`content`,`sub-trigger`,`item`,`group`,`group-heading`,`checkbox-group`,`checkbox-item`,`radio-group`,`radio-item`,`separator`,`sub-content`,`arrow`]}),jr=class{#e;#t=null;#n=null;#r=!1;#i=null;#a=null;#o=null;#s=null;constructor(e){this.#e=e,U([e.triggerNode,e.contentNode,e.enabled],([e,t,n])=>{if(this.#_(),!e||!t||!n)return;let r=e=>{Q(e)&&(this.#s={x:e.clientX,y:e.clientY},this.#r||this.#d(e,`content`))},i=e=>{Q(e)&&this.#f(e,`content`)},a=e=>{Q(e)&&(this.#r||this.#d(e,`trigger`))},o=e=>{if(Q(e)){if(Yt(e.relatedTarget)){let n=this.#e.subContentSelector(),r=e.relatedTarget.closest(n);if(r&&r!==t&&r.id&&t.querySelector(`[aria-controls="${r.id}"]`))return}this.#f(e,`trigger`)}},s=e=>{Q(e)&&this.#m()},c=e=>{Q(e)&&this.#m()};return e.addEventListener(`pointermove`,r),e.addEventListener(`pointerleave`,i),e.addEventListener(`pointerenter`,s),t.addEventListener(`pointermove`,a),t.addEventListener(`pointerleave`,o),t.addEventListener(`pointerenter`,c),()=>{e.removeEventListener(`pointermove`,r),e.removeEventListener(`pointerleave`,i),e.removeEventListener(`pointerenter`,s),t.removeEventListener(`pointermove`,a),t.removeEventListener(`pointerleave`,o),t.removeEventListener(`pointerenter`,c),this.#_()}}),W(()=>{this.#_()})}#c(){let e=this.#e.parentContentNode();return e?e.getBoundingClientRect():this.#e.triggerNode()?.getBoundingClientRect()??null}#l(e,t){let n=this.#e.triggerNode(),r=this.#e.contentNode();if(!n||!r)return null;let i=n.getBoundingClientRect(),a=r.getBoundingClientRect(),o=Fr(i,a),s,c,l;return t===`content`?(s=this.#r?this.#a??e:e,c=a):(s=this.#s??e,c=this.#c()??i,l=a),this.#a=s,{corridor:Ir(i,a,o),intent:Lr(s,c,o,t,l),targetRect:c,side:o}}#u(e,t,n){return Mr(e,t)||Mr(e,n)}#d(e,t){let n={x:e.clientX,y:e.clientY};this.#l(n,t)&&(this.#i=t,this.#o=n)}#f(e,t){if(!this.#e.enabled())return;let n=this.#e.triggerNode(),r=this.#e.contentNode();if(!n||!r)return;let i=e.relatedTarget;if(Yt(i)&&(t===`content`&&r.contains(i)||t===`trigger`&&n.contains(i)))return;let a={x:e.clientX,y:e.clientY},o=this.#l(a,t);if(o){if(!Nr(a,o.targetRect)&&!this.#u(a,o.corridor,o.intent)){this.#w();return}this.#r=!0,this.#i=t,this.#o=a,this.#e.setIsPointerInTransit(!0),this.#b(),this.#S()}}#p=null;#m(){if(!this.#r)return;let e=this.#i===`trigger`;this.#x(),this.#C(),this.#r=!1,this.#w(),e?(this.#h(),this.#p=setTimeout(()=>{this.#p=null,this.#e.setIsPointerInTransit(!1)},100)):this.#e.setIsPointerInTransit(!1)}#h(){this.#p!==null&&(clearTimeout(this.#p),this.#p=null)}#g(){let e=this.#o;this.#x(),this.#C(),this.#h(),this.#r=!1,this.#e.setIsPointerInTransit(!1),this.#w(),this.#e.onIntentExit(e)}#_(){this.#x(),this.#C(),this.#h(),this.#r&&this.#e.setIsPointerInTransit(!1),this.#r=!1,this.#i=null,this.#a=null,this.#o=null,this.#s=null}#v(e){let t=this.#e.contentNode();if(!t)return!1;let n=t.ownerDocument.elementFromPoint(e.x,e.y);if(!n)return!1;let r=this.#e.subContentSelector(),i=n.closest(r);return!i||i===t?!1:i.id?!!t.querySelector(`[aria-controls="${i.id}"]`):!1}#y=e=>{if(!this.#r||!this.#i||!Q(e))return;let t=this.#e.triggerNode(),n=this.#e.contentNode();if(!t||!n){this.#g();return}this.#C();let r={x:e.clientX,y:e.clientY};this.#o=r;let i=t.getBoundingClientRect(),a=n.getBoundingClientRect();if(this.#i===`content`&&Nr(r,a)){this.#m();return}if(this.#i===`trigger`&&Pr(r,i,4)){this.#m();return}if(this.#v(r)){this.#S();return}let o=this.#l(r,this.#i);if(!o){this.#g();return}if(this.#u(r,o.corridor,o.intent)){this.#S();return}this.#g()};#b(){if(this.#t)return;let e=bt(this.#e.triggerNode()??this.#e.contentNode());e&&(e.addEventListener(`pointermove`,this.#y,!0),this.#t=()=>{e.removeEventListener(`pointermove`,this.#y,!0),this.#t=null})}#x(){this.#t?.()}#S(){this.#C(),this.#n=setTimeout(()=>{this.#n=null,this.#r&&this.#g()},500)}#C(){this.#n!==null&&(clearTimeout(this.#n),this.#n=null)}#w(){this.#i=null,this.#a=null,this.#o=null}};function Mr(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e].x,s=t[e].y,c=t[a].x,l=t[a].y;s>r!=l>r&&n<(c-o)*(r-s)/(l-s)+o&&(i=!i)}return i}function Nr(e,t){return e.x>=t.left&&e.x<=t.right&&e.y>=t.top&&e.y<=t.bottom}function Pr(e,t,n){return e.x>=t.left+n&&e.x<=t.right-n&&e.y>=t.top+n&&e.y<=t.bottom-n}function Fr(e,t){let n=e.left+e.width/2,r=e.top+e.height/2,i=t.left+t.width/2,a=t.top+t.height/2,o=i-n,s=a-r;return Math.abs(o)>Math.abs(s)?o>0?`right`:`left`:s>0?`bottom`:`top`}function Ir(e,t,n){switch(n){case`top`:return[{x:Math.min(e.left,t.left)-2,y:e.top},{x:Math.min(e.left,t.left)-2,y:t.bottom},{x:Math.max(e.right,t.right)+2,y:t.bottom},{x:Math.max(e.right,t.right)+2,y:e.top}];case`bottom`:return[{x:Math.min(e.left,t.left)-2,y:e.bottom},{x:Math.min(e.left,t.left)-2,y:t.top},{x:Math.max(e.right,t.right)+2,y:t.top},{x:Math.max(e.right,t.right)+2,y:e.bottom}];case`left`:return[{x:e.left,y:Math.min(e.top,t.top)-2},{x:t.right,y:Math.min(e.top,t.top)-2},{x:t.right,y:Math.max(e.bottom,t.bottom)+2},{x:e.left,y:Math.max(e.bottom,t.bottom)+2}];case`right`:return[{x:e.right,y:Math.min(e.top,t.top)-2},{x:t.left,y:Math.min(e.top,t.top)-2},{x:t.left,y:Math.max(e.bottom,t.bottom)+2},{x:e.right,y:Math.max(e.bottom,t.bottom)+2}]}}function Lr(e,t,n,r,i){let a=r===`trigger`?Rr(n):n,o=i?Math.min(t.top,i.top)-8:t.top-8,s=i?Math.max(t.bottom,i.bottom)+8:t.bottom+8,c=i?Math.min(t.left,i.left)-8:t.left-8,l=i?Math.max(t.right,i.right)+8:t.right+8;switch(a){case`right`:return[e,{x:t.left,y:o},{x:t.left,y:s}];case`left`:return[e,{x:t.right,y:o},{x:t.right,y:s}];case`bottom`:return[e,{x:c,y:t.top},{x:l,y:t.top}];case`top`:return[e,{x:c,y:t.bottom},{x:l,y:t.bottom}]}}function Rr(e){switch(e){case`top`:return`bottom`;case`bottom`:return`top`;case`left`:return`right`;case`right`:return`left`}}var zr=class e{static create(t){let n=new e(t);return Cr.set(n)}opts;isUsingKeyboard=new Pn;#e=D(!1);get ignoreCloseAutoFocus(){return _(this.#e)}set ignoreCloseAutoFocus(e){C(this.#e,e,!0)}#t=D(!1);get isPointerInTransit(){return _(this.#t)}set isPointerInTransit(e){C(this.#t,e,!0)}constructor(e){this.opts=e}getBitsAttr=e=>Ar.getAttr(e,this.opts.variant.current)},Br=class e{static create(t,n){return wr.set(new e(t,n,null))}opts;root;parentMenu;contentId=L(()=>``);#e=D(null);get contentNode(){return _(this.#e)}set contentNode(e){C(this.#e,e,!0)}contentPresence;#t=D(null);get triggerNode(){return _(this.#t)}set triggerNode(e){C(this.#t,e,!0)}constructor(e,t,n){this.opts=e,this.root=t,this.parentMenu=n,this.contentPresence=new tn({ref:L(()=>this.contentNode),open:this.opts.open,onComplete:()=>{this.opts.onOpenChangeComplete.current(this.opts.open.current)},shouldSkipExitAnimation:()=>this.root.opts.variant.current!==`menubar`||this.parentMenu!==null?!1:this.root.opts.shouldSkipExitAnimation?.()??!1}),n&&U(()=>n.opts.open.current,()=>{n.opts.open.current||(this.opts.open.current=!1)})}toggleOpen(){this.opts.open.current=!this.opts.open.current}onOpen(){this.opts.open.current=!0}onClose(){this.opts.open.current=!1}},Vr=class e{static create(t){return Tr.set(new e(t,wr.get()))}opts;parentMenu;rovingFocusGroup;domContext;attachment;#e=D(``);get search(){return _(this.#e)}set search(e){C(this.#e,e,!0)}#t=0;#n;#r=D(!1);get mounted(){return _(this.#r)}set mounted(e){C(this.#r,e,!0)}#i;constructor(e,t){this.opts=e,this.parentMenu=t,this.domContext=new Ct(e.ref),this.attachment=K(this.opts.ref,e=>{this.parentMenu.contentNode!==e&&(this.parentMenu.contentNode=e)}),t.contentId=e.id,this.#i=e.isSub??!1,this.onkeydown=this.onkeydown.bind(this),this.onblur=this.onblur.bind(this),this.onfocus=this.onfocus.bind(this),this.handleInteractOutside=this.handleInteractOutside.bind(this),new jr({contentNode:()=>this.parentMenu.contentNode,triggerNode:()=>this.parentMenu.triggerNode,parentContentNode:()=>this.parentMenu.parentMenu?.contentNode??null,subContentSelector:()=>`[${this.parentMenu.root.getBitsAttr(`sub-content`)}]`,enabled:()=>this.parentMenu.opts.open.current&&!!this.parentMenu.triggerNode?.hasAttribute(this.parentMenu.root.getBitsAttr(`sub-trigger`)),onIntentExit:e=>{this.parentMenu.opts.open.current=!1,this.#s(e)},setIsPointerInTransit:e=>{this.parentMenu.root.isPointerInTransit=e}}),this.#n=new br({getActiveElement:()=>this.domContext.getActiveElement(),getWindow:()=>this.domContext.getWindow()}).handleTypeaheadSearch,this.rovingFocusGroup=new $t({rootNode:L(()=>this.parentMenu.contentNode),candidateAttr:this.parentMenu.root.getBitsAttr(`item`),loop:this.opts.loop,orientation:L(()=>`vertical`)}),U(()=>this.parentMenu.contentNode,e=>e?kr.listen(e,()=>{G(()=>{this.parentMenu.root.isUsingKeyboard.current&&this.rovingFocusGroup.focusFirstCandidate()})}):void 0),j(()=>{this.parentMenu.opts.open.current||this.domContext.getWindow().clearTimeout(this.#t)})}#a(){let e=this.parentMenu.contentNode;return e?Array.from(e.querySelectorAll(`[${this.parentMenu.root.getBitsAttr(`item`)}]:not([data-disabled])`)):[]}#o(){return this.parentMenu.root.isPointerInTransit}#s(e){if(!e)return;let t=this.parentMenu.parentMenu?.contentNode;if(!t)return;let n=this.domContext.getDocument().elementFromPoint(e.x,e.y);if(!Yt(n))return;let r=n.closest(`[${this.parentMenu.root.getBitsAttr(`sub-trigger`)}]`);r&&t.contains(r)&&r!==this.parentMenu.triggerNode&&r.dispatchEvent(new PointerEvent(`pointermove`,{bubbles:!0,cancelable:!0,pointerType:`mouse`,clientX:e.x,clientY:e.y}))}onCloseAutoFocus=e=>{if(this.opts.onCloseAutoFocus.current?.(e),!(e.defaultPrevented||this.#i)){if(this.parentMenu.root.ignoreCloseAutoFocus){e.preventDefault();return}this.parentMenu.triggerNode&&ur(this.parentMenu.triggerNode)&&(e.preventDefault(),this.parentMenu.triggerNode.focus())}};handleTabKeyDown(e){let t=this.parentMenu;for(;t.parentMenu!==null;)t=t.parentMenu;if(!t.triggerNode)return;e.preventDefault();let n=mr(t.triggerNode,e.shiftKey?`prev`:`next`);n?(this.parentMenu.root.ignoreCloseAutoFocus=!0,t.onClose(),G(()=>{n.focus(),G(()=>{this.parentMenu.root.ignoreCloseAutoFocus=!1})})):this.domContext.getDocument().body.focus()}onkeydown(e){if(e.defaultPrevented)return;if(e.key===`Tab`){this.handleTabKeyDown(e);return}let t=e.target,n=e.currentTarget;if(!J(t)||!J(n))return;let r=t.closest(`[${this.parentMenu.root.getBitsAttr(`content`)}]`)?.id===this.parentMenu.contentId.current,i=e.ctrlKey||e.altKey||e.metaKey,a=e.key.length===1;if(this.rovingFocusGroup.handleKeydown(t,e)||e.code===`Space`)return;let o=this.#a();r&&!i&&a&&this.#n(e.key,o),e.target?.id===this.parentMenu.contentId.current&&An.includes(e.key)&&(e.preventDefault(),kn.includes(e.key)&&o.reverse(),Mn(o,{select:!1},()=>this.domContext.getActiveElement()))}onblur(e){Yt(e.currentTarget)&&Yt(e.target)&&(e.currentTarget.contains?.(e.target)||(this.domContext.getWindow().clearTimeout(this.#t),this.search=``))}onfocus(e){this.parentMenu.root.isUsingKeyboard.current&&G(()=>this.rovingFocusGroup.focusFirstCandidate())}onItemEnter(){return this.#o()}onItemLeave(e){e.currentTarget.hasAttribute(this.parentMenu.root.getBitsAttr(`sub-trigger`))||this.#o()||this.parentMenu.root.isUsingKeyboard.current||(this.parentMenu.contentNode?.focus({preventScroll:!0}),this.rovingFocusGroup.setCurrentTabStopId(``))}onTriggerLeave(){return!!this.#o()}handleInteractOutside(e){if(!Xt(e.target))return;let t=this.parentMenu.triggerNode?.id;if(e.target.id===t){e.preventDefault();return}if(e.target.closest(`#${t}`)){e.preventDefault();return}this.parentMenu.root.ignoreCloseAutoFocus=!0,G(()=>{this.parentMenu.root.ignoreCloseAutoFocus=!1})}get shouldRender(){return this.parentMenu.contentPresence.shouldRender}#c=w(()=>({open:this.parentMenu.opts.open.current}));get snippetProps(){return _(this.#c)}set snippetProps(e){C(this.#c,e)}#l=w(()=>({id:this.opts.id.current,role:`menu`,"aria-orientation":`vertical`,[this.parentMenu.root.getBitsAttr(`content`)]:``,"data-state":Et(this.parentMenu.opts.open.current),...Ot(this.parentMenu.contentPresence.transitionStatus),onkeydown:this.onkeydown,onblur:this.onblur,onfocus:this.onfocus,dir:this.parentMenu.root.opts.dir.current,style:{pointerEvents:`auto`,contain:`layout style`},...this.attachment}));get props(){return _(this.#l)}set props(e){C(this.#l,e)}popperProps={onCloseAutoFocus:e=>this.onCloseAutoFocus(e)}},Hr=class{opts;content;attachment;#e=D(!1);constructor(e,t){this.opts=e,this.content=t,this.attachment=K(this.opts.ref),this.onpointermove=this.onpointermove.bind(this),this.onpointerleave=this.onpointerleave.bind(this),this.onfocus=this.onfocus.bind(this),this.onblur=this.onblur.bind(this)}onpointermove(e){if(!e.defaultPrevented&&Q(e)){if(this.opts.disabled.current)this.content.onItemLeave(e);else{if(this.content.onItemEnter())return;let t=e.currentTarget;if(!J(t))return;t.focus({preventScroll:!0})}}}onpointerleave(e){e.defaultPrevented||Q(e)&&this.content.onItemLeave(e)}onfocus(e){G(()=>{e.defaultPrevented||this.opts.disabled.current||C(this.#e,!0)})}onblur(e){G(()=>{e.defaultPrevented||C(this.#e,!1)})}#t=w(()=>({id:this.opts.id.current,tabindex:-1,role:`menuitem`,"aria-disabled":wt(this.opts.disabled.current),"data-disabled":q(this.opts.disabled.current),"data-highlighted":_(this.#e)?``:void 0,[this.content.parentMenu.root.getBitsAttr(`item`)]:``,onpointermove:this.onpointermove,onpointerleave:this.onpointerleave,onfocus:this.onfocus,onblur:this.onblur,...this.attachment}));get props(){return _(this.#t)}set props(e){C(this.#t,e)}},Ur=class e{static create(t){let n=new Hr(t,Tr.get());return new e(t,n)}opts;item;root;#e=!1;constructor(e,t){this.opts=e,this.item=t,this.root=t.content.parentMenu.root,this.onkeydown=this.onkeydown.bind(this),this.onclick=this.onclick.bind(this),this.onpointerdown=this.onpointerdown.bind(this),this.onpointerup=this.onpointerup.bind(this)}#t(){if(this.item.opts.disabled.current)return;let e=new CustomEvent(`menuitemselect`,{bubbles:!0,cancelable:!0});if(this.opts.onSelect.current(e),e.defaultPrevented){this.item.content.parentMenu.root.isUsingKeyboard.current=!1;return}this.opts.closeOnSelect.current&&this.item.content.parentMenu.root.opts.onClose()}onkeydown(e){let t=this.item.content.search!==``;if(!(this.item.opts.disabled.current||t&&e.key===` `)&&Dn.includes(e.key)){if(!J(e.currentTarget))return;e.currentTarget.click(),e.preventDefault()}}onclick(e){this.item.opts.disabled.current||this.#t()}onpointerup(e){if(!e.defaultPrevented&&!this.#e){if(!J(e.currentTarget))return;e.currentTarget?.click()}}onpointerdown(e){this.#e=!0}#n=w(()=>V(this.item.props,{onclick:this.onclick,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,onkeydown:this.onkeydown}));get props(){return _(this.#n)}set props(e){C(this.#n,e)}},Wr=class e{static create(t){return Er.set(new e(t,Cr.get()))}opts;root;attachment;#e=D(void 0);get groupHeadingId(){return _(this.#e)}set groupHeadingId(e){C(this.#e,e,!0)}constructor(e,t){this.opts=e,this.root=t,this.attachment=K(this.opts.ref)}#t=w(()=>({id:this.opts.id.current,role:`group`,"aria-labelledby":this.groupHeadingId,[this.root.getBitsAttr(`group`)]:``,...this.attachment}));get props(){return _(this.#t)}set props(e){C(this.#t,e)}},Gr=class e{static create(t){let n=Or.getOr(null);if(n)return new e(t,n);let r=Dr.getOr(null);return r?new e(t,r):new e(t,Er.get())}opts;group;attachment;constructor(e,t){this.opts=e,this.group=t,this.attachment=K(this.opts.ref,e=>this.group.groupHeadingId=e?.id)}#e=w(()=>({id:this.opts.id.current,role:`group`,[this.group.root.getBitsAttr(`group-heading`)]:``,...this.attachment}));get props(){return _(this.#e)}set props(e){C(this.#e,e)}},Kr=class e{static create(t){return new e(t,Cr.get())}opts;root;attachment;constructor(e,t){this.opts=e,this.root=t,this.attachment=K(this.opts.ref)}#e=w(()=>({id:this.opts.id.current,role:`group`,[this.root.getBitsAttr(`separator`)]:``,...this.attachment}));get props(){return _(this.#e)}set props(e){C(this.#e,e)}},qr=class e{static create(t){return new e(t,wr.get())}opts;parentMenu;attachment;constructor(e,t){this.opts=e,this.parentMenu=t,this.attachment=K(this.opts.ref,e=>this.parentMenu.triggerNode=e)}onclick=e=>{this.opts.disabled.current||e.detail!==0||(this.parentMenu.toggleOpen(),e.preventDefault())};onpointerdown=e=>{if(!this.opts.disabled.current){if(e.pointerType===`touch`)return e.preventDefault();e.button===0&&e.ctrlKey===!1&&(this.parentMenu.toggleOpen(),this.parentMenu.opts.open.current||e.preventDefault())}};onpointerup=e=>{this.opts.disabled.current||e.pointerType===`touch`&&(e.preventDefault(),this.parentMenu.toggleOpen())};onkeydown=e=>{if(!this.opts.disabled.current){if(e.key===` `||e.key===`Enter`){this.parentMenu.toggleOpen(),e.preventDefault();return}e.key===`ArrowDown`&&(this.parentMenu.onOpen(),e.preventDefault())}};#e=w(()=>{if(this.parentMenu.opts.open.current&&this.parentMenu.contentId.current)return this.parentMenu.contentId.current});#t=w(()=>({id:this.opts.id.current,disabled:this.opts.disabled.current,"aria-haspopup":`menu`,"aria-expanded":wt(this.parentMenu.opts.open.current),"aria-controls":_(this.#e),"data-disabled":q(this.opts.disabled.current),"data-state":Et(this.parentMenu.opts.open.current),[this.parentMenu.root.getBitsAttr(`trigger`)]:``,onclick:this.onclick,onpointerdown:this.onpointerdown,onpointerup:this.onpointerup,onkeydown:this.onkeydown,...this.attachment}));get props(){return _(this.#t)}set props(e){C(this.#t,e)}};globalThis.bitsDismissableLayers??=new Map;var Jr=class e{static create(t){return new e(t)}opts;#e;#t;#n={pointerdown:!1};#r=!1;#i=!1;#a=void 0;#o;#s=Y;constructor(e){this.opts=e,this.#t=e.interactOutsideBehavior,this.#e=e.onInteractOutside,this.#o=e.onFocusOutside,j(()=>{this.#a=wn(this.opts.ref.current)});let t=Y,n=null,r=!1,i=()=>{n!=null&&(clearTimeout(n),n=null)},a=()=>{i(),this.#g(),globalThis.bitsDismissableLayers.delete(this),this.#d.destroy(),t()};U([()=>this.opts.enabled.current,()=>this.opts.ref.current],()=>{if(this.opts.enabled.current&&this.opts.ref.current)return i(),n=ut(1,()=>{n=null,!r&&this.opts.ref.current&&(globalThis.bitsDismissableLayers.set(this,this.#t),t(),t=this.#l())}),a}),W(()=>{r=!0,i(),this.#g.destroy(),globalThis.bitsDismissableLayers.delete(this),this.#d.destroy(),this.#s(),t()})}#c=e=>{e.defaultPrevented||this.opts.ref.current&&G(()=>{this.opts.ref.current&&!this.#h(e.target)&&e.target&&!this.#i&&this.#o.current?.(e)})};#l(){return B(A(this.#a,`pointerdown`,B(this.#f,this.#m),{capture:!0}),A(this.#a,`pointerdown`,B(this.#p,this.#d)),A(this.#a,`focusin`,this.#c))}#u=e=>{let t=e;t.defaultPrevented&&(t=Qr(e)),this.#e.current(e)};#d=Sn(e=>{if(!this.opts.ref.current){this.#s();return}let t=this.opts.isValidEvent.current(e,this.opts.ref.current)||Zr(e,this.opts.ref.current);if(!this.#r||this.#_()||!t){this.#s();return}let n=e;if(n.defaultPrevented&&(n=Qr(n)),this.#t.current!==`close`&&this.#t.current!==`defer-otherwise-close`){this.#s();return}e.pointerType===`touch`?(this.#s(),this.#s=A(this.#a,`click`,this.#u,{once:!0})):this.#e.current(n)},10);#f=e=>{this.#n[e.type]=!0};#p=e=>{this.#n[e.type]=!1};#m=()=>{this.opts.ref.current&&(this.#r=Xr(this.opts.ref.current))};#h=e=>this.opts.ref.current?Cn(this.opts.ref.current,e):!1;#g=Sn(()=>{for(let e in this.#n)this.#n[e]=!1;this.#r=!1},20);#_(){return Object.values(this.#n).some(Boolean)}#v=()=>{this.#i=!0};#y=()=>{this.#i=!1};props={onfocuscapture:this.#v,onblurcapture:this.#y}};function Yr(e=[...globalThis.bitsDismissableLayers]){return e.findLast(([e,{current:t}])=>t===`close`||t===`ignore`)}function Xr(e){let t=[...globalThis.bitsDismissableLayers],n=Yr(t);if(n)return n[0].opts.ref.current===e;let[r]=t[0];return r.opts.ref.current===e}function Zr(e,t){let n=e.target;if(!Xt(n))return!1;let r=!!n.closest(`[${xr}]`),i=!!t.closest(`[${Sr}]`);return`button`in e&&e.button>0&&!r?!1:`button`in e&&e.button===0&&r&&i?!0:r&&i?!1:wn(n).documentElement.contains(n)&&!Cn(t,n)&&En(e,t)}function Qr(e){let t=e.currentTarget,n=e.target,r;r=e instanceof PointerEvent?new PointerEvent(e.type,e):new PointerEvent(`pointerdown`,e);let i=!1;return new Proxy(r,{get:(r,a)=>a===`currentTarget`?t:a===`target`?n:a===`preventDefault`?()=>{i=!0,typeof r.preventDefault==`function`&&r.preventDefault()}:a===`defaultPrevented`?i:a in r?r[a]:e[a]})}function $r(e,t){i(t,!0);let n=y(t,`interactOutsideBehavior`,3,`close`),r=y(t,`onInteractOutside`,3,Y),a=y(t,`onFocusOutside`,3,Y),o=y(t,`isValidEvent`,3,()=>!1),s=Jr.create({id:L(()=>t.id),interactOutsideBehavior:L(()=>n()),onInteractOutside:L(()=>r()),enabled:L(()=>t.enabled),onFocusOutside:L(()=>a()),isValidEvent:L(()=>o()),ref:t.ref});var c=P(),l=N(c);d(l,()=>t.children??E,()=>({props:s.props})),m(e,c),h()}globalThis.bitsEscapeLayers??=new Map;var ei=class e{static create(t){return new e(t)}opts;domContext;constructor(e){this.opts=e,this.domContext=new Ct(this.opts.ref);let t=Y;U(()=>e.enabled.current,n=>(n&&(globalThis.bitsEscapeLayers.set(this,e.escapeKeydownBehavior),t=this.#e()),()=>{t(),globalThis.bitsEscapeLayers.delete(this)}))}#e=()=>A(this.domContext.getDocument(),`keydown`,this.#t,{passive:!1});#t=e=>{if(e.key!==`Escape`||!ti(this))return;let t=new KeyboardEvent(e.type,e);e.preventDefault();let n=this.opts.escapeKeydownBehavior.current;(n===`close`||n===`defer-otherwise-close`)&&this.opts.onEscapeKeydown.current(t)}};function ti(e){let t=[...globalThis.bitsEscapeLayers],n=t.findLast(([e,{current:t}])=>t===`close`||t===`ignore`);if(n)return n[0]===e;let[r]=t[0];return r===e}function ni(e,t){i(t,!0);let n=y(t,`escapeKeydownBehavior`,3,`close`),r=y(t,`onEscapeKeydown`,3,Y);ei.create({escapeKeydownBehavior:L(()=>n()),onEscapeKeydown:L(()=>r()),enabled:L(()=>t.enabled),ref:t.ref});var a=P(),o=N(a);d(o,()=>t.children??E),m(e,a),h()}var ri=class e{static instance;#e=Se([]);#t=new WeakMap;#n=new WeakMap;static getInstance(){return this.instance||=new e,this.instance}register(e){let t=this.getActive();t&&t!==e&&t.pause();let n=document.activeElement;n&&n!==document.body&&this.#n.set(e,n),this.#e.current=this.#e.current.filter(t=>t!==e),this.#e.current.unshift(e)}unregister(e){this.#e.current=this.#e.current.filter(t=>t!==e);let t=this.getActive();t&&t.resume()}getActive(){return this.#e.current[0]}setFocusMemory(e,t){this.#t.set(e,t)}getFocusMemory(e){return this.#t.get(e)}isActiveScope(e){return this.getActive()===e}setPreFocusMemory(e,t){this.#n.set(e,t)}getPreFocusMemory(e){return this.#n.get(e)}clearPreFocusMemory(e){this.#n.delete(e)}},ii=class e{#e=!1;#t=null;#n=ri.getInstance();#r=[];#i;constructor(e){this.#i=e}get paused(){return this.#e}pause(){this.#e=!0}resume(){this.#e=!1}#a(){for(let e of this.#r)e();this.#r=[]}mount(e){this.#t&&this.unmount(),this.#t=e,this.#n.register(this),this.#c(),this.#o()}unmount(){this.#t&&=(this.#a(),this.#s(),this.#n.unregister(this),this.#n.clearPreFocusMemory(this),null)}#o(){if(!this.#t)return;let e=new CustomEvent(`focusScope.onOpenAutoFocus`,{bubbles:!1,cancelable:!0});this.#i.onOpenAutoFocus.current(e),e.defaultPrevented||requestAnimationFrame(()=>{if(!this.#t)return;let e=this.#u();e?(e.focus(),this.#n.setFocusMemory(this,e)):this.#t.focus()})}#s(){let e=new CustomEvent(`focusScope.onCloseAutoFocus`,{bubbles:!1,cancelable:!0});if(this.#i.onCloseAutoFocus.current?.(e),!e.defaultPrevented){let e=this.#n.getPreFocusMemory(this);if(e&&document.contains(e))try{e.focus()}catch{document.body.focus()}}}#c(){if(!this.#t||!this.#i.trap.current)return;let e=this.#t,t=e.ownerDocument;this.#r.push(A(t,`focusin`,t=>{if(this.#e||!this.#n.isActiveScope(this))return;let n=t.target;if(n){if(e.contains(n))this.#n.setFocusMemory(this,n);else{let n=this.#n.getFocusMemory(this);if(n&&e.contains(n)&&fr(n))t.preventDefault(),n.focus();else{let t=this.#u(),n=this.#d()[0];(t||n||e).focus()}}}},{capture:!0}),A(e,`keydown`,e=>{if(!this.#i.loop||this.#e||e.key!==`Tab`||!this.#n.isActiveScope(this))return;let n=this.#l();if(n.length===0)return;let r=n[0],i=n[n.length-1];!e.shiftKey&&t.activeElement===i?(e.preventDefault(),r.focus()):e.shiftKey&&t.activeElement===r&&(e.preventDefault(),i.focus())}));let n=new MutationObserver(()=>{let t=this.#n.getFocusMemory(this);if(t&&!e.contains(t)){let t=this.#u(),n=this.#d()[0],r=t||n;r?(r.focus(),this.#n.setFocusMemory(this,r)):e.focus()}});n.observe(e,{childList:!0,subtree:!0}),this.#r.push(()=>n.disconnect())}#l(){return this.#t?cr(this.#t,{includeContainer:!1,getShadowRoot:!0}):[]}#u(){return this.#l()[0]||null}#d(){return this.#t?lr(this.#t,{includeContainer:!1,getShadowRoot:!0}):[]}static use(t){let n=null;return U([()=>t.ref.current,()=>t.enabled.current],([r,i])=>{r&&i?(n||=new e(t),n.mount(r)):n&&=(n.unmount(),null)}),W(()=>{n?.unmount()}),{get props(){return{tabindex:-1}}}}};function ai(e,t){i(t,!0);let n=y(t,`enabled`,3,!1),r=y(t,`trapFocus`,3,!1),a=y(t,`loop`,3,!1),o=y(t,`onCloseAutoFocus`,3,Y),s=y(t,`onOpenAutoFocus`,3,Y),c=ii.use({enabled:L(()=>n()),trap:L(()=>r()),loop:a(),onCloseAutoFocus:L(()=>o()),onOpenAutoFocus:L(()=>s()),ref:t.ref});var l=P(),u=N(l);d(u,()=>t.focusScope??E,()=>({props:c.props})),m(e,l),h()}var oi=()=>{};globalThis.bitsTextSelectionLayers??=new Map;var si=class e{static create(t){return new e(t)}opts;domContext;#e=Y;#t=!1;#n=oi;#r=oi;constructor(e){this.opts=e,this.domContext=new Ct(e.ref);let t=Y;U(()=>[this.opts.enabled.current,this.opts.onPointerDown.current,this.opts.onPointerUp.current],([e,n,r])=>(this.#t=e,this.#n=n,this.#r=r,e&&(globalThis.bitsTextSelectionLayers.set(this,this.opts.enabled),t(),t=this.#i()),()=>{this.#t=!1,t(),this.#s(),globalThis.bitsTextSelectionLayers.delete(this)}))}#i(){return B(A(this.domContext.getDocument(),`pointerdown`,this.#o),A(this.domContext.getDocument(),`pointerup`,Ce(this.#s,this.#a)))}#a=e=>{this.#r(e)};#o=e=>{if(!this.#t)return;let t=this.opts.ref.current,n=e.target;J(t)&&J(n)&&di(this)&&yt(t,n)&&(this.#n(e),!e.defaultPrevented&&(this.#e=li(t,this.domContext.getDocument().body)))};#s=()=>{this.#e(),this.#e=Y}},ci=e=>e.style.userSelect||e.style.webkitUserSelect;function li(e,t){let n=ci(t),r=ci(e);return ui(t,`none`),ui(e,`text`),()=>{ui(t,n),ui(e,r)}}function ui(e,t){e.style.userSelect=t,e.style.webkitUserSelect=t}function di(e){let t=[...globalThis.bitsTextSelectionLayers];if(!t.length)return!1;let n=t.at(-1);return n?n[0]===e:!1}function fi(e,t){i(t,!0);let n=y(t,`preventOverflowTextSelection`,3,!0),r=y(t,`onPointerDown`,3,Y),a=y(t,`onPointerUp`,3,Y);si.create({id:L(()=>t.id),onPointerDown:L(()=>r()),onPointerUp:L(()=>a()),enabled:L(()=>t.enabled&&n()),ref:t.ref});var o=P(),s=N(o);d(s,()=>t.children??E),m(e,o),h()}globalThis.bitsIdCounter??={current:0};function pi(e=`bits`){return globalThis.bitsIdCounter.current++,`${e}-${globalThis.bitsIdCounter.current}`}var mi=class{#e;#t=0;#n=D();#r;constructor(e){this.#e=e}#i(){--this.#t,this.#r&&this.#t<=0&&(this.#r(),C(this.#n,void 0),this.#r=void 0)}get(...e){return this.#t+=1,_(this.#n)===void 0&&(this.#r=ae(()=>{C(this.#n,this.#e(...e),!0)})),j(()=>()=>{this.#i()}),_(this.#n)}},hi=new rt,gi=D(null),_i=null,vi=null,yi=!1,bi=L(()=>{for(let e of hi.values())if(e)return!0;return!1}),xi=null,Si=new mi(()=>{function e(){document.body.setAttribute(`style`,_(gi)??``),document.body.style.removeProperty(`--scrollbar-width`),qt&&_i?.(),C(gi,null)}function t(){vi!==null&&(window.clearTimeout(vi),vi=null)}function n(e,n){t(),yi=!0,xi=Date.now();let r=xi,i=()=>{vi=null,xi===r&&(wi(hi)?yi=!1:(yi=!1,n()))},a=e===null?24:e;vi=window.setTimeout(i,a)}function r(){_(gi)===null&&hi.size===0&&!yi&&C(gi,document.body.getAttribute(`style`),!0)}return U(()=>bi.current,()=>{if(!bi.current)return;r(),yi=!1;let e=getComputedStyle(document.documentElement),t=getComputedStyle(document.body),n=e.scrollbarGutter?.includes(`stable`)||t.scrollbarGutter?.includes(`stable`),i=window.innerWidth-document.documentElement.clientWidth,a={padding:Number.parseInt(t.paddingRight??`0`,10)+i,margin:Number.parseInt(t.marginRight??`0`,10)};i>0&&!n&&(document.body.style.paddingRight=`${a.padding}px`,document.body.style.marginRight=`${a.margin}px`,document.body.style.setProperty(`--scrollbar-width`,`${i}px`)),document.body.style.overflow=`hidden`,qt&&(_i=A(document,`touchmove`,e=>{e.target===document.documentElement&&(e.touches.length>1||e.preventDefault())},{passive:!1})),G(()=>{document.body.style.pointerEvents=`none`,document.body.style.overflow=`hidden`})}),W(()=>()=>{_i?.()}),{get lockMap(){return hi},resetBodyStyle:e,scheduleCleanupIfNoNewLocks:n,cancelPendingCleanup:t,ensureInitialStyleCaptured:r}}),Ci=class{#e=pi();#t;#n=()=>null;#r;locked;constructor(e,t=()=>null){this.#t=e,this.#n=t,this.#r=Si.get(),this.#r&&(this.#r.cancelPendingCleanup(),this.#r.ensureInitialStyleCaptured(),this.#r.lockMap.set(this.#e,this.#t??!1),this.locked=L(()=>this.#r.lockMap.get(this.#e)??!1,e=>this.#r.lockMap.set(this.#e,e)),W(()=>{if(this.#r.lockMap.delete(this.#e),wi(this.#r.lockMap))return;let e=this.#n();this.#r.scheduleCleanupIfNoNewLocks(e,()=>{this.#r.resetBodyStyle()})}))}};function wi(e){for(let[t,n]of e)if(n)return!0;return!1}function Ti(e,t){i(t,!0);let n=y(t,`preventScroll`,3,!0),r=y(t,`restoreScrollDelay`,3,null);n()&&new Ci(n(),()=>r()),h()}var Ei=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`forceMount`,`child`,`children`,`ref`]),Di=n(`<div><!></div>`);function Oi(e,n){let r=o();i(n,!0);let a=y(n,`id`,19,()=>X(r)),s=y(n,`forceMount`,3,!1),c=y(n,`ref`,15,null),l=O(n,Ei),f=ln.create({id:L(()=>a()),ref:L(()=>c(),e=>c(e))}),p=w(()=>V(l,f.props));var g=P(),v=N(g),b=e=>{var r=P(),i=N(r),a=e=>{var t=P(),r=N(t);{let e=w(()=>({props:V(_(p)),...f.snippetProps}));d(r,()=>n.child,()=>_(e))}m(e,t)},o=e=>{var r=Di();S(r,e=>({...e}),[()=>V(_(p))]);var i=k(r);d(i,()=>n.children??E,()=>f.snippetProps),t(r),m(e,r)};u(i,e=>{n.child?e(a):e(o,-1)}),m(e,r)};u(v,e=>{(f.shouldRender||s())&&e(b)}),m(e,g),h()}var ki=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`children`,`child`,`ref`]),Ai=n(`<div><!></div>`);function ji(e,n){let r=o();i(n,!0);let a=y(n,`id`,19,()=>X(r)),s=y(n,`ref`,15,null),c=O(n,ki),l=sn.create({id:L(()=>a()),ref:L(()=>s(),e=>s(e))}),f=w(()=>V(c,l.props));var p=P(),g=N(p),v=e=>{var t=P(),r=N(t);d(r,()=>n.child,()=>({props:_(f)})),m(e,t)},b=e=>{var r=Ai();S(r,()=>({..._(f)}));var i=k(r);d(i,()=>n.children??E),t(r),m(e,r)};u(g,e=>{n.child?e(v):e(b,-1)}),m(e,p),h()}function Mi(e,t){i(t,!0);let n=y(t,`open`,15,!1),r=y(t,`onOpenChange`,3,Y),a=y(t,`onOpenChangeComplete`,3,Y);rn.create({variant:L(()=>`dialog`),open:L(()=>n(),e=>{n(e),r()(e)}),onOpenChangeComplete:L(()=>a())});var o=P(),s=N(o);d(s,()=>t.children??E),m(e,o),h()}var Ni=new Set([`$$slots`,`$$events`,`$$legacy`,`children`,`child`,`id`,`ref`,`disabled`]),Pi=n(`<button><!></button>`);function Fi(e,n){let r=o();i(n,!0);let a=y(n,`id`,19,()=>X(r)),s=y(n,`ref`,15,null),c=y(n,`disabled`,3,!1),l=O(n,Ni),f=an.create({variant:L(()=>`close`),id:L(()=>a()),ref:L(()=>s(),e=>s(e)),disabled:L(()=>!!c())}),p=w(()=>V(l,f.props));var g=P(),v=N(g),b=e=>{var t=P(),r=N(t);d(r,()=>n.child,()=>({props:_(p)})),m(e,t)},x=e=>{var r=Pi();S(r,()=>({..._(p)}));var i=k(r);d(i,()=>n.children??E),t(r),m(e,r)};u(v,e=>{n.child?e(b):e(x,-1)}),m(e,g),h()}var Ii=new Set([`$$slots`,`$$events`,`$$legacy`,`id`,`children`,`child`,`ref`,`forceMount`,`onCloseAutoFocus`,`onOpenAutoFocus`,`onEscapeKeydown`,`onInteractOutside`,`trapFocus`,`preventScroll`,`restoreScrollDelay`]),Li=n(`<!> <!>`,1),Ri=n(`<!> <div><!></div>`,1);function zi(e,n){let r=o();i(n,!0);let a=y(n,`id`,19,()=>X(r)),s=y(n,`ref`,15,null),c=y(n,`forceMount`,3,!1),l=y(n,`onCloseAutoFocus`,3,Y),f=y(n,`onOpenAutoFocus`,3,Y),p=y(n,`onEscapeKeydown`,3,Y),g=y(n,`onInteractOutside`,3,Y),v=y(n,`trapFocus`,3,!0),b=y(n,`preventScroll`,3,!0),x=y(n,`restoreScrollDelay`,3,null),ee=O(n,Ii),C=cn.create({id:L(()=>a()),ref:L(()=>s(),e=>s(e))}),T=w(()=>V(ee,C.props));var te=P(),ne=N(te),D=e=>{ai(e,{get ref(){return C.opts.ref},loop:!0,get trapFocus(){return v()},get enabled(){return C.root.opts.open.current},get onOpenAutoFocus(){return f()},get onCloseAutoFocus(){return l()},focusScope:(e,r)=>{let i=()=>(r?.()).props;ni(e,M(()=>_(T),{get enabled(){return C.root.opts.open.current},get ref(){return C.opts.ref},onEscapeKeydown:e=>{p()(e),!e.defaultPrevented&&C.root.handleClose()},children:(e,r)=>{$r(e,M(()=>_(T),{get ref(){return C.opts.ref},get enabled(){return C.root.opts.open.current},onInteractOutside:e=>{g()(e),!e.defaultPrevented&&C.root.handleClose()},children:(e,r)=>{fi(e,M(()=>_(T),{get ref(){return C.opts.ref},get enabled(){return C.root.opts.open.current},children:(e,r)=>{var a=P(),o=N(a),s=e=>{var t=Li(),r=N(t),a=e=>{Ti(e,{get preventScroll(){return b()},get restoreScrollDelay(){return x()}})};u(r,e=>{C.root.opts.open.current&&e(a)});var o=re(r,2);{let e=w(()=>({props:V(_(T),i()),...C.snippetProps}));d(o,()=>n.child,()=>_(e))}m(e,t)},c=e=>{var r=Ri(),a=N(r);Ti(a,{get preventScroll(){return b()}});var o=re(a,2);S(o,e=>({...e}),[()=>V(_(T),i())]);var s=k(o);d(s,()=>n.children??E),t(o),m(e,r)};u(o,e=>{n.child?e(s):e(c,-1)}),m(e,a)},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{default:!0}}))},$$slots:{focusScope:!0}})};u(ne,e=>{(C.shouldRender||c())&&e(D)}),m(e,te),h()}var Bi=new Set([`$$slots`,`$$events`,`$$legacy`,`open`]);function Vi(e,t){i(t,!0);let n=y(t,`open`,15,!1),r=O(t,Bi);var o=P(),s=N(o);a(s,()=>Mi,(e,t)=>{t(e,M(()=>r,{get open(){return n()},set open(e){n(e)}}))}),m(e,o),h()}var Hi=new Set([`$$slots`,`$$events`,`$$legacy`]);function Ui(e,t){let n=O(t,Hi);var r=P(),i=N(r);a(i,()=>bn,(e,t)=>{t(e,M(()=>n))}),m(e,r)}var Wi=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function Gi(e,t){i(t,!0);let n=y(t,`ref`,15,null),r=O(t,Wi);var o=P(),s=N(o);{let e=w(()=>F(`text-sm font-medium`,t.class));a(s,()=>fn,(t,i)=>{i(t,M({"data-slot":`dialog-title`,get class(){return _(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}m(e,o),h()}var Ki=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`children`,`showCloseButton`]),qi=n(`<div><!> <!></div>`);function Ji(e,n){i(n,!0);let r=y(n,`ref`,15,null),o=y(n,`showCloseButton`,3,!1),s=O(n,Ki);var c=qi();S(c,e=>({"data-slot":`dialog-footer`,class:e,...s}),[()=>F(`gap-2 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,n.class)]);var l=k(c);d(l,()=>n.children??E);var f=re(l,2),p=e=>{var t=P(),n=N(t);{let e=(e,t)=>{ue(e,M({variant:`outline`},()=>(t?.()).props,{children:(e,t)=>{te();var n=g(`Close`);m(e,n)},$$slots:{default:!0}}))};a(n,()=>Fi,(t,n)=>{n(t,{child:e,$$slots:{child:!0}})})}m(e,t)};u(f,e=>{o()&&e(p)}),t(c),ne(c,e=>r(e),()=>r()),m(e,c),h()}var Yi=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`children`]),Xi=n(`<div><!></div>`);function Zi(e,n){i(n,!0);let r=y(n,`ref`,15,null),a=O(n,Yi);var o=Xi();S(o,e=>({"data-slot":`dialog-header`,class:e,...a}),[()=>F(`gap-1 flex flex-col`,n.class)]);var s=k(o);d(s,()=>n.children??E),t(o),ne(o,e=>r(e),()=>r()),m(e,o),h()}var Qi=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function $i(e,t){i(t,!0);let n=y(t,`ref`,15,null),r=O(t,Qi);var o=P(),s=N(o);{let e=w(()=>F(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/80 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50`,t.class));a(s,()=>Oi,(t,i)=>{i(t,M({"data-slot":`dialog-overlay`,get class(){return _(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}m(e,o),h()}var ea=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`,`portalProps`,`children`,`showCloseButton`]),ta=n(`<!> <span class="sr-only">Close</span>`,1),na=n(`<!> <!>`,1);function ra(e,t){i(t,!0);let n=y(t,`ref`,15,null),r=y(t,`showCloseButton`,3,!0),o=O(t,ea);Ui(e,M(()=>t.portalProps,{children:(e,i)=>{var s=na(),c=N(s);a(c,()=>$i,(e,t)=>{t(e,{})});var l=re(c,2);{let e=w(()=>F(`bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-4 rounded-xl p-4 text-xs/relaxed ring-1 duration-100 sm:max-w-sm fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none`,t.class));a(l,()=>zi,(i,s)=>{s(i,M({"data-slot":`dialog-content`,get class(){return _(e)}},()=>o,{get ref(){return n()},set ref(e){n(e)},children:(e,n)=>{var i=na(),o=N(i);d(o,()=>t.children??E);var s=re(o,2),c=e=>{var t=P(),n=N(t);{let e=(e,t)=>{ue(e,M({variant:`ghost`,class:`absolute top-2 right-2`,size:`icon-sm`},()=>(t?.()).props,{children:(e,t)=>{var n=ta(),r=N(n);de(r,{}),te(2),m(e,n)},$$slots:{default:!0}}))};a(n,()=>Fi,(t,n)=>{n(t,{"data-slot":`dialog-close`,child:e,$$slots:{child:!0}})})}m(e,t)};u(s,e=>{r()&&e(c)}),m(e,i)},$$slots:{default:!0}}))})}m(e,s)},$$slots:{default:!0}})),h()}var ia=new Set([`$$slots`,`$$events`,`$$legacy`,`ref`,`class`]);function aa(e,t){i(t,!0);let n=y(t,`ref`,15,null),r=O(t,ia);var o=P(),s=N(o);{let e=w(()=>F(`text-muted-foreground *:[a]:hover:text-foreground text-xs/relaxed *:[a]:underline *:[a]:underline-offset-3`,t.class));a(s,()=>ji,(t,i)=>{i(t,M({"data-slot":`dialog-description`,get class(){return _(e)}},()=>r,{get ref(){return n()},set ref(e){n(e)}}))})}m(e,o),h()}export{Ft as A,xt as B,X as C,Mt as D,Zt as E,Tt as F,U as G,ut as H,jt as I,Qe as J,H as K,kt as L,Lt as M,q as N,Nt as O,wt as P,Se as Q,Dt as R,bn as S,J as T,W as U,G as V,lt as W,ye as X,Je as Y,L as Z,Ur as _,Gi as a,Kr as b,pi as c,ni as d,$r as f,Wr as g,Gr as h,Ji as i,It as j,Pt as k,fi as l,Vr as m,ra as n,Vi as o,qr as p,V as q,Zi as r,Ti as s,aa as t,ai as u,Br as v,Y as w,Tn as x,zr as y,K as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{$ as e,At as t,B as n,Ct as r,D as i,F as a,N as o,R as s,St as c,X as l,bt as u,ct as d,ft as f,gt as p,it as m,l as h,lt as g,mt as _,nt as ee,ot as v,rt as y,st as te,wt as b,xt as x,z as ne}from"./CmCJ0SKP.js";import{t as S}from"./DjZ7hdjX.js";import"./xihTtKlq.js";import{t as C}from"./BDMeqoYB.js";import"./eFUKcYMv.js";import{D as w,S as T,T as E,w as D}from"./pd7EK5wP.js";function O(e){return e.activities.find(e=>e.entry)??e.activities[0]}var k=class{entries=new Map;register(e){this.entries.set(e.id,e)}get(e){return this.entries.get(e)}list(){return[...this.entries.values()]}findByPath(e){for(let t of this.entries.values()){let n=t.absolutePattern.replace(/:[^/]+/g,`[^/]+`);try{if(RegExp(`^${n.replace(/\//g,`\\/`)}\\/?$`).test(e))return t}catch{}}}},A=class{apps=new Map;register(e){this.apps.set(e.id,e)}get(e){return this.apps.get(e)}list(){return[...this.apps.values()]}},j=new k,M=new A;function N(e){let t={id:e.id,pattern:e.pattern,params:e.params,search:e.search,component:e.component,children:e.children};return F(t,t.pattern||`/`),t}function P(e,t){I(e,t)}function F(e,t){if(j.register({id:e.id,route:e,absolutePattern:t}),e.children)for(let n of e.children)F(n,L(t,n.pattern))}function I(e,t){let n=L(e,t.pattern);if(j.register({id:t.id,route:t,absolutePattern:n}),t.children)for(let e of t.children)I(n,e)}function L(e,t){let n=e.replace(/\/+$/,``),r=t.replace(/^\/+|\/+$/g,``);return r===``?n||`/`:`${n}/${r}`}function re(e){return P(e.pattern,e.root),{pattern:e.pattern,root:e.root,entry:e.entry}}function ie(e){return{id:e.id,pattern:``,search:e.search,component:e.component}}function ae(e){return M.register(e),{manifest:e}}function oe(e){let t=Object.entries(e).filter(([,e])=>e!=null);if(t.length===0)return``;let n=new URLSearchParams;for(let[e,r]of t)n.set(e,typeof r==`string`?r:String(r));let r=n.toString();return r?`?${r}`:``}function R(e){let t=e.startsWith(`?`)?e.slice(1):e;if(!t)return{};let n={},r=new URLSearchParams(t);for(let[e,t]of r)n[e]=t;return n}function z(e,t,n,r){let i=V(e,ce(se(t,r)),r);if(i.length===0)return{kind:`no-match`,reason:`no-route`};let a=H(i),o=i[i.length-1].route,s=o.params;if(s){let e=s.safeParse(a);if(!e.success)return{kind:`parse-error`,reason:`params`,chain:i,errors:e.error}}let c=o.search;if(c){let e=R(n),t=c.safeParse(e);if(!t.success)return{kind:`parse-error`,reason:`search`,chain:i,errors:t.error}}return{kind:`matched`,chain:i}}function se(e,t){let n=t.replace(/\/+$/,``);return e===n?``:e.startsWith(n+`/`)?e.slice(n.length):e}function ce(e){let t=e.replace(/^\/+|\/+$/g,``);return t===``?[]:t.split(`/`).map(e=>{try{return decodeURIComponent(e)}catch{return e}})}function le(e){let t=e.replace(/^\/+|\/+$/g,``);return t===``?[]:t.split(`/`).map(e=>e.startsWith(`:`)?{kind:`param`,value:e.slice(1)}:{kind:`static`,value:e})}function B(e,t){let n=e.replace(/\/+$/,``),r=t.replace(/^\/+|\/+$/g,``);return r===``?n:`${n}/${r}`}function V(e,t,n){let r=B(n,e.pattern),i=le(e.pattern);if(t.length<i.length)return[];let a={};for(let e=0;e<i.length;e++){let n=i[e],r=t[e];if(!r)return[];if(n.kind===`static`){if(n.value!==r)return[]}else a[n.value]=r}let o={absolutePattern:r,route:e,rawParams:a},s=t.slice(i.length);if(s.length===0)return[o];if(e.children&&e.children.length>0)for(let t of e.children){let e=V(t,s,r);if(e.length>0)return[o,...e]}return[]}function H(e){let t={};for(let n of e)Object.assign(t,n.rawParams);return t}var U=/:([A-Za-z_][A-Za-z0-9_]*)/g;function W(e,t){return e.replace(U,(e,n)=>{let r=t[n];return r===void 0?`:${n}`:encodeURIComponent(r)})}var G=`/workspaces`;function ue(e,t){let n=de(e),r=n?M.get(n):void 0;if(!r)return{kind:`redirect`,path:G};let i=O(r);if(!i)return{kind:`redirect`,path:G};for(let n of r.activities){let r=z(n.root,e,t,n.pattern);if(r.kind===`matched`)return{kind:`ok`};if(r.kind===`parse-error`)return r.reason===`params`?{kind:`redirect`,path:i.pattern}:{kind:`redirect`,path:e}}return{kind:`redirect`,path:i.pattern}}function de(e){let t=e.replace(/^\/+/,``);return t?t.split(`/`)[0]??null:null}var K=null;function fe(e){K=e}function pe(e,t,n){let r=j.get(e);return r?he(r.absolutePattern,t,n):`/`}function me(e,t,n,r){let i=pe(e,t,n);K?.navigate(i,r)}function he(e,t,n){return`${W(e,t??{})}${n?oe(n):``}`}var ge=Symbol(`skill-creator:portal-target`),_e=Symbol(`skill-creator:app-context`);function ve(e){b(ge,e)}function ye(e){b(_e,e)}var q=Symbol(`skill-creator:router`);function be(e){b(q,{get:e})}function xe(){if(!x(q))return;let e=u(q).get;return()=>e().params}function Se(){if(!x(q))return;let e=u(q).get;return()=>e().search}function J(e){let t=e.replace(/^\/+|\/+$/g,``);if(!t)return null;let n=t.split(`/`),r=n[0];return r?{app:r,instanceKey:n[1]??`home`}:null}var Ce={navigate(e,t=`PUSH`){t===`REPLACE`?S(e,{replaceState:!0,keepFocus:!0,noScroll:!0}):S(e)},replace(e){this.navigate(e,`REPLACE`)}},Y=`skill-creator:device-prefs`,X=w({version:E(1),theme:T([`light`,`dark`,`system`]).default(`system`),sidebarCollapsed:D().default(!1)}),Z={version:1,theme:`system`,sidebarCollapsed:!1};function Q(){if(typeof localStorage>`u`)return{...Z};try{let e=localStorage.getItem(Y);if(!e)return{...Z};let t=X.safeParse(JSON.parse(e));return t.success?t.data:{...Z}}catch{return{...Z}}}function $(e){if(!(typeof localStorage>`u`))try{let t=X.parse(e);localStorage.setItem(Y,JSON.stringify(t))}catch{}}function we(e){let t={...Q(),...e,version:1};return $(t),t}var Te=n(`<div class="app-shell-error svelte-1oszhz"> </div>`),Ee=n(`<div class="app-shell-loading svelte-1oszhz" aria-label="Loading"></div>`),De=n(`<div class="app-shell-empty svelte-1oszhz">No route matched</div>`),Oe=n(`<div class="app-shell svelte-1oszhz"><!> <div class="app-portal-root svelte-1oszhz"></div></div>`);function ke(n,u){r(u,!0);let m=_(null),b=p(()=>z(u.activity.root,C.url.pathname,C.url.search,u.activity.pattern)),x=p(()=>l(b).kind===`matched`?l(b).chain:[]),S=p(()=>k(l(x))),w=p(()=>A(l(b),l(x)));ve(()=>l(m)),ye({get manifest(){return{id:u.app.id,name:u.app.name,icon:u.app.icon}},get pathname(){return C.url.pathname}}),be(()=>({match:l(b),params:l(S),search:l(w),chain:l(x)}));let T=_(null),E=_(null),D=null,O=0;y(()=>{let t=(l(x).length>0?l(x)[l(x).length-1]:void 0)?.route,n=e(()=>D);if(!t){D=null,O+=1,f(T,null),f(E,null);return}if(n===t)return;D=t,f(T,null),f(E,null);let r=++O;t.component().then(e=>{r===O&&f(T,e.default,!0)}).catch(e=>{r===O&&f(E,e instanceof Error?e.message:String(e),!0)})});function k(e){if(e.length===0)return;let t={};for(let n of e)Object.assign(t,n.rawParams);return t}function A(e,t){if(e.kind===`no-match`||t.length===0)return;let n=t[t.length-1]?.route.search;if(!n)return;let r=n.safeParse(R(C.url.search));return r.success?r.data:void 0}var j=Oe(),M=v(j),N=e=>{var t=Te(),n=d(t);ee(()=>a(n,`Failed to load: ${l(E)??``}`)),s(e,t)},P=e=>{let t=p(()=>l(T));var n=ne(),r=te(n);i(r,()=>l(t),(e,t)=>{t(e,{})}),s(e,n)},F=e=>{var t=Ee();s(e,t)},I=e=>{var t=De();s(e,t)};o(M,e=>{l(E)?e(N):l(T)?e(P,1):l(x).length>0?e(F,2):e(I,-1)});var L=g(M,2);h(L,e=>f(m,e),()=>l(m)),t(j),s(n,j),c()}var Ae=n(`<div class="tab-empty svelte-t4mhty">Select an app from the sidebar.</div>`),je=n(`<div class="tab-outlet-root svelte-t4mhty"><!></div>`);function Me(e,n){r(n,!0);let i=p(()=>C.url.pathname),a=p(()=>J(l(i))?.app??null),u=p(()=>l(a)?M.get(l(a)):null);m(()=>{let e=ue(l(i),C.url.search);e.kind===`redirect`&&(e.path!==l(i)||C.url.search)&&Ce.replace(e.path)});let d=p(()=>{if(!l(u))return null;for(let e of l(u).activities)if(z(e.root,l(i),C.url.search,e.pattern).kind===`matched`)return e;return l(u).activities.find(e=>e.entry)??l(u).activities[0]??null});var f=je(),h=v(f),g=e=>{ke(e,{get app(){return l(u)},get activity(){return l(d)}})},_=e=>{var t=Ae();s(e,t)};o(h,e=>{l(u)&&l(d)?e(g):e(_,-1)}),t(f),s(e,f),c()}export{xe as a,fe as c,ie as d,N as f,J as i,ae as l,Q as n,Se as o,M as p,we as r,me as s,Me as t,re as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e,s as t,ut as n}from"./CmCJ0SKP.js";import"./xihTtKlq.js";import{t as r}from"./BkEnd9_Z.js";import{a as i,o as a,t as o}from"./pd7EK5wP.js";var s=new Set([`$$slots`,`$$events`,`$$legacy`]);function c(n,i){let a=e(i,s),o=[[`path`,{d:`M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z`}],[`path`,{d:`m7 16.5-4.74-2.85`}],[`path`,{d:`m7 16.5 5-3`}],[`path`,{d:`M7 16.5v5.17`}],[`path`,{d:`M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z`}],[`path`,{d:`m17 16.5-5-3`}],[`path`,{d:`m17 16.5 4.74-2.85`}],[`path`,{d:`M17 16.5v5.17`}],[`path`,{d:`M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z`}],[`path`,{d:`M12 8 7.26 5.15`}],[`path`,{d:`m12 8 4.74-2.85`}],[`path`,{d:`M12 13.5V8`}]];r(n,t({name:`boxes`},()=>a,{get iconNode(){return o}}))}var l=o(i),u=o(i),d=n({status:null,loading:!1});async function f(){let e=l.issue(),t=a();if(!t){e.isLatest()&&(d.loading=!1);return}d.loading=!0;try{let n=await t.selfSkill.state({});if(!e.isCurrent())return;d.status=n}catch{e.isCurrent()&&(d.status=null)}finally{e.isLatest()&&(d.loading=!1)}}async function p(e){let t=u.issue(),n=a();if(!n)return{ok:!1,reason:`Not connected to the daemon.`};try{let r=await n.selfSkill.resolve({backup:e});return r.ok&&t.isCurrent()&&f(),r}catch(e){return{ok:!1,reason:e instanceof Error?e.message:String(e)}}}async function m(){let e=u.issue(),t=a();if(!t)return{ok:!1,reason:`Not connected to the daemon.`};try{let n=await t.selfSkill.keep({});return n.ok&&e.isCurrent()&&f(),n}catch(e){return{ok:!1,reason:e instanceof Error?e.message:String(e)}}}var h=n({open:!1});function g(){h.open=!0}var _=new Set([`$$slots`,`$$events`,`$$legacy`]);function v(n,i){let a=e(i,_),o=[[`path`,{d:`M12 10v6`}],[`path`,{d:`M9 13h6`}],[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`}]];r(n,t({name:`folder-plus`},()=>a,{get iconNode(){return o}}))}var y=new Set([`$$slots`,`$$events`,`$$legacy`]);function b(n,i){let a=e(i,y),o=[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`}]];r(n,t({name:`message-square`},()=>a,{get iconNode(){return o}}))}var x=new Set([`$$slots`,`$$events`,`$$legacy`]);function S(n,i){let a=e(i,x),o=[[`path`,{d:`M13 21h8`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`}]];r(n,t({name:`pen-line`},()=>a,{get iconNode(){return o}}))}export{g as a,p as c,h as i,d as l,b as n,m as o,v as r,f as s,S as t,c as u};
|