@snagset/server 0.1.10 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.js +23 -1
- package/dist/app.js.map +1 -1
- package/dist/config.generated.js +2 -1
- package/dist/config.generated.js.map +1 -1
- package/dist/db/migrate.js +44 -0
- package/dist/db/migrate.js.map +1 -1
- package/dist/db/migrations/0008_outbox_org_rows.sql +29 -0
- package/dist/db/migrations/0009_member_invites.sql +84 -0
- package/dist/jobs/set.js +15 -4
- package/dist/jobs/set.js.map +1 -1
- package/dist/mail/digest.js +291 -0
- package/dist/mail/digest.js.map +1 -0
- package/dist/mail/links.js +41 -0
- package/dist/mail/links.js.map +1 -0
- package/dist/mail/notify.js +126 -25
- package/dist/mail/notify.js.map +1 -1
- package/dist/net/publicFetch.js +202 -0
- package/dist/net/publicFetch.js.map +1 -0
- package/dist/routes/commentEdit.js +20 -5
- package/dist/routes/commentEdit.js.map +1 -1
- package/dist/routes/imageProxy.js +77 -0
- package/dist/routes/imageProxy.js.map +1 -0
- package/dist/routes/invites.js +417 -0
- package/dist/routes/invites.js.map +1 -0
- package/dist/routes/members.js +36 -68
- package/dist/routes/members.js.map +1 -1
- package/dist/routes/owner.js +5 -0
- package/dist/routes/owner.js.map +1 -1
- package/dist/routes/threads.js +182 -42
- package/dist/routes/threads.js.map +1 -1
- package/package.json +3 -3
- package/static/dashboard/assets/CompositeItem-CYCgjQYA.js +1 -0
- package/static/dashboard/assets/{ConfirmDialog-eCzw7vjK.js → ConfirmDialog-ChIOOj7I.js} +1 -1
- package/static/dashboard/assets/{CopyButton-lcjux1TA.js → CopyButton-V7OJiMLP.js} +1 -1
- package/static/dashboard/assets/{FieldItemContext-i5zdyQYl.js → FieldItemContext-DVtdzu3C.js} +1 -1
- package/static/dashboard/assets/{InstallTag-Eqs3RM9e.js → InstallTag-OD-dW_hC.js} +1 -1
- package/static/dashboard/assets/{SaveState-Cf_bnJmg.js → SaveState-JVgANqCr.js} +1 -1
- package/static/dashboard/assets/{_app-CuKLSKZ2.js → _app-B0TJyHg-.js} +1 -1
- package/static/dashboard/assets/_app-Bwss1pXe.js +56 -0
- package/static/dashboard/assets/activity-CbcgWM3L.js +1 -0
- package/static/dashboard/assets/{arrow-left-CQUHEFUP.js → arrow-left-BrmSwEeI.js} +1 -1
- package/static/dashboard/assets/{avatar-CWT37Ivf.js → avatar-CwD1_B-n.js} +1 -1
- package/static/dashboard/assets/{badge-thtKAJ0h.js → badge-DM_IoUbC.js} +1 -1
- package/static/dashboard/assets/{card-CsXE7vKD.js → card-DpmJQuox.js} +1 -1
- package/static/dashboard/assets/{check-Bc_1fmPx.js → check-DNKwULUa.js} +1 -1
- package/static/dashboard/assets/{chevron-right-neQQkaOt.js → chevron-right-ob3VZye2.js} +1 -1
- package/static/dashboard/assets/{copy-O3USBatC.js → copy-CyBHfvzN.js} +1 -1
- package/static/dashboard/assets/{dialog-MC-TOvQV.js → dialog-Bys-LJLw.js} +2 -2
- package/static/dashboard/assets/{dropdown-menu-C2ZhmONu.js → dropdown-menu-Cqas_wS3.js} +2 -2
- package/static/dashboard/assets/{image-off-Bu6l8gP5.js → image-off-D_65_17F.js} +1 -1
- package/static/dashboard/assets/index-Cxnlb88o.js +169 -0
- package/static/dashboard/assets/index-Ddi7bl87.css +1 -0
- package/static/dashboard/assets/invite-Cc7l9fdY.js +1 -0
- package/static/dashboard/assets/label-CwqSv8L3.js +1 -0
- package/static/dashboard/assets/{layout-grid-rYWIGaIJ.js → layout-grid-PTAyhqU8.js} +1 -1
- package/static/dashboard/assets/me-kMczOn0k.js +1 -0
- package/static/dashboard/assets/{parts-kPNZVO9H.js → parts-CErghVAB.js} +1 -1
- package/static/dashboard/assets/{plus-CcJ1Zwa7.js → plus-BE-gOo3v.js} +1 -1
- package/static/dashboard/assets/s._site-BBRI74gv.js +1 -0
- package/static/dashboard/assets/s._site.comments-CbfjF9-s.js +54 -0
- package/static/dashboard/assets/{s._site.reviewers-Djq2t6Dx.js → s._site.reviewers-BMiqVuRm.js} +1 -1
- package/static/dashboard/assets/s._site.settings-CEvRwMQt.js +1 -0
- package/static/dashboard/assets/{setup-D748SEIm.js → setup-CkNn_rwp.js} +1 -1
- package/static/dashboard/assets/{sign-in-CKSiZWCo.js → sign-in-Bz6iRxcc.js} +1 -1
- package/static/dashboard/assets/{sign-up-BX9j_Ya2.js → sign-up-QcstGuaV.js} +1 -1
- package/static/dashboard/assets/sites-DJjGT-f2.js +1 -0
- package/static/dashboard/assets/studio-mKw0u2SL.js +1 -0
- package/static/dashboard/assets/studio-qqUvuQo5.js +1 -0
- package/static/dashboard/assets/studio.index-zjJeqf8B.js +1 -0
- package/static/dashboard/assets/studio.integrations-C9-R6CQZ.js +1 -0
- package/static/dashboard/assets/studio.members-BYd5gcvp.js +6 -0
- package/static/dashboard/assets/{sun-CWPmS6_O.js → sun-DTQiNbTt.js} +1 -1
- package/static/dashboard/assets/switch-Cqqz6oQN.js +1 -0
- package/static/dashboard/assets/{table-CiZO2uuW.js → table-D_36h1Oq.js} +1 -1
- package/static/dashboard/assets/{useAriaLabelledBy-oZFqC809.js → useAriaLabelledBy-D-dab2TD.js} +1 -1
- package/static/dashboard/assets/{useBaseQuery-CHgLQD-M.js → useBaseQuery-DmDP3Pxx.js} +1 -1
- package/static/dashboard/assets/useQuery-CKn14AcE.js +1 -0
- package/static/dashboard/assets/useRender-B_JrSXOO.js +1 -0
- package/static/dashboard/assets/{useValueChanged-Dvr7PvAV.js → useValueChanged--Isnj6ZH.js} +1 -1
- package/static/dashboard/assets/{users-Ci-ogubz.js → users-CJVqlkra.js} +1 -1
- package/static/dashboard/assets/{welcome-BDWw5Qlv.js → welcome-BMr4vd5V.js} +2 -2
- package/static/dashboard/assets/{you-DAUNHAFI.js → you-Bqw_r3i7.js} +1 -1
- package/static/dashboard/assets/{zod-CtjFmGX5.js → zod-BMw0fS-7.js} +1 -1
- package/static/dashboard/index.html +2 -2
- package/static/widget/snag.capture.js +1 -1
- package/static/widget/snag.dock.js +1 -1
- package/static/widget/snag.runtime.js +2 -2
- package/static/widget/snag.screenshot.js +1 -1
- package/static/dashboard/assets/CompositeItem-Db_8iHSG.js +0 -1
- package/static/dashboard/assets/_app-qNVG5lsX.js +0 -56
- package/static/dashboard/assets/activity-CQLBFIV4.js +0 -1
- package/static/dashboard/assets/index-BR4Mnw-o.css +0 -1
- package/static/dashboard/assets/index-C6gyyLd5.js +0 -169
- package/static/dashboard/assets/label-BTdAT39L.js +0 -1
- package/static/dashboard/assets/me-CI9giaT9.js +0 -1
- package/static/dashboard/assets/s._site-D0HRtia-.js +0 -1
- package/static/dashboard/assets/s._site.comments-D3ACsr3a.js +0 -39
- package/static/dashboard/assets/s._site.settings-D0b6vJci.js +0 -1
- package/static/dashboard/assets/sites-QwJy87Y8.js +0 -1
- package/static/dashboard/assets/studio-B_ma5JGA.js +0 -1
- package/static/dashboard/assets/studio-HH_J6PPv.js +0 -1
- package/static/dashboard/assets/studio.index-DrtJF7DT.js +0 -1
- package/static/dashboard/assets/studio.integrations-Cv34ukzT.js +0 -1
- package/static/dashboard/assets/studio.members-DTbKcrEI.js +0 -1
- package/static/dashboard/assets/switch-CzijGUed.js +0 -1
- package/static/dashboard/assets/useQuery-C6FyjMS-.js +0 -1
- package/static/dashboard/assets/useRender-D5jZ1wns.js +0 -1
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import{u as pt,a as gt,b as ft,c as I,r as o,d as z,e as le,g as ht,j as e,B as J,f as w,h as se,m as be,E as xt,i as ve,k as ge,l as mt,n as bt,o as ne,S as vt,p as Z,q as jt,L as _,s as yt,t as _e,M as St,v as wt,w as Ct,x as Nt,y as kt,O as Tt}from"./index-Cxnlb88o.js";import{u as He}from"./useQuery-CKn14AcE.js";import{T as Pt,i as ze,a as Rt,D as Mt,b as Et,c as Ot,X as Dt,d as It,e as At,f as _t,g as Ht,R as zt,p as Lt,h as $t,j as Bt,k as Ft,P as Ut,l as qt,u as Gt,m as Vt,n as Kt,o as Yt,q as Wt,r as Xt,s as Qt,t as Jt,v as Zt,w as es,x as ts,y as ss,z as ns,A as as,F as rs,B as os,C as is,E as Le,G as $e,H as Be,I as ls,J as ds,K as cs}from"./dialog-Bys-LJLw.js";import{c as B,n as Fe,g as us,a as fe,t as ps,d as gs,i as fs,u as hs,b as de,L as xs,I as ms}from"./label-CwqSv8L3.js";import{g as he,u as bs,a as vs,b as js,s as ys,c as Ss,d as ws,e as Cs,f as Ns,h as ks,S as Ue,E as Q,D as ae,i as re,j as oe,k as je,l as ee,m as D,n as V,o as Ts,p as ce}from"./dropdown-menu-Cqas_wS3.js";import{u as qe}from"./useRender-B_JrSXOO.js";import{A as Ps,a as Rs}from"./avatar-CwD1_B-n.js";import{S as Ms,i as Es,a as Os}from"./labels--UUyt9uB.js";import{u as Ge}from"./me-kMczOn0k.js";import{L as te}from"./layout-grid-PTAyhqU8.js";import{U as xe}from"./users-CJVqlkra.js";import{c as Ds}from"./update-duXzIzFS.js";import{P as Ve}from"./plus-BE-gOo3v.js";import{M as Is,S as As,a as _s}from"./sun-DTQiNbTt.js";import"./useBaseQuery-DmDP3Pxx.js";import"./check-DNKwULUa.js";import"./CompositeItem-CYCgjQYA.js";import"./useValueChanged--Isnj6ZH.js";function Hs(t){const s=pt({warn:t?.router===void 0}),n=t?.router||s;return gt(n.stores.__store,ft(t,n))}/**
|
|
2
|
+
* @license lucide-react v1.39.0 - ISC
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the ISC license.
|
|
5
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/const zs=[["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"}]],Ke=I("activity",zs);/**
|
|
7
|
+
* @license lucide-react v1.39.0 - ISC
|
|
8
|
+
*
|
|
9
|
+
* This source code is licensed under the ISC license.
|
|
10
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
+
*/const Ls=[["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"}]],Ye=I("blocks",Ls);/**
|
|
12
|
+
* @license lucide-react v1.39.0 - ISC
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the ISC license.
|
|
15
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
+
*/const $s=[["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"}]],We=I("book-open",$s);/**
|
|
17
|
+
* @license lucide-react v1.39.0 - ISC
|
|
18
|
+
*
|
|
19
|
+
* This source code is licensed under the ISC license.
|
|
20
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
+
*/const Bs=[["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"}]],ye=I("building-2",Bs);/**
|
|
22
|
+
* @license lucide-react v1.39.0 - ISC
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the ISC license.
|
|
25
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/const Fs=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],Se=I("chevrons-up-down",Fs);/**
|
|
27
|
+
* @license lucide-react v1.39.0 - ISC
|
|
28
|
+
*
|
|
29
|
+
* This source code is licensed under the ISC license.
|
|
30
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
+
*/const Us=[["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"}]],qs=I("circle-question-mark",Us);/**
|
|
32
|
+
* @license lucide-react v1.39.0 - ISC
|
|
33
|
+
*
|
|
34
|
+
* This source code is licensed under the ISC license.
|
|
35
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
+
*/const Gs=[["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"}]],Vs=I("log-out",Gs);/**
|
|
37
|
+
* @license lucide-react v1.39.0 - ISC
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the ISC license.
|
|
40
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/const Ks=[["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"}]],me=I("message-square",Ks);/**
|
|
42
|
+
* @license lucide-react v1.39.0 - ISC
|
|
43
|
+
*
|
|
44
|
+
* This source code is licensed under the ISC license.
|
|
45
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
+
*/const Ys=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],Ws=I("panel-left",Ys);/**
|
|
47
|
+
* @license lucide-react v1.39.0 - ISC
|
|
48
|
+
*
|
|
49
|
+
* This source code is licensed under the ISC license.
|
|
50
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
51
|
+
*/const Xs=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],Xe=I("sliders-horizontal",Xs);/**
|
|
52
|
+
* @license lucide-react v1.39.0 - ISC
|
|
53
|
+
*
|
|
54
|
+
* This source code is licensed under the ISC license.
|
|
55
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
56
|
+
*/const Qs=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Qe=I("user",Qs),ue=768;function Js(){const[t,s]=o.useState(void 0);return o.useEffect(()=>{const n=window.matchMedia(`(max-width: ${ue-1}px)`),a=()=>{s(window.innerWidth<ue)};return n.addEventListener("change",a),s(window.innerWidth<ue),()=>n.removeEventListener("change",a)},[]),!!t}const Zs=o.createContext({hasProvider:!1,timeoutMs:0,delayRef:{current:0},initialDelayRef:{current:0},timeout:new Pt,currentIdRef:{current:null},currentContextRef:{current:null}});function en(t,s){t.current=s.current}function tn(t,s={open:!1}){const{open:n}=s,a="rootStore"in t?t.rootStore:t,r=a.useState("floatingId"),f=o.useContext(Zs),{currentIdRef:d,delayRef:i,timeoutMs:h,initialDelayRef:c,currentContextRef:g,hasProvider:j,timeout:x}=f,[m,p]=o.useState(!1),S=o.useRef(n);return z(()=>{S.current=n},[n]),z(()=>{function u(){g.current?.setIsInstantPhase(!1),d.current=null,g.current=null,i.current=c.current,x.clear()}if(d.current&&!n&&d.current===r){if(p(!1),h){const b=r;return x.start(h,()=>{a.select("open")||d.current&&d.current!==b||u()}),()=>{(S.current||d.current!==b)&&x.clear()}}u()}},[n,r,d,i,h,c,g,x,a]),z(()=>{if(!n)return;const u=g.current,b=d.current;x.clear(),g.current={onOpenChange:a.setOpen,setIsInstantPhase:p},d.current=r,i.current={open:0,close:he(c.current,"close")},b!==null&&b!==r?(p(!0),u?.setIsInstantPhase(!0),u?.onOpenChange(!1,B(Fe))):(p(!1),u?.setIsInstantPhase(!1))},[n,r,a,d,i,c,g,x]),z(()=>()=>{if(d.current===r){if(g.current=null,!S.current)return;d.current=null,en(i,c),x.clear()}},[g,d,i,r,c,x]),o.useMemo(()=>({hasProvider:j,delayRef:i,isInstantPhase:m}),[j,i,m])}function sn(t,s){let n=null,a=null,r=!1;return{contextElement:t||void 0,getBoundingClientRect(){const f=t?.getBoundingClientRect()||{width:0,height:0,x:0,y:0},d=s.axis==="x"||s.axis==="both",i=s.axis==="y"||s.axis==="both",h=["mouseenter","mousemove"].includes(s.dataRef.current.openEvent?.type||"")&&s.pointerType!=="touch";let c=f.width,g=f.height,j=f.x,x=f.y;return n==null&&s.x&&d&&(n=f.x-s.x),a==null&&s.y&&i&&(a=f.y-s.y),j-=n||0,x-=a||0,c=0,g=0,!r||h?(c=s.axis==="y"?f.width:0,g=s.axis==="x"?f.height:0,j=d&&s.x!=null?s.x:j,x=i&&s.y!=null?s.y:x):r&&!h&&(g=s.axis==="x"?f.height:g,c=s.axis==="y"?f.width:c),r=!0,{width:c,height:g,x:j,y:x,top:x,right:j+c,bottom:x+g,left:j}}}}function Ee(t){return t!=null&&t.clientX!=null}function nn(t,s={}){const{enabled:n=!0,axis:a="both"}=s,r="rootStore"in t?t.rootStore:t,f=r.useState("open"),d=r.useState("floatingElement"),i=r.useState("domReferenceElement"),h=r.context.dataRef,c=o.useRef(!1),g=o.useRef(null),[j,x]=o.useState(),[m,p]=o.useState([]),S=le(v=>{r.set("positionReference",v)}),u=le((v,y,P)=>{c.current||h.current.openEvent&&!Ee(h.current.openEvent)||r.set("positionReference",sn(P??i,{x:v,y,axis:a,dataRef:h,pointerType:j}))}),b=le(v=>{f?g.current||(u(v.clientX,v.clientY,v.currentTarget),p([])):u(v.clientX,v.clientY,v.currentTarget)}),N=ze(j)?d:f;o.useEffect(()=>{if(!n){S(i);return}if(!N)return;function v(){g.current?.(),g.current=null}const y=ht(d);function P(l){const k=us(l);fe(d,k)?v():u(l.clientX,l.clientY)}return!h.current.openEvent||Ee(h.current.openEvent)?g.current=Rt(y,"mousemove",P):S(i),v},[N,n,d,h,i,r,u,S,m]),o.useEffect(()=>()=>{r.set("positionReference",null)},[r]),o.useEffect(()=>{n&&!d&&(c.current=!1)},[n,d]),o.useEffect(()=>{!n&&f&&(c.current=!0)},[n,f]);const C=o.useMemo(()=>{function v(y){x(y.pointerType)}return{onPointerDown:v,onPointerEnter:v,onMouseMove:b,onMouseEnter:b}},[b]);return o.useMemo(()=>n?{reference:C,trigger:C}:{},[n,C])}function an({...t}){return e.jsx(Mt,{"data-slot":"sheet",...t})}function rn({...t}){return e.jsx(_t,{"data-slot":"sheet-portal",...t})}function on({className:t,...s}){return e.jsx(Ht,{"data-slot":"sheet-overlay",className:w("fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs",t),...s})}function ln({className:t,children:s,side:n="right",showCloseButton:a=!0,...r}){return e.jsxs(rn,{children:[e.jsx(on,{}),e.jsxs(Et,{"data-slot":"sheet-content","data-side":n,className:w("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",t),...r,children:[s,a&&e.jsxs(Ot,{"data-slot":"sheet-close",render:e.jsx(J,{variant:"ghost",className:"absolute top-3 right-3",size:"icon-sm"}),children:[e.jsx(Dt,{}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function dn({className:t,...s}){return e.jsx("div",{"data-slot":"sheet-header",className:w("flex flex-col gap-0.5 p-4",t),...s})}function cn({className:t,...s}){return e.jsx(It,{"data-slot":"sheet-title",className:w("font-heading text-base font-medium text-foreground",t),...s})}function un({className:t,...s}){return e.jsx(At,{"data-slot":"sheet-description",className:w("text-sm text-muted-foreground",t),...s})}const Je=o.createContext(void 0);function K(t){const s=o.useContext(Je);if(s===void 0&&!t)throw new Error(se(72));return s}const pn={...Lt,disabled:t=>t.disabled,instantType:t=>t.instantType,isInstantPhase:t=>t.isInstantPhase,trackCursorAxis:t=>t.trackCursorAxis,disableHoverablePopup:t=>t.disableHoverablePopup,lastOpenChangeReason:t=>t.openChangeReason,closeOnClick:t=>t.closeOnClick,closeDelay:t=>t.closeDelay,adaptiveOrigin:t=>t.adaptiveOrigin};class gn extends zt{constructor(s,n,a){const r=new Ut;super(fn(s,r,n,a),hn(r),pn)}setOpen=(s,n)=>{$t(this,s,n,{extraState:{openChangeReason:n.reason}})};cancelPendingOpen(s){this.state.floatingRootContext.dispatchOpenChange(!1,B(ps,s))}}function fn(t,s,n,a=!1){const r={...Bt(),disabled:!1,instantType:void 0,isInstantPhase:!1,trackCursorAxis:"none",disableHoverablePopup:!1,openChangeReason:null,closeOnClick:!0,closeDelay:0,adaptiveOrigin:void 0,...t};return r.floatingRootContext=Ft(s,n,a),r}function hn(t){return{popupRef:o.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:t}}const xn=qt(function(s){const{disabled:n=!1,defaultOpen:a=!1,open:r,disableHoverablePopup:f=!1,trackCursorAxis:d="none",actionsRef:i,onOpenChange:h,onOpenChangeComplete:c,handle:g,triggerId:j,defaultTriggerId:x=null,children:m}=s,p=Gt(($,F)=>new gn({open:a,openProp:r,activeTriggerId:x,triggerIdProp:j},$,F));p.useControlledProp("openProp",r),p.useControlledProp("triggerIdProp",j),p.useContextCallback("onOpenChange",h),p.useContextCallback("onOpenChangeComplete",c);const S=p.useState("open"),u=!n&&S,b=p.useState("activeTriggerId"),N=p.useState("mounted"),C=p.useState("payload");p.useSyncedValues({trackCursorAxis:d,disableHoverablePopup:f,disabled:n}),Vt(p,{closeOnActiveTriggerUnmount:!0});const{forceUnmount:v,transitionStatus:y}=Kt(u,p),P=p.useState("isInstantPhase"),l=p.useState("instantType"),k=p.useState("lastOpenChangeReason"),R=o.useRef(null);z(()=>{S&&n&&p.setOpen(!1,B(gs))},[S,n,p]),z(()=>{y==="ending"&&k===Fe||y!=="ending"&&P?(l!=="delay"&&(R.current=l),p.set("instantType","delay")):R.current!==null&&(p.set("instantType",R.current),R.current=null)},[y,P,k,l,p]),z(()=>{u&&b==null&&p.set("payload",void 0)},[p,b,u]),o.useImperativeHandle(i,()=>({unmount:v,close:()=>p.setOpen(!1,B(fs))}),[v,p]);const L=u||N||!n&&d!=="none";return e.jsxs(Je.Provider,{value:p,children:[g&&e.jsx(Yt,{handle:g,store:p}),L&&e.jsx(mn,{store:p,disabled:n,trackCursorAxis:d}),typeof m=="function"?m({payload:C}):m]})});function mn({store:t,disabled:s,trackCursorAxis:n}){const a=t.useState("floatingRootContext"),r=Wt(a,{enabled:!s,referencePress:()=>t.select("closeOnClick")}),f=nn(a,{enabled:!s&&n!=="none",axis:n==="none"?void 0:n}),d=o.useMemo(()=>be(f.reference,r.reference),[f.reference,r.reference]);return Xt(t,{activeTriggerProps:d,inactiveTriggerProps:d,popupProps:r.floating??xt}),null}const bn=o.createContext(void 0);function vn(){return o.useContext(bn)}const Oe=600,Ze="data-base-ui-tooltip-trigger";function De(t){if("composedPath"in t){const n=t.composedPath();for(let a=0;a<n.length;a+=1){const r=n[a];if(ge(r))return r}}const s=t.target;return ge(s)?s:null}function jn(t){let s=t;for(;s;){const n=s.closest(`[${Ze}]`);if(n)return n;const a=s.getRootNode();s="host"in a&&ge(a.host)?a.host:null}return null}const yn=Qt(function(s,n){const{render:a,className:r,style:f,handle:d,payload:i,disabled:h,delay:c,closeOnClick:g=!0,closeDelay:j,id:x,...m}=s,p=K(!0),u=bs(d)??p;if(!u)throw new Error(se(82));const b=hs(x),N=u.useState("isTriggerActive",b),C=u.useState("isOpenedByTrigger",b),v=u.useState("floatingRootContext"),y=o.useRef(null),P=c??Oe,l=j??0,{registerTrigger:k,isMountedByThisTrigger:R}=Jt(b,y,u,{payload:i,closeOnClick:g,closeDelay:l}),L=vn(),{delayRef:$,isInstantPhase:F,hasProvider:M}=tn(v,{open:C}),U=vs(v);u.useSyncedValue("isInstantPhase",F);const ie=u.useState("disabled"),q=h??ie,Ce=Zt(q),Ne=u.useState("trackCursorAxis"),rt=u.useState("disableHoverablePopup"),G=o.useRef(!1),Y=es(),W=o.useRef(void 0);function ke(){return M?he($.current,"open")===0?0:c??L??Oe:P}function Te(T){const A=y.current;if(!A||!T)return!1;const H=jn(T);return H!==null&&H!==A&&fe(A,H)}function ot(T){const A=Te(T);return G.current=A,A&&(U.openChangeTimeout.clear(),U.restTimeout.clear(),U.restTimeoutPending=!1,Y.clear()),A}const it=js(v,{enabled:!q,mouseOnly:!0,move:!1,handleClose:!rt&&Ne!=="both"?ys():null,restMs:ke,delay(){return j==null&&M?{close:he($.current,"close")}:{close:l}},triggerElementRef:y,isActiveTrigger:N,isClosing:()=>u.select("transitionStatus")==="ending",shouldOpen(){return!G.current}}),lt=Ss(v,{enabled:!q}).reference,dt=T=>{const A=G.current,H=De(T),Pe=ot(H),X=y.current,ut=X&&H&&fe(X,H);if(Pe&&u.select("open")&&u.select("lastOpenChangeReason")===de){u.setOpen(!1,B(de,T));return}if(A&&!Pe&&ut&&!Ce.current&&!u.select("open")&&X&&ze(W.current)){const Re=()=>{!G.current&&!Ce.current&&!u.select("open")&&u.setOpen(!0,B(de,T,X))},Me=ke();Me===0?(Y.clear(),Re()):Y.start(Me,Re)}},ct=u.useState("triggerProps",R);return ve("button",s,{state:{open:C},ref:[n,k,y],props:[it,lt,R||Ne!=="none"?ct:void 0,{onMouseOver(T){dt(T.nativeEvent)},onFocus(T){Te(De(T.nativeEvent))&&T.preventBaseUIHandler()},onMouseLeave(){G.current=!1,Y.clear(),W.current=void 0},onPointerEnter(T){W.current=T.pointerType},onPointerDown(T){W.current=T.pointerType,u.set("closeOnClick",g),g&&!u.select("open")&&u.cancelPendingOpen(T.nativeEvent)},onClick(T){g&&!u.select("open")&&u.cancelPendingOpen(T.nativeEvent)},id:b,"data-trigger-disabled":q?"":void 0,[Ze]:q?void 0:""},m],stateAttributesMapping:ts})}),et=o.createContext(void 0);function Sn(){const t=o.useContext(et);if(t===void 0)throw new Error(se(70));return t}const wn=o.forwardRef(function(s,n){const{children:a,container:r,className:f,render:d,style:i,...h}=s,{node:c,subtree:g}=ss({container:r,ref:n,componentProps:s,elementProps:h});return!g&&!c?null:e.jsxs(o.Fragment,{children:[g,c&&mt.createPortal(a,c)]})}),Cn=o.forwardRef(function(s,n){const{keepMounted:a=!1,...r}=s;return K().useState("mounted")||a?e.jsx(et.Provider,{value:a,children:e.jsx(wn,{ref:n,...r})}):null}),tt=o.createContext(void 0);function st(){const t=o.useContext(tt);if(t===void 0)throw new Error(se(71));return t}const Nn=o.forwardRef(function(s,n){const{render:a,className:r,anchor:f,positionMethod:d="absolute",side:i="top",align:h="center",sideOffset:c=0,alignOffset:g=0,collisionBoundary:j="clipping-ancestors",collisionPadding:x=5,arrowPadding:m=5,sticky:p=!1,disableAnchorTracking:S=!1,collisionAvoidance:u=ns,style:b,...N}=s,C=K(),v=Sn(),y=C.useState("open"),P=C.useState("mounted"),l=C.useState("trackCursorAxis"),k=C.useState("disableHoverablePopup"),R=C.useState("floatingRootContext"),L=C.useState("instantType"),$=C.useState("transitionStatus"),F=C.useState("adaptiveOrigin"),M=ws({anchor:f,positionMethod:d,floatingRootContext:R,mounted:P,side:i,sideOffset:c,align:h,alignOffset:g,collisionBoundary:j,collisionPadding:x,sticky:p,arrowPadding:m,disableAnchorTracking:S,keepMounted:v,collisionAvoidance:u,adaptiveOrigin:F}),U=o.useMemo(()=>({open:y,side:M.side,align:M.align,anchorHidden:M.anchorHidden,instant:l!=="none"?"tracking-cursor":L}),[y,M.side,M.align,M.anchorHidden,l,L]),ie=Cs(s,U,{styles:M.positionerStyles,transitionStatus:$,props:N,refs:[n,C.useStateSetter("positionerElement")],hidden:!P,inert:!y||l==="both"||k});return e.jsx(tt.Provider,{value:M,children:ie})}),kn=o.forwardRef(function(s,n){const{render:a,className:r,style:f,...d}=s,i=K(),{side:h,align:c}=st(),g=i.useState("open"),j=i.useState("instantType"),x=i.useState("transitionStatus"),m=i.useState("popupProps"),p=i.useState("floatingRootContext"),S=i.useState("disabled"),u=i.useState("closeDelay");as({open:g,ref:i.context.popupRef,onComplete(){g&&i.context.onOpenChangeComplete?.(!0)}}),Ns(p,{enabled:!S,closeDelay:u});const b=i.useStateSetter("popupElement");return ve("div",s,{state:{open:g,side:h,align:c,instant:j,transitionStatus:x},ref:[n,i.context.popupRef,b],props:[rs,m,ks(x),d],stateAttributesMapping:os})}),Tn=o.forwardRef(function(s,n){const{render:a,className:r,style:f,...d}=s,i=K(),{arrowRef:h,side:c,align:g,arrowUncentered:j,arrowStyles:x}=st(),m=i.useState("open"),p=i.useState("instantType");return ve("div",s,{state:{open:m,side:c,align:g,uncentered:j,instant:p},ref:[n,h],props:[{style:x,"aria-hidden":!0},d],stateAttributesMapping:is})});function Pn({...t}){return e.jsx(xn,{"data-slot":"tooltip",...t})}function Rn({...t}){return e.jsx(yn,{"data-slot":"tooltip-trigger",...t})}function Mn({className:t,side:s="top",sideOffset:n=4,align:a="center",alignOffset:r=0,children:f,...d}){return e.jsx(Cn,{children:e.jsx(Nn,{align:a,alignOffset:r,side:s,sideOffset:n,className:"isolate z-50",children:e.jsxs(kn,{"data-slot":"tooltip-content",className:w("z-50 inline-flex w-fit max-w-xs origin-(--transform-origin) items-center gap-1.5 rounded-md bg-foreground px-3 py-1.5 text-xs text-background has-data-[slot=kbd]:pr-1.5 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 **:data-[slot=kbd]:relative **:data-[slot=kbd]:isolate **:data-[slot=kbd]:z-50 **:data-[slot=kbd]:rounded-sm data-[state=delayed-open]:animate-in data-[state=delayed-open]:fade-in-0 data-[state=delayed-open]:zoom-in-95 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",t),...d,children:[f,e.jsx(Tn,{className:"z-50 size-2.5 translate-y-[calc(-50%-2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground data-[side=bottom]:top-1 data-[side=inline-end]:top-1/2! data-[side=inline-end]:-left-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-start]:top-1/2! data-[side=inline-start]:-right-1 data-[side=inline-start]:-translate-y-1/2 data-[side=left]:top-1/2! data-[side=left]:-right-1 data-[side=left]:-translate-y-1/2 data-[side=right]:top-1/2! data-[side=right]:-left-1 data-[side=right]:-translate-y-1/2 data-[side=top]:-bottom-2.5"})]})})})}const En="sidebar_state",On=3600*24*7,Dn="16rem",In="18rem",An="3rem",_n="b",nt=o.createContext(null);function we(){const t=o.useContext(nt);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function Hn({defaultOpen:t=!0,open:s,onOpenChange:n,className:a,style:r,children:f,...d}){const i=Js(),[h,c]=o.useState(!1),[g,j]=o.useState(t),x=s??g,m=o.useCallback(b=>{const N=typeof b=="function"?b(x):b;n?n(N):j(N),document.cookie=`${En}=${N}; path=/; max-age=${On}`},[n,x]),p=o.useCallback(()=>i?c(b=>!b):m(b=>!b),[i,m,c]);o.useEffect(()=>{const b=N=>{N.key===_n&&(N.metaKey||N.ctrlKey)&&(N.preventDefault(),p())};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[p]);const S=x?"expanded":"collapsed",u=o.useMemo(()=>({state:S,open:x,setOpen:m,isMobile:i,openMobile:h,setOpenMobile:c,toggleSidebar:p}),[S,x,m,i,h,c,p]);return e.jsx(nt.Provider,{value:u,children:e.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":Dn,"--sidebar-width-icon":An,...r},className:w("group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",a),...d,children:f})})}function zn({side:t="left",variant:s="sidebar",collapsible:n="offcanvas",className:a,children:r,dir:f,...d}){const{isMobile:i,state:h,openMobile:c,setOpenMobile:g}=we();return n==="none"?e.jsx("div",{"data-slot":"sidebar",className:w("flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",a),...d,children:r}):i?e.jsx(an,{open:c,onOpenChange:g,...d,children:e.jsxs(ln,{dir:f,"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"w-(--sidebar-width) bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":In},side:t,children:[e.jsxs(dn,{className:"sr-only",children:[e.jsx(cn,{children:"Sidebar"}),e.jsx(un,{children:"Displays the mobile sidebar."})]}),e.jsx("div",{className:"flex h-full w-full flex-col",children:r})]})}):e.jsxs("div",{className:"group peer hidden text-sidebar-foreground md:block","data-state":h,"data-collapsible":h==="collapsed"?n:"","data-variant":s,"data-side":t,"data-slot":"sidebar",children:[e.jsx("div",{"data-slot":"sidebar-gap",className:w("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",s==="floating"||s==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),e.jsx("div",{"data-slot":"sidebar-container","data-side":t,className:w("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)] md:flex",s==="floating"||s==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",a),...d,children:e.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border",children:r})})]})}function Ln({className:t,onClick:s,...n}){const{toggleSidebar:a}=we();return e.jsxs(J,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon-sm",className:w(t),onClick:r=>{s?.(r),a()},...n,children:[e.jsx(Ws,{}),e.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function $n({className:t,...s}){return e.jsx("main",{"data-slot":"sidebar-inset",className:w("relative flex w-full flex-1 flex-col bg-background md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",t),...s})}function Bn({className:t,...s}){return e.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:w("flex flex-col gap-2 p-2",t),...s})}function Fn({className:t,...s}){return e.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:w("flex flex-col gap-2 p-2",t),...s})}function Un({className:t,...s}){return e.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:w("no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...s})}function Ie({className:t,...s}){return e.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:w("relative flex w-full min-w-0 flex-col p-2",t),...s})}function qn({className:t,render:s,...n}){return qe({defaultTagName:"div",props:be({className:w("flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",t)},n),render:s,state:{slot:"sidebar-group-label",sidebar:"group-label"}})}function Ae({className:t,...s}){return e.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:w("w-full text-sm",t),...s})}function pe({className:t,...s}){return e.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:w("flex w-full min-w-0 flex-col gap-0",t),...s})}function E({className:t,...s}){return e.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:w("group/menu-item relative",t),...s})}const Gn=bt("peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-accent data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_var(--sidebar-border)] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_var(--sidebar-accent)]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function O({render:t,isActive:s=!1,variant:n="default",size:a="default",tooltip:r,className:f,...d}){const{isMobile:i,state:h}=we(),c=qe({defaultTagName:"button",props:be({className:w(Gn({variant:n,size:a}),f)},d),render:r?e.jsx(Rn,{render:t}):t,state:{slot:"sidebar-menu-button",sidebar:"menu-button",size:a,active:s}});return r?(typeof r=="string"&&(r={children:r}),e.jsxs(Pn,{children:[c,e.jsx(Mn,{side:"right",align:"center",hidden:h!=="collapsed"||i,...r})]})):c}function Vn({className:t,...s}){return e.jsx("div",{"data-slot":"sidebar-menu-badge","data-sidebar":"menu-badge",className:w("pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium text-sidebar-foreground tabular-nums select-none group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 peer-data-active/menu-button:text-sidebar-accent-foreground",t),...s})}function Kn({open:t,onOpenChange:s}){const n=Ge(),a=ne(),[r,f]=o.useState(""),[d,i]=o.useState(0),h=o.useRef(null),c=r.trim(),[g,j]=o.useState("");o.useEffect(()=>{const l=setTimeout(()=>j(c),180);return()=>clearTimeout(l)},[c]);const x=He({queryKey:["activity","search",g],queryFn:()=>Z.activity({q:g,status:"all",limit:8}),enabled:t&&g.length>=2,staleTime:3e4});o.useEffect(()=>{t||(f(""),i(0))},[t]);const m=o.useMemo(()=>[{id:"s:sites",label:"Sites",icon:e.jsx(te,{className:"size-4"}),go:()=>void a({to:"/sites"})},{id:"s:activity",label:"Activity",hint:"every site, newest first",icon:e.jsx(Ke,{className:"size-4"}),go:()=>void a({to:"/activity"})},{id:"s:members",label:"Members",icon:e.jsx(xe,{className:"size-4"}),go:()=>void a({to:"/studio/members"})},{id:"s:integrations",label:"Integrations",icon:e.jsx(Ye,{className:"size-4"}),go:()=>void a({to:"/studio/integrations"})},{id:"s:studio",label:"Studio settings",icon:e.jsx(ye,{className:"size-4"}),go:()=>void a({to:"/studio"})},{id:"s:you",label:"You",icon:e.jsx(Qe,{className:"size-4"}),go:()=>void a({to:"/you"})}],[a]),p=o.useMemo(()=>n.projects.map(l=>({id:`p:${l.uid}`,label:l.name,hint:l.unresolved>0?`${l.unresolved} open`:"nothing open",icon:e.jsx(me,{className:"size-4"}),go:()=>void a({to:"/s/$site/comments",params:{site:l.uid}})})),[n.projects,a]),S=l=>!c||l.toLowerCase().includes(c.toLowerCase()),u=[],b=p.filter(l=>S(l.label)),N=m.filter(l=>S(l.label));b.length&&u.push({title:"Sites",items:b}),N.length&&u.push({title:"Go to",items:N});const C=(x.data?.data??[]).map(l=>({id:`t:${l.id}`,label:l.latest?.body?.trim()||l.route,hint:`${l.site.name} · ${Es(l.status)?Ms[l.status]:l.status} · ${l.key}`,icon:e.jsx(me,{className:"size-4"}),go:()=>void a({to:"/s/$site/comments",params:{site:l.site.uid},search:{thread:l.key}})}));C.length&&u.push({title:"Comments",items:C});const v=u.flatMap(l=>l.items),y=Math.min(d,Math.max(0,v.length-1)),P=l=>{l&&(s(!1),l.go())};return o.useEffect(()=>{h.current?.querySelector(`[data-at="${y}"]`)?.scrollIntoView({block:"nearest"})},[y]),e.jsx(Le,{open:t,onOpenChange:s,children:e.jsxs($e,{showCloseButton:!1,className:"top-[15%] max-h-[70dvh] translate-y-0 gap-0 overflow-hidden p-0 sm:max-w-lg",children:[e.jsx(Be,{className:"sr-only",children:"Search and go"}),e.jsxs("div",{className:"flex items-center gap-2 border-b border-border px-3",children:[e.jsx(Ue,{className:"size-4 shrink-0 text-muted-foreground"}),e.jsx("input",{autoFocus:!0,value:r,onChange:l=>{f(l.target.value),i(0)},onKeyDown:l=>{l.key==="ArrowDown"?(l.preventDefault(),i(k=>Math.min(k+1,v.length-1))):l.key==="ArrowUp"?(l.preventDefault(),i(k=>Math.max(k-1,0))):l.key==="Enter"&&(l.preventDefault(),P(v[y]))},placeholder:"Go to a site or a screen, or search every comment…","aria-label":"Search and go",className:"h-11 w-full bg-transparent text-[14px] outline-none placeholder:text-muted-foreground"})]}),e.jsxs("div",{ref:h,className:"min-h-0 flex-1 overflow-auto py-1.5",children:[v.length===0&&e.jsx("p",{className:"m-0 px-3 py-6 text-center text-[13px] text-muted-foreground",children:x.isFetching?"Looking…":c?`Nothing matches “${c}”.`:"Nothing here."}),u.map(l=>e.jsxs("div",{children:[e.jsx("div",{className:"px-3 py-1 text-[11px] font-medium uppercase tracking-wide text-muted-foreground",children:l.title}),l.items.map(k=>{const R=v.indexOf(k);return e.jsxs("button",{type:"button","data-at":R,onMouseMove:()=>i(R),onClick:()=>P(k),className:w("flex w-full items-center gap-2.5 border-0 bg-transparent px-3 py-2 text-left text-[13px] text-foreground",R===y&&"bg-muted"),children:[e.jsx("span",{className:"shrink-0 text-muted-foreground",children:k.icon}),e.jsx("span",{className:"min-w-0 flex-1 truncate",children:k.label}),k.hint&&e.jsx("span",{className:"shrink-0 text-[12px] text-muted-foreground",children:k.hint})]},k.id)})]},l.title)),x.isFetching&&v.length>0&&e.jsxs("p",{className:"m-0 flex items-center gap-1.5 px-3 py-1.5 text-[12px] text-muted-foreground",children:[e.jsx(vt,{className:"size-3"}),"Searching every site…"]})]})]})})}function Yn(){const[t,s]=o.useState(!1);return o.useEffect(()=>{const n=a=>{a.key.toLowerCase()!=="k"||!(a.metaKey||a.ctrlKey)||(a.preventDefault(),s(r=>!r))};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[]),[t,s]}const at="https://snagset.com/docs/",Wn="https://www.npmjs.com/package/@snagset/server?activeTab=versions",Xn="https://snagset.com/docs/self-hosting/#upgrade";function Qn({children:t}){const s=Ge(),n=jt(s),[a,r]=Yn();return e.jsxs(Hn,{children:[e.jsx(Zn,{me:s,site:n}),e.jsxs($n,{className:"min-w-0",children:[e.jsx(aa,{onSearch:()=>r(!0)}),e.jsx(Jn,{names:s.pendingMigrations??[],owner:s.user.role==="owner"}),e.jsx("div",{className:"min-h-0 flex-1",children:t})]}),e.jsx(Kn,{open:a,onOpenChange:r})]})}function Jn({names:t,owner:s}){return t.length?e.jsxs("div",{role:"alert",className:"mx-7 mt-4 rounded-md border border-destructive/40 bg-warn-soft px-3 py-2 text-[13px] text-destructive",children:[e.jsxs("p",{className:"m-0 font-medium",children:["The database needs an update for this version (",t.length," ",t.length===1?"migration":"migrations",")."]}),e.jsx("p",{className:"m-0 mt-0.5",children:s?e.jsxs(e.Fragment,{children:["Run ",e.jsx("code",{className:"font-mono",children:"snagset migrate"})," with this instance's ",e.jsx("code",{className:"font-mono",children:"DATABASE_URL"})," — from the project, ",e.jsx("code",{className:"font-mono",children:"pnpm migrate"}),". Until then, parts of this version may fail."]}):"Ask the studio's owner to run snagset migrate. Until then, parts of this version may fail."})]}):null}function Zn({me:t,site:s}){const n=Hs({select:r=>r.location.pathname}),a=r=>n===r||n.startsWith(r+"/");return e.jsxs(zn,{children:[e.jsx(Bn,{className:"px-3 pb-1 pt-3",children:e.jsx(ea,{me:t})}),e.jsxs(Un,{children:[e.jsxs(Ie,{children:[e.jsx(ta,{me:t,site:s}),s&&e.jsx(Ae,{children:e.jsxs(pe,{children:[e.jsxs(E,{children:[e.jsxs(O,{isActive:a(`/s/${s.uid}/comments`),render:e.jsx(_,{to:"/s/$site/comments",params:{site:s.uid}}),children:[e.jsx(me,{}),e.jsx("span",{children:"Comments"})]}),s.unresolved>0&&e.jsx(Vn,{children:s.unresolved})]}),e.jsx(E,{children:e.jsxs(O,{isActive:a(`/s/${s.uid}/reviewers`),render:e.jsx(_,{to:"/s/$site/reviewers",params:{site:s.uid}}),children:[e.jsx(xe,{}),e.jsx("span",{children:"Reviewers"})]})}),e.jsx(E,{children:e.jsxs(O,{isActive:a(`/s/${s.uid}/settings`),render:e.jsx(_,{to:"/s/$site/settings",params:{site:s.uid}}),children:[e.jsx(Xe,{}),e.jsx("span",{children:"Settings"})]})})]})})]}),e.jsxs(Ie,{children:[e.jsx(qn,{children:"Studio"}),e.jsx(Ae,{children:e.jsxs(pe,{children:[e.jsx(E,{children:e.jsxs(O,{isActive:a("/sites"),render:e.jsx(_,{to:"/sites"}),children:[e.jsx(te,{}),e.jsx("span",{children:"Sites"})]})}),e.jsx(E,{children:e.jsxs(O,{isActive:a("/activity"),render:e.jsx(_,{to:"/activity"}),children:[e.jsx(Ke,{}),e.jsx("span",{children:"Activity"})]})}),e.jsx(E,{children:e.jsxs(O,{isActive:a("/studio/members"),render:e.jsx(_,{to:"/studio/members"}),children:[e.jsx(xe,{}),e.jsx("span",{children:"Members"})]})}),e.jsx(E,{children:e.jsxs(O,{isActive:a("/studio/integrations"),render:e.jsx(_,{to:"/studio/integrations"}),children:[e.jsx(Ye,{}),e.jsx("span",{children:"Integrations"})]})}),e.jsx(E,{children:e.jsxs(O,{isActive:n==="/studio",render:e.jsx(_,{to:"/studio"}),children:[e.jsx(ye,{}),e.jsx("span",{children:"General"})]})})]})})]})]}),e.jsx(Fn,{children:e.jsxs(pe,{children:[e.jsx(E,{children:e.jsxs(O,{render:e.jsx("a",{href:at,target:"_blank",rel:"noreferrer"}),children:[e.jsx(We,{}),e.jsx("span",{children:"Docs"}),e.jsx(Q,{className:"ml-auto size-3.5 text-muted-foreground"})]})}),e.jsx(E,{children:e.jsx(sa,{})}),e.jsx(E,{children:e.jsx(na,{me:t})})]})})]})}function ea({me:t}){const s=ne(),n=_e(),[a,r]=o.useState(!1),[f,d]=o.useState(""),[i,h]=o.useState(""),[c,g]=o.useState(!1),j=e.jsxs(e.Fragment,{children:[e.jsx(St,{size:20}),e.jsxs("span",{className:"min-w-0 flex-1 text-left",children:[e.jsx("span",{className:"block truncate text-[14px] font-semibold leading-tight tracking-tight",children:t.org.name}),e.jsx("span",{className:"block truncate text-[11.5px] text-muted-foreground",children:location.host})]})]});if(t.orgs.length<=1&&!t.signupOpen)return e.jsx(_,{to:"/studio",className:"flex items-center gap-2.5 rounded-md px-1 py-0.5 text-foreground hover:bg-sidebar-accent","aria-label":`${t.org.name} — studio settings`,children:j});const x=async m=>{g(!0),h("");try{await m(),n.clear(),r(!1),d(""),s({to:"/sites",replace:!0})}catch(p){h(p instanceof Error?p.message:"Something went wrong. Try again.")}finally{g(!1)}};return e.jsxs(e.Fragment,{children:[e.jsxs(ae,{children:[e.jsxs(re,{render:e.jsx("button",{type:"button",className:"flex w-full items-center gap-2.5 rounded-md px-1 py-0.5 text-foreground hover:bg-sidebar-accent","aria-label":"Switch studio"}),children:[j,e.jsx(Se,{className:"size-3.5 shrink-0 text-muted-foreground"})]}),e.jsxs(oe,{align:"start",className:"w-[240px]",children:[e.jsxs(je,{children:[e.jsx(ee,{children:"Studios"}),t.orgs.map(m=>e.jsxs(D,{disabled:m.current,onClick:()=>void x(()=>Z.switchOrg(m.slug)),children:[e.jsx(ye,{}),e.jsx("span",{className:"truncate",children:m.name}),m.current&&e.jsx("span",{className:"ml-auto text-[11px] text-muted-foreground",children:"current"})]},m.slug))]}),e.jsx(V,{}),e.jsxs(D,{onClick:()=>void s({to:"/studio"}),children:[e.jsx(Xe,{}),"Studio settings"]}),t.signupOpen&&e.jsxs(D,{onClick:()=>r(!0),children:[e.jsx(Ve,{}),"New studio…"]})]})]}),e.jsx(Le,{open:a,onOpenChange:m=>!c&&r(m),children:e.jsx($e,{className:"sm:max-w-[420px]",children:e.jsxs("form",{className:"flex flex-col gap-4",onSubmit:m=>{m.preventDefault(),x(()=>Z.createOrg(f.trim()||"My studio"))},children:[e.jsxs(ls,{children:[e.jsx(Be,{children:"New studio"}),e.jsx(ds,{children:"Its own sites, members and settings. You are its owner, and you move to it now — this one stays in the menu."})]}),e.jsxs("div",{className:"flex flex-col gap-1.5",children:[e.jsx(xs,{htmlFor:"new-studio-name",children:"Studio name"}),e.jsx(ms,{id:"new-studio-name",value:f,onChange:m=>d(m.target.value),placeholder:"My studio",autoFocus:!0})]}),i&&e.jsx("p",{className:"m-0 text-[12px] text-destructive",children:i}),e.jsxs(cs,{children:[e.jsx(J,{type:"button",variant:"outline",onClick:()=>r(!1),disabled:c,children:"Cancel"}),e.jsx(J,{type:"submit",loading:c,children:c?"Creating…":"Create studio"})]})]})})})]})}function ta({me:t,site:s}){const n=ne();return e.jsxs(ae,{children:[e.jsxs(re,{render:e.jsx("button",{type:"button",className:"mb-1 flex h-[34px] w-full items-center justify-between rounded-md border border-border bg-card px-2.5 text-[13px] font-semibold text-foreground","aria-label":"Switch site"}),children:[e.jsx("span",{className:"truncate",children:s?.name??"No sites yet"}),e.jsx(Se,{className:"size-3.5 text-muted-foreground"})]}),e.jsxs(oe,{align:"start",className:"w-[240px]",children:[e.jsxs(je,{children:[e.jsx(ee,{children:"Sites"}),t.projects.map(a=>e.jsxs(D,{onClick:()=>void n({to:"/s/$site/comments",params:{site:a.uid}}),children:[e.jsx(te,{}),e.jsx("span",{className:"truncate",children:a.name}),a.uid===s?.uid&&e.jsx("span",{className:"ml-auto text-[11px] text-muted-foreground",children:"current"})]},a.uid))]}),e.jsx(V,{}),e.jsxs(D,{onClick:()=>void n({to:"/sites",search:{add:!0}}),children:[e.jsx(Ve,{}),"Add a site"]}),e.jsxs(D,{onClick:()=>void n({to:"/sites"}),children:[e.jsx(te,{}),"All sites"]})]})]})}function sa(){const t=He(kt.meta()),s=t.data?.version??"",[n,a]=o.useState({state:"idle"}),r=async()=>{a({state:"checking"});try{a({state:"done",result:await Ds(s)})}catch{a({state:"failed"})}};return e.jsxs(ae,{children:[e.jsxs(re,{render:e.jsx(O,{}),children:[e.jsx(qs,{}),e.jsx("span",{children:"Help"})]}),e.jsxs(oe,{align:"start",side:"top",className:"w-[240px]",children:[e.jsxs(D,{render:e.jsx("a",{href:at,target:"_blank",rel:"noreferrer"}),children:[e.jsx(We,{}),"Docs",e.jsx(Q,{className:"ml-auto size-3 text-muted-foreground"})]}),e.jsxs(D,{render:e.jsx("a",{href:Wn,target:"_blank",rel:"noreferrer"}),children:["Changelog",e.jsx(Q,{className:"ml-auto size-3 text-muted-foreground"})]}),t.data?.sourceUrl&&e.jsxs(D,{render:e.jsx("a",{href:t.data.sourceUrl,target:"_blank",rel:"noreferrer"}),children:["Source · AGPL",e.jsx(Q,{className:"ml-auto size-3 text-muted-foreground"})]}),e.jsx(V,{}),e.jsxs("div",{className:"px-2 py-1.5 text-[12px] text-muted-foreground",children:["Snagset ",s||"—",n.state==="idle"&&e.jsxs(e.Fragment,{children:[" · ",e.jsx("button",{type:"button",className:"text-brand hover:underline",onClick:()=>void r(),children:"Check for updates"})]}),n.state==="checking"&&" · checking…",n.state==="failed"&&" · could not reach npm",n.state==="done"&&n.result&&e.jsxs(e.Fragment,{children:[" · ",n.result.newer?e.jsxs("a",{href:Xn,target:"_blank",rel:"noreferrer",className:"text-brand hover:underline",children:[n.result.latest," is out — how to upgrade"]}):"up to date"]})]})]})]})}function na({me:t}){const s=ne(),n=_e(),[a,r]=o.useState(wt),f=t.user.name||t.user.email,d=t.user.name?t.user.email:t.user.role,i=async()=>{await Z.logout().catch(()=>{}),Nt("out"),n.clear(),s({to:"/sign-in",replace:!0})};return e.jsxs(ae,{children:[e.jsxs(re,{render:e.jsx(O,{size:"lg"}),children:[e.jsx(Ps,{className:"size-8 rounded-full",children:e.jsx(Rs,{className:"bg-primary text-[12px] font-semibold text-primary-foreground",children:Os(t.user.name,t.user.email)})}),e.jsxs("div",{className:"min-w-0 flex-1 text-left leading-tight",children:[e.jsx("div",{className:"truncate text-[13px] font-semibold",children:f}),e.jsx("div",{className:"truncate text-[11.5px] text-muted-foreground",children:d})]}),e.jsx(Se,{className:"size-3.5 text-muted-foreground"})]}),e.jsxs(oe,{align:"start",side:"top",className:"w-[250px]",children:[e.jsx(je,{children:e.jsxs(ee,{className:"flex flex-col",children:[e.jsx("span",{className:"text-[13px] font-semibold",children:f}),e.jsx("span",{className:"text-[11.5px] font-normal text-muted-foreground",children:t.user.name?`${t.user.email} · ${t.user.role}`:t.user.role})]})}),e.jsx(V,{}),e.jsxs(Ts,{value:a,onValueChange:h=>{const c=h;Ct(c),r(c)},children:[e.jsx(ee,{children:"Theme"}),e.jsxs(ce,{value:"system",children:[e.jsx(Is,{}),"System"]}),e.jsxs(ce,{value:"light",children:[e.jsx(As,{}),"Light"]}),e.jsxs(ce,{value:"dark",children:[e.jsx(_s,{}),"Dark"]})]}),e.jsx(V,{}),e.jsxs(D,{onClick:()=>void s({to:"/you"}),children:[e.jsx(Qe,{}),"You"]}),e.jsxs(D,{onClick:()=>void i(),children:[e.jsx(Vs,{}),"Sign out"]})]})]})}function aa({onSearch:t}){const n=yt().map(a=>a.loaderData?.crumb).filter(a=>typeof a=="string"&&a.length>0);return e.jsxs("div",{className:"flex h-12 shrink-0 items-center gap-2.5 border-b border-border/60 px-4",children:[e.jsx(Ln,{className:"-ml-1"}),e.jsx("nav",{"aria-label":"Breadcrumb",className:"flex items-center gap-2 text-[13.5px] font-medium text-muted-foreground",children:n.map((a,r)=>e.jsxs("span",{className:"flex items-center gap-2",children:[r>0&&e.jsx("span",{className:"text-line-strong",children:"/"}),e.jsx("span",{className:r===n.length-1?"text-foreground":void 0,children:a})]},r))}),e.jsx("div",{className:"flex-1"}),e.jsxs("button",{type:"button",onClick:t,"aria-label":"Search and go",className:"flex h-7 items-center gap-2 rounded-md border border-border bg-card px-2 text-[12.5px] text-muted-foreground",children:[e.jsx(Ue,{className:"size-3.5"}),e.jsx("span",{className:"hidden sm:inline",children:"Search"}),e.jsx("kbd",{className:"hidden rounded border border-border px-1 font-mono text-[11px] sm:inline",children:"⌘K"})]})]})}const ka=()=>e.jsx(Qn,{children:e.jsx(Tt,{})});export{ka as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{N as g,P as f,Q as p,o as v,j as e,B as m,T as N,L as P,p as j}from"./index-Cxnlb88o.js";import{Q as y,u as b}from"./useBaseQuery-DmDP3Pxx.js";import{P as w,S}from"./parts-CErghVAB.js";import{b as R,c as E,S as F}from"./labels--UUyt9uB.js";import{u as k}from"./me-kMczOn0k.js";import"./card-DpmJQuox.js";var M=class extends y{constructor(s,n){super(s,n)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(s){s._type="infinite",super.setOptions(s)}getOptimisticResult(s){return s._type="infinite",super.getOptimisticResult(s)}fetchNextPage(s){return this.fetch({...s,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(s){return this.fetch({...s,meta:{fetchMore:{direction:"backward"}}})}createResult(s,n){const{state:i}=s,l=super.createResult(s,n),{isFetching:o,isRefetching:r,isError:u,isRefetchError:d}=l,t=i.fetchMeta?.fetchMore?.direction,c=u&&t==="forward",a=o&&t==="forward",h=u&&t==="backward",x=o&&t==="backward";return{...l,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:f(n,i.data),hasPreviousPage:g(n,i.data),isFetchNextPageError:c,isFetchingNextPage:a,isFetchPreviousPageError:h,isFetchingPreviousPage:x,isRefetchError:d&&!c&&!h,isRefetching:r&&!a&&!x}}};function A(s,n){return b(s,M)}const C=[{value:"unresolved",label:"Needs attention"},...E.map(s=>({value:s,label:F[s]})),{value:"all",label:"Everything"}];function O(s,n=new Date){const i=new Date(s),l=r=>new Date(r.getFullYear(),r.getMonth(),r.getDate()).getTime(),o=Math.round((l(n)-l(i))/864e5);return o<=0?"Today":o===1?"Yesterday":o<7?i.toLocaleDateString(void 0,{weekday:"long"}):i.toLocaleDateString(void 0,{day:"numeric",month:"long"})}function _(){const s=k(),{status:n="unresolved",site:i}=p.useSearch(),l=v({from:"/activity"}),o=t=>void l({search:c=>({...c,...t}),replace:!0}),r=A({queryKey:["activity",n,i??null],queryFn:({pageParam:t})=>j.activity({status:n,...i?{site:i}:{},...t?{cursor:t}:{}}),initialPageParam:"",getNextPageParam:t=>t.nextCursor??void 0,refetchOnWindowFocus:!0}),u=r.data?.pages.flatMap(t=>t.data)??[],d=[];for(const t of u){const c=O(t.updatedAt),a=d[d.length-1];a?.day===c?a.rows.push(t):d.push({day:c,rows:[t]})}return e.jsxs("div",{className:"flex flex-col gap-5 p-7",children:[e.jsx(w,{title:"Activity",sub:`Every site, newest first${i?"":" — all of them"}`}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[C.map(t=>e.jsx(m,{size:"sm",variant:n===t.value?"default":"outline",onClick:()=>o({status:t.value}),children:t.label},t.value)),e.jsx("div",{className:"flex-1"}),e.jsxs("label",{className:"flex items-center gap-2 text-[13px] text-muted-foreground",children:["Site",e.jsxs("select",{"aria-label":"Site",value:i??"",onChange:t=>o({site:t.target.value||void 0}),className:"h-8 rounded-md border border-input bg-background px-2.5 text-[13px] text-foreground",children:[e.jsx("option",{value:"",children:"All sites"}),s.projects.map(t=>e.jsx("option",{value:t.uid,children:t.name},t.uid))]})]})]}),r.isPending&&e.jsx(N,{rows:4}),r.isError&&e.jsx("p",{className:"m-0 text-[13px] text-destructive",children:"Could not read the feed. Reload to try again."}),r.isSuccess&&u.length===0&&e.jsx("p",{className:"m-0 text-[13px] text-muted-foreground",children:n==="resolved"?"Nothing has been resolved yet — this is where finished comments go.":n==="unresolved"?"Nothing needs attention. Every comment on every site is resolved.":"No comments yet on any site."}),d.map(({day:t,rows:c})=>e.jsxs("section",{className:"flex flex-col gap-2",children:[e.jsx("h2",{className:"m-0 text-[12px] font-medium uppercase tracking-wide text-muted-foreground",children:t}),e.jsx("ul",{className:"m-0 flex list-none flex-col gap-1.5 p-0",children:c.map(a=>e.jsx("li",{children:e.jsxs(P,{to:"/s/$site/comments",params:{site:a.site.uid},search:{thread:a.key},className:"flex flex-col gap-1 rounded-md border border-border px-3 py-2.5 no-underline transition-colors hover:bg-muted/60",children:[e.jsxs("span",{className:"flex flex-wrap items-center gap-x-2.5 gap-y-1 text-[13px]",children:[e.jsx(S,{status:a.status}),e.jsx("span",{className:"font-medium text-foreground",children:a.site.name}),e.jsx("code",{className:"font-mono text-[12px] text-muted-foreground",children:a.route}),e.jsx("span",{className:"flex-1"}),e.jsx("span",{className:"text-[12px] text-muted-foreground",children:R(a.updatedAt)})]}),a.latest?.body&&e.jsxs("span",{className:"line-clamp-2 text-[13px] text-foreground",children:[e.jsxs("span",{className:"text-muted-foreground",children:[a.latest.author??a.createdBy.name,": "]}),a.latest.body]}),e.jsxs("span",{className:"flex flex-wrap items-center gap-x-2 text-[12px] text-muted-foreground",children:[e.jsx("span",{className:"font-mono",children:a.key}),e.jsx("span",{children:"·"}),e.jsxs("span",{children:[a.commentCount," ",a.commentCount===1?"comment":"comments"]}),a.assignee&&e.jsxs(e.Fragment,{children:[e.jsx("span",{children:"·"}),e.jsx("span",{children:a.assignee})]})]})]})},a.id))})]},t)),r.hasNextPage&&e.jsx("div",{children:e.jsx(m,{variant:"outline",size:"sm",disabled:r.isFetchingNextPage,onClick:()=>void r.fetchNextPage(),children:r.isFetchingNextPage?"Reading…":"Show older"})})]})}export{_ as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as a,h as b,i as f,j as d,f as m}from"./index-
|
|
1
|
+
import{r as a,h as b,i as f,j as d,f as m}from"./index-Cxnlb88o.js";import{w as A}from"./dialog-Bys-LJLw.js";const x=a.createContext(void 0);function z(){const e=a.useContext(x);if(e===void 0)throw new Error(b(13));return e}const g={imageLoadingStatus:()=>null},R=a.forwardRef(function(t,r){const{className:v,render:p,style:s,...c}=t,[n,o]=a.useState("idle"),i={imageLoadingStatus:n},u=a.useMemo(()=>({imageLoadingStatus:n,setImageLoadingStatus:o}),[n,o]),l=f("span",t,{state:i,ref:r,props:c,stateAttributesMapping:g});return d.jsx(x.Provider,{value:u,children:l})}),k=a.forwardRef(function(t,r){const{className:v,render:p,delay:s=0,style:c,...n}=t,{imageLoadingStatus:o}=z(),[i,u]=a.useState(s===0),l=A();return a.useEffect(()=>(s>0?l.start(s,()=>u(!0)):u(!0),l.clear),[l,s]),f("span",t,{state:{imageLoadingStatus:o},ref:r,props:n,stateAttributesMapping:g,enabled:o!=="loaded"&&(s===0||i)})});function h({className:e,size:t="default",...r}){return d.jsx(R,{"data-slot":"avatar","data-size":t,className:m("group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten",e),...r})}function w({className:e,...t}){return d.jsx(k,{"data-slot":"avatar-fallback",className:m("flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs",e),...t})}export{h as A,w as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as a,f as n,n as o}from"./index-
|
|
1
|
+
import{m as a,f as n,n as o}from"./index-Cxnlb88o.js";import{u as d}from"./useRender-B_JrSXOO.js";const s=o("group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-4xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",destructive:"bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",outline:"border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",ghost:"hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",link:"text-primary underline-offset-4 hover:underline"}},defaultVariants:{variant:"default"}});function v({className:r,variant:e="default",render:t,...i}){return d({defaultTagName:"span",props:a({className:n(s({variant:e}),r)},i),render:t,state:{slot:"badge",variant:e}})}export{v as B};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s,f as t}from"./index-
|
|
1
|
+
import{j as s,f as t}from"./index-Cxnlb88o.js";function c({className:a,size:d="default",...r}){return s.jsx("div",{"data-slot":"card","data-size":d,className:t("group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",a),...r})}export{c as C};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{c as zn,
|
|
1
|
+
import{c as zn,ao as Z,k as Pe,ap as mt,aw as oe,aN as bt,r as l,aB as Jn,a1 as ke,e as q,l as Ze,d as N,h as zt,i as Ae,a2 as Qn,j as I,a3 as Jt,E as ve,aO as Zn,a4 as Pt,g as et,as as ot,ar as er,aP as tr,aQ as Qt,aR as nr,ax as rr,B as Zt,f as Fe}from"./index-Cxnlb88o.js";import{a as A,o as U,m as ge,c as Se,B as or,u as en,s as tn,y as yt,b as nn,w as rn,g as Ee,t as on,q as sn,n as sr,p as ir,i as ar}from"./label-CwqSv8L3.js";/**
|
|
2
2
|
* @license lucide-react v1.39.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const cr=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ur=zn("x",cr);function lr(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:dr,platform:fr,maxTouchPoints:pr}=lr(),tt=dr.toLowerCase(),_e=fr.toLowerCase(),St=/^i(os$|p)/.test(_e)||_e==="macintel"&&pr>1,wt="android",lt=_e===wt||tt.includes(wt),gr=!St&&_e.startsWith("mac");_e.startsWith("win");const hr=gr||St,Me=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none");!Me&&tt.includes("firefox");!Me&&tt.includes("chrom");const mr=hr,an=/jsdom|happydom/.test(tt),dt="data-base-ui-focusable",cn="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",gs="ArrowLeft",hs="ArrowRight",ms="ArrowUp",bs="ArrowDown";function ys(e,t){if(!Pe(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,r]of t.entries())if(A(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function st(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function br(e){return e.matches("html,body")}function un(e){return Z(e)&&e.matches(cn)}function Ss(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${cn}`)!=null}function kt(e){return e?e.getAttribute("role")==="combobox"&&un(e):!1}function Es(e){if(!e||an)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function At(e){return e?e.hasAttribute(dt)?e:e.querySelector(`[${dt}]`)||e:null}function Ve(e,t,n=!0){return e.filter(o=>o.parentId===t).flatMap(o=>[...!n||o.context?.open?[o]:[],...Ve(e,o.id,n)])}function Ft(e,t){let n=[],r=e.find(o=>o.id===t)?.parentId;for(;r;){const o=e.find(s=>s.id===r);r=o?.parentId,o&&(n=n.concat(o))}return n}function yr(e){e.preventDefault(),e.stopPropagation()}function Sr(e){return"nativeEvent"in e}function Er(e){return e.pointerType===""&&e.isTrusted?!0:lt&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Rr(e){return an?!1:!lt&&e.width===0&&e.height===0||lt&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function Rs(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Tr(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}function Ts(e,t){return t<0||t>=e.length}function xs(e,t){return ln(e.current,{disabledIndices:t})}function vs(e,t){return ln(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function ln(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:o=1}={}){let s=t;do s+=n?-o:o;while(s>=0&&s<=e.length-1&&xr(e,s,r));return s}function xr(e,t,n){if(typeof n=="function"?n(t):n?.includes(t)??!1)return!0;const o=e[t];return o?!Et(o)||o.matches(":disabled")?!0:!n&&(o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true"):!1}function vr(e){return e.visibility==="hidden"||e.visibility==="collapse"}function Et(e,t=e?mt(e):null){return!e||!e.isConnected||!t||vr(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const Cr='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function Or(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return bt(n)?n.host:null}function ft(e){for(const t of Array.from(e.children))if(oe(t)==="summary")return t;return null}function Ir(e,t){const n=ft(t);return!!n&&(e===n||A(n,e))}function dn(e){const t=e?oe(e):"";return e!=null&&e.matches(Cr)&&(t!=="summary"||e.parentElement!=null&&oe(e.parentElement)==="details"&&ft(e.parentElement)===e)&&(t!=="details"||ft(e)==null)&&(t!=="input"||e.type!=="hidden")}function fn(e){if(!dn(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=Or(t)){const n=t!==e,r=oe(t)==="slot";if(t.hasAttribute("inert")||n&&oe(t)==="details"&&!t.open&&!Ir(e,t)||t.hasAttribute("hidden")||!r&&!Pr(t,n))return!1}return!0}function Pr(e,t){const n=mt(e);return t?n.display!=="none":Et(e,n)}function pn(e){const t=e.tabIndex;if(t<0){const n=oe(e);if(n==="details"||n==="audio"||n==="video"||Z(e)&&e.isContentEditable)return 0}return t}function it(e){if(oe(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function wr(e,t){const n=it(e);if(!n)return!0;const r=t.find(o=>{const s=it(o);return s?.name===n.name&&s.form===n.form&&s.checked});return r?r===n:t.find(o=>{const s=it(o);return s?.name===n.name&&s.form===n.form})===n}function gn(e){if(Z(e)&&oe(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Z(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function hn(e,t){gn(e).forEach(n=>{dn(n)&&t.push(n),hn(n,t)})}function mn(e,t,n){gn(e).forEach(r=>{Z(r)&&r.matches(t)&&n.push(r),mn(r,t,n)})}function Rt(e){return fn(e)&&pn(e)>=0}function bn(e){const t=[];return hn(e,t),t.filter(fn)}function Ue(e){const t=bn(e);return t.filter(n=>pn(n)>=0&&wr(n,t))}function yn(e,t){const n=Ue(e),r=n.length;if(r===0)return;const o=ge(U(e)),s=n.indexOf(o),a=s===-1?t===1?0:r-1:s+t;return n[a]}function Sn(e){return yn(U(e).body,1)||e}function En(e){return yn(U(e).body,-1)||e}function Rn(e,t){if(!e)return null;const n=Ue(U(e).body),r=n.length;if(r===0)return null;const o=n.indexOf(e);if(o===-1)return null;const s=(o+t+r)%r;return n[s]}function Cs(e){return Rn(e,1)}function Os(e){return Rn(e,-1)}function He(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!A(n,r)}function kr(e){Ue(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Mt(e){const t=[];mn(e,"[data-tabindex]",t),t.forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function Tn(e){l.useEffect(e,Jn)}const Be=0;class Ce{static create(){return new Ce}currentId=Be;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Be,n()},t)}isStarted(){return this.currentId!==Be}clear=()=>{this.currentId!==Be&&(clearTimeout(this.currentId),this.currentId=Be)};disposeEffect=()=>this.clear}function ze(){const e=ke(Ce.create).current;return Tn(e.disposeEffect),e}const Ge=null;class Ar{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let o=0;o<n.length;o+=1)n[o]?.(t)};request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}let qe=new Ar;class ue{static create(){return new ue}static request(t){return qe.request(t)}static cancel(t){return qe.cancel(t)}currentId=Ge;request(t){this.cancel(),this.currentId=qe.request(()=>{this.currentId=Ge,t()})}cancel=()=>{this.currentId!==Ge&&(qe.cancel(this.currentId),this.currentId=Ge)};disposeEffect=()=>this.cancel}function xn(){const e=ke(ue.create).current;return Tn(e.disposeEffect),e}function he(e){return e==null?e:"current"in e?e.current:e}function Fr(e,t=!1){const n=xn();return q((r,o=null)=>{n.cancel();const s=he(e);if(s==null)return;const a=s,c=()=>{Ze.flushSync(r)};if(typeof a.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){r();return}function u(){Promise.all(a.getAnimations().map(i=>i.finished)).then(()=>{o?.aborted||c()},()=>{if(o?.aborted)return;if(a.getAnimations().some(d=>d.pending||d.playState!=="finished")){u();return}c()})}if(t){const i="data-starting-style";if(!a.hasAttribute(i)){n.request(u);return}const d=new MutationObserver(()=>{a.hasAttribute(i)||(d.disconnect(),u())});d.observe(a,{attributes:!0,attributeFilter:[i]}),o?.addEventListener("abort",()=>d.disconnect(),{once:!0});return}n.request(u)})}function vn(e){const{enabled:t=!0,open:n,ref:r,onComplete:o}=e,s=q(o),a=Fr(r,n);l.useEffect(()=>{if(!t)return;const c=new AbortController;return a(s,c.signal),()=>{c.abort()}},[t,n,s,a])}let Dt=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const Mr={"data-starting-style":""},Dr={"data-ending-style":""},Cn={transitionStatus(e){return e==="starting"?Mr:e==="ending"?Dr:null}};function Nr(e,t=!1,n=!1){const[r,o]=l.useState(e&&t?"idle":void 0),[s,a]=l.useState(e);return e&&!s&&(a(!0),o("starting")),!e&&s&&r!=="ending"&&!n&&o("ending"),!e&&!s&&r==="ending"&&o(void 0),N(()=>{if(!e&&s&&r!=="ending"&&n){const c=ue.request(()=>{o("ending")});return()=>{ue.cancel(c)}}},[e,s,r,n]),N(()=>{if(!e||t)return;const c=ue.request(()=>{o(void 0)});return()=>{ue.cancel(c)}},[t,e]),N(()=>{if(!e||!t)return;e&&s&&r!=="idle"&&o("starting");const c=ue.request(()=>{o("idle")});return()=>{ue.cancel(c)}},[t,e,s,r]),{mounted:s,setMounted:a,transitionStatus:r}}const On=l.createContext(void 0);function Oe(e){const t=l.useContext(On);if(!e&&t===void 0)throw new Error(zt(27));return t}(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Dt.startingStyle]="startingStyle",e[e.endingStyle=Dt.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({});const Lr={"data-popup-open":""},Br={"data-popup-open":"","data-pressed":""},Wr={"data-open":""},Hr={"data-closed":""},jr={"data-anchor-hidden":""},Is={open(e){return e?Lr:null}},Ps={open(e){return e?Br:null}},In={open(e){return e?Wr:Hr},anchorHidden(e){return e?jr:null}},_r={...In,...Cn},Vr=l.forwardRef(function(t,n){const{render:r,className:o,style:s,forceRender:a=!1,...c}=t,u=Oe(),i=u.useState("open"),d=u.useState("nested"),R=u.useState("mounted"),f=u.useState("transitionStatus");return Ae("div",t,{state:{open:i,transitionStatus:f},ref:[u.context.backdropRef,n],stateAttributesMapping:_r,props:[{role:"presentation",hidden:!R,style:{userSelect:"none",WebkitUserSelect:"none"}},c],enabled:a||!d})}),Pn=l.forwardRef(function(t,n){const{render:r,className:o,style:s,disabled:a=!1,nativeButton:c=!0,...u}=t,i=Oe(),d=i.useState("open"),{getButtonProps:R,buttonRef:f}=Qn({disabled:a,native:c}),g={disabled:a};function m(x){d&&i.setOpen(!1,Se(or,x.nativeEvent))}return Ae("button",t,{state:g,ref:[n,f],props:[{onClick:m},u,R]})}),Ur=l.forwardRef(function(t,n){const{render:r,className:o,style:s,id:a,...c}=t,u=Oe(),i=en(a);return u.useSyncedValueWithCleanup("descriptionElementId",i),Ae("p",t,{ref:n,props:[{id:i},c]})});function D(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function we(...e){return()=>{for(let t=0;t<e.length;t+=1){const n=e[t];n&&n()}}}function Ke(e){const t=ke(Yr,e).current;return t.next=e,N(t.effect),t}function Yr(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const wn={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},Gr={...wn,position:"fixed",top:0,left:0},ws={...wn,position:"absolute"},Je=l.forwardRef(function(t,n){const[r,o]=l.useState();N(()=>{mr&&Me&&o("button")},[]);const s={tabIndex:0,role:r};return I.jsx("span",{...t,ref:n,style:Gr,"aria-hidden":r?void 0:!0,...s,"data-base-ui-focus-guard":""})});function Qe(e){return`data-base-ui-${e}`}let $e=0;function at(e,t={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:o}=t;cancelAnimationFrame($e);function s(){o&&!o()||e?.focus({preventScroll:n})}if(r)return s(),Jt;const a=requestAnimationFrame(s);return $e=a,()=>{$e===a&&(cancelAnimationFrame(a),$e=0)}}const ct={inert:new WeakMap,"aria-hidden":new WeakMap},Nt="data-base-ui-inert",pt={inert:new WeakSet,"aria-hidden":new WeakSet};let We=new WeakMap,ut=0;function qr(e){return pt[e]}function kn(e){return e?bt(e)?e.host:kn(e.parentNode):null}const Lt=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=kn(n);return e.contains(r)?r:null}).filter(n=>n!=null),Bt=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},Wt=(e,t,n)=>{const r=[],o=s=>{!s||n.has(s)||Array.from(s.children).forEach(a=>{oe(a)!=="script"&&(t.has(a)?o(a):r.push(a))})};return o(e),r};function Kr(e,t,n,r,{mark:o=!0}){let s=null;r?s="inert":n&&(s="aria-hidden");let a=null,c=null;const u=Lt(t,e),i=o?Wt(t,Bt(u),new Set(u)):[],d=[],R=[];if(s){const f=ct[s],g=qr(s);c=g,a=f;const m=Lt(t,Array.from(t.querySelectorAll("[aria-live]"))),x=u.concat(m);Wt(t,Bt(x),new Set(x)).forEach(S=>{const b=S.getAttribute(s),Y=b!==null&&b!=="false",v=(f.get(S)||0)+1;f.set(S,v),d.push(S),v===1&&Y&&g.add(S),Y||S.setAttribute(s,s==="inert"?"":"true")})}return o&&i.forEach(f=>{const g=(We.get(f)||0)+1;We.set(f,g),R.push(f),g===1&&f.setAttribute(Nt,"")}),ut+=1,()=>{a&&d.forEach(f=>{const m=(a.get(f)||0)-1;a.set(f,m),m||(!c?.has(f)&&s&&f.removeAttribute(s),c?.delete(f))}),o&&R.forEach(f=>{const g=(We.get(f)||0)-1;We.set(f,g),g||f.removeAttribute(Nt)}),ut-=1,ut||(ct.inert=new WeakMap,ct["aria-hidden"]=new WeakMap,pt.inert=new WeakSet,pt["aria-hidden"]=new WeakSet,We=new WeakMap)}}function Ht(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:o=!0}=t,s=U(e[0]).body;return Kr(e,s,n,r,{mark:o})}const ks=500,As=500,Fs={style:{transition:"none"}},$r="data-base-ui-click-trigger",Ms={fallbackAxisSide:"none"},Ds={fallbackAxisSide:"end"},Xr={clipPath:"inset(50%)",position:"fixed",top:0,left:0},An=l.createContext(null),Fn=()=>l.useContext(An),zr=Qe("portal");function Jr(e={}){const{ref:t,container:n,componentProps:r=ve,elementProps:o}=e,s=yt(),c=Fn()?.portalNode,[u,i]=l.useState(null),[d,R]=l.useState(null),f=q(y=>{y!==null&&R(y)}),g=l.useRef(null);N(()=>{if(n===null){g.current&&(g.current=null,R(null),i(null));return}const y=(n&&(Zn(n)?n:n.current))??c??document.body;if(y==null){g.current&&(g.current=null,R(null),i(null));return}g.current!==y&&(g.current=y,R(null),i(y))},[n,c]);const m=Ae("div",r,{ref:[t,f],props:[{id:s,[zr]:""},o]}),x=u&&m?Ze.createPortal(m,u):null;return{node:d,nodeId:l.isValidElement(m)?m.props.id:void 0,subtree:x}}const Qr=l.forwardRef(function(t,n){const{render:r,className:o,style:s,children:a,container:c,...u}=t,{node:i,nodeId:d,subtree:R}=Jr({container:c,ref:n,componentProps:t,elementProps:u}),f=l.useRef(null),g=l.useRef(null),m=l.useRef(null),x=l.useRef(null),[y,S]=l.useState(null),b=l.useRef(!1),Y=y?.modal,v=y?.open,B=!!y&&!y.modal&&y.open&&!!i;l.useEffect(()=>{if(!i||Y)return;function F(H){i&&H.relatedTarget&&He(H)&&(H.type==="focusin"?b.current&&(Mt(i),b.current=!1):(kr(i),b.current=!0))}return we(D(i,"focusin",F,!0),D(i,"focusout",F,!0))},[i,Y]),N(()=>{!i||v!==!0||!b.current||(Mt(i),b.current=!1)},[v,i]);const K=l.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:g,beforeInsideRef:m,afterInsideRef:x,portalNode:i,setFocusManagerState:S}),[i]);return I.jsxs(l.Fragment,{children:[R,I.jsxs(An.Provider,{value:K,children:[B&&i&&I.jsx(Je,{"data-type":"outside",ref:f,onFocus:F=>{if(He(F,i))m.current?.focus();else{const H=y?y.domReference:null;En(H)?.focus()}}}),B&&i&&I.jsx("span",{"aria-owns":d,style:Xr}),i&&Ze.createPortal(a,i),B&&i&&I.jsx(Je,{"data-type":"outside",ref:g,onFocus:F=>{if(He(F,i))x.current?.focus();else{const H=y?y.domReference:null;Sn(H)?.focus(),y?.closeOnFocusOut&&y?.onOpenChange(!1,Se(tn,F.nativeEvent))}}})]})]})});function Mn(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}class Zr{nodesRef={current:[]};events=Mn();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const Dn=l.createContext(null),Nn=l.createContext(null),Tt=()=>l.useContext(Dn)?.id||null,xt=e=>{const t=l.useContext(Nn);return e??t};function Ns(e){const t=yt(),n=xt(e),r=Tt();return N(()=>{if(!t)return;const o={id:t,parentId:r};return n?.addNode(o),()=>{n?.removeNode(o)}},[n,t,r]),t}function Ls(e){const{children:t,id:n}=e,r=Tt();return I.jsx(Dn.Provider,{value:l.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function Bs(e){const{children:t,externalTree:n}=e,r=ke(()=>n??new Zr).current;return I.jsx(Nn.Provider,{value:r,children:t})}function eo(e,t){const n=et(Ee(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const jt=20;let ye=[];function vt(){ye=ye.filter(e=>e.deref()?.isConnected)}function _t(e){vt(),e&&oe(e)!=="body"&&(ye.push(new WeakRef(e)),ye.length>jt&&(ye=ye.slice(-jt)))}function Vt(){return vt(),ye[ye.length-1]?.deref()}function to(e){return e?Rt(e)?e:Ue(e)[0]||e:null}function Ut(e){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!e.getAttribute("role")?.includes("dialog"))return;const n=bn(e).filter(o=>{const s=o.getAttribute("data-tabindex")||"";return Rt(o)||o.hasAttribute("data-tabindex")&&!s.startsWith("-")}),r=e.getAttribute("tabindex");n.length===0?r!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(r!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function no(e){const{context:t,children:n,disabled:r=!1,initialFocus:o=!0,returnFocus:s=!0,restoreFocus:a=!1,modal:c=!0,closeOnFocusOut:u=!0,openInteractionType:i="",nextFocusableElement:d,previousFocusableElement:R,beforeContentFocusGuardRef:f,externalTree:g,getInsideElements:m}=e,x="rootStore"in t?t.rootStore:t,y=x.useState("open"),S=x.useState("domReferenceElement"),b=x.useState("floatingElement"),{events:Y,dataRef:v}=x.context,B=q(()=>v.current.floatingContext?.nodeId),K=o===!1,F=kt(S)&&K,H=Ke(o),M=Ke(s),X=Ke(i),me=Ke(y),_=xt(g),P=Fn(),$=l.useRef(!1),le=l.useRef(!1),se=l.useRef(!1),ie=l.useRef(null),Re=l.useRef(""),be=l.useRef(""),Te=l.useRef(null),Ie=l.useRef(null),w=Pt(Te,f,P?.beforeInsideRef),ee=Pt(Ie,P?.afterInsideRef),de=ze(),fe=ze(),De=xn(),Ye=P!=null,C=At(b),ae=q((O=C)=>O?Ue(O):[]),re=q(()=>m?.().filter(O=>O!=null)??[]);l.useEffect(()=>{if(r||!c)return;function O(G){G.key==="Tab"&&A(C,ge(U(C)))&&ae().length===0&&!F&&yr(G)}const j=U(C);return D(j,"keydown",O)},[r,C,c,F,ae]),l.useEffect(()=>{if(r||!y)return;const O=U(C);function j(){se.current=!1}function G(te){const T=Ee(te),L=re(),E=A(b,T)||A(S,T)||A(P?.portalNode,T)||L.some(V=>V===T||A(V,T));se.current=!E,be.current=te.pointerType||"keyboard",T?.closest(`[${$r}]`)&&(le.current=!0,fe.start(0,()=>{le.current=!1}))}function z(){be.current="keyboard"}return we(D(O,"pointerdown",G,!0),D(O,"pointerup",j,!0),D(O,"pointercancel",j,!0),D(O,"keydown",z,!0),j)},[r,b,S,C,y,P,fe,re]),l.useEffect(()=>{if(r||!u)return;const O=U(C);function j(){le.current=!0,fe.start(0,()=>{le.current=!1})}function G(L){const E=Ee(L);Rt(E)&&(ie.current=E)}function z(L){const E=L.relatedTarget,V=L.currentTarget,J=Ee(L);c&&E==null&&J!=null&&A(b,J)&&_t(J),queueMicrotask(()=>{const W=B(),ne=x.context.triggerElements,p=re(),h=E?.hasAttribute(Qe("focus-guard"))&&[Te.current,Ie.current,P?.beforeInsideRef.current,P?.afterInsideRef.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,he(R),he(d)].includes(E),Q=!(A(S,E)||A(b,E)||A(E,b)||A(P?.portalNode,E)||p.some(k=>k===E||A(k,E))||ne.hasMatchingElement(k=>A(k,E))||h||_&&(Ve(_.nodesRef.current,W).find(k=>A(k.context?.elements.floating,E)||A(k.context?.elements.domReference,E))||Ft(_.nodesRef.current,W).find(k=>[k.context?.elements.floating,At(k.context?.elements.floating)].includes(E)||k.context?.elements.domReference===E)));if(V===S&&C&&Ut(C),a&&V!==S&&!Et(J)&&ge(O)===O.body){if(Z(C)&&(C.focus(),a==="popup")){De.request(()=>{C.focus()});return}const k=ae(),pe=ie.current,Ne=(pe&&k.includes(pe)?pe:null)||k[k.length-1]||C;Z(Ne)&&Ne.focus()}if(v.current.insideReactTree){v.current.insideReactTree=!1;return}(F||!c)&&E&&Q&&!le.current&&(F||E!==Vt())&&($.current=!0,x.setOpen(!1,Se(tn,L)))})}function te(){se.current||(v.current.insideReactTree=!0,de.start(0,()=>{v.current.insideReactTree=!1}))}const T=Z(S)?S:null;if(!(!b&&!T))return we(T&&D(T,"focusout",z),T&&D(T,"pointerdown",j),b&&D(b,"focusin",G),b&&D(b,"focusout",z),b&&P&&D(b,"focusout",te,!0))},[r,S,b,C,c,_,P,x,u,a,ae,F,B,v,de,fe,De,d,R,re]),l.useEffect(()=>{if(r||!b||!y)return;const O=Array.from(P?.portalNode?.querySelectorAll(`[${Qe("portal")}]`)||[]),G=(_?Ft(_.nodesRef.current,B()):[]).find(V=>kt(V.context?.elements.domReference||null))?.context?.elements.domReference,te=[...[b,...O,Te.current,Ie.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,...re()],G,he(R),he(d),F?S:null].filter(V=>V!=null),T=Ht(te,{ariaHidden:c||F,mark:!1}),L=[b,...O].filter(V=>V!=null),E=Ht(L);return()=>{E(),T()}},[y,r,S,b,c,P,F,_,B,d,R,re]),N(()=>{if(!y||r||!Z(C))return;Re.current="",be.current="";const O=U(C),j=ge(O);queueMicrotask(()=>{const G=H.current,z=typeof G=="function"?G(X.current||""):G;if(z===void 0||z===!1||A(C,j))return;let T=null;const L=()=>(T==null&&(T=ae(C)),T[0]||C);let E;z===!0||z===null?E=L():E=he(z),E=E||L();const V=A(C,ge(O));at(E,{preventScroll:E===C,shouldFocus(){if(!me.current)return!1;if(V)return!0;const J=ge(O);return!(J!==E&&A(C,J))}})})},[r,y,C,ae,H,X,me]),N(()=>{if(r||!C)return;const O=U(C),j=ge(O),G=X.current==null;_t(j);function z(T){if(T.open||(Re.current=eo(T.nativeEvent,be.current)),T.reason===nn&&T.nativeEvent.type==="mouseleave"&&($.current=!0),T.reason===rn)if(T.nested)$.current=!1;else if(Er(T.nativeEvent)||Rr(T.nativeEvent))$.current=!1;else{let L=!1;U(C).createElement("div").focus({get preventScroll(){return L=!0,!1}}),L?$.current=!1:$.current=!0}}Y.on("openchange",z);function te(T){const L=M.current;let E=typeof L=="function"?L(T):L;if(E===void 0||E===!1)return null;E===null&&(E=!0);const V=S?.isConnected?S:null,J=j?.isConnected&&oe(j)!=="body"?j:null;let W=G?J||V:V||J;return W||(W=Vt()||null),typeof E=="boolean"?W:he(E)||W||null}return()=>{Y.off("openchange",z);const T=ge(O),L=re(),E=A(b,T)||L.some(ne=>ne===T||A(ne,T))||_&&Ve(_.nodesRef.current,B(),!1).some(ne=>A(ne.context?.elements.floating,T)),V=M.current,J=Re.current,W=te(J);queueMicrotask(()=>{const ne=to(W),p=typeof V!="boolean";if(V&&!$.current&&Z(ne)&&(!(!p&&ne!==T&&T!==O.body)||E)){const h={preventScroll:!0};J==="keyboard"&&(h.focusVisible=!0),ne.focus(h)}$.current=!1})}},[r,b,C,M,X,Y,_,S,B,re]),N(()=>{if(!Me||y||!b)return;const O=ge(U(b));!Z(O)||!un(O)||A(b,O)&&O.blur()},[y,b]),N(()=>{if(!(r||!P))return P.setFocusManagerState({modal:c,closeOnFocusOut:u,open:y,onOpenChange:x.setOpen,domReference:S}),()=>{P.setFocusManagerState(null)}},[r,P,c,y,x,u,S]),N(()=>{if(!(r||!C))return Ut(C),()=>{queueMicrotask(vt)}},[r,C]);const xe=!r&&(c?!F:!0)&&(Ye||c);return I.jsxs(l.Fragment,{children:[xe&&I.jsx(Je,{"data-type":"inside",ref:w,onFocus:O=>{if(c){const j=ae();at(j[j.length-1])}else P?.portalNode&&($.current=!1,He(O,P.portalNode)?Sn(S)?.focus():he(R??P.beforeOutsideRef)?.focus())}}),n,xe&&I.jsx(Je,{"data-type":"inside",ref:ee,onFocus:O=>{c?at(ae()[0]):P?.portalNode&&(u&&($.current=!0),He(O,P.portalNode)?En(S)?.focus():he(d??P.afterOutsideRef)?.focus())}})]})}function ro(){return!1}function oo(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function so(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:o=!0,outsidePressEvent:s="sloppy",referencePress:a=ro,bubbles:c,externalTree:u}=t,i="rootStore"in e?e.rootStore:e,d=i.useState("open"),R=i.useState("floatingElement"),{dataRef:f}=i.context,g=xt(u),m=q(typeof o=="function"?o:()=>!1),x=typeof o=="function"?m:o,y=x!==!1,S=q(()=>s),{escapeKey:b,outsidePress:Y}=oo(c),v=l.useRef(!1),B=l.useRef(!1),K=l.useRef(!1),F=l.useRef(!1),H=l.useRef(""),M=l.useRef(null),X=ze(),me=ze(),_=q(()=>{me.clear(),f.current.insideReactTree=!1}),P=q(w=>{const ee=f.current.floatingContext?.nodeId;return(g?Ve(g.nodesRef.current,ee):[]).some(fe=>fe.context?.open&&!fe.context.dataRef.current[w])}),$=q(w=>st(w,i.select("floatingElement"))||st(w,i.select("domReferenceElement"))),le=q(w=>{a()&&i.setOpen(!1,Se(on,w.nativeEvent))}),se=q(w=>{if(!d||!n||!r||w.key!=="Escape"||F.current||!b&&P("__escapeKeyBubbles"))return;const ee=Sr(w)?w.nativeEvent:w,de=Se(sn,ee);i.setOpen(!1,de),de.isCanceled||w.preventDefault(),!b&&!de.isPropagationAllowed&&w.stopPropagation()}),ie=q(()=>{f.current.insideReactTree=!0,me.start(0,_)}),Re=q(w=>{if(!d||!n||w.button!==0)return;const ee=Ee(w.nativeEvent);A(i.select("floatingElement"),ee)&&(v.current||(v.current=!0,B.current=!1))}),be=q(w=>{!d||!n||(w.defaultPrevented||w.nativeEvent.defaultPrevented)&&v.current&&(B.current=!0)});l.useEffect(()=>{if(!d||!n)return _;f.current.__escapeKeyBubbles=b,f.current.__outsidePressBubbles=Y;const w=new Ce,ee=new Ce;function de(){w.clear(),F.current=!0}function fe(){w.start(Me?5:0,()=>{F.current=!1})}function De(){K.current=!0,ee.start(0,()=>{K.current=!1})}function Ye(){v.current=!1,B.current=!1}function C(){const p=H.current,h=p==="pen"||!p?"mouse":p,Q=S(),k=typeof Q=="function"?Q():Q;return typeof k=="string"?k:k[h]}function ae(p){const h=C();return h==="intentional"&&p.type!=="click"||h==="sloppy"&&p.type==="click"}function re(p){const h=f.current.floatingContext?.nodeId,Q=g&&Ve(g.nodesRef.current,h).some(k=>st(p,k.context?.elements.floating));return $(p)||Q}function xe(p){if(ae(p)){p.type!=="click"&&!$(p)&&(ee.clear(),K.current=!1),_();return}if(f.current.insideReactTree){_();return}const h=Ee(p),Q=`[${Qe("inert")}]`,k=Pe(h)?h.getRootNode():null,pe=Array.from((bt(k)?k:U(i.select("floatingElement"))).querySelectorAll(Q)),Ne=i.context.triggerElements;if(h&&(Ne.hasElement(h)||Ne.hasMatchingElement(ce=>A(ce,h))))return;let Le=Pe(h)?h:null;for(;Le&&!ot(Le);){const ce=er(Le);if(ot(ce)||!Pe(ce))break;Le=ce}if(!(pe.length&&Pe(h)&&!br(h)&&!A(h,i.select("floatingElement"))&&pe.every(ce=>!A(Le,ce)))){if(Z(h)&&!("touches"in p)){const ce=ot(h),rt=mt(h),It=/auto|scroll/,Un=ce||It.test(rt.overflowX),Yn=ce||It.test(rt.overflowY),Gn=Un&&h.clientWidth>0&&h.scrollWidth>h.clientWidth,qn=Yn&&h.clientHeight>0&&h.scrollHeight>h.clientHeight,Kn=rt.direction==="rtl",$n=qn&&(Kn?p.offsetX<=h.offsetWidth-h.clientWidth:p.offsetX>h.clientWidth),Xn=Gn&&p.offsetY>h.clientHeight;if($n||Xn)return}if(!re(p)){if(C()==="intentional"&&K.current){ee.clear(),K.current=!1;return}typeof x=="function"&&!x(p)||P("__outsidePressBubbles")||(i.setOpen(!1,Se(rn,p)),_())}}}function O(p){C()!=="sloppy"||p.pointerType==="touch"||!i.select("open")||!n||$(p)||xe(p)}function j(p){if(C()!=="sloppy"||!i.select("open")||!n||$(p))return;const h=p.touches[0];h&&(M.current={startTime:Date.now(),startX:h.clientX,startY:h.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},X.start(1e3,()=>{M.current&&(M.current.dismissOnTouchEnd=!1,M.current.dismissOnMouseDown=!1)}))}function G(p,h){const Q=Ee(p);if(!Q)return;const k=D(Q,p.type,()=>{h(p),k()})}function z(p){H.current="touch",G(p,j)}function te(p){X.clear(),p.type==="pointerdown"&&(H.current=p.pointerType),!(p.type==="mousedown"&&M.current&&!M.current.dismissOnMouseDown)&&G(p,h=>{h.type==="pointerdown"?O(h):xe(h)})}function T(p){if(!v.current)return;const h=B.current;if(Ye(),C()==="intentional"){if(p.type==="pointercancel"){h&&De();return}if(!re(p)){if(h){De();return}typeof x=="function"&&!x(p)||(ee.clear(),K.current=!0,_())}}}function L(p){if(C()!=="sloppy"||!M.current||$(p))return;const h=p.touches[0];if(!h)return;const Q=Math.abs(h.clientX-M.current.startX),k=Math.abs(h.clientY-M.current.startY),pe=Math.sqrt(Q*Q+k*k);pe>5&&(M.current.dismissOnTouchEnd=!0),pe>10&&(xe(p),X.clear(),M.current=null)}function E(p){G(p,L)}function V(p){C()!=="sloppy"||!M.current||$(p)||(M.current.dismissOnTouchEnd&&xe(p),X.clear(),M.current=null)}function J(p){G(p,V)}const W=U(R),ne=we(r&&we(D(W,"keydown",se),D(W,"compositionstart",de),D(W,"compositionend",fe)),y&&we(D(W,"click",te,!0),D(W,"pointerdown",te,!0),D(W,"pointerup",T,!0),D(W,"pointercancel",T,!0),D(W,"mousedown",te,!0),D(W,"mouseup",T,!0),D(W,"touchstart",z,!0),D(W,"touchmove",E,!0),D(W,"touchend",J,!0)));return()=>{ne(),w.clear(),ee.clear(),Ye(),K.current=!1,_()}},[f,R,r,y,x,d,n,b,Y,se,_,S,P,$,g,i,X]);const Te=l.useMemo(()=>({onKeyDown:se,onPointerDown:le,onClick:le}),[se,le]),Ie=l.useMemo(()=>({onKeyDown:se,onPointerDown:be,onMouseDown:be,onClickCapture:ie,onMouseDownCapture(w){ie(),Re(w)},onPointerDownCapture(w){ie(),Re(w)},onMouseUpCapture:ie,onTouchEndCapture:ie,onTouchMoveCapture:ie}),[se,ie,Re,be]);return l.useMemo(()=>n?{reference:Te,floating:Ie,trigger:Te}:{},[n,Te,Ie])}var Ln=tr();const gt=[];let ht;function io(){return ht}function ao(e){gt.push(e)}function co(e){const t=(n,r)=>{const o=ke(uo).current;let s;try{ht=o;for(const a of gt)a.before(o);s=e(n,r);for(const a of gt)a.after(o);o.didInitialize=!0}finally{ht=void 0}return s};return t.displayName=e.displayName||e.name,t}function Ws(e){return l.forwardRef(co(e))}function uo(){return{didInitialize:!1}}const lo=Qt(19),fo=lo?go:ho;function Bn(e,t,n,r,o){return fo(e,t,n,r,o)}function po(e,t,n,r,o){const s=l.useCallback(()=>t(e.getSnapshot(),n,r,o),[e,t,n,r,o]);return Ln.useSyncExternalStore(e.subscribe,s,s)}ao({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){const r=e.syncHooks[n],o=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,o)||(t=!0,r.value=o)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const n=new Set;for(const o of e.syncHooks)n.add(o.store);const r=[];for(const o of n)r.push(o.subscribe(t));return()=>{for(const o of r)o()}}),Ln.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function go(e,t,n,r,o){const s=io();if(!s)return po(e,t,n,r,o);const a=s.syncIndex;s.syncIndex+=1;let c;return s.didInitialize?(c=s.syncHooks[a],(c.store!==e||c.selector!==t||!Object.is(c.a1,n)||!Object.is(c.a2,r)||!Object.is(c.a3,o))&&(c.store!==e&&(s.didChangeStore=!0),c.store=e,c.selector=t,c.a1=n,c.a2=r,c.a3=o,c.value=t(e.getSnapshot(),n,r,o))):(c={store:e,selector:t,a1:n,a2:r,a3:o,value:t(e.getSnapshot(),n,r,o)},s.syncHooks.push(c)),c.value}function ho(e,t,n,r,o){return nr.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,r,o))}class mo{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,o){return Bn(this,t,n,r,o)}}class Wn extends mo{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){l.useDebugValue(t);const r=this;N(()=>{r.state[t]!==n&&r.set(t,n)},[r,t,n])}useSyncedValueWithCleanup(t,n){const r=this;N(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);N(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){l.useDebugValue(t);const r=this,o=n!==void 0;N(()=>{o&&!Object.is(r.state[t],n)&&r.setState({...r.state,[t]:n})},[r,t,n,o])}select(t,n,r,o){const s=this.selectors[t];return s(this.state,n,r,o)}useState(t,n,r,o){return l.useDebugValue(t),Bn(this,this.selectors[t],n,r,o)}useContextCallback(t,n){l.useDebugValue(t);const r=q(n??Jt);this.context[t]=r}useStateSetter(t){const n=l.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let o=r(this.state);return n(o,o,this),this.subscribe(s=>{const a=r(s);if(!Object.is(o,a)){const c=o;o=a,n(a,c,this)}})}}const bo={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId};class Ct extends Wn{constructor(t){const{syncOnly:n,nested:r,onOpenChange:o,triggerElements:s,...a}=t;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:o,dataRef:{current:{}},events:Mn(),nested:r,triggerElements:s},bo),this.syncOnly=n}syncOpenEvent=(t,n)=>{(!t||!this.state.open||n!=null&&Tr(n))&&(this.context.dataRef.current.openEvent=t?n:void 0)};dispatchOpenChange=(t,n)=>{this.syncOpenEvent(t,n.event);const r={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)};setOpen=(t,n)=>{if(this.syncOnly){this.context.onOpenChange?.(t,n);return}this.dispatchOpenChange(t,n),this.context.onOpenChange?.(t,n)}}function yo(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:o,nested:s,onOpenChange:a}=e,c=t.useState("open"),u=t.useState("activeTriggerElement"),i=t.useState(n?"popupElement":"positionerElement"),d=t.context.triggerElements,R=a,f=l.useRef(null);r===void 0&&f.current===null&&(f.current=new Ct({open:c,transitionStatus:void 0,referenceElement:u,floatingElement:i,triggerElements:d,onOpenChange:R,floatingId:o,syncOnly:!0,nested:s}));const g=r??f.current;return t.useSyncedValue("floatingId",o),N(()=>{const m={open:c,floatingId:o,referenceElement:u,floatingElement:i};Pe(u)&&(m.domReferenceElement=u),g.state.positionReference===g.state.referenceElement&&(m.positionReference=u),g.update(m)},[c,o,u,i,g]),g.context.onOpenChange=R,g.context.nested=s,g}const So={tabIndex:-1,[dt]:""};function Eo(e){return t=>t==="touch"?e.current:!0}function Ro(e,t=!1){const n=yt(),r=Tt()!=null,o=ke(()=>e(n,r)).current;return yo({popupStore:o,treatPopupAsFloatingElement:t,floatingRootContext:o.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:o.setOpen}),o}function To({handle:e,store:t}){return N(()=>e.attachStore(t),[e,t]),null}function xo(e,t){const n=l.useRef(null),r=l.useRef(null);return l.useCallback(o=>{if(e===void 0)return;let s=!1;if(n.current!==null){const a=n.current,c=r.current,u=t.context.triggerElements.getById(a);c&&u===c&&(t.context.triggerElements.delete(a),s=!0),n.current=null,r.current=null}if(o!==null&&(n.current=e,r.current=o,t.context.triggerElements.add(e,o),s=!0),s){const a=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==a&&t.set("triggerCount",a)}},[t,e])}function Hn(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);const o=n?.id??null;(o||t)&&(e.activeTriggerId=o,e.activeTriggerElement=n??null)}function vo(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Hs(e,t,n,r={}){const o=n.reason,s=o===nn,a=t&&o===ir,c=!t&&(o===on||o===sn),u=vo(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);const i=()=>{const d={...r.extraState,open:t};a?d.instantType="focus":c?d.instantType="dismiss":s&&(d.instantType=void 0),Hn(d,t,n.trigger,u()),e.update(d)};s?Ze.flushSync(i):i()}function js(e,t,n,r){const o=n.useState("isMountedByTrigger",e),s=xo(e,n),a=q(u=>{const i=n.select("open"),d=n.select("activeTriggerId");if(d===e){n.update({activeTriggerElement:u,...i?r:null});return}d==null&&i&&n.update({activeTriggerId:e,activeTriggerElement:u,...r})}),c=l.useCallback(u=>{s(u),u&&a(u)},[s,a]);return N(()=>{o&&n.update({activeTriggerElement:t.current,...r})},[o,n,t,...Object.values(r)]),{registerTrigger:c,isMountedByThisTrigger:o}}function Co(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,r=l.useRef(null),o=e.useState("open"),s=e.useState("triggerCount"),a=e.useState("activeTriggerId"),c=e.useState("activeTriggerElement");N(()=>{if(!o){r.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0);return}const u=e.context.triggerElements.size,i={};e.state.triggerCount!==u&&(i.triggerCount=u);const d=e.select("activeTriggerId");let R=null;if(d){const f=e.context.triggerElements.getById(d);if(f)r.current=d,f!==e.state.activeTriggerElement&&(i.activeTriggerElement=f);else{for(const[g,m]of e.context.triggerElements.entries())if(m===e.state.activeTriggerElement){i.activeTriggerId=g,i.activeTriggerElement=m,r.current=g;break}i.activeTriggerId===void 0&&(r.current===d?R=d:r.current=null)}}else r.current=null;if(!R&&!d&&u===1){const f=e.context.triggerElements.entries().next();if(!f.done){const[g,m]=f.value;i.activeTriggerId=g,i.activeTriggerElement=m,r.current=g}}(i.triggerCount!==void 0||i.activeTriggerId!==void 0||i.activeTriggerElement!==void 0)&&e.update(i),R&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===R&&!e.context.triggerElements.getById(R)){const f=Se(sr);e.setOpen(!1,f),f.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[o,e,s,a,c,n])}function Oo(e,t,n){const{mounted:r,setMounted:o,transitionStatus:s}=Nr(e),a=t.useState("preventUnmountingOnClose"),c=e?!1:a;t.useSyncedValues({mounted:r,transitionStatus:s,preventUnmountingOnClose:c});const u=q(()=>{o(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return vn({enabled:r&&!e&&!c,open:e,ref:t.context.popupRef,onComplete(){e||u()}}),{forceUnmount:u,transitionStatus:s}}function Io(e,t){e.useSyncedValues(t),N(()=>()=>{e.update({activeTriggerProps:ve,inactiveTriggerProps:ve,popupProps:ve})},[e])}function Po(e,t){N(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),N(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class jn{constructor(){this.idMap=new Map}add(t,n){this.idMap.set(t,n)}delete(t){this.idMap.delete(t)}hasElement(t){for(const n of this.idMap.values())if(n===t)return!0;return!1}hasMatchingElement(t){for(const n of this.idMap.values())if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function wo(){return new Ct({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new jn,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function ko(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:wo(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:ve,inactiveTriggerProps:ve,popupProps:ve}}function Ao(e,t,n=!1){return new Ct({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}const je=e=>e.triggerIdProp??e.activeTriggerId,Ot=e=>e.openProp??e.open,Yt=e=>(e.popupElement?.id??e.floatingId)||void 0;function _n(e,t){return t!==void 0&&Ot(e)&&je(e)===t}function Fo(e,t){return _n(e,t)?!0:t!==void 0&&Ot(e)&&je(e)==null&&e.triggerCount===1}const Mo={open:Ot,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:je,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Yt,isTriggerActive:(e,t)=>t!==void 0&&je(e)===t,isOpenedByTrigger:(e,t)=>_n(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&je(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>Fo(e,t)?Yt(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement},Vn=l.createContext(void 0);function Do(){const e=l.useContext(Vn);if(e===void 0)throw new Error(zt(26));return e}const No="ArrowUp",Lo="ArrowDown",Bo="ArrowLeft",Wo="ArrowRight",Ho="Home",jo="End",_o=new Set([No,Lo,Bo,Wo,Ho,jo]),Vo="Shift",_s=[Vo,"Control","Alt","Meta"];function Uo(e){return Z(e)&&e.tagName==="INPUT"}function Vs(e){return!!(Uo(e)&&e.selectionStart!=null||Z(e)&&e.tagName==="TEXTAREA")}function Us(e,t,n,r){if(!e||!t||!t.scrollTo)return;let o=e.scrollLeft,s=e.scrollTop;const a=e.clientWidth<e.scrollWidth,c=e.clientHeight<e.scrollHeight;if(a&&r!=="vertical"){const u=Gt(e,t,"left"),i=Xe(e),d=Xe(t);n==="ltr"&&(u+t.offsetWidth+d.scrollMarginRight>e.scrollLeft+e.clientWidth-i.scrollPaddingRight?o=u+t.offsetWidth+d.scrollMarginRight-e.clientWidth+i.scrollPaddingRight:u-d.scrollMarginLeft<e.scrollLeft+i.scrollPaddingLeft&&(o=u-d.scrollMarginLeft-i.scrollPaddingLeft)),n==="rtl"&&(u-d.scrollMarginLeft<e.scrollLeft+i.scrollPaddingLeft?o=u-d.scrollMarginLeft-i.scrollPaddingLeft:u+t.offsetWidth+d.scrollMarginRight>e.scrollLeft+e.clientWidth-i.scrollPaddingRight&&(o=u+t.offsetWidth+d.scrollMarginRight-e.clientWidth+i.scrollPaddingRight))}if(c&&r!=="horizontal"){const u=Gt(e,t,"top"),i=Xe(e),d=Xe(t);u-d.scrollMarginTop<e.scrollTop+i.scrollPaddingTop?s=u-d.scrollMarginTop-i.scrollPaddingTop:u+t.offsetHeight+d.scrollMarginBottom>e.scrollTop+e.clientHeight-i.scrollPaddingBottom&&(s=u+t.offsetHeight+d.scrollMarginBottom-e.clientHeight+i.scrollPaddingBottom)}e.scrollTo({left:o,top:s,behavior:"auto"})}function Gt(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[r],t.offsetParent!==e);)t=t.offsetParent;return o}function Xe(e){const t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}const Yo={...In,...Cn,nestedDialogOpen(e){return e?{"data-nested-dialog-open":""}:null}},Go=l.forwardRef(function(t,n){const{render:r,className:o,style:s,finalFocus:a,initialFocus:c,...u}=t,i=Oe(),d=i.useState("descriptionElementId"),R=i.useState("disablePointerDismissal"),f=i.useState("floatingRootContext"),g=i.useState("popupProps"),m=i.useState("modal"),x=i.useState("mounted"),y=i.useState("nested"),S=i.useState("nestedOpenDialogCount"),b=i.useState("open"),Y=i.useState("openMethod"),v=i.useState("titleElementId"),B=i.useState("transitionStatus"),K=i.useState("role"),F=f.useState("floatingId");Do(),vn({open:b,ref:i.context.popupRef,onComplete(){b&&i.context.onOpenChangeComplete?.(!0)}});const H=c===void 0?Eo(i.context.popupRef):c,M=S>0,X=i.useStateSetter("popupElement"),_=Ae("div",t,{state:{open:b,nested:y,transitionStatus:B,nestedDialogOpen:M},props:[g,{id:F,"aria-labelledby":v,"aria-describedby":d,role:K,...So,hidden:!x,onKeyDown(P){_o.has(P.key)&&P.stopPropagation()},style:{"--nested-dialogs":S}},u],ref:[n,i.context.popupRef,X],stateAttributesMapping:Yo});return I.jsx(no,{context:f,openInteractionType:Y,disabled:!x,closeOnFocusOut:!R,initialFocus:H,returnFocus:a,modal:m!==!1,restoreFocus:"popup",children:_})});function qo(e){return Qt(19)?e:e?"true":void 0}const Ko=l.forwardRef(function(t,n){const{cutout:r,...o}=t;let s;if(r){const a=r.getBoundingClientRect();s=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${a.left}px ${a.top}px,${a.left}px ${a.bottom}px,${a.right}px ${a.bottom}px,${a.right}px ${a.top}px,${a.left}px ${a.top}px)`}return I.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})}),$o=l.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t,s=Oe(),a=s.useState("mounted"),c=s.useState("modal"),u=s.useState("open");return a||r?I.jsx(Vn.Provider,{value:r,children:I.jsxs(Qr,{ref:n,...o,children:[a&&c===!0&&I.jsx(Ko,{ref:s.context.internalBackdropRef,inert:qo(!u)}),t.children]})}):null});let qt={},Kt={},$t="";function nt(e,t){return rr(e)?e:t}function Xt(e,t,n){return/hidden|clip/.test(e.getComputedStyle(nt(t,n)).overflowY)}function Xo(e){if(typeof document>"u")return!1;const t=U(e);return et(t).innerWidth-t.documentElement.clientWidth>0}function zo(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=U(e),r=n.documentElement,o=n.body,s=nt(r,o),a=s.style.overflowY,c=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",s.style.overflowY="scroll";const u=s.offsetWidth;s.style.overflowY="hidden";const i=s.offsetWidth;return s.style.overflowY=a,r.style.scrollbarGutter=c,u===i}function Jo(e){const t=U(e),n=t.documentElement,r=t.body,o=nt(n,r),s={overflowY:o.style.overflowY,overflowX:o.style.overflowX};return Object.assign(o.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(o.style,s)}}function Qo(e){const t=U(e),n=t.documentElement,r=t.body,o=et(n);let s=0,a=0,c=!1;const u=ue.create();if(Me&&(o.visualViewport?.scale??1)!==1)return()=>{};function i(){const g=o.getComputedStyle(n),m=o.getComputedStyle(r),S=(g.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,a=n.scrollLeft,qt={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},$t=n.style.scrollBehavior,Kt={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const b=n.scrollHeight>n.clientHeight,Y=n.scrollWidth>n.clientWidth,v=g.overflowY==="scroll"||m.overflowY==="scroll",B=g.overflowX==="scroll"||m.overflowX==="scroll",K=Math.max(0,o.innerWidth-r.clientWidth),F=Math.max(0,o.innerHeight-r.clientHeight),H=parseFloat(m.marginTop)+parseFloat(m.marginBottom),M=parseFloat(m.marginLeft)+parseFloat(m.marginRight),X=nt(n,r);if(c=zo(e),c){n.style.scrollbarGutter=S,X.style.overflowY="hidden",X.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:S,overflowY:"hidden",overflowX:"hidden"}),(b||v)&&(n.style.overflowY="scroll"),(Y||B)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:H||F?`calc(100dvh - ${H+F}px)`:"100dvh",width:M||K?`calc(100vw - ${M+K}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),r.scrollTop=s,r.scrollLeft=a,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function d(){Object.assign(n.style,qt),Object.assign(r.style,Kt),c||(n.scrollTop=s,n.scrollLeft=a,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=$t)}function R(){d(),u.request(i)}i();const f=D(o,"resize",R);return()=>{u.cancel(),d(),typeof o.removeEventListener=="function"&&f()}}class Zo{lockCount=0;restore=null;timeoutLock=Ce.create();timeoutUnlock=Ce.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const n=U(t),r=n.documentElement,o=n.body,s=et(r);if(Xt(s,r,o)){const c=new s.MutationObserver(()=>{Xt(s,r,o)||(c.disconnect(),this.restore=null,this.lock(t))}),u={attributes:!0};c.observe(r,u),c.observe(o,u),this.restore=()=>c.disconnect();return}const a=St||!Xo(t);this.restore=a?Jo(t):Qo(t)}}const es=new Zo;function ts(e=!0,t=null){N(()=>{if(e)return es.acquire(t)},[e,t])}function ns({store:e,parentContext:t,isDrawer:n}){const r=e.useState("open"),o=e.useState("disablePointerDismissal"),s=e.useState("modal"),a=e.useState("popupElement"),c=e.useState("floatingRootContext"),[u,i]=l.useState(0),[d,R]=l.useState(0),f=u===0,g=so(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:s==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(m){if(!e.context.outsidePressEnabledRef.current||"button"in m&&m.button!==0)return!1;if("touches"in m){if(m.type==="touchend"){if(m.changedTouches.length!==1||m.touches.length!==0)return!1}else if(m.touches.length!==1)return!1}const x=Ee(m);if(f&&!o){if(s){const y=e.context.internalBackdropRef.current,S=e.context.backdropRef.current;return y||S?y===x||S===x||A(x,a)&&!x?.hasAttribute("data-base-ui-portal"):!0}return!0}return!1},escapeKey:f});return ts(r&&s===!0,a),e.useContextCallback("onNestedDialogOpen",(m,x)=>{i(m),R(x)}),N(()=>(t?.onNestedDialogOpen&&(r?t.onNestedDialogOpen(u+1,d+(n?1:0)):t.onNestedDialogOpen(0,0)),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,u,d,t]),Io(e,{activeTriggerProps:g.reference,inactiveTriggerProps:g.trigger,popupProps:g.floating,nestedOpenDialogCount:u,nestedOpenDrawerCount:d}),null}const rs={...Mo,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role};class os extends Wn{constructor(t,n,r){const o=new jn,s=ss(t,o,n,r);super(s,is(o),rs)}setOpen=(t,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(t,n);const r={open:t};Hn(r,t,n.trigger),this.update(r)}}function ss(e,t,n,r=!1){const o={...ko(),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e};return o.floatingRootContext=Ao(t,n,r),o}function is(e){return{popupRef:l.createRef(),backdropRef:l.createRef(),internalBackdropRef:l.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function as(e,t){const{children:n,open:r,defaultOpen:o=!1,onOpenChange:s,onOpenChangeComplete:a,disablePointerDismissal:c=!1,modal:u=!0,actionsRef:i,handle:d,triggerId:R,defaultTriggerId:f=null}=t,g=e==="drawer",m=u,x=c,y="dialog",S=Oe(!0),b=S!=null,Y={modal:m,disablePointerDismissal:x,nested:b,role:y},v=Ro((X,me)=>new os({open:o,openProp:r,activeTriggerId:f,triggerIdProp:R,...Y},X,me),!0);v.useControlledProp("openProp",r),v.useControlledProp("triggerIdProp",R),v.useSyncedValues(Y),v.useContextCallback("onOpenChange",s),v.useContextCallback("onOpenChangeComplete",a);const B=v.useState("open"),K=v.useState("mounted"),F=v.useState("payload");Po(v,B),Co(v);const{forceUnmount:H}=Oo(B,v);l.useImperativeHandle(i,()=>({unmount:H,close:()=>v.setOpen(!1,Se(ar))}),[H,v]);const M=B||K;return I.jsxs(On.Provider,{value:v,children:[d&&I.jsx(To,{handle:d,store:v}),M&&I.jsx(ns,{store:v,parentContext:S?.context,isDrawer:g}),typeof n=="function"?n({payload:F}):n]})}function cs(e){return as("dialog",e)}const us=l.forwardRef(function(t,n){const{render:r,className:o,style:s,id:a,...c}=t,u=Oe(),i=en(a);return u.useSyncedValueWithCleanup("titleElementId",i),Ae("h2",t,{ref:n,props:[{id:i},c]})});function Ys({...e}){return I.jsx(cs,{"data-slot":"dialog",...e})}function ls({...e}){return I.jsx($o,{"data-slot":"dialog-portal",...e})}function ds({className:e,...t}){return I.jsx(Vr,{"data-slot":"dialog-overlay",className:Fe("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...t})}function Gs({className:e,children:t,showCloseButton:n=!0,...r}){return I.jsxs(ls,{children:[I.jsx(ds,{}),I.jsxs(Go,{"data-slot":"dialog-content",className:Fe("fixed top-1/2 left-1/2 z-50 grid max-h-[calc(100dvh-2rem)] w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 overflow-y-auto rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...r,children:[t,n&&I.jsxs(Pn,{"data-slot":"dialog-close",render:I.jsx(Zt,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[I.jsx(ur,{}),I.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function qs({className:e,...t}){return I.jsx("div",{"data-slot":"dialog-header",className:Fe("flex flex-col gap-2",e),...t})}function Ks({className:e,showCloseButton:t=!1,children:n,...r}){return I.jsxs("div",{"data-slot":"dialog-footer",className:Fe("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",e),...r,children:[n,t&&I.jsx(Pn,{render:I.jsx(Zt,{variant:"outline"}),children:"Close"})]})}function $s({className:e,...t}){return I.jsx(us,{"data-slot":"dialog-title",className:Fe("font-heading text-base leading-none font-medium",e),...t})}function Xs({className:e,...t}){return I.jsx(Ur,{"data-slot":"dialog-description",className:Fe("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}export{Qe as $,vn as A,_r as B,In as C,cs as D,Ys as E,So as F,Gs as G,$s as H,qs as I,Xs as J,Ks as K,ws as L,Gr as M,Nr as N,Cn as O,jn as P,xn as Q,Wn as R,un as S,Ce as T,Rr as U,Ln as V,xt as W,ur as X,we as Y,gr as Z,Me as _,D as a,ys as a0,Es as a1,Tn as a2,Tt as a3,Ss as a4,Ve as a5,At as a6,kt as a7,at as a8,Ts as a9,yo as aA,ks as aB,Bs as aC,an as aD,He as aE,Cs as aF,Sn as aG,Os as aH,Ps as aI,Je as aJ,As as aK,Us as aL,Ho as aM,jo as aN,Vs as aO,Lo as aP,No as aQ,Bo as aR,Wo as aS,_s as aT,Vo as aU,xs as aa,vs as ab,yr as ac,ln as ad,Er as ae,gs as af,hs as ag,ms as ah,bs as ai,Et as aj,xr as ak,St as al,Fs as am,no as an,_o as ao,Qr as ap,ts as aq,Ms as ar,Fr as as,Ko as at,qo as au,Ls as av,Zr as aw,Ns as ax,vo as ay,Hn as az,Go as b,Pn as c,us as d,Ur as e,$o as f,Vr as g,Hs as h,Rs as i,ko as j,Ao as k,co as l,Co as m,Oo as n,To as o,Mo as p,so as q,Io as r,Ws as s,js as t,Ro as u,Ke as v,ze as w,Is as x,Jr as y,Ds as z};
|
|
6
|
+
*/const cr=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],ur=zn("x",cr);function lr(){return typeof navigator>"u"?{userAgent:"",platform:"",maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??0}}const{userAgent:dr,platform:fr,maxTouchPoints:pr}=lr(),tt=dr.toLowerCase(),_e=fr.toLowerCase(),St=/^i(os$|p)/.test(_e)||_e==="macintel"&&pr>1,wt="android",lt=_e===wt||tt.includes(wt),gr=!St&&_e.startsWith("mac");_e.startsWith("win");const hr=gr||St,Me=typeof CSS<"u"&&!!CSS.supports?.("-webkit-backdrop-filter:none");!Me&&tt.includes("firefox");!Me&&tt.includes("chrom");const mr=hr,an=/jsdom|happydom/.test(tt),dt="data-base-ui-focusable",cn="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",gs="ArrowLeft",hs="ArrowRight",ms="ArrowUp",bs="ArrowDown";function ys(e,t){if(!Pe(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,r]of t.entries())if(A(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function st(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function br(e){return e.matches("html,body")}function un(e){return Z(e)&&e.matches(cn)}function Ss(e){return e?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${cn}`)!=null}function kt(e){return e?e.getAttribute("role")==="combobox"&&un(e):!1}function Es(e){if(!e||an)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function At(e){return e?e.hasAttribute(dt)?e:e.querySelector(`[${dt}]`)||e:null}function Ve(e,t,n=!0){return e.filter(o=>o.parentId===t).flatMap(o=>[...!n||o.context?.open?[o]:[],...Ve(e,o.id,n)])}function Ft(e,t){let n=[],r=e.find(o=>o.id===t)?.parentId;for(;r;){const o=e.find(s=>s.id===r);r=o?.parentId,o&&(n=n.concat(o))}return n}function yr(e){e.preventDefault(),e.stopPropagation()}function Sr(e){return"nativeEvent"in e}function Er(e){return e.pointerType===""&&e.isTrusted?!0:lt&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Rr(e){return an?!1:!lt&&e.width===0&&e.height===0||lt&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function Rs(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Tr(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}function Ts(e,t){return t<0||t>=e.length}function xs(e,t){return ln(e.current,{disabledIndices:t})}function vs(e,t){return ln(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function ln(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:o=1}={}){let s=t;do s+=n?-o:o;while(s>=0&&s<=e.length-1&&xr(e,s,r));return s}function xr(e,t,n){if(typeof n=="function"?n(t):n?.includes(t)??!1)return!0;const o=e[t];return o?!Et(o)||o.matches(":disabled")?!0:!n&&(o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true"):!1}function vr(e){return e.visibility==="hidden"||e.visibility==="collapse"}function Et(e,t=e?mt(e):null){return!e||!e.isConnected||!t||vr(t)?!1:typeof e.checkVisibility=="function"?e.checkVisibility():t.display!=="none"&&t.display!=="contents"}const Cr='a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]';function Or(e){const t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;const n=e.getRootNode();return bt(n)?n.host:null}function ft(e){for(const t of Array.from(e.children))if(oe(t)==="summary")return t;return null}function Ir(e,t){const n=ft(t);return!!n&&(e===n||A(n,e))}function dn(e){const t=e?oe(e):"";return e!=null&&e.matches(Cr)&&(t!=="summary"||e.parentElement!=null&&oe(e.parentElement)==="details"&&ft(e.parentElement)===e)&&(t!=="details"||ft(e)==null)&&(t!=="input"||e.type!=="hidden")}function fn(e){if(!dn(e)||!e.isConnected||e.matches(":disabled"))return!1;for(let t=e;t;t=Or(t)){const n=t!==e,r=oe(t)==="slot";if(t.hasAttribute("inert")||n&&oe(t)==="details"&&!t.open&&!Ir(e,t)||t.hasAttribute("hidden")||!r&&!Pr(t,n))return!1}return!0}function Pr(e,t){const n=mt(e);return t?n.display!=="none":Et(e,n)}function pn(e){const t=e.tabIndex;if(t<0){const n=oe(e);if(n==="details"||n==="audio"||n==="video"||Z(e)&&e.isContentEditable)return 0}return t}function it(e){if(oe(e)!=="input")return null;const t=e;return t.type==="radio"&&t.name!==""?t:null}function wr(e,t){const n=it(e);if(!n)return!0;const r=t.find(o=>{const s=it(o);return s?.name===n.name&&s.form===n.form&&s.checked});return r?r===n:t.find(o=>{const s=it(o);return s?.name===n.name&&s.form===n.form})===n}function gn(e){if(Z(e)&&oe(e)==="slot"){const t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Z(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function hn(e,t){gn(e).forEach(n=>{dn(n)&&t.push(n),hn(n,t)})}function mn(e,t,n){gn(e).forEach(r=>{Z(r)&&r.matches(t)&&n.push(r),mn(r,t,n)})}function Rt(e){return fn(e)&&pn(e)>=0}function bn(e){const t=[];return hn(e,t),t.filter(fn)}function Ue(e){const t=bn(e);return t.filter(n=>pn(n)>=0&&wr(n,t))}function yn(e,t){const n=Ue(e),r=n.length;if(r===0)return;const o=ge(U(e)),s=n.indexOf(o),a=s===-1?t===1?0:r-1:s+t;return n[a]}function Sn(e){return yn(U(e).body,1)||e}function En(e){return yn(U(e).body,-1)||e}function Rn(e,t){if(!e)return null;const n=Ue(U(e).body),r=n.length;if(r===0)return null;const o=n.indexOf(e);if(o===-1)return null;const s=(o+t+r)%r;return n[s]}function Cs(e){return Rn(e,1)}function Os(e){return Rn(e,-1)}function We(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!A(n,r)}function kr(e){Ue(e).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Mt(e){const t=[];mn(e,"[data-tabindex]",t),t.forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}function Tn(e){l.useEffect(e,Jn)}const Be=0;class Ce{static create(){return new Ce}currentId=Be;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Be,n()},t)}isStarted(){return this.currentId!==Be}clear=()=>{this.currentId!==Be&&(clearTimeout(this.currentId),this.currentId=Be)};disposeEffect=()=>this.clear}function ze(){const e=ke(Ce.create).current;return Tn(e.disposeEffect),e}const Ge=null;class Ar{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let o=0;o<n.length;o+=1)n[o]?.(t)};request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}let qe=new Ar;class ue{static create(){return new ue}static request(t){return qe.request(t)}static cancel(t){return qe.cancel(t)}currentId=Ge;request(t){this.cancel(),this.currentId=qe.request(()=>{this.currentId=Ge,t()})}cancel=()=>{this.currentId!==Ge&&(qe.cancel(this.currentId),this.currentId=Ge)};disposeEffect=()=>this.cancel}function xn(){const e=ke(ue.create).current;return Tn(e.disposeEffect),e}function he(e){return e==null?e:"current"in e?e.current:e}function Fr(e,t=!1){const n=xn();return q((r,o=null)=>{n.cancel();const s=he(e);if(s==null)return;const a=s,c=()=>{Ze.flushSync(r)};if(typeof a.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED){r();return}function u(){Promise.all(a.getAnimations().map(i=>i.finished)).then(()=>{o?.aborted||c()},()=>{if(o?.aborted)return;if(a.getAnimations().some(d=>d.pending||d.playState!=="finished")){u();return}c()})}if(t){const i="data-starting-style";if(!a.hasAttribute(i)){n.request(u);return}const d=new MutationObserver(()=>{a.hasAttribute(i)||(d.disconnect(),u())});d.observe(a,{attributes:!0,attributeFilter:[i]}),o?.addEventListener("abort",()=>d.disconnect(),{once:!0});return}n.request(u)})}function vn(e){const{enabled:t=!0,open:n,ref:r,onComplete:o}=e,s=q(o),a=Fr(r,n);l.useEffect(()=>{if(!t)return;const c=new AbortController;return a(s,c.signal),()=>{c.abort()}},[t,n,s,a])}let Dt=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const Mr={"data-starting-style":""},Dr={"data-ending-style":""},Cn={transitionStatus(e){return e==="starting"?Mr:e==="ending"?Dr:null}};function Nr(e,t=!1,n=!1){const[r,o]=l.useState(e&&t?"idle":void 0),[s,a]=l.useState(e);return e&&!s&&(a(!0),o("starting")),!e&&s&&r!=="ending"&&!n&&o("ending"),!e&&!s&&r==="ending"&&o(void 0),N(()=>{if(!e&&s&&r!=="ending"&&n){const c=ue.request(()=>{o("ending")});return()=>{ue.cancel(c)}}},[e,s,r,n]),N(()=>{if(!e||t)return;const c=ue.request(()=>{o(void 0)});return()=>{ue.cancel(c)}},[t,e]),N(()=>{if(!e||!t)return;e&&s&&r!=="idle"&&o("starting");const c=ue.request(()=>{o("idle")});return()=>{ue.cancel(c)}},[t,e,s,r]),{mounted:s,setMounted:a,transitionStatus:r}}const On=l.createContext(void 0);function Oe(e){const t=l.useContext(On);if(!e&&t===void 0)throw new Error(zt(27));return t}(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Dt.startingStyle]="startingStyle",e[e.endingStyle=Dt.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({});const Lr={"data-popup-open":""},Br={"data-popup-open":"","data-pressed":""},Hr={"data-open":""},Wr={"data-closed":""},jr={"data-anchor-hidden":""},Is={open(e){return e?Lr:null}},Ps={open(e){return e?Br:null}},In={open(e){return e?Hr:Wr},anchorHidden(e){return e?jr:null}},_r={...In,...Cn},Vr=l.forwardRef(function(t,n){const{render:r,className:o,style:s,forceRender:a=!1,...c}=t,u=Oe(),i=u.useState("open"),d=u.useState("nested"),R=u.useState("mounted"),f=u.useState("transitionStatus");return Ae("div",t,{state:{open:i,transitionStatus:f},ref:[u.context.backdropRef,n],stateAttributesMapping:_r,props:[{role:"presentation",hidden:!R,style:{userSelect:"none",WebkitUserSelect:"none"}},c],enabled:a||!d})}),Pn=l.forwardRef(function(t,n){const{render:r,className:o,style:s,disabled:a=!1,nativeButton:c=!0,...u}=t,i=Oe(),d=i.useState("open"),{getButtonProps:R,buttonRef:f}=Qn({disabled:a,native:c}),g={disabled:a};function m(x){d&&i.setOpen(!1,Se(or,x.nativeEvent))}return Ae("button",t,{state:g,ref:[n,f],props:[{onClick:m},u,R]})}),Ur=l.forwardRef(function(t,n){const{render:r,className:o,style:s,id:a,...c}=t,u=Oe(),i=en(a);return u.useSyncedValueWithCleanup("descriptionElementId",i),Ae("p",t,{ref:n,props:[{id:i},c]})});function D(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function we(...e){return()=>{for(let t=0;t<e.length;t+=1){const n=e[t];n&&n()}}}function Ke(e){const t=ke(Yr,e).current;return t.next=e,N(t.effect),t}function Yr(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}const wn={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},Gr={...wn,position:"fixed",top:0,left:0},ws={...wn,position:"absolute"},Je=l.forwardRef(function(t,n){const[r,o]=l.useState();N(()=>{mr&&Me&&o("button")},[]);const s={tabIndex:0,role:r};return I.jsx("span",{...t,ref:n,style:Gr,"aria-hidden":r?void 0:!0,...s,"data-base-ui-focus-guard":""})});function Qe(e){return`data-base-ui-${e}`}let $e=0;function at(e,t={}){const{preventScroll:n=!1,sync:r=!1,shouldFocus:o}=t;cancelAnimationFrame($e);function s(){o&&!o()||e?.focus({preventScroll:n})}if(r)return s(),Jt;const a=requestAnimationFrame(s);return $e=a,()=>{$e===a&&(cancelAnimationFrame(a),$e=0)}}const ct={inert:new WeakMap,"aria-hidden":new WeakMap},Nt="data-base-ui-inert",pt={inert:new WeakSet,"aria-hidden":new WeakSet};let He=new WeakMap,ut=0;function qr(e){return pt[e]}function kn(e){return e?bt(e)?e.host:kn(e.parentNode):null}const Lt=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=kn(n);return e.contains(r)?r:null}).filter(n=>n!=null),Bt=e=>{const t=new Set;return e.forEach(n=>{let r=n;for(;r&&!t.has(r);)t.add(r),r=r.parentNode}),t},Ht=(e,t,n)=>{const r=[],o=s=>{!s||n.has(s)||Array.from(s.children).forEach(a=>{oe(a)!=="script"&&(t.has(a)?o(a):r.push(a))})};return o(e),r};function Kr(e,t,n,r,{mark:o=!0}){let s=null;r?s="inert":n&&(s="aria-hidden");let a=null,c=null;const u=Lt(t,e),i=o?Ht(t,Bt(u),new Set(u)):[],d=[],R=[];if(s){const f=ct[s],g=qr(s);c=g,a=f;const m=Lt(t,Array.from(t.querySelectorAll("[aria-live]"))),x=u.concat(m);Ht(t,Bt(x),new Set(x)).forEach(S=>{const b=S.getAttribute(s),Y=b!==null&&b!=="false",v=(f.get(S)||0)+1;f.set(S,v),d.push(S),v===1&&Y&&g.add(S),Y||S.setAttribute(s,s==="inert"?"":"true")})}return o&&i.forEach(f=>{const g=(He.get(f)||0)+1;He.set(f,g),R.push(f),g===1&&f.setAttribute(Nt,"")}),ut+=1,()=>{a&&d.forEach(f=>{const m=(a.get(f)||0)-1;a.set(f,m),m||(!c?.has(f)&&s&&f.removeAttribute(s),c?.delete(f))}),o&&R.forEach(f=>{const g=(He.get(f)||0)-1;He.set(f,g),g||f.removeAttribute(Nt)}),ut-=1,ut||(ct.inert=new WeakMap,ct["aria-hidden"]=new WeakMap,pt.inert=new WeakSet,pt["aria-hidden"]=new WeakSet,He=new WeakMap)}}function Wt(e,t={}){const{ariaHidden:n=!1,inert:r=!1,mark:o=!0}=t,s=U(e[0]).body;return Kr(e,s,n,r,{mark:o})}const ks=500,As=500,Fs={style:{transition:"none"}},$r="data-base-ui-click-trigger",Ms={fallbackAxisSide:"none"},Ds={fallbackAxisSide:"end"},Xr={clipPath:"inset(50%)",position:"fixed",top:0,left:0},An=l.createContext(null),Fn=()=>l.useContext(An),zr=Qe("portal");function Jr(e={}){const{ref:t,container:n,componentProps:r=ve,elementProps:o}=e,s=yt(),c=Fn()?.portalNode,[u,i]=l.useState(null),[d,R]=l.useState(null),f=q(y=>{y!==null&&R(y)}),g=l.useRef(null);N(()=>{if(n===null){g.current&&(g.current=null,R(null),i(null));return}const y=(n&&(Zn(n)?n:n.current))??c??document.body;if(y==null){g.current&&(g.current=null,R(null),i(null));return}g.current!==y&&(g.current=y,R(null),i(y))},[n,c]);const m=Ae("div",r,{ref:[t,f],props:[{id:s,[zr]:""},o]}),x=u&&m?Ze.createPortal(m,u):null;return{node:d,nodeId:l.isValidElement(m)?m.props.id:void 0,subtree:x}}const Qr=l.forwardRef(function(t,n){const{render:r,className:o,style:s,children:a,container:c,...u}=t,{node:i,nodeId:d,subtree:R}=Jr({container:c,ref:n,componentProps:t,elementProps:u}),f=l.useRef(null),g=l.useRef(null),m=l.useRef(null),x=l.useRef(null),[y,S]=l.useState(null),b=l.useRef(!1),Y=y?.modal,v=y?.open,B=!!y&&!y.modal&&y.open&&!!i;l.useEffect(()=>{if(!i||Y)return;function F(W){i&&W.relatedTarget&&We(W)&&(W.type==="focusin"?b.current&&(Mt(i),b.current=!1):(kr(i),b.current=!0))}return we(D(i,"focusin",F,!0),D(i,"focusout",F,!0))},[i,Y]),N(()=>{!i||v!==!0||!b.current||(Mt(i),b.current=!1)},[v,i]);const K=l.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:g,beforeInsideRef:m,afterInsideRef:x,portalNode:i,setFocusManagerState:S}),[i]);return I.jsxs(l.Fragment,{children:[R,I.jsxs(An.Provider,{value:K,children:[B&&i&&I.jsx(Je,{"data-type":"outside",ref:f,onFocus:F=>{if(We(F,i))m.current?.focus();else{const W=y?y.domReference:null;En(W)?.focus()}}}),B&&i&&I.jsx("span",{"aria-owns":d,style:Xr}),i&&Ze.createPortal(a,i),B&&i&&I.jsx(Je,{"data-type":"outside",ref:g,onFocus:F=>{if(We(F,i))x.current?.focus();else{const W=y?y.domReference:null;Sn(W)?.focus(),y?.closeOnFocusOut&&y?.onOpenChange(!1,Se(tn,F.nativeEvent))}}})]})]})});function Mn(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}class Zr{nodesRef={current:[]};events=Mn();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(r=>r===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const Dn=l.createContext(null),Nn=l.createContext(null),Tt=()=>l.useContext(Dn)?.id||null,xt=e=>{const t=l.useContext(Nn);return e??t};function Ns(e){const t=yt(),n=xt(e),r=Tt();return N(()=>{if(!t)return;const o={id:t,parentId:r};return n?.addNode(o),()=>{n?.removeNode(o)}},[n,t,r]),t}function Ls(e){const{children:t,id:n}=e,r=Tt();return I.jsx(Dn.Provider,{value:l.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function Bs(e){const{children:t,externalTree:n}=e,r=ke(()=>n??new Zr).current;return I.jsx(Nn.Provider,{value:r,children:t})}function eo(e,t){const n=et(Ee(e));return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const jt=20;let ye=[];function vt(){ye=ye.filter(e=>e.deref()?.isConnected)}function _t(e){vt(),e&&oe(e)!=="body"&&(ye.push(new WeakRef(e)),ye.length>jt&&(ye=ye.slice(-jt)))}function Vt(){return vt(),ye[ye.length-1]?.deref()}function to(e){return e?Rt(e)?e:Ue(e)[0]||e:null}function Ut(e){if(e.hasAttribute("tabindex")&&!e.hasAttribute("data-tabindex")||!e.getAttribute("role")?.includes("dialog"))return;const n=bn(e).filter(o=>{const s=o.getAttribute("data-tabindex")||"";return Rt(o)||o.hasAttribute("data-tabindex")&&!s.startsWith("-")}),r=e.getAttribute("tabindex");n.length===0?r!=="0"&&(e.setAttribute("tabindex","0"),e.setAttribute("data-tabindex","0")):(r!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function no(e){const{context:t,children:n,disabled:r=!1,initialFocus:o=!0,returnFocus:s=!0,restoreFocus:a=!1,modal:c=!0,closeOnFocusOut:u=!0,openInteractionType:i="",nextFocusableElement:d,previousFocusableElement:R,beforeContentFocusGuardRef:f,externalTree:g,getInsideElements:m}=e,x="rootStore"in t?t.rootStore:t,y=x.useState("open"),S=x.useState("domReferenceElement"),b=x.useState("floatingElement"),{events:Y,dataRef:v}=x.context,B=q(()=>v.current.floatingContext?.nodeId),K=o===!1,F=kt(S)&&K,W=Ke(o),M=Ke(s),X=Ke(i),me=Ke(y),_=xt(g),P=Fn(),$=l.useRef(!1),le=l.useRef(!1),se=l.useRef(!1),ie=l.useRef(null),Re=l.useRef(""),be=l.useRef(""),Te=l.useRef(null),Ie=l.useRef(null),w=Pt(Te,f,P?.beforeInsideRef),ee=Pt(Ie,P?.afterInsideRef),de=ze(),fe=ze(),De=xn(),Ye=P!=null,C=At(b),ae=q((O=C)=>O?Ue(O):[]),re=q(()=>m?.().filter(O=>O!=null)??[]);l.useEffect(()=>{if(r||!c)return;function O(G){G.key==="Tab"&&A(C,ge(U(C)))&&ae().length===0&&!F&&yr(G)}const j=U(C);return D(j,"keydown",O)},[r,C,c,F,ae]),l.useEffect(()=>{if(r||!y)return;const O=U(C);function j(){se.current=!1}function G(te){const T=Ee(te),L=re(),E=A(b,T)||A(S,T)||A(P?.portalNode,T)||L.some(V=>V===T||A(V,T));se.current=!E,be.current=te.pointerType||"keyboard",T?.closest(`[${$r}]`)&&(le.current=!0,fe.start(0,()=>{le.current=!1}))}function z(){be.current="keyboard"}return we(D(O,"pointerdown",G,!0),D(O,"pointerup",j,!0),D(O,"pointercancel",j,!0),D(O,"keydown",z,!0),j)},[r,b,S,C,y,P,fe,re]),l.useEffect(()=>{if(r||!u)return;const O=U(C);function j(){le.current=!0,fe.start(0,()=>{le.current=!1})}function G(L){const E=Ee(L);Rt(E)&&(ie.current=E)}function z(L){const E=L.relatedTarget,V=L.currentTarget,J=Ee(L);c&&E==null&&J!=null&&A(b,J)&&_t(J),queueMicrotask(()=>{const H=B(),ne=x.context.triggerElements,p=re(),h=E?.hasAttribute(Qe("focus-guard"))&&[Te.current,Ie.current,P?.beforeInsideRef.current,P?.afterInsideRef.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,he(R),he(d)].includes(E),Q=!(A(S,E)||A(b,E)||A(E,b)||A(P?.portalNode,E)||p.some(k=>k===E||A(k,E))||ne.hasMatchingElement(k=>A(k,E))||h||_&&(Ve(_.nodesRef.current,H).find(k=>A(k.context?.elements.floating,E)||A(k.context?.elements.domReference,E))||Ft(_.nodesRef.current,H).find(k=>[k.context?.elements.floating,At(k.context?.elements.floating)].includes(E)||k.context?.elements.domReference===E)));if(V===S&&C&&Ut(C),a&&V!==S&&!Et(J)&&ge(O)===O.body){if(Z(C)&&(C.focus(),a==="popup")){De.request(()=>{C.focus()});return}const k=ae(),pe=ie.current,Ne=(pe&&k.includes(pe)?pe:null)||k[k.length-1]||C;Z(Ne)&&Ne.focus()}if(v.current.insideReactTree){v.current.insideReactTree=!1;return}(F||!c)&&E&&Q&&!le.current&&(F||E!==Vt())&&($.current=!0,x.setOpen(!1,Se(tn,L)))})}function te(){se.current||(v.current.insideReactTree=!0,de.start(0,()=>{v.current.insideReactTree=!1}))}const T=Z(S)?S:null;if(!(!b&&!T))return we(T&&D(T,"focusout",z),T&&D(T,"pointerdown",j),b&&D(b,"focusin",G),b&&D(b,"focusout",z),b&&P&&D(b,"focusout",te,!0))},[r,S,b,C,c,_,P,x,u,a,ae,F,B,v,de,fe,De,d,R,re]),l.useEffect(()=>{if(r||!b||!y)return;const O=Array.from(P?.portalNode?.querySelectorAll(`[${Qe("portal")}]`)||[]),G=(_?Ft(_.nodesRef.current,B()):[]).find(V=>kt(V.context?.elements.domReference||null))?.context?.elements.domReference,te=[...[b,...O,Te.current,Ie.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,...re()],G,he(R),he(d),F?S:null].filter(V=>V!=null),T=Wt(te,{ariaHidden:c||F,mark:!1}),L=[b,...O].filter(V=>V!=null),E=Wt(L);return()=>{E(),T()}},[y,r,S,b,c,P,F,_,B,d,R,re]),N(()=>{if(!y||r||!Z(C))return;Re.current="",be.current="";const O=U(C),j=ge(O);queueMicrotask(()=>{const G=W.current,z=typeof G=="function"?G(X.current||""):G;if(z===void 0||z===!1||A(C,j))return;let T=null;const L=()=>(T==null&&(T=ae(C)),T[0]||C);let E;z===!0||z===null?E=L():E=he(z),E=E||L();const V=A(C,ge(O));at(E,{preventScroll:E===C,shouldFocus(){if(!me.current)return!1;if(V)return!0;const J=ge(O);return!(J!==E&&A(C,J))}})})},[r,y,C,ae,W,X,me]),N(()=>{if(r||!C)return;const O=U(C),j=ge(O),G=X.current==null;_t(j);function z(T){if(T.open||(Re.current=eo(T.nativeEvent,be.current)),T.reason===nn&&T.nativeEvent.type==="mouseleave"&&($.current=!0),T.reason===rn)if(T.nested)$.current=!1;else if(Er(T.nativeEvent)||Rr(T.nativeEvent))$.current=!1;else{let L=!1;U(C).createElement("div").focus({get preventScroll(){return L=!0,!1}}),L?$.current=!1:$.current=!0}}Y.on("openchange",z);function te(T){const L=M.current;let E=typeof L=="function"?L(T):L;if(E===void 0||E===!1)return null;E===null&&(E=!0);const V=S?.isConnected?S:null,J=j?.isConnected&&oe(j)!=="body"?j:null;let H=G?J||V:V||J;return H||(H=Vt()||null),typeof E=="boolean"?H:he(E)||H||null}return()=>{Y.off("openchange",z);const T=ge(O),L=re(),E=A(b,T)||L.some(ne=>ne===T||A(ne,T))||_&&Ve(_.nodesRef.current,B(),!1).some(ne=>A(ne.context?.elements.floating,T)),V=M.current,J=Re.current,H=te(J);queueMicrotask(()=>{const ne=to(H),p=typeof V!="boolean";if(V&&!$.current&&Z(ne)&&(!(!p&&ne!==T&&T!==O.body)||E)){const h={preventScroll:!0};J==="keyboard"&&(h.focusVisible=!0),ne.focus(h)}$.current=!1})}},[r,b,C,M,X,Y,_,S,B,re]),N(()=>{if(!Me||y||!b)return;const O=ge(U(b));!Z(O)||!un(O)||A(b,O)&&O.blur()},[y,b]),N(()=>{if(!(r||!P))return P.setFocusManagerState({modal:c,closeOnFocusOut:u,open:y,onOpenChange:x.setOpen,domReference:S}),()=>{P.setFocusManagerState(null)}},[r,P,c,y,x,u,S]),N(()=>{if(!(r||!C))return Ut(C),()=>{queueMicrotask(vt)}},[r,C]);const xe=!r&&(c?!F:!0)&&(Ye||c);return I.jsxs(l.Fragment,{children:[xe&&I.jsx(Je,{"data-type":"inside",ref:w,onFocus:O=>{if(c){const j=ae();at(j[j.length-1])}else P?.portalNode&&($.current=!1,We(O,P.portalNode)?Sn(S)?.focus():he(R??P.beforeOutsideRef)?.focus())}}),n,xe&&I.jsx(Je,{"data-type":"inside",ref:ee,onFocus:O=>{c?at(ae()[0]):P?.portalNode&&(u&&($.current=!0),We(O,P.portalNode)?En(S)?.focus():he(d??P.afterOutsideRef)?.focus())}})]})}function ro(){return!1}function oo(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function so(e,t={}){const{enabled:n=!0,escapeKey:r=!0,outsidePress:o=!0,outsidePressEvent:s="sloppy",referencePress:a=ro,bubbles:c,externalTree:u}=t,i="rootStore"in e?e.rootStore:e,d=i.useState("open"),R=i.useState("floatingElement"),{dataRef:f}=i.context,g=xt(u),m=q(typeof o=="function"?o:()=>!1),x=typeof o=="function"?m:o,y=x!==!1,S=q(()=>s),{escapeKey:b,outsidePress:Y}=oo(c),v=l.useRef(!1),B=l.useRef(!1),K=l.useRef(!1),F=l.useRef(!1),W=l.useRef(""),M=l.useRef(null),X=ze(),me=ze(),_=q(()=>{me.clear(),f.current.insideReactTree=!1}),P=q(w=>{const ee=f.current.floatingContext?.nodeId;return(g?Ve(g.nodesRef.current,ee):[]).some(fe=>fe.context?.open&&!fe.context.dataRef.current[w])}),$=q(w=>st(w,i.select("floatingElement"))||st(w,i.select("domReferenceElement"))),le=q(w=>{a()&&i.setOpen(!1,Se(on,w.nativeEvent))}),se=q(w=>{if(!d||!n||!r||w.key!=="Escape"||F.current||!b&&P("__escapeKeyBubbles"))return;const ee=Sr(w)?w.nativeEvent:w,de=Se(sn,ee);i.setOpen(!1,de),de.isCanceled||w.preventDefault(),!b&&!de.isPropagationAllowed&&w.stopPropagation()}),ie=q(()=>{f.current.insideReactTree=!0,me.start(0,_)}),Re=q(w=>{if(!d||!n||w.button!==0)return;const ee=Ee(w.nativeEvent);A(i.select("floatingElement"),ee)&&(v.current||(v.current=!0,B.current=!1))}),be=q(w=>{!d||!n||(w.defaultPrevented||w.nativeEvent.defaultPrevented)&&v.current&&(B.current=!0)});l.useEffect(()=>{if(!d||!n)return _;f.current.__escapeKeyBubbles=b,f.current.__outsidePressBubbles=Y;const w=new Ce,ee=new Ce;function de(){w.clear(),F.current=!0}function fe(){w.start(Me?5:0,()=>{F.current=!1})}function De(){K.current=!0,ee.start(0,()=>{K.current=!1})}function Ye(){v.current=!1,B.current=!1}function C(){const p=W.current,h=p==="pen"||!p?"mouse":p,Q=S(),k=typeof Q=="function"?Q():Q;return typeof k=="string"?k:k[h]}function ae(p){const h=C();return h==="intentional"&&p.type!=="click"||h==="sloppy"&&p.type==="click"}function re(p){const h=f.current.floatingContext?.nodeId,Q=g&&Ve(g.nodesRef.current,h).some(k=>st(p,k.context?.elements.floating));return $(p)||Q}function xe(p){if(ae(p)){p.type!=="click"&&!$(p)&&(ee.clear(),K.current=!1),_();return}if(f.current.insideReactTree){_();return}const h=Ee(p),Q=`[${Qe("inert")}]`,k=Pe(h)?h.getRootNode():null,pe=Array.from((bt(k)?k:U(i.select("floatingElement"))).querySelectorAll(Q)),Ne=i.context.triggerElements;if(h&&(Ne.hasElement(h)||Ne.hasMatchingElement(ce=>A(ce,h))))return;let Le=Pe(h)?h:null;for(;Le&&!ot(Le);){const ce=er(Le);if(ot(ce)||!Pe(ce))break;Le=ce}if(!(pe.length&&Pe(h)&&!br(h)&&!A(h,i.select("floatingElement"))&&pe.every(ce=>!A(Le,ce)))){if(Z(h)&&!("touches"in p)){const ce=ot(h),rt=mt(h),It=/auto|scroll/,Un=ce||It.test(rt.overflowX),Yn=ce||It.test(rt.overflowY),Gn=Un&&h.clientWidth>0&&h.scrollWidth>h.clientWidth,qn=Yn&&h.clientHeight>0&&h.scrollHeight>h.clientHeight,Kn=rt.direction==="rtl",$n=qn&&(Kn?p.offsetX<=h.offsetWidth-h.clientWidth:p.offsetX>h.clientWidth),Xn=Gn&&p.offsetY>h.clientHeight;if($n||Xn)return}if(!re(p)){if(C()==="intentional"&&K.current){ee.clear(),K.current=!1;return}typeof x=="function"&&!x(p)||P("__outsidePressBubbles")||(i.setOpen(!1,Se(rn,p)),_())}}}function O(p){C()!=="sloppy"||p.pointerType==="touch"||!i.select("open")||!n||$(p)||xe(p)}function j(p){if(C()!=="sloppy"||!i.select("open")||!n||$(p))return;const h=p.touches[0];h&&(M.current={startTime:Date.now(),startX:h.clientX,startY:h.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},X.start(1e3,()=>{M.current&&(M.current.dismissOnTouchEnd=!1,M.current.dismissOnMouseDown=!1)}))}function G(p,h){const Q=Ee(p);if(!Q)return;const k=D(Q,p.type,()=>{h(p),k()})}function z(p){W.current="touch",G(p,j)}function te(p){X.clear(),p.type==="pointerdown"&&(W.current=p.pointerType),!(p.type==="mousedown"&&M.current&&!M.current.dismissOnMouseDown)&&G(p,h=>{h.type==="pointerdown"?O(h):xe(h)})}function T(p){if(!v.current)return;const h=B.current;if(Ye(),C()==="intentional"){if(p.type==="pointercancel"){h&&De();return}if(!re(p)){if(h){De();return}typeof x=="function"&&!x(p)||(ee.clear(),K.current=!0,_())}}}function L(p){if(C()!=="sloppy"||!M.current||$(p))return;const h=p.touches[0];if(!h)return;const Q=Math.abs(h.clientX-M.current.startX),k=Math.abs(h.clientY-M.current.startY),pe=Math.sqrt(Q*Q+k*k);pe>5&&(M.current.dismissOnTouchEnd=!0),pe>10&&(xe(p),X.clear(),M.current=null)}function E(p){G(p,L)}function V(p){C()!=="sloppy"||!M.current||$(p)||(M.current.dismissOnTouchEnd&&xe(p),X.clear(),M.current=null)}function J(p){G(p,V)}const H=U(R),ne=we(r&&we(D(H,"keydown",se),D(H,"compositionstart",de),D(H,"compositionend",fe)),y&&we(D(H,"click",te,!0),D(H,"pointerdown",te,!0),D(H,"pointerup",T,!0),D(H,"pointercancel",T,!0),D(H,"mousedown",te,!0),D(H,"mouseup",T,!0),D(H,"touchstart",z,!0),D(H,"touchmove",E,!0),D(H,"touchend",J,!0)));return()=>{ne(),w.clear(),ee.clear(),Ye(),K.current=!1,_()}},[f,R,r,y,x,d,n,b,Y,se,_,S,P,$,g,i,X]);const Te=l.useMemo(()=>({onKeyDown:se,onPointerDown:le,onClick:le}),[se,le]),Ie=l.useMemo(()=>({onKeyDown:se,onPointerDown:be,onMouseDown:be,onClickCapture:ie,onMouseDownCapture(w){ie(),Re(w)},onPointerDownCapture(w){ie(),Re(w)},onMouseUpCapture:ie,onTouchEndCapture:ie,onTouchMoveCapture:ie}),[se,ie,Re,be]);return l.useMemo(()=>n?{reference:Te,floating:Ie,trigger:Te}:{},[n,Te,Ie])}var Ln=tr();const gt=[];let ht;function io(){return ht}function ao(e){gt.push(e)}function co(e){const t=(n,r)=>{const o=ke(uo).current;let s;try{ht=o;for(const a of gt)a.before(o);s=e(n,r);for(const a of gt)a.after(o);o.didInitialize=!0}finally{ht=void 0}return s};return t.displayName=e.displayName||e.name,t}function Hs(e){return l.forwardRef(co(e))}function uo(){return{didInitialize:!1}}const lo=Qt(19),fo=lo?go:ho;function Bn(e,t,n,r,o){return fo(e,t,n,r,o)}function po(e,t,n,r,o){const s=l.useCallback(()=>t(e.getSnapshot(),n,r,o),[e,t,n,r,o]);return Ln.useSyncExternalStore(e.subscribe,s,s)}ao({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){const r=e.syncHooks[n],o=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,o)||(t=!0,r.value=o)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const n=new Set;for(const o of e.syncHooks)n.add(o.store);const r=[];for(const o of n)r.push(o.subscribe(t));return()=>{for(const o of r)o()}}),Ln.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function go(e,t,n,r,o){const s=io();if(!s)return po(e,t,n,r,o);const a=s.syncIndex;s.syncIndex+=1;let c;return s.didInitialize?(c=s.syncHooks[a],(c.store!==e||c.selector!==t||!Object.is(c.a1,n)||!Object.is(c.a2,r)||!Object.is(c.a3,o))&&(c.store!==e&&(s.didChangeStore=!0),c.store=e,c.selector=t,c.a1=n,c.a2=r,c.a3=o,c.value=t(e.getSnapshot(),n,r,o))):(c={store:e,selector:t,a1:n,a2:r,a3:o,value:t(e.getSnapshot(),n,r,o)},s.syncHooks.push(c)),c.value}function ho(e,t,n,r,o){return nr.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,r,o))}class mo{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const r of this.listeners){if(n!==this.updateTick)return;r(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,r,o){return Bn(this,t,n,r,o)}}class Hn extends mo{constructor(t,n={},r){super(t),this.context=n,this.selectors=r}useSyncedValue(t,n){l.useDebugValue(t);const r=this;N(()=>{r.state[t]!==n&&r.set(t,n)},[r,t,n])}useSyncedValueWithCleanup(t,n){const r=this;N(()=>(r.state[t]!==n&&r.set(t,n),()=>{r.set(t,void 0)}),[r,t,n])}useSyncedValues(t){const n=this,r=Object.values(t);N(()=>{n.update(t)},[n,...r])}useControlledProp(t,n){l.useDebugValue(t);const r=this,o=n!==void 0;N(()=>{o&&!Object.is(r.state[t],n)&&r.setState({...r.state,[t]:n})},[r,t,n,o])}select(t,n,r,o){const s=this.selectors[t];return s(this.state,n,r,o)}useState(t,n,r,o){return l.useDebugValue(t),Bn(this,this.selectors[t],n,r,o)}useContextCallback(t,n){l.useDebugValue(t);const r=q(n??Jt);this.context[t]=r}useStateSetter(t){const n=l.useRef(void 0);return n.current===void 0&&(n.current=r=>{this.set(t,r)}),n.current}observe(t,n){let r;typeof t=="function"?r=t:r=this.selectors[t];let o=r(this.state);return n(o,o,this),this.subscribe(s=>{const a=r(s);if(!Object.is(o,a)){const c=o;o=a,n(a,c,this)}})}}const bo={open:e=>e.open,transitionStatus:e=>e.transitionStatus,domReferenceElement:e=>e.domReferenceElement,referenceElement:e=>e.positionReference??e.referenceElement,floatingElement:e=>e.floatingElement,floatingId:e=>e.floatingId};class Ct extends Hn{constructor(t){const{syncOnly:n,nested:r,onOpenChange:o,triggerElements:s,...a}=t;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:o,dataRef:{current:{}},events:Mn(),nested:r,triggerElements:s},bo),this.syncOnly=n}syncOpenEvent=(t,n)=>{(!t||!this.state.open||n!=null&&Tr(n))&&(this.context.dataRef.current.openEvent=t?n:void 0)};dispatchOpenChange=(t,n)=>{this.syncOpenEvent(t,n.event);const r={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",r)};setOpen=(t,n)=>{if(this.syncOnly){this.context.onOpenChange?.(t,n);return}this.dispatchOpenChange(t,n),this.context.onOpenChange?.(t,n)}}function yo(e){const{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:o,nested:s,onOpenChange:a}=e,c=t.useState("open"),u=t.useState("activeTriggerElement"),i=t.useState(n?"popupElement":"positionerElement"),d=t.context.triggerElements,R=a,f=l.useRef(null);r===void 0&&f.current===null&&(f.current=new Ct({open:c,transitionStatus:void 0,referenceElement:u,floatingElement:i,triggerElements:d,onOpenChange:R,floatingId:o,syncOnly:!0,nested:s}));const g=r??f.current;return t.useSyncedValue("floatingId",o),N(()=>{const m={open:c,floatingId:o,referenceElement:u,floatingElement:i};Pe(u)&&(m.domReferenceElement=u),g.state.positionReference===g.state.referenceElement&&(m.positionReference=u),g.update(m)},[c,o,u,i,g]),g.context.onOpenChange=R,g.context.nested=s,g}const So={tabIndex:-1,[dt]:""};function Eo(e){return t=>t==="touch"?e.current:!0}function Ro(e,t=!1){const n=yt(),r=Tt()!=null,o=ke(()=>e(n,r)).current;return yo({popupStore:o,treatPopupAsFloatingElement:t,floatingRootContext:o.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:o.setOpen}),o}function To({handle:e,store:t}){return N(()=>e.attachStore(t),[e,t]),null}function xo(e,t){const n=l.useRef(null),r=l.useRef(null);return l.useCallback(o=>{if(e===void 0)return;let s=!1;if(n.current!==null){const a=n.current,c=r.current,u=t.context.triggerElements.getById(a);c&&u===c&&(t.context.triggerElements.delete(a),s=!0),n.current=null,r.current=null}if(o!==null&&(n.current=e,r.current=o,t.context.triggerElements.add(e,o),s=!0),s){const a=t.context.triggerElements.size;t.select("open")&&t.state.triggerCount!==a&&t.set("triggerCount",a)}},[t,e])}function Wn(e,t,n,r=!1){t?e.preventUnmountingOnClose=!1:r&&(e.preventUnmountingOnClose=!0);const o=n?.id??null;(o||t)&&(e.activeTriggerId=o,e.activeTriggerElement=n??null)}function vo(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Ws(e,t,n,r={}){const o=n.reason,s=o===nn,a=t&&o===ir,c=!t&&(o===on||o===sn),u=vo(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);const i=()=>{const d={...r.extraState,open:t};a?d.instantType="focus":c?d.instantType="dismiss":s&&(d.instantType=void 0),Wn(d,t,n.trigger,u()),e.update(d)};s?Ze.flushSync(i):i()}function js(e,t,n,r){const o=n.useState("isMountedByTrigger",e),s=xo(e,n),a=q(u=>{const i=n.select("open"),d=n.select("activeTriggerId");if(d===e){n.update({activeTriggerElement:u,...i?r:null});return}d==null&&i&&n.update({activeTriggerId:e,activeTriggerElement:u,...r})}),c=l.useCallback(u=>{s(u),u&&a(u)},[s,a]);return N(()=>{o&&n.update({activeTriggerElement:t.current,...r})},[o,n,t,...Object.values(r)]),{registerTrigger:c,isMountedByThisTrigger:o}}function Co(e,t={}){const{closeOnActiveTriggerUnmount:n=!1}=t,r=l.useRef(null),o=e.useState("open"),s=e.useState("triggerCount"),a=e.useState("activeTriggerId"),c=e.useState("activeTriggerElement");N(()=>{if(!o){r.current=null,e.state.triggerCount!==0&&e.set("triggerCount",0);return}const u=e.context.triggerElements.size,i={};e.state.triggerCount!==u&&(i.triggerCount=u);const d=e.select("activeTriggerId");let R=null;if(d){const f=e.context.triggerElements.getById(d);if(f)r.current=d,f!==e.state.activeTriggerElement&&(i.activeTriggerElement=f);else{for(const[g,m]of e.context.triggerElements.entries())if(m===e.state.activeTriggerElement){i.activeTriggerId=g,i.activeTriggerElement=m,r.current=g;break}i.activeTriggerId===void 0&&(r.current===d?R=d:r.current=null)}}else r.current=null;if(!R&&!d&&u===1){const f=e.context.triggerElements.entries().next();if(!f.done){const[g,m]=f.value;i.activeTriggerId=g,i.activeTriggerElement=m,r.current=g}}(i.triggerCount!==void 0||i.activeTriggerId!==void 0||i.activeTriggerElement!==void 0)&&e.update(i),R&&n&&queueMicrotask(()=>{if(e.select("open")&&e.select("activeTriggerId")===R&&!e.context.triggerElements.getById(R)){const f=Se(sr);e.setOpen(!1,f),f.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[o,e,s,a,c,n])}function Oo(e,t,n){const{mounted:r,setMounted:o,transitionStatus:s}=Nr(e),a=t.useState("preventUnmountingOnClose"),c=e?!1:a;t.useSyncedValues({mounted:r,transitionStatus:s,preventUnmountingOnClose:c});const u=q(()=>{o(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)});return vn({enabled:r&&!e&&!c,open:e,ref:t.context.popupRef,onComplete(){e||u()}}),{forceUnmount:u,transitionStatus:s}}function Io(e,t){e.useSyncedValues(t),N(()=>()=>{e.update({activeTriggerProps:ve,inactiveTriggerProps:ve,popupProps:ve})},[e])}function Po(e,t){N(()=>{!t&&e.state.openMethod!==null&&e.set("openMethod",null)},[t,e]),N(()=>()=>{e.state.openMethod!==null&&e.set("openMethod",null)},[e])}class jn{constructor(){this.idMap=new Map}add(t,n){this.idMap.set(t,n)}delete(t){this.idMap.delete(t)}hasElement(t){for(const n of this.idMap.values())if(n===t)return!0;return!1}hasMatchingElement(t){for(const n of this.idMap.values())if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}}function wo(){return new Ct({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:new jn,floatingId:void 0,syncOnly:!1,nested:!1,onOpenChange:void 0})}function ko(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:wo(),floatingId:void 0,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:ve,inactiveTriggerProps:ve,popupProps:ve}}function Ao(e,t,n=!1){return new Ct({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0})}const je=e=>e.triggerIdProp??e.activeTriggerId,Ot=e=>e.openProp??e.open,Yt=e=>(e.popupElement?.id??e.floatingId)||void 0;function _n(e,t){return t!==void 0&&Ot(e)&&je(e)===t}function Fo(e,t){return _n(e,t)?!0:t!==void 0&&Ot(e)&&je(e)==null&&e.triggerCount===1}const Mo={open:Ot,mounted:e=>e.mounted,transitionStatus:e=>e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:je,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Yt,isTriggerActive:(e,t)=>t!==void 0&&je(e)===t,isOpenedByTrigger:(e,t)=>_n(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&je(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>Fo(e,t)?Yt(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement},Vn=l.createContext(void 0);function Do(){const e=l.useContext(Vn);if(e===void 0)throw new Error(zt(26));return e}const No="ArrowUp",Lo="ArrowDown",Bo="ArrowLeft",Ho="ArrowRight",Wo="Home",jo="End",_o=new Set([No,Lo,Bo,Ho,Wo,jo]),Vo="Shift",_s=[Vo,"Control","Alt","Meta"];function Uo(e){return Z(e)&&e.tagName==="INPUT"}function Vs(e){return!!(Uo(e)&&e.selectionStart!=null||Z(e)&&e.tagName==="TEXTAREA")}function Us(e,t,n,r){if(!e||!t||!t.scrollTo)return;let o=e.scrollLeft,s=e.scrollTop;const a=e.clientWidth<e.scrollWidth,c=e.clientHeight<e.scrollHeight;if(a&&r!=="vertical"){const u=Gt(e,t,"left"),i=Xe(e),d=Xe(t);n==="ltr"&&(u+t.offsetWidth+d.scrollMarginRight>e.scrollLeft+e.clientWidth-i.scrollPaddingRight?o=u+t.offsetWidth+d.scrollMarginRight-e.clientWidth+i.scrollPaddingRight:u-d.scrollMarginLeft<e.scrollLeft+i.scrollPaddingLeft&&(o=u-d.scrollMarginLeft-i.scrollPaddingLeft)),n==="rtl"&&(u-d.scrollMarginLeft<e.scrollLeft+i.scrollPaddingLeft?o=u-d.scrollMarginLeft-i.scrollPaddingLeft:u+t.offsetWidth+d.scrollMarginRight>e.scrollLeft+e.clientWidth-i.scrollPaddingRight&&(o=u+t.offsetWidth+d.scrollMarginRight-e.clientWidth+i.scrollPaddingRight))}if(c&&r!=="horizontal"){const u=Gt(e,t,"top"),i=Xe(e),d=Xe(t);u-d.scrollMarginTop<e.scrollTop+i.scrollPaddingTop?s=u-d.scrollMarginTop-i.scrollPaddingTop:u+t.offsetHeight+d.scrollMarginBottom>e.scrollTop+e.clientHeight-i.scrollPaddingBottom&&(s=u+t.offsetHeight+d.scrollMarginBottom-e.clientHeight+i.scrollPaddingBottom)}e.scrollTo({left:o,top:s,behavior:"auto"})}function Gt(e,t,n){const r=n==="left"?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[r],t.offsetParent!==e);)t=t.offsetParent;return o}function Xe(e){const t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}const Yo={...In,...Cn,nestedDialogOpen(e){return e?{"data-nested-dialog-open":""}:null}},Go=l.forwardRef(function(t,n){const{render:r,className:o,style:s,finalFocus:a,initialFocus:c,...u}=t,i=Oe(),d=i.useState("descriptionElementId"),R=i.useState("disablePointerDismissal"),f=i.useState("floatingRootContext"),g=i.useState("popupProps"),m=i.useState("modal"),x=i.useState("mounted"),y=i.useState("nested"),S=i.useState("nestedOpenDialogCount"),b=i.useState("open"),Y=i.useState("openMethod"),v=i.useState("titleElementId"),B=i.useState("transitionStatus"),K=i.useState("role"),F=f.useState("floatingId");Do(),vn({open:b,ref:i.context.popupRef,onComplete(){b&&i.context.onOpenChangeComplete?.(!0)}});const W=c===void 0?Eo(i.context.popupRef):c,M=S>0,X=i.useStateSetter("popupElement"),_=Ae("div",t,{state:{open:b,nested:y,transitionStatus:B,nestedDialogOpen:M},props:[g,{id:F,"aria-labelledby":v,"aria-describedby":d,role:K,...So,hidden:!x,onKeyDown(P){_o.has(P.key)&&P.stopPropagation()},style:{"--nested-dialogs":S}},u],ref:[n,i.context.popupRef,X],stateAttributesMapping:Yo});return I.jsx(no,{context:f,openInteractionType:Y,disabled:!x,closeOnFocusOut:!R,initialFocus:W,returnFocus:a,modal:m!==!1,restoreFocus:"popup",children:_})});function qo(e){return Qt(19)?e:e?"true":void 0}const Ko=l.forwardRef(function(t,n){const{cutout:r,...o}=t;let s;if(r){const a=r.getBoundingClientRect();s=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${a.left}px ${a.top}px,${a.left}px ${a.bottom}px,${a.right}px ${a.bottom}px,${a.right}px ${a.top}px,${a.left}px ${a.top}px)`}return I.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})}),$o=l.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t,s=Oe(),a=s.useState("mounted"),c=s.useState("modal"),u=s.useState("open");return a||r?I.jsx(Vn.Provider,{value:r,children:I.jsxs(Qr,{ref:n,...o,children:[a&&c===!0&&I.jsx(Ko,{ref:s.context.internalBackdropRef,inert:qo(!u)}),t.children]})}):null});let qt={},Kt={},$t="";function nt(e,t){return rr(e)?e:t}function Xt(e,t,n){return/hidden|clip/.test(e.getComputedStyle(nt(t,n)).overflowY)}function Xo(e){if(typeof document>"u")return!1;const t=U(e);return et(t).innerWidth-t.documentElement.clientWidth>0}function zo(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=U(e),r=n.documentElement,o=n.body,s=nt(r,o),a=s.style.overflowY,c=r.style.scrollbarGutter;r.style.scrollbarGutter="stable",s.style.overflowY="scroll";const u=s.offsetWidth;s.style.overflowY="hidden";const i=s.offsetWidth;return s.style.overflowY=a,r.style.scrollbarGutter=c,u===i}function Jo(e){const t=U(e),n=t.documentElement,r=t.body,o=nt(n,r),s={overflowY:o.style.overflowY,overflowX:o.style.overflowX};return Object.assign(o.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(o.style,s)}}function Qo(e){const t=U(e),n=t.documentElement,r=t.body,o=et(n);let s=0,a=0,c=!1;const u=ue.create();if(Me&&(o.visualViewport?.scale??1)!==1)return()=>{};function i(){const g=o.getComputedStyle(n),m=o.getComputedStyle(r),S=(g.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,a=n.scrollLeft,qt={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},$t=n.style.scrollBehavior,Kt={position:r.style.position,height:r.style.height,width:r.style.width,boxSizing:r.style.boxSizing,overflowY:r.style.overflowY,overflowX:r.style.overflowX,scrollBehavior:r.style.scrollBehavior};const b=n.scrollHeight>n.clientHeight,Y=n.scrollWidth>n.clientWidth,v=g.overflowY==="scroll"||m.overflowY==="scroll",B=g.overflowX==="scroll"||m.overflowX==="scroll",K=Math.max(0,o.innerWidth-r.clientWidth),F=Math.max(0,o.innerHeight-r.clientHeight),W=parseFloat(m.marginTop)+parseFloat(m.marginBottom),M=parseFloat(m.marginLeft)+parseFloat(m.marginRight),X=nt(n,r);if(c=zo(e),c){n.style.scrollbarGutter=S,X.style.overflowY="hidden",X.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:S,overflowY:"hidden",overflowX:"hidden"}),(b||v)&&(n.style.overflowY="scroll"),(Y||B)&&(n.style.overflowX="scroll"),Object.assign(r.style,{position:"relative",height:W||F?`calc(100dvh - ${W+F}px)`:"100dvh",width:M||K?`calc(100vw - ${M+K}px)`:"100vw",boxSizing:"border-box",overflowY:"hidden",overflowX:"hidden",scrollBehavior:"unset"}),r.scrollTop=s,r.scrollLeft=a,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function d(){Object.assign(n.style,qt),Object.assign(r.style,Kt),c||(n.scrollTop=s,n.scrollLeft=a,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=$t)}function R(){d(),u.request(i)}i();const f=D(o,"resize",R);return()=>{u.cancel(),d(),typeof o.removeEventListener=="function"&&f()}}class Zo{lockCount=0;restore=null;timeoutLock=Ce.create();timeoutUnlock=Ce.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const n=U(t),r=n.documentElement,o=n.body,s=et(r);if(Xt(s,r,o)){const c=new s.MutationObserver(()=>{Xt(s,r,o)||(c.disconnect(),this.restore=null,this.lock(t))}),u={attributes:!0};c.observe(r,u),c.observe(o,u),this.restore=()=>c.disconnect();return}const a=St||!Xo(t);this.restore=a?Jo(t):Qo(t)}}const es=new Zo;function ts(e=!0,t=null){N(()=>{if(e)return es.acquire(t)},[e,t])}function ns({store:e,parentContext:t,isDrawer:n}){const r=e.useState("open"),o=e.useState("disablePointerDismissal"),s=e.useState("modal"),a=e.useState("popupElement"),c=e.useState("floatingRootContext"),[u,i]=l.useState(0),[d,R]=l.useState(0),f=u===0,g=so(c,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:s==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(m){if(!e.context.outsidePressEnabledRef.current||"button"in m&&m.button!==0)return!1;if("touches"in m){if(m.type==="touchend"){if(m.changedTouches.length!==1||m.touches.length!==0)return!1}else if(m.touches.length!==1)return!1}const x=Ee(m);if(f&&!o){if(s){const y=e.context.internalBackdropRef.current,S=e.context.backdropRef.current;return y||S?y===x||S===x||A(x,a)&&!x?.hasAttribute("data-base-ui-portal"):!0}return!0}return!1},escapeKey:f});return ts(r&&s===!0,a),e.useContextCallback("onNestedDialogOpen",(m,x)=>{i(m),R(x)}),N(()=>(t?.onNestedDialogOpen&&(r?t.onNestedDialogOpen(u+1,d+(n?1:0)):t.onNestedDialogOpen(0,0)),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,u,d,t]),Io(e,{activeTriggerProps:g.reference,inactiveTriggerProps:g.trigger,popupProps:g.floating,nestedOpenDialogCount:u,nestedOpenDrawerCount:d}),null}const rs={...Mo,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role};class os extends Hn{constructor(t,n,r){const o=new jn,s=ss(t,o,n,r);super(s,is(o),rs)}setOpen=(t,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(t,n);const r={open:t};Wn(r,t,n.trigger),this.update(r)}}function ss(e,t,n,r=!1){const o={...ko(),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:"dialog",...e};return o.floatingRootContext=Ao(t,n,r),o}function is(e){return{popupRef:l.createRef(),backdropRef:l.createRef(),internalBackdropRef:l.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function as(e,t){const{children:n,open:r,defaultOpen:o=!1,onOpenChange:s,onOpenChangeComplete:a,disablePointerDismissal:c=!1,modal:u=!0,actionsRef:i,handle:d,triggerId:R,defaultTriggerId:f=null}=t,g=e==="drawer",m=u,x=c,y="dialog",S=Oe(!0),b=S!=null,Y={modal:m,disablePointerDismissal:x,nested:b,role:y},v=Ro((X,me)=>new os({open:o,openProp:r,activeTriggerId:f,triggerIdProp:R,...Y},X,me),!0);v.useControlledProp("openProp",r),v.useControlledProp("triggerIdProp",R),v.useSyncedValues(Y),v.useContextCallback("onOpenChange",s),v.useContextCallback("onOpenChangeComplete",a);const B=v.useState("open"),K=v.useState("mounted"),F=v.useState("payload");Po(v,B),Co(v);const{forceUnmount:W}=Oo(B,v);l.useImperativeHandle(i,()=>({unmount:W,close:()=>v.setOpen(!1,Se(ar))}),[W,v]);const M=B||K;return I.jsxs(On.Provider,{value:v,children:[d&&I.jsx(To,{handle:d,store:v}),M&&I.jsx(ns,{store:v,parentContext:S?.context,isDrawer:g}),typeof n=="function"?n({payload:F}):n]})}function cs(e){return as("dialog",e)}const us=l.forwardRef(function(t,n){const{render:r,className:o,style:s,id:a,...c}=t,u=Oe(),i=en(a);return u.useSyncedValueWithCleanup("titleElementId",i),Ae("h2",t,{ref:n,props:[{id:i},c]})});function Ys({...e}){return I.jsx(cs,{"data-slot":"dialog",...e})}function ls({...e}){return I.jsx($o,{"data-slot":"dialog-portal",...e})}function ds({className:e,...t}){return I.jsx(Vr,{"data-slot":"dialog-overlay",className:Fe("fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",e),...t})}function Gs({className:e,children:t,showCloseButton:n=!0,...r}){return I.jsxs(ls,{children:[I.jsx(ds,{}),I.jsxs(Go,{"data-slot":"dialog-content",className:Fe("fixed top-1/2 left-1/2 z-50 grid max-h-[calc(100dvh-2rem)] w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 overflow-y-auto rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",e),...r,children:[t,n&&I.jsxs(Pn,{"data-slot":"dialog-close",render:I.jsx(Zt,{variant:"ghost",className:"absolute top-2 right-2",size:"icon-sm"}),children:[I.jsx(ur,{}),I.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function qs({className:e,...t}){return I.jsx("div",{"data-slot":"dialog-header",className:Fe("flex flex-col gap-2",e),...t})}function Ks({className:e,showCloseButton:t=!1,children:n,...r}){return I.jsxs("div",{"data-slot":"dialog-footer",className:Fe("-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end",e),...r,children:[n,t&&I.jsx(Pn,{render:I.jsx(Zt,{variant:"outline"}),children:"Close"})]})}function $s({className:e,...t}){return I.jsx(us,{"data-slot":"dialog-title",className:Fe("font-heading text-base leading-none font-medium",e),...t})}function Xs({className:e,...t}){return I.jsx(Ur,{"data-slot":"dialog-description",className:Fe("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",e),...t})}export{Qe as $,vn as A,_r as B,In as C,cs as D,Ys as E,So as F,Gs as G,$s as H,qs as I,Xs as J,Ks as K,ws as L,Gr as M,Nr as N,Cn as O,jn as P,xn as Q,Hn as R,un as S,Ce as T,Rr as U,Ln as V,xt as W,ur as X,we as Y,gr as Z,Me as _,D as a,ys as a0,Es as a1,Tn as a2,Tt as a3,Ss as a4,Ve as a5,At as a6,kt as a7,at as a8,Ts as a9,yo as aA,ks as aB,Bs as aC,an as aD,We as aE,Cs as aF,Sn as aG,Os as aH,Ps as aI,Je as aJ,As as aK,Us as aL,Wo as aM,jo as aN,Vs as aO,Lo as aP,No as aQ,Bo as aR,Ho as aS,_s as aT,Vo as aU,xs as aa,vs as ab,yr as ac,ln as ad,Er as ae,gs as af,hs as ag,ms as ah,bs as ai,Et as aj,xr as ak,St as al,Fs as am,no as an,_o as ao,Qr as ap,ts as aq,Ms as ar,Fr as as,Ko as at,qo as au,Ls as av,Zr as aw,Ns as ax,vo as ay,Wn as az,Go as b,Pn as c,us as d,Ur as e,$o as f,Vr as g,Ws as h,Rs as i,ko as j,Ao as k,co as l,Co as m,Oo as n,To as o,Mo as p,so as q,Io as r,Hs as s,js as t,Ro as u,Ke as v,ze as w,Is as x,Jr as y,Ds as z};
|