@deslop/scope 0.1.1233 → 0.1.1237
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/client/assets/(home)-DGRJAiCW.js +1 -0
- package/dist/client/assets/{effect-DFsnctYV.js → effect-YUKEuiNO.js} +13 -13
- package/dist/client/assets/index-BBKP22pP.css +2 -0
- package/dist/client/assets/{index-UN-ouzVZ.js → index-Oqljh0ns.js} +4 -4
- package/dist/client/index.html +3 -3
- package/dist/server.js +7 -1
- package/package.json +2 -2
- package/dist/client/assets/(home)-Dud-Hnh-.js +0 -1
- package/dist/client/assets/index-C4YnrtyC.css +0 -2
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./rolldown-runtime-WkwZ5CU-.js";import{a as t,i as n,o as r,r as i,t as a}from"./react-CDnnZf73.js";import{$t as o,A as s,An as c,At as l,B as u,Bt as d,C as f,Cn as p,D as m,Dn as h,Dt as g,En as _,Et as v,F as y,Fn as b,Ft as x,G as S,Gt as C,H as w,I as T,It as E,Jt as D,K as O,Kt as k,L as A,Ln as j,M,Mt as N,N as P,Nt as F,O as I,On as L,Ot as R,P as z,Pn as ee,Pt as te,Qt as B,R as ne,Rn as V,S as H,Sn as U,St as re,Tn as ie,U as W,V as ae,Vt as oe,W as G,Wt as se,X as ce,Xt as le,Y as ue,Yt as de,Z as fe,Zt as pe,_ as me,_n as he,_t as ge,at as K,b as _e,bn as ve,cn as ye,ct as be,d as xe,dn as Se,dt as Ce,en as we,et as Te,f as Ee,fn as De,ft as Oe,g as ke,gn as Ae,gt as je,h as Me,hn as Ne,ht as Pe,i as Fe,in as Ie,it as Le,j as Re,jt as ze,k as Be,kt as Ve,ln as He,lt as Ue,m as We,mn as Ge,mt as Ke,n as qe,nn as Je,nt as Ye,on as Xe,ot as Ze,p as Qe,pn as $e,pt as et,q as tt,qt as nt,r as rt,rn as it,rt as q,s as at,sn as ot,st,t as ct,tn as lt,tt as ut,u as dt,un as ft,ut as pt,v as mt,vn as ht,vt as gt,wn as _t,wt as vt,x as yt,xn as bt,xt,y as St,yn as Ct,yt as wt,z as Tt,zt as Et}from"./effect-DFsnctYV.js";import{A as Dt,B as Ot,C as kt,D as At,E as jt,F as Mt,G as Nt,H as Pt,I as Ft,J as It,K as Lt,L as Rt,M as zt,N as Bt,O as Vt,P as Ht,R as Ut,S as J,T as Wt,U as Gt,V as Kt,W as qt,_ as Jt,a as Yt,b as Xt,c as Zt,d as Qt,f as $t,g as en,h as tn,i as nn,j as rn,k as an,l as on,m as sn,n as cn,o as ln,p as un,q as dn,r as fn,s as pn,t as mn,u as hn,v as gn,w as _n,x as Y,y as vn,z as yn}from"./index-UN-ouzVZ.js";var bn={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};bn.node;var xn=Lt(bn),Sn={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};Sn.node;var Cn=Lt(Sn),wn={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};wn.node;var Tn=Lt(wn),En={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};En.node;var Dn=Lt(En),On={name:`server`,size:24,node:[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]};On.node;var kn=Lt(On),An={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};An.node;var jn=Lt(An);function Mn(e){return e?.ownerDocument||document}var X=e(r(),1),Z=t(),Nn=e(i(),1),Pn=a(),Fn=class extends O()(`AuthError`,{cause:Le(M()),error:K(Tt([`invalid_request`,`invalid_client`,`invalid_client_metadata`,`invalid_redirect_uri`,`invalid_grant`,`invalid_target`,`invalid_scope`,`unsupported_grant_type`,`unsupported_response_type`,`access_denied`,`temporarily_unavailable`])),message:W}){};G({id:ae,name:ae}),W.check(Ye(/^https:\/\/[a-z\d-]+\.mp281x\.xyz(?:\/mcp)?$/u)),G({accessToken:ae,clientId:ae,expiresAt:z,refreshToken:ae}),G({client_id:ae}),G({access_token:ae,expires_in:z,refresh_token:ae});var In=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2064%2064'%20shape-rendering='crispEdges'%3e%3cpath%20fill='%23da702c'%20d='M17%2021h1v22h-1zM18%2022h2v22h-2zM20%2023h2v22h-2zM22%2024h2v22h-2zM24%2025h2v22h-2zM26%2026h2v5h-2zM28%2027h2v5h-2zM30%2028h2v22h-2zM32%2029h2v22h-2zM34%2030h2v22h-2zM26%2031h1v17h-1zM36%2031h2v22h-2zM29%2032h1v17h-1zM38%2032h1v22h-1zM27%2041h1v7h-1zM28%2042h1v7h-1z'/%3e%3cpath%20fill='%23bc5215'%20d='M46%2028h1v22h-1zM44%2029h2v22h-2zM42%2030h2v22h-2zM40%2031h2v22h-2zM39%2032h1v22h-1z'/%3e%3cpath%20fill='%230a0a0a'%20d='M29%209h2v1h-2zM27%2010h2v1h-2zM31%2010h3v1h-3zM25%2011h2v1h-2zM34%2011h1v1h-1zM24%2012h1v1h-1zM35%2012h1v1h-1zM23%2013h1v2h-1zM36%2013h1v1h-1zM37%2014h1v1h-1zM22%2015h1v3h-1zM29%2015h1v1h-1zM38%2015h1v2h-1zM28%2016h1v3h-1zM30%2016h2v1h-2zM32%2017h1v1h-1zM39%2017h1v2h-1zM20%2018h2v1h-2zM29%2018h1v1h-1zM33%2018h1v1h-1zM18%2019h2v1h-2zM30%2019h2v1h-2zM34%2019h1v3h-1zM40%2019h1v2h-1zM17%2020h1v1h-1zM32%2020h2v1h-2zM16%2021h1v22h-1zM41%2021h1v4h-1zM42%2025h2v1h-2zM44%2026h2v1h-2zM46%2027h1v1h-1zM47%2028h1v22h-1zM17%2043h1v1h-1zM18%2044h2v1h-2zM20%2045h2v1h-2zM22%2046h2v1h-2zM24%2047h2v1h-2zM26%2048h2v1h-2zM28%2049h2v1h-2zM30%2050h2v1h-2zM46%2050h1v1h-1zM32%2051h2v1h-2zM44%2051h2v1h-2zM34%2052h2v1h-2zM42%2052h2v1h-2zM36%2053h2v1h-2zM40%2053h2v1h-2zM38%2054h2v1h-2z'/%3e%3cpath%20fill='%23ec8b49'%20d='M22%2018h1v5h-1zM20%2019h2v3h-2zM28%2019h2v7h-2zM18%2020h2v1h-2zM30%2020h2v7h-2zM23%2021h1v2h-1zM32%2021h2v7h-2zM24%2022h4v2h-4zM34%2022h2v7h-2zM26%2024h2v1h-2zM41%2025h1v5h-1zM42%2026h2v3h-2zM44%2027h2v1h-2zM36%2028h2v2h-2zM40%2028h1v2h-1zM38%2029h2v2h-2z'/%3e%3cpath%20fill='%23b7b5ac'%20d='M27%2011h2v4h-2zM25%2012h2v5h-2zM29%2012h3v3h-3zM24%2013h1v9h-1zM32%2013h1v4h-1zM33%2014h1v4h-1zM23%2015h1v6h-1zM27%2015h1v1h-1zM30%2015h2v1h-2zM34%2015h1v4h-1zM35%2016h1v6h-1zM25%2017h1v5h-1zM36%2018h1v10h-1zM37%2020h1v8h-1zM38%2022h1v7h-1z'/%3e%3cpath%20fill='%23878580'%20d='M28%2015h1v1h-1zM27%2016h1v6h-1zM26%2017h1v5h-1zM37%2019h3v1h-3zM38%2020h2v2h-2zM40%2021h1v7h-1zM39%2022h1v7h-1z'/%3e%3cpath%20fill='%23f9ae77'%20d='M18%2021h2v1h-2zM20%2022h2v1h-2zM22%2023h2v1h-2zM24%2024h2v1h-2zM26%2025h2v1h-2zM28%2026h2v1h-2zM30%2027h2v1h-2zM32%2028h2v1h-2zM44%2028h2v1h-2zM34%2029h2v1h-2zM42%2029h2v1h-2zM36%2030h2v1h-2zM40%2030h2v1h-2zM38%2031h2v1h-2z'/%3e%3cpath%20fill='%23cecdc3'%20d='M29%2010h2v2h-2zM31%2011h3v1h-3zM32%2012h3v1h-3zM33%2013h3v1h-3zM34%2014h3v1h-3zM35%2015h3v1h-3zM36%2016h2v2h-2zM38%2017h1v2h-1zM37%2018h1v1h-1z'/%3e%3cpath%20fill='%23000000'%20fill-opacity='0.353'%20d='M19%2045h1v1h-1zM20%2046h2v1h-2zM22%2047h2v1h-2zM24%2048h2v1h-2zM26%2049h2v1h-2zM28%2050h2v1h-2zM30%2051h2v1h-2zM32%2052h2v1h-2zM44%2052h1v1h-1zM34%2053h2v1h-2zM42%2053h2v1h-2zM36%2054h2v1h-2zM40%2054h2v1h-2zM38%2055h2v1h-2z'/%3e%3cpath%20fill='%231c1b1a'%20d='M27%2031h1v10h-1zM28%2032h1v10h-1z'/%3e%3c/svg%3e`,Ln=`/assets/icon-B_7Zk4lP.svg`,Rn=`/assets/icon-61pmFc-p.svg`,zn=`/assets/icon-BGymHyAZ.svg`,Bn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2018%2018'%20shape-rendering='crispEdges'%3e%3cpath%20fill='%23fd7357'%20d='M12%200h1v1h-1zM11%201h1v1h-1zM10%202h2v1h-2zM9%203h2v1h-2zM8%204h3v1h-3zM7%205h3v1h-3zM6%206h4v1h-4zM5%207h4v1h-4zM4%208h5v1h-5zM3%209h10v1h-10zM8%2010h4v1h-4zM7%2011h4v1h-4zM7%2012h3v1h-3zM6%2013h3v1h-3zM6%2014h2v1h-2zM5%2015h2v1h-2zM5%2016h1v1h-1zM4%2017h1v1h-1z'/%3e%3cpath%20fill='%23050505'%20d='M13%200h1v1h-1zM3%201h1v1h-1zM7%201h1v1h-1zM12%201h1v1h-1zM6%202h1v1h-1zM12%202h1v1h-1zM5%203h1v1h-1zM11%203h1v1h-1zM4%204h1v1h-1zM11%204h1v1h-1zM10%205h1v1h-1zM10%206h1v1h-1zM9%207h1v1h-1zM9%208h1v1h-1zM13%209h1v1h-1zM12%2010h1v1h-1zM11%2011h1v1h-1zM10%2012h1v1h-1zM9%2013h1v1h-1zM8%2014h1v1h-1zM12%2014h1v1h-1zM7%2015h1v1h-1zM11%2015h1v1h-1zM6%2016h1v1h-1zM10%2016h1v1h-1zM5%2017h1v1h-1zM13%2017h1v1h-1z'/%3e%3c/svg%3e`,Vn=`/assets/icon-D1hVTa1Q.svg`,Hn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2064%2064'%20shape-rendering='crispEdges'%3e%3cpath%20fill='%23ce5d97'%20d='M9%2026h10v4h-10zM9%2030h1v6h-1zM12%2030h7v2h-7zM19%2031h10v4h-10zM12%2032h3v6h-3zM16%2032h3v1h-3zM17%2033h2v7h-2zM10%2034h2v3h-2zM19%2035h1v6h-1zM22%2035h7v2h-7zM15%2036h1v3h-1zM29%2036h10v4h-10zM16%2037h1v3h-1zM22%2037h3v6h-3zM26%2037h3v1h-3zM14%2038h1v1h-1zM27%2038h2v7h-2zM20%2039h2v3h-2zM18%2040h1v1h-1zM29%2040h1v6h-1zM32%2040h7v2h-7zM25%2041h1v3h-1zM26%2042h1v3h-1zM32%2042h3v6h-3zM36%2042h3v1h-3zM24%2043h1v1h-1zM37%2043h2v7h-2zM30%2044h2v3h-2zM28%2045h1v1h-1zM35%2046h1v3h-1zM36%2047h1v3h-1zM34%2048h1v1h-1zM38%2050h1v1h-1z'/%3e%3cpath%20fill='%23575653'%20d='M24%2017h10v1h-10zM22%2018h10v1h-10zM20%2019h10v1h-10zM18%2020h10v1h-10zM16%2021h10v1h-10zM14%2022h10v1h-10zM34%2022h8v2h-8zM12%2023h10v1h-10zM32%2023h2v5h-2zM10%2024h10v1h-10zM30%2024h2v5h-2zM34%2024h6v1h-6zM28%2025h2v5h-2zM34%2025h4v1h-4zM26%2026h2v4h-2zM34%2026h2v1h-2zM24%2027h2v3h-2zM50%2027h4v1h-4zM22%2028h2v2h-2zM49%2028h3v1h-3zM20%2029h2v1h-2zM40%2029h2v5h-2zM47%2029h3v1h-3zM38%2030h2v5h-2zM42%2030h6v1h-6zM36%2031h2v4h-2zM42%2031h4v1h-4zM34%2032h2v3h-2zM42%2032h2v1h-2zM32%2033h2v2h-2zM30%2034h2v1h-2z'/%3e%3cpath%20fill='%23403e3c'%20d='M34%2018h1v4h-1zM32%2019h2v1h-2zM30%2020h2v4h-2zM28%2021h2v1h-2zM26%2022h2v4h-2zM24%2023h2v1h-2zM22%2024h2v4h-2zM9%2025h10v1h-10zM20%2025h2v1h-2zM40%2025h2v4h-2zM19%2026h1v5h-1zM38%2026h2v1h-2zM36%2027h2v4h-2zM34%2028h2v1h-2zM54%2028h1v5h-1zM32%2029h2v4h-2zM52%2029h2v1h-2zM20%2030h9v1h-9zM30%2030h2v1h-2zM50%2030h2v5h-2zM29%2031h1v5h-1zM48%2031h2v1h-2zM46%2032h2v5h-2zM44%2033h2v1h-2zM52%2033h2v1h-2zM42%2034h2v5h-2zM30%2035h9v1h-9zM40%2035h2v1h-2zM48%2035h2v1h-2zM39%2036h1v5h-1zM44%2037h2v1h-2zM40%2039h2v1h-2z'/%3e%3cpath%20fill='%23a02f6f'%20d='M54%2033h1v10h-1zM52%2034h2v10h-2zM50%2035h2v10h-2zM48%2036h2v10h-2zM46%2037h2v10h-2zM44%2038h2v10h-2zM42%2039h2v10h-2zM40%2040h2v10h-2zM39%2041h1v10h-1z'/%3e%3cpath%20fill='%230a0a0a'%20d='M43%2013h6v1h-6zM42%2014h1v1h-1zM49%2014h1v1h-1zM41%2015h1v7h-1zM50%2015h1v12h-1zM24%2016h11v1h-11zM22%2017h2v1h-2zM35%2017h1v5h-1zM20%2018h2v1h-2zM18%2019h2v1h-2zM16%2020h2v1h-2zM14%2021h2v1h-2zM36%2021h5v1h-5zM12%2022h2v1h-2zM10%2023h2v1h-2zM9%2024h1v1h-1zM8%2025h1v11h-1zM51%2026h4v1h-4zM55%2027h1v16h-1zM9%2036h1v1h-1zM10%2037h2v1h-2zM12%2038h2v1h-2zM14%2039h2v1h-2zM16%2040h2v1h-2zM18%2041h2v1h-2zM20%2042h2v1h-2zM22%2043h2v1h-2zM54%2043h1v1h-1zM24%2044h2v1h-2zM52%2044h2v1h-2zM26%2045h2v1h-2zM50%2045h2v1h-2zM28%2046h2v1h-2zM48%2046h2v1h-2zM30%2047h2v1h-2zM46%2047h2v1h-2zM32%2048h2v1h-2zM44%2048h2v1h-2zM34%2049h2v1h-2zM42%2049h2v1h-2zM36%2050h2v1h-2zM40%2050h2v1h-2zM38%2051h2v1h-2z'/%3e%3cpath%20fill='%231c1b1a'%20d='M10%2030h2v4h-2zM15%2032h1v4h-1zM16%2033h1v4h-1zM20%2035h2v4h-2zM25%2037h1v4h-1zM26%2038h1v4h-1zM30%2040h2v4h-2zM35%2042h1v4h-1zM36%2043h1v4h-1z'/%3e%3cpath%20fill='%23343331'%20d='M34%2017h1v1h-1zM32%2018h2v1h-2zM30%2019h2v1h-2zM28%2020h2v1h-2zM26%2021h2v1h-2zM24%2022h2v1h-2zM22%2023h2v1h-2zM20%2024h2v1h-2zM40%2024h2v1h-2zM19%2025h1v1h-1zM38%2025h2v1h-2zM36%2026h2v1h-2zM34%2027h2v1h-2zM54%2027h1v1h-1zM32%2028h2v1h-2zM52%2028h2v1h-2zM30%2029h2v1h-2zM50%2029h2v1h-2zM29%2030h1v1h-1zM48%2030h2v1h-2zM46%2031h2v1h-2zM44%2032h2v1h-2zM42%2033h2v1h-2zM40%2034h2v1h-2zM39%2035h1v1h-1z'/%3e%3cpath%20fill='%23e47da8'%20d='M32%2021h2v2h-2zM28%2023h2v2h-2zM24%2025h2v2h-2zM20%2027h2v2h-2zM38%2028h2v2h-2zM34%2030h2v2h-2zM52%2031h2v2h-2zM30%2032h2v2h-2zM48%2033h2v2h-2zM44%2035h2v2h-2zM40%2037h2v2h-2z'/%3e%3cpath%20fill='%23000000'%20fill-opacity='0.353'%20d='M11%2038h1v1h-1zM12%2039h2v1h-2zM14%2040h2v1h-2zM16%2041h2v1h-2zM18%2042h2v1h-2zM20%2043h2v1h-2zM22%2044h2v1h-2zM24%2045h2v1h-2zM52%2045h1v1h-1zM26%2046h2v1h-2zM50%2046h2v1h-2zM28%2047h2v1h-2zM48%2047h2v1h-2zM30%2048h2v1h-2zM46%2048h2v1h-2zM32%2049h2v1h-2zM44%2049h2v1h-2zM34%2050h2v1h-2zM42%2050h2v1h-2zM36%2051h2v1h-2zM40%2051h2v1h-2zM38%2052h2v1h-2z'/%3e%3cpath%20fill='%23cecdc3'%20d='M43%2014h6v2h-6zM43%2016h2v14h-2z'/%3e%3cpath%20fill='%23b7b5ac'%20d='M42%2016h1v14h-1zM45%2017h2v13h-2z'/%3e%3cpath%20fill='%23878580'%20d='M49%2016h1v12h-1zM47%2017h2v12h-2z'/%3e%3cpath%20fill='%23f4a4c2'%20d='M32%2020h2v1h-2zM28%2022h2v1h-2zM24%2024h2v1h-2zM20%2026h2v1h-2zM38%2027h2v1h-2zM34%2029h2v1h-2zM52%2030h2v1h-2zM30%2031h2v1h-2zM48%2032h2v1h-2zM44%2034h2v1h-2zM40%2036h2v1h-2z'/%3e%3cpath%20fill='%23e6e4d9'%20d='M42%2015h1v1h-1zM49%2015h1v1h-1zM45%2016h4v1h-4z'/%3e%3c/svg%3e`,Un=`/assets/icon-THdxja9j.svg`,Wn=`data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2064%2064'%20shape-rendering='crispEdges'%3e%3cpath%20fill='%234385be'%20d='M17%2017h1v25h-1zM18%2018h2v25h-2zM20%2019h2v2h-2zM22%2020h2v25h-2zM24%2021h2v25h-2zM26%2022h2v2h-2zM28%2023h2v25h-2zM30%2024h2v25h-2zM32%2025h2v2h-2zM34%2026h2v25h-2zM36%2027h1v25h-1z'/%3e%3cpath%20fill='%23205ea6'%20d='M21%2021h1v23h-1zM46%2022h1v25h-1zM44%2023h2v25h-2zM27%2024h1v23h-1zM42%2024h2v25h-2zM40%2025h2v25h-2zM38%2026h2v25h-2zM33%2027h1v23h-1zM37%2027h1v25h-1z'/%3e%3cpath%20fill='%2366a0c8'%20d='M24%2013h2v7h-2zM22%2014h2v5h-2zM20%2015h2v3h-2zM30%2015h2v8h-2zM18%2016h2v1h-2zM32%2016h2v8h-2zM26%2018h4v3h-4zM38%2018h2v7h-2zM40%2019h2v5h-2zM42%2020h2v3h-2zM20%2021h1v23h-1zM28%2021h2v1h-2zM44%2021h2v1h-2zM34%2022h4v3h-4zM26%2024h1v23h-1zM36%2025h2v1h-2zM32%2027h1v23h-1z'/%3e%3cpath%20fill='%230a0a0a'%20d='M26%209h4v1h-4zM25%2010h1v3h-1zM30%2010h2v1h-2zM32%2011h2v1h-2zM24%2012h1v1h-1zM34%2012h2v1h-2zM22%2013h2v1h-2zM36%2013h2v1h-2zM20%2014h2v1h-2zM38%2014h1v4h-1zM18%2015h2v1h-2zM17%2016h1v1h-1zM16%2017h1v25h-1zM39%2017h1v1h-1zM40%2018h2v1h-2zM42%2019h2v1h-2zM44%2020h2v1h-2zM46%2021h1v1h-1zM47%2022h1v25h-1zM17%2042h1v1h-1zM18%2043h1v3h-1zM19%2046h2v1h-2zM23%2046h3v1h-3zM21%2047h2v1h-2zM26%2047h2v1h-2zM46%2047h1v1h-1zM28%2048h2v1h-2zM45%2048h1v3h-1zM30%2049h2v1h-2zM32%2050h2v1h-2zM33%2051h1v2h-1zM40%2051h1v2h-1zM43%2051h2v1h-2zM41%2052h2v1h-2zM34%2053h1v1h-1zM39%2053h1v1h-1zM35%2054h4v1h-4z'/%3e%3cpath%20fill='%23b7b5ac'%20d='M26%2011h2v7h-2zM28%2012h2v2h-2zM30%2013h2v2h-2zM32%2014h2v2h-2zM34%2015h2v7h-2z'/%3e%3cpath%20fill='%2392bfdb'%20d='M18%2017h2v1h-2zM20%2018h2v1h-2zM22%2019h2v1h-2zM24%2020h2v1h-2zM26%2021h2v1h-2zM28%2022h2v1h-2zM44%2022h2v1h-2zM30%2023h2v1h-2zM42%2023h2v1h-2zM32%2024h2v1h-2zM40%2024h2v1h-2zM34%2025h2v1h-2zM38%2025h2v1h-2zM36%2026h2v1h-2z'/%3e%3cpath%20fill='%23878580'%20d='M28%2014h2v4h-2zM36%2015h2v7h-2z'/%3e%3cpath%20fill='%23cecdc3'%20d='M26%2010h4v1h-4zM28%2011h4v1h-4zM30%2012h4v1h-4zM32%2013h4v1h-4zM34%2014h4v1h-4z'/%3e%3cpath%20fill='%23403e3c'%20d='M19%2043h1v3h-1zM21%2044h1v3h-1zM22%2045h1v2h-1zM42%2049h1v3h-1zM41%2050h1v2h-1zM34%2051h1v2h-1zM36%2052h2v2h-2z'/%3e%3cpath%20fill='%23343331'%20d='M23%2045h1v1h-1zM44%2048h1v3h-1zM43%2049h1v2h-1zM38%2051h2v2h-2zM38%2053h1v1h-1z'/%3e%3cpath%20fill='%23000000'%20fill-opacity='0.353'%20d='M21%2048h1v1h-1zM41%2053h2v1h-2zM39%2054h1v1h-1zM36%2055h3v1h-3z'/%3e%3cpath%20fill='%23575653'%20d='M20%2044h1v2h-1zM40%2050h1v1h-1zM35%2051h1v3h-1z'/%3e%3c/svg%3e`,Gn=e(n(),1);function Kn(e){let t=Gn.unstable_scheduleCallback(4,e);return()=>Gn.unstable_cancelCallback(t)}var qn=X.createContext(ke({scheduleTask:Kn,defaultIdleTTL:400})),Jn=new WeakMap,Yn=0,Xn=new Set;function Zn(e){Yn++;try{return e()}finally{Yn--}}function Qn(e){if(Yn===0)return e();Xn.size===0&&queueMicrotask($n),Xn.add(e)}function $n(){for(let e of Xn)Xn.delete(e),e()}function er(e,t){let n=Jn.get(e);n===void 0&&(n=new WeakMap,Jn.set(e,n));let r=n.get(t);if(r!==void 0)return r;let i=0,a,o={subscribe(n){i++;let r=e.subscribe(t,()=>Qn(n));return()=>{i--,Xn.delete(n),r()}},snapshot(){return Zn(()=>e.get(t))},getServerSnapshot(){return(i===0||a===void 0)&&(a={value:Zn(()=>xe(t,e))}),a.value}};return n.set(t,o),o}function tr(e,t){let n=er(e,t);return X.useEffect($n),X.useSyncExternalStore(n.subscribe,n.snapshot,n.getServerSnapshot)}function nr(e,t,n){let r=er(e,t),i=X.useMemo(()=>{let e;return t=>(e!==void 0&&Object.is(e.source,t)||(e={source:t,value:n(t)}),e.value)},[n]);return X.useEffect($n),X.useSyncExternalStore(r.subscribe,()=>i(r.snapshot()),()=>i(r.getServerSnapshot()))}var rr=(e,t)=>{let n=X.useContext(qn);return t?nr(n,e,t):tr(n,e)};function ir(e,t,n){return n?.mode===`promise`||n?.mode===`promiseExit`?X.useCallback(r=>{e.set(t,r);let i=gt(Me(e,t,{suspendOnWaiting:!0}));return n.mode===`promise`?i.then(ar):i},[e,t,n.mode]):X.useCallback(n=>{e.set(t,typeof n==`function`?n(e.get(t)):n)},[e,t])}var ar=e=>{if(Et(e))return e.value;throw se(e.cause)},or=(e,t)=>{let n=X.useContext(qn);return[tr(n,e),ir(n,e,t)]},sr={suspendOnWaiting:new WeakMap,default:new WeakMap};function cr(e,t,n){let r=n?sr.suspendOnWaiting:sr.default,i=r.get(e);i===void 0&&(i=new WeakMap,r.set(e,i));let a=i.get(t);return a===void 0&&(a=new Promise(r=>{let a=e.subscribe(t,e=>{e._tag===`Initial`||n&&e.waiting||(setTimeout(a,1e3),r(),i.delete(t))})}),i.set(t,a)),a}function lr(e,t,n){let r=tr(e,t);if(r._tag===`Initial`||n&&r.waiting)throw cr(e,t,n);return r}var ur=(e,t)=>{let n=lr(X.useContext(qn),e,t?.suspendOnWaiting??!1);if(n._tag===`Failure`&&!t?.includeFailure)throw se(n.cause);return n};function dr({controlled:e,default:t,name:n,state:r=`value`}){let{current:i}=X.useRef(e!==void 0),[a,o]=X.useState(()=>t);return[i&&e!==void 0?e:a,X.useCallback(e=>{i||o(e)},[])]}function fr(e){let t=X.useRef(!0);t.current&&(t.current=!1,e())}function pr(e){let t=kt(mr,e).current;return t.next=e,Y(t.effect),t}function mr(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var hr={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},gr={...hr,position:`fixed`,margin:0,top:0,left:0},_r={...hr,position:`absolute`},vr=[],yr=void 0;function br(){return yr}function xr(e){vr.push(e)}function Sr(e){let t=(t,n)=>{let r=kt(wr).current,i;try{yr=r;for(let e of vr)e.before(r);i=e(t,n);for(let e of vr)e.after(r);r.didInitialize=!0}finally{yr=void 0}return i};return t.displayName=e.displayName||e.name,t}function Cr(e){return X.forwardRef(Sr(e))}function wr(){return{didInitialize:!1}}var Tr=It(),Er=dn(),Dr=sn(19)?Ar:jr;function Or(e,t,n,r,i){return Dr(e,t,n,r,i)}function kr(e,t,n,r,i){let a=X.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,Tr.useSyncExternalStore)(e.subscribe,a,a)}xr({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){let r=e.syncHooks[n],i=r.selector(r.store.state,r.a1,r.a2,r.a3);Object.is(r.value,i)||(t=!0,r.value=i)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{let n=new Set;for(let t of e.syncHooks)n.add(t.store);let r=[];for(let e of n)r.push(e.subscribe(t));return()=>{for(let e of r)e()}}),(0,Tr.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function Ar(e,t,n,r,i){let a=br();if(!a)return kr(e,t,n,r,i);let o=a.syncIndex;a.syncIndex+=1;let s;return a.didInitialize?(s=a.syncHooks[o],s.store===e&&s.selector===t&&Object.is(s.a1,n)&&Object.is(s.a2,r)&&Object.is(s.a3,i)||(s.store!==e&&(a.didChangeStore=!0),s.store=e,s.selector=t,s.a1=n,s.a2=r,s.a3=i,s.value=t(e.getSnapshot(),n,r,i))):(s={store:e,selector:t,a1:n,a2:r,a3:i,value:t(e.getSnapshot(),n,r,i)},a.syncHooks.push(s)),s.value}function jr(e,t,n,r,i){return(0,Er.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var Mr=class{static create(e){return new this(e)}constructor(e){this.state=e,this.listeners=new Set,this.updateTick=0}subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.state;setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;let t=this.updateTick;for(let n of this.listeners){if(t!==this.updateTick)return;n(e)}}update(e){for(let t in e)if(!Object.is(this.state[t],e[t])){this.setState({...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||this.setState({...this.state,[e]:t})}notifyAll(){let e={...this.state};this.setState(e)}use(e,t,n,r){return Or(this,e,t,n,r)}},Nr=class extends Mr{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){X.useDebugValue(e);let n=this;Y(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;Y(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this,n=Object.values(e);Y(()=>{t.update(e)},[t,...n])}useControlledProp(e,t){X.useDebugValue(e);let n=this,r=t!==void 0;Y(()=>{r&&!Object.is(n.state[e],t)&&n.setState({...n.state,[e]:t})},[n,e,t,r])}select(e,t,n,r){let i=this.selectors[e];return i(this.state,t,n,r)}useState(e,t,n,r){return X.useDebugValue(e),Or(this,this.selectors[e],t,n,r)}useContextCallback(e,t){X.useDebugValue(e);let n=J(t??un);this.context[e]=n}useStateSetter(e){let t=X.useRef(void 0);return t.current===void 0&&(t.current=t=>{this.set(e,t)}),t.current}observe(e,t){let n;n=typeof e==`function`?e:this.selectors[e];let r=n(this.state);return t(r,r,this),this.subscribe(e=>{let i=n(e);if(!Object.is(r,i)){let e=r;r=i,t(i,e,this)}})}};function Pr(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Fr(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function Ir(e){X.useEffect(e,Qt)}var Lr=0,Rr=class e{static create(){return new e}currentId=Lr;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Lr,t()},e)}isStarted(){return this.currentId!==Lr}clear=()=>{this.currentId!==Lr&&(clearTimeout(this.currentId),this.currentId=Lr)};disposeEffect=()=>this.clear};function zr(){let e=kt(Rr.create).current;return Ir(e.disposeEffect),e}function Br(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:Vr,platform:Hr,maxTouchPoints:Ur}=Br(),Wr=Vr.toLowerCase(),Gr=Hr.toLowerCase(),Kr=/^i(os$|p)/.test(Gr)||Gr===`macintel`&&Ur>1,qr=`android`,Jr=Gr===qr||Wr.includes(qr),Yr=!Kr&&Gr.startsWith(`mac`);Gr.startsWith(`win`),!Jr&&/^(linux|chrome os)/.test(Gr);var Xr=Yr||Kr,Zr=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`),Qr=!Zr&&Wr.includes(`firefox`);!Zr&&Wr.includes(`chrom`);var $r=Xr,ei=/jsdom|happydom/.test(Wr),ti=null;globalThis.requestAnimationFrame;var ni=new class{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=e=>{this.isScheduled=!1;let t=this.callbacks,n=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,n>0)for(let n=0;n<t.length;n+=1)t[n]?.(e)};request(e){let t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,this.isScheduled||=(requestAnimationFrame(this.tick),!0),t}cancel(e){let t=e-this.startId;t<0||t>=this.callbacks.length||this.callbacks[t]!==null&&(this.callbacks[t]=null,--this.callbacksCount)}},ri=class e{static create(){return new e}static request(e){return ni.request(e)}static cancel(e){return ni.cancel(e)}currentId=ti;request(e){this.cancel(),this.currentId=ni.request(()=>{this.currentId=ti,e()})}cancel=()=>{this.currentId!==ti&&(ni.cancel(this.currentId),this.currentId=ti)};disposeEffect=()=>this.cancel};function ii(){let e=kt(ri.create).current;return Ir(e.disposeEffect),e}var ai=X.forwardRef(function(e,t){let[n,r]=X.useState();Y(()=>{$r&&Zr&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,Z.jsx)(`span`,{...e,ref:t,style:gr,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})});function oi(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Q(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&Ot(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function si(e,t){let n=e;for(;n;){if(Mt(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(Ot(n)?n.host:null)}return null}function ci(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var li=`data-base-ui-focusable`,ui=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,di=`ArrowLeft`,fi=`ArrowRight`,pi=`ArrowUp`,mi=`ArrowDown`,hi=`data-starting-style`,gi=`data-ending-style`,_i={[hi]:``},vi={[gi]:``},yi={transitionStatus(e){return e===`starting`?_i:e===`ending`?vi:null}},bi=`data-open`,xi=`data-closed`,Si=`data-anchor-hidden`,Ci=`data-popup-open`,wi=`data-pressed`,Ti={[Ci]:``},Ei={[Ci]:``,[wi]:``},Di={[bi]:``},Oi={[xi]:``},ki={[Si]:``},Ai={open(e){return e?Ti:null}},ji={open(e){return e?Ei:null}},Mi={open(e){return e?Di:Oi},anchorHidden(e){return e?ki:null}},Ni={...Mi,...yi},Pi=`data-trigger-disabled`;function Fi(e,t){if(!Mt(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(Pi);for(let[,e]of t.entries())if(Q(e,n))return!e.hasAttribute(Pi);return!1}function Ii(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Li(e){return e.matches(`html,body`)}function Ri(e){return Ft(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function zi(e){return si(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${ui}`)!=null}function Bi(e){return e?e.getAttribute(`role`)===`combobox`&&Ri(e):!1}function Vi(e){if(!e||ei)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Hi(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Ui(e){e.preventDefault(),e.stopPropagation()}function Wi(e){return`nativeEvent`in e}function Gi(e){return e.pointerType===``&&e.isTrusted?!0:Jr&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function Ki(e){return ei?!1:!Jr&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(Jr||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function qi(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function Ji(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var Yi=Math.min,Xi=Math.max,Zi=Math.round,Qi=Math.floor,$i=e=>({x:e,y:e}),ea={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function ta(e,t,n){return Xi(e,Yi(t,n))}function na(e,t){return typeof e==`function`?e(t):e}function ra(e){return e.split(`-`)[0]}function ia(e){return e.split(`-`)[1]}function aa(e){return e===`x`?`y`:`x`}function oa(e){return e===`y`?`height`:`width`}function sa(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function ca(e){return aa(sa(e))}function la(e,t,n){n===void 0&&(n=!1);let r=ia(e),i=ca(e),a=oa(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=va(o)),[o,va(o)]}function ua(e){let t=va(e);return[da(e),t,da(t)]}function da(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var fa=[`left`,`right`],pa=[`right`,`left`],ma=[`top`,`bottom`],ha=[`bottom`,`top`];function ga(e,t,n){switch(e){case`top`:case`bottom`:return n?t?pa:fa:t?fa:pa;case`left`:case`right`:return t?ma:ha;default:return[]}}function _a(e,t,n,r){let i=ia(e),a=ga(ra(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(da)))),a}function va(e){let t=ra(e);return ea[t]+e.slice(t.length)}function ya(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function ba(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:ya(e)}function xa(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Sa(e,t,n){return Math.floor(e/t)!==n}function Ca(e,t){return t<0||t>=e.length}function wa(e,t){return Da(e.current,{disabledIndices:t})}function Ta(e,t){return Da(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function Ea(e,t,n){let{decrement:r,loopFocus:i,allowEscape:a,disabledIndices:o,minIndex:s,maxIndex:c}=n,l=()=>Da(e,{startingIndex:t,decrement:r,disabledIndices:o}),u,d=!1;if(!i)u=r?Math.max(s,l()):Math.min(c,l());else if(r?t<=s:t>=c){let n=r?-1:e.length;a&&t!==n?u=-1:(u=r?c:s,d=!0)}else u=l();return{index:Ca(e,u)?-1:u,wrapped:d}}function Da(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:r,amount:i=1}={}){let a=t;do a+=n?-i:i;while(a>=0&&a<=e.length-1&&ka(e,a,r));return a}function Oa(e,{event:t,orientation:n,loopFocus:r,onLoop:i,rtl:a,cols:o,disabledIndices:s,minIndex:c,maxIndex:l,prevIndex:u,stopEvent:d=!1}){let f=u,p;if(t.key===`ArrowUp`?p=`up`:t.key===`ArrowDown`&&(p=`down`),p){let n=[],a=[],m=!1,h=0;{let t=null,r=-1;e.forEach((e,i)=>{if(e==null)return;h+=1;let o=si(e,`[role="row"]`);o&&(m=!0),(o!==t||r===-1)&&(t=o,r+=1,n[r]=[]),n[r].push(i),a[i]=r})}let g=!1,_=0;if(m)for(let e of n){let t=e.length;t>_&&(_=t),t!==o&&(g=!0)}let v=g&&h<e.length,y=_||o,b=o=>{if(!g||u===-1)return;let c=a[u];if(c==null)return;let l=n[c].indexOf(u),d=o===`up`?-1:1;for(let o=c+d,f=0;f<n.length;f+=1,o+=d){if(o<0||o>=n.length){if(!r||v)return;if(o=o<0?n.length-1:0,i){let e=Math.min(l,n[o].length-1),r=i(t,u,n[o][e]??n[o][0]);o=a[r]??o}}let c=n[o];for(let t=Math.min(l,c.length-1);t>=0;--t){let n=c[t];if(!ka(e,n,s))return n}}},x=t=>{if(!v||u===-1)return;let n=u%y,i=t===`up`?-y:y,a=l-l%y,o=Qi(l/y)+1;for(let t=u-n+i,c=0;c<o;c+=1,t+=i){if(t<0||t>l){if(!r)return;t=t<0?a:0}let i=Math.min(t+y-1,l);for(let r=Math.min(t+n,i);r>=t;--r)if(!ka(e,r,s))return r}};d&&Ui(t);let S=b(p)??x(p);if(S!==void 0)f=S;else if(u===-1)f=p===`up`?l:c;else if(f=Da(e,{startingIndex:u,amount:y,decrement:p===`up`,disabledIndices:s}),r){if(p===`up`&&(u-y<c||f<0)){let e=u%y,n=l%y,r=l-(n-e);f=n===e?l:n>e?r:r-y,i&&(f=i(t,u,f))}p===`down`&&u+y>l&&(f=Da(e,{startingIndex:u%y-y,amount:y,disabledIndices:s}),i&&(f=i(t,u,f)))}Ca(e,f)&&(f=u)}if(n===`both`){let n=Qi(u/o);t.key===(a?`ArrowLeft`:`ArrowRight`)&&(d&&Ui(t),u%o===o-1?r&&(f=Da(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):(f=Da(e,{startingIndex:u,disabledIndices:s}),r&&Sa(f,o,n)&&(f=Da(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f)))),Sa(f,o,n)&&(f=u)),t.key===(a?`ArrowRight`:`ArrowLeft`)&&(d&&Ui(t),u%o===0?r&&(f=Da(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f))):(f=Da(e,{startingIndex:u,decrement:!0,disabledIndices:s}),r&&Sa(f,o,n)&&(f=Da(e,{startingIndex:u+(o-u%o),decrement:!0,disabledIndices:s}),i&&(f=i(t,u,f)))),Sa(f,o,n)&&(f=u));let c=Qi(l/o)===n;Ca(e,f)&&(r&&c?(f=t.key===(a?`ArrowRight`:`ArrowLeft`)?l:Da(e,{startingIndex:u-u%o-1,disabledIndices:s}),i&&(f=i(t,u,f))):f=u)}return f}function ka(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!ja(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function Aa(e){return e.visibility===`hidden`||e.visibility===`collapse`}function ja(e,t=e?Wt(e):null){return!e||!e.isConnected||!t||Aa(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var Ma=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function Na(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return Ot(n)?n.host:null}function Pa(e){for(let t of Array.from(e.children))if(an(t)===`summary`)return t;return null}function Fa(e,t){let n=Pa(t);return!!n&&(e===n||Q(n,e))}function Ia(e){let t=e?an(e):``;return e!=null&&e.matches(Ma)&&(t!==`summary`||e.parentElement!=null&&an(e.parentElement)===`details`&&Pa(e.parentElement)===e)&&(t!==`details`||Pa(e)==null)&&(t!==`input`||e.type!==`hidden`)}function La(e){if(!Ia(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=Na(t)){let n=t!==e,r=an(t)===`slot`;if(t.hasAttribute(`inert`)||n&&an(t)===`details`&&!t.open&&!Fa(e,t)||t.hasAttribute(`hidden`)||!r&&!Ra(t,n))return!1}return!0}function Ra(e,t){let n=Wt(e);return t?n.display!==`none`:ja(e,n)}function za(e){let t=e.tabIndex;if(t<0){let t=an(e);if(t===`details`||t===`audio`||t===`video`||Ft(e)&&e.isContentEditable)return 0}return t}function Ba(e){if(an(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function Va(e,t){let n=Ba(e);if(!n)return!0;let r=t.find(e=>{let t=Ba(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=Ba(e);return t?.name===n.name&&t.form===n.form})===n}function Ha(e){if(Ft(e)&&an(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return Ft(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function Ua(e,t){Ha(e).forEach(e=>{Ia(e)&&t.push(e),Ua(e,t)})}function Wa(e,t,n){Ha(e).forEach(e=>{Ft(e)&&e.matches(t)&&n.push(e),Wa(e,t,n)})}function Ga(e){return La(e)&&za(e)>=0}function Ka(e){let t=[];return Ua(e,t),t.filter(La)}function qa(e){let t=Ka(e);return t.filter(e=>za(e)>=0&&Va(e,t))}function Ja(e,t){let n=qa(e),r=n.length;if(r===0)return;let i=oi(Mn(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Ya(e){return Ja(Mn(e).body,1)||e}function Xa(e){return Ja(Mn(e).body,-1)||e}function Za(e,t,n){if(!e)return null;let r=[];Ua(Mn(e).body,r);let i=r.indexOf(e);if(i===-1)return null;let a=r.filter(La);for(let e=1;e<r.length;e+=1){let o=r[(i+t*e+r.length)%r.length];if(!Q(n,o)&&Ga(o)&&Va(o,a))return o}return r[i]}function Qa(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Q(n,r)}function $a(e){qa(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function eo(e){let t=[];Wa(e,`[data-tabindex]`,t),t.forEach(e=>{let t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute(`tabindex`,t):e.removeAttribute(`tabindex`)})}function to(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...to(e,t.id,n)])}function no(e,t){let n=[],r=e.find(e=>e.id===t)?.parentId;for(;r;){let t=e.find(e=>e.id===r);r=t?.parentId,t&&(n=n.concat(t))}return n}function $(e,t,n,r){let i=!1,a=!1,o=r??$t;return{reason:e,event:t??new Event(`base-ui`),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}function ro(e,t,n){let r=n??$t;return{reason:e,event:t??new Event(`base-ui`),...r}}var io=`none`,ao=`trigger-press`,oo=`trigger-hover`,so=`trigger-focus`,co=`outside-press`,lo=`item-press`,uo=`close-press`,fo=`clear-press`,po=`input-change`,mo=`input-clear`,ho=`input-press`,go=`focus-out`,_o=`escape-key`,vo=`list-navigation`,yo=`keyboard`,bo=`pointer`,xo=`cancel-open`,So=`sibling-open`,Co=`imperative-action`;function wo(e){return`data-base-ui-${e}`}var To=0;function Eo(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(To);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),un;let o=requestAnimationFrame(a);return To=o,()=>{To===o&&(cancelAnimationFrame(o),To=0)}}var Do=`data-base-ui-inert`,Oo=new WeakMap,ko=new WeakSet,Ao=new WeakMap,jo=0;function Mo(e){return e?Ot(e)?e.host:Mo(e.parentNode):null}var No=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Mo(t);return e.contains(n)?n:null}).filter(e=>e!=null),Po=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},Fo=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{an(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function Io(e,t,n,{mark:r=!0}){let i=No(t,e),a=r?Fo(t,Po(i),new Set(i)):[],o=[],s=[];if(n){let e=No(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);Fo(t,Po(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(Oo.get(e)||0)+1;Oo.set(e,r),o.push(e),r===1&&n&&ko.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(Ao.get(e)||0)+1;Ao.set(e,t),s.push(e),t===1&&e.setAttribute(Do,``)}),jo+=1,()=>{o.forEach(e=>{let t=(Oo.get(e)||0)-1;Oo.set(e,t),t||(ko.has(e)||e.removeAttribute(`aria-hidden`),ko.delete(e))}),r&&s.forEach(e=>{let t=(Ao.get(e)||0)-1;Ao.set(e,t),t||e.removeAttribute(Do)}),--jo,jo||(Oo=new WeakMap,ko=new WeakSet,Ao=new WeakMap)}}function Lo(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=Mn(e[0]).body;return Io(e,i,n,{mark:r})}function Ro(){let[,e]=X.useState({});return X.useCallback(()=>{e({})},[])}var zo=0;function Bo(e,t=`mui`){let n=X.useRef(void 0),r=Ro(),i=e??n.current;return X.useEffect(()=>{n.current??(zo+=1,n.current=`${t}-${zo}`,e??r())},[e,t,r]),i}var Vo=_n.useId;function Ho(e,t){if(Vo!==void 0){let n=Vo();return e??(t?`${t}-${n}`:n)}return Bo(e,t)}var Uo={style:{transition:`none`}},Wo={fallbackAxisSide:`none`},Go={fallbackAxisSide:`end`},Ko={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},qo=X.createContext(null),Jo=()=>X.useContext(qo),Yo=wo(`portal`);function Xo(e={}){let{ref:t,container:n,componentProps:r=$t,elementProps:i}=e,a=Ho(),o=Jo()?.portalNode,[s,c]=X.useState(null),[l,u]=X.useState(null),d=J(e=>{e!==null&&u(e)}),f=X.useRef(null);Y(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(Ut(n)?n:n.current))??o??document.body;e==null?f.current&&(f.current=null,u(null),c(null)):f.current!==e&&(f.current=e,u(null),c(e))},[n,o]);let p=on(`div`,r,{ref:[t,d],props:[{id:a,[Yo]:``},i]}),m=s&&p?Nn.createPortal(p,s):null;return{node:l,nodeId:X.isValidElement(p)?p.props.id:void 0,subtree:m}}var Zo=X.forwardRef(function(e,t){let{render:n,className:r,style:i,children:a,container:o,portalOwnerRole:s,...c}=e,{node:l,nodeId:u,subtree:d}=Xo({container:o,ref:t,componentProps:e,elementProps:c}),f=X.useRef(null),p=X.useRef(null),m=X.useRef(null),h=X.useRef(null),[g,_]=X.useState(null),v=X.useRef(!1),y=g?.modal,b=g?.open,x=!!g&&!g.modal&&g.open&&!!l;X.useEffect(()=>{if(!l||y)return;function e(e){l&&e.relatedTarget&&Qa(e)&&(e.type===`focusin`?v.current&&=(eo(l),!1):($a(l),v.current=!0))}return Fr(Pr(l,`focusin`,e,!0),Pr(l,`focusout`,e,!0))},[l,y]),Y(()=>{l&&b===!0&&v.current&&(eo(l),v.current=!1)},[b,l]);let S=X.useMemo(()=>({beforeOutsideRef:f,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:l,setFocusManagerState:_}),[l]);return(0,Z.jsxs)(X.Fragment,{children:[d,(0,Z.jsxs)(qo.Provider,{value:S,children:[x&&l&&(0,Z.jsx)(ai,{"data-type":`outside`,ref:f,onFocus:e=>{Qa(e,l)?m.current?.focus():Xa(g?g.domReference:null)?.focus()}}),x&&l&&(0,Z.jsx)(`span`,{role:s,"aria-owns":u,style:Ko}),l&&Nn.createPortal(a,l),x&&l&&(0,Z.jsx)(ai,{"data-type":`outside`,ref:p,onFocus:e=>{Qa(e,l)?h.current?.focus():(Ya(g?g.domReference:null)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,$(`focus-out`,e.nativeEvent)))}})]})]})});function Qo(){let e=new Map;return{emit(t,n){e.get(t)?.forEach(e=>e(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)}}}var $o=class{nodesRef={current:[]};events=Qo();addNode(e){this.nodesRef.current.push(e)}removeNode(e){let t=this.nodesRef.current.findIndex(t=>t===e);t!==-1&&this.nodesRef.current.splice(t,1)}},es=X.createContext(null),ts=X.createContext(null),ns=()=>X.useContext(es)?.id||null,rs=e=>{let t=X.useContext(ts);return e??t};function is(e){let t=Ho(),n=rs(e),r=ns();return Y(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function as(e){let{children:t,id:n}=e,r=ns();return(0,Z.jsx)(es.Provider,{value:X.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function os(e){let{children:t,externalTree:n}=e,r=kt(()=>n??new $o).current;return(0,Z.jsx)(ts.Provider,{value:r,children:t})}function ss(e){return e==null?e:`current`in e?e.current:e}function cs(e,t){let n=Bt(ci(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(Gi(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var ls=20,us=[];function ds(){us=us.filter(e=>e.deref()?.isConnected)}function fs(e){ds(),e&&an(e)!==`body`&&(us.push(new WeakRef(e)),us.length>ls&&(us=us.slice(-20)))}function ps(){return ds(),us[us.length-1]?.deref()}function ms(e){return e?Ga(e)?e:qa(e)[0]||e:null}function hs(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=Ka(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return Ga(e)||e.hasAttribute(`data-tabindex`)&&!t.startsWith(`-`)}),n=e.getAttribute(`tabindex`);t.length===0?n!==`0`&&(e.setAttribute(`tabindex`,`0`),e.setAttribute(`data-tabindex`,`0`)):(n!==`-1`||e.hasAttribute(`data-tabindex`)&&e.getAttribute(`data-tabindex`)!==`-1`)&&(e.setAttribute(`tabindex`,`-1`),e.setAttribute(`data-tabindex`,`-1`))}function gs(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,explicitReturnFocus:o,restoreFocus:s=!1,modal:c=!0,closeOnFocusOut:l=!0,openInteractionType:u=``,nextFocusableElement:d,previousFocusableElement:f,beforeContentFocusGuardRef:p,externalTree:m,getInsideElements:h}=e,g=t.useState(`open`),_=t.useState(`domReferenceElement`),v=t.useState(`floatingElement`),{events:y,dataRef:b}=t.context,x=J(()=>b.current.floatingContext?.nodeId),S=i===!1,C=Bi(_)&&S,w=pr(i),T=pr(a),E=pr(o),D=pr(u),O=pr(g),k=rs(m),A=Jo(),j=X.useRef(!1),M=X.useRef(!1),N=X.useRef(!1),P=X.useRef(null),F=X.useRef(``),I=X.useRef(``),L=X.useRef(null),R=X.useRef(null),z=tn(L,p,A?.beforeInsideRef),ee=tn(R,A?.afterInsideRef),te=zr(),B=zr(),ne=ii(),V=A!=null,H=Hi(v),U=J((e=H)=>e?qa(e):[]),re=J(()=>h?.().filter(e=>e!=null)??[]);X.useEffect(()=>{if(r||!c)return;function e(e){e.key===`Tab`&&Q(H,oi(Mn(H)))&&U().length===0&&!C&&Ui(e)}return Pr(Mn(H),`keydown`,e)},[r,H,c,C,U]),X.useEffect(()=>{if(r||!g)return;let e=Mn(H);function t(){N.current=!1}function n(e){let t=ci(e),n=re(),r=Q(v,t)||Q(_,t)||Q(A?.portalNode,t)||n.some(e=>e===t||Q(e,t));N.current=!r,I.current=e.pointerType||`keyboard`,si(t,`[data-base-ui-click-trigger]`)&&(M.current=!0,B.start(0,()=>{M.current=!1}))}function i(){I.current=`keyboard`}return Fr(Pr(e,`pointerdown`,n,!0),Pr(e,`pointerup`,t,!0),Pr(e,`pointercancel`,t,!0),Pr(e,`keydown`,i,!0),t)},[r,v,_,H,g,A,B,re]),X.useEffect(()=>{if(r||!l)return;let e=Mn(H);function n(){M.current=!0,B.start(0,()=>{M.current=!1})}function i(e){let t=ci(e);Ga(t)&&(P.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=ci(n);c&&r==null&&a!=null&&Q(v,a)&&fs(a),queueMicrotask(()=>{let o=x(),l=t.context.triggerElements,u=re(),p=r?.hasAttribute(wo(`focus-guard`))&&[L.current,R.current,A?.beforeInsideRef.current,A?.afterInsideRef.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,ss(f),ss(d)].includes(r),m=!(Q(_,r)||Q(v,r)||Q(r,v)||Q(A?.portalNode,r)||u.some(e=>e===r||Q(e,r))||l.hasMatchingElement(e=>Q(e,r))||p||k&&(to(k.nodesRef.current,o).find(e=>Q(e.context?.elements.floating,r)||Q(e.context?.elements.domReference,r))||no(k.nodesRef.current,o).find(e=>[e.context?.elements.floating,Hi(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===_&&H&&hs(H),s&&i!==_&&!ja(a)&&oi(e)===e.body){if(Ft(H)&&(H.focus(),s===`popup`)){ne.request(()=>{H.focus()});return}let e=U(),t=P.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||H;Ft(n)&&n.focus()}b.current.insideReactTree?b.current.insideReactTree=!1:(C||!c)&&r&&m&&!M.current&&(C||r!==ps())&&(j.current=!0,t.setOpen(!1,$(go,n)))})}function o(){N.current||(b.current.insideReactTree=!0,te.start(0,()=>{b.current.insideReactTree=!1}))}let u=Ft(_)?_:null;if(v||u)return Fr(u&&Pr(u,`focusout`,a),u&&Pr(u,`pointerdown`,n),v&&Pr(v,`focusin`,i),v&&Pr(v,`focusout`,a),v&&A&&Pr(v,`focusout`,o,!0))},[r,_,v,H,c,k,A,t,l,s,U,C,x,b,te,B,ne,d,f,re]),X.useEffect(()=>{if(r||!v||!g)return;let e=Array.from(A?.portalNode?.querySelectorAll(`[${wo(`portal`)}]`)||[]),t=(k?no(k.nodesRef.current,x()):[]).find(e=>Bi(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Lo([v,...e,L.current,R.current,A?.beforeOutsideRef.current,A?.afterOutsideRef.current,...re(),t,ss(f),ss(d),C?_:null].filter(e=>e!=null),{ariaHidden:c||C,mark:!1}),i=Lo([v,...e].filter(e=>e!=null));return()=>{i(),n()}},[g,r,_,v,c,A,C,k,x,d,f,re]),Y(()=>{if(!g||r||!Ft(H))return;F.current=``,I.current=``;let e=Mn(H),t=oi(e);queueMicrotask(()=>{let n=w.current,r=typeof n==`function`?n(D.current||``):n;if(r===void 0||r===!1||Q(H,t))return;let i=null,a=()=>(i??=U(H),i[0]||H),o;o=r===!0||r===null?a():ss(r),o||=a();let s=Q(H,oi(e)),c=b.current.openEvent,l=c?.type===`mousedown`&&Gi(c);Eo(o,{sync:l,preventScroll:o===H,shouldFocus(){if(!O.current)return!1;if(s)return!0;let t=oi(e);return!(t!==o&&Q(H,t))}})})},[r,g,H,U,w,D,O,b]);let ie=X.useRef(null);Y(()=>{if(r||!H){ie.current=null;return}ie.current&&=(ie.current.cancelled=!0,null);let e=Mn(H),t=oi(e),n=D.current==null;fs(t);function i(e){if(e.open||(F.current=cs(e.nativeEvent,I.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(wo(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(j.current=!0),e.reason===`outside-press`){if(e.nested)j.current=!1;else if(Gi(e.nativeEvent)||Ki(e.nativeEvent))j.current=!1;else{let e=!1;Mn(H).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?j.current=!1:j.current=!0}}}y.on(`openchange`,i);function a(e){let r=T.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=_?.isConnected?_:null,o=t?.isConnected&&an(t)!==`body`?t:null,s=n?o||a:a||o;return s||=ps()||null,typeof i==`boolean`?s:ss(i)||s||null}return()=>{y.off(`openchange`,i);let t=oi(e),n=re(),r=Q(v,t)||n.some(e=>e===t||Q(e,t))||k&&to(k.nodesRef.current,x(),!1).some(e=>Q(e.context?.elements.floating,t)),o=T.current,s=F.current,c=a(s),l={cancelled:!1};ie.current=l,queueMicrotask(()=>{ie.current===l&&(ie.current=null);let n=ms(c),i=E.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!j.current&&Ft(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}j.current=!1})}},[r,v,H,T,E,D,y,k,_,x,re]),Y(()=>{if(!Zr||g||!v)return;let e=oi(Mn(v));Ft(e)&&Ri(e)&&Q(v,e)&&e.blur()},[g,v]),Y(()=>{if(!r&&A)return A.setFocusManagerState({modal:c,closeOnFocusOut:l,open:g,onOpenChange:t.setOpen,domReference:_}),()=>{A.setFocusManagerState(null)}},[r,A,c,g,t,l,_]),Y(()=>{if(!r&&H)return hs(H),()=>{queueMicrotask(ds)}},[r,H]);let W=!r&&(!c||!C)&&(V||c);return(0,Z.jsxs)(X.Fragment,{children:[W&&(0,Z.jsx)(ai,{"data-type":`inside`,ref:z,onFocus:e=>{if(c){let e=U();Eo(e[e.length-1])}else A?.portalNode&&(j.current=!1,Qa(e,A.portalNode)?Ya(_)?.focus():ss(f??A.beforeOutsideRef)?.focus())}}),n,W&&(0,Z.jsx)(ai,{"data-type":`inside`,ref:ee,onFocus:e=>{c?Eo(U()[0]):A?.portalNode&&(l&&(j.current=!0),Qa(e,A.portalNode)?Xa(_)?.focus():ss(d??A.afterOutsideRef)?.focus())}})]})}function _s(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=ao}=t,l=e.context.dataRef,u=X.useRef(void 0),d=ii(),f=zr(),p=X.useMemo(()=>{function t(t,n,r,i){let a=$(c,n,r);t&&i===`touch`&&s>0?f.start(s,()=>{e.setOpen(!0,a)}):e.setOpen(t,a)}function n(t,n,r){let a=l.current.openEvent,s=e.select(`domReferenceElement`)!==n;return t&&s||!t||!i?!0:a&&(typeof o==`function`?o():o)?!r(a.type):!1}return{onPointerDown(e){u.current=qi(e.pointerType,!0)&&Ki(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let o=u.current,s=i.nativeEvent,c=e.select(`open`);if(i.button!==0||r===`click`||qi(o,!0)&&a)return;let l=n(c,i.currentTarget,e=>e===`click`||e===`mousedown`),f=ci(s),p=Ri(f);if(p||o===`virtual`){t(l,s,p?f:i.currentTarget,o);return}let m=i.currentTarget;d.request(()=>{t(l,s,m,o)})},onClick(i){if(r===`mousedown-only`)return;let o=u.current;r===`mousedown`&&o?u.current=void 0:qi(o,!0)&&a||t(n(e.select(`open`),i.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),i.nativeEvent,i.currentTarget,o)},onKeyDown(){u.current=void 0}}},[l,r,a,c,e,o,i,d,f,s]);return X.useMemo(()=>n?{reference:p}:$t,[n,p])}function vs(){return!1}function ys(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function bs(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:i=!0,outsidePressEvent:a=`sloppy`,referencePress:o=vs,bubbles:s,externalTree:c}=t,l=e.useState(`open`),u=e.useState(`floatingElement`),{dataRef:d,events:f}=e.context,p=rs(c),m=J(typeof i==`function`?i:()=>!1),h=typeof i==`function`?m:i,g=h!==!1,_=J(()=>a),{escapeKey:v,outsidePress:y}=ys(s),b=X.useRef(!1),x=X.useRef(!1),S=X.useRef(!1),C=X.useRef(!1),w=X.useRef(!1),T=X.useRef(``),E=X.useRef(null),D=zr(),O=zr(),k=zr(),A=J(()=>{O.clear(),d.current.insideReactTree=!1}),j=J(e=>{let t=d.current.floatingContext?.nodeId;return(p?to(p.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),M=J(t=>Ii(t,e.select(`floatingElement`))||Ii(t,e.select(`domReferenceElement`))),N=J(t=>{o()&&e.setOpen(!1,$(ao,t.nativeEvent))}),P=J(t=>{if(!l||!n||!r||t.key!==`Escape`)return;let i=Wi(t)?t.nativeEvent:t;if(w.current||i.isComposing||!v&&j(`__escapeKeyBubbles`))return;let a=$(_o,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!v&&!a.isPropagationAllowed&&t.stopPropagation()}),F=J(()=>{d.current.insideReactTree=!0,O.start(0,A)}),I=J(t=>{if(!l||!n||t.button!==0)return;let r=ci(t.nativeEvent);Q(e.select(`floatingElement`),r)&&(b.current||(b.current=!0,x.current=!1))}),L=J(e=>{l&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&b.current&&(x.current=!0)});X.useEffect(()=>{function e(e){e.open||(C.current=!1)}return f.on(`openchange`,e),()=>{f.off(`openchange`,e)}},[f]),X.useEffect(()=>A,[A]),X.useEffect(()=>{if(!l||!n)return l||(C.current=!1,w.current=!1,T.current=``,E.current=null),A;d.current.__escapeKeyBubbles=v,d.current.__outsidePressBubbles=y;let t=new Rr,i=Mn(u);function a(){k.clear(),w.current=!0}function o(){w.current=!0,k.start(Zr?5:0,()=>{w.current=!1})}function s(){S.current=!0,t.start(0,()=>{S.current=!1})}function c(){b.current=!1,x.current=!1}function f(){let e=T.current,t=e===`pen`||!e?`mouse`:e,n=_(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function m(e){let t=f();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function O(e){let t=d.current.floatingContext?.nodeId,n=p&&to(p.nodesRef.current,t).some(t=>Ii(e,t.context?.elements.floating));return M(e)||n}function N(n){if(m(n)){n.type!==`click`&&!M(n)&&(t.clear(),S.current=!1),A();return}if(d.current.insideReactTree){A();return}let r=ci(n),i=`[${wo(`inert`)}]`,a=Mt(r)?r.getRootNode():null,o=Array.from((Ot(a)?a:Mn(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>Q(e,r))))return;let c=Mt(r)?r:null;for(;c&&!Rt(c);){let e=zt(c);if(Rt(e)||!Mt(e))break;c=e}if(!(o.length&&Mt(r)&&!Li(r)&&!Q(r,e.select(`floatingElement`))&&o.every(e=>!Q(c,e)))){if(Ft(r)&&!(`touches`in n)){let e=Rt(r),t=Wt(r),i=/auto|scroll/,a=e||i.test(t.overflowX),o=e||i.test(t.overflowY),s=a&&r.clientWidth>0&&r.scrollWidth>r.clientWidth,c=o&&r.clientHeight>0&&r.scrollHeight>r.clientHeight,l=t.direction===`rtl`,u=c&&(l?n.offsetX<=r.offsetWidth-r.clientWidth:n.offsetX>r.clientWidth),d=s&&n.offsetY>r.clientHeight;if(u||d)return}if(!O(n)){if(f()===`intentional`){if(n.detail!==0&&!Gi(n)&&!C.current)return;if(S.current){t.clear(),S.current=!1;return}}typeof h==`function`&&!h(n)||j(`__outsidePressBubbles`)||(e.setOpen(!1,$(co,n)),A())}}}function F(t){f()===`sloppy`&&t.pointerType!==`touch`&&e.select(`open`)&&n&&!M(t)&&N(t)}function I(t){if(f()!==`sloppy`||!e.select(`open`)||!n||M(t))return;let r=t.touches[0];r&&(E.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},D.start(1e3,()=>{E.current&&(E.current.dismissOnTouchEnd=!1,E.current.dismissOnMouseDown=!1)}))}function L(e,t){let n=ci(e);if(!n)return;let r=Pr(n,e.type,()=>{t(e),r()})}function R(e){T.current=`touch`,L(e,I)}function z(e){D.clear(),e.type===`pointerdown`&&(e.button===0&&(C.current=!0),T.current=e.pointerType),(e.type!==`mousedown`||!E.current||E.current.dismissOnMouseDown)&&L(e,e=>{e.type===`pointerdown`?F(e):N(e)})}function ee(e){if(e.type===`pointercancel`&&(C.current=!1),!b.current)return;let n=x.current;c(),f()===`intentional`&&(e.type===`pointercancel`?n&&s():O(e)||(n?s():(typeof h!=`function`||h(e))&&(t.clear(),S.current=!0,A())))}function te(e){if(f()!==`sloppy`||!E.current||M(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-E.current.startX),r=Math.abs(t.clientY-E.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(E.current.dismissOnTouchEnd=!0),i>10&&(N(e),D.clear(),E.current=null)}function B(e){L(e,te)}function ne(e){f()===`sloppy`&&E.current&&!M(e)&&(E.current.dismissOnTouchEnd&&N(e),D.clear(),E.current=null)}function V(e){L(e,ne)}let H=Fr(r&&Fr(Pr(i,`keydown`,P),Pr(i,`compositionstart`,a),Pr(i,`compositionend`,o)),g&&Fr(Pr(i,`click`,z,!0),Pr(i,`pointerdown`,z,!0),Pr(i,`pointerup`,ee,!0),Pr(i,`pointercancel`,ee,!0),Pr(i,`mousedown`,z,!0),Pr(i,`mouseup`,ee,!0),Pr(i,`touchstart`,R,{capture:!0,passive:!0}),Pr(i,`touchmove`,B,{capture:!0,passive:!0}),Pr(i,`touchend`,V,{capture:!0,passive:!0})));return()=>{H(),t.clear(),c(),S.current=!1}},[d,u,r,g,h,l,n,v,y,P,A,_,j,M,p,e,D,k]);let R=X.useMemo(()=>({onKeyDown:P,onPointerDown:N,onClick:N}),[P,N]),z=X.useMemo(()=>({onKeyDown:P,onPointerDown:L,onMouseDown:L,onClickCapture:F,onMouseDownCapture(e){F(),I(e)},onPointerDownCapture(e){F(),I(e)},onMouseUpCapture:F,onTouchEndCapture:F,onTouchMoveCapture:F}),[P,F,I,L]);return X.useMemo(()=>n?{reference:R,floating:z,trigger:R}:{},[n,R,z])}function xs(e){let{popupStore:t,treatPopupAsFloatingElement:n=!1,floatingRootContext:r,floatingId:i,nested:a,onOpenChange:o}=e,s=t.useState(`open`),c=t.useState(`activeTriggerElement`),l=t.useState(n?`popupElement`:`positionerElement`),u=o;return t.useSyncedValue(`floatingId`,i),Y(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};Mt(c)&&(e.domReferenceElement=c),r.state.positionReference===r.state.referenceElement&&(e.positionReference=c),r.update(e)},[s,i,c,l,r]),r.context.onOpenChange=u,r.context.nested=a,r}function Ss(e,t=!1,n=!1,r=!1){let[i,a]=X.useState(e&&t?`idle`:void 0),[o,s]=X.useState(e&&!r);return e&&!o&&(s(!0),a(`starting`)),!e&&o&&i!==`ending`&&!n&&a(`ending`),!e&&!o&&i===`ending`&&a(void 0),Y(()=>{if(!e&&o&&i!==`ending`&&n){let e=ri.request(()=>{a(`ending`)});return()=>{ri.cancel(e)}}},[e,o,i,n]),Y(()=>{if(!e||t||i===void 0)return;let n=ri.request(()=>{a(void 0)});return()=>{ri.cancel(n)}},[t,e,i]),Y(()=>{if(!e||!t)return;e&&o&&i!==`idle`&&a(`starting`);let n=ri.request(()=>{a(`idle`)});return()=>{ri.cancel(n)}},[t,e,o,i]),{mounted:o,setMounted:s,transitionStatus:i}}function Cs(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var ws=null;function Ts(e){if(!ws){let e=[];ws=e,queueMicrotask(()=>{ws=null,Nn.flushSync(()=>{for(let t of e)t()})})}ws.push(e)}function Es(e,t=!1,n=!1){let r=ii();return J((i,a=null)=>{r.cancel();let o=ss(e);if(o==null)return;let s=o,c=()=>{n?Ts(()=>{a?.aborted||i()}):Nn.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(Cs(s).map(e=>e.finished.then(un))).then(()=>{a?.aborted||c()},()=>{a?.aborted||(Cs(s).some(e=>e.pending||e.playState!==`finished`)?l():c())})}if(t){let e=hi;if(!s.hasAttribute(e)){r.request(l);return}let t=new MutationObserver(()=>{s.hasAttribute(e)||(t.disconnect(),l())});t.observe(s,{attributes:!0,attributeFilter:[e]}),a?.addEventListener(`abort`,()=>t.disconnect(),{once:!0})}else r.request(l)})}function Ds(e){let{enabled:t=!0,open:n,ref:r,batch:i=!1,onComplete:a}=e,o=J(a),s=Es(r,n,i);X.useEffect(()=>{if(!t)return;let e=new AbortController;return s(o,e.signal),()=>{e.abort()}},[t,n,o,s])}function Os(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:a,animateInitialOpen:o}=e,s=J(i),{mounted:c,setMounted:l,transitionStatus:u}=Ss(t,!1,!1,o),d=!t&&r;Y(()=>{t&&s(!1)},[t,s]);let f=X.useRef(c),p=X.useRef(!1),m=Ro(),h=()=>{f.current=!1,l(!1),a()};Y(()=>{f.current=c,p.current&&(p.current=!1,!t&&c&&h())});let g=J(()=>{f.current&&(t?(p.current=!0,m()):h())});return Ds({enabled:c&&!t&&!d,open:t,ref:n,onComplete(){t||g()}}),{mounted:c,transitionStatus:u,preventUnmountingOnClose:d,forceUnmount:g}}var ks={tabIndex:-1,[li]:``};function As({handle:e,store:t}){return Y(()=>e.attachStore(t),[e,t]),null}function js(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function Ms(e,t){let n=X.useRef(null);return J(r=>{let i=n.current;if(i!==null){if(i.element===r&&i.store===t&&i.id===e)return;n.current=null;let a=i.store;a.context.triggerElements.getById(i.id)===i.element&&(a.context.triggerElements.delete(i.id),js(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),js(t))})}function Ns(e,t,n,r=!1){let i=e.preventUnmountingOnClose;t?i=!1:r&&(i=!0);let a=n?.id??null,o=e.activeTriggerId,s=e.activeTriggerElement;return(a||t)&&(o=a,s=n??null),{open:t,preventUnmountingOnClose:i,activeTriggerId:o,activeTriggerElement:s,openedWithoutTrigger:t?n==null:e.openedWithoutTrigger}}function Ps(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Fs(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=Ms(e,n),o=J(t=>{let i=n.select(`open`),a=n.select(`activeTriggerId`);if(a===e){let e={activeTriggerElement:t,...i?r:null};n.update(e)}else if(a==null&&i&&!n.state.openedWithoutTrigger){let i={activeTriggerId:e??null,activeTriggerElement:t,...r};n.update(i)}}),s=J(e=>{a(e),e&&o(e)});return Y(()=>(s(t.current),()=>s(null)),[s,t,n,e]),Y(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Is(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=X.useRef(null),i=e.useState(`open`),a=e.useState(`triggerCount`),o=e.useState(`activeTriggerId`),s=e.useState(`activeTriggerElement`);Y(()=>{if(!i){r.current=null,e.state.triggerCount!==0&&e.set(`triggerCount`,0),e.state.openedWithoutTrigger&&e.set(`openedWithoutTrigger`,!1);return}let t=e.context.triggerElements.size,a={};e.state.triggerCount!==t&&(a.triggerCount=t);let o=e.select(`activeTriggerId`),s=null;if(o){let t=e.context.triggerElements.getById(o);if(t)r.current=o,t!==e.state.activeTriggerElement&&(a.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){a.activeTriggerId=t,a.activeTriggerElement=n,r.current=t;break}a.activeTriggerId===void 0&&(r.current===o?s=o:r.current=null)}}else r.current=null;if(!s&&!o&&!e.state.openedWithoutTrigger&&t===1){let t=e.context.triggerElements.entries().next();if(!t.done){let[e,n]=t.value;a.activeTriggerId=e,a.activeTriggerElement=n,r.current=e}}(a.triggerCount!==void 0||a.activeTriggerId!==void 0||a.activeTriggerElement!==void 0)&&e.update(a),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=$(io);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,a,o,s,n])}function Ls(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=Os({open:e,ref:t.context.popupRef,preventUnmountOnClose:t.useState(`preventUnmountingOnClose`),setPreventUnmountOnClose:e=>t.set(`preventUnmountingOnClose`,e),animateInitialOpen:r,onUnmount(){t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1,preventUnmountingOnClose:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}});return kt(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function Rs(e,t){e.useSyncedValues(t),Y(()=>()=>{e.update({activeTriggerProps:$t,inactiveTriggerProps:$t,popupProps:$t})},[e])}var zs=class{idMap=new Map;add(e,t){this.idMap.set(e,t)}delete(e){this.idMap.delete(e)}hasElement(e){for(let t of this.idMap.values())if(t===e)return!0;return!1}hasMatchingElement(e){for(let t of this.idMap.values())if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}elements(){return this.idMap.values()}get size(){return this.idMap.size}},Bs={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},Vs=class extends Nr{constructor(e){let{syncOnly:t,nested:n,onOpenChange:r,triggerElements:i,...a}=e;super({...a,positionReference:a.referenceElement,domReferenceElement:a.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:Qo(),nested:n,triggerElements:i},Bs),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&Ji(t))&&(this.context.dataRef.current.openEvent=e?t:void 0)};dispatchOpenChange=(e,t)=>{this.syncOpenEvent(e,t.event);let n={open:e,reason:t.reason,nativeEvent:t.event,nested:this.context.nested,triggerElement:t.trigger};this.context.events.emit(`openchange`,n)};setOpen=(e,t)=>{this.syncOnly||this.dispatchOpenChange(e,t),this.context.onOpenChange?.(e,t)}};function Hs(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new Vs({open:!1,transitionStatus:void 0,floatingElement:null,referenceElement:null,triggerElements:e,floatingId:t,syncOnly:!0,nested:n,onOpenChange:void 0}),floatingId:t,triggerCount:0,preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,openedWithoutTrigger:!1,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:$t,inactiveTriggerProps:$t,popupProps:$t}}var Us=e=>e.triggerIdProp??e.activeTriggerId,Ws=e=>e.openProp??e.open,Gs=e=>(e.popupElement?.id??e.floatingId)||void 0;function Ks(e,t){return t!==void 0&&Ws(e)&&Us(e)===t}function qs(e,t){return Ks(e,t)?!0:t!==void 0&&Ws(e)&&Us(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var Js={open:Ws,mounted:e=>e.mounted,transitionStatus:e=>Ws(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:Us,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Gs,isTriggerActive:(e,t)=>t!==void 0&&Us(e)===t,isOpenedByTrigger:(e,t)=>Ks(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Us(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>qs(e,t)?Gs(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function Ys(e){let t=X.useCallback(t=>e===void 0?un:e.subscribeStore(t),[e]),n=X.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,Tr.useSyncExternalStore)(t,n,()=>e?.serverStore)}function Xs(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=Ho(),a=ns()!=null,o=kt(()=>new Vs({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new zs,floatingId:i,syncOnly:!1,nested:a})).current;return Y(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=Mt(r.reference)?r.reference:null),r.floating!==void 0&&(e.floatingElement=r.floating),o.update(e)},[t,i,r.reference,r.floating,o]),o.context.onOpenChange=n,o.context.nested=a,o}var Zs=Yr&&Zr;function Qs(e,t={}){let{enabled:n=!0,delay:r}=t,{events:i,dataRef:a}=e.context,o=X.useRef(!1),s=X.useRef(null),c=X.useRef(!0),l=zr();X.useEffect(()=>{let t=e.select(`domReferenceElement`);if(!n)return;let r=Bt(t);function i(){let t=e.select(`domReferenceElement`);!e.select(`open`)&&Ft(t)&&t===oi(Mn(t))&&(o.current=!0,s.current=t)}function a(){c.current=!0}function l(){c.current=!1}return Fr(Pr(r,`blur`,i),Zs&&Pr(r,`keydown`,a,!0),Zs&&Pr(r,`pointerdown`,l,!0))},[e,n]),X.useEffect(()=>{if(!n)return;function t(t){if(t.reason===`trigger-press`||t.reason===`escape-key`){let t=e.select(`domReferenceElement`);Mt(t)&&(s.current=t,o.current=!0)}}return i.on(`openchange`,t),()=>{i.off(`openchange`,t)}},[i,n,e]);let u=X.useMemo(()=>{function t(){o.current=!1,s.current=null}return{onMouseLeave(){t()},onFocus(n){let i=n.currentTarget;if(o.current){if(s.current===i)return;t()}let a=ci(n.nativeEvent);if(Mt(a)){if(Zs&&!n.relatedTarget){if(!c.current&&!Ri(a))return}else if(!Vi(a))return}let u=Fi(n.relatedTarget,e.context.triggerElements),{nativeEvent:d,currentTarget:f}=n;e.select(`open`)&&u||!r?e.setOpen(!0,$(so,d,f)):l.start(r,()=>{o.current||e.setOpen(!0,$(so,d,f))})},onBlur(n){t();let r=n.relatedTarget,i=n.nativeEvent,o=Mt(r)&&r.hasAttribute(wo(`focus-guard`))&&r.getAttribute(`data-type`)===`outside`;l.start(0,()=>{let t=e.select(`domReferenceElement`),n=oi(Mn(t));!r&&n===t||Q(a.current.floatingContext?.refs.floating.current,n)||Q(t,n)||o||Fi(r??n,e.context.triggerElements)||e.setOpen(!1,$(so,i))})}}},[a,r,e,l]);return X.useMemo(()=>n?{reference:u,trigger:u}:{},[n,u])}var $s=class e{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new Rr;restTimeout=new Rr;handleCloseOptions=void 0;static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},ec=new WeakMap;function tc(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&ec.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),ec.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function nc(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=ec.get(n);a&&a!==e&&tc(a),tc(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,ec.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function rc(e){let t=e.context.dataRef.current,n=kt(()=>t.hoverInteractionState??$s.create()).current;return t.hoverInteractionState||=n,Ir(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function ic(e,t){return t!=null&&!qi(t)?0:typeof e==`function`?e():e}function ac(e,t,n){let r=ic(e,n);return typeof r==`number`?r:r?.[t]}function oc(e){return typeof e==`function`?e():e}function sc(e,t){return t||e===`click`||e===`mousedown`}function cc(e){return e?.includes(`mouse`)&&e!==`mousedown`}function lc(e,t={}){let{enabled:n=!0,closeDelay:r=0,nodeId:i}=t,a=e.useState(`open`),o=e.useState(`floatingElement`),s=e.useState(`domReferenceElement`),{dataRef:c}=e.context,l=rs(),u=ns(),d=rc(e),f=zr(),p=J(()=>sc(c.current.openEvent?.type,d.interactedInside)),m=J(()=>cc(c.current.openEvent?.type)),h=J(()=>{tc(d)});Y(()=>{a||(d.pointerType=void 0,d.restTimeoutPending=!1,d.interactedInside=!1,h())},[a,d,h]),X.useEffect(()=>h,[h]),Y(()=>{if(n&&a&&d.handleCloseOptions?.blockPointerEvents&&m()&&Mt(s)&&o){let e=s,t=o,n=Mn(o),r=l?.nodesRef.current.find(e=>e.id===u)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=d.pointerEventsScopeElement===t?null:d.pointerEventsScopeElement,a=r===t?null:r,c=d.handleCloseOptions?.getScope?.()??i??a??si(e,`[data-rootownerid]`)??n.body;return nc(d,{scopeElement:c,referenceElement:e,floatingElement:t}),()=>{h()}}},[n,a,s,o,d,m,l,u,h]),X.useEffect(()=>{if(!n)return;function t(){return!!(l&&u&&to(l.nodesRef.current,u).length>0)}function a(t){let n=ac(r,`close`,d.pointerType),i=()=>{e.setOpen(!1,$(oo,t)),l?.events.emit(`floating.closed`,t)};n?d.openChangeTimeout.start(n,i):(d.openChangeTimeout.clear(),i())}function s(e){let t=ci(e);zi(t)?d.interactedInside=si(t,`[aria-haspopup]`)!=null:d.interactedInside=!1}function g(){d.openChangeTimeout.clear(),f.clear(),l?.events.off(`floating.closed`,v),h()}function _(n){if(t()&&l){l.events.on(`floating.closed`,v);return}if(Fi(n.relatedTarget,e.context.triggerElements))return;let r=c.current.floatingContext?.nodeId??i,o=n.relatedTarget;l&&r&&Mt(o)&&to(l.nodesRef.current,r,!1).some(e=>Q(e.context?.elements.floating,o))||(d.handler?d.handler(n):(h(),m()&&!p()&&a(n)))}function v(n){l&&u&&!t()&&f.start(0,()=>{l.events.off(`floating.closed`,v),e.setOpen(!1,$(oo,n)),l.events.emit(`floating.closed`,n)})}let y=o;return Fr(y&&Pr(y,`mouseenter`,g),y&&Pr(y,`mouseleave`,_),y&&Pr(y,`pointerdown`,s,!0),()=>{l?.events.off(`floating.closed`,v)})},[n,o,e,c,r,i,m,p,h,d,l,u,f])}var uc={current:null};function dc(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:a=!1,restMs:o=0,move:s=!0,triggerElementRef:c=uc,externalTree:l,isActiveTrigger:u=!0,getHandleCloseContext:d,isClosing:f,shouldOpen:p,guardStaleOpen:m=!1}=t,{dataRef:h,events:g}=e.context,_=rs(l),v=rc(e),y=X.useRef(!1),b=pr(i),x=pr(r),S=pr(o),C=pr(n),w=pr(p),T=pr(f),E=J(()=>sc(h.current.openEvent?.type,v.interactedInside)),D=J(()=>w.current?.()!==!1),O=J((t,n,r)=>{let i=e.context.triggerElements;if(i.hasElement(n))return!t||!Q(t,n);if(!Mt(r))return!1;let a=r;return i.hasMatchingElement(e=>Q(e,a))&&(!t||!Q(t,a))}),k=J(()=>{v.handler&&=(Mn(e.select(`domReferenceElement`)).removeEventListener(`mousemove`,v.handler),void 0)}),A=J(()=>{tc(v)});return u&&(v.handleCloseOptions=i?.__options),X.useEffect(()=>k,[k]),X.useEffect(()=>{if(!n)return;function e(e){e.open?y.current=!1:(y.current=e.reason===oo,k(),v.openChangeTimeout.clear(),v.restTimeout.clear(),v.blockMouseMove=!0,v.restTimeoutPending=!1)}return g.on(`openchange`,e),()=>{g.off(`openchange`,e)}},[n,g,v,k]),X.useEffect(()=>{if(!n)return;function t(t,n=!0){let r=ac(x.current,`close`,v.pointerType);r?v.openChangeTimeout.start(r,()=>{e.setOpen(!1,$(oo,t)),_?.events.emit(`floating.closed`,t)}):n&&(v.openChangeTimeout.clear(),e.setOpen(!1,$(oo,t)),_?.events.emit(`floating.closed`,t))}let r=c.current??(u?e.select(`domReferenceElement`):null);if(!Mt(r))return;function i(t){if(v.openChangeTimeout.clear(),v.blockMouseMove=!1,a&&!qi(v.pointerType))return;let n=oc(S.current),r=ac(x.current,`open`,v.pointerType),i=ci(t),o=t.currentTarget??null,s=e.select(`domReferenceElement`),c=o;if(Mt(i)&&!e.context.triggerElements.hasElement(i)){for(let t of e.context.triggerElements.elements())if(Q(t,i)){c=t;break}}Mt(o)&&Mt(s)&&!e.context.triggerElements.hasElement(o)&&Q(o,s)&&(c=s);let l=c!=null&&O(s,c,i),u=e.select(`open`),d=T.current?.()??e.select(`transitionStatus`)===`ending`,f=!u&&d&&y.current,p=!l&&Mt(c)&&Mt(s)&&Q(s,c)&&f,m=n>0&&!r,h=l&&(u||f)||p,g=!u||l;h?D()&&e.setOpen(!0,$(oo,t,c)):m||(r?v.openChangeTimeout.start(r,()=>{g&&D()&&e.setOpen(!0,$(oo,t,c))}):g&&D()&&e.setOpen(!0,$(oo,t,c)))}function o(n){if(E()){A();return}k();let r=Mn(e.select(`domReferenceElement`));v.restTimeout.clear(),v.restTimeoutPending=!1;let i=h.current.floatingContext??d?.();if(!Fi(n.relatedTarget,e.context.triggerElements)){if(b.current&&i){e.select(`open`)||v.openChangeTimeout.clear();let a=c.current;v.handler=b.current({...i,tree:_,x:n.clientX,y:n.clientY,onClose(){A(),k(),C.current&&!E()&&a===e.select(`domReferenceElement`)&&t(n,!0)}}),r.addEventListener(`mousemove`,v.handler),v.handler(n)}else v.pointerType===`touch`&&Q(e.select(`floatingElement`),n.relatedTarget)||t(n)}}function l(e){Q(r,e.relatedTarget)||(v.openChangeTimeout.clear(),v.restTimeout.clear(),v.restTimeoutPending=!1)}let f=m?Pr(r,`mouseout`,l):void 0;return s?Fr(Pr(r,`mousemove`,i,{once:!0}),Pr(r,`mouseenter`,i),Pr(r,`mouseleave`,o),f):Fr(Pr(r,`mouseenter`,i),Pr(r,`mouseleave`,o),f)},[k,A,h,x,e,n,b,v,u,O,E,a,s,S,c,_,C,d,T,D,m]),X.useMemo(()=>{if(!n)return;function t(e){v.pointerType=e.pointerType}return{onPointerDown:t,onPointerEnter:t,onMouseMove(t){let{nativeEvent:n}=t,r=t.currentTarget,i=e.select(`domReferenceElement`),o=e.select(`open`),s=O(i,r,t.target);if(a&&!qi(v.pointerType))return;if(o&&s&&v.handleCloseOptions?.blockPointerEvents){let t=e.select(`floatingElement`);if(t){let e=v.handleCloseOptions?.getScope?.()??r.ownerDocument.body;nc(v,{scopeElement:e,referenceElement:r,floatingElement:t})}}let c=oc(S.current);if(o&&!s||c===0||!s&&v.restTimeoutPending&&t.movementX**2+t.movementY**2<2)return;v.restTimeout.clear();function l(){if(v.restTimeoutPending=!1,E())return;let t=e.select(`open`);!v.blockMouseMove&&(!t||s)&&D()&&e.setOpen(!0,$(oo,n,r))}v.pointerType===`touch`?Nn.flushSync(()=>{l()}):s&&o?l():(v.restTimeoutPending=!0,v.restTimeout.start(c,l))}}},[n,v,E,O,a,e,S,D])}function fc(e){return Zr&&e.movementX===0&&e.movementY===0}function pc(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function mc(e,t){return pc(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function hc(e,t,n){return pc(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function gc(e,t,n){return pc(t,n?e===di:e===fi,e===mi)}function _c(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:pc(t,n?e===fi:e===di,e===pi)}function vc(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:d=!1,focusItemOnOpen:f=`auto`,focusItemOnHover:p=!0,openOnArrowKeyDown:m=!0,disabledIndices:h=void 0,orientation:g=`vertical`,triggerOrientation:_=g,parentOrientation:v,id:y,resetOnPointerLeave:b=!0,externalTree:x,nestedReturnFocusRef:S,grid:C}=t,w=C!=null,T=e.useState(`open`),E=e.useState(`floatingElement`),D=e.useState(`domReferenceElement`),O=e.context.dataRef,k=Hi(E),A=Bi(D),j=pr(k),M=ns(),N=rs(x),P=X.useRef(f),F=X.useRef(o??-1),I=X.useRef(null),L=X.useRef(!0),R=J(e=>{i(F.current===-1?null:F.current,e)}),z=X.useRef(!!E),ee=X.useRef(T),te=X.useRef(!1),B=X.useRef(!1),ne=X.useRef(null),V=pr(h),H=pr(T),U=pr(o),re=pr(b),ie=ii(),W=ii(),ae=J(()=>{ie.cancel();function e(e){d||(ne.current=Eo(e,{sync:te.current,preventScroll:!0}))}let t=n.current[F.current],r=B.current;t&&e(t),(te.current?e=>e():e=>ie.request(e))(()=>{let i=n.current[F.current]||t;i&&(t||e(i),ue&&(r||!L.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});Y(()=>{O.current.orientation=g},[O,g]),Y(()=>{T||(I.current=null),T&&f===`auto`||(P.current=f)},[T,f]),Y(()=>{a&&(T&&E?(F.current=o??-1,P.current&&o!=null&&(B.current=!0,R())):z.current&&(F.current=-1,R()))},[a,T,E,o,R]),Y(()=>{if(a){if(!T)te.current=!1;else if(E){if(r==null){if(te.current=!1,U.current!=null)return;if(z.current&&(F.current=-1,ae()),(!ee.current||!z.current)&&P.current&&(I.current!=null||P.current===!0&&I.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>W.request(e):queueMicrotask)(t),e+=1):(F.current=I.current==null||hc(I.current,_,u)||l?wa(n):Ta(n),I.current=null,R())};t()}}else Ca(n.current,r)||(F.current=r,ae(),B.current=!1)}}},[a,T,E,r,U,l,n,_,u,R,ae,W]),Y(()=>{if(!a||E||!N||d||!z.current)return;let e=N.nodesRef.current,t=e.find(e=>e.id===M)?.context?.elements.floating,n=oi(Mn(D??t??null)),r=e.some(e=>e.context&&Q(e.context.elements.floating,n));t&&!r&&L.current&&t.focus({preventScroll:!0})},[a,E,D,N,M,d]),Y(()=>{ee.current=T,z.current=!!E});let oe=r!=null,G=J(e=>{if(!H.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(F.current!==t||r!==t)&&(F.current=t,R(e))}),se=J(()=>v??N?.nodesRef.current.find(e=>e.id===M)?.context?.dataRef?.current.orientation),ce=J(()=>wa(n,V.current)),le=J(t=>{if(L.current=!1,te.current=!0,t.which===229||!H.current&&t.currentTarget===j.current)return;if(l&&_c(t.key,g,u,w)){mc(t.key,se())||Ui(t),e.setOpen(!1,$(vo,t.nativeEvent));let n=S?.current??D;Ft(n)&&n.focus();return}r!=null&&r!==F.current&&!Ca(n.current,r)&&(F.current=r);let i=F.current,a=wa(n,h),o=Ta(n,h);if(A||(t.key===`Home`&&(Ui(t),F.current=a,R(t)),t.key===`End`&&(Ui(t),F.current=o,R(t))),C!=null){let e=C(t,F.current,n,g,c,u,h,a,o);if(e!=null&&e!==F.current&&(F.current=e,R(t)),g===`both`)return}if(mc(t.key,g)){Ui(t);let e=oi(t.currentTarget.ownerDocument);if(T&&!d&&Q(t.currentTarget,e)&&!n.current.some(t=>t!=null&&Q(t,e))){F.current=hc(t.key,g,u)?a:o,R(t),r===F.current&&ae();return}let{index:l,wrapped:f}=Ea(n.current,i,{decrement:!hc(t.key,g,u),loopFocus:c,allowEscape:s,disabledIndices:h,minIndex:a,maxIndex:o});f&&(te.current=!1),F.current=l,R(t)}}),ue=X.useMemo(()=>({onFocus(e){te.current=!0,G(e)},onClick({currentTarget:e}){d||e.focus({preventScroll:!0})},onMouseMove(e){fc(e)||(te.current=!0,B.current=!1,p&&G(e))},onPointerLeave(e){if(!H.current||!L.current||e.pointerType===`touch`)return;te.current=!0;let t=e.relatedTarget;if(p&&!n.current.includes(t)&&re.current&&(ne.current?.(),ne.current=null,F.current=-1,R(e),!d)){let e=j.current,t=oi(Mn(e));e&&Q(e,t)&&e.focus({preventScroll:!0})}}}),[G,H,j,p,n,R,re,d]),de=X.useMemo(()=>d&&T&&oe&&{"aria-activedescendant":`${y}-${r}`},[d,T,oe,y,r]),fe=X.useMemo(()=>({...A?{}:de,onKeyDown(t){if(t.key===`Tab`&&t.shiftKey&&T&&!d){let n=ci(t.nativeEvent);if(n&&!Q(j.current,n))return;Ui(t);let r=$(go,t.nativeEvent);e.setOpen(!1,r);let i=S?.current??D;!r.isCanceled&&Ft(i)&&i.focus()}else le(t)},onPointerMove(e){fc(e)||(L.current=!0)}}),[de,le,j,A,e,T,d,D,S]),pe=X.useMemo(()=>{function t(t){e.setOpen(!0,$(vo,t.nativeEvent,t.currentTarget))}function n(e){f===`auto`&&Gi(e.nativeEvent)&&(P.current=!d)}function r(e){P.current=f,f===`auto`&&Ki(e.nativeEvent)&&(P.current=!0)}return{onKeyDown(n){let r=e.select(`open`);L.current=!1;let i=n.key.startsWith(`Arrow`),a=gc(n.key,se(),u),o=mc(n.key,r?g:_),s=(l?a:o)||n.key===`Enter`||n.key.trim()===``;if(d&&r&&(!l||Ri(n.currentTarget)))return le(n);if(r||m||!i){if(s){let e=mc(n.key,se());I.current=l&&e?null:n.key}l?a&&(Ui(n),r?(F.current=ce(),R(n),d&&j.current?.focus()):t(n)):o&&(U.current!=null&&(F.current=U.current),Ui(n),!r&&m?t(n):le(n),r&&R(n))}},onFocus(t){t.target===t.currentTarget&&e.select(`open`)&&!d&&(F.current=-1,R(t))},onPointerDown:r,onPointerEnter:r,onMouseDown:n,onClick:n}},[le,f,ce,l,R,e,m,g,_,se,u,U,d,j]),me=X.useMemo(()=>({...de,...pe}),[de,pe]);return X.useMemo(()=>a?{reference:me,floating:fe,item:ue,trigger:pe}:{},[a,me,fe,pe,ue])}function yc(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=J(s),f=e.useState(`open`),p=zr(),m=X.useRef(``),h=X.useRef(u??i??-1),g=X.useRef(null),_=J(e=>{function t(e){return r?.current[e]}function s(e){let n=t(e);return n&&!ja(n)||n?.matches(`:disabled`)?!1:o==null||!ka(Qt,e,o)}function c(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(i)&&s(n))return n}return-1}let _=n.current;if(m.current.length>0&&e.key===` `&&(Ui(e),d?.(!0)),m.current.length>0&&m.current[0]!==` `&&c(_,m.current)===-1&&e.key!==` `&&d?.(!1),_==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(Ui(e),d?.(!0));let v=m.current===``;v&&(h.current=u??i??-1),_.every((e,t)=>e&&s(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=g.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=g.current,d?.(!1)});let y=((v?u??i??-1:h.current)??0)+1,b=c(_,m.current,y);b===-1?e.key!==` `&&(m.current=``,d?.(!1)):(a?.(b,e),g.current=b)}),v=J(t=>{let n=t.relatedTarget,r=e.select(`domReferenceElement`),i=e.select(`floatingElement`);Q(r,n)||Q(i,n)||(p.clear(),m.current=``,h.current=g.current,d?.(!1))});Y(()=>{(f||u===null)&&(p.clear(),g.current=null,m.current!==``&&(m.current=``,d?.(!1)))},[f,u,p,d]);let y=X.useMemo(()=>({onKeyDown:_,onBlur:v}),[_,v]);return X.useMemo(()=>c?{reference:y,floating:y}:{},[c,y])}var bc=.1,xc=bc*bc,Sc=.5;function Cc(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function wc(e,t,n,r,i,a,o,s,c,l){let u=!1;return Cc(e,t,n,r,i,a)&&(u=!u),Cc(e,t,i,a,o,s)&&(u=!u),Cc(e,t,o,s,c,l)&&(u=!u),Cc(e,t,c,l,n,r)&&(u=!u),u}function Tc(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function Ec(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function Dc(e={}){let{blockPointerEvents:t=!1}=e,n=new Rr,r=({x:e,y:t,placement:r,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=r?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*xc;return u=e,d=t,f=n,o<s}function m(){n.clear(),a()}return function(r){n.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=r,h=ci(r),g=r.type===`mouseleave`,_=Q(u,h),v=Q(a,h);if(_&&(l=!0,!g))return;if(v&&(l=!1,!g)){l=!0;return}if(g&&Mt(r.relatedTarget)&&Q(u,r.relatedTarget))return;function y(){return!!(s&&to(s.nodesRef.current,o).length>0)}function b(){y()||m()}if(y())return;let x=a.getBoundingClientRect(),S=u.getBoundingClientRect(),C=e>S.right-S.width/2,w=t>S.bottom-S.height/2,T=S.width>x.width,E=S.height>x.height,D=(T?x:S).left,O=(T?x:S).right,k=(E?x:S).top,A=(E?x:S).bottom;if(c===`top`&&t>=x.bottom-1||c===`bottom`&&t<=x.top+1||c===`left`&&e>=x.right-1||c===`right`&&e<=x.left+1){b();return}let j=!1;switch(c){case`top`:j=Ec(d,f,D,x.top+1,O,S.bottom-1);break;case`bottom`:j=Ec(d,f,D,S.top+1,O,x.bottom-1);break;case`left`:j=Ec(d,f,S.right-1,A,x.left+1,k);break;case`right`:j=Ec(d,f,x.right-1,A,S.left+1,k)}if(j)return;if(l&&!Tc(d,f,x)||!g&&p(d,f)){b();return}let M=!1;switch(c){case`top`:{let n=T?Sc/2:Sc*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t+Sc+1,o=C||T?S.bottom-Sc:S.top,s=C?T?S.bottom-Sc:S.top:S.bottom-Sc;M=wc(d,f,r,a,i,a,S.left,o,S.right,s);break}case`bottom`:{let n=T?Sc/2:Sc*4,r=T||C?e+n:e-n,i=T?e-n:C?e+n:e-n,a=t-Sc,o=C||T?S.top+Sc:S.bottom,s=C?T?S.top+Sc:S.bottom:S.top+Sc;M=wc(d,f,r,a,i,a,S.left,o,S.right,s);break}case`left`:{let n=E?Sc/2:Sc*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e+Sc+1,o=w||E?S.right-Sc:S.left,s=w?E?S.right-Sc:S.left:S.right-Sc;M=wc(d,f,o,S.top,s,S.bottom,a,r,a,i);break}case`right`:{let n=E?Sc/2:Sc*4,r=E||w?t+n:t-n,i=E?t-n:w?t+n:t-n,a=e-Sc,o=w||E?S.left+Sc:S.right,s=w?E?S.left+Sc:S.right:S.left+Sc;M=wc(d,f,a,r,a,i,o,S.top,s,S.bottom);break}}M?l||n.start(40,b):b()}};return r.__options={...e,blockPointerEvents:t},r}function Oc(e,t,n){let{reference:r,floating:i}=e,a=sa(t),o=ca(t),s=oa(o),c=ra(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=ia(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function kc(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=na(t,e),p=ba(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=xa(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=xa(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Ac=50,jc=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:kc},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Oc(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Ac&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Oc(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Mc=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=na(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=ra(r),_=sa(o),v=ra(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[va(o)]:ua(o)),x=p!==`none`;!d&&x&&b.push(..._a(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=la(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===sa(t)||T.every(e=>sa(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=sa(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},Nc=new Set([`left`,`top`]);async function Pc(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ra(n),s=ia(n),c=sa(n)===`y`,l=Nc.has(o)?-1:1,u=a&&c?-1:1,d=na(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Fc=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Pc(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Ic=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=na(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=sa(i),p=aa(f),m=u[p],h=u[f],g=(e,t)=>ta(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Lc=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=na(e,t),u={x:n,y:r},d=sa(i),f=aa(d),p=u[f],m=u[d],h=na(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Nc.has(ra(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Rc=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=na(e,t),c=await i.detectOverflow(t,s),l=ra(n),u=ia(n),d=sa(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=Yi(p-c[m],g),y=Yi(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*Xi(c.left,c.right):S=p-2*Xi(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function zc(e){let t=Wt(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Ft(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Zi(n)!==a||Zi(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Bc(e){return Mt(e)?e:e.contextElement}function Vc(e){let t=Bc(e);if(!Ft(t))return $i(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=zc(t),o=(a?Zi(n.width):n.width)/r,s=(a?Zi(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var Hc=$i(0);function Uc(e){let t=Bt(e);return!Gt()||!t.visualViewport?Hc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Wc(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Bt(e)}function Gc(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Bc(e),o=$i(1);t&&(r?Mt(r)&&(o=Vc(r)):o=Vc(e));let s=Wc(a,n,r)?Uc(a):$i(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=Bt(a),t=Mt(r)?Bt(r):r,n=e,i=Vt(n);for(;i&&t!==n;){let e=Vc(i),t=i.getBoundingClientRect(),r=Wt(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=Bt(i),i=Vt(n)}}return xa({width:u,height:d,x:c,y:l})}function Kc(e,t){let n=Dt(e).scrollLeft;return t?t.left+n:Gc(At(e)).left+n}function qc(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Kc(e,n),y:n.top+t.scrollTop}}function Jc(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=At(r),s=t?Pt(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=$i(1),u=$i(0),d=Ft(r);if((d||!a)&&((an(r)!==`body`||yn(o))&&(c=Dt(r)),d)){let e=Gc(r);l=Vc(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?qc(o,c):$i(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Yc(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Xc(e){let t=Dt(e),n=e.ownerDocument.body,r=Xi(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Xi(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+Kc(e),o=-t.scrollTop;return Wt(n).direction===`rtl`&&(a+=Xi(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Zc=25;function Qc(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Bt(e),a=At(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Gt()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(Kc(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=Zc&&(s-=o)}return{width:s,height:c,x:l,y:u}}function $c(e,t){let n=Gc(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Vc(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function el(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Qc(e,n,t);else if(t===`document`)r=Xc(At(e));else if(Mt(t))r=$c(t,n);else{let n=Uc(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return xa(r)}function tl(e,t){let n=t.get(e);if(n)return n;let r=rn(e,[],!1).filter(e=>Mt(e)&&an(e)!==`body`),i=null,a=Wt(e).position===`fixed`,o=a?zt(e):e;for(;Mt(o)&&!Rt(o);){let e=Wt(o),t=Ht(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=zt(o)}return t.set(e,r),r}function nl(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Pt(t)?[]:tl(t,this._c):[].concat(n),r],o=el(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=el(t,a[e],i);s=Xi(n.top,s),c=Yi(n.right,c),l=Yi(n.bottom,l),u=Xi(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function rl(e){let{width:t,height:n}=zc(e);return{width:t,height:n}}function il(e,t,n){let r=Ft(t),i=At(t),a=n===`fixed`,o=Gc(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=$i(0);if((r||!a)&&((an(t)!==`body`||yn(i))&&(s=Dt(t)),r)){let e=Gc(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=Kc(i));let l=i&&!r&&!a?qc(i,s):$i(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function al(e){return Wt(e).position===`static`}function ol(e,t){if(!Ft(e)||Wt(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return At(e)===n&&(n=n.ownerDocument.body),n}function sl(e,t){let n=Bt(e);if(Pt(e))return n;if(!Ft(e)){let t=zt(e);for(;t&&!Rt(t);){if(Mt(t)&&!al(t))return t;t=zt(t)}return n}let r=ol(e,t);for(;r&&Kt(r)&&al(r);)r=ol(r,t);return r&&Rt(r)&&al(r)&&!Ht(r)?n:r||jt(e)||n}var cl=async function(e){let t=this.getOffsetParent||sl,n=this.getDimensions,r=await n(e.floating);return{reference:il(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function ll(e){return Wt(e).direction===`rtl`}var ul={convertOffsetParentRelativeRectToViewportRelativeRect:Jc,getDocumentElement:At,getClippingRect:nl,getOffsetParent:sl,getElementRects:cl,getClientRects:Yc,getDimensions:rl,getScale:Vc,isElement:Mt,isRTL:ll};function dl(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function fl(e,t,n){let r=null,i,a=At(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=Qi(d),h=Qi(a.clientWidth-(u+f)),g=Qi(a.clientHeight-(d+p)),_=Qi(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Xi(0,Yi(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!dl(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=Bt(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function pl(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Bc(e),u=i||a?[...l?rn(l):[],...t?rn(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?fl(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Gc(e):null;c&&g();function g(){let t=Gc(e);h&&!dl(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var ml=Fc,hl=Ic,gl=Mc,_l=Rc,vl=Lc,yl=(e,t,n)=>{let r=new Map,i=n??{},a={...ul,...i.platform,_c:r};return jc(e,t,{...i,platform:a})},bl=typeof document<`u`?X.useLayoutEffect:function(){};function xl(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!xl(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!xl(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Sl(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Cl(e,t){let n=Sl(e);return Math.round(t*n)/n}function wl(e){let t=X.useRef(e);return bl(()=>{t.current=e}),t}function Tl(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=X.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=X.useState(r);xl(f,r)||p(r);let[m,h]=X.useState(null),[g,_]=X.useState(null),v=X.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=X.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=X.useRef(null),C=X.useRef(null),w=X.useRef(u),T=c!=null,E=wl(c),D=wl(i),O=wl(l),k=X.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),yl(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!xl(w.current,t)&&(w.current=t,Nn.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);bl(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=X.useRef(!1);bl(()=>(A.current=!0,()=>{A.current=!1}),[]),bl(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=X.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=X.useMemo(()=>({reference:b,floating:x}),[b,x]),N=X.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=Cl(M.floating,u.x),r=Cl(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Sl(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return X.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var El=(e,t)=>{let n=ml(e);return{name:n.name,fn:n.fn,options:[e,t]}},Dl=(e,t)=>{let n=hl(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ol=(e,t)=>({fn:vl(e).fn,options:[e,t]}),kl=(e,t)=>{let n=gl(e);return{name:n.name,fn:n.fn,options:[e,t]}},Al=(e,t)=>{let n=_l(e);return{name:n.name,fn:n.fn,options:[e,t]}};function jl(e,t,n,r,i,a,o,s,c,l=2){let u=Oa(n.current,{event:e,orientation:r,loopFocus:i,rtl:a,cols:l,disabledIndices:o,minIndex:s,maxIndex:c,prevIndex:t>c?s:t,stopEvent:!0});return Ca(n.current,u)?void 0:u}function Ml(e){return e==null?io:e.type.startsWith(`key`)?yo:e.type.startsWith(`mouse`)||e.type.startsWith(`pointer`)?bo:io}var Nl=X.createContext(void 0),Pl=X.createContext(void 0),Fl=X.createContext(void 0),Il=X.createContext(!1),Ll=X.createContext(``);function Rl(){let e=X.useContext(Nl);if(!e)throw Error(vn(22));return e}function zl(){let e=X.useContext(Pl);if(!e)throw Error(vn(23));return e}function Bl(){let e=X.useContext(Fl);if(!e)throw Error(vn(24));return e}function Vl(){return X.useContext(Ll)}function Hl(){return X.useContext(Il)}function Ul(e,t,n=Object.is){let{length:r}=e;if(r!==t.length)return!1;for(let i=0;i<r;i+=1)if(!n(e[i],t[i]))return!1;return!0}var Wl=(e,t)=>Object.is(e,t);function Gl(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function Kl(e,t,n){return Array.isArray(e)&&Array.isArray(t)?!Ul(e,t,(e,t)=>Gl(e,t,n)):e!==t}function ql(e,t,n){return e?e.some(e=>e!==void 0&&Gl(t,e,n)):!1}function Jl(e,t,n){return e?e.findIndex(e=>e!==void 0&&Gl(e,t,n)):-1}function Yl(e,t){if(t!==Wl)return n=>ql(e,n,t);let n=new Set(e);return n.delete(void 0),t=>n.has(t)&&(t!==0||e.some(e=>Object.is(t,e)))}function Xl(e,t,n,r){let i=r&&Array.isArray(t)?e.findIndex(Yl(t,n)):Jl(e,t,n);return i===-1?null:i}function Zl(e,t,n,r,i,a){return ql(r,t,i)?a!=null&&e>a&&ql(r,n[a],i)?a:e:e===a?Xl(n,r,i,!0):a}function Ql(e,t,n){return e.filter(e=>!Gl(t,e,n))}function $l(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function eu(e){return typeof e==`object`&&!!e&&Array.isArray(e.items)}function tu(e){return eu(e?.[0])}function nu(e){return tu(e)?e.flatMap(e=>e.items):e}function ru(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(tu(t)){for(let e of t)for(let t of e.items)if(t&&t.value==null&&t.label!=null)return!0;return!1}for(let e of t)if(e&&e.value==null&&e.label!=null)return!0;return!1}function iu(e,t){if(t&&e!=null)return t(e)??``;if(e&&typeof e==`object`){if(`label`in e&&e.label!=null)return String(e.label);if(`value`in e)return String(e.value)}return $l(e)}function au(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?$l(e.value):$l(e)}var ou={id:e=>e.id,labelId:e=>e.labelId,items:e=>e.items,selectedValue:e=>e.selectedValue,hasSelectionChips:e=>{let t=e.selectedValue;return Array.isArray(t)&&t.length>0},hasSelectedValue:e=>{let{selectedValue:t,selectionMode:n}=e;return t==null?!1:n===`multiple`&&Array.isArray(t)?t.length>0:!0},hasNullItemLabel:(e,t)=>t?ru(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMounted:e=>e.forceMounted,inline:e=>e.inline,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.selectedValue;return Array.isArray(r)?r.some(e=>Gl(t,e,n)):Gl(t,r,n)},transitionStatus:e=>e.transitionStatus,popupProps:e=>e.popupProps,listProps:e=>e.listProps,inputProps:e=>e.inputProps,triggerProps:e=>e.triggerProps,itemRoot:e=>e.itemRoot,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupId:e=>e.popupId,triggerElement:e=>e.triggerElement,inputElement:e=>e.inputElement,inputGroupElement:e=>e.inputGroupElement,popupSide:e=>e.popupSide,openMethod:e=>e.openMethod,inputInsidePopup:e=>e.inputInsidePopup,inputOwnsFormValue:e=>e.inputOwnsFormValue,selectionMode:e=>e.selectionMode,name:e=>e.name,form:e=>e.form,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,grid:e=>e.grid,virtualized:e=>e.virtualized,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,modal:e=>e.modal,autoHighlight:e=>e.autoHighlight},su=`data-valid`,cu=`data-invalid`,lu={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},uu={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},du={disabled:!1,...uu},fu={valid(e){return e===null?null:e?{[su]:``}:{[cu]:``}}},pu={invalid:void 0,name:void 0,validityData:{state:lu,errors:[],error:``,value:``,initialValue:null},setValidityData:un,disabled:void 0,setTouched:un,setDirty:un,setFilled:un,setFocused:un,focusOwnerRef:{current:void 0},validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:du,registerFieldControl:un,validation:{getValidationProps:(e,t=$t)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:un,getInputControl:()=>null,commit:async()=>{},change:un}},mu=X.createContext(pu);function hu(e=!0){let t=X.useContext(mu);if(t.setValidityData===un&&!e)throw Error(vn(28));return t}function gu(e,t,n,r,i=!0,a){let{registerFieldControl:o}=hu(),s=kt(()=>Symbol());Y(()=>{let c=s.current;i?o(c,{controlRef:e,getValue:r,id:t,name:a,value:n}):o(c,void 0)},[e,i,r,t,a,o,s,n]),Y(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}var _u=X.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:un,validationMode:`onSubmit`,submitCountRef:{current:0}});function vu(){return X.useContext(_u)}function yu(e){return Ho(e,`base-ui`)}var bu=X.createContext({controlId:void 0,registerControlId:un,resetControlId:un,labelId:void 0,setLabelId:un,messageIds:[],setMessageIds:un,getDescriptionProps:e=>e});function xu(){return X.useContext(bu)}function Su(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:i,resetControlId:a}=xu(),o=yu(),s=kt(()=>Symbol()),c=X.useRef(!1),l=X.useRef(!1),u=J(()=>{c.current&&i!==un&&(c.current=!1,i(s.current,void 0))});return Y(()=>{if(!n||i===un){u();return}let e;if(t!==void 0)l.current=!0,e=t;else if(l.current)e=o;else{a();return}e===void 0?u():(c.current=!0,i(s.current,e))},[t,n,i,a,o,s,u]),Y(()=>u,[u]),(n?r:void 0)??t??o}function Cu(e){return e==null?void 0:`${e}-popup`}function wu(e,t){return(n,r)=>n!=null&&e.contains(n,r,t)}function Tu(e){return Array.isArray(e)?e.map(e=>Tu(e)).join(`,`):e==null?``:String(e)}var Eu=new Map;function Du(e={}){let{locale:t,...n}=e,r={usage:`search`,sensitivity:`base`,ignorePunctuation:!0,...n},i=`${Tu(t)}|${JSON.stringify(r)}`,a=Eu.get(i);if(a)return a;let o=new Intl.Collator(t,r),s={contains(e,t,n){if(!t)return!0;let r=iu(e,n);for(let e=0;e<=r.length-t.length;e+=1)if(o.compare(r.slice(e,e+t.length),t)===0)return!0;return!1},startsWith(e,t,n){if(!t)return!0;let r=iu(e,n);return o.compare(r.slice(0,t.length),t)===0},endsWith(e,t,n){if(!t)return!0;let r=iu(e,n),i=t.length;return r.length>=i&&o.compare(r.slice(r.length-i),t)===0}};return Eu.set(i,s),s}var Ou=Du;function ku(e){let t=X.useRef(``),n=X.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:X.useCallback(n=>{n.detail===0?e(n,`keyboard`):(`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``)},[e]),onPointerDown:n}}function Au(e,t){let n=X.useRef(e),r=J(t);Y(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function ju(e,t){let{onClick:n,onPointerDown:r}=ku(J((n,r)=>{(typeof e==`function`?e():e)||t(r||(Kr?`touch`:``))}));return X.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function Mu(e){let[t,n]=X.useState(null),r=ju(e,n);return Au(e,t=>{t&&!e&&n(null)}),X.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function Nu(e,t=!1){let{overflowY:n}=Wt(e);return n!==`auto`&&n!==`scroll`?!1:t?e.clientHeight>0:e.scrollHeight>e.clientHeight}var Pu=Symbol(`none`),Fu={value:Pu,index:-1},Iu=X.createContext(void 0);function Lu(){return X.useContext(Iu)?.direction??`ltr`}function Ru(e,t,n){let r=e.get(t);if(r!==void 0||n===Wl)return r;for(let[r,i]of e)if(Gl(r,t,n))return i}function zu(e){let{id:t,onOpenChangeComplete:n,defaultSelectedValue:r=null,selectedValue:i,onSelectedValueChange:a,defaultInputValue:o,inputValue:s,open:c,defaultOpen:l=!1,selectionMode:u,onItemHighlighted:d,name:f,form:p,disabled:m=!1,readOnly:h=!1,required:g=!1,inputRef:_,grid:v=!1,items:y,filteredItems:b,filter:x,filterQuery:S,openOnInputClick:C=!0,autoHighlight:w=!1,keepHighlight:T=!1,highlightItemOnHover:E=!0,loopFocus:D=!0,itemToStringLabel:O,itemToStringValue:k,isItemEqualToValue:A=Wl,virtualized:j=!1,inline:M=!1,fillInputOnItemPress:N=!0,modal:P=!1,limit:F=-1,autoComplete:I=`list`,formAutoComplete:L,locale:R,submitOnItemClick:z=!1}=e,{clearErrors:ee}=vu(),{setDirty:te,validityData:B,setFilled:ne,name:V,disabled:H,setTouched:U,setFocused:re,validationMode:ie,validation:W}=hu(),ae=Lu(),oe=Su({id:t}),G=Ou({locale:R}),se=Array.isArray(y)?null:y;if(se&&typeof se.label!=`function`)throw Error(vn(100));let ce=se?se.data:y,le=se?.value,ue=le?void 0:ce,de=X.useMemo(()=>{if(!b||!le)return;let e=nu(b),t=e.map(le),n;return{values:t,findItem(r,i){if(!n){n=new Map;for(let r=0;r<t.length;r+=1)n.has(t[r])||n.set(t[r],e[r])}return Ru(n,r,i)}}},[b,le]),fe=X.useMemo(()=>se?e=>se.label(e,A,e=>{let t=de?.findItem(e,A);return t==null?iu(e,O):se.itemLabel(t)}):O,[se,O,de,A]),pe=X.useMemo(()=>se?Object.assign(e=>se.itemLabel(e),{selected:e=>iu(e,fe)}):O,[se,fe,O]);function me(e){return iu(e,fe)}let[he,ge]=X.useState(!1),[K,_e]=X.useState(null),ve=X.useRef(K),ye=X.useRef([]),be=X.useRef([]),xe=X.useRef(null),Se=X.useRef(null),Ce=X.useRef(null),we=X.useRef(null),Te=X.useRef(null),Ee=X.useRef(!1),De=X.useRef(null),Oe=X.useRef(null),ke=X.useRef(null),Ae=X.useRef(Fu),je=X.useRef(null),Me=X.useRef([]),Ne=X.useRef(null),Pe=H||m,Fe=V??f,Ie=u===`multiple`,Le=u===`single`,Re=s!==void 0||o!==void 0,ze=ce!==void 0,Be=b!==void 0,Ve;Ve=w===`always`?`always`:w?`input-change`:!1;let[He,Ue]=dr({controlled:i,default:Ie?r??Qt:r,name:`Combobox`,state:`selectedValue`}),We=X.useMemo(()=>x===null?()=>!0:x===void 0?wu(G,pe):x,[x,G,pe]),Ge=kt(()=>Re?o??``:Le?me(He):``).current,[Ke,qe]=dr({controlled:s,default:Ge,name:`Combobox`,state:`inputValue`}),[Je,Ye]=dr({controlled:c,default:l,name:`Combobox`,state:`open`}),Xe=tu(ce),Ze=!Je&&K!==null?K:String(Ke).trim(),Qe=Le?me(He):``,$e=Le&&!he&&Ze!==``&&Qe.length===Ze.length&&G.contains(Qe,Ze),et=$e?``:S??Ze,tt=ze&&Be&&$e&&(!se||se.hasValue(He,A)),nt=X.useMemo(()=>ce?nu(ce):Qt,[ce]),rt=X.useMemo(()=>{if(b&&!tt)return b;if(!ce)return Qt;if(Xe){let e=ce,t=[],n=0;for(let r of e){if(F>-1&&n>=F)break;let e=F>-1?F-n:1/0,i=et===``?r.items.slice(0,e):[];if(et!==``)for(let t of r.items){if(i.length>=e)break;We(t,et,pe)&&i.push(t)}if(i.length>0){let e={...r,items:i};t.push(e),n+=i.length}}return t}if(et===``)return F>-1?nt.slice(0,F):nt;let e=[];for(let t of nt){if(F>-1&&e.length>=F)break;We(t,et,pe)&&e.push(t)}return e},[b,tt,ce,Xe,et,F,We,pe,nt]),it=X.useMemo(()=>{if(de&&rt===b)return de.values;let e=nu(rt);return le?e.map(e=>le(e)):e},[rt,b,de,le]),q=kt(()=>{let e=null;return M&&Je&&ze&&u!==`none`&&(e=Xl(it,He,A,Ie)),new Nr({id:oe,labelId:void 0,selectedValue:He,open:Je,items:ue,selectionMode:u,name:Fe,form:p,disabled:Pe,readOnly:h,required:g,grid:v,virtualized:j,openOnInputClick:C,itemToStringLabel:fe,isItemEqualToValue:A,modal:P,autoHighlight:Ve,submitOnItemClick:z,hasInputValue:Re,mounted:!1,forceMounted:!1,transitionStatus:`idle`,inline:M,activeIndex:null,selectedIndex:e,popupProps:{},listProps:{},inputProps:{},triggerProps:{},itemRoot:{props:$t,id:oe,selectionMode:u,disabled:Pe,readOnly:h,isItemEqualToValue:A},positionerElement:null,listElement:null,popupId:void 0,triggerElement:null,inputElement:null,inputGroupElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,inputOwnsFormValue:u===`none`},{onOpenChangeComplete:un,setOpen:un,setInputValue:un,setSelectedValue:un,setIndices:un,handleSelection:un,forceMount:un,requestSubmit:un,listRef:ye,labelsRef:be,popupRef:xe,emptyRef:Te,inputRef:Se,startDismissRef:Ce,endDismissRef:we,chipsContainerRef:De,clearRef:Oe,valuesRef:Me,pointerDownItemRef:Ne,selectionEventRef:ke},ou)}).current,at=u===`none`?Ke:He,ot=X.useMemo(()=>u===`none`?at:Array.isArray(He)?He.map(e=>au(e,k)):au(He,k),[at,k,u,He]),st=J(d),ct=J(n),lt=q.useState(`activeIndex`),ut=q.useState(`selectedIndex`),dt=q.useState(`positionerElement`),ft=q.useState(`listElement`),pt=q.useState(`triggerElement`),mt=q.useState(`inputElement`),ht=q.useState(`inputGroupElement`),gt=q.useState(`inline`),_t=q.useState(`inputInsidePopup`),vt=q.useState(`inputOwnsFormValue`),yt=Le&&!_t&&Ke===Qe,bt=pr(pt),{openMethod:xt,triggerProps:St}=Mu(Je),Ct=J(()=>ot);gu(_t?bt:Se,oe,at,Ct,!Pe,f);let wt=J(()=>{ce?be.current=it.map(me):q.set(`forceMounted`,!0)}),Tt=J((e,t,n,r)=>{if(t===-1){if(Ae.current===Fu)return;Ae.current=Fu}else Ae.current={value:e,index:t};st(e,ro(n,r,{index:t}))}),Et=J(e=>{let t={};e.activeIndex!==void 0&&(t.activeIndex=e.activeIndex),e.selectedIndex!==void 0&&(t.selectedIndex=e.selectedIndex),q.update(t);let n=e.activeIndex;if(n===void 0)return;let r=e.type||`none`;n===null?Tt(void 0,-1,r,e.event):Tt(Me.current[n],n,r,e.event)}),Dt=J((t,n)=>{if(e.onInputValueChange?.(t,n),!n.isCanceled){if(Ee.current=n.reason===mo,n.reason===`input-change`){Je&&K!==null&&_e(null);let e=n.event,r=e.inputType;if(e.type===`compositionend`||r!=null&&r!==``&&r!==`insertReplacementText`){let e=t.trim()!==``;e&&ge(!0),je.current={hasQuery:e};let n=q.state.listElement;if(!q.state.virtualized&&n){let e=xe.current;for(let t of rn(n.firstElementChild??n)){if(!Ft(t)||(e?!Q(e,t):t.getAttribute(`role`)===`dialog`))break;if(Nu(t)){t.scrollTop=0;break}}}e&&Ve&&q.state.activeIndex==null&&(Je||gt)&&q.set(`activeIndex`,0)}}else n.reason===`input-clear`&&t===``&&q.state.inputInsidePopup&&(je.current={hasQuery:!1,selection:!0});qe(t)}}),Ot=J(e=>{let t=!e&&_t&&!gt&&Ke!==``&&(String(Ke).trim()===K||Ke===Qe);!e&&(t||Ke===``||yt)&&ge(!1),_e(null),t&&Dt(``,$(mo))}),[At,jt]=X.useState(!1),Mt=J((t,n)=>{if(Je===t)return;n.reason===`escape-key`&&ze&&it.length===0&&!Te.current&&n.allowPropagation();let r=n,i=Ps(r);if(e.onOpenChange?.(t,r),je.current?.hasQuery&&n.reason===`input-change`===n.isCanceled&&(je.current=null),!n.isCanceled&&(t&&K!==null&&Ot(n.reason===po),!t&&he&&(Le?(gt||_e(Ze),Ze===``&&ge(!1)):Ie&&(gt||_e(Ze),_t&&Et({activeIndex:null}),(!_t||gt)&&Dt(``,$(mo,n.event,void 0,{isItemPress:n.reason===lo})))),t||jt(i()),Ye(t),!t&&_t&&(n.reason===`focus-out`||n.reason===`outside-press`)&&(U(!0),re(!1),ie===`onBlur`))){let e=u===`none`?Ke:He;W.commit(e)}}),Nt=J((e,t)=>{a?.(e,t),!t.isCanceled&&(Ue(e),(u===`none`&&xe.current&&N||Le&&!q.state.inputInsidePopup)&&Dt(me(e),$(t.reason,t.event)))}),Pt=J((e,t)=>{let n=ci(e),r=ke.current??e;ke.current=null;let i=$(lo,r),a=si(n,`a`)?.getAttribute(`href`);if(a)a.startsWith(`#`)&&Mt(!1,i);else if(Ie){let e=Array.isArray(He)?He:[],n=ql(e,t,A),r=n?Ql(e,t,A):[...e,t];if(Nt(r,i),i.isCanceled||!(Se.current&&Se.current.value.trim()!==``))return;if(q.state.inputInsidePopup){Dt(``,$(mo,i.event,void 0,{isItemPress:!0}));let e=je.current;e&&!n&&(e.toggledValue=t)}else Mt(!1,i)}else{if(Nt(t,i),i.isCanceled)return;Mt(!1,i)}}),It=J(()=>{let e=W.inputRef.current?.form??q.state.inputElement?.form;e&&typeof e.requestSubmit==`function`&&e.requestSubmit()}),Lt=J(()=>{if(ct?.(!1),ge(!1),_e(null),Et(u===`none`?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),Ie&&Se.current&&Se.current.value!==``&&!Ee.current&&Dt(``,$(mo)),Le){if(q.state.inputInsidePopup)Se.current&&Se.current.value!==``&&Dt(``,$(mo));else{let e=me(He);Se.current&&Se.current.value!==e&&Dt(e,$(e===``?mo:io))}}}),Rt=X.useMemo(()=>gt&&dt?{current:si(dt,`[role="dialog"]`)}:xe,[gt,dt]),{mounted:zt,transitionStatus:Bt,forceUnmount:Vt}=Os({open:Je,ref:Rt,preventUnmountOnClose:At,setPreventUnmountOnClose:jt,onUnmount:Lt});X.useImperativeHandle(e.actionsRef,()=>({unmount:Vt,close:()=>Mt(!1,$(Co))}),[Vt,Mt]),Y(function(){let e=ve.current!==null&&K===null;if(ve.current=K,Je&&(!e||!ze)||(Je||(Ne.current=null),u===`none`))return;let t=ze?it:Me.current;Et({selectedIndex:Xl(t,He,A,Ie)})},[Je,K,He,u,Ie,ze,it,A,Et]),Y(()=>{ce&&(Me.current=it,ye.current.length=it.length)},[ce,it]),Y(()=>{!Je&&je.current?.hasQuery&&(je.current=null)},[Je]),Y(()=>{if(!Je&>&&Rt.current){je.current=null;return}let e=ze||Be?it:Me.current,t=je.current;if(t){let n=Je||gt||q.state.positionerElement?.hidden===!1;if(t.hasQuery){let t=Se.current;!Ve||String(Ke).trim()===``||gt&&Ve!==`always`&&(!t||oi(t.ownerDocument)!==t)?je.current=null:n&&(e[0]!==void 0||!ze&&!Be)&&(q.set(`activeIndex`,0),je.current=null)}else if(String(Ke).trim()===``&&(je.current=null,n)){let e=t.selection;Ve===`always`&&!e&&q.state.selectionMode===`none`&&q.set(`activeIndex`,0),queueMicrotask(()=>{if(!q.state.open&&(!q.state.inline||Rt.current)||Se.current&&Se.current.value.trim()!==``)return;let n=q.state.selectedValue,r=q.state.selectionMode===`multiple`;if(r&&Array.isArray(n)?n.length>0:q.state.selectionMode!==`none`&&n!=null){let e=ze||Be?it:Me.current,i=Jl(e,t.toggledValue,q.state.isItemEqualToValue);q.set(`activeIndex`,i===-1?Xl(e,n,q.state.isItemEqualToValue,r):i)}else e?q.set(`activeIndex`,null):Ve===`always`&&q.set(`activeIndex`,0)})}}if(!Je&&!gt)return;let n=q.state.activeIndex;if(n==null){if(Ve===`always`&&e.length>0){q.set(`activeIndex`,0);return}Tt(void 0,-1,io);return}if(n>=e.length){Tt(void 0,-1,io),q.set(`activeIndex`,null);return}let r=e[n],i=Ae.current.value,a=i!==Pu&&Gl(r,i,q.state.isItemEqualToValue);Ae.current.index===n&&a||Tt(r,n,io)},[lt,Ve,Tt,Be,ze,it,gt,Je,Rt,q,Ke]),Y(()=>{ne(u===`none`?String(Ke)!==``:Ie?Array.isArray(He)&&He.length>0:He!=null)},[ne,u,Ke,He,Ie]),X.useEffect(()=>{ze&&Ve&&it.length===0&&Et({activeIndex:null})},[ze,Ve,it.length,Et]);function Ht(){Je&&Ze!==``&&Ze!==String(Ge)&&!yt&&ge(!0)}function Ut(){Je&&K!==null&&Ot(!1)}let Wt=!1;function Gt(){!Wt&&Ke!==Qe&&(Wt=!0,Dt(Qe,$(io)))}function Kt(){u!==`none`&&(ee(Fe),te(Kl(He,B.initialValue,A)),W.change(He),Le&&!Re&&!_t&&Gt())}function qt(){Le&&!Re&&!_t&&!he&&Gt()}function Jt(){u===`none`&&(ee(Fe),te(Ke!==B.initialValue),W.change(Ke))}Au(Ze,Ht),Au(Je,Ut),Au(He,Kt),Au(Qe,qt),Au(ce,qt),Au(Ke,Jt);let Yt=Xs({open:gt?!0:Je,onOpenChange:Mt,elements:{reference:_t?pt:mt,floating:dt}}),Zt=v?`grid`:`listbox`,en=Je||gt,nn=en?`true`:`false`,an=X.useMemo(()=>{let e=mt?.tagName===`INPUT`,t=mt==null||e,n=t||en,r=t?{autoComplete:`off`,spellCheck:`false`,autoCorrect:`off`,autoCapitalize:`none`}:{};return n&&(r.role=`combobox`,r[`aria-expanded`]=nn,r[`aria-haspopup`]=Zt,r[`aria-controls`]=en?ft?.id:void 0,r[`aria-autocomplete`]=h?`none`:I),{reference:r,floating:{role:`presentation`}}},[mt,en,nn,Zt,ft?.id,I,h]),on=_s(Yt,{enabled:!Pe&&C,event:`mousedown-only`,toggle:!1,touchOpenDelay:_t?0:100,reason:ho}),sn=bs(Yt,{enabled:!Pe&&!gt,outsidePressEvent:{mouse:`sloppy`,touch:`intentional`},bubbles:gt?!0:void 0,outsidePress(e){let t=ci(e);return!Q(pt,t)&&!Q(Oe.current,t)&&!Q(De.current,t)&&!Q(ht,t)}}),cn=vc(Yt,{enabled:!Pe,id:oe,listRef:ye,activeIndex:lt,selectedIndex:ut,virtual:!0,loopFocus:D,allowEscape:D&&!Ve,focusItemOnOpen:he||u===`none`&&!Ve?!1:`auto`,focusItemOnHover:E,resetOnPointerLeave:!T,orientation:v?`horizontal`:void 0,rtl:ae===`rtl`,disabledIndices:Qt,grid:v?jl:void 0,onNavigate(e,t){(t||Je||gt&&e===null)&&Bt!==`ending`&&Et({activeIndex:e,type:Ml(t),event:t?.nativeEvent})}}),ln=X.useMemo(()=>Xt(cn.reference,{onKeyDown(e){v&&q.state.activeIndex==null&&(e.key===`ArrowLeft`||e.key===`ArrowRight`)&&e.preventBaseUIHandler()}},sn.reference,on.reference,an.reference),[cn.reference,sn.reference,on.reference,an.reference,v,q]),dn=X.useMemo(()=>Xt(ks,sn.floating),[sn.floating]),fn=X.useMemo(()=>Xt(cn.floating,an.floating),[cn.floating,an.floating]),pn=X.useMemo(()=>{let e=cn.item;return{props:e?{...e,onFocus:void 0}:$t,id:oe,selectionMode:u,disabled:Pe,readOnly:h,isItemEqualToValue:A}},[cn.item,oe,u,Pe,h,A]);q.useContextCallback(`setOpen`,Mt),q.useContextCallback(`setInputValue`,Dt),q.useContextCallback(`setSelectedValue`,Nt),q.useContextCallback(`setIndices`,Et),q.useContextCallback(`handleSelection`,Pt),q.useContextCallback(`forceMount`,wt),q.useContextCallback(`requestSubmit`,It),q.useContextCallback(`onOpenChangeComplete`,n),fr(()=>{q.update({inline:M,popupProps:dn,listProps:fn,inputProps:ln,triggerProps:St,itemRoot:pn})});let mn={id:oe,selectedValue:He,open:Je,mounted:zt,transitionStatus:Bt,items:ue,inline:M,popupProps:dn,listProps:fn,inputProps:ln,triggerProps:St,itemRoot:pn,openMethod:xt,selectionMode:u,name:Fe,form:p,disabled:Pe,readOnly:h,required:g,grid:v,virtualized:j,openOnInputClick:C,itemToStringLabel:fe,modal:P,autoHighlight:Ve,isItemEqualToValue:A,submitOnItemClick:z,hasInputValue:Re};Y(()=>{q.update({...mn,inputOwnsFormValue:u===`none`&&(M||!q.state.inputInsidePopup)})},[q,...Object.values(mn)]);let hn=tn(_,W.inputRef),gn=X.useMemo(()=>({query:Ze,hasItems:ze,filteredItems:rt,flatFilteredValues:it}),[Ze,ze,rt,it]),_n=X.useMemo(()=>Array.isArray(at)?``:au(at,k),[at,k]),yn=Ie&&Array.isArray(He)&&He.length>0,bn=Ie||u===`none`&&vt?void 0:Fe,xn=X.useMemo(()=>!Ie||!Array.isArray(He)||!Fe?null:He.map(e=>{let t=au(e,k);return(0,Z.jsx)(`input`,{type:`hidden`,form:p,name:Fe,value:t,disabled:Pe},t)}),[Ie,He,p,Fe,k,Pe]),Sn=(0,Z.jsxs)(X.Fragment,{children:[e.children,(0,Z.jsx)(`input`,{...W.getValidationProps(Pe,{onFocus(){_t?pt?.focus():(Se.current||pt)?.focus()},onChange(e){if(e.nativeEvent.defaultPrevented||Pe||h)return;let t=e.currentTarget.value,n=t.toLowerCase(),r=$(io,e.nativeEvent),i=()=>Me.current.findIndex(e=>au(e,k).toLowerCase()===n||me(e).toLowerCase()===n);function a(){if(Ie)return;if(u===`none`){Dt(t,r);return}let e=i();e===-1&&(e=Me.current.findIndex((e,t)=>{let r=be.current[t];return r!=null&&r.toLowerCase()===n}));let a=e===-1?void 0:Me.current[e];a!=null&&Nt?.(a,r)}Le&&(wt(),ce&&i()===-1&&q.set(`forceMounted`,!0)),queueMicrotask(a)}}),id:oe&&bn==null?`${oe}-hidden-input`:void 0,form:p,name:bn,autoComplete:L,disabled:Pe,required:g&&!yn,readOnly:h,value:_n,ref:hn,style:bn?_r:gr,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),xn]});return(0,Z.jsx)(Nl.Provider,{value:q,children:(0,Z.jsx)(Pl.Provider,{value:Yt,children:(0,Z.jsx)(Il.Provider,{value:ze,children:(0,Z.jsx)(Fl.Provider,{value:gn,children:(0,Z.jsx)(Ll.Provider,{value:Ke,children:Sn})})})})})}function Bu(e){let{openOnInputClick:t=!1,value:n,defaultValue:r,onValueChange:i,mode:a=`list`,itemToStringValue:o,...s}=e,c=(a===`inline`||a===`both`)&&!e.readOnly,l=a===`inline`||a===`none`,u=n!==void 0,[d,f]=X.useState(r??``),[p,m]=X.useState(``);X.useEffect(()=>{(u||!c)&&m(``)},[n,u,c]);let h;h=c&&p!==``?p:u?n??``:d;let g=Ou({locale:s.locale}),_=String((u?n:d)??``).trim(),v=l||s.filter===null?null:s.filter??g.contains;function y(e,t){m(``),u||f(e),i?.(e,t)}function b(t,n){e.onItemHighlighted?.(t,n),n.reason!==`pointer`&&m(c&&t!=null?iu(t,o):``)}return(0,Z.jsx)(zu,{...s,itemToStringLabel:o,openOnInputClick:t,selectionMode:`none`,fillInputOnItemPress:!0,filter:v,filterQuery:a===`both`?_:void 0,autoComplete:a,inputValue:h,defaultInputValue:r,onInputValueChange:y,onItemHighlighted:b})}var Vu=`data-popup-side`,Hu=`data-list-empty`,Uu={...ji,...fu,popupSide:e=>e?{[Vu]:e}:null,listEmpty:e=>e?{[Hu]:``}:null};function Wu(e,t,n){let{setFocused:r,focusOwnerRef:i}=hu(),a=J(t=>{(t?!e:i.current===a)&&(i.current=t&&a,n?.(t),r(t))});return Y(()=>{let e=t.current;return e?.getRootNode()?.activeElement===e&&a(!0),()=>a(!1)},[e,t,a]),a}var Gu=5;function Ku(e,t){let n=qu(t);return e.clientX>=n.left-Gu&&e.clientX<=n.right+Gu&&e.clientY>=n.top-Gu&&e.clientY<=n.bottom+Gu}function qu(e){let t=e.getBoundingClientRect(),n=Bt(e);if(ei)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function Ju(e,t){return e??t}function Yu(e){let t=e.useState(`mounted`),n=e.useState(`popupSide`),r=e.useState(`positionerElement`);return t&&r?n:null}function Xu(){return Bl().filteredItems.length===0}function Zu(e){return e===`rtl`?[`ArrowRight`,`ArrowLeft`]:[`ArrowLeft`,`ArrowRight`]}function Qu(e,t,n){let r=e.context.listRef.current[t];r&&(e.context.selectionEventRef.current=n,r.click(),e.context.selectionEventRef.current=null)}var $u=X.forwardRef(function(e,t){let{render:n,className:r,nativeButton:i=!0,disabled:a=!1,id:o,style:s,...c}=e,{state:l,disabled:u,setTouched:d,validationMode:f,validation:p}=hu(),{labelId:m}=xu(),h=Rl(),g=h.useState(`selectionMode`),_=h.useState(`disabled`),v=h.useState(`readOnly`),y=h.useState(`required`),b=h.useState(`positionerElement`),x=h.useState(`listElement`),S=h.useState(`popupId`),C=h.useState(`triggerProps`),w=h.useState(`inputInsidePopup`),T=h.useState(`id`),E=h.useState(`labelId`),D=h.useState(`open`),O=h.useState(`selectedValue`),k=h.useState(`activeIndex`),A=h.useState(`selectedIndex`),j=h.useState(`hasSelectedValue`),M=zl(),N=Vl(),P=zr(),F=u||_||a,I=Xu(),L=Yu(h),R=X.useRef(null),z=Wu(F,R);Su({id:w?o:void 0});let ee=w?o??T:o,te=Ju(m,E),B;D&&w?B=S??Cu(T):D&&(B=x?.id);let ne=X.useRef(``);function V(e){ne.current=e.pointerType}let{reference:H}=yc(M,{enabled:!D&&!v&&!_&&g===`single`,listRef:h.context.labelsRef,activeIndex:k,selectedIndex:A,onMatch(e){let t=h.context.valuesRef.current[e];t!==void 0&&h.context.setSelectedValue(t,$(io))}}),{reference:U}=_s(M,{enabled:!_,event:`mousedown`}),{buttonRef:re,getButtonProps:ie}=en({native:i,disabled:F}),W={...l,readOnly:v,open:D,disabled:F,popupSide:L,listEmpty:I,placeholder:g!==`none`&&!j},ae=J(e=>{h.set(`triggerElement`,e)});return on(`button`,e,{ref:[t,re,R,ae],state:W,props:[C,U,H,{id:ee,tabIndex:w?0:-1,role:w?`combobox`:void 0,"aria-expanded":D,"aria-haspopup":w?`dialog`:`listbox`,"aria-controls":B,"aria-required":w&&y||void 0,"aria-readonly":w&&v||void 0,"aria-labelledby":te,onPointerDown:V,onPointerEnter:V,onFocus(){z(!0),!F&&P.start(0,h.context.forceMount)},onBlur(e){if(!Q(b,e.relatedTarget)&&(d(!0),z(!1),f===`onBlur`)){let e=g===`none`?N:O;p.commit(e)}},onMouseDown(e){if(F||(w||M.set(`domReferenceElement`,e.currentTarget),h.context.forceMount(),ne.current!==`touch`&&(h.context.inputRef.current?.focus(),w||e.preventDefault()),D))return;let t=Mn(e.currentTarget);function n(e){let t=h.state.triggerElement;if(!t)return;let n=ci(e),r=h.state.positionerElement,i=h.state.listElement;Q(t,n)||Q(r,n)||Q(i,n)||Ku(e,t)||h.context.setOpen(!1,$(xo,e))}w&&t.addEventListener(`mouseup`,n,{once:!0})},onKeyDown(e){(e.key===`ArrowDown`||e.key===`ArrowUp`)&&(Ui(e),h.context.setOpen(!0,$(vo,e.nativeEvent)),h.context.inputRef.current?.focus())}},p.getValidationProps(F,c),ie],stateAttributesMapping:Uu})}),ed=X.createContext(void 0);function td(){return X.useContext(ed)}var nd=X.createContext(void 0);function rd(e){let t=X.useContext(nd);if(t===void 0&&!e)throw Error(vn(21));return t}var id=X.forwardRef(function(e,t){let n=Rl(),{buttonRef:r,getButtonProps:i}=en({native:!1}),a=tn(t,r);function o(e){n.context.setOpen(!1,$(uo,e.nativeEvent,e.currentTarget))}let s=i({onClick:o});return(0,Z.jsx)(`span`,{ref:a,...s,"aria-label":`Dismiss`,tabIndex:void 0,style:_r})}),ad=X.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,id:a,style:o,...s}=e,{state:c,disabled:l,setTouched:u,validationMode:d,validation:f}=hu(),{labelId:p}=xu(),m=td(),h=!!rd(!0),g=Rl(),_=Vl(),v=Lu(),y=g.useState(`required`),b=g.useState(`disabled`),x=g.useState(`readOnly`),S=g.useState(`name`),C=g.useState(`form`),w=g.useState(`selectionMode`),T=g.useState(`autoHighlight`),E=g.useState(`inputProps`),D=g.useState(`triggerProps`),O=g.useState(`open`),k=g.useState(`mounted`),A=g.useState(`selectedValue`),j=g.useState(`id`),M=g.useState(`inline`),N=g.useState(`modal`),P=!!T,F=Yu(g),I=l||b||i,L=Xu(),R=Wu(I,g.context.inputRef),z=h||M,ee=!z||N,te=yu(a??(z?void 0:j)),B=h?uu:c,[ne,V]=X.useState(null),H=X.useRef(!1),U=X.useRef(null);Y(()=>{O||(U.current=null)},[O]);let re=w===`none`&&!h,ie=J(e=>{let t=h||g.state.inline;t&&!g.state.hasInputValue&&g.context.setInputValue(``,$(io)),g.update({inputElement:e,inputInsidePopup:t,inputOwnsFormValue:re})}),W=h?s:f.getValidationProps(I,s);function ae(e){g.context.setIndices({activeIndex:null,selectedIndex:null,type:Ml(e),event:e})}let oe={...B,open:O,disabled:I,readOnly:x,popupSide:F,listEmpty:L};function G(e){if(!m)return;let t,n=m.chipsRef.current.length,[r]=Zu(v);return e.key===r&&(e.currentTarget.selectionStart??0)===0&&A.length>0&&(e.preventDefault(),t=n>0?n-1:void 0),t}let se=on(`input`,e,{state:oe,ref:[t,g.context.inputRef,ie],props:[E,D,{value:ne??_,"aria-readonly":x||void 0,"aria-required":y||void 0,"aria-labelledby":p,disabled:I,readOnly:x,required:w===`none`?y:void 0,form:C,...re&&S&&{name:S},id:te,onFocus(){if(R(!0),!M)return;let e=U.current;U.current=null,e!=null&&Object.hasOwn(g.context.valuesRef.current,e)&&g.context.setIndices({activeIndex:e})},onBlur(){u(!0),R(!1);let e=g.state.activeIndex;if(M&&e!==null&&T!==`always`&&(U.current=e,g.context.setIndices({activeIndex:null})),d===`onBlur`){let e=w===`none`?_:A;f.commit(e)}},onCompositionStart(e){Jr||(H.current=!0,V(e.currentTarget.value))},onCompositionEnd(e){H.current=!1;let t=e.currentTarget.value;V(null),g.context.setInputValue(t,$(po,e.nativeEvent))},onChange(e){let t=e.nativeEvent,n=t.inputType,r=!n||n===`insertReplacementText`,i=H.current||!r;function a(e){!x&&!I&&e&&i&&(g.context.setOpen(!0,$(po,t)),P||ae(t))}if(H.current){let n=e.currentTarget.value;V(n),n===``&&!g.state.openOnInputClick&&!g.state.inputInsidePopup&&g.context.setOpen(!1,$(mo,t));let r=n.trim(),i=P&&r!==``;a(r),O&&g.state.activeIndex!==null&&!i&&ae(t);return}let o=$(po,t);if(g.context.setInputValue(e.currentTarget.value,o),o.isCanceled)return;let s=e.currentTarget.value===``,c=$(mo,t);s&&!g.state.inputInsidePopup&&(w===`single`&&g.context.setSelectedValue(null,c),g.state.openOnInputClick||g.context.setOpen(!1,c)),a(e.currentTarget.value.trim()),O&&g.state.activeIndex!==null&&!P&&ae(t)},onKeyDown(e){if(e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)return;if(I||x){x&&e.key===`Enter`&&O&&g.state.activeIndex!==null&&Ui(e);return}let t=e.currentTarget,n=t.scrollWidth-t.clientWidth,r=v===`rtl`;if(e.key===`Home`){Ui(e);let n=Qr&&r?t.value.length:0;t.setSelectionRange(n,n),t.scrollLeft=0;return}if(e.key===`End`){Ui(e);let i=Qr&&r?0:t.value.length;t.setSelectionRange(i,i),t.scrollLeft=r?-n:n;return}if(!k&&e.key===`Escape`){let t=w===`multiple`&&Array.isArray(A)?A.length===0:A===null,n=$(_o,e.nativeEvent),r=w===`multiple`?[]:null;g.context.setInputValue(``,n),g.context.setSelectedValue(r,n),t||g.state.inline||n.isPropagationAllowed||e.stopPropagation();return}if(m&&e.key===`Backspace`&&t.value===``&&Array.isArray(A)&&A.length>0){let t=m.chipsRef.current.length,n=t>0?t-1:A.length-1,r=A.filter((e,t)=>t!==n);ae(e.nativeEvent),g.context.setSelectedValue(r,$(io,e.nativeEvent));return}let i=G(e);if(i!==void 0&&m?.chipsRef.current[i]?.focus(),e.which!==229&&e.key===`Enter`&&O){let t=g.state.activeIndex,n=e.nativeEvent;if(t===null){if(M)return;g.context.setOpen(!1,$(io,n));return}Ui(e),Qu(g,t,n)}}},W],stateAttributesMapping:Uu}),ce=h?(0,Z.jsx)(mu.Provider,{value:pu,children:se}):se;return(0,Z.jsxs)(X.Fragment,{children:[O&&ee&&(0,Z.jsx)(id,{ref:g.context.startDismissRef}),ce]})}),od={...yi,...Ai},sd=X.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,nativeButton:a=!0,keepMounted:o=!1,style:s,...c}=e,{disabled:l}=hu(),u=Rl(),d=u.useState(`selectionMode`),f=u.useState(`disabled`),p=u.useState(`readOnly`),m=u.useState(`open`),h=u.useState(`selectedValue`),g=u.useState(`hasSelectionChips`),_=Vl(),v=!1;v=d===`none`?_!==``:d===`single`?h!=null:g;let y=l||f||i,{buttonRef:b,getButtonProps:x}=en({native:a,disabled:y}),{mounted:S,transitionStatus:C,setMounted:w}=Ss(v),T={disabled:y,visible:v,open:m,transitionStatus:C};Ds({open:v,ref:u.context.clearRef,onComplete(){v||w(!1)}});let E=on(`button`,e,{state:T,ref:[t,b,u.context.clearRef],props:[{tabIndex:-1,children:`x`,onMouseDown(e){e.preventDefault()},onClick(e){if(y||p)return;let t=Ml(e);u.context.setInputValue(``,$(fo,e.nativeEvent)),d===`none`?u.context.setIndices({activeIndex:null,type:t,event:e.nativeEvent}):(u.context.setSelectedValue(Array.isArray(h)?[]:null,$(fo,e.nativeEvent)),u.context.setIndices({activeIndex:null,selectedIndex:null,type:t,event:e.nativeEvent})),u.context.inputRef.current?.focus()}},c,x],stateAttributesMapping:od});return o||S?E:null}),cd=X.createContext(null);function ld(){return X.useContext(cd)}function ud(e){let{children:t}=e,{filteredItems:n}=Bl(),r=ld(),i=r?r.items:n;return(0,Z.jsx)(X.Fragment,{children:i.map(t)})}var dd=X.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function fd(){return X.useContext(dd)}function pd(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=J(i),[,o]=X.useState(0),s=kt(hd).current,c=kt(md).current,l=X.useRef(0),u=X.useRef(!0),d=X.useRef(null),f=X.useRef(null),p=J(()=>{u.current||(u.current=!0,o(e=>e+1))}),m=J((e,t)=>{c.set(e,t),p()}),h=J(e=>{c.delete(e),p()}),g=J(e=>{let t=new Map;return n.current.length=0,r&&(r.current.length=0),e.forEach(e=>{t.set(e.element,{...e.registration.metadata??{},index:e.index}),n.current[e.index]=e.element,r&&(r.current[e.index]=e.registration.label===void 0?e.registration.textRef?.current?.textContent??e.element.textContent:e.registration.label)}),l.current=n.current.length,t});function _(e){if(f.current?.disconnect(),f.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!vd(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&yd(r,n)>0){t.disconnect(),p();return}r=n}});f.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=_d(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let v=J(()=>{let[e,t]=gd(c),n=g(e),r=d.current,i=!r||r.length!==e.length||e.some((e,t)=>{let n=r[t];return e.index!==n.index||e.element!==n.element||e.registration.index!==n.registration.index||e.registration.metadata!==n.registration.metadata});_(t),d.current=e,u.current=!1,i&&(s.forEach(e=>e(n)),a(n))});Y(()=>(!u.current&&d.current&&g(d.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,g]),Y(()=>{u.current&&v()}),Y(()=>()=>{f.current?.disconnect(),u.current=!0},[]);let y=J(e=>(s.add(e),()=>{s.delete(e)})),b=X.useMemo(()=>({register:m,unregister:h,subscribeMapChange:y,nextIndexRef:l}),[m,h,y,l]);return(0,Z.jsx)(dd.Provider,{value:b,children:t})}function md(){return new Map}function hd(){return new Set}function gd(e){let t=new Set,n=[],r=[];e.forEach((e,i)=>{if(!i.isConnected)return;let a=e.index,o={index:a??-1,element:i,registration:e};a===null?r.push(o):a>=0&&(t.add(a),n.push(o))});let i=0;return r.sort((e,t)=>yd(e.element,t.element)),r.forEach(e=>{for(;t.has(i);)i+=1;e.index=i,n.push(e),i+=1}),t.size>0&&n.sort((e,t)=>e.index-t.index),[n,r.map(e=>e.element)]}function _d(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function vd(e){for(let t of e)for(let e=0;e<t.removedNodes.length;e+=1)if(t.removedNodes[e].isConnected)return!0;return!1}function yd(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}var bd=X.forwardRef(function(e,t){var n;let{render:r,className:i,style:a,children:o,...s}=e,c=Rl(),l=zl(),u=!!rd(!0),{filteredItems:d,hasItems:f}=Bl(),p=c.useState(`selectionMode`),m=c.useState(`grid`),h=c.useState(`readOnly`),g=c.useState(`listProps`),_=c.useState(`virtualized`),v=c.useState(`forceMounted`),y=p===`multiple`,b=d.length===0,x=J(e=>{c.set(`positionerElement`,e)}),S=J(e=>{c.set(`listElement`,e)}),C=X.useMemo(()=>typeof o==`function`?n||=(0,Z.jsx)(ud,{children:o}):o,[o]),w={empty:b},T=l.useState(`floatingId`),E=on(`div`,e,{state:w,ref:[t,S,u?null:x],props:[g,{children:C,tabIndex:-1,id:T,role:m?`grid`:`listbox`,"aria-multiselectable":y?`true`:void 0,"aria-readonly":!m&&h?!0:void 0,onKeyDown(e){if(!(c.state.disabled||c.state.readOnly)&&e.key===`Enter`){let t=c.state.activeIndex;if(t==null)return;Ui(e),Qu(c,t,e.nativeEvent)}}},s]});if(_)return E;let D=f&&!v?void 0:c.context.labelsRef;return(0,Z.jsx)(pd,{elementsRef:c.context.listRef,labelsRef:D,children:E})}),xd=X.createContext(void 0);function Sd(){let e=X.useContext(xd);if(e===void 0)throw Error(vn(20));return e}var Cd=X.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=Rl(),a=i.useState(`mounted`),o=i.useState(`forceMounted`);return a||n||o?(0,Z.jsx)(xd.Provider,{value:n,children:(0,Z.jsx)(Zo,{ref:t,...r})}):null});function wd(e){return sn(19)?e:e?`true`:void 0}function Td(e){let{nodeId:t,externalTree:n,rootContext:r}=e,i=r.useState(`referenceElement`),a=r.useState(`floatingElement`),o=r.useState(`domReferenceElement`),s=r.useState(`open`),c=r.useState(`floatingId`),[l,u]=X.useState(null),d=X.useRef(null),f=rs(n),p=X.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),m=Tl({...e,elements:{...p,...l&&{reference:l}}}),h=X.useCallback(e=>{let t=Mt(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),m.refs.setReference(t)},[m.refs]),g=X.useMemo(()=>({...m.refs,setPositionReference:h,domReference:d}),[m.refs,h]),_=X.useMemo(()=>({...m.elements,domReference:o}),[m.elements,o]),v=X.useMemo(()=>({...m,dataRef:r.context.dataRef,open:s,onOpenChange:r.setOpen,events:r.context.events,floatingId:c,refs:g,elements:_,nodeId:t,rootStore:r}),[m,g,_,t,r,s,c]);return Y(()=>{o&&(d.current=o)},[o]),Y(()=>{r.context.dataRef.current.floatingContext=v;let e=f?.nodesRef.current.find(e=>e.id===t);e&&(e.context=v)}),X.useMemo(()=>({...m,context:v,refs:g,elements:_,rootStore:r}),[m,g,_,v,r])}var Ed=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=na(e,t)||{};if(l==null)return{};let d=ba(u),f={x:n,y:r},p=ca(i),m=oa(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=s.floating[y]||a.floating[m],C=b/2-x/2,w=S/2-h[m]/2-1,T=Math.min(d[_],w),E=Math.min(d[v],w),D=T,O=S-h[m]-E,k=S/2-h[m]/2+C,A=ta(D,k,O),j=!c.arrow&&ia(i)!=null&&k!==A&&a.reference[m]/2-(k<D?T:E)-h[m]/2<0,M=j?k<D?k-D:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Dd=(e,t)=>{let{name:n,fn:r}=Ed(e);return{name:n,fn:r,options:[e,t]}},Od={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},kd={sideX:`left`,sideY:`top`},Ad=`--available-width`,jd=`--available-height`,Md=`--anchor-width`,Nd=`--anchor-height`,Pd=`--transform-origin`,Fd=Ad,Id=jd;function Ld(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function Rd(e,t,n){let{rects:r,placement:i}=e;return{side:Ld(t,ra(i),n),align:ia(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function zd(e){return Bd(e,Td)}function Bd(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shift:v,nodeId:y,adaptiveOrigin:b,lazyFlip:x=!1,externalTree:S}=e,C=_.side||`flip`,w=_.align||`flip`,T=_.fallbackAxisSide||`end`,E=v?.crossAxis??!1,D=v?.rootBoundary,O=typeof n==`function`?n:void 0,k=J(O),A=O?k:n,j=pr(n),M=pr(g),N=Lu()===`rtl`,[P,F]=X.useState(null);!g&&P!==null&&F(null);let I=x===`placement`,L=P?ra(P):null,R=P&&I?ia(P)||`center`:null,z=L||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":N?`left`:`right`,"inline-start":N?`right`:`left`}[i],ee=R||o,te=ee===`center`?z:`${z}-${ee}`,B=l;typeof B==`number`?B={top:B,right:B,bottom:B,left:B}:B&&={top:B.top||0,right:B.right||0,bottom:B.bottom||0,left:B.left||0};let ne=+(i===`bottom`),V=+(i===`top`),H=+(i===`right`),U=+(i===`left`),re={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:B},ie=X.useRef(null),W=pr(a),ae=pr(s),oe=typeof a==`function`?0:a,G=typeof s==`function`?0:s,se=[];p&&se.push(p),se.push(El(e=>{let t=Rd(e,i,N),n=typeof W.current==`function`?W.current(t):W.current,r=typeof ae.current==`function`?ae.current(t):ae.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[oe,G,N,i]));let ce=w===`none`&&C!==`shift`,le=!ce&&(u||E||C===`shift`),ue=C===`none`?null:kl({...re,padding:{top:B.top+1+ne,right:B.right+1+U,bottom:B.bottom+1+V,left:B.left+1+H},mainAxis:!E&&C===`flip`,crossAxis:w===`flip`&&`alignment`,fallbackAxisSideDirection:T}),de=ce?null:Dl({...re,rootBoundary:D,mainAxis:w!==`none`,crossAxis:le,limiter:u||E?void 0:Ol(e=>{if(!ie.current)return{};let{width:t,height:n}=ie.current.getBoundingClientRect(),r=sa(ra(e.placement)),i=r===`y`?t:n,a=r===`y`?B.left+B.right:B.top+B.bottom;return{offset:i/2+a/2}})},[re,u,E,D,B,w]);C===`shift`||w===`shift`||ee===`center`?se.push(de,ue):se.push(ue,de),se.push(Al({...re,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!M.current)return;let i=e.style;i.setProperty(Fd,`${t}px`),i.setProperty(Id,`${n}px`);let a=Bt(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(Md,`${u}px`),i.setProperty(Nd,`${d}px`)}}),Dd(e=>({element:ie.current||Mn(e.elements.floating).createElement(`div`),padding:ie.current?d:0}),[d]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=ra(r),u=ia(r),d=sa(l)===`y`,f=ie.current,p=typeof a==`function`?a(Rd(e,i,N)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return le&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(Pd,d?`${m} ${h}`:`${h} ${m}`),{}}},Od,b),Y(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let fe=X.useMemo(()=>({ancestorScroll:!f,elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:pe,elements:me,x:he,y:ge,middlewareData:K,update:_e,placement:ve,context:ye,isPositioned:be,floatingStyles:xe}=t({rootContext:h,open:m?g:void 0,placement:te,middleware:se,strategy:r,whileElementsMounted:m?void 0:(...e)=>pl(...e,fe),nodeId:y,externalTree:S}),{sideX:Se,sideY:Ce}=K.adaptiveOrigin||kd,we=be?r:`fixed`,Te=X.useMemo(()=>{let e;return e=be?b?{position:we,[Se]:he,[Ce]:ge}:{...xe,position:we}:{position:we,top:0,left:0},e[Fd]=`100vw`,e[Id]=`100vh`,be||(e.opacity=0),e},[b,we,Se,he,Ce,ge,xe,be]),Ee=X.useRef(null);Y(()=>{if(!g)return;let e=j.current,t=typeof e==`function`?e():e,n=(Vd(t)?t.current:t)||null;n!==Ee.current&&(pe.setPositionReference(n),Ee.current=n)},[g,pe,A,j]),X.useEffect(()=>{if(!g)return;let e=j.current;typeof e!=`function`&&Vd(e)&&e.current!==Ee.current&&(pe.setPositionReference(e.current),Ee.current=e.current)},[g,pe,A,j]),X.useEffect(()=>{if(m&&g&&me.reference&&me.floating)return pl(me.reference,me.floating,_e,fe)},[m,g,me,_e,fe]);let De=ra(ve),Oe=Ld(i,De,N),ke=ia(ve)||`center`,Ae=!!K.hide?.referenceHidden;Y(()=>{x&&g&&be&&(De!==z||I&&ke!==ee)&&F(ve)},[x,I,g,be,ve,De,ke,z,ee]);let je=X.useMemo(()=>({position:`absolute`,top:K.arrow?.y,left:K.arrow?.x}),[K.arrow]),Me=K.arrow?.centerOffset!==0;return X.useMemo(()=>({positionerStyles:Te,arrowStyles:je,arrowRef:ie,arrowUncentered:Me,side:Oe,align:ke,physicalSide:De,anchorHidden:Ae,refs:pe,context:ye,isPositioned:be,update:_e}),[Te,je,ie,Me,Oe,ke,De,Ae,pe,ye,be,_e])}function Vd(e){return e!=null&&`current`in e}var Hd=X.forwardRef(function(e,t){let{cutout:n,...r}=e,i;if(n){let e=n.getBoundingClientRect();i=`polygon(0% 0%,100% 0%,100% 100%,0% 100%,0% 0%,${e.left}px ${e.top}px,${e.left}px ${e.bottom}px,${e.right}px ${e.bottom}px,${e.right}px ${e.top}px,${e.left}px ${e.top}px)`}return(0,Z.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function Ud(e){return e===`starting`?Uo:$t}function Wd(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),on(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},Ud(r),i],stateAttributesMapping:Mi})}var Gd={},Kd={},qd=``;function Jd(e,t){return yn(e)?e:t}function Yd(e,t,n){return/hidden|clip/.test(e.getComputedStyle(Jd(t,n)).overflowY)}function Xd(e){if(typeof document>`u`)return!1;let t=Mn(e);return Bt(t).innerWidth-t.documentElement.clientWidth>0}function Zd(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=Mn(e),n=t.documentElement,r=t.body,i=Jd(n,r),a=i.style.overflowY,o=n.style.scrollbarGutter;n.style.scrollbarGutter=`stable`,i.style.overflowY=`scroll`;let s=i.offsetWidth;i.style.overflowY=`hidden`;let c=i.offsetWidth;return i.style.overflowY=a,n.style.scrollbarGutter=o,s===c}function Qd(e){let t=Mn(e),n=t.documentElement,r=t.body,i=Jd(n,r),a={overflowY:i.style.overflowY,overflowX:i.style.overflowX};return Object.assign(i.style,{overflowY:`hidden`,overflowX:`hidden`}),()=>{Object.assign(i.style,a)}}function $d(e){let t=Mn(e),n=t.documentElement,r=t.body,i=Bt(n),a=0,o=0,s=!1,c=ri.create();if(Zr&&(i.visualViewport?.scale??1)!==1)return()=>{};function l(){let t=i.getComputedStyle(n),c=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,Gd={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},qd=n.style.scrollBehavior,Kd={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};let u=n.scrollHeight>n.clientHeight,d=n.scrollWidth>n.clientWidth,f=t.overflowY===`scroll`||c.overflowY===`scroll`,p=t.overflowX===`scroll`||c.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(c.marginTop)+parseFloat(c.marginBottom),_=parseFloat(c.marginLeft)+parseFloat(c.marginRight),v=Jd(n,r);s=Zd(e),s?(n.style.scrollbarGutter=l,v.style.overflowY=`hidden`,v.style.overflowX=`hidden`):(Object.assign(n.style,{scrollbarGutter:l,overflowY:`hidden`,overflowX:`hidden`}),(u||f)&&(n.style.overflowY=`scroll`),(d||p)&&(n.style.overflowX=`scroll`),Object.assign(r.style,{position:`relative`,height:g||h?`calc(100dvh - ${g+h}px)`:`100dvh`,width:_||m?`calc(100vw - ${_+m}px)`:`100vw`,boxSizing:`border-box`,overflowY:`hidden`,overflowX:`hidden`,scrollBehavior:`unset`}),r.scrollTop=a,r.scrollLeft=o,n.setAttribute(`data-base-ui-scroll-locked`,``),n.style.scrollBehavior=`unset`)}function u(){Object.assign(n.style,Gd),Object.assign(r.style,Kd),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=qd)}function d(){u(),c.request(l)}l();let f=Pr(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var ef=new class{lockCount=0;restore=null;timeoutLock=Rr.create();timeoutUnlock=Rr.create();acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}release=()=>{--this.lockCount,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(e){if(this.lockCount===0||this.restore!==null)return;let t=Mn(e),n=t.documentElement,r=t.body,i=Bt(n);if(Yd(i,n,r)){let t=new i.MutationObserver(()=>{Yd(i,n,r)||(t.disconnect(),this.restore=null,this.lock(e))}),a={attributes:!0};t.observe(n,a),t.observe(r,a),this.restore=()=>t.disconnect();return}let a=Kr||!Xd(e);this.restore=a?Qd(e):$d(e)}};function tf(e=!0,t=null){Y(()=>{if(e)return ef.acquire(t)},[e,t])}var nf=20;function rf(e,t,n,r){let[i,a]=X.useState(!1);Y(()=>{if(!e||!t||n==null){a(!1);return}let r=Mn(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-nf)},[e,t,n]),tf(e&&(!t||i),r)}var af=X.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a,side:o,align:s,sideOffset:c,alignOffset:l,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f,sticky:p,disableAnchorTracking:m=!1,collisionAvoidance:h=Wo,style:g,..._}=e,v=Rl(),y=zl(),b=Sd(),x=v.useState(`modal`),S=v.useState(`open`),C=v.useState(`mounted`),w=v.useState(`openMethod`),T=v.useState(`positionerElement`),E=v.useState(`triggerElement`),D=v.useState(`inputElement`),O=v.useState(`inputGroupElement`),k=v.useState(`inputInsidePopup`),A=v.useState(`transitionStatus`),j=Xu(),M=zd({anchor:i??(k?E:O??D),floatingRootContext:y,positionMethod:a,mounted:C,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m,keepMounted:b,collisionAvoidance:h,lazyFlip:!0});rf(S&&x,w===`touch`,T,E);let N={open:S,side:M.side,align:M.align,anchorHidden:M.anchorHidden,empty:j};Y(()=>{v.set(`popupSide`,M.side)},[v,M.side]);let P=J(e=>{v.set(`positionerElement`,e)}),F=Wd(e,N,{styles:M.positionerStyles,transitionStatus:A,props:_,refs:[t,P],hidden:!C,inert:!S});return(0,Z.jsxs)(nd.Provider,{value:M,children:[C&&x&&(0,Z.jsx)(Hd,{inert:wd(!S),cutout:O??D??E}),F]})}),of={...Mi,...yi},sf=X.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...s}=e,c=Rl(),l=rd(),u=zl(),d=c.useState(`mounted`),f=c.useState(`open`),p=c.useState(`openMethod`),m=c.useState(`popupProps`),h=c.useState(`transitionStatus`),g=c.useState(`inputInsidePopup`),_=c.useState(`inputElement`),v=c.useState(`modal`),y=c.useState(`id`),b=Xu(),x=s.id??(g?Cu(y):void 0);Y(()=>(c.set(`popupId`,c.context.popupRef.current?.id||x),()=>{c.set(`popupId`,void 0)}),[c,x]),Ds({open:f,ref:c.context.popupRef,onComplete(){f&&c.context.onOpenChangeComplete(!0)}});let S={open:f,side:l.side,align:l.align,anchorHidden:l.anchorHidden,transitionStatus:h,empty:b},C=on(`div`,e,{state:S,ref:[t,c.context.popupRef],props:[m,{id:x,role:g?`dialog`:`presentation`,onFocus(e){let t=ci(e.nativeEvent);p!==`touch`&&(Q(c.state.listElement,t)||t===e.currentTarget)&&c.context.inputRef.current?.focus()}},Ud(h),s],stateAttributesMapping:of}),w=a===void 0?g?e=>e===`touch`?c.context.popupRef.current:_:!1:a,T;T=o??(g?void 0:!1);let E=!g||v;return(0,Z.jsx)(gs,{context:u,disabled:!d,modal:E,openInteractionType:p,initialFocus:w,returnFocus:T,getInsideElements:()=>[c.context.startDismissRef.current,c.context.endDismissRef.current],children:(0,Z.jsxs)(X.Fragment,{children:[C,E&&(0,Z.jsx)(id,{ref:c.context.endDismissRef})]})})});function cf(e={}){let{guess:t,label:n,metadata:r,textRef:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,nextIndexRef:l}=fd(),u=X.useRef(-1),[d,f]=X.useState(a==null&&t?()=>{if(u.current===-1){let e=l.current;l.current+=1,u.current=e}return u.current}:-1),p=a??d,m=X.useRef(null),h=X.useCallback(e=>{let t=m.current;t&&s(t),m.current=e,e&&o(e,{metadata:r??null,index:a??null,label:n,textRef:i})},[a,o,s,r,n,i]);return Y(()=>{if(a==null)return c(e=>{let t=m.current?e.get(m.current)?.index:null;t!=null&&f(t)})},[a,c]),{ref:h,index:p}}var lf=X.createContext(void 0);function uf(){let e=X.useContext(lf);if(!e)throw Error(vn(19));return e}var df=X.createContext(!1);function ff(){return X.useContext(df)}function pf(e){let{componentProps:t,forwardedRef:n,virtualized:r,indexFromFilter:i}=e,{render:a,className:o,style:s,value:c=null,index:l,disabled:u=!1,nativeButton:d=!1,...f}=t,p=X.useRef(null),m=cf({guess:!0,index:l,textRef:p}),h=Rl(),g=ff(),_=Hl(),{props:v,id:y,selectionMode:b,disabled:x,readOnly:S,isItemEqualToValue:C}=h.useState(`itemRoot`),w=x||u,T=b!==`none`,E=l??i??m.index,D=E!==-1,O=h.useState(`isActive`,E),k=h.useState(`isSelected`,c),A=X.useRef(null),j=y!=null&&D?`${y}-${E}`:void 0,M=k&&T;Y(()=>{if(!D||!r&&l==null)return;let e=h.context.listRef.current;return e[E]=A.current,()=>{delete e[E]}},[D,r,E,l,h]),Y(()=>{if(!D||_)return;let e=h.context.valuesRef.current;return e[E]=c,()=>{delete e[E]}},[D,_,E,c,h]),Y(()=>{if(!D||_)return;let e=h.state.selectedValue,t=h.state.selectedIndex;h.state.selectionMode===`multiple`&&Array.isArray(e)?t=Zl(E,c,h.context.valuesRef.current,e,C,t):Gl(c,e,C)&&(t=E),h.set(`selectedIndex`,t)},[D,_,h,E,c,C]);let{getButtonProps:N,buttonRef:P}=en({disabled:w,focusableWhenDisabled:!0,native:d,composite:!0}),F={disabled:w,selected:M,highlighted:O};function I(e){function t(){h.context.handleSelection(e,c)}h.state.submitOnItemClick?(Nn.flushSync(t),h.context.requestSubmit()):t()}let L={id:j,role:g?`gridcell`:`option`,"aria-selected":T?M:void 0,tabIndex:void 0,onPointerDownCapture(e){e.isPrimary&&(h.context.pointerDownItemRef.current=e.currentTarget),e.preventDefault()},onMouseDown(e){e.preventDefault()},onClick(e){w||S||I(e.nativeEvent)},onMouseUp(e){let t=h.context.pointerDownItemRef.current===e.currentTarget;h.context.pointerDownItemRef.current=null,!(w||S||e.button!==0||t||!O)&&I(e.nativeEvent)}},R=on(`div`,t,{ref:[P,n,m.ref,A],state:F,props:[v,L,f,N]}),z=X.useMemo(()=>({selected:M,textRef:p}),[M,p]);return(0,Z.jsx)(lf.Provider,{value:z,children:R})}function mf(e){let{componentProps:t,forwardedRef:n}=e,r=Rl().useState(`isItemEqualToValue`),{flatFilteredValues:i}=Bl(),a=Jl(i,t.value??null,r);return(0,Z.jsx)(pf,{componentProps:t,forwardedRef:n,virtualized:!0,indexFromFilter:a})}var hf=X.memo(X.forwardRef(function(e,t){let n=Rl().useState(`virtualized`);return n&&e.index==null?(0,Z.jsx)(mf,{componentProps:e,forwardedRef:t}):(0,Z.jsx)(pf,{componentProps:e,forwardedRef:t,virtualized:n,indexFromFilter:void 0})}));function gf(e){return on(e.defaultTagName??`div`,e,e)}var _f=X.createContext(void 0);function vf(){let e=X.useContext(_f);if(e===void 0)throw Error(vn(13));return e}var yf={imageLoadingStatus:()=>null},bf=X.forwardRef(function(e,t){let{className:n,render:r,style:i,...a}=e,[o,s]=X.useState(`idle`),c={imageLoadingStatus:o},l=X.useMemo(()=>({imageLoadingStatus:o,setImageLoadingStatus:s}),[o,s]),u=on(`span`,e,{state:c,ref:t,props:a,stateAttributesMapping:yf});return(0,Z.jsx)(_f.Provider,{value:l,children:u})});function xf(e,{referrerPolicy:t,crossOrigin:n,sizes:r,srcSet:i},a){let o=X.useState(`idle`),s=o[1];return Y(()=>{if(!a)return un;if(!e&&!i)return s(`error`),un;let o=!0,c=new window.Image,l=e=>()=>{o&&s(e)};return s(`loading`),c.onload=l(`loaded`),c.onerror=l(`error`),t&&(c.referrerPolicy=t),c.crossOrigin=n??null,r&&(c.sizes=r),i&&(c.srcset=i),e&&(c.src=e),c.complete&&s(c.naturalWidth>0?`loaded`:`error`),()=>{o=!1}},[a,e,i,r,n,t,s]),o}var Sf={...yf,...yi},Cf=X.forwardRef(function(e,t){let{className:n,render:r,onLoadingStatusChange:i,keepMounted:a=!1,style:o,sizes:s,srcSet:c,src:l,...u}=e,{setImageLoadingStatus:d}=vf(),[f,p]=xf(l,e,!a),m=f===`loaded`,{mounted:h,transitionStatus:g,setMounted:_}=Ss(m),v=X.useRef(null),y=X.useRef(!0);Y(()=>{if(!a)return;let e=y.current;y.current=!1;let t=v.current;if(!t)return;if(!t.complete){p(`loading`);return}let n=t.naturalWidth>0?`loaded`:`error`;p(n),n===`loaded`&&e&&_(!0)},[a,l,c,s,u.crossOrigin,u.referrerPolicy,r,p,_]);let b=a?{"data-loading":f===`loading`?``:void 0,"data-error":f===`error`?``:void 0,"aria-hidden":f!==`loaded`||void 0,onLoad(){p(`loaded`)},onError(){p(`error`)}}:void 0,x=J(e=>{i?.(e),d(e)});Y(()=>{f!==`idle`&&x(f)},[f,x]),Y(()=>()=>d(`idle`),[d]),Ds({enabled:!m,open:m,ref:v,onComplete(){m||_(!1)}});let S={imageLoadingStatus:f,transitionStatus:a&&g===`ending`?void 0:g},C=a||h,w={};s!==void 0&&(w.sizes=s),c!==void 0&&(w.srcSet=c),l!==void 0&&(w.src=l);let T=on(`img`,e,{state:S,ref:[t,v],props:[b,u,w],stateAttributesMapping:Sf,enabled:C});return C?T:null}),wf=X.forwardRef(function(e,t){let{className:n,render:r,delay:i=0,style:a,...o}=e,{imageLoadingStatus:s}=vf(),[c,l]=X.useState(i===0),u=zr();return X.useEffect(()=>(i>0?u.start(i,()=>l(!0)):l(!0),u.clear),[u,i]),on(`span`,e,{state:{imageLoadingStatus:s},ref:t,props:o,stateAttributesMapping:yf,enabled:s!==`loaded`&&(i===0||c)})});function Tf(e){let t=(0,Pn.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,size:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`default`:i,o;t[4]===n?o=t[5]:(o=qt(`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`,n),t[4]=n,t[5]=o);let s;return t[6]!==r||t[7]!==a||t[8]!==o?(s=(0,Z.jsx)(bf,{"data-slot":`avatar`,"data-size":a,className:o,...r}),t[6]=r,t[7]=a,t[8]=o,t[9]=s):s=t[9],s}function Ef(e){let t=(0,Pn.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=qt(`aspect-square size-full rounded-full object-cover`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(Cf,{"data-slot":`avatar-image`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Df(e){let t=(0,Pn.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=qt(`flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(wf,{"data-slot":`avatar-fallback`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Of(e){let{open:t,defaultOpen:n=!1,onOpenChange:r,disabled:i}=e,[a,o]=dr({controlled:t,default:n,name:`Collapsible`,state:`open`}),{mounted:s,setMounted:c,transitionStatus:l}=Ss(a,!0,!0),u=yu(),[d,f]=X.useState(),p=d===null?void 0:d??u,m=J(e=>{let t=!a,n=$(ao,e.nativeEvent);r(t,n),!n.isCanceled&&o(t)});return X.useMemo(()=>({defaultPanelId:u,disabled:i,handleTrigger:m,mounted:s,open:a,panelId:p,setMounted:c,setOpen:o,setPanelIdState:f,transitionStatus:l}),[u,i,m,s,a,p,c,o,f,l])}var kf=X.createContext(void 0);function Af(){let e=X.useContext(kf);if(e===void 0)throw Error(vn(15));return e}var jf=`data-open`,Mf=`data-closed`,Nf=hi,Pf=`data-panel-open`,Ff={[jf]:``},If={[Mf]:``},Lf={open(e){return e?{[Pf]:``}:null}},Rf={open(e){return e?Ff:If},...yi},zf=X.forwardRef(function(e,t){let{render:n,className:r,defaultOpen:i=!1,disabled:a=!1,onOpenChange:o,open:s,style:c,...l}=e,u=J(o),d=Of({open:s,defaultOpen:i,onOpenChange:u,disabled:a}),f=X.useMemo(()=>({open:d.open,disabled:d.disabled,transitionStatus:d.transitionStatus}),[d.open,d.disabled,d.transitionStatus]),p=X.useMemo(()=>({...d,onOpenChange:u,state:f}),[d,u,f]),m=on(`div`,e,{state:f,ref:t,props:l,stateAttributesMapping:Rf});return(0,Z.jsx)(kf.Provider,{value:p,children:m})}),Bf={...Lf,...yi},Vf=X.forwardRef(function(e,t){let{panelId:n,open:r,handleTrigger:i,state:a,disabled:o}=Af(),{className:s,disabled:c=o,render:l,nativeButton:u=!0,style:d,...f}=e,{getButtonProps:p,buttonRef:m}=en({disabled:c,native:u});return on(`button`,e,{state:a,ref:[t,m],props:[{"aria-controls":r?n:void 0,"aria-expanded":r,onClick:i},f,p],stateAttributesMapping:Bf})}),Hf={height:void 0,width:void 0};function Uf(e){let{externalRef:t,hiddenUntilFound:n,id:r,keepMounted:i,mounted:a,onOpenChange:o,open:s,setMounted:c,setOpen:l,transitionStatus:u}=e,d=X.useRef(null),f=X.useRef(null),[p,m]=X.useState(Hf),h=X.useRef(Hf),g=X.useRef(!1),_=X.useRef(s),v=X.useRef(!1),[y,b]=X.useState(!1),x=X.useRef(null),S=tn(t,d),C=pr(s),w=Es(d),T=!s&&!a,E=y?`idle`:u,D=s&&(_.current||v.current),O=!s&&a&&f.current===`css-animation`&&p.height===void 0&&p.width===void 0?h.current:p,k=n&&T&&f.current!==`css-animation`,A=J((e,t=!0)=>{t&&(h.current=e),m(e)}),j=J(()=>{x.current?.(),x.current=null}),M=J(e=>{j(),x.current=()=>{x.current=null,e()}}),N=J(()=>{s&&a&&f.current===`css-animation`&&(v.current=!0)});Y(()=>{y&&u!==`starting`&&b(!1)},[y,u]),X.useEffect(()=>()=>{N(),j()},[N,j]),Y(()=>{s||(_.current=!1,v.current=!1);let e=d.current;if(!e)return;!s&&x.current&&j();let t=Gf(e,D);if(f.current=t,s&&u===`idle`&&_.current&&t===`css-animation`){h.current=Wf(e);return}if(s&&u===`starting`){let n=g.current;if(g.current=!1,t===`none`){A(Wf(e)),b(!0);return}if(t===`css-transition`){let t=Jf(e);if(A(Wf(e)),!n)return t;let r=qf(e,`transition-duration`,`0s`);return M(r),b(!0),t}A(Wf(e));let r=qf(e,`animation-name`,`none`);if(!n){r();return}let i=qf(e,`animation-duration`,`0s`);r(),M(i),b(!0);return}if(!s&&a&&(u===`idle`||u===`starting`)){if(t===`none`){A(Hf,!1),c(!1);return}A(Wf(e));return}if(u!==`ending`)return;if(t===`none`){c(!1);return}let n=Wf(e);n.height>0||n.width>0?(A(n),t===`css-animation`&&qf(e,`animation-name`,`none`)()):c(!1)},[a,s,j,A,c,M,D,u]),Ds({enabled:s&&a&&E===`idle`,open:!0,ref:d,onComplete(){s&&A(Hf,!1)}}),X.useEffect(()=>{if(s||!a||E!==`ending`)return;if(!d.current){c(!1),A(Hf,!1);return}let e=new AbortController,t=-1;function n(){C.current||(c(!1),A(Hf,!1))}return t=ri.request(()=>{w(n,e.signal)}),()=>{ri.cancel(t),e.abort()}},[C,a,s,E,w,A,c]),Y(()=>{let e=d.current;e&&n&&T&&e.setAttribute(`hidden`,`until-found`)},[T,n]),X.useEffect(function(){let e=d.current;if(!e)return;let t=Rr.create(),n=-1,r=(r,i)=>{t.start(0,()=>{C.current||(n=ri.request(()=>{C.current||(r&&(g.current=!1),i&&e.setAttribute(Nf,``),e.setAttribute(`hidden`,`until-found`))}))})},i=Pr(e,`beforematch`,t=>{let n=$(io,t);if(o(!0,n),n.isCanceled){r(!1,!1);return}g.current=!0;let i=e.hasAttribute(Nf);e.removeAttribute(Nf),l(!0),r(!0,i)});return()=>{t.clear(),ri.cancel(n),i()}},[C,o,l]);let P=i||n||a||s;return{height:O.height,props:{...k?{[Nf]:``}:void 0,hidden:T,id:r},ref:S,shouldPreventOpenAnimation:D,shouldRender:P,transitionStatus:E,width:O.width}}function Wf(e){return{height:e.scrollHeight,width:e.scrollWidth}}function Gf(e,t){let n=Bt(e).getComputedStyle(e),r=(n.animationName.split(`,`).map(e=>e.trim()).some(e=>e!==``&&e!==`none`)||t)&&Kf(n.animationDuration),i=Kf(n.transitionDuration);return r&&i||i?`css-transition`:r?`css-animation`:`none`}function Kf(e){return e.split(`,`).map(e=>e.trim()).some(e=>e!==``&&Number.parseFloat(e)>0)}function qf(e,t,n){let r=e.style.getPropertyValue(t),i=e.style.getPropertyPriority(t);return e.style.setProperty(t,n),()=>{r===``?e.style.removeProperty(t):e.style.setProperty(t,r,i)}}function Jf(e){let t={"justify-content":e.style.justifyContent,"align-items":e.style.alignItems,"align-content":e.style.alignContent,"justify-items":e.style.justifyItems};Object.keys(t).forEach(t=>{e.style.setProperty(t,`initial`,`important`)});function n(){Object.entries(t).forEach(([t,n])=>{n===``?e.style.removeProperty(t):e.style.setProperty(t,n)})}let r=ri.request(n);return()=>{ri.cancel(r),n()}}var Yf=`--collapsible-panel-height`,Xf=`--collapsible-panel-width`,Zf=X.forwardRef(function(e,t){let{className:n,hiddenUntilFound:r,keepMounted:i,render:a,id:o,style:s,...c}=e,{defaultPanelId:l,mounted:u,onOpenChange:d,open:f,setMounted:p,setPanelIdState:m,setOpen:h,state:g,transitionStatus:_}=Af(),v=r??!1,y=i??!1,b=o||void 0,x=b??l;Y(()=>(m(e=>b??(e===null?void 0:e)),()=>{m(e=>e===b?null:e)}),[b,m]);let{height:S,props:C,ref:w,shouldPreventOpenAnimation:T,shouldRender:E,transitionStatus:D,width:O}=Uf({externalRef:t,hiddenUntilFound:v,id:x,keepMounted:y,mounted:u,onOpenChange:d,open:f,setMounted:p,setOpen:h,transitionStatus:_}),k={...g,transitionStatus:D},A=hn(s,k),j=on(`div`,{...e,style:void 0},{state:k,ref:w,props:[C,{style:{[Yf]:S===void 0?`auto`:`${S}px`,[Xf]:O===void 0?`auto`:`${O}px`}},c,A?{style:A}:void 0,T?{style:{animationName:`none`}}:void 0],stateAttributesMapping:Rf});return E?j:null}),Qf=X.memo(X.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a,selected:o,...s}=e,c=X.useRef(null),{transitionStatus:l,setMounted:u}=Ss(o),d=on(`span`,e,{ref:[t,c],state:{selected:o,transitionStatus:l},props:[{"aria-hidden":!0,children:`✔️`},s],stateAttributesMapping:yi});return Ds({batch:!0,enabled:!o,open:o,ref:c,onComplete(){o||u(!1)}}),d})),$f=X.forwardRef(function(e,t){let{selected:n}=uf();return e.keepMounted||n?(0,Z.jsx)(Qf,{...e,selected:n,ref:t}):null}),ep=X.forwardRef(function(e,t){let{render:n,className:r,id:i,name:a,value:o,disabled:s=!1,onValueChange:c,defaultValue:l,autoFocus:u=!1,style:d,...f}=e,{state:p,name:m,disabled:h,setTouched:g,setDirty:_,validityData:v,setFilled:y,validationMode:b,validation:x}=hu(),{clearErrors:S,elementRef:C,submitCountRef:w}=vu(),T=h||s,E=m??a,D={...p,disabled:T},{labelId:O}=xu(),k=Su({id:i}),A=o!==void 0,j=o==null?void 0:String(o),M=J(()=>x.inputRef.current?.value);gu(x.inputRef,k,j,M,!T,a),Y(()=>{let e=j??x.inputRef.current?.value;e!==void 0&&y(e!==``)},[j,l,x.inputRef,y]),Au(j,()=>{j!==void 0&&(S(E),_(j!==(v.initialValue??``)),x.change(j))});let N=X.useRef(null),P=Wu(T,N),F=zr();return on(`input`,e,{ref:[t,N],state:D,props:[{id:k,disabled:T,name:E,ref:x.inputRef,"aria-labelledby":O,autoFocus:u,...A?{value:o}:{defaultValue:l},onChange(e){let t=e.currentTarget.value,n=$(io,e.nativeEvent);c?.(t,n),!A&&(_(t!==(v.initialValue??``)),y(t!==``),!e.nativeEvent.defaultPrevented&&!n.isCanceled&&(S(E),x.change(t)))},onFocus(){P(!0)},onBlur(e){if(g(!0),P(!1),b===`onBlur`){let t=e.currentTarget.value;x.commit(t),A&&queueMicrotask(()=>{let e=x.inputRef.current?.value;e!==void 0&&e!==t&&e!==(v.initialValue??``)&&x.commit(e)})}},onKeyDown(e){if(e.currentTarget.tagName===`INPUT`&&e.key===`Enter`){g(!0);let t=e.currentTarget.value,n=e.currentTarget.form;if(n&&n===C.current&&!e.defaultPrevented){let t=e.currentTarget,n=w.current;F.start(0,()=>{w.current===n&&x.commit(t.value)})}else x.commit(t)}}},f,e=>x.getValidationProps(T,e)],stateAttributesMapping:fu})}),tp=X.forwardRef(function(e,t){return(0,Z.jsx)(ep,{ref:t,...e})}),np=X.createContext(void 0);function rp(e){let t=X.useContext(np);if(t===void 0&&!e)throw Error(vn(33));return t}var ip=X.createContext(void 0);function ap(e){let t=X.useContext(ip);if(t===void 0&&!e)throw Error(vn(36));return t}var op=X.createContext(void 0);function sp(e=!0){let t=X.useContext(op);if(t===void 0&&!e)throw Error(vn(25));return t}var cp=X.createContext(null);function lp(e=`root`){let t=X.useContext(cp),n=X.useContext(ip);return t===null||n===void 0?null:(e===`submenu-trigger`?n.virtualFocus||n.parentVirtualFocus:n.virtualFocus)?t:null}var up={visible:!0,ref:null};function dp(){return up}function fp(e,t,n=`root`){let r=lp(n),i=((n===`submenu-trigger`?r?.useSubmenuTrigger:r?.useItem)??dp)({label:e.label,children:e.children,render:e.render}),a=tn(t,i.ref);return{visible:i.visible,ref:a,props:i.props}}function pp(e){e.preventDefault()}function mp(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,l=ap(),u=sp(!0),d=c.type===`submenu-trigger`,f=d?l.parentVirtualFocus:l.virtualFocus,p=(d&&l.parent.type===`menu`?l.parent.store:l.store).useState(`webkitAriaSelected`,n),{events:m}=a.useState(`floatingTreeRoot`),h=a.useState(`open`),g=u!==void 0,_=!f&&h&&n?0:-1;return X.useMemo(()=>({id:r,role:`menuitem`,tabIndex:_,"aria-selected":p,onMouseDown:f?pp:void 0,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&m.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&m.emit(`close`,{domEvent:e.nativeEvent,reason:lo})},onMouseUp(e){if(u){let t=u.initialCursorPointRef.current;if(u.initialCursorPointRef.current=null,g&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||g&&!Yr&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!g||e.button===2)&&c.type===`regular-item`&&Jt(s.current,e,{detail:1,pointerType:`mouse`})}}),[t,_,r,m,i,a.context.allowMouseUpTriggerRef,o,s,u,g,c.type,p,f])}var hp={type:`regular-item`};function gp(e){let{closeOnClick:t,disabled:n,highlighted:r,id:i,store:a,typingRef:o=a.context.typingRef,nativeButton:s,itemMetadata:c,nodeId:l}=e,u=X.useRef(null),{getButtonProps:d,buttonRef:f}=en({disabled:n,focusableWhenDisabled:!0,native:s,composite:!0}),p=mp({closeOnClick:t,highlighted:r,id:i,nodeId:l,store:a,typingRef:o,itemRef:u,itemMetadata:c}),m=X.useCallback(e=>Xt(p,{onMouseEnter(e){c.type===`submenu-trigger`&&c.setActive(e.nativeEvent)}},e,d),[p,d,c]),h=tn(u,f);return X.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}var _p=X.createContext(void 0);function vp(){let e=X.useContext(_p);if(e===void 0)throw Error(vn(31));return e}var yp=X.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,[o,s]=X.useState(void 0),c=on(`div`,e,{ref:t,props:{role:`group`,"aria-labelledby":o,...a}});return(0,Z.jsx)(_p.Provider,{value:s,children:c})}),bp=X.forwardRef(function(e,t){let n=lp()?.Group??yp;return(0,Z.jsx)(n,{...e,ref:t})}),xp=X.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=yu(a),c=vp();return Y(()=>(c(s),()=>{c(e=>e===s?void 0:e)}),[c,s]),on(`div`,e,{ref:t,props:{id:s,"aria-hidden":!0,...o}})}),Sp=X.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,{store:d}=ap(),f=cf({guess:!0,label:a}),p=yu(i),m=d.useState(`disabled`),h=d.useState(`isActive`,f.index),g=d.useState(`floatingNodeId`),_=d.useState(`itemProps`),v=s||m,{getItemProps:y,itemRef:b}=gp({closeOnClick:c,disabled:v,highlighted:h,id:p,store:d,nativeButton:o,nodeId:g,itemMetadata:hp});return on(`div`,e,{state:{disabled:v,highlighted:h},props:[_,u,y],ref:[b,t,f.ref]})}),Cp=X.forwardRef(function(e,t){let n=fp(e,t);return n.visible?(0,Z.jsx)(Sp,{...e,ref:n.ref}):null}),wp=X.createContext(void 0);function Tp(e){let t=X.useContext(wp);if(t===void 0&&!e)throw Error(vn(69));return t}var Ep=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Home`,`End`]),Dp=X.createContext(void 0);function Op(){return X.useContext(Dp)}function kp(e,t){let n=Zt(e.render);if(X.isValidElement(n)){let e=n.props;if(Object.hasOwn(e,`id`))return e.id??``}return e.id??t}function Ap(e,t,n){let r=kp(e,t),i=r===t?void 0:r;return[r,X.useCallback(e=>n?.(e?i:void 0),[i,n])]}function jp(e,t,n){let r=Zt(e.render),i=X.isValidElement(r)?r.props:void 0,a=e[`aria-label`]??i?.[`aria-label`],o=e[`aria-labelledby`]??i?.[`aria-labelledby`];return o==null&&!a&&(o=t?t.id||void 0:n||void 0),o}var Mp=X.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,id:o,initialFocus:s,...c}=e,{store:l,defaultFloatingId:u,setRenderedFloatingId:d,virtualFocus:f,orientation:p}=ap(),m=Op(),{side:h,align:g}=rp(),_=Tp(!0)!=null,v=l.useState(`open`),y=l.useState(`transitionStatus`),b=l.useState(`popupProps`),x=l.useState(`mounted`),S=l.useState(`instantType`),C=l.useState(`activeTriggerElement`),w=l.useState(`parent`),T=l.useState(`lastOpenChangeReason`),E=l.useState(`rootId`),D=l.useState(`floatingRootContext`),O=l.useState(`floatingTreeRoot`),k=l.useState(`closeDelay`),A=l.useState(`hoverEnabled`),j=l.useState(`disabled`),M=l.useState(`openMethod`),N=l.useState(`activeTriggerId`),P=l.useState(`listElement`),[F,I]=Ap(e,u,d),L=jp(e,C,N),R=w.type===`menu`?m:void 0,z=w.type===`context-menu`,ee=s??w.type!==`menu`;s===void 0&&P&&w.type!==`menu`&&(ee=()=>l.state.activeIndex===null&&P),Ds({open:v,ref:l.context.popupRef,onComplete(){v&&l.context.onOpenChangeComplete?.(!0)}}),X.useEffect(()=>{function e(e){l.setOpen(!1,$(e.reason,e.domEvent))}return O.events.on(`close`,e),()=>{O.events.off(`close`,e)}},[O.events,l]),lc(D,{enabled:A&&!j&&!z&&w.type!==`menubar`,closeDelay:k});let te=l.useStateSetter(`popupElement`),{parentVirtualFocusRef:B,handleFocus:ne}=(X.useContext(cp)?.useParentHandoff??Pp)(l,w,v,f),V={transitionStatus:y,side:h,align:g,open:v,nested:w.type===`menu`,instant:S},H=on(`div`,e,{state:V,ref:[t,l.context.popupRef,te,I],stateAttributesMapping:Ni,props:[b,{id:F,...P?{role:`presentation`}:{role:`menu`,"aria-orientation":p===`horizontal`?`horizontal`:void 0,"aria-labelledby":L},onKeyDown(e){R?.onPopupKeyDown?.(e),_&&Ep.has(e.key)&&e.stopPropagation()},onFocus:ne},Ud(y),c,{"data-rootownerid":E}]}),U=w.type===void 0||z;(C||w.type===`menubar`&&T!==`outside-press`)&&(U=!0);let re=R?.getReturnElement??B;return(0,Z.jsx)(gs,{context:D,openInteractionType:M,modal:z,disabled:!x,returnFocus:a??re??U,explicitReturnFocus:a===void 0&&re?!1:void 0,initialFocus:ee,restoreFocus:!0,getInsideElements:w.type===void 0?()=>[l.context.beforeTriggerFocusGuardRef.current]:void 0,externalTree:w.type===`menubar`?void 0:O,previousFocusableElement:C,nextFocusableElement:w.type===void 0?l.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:H})}),Np={parentVirtualFocusRef:void 0,handleFocus:void 0};function Pp(){return Np}var Fp=X.forwardRef(function(e,t){let n=lp()?.Popup??Mp;return(0,Z.jsx)(n,{...e,ref:t})}),Ip=X.createContext(void 0);function Lp(){let e=X.useContext(Ip);if(e===void 0)throw Error(vn(32));return e}var Rp=X.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,{store:i,parent:a}=ap();if(!(i.useState(`mounted`)||n))return null;let o=a.type===`menu`||a.type===`menubar`?`group`:void 0;return(0,Z.jsx)(Ip.Provider,{value:n,children:(0,Z.jsx)(Zo,{ref:t,...r,portalOwnerRole:o})})});function zp(e){let{store:t,domReference:n,positionerElement:r,open:i}=e,a=X.useRef(null),o=X.useRef(null),s=Es(r);Y(()=>{i||(o.current?.abort(),o.current=null,t.state.instantType===`trigger-change`&&t.set(`instantType`,void 0))},[i,t]),Y(()=>{let e=n,r=a.current;if(e&&(a.current=e),!r||!e||e===r||!t.select(`open`))return;t.set(`instantType`,void 0);let i=new AbortController;return o.current=i,s(()=>{t.select(`open`)&&t.set(`instantType`,`trigger-change`)},i.signal),()=>{i.abort()}},[n,s,t])}var Bp=X.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=Wo,style:g,..._}=e,{store:v,virtualFocus:y,syncHighlightedItem:b}=ap(),x=Lp(),S=sp(!0),C=v.useState(`parent`),w=v.useState(`floatingRootContext`),T=v.useState(`floatingTreeRoot`),E=v.useState(`mounted`),D=v.useState(`open`),O=v.useState(`modal`),k=v.useState(`openMethod`),A=v.useState(`activeTriggerElement`),j=v.useState(`transitionStatus`),M=v.useState(`positionerElement`),N=v.useState(`instantType`),P=v.useState(`adaptiveOrigin`),F=v.useState(`lastOpenChangeReason`),I=v.useState(`floatingNodeId`),L=v.useState(`floatingParentNodeId`),R=w.useState(`domReferenceElement`),z=n,ee=c,te=l,B=s,ne=h;C.type===`context-menu`&&(z=n??C.context?.anchor,B??=`start`,!o&&B!==`center`&&(te=e.alignOffset??2,ee=e.sideOffset??-5));let V=o,H=B;C.type===`menu`?(V??=`inline-end`,H??=`start`,ne=e.collisionAvoidance??Go):C.type===`menubar`&&(V??=C.context.orientation===`vertical`?`inline-end`:`bottom`,H??=`start`);let U=C.type===`context-menu`,re=zd({anchor:z,floatingRootContext:w,positionMethod:S?`fixed`:r,mounted:E,side:V,sideOffset:ee,align:H,alignOffset:te,arrowPadding:U?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:I,keepMounted:x,disableAnchorTracking:m,collisionAvoidance:ne,shift:U?{crossAxis:!(`side`in ne&&ne.side===`flip`),rootBoundary:`layoutViewport`}:void 0,externalTree:T,adaptiveOrigin:P,lazyFlip:y?`placement`:!1});X.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===I&&v.set(`hoverEnabled`,!1),e.nodeId!==I&&e.parentNodeId===v.select(`floatingParentNodeId`)&&v.setOpen(!1,$(So)))}return T.events.on(`menuopenchange`,e),()=>{T.events.off(`menuopenchange`,e)}},[v,T.events,I]),X.useEffect(()=>{if(v.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==v.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;v.setOpen(!1,$(t))}return T.events.on(`menuopenchange`,e),()=>{T.events.off(`menuopenchange`,e)}},[T.events,v]);let ie=zr();X.useEffect(()=>{D||ie.clear()},[D,ie]),X.useEffect(()=>{function e(e){if(D&&e.nodeId===v.select(`floatingParentNodeId`)){if(e.target&&A&&A!==e.target){let e=v.select(`closeDelay`);e>0?ie.isStarted()||ie.start(e,()=>{v.setOpen(!1,$(So))}):v.setOpen(!1,$(So))}else ie.clear()}}return T.events.on(`itemhover`,e),()=>{T.events.off(`itemhover`,e)}},[T.events,D,A,v,ie]),X.useEffect(()=>{let e={open:D,nodeId:I,parentNodeId:L,reason:v.select(`lastOpenChangeReason`)};T.events.emit(`menuopenchange`,e)},[T.events,D,v,I,L]),zp({store:v,domReference:R,positionerElement:M,open:D});let W={open:D,side:re.side,align:re.align,anchorHidden:re.anchorHidden,nested:C.type===`menu`,instant:N},ae=C.type===`menubar`&&C.context.modal;rf(D&&(ae||O&&F!==`trigger-hover`),k===`touch`,M,A);let oe=Wd(e,W,{styles:re.positionerStyles,transitionStatus:j,props:_,refs:[t,v.useStateSetter(`positionerElement`)],hidden:!E,inert:!D}),G=E&&C.type!==`menu`&&(C.type!==`menubar`&&O&&F!==`trigger-hover`||C.type===`menubar`&&C.context.modal),se=null;return C.type===`menubar`?se=C.context.contentElement:C.type===void 0&&(se=A),(0,Z.jsxs)(np.Provider,{value:re,children:[G&&(0,Z.jsx)(Hd,{ref:C.type===`context-menu`||C.type===`nested-context-menu`?C.context.internalBackdropRef:null,inert:wd(!D),cutout:se}),(0,Z.jsx)(as,{id:I,children:(0,Z.jsx)(pd,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,onMapChange:b,children:oe})})]})}),Vp=X.createContext(null);function Hp(e){let t=X.useContext(Vp);if(t===null&&!e)throw Error(vn(5));return t}var Up={...Js,disabled:e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled,modal:e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0),openMethod:e=>e.openMethod,keyboardOpen:e=>e.keyboardOpen,allowMouseEnter:e=>e.allowMouseEnter,highlightItemOnHover:e=>e.highlightItemOnHover,parent:e=>e.parent,rootId:e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId,activeIndex:e=>e.activeIndex,listElement:e=>e.listElement,triggerControlsId:(e,t)=>{let n=Js.triggerPopupId(e,t);return n?e.listElement?.id||n:void 0},filterTriggerProps:e=>e.filterTriggerProps,inputProps:e=>e.inputProps,webkitAriaSelected:(e,t)=>Zr&&e.inputFocused&&t?!0:void 0,highlightedItemId:e=>e.highlightedItem?.id||void 0,isActive:(e,t)=>e.activeIndex===t,hoverEnabled:e=>e.hoverEnabled,instantType:e=>e.instantType===`trigger-change`&&!Js.open(e)?void 0:e.instantType,lastOpenChangeReason:e=>e.openChangeReason,floatingTreeRoot:e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot,floatingNodeId:e=>e.floatingNodeId,floatingParentNodeId:e=>e.floatingParentNodeId,itemProps:e=>e.itemProps,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin,keyboardEventRelay:e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)}},Wp=class extends Nr{constructor(e,t,n=!1){let r=new zs,i=Kp(r,t,n,e);super(i,Gp(r),Up),this.observe(`parent`,e=>{e.type===`menu`?this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef:e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef)})}subscribeToParentMenu(){let e=this.state.parent;if(e.type!==`menu`)return;let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);return e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}setActiveIndex(e,t,n){if(this.state.activeIndex!==e){let r=(e===null?void 0:this.context.itemDomElements.current[e])===this.context.reportedItem;this.context.highlightReason=r?`none`:t,this.context.highlightEvent=r?void 0:n}this.set(`activeIndex`,e)}highlightItem(e,t,n){let r=this.context.itemDomElements.current.indexOf(e);r>-1&&this.setActiveIndex(r,t,n)}};function Gp(e){return{positionerRef:X.createRef(),popupRef:X.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},highlightReason:`none`,highlightEvent:void 0,reportedItem:void 0,allowMouseUpTriggerRef:{current:!1},virtualFocusRef:void 0,triggerFocusTargetRef:X.createRef(),beforeTriggerFocusGuardRef:X.createRef(),beforeContentFocusGuardRef:X.createRef(),onOpenChangeComplete:void 0,triggerElements:e}}function Kp(e,t,n=!1,r){return{...Hs(e,t,n),disabled:!1,modal:!0,openMethod:null,keyboardOpen:!1,allowMouseEnter:!1,highlightItemOnHover:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,listElement:null,filterTriggerProps:$t,inputProps:$t,inputFocused:!1,highlightedItem:void 0,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new $o,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:$t,keyboardEventRelay:void 0,closeDelay:0,adaptiveOrigin:void 0,...r}}var qp=X.createContext(null);function Jp(e,t){return(e===`trigger-press`||e===`item-press`)&&t?.detail===0}function Yp(e,t){return e===`list-navigation`||Jp(e,t)}var Xp=Sr(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,onItemHighlighted:a,defaultOpen:o=!1,disabled:s=!1,modal:c,loopFocus:l=!0,orientation:u=`vertical`,actionsRef:d,closeParentOnEsc:f=!1,handle:p,triggerId:m,defaultTriggerId:h=null,highlightItemOnHover:g=!0,isSubmenu:_=!1,virtualFocus:v=!1,virtualFocusRef:y,allowEscape:b=!0,resetOnPointerLeave:x=!0}=e,S=sp(!0),C=ap(!0),w=Hp(!0),T=C?.store,E=C?.virtualFocus??!1,D=X.useMemo(()=>_&&T?{type:`menu`,store:T}:w?{type:`menubar`,context:w}:S&&!T?{type:`context-menu`,context:S}:{type:void 0},[S,T,w,_]),O=yu(),k=yu(),[A,j]=X.useState(void 0),M=(A??k)||void 0,N=ns(),P=D.type===`menu`?D.store:void 0,F=(n??o)&&P?.state.transitionStatus===`starting`,I=kt(()=>F?P?.state.instantType:void 0).current,L=kt(()=>{let e=new Wp({open:o,openProp:n,activeTriggerId:h,triggerIdProp:m,parent:D,disabled:s,highlightItemOnHover:g,modal:D.type===void 0?c:void 0,rootId:O,instantType:I},M,N!=null);return e.context.virtualFocusRef=y,e}).current;L.useControlledProp(`openProp`,n),L.useControlledProp(`triggerIdProp`,m),L.useContextCallback(`onOpenChangeComplete`,i);let R=L.useState(`floatingTreeRoot`),z=is(R),ee=L.useState(`open`),te=L.useState(`activeTriggerElement`),B=L.useState(`positionerElement`),ne=L.useState(`hoverEnabled`),V=L.useState(`disabled`),H=L.useState(`lastOpenChangeReason`),U=L.useState(`parent`),re=L.useState(`activeIndex`),ie=L.useState(`keyboardOpen`),W=L.useState(`payload`),ae=L.useState(`floatingParentNodeId`),oe=X.useRef(null),G=X.useRef(U.type!==`context-menu`),se=zr(),ce=X.useRef(!0),le=zr(),ue=ae!=null,{openMethod:de,triggerProps:fe}=Mu(ee);L.useSyncedValues({disabled:s,highlightItemOnHover:g,modal:U.type===void 0?c:void 0,openMethod:de,rootId:O}),Is(L);let{forceUnmount:pe,transitionStatus:me}=Ls(ee,L,()=>{L.set(`allowMouseEnter`,!1)},F),he=Es(L.context.popupRef);X.useEffect(()=>{if(I===void 0)return;let e=()=>{L.state.instantType===I&&L.set(`instantType`,void 0)};if(!ee){e();return}if(me!==void 0)return;if(L.context.popupRef.current==null){e();return}let t=new AbortController;return he(e,t.signal),()=>{t.abort()}},[I,ee,me,he,L]),Y(()=>{S&&!C?L.update({parent:{type:`context-menu`,context:S},floatingNodeId:z,floatingParentNodeId:N}):(C||!L.select(`activeTriggerElement`))&&L.update({floatingNodeId:z,floatingParentNodeId:N})},[S,C,z,N,te,L]),X.useEffect(()=>{ee||(oe.current=null),U.type===`context-menu`&&(ee?se.start(500,()=>{G.current=!0}):(se.clear(),G.current=!1))},[se,ee,U.type]),Y(()=>{!ee&&!ne&&L.set(`hoverEnabled`,!0)},[ee,ne,L]);let ge=J((e,t)=>{let n=t.reason;if(!e&&!L.select(`open`)||ee===e&&t.trigger===te&&H===n)return;let i=Ps(t);if(!e&&t.trigger==null&&(t.trigger=te??void 0),r?.(e,t),t.isCanceled)return;L.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&n!==`item-press`&&a?.type===`click`&&a.pointerType===`touch`&&!ce.current)return;e&&n===`trigger-focus`?(ce.current=!1,le.start(300,()=>{ce.current=!0})):(ce.current=!0,le.clear());let o=!e&&(n===`escape-key`||n==null);oe.current=t.event;let s=Ns(L.state,e,t.trigger,i());s.openChangeReason=n,s.keyboardOpen=e&&Yp(n,a),s.instantType=U.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?`group`:Jp(n,a)?`click`:o?`dismiss`:void 0,L.update(s)}),K=xs({popupStore:L,floatingRootContext:L.state.floatingRootContext,floatingId:M,nested:N!=null,onOpenChange:ge}),_e=K.context.events;Y(()=>{let e=({open:e,eventDetails:t})=>ge(e,t);return _e.on(`setOpen`,e),()=>{_e?.off(`setOpen`,e)}},[_e,ge]),Y(()=>L.subscribeToParentMenu(),[L]);let ve=X.useCallback(()=>{L.setOpen(!1,$(Co))},[L]);X.useImperativeHandle(d,()=>({unmount:pe,close:ve}),[pe,ve]);let ye;U.type===`context-menu`&&(ye=U.context),X.useImperativeHandle(ye?.positionerRef,()=>B,[B]),X.useImperativeHandle(ye?.actionsRef,()=>({setOpen:ge}),[ge]);let be=bs(K,{enabled:!V,bubbles:{escapeKey:f&&U.type===`menu`},outsidePress(){return U.type!==`context-menu`||oe.current?.type===`contextmenu`||G.current},externalTree:ue?R:void 0}),xe=Lu(),Se=vc(K,{enabled:!V,listRef:L.context.itemDomElements,activeIndex:re,virtual:v,nested:U.type===`menubar`||!v&&U.type!==void 0,parentOrientation:U.type===`menubar`?U.context.orientation:void 0,loopFocus:l,focusItemOnOpen:v?ie:void 0,allowEscape:v&&l&&b,orientation:u,triggerOrientation:v?`vertical`:u,rtl:xe===`rtl`,disabledIndices:Qt,onNavigate(e,t){L.setActiveIndex(e,Ml(t),t?.nativeEvent)},openOnArrowKeyDown:U.type!==`context-menu`&&!(v&&_),externalTree:!v&&ue?R:void 0,nestedReturnFocusRef:P?.context.virtualFocusRef,focusItemOnHover:g,resetOnPointerLeave:x}),Ce=X.useCallback(e=>{L.context.typingRef.current=e},[L]),we=yc(K,{enabled:!V&&!v,listRef:L.context.itemLabels,elementsRef:L.context.itemDomElements,activeIndex:re,resetMs:500,onMatch:(e,t)=>{ee&&e!==re&&L.setActiveIndex(e,yo,t.nativeEvent)},onTyping:Ce}),Te=J(a),Ee=X.useRef(-1),De=J(()=>{let e=L.state.activeIndex,t=e===null?void 0:L.context.itemDomElements.current[e]??void 0;if(t?.isConnected===!1)return;let n=t===void 0?-1:e;if(Ee.current===n&&L.context.reportedItem===t)return;Ee.current=n,L.context.reportedItem=t,v&&L.set(`highlightedItem`,t);let{highlightReason:r,highlightEvent:i}=L.context;L.context.highlightReason=io,L.context.highlightEvent=void 0,a&&Te(t,ro(r,i,{label:t===void 0?void 0:L.context.itemLabels.current[n]??void 0}))});Y(()=>{De()},[re,De]);let Oe=X.useMemo(()=>{if(!v)return Se.reference;if(!Se.trigger)return $t;let{onFocus:e,...t}=Se.trigger;return t},[v,Se.reference,Se.trigger]);L.useSyncedValue(`inputProps`,v?Se.reference??$t:$t);let ke=X.useMemo(()=>{let e=Xt(we.reference,Oe,be.reference,{onMouseMove(){L.set(`allowMouseEnter`,!0)}},fe);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=ee,e},[L,we.reference,Oe,be.reference,fe,ee]),Ae=X.useMemo(()=>{let e=Xt(Se.trigger,be.trigger,fe);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[Se.trigger,be.trigger,fe]);kt(()=>(L.update({inactiveTriggerProps:Ae}),null)),Rs(L,{floatingRootContext:K,activeTriggerProps:ke,inactiveTriggerProps:Ae,popupProps:X.useMemo(()=>Xt(ks,{onMouseMove(){L.set(`allowMouseEnter`,!0),U.type===`menu`&&L.set(`hoverEnabled`,!1)},onClick(){L.select(`hoverEnabled`)&&L.set(`hoverEnabled`,!1)},onKeyDown(e){let t=L.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},we.floating,Se.floating,be.floating),[U.type,L,we.floating,Se.floating,be.floating]),itemProps:Se.item??$t});let je=X.useMemo(()=>({store:L,parent:D,orientation:u,loopFocus:l,allowEscape:b,defaultFloatingId:k,setRenderedFloatingId:j,virtualFocus:v,parentVirtualFocus:E,syncHighlightedItem:De}),[L,D,u,l,b,k,v,E,De]),Me=typeof t==`function`?t({payload:W}):t,Ne=(0,Z.jsxs)(ip.Provider,{value:je,children:[p&&(0,Z.jsx)(As,{handle:p,store:L}),Me]});return(U.type===void 0||U.type===`context-menu`)&&(Ne=(0,Z.jsx)(os,{externalTree:R,children:Ne})),Ne});function Zp(e){let t=X.useContext(qp);if(t===null)return(0,Z.jsx)(Xp,{...e});let n=t.Root;return(0,Z.jsx)(qp.Provider,{value:null,children:(0,Z.jsx)(n,{...t.options,...e})})}function Qp(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=gn(),{ref:i,index:a}=cf(e),o=n===a,s=X.useRef(null),c=tn(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}function $p(e){let{render:t,className:n,style:r,state:i=$t,props:a=Qt,refs:o=Qt,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=Qp({metadata:s});return on(l,e,{state:i,ref:[f,...o],props:[d,...a,u],stateAttributesMapping:c})}function em(e){if(Ft(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`);if(!Rt(e))return em(zt(e))}function tm(e,t){function n(n,r,i){let a=n.currentTarget;Nn.flushSync(()=>{e.setOpen(!1,$(go,n.nativeEvent,a))}),Za(a.isConnected?a:t.current,r,i)?.focus()}function r(t){n(t,-1,e.select(`positionerElement`))}function i(t){let r=e.select(`positionerElement`);r&&Qa(t,r)?e.context.beforeContentFocusGuardRef.current?.focus():n(t,1,r)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function nm(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=X.useRef(!1);return X.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,Mn(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:$t,[t,n,r])}var rm=Cr(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,id:s,openOnHover:c,delay:l=100,closeDelay:u=0,handle:d,payload:f,...p}=e,m=ap(!0),h=Ys(d)??m?.store;if(!h)throw Error(vn(85));let g=yu(s),_=h.useState(`isTriggerActive`,g),v=h.useState(`floatingRootContext`),y=h.useState(`isOpenedByTrigger`,g),b=h.useState(`triggerControlsId`,g),x=X.useRef(null),S=am(),C=gn(!0),w=rs(),T=X.useMemo(()=>w??new $o,[w]),{registerTrigger:E,isMountedByThisTrigger:D}=Fs(g,x,h,{payload:f,closeDelay:u,parent:S,floatingTreeRoot:T,floatingNodeId:is(T),floatingParentNodeId:ns(),keyboardEventRelay:C?.relayKeyboardEvent}),O=S.type===`menubar`,k=h.useState(`disabled`),A=a||k||O&&S.context.disabled,{getButtonProps:j,buttonRef:M}=en({disabled:A,native:o});X.useEffect(()=>{!y&&S.type===void 0&&(h.context.allowMouseUpTriggerRef.current=!1)},[h,y,S.type]);let N=X.useRef(null),P=zr(),F=J(e=>{if(!N.current)return;P.clear(),h.context.allowMouseUpTriggerRef.current=!1;let t=e.target;Q(N.current,t)||Q(h.select(`positionerElement`),t)||t===N.current||t!=null&&em(t)===h.select(`rootId`)||Ku(e,N.current)||T.events.emit(`close`,{domEvent:e,reason:xo})});X.useEffect(()=>{let e=Mn(N.current);if(y&&h.select(`lastOpenChangeReason`)===`trigger-hover`)return e.addEventListener(`mouseup`,F,{once:!0}),()=>{e.removeEventListener(`mouseup`,F)}},[y,F,h]);let I=O&&S.context.hasSubmenuOpen,L=dc(v,{enabled:(c??I)&&!A&&(!O||I&&!D),handleClose:Dc({blockPointerEvents:!O}),mouseOnly:!0,move:!1,restMs:S.type===void 0?l:void 0,delay:{close:u},triggerElementRef:x,externalTree:T,isActiveTrigger:_,isClosing:()=>h.select(`transitionStatus`)===`ending`}),R=im(y,h.select(`lastOpenChangeReason`)),z=_s(v,{enabled:!A,event:y&&O?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:S.type===void 0&&R}),ee=Qs(v,{enabled:!A&&I}),te=nm({open:y,enabled:O,mouseDownAction:`open`}),B=X.useMemo(()=>Xt(ee.reference,z.reference),[ee.reference,z.reference]),ne=h.useState(`triggerProps`,D),V=h.useState(`filterTriggerProps`),{handlePreFocusGuardFocus:H,handleFocusTargetFocus:U}=tm(h,x),re={disabled:A,open:y},ie=[N,t,M,E,x],W=[B,L??$t,ne,{"aria-haspopup":`menu`,"aria-controls":b,id:g,onMouseDown:e=>{h.select(`open`)||(P.start(200,()=>{h.context.allowMouseUpTriggerRef.current=!0}),Mn(e.currentTarget).addEventListener(`mouseup`,F,{once:!0}))}},V,O?{role:`menuitem`}:{},te,p,j],ae=on(`button`,e,{enabled:!O,stateAttributesMapping:ji,state:re,ref:ie,props:W});return O?(0,Z.jsx)($p,{tag:`button`,render:n,className:r,style:i,state:re,refs:ie,props:W,stateAttributesMapping:ji}):y?(0,Z.jsxs)(X.Fragment,{children:[(0,Z.jsx)(ai,{ref:h.context.beforeTriggerFocusGuardRef,onFocus:H},`${g}-pre-focus-guard`),(0,Z.jsx)(X.Fragment,{children:ae},g),(0,Z.jsx)(ai,{ref:h.context.triggerFocusTargetRef,onFocus:U},`${g}-post-focus-guard`)]}):(0,Z.jsx)(X.Fragment,{children:ae},g)});function im(e,t){let n=zr(),[r,i]=X.useState(!1);return Y(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function am(){let e=Hp(!0);return X.useMemo(()=>e?{type:`menubar`,context:e}:{type:void 0},[e])}var om=X.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return on(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})});function sm(e){let t=(0,Pn.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,type:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=qt(`h-7 w-full min-w-0 rounded-md border border-input bg-input/20 px-2 py-0.5 text-sm transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-xs/relaxed file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring/30 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-2 aria-invalid:ring-destructive/20 md:text-xs/relaxed dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==a||t[8]!==i?(o=(0,Z.jsx)(tp,{type:i,"data-slot":`input`,className:a,...r}),t[6]=r,t[7]=a,t[8]=i,t[9]=o):o=t[9],o}function cm(e){let t=(0,Pn.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=qt(`group/input-group relative flex h-7 w-full min-w-0 items-center rounded-md border border-input bg-input/20 transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-data-[align=block-end]:rounded-md has-data-[align=block-start]:rounded-md has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-2 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/30 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-2 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[textarea]:rounded-md has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var lm=Nt(`flex h-auto cursor-text items-center justify-center gap-1 py-2 text-xs/relaxed font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 **:data-[slot=kbd]:rounded-[calc(var(--radius-sm)-2px)] **:data-[slot=kbd]:bg-muted-foreground/10 **:data-[slot=kbd]:px-1 **:data-[slot=kbd]:text-[0.625rem] [&>svg:not([class*='size-'])]:size-3.5`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:ml-[-0.275rem] has-[>kbd]:ml-[-0.275rem]`,"inline-end":`order-last pr-2 has-[>button]:mr-[-0.275rem] has-[>kbd]:mr-[-0.275rem]`,"block-start":`order-first w-full justify-start px-2 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function um(e){let t=(0,Pn.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,align:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`inline-start`:i,o;t[4]!==a||t[5]!==n?(o=qt(lm({align:a}),n),t[4]=a,t[5]=n,t[6]=o):o=t[6];let s;return t[7]!==a||t[8]!==r||t[9]!==o?(s=(0,Z.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":a,className:o,onClick:dm,...r}),t[7]=a,t[8]=r,t[9]=o,t[10]=s):s=t[10],s}function dm(e){e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()}var fm=Nt(`flex items-center gap-2 rounded-md text-xs/relaxed shadow-none`,{variants:{size:{xs:`h-5 gap-1 rounded-[calc(var(--radius-sm)-2px)] px-1 [&>svg:not([class*='size-'])]:size-3`,sm:`gap-1`,"icon-xs":`size-6 p-0 has-[>svg]:p-0`,"icon-sm":`size-7 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function pm(e){let t=(0,Pn.c)(15),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:n,type:i,variant:a,size:o,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=i===void 0?`button`:i,c=a===void 0?`ghost`:a,l=o===void 0?`xs`:o,u;t[6]!==n||t[7]!==l?(u=qt(fm({size:l}),n),t[6]=n,t[7]=l,t[8]=u):u=t[8];let d;return t[9]!==r||t[10]!==l||t[11]!==u||t[12]!==s||t[13]!==c?(d=(0,Z.jsx)(pn,{type:s,"data-size":l,variant:c,className:u,...r}),t[9]=r,t[10]=l,t[11]=u,t[12]=s,t[13]=c,t[14]=d):d=t[14],d}function mm(e){let t=(0,Pn.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=qt(`flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(sm,{"data-slot":`input-group-control`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function hm(e){let t=(0,Pn.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=qt(`[&_svg:not([class*='size-'])]:size-3.5`,r),t[4]=r,t[5]=a);let o;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(Cn,{className:`pointer-events-none size-3.5 text-muted-foreground`}),t[6]=o):o=t[6];let s;return t[7]!==n||t[8]!==i||t[9]!==a?(s=(0,Z.jsxs)($u,{"data-slot":`combobox-trigger`,className:a,...i,children:[n,o]}),t[7]=n,t[8]=i,t[9]=a,t[10]=s):s=t[10],s}function gm(e){let t=(0,Pn.c)(10),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(pm,{variant:`ghost`,size:`icon-xs`}),t[3]=i):i=t[3];let a;t[4]===n?a=t[5]:(a=qt(n),t[4]=n,t[5]=a);let o;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(jn,{className:`pointer-events-none`}),t[6]=o):o=t[6];let s;return t[7]!==r||t[8]!==a?(s=(0,Z.jsx)(sd,{"data-slot":`combobox-clear`,render:i,className:a,...r,children:o}),t[7]=r,t[8]=a,t[9]=s):s=t[9],s}function _m(e){let t=(0,Pn.c)(28),n,r,i,a,o,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6]):({className:r,children:n,disabled:a,showTrigger:o,showClear:s,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s);let c=a!==void 0&&a,l=o===void 0||o,u=s!==void 0&&s,d;t[7]===r?d=t[8]:(d=qt(`w-auto`,r),t[7]=r,t[8]=d);let f;t[9]===c?f=t[10]:(f=(0,Z.jsx)(mm,{disabled:c}),t[9]=c,t[10]=f);let p;t[11]!==i||t[12]!==f?(p=(0,Z.jsx)(ad,{render:f,...i}),t[11]=i,t[12]=f,t[13]=p):p=t[13];let m;t[14]!==c||t[15]!==l?(m=l&&(0,Z.jsx)(pm,{size:`icon-xs`,variant:`ghost`,render:(0,Z.jsx)(hm,{}),"data-slot":`input-group-button`,className:`group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent`,disabled:c}),t[14]=c,t[15]=l,t[16]=m):m=t[16];let h;t[17]!==c||t[18]!==u?(h=u&&(0,Z.jsx)(gm,{disabled:c}),t[17]=c,t[18]=u,t[19]=h):h=t[19];let g;t[20]!==m||t[21]!==h?(g=(0,Z.jsxs)(um,{align:`inline-end`,children:[m,h]}),t[20]=m,t[21]=h,t[22]=g):g=t[22];let _;return t[23]!==n||t[24]!==d||t[25]!==p||t[26]!==g?(_=(0,Z.jsxs)(cm,{className:d,children:[p,g,n]}),t[23]=n,t[24]=d,t[25]=p,t[26]=g,t[27]=_):_=t[27],_}function vm(e){let t=(0,Pn.c)(21),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({className:r,side:a,sideOffset:o,align:s,alignOffset:c,anchor:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=a===void 0?`bottom`:a,u=o===void 0?6:o,d=s===void 0?`start`:s,f=c===void 0?0:c,p=!!n,m;t[8]===r?m=t[9]:(m=qt(`group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) overflow-hidden rounded-lg bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[chips=true]:min-w-(--anchor-width) 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=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-7 *:data-[slot=input-group]:border-none *:data-[slot=input-group]:bg-input/20 *:data-[slot=input-group]:shadow-none dark:bg-popover 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`,r),t[8]=r,t[9]=m);let h;t[10]!==i||t[11]!==p||t[12]!==m?(h=(0,Z.jsx)(sf,{"data-slot":`combobox-content`,"data-chips":p,className:m,...i}),t[10]=i,t[11]=p,t[12]=m,t[13]=h):h=t[13];let g;return t[14]!==d||t[15]!==f||t[16]!==n||t[17]!==l||t[18]!==u||t[19]!==h?(g=(0,Z.jsx)(Cd,{children:(0,Z.jsx)(af,{side:l,sideOffset:u,align:d,alignOffset:f,anchor:n,className:`isolate z-50`,children:h})}),t[14]=d,t[15]=f,t[16]=n,t[17]=l,t[18]=u,t[19]=h,t[20]=g):g=t[20],g}function ym(e){let t=(0,Pn.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=qt(`no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain p-1 data-empty:p-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(bd,{"data-slot":`combobox-list`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function bm(e){let t=(0,Pn.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=qt(`relative flex min-h-7 w-full cursor-default items-center gap-2 rounded-md px-2 py-1 text-xs/relaxed outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5`,r),t[4]=r,t[5]=a);let o;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)($f,{render:(0,Z.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`}),children:(0,Z.jsx)(xn,{className:`pointer-events-none`})}),t[6]=o):o=t[6];let s;return t[7]!==n||t[8]!==i||t[9]!==a?(s=(0,Z.jsxs)(hf,{"data-slot":`combobox-item`,className:a,...i,children:[n,o]}),t[7]=n,t[8]=i,t[9]=a,t[10]=s):s=t[10],s}function xm(e){let t=(0,Pn.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Z.jsx)(Zp,{"data-slot":`dropdown-menu`,...n}),t[2]=n,t[3]=r),r}function Sm(e){let t=(0,Pn.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Z.jsx)(rm,{"data-slot":`dropdown-menu-trigger`,...n}),t[2]=n,t[3]=r),r}function Cm(e){let t=(0,Pn.c)(18),n,r,i,a,o,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6]):({align:i,alignOffset:a,side:o,sideOffset:s,className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s);let c=i===void 0?`start`:i,l=a===void 0?0:a,u=o===void 0?`bottom`:o,d=s===void 0?4:s,f;t[7]===n?f=t[8]:(f=qt(`z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none 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-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95`,n),t[7]=n,t[8]=f);let p;t[9]!==r||t[10]!==f?(p=(0,Z.jsx)(Fp,{"data-slot":`dropdown-menu-content`,className:f,...r}),t[9]=r,t[10]=f,t[11]=p):p=t[11];let m;return t[12]!==c||t[13]!==l||t[14]!==u||t[15]!==d||t[16]!==p?(m=(0,Z.jsx)(Rp,{children:(0,Z.jsx)(Bp,{className:`isolate z-50 outline-none`,align:c,alignOffset:l,side:u,sideOffset:d,children:p})}),t[12]=c,t[13]=l,t[14]=u,t[15]=d,t[16]=p,t[17]=m):m=t[17],m}function wm(e){let t=(0,Pn.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Z.jsx)(bp,{"data-slot":`dropdown-menu-group`,...n}),t[2]=n,t[3]=r),r}function Tm(e){let t=(0,Pn.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,inset:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=qt(`px-2 py-1.5 text-xs text-muted-foreground data-inset:pl-7.5`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==i||t[8]!==a?(o=(0,Z.jsx)(xp,{"data-slot":`dropdown-menu-label`,"data-inset":r,className:a,...i}),t[6]=r,t[7]=i,t[8]=a,t[9]=o):o=t[9],o}function Em(e){let t=(0,Pn.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,inset:r,variant:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`default`:a,s;t[5]===n?s=t[6]:(s=qt(`group/dropdown-menu-item relative flex min-h-7 cursor-default items-center gap-2 rounded-md px-2 py-1 text-xs/relaxed outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7.5 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-3.5 data-[variant=destructive]:*:[svg]:text-destructive`,n),t[5]=n,t[6]=s);let c;return t[7]!==r||t[8]!==i||t[9]!==s||t[10]!==o?(c=(0,Z.jsx)(Cp,{"data-slot":`dropdown-menu-item`,"data-inset":r,"data-variant":o,className:s,...i}),t[7]=r,t[8]=i,t[9]=s,t[10]=o,t[11]=c):c=t[11],c}function Dm(e){let t=(0,Pn.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=qt(`-mx-1 my-1 h-px bg-border/50`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(om,{"data-slot":`dropdown-menu-separator`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Om(e){let t=(0,Pn.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=qt(`pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-xs bg-muted px-1 font-sans text-[0.625rem] font-medium text-muted-foreground select-none in-data-[slot=tooltip-content]:bg-background/20 in-data-[slot=tooltip-content]:text-background dark:in-data-[slot=tooltip-content]:bg-background/10 [&_svg:not([class*='size-'])]:size-3`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`kbd`,{"data-slot":`kbd`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var km=G({id:W,name:W,signOut:Re}),Am=We(_e).atom(V(yt(`/auth/user`),Pe(H),Pe(f(km)))),jm=Ee(Qe(``));function Mm(){return ze(F(rr(jm)))}function Nm(){let e=(0,Pn.c)(27),t=rr(Am);if(!St(t))return null;let n;e[0]===t.value.id?n=e[1]:(n=R(`github:`,``)(t.value.id),e[0]=t.value.id,e[1]=n);let r=`https://avatars.githubusercontent.com/u/${n}?s=96`,i;e[2]!==t.value.name||e[3]!==r?(i=(0,Z.jsx)(Ef,{src:r,alt:t.value.name}),e[2]=t.value.name,e[3]=r,e[4]=i):i=e[4];let a;e[5]===t.value.name?a=e[6]:(a=N(Ve(0,1)(t.value.name)),e[5]=t.value.name,e[6]=a);let o;e[7]===a?o=e[8]:(o=(0,Z.jsx)(Df,{children:a}),e[7]=a,e[8]=o);let s;e[9]!==i||e[10]!==o?(s=(0,Z.jsx)(Sm,{"aria-label":`Account`,children:(0,Z.jsxs)(Tf,{size:`sm`,children:[i,o]})}),e[9]=i,e[10]=o,e[11]=s):s=e[11];let c;e[12]===t.value.name?c=e[13]:(c=(0,Z.jsx)(wm,{children:(0,Z.jsxs)(Tm,{children:[`@`,t.value.name]})}),e[12]=t.value.name,e[13]=c);let l;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(Dm,{}),e[14]=l):l=e[14];let u=!t.value.signOut,d;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(d=new URLSearchParams({next:location.href}),e[15]=d):d=e[15];let f=`/auth/sign-out?${d}`,p;e[16]===f?p=e[17]:(p=(0,Z.jsx)(`a`,{"aria-label":`Sign out`,href:f}),e[16]=f,e[17]=p);let m;e[18]!==p||e[19]!==u?(m=(0,Z.jsx)(Em,{variant:`destructive`,disabled:u,render:p,children:`Sign out`}),e[18]=p,e[19]=u,e[20]=m):m=e[20];let h;e[21]!==m||e[22]!==c?(h=(0,Z.jsxs)(Cm,{align:`end`,className:`w-auto min-w-48`,children:[c,l,m]}),e[21]=m,e[22]=c,e[23]=h):h=e[23];let g;return e[24]!==h||e[25]!==s?(g=(0,Z.jsxs)(xm,{children:[s,h]}),e[24]=h,e[25]=s,e[26]=g):g=e[26],g}function Pm(e){let t=(0,Pn.c)(66),[n,r]=or(jm),[i,a]=(0,X.useState)(!1),o;t[0]===n?o=t[1]:(o=()=>n!==``,t[0]=n,t[1]=o);let[s,c]=(0,X.useState)(o),l=(0,X.useRef)(null),u=(0,X.useRef)(null),d,f;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>{let e=function(e){e.key===`k`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),c(!0),l.current?.focus())};return addEventListener(`keydown`,e),()=>removeEventListener(`keydown`,e)},f=[],t[2]=d,t[3]=f):(d=t[2],f=t[3]),(0,X.useEffect)(d,f);let p,m,h,g,_,v,y,b,x,S,C;if(t[4]!==i||t[5]!==e.commands||t[6]!==e.label||t[7]!==n||t[8]!==s||t[9]!==r){let a;t[21]===n?a=t[22]:(a=e=>vt(ze(F(n)))(ze(e.label)),t[21]=n,t[22]=a),m=B(e.commands,a);let o,d;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>{(0,Nn.flushSync)(()=>c(!0)),l.current?.focus()},d=(0,Z.jsx)(Dn,{}),t[23]=o,t[24]=d):(o=t[23],d=t[24]),t[25]===e.label?g=t[26]:(g=(0,Z.jsx)(pn,{variant:`ghost`,size:`icon-sm`,"aria-label":e.label,className:`ml-auto sm:hidden`,onClick:o,children:d}),t[25]=e.label,t[26]=g),C=u;let f=s&&`max-sm:bg-background max-sm:absolute max-sm:inset-0 max-sm:z-10 max-sm:flex max-sm:max-w-none max-sm:items-center max-sm:gap-2 max-sm:px-3`;t[27]===f?h=t[28]:(h=qt(`mx-auto hidden w-full max-w-sm sm:flex lg:absolute lg:left-1/2 lg:-translate-x-1/2`,f),t[27]=f,t[28]=h),p=Bu,_=m,v=null,y=Fm,b=n,t[29]===r?x=t[30]:(x=(e,t)=>{t.reason!==`item-press`&&r(e)},t[29]=r,t[30]=x),S=i&&it(m),t[4]=i,t[5]=e.commands,t[6]=e.label,t[7]=n,t[8]=s,t[9]=r,t[10]=p,t[11]=m,t[12]=h,t[13]=g,t[14]=_,t[15]=v,t[16]=y,t[17]=b,t[18]=x,t[19]=S,t[20]=C}else p=t[10],m=t[11],h=t[12],g=t[13],_=t[14],v=t[15],y=t[16],b=t[17],x=t[18],S=t[19],C=t[20];let w=n!==``,T;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(T=()=>a(!0),t[31]=T):T=t[31];let E;t[32]!==m||t[33]!==i||t[34]!==r?(E=e=>{e.key!==`Escape`||i&&it(m)||(r(``),c(!1),e.currentTarget.blur())},t[32]=m,t[33]=i,t[34]=r,t[35]=E):E=t[35];let D;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Z.jsx)(um,{children:(0,Z.jsx)(Dn,{})}),t[36]=D):D=t[36];let O;t[37]===n?O=t[38]:(O=n===``&&(0,Z.jsx)(um,{align:`inline-end`,className:`max-sm:hidden`,children:(0,Z.jsx)(Om,{children:`⌘K`})}),t[37]=n,t[38]=O);let k;t[39]!==e.label||t[40]!==w||t[41]!==E||t[42]!==O?(k=(0,Z.jsxs)(_m,{ref:l,"aria-label":e.label,placeholder:`Search or run a command`,showTrigger:!1,showClear:w,className:`w-full`,onFocus:T,onKeyDown:E,children:[D,O]}),t[39]=e.label,t[40]=w,t[41]=E,t[42]=O,t[43]=k):k=t[43];let A;t[44]===r?A=t[45]:(A=(0,Z.jsx)(vm,{anchor:u,children:(0,Z.jsx)(ym,{children:e=>(0,Z.jsxs)(bm,{value:e,onClick:()=>{r(``),c(!1),e.run()},children:[e.icon,e.label]},e.label)})}),t[44]=r,t[45]=A);let j;t[46]!==p||t[47]!==k||t[48]!==A||t[49]!==_||t[50]!==v||t[51]!==y||t[52]!==b||t[53]!==x||t[54]!==S?(j=(0,Z.jsxs)(p,{items:_,filter:v,itemToStringValue:y,value:b,onValueChange:x,open:S,onOpenChange:a,autoHighlight:!0,children:[k,A]}),t[46]=p,t[47]=k,t[48]=A,t[49]=_,t[50]=v,t[51]=y,t[52]=b,t[53]=x,t[54]=S,t[55]=j):j=t[55];let M;t[56]===r?M=t[57]:(M=(0,Z.jsx)(pn,{variant:`ghost`,size:`sm`,className:`sm:hidden`,onClick:()=>{r(``),c(!1)},children:`Cancel`}),t[56]=r,t[57]=M);let N;t[58]!==h||t[59]!==j||t[60]!==M||t[61]!==C?(N=(0,Z.jsxs)(`div`,{ref:C,className:h,children:[j,M]}),t[58]=h,t[59]=j,t[60]=M,t[61]=C,t[62]=N):N=t[62];let P;return t[63]!==g||t[64]!==N?(P=(0,Z.jsxs)(Z.Fragment,{children:[g,N]}),t[63]=g,t[64]=N,t[65]=P):P=t[65],P}function Fm(e){return e.label}function Im(e){let t=(0,Pn.c)(25),n;t[0]===e.icon?n=t[1]:(n=(0,Z.jsx)(`img`,{src:e.icon,alt:``,className:`pixelated size-8`}),t[0]=e.icon,t[1]=n);let r;t[2]===e.name?r=t[3]:(r=(0,Z.jsx)(`span`,{className:`font-mono text-sm font-medium`,children:e.name}),t[2]=e.name,t[3]=r);let i;t[4]!==n||t[5]!==r?(i=(0,Z.jsxs)(`a`,{href:`/`,className:`-ml-1 flex shrink-0 items-center gap-1.5`,children:[n,r]}),t[4]=n,t[5]=r,t[6]=i):i=t[6];let a;t[7]===e.tabs?a=t[8]:(a=e.tabs!==void 0&&(0,Z.jsx)(`nav`,{"aria-label":`Sections`,className:`ml-2 flex items-center gap-1`,children:e.tabs}),t[7]=e.tabs,t[8]=a);let o;t[9]===e.commands?o=t[10]:(o=e.commands===void 0&&(0,Z.jsx)(`span`,{className:`flex-1`}),t[9]=e.commands,t[10]=o);let s;t[11]!==e.commands||t[12]!==e.name?(s=e.commands!==void 0&&(0,Z.jsx)(Pm,{commands:e.commands,label:`Search ${e.name}`}),t[11]=e.commands,t[12]=e.name,t[13]=s):s=t[13];let c;t[14]===e.account?c=t[15]:(c=e.account??(0,Z.jsx)(Nm,{}),t[14]=e.account,t[15]=c);let l;t[16]!==e.action||t[17]!==c?(l=(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 lg:ml-auto`,children:[e.action,c]}),t[16]=e.action,t[17]=c,t[18]=l):l=t[18];let u;return t[19]!==i||t[20]!==a||t[21]!==o||t[22]!==s||t[23]!==l?(u=(0,Z.jsxs)(`header`,{className:`bg-background border-border sticky top-0 z-30 flex h-12 shrink-0 items-center gap-2 border-b px-4`,children:[i,a,o,s,l]}),t[19]=i,t[20]=a,t[21]=o,t[22]=s,t[23]=l,t[24]=u):u=t[24],u}function Lm(e){let t=(0,Pn.c)(5),n;t[0]===e.className?n=t[1]:(n=qt(`flex w-full max-w-3xl flex-col gap-4 self-start`,e.className),t[0]=e.className,t[1]=n);let r;return t[2]!==e.children||t[3]!==n?(r=(0,Z.jsx)(`main`,{className:`pb-safe flex min-h-0 flex-1 justify-center overflow-y-auto px-4 pt-3`,children:(0,Z.jsx)(`div`,{className:n,children:e.children})}),t[2]=e.children,t[3]=n,t[4]=r):r=t[4],r}var Rm=Nt(`group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-[0.625rem] 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-2.5!`,{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 bg-input/20 text-foreground dark:bg-input/30 [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 zm(e){let t=(0,Pn.c)(13),n,r,i,a,o;if(t[0]!==e){let{className:s,variant:c,render:l,...u}=e;n=l,o=c===void 0?`default`:c,a=gf,r=`span`,i=Xt({className:qt(Rm({variant:o}),s)},u),t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o}else n=t[1],r=t[2],i=t[3],a=t[4],o=t[5];let s;t[6]===o?s=t[7]:(s={slot:`badge`,variant:o},t[6]=o,t[7]=s);let c;return t[8]!==n||t[9]!==r||t[10]!==i||t[11]!==s?(c={defaultTagName:r,props:i,render:n,state:s},t[8]=n,t[9]=r,t[10]=i,t[11]=s,t[12]=c):c=t[12],a(c)}function Bm(e){let t=(0,Pn.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Z.jsx)(zf,{"data-slot":`collapsible`,...n}),t[2]=n,t[3]=r),r}function Vm(e){let t=(0,Pn.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Z.jsx)(Vf,{"data-slot":`collapsible-trigger`,...n}),t[2]=n,t[3]=r),r}function Hm(e){let t=(0,Pn.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,Z.jsx)(Zf,{"data-slot":`collapsible-content`,...n}),t[2]=n,t[3]=r),r}function Um(e){let t=(0,Pn.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=qt(`animate-pulse rounded-md bg-muted`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`skeleton`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}I(Be(m(`AUTH_URL`)),p);function Wm(e){return`${new URL(e).origin}/auth/sign-in?${new URLSearchParams({next:e})}`}function Gm(e){return Te(Fn)(e)&&e.error!==`temporarily_unavailable`&&e.error!==`access_denied`}nt()(`@deslop/runtime/auth/lib/utils/CurrentUser`);var Km=class e extends ct()(`@deslop/runtime/auth/lib/utils/RpcAuth`,{error:Fn}){static layerClient=t=>qe(e,e=>je(function*(){return yield*e.next({...e.request,headers:be(e.request.headers,`authorization`,`Bearer ${yield*t}`)})}))},qm=class extends O()(`TelemetryError`,{cause:Le(M()),message:W}){},Jm=V(W,ce(Ye(/^[a-fA-F0-9]{32}$/u))),Ym=V(W,ce(Ye(/^[a-fA-F0-9]{16}$/u))),Xm=V(W,ce(Ye(/^\d{1,20}$/u))),Zm=G({key:W,value:A}),Qm=S(G({attributes:K(s(Zm))}),[A]),$m=G({attributes:K(s(Zm)),events:K(s(S(G({attributes:K(s(Zm)),name:W,timeUnixNano:Xm}),[A]))),links:K(s(S(G({attributes:K(s(Zm)),spanId:Ym,traceId:Jm}),[A])))}),eh=S(G({...$m.fields,endTimeUnixNano:K(Xm),name:K(W),parentSpanId:K(tt([Ym,ne(``)])),spanId:Ym,startTimeUnixNano:Xm,status:K(S(G({code:K(y)}),[A])),traceId:Jm}),[A]),th=S(G({attributes:K(s(Zm)),body:K(A),observedTimeUnixNano:K(Xm),severityNumber:K(y),severityText:K(W),spanId:K(tt([Ym,ne(``)])),timeUnixNano:K(Xm),traceId:K(tt([Jm,ne(``)]))}),[A]);G({resourceSpans:K(s(S(G({resource:K(Qm),schemaUrl:K(W),scopeSpans:K(s(S(G({schemaUrl:K(W),scope:K(Qm),spans:K(s(eh))}),[A])))}),[A])))}),G({resourceLogs:K(s(S(G({resource:K(Qm),schemaUrl:K(W),scopeLogs:K(s(S(G({logRecords:K(s(th)),schemaUrl:K(W),scope:K(Qm)}),[A])))}),[A])))});var nh=G({durationMs:z,id:ae,name:W,payload:A,resource:Qm,resourceSchemaUrl:W,scope:Qm,scopeSchemaUrl:W,service:W,signal:Tt([`trace`,`log`]),spanId:W,status:y,time:Xm,traceId:W}).mapFields(st([`resource`,`resourceSchemaUrl`,`scope`,`scopeSchemaUrl`])),rh=G({errors:Re,from:z,limit:V(y,ce(ut({maximum:1e3,minimum:1}))),offset:V(y,ce(ut({maximum:1e5,minimum:0}))),operation:W,runs:Tt([`current`,`all`]),service:W,sort:Tt([`recent`,`slowest`]),text:W,to:z,traceId:W});G({entries:s(nh),total:y});var ih=Tt([`web`,`mobile`,`server`,`unknown`]),ah=G({name:W,runtime:ih}),oh=G({...ah.fields,entries:u,lastEventAt:Xm,runStartedAt:Xm}),sh=G({count:u,credential:Tt([`authorization`,`cookie`,`none`]),lastAt:z,route:Tt([`/v1/traces`,`/v1/logs`]),status:y});G({rejections:s(sh),services:s(oh),since:z});var ch=G({durationMs:z,errors:y,id:Jm,logs:y,operation:W,service:W,services:s(ah),spans:y,time:Xm});G({entries:s(ch),total:y});var lh=G({durationMs:z,failure:Le(G({message:W,span:W})),id:Jm,time:Xm}),uh=G({count:y,failures:y,name:W,p50Ms:z,p95Ms:z,traces:s(lh)}),dh=G({services:s(G({name:W,operations:s(uh)}))});G({count:y,errors:y,from:z,maxMs:z,p50Ms:z,p95Ms:z,to:z});var fh=G({...nh.fields,depth:u,logs:s(nh),offsetMs:z,parentSpanId:W,runtime:ih}),ph=G({durationMs:z,id:Jm,logs:s(nh),services:s(ah),spans:s(fh)}),mh=G({errors:V(rh.fields.errors,Ze(wt(!1)),ue({description:`Only failed spans and error logs.`})),operation:V(rh.fields.operation,Ze(wt(``)),ue({description:`Exact span name.`})),runs:V(rh.fields.runs,Ze(wt(`current`)),ue({description:`"current" searches the latest process/page load/app launch per service. "all" includes retained earlier runs in the lookback.`})),service:V(rh.fields.service,Ze(wt(``)),ue({description:`Exact service name, from list_services.`})),since:V(P,ce(q(C,{expected:`a finite duration`})),Ze(wt(k(10))),ue({description:`Lookback, such as "10 minutes" or "1 hour".`})),text:V(rh.fields.text,Ze(wt(``)),ue({description:`Case-insensitive text in the span name, log message or attributes.`})),traceId:V(rh.fields.traceId,Ze(wt(``)),ue({description:`Only entries of this trace.`}))}),hh=G({...mh.fields,limit:V(rh.fields.limit,Ze(wt(20)),ue({description:`Page size, 1 to 1000.`})),offset:V(rh.fields.offset,Ze(wt(0)),ue({description:`Entries to skip, for the next page.`}))});G({...hh.fields,sort:V(rh.fields.sort,Ze(wt(`recent`)),ue({description:`"recent" puts the newest first, "slowest" the longest first.`}))});var gh=class extends rt(at(`scope.overview`,{error:tt([Fn,qm]),stream:!0,success:dh}),at(`scope.trace`,{error:tt([Fn,qm]),payload:G({id:Jm}),success:ph})).middleware(Km){},_h=class extends Fe()(`@deslop/scope/lib/utils/RpcClient`,{group:gh,protocol:mn}){},vh=Ee(_h.runtime.atom(V(_h,ge(e=>e(`scope.overview`,void 0)),Ke,Oe(e=>V(e(xt(`2 seconds`)),re(e=>e.input._tag===`RpcClientError`)))))),yh=Qe(e=>{let t=e(vh),n=ht(e.self(),e=>e.seen);if(!St(t))return{arrived:pe(),seen:n};let r=we(t.value.services,e=>we(e.operations,e=>Xe(e.traces,e=>e.id)));return{arrived:_(n,{onNone:()=>pe(),onSome:e=>le(r,e)}),seen:L(r)}}),bh=dt(e=>_h.query(`scope.trace`,{id:bt(lt(l(e,`:`)),()=>e)})),xh=Qe(Ce(et(`30 seconds`),()=>d));function Sh(e,t){let n=te(0,(t-bt(x(V(e,Ve(0,-6))),()=>t))/1e3);return n<10?`now`:n<60?`${E(n,0)}s`:n<3600?`${E(n/60,0)}m`:n<86400?`${E(n/3600,0)}h`:`${E(n/86400,0)}d`}function Ch(e){return V(e,R(/^@deslop\//u,``),R(/-server$/u,``),R(/-client$/u,` web`),R(/-ios$/u,` iOS`))}function wh(e){return e<1e3?`${E(e,0)} ms`:`${E(e/1e3,1)} s`}var Th=`/assets/icon-D1hVTa1Q.svg`,Eh={auth:`var(--orange)`,deploy:`var(--blue)`,gateway:`var(--purple)`,opm:`var(--orange)`,portfolio:`var(--orange)`,scope:`var(--cyan)`,signal:`var(--magenta)`,stash:`var(--yellow)`,trips:`var(--blue)`},Dh=s(G({key:W,value:T})),Oh=w(W,T),kh=ft(Xe(Ge(Object.assign({"../../../../auth/src/routes/icon.svg":In,"../../../../deploy/src/routes/icon.svg":Ln,"../../../../gateway/src/routes/icon.svg":Rn,"../../../../opm/src/routes/icon.svg":zn,"../../../../portfolio/src/routes/icon.svg":Bn,"../icon.svg":Vn,"../../../../signal/src/routes/icon.svg":Hn,"../../../../stash/src/routes/icon.svg":Un,"../../../../trips/src/routes/icon.svg":Wn})),e=>[l(e[0],`/`)[4]??``,e[1]]));function Ah(e){return l(Ch(e),` `)[0]??``}function jh(e){return _(oe(e.cause),{onNone:()=>(0,Z.jsx)(cn,{error:se(e.cause),reset:()=>location.reload()}),onSome:e=>Gm(e)?(0,Z.jsx)(fn,{href:Wm(location.href)}):(0,Z.jsx)(cn,{error:e,reset:()=>location.reload()})})}function Mh(e){return V(fe(Oh)(e),ht(e=>lt(Ne(e))),he(e=>j(e)||ee(e)||c(e)),_({onNone:()=>JSON.stringify(e),onSome:e=>`${e}`}))}function Nh(e,t){return[...D(e.service===t,{onFalse:()=>[{key:`service`,value:Ch(e.service)}],onTrue:()=>[]}),...B(Xe(B(bt(fe(Dh)(e.payload.attributes),()=>[]),e=>e.key!==`service.name`),e=>({key:e.key,value:Mh(e.value)})),t=>t.value!==e.name)]}function Ph(e){return V(ie(e,e=>e.status===2),ht(e=>Ct(e.payload.status)),he(b),ht(e=>Ct(V(Se(e,`message`),U))),he(g),he(v))}function Fh(e,t){return _t(Ph(e))||Ie(Nh(e,t))||Ie(e.logs)}function Ih(e){return`calc(var(--spacing) * 10 + ${te(0,e.depth-1)*12}px)`}function Lh(e){let t=(0,Pn.c)(7),n;if(t[0]!==e.service||t[1]!==e.span){let r;t[3]===e.span?r=t[4]:(r=(t,n)=>(0,Z.jsxs)(`div`,{className:`flex items-baseline gap-3 py-1 pr-1 pl-(--indent)`,style:{"--indent":Ih(e.span)},children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground shrink-0`,children:t.key}),(0,Z.jsx)(`dd`,{className:qt(`min-w-0 flex-1 text-right break-all select-text`,t.failed&&`text-destructive`),children:t.value}),(0,Z.jsx)(`span`,{className:`size-3.5 shrink-0`})]},`${t.key}:${n}`),t[3]=e.span,t[4]=r),n=Xe([..._(Ph(e.span),{onNone:Vh,onSome:Bh}),...Xe(Nh(e.span,e.service),zh),...Xe(e.span.logs,Rh)],r),t[0]=e.service,t[1]=e.span,t[2]=n}else n=t[2];let r;return t[5]===n?r=t[6]:(r=(0,Z.jsx)(`dl`,{className:`flex flex-col pb-1 font-mono text-xs`,children:n}),t[5]=n,t[6]=r),r}function Rh(e){return{failed:e.status===2,key:`log`,value:e.name}}function zh(e){return{...e,failed:!1}}function Bh(e){return[{failed:!0,key:`error`,value:e}]}function Vh(){return[]}function Hh(e){let t=(0,Pn.c)(26),n;t[0]===e.span?n=t[1]:(n=Ih(e.span),t[0]=e.span,t[1]=n);let r;t[2]===n?r=t[3]:(r={"--indent":n},t[2]=n,t[3]=r);let i;t[4]!==e.span.name||t[5]!==r?(i=(0,Z.jsx)(`span`,{className:`w-36 shrink-0 truncate pl-(--indent) text-left sm:w-56`,style:r,children:e.span.name}),t[4]=e.span.name,t[5]=r,t[6]=i):i=t[6];let a;t[7]===e.span.status?a=t[8]:(a=qt(`absolute top-0 left-(--offset) h-2 w-(--length) min-w-0.5`,D(e.span.status===2,{onFalse:Kh,onTrue:Gh})),t[7]=e.span.status,t[8]=a);let o=`calc(${e.span.durationMs} / var(--trace-total) * 100%)`,s=`calc(${e.span.offsetMs} / var(--trace-total) * 100%)`,c;t[9]!==o||t[10]!==s?(c={"--length":o,"--offset":s},t[9]=o,t[10]=s,t[11]=c):c=t[11];let l;t[12]!==a||t[13]!==c?(l=(0,Z.jsx)(`span`,{className:`relative h-2 flex-1`,children:(0,Z.jsx)(`span`,{className:a,style:c})}),t[12]=a,t[13]=c,t[14]=l):l=t[14];let u;t[15]===e.span.durationMs?u=t[16]:(u=wh(e.span.durationMs),t[15]=e.span.durationMs,t[16]=u);let d;t[17]===u?d=t[18]:(d=(0,Z.jsx)(`span`,{className:`text-muted-foreground w-14 shrink-0 text-right font-mono`,children:u}),t[17]=u,t[18]=d);let f;t[19]===e.open?f=t[20]:(f=_(ve(e.open),{onNone:Wh,onSome:Uh}),t[19]=e.open,t[20]=f);let p;return t[21]!==f||t[22]!==i||t[23]!==l||t[24]!==d?(p=(0,Z.jsxs)(Z.Fragment,{children:[i,l,d,f]}),t[21]=f,t[22]=i,t[23]=l,t[24]=d,t[25]=p):p=t[25],p}function Uh(e){return(0,Z.jsx)(Tn,{className:qt(`text-muted-foreground size-3.5 shrink-0 transition-transform`,e&&`rotate-90`)})}function Wh(){return(0,Z.jsx)(`span`,{className:`size-3.5 shrink-0`})}function Gh(){return`bg-destructive`}function Kh(){return`bg-(--app)`}function qh(e){let t=B(e,e=>e.status===2),n=Xe(t,e=>bt(he(Ct(e.payload.parentSpanId),g),()=>``));return o(t,e=>!ye(n,t=>ze(t)===e.spanId))}function Jh(e){let t=(0,Pn.c)(22),n=`${e.id}:${e.size}`,r;t[0]===n?r=t[1]:(r=bh(n),t[0]=n,t[1]=r);let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i={includeFailure:!0},t[2]=i):i=t[2];let a=ur(r,i),[s,c]=(0,X.useState)();if(mt(a)){let e;return t[3]===a.cause?e=t[4]:(e=(0,Z.jsx)(jh,{cause:a.cause}),t[3]=a.cause,t[4]=e),e}let l=a.value,u;if(t[5]!==s||t[6]!==e.service||t[7]!==l.durationMs||t[8]!==l.spans){let n=o(l.spans,Zh),r=B(l.spans,e=>!Ae(n,t=>t.spanId===e.spanId)),i;t[10]!==s||t[11]!==l.spans?(i=()=>o(l.spans,e=>e.spanId===s),t[10]=s,t[11]=l.spans,t[12]=i):i=t[12];let a;t[13]===e.service?a=t[14]:(a=t=>Fh(t,e.service),t[13]=e.service,t[14]=a);let d=he(D(s===void 0,{onFalse:i,onTrue:()=>V(qh(l.spans),h(()=>n))}),a),f=Eh[Ah(e.service)]??`var(--primary)`,p;t[15]===l.durationMs?p=t[16]:(p=te(l.durationMs,1),t[15]=l.durationMs,t[16]=p);let m=`${p}`,g;t[17]!==f||t[18]!==m?(g={"--app":f,"--trace-total":m},t[17]=f,t[18]=m,t[19]=g):g=t[19];let v;t[20]===e.service?v=t[21]:(v=t=>(0,Z.jsx)(Lh,{service:e.service,span:t}),t[20]=e.service,t[21]=v),u=(0,Z.jsxs)(`div`,{className:`flex flex-col pb-2`,style:g,children:[_(he(d,e=>Ae(n,t=>t.spanId===e.spanId)),{onNone:Xh,onSome:v}),Xe(r,t=>D(Fh(t,e.service),{onFalse:()=>(0,Z.jsx)(`div`,{className:`flex h-8 w-full items-center gap-3 pr-1 text-xs`,children:(0,Z.jsx)(Hh,{span:t})},t.spanId),onTrue:()=>(0,Z.jsxs)(Bm,{open:Ae(d,e=>e.spanId===t.spanId),onOpenChange:e=>c(D(e,{onFalse:Yh,onTrue:()=>t.spanId})),className:`data-open:bg-muted/60`,children:[(0,Z.jsx)(Vm,{className:`hover:bg-muted/50 flex h-8 w-full cursor-pointer items-center gap-3 pr-1 text-left text-xs`,children:(0,Z.jsx)(Hh,{span:t,open:Ae(d,e=>e.spanId===t.spanId)})}),(0,Z.jsx)(Hm,{children:(0,Z.jsx)(Lh,{service:e.service,span:t})})]},t.spanId)}))]}),t[5]=s,t[6]=e.service,t[7]=l.durationMs,t[8]=l.spans,t[9]=u}else u=t[9];return u}function Yh(){return``}function Xh(){return null}function Zh(e){return e.depth===0}function Qh(){let e=(0,Pn.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(`div`,{"aria-busy":`true`,role:`status`,"aria-label":`Spans`,className:`flex flex-col gap-2 py-2 pr-1 pl-10`,children:Xe(ot(1,4),$h)}),e[0]=t):t=e[0],t}function $h(e){return(0,Z.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,Z.jsx)(Um,{className:`h-4 w-32`}),(0,Z.jsx)(Um,{className:`h-2 flex-1`})]},e)}function eg(e){let t=(0,Pn.c)(38),[n,r]=(0,X.useState)(!1),i=e.arrived&&`grow-in`,a;t[0]===i?a=t[1]:(a=qt(i),t[0]=i,t[1]=a);let o;t[2]===e?o=t[3]:(o=t=>{r(t),e.onOpenChange(t)},t[2]=e,t[3]=o);let s;t[4]!==e.now||t[5]!==e.trace.time?(s=Sh(e.trace.time,e.now),t[4]=e.now,t[5]=e.trace.time,t[6]=s):s=t[6];let c;t[7]===s?c=t[8]:(c=(0,Z.jsx)(`span`,{className:`text-muted-foreground w-8 shrink-0 font-mono`,children:s}),t[7]=s,t[8]=c);let l;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(`span`,{className:`flex-1`}),t[9]=l):l=t[9];let u;t[10]===e.trace.failure?u=t[11]:(u=e.trace.failure!==void 0&&(0,Z.jsx)(zm,{variant:`destructive`,className:`max-w-40 shrink-0 font-mono`,title:`Failed at ${e.trace.failure.span}`,children:(0,Z.jsx)(`span`,{className:`truncate`,children:e.trace.failure.span})}),t[10]=e.trace.failure,t[11]=u);let d;t[12]===e.trace.durationMs?d=t[13]:(d=wh(e.trace.durationMs),t[12]=e.trace.durationMs,t[13]=d);let f;t[14]===d?f=t[15]:(f=(0,Z.jsx)(`span`,{className:`w-14 shrink-0 text-right font-mono`,children:d}),t[14]=d,t[15]=f);let p=n&&`rotate-90`,m;t[16]===p?m=t[17]:(m=qt(`text-muted-foreground size-3.5 shrink-0 transition-transform`,p),t[16]=p,t[17]=m);let h;t[18]===m?h=t[19]:(h=(0,Z.jsx)(Tn,{className:m}),t[18]=m,t[19]=h);let g;t[20]!==h||t[21]!==c||t[22]!==u||t[23]!==f?(g=(0,Z.jsxs)(Vm,{className:`hover:bg-muted/50 flex h-8 w-full cursor-pointer items-center gap-3 pr-1 pl-6 text-left text-xs`,children:[c,l,u,f,h]}),t[20]=h,t[21]=c,t[22]=u,t[23]=f,t[24]=g):g=t[24];let _;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Z.jsx)(Qh,{}),t[25]=_):_=t[25];let v;t[26]!==e.service||t[27]!==e.trace.durationMs||t[28]!==e.trace.id?(v=(0,Z.jsx)(Hm,{children:(0,Z.jsx)(X.Suspense,{fallback:_,children:(0,Z.jsx)(Jh,{id:e.trace.id,service:e.service,size:e.trace.durationMs})})}),t[26]=e.service,t[27]=e.trace.durationMs,t[28]=e.trace.id,t[29]=v):v=t[29];let y;t[30]!==n||t[31]!==g||t[32]!==v||t[33]!==o?(y=(0,Z.jsxs)(Bm,{open:n,onOpenChange:o,className:`border-b`,children:[g,v]}),t[30]=n,t[31]=g,t[32]=v,t[33]=o,t[34]=y):y=t[34];let b;return t[35]!==a||t[36]!==y?(b=(0,Z.jsx)(`div`,{className:a,children:y}),t[35]=a,t[36]=y,t[37]=b):b=t[37],b}function tg(e){let t=(0,Pn.c)(66),[n,r]=(0,X.useState)(!1),[i,a]=(0,X.useState)(He),o,s,c,l,u,d,f,p,m;if(t[0]!==n||t[1]!==i||t[2]!==e.arrived||t[3]!==e.now||t[4]!==e.operation.count||t[5]!==e.operation.failures||t[6]!==e.operation.name||t[7]!==e.operation.p50Ms||t[8]!==e.operation.p95Ms||t[9]!==e.operation.traces||t[10]!==e.service){let h;t[20]===e.operation.traces?h=t[21]:(h=t=>!ye(e.operation.traces,e=>e.id===t.id),t[20]=e.operation.traces,t[21]=h);let g=[...e.operation.traces,...B(Ne(i),h)];s=Bm,u=`listitem`,d=n,f=r,p=`border-b`;let _;t[22]===e.operation.name?_=t[23]:(_=(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,children:e.operation.name}),t[22]=e.operation.name,t[23]=_);let v;t[24]===e.operation.failures?v=t[25]:(v=e.operation.failures>0&&(0,Z.jsxs)(zm,{variant:`destructive`,className:`shrink-0 font-mono`,title:`Failed`,children:[e.operation.failures,(0,Z.jsx)(`span`,{className:`sr-only`,children:` failed`})]}),t[24]=e.operation.failures,t[25]=v);let y;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsx)(`span`,{className:`sr-only`,children:` runs`}),t[26]=y):y=t[26];let b;t[27]===e.operation.count?b=t[28]:(b=(0,Z.jsxs)(`span`,{className:`text-muted-foreground w-10 shrink-0 text-right font-mono text-xs max-sm:hidden`,title:`Runs`,children:[e.operation.count,`×`,y]}),t[27]=e.operation.count,t[28]=b);let x;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Z.jsx)(`span`,{className:`sr-only`,children:`typical `}),t[29]=x):x=t[29];let S;t[30]===e.operation.p50Ms?S=t[31]:(S=wh(e.operation.p50Ms),t[30]=e.operation.p50Ms,t[31]=S);let C;t[32]===S?C=t[33]:(C=(0,Z.jsxs)(`span`,{className:`text-muted-foreground w-14 shrink-0 text-right font-mono text-xs max-sm:hidden`,title:`Typical`,children:[x,S]}),t[32]=S,t[33]=C);let w;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Z.jsx)(`span`,{className:`sr-only`,children:`slowest 5% `}),t[34]=w):w=t[34];let T;t[35]===e.operation.p95Ms?T=t[36]:(T=wh(e.operation.p95Ms),t[35]=e.operation.p95Ms,t[36]=T);let E;t[37]===T?E=t[38]:(E=(0,Z.jsxs)(`span`,{className:`w-14 shrink-0 text-right font-mono text-xs`,title:`Slowest 5%`,children:[w,T]}),t[37]=T,t[38]=E);let O=n&&`rotate-90`,k;t[39]===O?k=t[40]:(k=qt(`text-muted-foreground size-3.5 shrink-0 transition-transform`,O),t[39]=O,t[40]=k);let A;t[41]===k?A=t[42]:(A=(0,Z.jsx)(Tn,{className:k}),t[41]=k,t[42]=A),t[43]!==b||t[44]!==C||t[45]!==E||t[46]!==A||t[47]!==_||t[48]!==v?(m=(0,Z.jsxs)(Vm,{className:`hover:bg-muted/50 flex h-10 w-full cursor-pointer items-center gap-3 px-1 text-left text-sm`,children:[_,v,b,C,E,A]}),t[43]=b,t[44]=C,t[45]=E,t[46]=A,t[47]=_,t[48]=v,t[49]=m):m=t[49],o=Hm,c=`border-t`;let j;t[50]!==e.arrived||t[51]!==e.now||t[52]!==e.service?(j=t=>(0,Z.jsx)(eg,{arrived:de(e.arrived,t.id),now:e.now,onOpenChange:e=>a(n=>D(e,{onFalse:()=>De(n,t.id),onTrue:()=>$e(n,t.id,t)})),service:e.service,trace:t},t.id),t[50]=e.arrived,t[51]=e.now,t[52]=e.service,t[53]=j):j=t[53],l=Xe(g,j),t[0]=n,t[1]=i,t[2]=e.arrived,t[3]=e.now,t[4]=e.operation.count,t[5]=e.operation.failures,t[6]=e.operation.name,t[7]=e.operation.p50Ms,t[8]=e.operation.p95Ms,t[9]=e.operation.traces,t[10]=e.service,t[11]=o,t[12]=s,t[13]=c,t[14]=l,t[15]=u,t[16]=d,t[17]=f,t[18]=p,t[19]=m}else o=t[11],s=t[12],c=t[13],l=t[14],u=t[15],d=t[16],f=t[17],p=t[18],m=t[19];let h;t[54]!==o||t[55]!==c||t[56]!==l?(h=(0,Z.jsx)(o,{className:c,children:l}),t[54]=o,t[55]=c,t[56]=l,t[57]=h):h=t[57];let g;return t[58]!==s||t[59]!==u||t[60]!==d||t[61]!==f||t[62]!==p||t[63]!==m||t[64]!==h?(g=(0,Z.jsxs)(s,{role:u,open:d,onOpenChange:f,className:p,children:[m,h]}),t[58]=s,t[59]=u,t[60]=d,t[61]=f,t[62]=p,t[63]=m,t[64]=h,t[65]=g):g=t[65],g}function ng(e){let t=(0,Pn.c)(5),n=ze(Mm()),r=rr(yh).arrived,i=me(rr(xh),cg),a=B(Xe(e.overview.services,e=>({...e,operations:B(e.operations,t=>vt(n)(ze(`${Ch(e.name)} ${t.name}`)))})),sg);if(Je(a)){let e=D(n===``,{onFalse:og,onTrue:ag}),r;return t[0]===e?r=t[1]:(r=(0,Z.jsx)(nn,{children:(0,Z.jsx)(Yt,{children:(0,Z.jsx)(ln,{children:e})})}),t[0]=e,t[1]=r),r}let o;return t[2]!==r||t[3]!==i?(o=e=>(0,Z.jsxs)(`section`,{"aria-label":Ch(e.name),className:`flex flex-col`,style:{"--app":Eh[Ah(e.name)]??`var(--primary)`},children:[(0,Z.jsxs)(`h2`,{className:`flex h-9 items-center gap-2 px-1 text-sm font-semibold`,children:[_(ve(kh[Ah(e.name)]),{onNone:ig,onSome:rg}),Ch(e.name)]}),(0,Z.jsx)(`div`,{role:`list`,children:Xe(e.operations,t=>(0,Z.jsx)(tg,{arrived:r,now:i,operation:t,service:e.name},t.name))})]},e.name),t[2]=r,t[3]=i,t[4]=o):o=t[4],Xe(a,o)}function rg(e){return(0,Z.jsx)(`img`,{src:e,alt:``,className:`pixelated size-5`})}function ig(){return(0,Z.jsx)(kn,{className:`text-muted-foreground size-4`})}function ag(){return`No traces yet`}function og(){return`No operation matches`}function sg(e){return Ie(e.operations)}function cg(){return pt(Ue())}function lg(){let e=(0,Pn.c)(5),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={includeFailure:!0},e[0]=t):t=e[0];let n=ur(vh,t);if(mt(n)){let t;return e[1]===n.cause?t=e[2]:(t=(0,Z.jsx)(jh,{cause:n.cause}),e[1]=n.cause,e[2]=t),t}let r;return e[3]===n.value?r=e[4]:(r=(0,Z.jsx)(ng,{overview:n.value}),e[3]=n.value,e[4]=r),r}function ug(){let e=(0,Pn.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(Im,{icon:Th,name:`scope`,commands:[]}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsxs)(Z.Fragment,{children:[t,(0,Z.jsx)(Lm,{className:`gap-6`,children:(0,Z.jsx)(X.Suspense,{fallback:(0,Z.jsx)(`div`,{role:`status`,"aria-label":`Operations`,className:`flex flex-col gap-2`,children:Xe(ot(1,6),dg)}),children:(0,Z.jsx)(lg,{})})})]}),e[1]=n):n=e[1],n}function dg(e){return(0,Z.jsx)(Um,{className:`h-9 w-full`},e)}export{ug as component};
|