@engenty/wizards-runtime 0.20.2 → 0.20.4

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.
Files changed (28) hide show
  1. package/README.md +1 -1
  2. package/apps/runtime/dist/docs/dev/licensing.md +11 -4
  3. package/apps/web/dist/assets/{AboutDialog-CSbCideu.js → AboutDialog-CQvfeGqA.js} +1 -1
  4. package/apps/web/dist/assets/{CapabilitiesPage-M2s68GkB.js → CapabilitiesPage-DJRpCw2_.js} +1 -1
  5. package/apps/web/dist/assets/{ChangelogDialog-BG3enhF_.js → ChangelogDialog-F7gj0WCW.js} +1 -1
  6. package/apps/web/dist/assets/{ConnectorsSection-C2ZKAYYg.js → ConnectorsSection-dXmTJOrm.js} +1 -1
  7. package/apps/web/dist/assets/{EditorPage-DrlMr_BY.js → EditorPage-DNox0Po-.js} +1 -1
  8. package/apps/web/dist/assets/{NewWizardChannels-5Nz8FBfp.js → NewWizardChannels-BugegWm1.js} +1 -1
  9. package/apps/web/dist/assets/{NewWizardPage-DZZx49Zp.js → NewWizardPage-Df359wgE.js} +1 -1
  10. package/apps/web/dist/assets/{ProtocolSection-D4pst4zv.js → ProtocolSection-B1tcJgJl.js} +1 -1
  11. package/apps/web/dist/assets/{ReadOnly-CcHDevY4.js → ReadOnly-DxC8kALr.js} +1 -1
  12. package/apps/web/dist/assets/{Results-DTEHveBZ.js → Results-D6ecFiSB.js} +1 -1
  13. package/apps/web/dist/assets/{RunDrawer-r6eFEs5D.js → RunDrawer-oPFk8yHt.js} +1 -1
  14. package/apps/web/dist/assets/{SettingsPage-DmZdkZJZ.js → SettingsPage-DueaPjW3.js} +2 -2
  15. package/apps/web/dist/assets/{SetupPage-KE6tcFO2.js → SetupPage-k61GmbIs.js} +1 -1
  16. package/apps/web/dist/assets/{SpacePage-BdB2lsHC.js → SpacePage-z66Mza2y.js} +1 -1
  17. package/apps/web/dist/assets/{StudioHome-Dc4vCVDX.js → StudioHome-q1f_vqAI.js} +1 -1
  18. package/apps/web/dist/assets/{TableEditor-DjIhH4Xp.js → TableEditor-Dfu5Qa-O.js} +1 -1
  19. package/apps/web/dist/assets/{UpdateCheck-C82R62Tc.js → UpdateCheck-y1StF2CW.js} +2 -2
  20. package/apps/web/dist/assets/changelog-DoEmFdnI.js +1 -0
  21. package/apps/web/dist/assets/{host-CA1dqZWL.js → host-Bh_WJbQv.js} +3 -3
  22. package/apps/web/dist/assets/{index-BtEYkDXF.js → index-CgSUfzBq.js} +3 -3
  23. package/apps/web/dist/assets/{oss-credits-B8LDQxiG.js → oss-credits-C4SGbRkz.js} +1 -1
  24. package/apps/web/dist/index.html +4 -4
  25. package/package.json +1 -1
  26. package/plugin/.claude-plugin/plugin.json +1 -1
  27. package/plugin/plugin.json +1 -1
  28. package/apps/web/dist/assets/changelog-BqBrvuEE.js +0 -1
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/BlockEditor-CgjXTWly.js","assets/rolldown-runtime-XKyaHtl9.js","assets/w3c-keyname-BOAvb0qz.js","assets/jsx-runtime-C3cWAN_r.js","assets/react-dom-BwXff0Px.js","assets/with-selector-DNNxLmGI.js","assets/floating-ui.dom-S_FT_s1L.js","assets/marked.esm-BfGIZK7F.js","assets/code-hPTnSH4L.js","assets/link-DyYjkzYx.js","assets/list-checks-D1zkXlZa.js","assets/list-ordered-B7aUqZdk.js","assets/table-BEbwD8ie.js","assets/upload-BZThm-R6.js","assets/i18n-WXeVnv7i.js","assets/BlockEditor-CtW6lw0y.css","assets/viewers-CmGDpBjn.js","assets/dist-Bux-wzFO.js","assets/ui-DkEhb2Rt.js","assets/preload-helper-Cj7BV335.js","assets/code-editor-CufyaUFC.js","assets/Marketplace-B3NoH5Va.js","assets/useMutation-BSffqL6W.js","assets/volume-2-Br71vpS5.js","assets/eye-CG1LzvNI.js","assets/plug-CHvl1GhO.js","assets/brand-BIT7AumL.js","assets/engenty-Cy7MbUxR.js","assets/logo-xL-sneZz.js","assets/session-RDdtfee2.js","assets/AboutDialog-CSbCideu.js","assets/UpdateCheck-C82R62Tc.js","assets/media-gjOIWMWK.js","assets/ChangelogDialog-BG3enhF_.js"])))=>i.map(i=>d[i]);
2
- import{n as e,r as t,t as n}from"./rolldown-runtime-XKyaHtl9.js";import{n as r,t as i}from"./jsx-runtime-C3cWAN_r.js";import{$ as a,$n as o,Bn as s,C as c,Cn as l,Dn as u,Fn as d,G as f,Gn as p,In as m,J as h,Jn as g,K as _,Kn as v,Ln as y,Nn as b,On as x,Q as S,Qn as C,Rn as w,S as T,Sn as E,Sr as D,Tn as O,U as k,Un as A,Vn as j,W as M,X as N,Yn as P,Z as F,Zn as I,Zt as L,a as R,an as z,ar as B,at as ee,bn as V,br as te,c as ne,cn as H,ct as U,d as re,dn as ie,dt as ae,er as oe,et as se,f as ce,fn as le,fr as ue,gn as de,hn as fe,hr as pe,i as me,it as he,jn as ge,jt as _e,kn as ve,kt as ye,l as be,ln as xe,lr as Se,lt as Ce,mn as we,mr as Te,mt as Ee,ni as De,o as Oe,on as ke,pr as Ae,q as je,rr as Me,sn as Ne,sr as Pe,st as Fe,t as Ie,tr as Le,un as Re,ur as ze,v as Be,vn as Ve,vr as He,xn as W,xr as Ue,yn as We,yr as Ge,zr as Ke}from"./ui-DkEhb2Rt.js";import{A as qe,C as Je,M as Ye,N as Xe,O as Ze,T as Qe,i as $e,k as et,x as tt,y as nt}from"./Marketplace-B3NoH5Va.js";import{t as rt}from"./useMutation-BSffqL6W.js";import{t as it}from"./react-dom-BwXff0Px.js";import{c as at,d as G,i as ot,l as st,n as ct,o as lt,r as ut,s as dt,u as ft}from"./marked.esm-BfGIZK7F.js";import{n as pt,r as mt,t as ht}from"./volume-2-Br71vpS5.js";import{n as gt,t as _t}from"./scroll-text-DmK2IucJ.js";import{t as vt}from"./eye-CG1LzvNI.js";import{d as yt,f as bt,i as xt,l as St,m as Ct,n as wt,p as Tt,r as Et,s as Dt}from"./read-aloud-CRFt5q6k.js";import{n as Ot,t as kt}from"./list-checks-D1zkXlZa.js";import{A as At,C as jt,D as Mt,E as Nt,O as Pt,S as Ft,T as It,_ as Lt,a as Rt,b as zt,c as Bt,d as Vt,f as Ht,g as Ut,h as Wt,i as Gt,k as Kt,l as qt,m as Jt,p as Yt,r as Xt,u as Zt,v as Qt,w as $t,x as en,y as tn}from"./floating-ui.dom-S_FT_s1L.js";import{_ as nn,a as rn,d as an,g as on,h as sn,i as cn,m as ln,n as un,o as dn,s as fn,t as pn}from"./brand-BIT7AumL.js";import{t as mn}from"./plug-CHvl1GhO.js";import{t as hn}from"./upload-BZThm-R6.js";import{t as gn}from"./logo-xL-sneZz.js";import{$t as _n,F as vn,Gt as yn,Ht as bn,Jt as xn,Kt as Sn,P as Cn,Qt as wn,R as Tn,Rt as En,T as Dn,Ut as On,Vt as kn,Wt as An,Xt as jn,Yt as Mn,Zt as Nn,an as Pn,b as Fn,en as In,in as Ln,n as Rn,nn as zn,qt as Bn,rn as Vn,s as K,tn as Hn,z as Un}from"./i18n-WXeVnv7i.js";import{t as Wn}from"./preload-helper-Cj7BV335.js";import{b as Gn,d as Kn,h as qn,m as Jn,n as Yn,p as Xn,s as Zn,u as Qn}from"./session-RDdtfee2.js";import{t as $n}from"./media-gjOIWMWK.js";import{d as er,g as tr,h as nr,l as rr,n as ir,p as ar,s as or}from"./UpdateCheck-C82R62Tc.js";import{n as sr,t as cr}from"./with-selector-DNNxLmGI.js";import{t as lr}from"./code-editor-CufyaUFC.js";import{r as ur,t as dr}from"./LangSwitch-BLB7dDce.js";var fr={name:`a-large-small`,size:24,node:[[`path`,{d:`m15 16 2.536-7.328a1.02 1.02 1 0 1 1.928 0L22 16`,key:`xik6mr`}],[`path`,{d:`M15.697 14h5.606`,key:`1stdlc`}],[`path`,{d:`m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16`,key:`d5nyq2`}],[`path`,{d:`M3.304 13h6.392`,key:`1q3zxz`}]]};fr.node;var pr=G(fr),mr={name:`activity`,size:24,node:[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]};mr.node;var hr=G(mr),gr={name:`archive-arrow-up`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`,key:`tvwodi`}],[`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`,key:`1gkqxj`}],[`path`,{d:`m9 15 3-3 3 3`,key:`1pd0qc`}],[`path`,{d:`M12 12v9`,key:`192myk`}]],aliases:[`archive-restore`]};gr.node;var _r=G(gr),vr={name:`archive`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]};vr.node;var yr=G(vr),br={name:`arrow-left-right`,size:24,node:[[`path`,{d:`M8 3 4 7l4 4`,key:`9rb6wj`}],[`path`,{d:`M4 7h16`,key:`6tx8e3`}],[`path`,{d:`m16 21 4-4-4-4`,key:`siv7j2`}],[`path`,{d:`M20 17H4`,key:`h6l3hr`}]]};br.node;var xr=G(br),Sr={name:`arrow-up-right`,size:24,node:[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]};Sr.node;var Cr=G(Sr),wr={name:`arrow-up-to-line`,size:24,node:[[`path`,{d:`M5 3h14`,key:`7usisc`}],[`path`,{d:`m18 13-6-6-6 6`,key:`1kf1n9`}],[`path`,{d:`M12 7v14`,key:`1akyts`}]]};wr.node;var Tr=G(wr),Er={name:`blocks`,size:24,node:[[`path`,{d:`M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2`,key:`1ah6g2`}],[`rect`,{x:`14`,y:`2`,width:`8`,height:`8`,rx:`1`,key:`88lufb`}]]};Er.node;var Dr=G(Er),Or={name:`book-open`,size:24,node:[[`path`,{d:`M12 5v16`,key:`1f6ucr`}],[`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`,key:`1fyvmf`}]]};Or.node;var kr=G(Or),Ar={name:`book-plus`,size:24,node:[[`path`,{d:`M12 7v6`,key:`lw1j43`}],[`path`,{d:`M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20`,key:`k3hazp`}],[`path`,{d:`M9 10h6`,key:`9gxzsh`}]]};Ar.node;var jr=G(Ar),Mr={name:`brain`,size:24,node:[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 01-3-4 4.17 4.17 0 01-3 4`,key:`5nuw1p`}],[`path`,{d:`M17.707 6.294A3 3 0 1012 5a3 3 0 10-5.707 1.294`,key:`18ldcf`}],[`path`,{d:`M17.996 5.125a4 4 0 012.526 5.77`,key:`1sdu8q`}],[`path`,{d:`M18 18a4 4 0 002-7.465`,key:`7xqqvr`}],[`path`,{d:`M19.967 17.482a4 4 0 11-7.967.517 4 4 0 11-7.967-.517`,key:`t46ysz`}],[`path`,{d:`M6 18a4 4 0 01-2-7.465`,key:`1y2m15`}],[`path`,{d:`M6.004 5.125a4 4 0 00-2.526 5.77`,key:`3cw1ss`}]]};Mr.node;var Nr=G(Mr),Pr={name:`building-complex`,size:24,node:[[`path`,{d:`M10 12h4`,key:`a56b0p`}],[`path`,{d:`M10 8h4`,key:`1sr2af`}],[`path`,{d:`M14 21v-3a2 2 0 0 0-4 0v3`,key:`1rgiei`}],[`path`,{d:`M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2`,key:`secmi2`}],[`path`,{d:`M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16`,key:`16ra0t`}]],aliases:[`building-2`]};Pr.node;var Fr=G(Pr),Ir={name:`cable`,size:24,node:[[`path`,{d:`M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z`,key:`trhst0`}],[`path`,{d:`M17 21v-2`,key:`ds4u3f`}],[`path`,{d:`M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10`,key:`1mo9zo`}],[`path`,{d:`M21 21v-2`,key:`eo0ou`}],[`path`,{d:`M3 5V3`,key:`1k5hjh`}],[`path`,{d:`M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z`,key:`1dd30t`}],[`path`,{d:`M7 5V3`,key:`1t1388`}]]};Ir.node;var Lr=G(Ir),Rr={name:`calendar`,size:24,node:[[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]};Rr.node;var zr=G(Rr),Br={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};Br.node;var Vr=G(Br),Hr={name:`chevrons-up-down`,size:24,node:[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]};Hr.node;var Ur=G(Hr),Wr={name:`circle-exclamation-point`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`,`circle-alert`]};Wr.node;var Gr=G(Wr),Kr={name:`circle-pause`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`10`,x2:`10`,y1:`15`,y2:`9`,key:`c1nkhi`}],[`line`,{x1:`14`,x2:`14`,y1:`15`,y2:`9`,key:`h65svq`}]],aliases:[`pause-circle`]};Kr.node;var qr=G(Kr),Jr={name:`circle-question-mark`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`help-circle`,`circle-help`]};Jr.node;var Yr=G(Jr),Xr={name:`cloud-cog`,size:24,node:[[`path`,{d:`m10.852 19.772-.383.924`,key:`r7sl7d`}],[`path`,{d:`m13.148 14.228.383-.923`,key:`1d5zpm`}],[`path`,{d:`M13.148 19.772a3 3 0 1 0-2.296-5.544l-.383-.923`,key:`1ydik7`}],[`path`,{d:`m13.53 20.696-.382-.924a3 3 0 1 1-2.296-5.544`,key:`1m1vsf`}],[`path`,{d:`m14.772 15.852.923-.383`,key:`660p6e`}],[`path`,{d:`m14.772 18.148.923.383`,key:`hrcpis`}],[`path`,{d:`M4.2 15.1a7 7 0 1 1 9.93-9.858A7 7 0 0 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.2`,key:`j2q98n`}],[`path`,{d:`m9.228 15.852-.923-.383`,key:`1p9ong`}],[`path`,{d:`m9.228 18.148-.923.383`,key:`6558rz`}]]};Xr.node;var Zr=G(Xr),Qr={name:`cloud-exclamation-point`,size:24,node:[[`path`,{d:`M12 12v4`,key:`tww15h`}],[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.128 16.949A7 7 0 1 1 15.71 8h1.79a1 1 0 0 1 0 9h-1.642`,key:`1namsd`}]],aliases:[`cloud-alert`]};Qr.node;var $r=G(Qr),ei={name:`cloud`,size:24,node:[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]};ei.node;var ti=G(ei),ni={name:`cpu`,size:24,node:[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]};ni.node;var ri=G(ni),ii={name:`credit-card`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`2`,key:`ynyp8z`}],[`line`,{x1:`2`,x2:`22`,y1:`10`,y2:`10`,key:`1b3vmo`}],[`path`,{d:`M6 14h2`,key:`mk7k0u`}]]};ii.node;var ai=G(ii),oi={name:`eye-off`,size:24,node:[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};oi.node;var si=G(oi),ci={name:`file-code`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]};ci.node;var li=G(ci),ui={name:`file-image`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]};ui.node;var di=G(ui),fi={name:`file-question-mark`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}]],aliases:[`file-question`]};fi.node;var pi=G(fi),mi={name:`file-spreadsheet`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 13h2`,key:`yr2amv`}],[`path`,{d:`M14 13h2`,key:`un5t4a`}],[`path`,{d:`M8 17h2`,key:`2yhykz`}],[`path`,{d:`M14 17h2`,key:`10kma7`}]]};mi.node;var hi=G(mi),gi={name:`files`,size:24,node:[[`path`,{d:`M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8`,key:`14sh0y`}],[`path`,{d:`M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z`,key:`1970lx`}],[`path`,{d:`M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1`,key:`l4dndm`}]]};gi.node;var _i=G(gi),vi={name:`fingerprint-pattern`,size:24,node:[[`path`,{d:`M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4`,key:`1nerag`}],[`path`,{d:`M14 13.12c0 2.38 0 6.38-1 8.88`,key:`o46ks0`}],[`path`,{d:`M17.29 21.02c.12-.6.43-2.3.5-3.02`,key:`ptglia`}],[`path`,{d:`M2 12a10 10 0 0 1 18-6`,key:`ydlgp0`}],[`path`,{d:`M2 16h.01`,key:`1gqxmh`}],[`path`,{d:`M21.8 16c.2-2 .131-5.354 0-6`,key:`drycrb`}],[`path`,{d:`M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2`,key:`1tidbn`}],[`path`,{d:`M8.65 22c.21-.66.45-1.32.57-2`,key:`13wd9y`}],[`path`,{d:`M9 6.8a6 6 0 0 1 9 5.2v2`,key:`1fr1j5`}]],aliases:[`fingerprint`]};vi.node;var yi=G(vi),bi={name:`folder-open`,size:24,node:[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]};bi.node;var xi=G(bi),Si={name:`folder-plus`,size:24,node:[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`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`,key:`1kt360`}]]};Si.node;var Ci=G(Si),wi={name:`folder`,size:24,node:[[`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`,key:`1kt360`}]]};wi.node;var Ti=G(wi),Ei={name:`git-merge`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]};Ei.node;var Di=G(Ei),Oi={name:`hard-drive`,size:24,node:[[`path`,{d:`M10 16h.01`,key:`1bzywj`}],[`path`,{d:`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`18tbho`}],[`path`,{d:`M21.946 12.013H2.054`,key:`zqlbp7`}],[`path`,{d:`M6 16h.01`,key:`1pmjb7`}]]};Oi.node;var ki=G(Oi),Ai={name:`hash`,size:24,node:[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]};Ai.node;var ji=G(Ai),Mi={name:`highlighter`,size:24,node:[[`path`,{d:`m9 11-6 6v3h9l3-3`,key:`1a3l36`}],[`path`,{d:`m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4`,key:`14a9rk`}]]};Mi.node;var Ni=G(Mi),Pi={name:`house`,size:24,node:[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]],aliases:[`home`]};Pi.node;var Fi=G(Pi),Ii={name:`images`,size:24,node:[[`path`,{d:`m22 11-1.296-1.296a2.4 2.4 0 0 0-3.408 0L11 16`,key:`9kzy35`}],[`path`,{d:`M4 8a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2`,key:`1t0f0t`}],[`circle`,{cx:`13`,cy:`7`,r:`1`,fill:`currentColor`,key:`1obus6`}],[`rect`,{x:`8`,y:`2`,width:`14`,height:`14`,rx:`2`,key:`1gvhby`}]]};Ii.node;var Li=G(Ii),Ri={name:`inbox`,size:24,node:[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]};Ri.node;var zi=G(Ri),Bi={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]};Bi.node;var Vi=G(Bi),Hi={name:`key-round`,size:24,node:[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]};Hi.node;var Ui=G(Hi),Wi={name:`laptop`,size:24,node:[[`path`,{d:`M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z`,key:`1pdavp`}],[`path`,{d:`M20.054 15.987H3.946`,key:`14rxg9`}]]};Wi.node;var Gi=G(Wi),Ki={name:`layers`,size:24,node:[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]],aliases:[`layers-3`]};Ki.node;var qi=G(Ki),Ji={name:`layout-grid`,size:24,node:[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]};Ji.node;var Yi=G(Ji),Xi={name:`list-filter`,size:24,node:[[`path`,{d:`M2 5h20`,key:`1fs1ex`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M9 19h6`,key:`456am0`}]]};Xi.node;var Zi=G(Xi),Qi={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};Qi.node;var $i=G(Qi),ea={name:`lock`,size:24,node:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]};ea.node;var ta=G(ea),na={name:`log-out`,size:24,node:[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]};na.node;var ra=G(na),ia={name:`message-circle-more`,size:24,node:[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}]]};ia.node;var aa=G(ia),oa={name:`message-circle`,size:24,node:[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]};oa.node;var sa=G(oa),ca={name:`message-square-plus`,size:24,node:[[`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`,key:`18887p`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]};ca.node;var la=G(ca),ua={name:`message-square-quote`,size:24,node:[[`path`,{d:`M14 14a2 2 0 0 0 2-2V8h-2`,key:`1r06pg`}],[`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`,key:`18887p`}],[`path`,{d:`M8 14a2 2 0 0 0 2-2V8H8`,key:`1jzu5j`}]]};ua.node;var da=G(ua),fa={name:`message-square-text`,size:24,node:[[`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`,key:`18887p`}],[`path`,{d:`M7 11h10`,key:`1twpyw`}],[`path`,{d:`M7 15h6`,key:`d9of3u`}],[`path`,{d:`M7 7h8`,key:`af5zfr`}]]};fa.node;var pa=G(fa),ma={name:`messages-square`,size:24,node:[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]};ma.node;var ha=G(ma),ga={name:`monitor`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]};ga.node;var _a=G(ga),va={name:`palette`,size:24,node:[[`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`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]};va.node;var ya=G(va),ba={name:`panel-bottom`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 15h18`,key:`5xshup`}]]};ba.node;var xa=G(ba),Sa={name:`panel-left-open`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]],aliases:[`sidebar-open`]};Sa.node;var Ca=G(Sa),wa={name:`panel-left`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]],aliases:[`sidebar`]};wa.node;var Ta=G(wa),Ea={name:`panel-right`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]};Ea.node;var Da=G(Ea),Oa={name:`panel-top`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]};Oa.node;var ka=G(Oa),Aa={name:`pause`,size:24,node:[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]};Aa.node;var ja=G(Aa),Ma={name:`phone-call`,size:24,node:[[`path`,{d:`M13 2a9 9 0 0 1 9 9`,key:`1itnx2`}],[`path`,{d:`M13 6a5 5 0 0 1 5 5`,key:`11nki7`}],[`path`,{d:`M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384`,key:`9njp5v`}]]};Ma.node;var Na=G(Ma),Pa={name:`picture-in-picture-2`,size:24,node:[[`path`,{d:`M21 9V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v10c0 1.1.9 2 2 2h4`,key:`daa4of`}],[`rect`,{width:`10`,height:`7`,x:`12`,y:`13`,rx:`2`,key:`1nb8gs`}]]};Pa.node;var Fa=G(Pa),Ia={name:`pin-off`,size:24,node:[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`,key:`znwnzq`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`,key:`c9qhm2`}]]};Ia.node;var La=G(Ia),Ra={name:`pin`,size:24,node:[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]};Ra.node;var za=G(Ra),Ba={name:`radio`,size:24,node:[[`path`,{d:`M16.247 7.761a6 6 0 0 1 0 8.478`,key:`1fwjs5`}],[`path`,{d:`M19.075 4.933a10 10 0 0 1 0 14.134`,key:`ehdyv1`}],[`path`,{d:`M4.925 19.067a10 10 0 0 1 0-14.134`,key:`1q22gi`}],[`path`,{d:`M7.753 16.239a6 6 0 0 1 0-8.478`,key:`r2q7qm`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]};Ba.node;var Va=G(Ba),Ha={name:`receipt`,size:24,node:[[`path`,{d:`M12 17V7`,key:`pyj7ub`}],[`path`,{d:`M16 8h-6a2 2 0 0 0 0 4h4a2 2 0 0 1 0 4H8`,key:`1elt7d`}],[`path`,{d:`M4 3a1 1 0 0 1 1-1 1.3 1.3 0 0 1 .7.2l.933.6a1.3 1.3 0 0 0 1.4 0l.934-.6a1.3 1.3 0 0 1 1.4 0l.933.6a1.3 1.3 0 0 0 1.4 0l.933-.6a1.3 1.3 0 0 1 1.4 0l.934.6a1.3 1.3 0 0 0 1.4 0l.933-.6A1.3 1.3 0 0 1 19 2a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1 1.3 1.3 0 0 1-.7-.2l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.934.6a1.3 1.3 0 0 1-1.4 0l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-1.4 0l-.934-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-.7.2 1 1 0 0 1-1-1z`,key:`ycz6yz`}]]};Ha.node;var Ua=G(Ha),Wa={name:`rotate-ccw-clock`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]],aliases:[`history`]};Wa.node;var Ga=G(Wa),Ka={name:`rotate-cw`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]};Ka.node;var qa=G(Ka),Ja={name:`rows-3`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M21 9H3`,key:`1338ky`}],[`path`,{d:`M21 15H3`,key:`9uk58r`}]],aliases:[`panels-top-bottom`]};Ja.node;var Ya=G(Ja),Xa={name:`server`,size:24,node:[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]};Xa.node;var Za=G(Xa),Qa={name:`settings-2`,size:24,node:[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]};Qa.node;var $a=G(Qa),eo={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};eo.node;var to=G(eo),no={name:`shapes`,size:24,node:[[`path`,{d:`M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z`,key:`1bo67w`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1bkyp8`}],[`circle`,{cx:`17.5`,cy:`17.5`,r:`3.5`,key:`w3z12y`}]]};no.node;var ro=G(no),io={name:`shield-exclamation-point`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]],aliases:[`shield-alert`]};io.node;var ao=G(io),oo={name:`shield-question-mark`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`shield-question`]};oo.node;var so=G(oo),co={name:`shield-x`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m14.5 9.5-5 5`,key:`17q4r4`}],[`path`,{d:`m9.5 9.5 5 5`,key:`18nt4w`}]],aliases:[`shield-close`]};co.node;var lo=G(co),uo={name:`square-pen`,size:24,node:[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]],aliases:[`pen-box`,`edit`,`pen-square`]};uo.node;var fo=G(uo),po={name:`square-terminal`,size:24,node:[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]],aliases:[`terminal-square`]};po.node;var mo=G(po),ho={name:`square-user-round`,size:24,node:[[`path`,{d:`M18 21a6 6 0 0 0-12 0`,key:`kaz2du`}],[`circle`,{cx:`12`,cy:`11`,r:`4`,key:`1gt34v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]],aliases:[`user-square-2`]};ho.node;var go=G(ho),_o={name:`swatch-book`,size:24,node:[[`path`,{d:`M11 17a4 4 0 0 1-8 0V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2Z`,key:`1ldrpk`}],[`path`,{d:`M16.7 13H19a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H7`,key:`11i5po`}],[`path`,{d:`M 7 17h.01`,key:`1euzgo`}],[`path`,{d:`m11 8 2.3-2.3a2.4 2.4 0 0 1 3.404.004L18.6 7.6a2.4 2.4 0 0 1 .026 3.434L9.9 19.8`,key:`o2gii7`}]]};_o.node;var vo=G(_o),yo={name:`tags`,size:24,node:[[`path`,{d:`M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z`,key:`16rjxf`}],[`path`,{d:`M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193`,key:`178nd4`}],[`circle`,{cx:`10.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`12ikhr`}]]};yo.node;var bo=G(yo),xo={name:`tag`,size:24,node:[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]};xo.node;var So=G(xo),Co={name:`text-quote`,size:24,node:[[`path`,{d:`M17 5H3`,key:`1cn7zz`}],[`path`,{d:`M21 12H8`,key:`scolzb`}],[`path`,{d:`M21 19H8`,key:`13qgcb`}],[`path`,{d:`M3 12v7`,key:`1ri8j3`}]]};Co.node;var wo=G(Co),To={name:`toggle-left`,size:24,node:[[`circle`,{cx:`9`,cy:`12`,r:`3`,key:`u3jwor`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`7`,key:`g7kal2`}]]};To.node;var Eo=G(To),Do={name:`toggle-right`,size:24,node:[[`circle`,{cx:`15`,cy:`12`,r:`3`,key:`1afu0r`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`7`,key:`g7kal2`}]]};Do.node;var Oo=G(Do),ko={name:`toolbox`,size:24,node:[[`path`,{d:`M16 12v4`,key:`vf1vip`}],[`path`,{d:`M16 6V4a2 2 0 00-2-2h-4a2 2 0 00-2 2v2`,key:`llnzfg`}],[`path`,{d:`M17 6a2 2 0 011.414.586l3 3A2 2 0 0122 11v8a2 2 0 01-2 2H4a2 2 0 01-2-2v-8a2 2 0 01.586-1.414l3-3A2 2 0 017 6z`,key:`1hprxj`}],[`path`,{d:`M2 14h20`,key:`myj16y`}],[`path`,{d:`M8 12v4`,key:`1w4uao`}]]};ko.node;var Ao=G(ko),jo={name:`unlink`,size:24,node:[[`path`,{d:`m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71`,key:`yqzxt4`}],[`path`,{d:`m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71`,key:`4qinb0`}],[`line`,{x1:`8`,x2:`8`,y1:`2`,y2:`5`,key:`1041cp`}],[`line`,{x1:`2`,x2:`5`,y1:`8`,y2:`8`,key:`14m1p5`}],[`line`,{x1:`16`,x2:`16`,y1:`19`,y2:`22`,key:`rzdirn`}],[`line`,{x1:`19`,x2:`22`,y1:`16`,y2:`16`,key:`ox905f`}]]};jo.node;var Mo=G(jo),No={name:`user-round`,size:24,node:[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]],aliases:[`user-2`]};No.node;var Po=G(No),Fo={name:`users-round`,size:24,node:[[`path`,{d:`M18 21a8 8 0 0 0-16 0`,key:`3ypg7q`}],[`circle`,{cx:`10`,cy:`8`,r:`5`,key:`o932ke`}],[`path`,{d:`M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3`,key:`10s06x`}]],aliases:[`users-2`]};Fo.node;var Io=G(Fo),Lo={name:`users`,size:24,node:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]};Lo.node;var Ro=G(Lo),zo={name:`wrench`,size:24,node:[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]};zo.node;var Bo=G(zo),Vo=e({defineStudioPlugin:()=>Ho});function Ho(e){return e}var q=t(r(),1),Uo=[`left`,`top`,`right`,`bottom`],Wo=`wizards.appbar`,Go={position:`left`,labels:!0},Ko=e=>Uo.includes(e);function qo(){try{let e=JSON.parse(localStorage.getItem(Wo)??`null`);return{position:Ko(e?.position)?e.position:Go.position,labels:typeof e?.labels==`boolean`?e.labels:Go.labels}}catch{return Go}}var Jo=qo(),Yo=new Set;function Xo(e){Jo={...Jo,...e};try{localStorage.setItem(Wo,JSON.stringify(Jo))}catch{}for(let e of Yo)e()}function Zo(){return $n(`(max-width: 767px)`)}function Qo(){let e=(0,q.useSyncExternalStore)(e=>(Yo.add(e),()=>Yo.delete(e)),()=>Jo),t=Zo();return(0,q.useMemo)(()=>t?{...e,position:`bottom`,phone:t}:{...e,phone:t},[e,t])}var $o=e=>e===`top`||e===`bottom`;function es(e){let{position:t,labels:n}=Qo(),r=$n(`(min-width: 1400px)`)&&!$o(t)&&!e;return{shown:n&&r,room:r}}function ts(e,t){switch(e){case`left`:return t===`start`?`top-0 left-full ml-3`:`bottom-0 left-full ml-3`;case`right`:return t===`start`?`top-0 right-full mr-3`:`bottom-0 right-full mr-3`;case`top`:return t===`start`?`top-full left-0 mt-3`:`top-full right-0 mt-3`;case`bottom`:return t===`start`?`bottom-full left-0 mb-3`:`bottom-full right-0 mb-3`}}var ns=()=>matchMedia(`(display-mode: standalone)`).matches||matchMedia(`(display-mode: window-controls-overlay)`).matches||navigator.standalone===!0,rs=()=>navigator.userAgent,is=()=>/iPhone|iPad|iPod/.test(rs())||navigator.platform===`MacIntel`&&navigator.maxTouchPoints>1,as=()=>!!navigator.userAgentData?.brands?.length||/Chrome|Chromium|Edg/.test(rs()),os=()=>/Safari/.test(rs())&&!/Chrome|Chromium|Edg|Firefox|FxiOS/.test(rs());function ss(e){return e?`prompt`:/Android/.test(rs())?as()?`android`:`none`:is()?`ios`:os()?`mac`:as()?`chromium`:`none`}function cs(){return(0,q.useSyncExternalStore)(e=>(window.addEventListener(`wizard-install`,e),window.addEventListener(`appinstalled`,e),()=>{window.removeEventListener(`wizard-install`,e),window.removeEventListener(`appinstalled`,e)}),()=>window.wizardInstall??null)}async function ls(e){try{await e.prompt()}finally{window.wizardInstall=null,window.dispatchEvent(new Event(`wizard-install`))}}function us(e,t){return e[13]=1,e[14]=t>>8,e[15]=t&255,e[16]=t>>8,e[17]=t&255,e}var ds=112,fs=72,ps=89,ms=115,hs;function gs(){let e=new Int32Array(256);for(let t=0;t<256;t++){let n=t;for(let e=0;e<8;e++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n}return e}function _s(e){let t=-1;hs||=gs();for(let n=0;n<e.length;n++)t=hs[(t^e[n])&255]^t>>>8;return t^-1}function vs(e){let t=e.length-1;for(let n=t;n>=4;n--)if(e[n-4]===9&&e[n-3]===ds&&e[n-2]===fs&&e[n-1]===ps&&e[n]===ms)return n-3;return 0}function ys(e,t,n=!1){let r=new Uint8Array(13);t*=39.3701,r[0]=ds,r[1]=fs,r[2]=ps,r[3]=ms,r[4]=t>>>24,r[5]=t>>>16,r[6]=t>>>8,r[7]=t&255,r[8]=r[4],r[9]=r[5],r[10]=r[6],r[11]=r[7],r[12]=1;let i=_s(r),a=new Uint8Array(4);if(a[0]=i>>>24,a[1]=i>>>16,a[2]=i>>>8,a[3]=i&255,n){let t=vs(e);return e.set(r,t),e.set(a,t+13),e}{let t=new Uint8Array(4);t[0]=0,t[1]=0,t[2]=0,t[3]=9;let n=new Uint8Array(54);return n.set(e,0),n.set(t,33),n.set(r,37),n.set(a,50),n}}var bs=`AAlwSFlz`,xs=`AAAJcEhZ`,Ss=`AAAACXBI`;function Cs(e){let t=e.indexOf(bs);return t===-1&&(t=e.indexOf(xs)),t===-1&&(t=e.indexOf(Ss)),t}var ws=`[modern-screenshot]`,Ts=typeof window<`u`,Es=Ts&&`Worker`in window,Ds=Ts&&`atob`in window,Os=Ts&&`btoa`in window,ks=Ts?window.navigator?.userAgent:``,As=ks.includes(`Chrome`),js=ks.includes(`AppleWebKit`)&&!As,Ms=ks.includes(`Firefox`),Ns=e=>e&&`__CONTEXT__`in e,Ps=e=>e.constructor.name===`CSSFontFaceRule`,Fs=e=>e.constructor.name===`CSSImportRule`,Is=e=>e.constructor.name===`CSSLayerBlockRule`,Ls=e=>e.nodeType===1,Rs=e=>typeof e.className==`object`,zs=e=>e.tagName===`image`,Bs=e=>e.tagName===`use`,Vs=e=>Ls(e)&&e.style!==void 0&&!Rs(e),Hs=e=>e.nodeType===8,Us=e=>e.nodeType===3,Ws=e=>e.tagName===`IMG`,Gs=e=>e.tagName===`VIDEO`,Ks=e=>e.tagName===`CANVAS`,qs=e=>e.tagName===`TEXTAREA`,Js=e=>e.tagName===`INPUT`,Ys=e=>e.tagName===`STYLE`,Xs=e=>e.tagName===`SCRIPT`,Zs=e=>e.tagName===`SELECT`,Qs=e=>e.tagName===`SLOT`,$s=e=>e.tagName===`IFRAME`,ec=(...e)=>console.warn(ws,...e);function tc(e){let t=e?.createElement?.(`canvas`);return t&&(t.height=t.width=1),!!t&&`toDataURL`in t&&!!t.toDataURL(`image/webp`).includes(`image/webp`)}var nc=e=>e.startsWith(`data:`);function rc(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(Ts&&e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i)||!Ts)return e;let n=ic().implementation.createHTMLDocument(),r=n.createElement(`base`),i=n.createElement(`a`);return n.head.appendChild(r),n.body.appendChild(i),t&&(r.href=t),i.href=e,i.href}function ic(e){return(e&&Ls(e)?e?.ownerDocument:e)??window.document}var ac=`http://www.w3.org/2000/svg`;function oc(e,t,n){let r=ic(n).createElementNS(ac,`svg`);return r.setAttributeNS(null,`width`,e.toString()),r.setAttributeNS(null,`height`,t.toString()),r.setAttributeNS(null,`viewBox`,`0 0 ${e} ${t}`),r}function sc(e,t){let n=new XMLSerializer().serializeToString(e);return t&&(n=n.replace(/[\u0000-\u0008\v\f\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/gu,``)),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`}function cc(e,t){return new Promise((n,r)=>{let i=new FileReader;i.onload=()=>n(i.result),i.onerror=()=>r(i.error),i.onabort=()=>r(Error(`Failed read blob to ${t}`)),t===`dataUrl`?i.readAsDataURL(e):t===`arrayBuffer`&&i.readAsArrayBuffer(e)})}var lc=e=>cc(e,`dataUrl`);function uc(e,t){let n=ic(t).createElement(`img`);return n.decoding=`sync`,n.loading=`eager`,n.src=e,n}function dc(e,t){return new Promise(n=>{let{timeout:r,ownerDocument:i,onError:a,onWarn:o}=t??{},s=typeof e==`string`?uc(e,ic(i)):e,c=null,l=null;function u(){n(s),c&&clearTimeout(c),l?.()}if(r&&(c=setTimeout(u,r)),Gs(s)){let e=s.currentSrc||s.src;if(!e)return s.poster?dc(s.poster,t).then(n):u();if(s.readyState>=2)return u();let r=u,i=t=>{o?.(`Failed video load`,e,t),a?.(t),u()};l=()=>{s.removeEventListener(`loadeddata`,r),s.removeEventListener(`error`,i)},s.addEventListener(`loadeddata`,r,{once:!0}),s.addEventListener(`error`,i,{once:!0})}else{let e=zs(s)?s.href.baseVal:s.currentSrc||s.src;if(!e)return u();let t=async()=>{if(Ws(s)&&`decode`in s)try{await s.decode()}catch(t){o?.(`Failed to decode image, trying to render anyway`,s.dataset.originalSrc||e,t)}u()},n=t=>{o?.(`Failed image load`,s.dataset.originalSrc||e,t),u()};if(Ws(s)&&s.complete)return t();l=()=>{s.removeEventListener(`load`,t),s.removeEventListener(`error`,n)},s.addEventListener(`load`,t,{once:!0}),s.addEventListener(`error`,n,{once:!0})}})}async function fc(e,t){Vs(e)&&(Ws(e)||Gs(e)?await dc(e,t):await Promise.all([`img`,`video`].flatMap(n=>Array.from(e.querySelectorAll(n)).map(e=>dc(e,t)))))}var pc=function(){let e=0,t=()=>`0000${(Math.random()*36**4|0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)}();function mc(e){return e?.split(`,`).map(e=>e.trim().replace(/"|'/g,``).toLowerCase()).filter(Boolean)}var hc=0;function gc(e){let t=`${ws}[#${hc}]`;return hc++,{time:n=>e&&console.time(`${t} ${n}`),timeEnd:n=>e&&console.timeEnd(`${t} ${n}`),warn:(...t)=>e&&ec(...t)}}function _c(e){return{cache:e?`no-cache`:`force-cache`}}async function vc(e,t){return Ns(e)?e:yc(e,{...t,autoDestruct:!0})}async function yc(e,t){let{scale:n=1,workerUrl:r,workerNumber:i=1}=t||{},a=!!t?.debug,o=t?.features??!0,s=e.ownerDocument??(Ts?window.document:void 0),c=e.ownerDocument?.defaultView??(Ts?window:void 0),l=new Map,u={width:0,height:0,quality:1,type:`image/png`,scale:n,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:3e4,progress:null,debug:a,fetch:{requestInit:_c(t?.fetch?.bypassingCache),placeholderImage:`data:image/png;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7`,bypassingCache:!1,...t?.fetch},fetchFn:null,font:{},drawImageInterval:100,workerUrl:null,workerNumber:i,onCloneEachNode:null,onCloneNode:null,onEmbedNode:null,onCreateForeignObjectSvg:null,includeStyleProperties:null,autoDestruct:!1,...t,__CONTEXT__:!0,log:gc(a),node:e,ownerDocument:s,ownerWindow:c,dpi:n===1?null:96*n,svgStyleElement:bc(s),svgDefsElement:s?.createElementNS(ac,`defs`),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:Es&&r&&i?i:0})].map(()=>{try{let e=new Worker(r);return e.onmessage=async e=>{let{url:t,result:n}=e.data;n?l.get(t)?.resolve?.(n):l.get(t)?.reject?.(Error(`Error receiving message from worker: ${t}`))},e.onmessageerror=e=>{let{url:t}=e.data;l.get(t)?.reject?.(Error(`Error receiving message from worker: ${t}`))},e}catch(e){return u.log.warn(`Failed to new Worker`,e),null}}).filter(Boolean),fontFamilies:new Map,fontCssTexts:new Map,acceptOfImage:`${[tc(s)&&`image/webp`,`image/svg+xml`,`image/*`,`*/*`].filter(Boolean).join(`,`)};q=0.8`,requests:l,drawImageCount:0,tasks:[],features:o,isEnable:e=>e===`restoreScrollPosition`?typeof o==`boolean`?!1:o[e]??!1:typeof o==`boolean`?o:o[e]??!0,shadowRoots:[]};u.log.time(`wait until load`),await fc(e,{timeout:u.timeout,onWarn:u.log.warn}),u.log.timeEnd(`wait until load`);let{width:d,height:f}=xc(e,u);return u.width=d,u.height=f,u}function bc(e){if(!e)return;let t=e.createElement(`style`),n=t.ownerDocument.createTextNode(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/BlockEditor-CgjXTWly.js","assets/rolldown-runtime-XKyaHtl9.js","assets/w3c-keyname-BOAvb0qz.js","assets/jsx-runtime-C3cWAN_r.js","assets/react-dom-BwXff0Px.js","assets/with-selector-DNNxLmGI.js","assets/floating-ui.dom-S_FT_s1L.js","assets/marked.esm-BfGIZK7F.js","assets/code-hPTnSH4L.js","assets/link-DyYjkzYx.js","assets/list-checks-D1zkXlZa.js","assets/list-ordered-B7aUqZdk.js","assets/table-BEbwD8ie.js","assets/upload-BZThm-R6.js","assets/i18n-WXeVnv7i.js","assets/BlockEditor-CtW6lw0y.css","assets/viewers-CmGDpBjn.js","assets/dist-Bux-wzFO.js","assets/ui-DkEhb2Rt.js","assets/preload-helper-Cj7BV335.js","assets/code-editor-CufyaUFC.js","assets/Marketplace-B3NoH5Va.js","assets/useMutation-BSffqL6W.js","assets/volume-2-Br71vpS5.js","assets/eye-CG1LzvNI.js","assets/plug-CHvl1GhO.js","assets/brand-BIT7AumL.js","assets/engenty-Cy7MbUxR.js","assets/logo-xL-sneZz.js","assets/session-RDdtfee2.js","assets/AboutDialog-CQvfeGqA.js","assets/UpdateCheck-y1StF2CW.js","assets/media-gjOIWMWK.js","assets/ChangelogDialog-F7gj0WCW.js"])))=>i.map(i=>d[i]);
2
+ import{n as e,r as t,t as n}from"./rolldown-runtime-XKyaHtl9.js";import{n as r,t as i}from"./jsx-runtime-C3cWAN_r.js";import{$ as a,$n as o,Bn as s,C as c,Cn as l,Dn as u,Fn as d,G as f,Gn as p,In as m,J as h,Jn as g,K as _,Kn as v,Ln as y,Nn as b,On as x,Q as S,Qn as C,Rn as w,S as T,Sn as E,Sr as D,Tn as O,U as k,Un as A,Vn as j,W as M,X as N,Yn as P,Z as F,Zn as I,Zt as L,a as R,an as z,ar as B,at as ee,bn as V,br as te,c as ne,cn as H,ct as U,d as re,dn as ie,dt as ae,er as oe,et as se,f as ce,fn as le,fr as ue,gn as de,hn as fe,hr as pe,i as me,it as he,jn as ge,jt as _e,kn as ve,kt as ye,l as be,ln as xe,lr as Se,lt as Ce,mn as we,mr as Te,mt as Ee,ni as De,o as Oe,on as ke,pr as Ae,q as je,rr as Me,sn as Ne,sr as Pe,st as Fe,t as Ie,tr as Le,un as Re,ur as ze,v as Be,vn as Ve,vr as He,xn as W,xr as Ue,yn as We,yr as Ge,zr as Ke}from"./ui-DkEhb2Rt.js";import{A as qe,C as Je,M as Ye,N as Xe,O as Ze,T as Qe,i as $e,k as et,x as tt,y as nt}from"./Marketplace-B3NoH5Va.js";import{t as rt}from"./useMutation-BSffqL6W.js";import{t as it}from"./react-dom-BwXff0Px.js";import{c as at,d as G,i as ot,l as st,n as ct,o as lt,r as ut,s as dt,u as ft}from"./marked.esm-BfGIZK7F.js";import{n as pt,r as mt,t as ht}from"./volume-2-Br71vpS5.js";import{n as gt,t as _t}from"./scroll-text-DmK2IucJ.js";import{t as vt}from"./eye-CG1LzvNI.js";import{d as yt,f as bt,i as xt,l as St,m as Ct,n as wt,p as Tt,r as Et,s as Dt}from"./read-aloud-CRFt5q6k.js";import{n as Ot,t as kt}from"./list-checks-D1zkXlZa.js";import{A as At,C as jt,D as Mt,E as Nt,O as Pt,S as Ft,T as It,_ as Lt,a as Rt,b as zt,c as Bt,d as Vt,f as Ht,g as Ut,h as Wt,i as Gt,k as Kt,l as qt,m as Jt,p as Yt,r as Xt,u as Zt,v as Qt,w as $t,x as en,y as tn}from"./floating-ui.dom-S_FT_s1L.js";import{_ as nn,a as rn,d as an,g as on,h as sn,i as cn,m as ln,n as un,o as dn,s as fn,t as pn}from"./brand-BIT7AumL.js";import{t as mn}from"./plug-CHvl1GhO.js";import{t as hn}from"./upload-BZThm-R6.js";import{t as gn}from"./logo-xL-sneZz.js";import{$t as _n,F as vn,Gt as yn,Ht as bn,Jt as xn,Kt as Sn,P as Cn,Qt as wn,R as Tn,Rt as En,T as Dn,Ut as On,Vt as kn,Wt as An,Xt as jn,Yt as Mn,Zt as Nn,an as Pn,b as Fn,en as In,in as Ln,n as Rn,nn as zn,qt as Bn,rn as Vn,s as K,tn as Hn,z as Un}from"./i18n-WXeVnv7i.js";import{t as Wn}from"./preload-helper-Cj7BV335.js";import{b as Gn,d as Kn,h as qn,m as Jn,n as Yn,p as Xn,s as Zn,u as Qn}from"./session-RDdtfee2.js";import{t as $n}from"./media-gjOIWMWK.js";import{d as er,g as tr,h as nr,l as rr,n as ir,p as ar,s as or}from"./UpdateCheck-y1StF2CW.js";import{n as sr,t as cr}from"./with-selector-DNNxLmGI.js";import{t as lr}from"./code-editor-CufyaUFC.js";import{r as ur,t as dr}from"./LangSwitch-BLB7dDce.js";var fr={name:`a-large-small`,size:24,node:[[`path`,{d:`m15 16 2.536-7.328a1.02 1.02 1 0 1 1.928 0L22 16`,key:`xik6mr`}],[`path`,{d:`M15.697 14h5.606`,key:`1stdlc`}],[`path`,{d:`m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16`,key:`d5nyq2`}],[`path`,{d:`M3.304 13h6.392`,key:`1q3zxz`}]]};fr.node;var pr=G(fr),mr={name:`activity`,size:24,node:[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]};mr.node;var hr=G(mr),gr={name:`archive-arrow-up`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h2`,key:`tvwodi`}],[`path`,{d:`M20 8v11a2 2 0 0 1-2 2h-2`,key:`1gkqxj`}],[`path`,{d:`m9 15 3-3 3 3`,key:`1pd0qc`}],[`path`,{d:`M12 12v9`,key:`192myk`}]],aliases:[`archive-restore`]};gr.node;var _r=G(gr),vr={name:`archive`,size:24,node:[[`rect`,{width:`20`,height:`5`,x:`2`,y:`3`,rx:`1`,key:`1wp1u1`}],[`path`,{d:`M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8`,key:`1s80jp`}],[`path`,{d:`M10 12h4`,key:`a56b0p`}]]};vr.node;var yr=G(vr),br={name:`arrow-left-right`,size:24,node:[[`path`,{d:`M8 3 4 7l4 4`,key:`9rb6wj`}],[`path`,{d:`M4 7h16`,key:`6tx8e3`}],[`path`,{d:`m16 21 4-4-4-4`,key:`siv7j2`}],[`path`,{d:`M20 17H4`,key:`h6l3hr`}]]};br.node;var xr=G(br),Sr={name:`arrow-up-right`,size:24,node:[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]};Sr.node;var Cr=G(Sr),wr={name:`arrow-up-to-line`,size:24,node:[[`path`,{d:`M5 3h14`,key:`7usisc`}],[`path`,{d:`m18 13-6-6-6 6`,key:`1kf1n9`}],[`path`,{d:`M12 7v14`,key:`1akyts`}]]};wr.node;var Tr=G(wr),Er={name:`blocks`,size:24,node:[[`path`,{d:`M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2`,key:`1ah6g2`}],[`rect`,{x:`14`,y:`2`,width:`8`,height:`8`,rx:`1`,key:`88lufb`}]]};Er.node;var Dr=G(Er),Or={name:`book-open`,size:24,node:[[`path`,{d:`M12 5v16`,key:`1f6ucr`}],[`path`,{d:`M20.001 19A2 2 0 0022 17V5a2 2 0 00-1.999-2L16 3.002A5 5 0 0012 5a5 5 0 00-4-2H4a2 2 0 00-2 2v12a2 2 0 001.999 2H8a5 5 0 014 2 5 5 0 014-2z`,key:`1fyvmf`}]]};Or.node;var kr=G(Or),Ar={name:`book-plus`,size:24,node:[[`path`,{d:`M12 7v6`,key:`lw1j43`}],[`path`,{d:`M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20`,key:`k3hazp`}],[`path`,{d:`M9 10h6`,key:`9gxzsh`}]]};Ar.node;var jr=G(Ar),Mr={name:`brain`,size:24,node:[[`path`,{d:`M12 18V5`,key:`adv99a`}],[`path`,{d:`M15 13a4.17 4.17 0 01-3-4 4.17 4.17 0 01-3 4`,key:`5nuw1p`}],[`path`,{d:`M17.707 6.294A3 3 0 1012 5a3 3 0 10-5.707 1.294`,key:`18ldcf`}],[`path`,{d:`M17.996 5.125a4 4 0 012.526 5.77`,key:`1sdu8q`}],[`path`,{d:`M18 18a4 4 0 002-7.465`,key:`7xqqvr`}],[`path`,{d:`M19.967 17.482a4 4 0 11-7.967.517 4 4 0 11-7.967-.517`,key:`t46ysz`}],[`path`,{d:`M6 18a4 4 0 01-2-7.465`,key:`1y2m15`}],[`path`,{d:`M6.004 5.125a4 4 0 00-2.526 5.77`,key:`3cw1ss`}]]};Mr.node;var Nr=G(Mr),Pr={name:`building-complex`,size:24,node:[[`path`,{d:`M10 12h4`,key:`a56b0p`}],[`path`,{d:`M10 8h4`,key:`1sr2af`}],[`path`,{d:`M14 21v-3a2 2 0 0 0-4 0v3`,key:`1rgiei`}],[`path`,{d:`M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2`,key:`secmi2`}],[`path`,{d:`M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16`,key:`16ra0t`}]],aliases:[`building-2`]};Pr.node;var Fr=G(Pr),Ir={name:`cable`,size:24,node:[[`path`,{d:`M17 19a1 1 0 0 1-1-1v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v2a1 1 0 0 1-1 1z`,key:`trhst0`}],[`path`,{d:`M17 21v-2`,key:`ds4u3f`}],[`path`,{d:`M19 14V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V10`,key:`1mo9zo`}],[`path`,{d:`M21 21v-2`,key:`eo0ou`}],[`path`,{d:`M3 5V3`,key:`1k5hjh`}],[`path`,{d:`M4 10a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2a2 2 0 0 1-2 2z`,key:`1dd30t`}],[`path`,{d:`M7 5V3`,key:`1t1388`}]]};Ir.node;var Lr=G(Ir),Rr={name:`calendar`,size:24,node:[[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]};Rr.node;var zr=G(Rr),Br={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};Br.node;var Vr=G(Br),Hr={name:`chevrons-up-down`,size:24,node:[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]};Hr.node;var Ur=G(Hr),Wr={name:`circle-exclamation-point`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]],aliases:[`alert-circle`,`circle-alert`]};Wr.node;var Gr=G(Wr),Kr={name:`circle-pause`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`10`,x2:`10`,y1:`15`,y2:`9`,key:`c1nkhi`}],[`line`,{x1:`14`,x2:`14`,y1:`15`,y2:`9`,key:`h65svq`}]],aliases:[`pause-circle`]};Kr.node;var qr=G(Kr),Jr={name:`circle-question-mark`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`help-circle`,`circle-help`]};Jr.node;var Yr=G(Jr),Xr={name:`cloud-cog`,size:24,node:[[`path`,{d:`m10.852 19.772-.383.924`,key:`r7sl7d`}],[`path`,{d:`m13.148 14.228.383-.923`,key:`1d5zpm`}],[`path`,{d:`M13.148 19.772a3 3 0 1 0-2.296-5.544l-.383-.923`,key:`1ydik7`}],[`path`,{d:`m13.53 20.696-.382-.924a3 3 0 1 1-2.296-5.544`,key:`1m1vsf`}],[`path`,{d:`m14.772 15.852.923-.383`,key:`660p6e`}],[`path`,{d:`m14.772 18.148.923.383`,key:`hrcpis`}],[`path`,{d:`M4.2 15.1a7 7 0 1 1 9.93-9.858A7 7 0 0 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.2`,key:`j2q98n`}],[`path`,{d:`m9.228 15.852-.923-.383`,key:`1p9ong`}],[`path`,{d:`m9.228 18.148-.923.383`,key:`6558rz`}]]};Xr.node;var Zr=G(Xr),Qr={name:`cloud-exclamation-point`,size:24,node:[[`path`,{d:`M12 12v4`,key:`tww15h`}],[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.128 16.949A7 7 0 1 1 15.71 8h1.79a1 1 0 0 1 0 9h-1.642`,key:`1namsd`}]],aliases:[`cloud-alert`]};Qr.node;var $r=G(Qr),ei={name:`cloud`,size:24,node:[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]};ei.node;var ti=G(ei),ni={name:`cpu`,size:24,node:[[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M17 20v2`,key:`1rnc9c`}],[`path`,{d:`M17 2v2`,key:`11trls`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M2 17h2`,key:`7oei6x`}],[`path`,{d:`M2 7h2`,key:`asdhe0`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`M20 17h2`,key:`1fpfkl`}],[`path`,{d:`M20 7h2`,key:`1o8tra`}],[`path`,{d:`M7 20v2`,key:`4gnj0m`}],[`path`,{d:`M7 2v2`,key:`1i4yhu`}],[`rect`,{x:`4`,y:`4`,width:`16`,height:`16`,rx:`2`,key:`1vbyd7`}],[`rect`,{x:`8`,y:`8`,width:`8`,height:`8`,rx:`1`,key:`z9xiuo`}]]};ni.node;var ri=G(ni),ii={name:`credit-card`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`2`,key:`ynyp8z`}],[`line`,{x1:`2`,x2:`22`,y1:`10`,y2:`10`,key:`1b3vmo`}],[`path`,{d:`M6 14h2`,key:`mk7k0u`}]]};ii.node;var ai=G(ii),oi={name:`eye-off`,size:24,node:[[`path`,{d:`M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49`,key:`ct8e1f`}],[`path`,{d:`M14.084 14.158a3 3 0 0 1-4.242-4.242`,key:`151rxh`}],[`path`,{d:`M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143`,key:`13bj9a`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]};oi.node;var si=G(oi),ci={name:`file-code`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M10 12.5 8 15l2 2.5`,key:`1tg20x`}],[`path`,{d:`m14 12.5 2 2.5-2 2.5`,key:`yinavb`}]]};ci.node;var li=G(ci),ui={name:`file-image`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`circle`,{cx:`10`,cy:`12`,r:`2`,key:`737tya`}],[`path`,{d:`m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22`,key:`wt3hpn`}]]};ui.node;var di=G(ui),fi={name:`file-question-mark`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}]],aliases:[`file-question`]};fi.node;var pi=G(fi),mi={name:`file-spreadsheet`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 13h2`,key:`yr2amv`}],[`path`,{d:`M14 13h2`,key:`un5t4a`}],[`path`,{d:`M8 17h2`,key:`2yhykz`}],[`path`,{d:`M14 17h2`,key:`10kma7`}]]};mi.node;var hi=G(mi),gi={name:`files`,size:24,node:[[`path`,{d:`M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8`,key:`14sh0y`}],[`path`,{d:`M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z`,key:`1970lx`}],[`path`,{d:`M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1`,key:`l4dndm`}]]};gi.node;var _i=G(gi),vi={name:`fingerprint-pattern`,size:24,node:[[`path`,{d:`M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4`,key:`1nerag`}],[`path`,{d:`M14 13.12c0 2.38 0 6.38-1 8.88`,key:`o46ks0`}],[`path`,{d:`M17.29 21.02c.12-.6.43-2.3.5-3.02`,key:`ptglia`}],[`path`,{d:`M2 12a10 10 0 0 1 18-6`,key:`ydlgp0`}],[`path`,{d:`M2 16h.01`,key:`1gqxmh`}],[`path`,{d:`M21.8 16c.2-2 .131-5.354 0-6`,key:`drycrb`}],[`path`,{d:`M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2`,key:`1tidbn`}],[`path`,{d:`M8.65 22c.21-.66.45-1.32.57-2`,key:`13wd9y`}],[`path`,{d:`M9 6.8a6 6 0 0 1 9 5.2v2`,key:`1fr1j5`}]],aliases:[`fingerprint`]};vi.node;var yi=G(vi),bi={name:`folder-open`,size:24,node:[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]};bi.node;var xi=G(bi),Si={name:`folder-plus`,size:24,node:[[`path`,{d:`M12 10v6`,key:`1bos4e`}],[`path`,{d:`M9 13h6`,key:`1uhe8q`}],[`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`,key:`1kt360`}]]};Si.node;var Ci=G(Si),wi={name:`folder`,size:24,node:[[`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`,key:`1kt360`}]]};wi.node;var Ti=G(wi),Ei={name:`git-merge`,size:24,node:[[`circle`,{cx:`18`,cy:`18`,r:`3`,key:`1xkwt0`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`path`,{d:`M6 21V9a9 9 0 0 0 9 9`,key:`7kw0sc`}]]};Ei.node;var Di=G(Ei),Oi={name:`hard-drive`,size:24,node:[[`path`,{d:`M10 16h.01`,key:`1bzywj`}],[`path`,{d:`M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`18tbho`}],[`path`,{d:`M21.946 12.013H2.054`,key:`zqlbp7`}],[`path`,{d:`M6 16h.01`,key:`1pmjb7`}]]};Oi.node;var ki=G(Oi),Ai={name:`hash`,size:24,node:[[`line`,{x1:`4`,x2:`20`,y1:`9`,y2:`9`,key:`4lhtct`}],[`line`,{x1:`4`,x2:`20`,y1:`15`,y2:`15`,key:`vyu0kd`}],[`line`,{x1:`10`,x2:`8`,y1:`3`,y2:`21`,key:`1ggp8o`}],[`line`,{x1:`16`,x2:`14`,y1:`3`,y2:`21`,key:`weycgp`}]]};Ai.node;var ji=G(Ai),Mi={name:`highlighter`,size:24,node:[[`path`,{d:`m9 11-6 6v3h9l3-3`,key:`1a3l36`}],[`path`,{d:`m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4`,key:`14a9rk`}]]};Mi.node;var Ni=G(Mi),Pi={name:`house`,size:24,node:[[`path`,{d:`M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8`,key:`5wwlr5`}],[`path`,{d:`M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`,key:`r6nss1`}]],aliases:[`home`]};Pi.node;var Fi=G(Pi),Ii={name:`images`,size:24,node:[[`path`,{d:`m22 11-1.296-1.296a2.4 2.4 0 0 0-3.408 0L11 16`,key:`9kzy35`}],[`path`,{d:`M4 8a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2`,key:`1t0f0t`}],[`circle`,{cx:`13`,cy:`7`,r:`1`,fill:`currentColor`,key:`1obus6`}],[`rect`,{x:`8`,y:`2`,width:`14`,height:`14`,rx:`2`,key:`1gvhby`}]]};Ii.node;var Li=G(Ii),Ri={name:`inbox`,size:24,node:[[`polyline`,{points:`22 12 16 12 14 15 10 15 8 12 2 12`,key:`o97t9d`}],[`path`,{d:`M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z`,key:`oot6mr`}]]};Ri.node;var zi=G(Ri),Bi={name:`info`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 16v-4`,key:`1dtifu`}],[`path`,{d:`M12 8h.01`,key:`e9boi3`}]]};Bi.node;var Vi=G(Bi),Hi={name:`key-round`,size:24,node:[[`path`,{d:`M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z`,key:`1s6t7t`}],[`circle`,{cx:`16.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`w0ekpg`}]]};Hi.node;var Ui=G(Hi),Wi={name:`laptop`,size:24,node:[[`path`,{d:`M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z`,key:`1pdavp`}],[`path`,{d:`M20.054 15.987H3.946`,key:`14rxg9`}]]};Wi.node;var Gi=G(Wi),Ki={name:`layers`,size:24,node:[[`path`,{d:`M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z`,key:`zw3jo`}],[`path`,{d:`M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12`,key:`1wduqc`}],[`path`,{d:`M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17`,key:`kqbvx6`}]],aliases:[`layers-3`]};Ki.node;var qi=G(Ki),Ji={name:`layout-grid`,size:24,node:[[`rect`,{width:`7`,height:`7`,x:`3`,y:`3`,rx:`1`,key:`1g98yp`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`3`,rx:`1`,key:`6d4xhi`}],[`rect`,{width:`7`,height:`7`,x:`14`,y:`14`,rx:`1`,key:`nxv5o0`}],[`rect`,{width:`7`,height:`7`,x:`3`,y:`14`,rx:`1`,key:`1bb6yr`}]]};Ji.node;var Yi=G(Ji),Xi={name:`list-filter`,size:24,node:[[`path`,{d:`M2 5h20`,key:`1fs1ex`}],[`path`,{d:`M6 12h12`,key:`8npq4p`}],[`path`,{d:`M9 19h6`,key:`456am0`}]]};Xi.node;var Zi=G(Xi),Qi={name:`loader-circle`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]],aliases:[`loader-2`]};Qi.node;var $i=G(Qi),ea={name:`lock`,size:24,node:[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]};ea.node;var ta=G(ea),na={name:`log-out`,size:24,node:[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]};na.node;var ra=G(na),ia={name:`message-circle-more`,size:24,node:[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}],[`path`,{d:`M8 12h.01`,key:`czm47f`}],[`path`,{d:`M12 12h.01`,key:`1mp3jc`}],[`path`,{d:`M16 12h.01`,key:`1l6xoz`}]]};ia.node;var aa=G(ia),oa={name:`message-circle`,size:24,node:[[`path`,{d:`M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719`,key:`1sd12s`}]]};oa.node;var sa=G(oa),ca={name:`message-square-plus`,size:24,node:[[`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`,key:`18887p`}],[`path`,{d:`M12 8v6`,key:`1ib9pf`}],[`path`,{d:`M9 11h6`,key:`1fldmi`}]]};ca.node;var la=G(ca),ua={name:`message-square-quote`,size:24,node:[[`path`,{d:`M14 14a2 2 0 0 0 2-2V8h-2`,key:`1r06pg`}],[`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`,key:`18887p`}],[`path`,{d:`M8 14a2 2 0 0 0 2-2V8H8`,key:`1jzu5j`}]]};ua.node;var da=G(ua),fa={name:`message-square-text`,size:24,node:[[`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`,key:`18887p`}],[`path`,{d:`M7 11h10`,key:`1twpyw`}],[`path`,{d:`M7 15h6`,key:`d9of3u`}],[`path`,{d:`M7 7h8`,key:`af5zfr`}]]};fa.node;var pa=G(fa),ma={name:`messages-square`,size:24,node:[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]};ma.node;var ha=G(ma),ga={name:`monitor`,size:24,node:[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]};ga.node;var _a=G(ga),va={name:`palette`,size:24,node:[[`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`,key:`e79jfc`}],[`circle`,{cx:`13.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`1okk4w`}],[`circle`,{cx:`17.5`,cy:`10.5`,r:`.5`,fill:`currentColor`,key:`f64h9f`}],[`circle`,{cx:`6.5`,cy:`12.5`,r:`.5`,fill:`currentColor`,key:`qy21gx`}],[`circle`,{cx:`8.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`fotxhn`}]]};va.node;var ya=G(va),ba={name:`panel-bottom`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 15h18`,key:`5xshup`}]]};ba.node;var xa=G(ba),Sa={name:`panel-left-open`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}],[`path`,{d:`m14 9 3 3-3 3`,key:`8010ee`}]],aliases:[`sidebar-open`]};Sa.node;var Ca=G(Sa),wa={name:`panel-left`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M9 3v18`,key:`fh3hqa`}]],aliases:[`sidebar`]};wa.node;var Ta=G(wa),Ea={name:`panel-right`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M15 3v18`,key:`14nvp0`}]]};Ea.node;var Da=G(Ea),Oa={name:`panel-top`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9h18`,key:`1pudct`}]]};Oa.node;var ka=G(Oa),Aa={name:`pause`,size:24,node:[[`rect`,{x:`14`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`kaeet6`}],[`rect`,{x:`5`,y:`3`,width:`5`,height:`18`,rx:`1`,key:`1wsw3u`}]]};Aa.node;var ja=G(Aa),Ma={name:`phone-call`,size:24,node:[[`path`,{d:`M13 2a9 9 0 0 1 9 9`,key:`1itnx2`}],[`path`,{d:`M13 6a5 5 0 0 1 5 5`,key:`11nki7`}],[`path`,{d:`M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384`,key:`9njp5v`}]]};Ma.node;var Na=G(Ma),Pa={name:`picture-in-picture-2`,size:24,node:[[`path`,{d:`M21 9V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v10c0 1.1.9 2 2 2h4`,key:`daa4of`}],[`rect`,{width:`10`,height:`7`,x:`12`,y:`13`,rx:`2`,key:`1nb8gs`}]]};Pa.node;var Fa=G(Pa),Ia={name:`pin-off`,size:24,node:[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`,key:`znwnzq`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`,key:`c9qhm2`}]]};Ia.node;var La=G(Ia),Ra={name:`pin`,size:24,node:[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]};Ra.node;var za=G(Ra),Ba={name:`radio`,size:24,node:[[`path`,{d:`M16.247 7.761a6 6 0 0 1 0 8.478`,key:`1fwjs5`}],[`path`,{d:`M19.075 4.933a10 10 0 0 1 0 14.134`,key:`ehdyv1`}],[`path`,{d:`M4.925 19.067a10 10 0 0 1 0-14.134`,key:`1q22gi`}],[`path`,{d:`M7.753 16.239a6 6 0 0 1 0-8.478`,key:`r2q7qm`}],[`circle`,{cx:`12`,cy:`12`,r:`2`,key:`1c9p78`}]]};Ba.node;var Va=G(Ba),Ha={name:`receipt`,size:24,node:[[`path`,{d:`M12 17V7`,key:`pyj7ub`}],[`path`,{d:`M16 8h-6a2 2 0 0 0 0 4h4a2 2 0 0 1 0 4H8`,key:`1elt7d`}],[`path`,{d:`M4 3a1 1 0 0 1 1-1 1.3 1.3 0 0 1 .7.2l.933.6a1.3 1.3 0 0 0 1.4 0l.934-.6a1.3 1.3 0 0 1 1.4 0l.933.6a1.3 1.3 0 0 0 1.4 0l.933-.6a1.3 1.3 0 0 1 1.4 0l.934.6a1.3 1.3 0 0 0 1.4 0l.933-.6A1.3 1.3 0 0 1 19 2a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1 1.3 1.3 0 0 1-.7-.2l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.934.6a1.3 1.3 0 0 1-1.4 0l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-1.4 0l-.934-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-.7.2 1 1 0 0 1-1-1z`,key:`ycz6yz`}]]};Ha.node;var Ua=G(Ha),Wa={name:`rotate-ccw-clock`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}],[`path`,{d:`M12 7v5l4 2`,key:`1fdv2h`}]],aliases:[`history`]};Wa.node;var Ga=G(Wa),Ka={name:`rotate-cw`,size:24,node:[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]};Ka.node;var qa=G(Ka),Ja={name:`rows-3`,size:24,node:[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M21 9H3`,key:`1338ky`}],[`path`,{d:`M21 15H3`,key:`9uk58r`}]],aliases:[`panels-top-bottom`]};Ja.node;var Ya=G(Ja),Xa={name:`server`,size:24,node:[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]};Xa.node;var Za=G(Xa),Qa={name:`settings-2`,size:24,node:[[`path`,{d:`M14 17H5`,key:`gfn3mx`}],[`path`,{d:`M19 7h-9`,key:`6i9tg`}],[`circle`,{cx:`17`,cy:`17`,r:`3`,key:`18b49y`}],[`circle`,{cx:`7`,cy:`7`,r:`3`,key:`dfmy0x`}]]};Qa.node;var $a=G(Qa),eo={name:`settings`,size:24,node:[[`path`,{d:`M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915`,key:`1i5ecw`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}]]};eo.node;var to=G(eo),no={name:`shapes`,size:24,node:[[`path`,{d:`M8.3 10a.7.7 0 0 1-.626-1.079L11.4 3a.7.7 0 0 1 1.198-.043L16.3 8.9a.7.7 0 0 1-.572 1.1Z`,key:`1bo67w`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1bkyp8`}],[`circle`,{cx:`17.5`,cy:`17.5`,r:`3.5`,key:`w3z12y`}]]};no.node;var ro=G(no),io={name:`shield-exclamation-point`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M12 8v4`,key:`1got3b`}],[`path`,{d:`M12 16h.01`,key:`1drbdi`}]],aliases:[`shield-alert`]};io.node;var ao=G(io),oo={name:`shield-question-mark`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3`,key:`mhlwft`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`shield-question`]};oo.node;var so=G(oo),co={name:`shield-x`,size:24,node:[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m14.5 9.5-5 5`,key:`17q4r4`}],[`path`,{d:`m9.5 9.5 5 5`,key:`18nt4w`}]],aliases:[`shield-close`]};co.node;var lo=G(co),uo={name:`square-pen`,size:24,node:[[`path`,{d:`M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`,key:`1m0v6g`}],[`path`,{d:`M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z`,key:`ohrbg2`}]],aliases:[`pen-box`,`edit`,`pen-square`]};uo.node;var fo=G(uo),po={name:`square-terminal`,size:24,node:[[`path`,{d:`m7 11 2-2-2-2`,key:`1lz0vl`}],[`path`,{d:`M11 13h4`,key:`1p7l4v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}]],aliases:[`terminal-square`]};po.node;var mo=G(po),ho={name:`square-user-round`,size:24,node:[[`path`,{d:`M18 21a6 6 0 0 0-12 0`,key:`kaz2du`}],[`circle`,{cx:`12`,cy:`11`,r:`4`,key:`1gt34v`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}]],aliases:[`user-square-2`]};ho.node;var go=G(ho),_o={name:`swatch-book`,size:24,node:[[`path`,{d:`M11 17a4 4 0 0 1-8 0V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2Z`,key:`1ldrpk`}],[`path`,{d:`M16.7 13H19a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2H7`,key:`11i5po`}],[`path`,{d:`M 7 17h.01`,key:`1euzgo`}],[`path`,{d:`m11 8 2.3-2.3a2.4 2.4 0 0 1 3.404.004L18.6 7.6a2.4 2.4 0 0 1 .026 3.434L9.9 19.8`,key:`o2gii7`}]]};_o.node;var vo=G(_o),yo={name:`tags`,size:24,node:[[`path`,{d:`M13.172 2a2 2 0 0 1 1.414.586l6.71 6.71a2.4 2.4 0 0 1 0 3.408l-4.592 4.592a2.4 2.4 0 0 1-3.408 0l-6.71-6.71A2 2 0 0 1 6 9.172V3a1 1 0 0 1 1-1z`,key:`16rjxf`}],[`path`,{d:`M2 7v6.172a2 2 0 0 0 .586 1.414l6.71 6.71a2.4 2.4 0 0 0 3.191.193`,key:`178nd4`}],[`circle`,{cx:`10.5`,cy:`6.5`,r:`.5`,fill:`currentColor`,key:`12ikhr`}]]};yo.node;var bo=G(yo),xo={name:`tag`,size:24,node:[[`path`,{d:`M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z`,key:`vktsd0`}],[`circle`,{cx:`7.5`,cy:`7.5`,r:`.5`,fill:`currentColor`,key:`kqv944`}]]};xo.node;var So=G(xo),Co={name:`text-quote`,size:24,node:[[`path`,{d:`M17 5H3`,key:`1cn7zz`}],[`path`,{d:`M21 12H8`,key:`scolzb`}],[`path`,{d:`M21 19H8`,key:`13qgcb`}],[`path`,{d:`M3 12v7`,key:`1ri8j3`}]]};Co.node;var wo=G(Co),To={name:`toggle-left`,size:24,node:[[`circle`,{cx:`9`,cy:`12`,r:`3`,key:`u3jwor`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`7`,key:`g7kal2`}]]};To.node;var Eo=G(To),Do={name:`toggle-right`,size:24,node:[[`circle`,{cx:`15`,cy:`12`,r:`3`,key:`1afu0r`}],[`rect`,{width:`20`,height:`14`,x:`2`,y:`5`,rx:`7`,key:`g7kal2`}]]};Do.node;var Oo=G(Do),ko={name:`toolbox`,size:24,node:[[`path`,{d:`M16 12v4`,key:`vf1vip`}],[`path`,{d:`M16 6V4a2 2 0 00-2-2h-4a2 2 0 00-2 2v2`,key:`llnzfg`}],[`path`,{d:`M17 6a2 2 0 011.414.586l3 3A2 2 0 0122 11v8a2 2 0 01-2 2H4a2 2 0 01-2-2v-8a2 2 0 01.586-1.414l3-3A2 2 0 017 6z`,key:`1hprxj`}],[`path`,{d:`M2 14h20`,key:`myj16y`}],[`path`,{d:`M8 12v4`,key:`1w4uao`}]]};ko.node;var Ao=G(ko),jo={name:`unlink`,size:24,node:[[`path`,{d:`m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71`,key:`yqzxt4`}],[`path`,{d:`m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71`,key:`4qinb0`}],[`line`,{x1:`8`,x2:`8`,y1:`2`,y2:`5`,key:`1041cp`}],[`line`,{x1:`2`,x2:`5`,y1:`8`,y2:`8`,key:`14m1p5`}],[`line`,{x1:`16`,x2:`16`,y1:`19`,y2:`22`,key:`rzdirn`}],[`line`,{x1:`19`,x2:`22`,y1:`16`,y2:`16`,key:`ox905f`}]]};jo.node;var Mo=G(jo),No={name:`user-round`,size:24,node:[[`circle`,{cx:`12`,cy:`8`,r:`5`,key:`1hypcn`}],[`path`,{d:`M20 21a8 8 0 0 0-16 0`,key:`rfgkzh`}]],aliases:[`user-2`]};No.node;var Po=G(No),Fo={name:`users-round`,size:24,node:[[`path`,{d:`M18 21a8 8 0 0 0-16 0`,key:`3ypg7q`}],[`circle`,{cx:`10`,cy:`8`,r:`5`,key:`o932ke`}],[`path`,{d:`M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3`,key:`10s06x`}]],aliases:[`users-2`]};Fo.node;var Io=G(Fo),Lo={name:`users`,size:24,node:[[`path`,{d:`M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2`,key:`1yyitq`}],[`path`,{d:`M16 3.128a4 4 0 0 1 0 7.744`,key:`16gr8j`}],[`path`,{d:`M22 21v-2a4 4 0 0 0-3-3.87`,key:`kshegd`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]};Lo.node;var Ro=G(Lo),zo={name:`wrench`,size:24,node:[[`path`,{d:`M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z`,key:`1ngwbx`}]]};zo.node;var Bo=G(zo),Vo=e({defineStudioPlugin:()=>Ho});function Ho(e){return e}var q=t(r(),1),Uo=[`left`,`top`,`right`,`bottom`],Wo=`wizards.appbar`,Go={position:`left`,labels:!0},Ko=e=>Uo.includes(e);function qo(){try{let e=JSON.parse(localStorage.getItem(Wo)??`null`);return{position:Ko(e?.position)?e.position:Go.position,labels:typeof e?.labels==`boolean`?e.labels:Go.labels}}catch{return Go}}var Jo=qo(),Yo=new Set;function Xo(e){Jo={...Jo,...e};try{localStorage.setItem(Wo,JSON.stringify(Jo))}catch{}for(let e of Yo)e()}function Zo(){return $n(`(max-width: 767px)`)}function Qo(){let e=(0,q.useSyncExternalStore)(e=>(Yo.add(e),()=>Yo.delete(e)),()=>Jo),t=Zo();return(0,q.useMemo)(()=>t?{...e,position:`bottom`,phone:t}:{...e,phone:t},[e,t])}var $o=e=>e===`top`||e===`bottom`;function es(e){let{position:t,labels:n}=Qo(),r=$n(`(min-width: 1400px)`)&&!$o(t)&&!e;return{shown:n&&r,room:r}}function ts(e,t){switch(e){case`left`:return t===`start`?`top-0 left-full ml-3`:`bottom-0 left-full ml-3`;case`right`:return t===`start`?`top-0 right-full mr-3`:`bottom-0 right-full mr-3`;case`top`:return t===`start`?`top-full left-0 mt-3`:`top-full right-0 mt-3`;case`bottom`:return t===`start`?`bottom-full left-0 mb-3`:`bottom-full right-0 mb-3`}}var ns=()=>matchMedia(`(display-mode: standalone)`).matches||matchMedia(`(display-mode: window-controls-overlay)`).matches||navigator.standalone===!0,rs=()=>navigator.userAgent,is=()=>/iPhone|iPad|iPod/.test(rs())||navigator.platform===`MacIntel`&&navigator.maxTouchPoints>1,as=()=>!!navigator.userAgentData?.brands?.length||/Chrome|Chromium|Edg/.test(rs()),os=()=>/Safari/.test(rs())&&!/Chrome|Chromium|Edg|Firefox|FxiOS/.test(rs());function ss(e){return e?`prompt`:/Android/.test(rs())?as()?`android`:`none`:is()?`ios`:os()?`mac`:as()?`chromium`:`none`}function cs(){return(0,q.useSyncExternalStore)(e=>(window.addEventListener(`wizard-install`,e),window.addEventListener(`appinstalled`,e),()=>{window.removeEventListener(`wizard-install`,e),window.removeEventListener(`appinstalled`,e)}),()=>window.wizardInstall??null)}async function ls(e){try{await e.prompt()}finally{window.wizardInstall=null,window.dispatchEvent(new Event(`wizard-install`))}}function us(e,t){return e[13]=1,e[14]=t>>8,e[15]=t&255,e[16]=t>>8,e[17]=t&255,e}var ds=112,fs=72,ps=89,ms=115,hs;function gs(){let e=new Int32Array(256);for(let t=0;t<256;t++){let n=t;for(let e=0;e<8;e++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n}return e}function _s(e){let t=-1;hs||=gs();for(let n=0;n<e.length;n++)t=hs[(t^e[n])&255]^t>>>8;return t^-1}function vs(e){let t=e.length-1;for(let n=t;n>=4;n--)if(e[n-4]===9&&e[n-3]===ds&&e[n-2]===fs&&e[n-1]===ps&&e[n]===ms)return n-3;return 0}function ys(e,t,n=!1){let r=new Uint8Array(13);t*=39.3701,r[0]=ds,r[1]=fs,r[2]=ps,r[3]=ms,r[4]=t>>>24,r[5]=t>>>16,r[6]=t>>>8,r[7]=t&255,r[8]=r[4],r[9]=r[5],r[10]=r[6],r[11]=r[7],r[12]=1;let i=_s(r),a=new Uint8Array(4);if(a[0]=i>>>24,a[1]=i>>>16,a[2]=i>>>8,a[3]=i&255,n){let t=vs(e);return e.set(r,t),e.set(a,t+13),e}{let t=new Uint8Array(4);t[0]=0,t[1]=0,t[2]=0,t[3]=9;let n=new Uint8Array(54);return n.set(e,0),n.set(t,33),n.set(r,37),n.set(a,50),n}}var bs=`AAlwSFlz`,xs=`AAAJcEhZ`,Ss=`AAAACXBI`;function Cs(e){let t=e.indexOf(bs);return t===-1&&(t=e.indexOf(xs)),t===-1&&(t=e.indexOf(Ss)),t}var ws=`[modern-screenshot]`,Ts=typeof window<`u`,Es=Ts&&`Worker`in window,Ds=Ts&&`atob`in window,Os=Ts&&`btoa`in window,ks=Ts?window.navigator?.userAgent:``,As=ks.includes(`Chrome`),js=ks.includes(`AppleWebKit`)&&!As,Ms=ks.includes(`Firefox`),Ns=e=>e&&`__CONTEXT__`in e,Ps=e=>e.constructor.name===`CSSFontFaceRule`,Fs=e=>e.constructor.name===`CSSImportRule`,Is=e=>e.constructor.name===`CSSLayerBlockRule`,Ls=e=>e.nodeType===1,Rs=e=>typeof e.className==`object`,zs=e=>e.tagName===`image`,Bs=e=>e.tagName===`use`,Vs=e=>Ls(e)&&e.style!==void 0&&!Rs(e),Hs=e=>e.nodeType===8,Us=e=>e.nodeType===3,Ws=e=>e.tagName===`IMG`,Gs=e=>e.tagName===`VIDEO`,Ks=e=>e.tagName===`CANVAS`,qs=e=>e.tagName===`TEXTAREA`,Js=e=>e.tagName===`INPUT`,Ys=e=>e.tagName===`STYLE`,Xs=e=>e.tagName===`SCRIPT`,Zs=e=>e.tagName===`SELECT`,Qs=e=>e.tagName===`SLOT`,$s=e=>e.tagName===`IFRAME`,ec=(...e)=>console.warn(ws,...e);function tc(e){let t=e?.createElement?.(`canvas`);return t&&(t.height=t.width=1),!!t&&`toDataURL`in t&&!!t.toDataURL(`image/webp`).includes(`image/webp`)}var nc=e=>e.startsWith(`data:`);function rc(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(Ts&&e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i)||!Ts)return e;let n=ic().implementation.createHTMLDocument(),r=n.createElement(`base`),i=n.createElement(`a`);return n.head.appendChild(r),n.body.appendChild(i),t&&(r.href=t),i.href=e,i.href}function ic(e){return(e&&Ls(e)?e?.ownerDocument:e)??window.document}var ac=`http://www.w3.org/2000/svg`;function oc(e,t,n){let r=ic(n).createElementNS(ac,`svg`);return r.setAttributeNS(null,`width`,e.toString()),r.setAttributeNS(null,`height`,t.toString()),r.setAttributeNS(null,`viewBox`,`0 0 ${e} ${t}`),r}function sc(e,t){let n=new XMLSerializer().serializeToString(e);return t&&(n=n.replace(/[\u0000-\u0008\v\f\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/gu,``)),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`}function cc(e,t){return new Promise((n,r)=>{let i=new FileReader;i.onload=()=>n(i.result),i.onerror=()=>r(i.error),i.onabort=()=>r(Error(`Failed read blob to ${t}`)),t===`dataUrl`?i.readAsDataURL(e):t===`arrayBuffer`&&i.readAsArrayBuffer(e)})}var lc=e=>cc(e,`dataUrl`);function uc(e,t){let n=ic(t).createElement(`img`);return n.decoding=`sync`,n.loading=`eager`,n.src=e,n}function dc(e,t){return new Promise(n=>{let{timeout:r,ownerDocument:i,onError:a,onWarn:o}=t??{},s=typeof e==`string`?uc(e,ic(i)):e,c=null,l=null;function u(){n(s),c&&clearTimeout(c),l?.()}if(r&&(c=setTimeout(u,r)),Gs(s)){let e=s.currentSrc||s.src;if(!e)return s.poster?dc(s.poster,t).then(n):u();if(s.readyState>=2)return u();let r=u,i=t=>{o?.(`Failed video load`,e,t),a?.(t),u()};l=()=>{s.removeEventListener(`loadeddata`,r),s.removeEventListener(`error`,i)},s.addEventListener(`loadeddata`,r,{once:!0}),s.addEventListener(`error`,i,{once:!0})}else{let e=zs(s)?s.href.baseVal:s.currentSrc||s.src;if(!e)return u();let t=async()=>{if(Ws(s)&&`decode`in s)try{await s.decode()}catch(t){o?.(`Failed to decode image, trying to render anyway`,s.dataset.originalSrc||e,t)}u()},n=t=>{o?.(`Failed image load`,s.dataset.originalSrc||e,t),u()};if(Ws(s)&&s.complete)return t();l=()=>{s.removeEventListener(`load`,t),s.removeEventListener(`error`,n)},s.addEventListener(`load`,t,{once:!0}),s.addEventListener(`error`,n,{once:!0})}})}async function fc(e,t){Vs(e)&&(Ws(e)||Gs(e)?await dc(e,t):await Promise.all([`img`,`video`].flatMap(n=>Array.from(e.querySelectorAll(n)).map(e=>dc(e,t)))))}var pc=function(){let e=0,t=()=>`0000${(Math.random()*36**4|0).toString(36)}`.slice(-4);return()=>(e+=1,`u${t()}${e}`)}();function mc(e){return e?.split(`,`).map(e=>e.trim().replace(/"|'/g,``).toLowerCase()).filter(Boolean)}var hc=0;function gc(e){let t=`${ws}[#${hc}]`;return hc++,{time:n=>e&&console.time(`${t} ${n}`),timeEnd:n=>e&&console.timeEnd(`${t} ${n}`),warn:(...t)=>e&&ec(...t)}}function _c(e){return{cache:e?`no-cache`:`force-cache`}}async function vc(e,t){return Ns(e)?e:yc(e,{...t,autoDestruct:!0})}async function yc(e,t){let{scale:n=1,workerUrl:r,workerNumber:i=1}=t||{},a=!!t?.debug,o=t?.features??!0,s=e.ownerDocument??(Ts?window.document:void 0),c=e.ownerDocument?.defaultView??(Ts?window:void 0),l=new Map,u={width:0,height:0,quality:1,type:`image/png`,scale:n,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:3e4,progress:null,debug:a,fetch:{requestInit:_c(t?.fetch?.bypassingCache),placeholderImage:`data:image/png;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7`,bypassingCache:!1,...t?.fetch},fetchFn:null,font:{},drawImageInterval:100,workerUrl:null,workerNumber:i,onCloneEachNode:null,onCloneNode:null,onEmbedNode:null,onCreateForeignObjectSvg:null,includeStyleProperties:null,autoDestruct:!1,...t,__CONTEXT__:!0,log:gc(a),node:e,ownerDocument:s,ownerWindow:c,dpi:n===1?null:96*n,svgStyleElement:bc(s),svgDefsElement:s?.createElementNS(ac,`defs`),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:Es&&r&&i?i:0})].map(()=>{try{let e=new Worker(r);return e.onmessage=async e=>{let{url:t,result:n}=e.data;n?l.get(t)?.resolve?.(n):l.get(t)?.reject?.(Error(`Error receiving message from worker: ${t}`))},e.onmessageerror=e=>{let{url:t}=e.data;l.get(t)?.reject?.(Error(`Error receiving message from worker: ${t}`))},e}catch(e){return u.log.warn(`Failed to new Worker`,e),null}}).filter(Boolean),fontFamilies:new Map,fontCssTexts:new Map,acceptOfImage:`${[tc(s)&&`image/webp`,`image/svg+xml`,`image/*`,`*/*`].filter(Boolean).join(`,`)};q=0.8`,requests:l,drawImageCount:0,tasks:[],features:o,isEnable:e=>e===`restoreScrollPosition`?typeof o==`boolean`?!1:o[e]??!1:typeof o==`boolean`?o:o[e]??!0,shadowRoots:[]};u.log.time(`wait until load`),await fc(e,{timeout:u.timeout,onWarn:u.log.warn}),u.log.timeEnd(`wait until load`);let{width:d,height:f}=xc(e,u);return u.width=d,u.height=f,u}function bc(e){if(!e)return;let t=e.createElement(`style`),n=t.ownerDocument.createTextNode(`
3
3
  .______background-clip--text {
4
4
  background-clip: text;
5
5
  -webkit-background-clip: text;
@@ -66,4 +66,4 @@ WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){t
66
66
  `),"aria-label":r.map(AU).join(`, `),children:r.slice(0,3).map(e=>(0,J.jsx)(`span`,{className:`size-2 rounded-full`,style:{background:DU(e.who)}},`${e.who}|${e.tab}`))}):null]}),(0,J.jsxs)(`div`,{className:`flex items-center`,children:[(0,J.jsx)(PU,{wizard:e,className:`opacity-0 transition group-hover/card:opacity-100 has-[[aria-expanded=true]]:opacity-100 focus-within:opacity-100 coarse:opacity-100`}),s?(0,J.jsx)(zU,{url:s}):o.kind===`here`&&i?(0,J.jsx)(BU,{}):null,c?(0,J.jsx)(Re,{label:K(s?`share.open`:`share.openHere`),className:`ml-1 size-8`,onClick:e=>{e.stopPropagation(),Dw(c)},children:(0,J.jsx)(Cr,{className:`size-4`})}):null]})]})]})]})}var HU=[`draft`,`here`,`live`,`missing`],UU={draft:m,here:Gi,live:Va,missing:qe},WU=e=>K(e===`draft`?`home.draft`:e===`here`?`where.here`:e===`live`?`home.live`:`where.missing`);function GU(e,t){let{kind:n}=yH(e,t,e.cloud);return n===`draft`||n===`here`?n:n===`live`||n===`unknown`?`live`:`missing`}function KU({wizards:e,me:t,value:n,onChange:r}){let i=new Map;for(let n of e){let e=GU(n,t);i.set(e,(i.get(e)??0)+1)}if(i.size<2)return null;let a=e=>W(`inline-flex h-8 items-center gap-1.5 rounded-full px-3 font-medium text-[0.8125rem] transition`,e?`bg-paper-2 text-ink`:`text-ink-3 hover:text-ink`);return(0,J.jsxs)(`div`,{className:`mt-5 flex flex-wrap items-center gap-1`,children:[(0,J.jsxs)(`button`,{type:`button`,className:a(n===null),onClick:()=>r(null),children:[K(`home.all`),(0,J.jsx)(`span`,{className:`text-[0.75rem] text-ink-4`,children:e.length})]}),HU.filter(e=>i.has(e)).map(e=>{let t=UU[e];return(0,J.jsxs)(`button`,{type:`button`,"aria-pressed":n===e,className:a(n===e),onClick:()=>r(n===e?null:e),children:[(0,J.jsx)(t,{className:`size-3.5`}),WU(e),(0,J.jsx)(`span`,{className:`text-[0.75rem] text-ink-4`,children:i.get(e)})]},e)})]})}var qU=12,JU=3;function YU({value:e,onChange:t}){return(0,J.jsxs)(`label`,{className:`relative flex h-10 w-full max-w-md items-center gap-2.5 rounded-full bg-card px-4 shadow-soft ring-1 ring-border-soft transition focus-within:ring-2 focus-within:ring-focus sm:h-11`,children:[(0,J.jsx)(ge,{className:`size-4 shrink-0 text-ink-3`}),(0,J.jsx)(`input`,{type:`search`,value:e,onChange:e=>t(e.target.value),placeholder:K(`home.search`),"aria-label":K(`home.search`),className:`min-w-0 flex-1 bg-transparent text-[0.9375rem] outline-none placeholder:text-ink-4 [&::-webkit-search-cancel-button]:hidden`}),e?(0,J.jsx)(`button`,{type:`button`,"aria-label":K(`market.reset`),onClick:()=>t(``),className:`-mr-1.5 flex size-7 shrink-0 items-center justify-center rounded-full text-ink-3 hover:bg-paper-2 hover:text-ink`,children:(0,J.jsx)(ct,{className:`size-4`})}):null]})}var XU=`curl -fsSL https://engenty.ai/install.sh | bash`;function ZU(){let[e,t]=(0,q.useState)(!1),n=[K(`home.local.install`),K(`home.local.signIn`),K(`home.local.publish`)];return(0,J.jsxs)(`div`,{className:`mx-auto flex max-w-xl animate-rise flex-col items-center pt-4 text-center`,children:[(0,J.jsx)(un,{kind:`round`,size:120}),(0,J.jsx)(`h1`,{className:`mt-2 font-display font-semibold text-[1.75rem] leading-tight tracking-tight`,children:K(`home.local.title`)}),(0,J.jsx)(`p`,{className:`mt-3 text-[0.9375rem] text-ink-2 leading-relaxed`,children:K(`home.local.text`)}),(0,J.jsx)(`ol`,{className:`mt-8 flex w-full flex-col gap-4 text-left`,children:n.map((n,r)=>(0,J.jsxs)(`li`,{className:`flex gap-3`,children:[(0,J.jsx)(`span`,{className:`flex size-7 shrink-0 items-center justify-center rounded-full bg-paper-2 font-medium text-[0.8125rem] text-ink-2`,children:r+1}),(0,J.jsxs)(`div`,{className:`min-w-0 flex-1 pt-0.5`,children:[(0,J.jsx)(`p`,{className:`text-[0.9375rem] leading-snug`,children:n}),r===0?(0,J.jsxs)(`div`,{className:`mt-2 flex items-center gap-2 rounded-lg bg-paper-2 py-1.5 pr-1.5 pl-3`,children:[(0,J.jsx)(`code`,{className:`min-w-0 flex-1 select-all overflow-x-auto whitespace-nowrap font-mono text-[0.8125rem] text-ink-2`,children:XU}),(0,J.jsxs)(z,{variant:`secondary`,size:`sm`,onClick:()=>{navigator.clipboard.writeText(XU),t(!0),setTimeout(()=>t(!1),1500)},children:[e?(0,J.jsx)(ft,{className:`size-3.5`}):(0,J.jsx)(st,{className:`size-3.5`}),K(e?`share.copied`:`share.copy`)]})]}):null]})]},n))})]})}function QU(){let e=te(),t=De(),{space:n,spaces:r,loading:i}=Qn(),o=qn().data,s=Xn(),c=Jn(),l=D({queryKey:[`wizards`,n?.id,!!o?.account],queryFn:()=>a.get(`/api/studio/spaces/${n.id}/wizards`),enabled:!!n}),u=FH().data??[],d=mU(`wizard`),[f,p]=(0,q.useState)(null),[m,h]=(0,q.useState)(``),g=(l.data?.length??0)>qU,_=g?m.trim().toLowerCase():``,v=(l.data??[]).filter(e=>(!f||!o||GU(e,o)===f)&&(!_||`${e.title} ${e.description}`.toLowerCase().includes(_))),y=!!_&&v.length<JU,b=rt({mutationFn:e=>a.post(`/api/studio/wizards`,{spaceId:n.id,starterId:e,lang:Rn}),onSuccess:async({id:n})=>{await t.invalidateQueries({queryKey:F.spaces()}),await t.invalidateQueries({queryKey:[`wizards`]}),e(`/edit/${n}`)}}),S=r.reduce((e,t)=>e+t.wizardCount,0),C=c&&!n?.readOnly;return!i&&C&&r.length&&S===0?(0,J.jsx)(pe,{to:`/new`,replace:!0}):!i&&!s&&r.length===0?(0,J.jsx)(ZU,{}):(0,J.jsxs)(`div`,{className:`animate-rise`,children:[(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-4`,children:[g?(0,J.jsx)(YU,{value:m,onChange:h}):(0,J.jsx)(`h1`,{className:`font-display font-semibold text-[1.75rem] tracking-tight`,children:K(`home.title`,{space:n&&o?eW(o,n):n?.name??``})}),C?(0,J.jsxs)(z,{onClick:()=>e(`/new`),children:[(0,J.jsx)(ot,{className:`size-4`}),` `,K(`home.new`)]}):null]}),n?.origin===`local`?(0,J.jsxs)(`p`,{className:`mt-2 text-[0.875rem] text-ink-3`,children:[K(`home.fromLocal`),` `,n.syncedAt?K(`home.syncedAt`,{when:new Intl.DateTimeFormat(Rn,{dateStyle:`medium`,timeStyle:`short`}).format(new Date(n.syncedAt))}):null]}):null,l.data&&l.data.length===0?(0,J.jsxs)(xe,{children:[(0,J.jsx)(`p`,{children:K(`home.empty`)}),C?(0,J.jsxs)(z,{className:`mt-5`,onClick:()=>e(`/new`),children:[(0,J.jsx)(ot,{className:`size-4`}),` `,K(`home.new`)]}):null]}):null,l.data?.length&&o?(0,J.jsx)(KU,{wizards:l.data,me:o,value:f,onChange:p}):null,_&&v.length===0?(0,J.jsx)(`p`,{className:`mt-6 text-[0.875rem] text-ink-3`,children:K(`home.noMatch`)}):null,(0,J.jsx)(`div`,{className:`mt-6 grid gap-4 sm:grid-cols-2 lg:grid-cols-3`,children:o?v.map(e=>(0,J.jsx)(VU,{w:e,me:o,runners:u,present:d?.[e.id]?.filter(e=>e.who!==o.user.id)},e.id)):null}),y?(0,J.jsxs)(J.Fragment,{children:[C?(0,J.jsx)($e,{query:m,busy:b.isPending,onUse:e=>n&&!b.isPending&&b.mutate(e.id)}):(0,J.jsx)($e,{query:m}),C?(0,J.jsx)(`div`,{className:`mt-8 flex justify-center`,children:(0,J.jsxs)(z,{variant:`secondary`,onClick:()=>e(`/new?wish=${encodeURIComponent(m.trim())}`),children:[(0,J.jsx)(x,{className:`size-4`}),` `,K(`home.newFromSearch`,{q:m.trim()})]})}):null]}):null]})}var $U=7;function eW(e,t){return t.root?e.mode===`managed`?e.tenant.name||t.name:K(`nav.localSpace`):t.personal?K(`nav.mySpace`):t.name}function tW({me:e,space:t}){return t.personal?(0,J.jsx)(`span`,{className:`grid size-6 shrink-0 place-items-center rounded-md bg-paper-3 text-ink-2 ring-1 ring-border`,children:(0,J.jsx)(go,{className:`size-4`})}):t.kind===`client`?(0,J.jsx)(`span`,{className:`grid size-6 shrink-0 place-items-center rounded-md bg-violet-500/10 font-semibold text-[0.5625rem] text-violet-700 ring-1 ring-violet-500/30 dark:text-violet-300`,children:Yn(t.name)}):(0,J.jsx)(jY,{space:t,name:t.root?eW(e,t):void 0,size:`xs`})}function nW({open:e,onToggle:t}){return(0,J.jsx)(`button`,{type:`button`,onClick:t,"aria-pressed":e,"aria-label":K(`nav.sidebar`),title:K(`nav.sidebar`),className:W(`-ml-1 grid size-8 shrink-0 place-items-center rounded-lg text-ink-3 transition hover:bg-accent hover:text-ink`,!e&&`bg-accent text-ink`),children:(0,J.jsx)(Ta,{className:`size-4`})})}function rW({me:e}){let t=te(),{space:n,spaces:r,select:i}=Qn(),a=Jn(),[o,s]=(0,q.useState)(!1),[c,l]=(0,q.useState)(null),u=nt(`clientSpaces`),d=Kn(),[f,p]=(0,q.useState)(!1),m=(0,q.useRef)(null);if(OY(m,o,()=>s(!1)),!n)return null;let h=eW(e,n),g=e.limits.spaces,_=g!==null&&r.filter(e=>e.kind===`space`).length>=g,v=u&&d&&e.mode===`managed`,y=r.length<=1&&!(a&&(!_||v)),b=r.find(e=>e.root),x=r.find(e=>e.personal),S=r.filter(e=>!e.root&&e.kind===`space`),C=r.filter(e=>e.kind===`client`),w=e=>{s(!1),p(!1),e===n.id?t(`/`):i(e)},T=(t,r)=>(0,J.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":t.id===n.id,onClick:()=>w(t.id),className:W(`flex w-full items-center gap-2.5 rounded-lg px-2 py-1.5 text-left text-[0.875rem] transition hover:bg-accent`,t.id===n.id?`bg-background font-medium text-ink shadow-soft`:`text-ink-2`),children:[(0,J.jsx)(tW,{me:e,space:t}),(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:eW(e,t)}),t.kind===`client`&&t.clients>0?(0,J.jsxs)(`span`,{className:`flex shrink-0 items-center gap-0.5 text-[0.75rem] text-violet-700 dark:text-violet-300`,children:[(0,J.jsx)(Po,{className:`size-3`}),t.clients]}):r?(0,J.jsx)(`span`,{className:`shrink-0 text-[0.75rem] text-ink-4`,children:r}):null]},t.id),E=(0,J.jsx)(tW,{me:e,space:n});return y?(0,J.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2 px-1 font-medium text-[0.9375rem] text-ink`,children:[E,(0,J.jsx)(`span`,{className:`truncate`,children:h})]}):(0,J.jsxs)(`div`,{ref:m,className:`relative shrink-0`,children:[(0,J.jsxs)(`button`,{type:`button`,"aria-haspopup":`menu`,"aria-expanded":o,title:K(`nav.switchSpace`),onClick:()=>s(e=>!e),className:W(`flex max-w-[18rem] items-center gap-2 rounded-lg px-1.5 py-1 font-medium text-[0.9375rem] text-ink transition hover:bg-accent`,o&&`bg-accent`),children:[E,(0,J.jsx)(`span`,{className:`truncate`,children:h}),(0,J.jsx)(Ur,{className:`size-3.5 shrink-0 text-ink-4`})]}),o?(0,J.jsxs)(`div`,{role:`menu`,className:`absolute top-10 left-0 z-50 w-72 animate-rise rounded-xl bg-card p-1.5 shadow-overlay ring-1 ring-border-soft`,children:[b?T(b,e.mode===`managed`?K(`nav.spaceAll`):void 0):null,x?T(x,K(`nav.spaceMine`)):null,S.length?(0,J.jsx)(`div`,{className:`px-2 pt-2 pb-1 text-[0.75rem] text-ink-3`,children:K(`nav.spacesHeading`)}):null,S.slice(0,$U).map(e=>T(e)),S.length>$U?(0,J.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{s(!1),p(!0)},className:`flex w-full items-center gap-2.5 rounded-lg px-2 py-1.5 text-left text-[0.875rem] text-ink-3 transition hover:bg-accent hover:text-ink`,children:[(0,J.jsx)(ge,{className:`size-4 shrink-0`}),K(`nav.allSpaces`,{n:S.length})]}):null,a&&!_?(0,J.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{s(!1),l(`space`)},className:`flex w-full items-center gap-2.5 rounded-lg px-2 py-1.5 text-left text-[0.875rem] text-ink-3 transition hover:bg-accent hover:text-ink`,children:[(0,J.jsx)(ot,{className:`size-4 shrink-0`}),K(`nav.newSpace`)]}):null,C.length||a&&v?(0,J.jsx)(`div`,{className:`px-2 pt-2 pb-1 text-[0.75rem] text-ink-3`,children:K(`nav.clientsHeading`)}):null,C.slice(0,$U).map(e=>T(e)),a&&v?(0,J.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{s(!1),l(`client`)},className:`flex w-full items-center gap-2.5 rounded-lg px-2 py-1.5 text-left text-[0.875rem] text-ink-3 transition hover:bg-accent hover:text-ink`,children:[(0,J.jsx)(ot,{className:`size-4 shrink-0`}),K(`nav.newClient`)]}):null]}):null,(0,J.jsx)(LU,{open:c!==null,client:c===`client`,onClose:()=>l(null)}),(0,J.jsx)(iW,{me:e,open:f,onClose:()=>p(!1),pick:w})]})}function iW({me:e,open:t,onClose:n,pick:r}){let{space:i,spaces:a}=Qn(),[o,s]=(0,q.useState)(``),c=o.trim().toLowerCase(),l=a.filter(t=>!c||eW(e,t).toLowerCase().includes(c));return(0,J.jsxs)(H,{open:t,onClose:n,title:K(`nav.spacesHeading`),height:`tall`,children:[(0,J.jsx)(ie,{autoFocus:!0,value:o,placeholder:K(`nav.searchSpaces`),"aria-label":K(`nav.searchSpaces`),onChange:e=>s(e.target.value)}),(0,J.jsxs)(`div`,{className:`mt-3 flex flex-col gap-0.5`,children:[l.map(t=>(0,J.jsxs)(`button`,{type:`button`,onClick:()=>r(t.id),className:W(`flex w-full items-center gap-2.5 rounded-lg px-2 py-2 text-left text-[0.875rem] transition hover:bg-accent`,t.id===i?.id?`font-medium text-ink`:`text-ink-2`),children:[(0,J.jsx)(tW,{me:e,space:t}),(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:eW(e,t)}),t.clients>0?(0,J.jsx)(`span`,{className:`text-[0.75rem] text-violet-700 dark:text-violet-300`,children:K(`nav.spaceClients`,{n:t.clients})}):null]},t.id)),l.length?null:(0,J.jsx)(`p`,{className:`px-2 py-6 text-center text-[0.875rem] text-ink-3`,children:K(`nav.noSpaceFound`)})]})]})}function aW(e,t){return!(!e||!t||t.root||t.personal||t.readOnly||e.tenant.role!==`owner`&&e.tenant.role!==`admin`)}function oW({space:e}){let t=qn().data,[n,r]=(0,q.useState)(!1);if(t?.mode!==`managed`)return null;let i=aW(t,e);return(0,J.jsxs)(`div`,{className:`mt-auto flex items-center gap-2.5 border-border-soft border-t px-1.5 pt-2.5 pb-1`,children:[(0,J.jsx)(`span`,{className:`grid size-7 shrink-0 place-items-center rounded-md bg-paper-3 text-ink-2 ring-1 ring-border`,children:(0,J.jsx)(Ro,{className:`size-3.5`})}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col leading-tight`,children:[(0,J.jsx)(`span`,{className:`truncate font-medium text-[0.8125rem] text-ink`,children:eW(t,e)}),(0,J.jsx)(`span`,{className:`truncate text-[0.75rem] text-ink-3`,children:e.personal?K(`nav.spaceMine`):e.clients?K(`nav.spaceClients`,{n:e.clients}):e.access===`members`?K(`share.whoMembers`):K(`share.everyone`)})]}),i?(0,J.jsx)(z,{variant:`ghost`,onClick:()=>r(!0),children:K(`share.title`)}):null,i?(0,J.jsx)(cW,{me:t,space:e,open:n,onClose:()=>r(!1)}):null]})}function sW({value:e,organization:t,onChange:n,disabled:r,here:i=!1}){let a=(0,q.useId)();return(0,J.jsxs)(`fieldset`,{className:`grid gap-2`,children:[(0,J.jsx)(`legend`,{className:`mb-2 font-medium text-[0.875rem] text-ink`,children:K(`share.who`)}),[`all`,`members`].map(o=>(0,J.jsxs)(`label`,{className:W(`flex cursor-pointer items-start gap-2.5 rounded-lg p-2.5 ring-1 transition`,e===o?`bg-background ring-ember/50`:`ring-border-soft hover:bg-ink/5`),children:[(0,J.jsx)(`input`,{type:`radio`,name:a,checked:e===o,disabled:r,onChange:()=>n(o),className:`mt-0.5 accent-ember`}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5 leading-tight`,children:[(0,J.jsx)(`span`,{className:`text-[0.875rem] text-ink`,children:o===`all`?K(`share.whoAll`,{organization:t}):K(`share.whoMembers`)}),(0,J.jsx)(`span`,{className:`text-[0.75rem] text-ink-3`,children:K(o===`all`?`share.whoAllHint`:i?`share.whoMembersHere`:`share.whoMembersHint`)})]})]},o))]})}function cW({me:e,space:t,open:n,onClose:r}){let i=nt(`clientSpaces`)&&t.kind===`client`,o=De(),[s,c]=(0,q.useState)(``),l=e.tenant.name||K(`nav.space`),u=D({queryKey:[`space-members`,t.id],queryFn:()=>a.get(`/api/studio/spaces/${t.id}/members`),enabled:n}),d=t.access===`members`,f=D({queryKey:[`organization`,e.tenant.id],queryFn:()=>a.get(`/api/studio/organization`),enabled:n}),p=rt({mutationFn:e=>a.patch(`/api/studio/spaces/${t.id}`,{access:e}),onSuccess:async()=>{await o.invalidateQueries({queryKey:F.spaces()}),await o.invalidateQueries({queryKey:[`space-members`,t.id]})}}),m=rt({mutationFn:({userId:e,inside:n})=>n?a.put(`/api/studio/spaces/${t.id}/members/${e}`,{role:`member`}):a.del(`/api/studio/spaces/${t.id}/members/${e}`),onSuccess:()=>o.invalidateQueries({queryKey:[`space-members`,t.id]})}),h=new Set((u.data?.members??[]).filter(e=>e.role===`member`).map(e=>e.userId)),g=rt({mutationFn:e=>a.post(`/api/studio/spaces/${t.id}/invite`,{email:e,lang:Rn}),onSuccess:async()=>{c(``),await o.invalidateQueries({queryKey:[`space-members`,t.id]}),await o.invalidateQueries({queryKey:F.spaces()})}}),_=e=>{e.preventDefault(),s.trim()&&g.mutate(s.trim())},v=(u.data?.members??[]).filter(e=>e.role===`client`),y=rt({mutationFn:e=>a.del(`/api/studio/spaces/${t.id}/members/${e}`),onSuccess:async()=>{await o.invalidateQueries({queryKey:[`space-members`,t.id]}),await o.invalidateQueries({queryKey:F.spaces()})}});return(0,J.jsxs)(H,{open:n,onClose:r,title:K(`share.dialogTitle`,{name:t.name}),children:[(0,J.jsxs)(`p`,{className:`-mt-2 text-[0.875rem] text-ink-2`,children:[d?K(`share.membersOnlySee`):K(`share.membersSee`,{organization:l}),i?` ${K(`share.clientSpace`)}`:null]}),(0,J.jsx)(`div`,{className:`mt-4`,children:(0,J.jsx)(sW,{value:t.access,organization:l,disabled:p.isPending,here:!0,onChange:e=>p.mutate(e)})}),(0,J.jsxs)(`div`,{className:`mt-4`,children:[(0,J.jsx)(`div`,{className:`mb-1.5 font-medium text-[0.875rem] text-ink`,children:K(`share.people`)}),(0,J.jsx)(`ul`,{className:`flex max-h-56 flex-col overflow-y-auto`,children:(f.data?.members??[]).filter(e=>e.role!==`client`).map(t=>(0,J.jsxs)(`li`,{className:`flex items-center gap-2.5 border-border-soft border-b py-2 text-[0.875rem] last:border-b-0`,children:[(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:t.name||t.email}),t.userId===e.user.id?(0,J.jsx)(`span`,{className:`text-[0.75rem] text-ink-4`,children:K(`share.you`)}):null,(0,J.jsx)(Ve,{checked:!d||h.has(t.userId),disabled:!d||t.userId===e.user.id||m.isPending,label:t.name||t.email,onChange:e=>m.mutate({userId:t.userId,inside:e})})]},t.userId))})]}),i?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`form`,{onSubmit:_,className:`mt-4 flex gap-2`,children:[(0,J.jsx)(ie,{id:`share-${t.id}`,type:`email`,value:s,maxLength:254,placeholder:K(`share.clientEmail`),"aria-label":K(`share.clientEmail`),onChange:e=>c(e.target.value)}),(0,J.jsx)(z,{type:`submit`,variant:`secondary`,busy:g.isPending,disabled:!s.trim(),children:K(`share.inviteClient`)})]}),g.error?(0,J.jsx)(`p`,{className:`mt-2 text-[0.8125rem] text-rose`,children:g.error.message}):null,(0,J.jsx)(`ul`,{className:`mt-4 flex flex-col`,children:v.map(e=>(0,J.jsxs)(`li`,{className:`flex items-center gap-2.5 border-border-soft border-b py-2 text-[0.875rem] last:border-b-0`,children:[(0,J.jsx)(Po,{className:`size-4 shrink-0 text-violet-700 dark:text-violet-300`}),(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.email??e.userId}),(0,J.jsx)(`span`,{className:`rounded-full bg-violet-500/10 px-2 py-0.5 text-[0.75rem] text-violet-700 dark:text-violet-300`,children:e.userId?K(`share.client`):K(`share.invited`)}),e.userId?(0,J.jsx)(Re,{label:K(`share.removeClient`,{name:e.email??``}),disabled:y.isPending,onClick:()=>y.mutate(e.userId),children:(0,J.jsx)(ct,{className:`size-4`})}):null]},e.userId??e.email))}),(0,J.jsx)(`p`,{className:`mt-3 text-[0.8125rem] text-ink-3`,children:K(`share.clientsSee`)})]}):null,(0,J.jsx)(`div`,{className:`mt-5 flex justify-end`,children:(0,J.jsx)(z,{onClick:r,children:K(`share.done`)})})]})}var lW=`application/x-wizards-chat`;function uW(e){let[t,n]=(0,q.useState)(()=>{try{return new Set(JSON.parse(localStorage.getItem(e)??`[]`))}catch{return new Set}});return[t,t=>n(n=>{let r=new Set(n);r.delete(t)||r.add(t);try{localStorage.setItem(e,JSON.stringify([...r]))}catch{}return r})]}function dW(){let[e,t]=(0,q.useState)(``),[n,r]=(0,q.useState)(!1),[i,a]=(0,q.useState)(!1),{space:o}=Qn(),s=nt(`orgSpaces`),{data:c}=cm(o?.id,e),[l,u]=uW(`wizards.work.folded-sections`),[d,f]=uW(`wizards.work.folded-threads`),[p,m]=(0,q.useState)(!1),h=gm(),g=Sm(),_=te(),v=c?.sections??[],y=(c?.chats??[]).filter(e=>(n||!e.archived)&&(!i||e.unread)),b=new Set(y.map(e=>e.id)),x=y.filter(e=>!e.parentId||!b.has(e.parentId)),S=e=>y.filter(t=>t.parentId===e),C=new Set(v.map(e=>e.id)),w=x.filter(e=>!e.archived),T=w.filter(e=>e.pinned),E=e=>w.filter(t=>!t.pinned&&t.sectionId===e),D=w.filter(e=>!e.pinned&&(!e.sectionId||!C.has(e.sectionId))),O=x.filter(e=>e.archived),k=async(e=null,t=null)=>{let n=await h.mutateAsync({spaceId:o?.id,sectionId:e,parentId:t});_(`/work/c/${n.id}`)},A=e=>(0,J.jsx)(SW,{chat:e,sections:v,threads:S(e.id),threadsFolded:d.has(e.id),onToggleThreads:()=>f(e.id),onNewThread:()=>k(e.sectionId,e.id),onNewSection:()=>m(!0)},e.id);return(0,J.jsx)(cH,{delay:500,children:(0,J.jsxs)(`aside`,{"aria-label":K(`work.chats`),className:`flex w-72 shrink-0 flex-col gap-0.5 overflow-y-auto border-border-soft border-r p-2 text-[0.875rem]`,children:[(0,J.jsxs)(Ae,{to:`/work`,end:!0,className:({isActive:e})=>W(`mb-1 flex items-center gap-2.5 rounded-lg px-2.5 py-1.5 font-semibold text-ink hover:bg-ink/5`,e&&`bg-ink/10 hover:bg-ink/10`),children:[(0,J.jsx)(Fi,{className:`size-4 shrink-0`}),K(`work.start`)]}),(0,J.jsxs)(`button`,{type:`button`,onClick:()=>k(),className:`flex items-center gap-2.5 rounded-lg px-2.5 py-1.5 text-left text-ink hover:bg-ink/5`,children:[(0,J.jsx)(ot,{className:`size-4 shrink-0`}),K(`work.newChat`)]}),(0,J.jsxs)(`label`,{className:`flex items-center gap-2.5 rounded-lg px-2.5 py-1.5 text-ink-3 focus-within:bg-ink/5 hover:bg-ink/5`,children:[(0,J.jsx)(ge,{className:`size-4 shrink-0`}),(0,J.jsx)(`input`,{type:`search`,value:e,onChange:e=>t(e.target.value),placeholder:K(`work.search`),"aria-label":K(`work.search`),className:`min-w-0 flex-1 bg-transparent text-ink outline-none placeholder:text-ink-3`})]}),T.length?(0,J.jsx)(hW,{title:K(`work.pinned`),children:T.map(A)}):null,v.map((e,t)=>(0,J.jsx)(gW,{section:e,first:t===0,last:t===v.length-1,folded:l.has(e.id),onToggle:()=>u(e.id),onNewChat:()=>k(e.id),children:E(e.id).map(A)},e.id)),p?(0,J.jsx)(_W,{placeholder:K(s?`work.folderName`:`work.sectionName`),onDone:async e=>{m(!1),e&&o&&await g.mutateAsync({spaceId:o.id,name:e})}}):null,(0,J.jsx)(hW,{title:K(`work.chats`),dropTo:null,actions:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(lV,{children:[(0,J.jsx)(pW,{label:K(`work.filter`),children:(0,J.jsx)(uV,{className:fW,"aria-label":K(`work.filter`),children:(0,J.jsx)(Zi,{className:`size-3.5`})})}),(0,J.jsxs)(dV,{align:`end`,className:`w-52`,children:[(0,J.jsx)(gV,{checked:i,onCheckedChange:e=>a(!!e),children:K(`work.unreadOnly`)}),(0,J.jsx)(gV,{checked:n,onCheckedChange:e=>r(!!e),children:K(`work.showArchived`)})]})]}),(0,J.jsx)(pW,{label:K(s?`work.newFolder`:`work.newSection`),children:(0,J.jsx)(`button`,{type:`button`,className:fW,"aria-label":K(s?`work.newFolder`:`work.newSection`),onClick:()=>m(!0),children:(0,J.jsx)(ot,{className:`size-3.5`})})})]}),children:D.length?D.map(A):(0,J.jsx)(`p`,{className:`px-2.5 py-1 text-[0.8125rem] text-ink-4`,children:K(e||i?`work.noMatches`:`work.noChats`)})}),n&&O.length?(0,J.jsx)(hW,{title:K(`work.archived`),children:O.map(A)}):null,s&&o?(0,J.jsx)(oW,{space:o}):null]})})}var fW=`grid size-6 place-items-center rounded-md text-ink-3 hover:bg-ink/10 hover:text-ink data-popup-open:bg-ink/10`;function pW({label:e,children:t}){return(0,J.jsxs)(lH,{children:[(0,J.jsx)(uH,{render:(0,J.jsx)(`span`,{className:`inline-flex`}),children:t}),(0,J.jsx)(dH,{children:e})]})}function mW(e){let[t,n]=(0,q.useState)(!1),r=_m();return e===void 0?{over:!1,props:{}}:{over:t,props:{onDragOver:e=>{e.dataTransfer.types.includes(lW)&&(e.preventDefault(),n(!0))},onDragLeave:()=>n(!1),onDrop:t=>{n(!1);let i=t.dataTransfer.getData(lW);i&&(t.preventDefault(),r.mutate({id:i,sectionId:e}))}}}}function hW({title:e,actions:t,dropTo:n,children:r}){let i=mW(n);return(0,J.jsxs)(`section`,{...i.props,className:W(`mt-3 flex min-w-0 flex-col gap-0.5 rounded-lg`,i.over&&`bg-ink/5 ring-1 ring-ember/40`),children:[(0,J.jsxs)(`div`,{className:`group/heading flex h-7 items-center gap-1 px-2.5`,children:[(0,J.jsx)(`h2`,{className:`min-w-0 flex-1 truncate font-medium text-[0.8125rem] text-ink-3`,children:e}),t?(0,J.jsx)(`div`,{className:`flex items-center gap-0.5`,children:t}):null]}),r]})}function gW({section:e,first:t,last:n,folded:r,onToggle:i,onNewChat:a,children:o}){let s=mW(e.id),c=nt(`orgSpaces`),l=te(),[u,f]=(0,q.useState)(!1),p=Cm(),m=Tm(),h=Em(),g=Array.isArray(o)?o.length:0;return(0,J.jsxs)(`section`,{...s.props,className:W(`mt-3 flex min-w-0 flex-col gap-0.5 rounded-lg`,s.over&&`bg-ink/5 ring-1 ring-ember/40`),children:[(0,J.jsxs)(`div`,{className:`group/heading flex h-7 items-center gap-1 rounded-lg px-1.5 hover:bg-ink/5`,children:[u?(0,J.jsx)(_W,{initial:e.name,placeholder:K(c?`work.folderName`:`work.sectionName`),onDone:async t=>{f(!1),t&&t!==e.name&&await p.mutateAsync({id:e.id,name:t})}}):(0,J.jsxs)(`button`,{type:`button`,onClick:i,"aria-expanded":!r,className:`flex min-w-0 flex-1 items-center gap-1 px-1 text-left font-medium text-[0.8125rem] text-ink-3`,children:[c?(0,J.jsx)(Ti,{className:`size-3.5 shrink-0`}):null,(0,J.jsx)(`span`,{className:`truncate`,children:e.name}),(0,J.jsx)(Me,{className:W(`size-3.5 shrink-0 transition-transform`,r&&`-rotate-90`)}),r&&g?(0,J.jsx)(`span`,{className:`text-ink-4 tabular-nums`,children:g}):null]}),(0,J.jsxs)(`div`,{className:`flex items-center gap-0.5 opacity-0 focus-within:opacity-100 group-hover/heading:opacity-100 has-data-popup-open:opacity-100`,children:[(0,J.jsxs)(lV,{children:[(0,J.jsx)(uV,{className:fW,"aria-label":K(`work.more`),children:(0,J.jsx)(gt,{className:`size-3.5`})}),(0,J.jsxs)(dV,{align:`end`,className:`w-52`,children:[c?(0,J.jsxs)(fV,{onClick:()=>l(`/work/f/${e.id}`),children:[(0,J.jsx)(xi,{}),K(`work.openFolder`)]}):null,(0,J.jsxs)(fV,{onClick:()=>f(!0),children:[(0,J.jsx)(d,{}),K(`work.rename`)]}),(0,J.jsxs)(fV,{disabled:t,onClick:()=>m.mutate({id:e.id,direction:`up`}),children:[(0,J.jsx)(Pe,{}),K(`work.moveUp`)]}),(0,J.jsxs)(fV,{disabled:n,onClick:()=>m.mutate({id:e.id,direction:`down`}),children:[(0,J.jsx)(ze,{}),K(`work.moveDown`)]}),(0,J.jsx)(_V,{}),(0,J.jsxs)(fV,{variant:`destructive`,onClick:async()=>{await R(K(`work.deleteSectionConfirm`,{name:e.name}))&&h.mutate(e.id)},children:[(0,J.jsx)(ut,{}),K(`work.deleteSection`)]})]})]}),(0,J.jsx)(pW,{label:K(`work.newChatIn`,{name:e.name}),children:(0,J.jsx)(`button`,{type:`button`,className:fW,"aria-label":K(`work.newChatIn`,{name:e.name}),onClick:a,children:(0,J.jsx)(ot,{className:`size-3.5`})})})]})]}),r?null:g?o:(0,J.jsx)(`p`,{className:`px-2.5 py-1 text-[0.8125rem] text-ink-4`,children:K(`work.noChats`)})]})}function _W({initial:e=``,placeholder:t,onDone:n}){let[r,i]=(0,q.useState)(e),a=(0,q.useRef)(!1),o=e=>{a.current||(a.current=!0,n(e))};return(0,J.jsx)(`input`,{autoFocus:!0,value:r,placeholder:t,"aria-label":t,onChange:e=>i(e.target.value),onFocus:e=>e.target.select(),onKeyDown:e=>{e.key===`Enter`?o(r.trim()||null):e.key===`Escape`&&o(null)},onBlur:()=>o(r.trim()||null),className:`h-7 min-w-0 flex-1 rounded-md bg-card px-2 text-[0.8125rem] text-ink outline-none ring-1 ring-ember/50`})}var vW={Item:fV,CheckboxItem:gV,Sub:pV,SubTrigger:mV,SubContent:hV,Separator:_V,Shortcut:vV},yW={Item:nV,CheckboxItem:oV,Sub:rV,SubTrigger:iV,SubContent:aV,Separator:sV,Shortcut:cV},bW={rename:`R`,pin:`P`,read:`U`,thread:`T`,archive:`A`,remove:`D`};function xW({kit:e,chat:t,sections:n,act:r}){return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(e.Item,{onClick:r.rename,children:[(0,J.jsx)(d,{}),K(`work.rename`),(0,J.jsx)(e.Shortcut,{children:bW.rename})]}),(0,J.jsxs)(e.Item,{onClick:r.pin,children:[t.pinned?(0,J.jsx)(La,{}):(0,J.jsx)(za,{}),t.pinned?K(`work.unpin`):K(`work.pin`),(0,J.jsx)(e.Shortcut,{children:bW.pin})]}),(0,J.jsxs)(e.Item,{onClick:r.read,children:[t.unread?(0,J.jsx)(si,{}):(0,J.jsx)(vt,{}),t.unread?K(`work.markRead`):K(`work.markUnread`),(0,J.jsx)(e.Shortcut,{children:bW.read})]}),t.parentId?null:(0,J.jsxs)(e.Sub,{children:[(0,J.jsxs)(e.SubTrigger,{children:[(0,J.jsx)(v,{}),K(`work.moveTo`)]}),(0,J.jsxs)(e.SubContent,{className:`w-52`,children:[n.map(n=>(0,J.jsx)(e.CheckboxItem,{checked:t.sectionId===n.id,onCheckedChange:()=>r.move(n.id),children:n.name},n.id)),(0,J.jsx)(e.CheckboxItem,{checked:!t.sectionId,onCheckedChange:()=>r.move(null),children:K(`work.noSection`)}),(0,J.jsx)(e.Separator,{}),(0,J.jsxs)(e.Item,{onClick:r.newSection,children:[(0,J.jsx)(ot,{}),K(`work.newSection`)]})]})]}),(0,J.jsxs)(e.Item,{onClick:r.newThread,children:[(0,J.jsx)(la,{}),K(`work.newThread`),(0,J.jsx)(e.Shortcut,{children:bW.thread})]}),(0,J.jsx)(e.Separator,{}),(0,J.jsx)(e.CheckboxItem,{checked:t.private,onCheckedChange:r.setPrivate,children:K(`work.private`)}),(0,J.jsxs)(e.Item,{onClick:r.copyLink,children:[(0,J.jsx)(A,{}),K(`work.copyLink`)]}),(0,J.jsx)(e.Separator,{}),(0,J.jsxs)(e.Item,{onClick:r.archive,children:[t.archived?(0,J.jsx)(_r,{}):(0,J.jsx)(yr,{}),t.archived?K(`work.unarchive`):K(`work.archive`),(0,J.jsx)(e.Shortcut,{children:bW.archive})]}),(0,J.jsxs)(e.Item,{variant:`destructive`,onClick:r.remove,children:[(0,J.jsx)(ut,{}),K(`work.delete`),(0,J.jsx)(e.Shortcut,{children:bW.remove})]})]})}function SW({chat:e,sections:t,threads:n,threadsFolded:r,onToggleThreads:i,onNewThread:a,onNewSection:o,depth:s=0,last:c=!1}){let{chatId:l}=Ue(),u=te(),[d,f]=(0,q.useState)(!1),p=(0,q.useRef)(null),m=vm(),h=_m(),g=ym(),_=e.title||K(`work.untitled`),v=l===e.id,y={rename:()=>f(!0),pin:()=>m.mutate({id:e.id,pinned:!e.pinned}),read:()=>m.mutate({id:e.id,read:e.unread}),archive:()=>m.mutate({id:e.id,archived:!e.archived}),remove:async()=>{await R(K(`work.deleteConfirm`,{title:_}))&&g.mutate(e.id,{onSuccess:()=>{v&&u(`/work`)}})},move:t=>h.mutate({id:e.id,sectionId:t}),newSection:o,newThread:a,setPrivate:t=>h.mutate({id:e.id,private:t}),copyLink:()=>{navigator.clipboard?.writeText(new URL(`work/c/${e.id}`,document.baseURI).href)}},b=e=>{if(e.metaKey||e.ctrlKey||e.altKey||d)return;let t=e.key.toUpperCase(),n={[bW.rename]:y.rename,[bW.pin]:y.pin,[bW.read]:y.read,[bW.thread]:y.newThread,[bW.archive]:y.archive,[bW.remove]:y.remove}[t];n&&(e.preventDefault(),n())},x=n.length>0;return(0,J.jsxs)(`div`,{className:W(s>0&&`relative ml-4 pl-3`),children:[s>0?(0,J.jsx)(`span`,{"aria-hidden":`true`,className:W(`pointer-events-none absolute top-0 left-0 border-border border-l`,c?`h-4 w-2 rounded-bl-md border-b`:`bottom-0`)}):null,(0,J.jsxs)($B,{children:[(0,J.jsxs)(eV,{render:(0,J.jsx)(`div`,{ref:p,draggable:!d,onDragStart:t=>{t.dataTransfer.setData(lW,e.id),t.dataTransfer.effectAllowed=`move`},className:W(`group/row relative flex h-8 items-center gap-1 rounded-lg pr-1 hover:bg-ink/5 has-data-popup-open:bg-ink/5`,v&&`bg-ink/10 hover:bg-ink/10`)}),children:[d?(0,J.jsx)(`div`,{className:`flex min-w-0 flex-1 px-1`,children:(0,J.jsx)(_W,{initial:e.title,placeholder:K(`work.untitled`),onDone:t=>{f(!1),t&&t!==e.title&&h.mutate({id:e.id,title:t})}})}):(0,J.jsxs)(LV,{children:[(0,J.jsxs)(RV,{delay:700,render:(0,J.jsx)(Ae,{to:`/work/c/${e.id}`,onKeyDown:b,className:`flex h-full min-w-0 flex-1 items-center gap-1.5 rounded-lg pl-2.5 outline-none focus-visible:ring-2 focus-visible:ring-ring`}),children:[(0,J.jsx)(`span`,{className:W(`truncate`,e.unread?`font-medium text-ink`:`text-ink-2`,!e.title&&`text-ink-3`),children:_}),e.private?(0,J.jsx)(ta,{className:`size-3 shrink-0 text-ink-4`,"aria-label":K(`work.private`)}):null]}),(0,J.jsx)(zV,{anchor:p,side:`right`,align:`start`,sideOffset:10,className:`w-80 p-3`,children:(0,J.jsx)(CW,{chat:e})})]}),x?(0,J.jsx)(pW,{label:K(r?`work.showThreads`:`work.hideThreads`),children:(0,J.jsxs)(`button`,{type:`button`,onClick:i,"aria-expanded":!r,"aria-label":K(r?`work.showThreads`:`work.hideThreads`),className:`flex h-6 shrink-0 items-center gap-0.5 rounded-md px-1 text-ink-4 hover:bg-ink/10 hover:text-ink`,children:[(0,J.jsx)(Me,{className:W(`size-3.5 transition-transform`,r&&`-rotate-90`)}),r?(0,J.jsx)(`span`,{className:`text-xs tabular-nums`,children:n.length}):null]})}):null,(0,J.jsxs)(`div`,{className:`hidden shrink-0 items-center gap-0.5 group-hover/row:flex has-data-popup-open:flex`,children:[(0,J.jsx)(pW,{label:e.pinned?K(`work.unpinChat`):K(`work.pinChat`),children:(0,J.jsx)(`button`,{type:`button`,className:fW,"aria-label":e.pinned?K(`work.unpinChat`):K(`work.pinChat`),onClick:y.pin,children:e.pinned?(0,J.jsx)(La,{className:`size-3.5`}):(0,J.jsx)(za,{className:`size-3.5`})})}),(0,J.jsx)(pW,{label:e.archived?K(`work.unarchive`):K(`work.archiveChat`),children:(0,J.jsx)(`button`,{type:`button`,className:fW,"aria-label":e.archived?K(`work.unarchive`):K(`work.archiveChat`),onClick:y.archive,children:e.archived?(0,J.jsx)(_r,{className:`size-3.5`}):(0,J.jsx)(yr,{className:`size-3.5`})})}),(0,J.jsxs)(lV,{children:[(0,J.jsx)(uV,{className:fW,"aria-label":K(`work.more`),children:(0,J.jsx)(gt,{className:`size-3.5`})}),(0,J.jsx)(dV,{align:`start`,className:`w-60`,children:(0,J.jsx)(xW,{kit:vW,chat:e,sections:t,act:y})})]})]}),e.unread?(0,J.jsx)(`span`,{role:`img`,"aria-label":K(`work.unread`),className:`mr-1.5 size-2 shrink-0 rounded-full bg-ember group-hover/row:hidden`}):null]}),(0,J.jsx)(tV,{className:`w-60`,children:(0,J.jsx)(xW,{kit:yW,chat:e,sections:t,act:y})})]}),x&&!r?n.map((e,r)=>(0,J.jsx)(SW,{chat:e,sections:t,threads:[],threadsFolded:!0,onToggleThreads:()=>{},onNewThread:a,onNewSection:o,depth:s+1,last:r===n.length-1},e.id)):null]})}function CW({chat:e}){let[t,n]=(0,q.useState)(``),r=bm(),i=()=>{let i=t.trim();i&&(r.mutate({id:e.id,text:i}),n(``))};return(0,J.jsxs)(`div`,{className:`grid gap-2`,children:[(0,J.jsx)(`p`,{className:`font-semibold text-ink`,children:e.title||K(`work.untitled`)}),e.last?(0,J.jsxs)(`p`,{className:`line-clamp-3 text-[0.8125rem] text-ink-3`,children:[(0,J.jsx)(`span`,{className:`text-ink-2`,children:e.last.author}),` · `,e.last.text]}):(0,J.jsx)(`p`,{className:`text-[0.8125rem] text-ink-4`,children:K(`work.emptyChat`)}),(0,J.jsxs)(`label`,{className:`flex items-center gap-2 rounded-lg bg-ink/5 px-2.5 py-1.5`,children:[(0,J.jsx)(`input`,{value:t,onChange:e=>n(e.target.value),onKeyDown:e=>{e.key===`Enter`&&(e.preventDefault(),i())},placeholder:K(`work.reply`),"aria-label":K(`work.reply`),className:`min-w-0 flex-1 bg-transparent text-[0.8125rem] text-ink outline-none placeholder:text-ink-4`}),(0,J.jsx)(o,{className:`size-3.5 shrink-0 text-ink-4`})]})]})}function wW(e){return xM(e.defaultTagName??`div`,e,e)}function TW(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=TW(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function EW(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=TW(e))&&(r&&(r+=` `),r+=t);return r}var DW=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,OW=EW,kW=(e,t)=>n=>{if(t?.variants==null)return OW(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=DW(t)||DW(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return OW(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},AW=kW(`group/bubble relative flex w-fit max-w-[80%] min-w-0 flex-col gap-1 group-data-[align=end]/message:self-end data-[align=end]:self-end data-[variant=ghost]:max-w-full`,{variants:{variant:{default:`*:data-[slot=bubble-content]:bg-primary *:data-[slot=bubble-content]:text-primary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-primary/80`,secondary:`*:data-[slot=bubble-content]:bg-secondary *:data-[slot=bubble-content]:text-secondary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]`,muted:`*:data-[slot=bubble-content]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--muted),var(--foreground)_5%)]`,tinted:`*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.93_calc(c*0.4)_h)] *:data-[slot=bubble-content]:text-foreground dark:*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.3_calc(c*0.4)_h)] [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.88_calc(c*0.5)_h)] dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.35_calc(c*0.5)_h)]`,outline:`*:data-[slot=bubble-content]:border-border *:data-[slot=bubble-content]:bg-background [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-input/30`,ghost:`border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent *:data-[slot=bubble-content]:p-0 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted/50`,destructive:`*:data-[slot=bubble-content]:bg-destructive/10 *:data-[slot=bubble-content]:text-destructive dark:*:data-[slot=bubble-content]:bg-destructive/20 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/20 dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/30`}},defaultVariants:{variant:`default`}});function jW({variant:e=`default`,align:t=`start`,className:n,...r}){return(0,J.jsx)(`div`,{"data-slot":`bubble`,"data-variant":e,"data-align":t,className:QB(AW({variant:e}),n),...r})}function MW({className:e,render:t,...n}){return wW({defaultTagName:`div`,props:cM({className:QB(`w-fit max-w-full min-w-0 overflow-hidden rounded-xl border border-transparent px-3 py-2 text-sm leading-relaxed wrap-break-word group-data-[align=end]/bubble:self-end [button]:text-left [button,a]:transition-colors [button,a]:outline-none [button,a]:focus-visible:border-ring [button,a]:focus-visible:ring-3 [button,a]:focus-visible:ring-ring/50`,e)},n),render:t,state:{slot:`bubble-content`}})}var NW=kW(`group/marker relative flex min-h-4 w-full items-center gap-2 text-left text-sm text-muted-foreground [&_svg:not([class*='size-'])]:size-4 [a]:underline [a]:underline-offset-3 [a]:hover:text-foreground`,{variants:{variant:{default:``,separator:`before:mr-1 before:h-px before:min-w-0 before:flex-1 before:bg-border after:ml-1 after:h-px after:min-w-0 after:flex-1 after:bg-border`,border:`border-b border-border pb-2`}}});function PW({className:e,variant:t=`default`,render:n,...r}){return wW({defaultTagName:`div`,props:cM({className:QB(NW({variant:t,className:e}))},r),render:n,state:{slot:`marker`,variant:t}})}function FW({className:e,...t}){return(0,J.jsx)(`span`,{"data-slot":`marker-content`,className:QB(`min-w-0 wrap-break-word group-data-[variant=separator]/marker:flex-none group-data-[variant=separator]/marker:text-center *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function IW({className:e,...t}){return(0,J.jsx)(`div`,{"data-slot":`message-group`,className:QB(`flex min-w-0 flex-col gap-2`,e),...t})}function LW({className:e,align:t=`start`,...n}){return(0,J.jsx)(`div`,{"data-slot":`message`,"data-align":t,className:QB(`group/message relative flex w-full min-w-0 gap-2 text-sm data-[align=end]:flex-row-reverse`,e),...n})}function RW({className:e,...t}){return(0,J.jsx)(`div`,{"data-slot":`message-avatar`,className:QB(`flex w-fit min-w-8 shrink-0 items-center justify-center self-end overflow-hidden rounded-full bg-muted group-has-data-[slot=message-footer]/message:-translate-y-8`,e),...t})}function zW({className:e,...t}){return(0,J.jsx)(`div`,{"data-slot":`message-content`,className:QB(`flex w-full min-w-0 flex-col gap-2.5 wrap-break-word group-data-[align=end]/message:*:data-slot:self-end`,e),...t})}function BW({className:e,...t}){return(0,J.jsx)(`div`,{"data-slot":`message-header`,className:QB(`flex max-w-full min-w-0 items-center px-3 text-xs font-medium text-muted-foreground group-has-data-[variant=ghost]/message:px-0`,e),...t})}function VW({defaultTagName:e,props:t,render:n,state:r={},stateAttributesMapping:i}){let a=HW(UW(r,i),t);if(!n)return q.createElement(e,a);if(typeof n==`function`)return n(a,r);if(!q.isValidElement(n))return null;let o=n.props,s={...HW(a,o),ref:KW(a.ref,o.ref)};return q.cloneElement(n,s)}function HW(...e){let t={};for(let n of e){if(!n)continue;let e=n;for(let n of Object.keys(e)){let r=e[n];if(r===void 0)continue;let i=t[n];t[n]=n===`className`?[i,r].filter(Boolean).join(` `):n===`style`?{...i,...r}:n===`ref`?KW(i,r):GW(n)&&typeof i==`function`&&typeof r==`function`?WW(r,i):r}}return t}function UW(e,t){let n={};for(let r of Object.keys(e)){let i=e[r],a=t?.[r]?.(i);if(a){Object.assign(n,a);continue}if(r===`slot`){n[`data-slot`]=i;continue}let o=`data-${String(r).replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}`;typeof i==`boolean`?n[o]=i?``:void 0:i!=null&&(n[o]=String(i))}return n}function WW(e,t){return function(n){e(n),n.defaultPrevented||t(n)}}function GW(e){return/^on[A-Z]/.test(e)}function KW(...e){let t=e.filter(Boolean);if(t.length!==0)return e=>{for(let n of t)typeof n==`function`?n(e):n&&(n.current=e)}}var qW=8,JW=64,YW=0,XW=.5,ZW=180,QW=new Set([`ArrowDown`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`,` `]),$W={start:!1,end:!1},eG={currentAnchorId:null,visibleMessageIds:[]};function tG({content:e,scrollEdgeThreshold:t,spacer:n,viewport:r}){if(!r||!e)return $W;let i=pG({content:e,spacer:n,viewport:r});return{start:r.scrollTop>t,end:i-r.scrollTop-r.clientHeight>t}}function nG({content:e,scrollMargin:t,scrollPreviousItemPeek:n,spacer:r,viewport:i,visibleMessageIds:a}){if(!e||!i)return eG;let o=i.getBoundingClientRect(),s=o.top+t+n,c=typeof IntersectionObserver>`u`,l=[],u=null;for(let t of rG(e,r)){let e=t.dataset.messageId;if(!e)continue;let n=t.dataset.scrollAnchor===`true`,r=n||c?t.getBoundingClientRect():null;(c&&r?r.bottom>s&&r.top<o.bottom:a.has(e))&&l.push(e),n&&r&&r.top<=s+XW&&(u=e)}return l.length===0&&u===null?eG:{currentAnchorId:u,visibleMessageIds:l}}function rG(e,t){return Array.from(e.children).filter(e=>e instanceof HTMLElement&&e!==t)}function iG(e,t){for(let n=t;n<e.length;n++){let t=e[n];if(t?.dataset.scrollAnchor===`true`)return t}return null}function aG(e,t){for(let n of e)if(n.dataset.scrollAnchor===`true`&&!t.has(n))return n;return null}function oG(e,t){let n=0;for(let r=t;r<e.length;r++)if(e[r]?.dataset.scrollAnchor===`true`&&(n+=1,n>1))return!0;return!1}function sG(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n?.dataset.scrollAnchor===`true`)return n}return null}function cG({content:e,spacer:t,viewport:n}){let r=n.getBoundingClientRect();for(let n of rG(e,t)){if(!n.dataset.messageId)continue;let e=n.getBoundingClientRect();if(e.bottom>r.top&&e.top<r.bottom)return n}return null}function lG({align:e,element:t,scrollMargin:n,spacer:r,viewport:i}){let a=uG(t,i),o=t.getBoundingClientRect().height,s=gG(r);if(e===`center`){let e=Math.max(0,i.clientHeight-s.start-s.end);return a-s.start-(e-o)/2-n}if(e===`end`)return a-i.clientHeight+o+s.end+n;if(e===`nearest`){let e=a+o,t=i.scrollTop+s.start,r=i.scrollTop+i.clientHeight-s.end;return a>=t&&e<=r?i.scrollTop:a<t?a-s.start-n:e-i.clientHeight+s.end+n}return a-s.start-n}function uG(e,t){let n=e.getBoundingClientRect(),r=t.getBoundingClientRect();return n.top-r.top+t.scrollTop}function dG(e,t){return e.getBoundingClientRect().top-t.getBoundingClientRect().top}function fG({content:e,scrollTop:t,spacer:n,viewport:r}){let i=pG({content:e,spacer:n,viewport:r});return t+r.clientHeight-i}function pG({content:e,spacer:t,viewport:n}){let r=rG(e,t),i=hG(e),a=n.getBoundingClientRect(),o=n.scrollTop,s=i.start+i.end;for(let e of r){let t=e.getBoundingClientRect();s=Math.max(s,t.bottom-a.top+o+i.end)}return s}function mG(e){return Math.max(0,e.scrollHeight-e.clientHeight)}function hG(e){let t=window.getComputedStyle(e);return{end:vG(t.paddingBlockEnd||t.paddingBottom),start:vG(t.paddingBlockStart||t.paddingTop)}}function gG(e){let t=e?.parentElement;return t?hG(t):{end:0,start:0}}function _G(e){if(!e)return 0;let t=window.getComputedStyle(e);return vG(t.rowGap===`normal`?t.gap:t.rowGap)}function vG(e){if(!e)return 0;let t=Number.parseFloat(e);return Number.isFinite(t)?t:0}function yG(e,t){let n=e,r=new Set;return{getSnapshot:()=>n,hasListeners:()=>r.size>0,setSnapshot:e=>{t(n,e)||(n=e,r.forEach(e=>e()))},subscribe:(e,t,n)=>{let i=r.size===0;return r.add(e),i&&t?.(),()=>{r.delete(e),r.size===0&&n?.()}}}}function bG(e,t){return yG(e,t)}function xG(){return yG(eG,CG)}function SG(e,t){return e.start===t.start&&e.end===t.end}function CG(e,t){return e.currentAnchorId!==t.currentAnchorId||e.visibleMessageIds.length!==t.visibleMessageIds.length?!1:e.visibleMessageIds.every((e,n)=>e===t.visibleMessageIds[n])}function wG({autoScroll:e,defaultScrollPosition:t,scrollEdgeThreshold:n,scrollMargin:r,scrollPreviousItemPeek:i}){let a=q.useRef(e),o=q.useRef(!1),s=q.useRef(null),c=q.useRef(!1),l=q.useRef(n),u=q.useRef(0),d=q.useRef(null),f=q.useRef(0),p=q.useRef(e?`following-bottom`:`free-scrolling`),m=q.useRef(new Map),h=q.useRef(null),g=q.useRef(null),_=q.useRef(null),v=q.useRef(i),y=q.useRef(!0),b=q.useRef(null),x=q.useRef(r),S=q.useRef(null),C=q.useRef(0),w=q.useRef(0),T=q.useRef(null),E=q.useRef(null),D=q.useRef(null),O=q.useRef(null),k=q.useRef(null),A=q.useRef(null),j=q.useRef(null),M=q.useRef(null),N=q.useRef(null),P=q.useRef(new Set),F=q.useRef(new WeakSet);return D.current===null&&(D.current=bG(t===`end`||t===`last-anchor`,(e,t)=>e===t)),O.current===null&&(O.current=bG($W,SG)),N.current===null&&(N.current=xG()),a.current=e,l.current=n,x.current=r,v.current=i,{autoScrollRef:a,autoscrollingRef:o,autoscrollingTimeoutRef:k,streamingTurnRef:_,contentRef:s,defaultScrollPositionAppliedRef:c,firstItemRef:d,itemCountRef:u,lastScrollTopRef:f,messageElementsRef:m,modeRef:p,pendingScrollFrameRef:S,pendingScrollToMessageRef:h,prependRestoreRef:g,preserveScrollOnPrependRef:y,pendingDefaultScrollStore:D.current,rootRef:b,scrollEdgeThresholdRef:l,scrollMarginRef:x,scrollPreviousItemPeekRef:v,spacerGapRef:C,spacerHeightRef:w,spacerRef:T,stateFrameRef:E,stateStore:O.current,viewportRef:A,visibilityFrameRef:j,visibilityObserverRef:M,visibilityStore:N.current,visibleMessageIdsRef:P,handledScrollAnchorsRef:F}}function TG(e){e.pendingDefaultScrollStore.setSnapshot(!1)}function EG(e){e.defaultScrollPositionAppliedRef.current=!0,TG(e)}function DG({refs:e,commitScrollState:t,scheduleStateCommit:n,scheduleVisibilitySync:r}){let{streamingTurnRef:i,autoScrollRef:a,autoscrollingRef:o,autoscrollingTimeoutRef:s,contentRef:c,itemCountRef:l,messageElementsRef:u,modeRef:d,pendingScrollToMessageRef:f,prependRestoreRef:p,scrollMarginRef:m,scrollPreviousItemPeekRef:h,spacerGapRef:g,spacerHeightRef:_,spacerRef:v,viewportRef:y}=e,b=q.useCallback(e=>{s.current!==null&&(window.clearTimeout(s.current),s.current=null),o.current!==e&&(o.current=e,t()),e&&(s.current=window.setTimeout(()=>{s.current=null,o.current=!1,t()},ZW))},[t]),x=q.useCallback(e=>{let t=v.current;if(!t)return;let n=Math.max(0,Math.ceil(e));_.current!==n&&(_.current=n,t.hidden=n===0,t.style.height=`${n}px`,t.style.marginTop=n>0?`${-g.current}px`:``)},[]),S=q.useCallback((e,{behavior:r=`auto`,autoscrolling:i=!1}={})=>{let a=y.current;if(!a)return;let o=Math.max(0,e);Math.abs(a.scrollTop-o)<=XW?(a.scrollTop=o,t()):(i&&b(!0),a.scrollTo({top:o,behavior:r}),n())},[t,n,b]),C=q.useCallback(({behavior:e=`auto`}={})=>y.current?(x(0),i.current=null,d.current=`free-scrolling`,S(0,{behavior:e}),r(),!0):!1,[r,S,x]),w=q.useCallback(({behavior:e=`auto`}={})=>{let t=y.current;return t?(x(0),i.current=null,d.current=a.current?`following-bottom`:`free-scrolling`,S(mG(t),{autoscrolling:!0,behavior:e}),r(),!0):!1},[r,S,x]),T=q.useCallback((e,{align:t=`start`,behavior:n=`auto`,scrollMargin:a=m.current}={},{keepPreviousPeek:o=!1}={})=>{let s=c.current,l=y.current;if(!s||!l||!s.contains(e))return!1;let u=lG({align:t,element:e,scrollMargin:o?a+h.current:a,spacer:v.current,viewport:l}),f=fG({content:s,scrollTop:u,spacer:v.current,viewport:l});return x(f),p.current={element:e,viewportTop:dG(e,l)},d.current=o?`anchored-to-message`:`settling-jump`,i.current=o?e:null,S(u,{behavior:n}),r(),!0},[r,S,x]),E=q.useCallback(()=>{let e=i.current;return!e||!e.isConnected||d.current!==`anchored-to-message`?!1:T(e,{align:`start`},{keepPreviousPeek:!0})},[T]),D=q.useCallback((t,n)=>{let r=u.current.get(t);return r?(EG(e),T(r,n)?(f.current=null,!0):(f.current={messageId:t,options:n},!0)):l.current===0&&(f.current={messageId:t,options:n},EG(e),!0)},[T]);return{flushPendingScrollToMessage:q.useCallback(()=>{let t=f.current;if(!t)return!1;let n=u.current.get(t.messageId);return!n||!T(n,t.options)?!1:(f.current=null,EG(e),!0)},[T]),reanchorToAnchoredMessage:E,scrollToElement:T,scrollToEnd:w,scrollToMessage:D,scrollToStart:C}}function OG(e,t){return q.useCallback(n=>{e.current=n,n&&t()},[e,t])}function kG({autoScroll:e=!1,defaultScrollPosition:t=`end`,scrollEdgeThreshold:n=qW,scrollPreviousItemPeek:r=JW,scrollMargin:i=YW}){let a=wG({autoScroll:e,defaultScrollPosition:t,scrollEdgeThreshold:n,scrollMargin:i,scrollPreviousItemPeek:r}),{streamingTurnRef:o,autoScrollRef:s,autoscrollingRef:c,autoscrollingTimeoutRef:l,contentRef:u,defaultScrollPositionAppliedRef:d,firstItemRef:f,itemCountRef:p,lastScrollTopRef:m,messageElementsRef:h,modeRef:g,pendingScrollFrameRef:_,pendingScrollToMessageRef:v,prependRestoreRef:y,preserveScrollOnPrependRef:b,pendingDefaultScrollStore:x,rootRef:S,scrollEdgeThresholdRef:C,scrollMarginRef:w,scrollPreviousItemPeekRef:T,spacerGapRef:E,spacerHeightRef:D,spacerRef:O,stateFrameRef:k,stateStore:A,viewportRef:j,visibilityFrameRef:M,visibilityObserverRef:N,visibilityStore:P,visibleMessageIdsRef:F,handledScrollAnchorsRef:I}=a,L=q.useRef(t);L.current!==t&&(L.current=t,d.current=!1);let R=q.useCallback(e=>{let t=S.current,n=j.current,r=[e.start&&`start`,e.end&&`end`].filter(Boolean).join(` `),i=c.current;for(let e of[t,n])e&&(r?e.setAttribute(`data-scrollable`,r):e.removeAttribute(`data-scrollable`),e.toggleAttribute(`data-autoscrolling`,i))},[]),z=q.useCallback(e=>{let t=j.current?.scrollTop??0,n=t<m.current-XW;m.current=t,s.current&&!e.end&&g.current!==`settling-jump`&&g.current!==`anchored-to-message`?g.current=`following-bottom`:g.current===`following-bottom`&&e.end&&n&&!c.current&&(g.current=`free-scrolling`)},[]),B=q.useCallback(()=>{let e=tG({content:u.current,scrollEdgeThreshold:C.current,spacer:O.current,viewport:j.current});z(e);let t=g.current===`following-bottom`?{...e,end:!1}:e;R(t),A.setSnapshot(t)},[z,A,R]),ee=q.useCallback(()=>{k.current===null&&(k.current=window.requestAnimationFrame(()=>{k.current=null,B()}))},[B]),V=q.useCallback(()=>{P.hasListeners()&&M.current===null&&(M.current=window.requestAnimationFrame(()=>{M.current=null,P.hasListeners()&&P.setSnapshot(nG({content:u.current,scrollMargin:w.current,scrollPreviousItemPeek:T.current,spacer:O.current,viewport:j.current,visibleMessageIds:F.current}))}))},[P]),{flushPendingScrollToMessage:te,reanchorToAnchoredMessage:ne,scrollToElement:H,scrollToEnd:U,scrollToMessage:re,scrollToStart:ie}=DG({refs:a,commitScrollState:B,scheduleStateCommit:ee,scheduleVisibilitySync:V}),ae=q.useCallback(()=>{let e=y.current,t=j.current;if(!e||!t||!e.element.isConnected)return!1;let n=dG(e.element,t)-e.viewportTop;return Math.abs(n)<=XW?!1:(t.scrollTop+=n,e.viewportTop=dG(e.element,t),ee(),V(),!0)},[ee,V]),oe=q.useCallback(()=>{let e=u.current,t=j.current;if(!e||!t){y.current=null;return}let n=cG({content:e,spacer:O.current,viewport:t});y.current=n?{element:n,viewportTop:dG(n,t)}:null},[]),se=q.useCallback(()=>{_.current===null&&(_.current=window.requestAnimationFrame(()=>{_.current=null,te()&&oe()}))},[oe,te]),ce=q.useCallback(()=>{if(!t||d.current||p.current===0)return!1;let e=!1;if(t===`last-anchor`){let t=u.current,n=j.current,r=t&&n?sG(rG(t,O.current)):null;if(!t||!n||!r)e=U({behavior:`auto`});else{let i=uG(r,n);e=pG({content:t,spacer:O.current,viewport:n})-i<=n.clientHeight?U({behavior:`auto`}):H(r,{align:`start`},{keepPreviousPeek:!0})}}else e=t===`end`?U({behavior:`auto`}):ie({behavior:`auto`});return e?(EG(a),!0):!1},[t,H,U,ie]),le=q.useCallback(()=>{let e=u.current;if(!e)return;let t=rG(e,O.current),n=p.current,r=f.current;p.current=t.length,f.current=t[0]??null,(()=>{if(te())return;if(n===0){if(ce()||t.length>0&&s.current&&U({behavior:`auto`}))return;B(),V();return}let e=r?t.indexOf(r):-1;if(b.current&&e>0)ae();else{if(t.length>n){let e=iG(t,n);if(e){if(s.current&&g.current===`following-bottom`&&oG(t,n)){U({behavior:`auto`});return}H(e,{align:`start`},{keepPreviousPeek:!0}),I.current.add(e);return}}if(t.length===n){let e=aG(t,I.current);if(e){H(e,{align:`start`},{keepPreviousPeek:!0}),I.current.add(e);return}}g.current===`following-bottom`&&s.current?U({behavior:`auto`}):(B(),V())}})(),oe()},[ce,oe,B,te,ae,V,H,U]),ue=q.useCallback(()=>{if(g.current===`following-bottom`&&s.current){U({behavior:`auto`});return}let e=D.current;ne()?s.current&&e>0&&D.current===0&&U({behavior:`auto`}):(ee(),V())},[ne,ee,V,U]),de=q.useCallback(()=>{let e=j.current;if(e&&P.hasListeners()){if(typeof IntersectionObserver>`u`){V();return}N.current||=new IntersectionObserver(e=>{for(let t of e){let e=t.target.dataset.messageId;e&&(t.isIntersecting?F.current.add(e):F.current.delete(e))}V()},{root:e,rootMargin:`${-(w.current+T.current)}px 0px 0px 0px`,threshold:[0,.01,.5,1]}),h.current.forEach(e=>{N.current?.observe(e)}),V()}},[V,P]),fe=q.useCallback(()=>{M.current!==null&&(window.cancelAnimationFrame(M.current),M.current=null),N.current?.disconnect(),N.current=null,F.current.clear(),P.setSnapshot(eG)},[P]),pe=q.useCallback((e,t,n)=>{t?(h.current.set(e,t),N.current?.observe(t),V(),v.current?.messageId===e&&se()):n&&h.current.get(e)===n&&(h.current.delete(e),F.current.delete(e),N.current?.unobserve(n),V())},[se,V]),me=q.useCallback(()=>{(g.current===`following-bottom`||g.current===`anchored-to-message`||g.current===`settling-jump`)&&(o.current=null,g.current=`free-scrolling`)},[]),he=q.useCallback(()=>R(A.getSnapshot()),[A,R]),ge=OG(S,he),_e=OG(j,he),ve=q.useCallback(e=>{u.current=e},[]),ye=q.useCallback(e=>{O.current=e,E.current=_G(e?.parentElement??null)},[]),be=q.useCallback(()=>{B(),V(),oe()},[oe,B,V]),xe=q.useMemo(()=>({handleContentChange:le,handleResize:ue,observeVisibility:de,pendingDefaultScrollStore:x,preserveScrollOnPrependRef:b,scrollToEnd:U,scrollToMessage:re,scrollToStart:ie,setContentElement:ve,setRootElement:ge,setSpacerElement:ye,setViewportElement:_e,stateStore:A,syncAfterScroll:be,unobserveVisibility:fe,userScrollIntent:me,viewportRef:j,visibilityStore:P}),[le,ue,de,x,U,re,ie,ve,ge,ye,_e,A,be,fe,me,P]);return q.useLayoutEffect(()=>{ce()||p.current===0&&TG(a)},[ce]),q.useEffect(()=>()=>{k.current!==null&&(window.cancelAnimationFrame(k.current),k.current=null),M.current!==null&&(window.cancelAnimationFrame(M.current),M.current=null),l.current!==null&&(window.clearTimeout(l.current),l.current=null),_.current!==null&&(window.cancelAnimationFrame(_.current),_.current=null),N.current?.disconnect(),N.current=null},[]),q.useLayoutEffect(()=>{e&&g.current===`following-bottom`&&p.current>0?U({behavior:`auto`}):B()},[e,B,U]),{context:xe,registerMessage:pe}}function AG(e){let t=q.useRef(e);return t.current=e,t}var jG=q.createContext(null),MG=q.createContext(null);function NG(){let e=q.useContext(jG);if(!e)throw Error(`useMessageScroller must be used within a MessageScroller.`);return e}function PG(){let e=q.useContext(MG);if(!e)throw Error(`MessageScrollerItem must be used within a MessageScroller.`);return e}function FG(){let{scrollToEnd:e,scrollToMessage:t,scrollToStart:n}=NG();return q.useMemo(()=>({scrollToEnd:e,scrollToMessage:t,scrollToStart:n}),[e,t,n])}function IG({autoScroll:e=!1,children:t,defaultScrollPosition:n=`end`,scrollEdgeThreshold:r,scrollPreviousItemPeek:i,scrollMargin:a}){let{context:o,registerMessage:s}=kG({autoScroll:e,defaultScrollPosition:n,scrollEdgeThreshold:r,scrollPreviousItemPeek:i,scrollMargin:a});return(0,J.jsx)(jG.Provider,{value:o,children:(0,J.jsx)(MG.Provider,{value:s,children:t})})}function LG(){let{pendingDefaultScrollStore:e}=NG();return q.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot)}function RG({children:e,...t}){let{setRootElement:n}=NG(),r=LG();return(0,J.jsx)(`div`,{ref:n,...t,...r?{"data-pending-scroll":``}:null,children:e})}function zG({"aria-label":e,children:t,onKeyDown:n,onScroll:r,onTouchMove:i,onWheel:a,preserveScrollOnPrepend:o=!0,ref:s,role:c,tabIndex:l,...u}){let{handleResize:d,preserveScrollOnPrependRef:f,setViewportElement:p,syncAfterScroll:m,userScrollIntent:h,viewportRef:g}=NG(),_=LG();f.current=o;let v=q.useCallback(e=>{p(e),KW(s)?.(e)},[s,p]);function y(e){m(),r?.(e)}function b(e){h(),a?.(e)}function x(e){h(),i?.(e)}function S(e){QW.has(e.key)&&h(),n?.(e)}return q.useEffect(()=>{let e=g.current;if(!e||typeof ResizeObserver>`u`)return;let t=0,n=new ResizeObserver(()=>{window.cancelAnimationFrame(t),t=window.requestAnimationFrame(d)});return n.observe(e),()=>{window.cancelAnimationFrame(t),n.disconnect()}},[d,g]),(0,J.jsx)(`div`,{ref:v,role:c??`region`,"aria-label":e??`Messages`,tabIndex:l??0,onKeyDown:S,onScroll:y,onTouchMove:x,onWheel:b,...u,..._?{"data-pending-scroll":``}:null,children:t})}function BG({"aria-relevant":e,children:t,ref:n,role:r,spacerClassName:i,...a}){let{handleContentChange:o,handleResize:s,setContentElement:c,setSpacerElement:l}=NG(),u=q.useRef(null),d=q.useCallback(e=>{u.current=e,c(e),KW(n)?.(e)},[n,c]);return q.useLayoutEffect(()=>{let e=u.current;if(!e||(o(),typeof MutationObserver>`u`))return;let t=new MutationObserver(()=>{o()});return t.observe(e,{childList:!0}),()=>t.disconnect()},[o]),q.useEffect(()=>{let e=u.current;if(!e||typeof ResizeObserver>`u`)return;let t=0,n=new ResizeObserver(()=>{window.cancelAnimationFrame(t),t=window.requestAnimationFrame(s)});return n.observe(e),()=>{window.cancelAnimationFrame(t),n.disconnect()}},[s]),(0,J.jsxs)(`div`,{ref:d,role:r??`log`,"aria-relevant":e??`additions`,...a,children:[t,(0,J.jsx)(`div`,{ref:l,"aria-hidden":`true`,"data-message-scroller-spacer":``,hidden:!0,className:i})]})}function VG({messageId:e,ref:t,scrollAnchor:n=!1,...r}){let i=PG(),a=q.useRef(null),o=q.useCallback(n=>{let r=a.current;a.current=n,e&&i(e,n,r),KW(t)?.(n)},[e,t,i]);return(0,J.jsx)(`div`,{ref:o,"data-message-id":e,"data-scroll-anchor":n?`true`:`false`,...r})}function HG({behavior:e=`smooth`,children:t,direction:n=`end`,onClick:r,render:i,tabIndex:a,type:o=`button`,...s}){let{scrollToEnd:c,scrollToStart:l,stateStore:u}=NG(),d=AG(r),f=q.useCallback(e=>u.subscribe(e),[u]),p=q.useCallback(()=>{let e=u.getSnapshot();return n===`start`?e.start:e.end},[n,u]),m=q.useSyncExternalStore(f,p,p),h=q.useCallback(t=>{m&&(d.current?.(t),t.defaultPrevented||(t.currentTarget.blur(),n===`start`?l({behavior:e}):c({behavior:e})))},[e,n,m,d,c,l]);return VW({defaultTagName:`button`,props:HW({type:o,inert:!m,tabIndex:m?a:-1,children:t??(0,J.jsxs)(`span`,{children:[`Scroll to `,n]}),onClick:h},s),render:i,state:{active:m,direction:n},stateAttributesMapping:{active:e=>({"data-active":e?`true`:`false`})}})}var UG={Provider:IG,Root:RG,Viewport:zG,Content:BG,Item:VG,Button:HG},WG=q.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=EN({disabled:i,focusableWhenDisabled:a,native:o});return xM(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})}),GG=kW(`group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function KG({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,J.jsx)(WG,{"data-slot":`button`,className:QB(GG({variant:t,size:n,className:e})),...r})}function qG(e){return(0,J.jsx)(UG.Provider,{...e})}function JG({className:e,...t}){return(0,J.jsx)(UG.Root,{"data-slot":`message-scroller`,className:QB(`group/message-scroller relative flex size-full min-h-0 flex-col overflow-hidden`,e),...t})}function YG({className:e,...t}){return(0,J.jsx)(UG.Viewport,{"data-slot":`message-scroller-viewport`,className:QB(`size-full min-h-0 min-w-0 scroll-fade-b scrollbar-thin scrollbar-gutter-stable overflow-y-auto overscroll-contain contain-content data-autoscrolling:scrollbar-thumb-transparent data-autoscrolling:scrollbar-track-transparent data-pending-scroll:invisible`,e),...t})}function XG({className:e,...t}){return(0,J.jsx)(UG.Content,{"data-slot":`message-scroller-content`,className:QB(`flex h-max min-h-full flex-col gap-6`,e),...t})}function ZG({className:e,scrollAnchor:t=!1,...n}){return(0,J.jsx)(UG.Item,{"data-slot":`message-scroller-item`,scrollAnchor:t,className:QB(`min-w-0 shrink-0 [contain-intrinsic-size:auto_10rem] [content-visibility:auto]`,e),...n})}function QG({direction:e=`end`,className:t,children:n,render:r,variant:i=`secondary`,size:a=`icon-sm`,...o}){return(0,J.jsx)(UG.Button,{"data-slot":`message-scroller-button`,"data-direction":e,"data-variant":i,"data-size":a,direction:e,className:QB(`absolute inset-s-1/2 -translate-x-1/2 border-border bg-background text-foreground transition-[translate,scale,opacity] duration-200 hover:bg-muted hover:text-foreground data-[active=false]:pointer-events-none data-[active=false]:scale-95 data-[active=false]:opacity-0 data-[active=false]:duration-400 data-[active=false]:ease-[cubic-bezier(0.7,0,0.84,0)] data-[active=true]:translate-y-0 data-[active=true]:scale-100 data-[active=true]:opacity-100 data-[active=true]:ease-[cubic-bezier(0.23,1,0.32,1)] data-[direction=end]:bottom-4 data-[direction=end]:data-[active=false]:translate-y-full data-[direction=start]:top-4 data-[direction=start]:data-[active=false]:-translate-y-full rtl:translate-x-1/2 data-[direction=start]:[&_svg]:rotate-180`,t),render:r??(0,J.jsx)(KG,{variant:i,size:a}),...o,children:n??(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(ze,{}),(0,J.jsx)(`span`,{className:`sr-only`,children:e===`end`?`Scroll to end`:`Scroll to start`})]})})}var $G={extra:!1,web:!0,pluginsOff:[]};function eK(e){return{...e.extra?{extra:!0}:{},...e.web?{}:{web:!1},...e.pluginsOff.length?{pluginsOff:e.pluginsOff}:{}}}function tK(e,t){return`${bH(yH(e,t,e.cloud))??vH(e)}/chat`}function nK(e){let t=qn().data;return(D({queryKey:[`wizards`,e,!!t?.account],queryFn:()=>a.get(`/api/studio/spaces/${e}/wizards`),enabled:!!e}).data??[]).filter(e=>e.published).sort((e,t)=>t.updatedAt>e.updatedAt?1:-1)}function rK(e,t,n=$G){let r=qn().data,[i,o]=(0,q.useState)(n),s=pm(),c=D({queryKey:[`work-composer`],queryFn:()=>a.get(`/api/studio/work/composer`)}).data,l=nK(e),u=c?.plugins??[],d=e=>o(t=>({...t,...e})),f=[[{icon:(0,J.jsx)(xi,{}),label:K(`work.files.fromSpace`),onSelect:t}],[...u.length?[{kind:`menu`,icon:(0,J.jsx)(Je,{}),label:K(`work.composer.plugins`),choices:u.map(e=>({id:e.id,label:e.name,on:!i.pluginsOff.includes(e.id),onSelect:()=>d({pluginsOff:i.pluginsOff.includes(e.id)?i.pluginsOff.filter(t=>t!==e.id):[...i.pluginsOff,e.id]})}))}]:[],...l.length&&r?[{kind:`menu`,icon:(0,J.jsx)(E,{}),label:K(`work.home.wizards`),choices:l.map(e=>({id:e.id,label:e.title,hint:K(`work.home.wizardOpen`),onSelect:()=>Dw(tK(e,r))}))}]:[]],c?.web?[{kind:`toggle`,icon:(0,J.jsx)(pt,{}),label:K(`work.composer.web`),on:i.web,onChange:e=>d({web:e})}]:[]];return{body:eK({...i,web:i.web||!c?.web}),choice:i,chooser:{on:i.extra,onChange:e=>d({extra:e}),...s},plus:f}}function iK(e){switch(e.type){case`tool-input-available`:return{event:`tool_call`,data:{toolCallId:e.toolCallId,toolCallName:e.toolName,input:e.input}};case`tool-output-available`:case`tool-output-error`:return{event:`tool_result`,data:e};case`data-dev-step`:return{event:`step`,data:e.data};case`data-dev-prompt`:return{event:`prompt`,data:e.data};default:return{event:e.type,data:e}}}function aK(e){let t=!!qn().data?.assistantDev,n=oT(),r=t&&n.dev,[i,a]=(0,q.useState)({chat:``,turns:[]}),o=(0,q.useRef)({chat:``,turns:[]}),s=(0,q.useRef)(null),c=(0,q.useRef)(null),l=()=>a({chat:o.current.chat,turns:[...o.current.turns]});return s.current=r?{start:t=>{c.current={id:crypto.randomUUID(),message:t,startedAt:Date.now(),endedAt:null,prompt:null,events:[]},o.current={chat:e,turns:[...o.current.chat===e?o.current.turns:[],c.current]},l()},chunk:e=>{let t=c.current;if(!t)return;let{event:n,data:r}=iK(e);t.events.push({at:Date.now(),event:n,data:r}),n===`prompt`&&(t.prompt=r),e.type.endsWith(`-delta`)||l()},end:()=>{c.current&&(c.current.endedAt=Date.now(),c.current=null,l())}}:null,{on:r,turns:i.chat===e?i.turns:[],tap:s}}function oK({dev:e,messages:t}){let[n,r]=(0,q.useState)(!1);return e.on?(0,J.jsxs)(`span`,{className:`flex h-9 shrink-0 items-center gap-0.5 px-1 coarse:h-11`,children:[(0,J.jsx)(Re,{label:K(`assistant.inspect`),onClick:()=>r(!0),className:`size-8`,children:(0,J.jsx)(hr,{className:`size-4`})}),t.length?(0,J.jsx)(SA,{messages:t,turns:e.turns}):null,(0,J.jsx)(TA,{open:n,onClose:()=>r(!1),turns:e.turns,messages:t,file:`work`})]}):null}function sK({spaceId:e,open:t,onClose:n,onPick:r}){let i=(N(e).data?.files??[]).filter(e=>(e.kind===`document`||e.kind===`asset`)&&e.status!==`failed`),[a,o]=(0,q.useState)(``),[s,c]=(0,q.useState)([]),l=a.trim().toLowerCase(),u=i.filter(e=>!l||e.name.toLowerCase().includes(l)).reverse(),d=()=>{o(``),c([]),n()},f=e=>c(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e]);return(0,J.jsx)(H,{open:t,onClose:d,title:K(`work.files.title`),height:`tall`,children:(0,J.jsxs)(`div`,{className:`grid gap-3`,children:[(0,J.jsx)(ie,{"data-autofocus":!0,value:a,onChange:e=>o(e.target.value),placeholder:K(`work.files.search`)}),(0,J.jsx)(`ul`,{className:`-mx-2`,children:u.map(t=>(0,J.jsx)(`li`,{children:(0,J.jsxs)(`button`,{type:`button`,"aria-pressed":s.includes(t.id),onClick:()=>f(t.id),className:`flex w-full items-center gap-3 rounded-lg px-2 py-2 text-left hover:bg-paper-2`,children:[(0,J.jsx)(cK,{spaceId:e,file:t}),(0,J.jsxs)(`span`,{className:`grid min-w-0 flex-1`,children:[(0,J.jsx)(`span`,{className:`truncate text-[0.875rem] text-ink`,children:t.name}),(0,J.jsx)(`span`,{className:`text-[0.75rem] text-ink-4`,children:lK(t.size)})]}),(0,J.jsx)(`span`,{className:W(`flex size-4 shrink-0 items-center justify-center rounded border`,s.includes(t.id)?`border-primary bg-primary text-primary-foreground`:`border-input`),children:s.includes(t.id)?(0,J.jsx)(ft,{className:`size-3`,strokeWidth:3}):null})]})},t.id))}),u.length?null:(0,J.jsx)(`p`,{className:`py-6 text-center text-[0.875rem] text-ink-3`,children:i.length?K(`work.files.noMatch`):K(`work.files.none`)}),(0,J.jsxs)(`div`,{className:`sticky bottom-0 flex justify-end gap-2 bg-card py-3`,children:[(0,J.jsx)(z,{variant:`secondary`,onClick:d,children:K(`work.files.cancel`)}),(0,J.jsx)(z,{disabled:!s.length,onClick:()=>{r(s.flatMap(t=>{let n=i.find(e=>e.id===t);return n?[{id:n.id,name:n.name,mime:n.mime,url:k(e,n.id)}]:[]})),d()},children:K(`work.files.add`)})]})]})})}function cK({spaceId:e,file:t}){return t.thumb||t.mime.startsWith(`image/`)?(0,J.jsx)(`img`,{src:t.thumb?_(e,t.id):k(e,t.id),alt:``,className:`size-9 shrink-0 rounded-md bg-paper-2 object-cover ring-1 ring-border`}):(0,J.jsx)(`span`,{className:`flex size-9 shrink-0 items-center justify-center rounded-md bg-paper-2 text-ink-3`,children:(0,J.jsx)(dt,{className:`size-4`})})}var lK=e=>e<1e6?`${Math.max(1,Math.round(e/1e3))} KB`:`${(e/1e6).toFixed(1)} MB`;function uK(e){let{open:t,defaultOpen:n=!1,onOpenChange:r,disabled:i}=e,[a,o]=cN({controlled:t,default:n,name:`Collapsible`,state:`open`}),{mounted:s,setMounted:c,transitionStatus:l}=lP(a,!0,!0),u=XN(),[d,f]=q.useState(),p=d===null?void 0:d??u,m=vN(e=>{let t=!a,n=eP(JM,e.nativeEvent);r(t,n),n.isCanceled||o(t)});return q.useMemo(()=>({defaultPanelId:u,disabled:i,handleTrigger:m,mounted:s,open:a,panelId:p,setMounted:c,setOpen:o,setPanelIdState:f,transitionStatus:l}),[u,i,m,s,a,p,c,o,f,l])}var dK=q.createContext(void 0);function fK(){let e=q.useContext(dK);if(e===void 0)throw Error(Fj(15));return e}var pK=`data-open`,mK=`data-closed`,hK=OM,gK=`data-panel-open`,_K={[pK]:``},vK={[mK]:``},yK={open(e){return e?{[gK]:``}:null}},bK={open(e){return e?_K:vK},...MM},xK=q.forwardRef(function(e,t){let{render:n,className:r,defaultOpen:i=!1,disabled:a=!1,onOpenChange:o,open:s,style:c,...l}=e,u=vN(o),d=uK({open:s,defaultOpen:i,onOpenChange:u,disabled:a}),f=q.useMemo(()=>({open:d.open,disabled:d.disabled,transitionStatus:d.transitionStatus}),[d.open,d.disabled,d.transitionStatus]),p=q.useMemo(()=>({...d,onOpenChange:u,state:f}),[d,u,f]),m=xM(`div`,e,{state:f,ref:t,props:l,stateAttributesMapping:bK});return(0,J.jsx)(dK.Provider,{value:p,children:m})}),SK={...yK,...MM},CK=q.forwardRef(function(e,t){let{panelId:n,open:r,handleTrigger:i,state:a,disabled:o}=fK(),{className:s,disabled:c=o,render:l,nativeButton:u=!0,style:d,...f}=e,{getButtonProps:p,buttonRef:m}=EN({disabled:c,native:u});return xM(`button`,e,{state:a,ref:[t,m],props:[{"aria-controls":r?n:void 0,"aria-expanded":r,onClick:i},f,p],stateAttributesMapping:SK})}),wK={height:void 0,width:void 0};function TK(e){let{externalRef:t,hiddenUntilFound:n,id:r,keepMounted:i,mounted:a,onOpenChange:o,open:s,setMounted:c,setOpen:l,transitionStatus:u}=e,d=q.useRef(null),f=q.useRef(null),[p,m]=q.useState(wK),h=q.useRef(wK),g=q.useRef(!1),_=q.useRef(s),v=q.useRef(!1),[y,b]=q.useState(!1),x=q.useRef(null),S=Gj(t,d),C=iF(s),w=mP(d),T=!s&&!a,E=y?`idle`:u,D=s&&(_.current||v.current),O=!s&&a&&f.current===`css-animation`&&p.height===void 0&&p.width===void 0?h.current:p,k=n&&T&&f.current!==`css-animation`,A=vN((e,t=!0)=>{t&&(h.current=e),m(e)}),j=vN(()=>{x.current?.(),x.current=null}),M=vN(e=>{j(),x.current=()=>{x.current=null,e()}}),N=vN(()=>{s&&a&&f.current===`css-animation`&&(v.current=!0)});$(()=>{y&&u!==`starting`&&b(!1)},[y,u]),q.useEffect(()=>()=>{N(),j()},[N,j]),$(()=>{s||(_.current=!1,v.current=!1);let e=d.current;if(!e)return;!s&&x.current&&j();let t=DK(e,D);if(f.current=t,s&&u===`idle`&&_.current&&t===`css-animation`){h.current=EK(e);return}if(s&&u===`starting`){let n=g.current;if(g.current=!1,t===`none`){A(EK(e)),b(!0);return}if(t===`css-transition`){let t=AK(e);if(A(EK(e)),!n)return t;let r=kK(e,`transition-duration`,`0s`);return M(r),b(!0),t}A(EK(e));let r=kK(e,`animation-name`,`none`);if(!n){r();return}let i=kK(e,`animation-duration`,`0s`);r(),M(i),b(!0);return}if(!s&&a&&(u===`idle`||u===`starting`)){if(t===`none`){A(wK,!1),c(!1);return}A(EK(e));return}if(u!==`ending`)return;if(t===`none`){c(!1);return}let n=EK(e);n.height>0||n.width>0?(A(n),t===`css-animation`&&kK(e,`animation-name`,`none`)()):c(!1)},[a,s,j,A,c,M,D,u]),hP({enabled:s&&a&&E===`idle`,open:!0,ref:d,onComplete(){s&&A(wK,!1)}}),q.useEffect(()=>{if(s||!a||E!==`ending`)return;if(!d.current){c(!1),A(wK,!1);return}let e=new AbortController,t=-1;function n(){C.current||(c(!1),A(wK,!1))}return t=sP.request(()=>{w(n,e.signal)}),()=>{sP.cancel(t),e.abort()}},[C,a,s,E,w,A,c]),$(()=>{let e=d.current;e&&n&&T&&e.setAttribute(`hidden`,`until-found`)},[T,n]),q.useEffect(function(){let e=d.current;if(!e)return;let t=bP.create(),n=-1,r=(r,i)=>{t.start(0,()=>{C.current||(n=sP.request(()=>{C.current||(r&&(g.current=!1),i&&e.setAttribute(hK,``),e.setAttribute(`hidden`,`until-found`))}))})},i=nF(e,`beforematch`,t=>{let n=eP(qM,t);if(o(!0,n),n.isCanceled){r(!1,!1);return}g.current=!0;let i=e.hasAttribute(hK);e.removeAttribute(hK),l(!0),r(!0,i)});return()=>{t.clear(),sP.cancel(n),i()}},[C,o,l]);let P=i||n||a||s;return{height:O.height,props:{...k?{[hK]:``}:void 0,hidden:T,id:r},ref:S,shouldPreventOpenAnimation:D,shouldRender:P,transitionStatus:E,width:O.width}}function EK(e){return{height:e.scrollHeight,width:e.scrollWidth}}function DK(e,t){let n=jt(e).getComputedStyle(e),r=(n.animationName.split(`,`).map(e=>e.trim()).some(e=>e!==``&&e!==`none`)||t)&&OK(n.animationDuration),i=OK(n.transitionDuration);return r&&i||i?`css-transition`:r?`css-animation`:`none`}function OK(e){return e.split(`,`).map(e=>e.trim()).some(e=>e!==``&&Number.parseFloat(e)>0)}function kK(e,t,n){let r=e.style.getPropertyValue(t),i=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{r===``?e.style.removeProperty(t):e.style.setProperty(t,r,i)}}function AK(e){let t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(t=>{e.style.setProperty(t,`initial`,`important`)});function n(){Object.entries(t).forEach(([t,n])=>{n===``?e.style.removeProperty(t):e.style.setProperty(t,n)})}let r=sP.request(n);return()=>{sP.cancel(r),n()}}var jK=`--collapsible-panel-height`,MK=`--collapsible-panel-width`,NK=q.forwardRef(function(e,t){let{className:n,hiddenUntilFound:r,keepMounted:i,render:a,id:o,style:s,...c}=e,{defaultPanelId:l,mounted:u,onOpenChange:d,open:f,setMounted:p,setPanelIdState:m,setOpen:h,state:g,transitionStatus:_}=fK(),v=r??!1,y=i??!1,b=o||void 0,x=b??l;$(()=>(m(e=>b??(e===null?void 0:e)),()=>{m(e=>e===b?null:e)}),[b,m]);let{height:S,props:C,ref:w,shouldPreventOpenAnimation:T,shouldRender:E,transitionStatus:D,width:O}=TK({externalRef:t,hiddenUntilFound:v,id:x,keepMounted:y,mounted:u,onOpenChange:d,open:f,setMounted:p,setOpen:h,transitionStatus:_}),k={...g,transitionStatus:D},A=oM(s,k),j=xM(`div`,{...e,style:void 0},{state:k,ref:w,props:[C,{style:{[jK]:S===void 0?`auto`:`${S}px`,[MK]:O===void 0?`auto`:`${O}px`}},c,A?{style:A}:void 0,T?{style:{animationName:`none`}}:void 0],stateAttributesMapping:bK});return E?j:null});function PK({...e}){return(0,J.jsx)(xK,{"data-slot":`collapsible`,...e})}function FK({...e}){return(0,J.jsx)(CK,{"data-slot":`collapsible-trigger`,...e})}function IK({...e}){return(0,J.jsx)(NK,{"data-slot":`collapsible-content`,...e})}function LK({className:e,...t}){return(0,J.jsx)(`div`,{"data-slot":`trace`,className:QB(`flex w-full min-w-0 flex-col gap-2 *:has-[>[data-slot=trace-line]]:flex *:has-[>[data-slot=trace-line]]:w-fit *:has-[>[data-slot=trace-line]]:max-w-full *:has-[>[data-slot=trace-line]]:min-w-0 *:has-[>[data-slot=trace-line]]:rounded-md *:has-[>[data-slot=trace-line]]:text-left *:has-[>[data-slot=trace-line]]:outline-none *:has-[>[data-slot=trace-line]]:focus-visible:ring-3 *:has-[>[data-slot=trace-line]]:focus-visible:ring-ring/50`,e),...t})}function RK({className:e,status:t,...n}){return(0,J.jsx)(`span`,{"data-slot":`trace-line`,"data-status":t,className:QB(`flex w-fit max-w-full min-w-0 items-center gap-2 text-sm text-muted-foreground transition-colors in-[a,button]:cursor-pointer in-[a:hover,button:hover]:text-foreground data-[status=error]:text-destructive data-[status=error]:in-[a:hover,button:hover]:text-destructive data-[status=pending]:opacity-60 data-[status=running]:*:data-[slot=trace-title]:shimmer`,e),...n})}function zK({className:e,...t}){return(0,J.jsx)(`span`,{"data-slot":`trace-icon`,"aria-hidden":`true`,className:QB(`flex size-4 shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [[data-slot=trace-title]~&]:-ml-1`,e),...t})}function BK({className:e,...t}){return(0,J.jsx)(`span`,{"data-slot":`trace-title`,className:QB(`min-w-0 truncate motion-reduce:shimmer-none`,e),...t})}function VK({className:e,...t}){return(0,J.jsx)(`span`,{"data-slot":`trace-description`,className:QB(`shrink-0 text-muted-foreground/70 tabular-nums`,e),...t})}function HK({className:e,...t}){return(0,J.jsx)(PK,{"data-slot":`trace-collapsible`,className:QB(`flex w-full min-w-0 flex-col`,e),...t})}function UK({className:e,children:t,...n}){return(0,J.jsxs)(FK,{"data-slot":`trace-collapsible-trigger`,className:QB(`group/trace-collapsible-trigger flex w-fit max-w-full min-w-0 cursor-pointer items-center gap-1 rounded-md text-left text-muted-foreground transition-colors outline-none hover:text-foreground focus-visible:ring-3 focus-visible:ring-ring/50 has-[[data-status=error]]:text-destructive`,e),...n,children:[t,(0,J.jsx)(zK,{className:`transition-transform group-aria-expanded/trace-collapsible-trigger:rotate-90`,children:(0,J.jsx)(Le,{})})]})}function WK({className:e,children:t,...n}){return(0,J.jsx)(IK,{"data-slot":`trace-collapsible-content`,className:`h-(--collapsible-panel-height) min-w-0 overflow-hidden transition-[height] duration-200 data-ending-style:h-0 data-starting-style:h-0`,...n,children:(0,J.jsx)(`div`,{"data-slot":`trace-collapsible-content-inner`,className:QB(`mt-2 mb-1 ml-[calc(--spacing(2)-1px)] min-w-0 border-l pr-1 pl-4 leading-relaxed wrap-break-word text-muted-foreground`,e),children:t})})}var GK=(0,q.createContext)(null),KK=e=>(e??[]).filter(e=>!!e&&typeof e.id==`string`&&typeof e.component==`string`);function qK(e){let[t,...n]=e.split(`:`),r=n.join(`:`);return r?[`p`,`t`,`f`,`v`].includes(t)?`/space/knowledge?show=${encodeURIComponent(e)}`:t===`chat`?`/work/c/${encodeURIComponent(r)}`:t===`wizard`?`/edit/${encodeURIComponent(r)}`:null:null}function JK({part:e,live:t}){let n=(0,q.useContext)(GK),r=te(),i=He(`/`).replace(/\/$/,``),a=e.input??{},o=e.output,s=KK(a.components),c=e.state===`input-streaming`||e.state===`input-available`;if(!n||e.state===`output-error`||e.state===`output-available`&&o?.ok!==!0)return null;if(!s.some(e=>e.id===`root`))return c&&t?(0,J.jsxs)(RK,{status:`running`,children:[(0,J.jsx)(zK,{children:(0,J.jsx)(Qe,{})}),(0,J.jsx)(BK,{children:K(`work.view.building`)})]}):null;let l=n.answered.get(e.toolCallId)??null,u={href:e=>{let t=qK(e);return t?`${i}${t}`:null},follow:e=>r(e.slice(i.length)||`/`),fieldBase:im(n.chatId),submit:t=>n.submit(e.toolCallId,{...t,text:a.title&&!t.text.startsWith(a.title)?`${a.title}\n${t.text}`:t.text}),answered:l};return(0,J.jsxs)(`div`,{className:`grid gap-3`,children:[a.title?(0,J.jsx)(`div`,{className:`font-display font-semibold text-[1rem] leading-snug`,children:a.title}):null,(0,J.jsx)(_e,{surface:{components:s,data:a.data??{}},assetUrl:e=>n.assetUrl?.(e)??Ee(`/api/studio/spaces/${n.spaceId}/files/${encodeURIComponent(e.replace(/^f:/,``))}/content`),onAction:e=>{e.action===`ask`&&typeof e.target==`string`&&e.target&&n.ask(e.target)},chat:u})]})}var YK=e=>e.type.startsWith(`tool-`)&&`toolCallId`in e,XK=e=>e.type===`reasoning`,ZK=(0,q.createContext)({approvals:new Map,may:()=>!1,decide:()=>{},busy:!1,tools:{}}),QK=e=>{let t=e.output;return t&&typeof t.approval==`string`&&t.status===`waiting`?t.approval:null};function $K(e,t){let n=t[e];return n?n.label?.[Rn]??`${n.plugin}: ${eq(n.tool)}`:eq(e)}var eq=e=>e.replaceAll(`_`,` `).replace(/([a-z])([A-Z])/g,`$1 $2`);function tq(e){let t=[];for(let n of e){let e=t.at(-1);if(n.type===`text`){let r=String(n.text??``);e?.kind===`text`?e.text+=r:r&&t.push({kind:`text`,text:r})}else n.type===`tool-show_view`&&`toolCallId`in n?t.push({kind:`view`,part:n}):(XK(n)||YK(n))&&(e?.kind===`steps`?e.parts.push(n):t.push({kind:`steps`,parts:[n]}))}return t}function nq({parts:e,live:t,id:n}){let r=tq(e),i=vq(e),a=t&&r.at(-1)?.kind!==`text`;return(0,J.jsxs)(`div`,{className:`grid gap-3`,children:[r.map((e,i)=>e.kind===`text`?(0,J.jsx)(ye,{text:e.text,className:`text-[0.9375rem]`},`text-${i}`):e.kind===`view`?(0,J.jsx)(JK,{part:e.part,live:t},e.part.toolCallId):(0,J.jsxs)(q.Fragment,{children:[(0,J.jsx)(cq,{parts:e.parts,running:t&&i===r.length-1,live:t,id:`${n.replace(/^pending-/,``)}:${i}`}),e.parts.filter(YK).map(QK).filter(e=>!!e).map(e=>(0,J.jsx)(Oq,{id:e},e))]},`steps-${i}`)),i.length&&!a?(0,J.jsx)(Sq,{list:i}):null]})}var rq={failed:`work.step.failed`,denied:`work.step.denied`,waiting:`work.step.waiting`,stopped:`work.step.stopped`};function iq(e,t,n,r){if(n)return!r||r.state===`pending`?`waiting`:r.state===`approved`?`done`:r.state;switch(e.state){case`output-available`:return Tq(e.output)!==null&&Object.keys(e.output).length===1?`failed`:`done`;case`output-error`:return`failed`;case`output-denied`:return`denied`;case`approval-requested`:return`waiting`;default:return t?`running`:`stopped`}}function aq(e,t,n,r){let i=e.type.slice(5),a=e.state===`output-available`?QK(e):null,o=a?n.get(a):void 0,s=iq(e,t,a,o),c=a?o?.output:e.output,l=e.input??{},u=rq[s]?K(rq[s]):null,d=s===`failed`?e.errorText??Tq(c):null,f=d?(0,J.jsx)(`p`,{className:`text-[0.8125rem] text-danger`,children:d}):null,p={key:e.toolCallId,phase:s};if(i===`space_search`||i===`search_space`){let t=typeof l.query==`string`?l.query:``,n=mq(c);return{...p,icon:ge,title:K(s===`running`?`work.step.searchingSpace`:`work.step.searchedSpace`,{query:t}),detail:u??(s===`done`&&n?n.length?K(`work.step.hits`,{count:n.length}):K(`work.step.noHits`):null),body:n?.length?(0,J.jsx)(gq,{hits:n}):f,raw:n?.length||d?{input:e.input,output:c??d}:null}}if(i===`web_search`){let t=l.query??l.queries,n=Array.isArray(t)?t.join(`, `):typeof t==`string`?t:``,r=_q(c);return{...p,icon:pt,title:n?K(s===`running`?`work.step.searchingWeb`:`work.step.searchedWeb`,{query:n}):K(s===`running`?`work.step.searchingWebBare`:`work.step.webSearch`),detail:u??(s===`done`&&r.length?K(`work.step.sources`,{count:r.length}):null),body:r.length?(0,J.jsx)(xq,{list:r}):f,raw:r.length||d?{input:e.input,output:c??d}:null}}if(i===`skill_load`||i===`skill_read`){let t=typeof l.name==`string`?l.name:``,n=i===`skill_read`&&typeof l.path==`string`?l.path:``;return{...p,icon:_t,title:K(s===`running`?`work.step.readingSkill`:`work.step.readSkill`,{name:n?`${t}/${n}`:t}),detail:u,body:f,raw:{input:e.input,output:c??d??void 0}}}if(i===`run_command`){let t=typeof l.command==`string`?l.command:``,n=c??{},r=[n.stdout,n.stderr].filter(Boolean).join(`
67
67
  `).trim();return{...p,icon:mo,title:K(s===`running`?`work.step.runningCommand`:`work.step.ranCommand`),detail:u??(s===`done`&&typeof n.exitCode==`number`&&n.exitCode!==0?K(`work.step.exitCode`,{code:n.exitCode}):null),body:(0,J.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,J.jsx)(`pre`,{className:`overflow-x-auto whitespace-pre-wrap rounded-lg bg-ink/5 px-2.5 py-1.5 font-mono text-[0.75rem]`,children:t}),r?(0,J.jsx)(`pre`,{className:`max-h-48 overflow-auto whitespace-pre-wrap px-2.5 font-mono text-[0.75rem] text-ink-3`,children:r}):null,f]}),raw:{input:e.input,output:c??d??void 0}}}return{...p,icon:r[i]?Je:Bo,title:$K(i,r),detail:u??(s===`done`?Cq(c):null),body:f,raw:{input:e.input,output:c??d??void 0}}}function oq(e,t,n){let r=e.text.trim();return{key:t,icon:Nr,title:K(n?`work.step.thinking`:`work.step.thought`),detail:null,phase:n?`running`:`done`,body:r?(0,J.jsx)(`p`,{className:`whitespace-pre-wrap text-[0.8125rem] leading-relaxed`,children:r}):null,raw:null}}function sq({view:e,seconds:t}){let n=(0,J.jsxs)(RK,{status:e.phase===`running`?`running`:e.phase===`failed`?`error`:void 0,children:[(0,J.jsx)(zK,{children:(0,J.jsx)(e.icon,{})}),(0,J.jsx)(BK,{children:e.title}),e.detail?(0,J.jsxs)(VK,{className:e.phase===`waiting`?`text-ember`:void 0,children:[`· `,e.detail]}):null,t===null?null:(0,J.jsxs)(VK,{children:[`· `,fq(t)]})]});return e.body||e.raw?(0,J.jsxs)(HK,{children:[(0,J.jsx)(UK,{children:n}),(0,J.jsxs)(WK,{className:`grid gap-2`,children:[e.body,e.raw?(0,J.jsx)(Eq,{raw:e.raw}):null]})]}):n}function cq({parts:e,running:t,live:n,id:r}){let{approvals:i,tools:a}=(0,q.useContext)(ZK),[o,s]=(0,q.useState)(null);pq(t);let c=e.map((o,s)=>YK(o)?aq(o,n,i,a):oq(o,`${r}:r${s}`,t&&(s===e.length-1||o.state===`streaming`))),l=c.map(e=>uq(e.key,e.phase===`running`));if(c.length===1)return(0,J.jsx)(LK,{children:(0,J.jsx)(sq,{view:c[0],seconds:dq(l,c[0].phase===`running`)})});let u=c.filter(e=>e.phase===`failed`).length,d=dq(l,t);return(0,J.jsx)(LK,{children:(0,J.jsxs)(HK,{open:o??t,onOpenChange:e=>s(e),children:[(0,J.jsx)(UK,{children:(0,J.jsxs)(RK,{status:t?`running`:void 0,children:[(0,J.jsx)(zK,{children:(0,J.jsx)(kt,{})}),(0,J.jsx)(BK,{children:K(`work.step.steps`,{count:c.length})}),d===null?null:(0,J.jsxs)(VK,{children:[`· `,fq(d)]}),u?(0,J.jsxs)(VK,{className:`text-danger`,children:[`· `,K(`work.step.failedCount`,{count:u})]}):null]})}),(0,J.jsx)(WK,{children:(0,J.jsx)(LK,{children:c.map((e,t)=>(0,J.jsx)(sq,{view:e,seconds:e.phase===`running`?null:dq([l[t]],!1)},e.key))})})]})})}var lq=new Map;function uq(e,t){let n=lq.get(e);return!n&&t&&(n={from:Date.now(),to:null},lq.set(e,n)),n&&!t&&n.to===null&&(n.to=Date.now()),n??null}function dq(e,t){let n=e.filter(e=>e!==null);if(!n.length)return null;let r=Math.min(...n.map(e=>e.from));return((t?Date.now():Math.max(...n.map(e=>e.to??e.from)))-r)/1e3}function fq(e){let t=Math.max(1,Math.round(e));return t<60?K(`work.step.seconds`,{n:t}):K(`work.step.minutes`,{m:Math.floor(t/60),s:t%60})}function pq(e){let[,t]=(0,q.useState)(0);(0,q.useEffect)(()=>{if(!e)return;let n=setInterval(()=>t(Date.now()),1e3);return()=>clearInterval(n)},[e])}function mq(e){let t=e?.hits;return Array.isArray(t)?t.map(e=>{let t=t=>typeof e[t]==`string`?e[t]:null;return{key:t(`key`)??t(`open`)??t(`path`)??``,title:t(`title`)??``,heading:t(`heading`)??t(`section`),text:t(`text`)??``,open:t(`open`),link:t(`link`)}}):null}var hq={p:dt,d:dt,t:O,f:lt,v:So,x:Je};function gq({hits:e}){return(0,J.jsx)(`ul`,{className:`-mx-2 grid`,children:e.map((e,t)=>{let n=hq[e.key.split(`:`)[0]]??dt,r=(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(n,{className:`mt-0.5 size-3.5 shrink-0 text-ink-4`}),(0,J.jsxs)(`span`,{className:`min-w-0`,children:[(0,J.jsxs)(`span`,{className:`block truncate text-[0.8125rem] text-ink-2`,children:[e.title,e.heading&&e.heading!==e.title?(0,J.jsxs)(`span`,{className:`text-ink-4`,children:[` › `,e.heading]}):null]}),(0,J.jsx)(`span`,{className:`line-clamp-2 text-[0.75rem] text-ink-4`,children:e.text})]})]}),i=`flex items-start gap-2 rounded-md px-2 py-1.5`;return(0,J.jsx)(`li`,{children:e.open?(0,J.jsx)(Ae,{to:`/space/knowledge?show=${encodeURIComponent(e.open)}`,className:W(i,`hover:bg-ink/5`),children:r}):e.link?(0,J.jsx)(`a`,{href:e.link,className:W(i,`hover:bg-ink/5`),children:r}):(0,J.jsx)(`div`,{className:i,children:r})},`${e.key}:${t}`)})})}function _q(e){let t=Array.isArray(e)?e:e?.results??e?.sources;return Array.isArray(t)?t.flatMap(e=>e&&typeof e.url==`string`?[{url:e.url,title:typeof e.title==`string`?e.title:``}]:[]):[]}function vq(e){let t=new Map;for(let n of e){let e=n.type===`source-url`?[n]:YK(n)&&n.type===`tool-web_search`?_q(n.output):[];for(let n of e)typeof n.url==`string`&&!t.has(n.url)&&t.set(n.url,{url:n.url,title:n.title??``})}return[...t.values()]}var yq=e=>{try{return new URL(e).hostname.replace(/^www\./,``)}catch{return``}};function bq({url:e,className:t}){let[n,r]=(0,q.useState)(!1),i=yq(e);return n||!i?(0,J.jsx)(pt,{className:W(`size-3.5 shrink-0 text-ink-4`,t)}):(0,J.jsx)(`img`,{src:`https://${new URL(e).hostname}/favicon.ico`,alt:``,loading:`lazy`,onError:()=>r(!0),className:W(`size-3.5 shrink-0 rounded-sm`,t)})}function xq({list:e}){return(0,J.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:e.map(e=>(0,J.jsxs)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer noopener`,title:e.title||e.url,className:`flex max-w-80 items-center gap-1.5 rounded-full bg-ink/5 py-1 pr-2.5 pl-2 text-[0.75rem] text-ink-2 transition hover:bg-ink/10 hover:text-ink`,children:[(0,J.jsx)(bq,{url:e.url}),(0,J.jsx)(`span`,{className:`truncate`,children:e.title||yq(e.url)}),e.title?(0,J.jsx)(`span`,{className:`shrink-0 text-ink-4`,children:yq(e.url)}):null]},e.url))})}function Sq({list:e}){let[t,n]=(0,q.useState)(!1);return(0,J.jsxs)(`div`,{className:`grid justify-items-start gap-2`,children:[(0,J.jsxs)(`button`,{type:`button`,"aria-expanded":t,onClick:()=>n(!t),className:`flex items-center gap-2 rounded-full border border-border-soft py-1 pr-3 pl-1.5 text-[0.8125rem] text-ink-3 transition hover:bg-ink/5 hover:text-ink`,children:[(0,J.jsx)(`span`,{className:`-space-x-1 flex`,children:e.slice(0,4).map(e=>(0,J.jsx)(`span`,{className:`grid size-5 place-items-center rounded-full bg-canvas ring-1 ring-border-soft`,children:(0,J.jsx)(bq,{url:e.url,className:`size-3`})},e.url))}),K(`work.step.sources`,{count:e.length})]}),t?(0,J.jsx)(xq,{list:e}):null]})}function Cq(e){if(typeof e==`string`&&e.trim())return wq(e.trim().split(`
68
68
  `)[0]);if(e&&typeof e==`object`&&!Array.isArray(e)){let t=Object.entries(e).filter(([,e])=>[`string`,`number`,`boolean`].includes(typeof e)).slice(0,2).map(([e,t])=>`${eq(e)}: ${wq(String(t))}`);if(t.length)return t.join(` · `)}return K(`work.step.done`)}var wq=e=>e.length>80?`${e.slice(0,79)}…`:e,Tq=e=>{let t=e?.error;return typeof t==`string`?t:null};function Eq({raw:e}){let[t,n]=(0,q.useState)(!1);return(0,J.jsxs)(`div`,{className:`grid justify-items-start gap-1.5`,children:[(0,J.jsxs)(`button`,{type:`button`,"aria-expanded":t,onClick:()=>n(!t),className:`flex items-center gap-1 text-[0.75rem] text-ink-4 transition hover:text-ink`,children:[(0,J.jsx)(Le,{className:W(`size-3 transition-transform`,t&&`rotate-90`)}),K(`work.step.details`)]}),t?(0,J.jsxs)(`div`,{className:`grid w-full gap-1.5`,children:[e.input===void 0?null:(0,J.jsx)(Dq,{label:K(`work.step.input`),value:e.input}),e.output===void 0?null:(0,J.jsx)(Dq,{label:K(`work.step.output`),value:e.output})]}):null]})}function Dq({label:e,value:t}){return(0,J.jsxs)(`div`,{className:`grid gap-1`,children:[(0,J.jsx)(`span`,{className:`text-[0.6875rem] text-ink-4 uppercase tracking-wide`,children:e}),(0,J.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap rounded-md bg-ink/5 p-2 font-mono text-[0.75rem]`,children:typeof t==`string`?t:JSON.stringify(t,null,2)})]})}function Oq({id:e}){let{approvals:t,may:n,decide:r,busy:i,tools:a}=(0,q.useContext)(ZK),o=t.get(e);if(!o)return null;let s=o.input&&typeof o.input==`object`&&!Array.isArray(o.input)?Object.entries(o.input):[],c=o.state===`approved`?QK({output:o.output}):null,l=o.state===`approved`?K(c?`work.approval.toAdmins`:`work.approval.approved`):o.state===`denied`?K(`work.approval.denied`):o.state===`failed`?K(`work.approval.failed`):null;return(0,J.jsxs)(`div`,{className:`grid gap-3 rounded-xl border border-border bg-card/40 p-3.5 text-[0.875rem]`,children:[(0,J.jsxs)(`p`,{className:`flex items-center gap-2 font-medium text-ink`,children:[o.state===`pending`?(0,J.jsx)(so,{className:`size-4 shrink-0 text-ember`}):o.state===`approved`?(0,J.jsx)(ve,{className:`size-4 shrink-0 text-moss`}):(0,J.jsx)(lo,{className:`size-4 shrink-0 text-ink-3`}),o.state===`pending`?K(o.heldFor===`admins`?`work.approval.waitingAdmins`:`work.approval.waiting`,{name:$K(o.toolName,a)}):$K(o.toolName,a)]}),s.length?(0,J.jsx)(`dl`,{className:`grid max-h-56 grid-cols-[auto_1fr] gap-x-4 gap-y-1.5 overflow-auto rounded-lg bg-ink/5 px-3 py-2.5 text-[0.8125rem]`,children:s.map(([e,t])=>(0,J.jsxs)(q.Fragment,{children:[(0,J.jsx)(`dt`,{className:`text-ink-3`,children:eq(e)}),(0,J.jsx)(`dd`,{className:`min-w-0 whitespace-pre-wrap break-words text-ink`,children:typeof t==`string`?t:JSON.stringify(t)})]},e))}):null,l?(0,J.jsx)(`p`,{className:o.state===`failed`?`text-danger`:`text-ink-3`,children:l}):n(o)?(0,J.jsxs)(`div`,{className:`flex gap-2`,children:[(0,J.jsx)(z,{size:`sm`,disabled:i,onClick:()=>r(o.id,!0),children:K(`work.approval.approve`)}),(0,J.jsx)(z,{size:`sm`,variant:`secondary`,disabled:i,onClick:()=>r(o.id,!1),children:K(`work.approval.deny`)})]}):(0,J.jsx)(`p`,{className:`text-ink-3`,children:K(o.heldFor===`admins`?`work.approval.notYoursAdmins`:`work.approval.notYours`)}),c?(0,J.jsx)(Oq,{id:c}):null]})}function kq({id:e}){HT({ownInput:!0});let t=aK(e),n=fm(e,t.tap),r=n.status===`submitted`||n.status===`streaming`,{data:i,isError:a}=lm(e,r),o=qn().data,s=o?.user.id,c=o?.tenant.role??`member`,l=Am(e),u=bm(),[d,f]=(0,q.useState)(null),p=(0,q.useRef)(null),[m,h]=(0,q.useState)(!1),[g,_]=(0,q.useState)(null),[v,y]=(0,q.useState)(!1),b=Ge(),S=b.state,C=i?.chat.answeringSince??null,w=(0,q.useRef)(null);(0,q.useEffect)(()=>{C&&!r&&w.current!==C&&(w.current=C,n.resumeStream())},[C,r,n]);let T=te(),E=!!i,D=i?.chat.spaceId??``,O=rK(i?.chat.spaceId,()=>h(!0),S?.choice),k=(0,q.useRef)(null);(0,q.useEffect)(()=>{S?.ask!==void 0&&E&&k.current!==b.key&&(k.current=b.key,T(b.pathname,{replace:!0,state:null}),Aq(n,D,S.ask,S.files??[],O.body))},[S,E,D,T,b.key,b.pathname,n,O.body]);let A=(0,q.useRef)(new Map),{space:j}=Qn(),M=De(),N=i?.chat.id;if((0,q.useEffect)(()=>{N&&M.invalidateQueries({queryKey:[`work-chats`]})},[N,M]),xY([{label:K(`work.chats`),to:`/work`},{label:Nq(i)}]),a)return(0,J.jsx)(`p`,{className:`m-auto text-ink-3`,children:K(`work.chatGone`)});if(!i)return(0,J.jsx)(`div`,{className:`flex-1`});let P=new Map(i.members.map(e=>[`${e.kind}:${e.id}`,e])),F=i.members.filter(e=>e.kind===`person`).length,I=d??F<=1,L=[...i.messages,...jq(n.messages,s??``,i.messages,A.current)],R={approvals:new Map(i.approvals.map(e=>[e.id,e])),may:e=>c!==`member`||e.heldFor===`asker`&&e.askedBy===s,decide:(e,t)=>l.mutate({id:e,approve:t}),busy:l.isPending,tools:i.tools??{}},z={chatId:e,spaceId:D,ask:t=>{r?u.mutateAsync({id:e,text:t,later:!0,choice:O.body}):Aq(n,D,t,[],O.body)},submit:async(t,i)=>{let a={call:t,values:i.values};r?await u.mutateAsync({id:e,text:i.text,later:!0,files:i.files,form:a,choice:O.body}):await Aq(n,D,i.text,[],O.body,{files:i.files,form:a})},answered:new Map(i.messages.filter(e=>e.form).map(e=>[e.form?.call??``,{by:P.get(`person:${e.author.id}`)?.name??e.author.name,values:e.form?.values??{}}]))},B=L.at(-1),ee=r&&B?.author.kind===`ai`&&B.id.startsWith(`pending-`)?B.id:null,V=e=>e.author.kind===`ai`?null:P.get(`person:${e.author.id}`)??{kind:`person`,id:e.author.id,name:e.author.name,image:null};return(0,J.jsxs)(`div`,{className:`relative flex min-h-0 min-w-0 flex-1 flex-col`,onDragOver:e=>{e.dataTransfer.types.includes(`Files`)&&(e.preventDefault(),y(!0))},onDragLeave:e=>{e.currentTarget.contains(e.relatedTarget)||y(!1)},onDrop:e=>{y(!1),e.dataTransfer.files.length&&(e.preventDefault(),p.current?.add(Array.from(e.dataTransfer.files).map(be)),p.current?.focus())},children:[v?(0,J.jsx)(`div`,{className:`pointer-events-none absolute inset-3 z-20 grid place-items-center rounded-2xl border-2 border-focus border-dashed bg-card/95 font-medium text-[0.9375rem] text-ink`,children:K(`new.dropHint`)}):null,(0,J.jsx)(Pq,{chat:i}),(0,J.jsx)(`div`,{className:`min-h-0 flex-1`,children:L.length?(0,J.jsx)(ZK.Provider,{value:R,children:(0,J.jsx)(GK.Provider,{value:z,children:(0,J.jsxs)(qG,{autoScroll:!0,children:[(0,J.jsx)(Mq,{sent:L.filter(e=>e.author.kind===`person`&&e.author.id===s).length}),(0,J.jsxs)(JG,{children:[(0,J.jsx)(YG,{children:(0,J.jsx)(XG,{className:`mx-auto w-full max-w-3xl gap-4 px-6 py-6`,children:Iq(L).map((e,t,n)=>{let r=e[0],i=r.author.kind===`person`&&r.author.id===s,a=V(r),o=Lq(r.createdAt),c=t===0||Lq(n[t-1][0].createdAt)!==o;return(0,J.jsxs)(q.Fragment,{children:[c?(0,J.jsx)(PW,{variant:`separator`,children:(0,J.jsx)(FW,{children:Rq(r.createdAt)})}):null,(0,J.jsx)(ZG,{messageId:r.id,children:(0,J.jsx)(Bq,{group:e,mine:i,author:a,spaceName:j?.name??``,liveId:ee})})]},r.id)})})}),(0,J.jsx)(QG,{})]})]},e)})}):(0,J.jsx)(`p`,{className:`grid h-full place-items-center text-[0.9375rem] text-ink-3`,children:K(`work.emptyChat`)})}),(0,J.jsxs)(`div`,{className:`mx-auto grid w-full max-w-3xl gap-2 px-6 pb-5`,children:[n.error?(0,J.jsx)(`p`,{className:`text-[0.8125rem] text-danger`,children:K(`work.turnFailed`,{message:n.error.message})}):null,g?(0,J.jsx)(`p`,{className:`text-[0.8125rem] text-danger`,children:K(`work.files.uploadFailed`,{message:g})}):null,(0,J.jsx)(`div`,{className:`flex`,children:(0,J.jsxs)(`button`,{type:`button`,"aria-pressed":I,onClick:()=>f(!I),className:W(`flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[0.8125rem] transition`,I?`bg-ember/15 text-ink`:`text-ink-3 hover:bg-ink/5 hover:text-ink`),children:[(0,J.jsx)(x,{className:`size-3.5`}),K(`work.askAi`,{name:j?.name??``})]})}),(0,J.jsx)(Oe,{ref:p,autoFocus:!0,tall:!0,lines:2,busy:r,chooser:O.chooser,buttons:(0,J.jsx)(oK,{dev:t,messages:L}),plus:O.plus,onStop:()=>{n.stop(),mm(e)},placeholder:K(I?`work.writeAsk`:`work.write`),onSend:async(t,i,a,o=[])=>{let s=t.trim();if(!s&&!i.length&&!o.length)return!1;_(null);let c;try{c=[...o,...await xm(e,i)]}catch(e){return _(e.message),!1}let l=c.map(e=>e.id);return a&&r?await u.mutateAsync({id:e,text:s,later:!0,files:l,choice:O.body}):I||s.startsWith(`@`)?Aq(n,D,s,c,O.body):await u.mutateAsync({id:e,text:s,files:l}),!0}},e),(0,J.jsx)(sK,{spaceId:i.chat.spaceId,open:m,onClose:()=>h(!1),onPick:e=>p.current?.pick(e)})]})]})}function Aq(e,t,n,r,i,a){if(a)return e.sendMessage({text:n},{body:{...i,form:a.form,...a.files.length?{files:a.files}:{}}});if(!r.length)return e.sendMessage({text:n},{body:i});let o=r.map(e=>({type:`file`,mediaType:e.mime,filename:e.name,url:`/api/studio/spaces/${t}/files/${e.id}/content`}));return e.sendMessage(n?{text:n,files:o}:{files:o},{body:{files:r.map(e=>e.id),...i}})}function jq(e,t,n,r){let i=e=>n.filter(n=>n.author.kind===`person`&&n.author.id===t&&Hq(n.parts)===e).length;return e.flatMap(e=>{if(e.role===`user`){let t=Hq(e.parts);if(r.has(e.id)||r.set(e.id,i(t)),i(t)>(r.get(e.id)??0))return[]}return[{id:`pending-${e.id}`,author:e.role===`user`?{kind:`person`,id:t,name:``}:{kind:`ai`,id:`ai`,name:``},parts:e.parts,createdAt:new Date().toISOString()}]})}function Mq({sent:e}){let{scrollToEnd:t}=FG(),n=(0,q.useRef)(e);return(0,q.useEffect)(()=>{e>n.current&&t({behavior:`smooth`}),n.current=e},[e,t]),null}var Nq=e=>e?e.chat.title||K(`work.untitled`):K(`work.chats`);function Pq({chat:e}){let t=gm(),n=te();return(0,J.jsxs)(`header`,{className:`flex min-h-12 flex-wrap items-center gap-x-3 gap-y-1 border-border-soft border-b px-6 py-2`,children:[e.chat.private?(0,J.jsx)(ta,{className:`size-3.5 shrink-0 text-ink-4`,"aria-label":K(`work.private`)}):null,(0,J.jsx)(`div`,{className:`-space-x-1.5 flex`,title:e.members.map(e=>e.name).join(`, `),children:e.members.slice(0,5).map(e=>(0,J.jsx)(Fq,{member:e,className:`ring-2 ring-canvas`},`${e.kind}:${e.id}`))}),(0,J.jsxs)(`div`,{className:`ml-auto flex flex-wrap items-center gap-1.5`,children:[e.threads.map(e=>(0,J.jsx)(Ae,{to:`/work/c/${e.id}`,className:`max-w-48 truncate rounded-full bg-ink/5 px-2.5 py-1 text-[0.8125rem] text-ink-2 hover:bg-ink/10`,children:e.title||K(`work.untitled`)},e.id)),(0,J.jsxs)(`button`,{type:`button`,onClick:async()=>{let r=await t.mutateAsync({parentId:e.chat.id});n(`/work/c/${r.id}`)},className:`flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[0.8125rem] text-ink-3 hover:bg-ink/5 hover:text-ink`,children:[(0,J.jsx)(la,{className:`size-3.5`}),K(`work.newThread`)]}),e.chat.parentId?(0,J.jsx)(Ae,{to:`/work/c/${e.chat.parentId}`,className:`rounded-full px-2.5 py-1 text-[0.8125rem] text-ink-3 hover:bg-ink/5 hover:text-ink`,children:K(`work.toParent`)}):null]})]})}function Fq({member:e,className:t}){let n=(e?.name??`?`).split(/\s+/).map(e=>e[0]).join(``).slice(0,2).toUpperCase();return e?.image?(0,J.jsx)(`img`,{src:e.image,alt:``,className:`size-7 shrink-0 rounded-full object-cover ${t??``}`}):(0,J.jsx)(`span`,{className:`grid size-7 shrink-0 place-items-center rounded-full bg-ink/10 font-semibold text-[0.6875rem] text-ink-2 ${t??``}`,children:n})}function Iq(e){let t=[];for(let n of e){let e=t.at(-1)?.at(-1);e&&e.author.kind===n.author.kind&&e.author.id===n.author.id&&Date.parse(n.createdAt)-Date.parse(e.createdAt)<3e5?t.at(-1)?.push(n):t.push([n])}return t}var Lq=e=>new Date(e).toDateString();function Rq(e){let t=new Date(e),n=new Date,r=new Date(n.getTime()-864e5);return t.toDateString()===n.toDateString()?K(`work.today`):t.toDateString()===r.toDateString()?K(`work.yesterday`):t.toLocaleDateString(Rn,{weekday:`long`,day:`numeric`,month:`long`})}var zq=e=>new Date(e).toLocaleTimeString(Rn,{hour:`2-digit`,minute:`2-digit`});function Bq({group:e,mine:t,author:n,spaceName:r,liveId:i}){let a=e[0].author.kind===`ai`;return(0,J.jsxs)(LW,{align:t?`end`:`start`,children:[t?null:(0,J.jsx)(RW,{className:`min-w-0 self-start bg-transparent`,children:a?(0,J.jsx)(gn,{size:28,kind:ru.work}):(0,J.jsx)(Fq,{member:n??void 0})}),(0,J.jsxs)(zW,{children:[(0,J.jsxs)(BW,{className:t?`justify-end`:void 0,children:[t?K(`work.you`):a?r:n?.name??``,(0,J.jsx)(`span`,{className:`ml-2 font-normal text-ink-4`,children:zq(e[0].createdAt)})]}),(0,J.jsx)(IW,{children:e.map(e=>a?(0,J.jsx)(nq,{id:e.id,parts:e.parts,live:e.id===i},e.id):(0,J.jsxs)(q.Fragment,{children:[Hq(e.parts)?(0,J.jsx)(jW,{align:t?`end`:`start`,variant:t?`muted`:`outline`,children:(0,J.jsx)(MW,{className:`whitespace-pre-wrap text-[0.9375rem]`,children:Hq(e.parts)})}):null,(0,J.jsx)(Vq,{parts:e.parts,mine:t})]},e.id))})]})]})}function Vq({parts:e,mine:t}){let[n,r]=(0,q.useState)(null),i=e.filter(e=>e.type===`file`).map(e=>({name:e.filename??K(`work.files.file`),mime:e.mediaType,url:Ee(e.url)}));if(!i.length)return null;let a=i.map((e,t)=>({f:e,i:t})),o=a.filter(({f:e})=>e.mime.startsWith(`image/`)),s=a.filter(({f:e})=>!e.mime.startsWith(`image/`)),c=({f:e,i:t},n)=>(0,J.jsx)(ce,{file:e,large:!0,imageClassName:n,onOpen:()=>r(t)},`${e.url}-${t}`);return(0,J.jsxs)(J.Fragment,{children:[o.length===1?(0,J.jsx)(`ul`,{className:W(`flex w-full`,t&&`justify-end`),children:o.map(e=>c(e))}):o.length?(0,J.jsx)(`ul`,{className:W(`grid w-full max-w-3xl grid-cols-2 items-start gap-2`,t&&`ml-auto justify-items-end`),children:o.map(e=>c(e,`max-h-[55dvh]`))}):null,s.length?(0,J.jsx)(`ul`,{className:W(`flex flex-wrap gap-2`,t&&`justify-end`),children:s.map(e=>c(e))}):null,(0,J.jsx)(re,{files:i,at:n,onAt:r})]})}var Hq=e=>e.filter(e=>e.type===`text`).map(e=>e.text).join(`
69
- `);function Uq({id:e}){let{space:t}=Qn(),{data:n}=cm(t?.id,``),r=n?.sections.find(t=>t.id===e),i=(n?.chats??[]).filter(t=>t.sectionId===e&&!t.archived&&!t.parentId),a=gm(),o=wm(e).data,s=Cm(),c=te(),[l,u]=(0,q.useState)(!1),[f,p]=(0,q.useState)(``);return(0,q.useEffect)(()=>{p(r?.infos??``)},[r?.infos]),xY(r?[{label:r.name}]:[]),r?(0,J.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:(0,J.jsxs)(`div`,{className:`mx-auto grid w-full max-w-5xl gap-8 px-6 py-8 md:grid-cols-[minmax(0,1fr)_16rem]`,children:[(0,J.jsxs)(`div`,{className:`grid min-w-0 content-start gap-5`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,J.jsx)(`span`,{className:`grid size-10 place-items-center rounded-xl bg-card text-ink-2 ring-1 ring-border-soft`,children:(0,J.jsx)(xi,{className:`size-5`})}),(0,J.jsx)(`h1`,{className:`min-w-0 truncate font-display font-semibold text-[1.375rem] text-ink`,children:r.name})]}),(0,J.jsx)(`form`,{onSubmit:async n=>{n.preventDefault();let r=await a.mutateAsync({spaceId:t?.id,sectionId:e,parentId:null});c(`/work/c/${r.id}`)},children:(0,J.jsx)(z,{type:`submit`,busy:a.isPending,children:K(`work.newChatIn`,{name:r.name})})}),(0,J.jsxs)(`ul`,{className:`grid`,children:[i.map(e=>(0,J.jsx)(`li`,{children:(0,J.jsxs)(`button`,{type:`button`,onClick:()=>c(`/work/c/${e.id}`),className:`flex w-full items-center gap-3 border-border-soft border-b px-1 py-2.5 text-left transition hover:bg-ink/5`,children:[(0,J.jsx)(j,{className:`size-4 shrink-0 text-ink-3`}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col leading-tight`,children:[(0,J.jsx)(`span`,{className:`truncate text-[0.875rem] text-ink`,children:e.title||K(`work.untitled`)}),e.last?(0,J.jsxs)(`span`,{className:`truncate text-[0.75rem] text-ink-3`,children:[e.last.author,`: `,e.last.text]}):null]})]})},e.id)),i.length?null:(0,J.jsx)(`li`,{className:`px-1 py-2.5 text-[0.875rem] text-ink-3`,children:K(`work.folderEmpty`)})]})]}),(0,J.jsxs)(`aside`,{className:`grid content-start gap-2.5`,children:[(0,J.jsxs)(`section`,{className:`grid gap-1.5 rounded-xl bg-card p-3 ring-1 ring-border-soft`,children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,J.jsx)(`h2`,{className:`font-semibold text-[0.8125rem] text-ink`,children:K(`work.folderInfos`)}),l?null:(0,J.jsx)(`button`,{type:`button`,"aria-label":K(`work.folderInfosEdit`),onClick:()=>u(!0),className:`grid size-6 place-items-center rounded-md text-ink-3 hover:bg-ink/10 hover:text-ink`,children:(0,J.jsx)(d,{className:`size-3.5`})})]}),l?(0,J.jsx)(`textarea`,{autoFocus:!0,value:f,rows:6,maxLength:2e4,"aria-label":K(`work.folderInfos`),onChange:e=>p(e.target.value),onBlur:async()=>{u(!1),f!==(r.infos??``)&&await s.mutateAsync({id:e,infos:f})},className:`w-full resize-y rounded-lg bg-background p-2 text-[0.8125rem] text-ink outline-none ring-1 ring-border focus:ring-ember/60`}):(0,J.jsx)(`p`,{className:W(`whitespace-pre-wrap text-[0.8125rem]`,r.infos?`text-ink-2`:`text-ink-4`),children:r.infos||K(`work.folderInfosEmpty`)})]}),(0,J.jsxs)(`section`,{className:`grid gap-1.5 rounded-xl bg-card p-3 ring-1 ring-border-soft`,children:[(0,J.jsx)(`h2`,{className:`font-semibold text-[0.8125rem] text-ink`,children:K(`work.folderFiles`)}),(0,J.jsx)(Wq,{spaceId:t?.id??``,mountId:r.mountId??null,onLink:t=>s.mutate({id:e,mountId:t})}),o?.files.length?o.files.map(e=>(0,J.jsxs)(`a`,{href:Ee(e.url),target:`_blank`,rel:`noreferrer`,className:`flex min-w-0 items-center gap-2 text-[0.8125rem] text-ink-2 hover:text-ink`,children:[(0,J.jsx)(dt,{className:`size-3.5 shrink-0 text-ink-3`}),(0,J.jsx)(`span`,{className:`truncate`,children:e.name})]},e.id)):(0,J.jsx)(`p`,{className:`text-[0.8125rem] text-ink-4`,children:K(`work.folderFilesEmpty`)})]}),(0,J.jsxs)(`section`,{className:`grid gap-1.5 rounded-xl bg-card p-3 ring-1 ring-border-soft`,children:[(0,J.jsx)(`h2`,{className:`font-semibold text-[0.8125rem] text-ink`,children:K(`work.folderResults`)}),o?.results.length?o.results.map(e=>(0,J.jsxs)(`button`,{type:`button`,onClick:()=>c(`/work/r/${e.runId}`),className:`flex min-w-0 items-center gap-2 text-left text-[0.8125rem] text-ink-2 hover:text-ink`,children:[(0,J.jsx)(x,{className:`size-3.5 shrink-0 text-ember-strong`}),(0,J.jsx)(`span`,{className:`truncate`,children:e.title})]},e.runId)):(0,J.jsx)(`p`,{className:`text-[0.8125rem] text-ink-4`,children:K(`work.folderResultsEmpty`)})]})]})]})}):(0,J.jsx)(`div`,{className:`flex-1`})}function Wq({spaceId:e,mountId:t,onLink:n}){let r=nt(`dateien`),i=D({queryKey:[`space-mounts`,e],queryFn:()=>a.get(`/api/studio/spaces/${e}/mounts`),enabled:r&&!!e}).data?.mounts,o=D({queryKey:[`space-mounts`,e,t,`files`],queryFn:()=>a.get(`/api/studio/spaces/${e}/mounts/${t}/files`),enabled:r&&!!(e&&t)}).data?.files;if(!r||!i?.length)return null;let s=i.find(e=>e.id===t);return s?(0,J.jsxs)(`div`,{className:`grid gap-1`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg bg-background px-2 py-1.5 text-[0.8125rem] ring-1 ring-border-soft`,children:[(0,J.jsx)(A,{className:`size-3.5 shrink-0 text-cobalt`}),(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:s.name}),(0,J.jsx)(`button`,{type:`button`,"aria-label":K(`work.folderUnlink`),title:K(`work.folderUnlink`),onClick:()=>n(null),className:`grid size-5 place-items-center rounded text-ink-3 hover:text-ink`,children:(0,J.jsx)(Mo,{className:`size-3`})})]}),o?.slice(0,5).map(e=>(0,J.jsx)(`span`,{className:`truncate pl-1 text-[0.75rem] text-ink-3`,children:e.path},e.id)),o&&o.length>5?(0,J.jsx)(`span`,{className:`pl-1 text-[0.75rem] text-ink-4`,children:K(`work.folderMoreFiles`,{n:o.length-5})}):null]}):(0,J.jsxs)(`label`,{className:`flex items-center gap-2 text-[0.8125rem] text-ink-3`,children:[(0,J.jsx)(ki,{className:`size-3.5 shrink-0`}),(0,J.jsxs)(`select`,{value:``,"aria-label":K(`work.folderLink`),onChange:e=>e.target.value&&n(e.target.value),className:`min-w-0 flex-1 rounded-md bg-background px-1.5 py-1 text-ink ring-1 ring-border`,children:[(0,J.jsx)(`option`,{value:``,children:K(`work.folderLink`)}),i.map(e=>(0,J.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]})}var Gq=6,Kq=4;function qq(){xY([{label:K(`work.chats`)}]),HT({ownInput:!0});let{space:e}=Qn(),t=qn().data,n=e&&t?eW(t,e):e?.name??``,r=(cm(e?.id,``).data?.chats??[]).filter(e=>!e.archived),i=Dm().data,a=i?.approvals??[],o=t=>(t??[]).filter(t=>t.spaceId===e?.id),s=o(i?.runs?.needs),c=o(i?.runs?.waits),l=gm(),u=te(),d=(0,q.useRef)(null),[f,p]=(0,q.useState)(!1),m=rK(e?.id,()=>p(!0)),[h,g]=(0,q.useState)(null),_=nK(e?.id).slice(0,Kq),v=new Map(r.map(e=>[e.id,e.title||K(`work.untitled`)])),y=r.filter(e=>e.unread&&e.last),b=r.filter(e=>e.answeringSince),x=new Set([...y,...b].map(e=>e.id)),S=[...r].filter(e=>!x.has(e.id)).sort((e,t)=>Jq(t)>Jq(e)?1:-1).slice(0,Gq),C=s.length+a.length+y.length,w=t?.user.name.split(` `)[0]??``;return(0,J.jsx)(`div`,{className:`min-w-0 flex-1 overflow-y-auto`,children:(0,J.jsxs)(`div`,{className:`mx-auto grid w-full max-w-3xl gap-10 px-6 pt-14 pb-16`,children:[(0,J.jsxs)(`header`,{className:`grid gap-1.5`,children:[(0,J.jsx)(`p`,{className:`text-[0.8125rem] text-ink-3`,children:new Date().toLocaleDateString(Rn,{weekday:`long`,day:`numeric`,month:`long`})}),(0,J.jsx)(`h1`,{className:`font-display font-semibold text-[2rem] text-ink leading-tight`,children:Yq(w)}),(0,J.jsx)(`p`,{className:`text-[0.9375rem] text-ink-2`,children:C?K(`work.home.needs`,{count:C}):K(`work.waitingEmpty`)})]}),(0,J.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,J.jsx)(Oe,{ref:d,tall:!0,autoFocus:!0,placeholder:K(`work.home.ask`,{name:n}),chooser:m.chooser,plus:m.plus,onSend:async(t,n,r,i=[])=>{let a=t.trim();if(!a&&!n.length&&!i.length||!e)return!1;g(null);try{let t=await l.mutateAsync({spaceId:e.id}),r=await xm(t.id,n);return u(`/work/c/${t.id}`,{state:{ask:a,files:[...i,...r],choice:m.choice}}),!0}catch(e){return g(e.message),!1}}}),(0,J.jsx)(`p`,{className:W(`px-3 text-[0.75rem]`,h?`text-danger`:`text-ink-4`),children:h?K(`work.files.uploadFailed`,{message:h}):K(`work.home.askHint`)}),e?(0,J.jsx)(sK,{spaceId:e.id,open:f,onClose:()=>p(!1),onPick:e=>d.current?.pick(e)}):null]}),C?(0,J.jsx)(Zq,{label:K(`work.home.needsYou`),children:(0,J.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[s.map(e=>(0,J.jsx)(nJ,{run:e},e.runId)),a.map(e=>(0,J.jsx)($q,{approval:e,chat:v.get(e.chatId)??K(`work.untitled`),may:t?.tenant.role!==`member`||e.heldFor===`asker`&&e.askedBy===t?.user.id},e.id)),y.map(e=>(0,J.jsx)(aJ,{chat:e},e.id))]})}):null,c.length?(0,J.jsxs)(Zq,{label:K(`work.home.waits`),children:[(0,J.jsx)(`p`,{className:`-mt-1.5 text-[0.8125rem] text-ink-3`,children:K(`work.home.waitsHint`)}),(0,J.jsx)(`ul`,{className:`grid`,children:c.map(e=>(0,J.jsx)(rJ,{run:e},e.runId))})]}):null,b.length?(0,J.jsx)(Zq,{label:K(`work.home.running`),children:(0,J.jsx)(`ul`,{className:`grid`,children:b.map(e=>(0,J.jsx)(sJ,{chat:e,note:(0,J.jsxs)(`span`,{className:`flex items-center gap-1.5 text-ember`,children:[(0,J.jsx)(`span`,{className:`size-1.5 animate-pulse rounded-full bg-ember`}),K(`work.home.answering`,{name:n})]})},e.id))})}):null,_.length&&t?(0,J.jsx)(Zq,{label:K(`work.home.wizards`),children:(0,J.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:_.map(e=>(0,J.jsx)(iJ,{wizard:e,me:t},e.id))})}):null,S.length?(0,J.jsx)(Zq,{label:K(`work.home.recent`),children:(0,J.jsx)(`ul`,{className:`grid`,children:S.map(e=>(0,J.jsx)(sJ,{chat:e},e.id))})}):null]})})}var Jq=e=>e.last?.at??e.updatedAt;function Yq(e){let t=new Date().getHours();return K(t<11?`work.home.morning`:t<18?`work.home.day`:`work.home.evening`,{name:e})}function Xq(e){let t=new Date(e),n=new Date;return t.toDateString()===n.toDateString()?t.toLocaleTimeString(Rn,{hour:`2-digit`,minute:`2-digit`}):t.toDateString()===new Date(n.getTime()-864e5).toDateString()?K(`work.yesterday`):t.toLocaleDateString(Rn,{day:`numeric`,month:`short`})}function Zq({label:e,children:t}){return(0,J.jsxs)(`section`,{className:`grid gap-3`,children:[(0,J.jsx)(`h2`,{className:`font-semibold text-[0.75rem] text-ink-3 uppercase tracking-wide`,children:e}),t]})}var Qq=`grid content-start gap-3 rounded-2xl border border-border bg-card p-4`;function $q({approval:e,chat:t,may:n}){let r=Am(e.chatId);return(0,J.jsxs)(`div`,{className:W(Qq,`border-ember/40`),children:[(0,J.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,J.jsx)(so,{className:`mt-0.5 size-4 shrink-0 text-ember`}),(0,J.jsxs)(`div`,{className:`grid min-w-0 gap-0.5`,children:[(0,J.jsx)(`p`,{className:`truncate text-[0.75rem] text-ink-3`,children:t}),(0,J.jsx)(`p`,{className:`font-medium text-[0.9375rem] text-ink`,children:K(e.heldFor===`admins`?`work.approval.waitingAdmins`:`work.approval.waiting`,{name:e.toolName})})]})]}),(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[n?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(z,{size:`sm`,disabled:r.isPending,onClick:()=>r.mutate({id:e.id,approve:!0}),children:K(`work.approval.approve`)}),(0,J.jsx)(z,{size:`sm`,variant:`secondary`,disabled:r.isPending,onClick:()=>r.mutate({id:e.id,approve:!1}),children:K(`work.approval.deny`)})]}):null,(0,J.jsx)(Ae,{to:`/work/c/${e.chatId}`,className:`ml-auto text-[0.8125rem] text-ink-3 hover:text-ink`,children:K(`work.home.open`)})]})]})}var eJ=e=>`/work/r/${e.runId}`;function tJ(e){return[e.about,K(`work.home.since`,{when:Xq(e.since)}),e.until?K(`work.home.until`,{when:Xq(e.until)}):K(`work.home.noDeadline`)].filter(Boolean).join(` · `)}function nJ({run:e}){let t=Om(e),n=te(),r=e.kind===`approve`?so:pi;return(0,J.jsxs)(`div`,{className:W(Qq,e.kind===`approve`&&`border-ember/40`),children:[(0,J.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,J.jsx)(r,{className:`mt-0.5 size-4 shrink-0 text-ember`}),(0,J.jsxs)(`div`,{className:`grid min-w-0 gap-0.5`,children:[(0,J.jsxs)(`p`,{className:`truncate text-[0.75rem] text-ink-3`,children:[e.wizard,` · `,e.step]}),e.detail?(0,J.jsx)(`p`,{className:`line-clamp-3 font-medium text-[0.9375rem] text-ink`,children:e.detail}):null,(0,J.jsx)(`p`,{className:`truncate text-[0.75rem] text-ink-3`,children:tJ(e)})]})]}),t.error?(0,J.jsx)(`p`,{className:`text-[0.8125rem] text-danger`,children:t.error.message}):null,(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[e.kind===`approve`?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(z,{size:`sm`,disabled:t.isPending,onClick:()=>t.mutate(!0),children:K(`run.approve`)}),(0,J.jsx)(z,{size:`sm`,variant:`secondary`,disabled:t.isPending,onClick:()=>t.mutate(!1),children:K(`run.decline`)})]}):(0,J.jsx)(z,{size:`sm`,onClick:()=>n(eJ(e)),children:K(e.kind===`review`?`work.home.review`:`work.home.answer`)}),(0,J.jsx)(Ae,{to:eJ(e),className:`ml-auto text-[0.8125rem] text-ink-3 hover:text-ink`,children:K(`work.home.open`)})]})]})}function rJ({run:e}){return(0,J.jsx)(`li`,{children:(0,J.jsxs)(Ae,{to:eJ(e),className:`-mx-3 flex items-baseline gap-3 rounded-xl px-3 py-2.5 hover:bg-ink/5`,children:[(0,J.jsx)(oe,{className:`size-3.5 shrink-0 self-center text-ink-4`}),(0,J.jsxs)(`div`,{className:`grid min-w-0 flex-1 gap-0.5`,children:[(0,J.jsxs)(`p`,{className:`truncate font-medium text-[0.9375rem] text-ink`,children:[e.wizard,` · `,e.step]}),(0,J.jsx)(`p`,{className:`truncate text-[0.8125rem] text-ink-3`,children:tJ(e)})]})]})})}function iJ({wizard:e,me:t}){return(0,J.jsxs)(`button`,{type:`button`,onClick:()=>Dw(tK(e,t)),title:K(`work.home.wizardOpen`),className:W(Qq,`grid-cols-[auto_1fr] items-start text-left hover:bg-ink/5`),children:[(0,J.jsx)(un,{kind:e.avatar,costume:e.costume,size:40}),(0,J.jsxs)(`div`,{className:`grid min-w-0 gap-0.5`,children:[(0,J.jsx)(`p`,{className:`truncate font-medium text-[0.9375rem] text-ink`,children:e.title}),(0,J.jsx)(`p`,{className:`line-clamp-2 text-[0.8125rem] text-ink-3`,children:e.description})]})]})}function aJ({chat:e}){let t=oJ(e);return(0,J.jsx)(Ae,{to:`/work/c/${e.id}`,className:W(Qq,`hover:bg-ink/5`),children:(0,J.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,J.jsx)(j,{className:`mt-0.5 size-4 shrink-0 text-ink-3`}),(0,J.jsxs)(`div`,{className:`grid min-w-0 gap-0.5`,children:[(0,J.jsxs)(`p`,{className:`truncate text-[0.75rem] text-ink-3`,children:[e.title||K(`work.untitled`),` · `,Xq(Jq(e))]}),(0,J.jsxs)(`p`,{className:`line-clamp-3 text-[0.9375rem] text-ink`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:t}),e.last?.text]})]})]})})}function oJ(e){let t=qn().data?.user.name,n=e.last?.author;return n?`${n===t?K(`work.you`):n}: `:``}function sJ({chat:e,note:t}){let n=oJ(e);return(0,J.jsx)(`li`,{children:(0,J.jsxs)(Ae,{to:`/work/c/${e.id}`,className:`-mx-3 flex items-baseline gap-3 rounded-xl px-3 py-2.5 hover:bg-ink/5`,children:[(0,J.jsxs)(`div`,{className:`grid min-w-0 flex-1 gap-0.5`,children:[(0,J.jsx)(`p`,{className:`truncate font-medium text-[0.9375rem] text-ink`,children:e.title||K(`work.untitled`)}),(0,J.jsx)(`div`,{className:`truncate text-[0.8125rem] text-ink-3`,children:t??(e.last?(0,J.jsxs)(J.Fragment,{children:[n,e.last.text]}):K(`work.emptyChat`))})]}),(0,J.jsx)(`span`,{className:`shrink-0 text-[0.75rem] text-ink-4`,children:Xq(Jq(e))})]})})}var cJ=[{place:`chats`,to:`/work`,label:`work.chats`},{place:`engenties`,to:`/work/engenties`,label:`work.engenties`},{place:`files`,to:`/work/files`,label:`work.files`},{place:`data`,to:`/work/data`,label:`work.data`},{place:`results`,to:`/work/results`,label:`work.results`},{place:`waiting`,to:`/work/waiting`,label:`work.waiting`}],lJ={engenties:`work.engentiesEmpty`,files:`work.filesEmpty`,data:`work.dataEmpty`,results:`work.resultsEmpty`,waiting:`work.waitingEmpty`};function uJ(e){return(0,J.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,...e,children:[(0,J.jsx)(`path`,{d:`M12 3.2Q19 7.6 19 14q0 6.5-7 6.9Q5 20.5 5 14q0-6.4 7-10.8z`}),(0,J.jsx)(`circle`,{cx:`12`,cy:`12.6`,r:`2.2`})]})}function dJ({mode:e,children:t}){let n=Gl(qn().data);return n===e?t:(0,J.jsx)(pe,{to:Il[n],replace:!0})}function fJ(){let{place:e,chatId:t,folderId:n}=Ue(),r=nt(`workWip`);if(t||n)return(0,J.jsx)(hJ,{});let i=r?cJ.find(t=>t.place===e&&t.place!==`chats`):void 0;return e&&!i?(0,J.jsx)(pe,{to:`/work`,replace:!0}):i?.place===`waiting`?(0,J.jsx)(vJ,{}):i?(0,J.jsx)(gJ,{place:i.place}):(0,J.jsx)(hJ,{})}var pJ=`wizards.work.sidebar`;function mJ(){let[e,t]=(0,q.useState)(()=>{try{return localStorage.getItem(pJ)!==`closed`}catch{return!0}});return[e,()=>t(e=>{try{localStorage.setItem(pJ,e?`closed`:`open`)}catch{}return!e})]}function hJ(){let{chatId:e,folderId:t}=Ue(),n=qn().data,[r,i]=mJ(),a=nt(`goose`),o=(0,q.useRef)(null);return(0,J.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[n?(0,J.jsx)(VY,{me:n,sidebar:{open:r,onToggle:i}}):null,(0,J.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,J.jsx)(`div`,{inert:!r,className:W(`flex shrink-0 overflow-hidden transition-[width] duration-200 ease-out motion-reduce:transition-none`,r?`w-72`:`w-0`),children:(0,J.jsx)(dW,{})}),(0,J.jsxs)(`div`,{ref:o,className:`relative flex min-h-0 min-w-0 flex-1 flex-col`,children:[e?(0,J.jsx)(kq,{id:e}):t?(0,J.jsx)(Uq,{id:t}):(0,J.jsx)(qq,{}),a?(0,J.jsx)(yj,{column:o}):null]})]})]})}function gJ({place:e}){let t=cJ.find(t=>t.place===e)?.label??`work.chats`;return xY([{label:K(t)}]),(0,J.jsx)(SJ,{children:K(lJ[e])})}var _J=`flex items-center gap-2 rounded-xl border border-border px-4 py-3 text-[0.9375rem] text-ink hover:bg-ink/5`;function vJ(){xY([{label:K(`work.waiting`)}]);let e=Dm().data,t=km().mutate;(0,q.useEffect)(()=>{t()},[t]);let n=e?.approvals??[],r=e?.critical??[],i=e?.runs?.needs??[];return n.length||r.length||i.length?(0,J.jsxs)(`div`,{className:`mx-auto grid w-full max-w-2xl gap-8 py-8`,children:[i.length?(0,J.jsxs)(`section`,{className:`grid gap-2`,children:[(0,J.jsx)(`h2`,{className:`font-semibold text-[0.75rem] text-ink-3 uppercase tracking-wide`,children:K(`work.waiting.runs`)}),(0,J.jsx)(`ul`,{className:`grid gap-2`,children:i.map(e=>(0,J.jsx)(`li`,{children:(0,J.jsxs)(Ae,{to:eJ(e),className:_J,children:[(0,J.jsx)(pi,{className:`size-4 shrink-0 text-ember`}),(0,J.jsxs)(`span`,{className:`grid min-w-0 gap-0.5`,children:[(0,J.jsxs)(`span`,{className:`truncate`,children:[e.wizard,` · `,e.step]}),(0,J.jsx)(`span`,{className:`truncate text-[0.8125rem] text-ink-3`,children:tJ(e)})]})]})},e.runId))})]}):null,n.length?(0,J.jsxs)(`section`,{className:`grid gap-2`,children:[(0,J.jsx)(`h2`,{className:`font-semibold text-[0.75rem] text-ink-3 uppercase tracking-wide`,children:K(`work.waiting.calls`)}),(0,J.jsx)(`ul`,{className:`grid gap-2`,children:n.map(e=>(0,J.jsx)(`li`,{children:(0,J.jsxs)(Ae,{to:`/work/c/${e.chatId}`,className:_J,children:[(0,J.jsx)(so,{className:`size-4 shrink-0 text-ember`}),K(e.heldFor===`admins`?`work.approval.waitingAdmins`:`work.approval.waiting`,{name:e.toolName})]})},e.id))})]}):null,r.length?(0,J.jsxs)(`section`,{className:`grid gap-2`,children:[(0,J.jsx)(`h2`,{className:`font-semibold text-[0.75rem] text-ink-3 uppercase tracking-wide`,children:K(`work.waiting.critical`)}),(0,J.jsx)(`ul`,{className:`grid gap-2`,children:r.map(e=>(0,J.jsx)(`li`,{children:(0,J.jsx)(bJ,{line:e})},e.id))})]}):null]}):(0,J.jsx)(SJ,{children:K(`work.waitingEmpty`)})}function yJ(e){return e.chatId?`/work/c/${e.chatId}`:e.wizardId?`/edit/${e.wizardId}${e.runId?`?run=${e.runId}`:``}`:null}function bJ({line:e}){let t=yJ(e),n=(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(ao,{className:`size-4 shrink-0 text-ember`}),(0,J.jsxs)(`span`,{className:`grid min-w-0 gap-0.5`,children:[(0,J.jsxs)(`span`,{className:`truncate`,children:[K(`work.critical.${e.kind}`),` · `,e.connectionId,` · `,e.actionId]}),(0,J.jsxs)(`span`,{className:`truncate text-[0.8125rem] text-ink-3`,children:[new Date(e.at).toLocaleString(Rn,{dateStyle:`short`,timeStyle:`short`}),` · `,e.who.kind,e.reason?` · ${e.reason}`:``]})]})]});return t?(0,J.jsx)(Ae,{to:t,className:_J,children:n}):(0,J.jsx)(`div`,{className:_J,children:n})}function xJ(){let{runId:e}=Ue();return xY([{label:K(`work.waiting`)}]),e?(0,J.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:(0,J.jsx)(Dt,{runId:e,studio:!0,stickyProgress:!0},e)}):null}function SJ({children:e}){return(0,J.jsx)(`p`,{className:`py-24 text-center text-[0.9375rem] text-ink-3`,children:e})}var CJ=(0,q.lazy)(()=>Wn(()=>import(`./AboutDialog-CSbCideu.js`).then(e=>({default:e.AboutDialog})),__vite__mapDeps([30,1,18,3,14,7,19,28,27,31,22,4,32,33])));function wJ(e,t=!1){return W(`shrink-0 rounded-lg transition`,t?`flex h-10 w-full items-center gap-3 px-2.5 font-medium text-[0.875rem]`:`grid size-10 place-items-center`,e?`bg-paper text-ink shadow-soft dark:ring-1 dark:ring-border-soft`:`text-ink-3 hover:bg-ink/10 hover:text-ink`)}function TJ(e,t){let[n,r]=(0,q.useState)(null);return{over:n=>{if(!e)return;let i=n.target.closest(`a[aria-label], button[aria-label]`),a=i?.getAttribute(`aria-label`);if(!(i&&a)){r(null);return}let o=i.getBoundingClientRect();r(t===`left`?{label:a,x:o.right+8,y:o.top+o.height/2}:t===`right`?{label:a,x:o.left-8,y:o.top+o.height/2}:t===`top`?{label:a,x:o.left+o.width/2,y:o.bottom+8}:{label:a,x:o.left+o.width/2,y:o.top-8})},out:()=>r(null),element:n?(0,tu.createPortal)((0,J.jsx)(`span`,{role:`tooltip`,className:W(`pointer-events-none fixed z-[60] animate-in whitespace-nowrap rounded-md bg-ink px-2.5 py-1 font-medium text-[0.8125rem] text-paper shadow-soft fade-in-0`,t===`left`&&`-translate-y-1/2`,t===`right`&&`-translate-x-full -translate-y-1/2`,t===`top`&&`-translate-x-1/2`,t===`bottom`&&`-translate-x-1/2 -translate-y-full`),style:{left:n.x,top:n.y},children:n.label}),document.body):null}}function EJ({children:e}){return(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e})}function DJ({me:e,labels:t}){let{space:n}=Qn(),r=MY(e),i=r?e.tenant.name??void 0:void 0;return(0,J.jsxs)(NY,{me:e,placement:`bar-start`,label:n?.name??K(`nav.space`),className:e=>t?W(`flex w-full items-center gap-3 rounded-lg p-0.5 pr-2 text-left transition hover:bg-ink/10`,e&&`bg-ink/10`):W(`block rounded-lg transition`,e?`ring-2 ring-ink/80 ring-offset-2 ring-offset-sidebar`:`hover:shadow-soft`),children:[(0,J.jsx)(jY,{space:n,name:i}),t?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-semibold text-[0.875rem] text-ink`,children:i??n?.name??K(`nav.space`)}),r?null:(0,J.jsx)(Ur,{className:`size-4 shrink-0 text-ink-4`})]}):null]})}var OJ={left:Ta,top:ka,right:Da,bottom:xa},kJ=[{pick:`light`,icon:on,label:`appbar.light`},{pick:`branded`,icon:ya,label:`appbar.branded`},{pick:`dark`,icon:nn,label:`appbar.dark`},{pick:null,icon:_a,label:`appbar.system`}];function AJ({at:e,room:t,onClose:n}){let{position:r,labels:i}=Qo(),a=sn(),o=Uo,s=(0,q.useRef)(null);OY(s,!0,n);let[c,l]=(0,q.useState)({x:0,y:0});(0,q.useLayoutEffect)(()=>{let e=s.current?.getBoundingClientRect();e&&l({x:Math.min(0,window.innerWidth-8-e.right),y:Math.min(0,window.innerHeight-8-e.bottom)})},[]);let u=`flex w-full items-center gap-3 rounded-lg px-3 py-2 text-left text-[0.875rem] text-ink-2 hover:bg-accent hover:text-ink disabled:pointer-events-none disabled:opacity-50`,d=`px-3 pt-2 pb-1 font-medium text-[0.6875rem] text-ink-4 uppercase tracking-[0.07em]`;return(0,J.jsxs)(`div`,{ref:s,role:`menu`,className:`fixed z-[60] w-56 animate-rise rounded-xl bg-card p-1.5 shadow-overlay ring-1 ring-border-soft`,style:{left:Math.max(8,e.x+c.x),top:Math.max(8,e.y+c.y)},onContextMenu:e=>e.preventDefault(),children:[(0,J.jsx)(`div`,{className:d,children:K(`appbar.position`)}),o.map(e=>{let t=OJ[e];return(0,J.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":e===r,className:W(u,e===r&&`text-ink`),onClick:()=>{Xo({position:e}),n()},children:[(0,J.jsx)(t,{className:`size-4`}),(0,J.jsx)(`span`,{className:`flex-1`,children:K(`appbar.${e}`)}),e===r?(0,J.jsx)(ft,{className:`size-4 text-ember-strong`}):null]},e)}),(0,J.jsxs)(`button`,{type:`button`,role:`menuitemcheckbox`,"aria-checked":i,disabled:!(i||t),className:W(u,i&&`text-ink`),onClick:()=>{Xo({labels:!i}),n()},children:[(0,J.jsx)(Ca,{className:`size-4`}),(0,J.jsx)(`span`,{className:`flex-1`,children:K(`appbar.labels`)}),i?(0,J.jsx)(ft,{className:`size-4 text-ember-strong`}):null]}),(0,J.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`}),(0,J.jsx)(`div`,{className:d,children:K(`appbar.theme`)}),kJ.map(({pick:e,icon:t,label:r})=>(0,J.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":e===a,className:W(u,e===a&&`text-ink`),onClick:()=>{dn(e),n()},children:[(0,J.jsx)(t,{className:`size-4`}),(0,J.jsx)(`span`,{className:`flex-1`,children:K(r)}),e===a?(0,J.jsx)(ft,{className:`size-4 text-ember-strong`}):null]},r))]})}function jJ(){let{pathname:e}=Ge(),t=nt(`orgSpaces`);return e===`/new`?`new`:t&&e===`/`?`start`:e===`/`||e===`/wizards`||e.startsWith(`/edit/`)?`home`:e===`/skills`?`skills`:e===`/capabilities`||e.startsWith(`/capabilities/`)?`capabilities`:e===`/space/results`||e.startsWith(`/space/results/`)?`results`:e===`/settings`||e.startsWith(`/settings/`)?`settings`:e===`/space`||e.startsWith(`/space/`)?`space`:null}var MJ={chats:j,engenties:uJ,files:Ti,data:C,results:zi,waiting:B};function NJ({labels:e,horizontal:t,nav:n}){let r=Dm().data,i=(r?.approvals.length??0)+(r?.runs?.needs.length??0)+(r?.unseen??0),a=nt(`workWip`)?cJ:cJ.filter(e=>e.place===`chats`);return(0,J.jsxs)(`nav`,{className:W(`flex min-h-0 min-w-0 flex-1`,e?`items-stretch`:`items-center`,t?`ml-1.5 flex-row gap-1.5 overflow-x-auto`:`mt-2 flex-col gap-2`),children:[a.map(({place:t,to:n,label:r})=>{let a=MJ[t];return(0,J.jsxs)(Ae,{to:n,end:!0,"aria-label":K(r),className:({isActive:t})=>W(wJ(t,e),`relative`),children:[(0,J.jsx)(a,{className:`size-5 shrink-0`}),e?(0,J.jsx)(EJ,{children:K(r)}):null,t===`waiting`&&i>0?(0,J.jsx)(`span`,{className:`absolute top-0.5 left-6 grid h-4 min-w-4 place-items-center rounded-full bg-ember px-1 font-bold text-[0.625rem] text-white`,children:i}):null]},t)}),n.map(t=>(0,J.jsx)(kX,{of:t,children:(0,J.jsxs)(Ae,{to:t.to,"aria-label":t.label(),className:({isActive:t})=>wJ(t,e),children:[(0,J.jsx)(t.icon,{className:`size-5 shrink-0`}),e?(0,J.jsx)(EJ,{children:t.label()}):null]})},t.serial))]})}function PJ({me:e,labels:t,room:n}){let r=aX(),i=nt(`skills`),a=nt(`capabilities`),o=nt(`orgSpaces`),{position:s}=Qo(),c=$o(s),l=TJ(!t,s),u=jJ(),d=Gl(e),f=Kl(r.nav,d,Rl(e)),[p,m]=(0,q.useState)(null),h=e=>{e.preventDefault(),m({x:e.clientX,y:e.clientY})},g=(0,q.useRef)(null),_=(0,q.useRef)(!1),v=()=>{g.current&&=(window.clearTimeout(g.current.timer),null)};return(0,J.jsxs)(`aside`,{"aria-label":pn.name,onContextMenu:h,onPointerDown:e=>{if(e.pointerType===`mouse`)return;v();let{clientX:t,clientY:n}=e;g.current={x:t,y:n,timer:window.setTimeout(()=>{g.current=null,_.current=!0,window.setTimeout(()=>{_.current=!1},700),m({x:t,y:n})},500)}},onPointerMove:e=>{g.current&&Math.hypot(e.clientX-g.current.x,e.clientY-g.current.y)>10&&v()},onPointerUp:v,onPointerCancel:v,onPointerLeave:v,onClickCapture:e=>{_.current&&(_.current=!1,e.preventDefault(),e.stopPropagation())},onMouseOver:l.over,onFocus:l.over,onMouseLeave:l.out,onBlur:l.out,onClick:l.out,className:W(`flex shrink-0 select-none bg-sidebar [-webkit-touch-callout:none]`,c?`w-full flex-row items-center gap-1.5 px-2`:W(`h-full flex-col pt-2 pb-3 transition-[width] duration-200 ease-out`,t?`w-56 items-stretch px-2.5`:`w-16 items-center`),s===`bottom`&&`pt-1.5 pb-[calc(0.375rem+env(safe-area-inset-bottom))]`,s===`top`&&`pt-[calc(0.375rem+env(safe-area-inset-top))] pb-1.5`),children:[(0,J.jsx)(gu,{me:e,position:s,horizontal:c,labels:t}),o?null:(0,J.jsx)(`div`,{className:c?`ml-1`:`mt-1`,children:(0,J.jsx)(DJ,{me:e,labels:t})}),(0,J.jsx)(au,{me:e,look:c?`row`:t?`named`:`stacked`,className:c?`ml-1`:`mt-2`}),d===`work`?(0,J.jsx)(NJ,{labels:t,horizontal:c,nav:f}):d===`shared`?(0,J.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1`}):(0,J.jsxs)(J.Fragment,{children:[o?(0,J.jsxs)(ue,{to:`/`,"aria-label":K(`start.title`),"aria-current":u===`start`?`page`:void 0,className:W(wJ(u===`start`,t),c?`ml-1.5`:`mt-2`),children:[(0,J.jsx)(Fi,{className:`size-5 shrink-0`}),t?(0,J.jsx)(EJ,{children:K(`start.title`)}):null]}):null,(0,J.jsxs)(ue,{to:o?`/wizards`:`/`,"aria-label":K(o?`nav.wizards`:`nav.home`),"aria-current":u===`home`||u===`new`?`page`:void 0,className:W(wJ(u===`home`||u===`new`,t),c?`ml-1.5`:`mt-2`),children:[o?(0,J.jsx)(E,{className:`size-5 shrink-0`}):(0,J.jsx)(Fi,{className:`size-5 shrink-0`}),t?(0,J.jsx)(EJ,{children:K(o?`nav.wizards`:`nav.home`)}):null]}),(0,J.jsxs)(ue,{to:`/space`,"aria-label":K(`nav.sources`),"aria-current":u===`space`?`page`:void 0,className:W(wJ(u===`space`,t),c?`ml-1.5`:`mt-2`),children:[(0,J.jsx)(qi,{className:`size-5 shrink-0`}),t?(0,J.jsx)(EJ,{children:K(`nav.sources`)}):null]}),a?(0,J.jsxs)(ue,{to:`/capabilities`,"aria-label":K(`nav.capabilities`),"aria-current":u===`capabilities`?`page`:void 0,className:W(wJ(u===`capabilities`,t),c?`ml-1.5`:`mt-2`),children:[(0,J.jsx)(Ao,{className:`size-5 shrink-0`}),t?(0,J.jsx)(EJ,{children:K(`nav.capabilities`)}):null]}):i?(0,J.jsxs)(ue,{to:`/skills`,"aria-label":K(`space.skills`),"aria-current":u===`skills`?`page`:void 0,className:W(wJ(u===`skills`,t),c?`ml-1.5`:`mt-2`),children:[(0,J.jsx)(_t,{className:`size-5 shrink-0`}),t?(0,J.jsx)(EJ,{children:K(`space.skills`)}):null]}):null,(0,J.jsxs)(ue,{to:`/space/results`,"aria-label":K(`space.results`),"aria-current":u===`results`?`page`:void 0,className:W(wJ(u===`results`,t),c?`ml-1.5`:`mt-2`),children:[(0,J.jsx)(zi,{className:`size-5 shrink-0`}),t?(0,J.jsx)(EJ,{children:K(`space.results`)}):null]}),f.length?(0,J.jsx)(`div`,{className:W(`shrink-0 bg-border`,c?`mx-2 h-7 w-px`:W(`my-3 h-px`,t?`mx-2.5`:`w-7`))}):null,(0,J.jsx)(`nav`,{className:W(`flex min-h-0 min-w-0 flex-1 gap-1.5`,t?`items-stretch`:`items-center`,c?`flex-row overflow-x-auto`:`flex-col overflow-y-auto`),children:f.map(e=>(0,J.jsx)(kX,{of:e,children:(0,J.jsxs)(Ae,{to:e.to,"aria-label":e.label(),className:({isActive:e})=>wJ(e,t),children:[(0,J.jsx)(e.icon,{className:`size-5 shrink-0`}),t?(0,J.jsx)(EJ,{children:e.label()}):null]})},e.serial))})]}),(0,J.jsxs)(`div`,{className:W(`flex shrink-0 gap-2`,c?`flex-row pl-3`:`flex-col pt-3`,t?`items-stretch`:`items-center`),children:[(0,J.jsxs)(Ae,{to:`/settings`,"aria-label":K(`nav.settings`),className:({isActive:e})=>wJ(e,t),children:[(0,J.jsx)(to,{className:`size-5 shrink-0`}),t?(0,J.jsx)(EJ,{children:K(`nav.settings`)}):null]}),(0,J.jsx)(LY,{me:e,placement:`bar-end`,named:t})]}),p?(0,J.jsx)(AJ,{at:p,room:n,onClose:()=>m(null)}):null,l.element]})}function FJ(e){return W(`glass-press relative grid h-12 w-16 place-items-center rounded-full transition-colors`,e?`text-ink`:`text-ink-3`)}var IJ=68;function LJ({index:e}){let t=(0,q.useRef)(null),n=(0,q.useRef)(e);return(0,q.useEffect)(()=>{let r=n.current;n.current=e;let i=t.current;if(!i||r===null||e===null||r===e||matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let a=r*IJ,o=e*IJ;i.animate([{transform:`translateX(${a}px)`},{transform:`translateX(${(a+o)/2}px) scaleX(1.35) scaleY(0.92)`,offset:.45},{transform:`translateX(${o}px)`}],{duration:420,easing:`cubic-bezier(0.34, 1.3, 0.64, 1)`})},[e]),(0,J.jsx)(`span`,{ref:t,"aria-hidden":`true`,className:`pointer-events-none absolute top-1 left-1 h-12 w-16 rounded-full bg-ink/12 transition-opacity`,style:{transform:`translateX(${(e??0)*IJ}px)`,opacity:e===null?0:1}})}function RJ({me:e}){let t=Kl(aX().nav,Gl(e),Rl(e)),n=nt(`skills`),r=nt(`capabilities`),i=jJ(),[a,o]=(0,q.useState)(!1),[s,c]=(0,q.useState)(!1),l=te(),u=(0,q.useRef)(null),d=Su(),f=Jn(),{space:p}=Qn(),m=d??(f&&!p?.readOnly&&i!==`new`?{icon:ot,label:K(`home.new`),run:()=>l(`/new`)}:null);OY(u,a,()=>o(!1));let{pathname:h}=Ge();(0,q.useEffect)(()=>o(!1),[h]);let g=e=>!a&&i===e,_=a?2:i===`start`||i===`home`||i===`new`?0:i===`space`?1:i===`skills`||i===`capabilities`||i===`results`||i===`settings`?2:null,v=e=>{o(!1),l(e)},y=e=>W(`flex w-full items-center gap-3 rounded-lg px-3 py-2.5 text-left text-[0.9375rem] transition`,e?`bg-accent text-ink`:`text-ink-2 hover:bg-accent hover:text-ink`);return(0,J.jsxs)(`div`,{className:`fixed inset-x-0 bottom-[calc(0.5rem+env(safe-area-inset-bottom))] z-40 flex select-none justify-center gap-2.5 [-webkit-touch-callout:none]`,children:[(0,J.jsxs)(`nav`,{ref:u,"aria-label":pn.name,className:`liquid-glass relative flex gap-1 rounded-full p-1`,children:[(0,J.jsx)(LJ,{index:_}),(0,J.jsx)(ue,{to:`/`,"aria-label":K(`nav.home`),"aria-current":i===`home`||i===`start`?`page`:void 0,onClick:()=>o(!1),className:FJ(g(`home`)||g(`start`)),children:(0,J.jsx)(Fi,{className:`size-[1.375rem]`})}),(0,J.jsx)(ue,{to:`/space`,"aria-label":K(`nav.sources`),"aria-current":i===`space`?`page`:void 0,onClick:()=>o(!1),className:FJ(g(`space`)),children:(0,J.jsx)(qi,{className:`size-[1.375rem]`})}),(0,J.jsx)(`button`,{type:`button`,"aria-label":K(`nav.more`),"aria-expanded":a,"aria-haspopup":`menu`,onClick:()=>o(e=>!e),className:FJ(a||i===`skills`||i===`capabilities`||i===`results`||i===`settings`),children:(0,J.jsx)(gt,{className:`size-[1.375rem]`})}),a?(0,J.jsxs)(`div`,{role:`menu`,className:`absolute right-0 bottom-full mb-3 flex w-60 animate-rise flex-col rounded-2xl bg-card p-1.5 shadow-overlay ring-1 ring-border-soft`,children:[r?(0,J.jsxs)(`button`,{type:`button`,role:`menuitem`,className:y(i===`capabilities`),onClick:()=>v(`/capabilities`),children:[(0,J.jsx)(Ao,{className:`size-[1.125rem] shrink-0 text-ink-3`}),(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:K(`nav.capabilities`)})]}):n?(0,J.jsxs)(`button`,{type:`button`,role:`menuitem`,className:y(i===`skills`),onClick:()=>v(`/skills`),children:[(0,J.jsx)(_t,{className:`size-[1.125rem] shrink-0 text-ink-3`}),(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:K(`space.skills`)})]}):null,(0,J.jsxs)(`button`,{type:`button`,role:`menuitem`,className:y(i===`results`),onClick:()=>v(`/space/results`),children:[(0,J.jsx)(zi,{className:`size-[1.125rem] shrink-0 text-ink-3`}),(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:K(`space.results`)})]}),(0,J.jsxs)(`button`,{type:`button`,role:`menuitem`,className:y(i===`settings`),onClick:()=>v(`/settings`),children:[(0,J.jsx)(to,{className:`size-[1.125rem] shrink-0 text-ink-3`}),(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:K(`nav.settings`)})]}),t.map(e=>(0,J.jsx)(kX,{of:e,children:(0,J.jsxs)(`button`,{type:`button`,role:`menuitem`,className:y(!1),onClick:()=>v(e.to),children:[(0,J.jsx)(e.icon,{className:`size-[1.125rem] shrink-0 text-ink-3`}),(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label()})]})},e.serial)),(0,J.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`}),(0,J.jsxs)(`button`,{type:`button`,role:`menuitem`,className:y(!1),onClick:()=>{o(!1),c(!0)},children:[(0,J.jsx)(Vi,{className:`size-[1.125rem] shrink-0 text-ink-3`}),(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:K(`about.nav`)})]})]}):null,s?(0,J.jsx)(q.Suspense,{fallback:null,children:(0,J.jsx)(CJ,{open:!0,me:e,onClose:()=>c(!1)})}):null]}),m?(0,J.jsx)(`button`,{type:`button`,"aria-label":m.label,title:m.label,onClick:m.run,className:`liquid-glass glass-press relative grid size-14 shrink-0 place-items-center rounded-full text-ink`,children:(0,J.jsx)(m.icon,{className:`size-6`})}):null]})}var zJ=[`schedule`,`webhook`,`record`,`wizard`],BJ=[`hour`,`day`,`week`,`month`],VJ=[`added`,`changed`,`became`],HJ=[`skip`,`allow`],UJ=[60,1440,10080],WJ=1440,GJ=/^([01]\d|2[0-3]):[0-5]\d$/;function KJ(e){try{return new Intl.DateTimeFormat(`en-US`,{timeZone:e}),!0}catch{return!1}}var qJ=_n({every:kn(BJ),weekday:wn().int().min(0).max(6).optional(),day:wn().int().min(1).max(28).optional(),time:Hn().regex(GJ),tz:Hn().min(1).refine(KJ,{message:`Unknown time zone.`}),overlap:kn(HJ).default(`skip`),maxLateMinutes:wn().int().min(5).max(44640).default(WJ)}).refine(e=>e.every!==`week`||e.weekday!==void 0,{message:`A weekly schedule names its weekday.`}).refine(e=>e.every!==`month`||e.day!==void 0,{message:`A monthly schedule names its day.`}),JJ=zn([_n({from:Hn().min(1)}).strict(),Vn()]),YJ=e=>e[e.kind]!==void 0,XJ={message:`A start carries the settings of its kind.`},ZJ=_n({id:Hn().min(1),kind:kn(zJ),on:yn().default(!0),schedule:qJ.optional(),webhook:_n({tokenHash:Hn().min(1)}).optional(),record:_n({source:Hn().min(1),event:kn(VJ),column:Hn().optional(),value:Vn().optional()}).refine(e=>e.event!==`became`||e.column&&e.value!==void 0,{message:`A 'became' start names the column and the value.`}).optional(),wizard:_n({id:Hn().min(1)}).optional(),answers:In(Hn(),JJ).default({}),allowChanges:yn().default(!1),passReviews:yn().default(!0),owner:Hn().optional(),handledUntil:Hn().optional(),lastRunAt:Hn().optional(),lastSkip:_n({at:Hn(),why:kn([`overlap`,`late`])}).optional(),failures:wn().int().min(0).default(0),pausedReason:Hn().optional()}),QJ=ZJ.refine(YJ,XJ);ZJ.partial({id:!0}).refine(YJ,XJ),An(QJ).max(20);var $J=new Map;function eY(e){let t=$J.get(e);return t||(t=new Intl.DateTimeFormat(`en-US`,{timeZone:e,hourCycle:`h23`,year:`numeric`,month:`numeric`,day:`numeric`,hour:`numeric`,minute:`numeric`,weekday:`short`}),$J.set(e,t)),t}var tY=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`];function nY(e,t){let n={};for(let r of eY(t).formatToParts(e))n[r.type]=r.value;return{y:Number(n.year),m:Number(n.month),d:Number(n.day),h:Number(n.hour),min:Number(n.minute),weekday:tY.indexOf(n.weekday??`Sun`)}}function rY(e,t,n,r,i,a){let o=Date.UTC(e,t-1,n,r,i),s=o;for(let e=0;e<2;e++){let e=nY(new Date(s),a),t=Date.UTC(e.y,e.m-1,e.d,e.h,e.min);if(t===o)break;s+=o-t}return new Date(s)}var iY=36e5,aY=62;function*oY(e,t,n){let[r,i]=e.time.split(`:`).map(Number),a=nY(t,e.tz);for(let t=0;t<=aY;t++){let o=new Date(Date.UTC(a.y,a.m-1,a.d+t*n));(e.every===`day`||e.every===`week`&&o.getUTCDay()===e.weekday||e.every===`month`&&o.getUTCDate()===e.day)&&(yield rY(o.getUTCFullYear(),o.getUTCMonth()+1,o.getUTCDate(),r,i,e.tz))}}function sY(e,t){if(e.every===`hour`)return new Date((Math.floor(t.getTime()/iY)+1)*iY);for(let n of oY(e,t,1))if(n.getTime()>t.getTime())return n;return null}var cY={en:{hour:`Every hour`,day:`Every day at {time}`,week:`Every {weekday} at {time}`,month:`On the {day} of each month at {time}`,webhook:`When something arrives at the address`,added:`When a row is added to {source}`,became:`When {column} in {source} becomes “{value}”`,changed:`When a row in {source} changes`,wizard:`When {wizard} finishes`,sunday:`Sunday`,monday:`Monday`,tuesday:`Tuesday`,wednesday:`Wednesday`,thursday:`Thursday`,friday:`Friday`,saturday:`Saturday`},de:{hour:`Jede Stunde`,day:`Jeden Tag um {time}`,week:`Jeden {weekday} um {time}`,month:`Am {day}. jedes Monats um {time}`,webhook:`Wenn etwas an der Adresse eintrifft`,added:`Wenn eine Zeile zu {source} kommt`,became:`Wenn in {source} „{column}“ zu „{value}“ wird`,changed:`Wenn sich eine Zeile in {source} ändert`,wizard:`Wenn {wizard} fertig ist`,sunday:`Sonntag`,monday:`Montag`,tuesday:`Dienstag`,wednesday:`Mittwoch`,thursday:`Donnerstag`,friday:`Freitag`,saturday:`Samstag`}},lY=[`sunday`,`monday`,`tuesday`,`wednesday`,`thursday`,`friday`,`saturday`];function uY(e,t){if(t===`de`)return String(e);let n=e%10;return`${e}${e%100>=11&&e%100<=13?`th`:n===1?`st`:n===2?`nd`:n===3?`rd`:`th`}`}function dY(e,t,n={}){let r=(e,n)=>Fn(cY,e,t,n);switch(e.kind){case`schedule`:{let n=e.schedule;return n?r(n.every,{time:n.time,weekday:r(lY[n.weekday??0]??`sunday`),day:uY(n.day??1,t)}):``}case`webhook`:return r(`webhook`);case`record`:{let t=e.record,i=n.source??t?.source??``;return t?.event===`added`?r(`added`,{source:i}):t?.event===`became`?r(`became`,{source:i,column:t.column,value:String(t.value)}):r(`changed`,{source:i})}case`wizard`:return r(`wizard`,{wizard:n.wizard??e.wizard?.id??``})}}var fY={needs_you:{Icon:Po,tone:`bg-amber-tint text-amber`},reminder:{Icon:Po,tone:`bg-amber-tint text-amber`},done:{Icon:ft,tone:`bg-moss-tint text-moss`},failed:{Icon:Gr,tone:`bg-rose-tint text-rose`},paused:{Icon:qr,tone:`bg-rose-tint text-rose`}};function pY(){let e=De(),[t,n]=(0,q.useState)(!1),r=(0,q.useRef)(null);OY(r,t,()=>n(!1));let i=D({queryKey:[`notices`],queryFn:()=>a.get(`/api/studio/notices`),refetchInterval:3e4}),o=rt({mutationFn:e=>a.post(`/api/studio/notices/read`,{ids:e}),onSuccess:()=>e.invalidateQueries({queryKey:[`notices`]})}),s=i.data??[],c=s.filter(e=>!e.read).length;if(!s.length)return null;let l=new Intl.DateTimeFormat(Rn,{dateStyle:`short`,timeStyle:`short`});return(0,J.jsxs)(`div`,{ref:r,className:`relative shrink-0`,children:[(0,J.jsxs)(`button`,{type:`button`,"aria-label":K(`notices.title`),"aria-expanded":t,"aria-haspopup":`dialog`,onClick:()=>n(e=>!e),className:W(`relative flex size-8 items-center justify-center rounded-full text-ink-2 transition hover:bg-accent hover:text-ink`,t&&`bg-accent text-ink`),children:[(0,J.jsx)(B,{className:`size-[1.125rem]`}),c?(0,J.jsx)(`span`,{className:`absolute top-1 right-1 size-2 rounded-full bg-ember ring-2 ring-paper`}):null]}),t?(0,J.jsxs)(`div`,{role:`dialog`,"aria-label":K(`notices.title`),className:`absolute top-full right-0 z-20 mt-1.5 flex w-[min(24rem,calc(100vw-1.5rem))] origin-top-right animate-unfold flex-col overflow-hidden rounded-xl bg-card shadow-overlay ring-1 ring-border`,children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between px-3.5 pt-3 pb-2`,children:[(0,J.jsx)(`span`,{className:`font-medium text-[0.875rem]`,children:K(`notices.title`)}),c?(0,J.jsx)(`button`,{type:`button`,onClick:()=>o.mutate(`all`),className:`text-[0.8125rem] text-ink-3 hover:text-ink`,children:K(`notices.allRead`)}):null]}),(0,J.jsx)(`ul`,{className:`flex max-h-[60vh] flex-col divide-y divide-border-soft overflow-y-auto`,children:s.map(e=>{let{Icon:t,tone:r}=fY[e.kind],i=e.kind===`paused`?K(`notices.pausedHint`):[e.start?dY(e.start,Rn):null,e.detail].filter(Boolean).join(` · `);return(0,J.jsxs)(`li`,{className:W(`flex items-start gap-3 px-3.5 py-3`,!e.read&&`bg-paper-2/60`),children:[(0,J.jsx)(`span`,{className:W(`mt-0.5 flex size-7 shrink-0 items-center justify-center rounded-lg`,r),children:(0,J.jsx)(t,{className:`size-3.5`})}),(0,J.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,J.jsx)(`div`,{className:`text-[0.875rem]`,children:K(`notices.${e.kind}`,{wizard:e.wizard.title})}),i?(0,J.jsx)(`div`,{className:`mt-0.5 text-[0.8125rem] text-ink-3 leading-snug`,children:i}):null,(0,J.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-3 text-[0.8125rem]`,children:[(0,J.jsx)(ue,{to:`/edit/${e.wizard.id}${e.runId?`?run=${e.runId}`:``}`,onClick:()=>{n(!1),e.read||o.mutate([e.id])},className:`font-medium text-cobalt hover:underline`,children:K(`notices.open`)}),(0,J.jsx)(`span`,{className:`text-ink-4`,children:l.format(new Date(e.at))})]})]})]},e.id)})})]}):null]})}var mY=(0,q.lazy)(()=>Wn(()=>import(`./ChangelogDialog-BG3enhF_.js`).then(e=>({default:e.ChangelogDialog})),__vite__mapDeps([33,1,3,14,18,7,19]))),hY=`wizards.update-banner`;function gY(){try{return localStorage.getItem(hY)}catch{return null}}function _Y(){let[e,t]=(0,q.useState)(gY),[n,r]=(0,q.useState)(!1),{data:i,latest:a,apply:o,busy:s,progress:c}=nr(),l=i&&!i.newer?i.updated?.to??null:null,u=l??(i?.newer?a:null);if(!(i&&u)||e===u&&i.applying===`idle`)return null;let d=()=>{try{localStorage.setItem(hY,u)}catch{}t(u)},f=c??(l?K(`about.update.updated`,{v:u}):i.pending?.version===u?K(`about.update.ready`,{v:u}):K(`about.update.available`,{v:u}));return(0,J.jsxs)(`div`,{className:`flex items-center gap-3 border-border-soft border-b bg-ember-tint px-4 py-2 text-[0.8125rem] text-ink-2 sm:px-6`,children:[s?(0,J.jsx)(de,{className:`size-4 shrink-0 text-ember-strong`}):(0,J.jsx)(I,{className:`size-4 shrink-0 text-ember-strong`}),(0,J.jsx)(`p`,{className:`min-w-0 flex-1`,children:f}),s?null:(0,J.jsx)(`button`,{type:`button`,onClick:()=>r(!0),className:`shrink-0 underline transition hover:text-ink`,children:K(`about.update.notes`)}),n?(0,J.jsx)(q.Suspense,{fallback:null,children:(0,J.jsx)(mY,{open:!0,version:u,onClose:()=>r(!1)})}):null,i.canApply&&!l&&(i.applying===`idle`||i.applying===`failed`)?(0,J.jsx)(z,{size:`sm`,disabled:o.isPending,onClick:()=>o.mutate(),children:K(`about.update.install`)}):null,s?null:(0,J.jsx)(Re,{label:K(`install.app.close`),onClick:d,className:`size-8`,children:(0,J.jsx)(ct,{className:`size-4`})})]})}var vY=[],yY=new Set;function bY(e){vY=e;for(let e of yY)e()}function xY(e){let t=JSON.stringify(e);(0,q.useEffect)(()=>(bY(JSON.parse(t)),()=>bY([])),[t])}function SY(){return vY}function CY(){return(0,q.useSyncExternalStore)(e=>(yY.add(e),()=>yY.delete(e)),()=>vY)}function wY({alone:e=!1}){let t=CY();return t.length?(0,J.jsx)(`nav`,{"aria-label":K(`nav.breadcrumb`),className:`flex min-w-0 items-center text-[0.9375rem] max-sm:hidden`,children:t.map((n,r)=>(0,J.jsxs)(q.Fragment,{children:[e&&r===0?null:(0,J.jsx)(`span`,{className:W(`mr-2 text-ink-4`,r===0?`-ml-1 sm:-ml-2`:`ml-2`),children:`/`}),n.to&&r<t.length-1?(0,J.jsx)(ue,{to:n.to,className:`truncate text-ink-3 transition hover:text-ink`,children:n.label}):(0,J.jsx)(`span`,{"aria-current":`page`,className:`truncate font-medium text-ink`,children:n.label})]},`${r}:${n.label}`))}):null}var TY=e=>e.manageUrl??e.account?.url??null;function EY(e){let t=TY(e);return t?`${t}/billing`:null}function DY(e,t){return e.mode===`local`?e.account?e.account.signedIn?`linked`:`expired`:t?`alone`:null:null}function OY(e,t,n){let r=(0,q.useRef)(n);r.current=n,(0,q.useEffect)(()=>{if(!t)return;let n=t=>{e.current?.contains(t.target)||r.current()},i=e=>{e.key===`Escape`&&r.current()};return document.addEventListener(`pointerdown`,n),document.addEventListener(`keydown`,i),()=>{document.removeEventListener(`pointerdown`,n),document.removeEventListener(`keydown`,i)}},[e,t])}function kY(e,t,n){return e===`below`?n:ts(t,e===`bar-start`?`start`:`end`)}var AY=e=>`oklch(from ${e} calc(0.16 + 0.83 * clamp(0, (0.65 - l) * 1000, 1)) 0.01 h)`;function jY({space:e,name:t,size:n=`md`}){let r=e?.brand.colors?.[0]?.value,i=Yn(t??e?.name??``),a=(0,J.jsx)(`span`,{className:W(`grid shrink-0 place-items-center font-semibold tracking-wide`,n===`md`?`size-10 rounded-lg text-[0.8125rem]`:n===`sm`?`size-9 rounded-lg text-[0.75rem]`:`size-6 rounded-md text-[0.5625rem]`,r?null:`bg-paper-3 text-ink ring-1 ring-border`),style:r?{background:r,color:AY(r)}:void 0,children:i||(0,J.jsx)(Ti,{className:`size-4`})});return e?.origin===`local`?(0,J.jsxs)(`span`,{className:`relative shrink-0`,title:K(`readonly.space`),children:[a,(0,J.jsx)(`span`,{className:`-right-1 -bottom-1 absolute grid size-4 place-items-center rounded-full bg-amber ring-2 ring-paper`,children:(0,J.jsx)(Gi,{className:`size-2.5 text-paper`})})]}):a}function MY(e){let{spaces:t}=Qn();return e.mode===`managed`&&!!e.tenant.name&&e.limits.spaces===1&&t.length<=1}function NY({me:e,placement:t,label:n,className:r,children:i}){let a=te(),{position:o,phone:s}=Qo(),{space:c,spaces:l,select:u}=Qn(),f=MY(e),p=uu(e),m=Jn(),[h,g]=(0,q.useState)(!1),[_,v]=(0,q.useState)(!1),[y,b]=(0,q.useState)(!1),[x,S]=(0,q.useState)(!1),C=cu(e),[w,T]=(0,q.useState)({top:0,left:0}),D=(0,q.useRef)(null);OY(D,h,()=>g(!1));let O=e.limits.spaces,k=O!==null&&l.length>=O,A=`flex w-full items-center gap-3 rounded-lg px-3 py-2 text-left text-[0.875rem] text-ink-2 transition hover:bg-accent hover:text-ink`;return(0,J.jsx)(`div`,{className:`shrink-0`,ref:D,children:(0,J.jsxs)(`div`,{className:`relative`,children:[(0,J.jsx)(`button`,{type:`button`,onClick:e=>{let t=e.currentTarget.getBoundingClientRect();T({top:t.bottom+6,left:t.left}),g(e=>!e)},"aria-expanded":h,"aria-haspopup":`menu`,"aria-label":n,title:f?void 0:K(`nav.switchSpace`),className:typeof r==`function`?r(h):r,children:i}),h?(0,J.jsxs)(`div`,{role:`menu`,style:t===`below`?{position:`fixed`,...w}:void 0,className:W(`z-50 w-72 animate-rise rounded-xl bg-card p-1.5 shadow-overlay ring-1 ring-border-soft`,t===`below`?null:W(`absolute`,kY(t,o,`top-10 left-0`))),children:[f&&ou(e)&&!s?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`div`,{className:`px-2 pt-1.5 pb-1 text-[0.75rem] text-ink-3`,children:K(`organizations.mine`)}),(0,J.jsx)(du,{me:e,onDone:()=>g(!1)}),(0,J.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`})]}):null,f&&!(ou(e)&&s)?null:C&&ou(e)?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`button`,{type:`button`,role:`menuitem`,className:`flex w-full items-center gap-3 rounded-lg px-2 py-1.5 text-left transition hover:bg-accent`,onClick:()=>{g(!1),S(!0)},children:[(0,J.jsx)(lu,{org:C,size:`xs`}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col leading-tight`,children:[(0,J.jsx)(`span`,{className:`truncate font-semibold text-[0.875rem] text-ink`,children:C.name}),C.plan?(0,J.jsx)(`span`,{className:`truncate text-[0.75rem] text-ink-4`,children:C.plan.name}):null]}),(0,J.jsx)(`span`,{className:`shrink-0 text-[0.8125rem] text-ink-3`,children:K(`organizations.switchShort`)}),(0,J.jsx)(Le,{className:`size-4 shrink-0 text-ink-4`})]}),(0,J.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`})]}):e.tenant.name?(0,J.jsx)(`div`,{className:`truncate px-2 pt-1.5 pb-1 text-[0.75rem] text-ink-3`,children:e.tenant.name}):null,(f?[]:l).map(e=>{let t=e.id===c?.id;return(0,J.jsxs)(`button`,{type:`button`,role:`menuitem`,className:`flex w-full items-center gap-3 rounded-lg px-2 py-1.5 text-left transition hover:bg-accent`,onClick:()=>{g(!1),t?a(`/`):u(e.id)},children:[(0,J.jsx)(jY,{space:e,size:`sm`}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col leading-tight`,children:[(0,J.jsx)(`span`,{className:W(`truncate text-[0.875rem]`,t?`font-semibold text-ink`:`font-medium text-ink-2`),children:e.name}),(0,J.jsx)(`span`,{className:`truncate text-[0.75rem] text-ink-4`,children:K(`nav.wizardCount`,{n:e.wizardCount})})]}),t?(0,J.jsx)(ft,{className:`size-4 shrink-0 text-ember-strong`}):null]},e.id)}),f?null:(0,J.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`}),[{to:`/`,icon:E,label:K(f?`nav.allWizards`:`nav.wizardsInSpace`),show:!0},{to:`/new`,icon:ot,label:K(`nav.addWizard`),show:m}].filter(e=>e.show).map(e=>(0,J.jsxs)(`button`,{type:`button`,role:`menuitem`,className:A,onClick:()=>{g(!1),a(e.to)},children:[(0,J.jsx)(e.icon,{className:`size-4 shrink-0 text-ink-3`}),(0,J.jsx)(`span`,{className:`truncate`,children:e.label})]},e.to)),f&&!ou(e)?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`}),(0,J.jsxs)(`button`,{type:`button`,role:`menuitem`,className:A,onClick:()=>{g(!1),p()},children:[(0,J.jsx)(to,{className:`size-4 shrink-0 text-ink-3`}),(0,J.jsx)(`span`,{className:`truncate`,children:K(`organizations.manage`)})]})]}):null,c&&!c.readOnly&&!f?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`}),(0,J.jsxs)(`button`,{type:`button`,role:`menuitem`,className:A,onClick:()=>{g(!1),b(!0)},children:[(0,J.jsx)(d,{className:`size-4 shrink-0 text-ink-3`}),(0,J.jsx)(`span`,{className:`truncate`,children:K(`nav.renameSpace`)})]})]}):null,m&&!k?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`}),(0,J.jsxs)(`button`,{type:`button`,role:`menuitem`,className:A,onClick:()=>{g(!1),v(!0)},children:[(0,J.jsx)(ot,{className:`size-4 shrink-0 text-ink-3`}),(0,J.jsx)(`span`,{className:`flex min-w-0 flex-1 flex-col leading-tight`,children:(0,J.jsx)(`span`,{className:`truncate`,children:K(`nav.addSpace`)})})]})]}):null]}):null,(0,J.jsx)(LU,{open:_,onClose:()=>v(!1)}),ou(e)?(0,J.jsx)(pu,{me:e,open:x,onClose:()=>S(!1)}):null,c?(0,J.jsx)(PY,{space:c,open:y,onClose:()=>b(!1)}):null]})})}function PY({space:e,open:t,onClose:n}){let r=De(),[i,o]=(0,q.useState)(e.name);(0,q.useEffect)(()=>{t&&o(e.name)},[t,e.name]);let s=rt({mutationFn:()=>a.patch(`/api/studio/spaces/${e.id}`,{name:i.trim()}),onSuccess:async()=>{await r.invalidateQueries({queryKey:F.spaces()}),n()}});return(0,J.jsx)(H,{open:t,onClose:n,title:K(`nav.renameSpace`),children:(0,J.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),i.trim()&&s.mutate()},children:[(0,J.jsx)(ie,{autoFocus:!0,maxLength:80,"aria-label":K(`nav.renameSpace`),value:i,onChange:e=>o(e.target.value)}),(0,J.jsxs)(`div`,{className:`mt-5 flex justify-end gap-2`,children:[(0,J.jsx)(z,{variant:`ghost`,onClick:n,children:K(`common.cancel`)}),(0,J.jsx)(z,{type:`submit`,busy:s.isPending,disabled:!i.trim(),children:K(`settings.save`)})]})]})})}function FY({me:e,space:t}){let n=e.mode===`local`||t.origin===`local`,r=n?Gi:ti,i=K(n?`nav.spaceLocal`:`nav.spaceCloud`);return(0,J.jsx)(`span`,{title:i,className:`grid size-6 shrink-0 place-items-center text-ink-4`,children:(0,J.jsx)(r,{className:`size-3.5`,"aria-label":i})})}function IY({me:e}){let{space:t}=Qn(),{phone:n}=Qo(),r=MY(e);return t?r&&e.tenant.name?(0,J.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[(0,J.jsxs)(NY,{me:e,placement:`below`,label:e.tenant.name,className:e=>W(n?`-ml-1 flex max-w-[16rem] items-center gap-2.5 rounded-xl py-1 pr-2 pl-1`:`-mx-1 flex max-w-[16rem] items-center gap-1 rounded-md px-2 py-0.5`,`text-left font-medium text-[0.9375rem] text-ink transition hover:bg-accent`,e&&`bg-accent`),children:[n?(0,J.jsx)(jY,{space:t,name:e.tenant.name,size:`sm`}):null,(0,J.jsx)(`span`,{className:`truncate`,children:e.tenant.name}),(0,J.jsx)(Ur,{className:`size-3.5 shrink-0 text-ink-4`})]}),(0,J.jsx)(FY,{me:e,space:t})]}):(0,J.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[e.tenant.name&&!n?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(fu,{me:e,className:`max-lg:hidden`}),(0,J.jsx)(`span`,{className:`text-ink-4 max-lg:hidden`,"aria-hidden":`true`,children:`/`})]}):null,(0,J.jsx)(NY,{me:e,placement:`below`,label:t.name,className:e=>W(n?`-ml-1 flex max-w-[16rem] items-center gap-2.5 rounded-xl py-1 pr-2 pl-1 text-left font-medium text-[0.9375rem] text-ink transition hover:bg-accent`:`-mx-1 max-w-[16rem] translate-y-[0.5px] truncate rounded-md px-2 py-0.5 text-left font-medium text-[0.9375rem] text-ink transition hover:bg-accent`,e&&`bg-accent`),children:n?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(jY,{space:t,size:`sm`}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-col leading-tight`,children:[e.tenant.name?(0,J.jsx)(`span`,{className:`truncate font-normal text-[0.75rem] text-ink-3`,children:e.tenant.name}):null,(0,J.jsx)(`span`,{className:`truncate`,children:t.name})]})]}):t.name}),(0,J.jsx)(FY,{me:e,space:t})]}):null}function LY({me:e,placement:t=`below`,named:n}){let[r,i]=(0,q.useState)(!1),a=(0,q.useRef)(null),o=te(),{position:s,phone:c}=Qo();OY(a,r,()=>i(!1));let l=cs(),[u,d]=(0,q.useState)(!1),f=Yn(e.user.name),p=oT().dev,m=DY(e,nt(`account`)),h=nt(`capabilities`),g=e.mode===`managed`&&Gn(e.features,`organizationSettings`),_=`flex w-full items-center gap-3 rounded-lg px-3 py-2.5 text-left text-[0.875rem] text-ink-2 hover:bg-accent hover:text-ink`;return(0,J.jsxs)(`div`,{className:W(`relative`,n&&`w-full`),ref:a,children:[(0,J.jsxs)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:n?W(`flex w-full items-center gap-3 rounded-lg p-0.5 pr-2 text-left transition hover:bg-ink/10`,r&&`bg-ink/10`):`block shrink-0 rounded-full`,"aria-label":e.user.name||`Menu`,children:[(0,J.jsxs)(`span`,{className:W(`relative flex shrink-0 items-center justify-center rounded-full bg-ember-tint font-semibold text-[0.8125rem] text-ember-strong ring-1 ring-border-soft`,t===`below`?`size-9`:`size-10`),children:[e.user.image?(0,J.jsx)(`img`,{src:e.user.image,alt:``,className:`size-full rounded-full object-cover`}):f,m===`linked`||m===`expired`?(0,J.jsx)(`span`,{title:m===`linked`?K(`nav.connected`,{host:_H(e.account?.cloudUrl??``)}):K(`nav.expired`),className:`-right-1 -bottom-1 absolute flex size-4 items-center justify-center rounded-full bg-card ring-1 ring-border-soft`,children:m===`linked`?(0,J.jsx)(ti,{className:`size-2.5 text-moss`}):(0,J.jsx)(qe,{className:`size-2.5 text-amber`})}):null]}),n?(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium text-[0.875rem] text-ink-2`,children:e.user.name}):null]}),r?(0,J.jsxs)(`div`,{className:W(`absolute z-50 w-72 animate-rise rounded-xl bg-card p-1.5 shadow-overlay ring-1 ring-border-soft`,kY(t,s,`top-11 right-0`)),children:[(0,J.jsxs)(`div`,{className:`px-3 pt-2 pb-2.5`,children:[(0,J.jsxs)(`div`,{className:`truncate font-medium text-[0.875rem]`,children:[e.user.name,m===`alone`?(0,J.jsxs)(`span`,{className:`font-normal text-ink-4`,children:[` (`,K(`nav.local`),`)`]}):null]}),(0,J.jsx)(`div`,{className:`truncate text-[0.75rem] text-ink-3`,children:e.user.email}),e.tenant.name?(0,J.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5 text-[0.75rem] text-ink-2`,children:[(0,J.jsx)(Fr,{className:`size-3.5 shrink-0 text-ink-4`,"aria-hidden":`true`}),(0,J.jsx)(`span`,{className:`truncate`,children:e.tenant.name})]}):null]}),m?(0,J.jsxs)(`button`,{type:`button`,className:`mx-1.5 mb-1.5 flex w-[calc(100%-0.75rem)] items-start gap-2.5 rounded-lg bg-paper-2 px-2.5 py-2 text-left text-[0.8125rem] text-ink-2 hover:text-ink`,onClick:()=>{i(!1),o(`/settings/account`)},children:[m===`linked`?(0,J.jsx)(ti,{className:`mt-0.5 size-4 shrink-0 text-moss`}):m===`expired`?(0,J.jsx)(qe,{className:`mt-0.5 size-4 shrink-0 text-amber`}):(0,J.jsx)(Gi,{className:`mt-0.5 size-4 shrink-0 text-ink-3`}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col leading-snug`,children:[(0,J.jsx)(`span`,{className:`break-words`,children:m===`linked`?K(`nav.connected`,{host:_H(e.account?.cloudUrl??``)}):K(m===`expired`?`nav.expired`:`nav.onlyHere`)}),(0,J.jsx)(`span`,{className:`font-medium text-ink tabular-nums`,children:m===`linked`?e.account?.credits!==null&&e.account?.credits!==void 0?K(`nav.credits`,{n:Math.floor(e.account.credits).toLocaleString(Rn)}):null:K(m===`expired`?`account.signInAgain`:`account.signIn`)})]})]}):null,(0,J.jsxs)(`button`,{type:`button`,className:_,onClick:()=>{i(!1),o(g?`/account`:`/settings/account`)},children:[(0,J.jsx)(Po,{className:`size-4`}),` `,K(`konto.title`)]}),h?(0,J.jsxs)(`button`,{type:`button`,className:_,onClick:()=>{i(!1),o(`/account/connections`)},children:[(0,J.jsx)(A,{className:`size-4`}),` `,K(`konto.connections`)]}):null,!g&&e.manageUrl?(0,J.jsxs)(`a`,{className:_,href:`${e.manageUrl}/account`,target:`_blank`,rel:`noreferrer`,children:[(0,J.jsx)(ai,{className:`size-4`}),` `,K(`nav.account`)]}):null,c&&!ns()?(0,J.jsxs)(`button`,{type:`button`,className:_,onClick:()=>{i(!1),l?ls(l):d(!0)},children:[(0,J.jsx)(Xe,{className:`size-4`}),` `,K(`install.app.action`)]}):null,(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2 text-[0.875rem] text-ink-2`,children:[K(`nav.theme`),(0,J.jsx)(gH,{})]}),(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2 text-[0.875rem] text-ink-2`,children:[K(`nav.language`),(0,J.jsx)(ur,{tone:`surface`})]}),e.assistantDev?(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2 text-[0.875rem] text-ink-2`,children:[K(`assistant.dev`),(0,J.jsx)(Ve,{checked:p,onChange:e=>aT({dev:e}),label:K(`assistant.dev`)})]}):null,e.mode===`managed`?(0,J.jsxs)(`button`,{type:`button`,className:_,onClick:()=>{i(!1),Tl({where:`studio`})},children:[(0,J.jsx)(Ze,{className:`size-4`}),` `,K(`report.open`)]}):null,e.mode===`managed`?(0,J.jsxs)(`button`,{type:`button`,className:_,onClick:()=>void Zn(),children:[(0,J.jsx)(ra,{className:`size-4`}),` `,K(`nav.logout`)]}):null]}):null,(0,J.jsx)(Xl,{open:u,onClose:()=>d(!1)})]})}var RY=(0,q.createContext)(null),zY=(0,q.createContext)(null);function BY({children:e}){let t=(0,q.useContext)(zY),n=(0,J.jsx)(`div`,{className:`flex w-full min-w-0 flex-col overflow-hidden bg-background md:w-[17rem] md:rounded-xl md:shadow-elevated md:dark:ring-1 md:dark:ring-border-soft`,children:e});return t?(0,tu.createPortal)(n,t):n}function VY({me:e,sidebar:t,children:n}){let r=nt(`startTriggers`),i=nt(`durableRuns`),a=nt(`orgSpaces`),{phone:o}=Qo(),s=Ge().pathname.startsWith(`/account`),c=(0,q.useContext)(RY),l=(0,J.jsxs)(`header`,{className:W(`flex h-12 shrink-0 items-center gap-2 coarse:h-14 sm:gap-3`,c?`pr-1 pl-0.5`:`px-3 sm:px-4 md:px-5`),children:[a&&t&&!s?(0,J.jsx)(nW,{open:t.open,onToggle:t.onToggle}):null,s?null:a?(0,J.jsx)(rW,{me:e}):(0,J.jsx)(IY,{me:e}),(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center`,children:[(0,J.jsx)(wY,{alone:s}),n]}),r||i?(0,J.jsx)(pY,{}):null,(0,J.jsx)(`div`,{ref:CT,className:`flex shrink-0 items-center empty:hidden`}),s||!o?null:(0,J.jsx)(au,{me:e,look:`row`,stack:!0}),o?(0,J.jsx)(LY,{me:e}):null]});return c?(0,tu.createPortal)(l,c):l}var HY=`studio-scroll`;function UY(){return document.getElementById(`studio-scroll`)??document.documentElement}var WY={left:`md:py-2 md:pr-2`,right:`md:py-2 md:pl-2`,top:`md:px-2 md:pb-2`,bottom:`md:px-2 md:pt-2`},GY={left:`pt-2 pr-2`,right:`pt-2 pl-2`,top:`px-2`,bottom:`px-2 pt-2`},KY={left:`flex-row`,right:`flex-row-reverse`,top:`flex-col`,bottom:`flex-col-reverse`};function qY({me:e,wide:t,full:n,children:r}){let{position:i,phone:a}=Qo(),o=(0,q.useRef)(null),s=a&&!n?`calc(4.75rem + env(safe-area-inset-bottom))`:`0px`,c=nt(`goose`),l=Tj()&&c&&!n,u=es(!!n||l);xU(e.tenant.id);let d=nt(`orgSpaces`)&&!a,[f,p]=(0,q.useState)(null),[m,h]=(0,q.useState)(null);return(0,J.jsxs)(`div`,{className:W(`flex h-dvh overflow-hidden bg-sidebar`,KY[i]),children:[a?n?null:(0,J.jsx)(RJ,{me:e}):(0,J.jsx)(PJ,{me:e,labels:u.shown,room:u.room}),(0,J.jsx)(RY.Provider,{value:d?f:null,children:(0,J.jsx)(zY.Provider,{value:a||n?null:m,children:(0,J.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[d?(0,J.jsx)(`div`,{ref:p,className:W(`shrink-0`,GY[i])}):null,(0,J.jsxs)(`div`,{className:W(`flex min-h-0 min-w-0 flex-1 md:gap-2`,WY[i],d&&`md:pt-0`),children:[(0,J.jsx)(`div`,{ref:h,className:`hidden min-h-0 shrink-0 md:flex md:empty:hidden`}),(0,J.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background md:rounded-xl md:shadow-elevated md:dark:ring-1 md:dark:ring-border-soft`,children:[e.impersonation?(0,J.jsx)(St,{name:e.user.name||e.user.email,until:e.impersonation.until}):null,(0,J.jsx)(_Y,{}),(0,J.jsx)(me,{}),(0,J.jsx)(eu,{me:e}),(0,J.jsx)(ig,{me:e}),n?(0,J.jsx)(`main`,{className:`relative flex min-h-0 flex-1 flex-col overflow-hidden`,children:r}):(0,J.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,J.jsx)(VY,{me:e}),(0,J.jsxs)(`div`,{ref:o,className:`relative flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,J.jsx)(`main`,{id:HY,className:`relative min-h-0 flex-1 overflow-y-auto`,style:{paddingBottom:`max(var(--assistant-dock, 0px), ${s})`},children:(0,J.jsx)(`div`,{className:W(`mx-auto w-full px-3 pt-4 pb-12 sm:px-6 sm:pt-6`,t?`max-w-[88rem]`:`max-w-5xl`),children:r})}),c&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(yj,{column:o}),(0,J.jsx)(Dj,{})]}),(0,J.jsx)(NO,{})]})]})]}),c&&!n?(0,J.jsx)(Ej,{}):null]})]})})})]})}function JY(){return[{id:`info`,label:K(`space.info`),icon:yi},{id:`brand`,label:K(`space.brand`),icon:vo},{id:`knowledge`,label:K(`space.knowledge`),icon:kr},{id:`files`,label:K(`space.dateien`),icon:xi},{id:`data`,label:K(`space.data`),icon:C},{id:`page`,label:K(`space.page`),icon:pt},{id:`clients`,label:K(`space.clients`),icon:Io}]}function YY(e,t){let n=[...e];for(let e of t.spaceParts){let r=n.findIndex(t=>t.id===(e.after??`data`))+1;for(;r<n.length&&t.spaceParts.some(e=>e.id===n[r].id);)r++;n.splice(r,0,{id:e.id,label:e.label(),icon:e.icon})}return n}function XY(e){return e===`info`||e===`brand`||e===`knowledge`||e===`data`||e===`files`||e===`page`||e===`results`||e===`skills`||e===`clients`}var ZY=[{id:`base`,group:`info`,label:`space.base`,icon:tt},{id:`facts`,group:`info`,label:`space.facts`,icon:kt},{id:`links`,group:`info`,label:`space.links`,icon:A},{id:`identity`,group:`brand`,label:`space.identity`,icon:tt},{id:`logos`,group:`brand`,label:`space.logos`,icon:ro},{id:`colors`,group:`brand`,label:`space.colors`,icon:ya},{id:`typography`,group:`brand`,label:`space.typography`,icon:pr},{id:`assets`,group:`brand`,label:`space.assets`,icon:Li},{id:`voice`,group:`brand`,label:`space.voice`,icon:da},{id:`documents`,group:`knowledge`,label:`space.documents`,icon:dt},{id:`page`,group:`page`,label:`page.sectionPage`,icon:pt},{id:`page-words`,group:`page`,label:`page.sectionWords`,icon:tt},{id:`page-wizards`,group:`page`,label:`page.sectionWizards`,icon:Yi},{id:`clients`,group:`clients`,label:`clients.title`,icon:Io}],QY=ZY.map(e=>e.id);function $Y(e,t){let n=t.spaceSections.find(t=>t.id===e);return ZY.find(t=>t.id===e)?.group??(n?n.group??`knowledge`:null)}function eX(e,t){let n=ZY.filter(t=>t.group===e).map(e=>({id:e.id,label:K(e.label),icon:e.icon})),r=new Map;for(let n of t.spaceSections){if((n.group??`knowledge`)!==e)continue;let t=`${n.grouped===!1?`-`:`+`}${n.plugin}`,i=r.get(t)??[];i.push({id:n.id,label:n.label(),icon:n.icon}),r.set(t,i)}return[...n.length?[{plugin:null,label:null,sections:n}]:[],...[...r].map(([e,n])=>{let r=e.slice(1);return{plugin:r,label:e[0]===`-`?null:t.plugins.find(e=>e.id===r)?.name??r,sections:n}})]}globalThis.__WIZARDS_STUDIO__={react:q,jsx:J,reactDom:{createPortal:tu.createPortal,flushSync:tu.flushSync},router:{Link:ue,Navigate:pe,NavLink:Ae,useLocation:Ge,useNavigate:te,useParams:Ue,useSearchParams:Te},query:{useMutation:rt,useQuery:D,useQueryClient:De},ui:Ie,sdk:Vo};var tX=0,nX={status:`idle`,plugins:[],canReload:!1,problems:[],failed:{},pages:[],nav:[],sections:[],spaceSections:[],spaceParts:[],spaceMenus:{},shareSections:[],shareSetups:[],cards:[],knowledgeSources:[],mountKinds:[]},rX=new Set;function iX(e){nX={...nX,...e};for(let e of rX)e()}function aX(){return(0,q.useSyncExternalStore)(e=>(rX.add(e),()=>rX.delete(e)),()=>nX)}var oX=new Set([`account`,`space`,`connectors`,`models`,`build`,`plugins`]),sX=new Set([`info`,`brand`,`knowledge`,`data`,`page`,`results`]),cX=new Map,lX=null,uX=e=>`${e.script}|${e.styles}`,dX=e=>`__wizardsPlugin_${e.replaceAll(`-`,`_`)}`;function fX(){let{space:e}=Qn(),t=e?.id,n=e?.name??``,r=e?.readOnly??!1,i=JSON.stringify({name:e?.brand.name??``,colors:(e?.brand.colors??[]).map(({name:e,value:t})=>({name:e,value:t})),fonts:(e?.brand.fonts??[]).map(({family:e,role:t,weights:n})=>({family:e,role:t,weights:n}))});return(0,q.useMemo)(()=>t?{id:t,name:n,readOnly:r,brand:JSON.parse(i)}:null,[t,n,r,i])}var pX=(0,q.createContext)(null);function mX({part:e,children:t}){return(0,J.jsx)(pX.Provider,{value:e,children:t})}function hX(e){let t=(0,q.useContext)(pX),n=JSON.stringify(e.map(e=>[e.id,e.label]));(0,q.useEffect)(()=>{if(t)return iX({spaceMenus:{...nX.spaceMenus,[t]:e}}),()=>{let{[t]:e,...n}=nX.spaceMenus;iX({spaceMenus:n})}},[t,n])}function gX({plugin:e,...t}){return HT({...t,plugin:e}),null}function _X(e,t){let{id:n}=e,r=e=>`/api/studio/plugins/${n}${e.startsWith(`/`)?e:`/${e}`}`,i=e=>e.filter(e=>e.plugin!==n);return{plugin:{id:n,name:e.name,version:e.version},registerPage(e){let r=e.path.split(`/`)[1]??``;if(!e.path.startsWith(`/`)||U.has(r))throw Error(`"${e.path}" is an address of the studio itself.`);if([...i(nX.pages),...t.pages].some(t=>t.path===e.path))throw Error(`"${e.path}" is registered already.`);t.pages.push({...e,plugin:n,serial:++tX})},registerNav(e){t.nav.push({...e,plugin:n,serial:++tX})},registerSettingsSection(e){let r=[...i(nX.sections),...t.sections].some(t=>t.id===e.id);if(oX.has(e.id)||r)throw Error(`The settings have a section "${e.id}" already.`);t.sections.push({...e,plugin:n,serial:++tX})},registerSpaceSection(e){let r=[...i(nX.spaceSections),...t.spaceSections].some(t=>t.id===e.id);if(QY.includes(e.id)||r)throw Error(`The space page has a section "${e.id}" already.`);t.spaceSections.push({...e,plugin:n,serial:++tX})},registerSpacePart(e){let r=[...i(nX.spaceParts),...t.spaceParts].some(t=>t.id===e.id);if(!/^[a-z][a-z0-9-]{0,39}$/.test(e.id)||sX.has(e.id)||r)throw Error(`The space page has a part "${e.id}" already.`);t.spaceParts.push({...e,plugin:n,serial:++tX})},registerShareSection(e){if([...i(nX.shareSections),...t.shareSections].some(t=>t.runner===e.runner))throw Error(`The runner "${e.runner}" has a share section already.`);t.shareSections.push({...e,plugin:n,serial:++tX})},registerShareSetup(e){if([...i(nX.shareSetups),...t.shareSetups].some(t=>t.runner===e.runner))throw Error(`The runner "${e.runner}" has a share setup already.`);t.shareSetups.push({...e,plugin:n,serial:++tX})},registerAssistantCard(e){if(t.cards.some(t=>t.tool===e.tool))throw Error(`The tool "${e.tool}" has a card already.`);t.cards.push({...e,plugin:n,serial:++tX})},registerKnowledgeSource(e){if([...i(nX.knowledgeSources),...t.knowledgeSources].some(t=>t.kind===e.kind))throw Error(`The source kind "${e.kind}" is taken.`);t.knowledgeSources.push({...e,plugin:n,serial:++tX})},registerMountKind(e){if([...i(nX.mountKinds),...t.mountKinds].some(t=>t.kind===e.kind)||e.kind===`folder`)throw Error(`The mount kind "${e.kind}" is taken.`);t.mountKinds.push({...e,plugin:n,serial:++tX})},useSpace:fX,useSpaceMenu:hX,useCrumbs:xY,Assistant:e=>(0,J.jsx)(gX,{plugin:n,...e}),useAssistantPage:e=>HT({...e,plugin:n}),useAssistantTool:(e,t,r)=>EE(`${n.replaceAll(`-`,`_`)}_${e}`,t,r),i18n:{register:e=>(t,n)=>{let r=e[Rn]?.[t]??e.de[t]??t;for(let[e,t]of Object.entries(n??{}))r=r.replace(`{${e}}`,String(t));return r},lang:()=>Rn},api:{get:e=>a.get(r(e)),post:(e,t)=>a.post(r(e),t),put:(e,t)=>a.put(r(e),t),patch:(e,t)=>a.patch(r(e),t),del:e=>a.del(r(e))},me:()=>({user:{id:lX.user.id,name:lX.user.name,email:lX.user.email},tenant:lX.tenant,mode:lX.mode}),onUnload(e){t.disposers.push(e)}}}function vX(e){return new Promise((t,n)=>{let r=document.createElement(`script`);r.src=e,r.onload=()=>{r.remove(),t()},r.onerror=()=>{r.remove(),n(Error(`The plugin's script did not load.`))},document.head.append(r)})}function yX(e,t){return new Promise(n=>{let r=document.createElement(`link`);r.rel=`stylesheet`,r.href=t,r.dataset.plugin=e,r.onload=()=>n(r),r.onerror=()=>n(r),document.head.append(r)})}function bX(e,t,n){for(let n of t)try{n()}catch(t){console.error(`[plugin ${e}]`,t)}n?.remove()}function xX(e){let t=cX.get(e);cX.delete(e),bX(e,t?.disposers??[],t?.link??null);let{[e]:n,...r}=nX.failed;iX({failed:r,pages:nX.pages.filter(t=>t.plugin!==e),nav:nX.nav.filter(t=>t.plugin!==e),sections:nX.sections.filter(t=>t.plugin!==e),spaceSections:nX.spaceSections.filter(t=>t.plugin!==e),spaceParts:nX.spaceParts.filter(t=>t.plugin!==e),shareSections:nX.shareSections.filter(t=>t.plugin!==e),shareSetups:nX.shareSetups.filter(t=>t.plugin!==e),cards:nX.cards.filter(t=>t.plugin!==e),knowledgeSources:nX.knowledgeSources.filter(t=>t.plugin!==e),mountKinds:nX.mountKinds.filter(t=>t.plugin!==e)})}async function SX(e){let{id:t}=e,n={pages:[],nav:[],sections:[],spaceSections:[],spaceParts:[],shareSections:[],shareSetups:[],cards:[],knowledgeSources:[],mountKinds:[],disposers:[]},r=null;try{e.styles&&(r=await yX(t,Ee(e.styles))),await vX(Ee(e.script));let i=globalThis,a=dX(t),o=i[a];i[a]=void 0;let s=typeof o==`function`?o:o?.default;if(typeof s!=`function`)throw Error(`The plugin's script has no default export.`);s(_X(e,n))}catch(i){console.error(`[plugin ${t}]`,i),bX(t,n.disposers,r),xX(t),cX.set(t,{key:uX(e),disposers:[],link:null}),iX({failed:{...nX.failed,[t]:i.message}});return}let i=cX.get(t);cX.set(t,{key:uX(e),disposers:n.disposers,link:r});let{[t]:a,...o}=nX.failed;iX({failed:o,pages:[...nX.pages.filter(e=>e.plugin!==t),...n.pages],nav:[...nX.nav.filter(e=>e.plugin!==t),...n.nav],sections:[...nX.sections.filter(e=>e.plugin!==t),...n.sections],spaceSections:[...nX.spaceSections.filter(e=>e.plugin!==t),...n.spaceSections],spaceParts:[...nX.spaceParts.filter(e=>e.plugin!==t),...n.spaceParts],shareSections:[...nX.shareSections.filter(e=>e.plugin!==t),...n.shareSections],shareSetups:[...nX.shareSetups.filter(e=>e.plugin!==t),...n.shareSetups],cards:[...nX.cards.filter(e=>e.plugin!==t),...n.cards],knowledgeSources:[...nX.knowledgeSources.filter(e=>e.plugin!==t),...n.knowledgeSources],mountKinds:[...nX.mountKinds.filter(e=>e.plugin!==t),...n.mountKinds]}),bX(t,i?.disposers??[],i?.link??null)}var CX=Promise.resolve();function wX(){return CX=CX.catch(()=>void 0).then(async()=>{let e=await a.get(`/api/studio/plugins`);for(let t of[...cX.keys()])e.plugins.some(e=>e.id===t&&e.script)||xX(t);iX(e);for(let t of e.plugins)t.script&&cX.get(t.id)?.key!==uX(t)&&await SX(t)}).catch(e=>console.error(`[plugins]`,e)).finally(()=>iX({status:`ready`})),CX}var TX=null;function EX(e){lX=e,nX.status===`idle`&&(iX({status:`loading`}),wX().then(()=>{nX.canReload&&!TX&&(TX=new EventSource(Ee(`/api/studio/plugins/-/events`),{withCredentials:!0}),TX.addEventListener(`change`,()=>void wX()))}))}async function DX(e){await a.post(e?`/api/studio/plugins/-/reload/${e}`:`/api/studio/plugins/-/reload`),await wX()}var OX=class extends q.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(e){console.error(`[plugin]`,e)}render(){return this.state.failed?(0,J.jsx)(xe,{children:K(`plugins.crashed`)}):this.props.children}};function kX({of:e,children:t}){return(0,J.jsx)(`div`,{"data-plugin":e.plugin,className:`contents`,children:(0,J.jsx)(OX,{children:t},e.serial)})}export{Jk as $,ji as $n,sg as $t,PU as A,wo as An,hD as At,jH as B,ya as Bn,QE as Bt,fJ as C,Tl as Cn,xD as Ct,eW as D,Po as Dn,jD as Dt,Yq as E,Io as En,ND as Et,NU as F,to as Fn,$E as Ft,bH as G,ra as Gn,Zw as Gt,CH as H,ha as Hn,ZE as Ht,EU as I,Ya as In,oD as It,pH as J,qi as Jn,Lw as Jt,yH as K,ta as Kn,Xw as Kt,pU as L,qa as Ln,BE as Lt,DU as M,mo as Mn,iD as Mt,AU as N,so as Nn,tD as Nt,FU as O,Ao as On,gD as Ot,MU as P,ao as Pn,nD as Pt,sA as Q,zi as Qn,og as Qt,gU as R,Ga as Rn,XE as Rt,dJ as S,Pl as Sn,LD as St,nJ as T,Ro as Tn,yD as Tt,xH as U,pa as Un,IE as Ut,wH as V,_a as Vn,HE as Vt,vH as W,sa as Wn,HT as Wt,oA as X,Ui as Xn,kw as Xt,cj as Y,Gi as Yn,Iw as Yt,eA as Z,Vi as Zn,Dw as Zt,WJ as _,zm as _n,ik as _t,aX as a,fg as an,ti as ar,Zk as at,dY as b,su as bn,UD as bt,JY as c,vg as cn,Vr as cr,Kk as ct,qY as d,Xh as dn,Dr as dr,Rk as dt,cg as en,ki as er,Yk as et,BY as f,rg as fn,Cr as fr,Ak as ft,OY as g,Hm as gn,uk as gt,xY as h,Zm as hn,wk as ht,EX as i,dg as in,ai as ir,Xk as it,jU as j,So as jn,dD as jt,RU as k,Eo as kn,uD as kt,eX as l,yg as ln,zr as lr,Lk as lt,UY as m,th as mn,Fk as mt,mX as n,_g as nn,Ci as nr,iA as nt,$Y as o,ug as on,qr as or,Qk as ot,EY as p,ah as pn,Ik as pt,gH as q,Yi as qn,Gw as qt,DX as r,pg as rn,si as rr,lA as rt,XY as s,bg as sn,Gr as sr,qk as st,kX as t,ag as tn,Di as tr,$k as tt,YY as u,gg as un,Fr as ur,Vk as ut,UJ as v,Dm as vn,nk as vt,xJ as w,Bo as wn,vD as wt,sY as x,Bl as xn,KD as xt,zJ as y,xu as yn,ak as yt,UH as z,Va as zn,YE as zt};
69
+ `);function Uq({id:e}){let{space:t}=Qn(),{data:n}=cm(t?.id,``),r=n?.sections.find(t=>t.id===e),i=(n?.chats??[]).filter(t=>t.sectionId===e&&!t.archived&&!t.parentId),a=gm(),o=wm(e).data,s=Cm(),c=te(),[l,u]=(0,q.useState)(!1),[f,p]=(0,q.useState)(``);return(0,q.useEffect)(()=>{p(r?.infos??``)},[r?.infos]),xY(r?[{label:r.name}]:[]),r?(0,J.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:(0,J.jsxs)(`div`,{className:`mx-auto grid w-full max-w-5xl gap-8 px-6 py-8 md:grid-cols-[minmax(0,1fr)_16rem]`,children:[(0,J.jsxs)(`div`,{className:`grid min-w-0 content-start gap-5`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,J.jsx)(`span`,{className:`grid size-10 place-items-center rounded-xl bg-card text-ink-2 ring-1 ring-border-soft`,children:(0,J.jsx)(xi,{className:`size-5`})}),(0,J.jsx)(`h1`,{className:`min-w-0 truncate font-display font-semibold text-[1.375rem] text-ink`,children:r.name})]}),(0,J.jsx)(`form`,{onSubmit:async n=>{n.preventDefault();let r=await a.mutateAsync({spaceId:t?.id,sectionId:e,parentId:null});c(`/work/c/${r.id}`)},children:(0,J.jsx)(z,{type:`submit`,busy:a.isPending,children:K(`work.newChatIn`,{name:r.name})})}),(0,J.jsxs)(`ul`,{className:`grid`,children:[i.map(e=>(0,J.jsx)(`li`,{children:(0,J.jsxs)(`button`,{type:`button`,onClick:()=>c(`/work/c/${e.id}`),className:`flex w-full items-center gap-3 border-border-soft border-b px-1 py-2.5 text-left transition hover:bg-ink/5`,children:[(0,J.jsx)(j,{className:`size-4 shrink-0 text-ink-3`}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col leading-tight`,children:[(0,J.jsx)(`span`,{className:`truncate text-[0.875rem] text-ink`,children:e.title||K(`work.untitled`)}),e.last?(0,J.jsxs)(`span`,{className:`truncate text-[0.75rem] text-ink-3`,children:[e.last.author,`: `,e.last.text]}):null]})]})},e.id)),i.length?null:(0,J.jsx)(`li`,{className:`px-1 py-2.5 text-[0.875rem] text-ink-3`,children:K(`work.folderEmpty`)})]})]}),(0,J.jsxs)(`aside`,{className:`grid content-start gap-2.5`,children:[(0,J.jsxs)(`section`,{className:`grid gap-1.5 rounded-xl bg-card p-3 ring-1 ring-border-soft`,children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,J.jsx)(`h2`,{className:`font-semibold text-[0.8125rem] text-ink`,children:K(`work.folderInfos`)}),l?null:(0,J.jsx)(`button`,{type:`button`,"aria-label":K(`work.folderInfosEdit`),onClick:()=>u(!0),className:`grid size-6 place-items-center rounded-md text-ink-3 hover:bg-ink/10 hover:text-ink`,children:(0,J.jsx)(d,{className:`size-3.5`})})]}),l?(0,J.jsx)(`textarea`,{autoFocus:!0,value:f,rows:6,maxLength:2e4,"aria-label":K(`work.folderInfos`),onChange:e=>p(e.target.value),onBlur:async()=>{u(!1),f!==(r.infos??``)&&await s.mutateAsync({id:e,infos:f})},className:`w-full resize-y rounded-lg bg-background p-2 text-[0.8125rem] text-ink outline-none ring-1 ring-border focus:ring-ember/60`}):(0,J.jsx)(`p`,{className:W(`whitespace-pre-wrap text-[0.8125rem]`,r.infos?`text-ink-2`:`text-ink-4`),children:r.infos||K(`work.folderInfosEmpty`)})]}),(0,J.jsxs)(`section`,{className:`grid gap-1.5 rounded-xl bg-card p-3 ring-1 ring-border-soft`,children:[(0,J.jsx)(`h2`,{className:`font-semibold text-[0.8125rem] text-ink`,children:K(`work.folderFiles`)}),(0,J.jsx)(Wq,{spaceId:t?.id??``,mountId:r.mountId??null,onLink:t=>s.mutate({id:e,mountId:t})}),o?.files.length?o.files.map(e=>(0,J.jsxs)(`a`,{href:Ee(e.url),target:`_blank`,rel:`noreferrer`,className:`flex min-w-0 items-center gap-2 text-[0.8125rem] text-ink-2 hover:text-ink`,children:[(0,J.jsx)(dt,{className:`size-3.5 shrink-0 text-ink-3`}),(0,J.jsx)(`span`,{className:`truncate`,children:e.name})]},e.id)):(0,J.jsx)(`p`,{className:`text-[0.8125rem] text-ink-4`,children:K(`work.folderFilesEmpty`)})]}),(0,J.jsxs)(`section`,{className:`grid gap-1.5 rounded-xl bg-card p-3 ring-1 ring-border-soft`,children:[(0,J.jsx)(`h2`,{className:`font-semibold text-[0.8125rem] text-ink`,children:K(`work.folderResults`)}),o?.results.length?o.results.map(e=>(0,J.jsxs)(`button`,{type:`button`,onClick:()=>c(`/work/r/${e.runId}`),className:`flex min-w-0 items-center gap-2 text-left text-[0.8125rem] text-ink-2 hover:text-ink`,children:[(0,J.jsx)(x,{className:`size-3.5 shrink-0 text-ember-strong`}),(0,J.jsx)(`span`,{className:`truncate`,children:e.title})]},e.runId)):(0,J.jsx)(`p`,{className:`text-[0.8125rem] text-ink-4`,children:K(`work.folderResultsEmpty`)})]})]})]})}):(0,J.jsx)(`div`,{className:`flex-1`})}function Wq({spaceId:e,mountId:t,onLink:n}){let r=nt(`dateien`),i=D({queryKey:[`space-mounts`,e],queryFn:()=>a.get(`/api/studio/spaces/${e}/mounts`),enabled:r&&!!e}).data?.mounts,o=D({queryKey:[`space-mounts`,e,t,`files`],queryFn:()=>a.get(`/api/studio/spaces/${e}/mounts/${t}/files`),enabled:r&&!!(e&&t)}).data?.files;if(!r||!i?.length)return null;let s=i.find(e=>e.id===t);return s?(0,J.jsxs)(`div`,{className:`grid gap-1`,children:[(0,J.jsxs)(`div`,{className:`flex items-center gap-2 rounded-lg bg-background px-2 py-1.5 text-[0.8125rem] ring-1 ring-border-soft`,children:[(0,J.jsx)(A,{className:`size-3.5 shrink-0 text-cobalt`}),(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:s.name}),(0,J.jsx)(`button`,{type:`button`,"aria-label":K(`work.folderUnlink`),title:K(`work.folderUnlink`),onClick:()=>n(null),className:`grid size-5 place-items-center rounded text-ink-3 hover:text-ink`,children:(0,J.jsx)(Mo,{className:`size-3`})})]}),o?.slice(0,5).map(e=>(0,J.jsx)(`span`,{className:`truncate pl-1 text-[0.75rem] text-ink-3`,children:e.path},e.id)),o&&o.length>5?(0,J.jsx)(`span`,{className:`pl-1 text-[0.75rem] text-ink-4`,children:K(`work.folderMoreFiles`,{n:o.length-5})}):null]}):(0,J.jsxs)(`label`,{className:`flex items-center gap-2 text-[0.8125rem] text-ink-3`,children:[(0,J.jsx)(ki,{className:`size-3.5 shrink-0`}),(0,J.jsxs)(`select`,{value:``,"aria-label":K(`work.folderLink`),onChange:e=>e.target.value&&n(e.target.value),className:`min-w-0 flex-1 rounded-md bg-background px-1.5 py-1 text-ink ring-1 ring-border`,children:[(0,J.jsx)(`option`,{value:``,children:K(`work.folderLink`)}),i.map(e=>(0,J.jsx)(`option`,{value:e.id,children:e.name},e.id))]})]})}var Gq=6,Kq=4;function qq(){xY([{label:K(`work.chats`)}]),HT({ownInput:!0});let{space:e}=Qn(),t=qn().data,n=e&&t?eW(t,e):e?.name??``,r=(cm(e?.id,``).data?.chats??[]).filter(e=>!e.archived),i=Dm().data,a=i?.approvals??[],o=t=>(t??[]).filter(t=>t.spaceId===e?.id),s=o(i?.runs?.needs),c=o(i?.runs?.waits),l=gm(),u=te(),d=(0,q.useRef)(null),[f,p]=(0,q.useState)(!1),m=rK(e?.id,()=>p(!0)),[h,g]=(0,q.useState)(null),_=nK(e?.id).slice(0,Kq),v=new Map(r.map(e=>[e.id,e.title||K(`work.untitled`)])),y=r.filter(e=>e.unread&&e.last),b=r.filter(e=>e.answeringSince),x=new Set([...y,...b].map(e=>e.id)),S=[...r].filter(e=>!x.has(e.id)).sort((e,t)=>Jq(t)>Jq(e)?1:-1).slice(0,Gq),C=s.length+a.length+y.length,w=t?.user.name.split(` `)[0]??``;return(0,J.jsx)(`div`,{className:`min-w-0 flex-1 overflow-y-auto`,children:(0,J.jsxs)(`div`,{className:`mx-auto grid w-full max-w-3xl gap-10 px-6 pt-14 pb-16`,children:[(0,J.jsxs)(`header`,{className:`grid gap-1.5`,children:[(0,J.jsx)(`p`,{className:`text-[0.8125rem] text-ink-3`,children:new Date().toLocaleDateString(Rn,{weekday:`long`,day:`numeric`,month:`long`})}),(0,J.jsx)(`h1`,{className:`font-display font-semibold text-[2rem] text-ink leading-tight`,children:Yq(w)}),(0,J.jsx)(`p`,{className:`text-[0.9375rem] text-ink-2`,children:C?K(`work.home.needs`,{count:C}):K(`work.waitingEmpty`)})]}),(0,J.jsxs)(`div`,{className:`grid gap-1.5`,children:[(0,J.jsx)(Oe,{ref:d,tall:!0,autoFocus:!0,placeholder:K(`work.home.ask`,{name:n}),chooser:m.chooser,plus:m.plus,onSend:async(t,n,r,i=[])=>{let a=t.trim();if(!a&&!n.length&&!i.length||!e)return!1;g(null);try{let t=await l.mutateAsync({spaceId:e.id}),r=await xm(t.id,n);return u(`/work/c/${t.id}`,{state:{ask:a,files:[...i,...r],choice:m.choice}}),!0}catch(e){return g(e.message),!1}}}),(0,J.jsx)(`p`,{className:W(`px-3 text-[0.75rem]`,h?`text-danger`:`text-ink-4`),children:h?K(`work.files.uploadFailed`,{message:h}):K(`work.home.askHint`)}),e?(0,J.jsx)(sK,{spaceId:e.id,open:f,onClose:()=>p(!1),onPick:e=>d.current?.pick(e)}):null]}),C?(0,J.jsx)(Zq,{label:K(`work.home.needsYou`),children:(0,J.jsxs)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:[s.map(e=>(0,J.jsx)(nJ,{run:e},e.runId)),a.map(e=>(0,J.jsx)($q,{approval:e,chat:v.get(e.chatId)??K(`work.untitled`),may:t?.tenant.role!==`member`||e.heldFor===`asker`&&e.askedBy===t?.user.id},e.id)),y.map(e=>(0,J.jsx)(aJ,{chat:e},e.id))]})}):null,c.length?(0,J.jsxs)(Zq,{label:K(`work.home.waits`),children:[(0,J.jsx)(`p`,{className:`-mt-1.5 text-[0.8125rem] text-ink-3`,children:K(`work.home.waitsHint`)}),(0,J.jsx)(`ul`,{className:`grid`,children:c.map(e=>(0,J.jsx)(rJ,{run:e},e.runId))})]}):null,b.length?(0,J.jsx)(Zq,{label:K(`work.home.running`),children:(0,J.jsx)(`ul`,{className:`grid`,children:b.map(e=>(0,J.jsx)(sJ,{chat:e,note:(0,J.jsxs)(`span`,{className:`flex items-center gap-1.5 text-ember`,children:[(0,J.jsx)(`span`,{className:`size-1.5 animate-pulse rounded-full bg-ember`}),K(`work.home.answering`,{name:n})]})},e.id))})}):null,_.length&&t?(0,J.jsx)(Zq,{label:K(`work.home.wizards`),children:(0,J.jsx)(`div`,{className:`grid gap-3 sm:grid-cols-2`,children:_.map(e=>(0,J.jsx)(iJ,{wizard:e,me:t},e.id))})}):null,S.length?(0,J.jsx)(Zq,{label:K(`work.home.recent`),children:(0,J.jsx)(`ul`,{className:`grid`,children:S.map(e=>(0,J.jsx)(sJ,{chat:e},e.id))})}):null]})})}var Jq=e=>e.last?.at??e.updatedAt;function Yq(e){let t=new Date().getHours();return K(t<11?`work.home.morning`:t<18?`work.home.day`:`work.home.evening`,{name:e})}function Xq(e){let t=new Date(e),n=new Date;return t.toDateString()===n.toDateString()?t.toLocaleTimeString(Rn,{hour:`2-digit`,minute:`2-digit`}):t.toDateString()===new Date(n.getTime()-864e5).toDateString()?K(`work.yesterday`):t.toLocaleDateString(Rn,{day:`numeric`,month:`short`})}function Zq({label:e,children:t}){return(0,J.jsxs)(`section`,{className:`grid gap-3`,children:[(0,J.jsx)(`h2`,{className:`font-semibold text-[0.75rem] text-ink-3 uppercase tracking-wide`,children:e}),t]})}var Qq=`grid content-start gap-3 rounded-2xl border border-border bg-card p-4`;function $q({approval:e,chat:t,may:n}){let r=Am(e.chatId);return(0,J.jsxs)(`div`,{className:W(Qq,`border-ember/40`),children:[(0,J.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,J.jsx)(so,{className:`mt-0.5 size-4 shrink-0 text-ember`}),(0,J.jsxs)(`div`,{className:`grid min-w-0 gap-0.5`,children:[(0,J.jsx)(`p`,{className:`truncate text-[0.75rem] text-ink-3`,children:t}),(0,J.jsx)(`p`,{className:`font-medium text-[0.9375rem] text-ink`,children:K(e.heldFor===`admins`?`work.approval.waitingAdmins`:`work.approval.waiting`,{name:e.toolName})})]})]}),(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[n?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(z,{size:`sm`,disabled:r.isPending,onClick:()=>r.mutate({id:e.id,approve:!0}),children:K(`work.approval.approve`)}),(0,J.jsx)(z,{size:`sm`,variant:`secondary`,disabled:r.isPending,onClick:()=>r.mutate({id:e.id,approve:!1}),children:K(`work.approval.deny`)})]}):null,(0,J.jsx)(Ae,{to:`/work/c/${e.chatId}`,className:`ml-auto text-[0.8125rem] text-ink-3 hover:text-ink`,children:K(`work.home.open`)})]})]})}var eJ=e=>`/work/r/${e.runId}`;function tJ(e){return[e.about,K(`work.home.since`,{when:Xq(e.since)}),e.until?K(`work.home.until`,{when:Xq(e.until)}):K(`work.home.noDeadline`)].filter(Boolean).join(` · `)}function nJ({run:e}){let t=Om(e),n=te(),r=e.kind===`approve`?so:pi;return(0,J.jsxs)(`div`,{className:W(Qq,e.kind===`approve`&&`border-ember/40`),children:[(0,J.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,J.jsx)(r,{className:`mt-0.5 size-4 shrink-0 text-ember`}),(0,J.jsxs)(`div`,{className:`grid min-w-0 gap-0.5`,children:[(0,J.jsxs)(`p`,{className:`truncate text-[0.75rem] text-ink-3`,children:[e.wizard,` · `,e.step]}),e.detail?(0,J.jsx)(`p`,{className:`line-clamp-3 font-medium text-[0.9375rem] text-ink`,children:e.detail}):null,(0,J.jsx)(`p`,{className:`truncate text-[0.75rem] text-ink-3`,children:tJ(e)})]})]}),t.error?(0,J.jsx)(`p`,{className:`text-[0.8125rem] text-danger`,children:t.error.message}):null,(0,J.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[e.kind===`approve`?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(z,{size:`sm`,disabled:t.isPending,onClick:()=>t.mutate(!0),children:K(`run.approve`)}),(0,J.jsx)(z,{size:`sm`,variant:`secondary`,disabled:t.isPending,onClick:()=>t.mutate(!1),children:K(`run.decline`)})]}):(0,J.jsx)(z,{size:`sm`,onClick:()=>n(eJ(e)),children:K(e.kind===`review`?`work.home.review`:`work.home.answer`)}),(0,J.jsx)(Ae,{to:eJ(e),className:`ml-auto text-[0.8125rem] text-ink-3 hover:text-ink`,children:K(`work.home.open`)})]})]})}function rJ({run:e}){return(0,J.jsx)(`li`,{children:(0,J.jsxs)(Ae,{to:eJ(e),className:`-mx-3 flex items-baseline gap-3 rounded-xl px-3 py-2.5 hover:bg-ink/5`,children:[(0,J.jsx)(oe,{className:`size-3.5 shrink-0 self-center text-ink-4`}),(0,J.jsxs)(`div`,{className:`grid min-w-0 flex-1 gap-0.5`,children:[(0,J.jsxs)(`p`,{className:`truncate font-medium text-[0.9375rem] text-ink`,children:[e.wizard,` · `,e.step]}),(0,J.jsx)(`p`,{className:`truncate text-[0.8125rem] text-ink-3`,children:tJ(e)})]})]})})}function iJ({wizard:e,me:t}){return(0,J.jsxs)(`button`,{type:`button`,onClick:()=>Dw(tK(e,t)),title:K(`work.home.wizardOpen`),className:W(Qq,`grid-cols-[auto_1fr] items-start text-left hover:bg-ink/5`),children:[(0,J.jsx)(un,{kind:e.avatar,costume:e.costume,size:40}),(0,J.jsxs)(`div`,{className:`grid min-w-0 gap-0.5`,children:[(0,J.jsx)(`p`,{className:`truncate font-medium text-[0.9375rem] text-ink`,children:e.title}),(0,J.jsx)(`p`,{className:`line-clamp-2 text-[0.8125rem] text-ink-3`,children:e.description})]})]})}function aJ({chat:e}){let t=oJ(e);return(0,J.jsx)(Ae,{to:`/work/c/${e.id}`,className:W(Qq,`hover:bg-ink/5`),children:(0,J.jsxs)(`div`,{className:`flex items-start gap-2.5`,children:[(0,J.jsx)(j,{className:`mt-0.5 size-4 shrink-0 text-ink-3`}),(0,J.jsxs)(`div`,{className:`grid min-w-0 gap-0.5`,children:[(0,J.jsxs)(`p`,{className:`truncate text-[0.75rem] text-ink-3`,children:[e.title||K(`work.untitled`),` · `,Xq(Jq(e))]}),(0,J.jsxs)(`p`,{className:`line-clamp-3 text-[0.9375rem] text-ink`,children:[(0,J.jsx)(`span`,{className:`font-medium`,children:t}),e.last?.text]})]})]})})}function oJ(e){let t=qn().data?.user.name,n=e.last?.author;return n?`${n===t?K(`work.you`):n}: `:``}function sJ({chat:e,note:t}){let n=oJ(e);return(0,J.jsx)(`li`,{children:(0,J.jsxs)(Ae,{to:`/work/c/${e.id}`,className:`-mx-3 flex items-baseline gap-3 rounded-xl px-3 py-2.5 hover:bg-ink/5`,children:[(0,J.jsxs)(`div`,{className:`grid min-w-0 flex-1 gap-0.5`,children:[(0,J.jsx)(`p`,{className:`truncate font-medium text-[0.9375rem] text-ink`,children:e.title||K(`work.untitled`)}),(0,J.jsx)(`div`,{className:`truncate text-[0.8125rem] text-ink-3`,children:t??(e.last?(0,J.jsxs)(J.Fragment,{children:[n,e.last.text]}):K(`work.emptyChat`))})]}),(0,J.jsx)(`span`,{className:`shrink-0 text-[0.75rem] text-ink-4`,children:Xq(Jq(e))})]})})}var cJ=[{place:`chats`,to:`/work`,label:`work.chats`},{place:`engenties`,to:`/work/engenties`,label:`work.engenties`},{place:`files`,to:`/work/files`,label:`work.files`},{place:`data`,to:`/work/data`,label:`work.data`},{place:`results`,to:`/work/results`,label:`work.results`},{place:`waiting`,to:`/work/waiting`,label:`work.waiting`}],lJ={engenties:`work.engentiesEmpty`,files:`work.filesEmpty`,data:`work.dataEmpty`,results:`work.resultsEmpty`,waiting:`work.waitingEmpty`};function uJ(e){return(0,J.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,...e,children:[(0,J.jsx)(`path`,{d:`M12 3.2Q19 7.6 19 14q0 6.5-7 6.9Q5 20.5 5 14q0-6.4 7-10.8z`}),(0,J.jsx)(`circle`,{cx:`12`,cy:`12.6`,r:`2.2`})]})}function dJ({mode:e,children:t}){let n=Gl(qn().data);return n===e?t:(0,J.jsx)(pe,{to:Il[n],replace:!0})}function fJ(){let{place:e,chatId:t,folderId:n}=Ue(),r=nt(`workWip`);if(t||n)return(0,J.jsx)(hJ,{});let i=r?cJ.find(t=>t.place===e&&t.place!==`chats`):void 0;return e&&!i?(0,J.jsx)(pe,{to:`/work`,replace:!0}):i?.place===`waiting`?(0,J.jsx)(vJ,{}):i?(0,J.jsx)(gJ,{place:i.place}):(0,J.jsx)(hJ,{})}var pJ=`wizards.work.sidebar`;function mJ(){let[e,t]=(0,q.useState)(()=>{try{return localStorage.getItem(pJ)!==`closed`}catch{return!0}});return[e,()=>t(e=>{try{localStorage.setItem(pJ,e?`closed`:`open`)}catch{}return!e})]}function hJ(){let{chatId:e,folderId:t}=Ue(),n=qn().data,[r,i]=mJ(),a=nt(`goose`),o=(0,q.useRef)(null);return(0,J.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[n?(0,J.jsx)(VY,{me:n,sidebar:{open:r,onToggle:i}}):null,(0,J.jsxs)(`div`,{className:`flex min-h-0 flex-1`,children:[(0,J.jsx)(`div`,{inert:!r,className:W(`flex shrink-0 overflow-hidden transition-[width] duration-200 ease-out motion-reduce:transition-none`,r?`w-72`:`w-0`),children:(0,J.jsx)(dW,{})}),(0,J.jsxs)(`div`,{ref:o,className:`relative flex min-h-0 min-w-0 flex-1 flex-col`,children:[e?(0,J.jsx)(kq,{id:e}):t?(0,J.jsx)(Uq,{id:t}):(0,J.jsx)(qq,{}),a?(0,J.jsx)(yj,{column:o}):null]})]})]})}function gJ({place:e}){let t=cJ.find(t=>t.place===e)?.label??`work.chats`;return xY([{label:K(t)}]),(0,J.jsx)(SJ,{children:K(lJ[e])})}var _J=`flex items-center gap-2 rounded-xl border border-border px-4 py-3 text-[0.9375rem] text-ink hover:bg-ink/5`;function vJ(){xY([{label:K(`work.waiting`)}]);let e=Dm().data,t=km().mutate;(0,q.useEffect)(()=>{t()},[t]);let n=e?.approvals??[],r=e?.critical??[],i=e?.runs?.needs??[];return n.length||r.length||i.length?(0,J.jsxs)(`div`,{className:`mx-auto grid w-full max-w-2xl gap-8 py-8`,children:[i.length?(0,J.jsxs)(`section`,{className:`grid gap-2`,children:[(0,J.jsx)(`h2`,{className:`font-semibold text-[0.75rem] text-ink-3 uppercase tracking-wide`,children:K(`work.waiting.runs`)}),(0,J.jsx)(`ul`,{className:`grid gap-2`,children:i.map(e=>(0,J.jsx)(`li`,{children:(0,J.jsxs)(Ae,{to:eJ(e),className:_J,children:[(0,J.jsx)(pi,{className:`size-4 shrink-0 text-ember`}),(0,J.jsxs)(`span`,{className:`grid min-w-0 gap-0.5`,children:[(0,J.jsxs)(`span`,{className:`truncate`,children:[e.wizard,` · `,e.step]}),(0,J.jsx)(`span`,{className:`truncate text-[0.8125rem] text-ink-3`,children:tJ(e)})]})]})},e.runId))})]}):null,n.length?(0,J.jsxs)(`section`,{className:`grid gap-2`,children:[(0,J.jsx)(`h2`,{className:`font-semibold text-[0.75rem] text-ink-3 uppercase tracking-wide`,children:K(`work.waiting.calls`)}),(0,J.jsx)(`ul`,{className:`grid gap-2`,children:n.map(e=>(0,J.jsx)(`li`,{children:(0,J.jsxs)(Ae,{to:`/work/c/${e.chatId}`,className:_J,children:[(0,J.jsx)(so,{className:`size-4 shrink-0 text-ember`}),K(e.heldFor===`admins`?`work.approval.waitingAdmins`:`work.approval.waiting`,{name:e.toolName})]})},e.id))})]}):null,r.length?(0,J.jsxs)(`section`,{className:`grid gap-2`,children:[(0,J.jsx)(`h2`,{className:`font-semibold text-[0.75rem] text-ink-3 uppercase tracking-wide`,children:K(`work.waiting.critical`)}),(0,J.jsx)(`ul`,{className:`grid gap-2`,children:r.map(e=>(0,J.jsx)(`li`,{children:(0,J.jsx)(bJ,{line:e})},e.id))})]}):null]}):(0,J.jsx)(SJ,{children:K(`work.waitingEmpty`)})}function yJ(e){return e.chatId?`/work/c/${e.chatId}`:e.wizardId?`/edit/${e.wizardId}${e.runId?`?run=${e.runId}`:``}`:null}function bJ({line:e}){let t=yJ(e),n=(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(ao,{className:`size-4 shrink-0 text-ember`}),(0,J.jsxs)(`span`,{className:`grid min-w-0 gap-0.5`,children:[(0,J.jsxs)(`span`,{className:`truncate`,children:[K(`work.critical.${e.kind}`),` · `,e.connectionId,` · `,e.actionId]}),(0,J.jsxs)(`span`,{className:`truncate text-[0.8125rem] text-ink-3`,children:[new Date(e.at).toLocaleString(Rn,{dateStyle:`short`,timeStyle:`short`}),` · `,e.who.kind,e.reason?` · ${e.reason}`:``]})]})]});return t?(0,J.jsx)(Ae,{to:t,className:_J,children:n}):(0,J.jsx)(`div`,{className:_J,children:n})}function xJ(){let{runId:e}=Ue();return xY([{label:K(`work.waiting`)}]),e?(0,J.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,children:(0,J.jsx)(Dt,{runId:e,studio:!0,stickyProgress:!0},e)}):null}function SJ({children:e}){return(0,J.jsx)(`p`,{className:`py-24 text-center text-[0.9375rem] text-ink-3`,children:e})}var CJ=(0,q.lazy)(()=>Wn(()=>import(`./AboutDialog-CQvfeGqA.js`).then(e=>({default:e.AboutDialog})),__vite__mapDeps([30,1,18,3,14,7,19,28,27,31,22,4,32,33])));function wJ(e,t=!1){return W(`shrink-0 rounded-lg transition`,t?`flex h-10 w-full items-center gap-3 px-2.5 font-medium text-[0.875rem]`:`grid size-10 place-items-center`,e?`bg-paper text-ink shadow-soft dark:ring-1 dark:ring-border-soft`:`text-ink-3 hover:bg-ink/10 hover:text-ink`)}function TJ(e,t){let[n,r]=(0,q.useState)(null);return{over:n=>{if(!e)return;let i=n.target.closest(`a[aria-label], button[aria-label]`),a=i?.getAttribute(`aria-label`);if(!(i&&a)){r(null);return}let o=i.getBoundingClientRect();r(t===`left`?{label:a,x:o.right+8,y:o.top+o.height/2}:t===`right`?{label:a,x:o.left-8,y:o.top+o.height/2}:t===`top`?{label:a,x:o.left+o.width/2,y:o.bottom+8}:{label:a,x:o.left+o.width/2,y:o.top-8})},out:()=>r(null),element:n?(0,tu.createPortal)((0,J.jsx)(`span`,{role:`tooltip`,className:W(`pointer-events-none fixed z-[60] animate-in whitespace-nowrap rounded-md bg-ink px-2.5 py-1 font-medium text-[0.8125rem] text-paper shadow-soft fade-in-0`,t===`left`&&`-translate-y-1/2`,t===`right`&&`-translate-x-full -translate-y-1/2`,t===`top`&&`-translate-x-1/2`,t===`bottom`&&`-translate-x-1/2 -translate-y-full`),style:{left:n.x,top:n.y},children:n.label}),document.body):null}}function EJ({children:e}){return(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e})}function DJ({me:e,labels:t}){let{space:n}=Qn(),r=MY(e),i=r?e.tenant.name??void 0:void 0;return(0,J.jsxs)(NY,{me:e,placement:`bar-start`,label:n?.name??K(`nav.space`),className:e=>t?W(`flex w-full items-center gap-3 rounded-lg p-0.5 pr-2 text-left transition hover:bg-ink/10`,e&&`bg-ink/10`):W(`block rounded-lg transition`,e?`ring-2 ring-ink/80 ring-offset-2 ring-offset-sidebar`:`hover:shadow-soft`),children:[(0,J.jsx)(jY,{space:n,name:i}),t?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-semibold text-[0.875rem] text-ink`,children:i??n?.name??K(`nav.space`)}),r?null:(0,J.jsx)(Ur,{className:`size-4 shrink-0 text-ink-4`})]}):null]})}var OJ={left:Ta,top:ka,right:Da,bottom:xa},kJ=[{pick:`light`,icon:on,label:`appbar.light`},{pick:`branded`,icon:ya,label:`appbar.branded`},{pick:`dark`,icon:nn,label:`appbar.dark`},{pick:null,icon:_a,label:`appbar.system`}];function AJ({at:e,room:t,onClose:n}){let{position:r,labels:i}=Qo(),a=sn(),o=Uo,s=(0,q.useRef)(null);OY(s,!0,n);let[c,l]=(0,q.useState)({x:0,y:0});(0,q.useLayoutEffect)(()=>{let e=s.current?.getBoundingClientRect();e&&l({x:Math.min(0,window.innerWidth-8-e.right),y:Math.min(0,window.innerHeight-8-e.bottom)})},[]);let u=`flex w-full items-center gap-3 rounded-lg px-3 py-2 text-left text-[0.875rem] text-ink-2 hover:bg-accent hover:text-ink disabled:pointer-events-none disabled:opacity-50`,d=`px-3 pt-2 pb-1 font-medium text-[0.6875rem] text-ink-4 uppercase tracking-[0.07em]`;return(0,J.jsxs)(`div`,{ref:s,role:`menu`,className:`fixed z-[60] w-56 animate-rise rounded-xl bg-card p-1.5 shadow-overlay ring-1 ring-border-soft`,style:{left:Math.max(8,e.x+c.x),top:Math.max(8,e.y+c.y)},onContextMenu:e=>e.preventDefault(),children:[(0,J.jsx)(`div`,{className:d,children:K(`appbar.position`)}),o.map(e=>{let t=OJ[e];return(0,J.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":e===r,className:W(u,e===r&&`text-ink`),onClick:()=>{Xo({position:e}),n()},children:[(0,J.jsx)(t,{className:`size-4`}),(0,J.jsx)(`span`,{className:`flex-1`,children:K(`appbar.${e}`)}),e===r?(0,J.jsx)(ft,{className:`size-4 text-ember-strong`}):null]},e)}),(0,J.jsxs)(`button`,{type:`button`,role:`menuitemcheckbox`,"aria-checked":i,disabled:!(i||t),className:W(u,i&&`text-ink`),onClick:()=>{Xo({labels:!i}),n()},children:[(0,J.jsx)(Ca,{className:`size-4`}),(0,J.jsx)(`span`,{className:`flex-1`,children:K(`appbar.labels`)}),i?(0,J.jsx)(ft,{className:`size-4 text-ember-strong`}):null]}),(0,J.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`}),(0,J.jsx)(`div`,{className:d,children:K(`appbar.theme`)}),kJ.map(({pick:e,icon:t,label:r})=>(0,J.jsxs)(`button`,{type:`button`,role:`menuitemradio`,"aria-checked":e===a,className:W(u,e===a&&`text-ink`),onClick:()=>{dn(e),n()},children:[(0,J.jsx)(t,{className:`size-4`}),(0,J.jsx)(`span`,{className:`flex-1`,children:K(r)}),e===a?(0,J.jsx)(ft,{className:`size-4 text-ember-strong`}):null]},r))]})}function jJ(){let{pathname:e}=Ge(),t=nt(`orgSpaces`);return e===`/new`?`new`:t&&e===`/`?`start`:e===`/`||e===`/wizards`||e.startsWith(`/edit/`)?`home`:e===`/skills`?`skills`:e===`/capabilities`||e.startsWith(`/capabilities/`)?`capabilities`:e===`/space/results`||e.startsWith(`/space/results/`)?`results`:e===`/settings`||e.startsWith(`/settings/`)?`settings`:e===`/space`||e.startsWith(`/space/`)?`space`:null}var MJ={chats:j,engenties:uJ,files:Ti,data:C,results:zi,waiting:B};function NJ({labels:e,horizontal:t,nav:n}){let r=Dm().data,i=(r?.approvals.length??0)+(r?.runs?.needs.length??0)+(r?.unseen??0),a=nt(`workWip`)?cJ:cJ.filter(e=>e.place===`chats`);return(0,J.jsxs)(`nav`,{className:W(`flex min-h-0 min-w-0 flex-1`,e?`items-stretch`:`items-center`,t?`ml-1.5 flex-row gap-1.5 overflow-x-auto`:`mt-2 flex-col gap-2`),children:[a.map(({place:t,to:n,label:r})=>{let a=MJ[t];return(0,J.jsxs)(Ae,{to:n,end:!0,"aria-label":K(r),className:({isActive:t})=>W(wJ(t,e),`relative`),children:[(0,J.jsx)(a,{className:`size-5 shrink-0`}),e?(0,J.jsx)(EJ,{children:K(r)}):null,t===`waiting`&&i>0?(0,J.jsx)(`span`,{className:`absolute top-0.5 left-6 grid h-4 min-w-4 place-items-center rounded-full bg-ember px-1 font-bold text-[0.625rem] text-white`,children:i}):null]},t)}),n.map(t=>(0,J.jsx)(kX,{of:t,children:(0,J.jsxs)(Ae,{to:t.to,"aria-label":t.label(),className:({isActive:t})=>wJ(t,e),children:[(0,J.jsx)(t.icon,{className:`size-5 shrink-0`}),e?(0,J.jsx)(EJ,{children:t.label()}):null]})},t.serial))]})}function PJ({me:e,labels:t,room:n}){let r=aX(),i=nt(`skills`),a=nt(`capabilities`),o=nt(`orgSpaces`),{position:s}=Qo(),c=$o(s),l=TJ(!t,s),u=jJ(),d=Gl(e),f=Kl(r.nav,d,Rl(e)),[p,m]=(0,q.useState)(null),h=e=>{e.preventDefault(),m({x:e.clientX,y:e.clientY})},g=(0,q.useRef)(null),_=(0,q.useRef)(!1),v=()=>{g.current&&=(window.clearTimeout(g.current.timer),null)};return(0,J.jsxs)(`aside`,{"aria-label":pn.name,onContextMenu:h,onPointerDown:e=>{if(e.pointerType===`mouse`)return;v();let{clientX:t,clientY:n}=e;g.current={x:t,y:n,timer:window.setTimeout(()=>{g.current=null,_.current=!0,window.setTimeout(()=>{_.current=!1},700),m({x:t,y:n})},500)}},onPointerMove:e=>{g.current&&Math.hypot(e.clientX-g.current.x,e.clientY-g.current.y)>10&&v()},onPointerUp:v,onPointerCancel:v,onPointerLeave:v,onClickCapture:e=>{_.current&&(_.current=!1,e.preventDefault(),e.stopPropagation())},onMouseOver:l.over,onFocus:l.over,onMouseLeave:l.out,onBlur:l.out,onClick:l.out,className:W(`flex shrink-0 select-none bg-sidebar [-webkit-touch-callout:none]`,c?`w-full flex-row items-center gap-1.5 px-2`:W(`h-full flex-col pt-2 pb-3 transition-[width] duration-200 ease-out`,t?`w-56 items-stretch px-2.5`:`w-16 items-center`),s===`bottom`&&`pt-1.5 pb-[calc(0.375rem+env(safe-area-inset-bottom))]`,s===`top`&&`pt-[calc(0.375rem+env(safe-area-inset-top))] pb-1.5`),children:[(0,J.jsx)(gu,{me:e,position:s,horizontal:c,labels:t}),o?null:(0,J.jsx)(`div`,{className:c?`ml-1`:`mt-1`,children:(0,J.jsx)(DJ,{me:e,labels:t})}),(0,J.jsx)(au,{me:e,look:c?`row`:t?`named`:`stacked`,className:c?`ml-1`:`mt-2`}),d===`work`?(0,J.jsx)(NJ,{labels:t,horizontal:c,nav:f}):d===`shared`?(0,J.jsx)(`div`,{className:`min-h-0 min-w-0 flex-1`}):(0,J.jsxs)(J.Fragment,{children:[o?(0,J.jsxs)(ue,{to:`/`,"aria-label":K(`start.title`),"aria-current":u===`start`?`page`:void 0,className:W(wJ(u===`start`,t),c?`ml-1.5`:`mt-2`),children:[(0,J.jsx)(Fi,{className:`size-5 shrink-0`}),t?(0,J.jsx)(EJ,{children:K(`start.title`)}):null]}):null,(0,J.jsxs)(ue,{to:o?`/wizards`:`/`,"aria-label":K(o?`nav.wizards`:`nav.home`),"aria-current":u===`home`||u===`new`?`page`:void 0,className:W(wJ(u===`home`||u===`new`,t),c?`ml-1.5`:`mt-2`),children:[o?(0,J.jsx)(E,{className:`size-5 shrink-0`}):(0,J.jsx)(Fi,{className:`size-5 shrink-0`}),t?(0,J.jsx)(EJ,{children:K(o?`nav.wizards`:`nav.home`)}):null]}),(0,J.jsxs)(ue,{to:`/space`,"aria-label":K(`nav.sources`),"aria-current":u===`space`?`page`:void 0,className:W(wJ(u===`space`,t),c?`ml-1.5`:`mt-2`),children:[(0,J.jsx)(qi,{className:`size-5 shrink-0`}),t?(0,J.jsx)(EJ,{children:K(`nav.sources`)}):null]}),a?(0,J.jsxs)(ue,{to:`/capabilities`,"aria-label":K(`nav.capabilities`),"aria-current":u===`capabilities`?`page`:void 0,className:W(wJ(u===`capabilities`,t),c?`ml-1.5`:`mt-2`),children:[(0,J.jsx)(Ao,{className:`size-5 shrink-0`}),t?(0,J.jsx)(EJ,{children:K(`nav.capabilities`)}):null]}):i?(0,J.jsxs)(ue,{to:`/skills`,"aria-label":K(`space.skills`),"aria-current":u===`skills`?`page`:void 0,className:W(wJ(u===`skills`,t),c?`ml-1.5`:`mt-2`),children:[(0,J.jsx)(_t,{className:`size-5 shrink-0`}),t?(0,J.jsx)(EJ,{children:K(`space.skills`)}):null]}):null,(0,J.jsxs)(ue,{to:`/space/results`,"aria-label":K(`space.results`),"aria-current":u===`results`?`page`:void 0,className:W(wJ(u===`results`,t),c?`ml-1.5`:`mt-2`),children:[(0,J.jsx)(zi,{className:`size-5 shrink-0`}),t?(0,J.jsx)(EJ,{children:K(`space.results`)}):null]}),f.length?(0,J.jsx)(`div`,{className:W(`shrink-0 bg-border`,c?`mx-2 h-7 w-px`:W(`my-3 h-px`,t?`mx-2.5`:`w-7`))}):null,(0,J.jsx)(`nav`,{className:W(`flex min-h-0 min-w-0 flex-1 gap-1.5`,t?`items-stretch`:`items-center`,c?`flex-row overflow-x-auto`:`flex-col overflow-y-auto`),children:f.map(e=>(0,J.jsx)(kX,{of:e,children:(0,J.jsxs)(Ae,{to:e.to,"aria-label":e.label(),className:({isActive:e})=>wJ(e,t),children:[(0,J.jsx)(e.icon,{className:`size-5 shrink-0`}),t?(0,J.jsx)(EJ,{children:e.label()}):null]})},e.serial))})]}),(0,J.jsxs)(`div`,{className:W(`flex shrink-0 gap-2`,c?`flex-row pl-3`:`flex-col pt-3`,t?`items-stretch`:`items-center`),children:[(0,J.jsxs)(Ae,{to:`/settings`,"aria-label":K(`nav.settings`),className:({isActive:e})=>wJ(e,t),children:[(0,J.jsx)(to,{className:`size-5 shrink-0`}),t?(0,J.jsx)(EJ,{children:K(`nav.settings`)}):null]}),(0,J.jsx)(LY,{me:e,placement:`bar-end`,named:t})]}),p?(0,J.jsx)(AJ,{at:p,room:n,onClose:()=>m(null)}):null,l.element]})}function FJ(e){return W(`glass-press relative grid h-12 w-16 place-items-center rounded-full transition-colors`,e?`text-ink`:`text-ink-3`)}var IJ=68;function LJ({index:e}){let t=(0,q.useRef)(null),n=(0,q.useRef)(e);return(0,q.useEffect)(()=>{let r=n.current;n.current=e;let i=t.current;if(!i||r===null||e===null||r===e||matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let a=r*IJ,o=e*IJ;i.animate([{transform:`translateX(${a}px)`},{transform:`translateX(${(a+o)/2}px) scaleX(1.35) scaleY(0.92)`,offset:.45},{transform:`translateX(${o}px)`}],{duration:420,easing:`cubic-bezier(0.34, 1.3, 0.64, 1)`})},[e]),(0,J.jsx)(`span`,{ref:t,"aria-hidden":`true`,className:`pointer-events-none absolute top-1 left-1 h-12 w-16 rounded-full bg-ink/12 transition-opacity`,style:{transform:`translateX(${(e??0)*IJ}px)`,opacity:e===null?0:1}})}function RJ({me:e}){let t=Kl(aX().nav,Gl(e),Rl(e)),n=nt(`skills`),r=nt(`capabilities`),i=jJ(),[a,o]=(0,q.useState)(!1),[s,c]=(0,q.useState)(!1),l=te(),u=(0,q.useRef)(null),d=Su(),f=Jn(),{space:p}=Qn(),m=d??(f&&!p?.readOnly&&i!==`new`?{icon:ot,label:K(`home.new`),run:()=>l(`/new`)}:null);OY(u,a,()=>o(!1));let{pathname:h}=Ge();(0,q.useEffect)(()=>o(!1),[h]);let g=e=>!a&&i===e,_=a?2:i===`start`||i===`home`||i===`new`?0:i===`space`?1:i===`skills`||i===`capabilities`||i===`results`||i===`settings`?2:null,v=e=>{o(!1),l(e)},y=e=>W(`flex w-full items-center gap-3 rounded-lg px-3 py-2.5 text-left text-[0.9375rem] transition`,e?`bg-accent text-ink`:`text-ink-2 hover:bg-accent hover:text-ink`);return(0,J.jsxs)(`div`,{className:`fixed inset-x-0 bottom-[calc(0.5rem+env(safe-area-inset-bottom))] z-40 flex select-none justify-center gap-2.5 [-webkit-touch-callout:none]`,children:[(0,J.jsxs)(`nav`,{ref:u,"aria-label":pn.name,className:`liquid-glass relative flex gap-1 rounded-full p-1`,children:[(0,J.jsx)(LJ,{index:_}),(0,J.jsx)(ue,{to:`/`,"aria-label":K(`nav.home`),"aria-current":i===`home`||i===`start`?`page`:void 0,onClick:()=>o(!1),className:FJ(g(`home`)||g(`start`)),children:(0,J.jsx)(Fi,{className:`size-[1.375rem]`})}),(0,J.jsx)(ue,{to:`/space`,"aria-label":K(`nav.sources`),"aria-current":i===`space`?`page`:void 0,onClick:()=>o(!1),className:FJ(g(`space`)),children:(0,J.jsx)(qi,{className:`size-[1.375rem]`})}),(0,J.jsx)(`button`,{type:`button`,"aria-label":K(`nav.more`),"aria-expanded":a,"aria-haspopup":`menu`,onClick:()=>o(e=>!e),className:FJ(a||i===`skills`||i===`capabilities`||i===`results`||i===`settings`),children:(0,J.jsx)(gt,{className:`size-[1.375rem]`})}),a?(0,J.jsxs)(`div`,{role:`menu`,className:`absolute right-0 bottom-full mb-3 flex w-60 animate-rise flex-col rounded-2xl bg-card p-1.5 shadow-overlay ring-1 ring-border-soft`,children:[r?(0,J.jsxs)(`button`,{type:`button`,role:`menuitem`,className:y(i===`capabilities`),onClick:()=>v(`/capabilities`),children:[(0,J.jsx)(Ao,{className:`size-[1.125rem] shrink-0 text-ink-3`}),(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:K(`nav.capabilities`)})]}):n?(0,J.jsxs)(`button`,{type:`button`,role:`menuitem`,className:y(i===`skills`),onClick:()=>v(`/skills`),children:[(0,J.jsx)(_t,{className:`size-[1.125rem] shrink-0 text-ink-3`}),(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:K(`space.skills`)})]}):null,(0,J.jsxs)(`button`,{type:`button`,role:`menuitem`,className:y(i===`results`),onClick:()=>v(`/space/results`),children:[(0,J.jsx)(zi,{className:`size-[1.125rem] shrink-0 text-ink-3`}),(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:K(`space.results`)})]}),(0,J.jsxs)(`button`,{type:`button`,role:`menuitem`,className:y(i===`settings`),onClick:()=>v(`/settings`),children:[(0,J.jsx)(to,{className:`size-[1.125rem] shrink-0 text-ink-3`}),(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:K(`nav.settings`)})]}),t.map(e=>(0,J.jsx)(kX,{of:e,children:(0,J.jsxs)(`button`,{type:`button`,role:`menuitem`,className:y(!1),onClick:()=>v(e.to),children:[(0,J.jsx)(e.icon,{className:`size-[1.125rem] shrink-0 text-ink-3`}),(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.label()})]})},e.serial)),(0,J.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`}),(0,J.jsxs)(`button`,{type:`button`,role:`menuitem`,className:y(!1),onClick:()=>{o(!1),c(!0)},children:[(0,J.jsx)(Vi,{className:`size-[1.125rem] shrink-0 text-ink-3`}),(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:K(`about.nav`)})]})]}):null,s?(0,J.jsx)(q.Suspense,{fallback:null,children:(0,J.jsx)(CJ,{open:!0,me:e,onClose:()=>c(!1)})}):null]}),m?(0,J.jsx)(`button`,{type:`button`,"aria-label":m.label,title:m.label,onClick:m.run,className:`liquid-glass glass-press relative grid size-14 shrink-0 place-items-center rounded-full text-ink`,children:(0,J.jsx)(m.icon,{className:`size-6`})}):null]})}var zJ=[`schedule`,`webhook`,`record`,`wizard`],BJ=[`hour`,`day`,`week`,`month`],VJ=[`added`,`changed`,`became`],HJ=[`skip`,`allow`],UJ=[60,1440,10080],WJ=1440,GJ=/^([01]\d|2[0-3]):[0-5]\d$/;function KJ(e){try{return new Intl.DateTimeFormat(`en-US`,{timeZone:e}),!0}catch{return!1}}var qJ=_n({every:kn(BJ),weekday:wn().int().min(0).max(6).optional(),day:wn().int().min(1).max(28).optional(),time:Hn().regex(GJ),tz:Hn().min(1).refine(KJ,{message:`Unknown time zone.`}),overlap:kn(HJ).default(`skip`),maxLateMinutes:wn().int().min(5).max(44640).default(WJ)}).refine(e=>e.every!==`week`||e.weekday!==void 0,{message:`A weekly schedule names its weekday.`}).refine(e=>e.every!==`month`||e.day!==void 0,{message:`A monthly schedule names its day.`}),JJ=zn([_n({from:Hn().min(1)}).strict(),Vn()]),YJ=e=>e[e.kind]!==void 0,XJ={message:`A start carries the settings of its kind.`},ZJ=_n({id:Hn().min(1),kind:kn(zJ),on:yn().default(!0),schedule:qJ.optional(),webhook:_n({tokenHash:Hn().min(1)}).optional(),record:_n({source:Hn().min(1),event:kn(VJ),column:Hn().optional(),value:Vn().optional()}).refine(e=>e.event!==`became`||e.column&&e.value!==void 0,{message:`A 'became' start names the column and the value.`}).optional(),wizard:_n({id:Hn().min(1)}).optional(),answers:In(Hn(),JJ).default({}),allowChanges:yn().default(!1),passReviews:yn().default(!0),owner:Hn().optional(),handledUntil:Hn().optional(),lastRunAt:Hn().optional(),lastSkip:_n({at:Hn(),why:kn([`overlap`,`late`])}).optional(),failures:wn().int().min(0).default(0),pausedReason:Hn().optional()}),QJ=ZJ.refine(YJ,XJ);ZJ.partial({id:!0}).refine(YJ,XJ),An(QJ).max(20);var $J=new Map;function eY(e){let t=$J.get(e);return t||(t=new Intl.DateTimeFormat(`en-US`,{timeZone:e,hourCycle:`h23`,year:`numeric`,month:`numeric`,day:`numeric`,hour:`numeric`,minute:`numeric`,weekday:`short`}),$J.set(e,t)),t}var tY=[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`];function nY(e,t){let n={};for(let r of eY(t).formatToParts(e))n[r.type]=r.value;return{y:Number(n.year),m:Number(n.month),d:Number(n.day),h:Number(n.hour),min:Number(n.minute),weekday:tY.indexOf(n.weekday??`Sun`)}}function rY(e,t,n,r,i,a){let o=Date.UTC(e,t-1,n,r,i),s=o;for(let e=0;e<2;e++){let e=nY(new Date(s),a),t=Date.UTC(e.y,e.m-1,e.d,e.h,e.min);if(t===o)break;s+=o-t}return new Date(s)}var iY=36e5,aY=62;function*oY(e,t,n){let[r,i]=e.time.split(`:`).map(Number),a=nY(t,e.tz);for(let t=0;t<=aY;t++){let o=new Date(Date.UTC(a.y,a.m-1,a.d+t*n));(e.every===`day`||e.every===`week`&&o.getUTCDay()===e.weekday||e.every===`month`&&o.getUTCDate()===e.day)&&(yield rY(o.getUTCFullYear(),o.getUTCMonth()+1,o.getUTCDate(),r,i,e.tz))}}function sY(e,t){if(e.every===`hour`)return new Date((Math.floor(t.getTime()/iY)+1)*iY);for(let n of oY(e,t,1))if(n.getTime()>t.getTime())return n;return null}var cY={en:{hour:`Every hour`,day:`Every day at {time}`,week:`Every {weekday} at {time}`,month:`On the {day} of each month at {time}`,webhook:`When something arrives at the address`,added:`When a row is added to {source}`,became:`When {column} in {source} becomes “{value}”`,changed:`When a row in {source} changes`,wizard:`When {wizard} finishes`,sunday:`Sunday`,monday:`Monday`,tuesday:`Tuesday`,wednesday:`Wednesday`,thursday:`Thursday`,friday:`Friday`,saturday:`Saturday`},de:{hour:`Jede Stunde`,day:`Jeden Tag um {time}`,week:`Jeden {weekday} um {time}`,month:`Am {day}. jedes Monats um {time}`,webhook:`Wenn etwas an der Adresse eintrifft`,added:`Wenn eine Zeile zu {source} kommt`,became:`Wenn in {source} „{column}“ zu „{value}“ wird`,changed:`Wenn sich eine Zeile in {source} ändert`,wizard:`Wenn {wizard} fertig ist`,sunday:`Sonntag`,monday:`Montag`,tuesday:`Dienstag`,wednesday:`Mittwoch`,thursday:`Donnerstag`,friday:`Freitag`,saturday:`Samstag`}},lY=[`sunday`,`monday`,`tuesday`,`wednesday`,`thursday`,`friday`,`saturday`];function uY(e,t){if(t===`de`)return String(e);let n=e%10;return`${e}${e%100>=11&&e%100<=13?`th`:n===1?`st`:n===2?`nd`:n===3?`rd`:`th`}`}function dY(e,t,n={}){let r=(e,n)=>Fn(cY,e,t,n);switch(e.kind){case`schedule`:{let n=e.schedule;return n?r(n.every,{time:n.time,weekday:r(lY[n.weekday??0]??`sunday`),day:uY(n.day??1,t)}):``}case`webhook`:return r(`webhook`);case`record`:{let t=e.record,i=n.source??t?.source??``;return t?.event===`added`?r(`added`,{source:i}):t?.event===`became`?r(`became`,{source:i,column:t.column,value:String(t.value)}):r(`changed`,{source:i})}case`wizard`:return r(`wizard`,{wizard:n.wizard??e.wizard?.id??``})}}var fY={needs_you:{Icon:Po,tone:`bg-amber-tint text-amber`},reminder:{Icon:Po,tone:`bg-amber-tint text-amber`},done:{Icon:ft,tone:`bg-moss-tint text-moss`},failed:{Icon:Gr,tone:`bg-rose-tint text-rose`},paused:{Icon:qr,tone:`bg-rose-tint text-rose`}};function pY(){let e=De(),[t,n]=(0,q.useState)(!1),r=(0,q.useRef)(null);OY(r,t,()=>n(!1));let i=D({queryKey:[`notices`],queryFn:()=>a.get(`/api/studio/notices`),refetchInterval:3e4}),o=rt({mutationFn:e=>a.post(`/api/studio/notices/read`,{ids:e}),onSuccess:()=>e.invalidateQueries({queryKey:[`notices`]})}),s=i.data??[],c=s.filter(e=>!e.read).length;if(!s.length)return null;let l=new Intl.DateTimeFormat(Rn,{dateStyle:`short`,timeStyle:`short`});return(0,J.jsxs)(`div`,{ref:r,className:`relative shrink-0`,children:[(0,J.jsxs)(`button`,{type:`button`,"aria-label":K(`notices.title`),"aria-expanded":t,"aria-haspopup":`dialog`,onClick:()=>n(e=>!e),className:W(`relative flex size-8 items-center justify-center rounded-full text-ink-2 transition hover:bg-accent hover:text-ink`,t&&`bg-accent text-ink`),children:[(0,J.jsx)(B,{className:`size-[1.125rem]`}),c?(0,J.jsx)(`span`,{className:`absolute top-1 right-1 size-2 rounded-full bg-ember ring-2 ring-paper`}):null]}),t?(0,J.jsxs)(`div`,{role:`dialog`,"aria-label":K(`notices.title`),className:`absolute top-full right-0 z-20 mt-1.5 flex w-[min(24rem,calc(100vw-1.5rem))] origin-top-right animate-unfold flex-col overflow-hidden rounded-xl bg-card shadow-overlay ring-1 ring-border`,children:[(0,J.jsxs)(`div`,{className:`flex items-center justify-between px-3.5 pt-3 pb-2`,children:[(0,J.jsx)(`span`,{className:`font-medium text-[0.875rem]`,children:K(`notices.title`)}),c?(0,J.jsx)(`button`,{type:`button`,onClick:()=>o.mutate(`all`),className:`text-[0.8125rem] text-ink-3 hover:text-ink`,children:K(`notices.allRead`)}):null]}),(0,J.jsx)(`ul`,{className:`flex max-h-[60vh] flex-col divide-y divide-border-soft overflow-y-auto`,children:s.map(e=>{let{Icon:t,tone:r}=fY[e.kind],i=e.kind===`paused`?K(`notices.pausedHint`):[e.start?dY(e.start,Rn):null,e.detail].filter(Boolean).join(` · `);return(0,J.jsxs)(`li`,{className:W(`flex items-start gap-3 px-3.5 py-3`,!e.read&&`bg-paper-2/60`),children:[(0,J.jsx)(`span`,{className:W(`mt-0.5 flex size-7 shrink-0 items-center justify-center rounded-lg`,r),children:(0,J.jsx)(t,{className:`size-3.5`})}),(0,J.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,J.jsx)(`div`,{className:`text-[0.875rem]`,children:K(`notices.${e.kind}`,{wizard:e.wizard.title})}),i?(0,J.jsx)(`div`,{className:`mt-0.5 text-[0.8125rem] text-ink-3 leading-snug`,children:i}):null,(0,J.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-3 text-[0.8125rem]`,children:[(0,J.jsx)(ue,{to:`/edit/${e.wizard.id}${e.runId?`?run=${e.runId}`:``}`,onClick:()=>{n(!1),e.read||o.mutate([e.id])},className:`font-medium text-cobalt hover:underline`,children:K(`notices.open`)}),(0,J.jsx)(`span`,{className:`text-ink-4`,children:l.format(new Date(e.at))})]})]})]},e.id)})})]}):null]})}var mY=(0,q.lazy)(()=>Wn(()=>import(`./ChangelogDialog-F7gj0WCW.js`).then(e=>({default:e.ChangelogDialog})),__vite__mapDeps([33,1,3,14,18,7,19]))),hY=`wizards.update-banner`;function gY(){try{return localStorage.getItem(hY)}catch{return null}}function _Y(){let[e,t]=(0,q.useState)(gY),[n,r]=(0,q.useState)(!1),{data:i,latest:a,apply:o,busy:s,progress:c}=nr(),l=i&&!i.newer?i.updated?.to??null:null,u=l??(i?.newer?a:null);if(!(i&&u)||e===u&&i.applying===`idle`)return null;let d=()=>{try{localStorage.setItem(hY,u)}catch{}t(u)},f=c??(l?K(`about.update.updated`,{v:u}):i.pending?.version===u?K(`about.update.ready`,{v:u}):K(`about.update.available`,{v:u}));return(0,J.jsxs)(`div`,{className:`flex items-center gap-3 border-border-soft border-b bg-ember-tint px-4 py-2 text-[0.8125rem] text-ink-2 sm:px-6`,children:[s?(0,J.jsx)(de,{className:`size-4 shrink-0 text-ember-strong`}):(0,J.jsx)(I,{className:`size-4 shrink-0 text-ember-strong`}),(0,J.jsx)(`p`,{className:`min-w-0 flex-1`,children:f}),s?null:(0,J.jsx)(`button`,{type:`button`,onClick:()=>r(!0),className:`shrink-0 underline transition hover:text-ink`,children:K(`about.update.notes`)}),n?(0,J.jsx)(q.Suspense,{fallback:null,children:(0,J.jsx)(mY,{open:!0,version:u,onClose:()=>r(!1)})}):null,i.canApply&&!l&&(i.applying===`idle`||i.applying===`failed`)?(0,J.jsx)(z,{size:`sm`,disabled:o.isPending,onClick:()=>o.mutate(),children:K(`about.update.install`)}):null,s?null:(0,J.jsx)(Re,{label:K(`install.app.close`),onClick:d,className:`size-8`,children:(0,J.jsx)(ct,{className:`size-4`})})]})}var vY=[],yY=new Set;function bY(e){vY=e;for(let e of yY)e()}function xY(e){let t=JSON.stringify(e);(0,q.useEffect)(()=>(bY(JSON.parse(t)),()=>bY([])),[t])}function SY(){return vY}function CY(){return(0,q.useSyncExternalStore)(e=>(yY.add(e),()=>yY.delete(e)),()=>vY)}function wY({alone:e=!1}){let t=CY();return t.length?(0,J.jsx)(`nav`,{"aria-label":K(`nav.breadcrumb`),className:`flex min-w-0 items-center text-[0.9375rem] max-sm:hidden`,children:t.map((n,r)=>(0,J.jsxs)(q.Fragment,{children:[e&&r===0?null:(0,J.jsx)(`span`,{className:W(`mr-2 text-ink-4`,r===0?`-ml-1 sm:-ml-2`:`ml-2`),children:`/`}),n.to&&r<t.length-1?(0,J.jsx)(ue,{to:n.to,className:`truncate text-ink-3 transition hover:text-ink`,children:n.label}):(0,J.jsx)(`span`,{"aria-current":`page`,className:`truncate font-medium text-ink`,children:n.label})]},`${r}:${n.label}`))}):null}var TY=e=>e.manageUrl??e.account?.url??null;function EY(e){let t=TY(e);return t?`${t}/billing`:null}function DY(e,t){return e.mode===`local`?e.account?e.account.signedIn?`linked`:`expired`:t?`alone`:null:null}function OY(e,t,n){let r=(0,q.useRef)(n);r.current=n,(0,q.useEffect)(()=>{if(!t)return;let n=t=>{e.current?.contains(t.target)||r.current()},i=e=>{e.key===`Escape`&&r.current()};return document.addEventListener(`pointerdown`,n),document.addEventListener(`keydown`,i),()=>{document.removeEventListener(`pointerdown`,n),document.removeEventListener(`keydown`,i)}},[e,t])}function kY(e,t,n){return e===`below`?n:ts(t,e===`bar-start`?`start`:`end`)}var AY=e=>`oklch(from ${e} calc(0.16 + 0.83 * clamp(0, (0.65 - l) * 1000, 1)) 0.01 h)`;function jY({space:e,name:t,size:n=`md`}){let r=e?.brand.colors?.[0]?.value,i=Yn(t??e?.name??``),a=(0,J.jsx)(`span`,{className:W(`grid shrink-0 place-items-center font-semibold tracking-wide`,n===`md`?`size-10 rounded-lg text-[0.8125rem]`:n===`sm`?`size-9 rounded-lg text-[0.75rem]`:`size-6 rounded-md text-[0.5625rem]`,r?null:`bg-paper-3 text-ink ring-1 ring-border`),style:r?{background:r,color:AY(r)}:void 0,children:i||(0,J.jsx)(Ti,{className:`size-4`})});return e?.origin===`local`?(0,J.jsxs)(`span`,{className:`relative shrink-0`,title:K(`readonly.space`),children:[a,(0,J.jsx)(`span`,{className:`-right-1 -bottom-1 absolute grid size-4 place-items-center rounded-full bg-amber ring-2 ring-paper`,children:(0,J.jsx)(Gi,{className:`size-2.5 text-paper`})})]}):a}function MY(e){let{spaces:t}=Qn();return e.mode===`managed`&&!!e.tenant.name&&e.limits.spaces===1&&t.length<=1}function NY({me:e,placement:t,label:n,className:r,children:i}){let a=te(),{position:o,phone:s}=Qo(),{space:c,spaces:l,select:u}=Qn(),f=MY(e),p=uu(e),m=Jn(),[h,g]=(0,q.useState)(!1),[_,v]=(0,q.useState)(!1),[y,b]=(0,q.useState)(!1),[x,S]=(0,q.useState)(!1),C=cu(e),[w,T]=(0,q.useState)({top:0,left:0}),D=(0,q.useRef)(null);OY(D,h,()=>g(!1));let O=e.limits.spaces,k=O!==null&&l.length>=O,A=`flex w-full items-center gap-3 rounded-lg px-3 py-2 text-left text-[0.875rem] text-ink-2 transition hover:bg-accent hover:text-ink`;return(0,J.jsx)(`div`,{className:`shrink-0`,ref:D,children:(0,J.jsxs)(`div`,{className:`relative`,children:[(0,J.jsx)(`button`,{type:`button`,onClick:e=>{let t=e.currentTarget.getBoundingClientRect();T({top:t.bottom+6,left:t.left}),g(e=>!e)},"aria-expanded":h,"aria-haspopup":`menu`,"aria-label":n,title:f?void 0:K(`nav.switchSpace`),className:typeof r==`function`?r(h):r,children:i}),h?(0,J.jsxs)(`div`,{role:`menu`,style:t===`below`?{position:`fixed`,...w}:void 0,className:W(`z-50 w-72 animate-rise rounded-xl bg-card p-1.5 shadow-overlay ring-1 ring-border-soft`,t===`below`?null:W(`absolute`,kY(t,o,`top-10 left-0`))),children:[f&&ou(e)&&!s?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`div`,{className:`px-2 pt-1.5 pb-1 text-[0.75rem] text-ink-3`,children:K(`organizations.mine`)}),(0,J.jsx)(du,{me:e,onDone:()=>g(!1)}),(0,J.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`})]}):null,f&&!(ou(e)&&s)?null:C&&ou(e)?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(`button`,{type:`button`,role:`menuitem`,className:`flex w-full items-center gap-3 rounded-lg px-2 py-1.5 text-left transition hover:bg-accent`,onClick:()=>{g(!1),S(!0)},children:[(0,J.jsx)(lu,{org:C,size:`xs`}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col leading-tight`,children:[(0,J.jsx)(`span`,{className:`truncate font-semibold text-[0.875rem] text-ink`,children:C.name}),C.plan?(0,J.jsx)(`span`,{className:`truncate text-[0.75rem] text-ink-4`,children:C.plan.name}):null]}),(0,J.jsx)(`span`,{className:`shrink-0 text-[0.8125rem] text-ink-3`,children:K(`organizations.switchShort`)}),(0,J.jsx)(Le,{className:`size-4 shrink-0 text-ink-4`})]}),(0,J.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`})]}):e.tenant.name?(0,J.jsx)(`div`,{className:`truncate px-2 pt-1.5 pb-1 text-[0.75rem] text-ink-3`,children:e.tenant.name}):null,(f?[]:l).map(e=>{let t=e.id===c?.id;return(0,J.jsxs)(`button`,{type:`button`,role:`menuitem`,className:`flex w-full items-center gap-3 rounded-lg px-2 py-1.5 text-left transition hover:bg-accent`,onClick:()=>{g(!1),t?a(`/`):u(e.id)},children:[(0,J.jsx)(jY,{space:e,size:`sm`}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col leading-tight`,children:[(0,J.jsx)(`span`,{className:W(`truncate text-[0.875rem]`,t?`font-semibold text-ink`:`font-medium text-ink-2`),children:e.name}),(0,J.jsx)(`span`,{className:`truncate text-[0.75rem] text-ink-4`,children:K(`nav.wizardCount`,{n:e.wizardCount})})]}),t?(0,J.jsx)(ft,{className:`size-4 shrink-0 text-ember-strong`}):null]},e.id)}),f?null:(0,J.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`}),[{to:`/`,icon:E,label:K(f?`nav.allWizards`:`nav.wizardsInSpace`),show:!0},{to:`/new`,icon:ot,label:K(`nav.addWizard`),show:m}].filter(e=>e.show).map(e=>(0,J.jsxs)(`button`,{type:`button`,role:`menuitem`,className:A,onClick:()=>{g(!1),a(e.to)},children:[(0,J.jsx)(e.icon,{className:`size-4 shrink-0 text-ink-3`}),(0,J.jsx)(`span`,{className:`truncate`,children:e.label})]},e.to)),f&&!ou(e)?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`}),(0,J.jsxs)(`button`,{type:`button`,role:`menuitem`,className:A,onClick:()=>{g(!1),p()},children:[(0,J.jsx)(to,{className:`size-4 shrink-0 text-ink-3`}),(0,J.jsx)(`span`,{className:`truncate`,children:K(`organizations.manage`)})]})]}):null,c&&!c.readOnly&&!f?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`}),(0,J.jsxs)(`button`,{type:`button`,role:`menuitem`,className:A,onClick:()=>{g(!1),b(!0)},children:[(0,J.jsx)(d,{className:`size-4 shrink-0 text-ink-3`}),(0,J.jsx)(`span`,{className:`truncate`,children:K(`nav.renameSpace`)})]})]}):null,m&&!k?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`div`,{className:`mx-2 my-1.5 h-px bg-border-soft`}),(0,J.jsxs)(`button`,{type:`button`,role:`menuitem`,className:A,onClick:()=>{g(!1),v(!0)},children:[(0,J.jsx)(ot,{className:`size-4 shrink-0 text-ink-3`}),(0,J.jsx)(`span`,{className:`flex min-w-0 flex-1 flex-col leading-tight`,children:(0,J.jsx)(`span`,{className:`truncate`,children:K(`nav.addSpace`)})})]})]}):null]}):null,(0,J.jsx)(LU,{open:_,onClose:()=>v(!1)}),ou(e)?(0,J.jsx)(pu,{me:e,open:x,onClose:()=>S(!1)}):null,c?(0,J.jsx)(PY,{space:c,open:y,onClose:()=>b(!1)}):null]})})}function PY({space:e,open:t,onClose:n}){let r=De(),[i,o]=(0,q.useState)(e.name);(0,q.useEffect)(()=>{t&&o(e.name)},[t,e.name]);let s=rt({mutationFn:()=>a.patch(`/api/studio/spaces/${e.id}`,{name:i.trim()}),onSuccess:async()=>{await r.invalidateQueries({queryKey:F.spaces()}),n()}});return(0,J.jsx)(H,{open:t,onClose:n,title:K(`nav.renameSpace`),children:(0,J.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),i.trim()&&s.mutate()},children:[(0,J.jsx)(ie,{autoFocus:!0,maxLength:80,"aria-label":K(`nav.renameSpace`),value:i,onChange:e=>o(e.target.value)}),(0,J.jsxs)(`div`,{className:`mt-5 flex justify-end gap-2`,children:[(0,J.jsx)(z,{variant:`ghost`,onClick:n,children:K(`common.cancel`)}),(0,J.jsx)(z,{type:`submit`,busy:s.isPending,disabled:!i.trim(),children:K(`settings.save`)})]})]})})}function FY({me:e,space:t}){let n=e.mode===`local`||t.origin===`local`,r=n?Gi:ti,i=K(n?`nav.spaceLocal`:`nav.spaceCloud`);return(0,J.jsx)(`span`,{title:i,className:`grid size-6 shrink-0 place-items-center text-ink-4`,children:(0,J.jsx)(r,{className:`size-3.5`,"aria-label":i})})}function IY({me:e}){let{space:t}=Qn(),{phone:n}=Qo(),r=MY(e);return t?r&&e.tenant.name?(0,J.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[(0,J.jsxs)(NY,{me:e,placement:`below`,label:e.tenant.name,className:e=>W(n?`-ml-1 flex max-w-[16rem] items-center gap-2.5 rounded-xl py-1 pr-2 pl-1`:`-mx-1 flex max-w-[16rem] items-center gap-1 rounded-md px-2 py-0.5`,`text-left font-medium text-[0.9375rem] text-ink transition hover:bg-accent`,e&&`bg-accent`),children:[n?(0,J.jsx)(jY,{space:t,name:e.tenant.name,size:`sm`}):null,(0,J.jsx)(`span`,{className:`truncate`,children:e.tenant.name}),(0,J.jsx)(Ur,{className:`size-3.5 shrink-0 text-ink-4`})]}),(0,J.jsx)(FY,{me:e,space:t})]}):(0,J.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,children:[e.tenant.name&&!n?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(fu,{me:e,className:`max-lg:hidden`}),(0,J.jsx)(`span`,{className:`text-ink-4 max-lg:hidden`,"aria-hidden":`true`,children:`/`})]}):null,(0,J.jsx)(NY,{me:e,placement:`below`,label:t.name,className:e=>W(n?`-ml-1 flex max-w-[16rem] items-center gap-2.5 rounded-xl py-1 pr-2 pl-1 text-left font-medium text-[0.9375rem] text-ink transition hover:bg-accent`:`-mx-1 max-w-[16rem] translate-y-[0.5px] truncate rounded-md px-2 py-0.5 text-left font-medium text-[0.9375rem] text-ink transition hover:bg-accent`,e&&`bg-accent`),children:n?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(jY,{space:t,size:`sm`}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-col leading-tight`,children:[e.tenant.name?(0,J.jsx)(`span`,{className:`truncate font-normal text-[0.75rem] text-ink-3`,children:e.tenant.name}):null,(0,J.jsx)(`span`,{className:`truncate`,children:t.name})]})]}):t.name}),(0,J.jsx)(FY,{me:e,space:t})]}):null}function LY({me:e,placement:t=`below`,named:n}){let[r,i]=(0,q.useState)(!1),a=(0,q.useRef)(null),o=te(),{position:s,phone:c}=Qo();OY(a,r,()=>i(!1));let l=cs(),[u,d]=(0,q.useState)(!1),f=Yn(e.user.name),p=oT().dev,m=DY(e,nt(`account`)),h=nt(`capabilities`),g=e.mode===`managed`&&Gn(e.features,`organizationSettings`),_=`flex w-full items-center gap-3 rounded-lg px-3 py-2.5 text-left text-[0.875rem] text-ink-2 hover:bg-accent hover:text-ink`;return(0,J.jsxs)(`div`,{className:W(`relative`,n&&`w-full`),ref:a,children:[(0,J.jsxs)(`button`,{type:`button`,onClick:()=>i(e=>!e),className:n?W(`flex w-full items-center gap-3 rounded-lg p-0.5 pr-2 text-left transition hover:bg-ink/10`,r&&`bg-ink/10`):`block shrink-0 rounded-full`,"aria-label":e.user.name||`Menu`,children:[(0,J.jsxs)(`span`,{className:W(`relative flex shrink-0 items-center justify-center rounded-full bg-ember-tint font-semibold text-[0.8125rem] text-ember-strong ring-1 ring-border-soft`,t===`below`?`size-9`:`size-10`),children:[e.user.image?(0,J.jsx)(`img`,{src:e.user.image,alt:``,className:`size-full rounded-full object-cover`}):f,m===`linked`||m===`expired`?(0,J.jsx)(`span`,{title:m===`linked`?K(`nav.connected`,{host:_H(e.account?.cloudUrl??``)}):K(`nav.expired`),className:`-right-1 -bottom-1 absolute flex size-4 items-center justify-center rounded-full bg-card ring-1 ring-border-soft`,children:m===`linked`?(0,J.jsx)(ti,{className:`size-2.5 text-moss`}):(0,J.jsx)(qe,{className:`size-2.5 text-amber`})}):null]}),n?(0,J.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-medium text-[0.875rem] text-ink-2`,children:e.user.name}):null]}),r?(0,J.jsxs)(`div`,{className:W(`absolute z-50 w-72 animate-rise rounded-xl bg-card p-1.5 shadow-overlay ring-1 ring-border-soft`,kY(t,s,`top-11 right-0`)),children:[(0,J.jsxs)(`div`,{className:`px-3 pt-2 pb-2.5`,children:[(0,J.jsxs)(`div`,{className:`truncate font-medium text-[0.875rem]`,children:[e.user.name,m===`alone`?(0,J.jsxs)(`span`,{className:`font-normal text-ink-4`,children:[` (`,K(`nav.local`),`)`]}):null]}),(0,J.jsx)(`div`,{className:`truncate text-[0.75rem] text-ink-3`,children:e.user.email}),e.tenant.name?(0,J.jsxs)(`div`,{className:`mt-1.5 flex items-center gap-1.5 text-[0.75rem] text-ink-2`,children:[(0,J.jsx)(Fr,{className:`size-3.5 shrink-0 text-ink-4`,"aria-hidden":`true`}),(0,J.jsx)(`span`,{className:`truncate`,children:e.tenant.name})]}):null]}),m?(0,J.jsxs)(`button`,{type:`button`,className:`mx-1.5 mb-1.5 flex w-[calc(100%-0.75rem)] items-start gap-2.5 rounded-lg bg-paper-2 px-2.5 py-2 text-left text-[0.8125rem] text-ink-2 hover:text-ink`,onClick:()=>{i(!1),o(`/settings/account`)},children:[m===`linked`?(0,J.jsx)(ti,{className:`mt-0.5 size-4 shrink-0 text-moss`}):m===`expired`?(0,J.jsx)(qe,{className:`mt-0.5 size-4 shrink-0 text-amber`}):(0,J.jsx)(Gi,{className:`mt-0.5 size-4 shrink-0 text-ink-3`}),(0,J.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col leading-snug`,children:[(0,J.jsx)(`span`,{className:`break-words`,children:m===`linked`?K(`nav.connected`,{host:_H(e.account?.cloudUrl??``)}):K(m===`expired`?`nav.expired`:`nav.onlyHere`)}),(0,J.jsx)(`span`,{className:`font-medium text-ink tabular-nums`,children:m===`linked`?e.account?.credits!==null&&e.account?.credits!==void 0?K(`nav.credits`,{n:Math.floor(e.account.credits).toLocaleString(Rn)}):null:K(m===`expired`?`account.signInAgain`:`account.signIn`)})]})]}):null,(0,J.jsxs)(`button`,{type:`button`,className:_,onClick:()=>{i(!1),o(g?`/account`:`/settings/account`)},children:[(0,J.jsx)(Po,{className:`size-4`}),` `,K(`konto.title`)]}),h?(0,J.jsxs)(`button`,{type:`button`,className:_,onClick:()=>{i(!1),o(`/account/connections`)},children:[(0,J.jsx)(A,{className:`size-4`}),` `,K(`konto.connections`)]}):null,!g&&e.manageUrl?(0,J.jsxs)(`a`,{className:_,href:`${e.manageUrl}/account`,target:`_blank`,rel:`noreferrer`,children:[(0,J.jsx)(ai,{className:`size-4`}),` `,K(`nav.account`)]}):null,c&&!ns()?(0,J.jsxs)(`button`,{type:`button`,className:_,onClick:()=>{i(!1),l?ls(l):d(!0)},children:[(0,J.jsx)(Xe,{className:`size-4`}),` `,K(`install.app.action`)]}):null,(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2 text-[0.875rem] text-ink-2`,children:[K(`nav.theme`),(0,J.jsx)(gH,{})]}),(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2 text-[0.875rem] text-ink-2`,children:[K(`nav.language`),(0,J.jsx)(ur,{tone:`surface`})]}),e.assistantDev?(0,J.jsxs)(`div`,{className:`flex items-center justify-between gap-3 px-3 py-2 text-[0.875rem] text-ink-2`,children:[K(`assistant.dev`),(0,J.jsx)(Ve,{checked:p,onChange:e=>aT({dev:e}),label:K(`assistant.dev`)})]}):null,e.mode===`managed`?(0,J.jsxs)(`button`,{type:`button`,className:_,onClick:()=>{i(!1),Tl({where:`studio`})},children:[(0,J.jsx)(Ze,{className:`size-4`}),` `,K(`report.open`)]}):null,e.mode===`managed`?(0,J.jsxs)(`button`,{type:`button`,className:_,onClick:()=>void Zn(),children:[(0,J.jsx)(ra,{className:`size-4`}),` `,K(`nav.logout`)]}):null]}):null,(0,J.jsx)(Xl,{open:u,onClose:()=>d(!1)})]})}var RY=(0,q.createContext)(null),zY=(0,q.createContext)(null);function BY({children:e}){let t=(0,q.useContext)(zY),n=(0,J.jsx)(`div`,{className:`flex w-full min-w-0 flex-col overflow-hidden bg-background md:w-[17rem] md:rounded-xl md:shadow-elevated md:dark:ring-1 md:dark:ring-border-soft`,children:e});return t?(0,tu.createPortal)(n,t):n}function VY({me:e,sidebar:t,children:n}){let r=nt(`startTriggers`),i=nt(`durableRuns`),a=nt(`orgSpaces`),{phone:o}=Qo(),s=Ge().pathname.startsWith(`/account`),c=(0,q.useContext)(RY),l=(0,J.jsxs)(`header`,{className:W(`flex h-12 shrink-0 items-center gap-2 coarse:h-14 sm:gap-3`,c?`pr-1 pl-0.5`:`px-3 sm:px-4 md:px-5`),children:[a&&t&&!s?(0,J.jsx)(nW,{open:t.open,onToggle:t.onToggle}):null,s?null:a?(0,J.jsx)(rW,{me:e}):(0,J.jsx)(IY,{me:e}),(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center`,children:[(0,J.jsx)(wY,{alone:s}),n]}),r||i?(0,J.jsx)(pY,{}):null,(0,J.jsx)(`div`,{ref:CT,className:`flex shrink-0 items-center empty:hidden`}),s||!o?null:(0,J.jsx)(au,{me:e,look:`row`,stack:!0}),o?(0,J.jsx)(LY,{me:e}):null]});return c?(0,tu.createPortal)(l,c):l}var HY=`studio-scroll`;function UY(){return document.getElementById(`studio-scroll`)??document.documentElement}var WY={left:`md:py-2 md:pr-2`,right:`md:py-2 md:pl-2`,top:`md:px-2 md:pb-2`,bottom:`md:px-2 md:pt-2`},GY={left:`pt-2 pr-2`,right:`pt-2 pl-2`,top:`px-2`,bottom:`px-2 pt-2`},KY={left:`flex-row`,right:`flex-row-reverse`,top:`flex-col`,bottom:`flex-col-reverse`};function qY({me:e,wide:t,full:n,children:r}){let{position:i,phone:a}=Qo(),o=(0,q.useRef)(null),s=a&&!n?`calc(4.75rem + env(safe-area-inset-bottom))`:`0px`,c=nt(`goose`),l=Tj()&&c&&!n,u=es(!!n||l);xU(e.tenant.id);let d=nt(`orgSpaces`)&&!a,[f,p]=(0,q.useState)(null),[m,h]=(0,q.useState)(null);return(0,J.jsxs)(`div`,{className:W(`flex h-dvh overflow-hidden bg-sidebar`,KY[i]),children:[a?n?null:(0,J.jsx)(RJ,{me:e}):(0,J.jsx)(PJ,{me:e,labels:u.shown,room:u.room}),(0,J.jsx)(RY.Provider,{value:d?f:null,children:(0,J.jsx)(zY.Provider,{value:a||n?null:m,children:(0,J.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[d?(0,J.jsx)(`div`,{ref:p,className:W(`shrink-0`,GY[i])}):null,(0,J.jsxs)(`div`,{className:W(`flex min-h-0 min-w-0 flex-1 md:gap-2`,WY[i],d&&`md:pt-0`),children:[(0,J.jsx)(`div`,{ref:h,className:`hidden min-h-0 shrink-0 md:flex md:empty:hidden`}),(0,J.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background md:rounded-xl md:shadow-elevated md:dark:ring-1 md:dark:ring-border-soft`,children:[e.impersonation?(0,J.jsx)(St,{name:e.user.name||e.user.email,until:e.impersonation.until}):null,(0,J.jsx)(_Y,{}),(0,J.jsx)(me,{}),(0,J.jsx)(eu,{me:e}),(0,J.jsx)(ig,{me:e}),n?(0,J.jsx)(`main`,{className:`relative flex min-h-0 flex-1 flex-col overflow-hidden`,children:r}):(0,J.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[(0,J.jsx)(VY,{me:e}),(0,J.jsxs)(`div`,{ref:o,className:`relative flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,J.jsx)(`main`,{id:HY,className:`relative min-h-0 flex-1 overflow-y-auto`,style:{paddingBottom:`max(var(--assistant-dock, 0px), ${s})`},children:(0,J.jsx)(`div`,{className:W(`mx-auto w-full px-3 pt-4 pb-12 sm:px-6 sm:pt-6`,t?`max-w-[88rem]`:`max-w-5xl`),children:r})}),c&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(yj,{column:o}),(0,J.jsx)(Dj,{})]}),(0,J.jsx)(NO,{})]})]})]}),c&&!n?(0,J.jsx)(Ej,{}):null]})]})})})]})}function JY(){return[{id:`info`,label:K(`space.info`),icon:yi},{id:`brand`,label:K(`space.brand`),icon:vo},{id:`knowledge`,label:K(`space.knowledge`),icon:kr},{id:`files`,label:K(`space.dateien`),icon:xi},{id:`data`,label:K(`space.data`),icon:C},{id:`page`,label:K(`space.page`),icon:pt},{id:`clients`,label:K(`space.clients`),icon:Io}]}function YY(e,t){let n=[...e];for(let e of t.spaceParts){let r=n.findIndex(t=>t.id===(e.after??`data`))+1;for(;r<n.length&&t.spaceParts.some(e=>e.id===n[r].id);)r++;n.splice(r,0,{id:e.id,label:e.label(),icon:e.icon})}return n}function XY(e){return e===`info`||e===`brand`||e===`knowledge`||e===`data`||e===`files`||e===`page`||e===`results`||e===`skills`||e===`clients`}var ZY=[{id:`base`,group:`info`,label:`space.base`,icon:tt},{id:`facts`,group:`info`,label:`space.facts`,icon:kt},{id:`links`,group:`info`,label:`space.links`,icon:A},{id:`identity`,group:`brand`,label:`space.identity`,icon:tt},{id:`logos`,group:`brand`,label:`space.logos`,icon:ro},{id:`colors`,group:`brand`,label:`space.colors`,icon:ya},{id:`typography`,group:`brand`,label:`space.typography`,icon:pr},{id:`assets`,group:`brand`,label:`space.assets`,icon:Li},{id:`voice`,group:`brand`,label:`space.voice`,icon:da},{id:`documents`,group:`knowledge`,label:`space.documents`,icon:dt},{id:`page`,group:`page`,label:`page.sectionPage`,icon:pt},{id:`page-words`,group:`page`,label:`page.sectionWords`,icon:tt},{id:`page-wizards`,group:`page`,label:`page.sectionWizards`,icon:Yi},{id:`clients`,group:`clients`,label:`clients.title`,icon:Io}],QY=ZY.map(e=>e.id);function $Y(e,t){let n=t.spaceSections.find(t=>t.id===e);return ZY.find(t=>t.id===e)?.group??(n?n.group??`knowledge`:null)}function eX(e,t){let n=ZY.filter(t=>t.group===e).map(e=>({id:e.id,label:K(e.label),icon:e.icon})),r=new Map;for(let n of t.spaceSections){if((n.group??`knowledge`)!==e)continue;let t=`${n.grouped===!1?`-`:`+`}${n.plugin}`,i=r.get(t)??[];i.push({id:n.id,label:n.label(),icon:n.icon}),r.set(t,i)}return[...n.length?[{plugin:null,label:null,sections:n}]:[],...[...r].map(([e,n])=>{let r=e.slice(1);return{plugin:r,label:e[0]===`-`?null:t.plugins.find(e=>e.id===r)?.name??r,sections:n}})]}globalThis.__WIZARDS_STUDIO__={react:q,jsx:J,reactDom:{createPortal:tu.createPortal,flushSync:tu.flushSync},router:{Link:ue,Navigate:pe,NavLink:Ae,useLocation:Ge,useNavigate:te,useParams:Ue,useSearchParams:Te},query:{useMutation:rt,useQuery:D,useQueryClient:De},ui:Ie,sdk:Vo};var tX=0,nX={status:`idle`,plugins:[],canReload:!1,problems:[],failed:{},pages:[],nav:[],sections:[],spaceSections:[],spaceParts:[],spaceMenus:{},shareSections:[],shareSetups:[],cards:[],knowledgeSources:[],mountKinds:[]},rX=new Set;function iX(e){nX={...nX,...e};for(let e of rX)e()}function aX(){return(0,q.useSyncExternalStore)(e=>(rX.add(e),()=>rX.delete(e)),()=>nX)}var oX=new Set([`account`,`space`,`connectors`,`models`,`build`,`plugins`]),sX=new Set([`info`,`brand`,`knowledge`,`data`,`page`,`results`]),cX=new Map,lX=null,uX=e=>`${e.script}|${e.styles}`,dX=e=>`__wizardsPlugin_${e.replaceAll(`-`,`_`)}`;function fX(){let{space:e}=Qn(),t=e?.id,n=e?.name??``,r=e?.readOnly??!1,i=JSON.stringify({name:e?.brand.name??``,colors:(e?.brand.colors??[]).map(({name:e,value:t})=>({name:e,value:t})),fonts:(e?.brand.fonts??[]).map(({family:e,role:t,weights:n})=>({family:e,role:t,weights:n}))});return(0,q.useMemo)(()=>t?{id:t,name:n,readOnly:r,brand:JSON.parse(i)}:null,[t,n,r,i])}var pX=(0,q.createContext)(null);function mX({part:e,children:t}){return(0,J.jsx)(pX.Provider,{value:e,children:t})}function hX(e){let t=(0,q.useContext)(pX),n=JSON.stringify(e.map(e=>[e.id,e.label]));(0,q.useEffect)(()=>{if(t)return iX({spaceMenus:{...nX.spaceMenus,[t]:e}}),()=>{let{[t]:e,...n}=nX.spaceMenus;iX({spaceMenus:n})}},[t,n])}function gX({plugin:e,...t}){return HT({...t,plugin:e}),null}function _X(e,t){let{id:n}=e,r=e=>`/api/studio/plugins/${n}${e.startsWith(`/`)?e:`/${e}`}`,i=e=>e.filter(e=>e.plugin!==n);return{plugin:{id:n,name:e.name,version:e.version},registerPage(e){let r=e.path.split(`/`)[1]??``;if(!e.path.startsWith(`/`)||U.has(r))throw Error(`"${e.path}" is an address of the studio itself.`);if([...i(nX.pages),...t.pages].some(t=>t.path===e.path))throw Error(`"${e.path}" is registered already.`);t.pages.push({...e,plugin:n,serial:++tX})},registerNav(e){t.nav.push({...e,plugin:n,serial:++tX})},registerSettingsSection(e){let r=[...i(nX.sections),...t.sections].some(t=>t.id===e.id);if(oX.has(e.id)||r)throw Error(`The settings have a section "${e.id}" already.`);t.sections.push({...e,plugin:n,serial:++tX})},registerSpaceSection(e){let r=[...i(nX.spaceSections),...t.spaceSections].some(t=>t.id===e.id);if(QY.includes(e.id)||r)throw Error(`The space page has a section "${e.id}" already.`);t.spaceSections.push({...e,plugin:n,serial:++tX})},registerSpacePart(e){let r=[...i(nX.spaceParts),...t.spaceParts].some(t=>t.id===e.id);if(!/^[a-z][a-z0-9-]{0,39}$/.test(e.id)||sX.has(e.id)||r)throw Error(`The space page has a part "${e.id}" already.`);t.spaceParts.push({...e,plugin:n,serial:++tX})},registerShareSection(e){if([...i(nX.shareSections),...t.shareSections].some(t=>t.runner===e.runner))throw Error(`The runner "${e.runner}" has a share section already.`);t.shareSections.push({...e,plugin:n,serial:++tX})},registerShareSetup(e){if([...i(nX.shareSetups),...t.shareSetups].some(t=>t.runner===e.runner))throw Error(`The runner "${e.runner}" has a share setup already.`);t.shareSetups.push({...e,plugin:n,serial:++tX})},registerAssistantCard(e){if(t.cards.some(t=>t.tool===e.tool))throw Error(`The tool "${e.tool}" has a card already.`);t.cards.push({...e,plugin:n,serial:++tX})},registerKnowledgeSource(e){if([...i(nX.knowledgeSources),...t.knowledgeSources].some(t=>t.kind===e.kind))throw Error(`The source kind "${e.kind}" is taken.`);t.knowledgeSources.push({...e,plugin:n,serial:++tX})},registerMountKind(e){if([...i(nX.mountKinds),...t.mountKinds].some(t=>t.kind===e.kind)||e.kind===`folder`)throw Error(`The mount kind "${e.kind}" is taken.`);t.mountKinds.push({...e,plugin:n,serial:++tX})},useSpace:fX,useSpaceMenu:hX,useCrumbs:xY,Assistant:e=>(0,J.jsx)(gX,{plugin:n,...e}),useAssistantPage:e=>HT({...e,plugin:n}),useAssistantTool:(e,t,r)=>EE(`${n.replaceAll(`-`,`_`)}_${e}`,t,r),i18n:{register:e=>(t,n)=>{let r=e[Rn]?.[t]??e.de[t]??t;for(let[e,t]of Object.entries(n??{}))r=r.replace(`{${e}}`,String(t));return r},lang:()=>Rn},api:{get:e=>a.get(r(e)),post:(e,t)=>a.post(r(e),t),put:(e,t)=>a.put(r(e),t),patch:(e,t)=>a.patch(r(e),t),del:e=>a.del(r(e))},me:()=>({user:{id:lX.user.id,name:lX.user.name,email:lX.user.email},tenant:lX.tenant,mode:lX.mode}),onUnload(e){t.disposers.push(e)}}}function vX(e){return new Promise((t,n)=>{let r=document.createElement(`script`);r.src=e,r.onload=()=>{r.remove(),t()},r.onerror=()=>{r.remove(),n(Error(`The plugin's script did not load.`))},document.head.append(r)})}function yX(e,t){return new Promise(n=>{let r=document.createElement(`link`);r.rel=`stylesheet`,r.href=t,r.dataset.plugin=e,r.onload=()=>n(r),r.onerror=()=>n(r),document.head.append(r)})}function bX(e,t,n){for(let n of t)try{n()}catch(t){console.error(`[plugin ${e}]`,t)}n?.remove()}function xX(e){let t=cX.get(e);cX.delete(e),bX(e,t?.disposers??[],t?.link??null);let{[e]:n,...r}=nX.failed;iX({failed:r,pages:nX.pages.filter(t=>t.plugin!==e),nav:nX.nav.filter(t=>t.plugin!==e),sections:nX.sections.filter(t=>t.plugin!==e),spaceSections:nX.spaceSections.filter(t=>t.plugin!==e),spaceParts:nX.spaceParts.filter(t=>t.plugin!==e),shareSections:nX.shareSections.filter(t=>t.plugin!==e),shareSetups:nX.shareSetups.filter(t=>t.plugin!==e),cards:nX.cards.filter(t=>t.plugin!==e),knowledgeSources:nX.knowledgeSources.filter(t=>t.plugin!==e),mountKinds:nX.mountKinds.filter(t=>t.plugin!==e)})}async function SX(e){let{id:t}=e,n={pages:[],nav:[],sections:[],spaceSections:[],spaceParts:[],shareSections:[],shareSetups:[],cards:[],knowledgeSources:[],mountKinds:[],disposers:[]},r=null;try{e.styles&&(r=await yX(t,Ee(e.styles))),await vX(Ee(e.script));let i=globalThis,a=dX(t),o=i[a];i[a]=void 0;let s=typeof o==`function`?o:o?.default;if(typeof s!=`function`)throw Error(`The plugin's script has no default export.`);s(_X(e,n))}catch(i){console.error(`[plugin ${t}]`,i),bX(t,n.disposers,r),xX(t),cX.set(t,{key:uX(e),disposers:[],link:null}),iX({failed:{...nX.failed,[t]:i.message}});return}let i=cX.get(t);cX.set(t,{key:uX(e),disposers:n.disposers,link:r});let{[t]:a,...o}=nX.failed;iX({failed:o,pages:[...nX.pages.filter(e=>e.plugin!==t),...n.pages],nav:[...nX.nav.filter(e=>e.plugin!==t),...n.nav],sections:[...nX.sections.filter(e=>e.plugin!==t),...n.sections],spaceSections:[...nX.spaceSections.filter(e=>e.plugin!==t),...n.spaceSections],spaceParts:[...nX.spaceParts.filter(e=>e.plugin!==t),...n.spaceParts],shareSections:[...nX.shareSections.filter(e=>e.plugin!==t),...n.shareSections],shareSetups:[...nX.shareSetups.filter(e=>e.plugin!==t),...n.shareSetups],cards:[...nX.cards.filter(e=>e.plugin!==t),...n.cards],knowledgeSources:[...nX.knowledgeSources.filter(e=>e.plugin!==t),...n.knowledgeSources],mountKinds:[...nX.mountKinds.filter(e=>e.plugin!==t),...n.mountKinds]}),bX(t,i?.disposers??[],i?.link??null)}var CX=Promise.resolve();function wX(){return CX=CX.catch(()=>void 0).then(async()=>{let e=await a.get(`/api/studio/plugins`);for(let t of[...cX.keys()])e.plugins.some(e=>e.id===t&&e.script)||xX(t);iX(e);for(let t of e.plugins)t.script&&cX.get(t.id)?.key!==uX(t)&&await SX(t)}).catch(e=>console.error(`[plugins]`,e)).finally(()=>iX({status:`ready`})),CX}var TX=null;function EX(e){lX=e,nX.status===`idle`&&(iX({status:`loading`}),wX().then(()=>{nX.canReload&&!TX&&(TX=new EventSource(Ee(`/api/studio/plugins/-/events`),{withCredentials:!0}),TX.addEventListener(`change`,()=>void wX()))}))}async function DX(e){await a.post(e?`/api/studio/plugins/-/reload/${e}`:`/api/studio/plugins/-/reload`),await wX()}var OX=class extends q.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(e){console.error(`[plugin]`,e)}render(){return this.state.failed?(0,J.jsx)(xe,{children:K(`plugins.crashed`)}):this.props.children}};function kX({of:e,children:t}){return(0,J.jsx)(`div`,{"data-plugin":e.plugin,className:`contents`,children:(0,J.jsx)(OX,{children:t},e.serial)})}export{Jk as $,ji as $n,sg as $t,PU as A,wo as An,hD as At,jH as B,ya as Bn,QE as Bt,fJ as C,Tl as Cn,xD as Ct,eW as D,Po as Dn,jD as Dt,Yq as E,Io as En,ND as Et,NU as F,to as Fn,$E as Ft,bH as G,ra as Gn,Zw as Gt,CH as H,ha as Hn,ZE as Ht,EU as I,Ya as In,oD as It,pH as J,qi as Jn,Lw as Jt,yH as K,ta as Kn,Xw as Kt,pU as L,qa as Ln,BE as Lt,DU as M,mo as Mn,iD as Mt,AU as N,so as Nn,tD as Nt,FU as O,Ao as On,gD as Ot,MU as P,ao as Pn,nD as Pt,sA as Q,zi as Qn,og as Qt,gU as R,Ga as Rn,XE as Rt,dJ as S,Pl as Sn,LD as St,nJ as T,Ro as Tn,yD as Tt,xH as U,pa as Un,IE as Ut,wH as V,_a as Vn,HE as Vt,vH as W,sa as Wn,HT as Wt,oA as X,Ui as Xn,kw as Xt,cj as Y,Gi as Yn,Iw as Yt,eA as Z,Vi as Zn,Dw as Zt,WJ as _,zm as _n,ik as _t,aX as a,fg as an,ti as ar,Zk as at,dY as b,su as bn,UD as bt,JY as c,vg as cn,Vr as cr,Kk as ct,qY as d,Xh as dn,Dr as dr,Rk as dt,cg as en,ki as er,Yk as et,BY as f,rg as fn,Cr as fr,Ak as ft,OY as g,Hm as gn,uk as gt,xY as h,Zm as hn,wk as ht,EX as i,dg as in,ai as ir,Xk as it,jU as j,So as jn,dD as jt,RU as k,Eo as kn,uD as kt,eX as l,yg as ln,zr as lr,Lk as lt,UY as m,th as mn,Fk as mt,mX as n,_g as nn,Ci as nr,iA as nt,$Y as o,ug as on,qr as or,Qk as ot,EY as p,ah as pn,Ik as pt,gH as q,Yi as qn,Gw as qt,DX as r,pg as rn,si as rr,lA as rt,XY as s,bg as sn,Gr as sr,qk as st,kX as t,ag as tn,Di as tr,$k as tt,YY as u,gg as un,Fr as ur,Vk as ut,UJ as v,Dm as vn,nk as vt,xJ as w,Bo as wn,vD as wt,sY as x,Bl as xn,KD as xt,zJ as y,xu as yn,ak as yt,UH as z,Va as zn,YE as zt};