@auersperg/flare 0.3.6 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. package/dist/cli/flare.js +1 -1
  2. package/dist/platform/admin.js +12 -4
  3. package/dist/platform/dashboard/_astro/{auth-view.UTGGCEHc.js → auth-view.DxyBDw7Z.js} +1 -1
  4. package/dist/platform/dashboard/_astro/cli-approval.C4-RBXQh.js +1 -0
  5. package/dist/platform/dashboard/_astro/common.D6YHScsr.js +1 -0
  6. package/dist/platform/dashboard/_astro/data-view.B2afgdXn.js +1 -0
  7. package/dist/platform/dashboard/_astro/functions-view.B0jPBNNy.js +1 -0
  8. package/dist/platform/dashboard/_astro/index.BPQdjJ4j.css +2 -0
  9. package/dist/platform/dashboard/_astro/index.astro_astro_type_script_index_0_lang.BQ7pqT75.js +3 -0
  10. package/dist/platform/dashboard/_astro/{input-group.CJxPRHej.js → input-group.BziAwKdZ.js} +1 -1
  11. package/dist/platform/dashboard/_astro/{sdk-view.COmbEZrF.js → sdk-view.DAd5aPbd.js} +1 -1
  12. package/dist/platform/dashboard/_astro/services-view.BvkS7FHr.js +1 -0
  13. package/dist/platform/dashboard/_astro/settings-view.BXt0dexJ.js +3 -0
  14. package/dist/platform/dashboard/index.html +1 -1
  15. package/dist/platform/manifest.json +36 -36
  16. package/dist/platform/runtime.js +1 -1
  17. package/package.json +1 -1
  18. package/dist/platform/dashboard/_astro/cli-approval.BZAWmpiR.js +0 -1
  19. package/dist/platform/dashboard/_astro/common.DPoFQu44.js +0 -1
  20. package/dist/platform/dashboard/_astro/data-view.BgYyTCMN.js +0 -1
  21. package/dist/platform/dashboard/_astro/functions-view.PUkng3T1.js +0 -1
  22. package/dist/platform/dashboard/_astro/index.astro_astro_type_script_index_0_lang.BEuO3H0E.js +0 -4
  23. package/dist/platform/dashboard/_astro/index.lobU7uK5.css +0 -2
  24. package/dist/platform/dashboard/_astro/services-view.C34dy0dk.js +0 -1
  25. package/dist/platform/dashboard/_astro/settings-view.IuD2r5JW.js +0 -3
package/dist/cli/flare.js CHANGED
@@ -3,7 +3,7 @@
3
3
  // packages/flare/package.json
4
4
  var package_default = {
5
5
  name: "@auersperg/flare",
6
- version: "0.3.6",
6
+ version: "0.3.7",
7
7
  license: "MIT",
8
8
  type: "module",
9
9
  description: "Flare client, server declarations and development CLI",
@@ -23,7 +23,7 @@ async function collectCatalog(database, now = Date.now()) {
23
23
  // packages/core/package.json
24
24
  var package_default = {
25
25
  name: "@flare/platform",
26
- version: "0.3.6",
26
+ version: "0.3.7",
27
27
  type: "module",
28
28
  license: "MIT",
29
29
  private: true,
@@ -297,6 +297,13 @@ async function accessEmail(access, audience) {
297
297
  fail("UNAUTHORIZED");
298
298
  return identity.email.toLowerCase();
299
299
  }
300
+ function projectCustomer(value) {
301
+ if (value === undefined)
302
+ return "Default";
303
+ if (typeof value !== "string" || !value.trim() || value.length > 100)
304
+ fail("INVALID_INPUT");
305
+ return value.trim();
306
+ }
300
307
 
301
308
  // packages/core/src/project-deletion.ts
302
309
  function authorizeProjectDeletion(actor, project, input) {
@@ -520,10 +527,11 @@ async function api(request, env, a) {
520
527
  fail("FORBIDDEN");
521
528
  writable(a);
522
529
  const input = await jsonBody(request);
523
- for (const field of ["name", "customer"])
530
+ for (const field of ["name"])
524
531
  if (typeof input[field] !== "string" || input[field].trim().length < 1 || input[field].length > 100)
525
532
  fail("INVALID_INPUT");
526
- const customer = await env.CATALOG.prepare("SELECT id FROM customers WHERE name=? COLLATE NOCASE LIMIT 1").bind(input.customer.trim()).first();
533
+ const customerName = projectCustomer(input.customer);
534
+ const customer = await env.CATALOG.prepare("SELECT id FROM customers WHERE name=? COLLATE NOCASE LIMIT 1").bind(customerName).first();
527
535
  const id = crypto.randomUUID(), customerId = customer?.id ?? crypto.randomUUID(), at = Date.now();
528
536
  const alias = input.alias ? projectAlias(input.alias) : defaultAlias(input.name, id);
529
537
  if (await env.CATALOG.prepare("SELECT projectId FROM project_aliases WHERE alias=?").bind(alias).first())
@@ -532,7 +540,7 @@ async function api(request, env, a) {
532
540
  const result = await audit(env, a, id, null, "project.create", async () => {
533
541
  await env.CATALOG.batch([
534
542
  ...customer ? [] : [
535
- env.CATALOG.prepare("INSERT INTO customers VALUES (?,?,?)").bind(customerId, input.customer.trim(), at)
543
+ env.CATALOG.prepare("INSERT INTO customers VALUES (?,?,?)").bind(customerId, customerName, at)
536
544
  ],
537
545
  env.CATALOG.prepare("INSERT INTO projects VALUES (?,?,?,?)").bind(id, customerId, input.name.trim(), at),
538
546
  env.CATALOG.prepare("INSERT INTO project_aliases (projectId,alias) VALUES (?,?)").bind(id, alias),
@@ -1 +1 @@
1
- import{a as e,r as t}from"./client.BeKNsjPN.js";import{S as n,_ as r,a as i,b as a,f as o,g as s,gt as c,ht as l,n as u,p as d,s as f,u as p,v as m,x as h,y as g}from"./common.DPoFQu44.js";import{s as _}from"./index.astro_astro_type_script_index_0_lang.BEuO3H0E.js";var v=e(t(),1),y=c();function b(e){let t=s(e.project,e.env),[c,b]=(0,v.useState)(``),[x,S]=(0,v.useState)(),C=p(t+`/auth-users`+(c?`?cursor=`+encodeURIComponent(c):``)),w=p(t+`/auth-settings`),T=e.session.role===`owner`,E=(n,r,i,a=[])=>{S({title:r,description:`Passwords are never displayed. Changes revoke existing sessions.`,productionId:e.env===`prod`?e.project.id:void 0,fields:a,submit:async r=>{try{await d(t+`/`+n,{...i,...o(a,e=>new FormData(r).get(e)),confirm:e.project.id})}catch(e){throw e instanceof Error&&e.message===`INVALID_PASSWORD`?Error(`Password must contain 6–128 characters. Spaces are allowed; the password is not trimmed.`):e instanceof Error&&e.message===`REGISTRATION_UNAVAILABLE`?Error(`This login is already registered. Choose another login or manage the existing user.`):e}C.refresh(),w.refresh()}})},D={name:`password`,type:`password`,required:!0,description:`6–128 characters.`};return(0,y.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,y.jsx)(`h1`,{className:`page-title`,children:`Auth`}),(0,y.jsx)(f,{loading:C.loading||w.loading,error:C.error||w.error}),w.data&&(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,y.jsx)(_,{status:w.data.enabled?`Enabled`:`Disabled`}),(0,y.jsx)(_,{status:w.data.registration?`Public registration`:`Registration closed`}),T&&(0,y.jsx)(l,{variant:`outline`,onClick:()=>E(`auth-configure`,`Configure authentication`,{},[{name:`enabled`,type:`boolean`,value:w.data.enabled},{name:`registration`,type:`boolean`,value:w.data.registration}]),children:`Configure`}),T&&(0,y.jsx)(l,{onClick:()=>E(`auth-create`,`Create user`,{},[{name:`login`,type:`string`,required:!0},D]),children:`Create user`})]}),C.data&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(r,{children:[(0,y.jsx)(h,{children:(0,y.jsxs)(n,{children:[(0,y.jsx)(a,{children:`Login`}),(0,y.jsx)(a,{children:`User ID`}),(0,y.jsx)(a,{children:`Status`}),(0,y.jsx)(a,{children:`Created`}),(0,y.jsx)(a,{children:`Actions`})]})}),(0,y.jsx)(m,{children:C.data.users.map(e=>(0,y.jsxs)(n,{children:[(0,y.jsx)(g,{children:e.login}),(0,y.jsx)(g,{children:(0,y.jsx)(`code`,{children:e.id})}),(0,y.jsx)(g,{children:(0,y.jsx)(_,{status:e.disabled?`Blocked`:`Active`})}),(0,y.jsx)(g,{children:new Date(e.createdAt).toLocaleString()}),(0,y.jsx)(g,{children:(0,y.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:T&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(l,{variant:`outline`,size:`sm`,onClick:()=>E(`auth-password`,`Change user password`,{id:e.id},[D]),children:`Change password`}),(0,y.jsx)(l,{variant:`outline`,size:`sm`,onClick:()=>E(`auth-revoke`,`Revoke all sessions`,{id:e.id}),children:`Revoke sessions`}),(0,y.jsx)(l,{variant:`outline`,size:`sm`,onClick:()=>E(`auth-disable`,e.disabled?`Unblock user`:`Block user`,{id:e.id,disabled:!e.disabled}),children:e.disabled?`Unblock`:`Block`})]})})})]},e.id))})]}),!C.data.users.length&&(0,y.jsx)(u,{title:`No users`}),(0,y.jsxs)(`div`,{className:`flex gap-2`,children:[(0,y.jsx)(l,{variant:`outline`,disabled:!c,onClick:()=>b(``),children:`First page`}),(0,y.jsx)(l,{variant:`outline`,disabled:!C.data.next,onClick:()=>b(C.data.next),children:`Next page`})]})]}),x&&(0,y.jsx)(i,{modal:x,onClose:()=>S(void 0)})]})}export{b as default};
1
+ import{a as e,r as t}from"./client.BeKNsjPN.js";import{S as n,_ as r,a as i,b as a,f as o,g as s,mt as c,n as l,p as u,pt as d,s as f,u as p,v as m,x as h,y as g}from"./common.D6YHScsr.js";import{o as _}from"./index.astro_astro_type_script_index_0_lang.BQ7pqT75.js";var v=e(t(),1),y=c();function b(e){let t=s(e.project,e.env),[c,b]=(0,v.useState)(``),[x,S]=(0,v.useState)(),C=p(t+`/auth-users`+(c?`?cursor=`+encodeURIComponent(c):``)),w=p(t+`/auth-settings`),T=e.session.role===`owner`,E=(n,r,i,a=[])=>{S({title:r,description:`Passwords are never displayed. Changes revoke existing sessions.`,productionId:e.env===`prod`?e.project.id:void 0,fields:a,submit:async r=>{try{await u(t+`/`+n,{...i,...o(a,e=>new FormData(r).get(e)),confirm:e.project.id})}catch(e){throw e instanceof Error&&e.message===`INVALID_PASSWORD`?Error(`Password must contain 6–128 characters. Spaces are allowed; the password is not trimmed.`):e instanceof Error&&e.message===`REGISTRATION_UNAVAILABLE`?Error(`This login is already registered. Choose another login or manage the existing user.`):e}C.refresh(),w.refresh()}})},D={name:`password`,type:`password`,required:!0,description:`6–128 characters.`};return(0,y.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,y.jsx)(`h1`,{className:`page-title`,children:`Auth`}),(0,y.jsx)(f,{loading:C.loading||w.loading,error:C.error||w.error}),w.data&&(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,y.jsx)(_,{status:w.data.enabled?`Enabled`:`Disabled`}),(0,y.jsx)(_,{status:w.data.registration?`Public registration`:`Registration closed`}),T&&(0,y.jsx)(d,{variant:`outline`,onClick:()=>E(`auth-configure`,`Configure authentication`,{},[{name:`enabled`,type:`boolean`,value:w.data.enabled},{name:`registration`,type:`boolean`,value:w.data.registration}]),children:`Configure`}),T&&(0,y.jsx)(d,{onClick:()=>E(`auth-create`,`Create user`,{},[{name:`login`,type:`string`,required:!0},D]),children:`Create user`})]}),C.data&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)(r,{children:[(0,y.jsx)(h,{children:(0,y.jsxs)(n,{children:[(0,y.jsx)(a,{children:`Login`}),(0,y.jsx)(a,{children:`User ID`}),(0,y.jsx)(a,{children:`Status`}),(0,y.jsx)(a,{children:`Created`}),(0,y.jsx)(a,{children:`Actions`})]})}),(0,y.jsx)(m,{children:C.data.users.map(e=>(0,y.jsxs)(n,{children:[(0,y.jsx)(g,{children:e.login}),(0,y.jsx)(g,{children:(0,y.jsx)(`code`,{children:e.id})}),(0,y.jsx)(g,{children:(0,y.jsx)(_,{status:e.disabled?`Blocked`:`Active`})}),(0,y.jsx)(g,{children:new Date(e.createdAt).toLocaleString()}),(0,y.jsx)(g,{children:(0,y.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:T&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(d,{variant:`outline`,size:`sm`,onClick:()=>E(`auth-password`,`Change user password`,{id:e.id},[D]),children:`Change password`}),(0,y.jsx)(d,{variant:`outline`,size:`sm`,onClick:()=>E(`auth-revoke`,`Revoke all sessions`,{id:e.id}),children:`Revoke sessions`}),(0,y.jsx)(d,{variant:`outline`,size:`sm`,onClick:()=>E(`auth-disable`,e.disabled?`Unblock user`:`Block user`,{id:e.id,disabled:!e.disabled}),children:e.disabled?`Unblock`:`Block`})]})})})]},e.id))})]}),!C.data.users.length&&(0,y.jsx)(l,{title:`No users`}),(0,y.jsxs)(`div`,{className:`flex gap-2`,children:[(0,y.jsx)(d,{variant:`outline`,disabled:!c,onClick:()=>b(``),children:`First page`}),(0,y.jsx)(d,{variant:`outline`,disabled:!C.data.next,onClick:()=>b(C.data.next),children:`Next page`})]})]}),x&&(0,y.jsx)(i,{modal:x,onClose:()=>S(void 0)})]})}export{b as default};
@@ -0,0 +1 @@
1
+ import{a as e,r as t}from"./client.BeKNsjPN.js";import{A as n,O as r,k as i,m as a,mt as o,p as s,pt as c,q as l,r as u,t as d}from"./common.D6YHScsr.js";var f=e(t(),1),p=o();function m(){let e=new URLSearchParams(location.search).get(`cli`)??``,[t,o]=(0,f.useState)(``),[m,h]=(0,f.useState)([]),[g,_]=(0,f.useState)(`new`),[v,y]=(0,f.useState)(``),[b,x]=(0,f.useState)(``),[S,C]=(0,f.useState)(!1),[w,T]=(0,f.useState)(!1);(0,f.useEffect)(()=>{let t=new AbortController;return Promise.all([s(`cli/approval?id=`+encodeURIComponent(e),void 0,t.signal),s(`projects`,void 0,t.signal)]).then(([e,t])=>{o(e.code),h(t),_(`new`)}).catch(e=>{t.signal.aborted||x(a(e))}),()=>t.abort()},[e]);async function E(){C(!0),x(``);try{let t=g;if(t===`new`){let e=await s(`projects`,{name:v,customer:`Applications`,origins:[]});t=e.id,h(t=>[...t,{id:e.id,name:v,customer:`Applications`}]),_(t)}await s(`cli/approval`,{id:e,project:t}),T(!0)}catch(e){x(a(e))}finally{C(!1)}}return(0,p.jsxs)(`main`,{className:`mx-auto max-w-lg p-8`,children:[(0,p.jsx)(`h1`,{className:`mb-4 text-xl font-semibold`,children:`Connect Flare CLI`}),w?(0,p.jsx)(`p`,{children:`Connected. Return to your terminal. You can close this tab.`}):(0,p.jsxs)(i,{children:[(0,p.jsx)(`p`,{children:`Approve only a login you just started. Compare this code with your terminal:`}),(0,p.jsx)(`strong`,{className:`text-2xl font-mono`,children:t||`Loading…`}),(0,p.jsx)(`p`,{children:`Grants this computer deployment access to the selected project, including production. The credential expires in 30 days and can be revoked in Settings.`}),(0,p.jsxs)(r,{children:[(0,p.jsx)(n,{children:`Project`}),(0,p.jsx)(d,{label:`CLI project`,value:g,onChange:_,items:[...m.map(e=>({value:e.id,label:e.name})),{value:`new`,label:`Create new project`}]})]}),g===`new`&&(0,p.jsxs)(r,{children:[(0,p.jsx)(n,{children:`New project name`}),(0,p.jsx)(l,{value:v,onChange:e=>y(e.target.value),maxLength:100})]}),b&&(0,p.jsx)(u,{children:b}),(0,p.jsx)(c,{disabled:S||!t||!g||g===`new`&&!v.trim(),onClick:E,children:`Approve connection`})]})]})}export{m as default};
@@ -0,0 +1 @@
1
+ import{a as e,i as t,n,r}from"./client.BeKNsjPN.js";var i=e(r(),1),a=e=>e?.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase();function o(e,t,n=[]){if(t==null)throw Error(`[lucide]: iconNode is required when icon name is used`);return{name:a(e),size:24,node:t,...n.length>0?{aliases:n}:{}}}var s=e=>{let t=``,n=!1;for(let r of e)r===`-`||r===`_`||r<=` `?n=t.length>0:(t.length===0?t+=r.toLowerCase():t+=n?r.toUpperCase():r,n=!1);return t},c=e=>{let t=s(e);return t.charAt(0).toUpperCase()+t.slice(1)},l=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),u={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":2,"stroke-linecap":`round`,"stroke-linejoin":`round`};function d(e){return e!=null}function f(e,t={}){let n=t.attributeNames??{},r=e=>n[e]??e,i=e.size??e.width??u.width,a=e.size??e.height??u.height,o=e.aliases?.filter(e=>typeof e==`string`&&e.trim()!==``).map(e=>`lucide-${e}`)??[],s=[...e.name?[`lucide-${e.name}`]:[],...o],c=t.className?.split(` `).filter(Boolean)??[],f=t.includeDefaultClasses===!1?l(...c):l(`lucide`,...s,...c),p=t.absoluteStrokeWidth?Number(t.strokeWidth??u[`stroke-width`])*Number(e.size??e.width??u.width)/Number(t.size??t.width??u.width):t.strokeWidth??u[`stroke-width`];return[`svg`,{...Object.entries(u).reduce((e,[t,n])=>(e[r(t)]=n,e),{}),...`color`in t&&t.color&&{[r(`stroke`)]:t.color},...`size`in t&&d(t.size)&&{[r(`width`)]:t.size,[r(`height`)]:t.size},...`width`in t&&d(t.width)&&{[r(`width`)]:t.width},...`height`in t&&d(t.height)&&{[r(`height`)]:t.height},[r(`stroke-width`)]:p,...f&&{[r(`class`)]:f},[r(`viewBox`)]:`0 0 ${i} ${a}`,...t.hasA11yProp===!1?{[r(`aria-hidden`)]:`true`}:{},...`attributes`in t&&t.attributes},e.node.map(e=>{let[n,i,a]=e,o=t.nonScalingStroke?{[r(`vector-effect`)]:`non-scaling-stroke`,...i}:i;return a?[n,o,a]:[n,o]})]}function p(e,t={}){return f(e,{...t,attributeNames:{...t.attributeNames,class:`className`,"stroke-width":`strokeWidth`,"stroke-linecap":`strokeLinecap`,"stroke-linejoin":`strokeLinejoin`,"vector-effect":`vectorEffect`}})}var m=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},h=(0,i.createContext)({}),g=()=>(0,i.useContext)(h),_=(0,i.forwardRef)(({color:e,size:t,width:n,height:r,strokeWidth:a,absoluteStrokeWidth:o,nonScalingStroke:s,className:c=``,children:u,iconNode:d=[],icon:f={node:d,aliases:[],size:24},...h},_)=>{let{size:v=24,strokeWidth:y=2,absoluteStrokeWidth:b=!1,nonScalingStroke:x=!1,color:S=`currentColor`,className:C=``}=g()??{},w=!!u||m(h),[T,E,D=[]]=p(f,{color:e??S,width:n??t??v,height:r??t??v,strokeWidth:a??y,absoluteStrokeWidth:o??b,nonScalingStroke:s??x,className:l(C,c),hasA11yProp:w,attributes:h});return(0,i.createElement)(T,{ref:_,...E},[...D.map(([e,t])=>(0,i.createElement)(e,t)),...Array.isArray(u)?u:[u]])});function v(e,t=[],n=[]){let r=typeof e==`string`?o(e,t,n):e,a=(0,i.forwardRef)(({className:e,...t},n)=>(0,i.createElement)(_,{ref:n,icon:r,className:e,...t}));return r.name&&(a.displayName=c(r.name)),a}var y={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};y.node;var b=v(y),x={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};x.node;var S=v(x),C={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};C.node;var w=v(C),T={name:`x`,size:24,node:[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]};T.node;var E=v(T);function D(){return typeof window<`u`}function O(e){return j(e)?(e.nodeName||``).toLowerCase():`#document`}function k(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function A(e){return((j(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function j(e){return D()?e instanceof Node||e instanceof k(e).Node:!1}function M(e){return D()?e instanceof Element||e instanceof k(e).Element:!1}function N(e){return D()?e instanceof HTMLElement||e instanceof k(e).HTMLElement:!1}function P(e){return!D()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof k(e).ShadowRoot}function F(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=ne(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function I(e){return/^(table|td|th)$/.test(O(e))}function L(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var R=/transform|translate|scale|rotate|perspective|filter/,z=/paint|layout|strict|content/,B=e=>!!e&&e!==`none`,V;function ee(e){let t=M(e)?ne(e):e;return B(t.transform)||B(t.translate)||B(t.scale)||B(t.rotate)||B(t.perspective)||!U()&&(B(t.backdropFilter)||B(t.filter))||R.test(t.willChange||``)||z.test(t.contain||``)}function H(e){let t=W(e);for(;N(t)&&!te(t);){if(ee(t))return t;if(L(t))return null;t=W(t)}return null}function U(){return V??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),V}function te(e){return/^(html|body|#document)$/.test(O(e))}function ne(e){return k(e).getComputedStyle(e)}function re(e){return M(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function W(e){if(O(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||P(e)&&e.host||A(e);return P(t)?t.host:t}function G(e){let t=W(e);return te(t)?(e.ownerDocument||e).body:N(t)&&F(t)?t:G(t)}function ie(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=G(e),i=r===e.ownerDocument?.body,a=k(r);if(i){let e=ae(a);return t.concat(a,a.visualViewport||[],F(r)?r:[],e&&n?ie(e):[])}return t.concat(r,ie(r,[],n))}function ae(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var oe={...i},se={};function ce(e,t){let n=i.useRef(se);return n.current===se&&(n.current=e(t)),n}var le=oe.useInsertionEffect,ue=le&&le!==oe.useLayoutEffect?le:e=>e();function K(e){let t=ce(de).current;return t.next=e,ue(t.effect),t.trampoline}function de(){let e={next:void 0,callback:fe,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function fe(){}var q=typeof document<`u`?i.useLayoutEffect:()=>{};function J(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}var pe={};function me(e,t,n,r,i){if(!n&&!r&&!i&&!e)return ge(t);let a=ge(e);return t&&(a=_e(a,t)),n&&(a=_e(a,n)),r&&(a=_e(a,r)),i&&(a=_e(a,i)),a}function he(e){if(e.length===0)return pe;if(e.length===1)return ge(e[0]);let t=ge(e[0]);for(let n=1;n<e.length;n+=1)t=_e(t,e[n]);return t}function ge(e){return xe(e)?{...e(pe)}:ve(e)}function _e(e,t){return xe(t)?t(e):ye(e,t)}function ve(e){let t={...e};for(let e in t){let n=t[e];be(e,n)&&(t[e]=Ce(n))}return t}function ye(e,t){if(!t)return e;for(let n in t){let r=t[n];switch(n){case`style`:e[n]=J(e.style,r);break;case`className`:e[n]=Te(e.className,r);break;default:e[n]=be(n,r)?Se(e[n],r):r}}return e}function be(e,t){let n=e.charCodeAt(0),r=e.charCodeAt(1),i=e.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof t==`function`||t===void 0)}function xe(e){return typeof e==`function`}function Se(e,t){return t?e?(...n)=>{let r=n[0];if(Ee(r)){let i=r;we(i);let a=t(...n);return i.baseUIHandlerPrevented||e?.(...n),a}let i=t(...n);return e?.(...n),i}:Ce(t):e}function Ce(e){return e&&((...t)=>{let n=t[0];return Ee(n)&&we(n),e(...t)})}function we(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Te(e,t){return t?e?t+` `+e:t:e}function Ee(e){return typeof e==`object`&&!!e&&`nativeEvent`in e}function De(e,t){return function(n,...r){let i=new URL(e);return i.searchParams.set(`code`,n.toString()),r.forEach(e=>i.searchParams.append(`args[]`,e)),`${t} error #${n}; visit ${i} for the full message.`}}var Oe=De(`https://base-ui.com/production-error`,`Base UI`),ke=i.createContext(void 0);function Ae(e=!1){let t=i.useContext(ke);if(t===void 0&&!e)throw Error(Oe(16));return t}function je(e){let{focusableWhenDisabled:t,disabled:n,composite:r=!1,tabIndex:a=0,isNativeButton:o}=e,s=r&&t!==!1,c=r&&t===!1;return{props:i.useMemo(()=>{let e={onKeyDown(e){n&&t&&e.key!==`Tab`&&e.preventDefault()}};return r||(e.tabIndex=a,!o&&n&&(e.tabIndex=t?a:-1)),(o&&(t||s)||!o&&n)&&(e[`aria-disabled`]=n),o&&(!t||c)&&(e.disabled=n),e},[r,n,t,s,c,o,a])}}function Y(e){return e?.ownerDocument||document}function Me(e,t,{detail:n=0,pointerType:r=``}={}){e.dispatchEvent(new(k(e)).PointerEvent(`click`,{bubbles:!0,cancelable:!0,composed:!0,detail:n,pointerType:r,shiftKey:t.shiftKey,ctrlKey:t.ctrlKey,altKey:t.altKey,metaKey:t.metaKey}))}function Ne(e={}){let{disabled:t=!1,focusableWhenDisabled:n,tabIndex:r=0,native:a=!0,composite:o}=e,s=i.useRef(null),c=Ae(!0),l=o??c!==void 0,{props:u}=je({focusableWhenDisabled:n,disabled:t,composite:l,tabIndex:r,isNativeButton:a}),d=i.useCallback(()=>{let e=s.current;Pe(e)&&l&&t&&u.disabled===void 0&&e.disabled&&(e.disabled=!1)},[t,u.disabled,l]);return q(d,[d]),{getButtonProps:i.useCallback((e={})=>{let{onClick:n,onMouseDown:r,onKeyUp:i,onKeyDown:o,onPointerDown:s,...c}=e;return me({onClick(e){t?e.preventDefault():n?.(e)},onMouseDown(e){t||r?.(e)},onKeyDown(e){if(t||(we(e),o?.(e),e.baseUIHandlerPrevented))return;let n=e.target===e.currentTarget,r=e.currentTarget,i=Pe(r),s=!a&&Fe(r),c=n&&(a?i:!s),u=e.key===`Enter`,d=e.key===` `,f=r.getAttribute(`role`),p=f?.startsWith(`menuitem`)||f===`option`||f===`gridcell`;if(n&&l&&d){if(e.defaultPrevented&&p)return;e.preventDefault(),(!a||i)&&(e.preventBaseUIHandler(),Me(r,e))}else!c||a||!d&&!u?n&&s&&d&&e.preventDefault():e.defaultPrevented||(e.preventDefault(),u&&(e.preventBaseUIHandler(),Me(r,e)))},onKeyUp(e){t||(we(e),i?.(e),e.target===e.currentTarget&&a&&l&&Pe(e.currentTarget)&&e.key===` `?e.preventDefault():e.baseUIHandlerPrevented||e.target===e.currentTarget&&!a&&!l&&!e.defaultPrevented&&e.key===` `&&(e.preventBaseUIHandler(),Me(e.currentTarget,e)))},onPointerDown(e){t?e.preventDefault():s?.(e)}},a?{type:`button`}:{role:`button`},u,c)},[t,u,l,a]),buttonRef:K(e=>{s.current=e,d()})}}function Pe(e){return N(e)&&e.tagName===`BUTTON`}function Fe(e){return N(e)&&e.tagName===`A`&&!!e.href}function Ie(e,t,n,r){let i=ce(Re).current;return ze(i,e,t,n,r)&&Ve(i,[e,t,n,r]),i.callback}function Le(e){let t=ce(Re).current;return Be(t,e)&&Ve(t,e),t.callback}function Re(){return{callback:null,cleanup:null,refs:[]}}function ze(e,t,n,r,i){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==r||e.refs[3]!==i}function Be(e,t){return e.refs.length!==t.length||e.refs.some((e,n)=>e!==t[n])}function Ve(e,t){e.refs=t,e.callback=t.every(e=>e==null)?null:n=>{if(e.cleanup&&=(e.cleanup(),null),n!=null){let r=Array(t.length).fill(null);for(let e=0;e<t.length;e+=1){let i=t[e];if(i!=null)switch(typeof i){case`function`:{let t=i(n);typeof t==`function`&&(r[e]=t);break}case`object`:i.current=n}}e.cleanup=()=>{for(let e=0;e<t.length;e+=1){let n=t[e];if(n!=null)switch(typeof n){case`function`:{let t=r[e];typeof t==`function`?t():n(null);break}case`object`:n.current=null}}}}}}var He=19;function Ue(e){return He>=e}function We(e){if(!i.isValidElement(e))return null;let t=e,n=t.props;return(Ue(19)?n?.ref:t.ref)??null}function X(){}var Ge=Object.freeze([]),Ke=Object.freeze({});function qe(e,t){let n={};for(let r in e){let i=e[r];if(t?.hasOwnProperty(r)){let e=t[r](i);e!=null&&Object.assign(n,e)}else i===!0?n[`data-${r.toLowerCase()}`]=``:i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function Je(e,t){return typeof e==`function`?e(t):e}function Ye(e,t){return typeof e==`function`?e(t):e}function Xe(e,t,n={}){let r=t.render;n.enabled!==!1&&(r=et(r));let i=Ze(t,n,r);if(n.enabled===!1)return null;let a=n.state??Ke;return tt(e,r,i,a)}function Ze(e,t,n){let{className:r,style:i}=e,{state:a=Ke,ref:o,props:s,stateAttributesMapping:c,enabled:l=!0}=t,u=l?Je(r,a):void 0,d=l?Ye(i,a):void 0,f=l?qe(a,c):Ke,p=l&&s?Qe(s):void 0,m=l?J(f,p)??{}:Ke;return typeof document<`u`&&(l?m.ref=Array.isArray(o)?Le([m.ref,We(n),...o]):Ie(m.ref,We(n),o):Ie(null,null)),l?(u!==void 0&&(m.className=Te(m.className,u)),d!==void 0&&(m.style=J(m.style,d)),m):Ke}function Qe(e){return Array.isArray(e)?he(e):me(void 0,e)}var $e=Symbol.for(`react.lazy`);function et(e){if(e?.$$typeof!==$e)return e;let t=i.Children.toArray(e)[0];return i.isValidElement(t)?t:e}function tt(e,t,n,r){if(t){if(typeof t==`function`)return t(n,r);let e=me(n,t.props);return e.ref=n.ref,i.cloneElement(t,e)}return nt(e,n)}function nt(e,t){return e===`button`?(0,i.createElement)(`button`,{type:`button`,...t,key:t.key}):e===`img`?(0,i.createElement)(`img`,{alt:``,...t,key:t.key}):i.createElement(e,t)}var rt=i.forwardRef(function(e,t){let{render:n,className:r,disabled:i=!1,focusableWhenDisabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{getButtonProps:l,buttonRef:u}=Ne({disabled:i,focusableWhenDisabled:a,native:o});return Xe(`button`,e,{state:{disabled:i},ref:[t,u],props:[c,l]})}),it=e(n(),1);function at(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=at(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function ot(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=at(e))&&(r&&(r+=` `),r+=t);return r}var st=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,ct=ot,lt=(e,t)=>n=>{if(t?.variants==null)return ct(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=st(t)||st(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return ct(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},ut=48,dt=(e,t=0)=>{let n=new Int32Array(e.length);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r)-ut-t;return n},ft=e=>{let t=new Int32Array(e.length+1);for(let n=0;n<e.length;n++)t[n+1]=t[n]+e[n];return t},pt=e=>{let t=new Int32Array(e.length),n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r)-ut;n+=i>>>1^-(i&1),t[r]=n}return t},mt=384,ht=[],gt=ft(dt(`E0500002005282000000002000150000020021820000011200000003022202000300004200120000200420001200021200301200010400162000010000220021010:2192001200220012000220012000200200200400010200040000000000400200108200110100000022010313000162002000020020012020080213000228200000000082000000000120002000120020020040101020300130001001010`)),_t=ft(dt(`:11111111211111119311546544411119731869:671397415686432441111111111161114151214313433415:78311132233313187211117221449443411141111151152226611131111112212518142224214215421421542142424242516171151615616347111111111197911327451111111111111111111113134714133513411111311111111111111111111112444411111342312715245411117:3`)),vt=`@containerabcdefghinlmoprstunderlineviawzccentlignnimatespectuto-colsrowsaglorightnessckdrop-sisbcontrastfiltergrayscalehue-rotateinvertopacityslurrightnessaturateepia-coniclinearpositionradialsizeockurrderttom-belrstxyespacing-xyaretoursorlnt-umnsendspantartainentrasteividerop-shadowurationcorationlay-xyasendillexontromlter-featuresstretchapr-xyayscaleidow-colsrowsue-rotatedentlinesetvert-beringsxyeshadoweiadingftnest-clamp-imageabein-lrstxyskx--b-coniclpositionrsizet-x-y-fromto-fromto-inearfromto-fromto-adialfromto-fromtofromtofromtofromtoblockhinlinew-screenesblockhinlinewbjectpacityrutlinederigin-offsetbelrstxyesrspective-originaceholderioghtng-offsettateundedw-xyz-belrstlreseslr-endspantartaturatecepiahizekewpace-taleroll-xyz-barmpbelrstxyesbelrstxyes-thumbrackadowrink-xyxyartrokeabextora-shadowpckingnsformitionlate-xyz-offsetill-changeoom`,yt=(()=>{let e=gt.length-1,t=new Int32Array(e);for(let n=e-1;n>=0;n--){let e=1,r=n+1;for(let i=gt[n];i<gt[n+1];i++)e+=t[r],r+=t[r];t[n]=e}let n=new Int32Array(gt[e]),r=0;for(let i=0;i<e;i++){let e=i+1;for(let a=gt[i];a<gt[i+1];a++)n[r++]=e,e+=t[e]}return n})(),bt=dt(`02000000000000900<=0?000B000F00F00ŏI0J0LNPRTVX0000]_a00000000000000000000000rst0000000zŏ00000000000…ŏ000ˆ0000ŏ0000000000—0000000000000000000000000000000000000000000000000000Ë000000000000000000000Þ000000000000000000ð0000000ø0ùúûüýþÿĀāĂ㥹Ć000000000000000000000000000000000000000000ħ0ĨĪ00000000000000000000ļĽ00000Ŭ000000`,1),xt=ft(dt(`123333359346463635126536711576`)),St=dt(`93203242332583253248325D>E?F@03263243255B:032523853:0325B:8GA032542H<C=12727B:0328432553;D>E?3257D>032585:0325B:;0328B:032`),Ct=dt(`012113445661666666789111:5;;;;;;;;444;;;:62999<1161=62>>?61:21@ABCD4446996:64E:::;:?::64:F114GHHIHHHHIHH1HH1HH1HHHHHH::EEJ4444::EE4444441691;644444114244444:;K6666555555555555555999666664444444444444444444444226?6:66644L9M?D:111::::6DE199`),wt=pt(`020200202020020020020020020020200200200200200200200002020202001003040106000200200200200200200200200200200200200200200200200200200200200200200200200200200200020020020020020020002020200202002002002002002002002002002020002002020020200220200200200200200200200200200200020020020000200020002000200200200020020020002000200200200020020202002020202000200200020022000200200020020002002000200220002002000200W0Z00020020002002020002002000200g0j0002002000200200020020002002000200200020020002000200002000002002002002002000200020000200002002002002002002002020020020200200200200200200200200202020020020020020020020020002002002020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020020002002002002002002000200200200200200200200200200020202020002000200020002002002002000020200200`),Tt=(()=>{let e=new Int32Array(319).fill(-1),t=pt(`02422242:222222242224222242442222222422222244442242226224222426222422442462222422622222222626222462242622422622422424242422222222422222222242422222222222222222622442224222222222222224424442262222222222222222222226224222424242422224422422422222`),n=pt(`02222222222222222222202222222222222222222222221422222222222222222222222222222222222Y\\222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222221422222222222222222222222222222222222222Ŀł222222222222222222`);for(let r=0;r<t.length;r++)e[t[r]]=n[r];return e})(),Et=`container |break-after- all auto avoid avoid-page column left page right|break-before- all auto avoid avoid-page column left page right|break-inside-a uto void void-column void-page|box-decoration- clone slice|box- border content| contents flow-root hidden table table-caption table-cell table-column table-column-group table-footer-group table-header-group table-row table-row-group| not-sr-only sr-only|float- end left none right start|clear- both end left none right start|isolat e ion-auto|overflow- auto clip hidden scroll visible|overflow-x- auto clip hidden scroll visible|overflow-y- auto clip hidden scroll visible|overscroll- auto contain none|overscroll-x- auto contain none|overscroll-y- auto contain none| absolute fixed relative static sticky| collapse invisible visible|justify- around baseline between center center-safe end end-safe evenly normal start stretch|justify-items- center center-safe end end-safe normal start stretch|justify-self- auto center center-safe end end-safe start stretch|items- baseline baseline-last center center-safe end end-safe start stretch|self- auto baseline baseline-last center center-safe end end-safe start stretch|place-content- around baseline between center center-safe end end-safe evenly start stretch|place-items- baseline center center-safe end end-safe start stretch|place-self- auto center center-safe end end-safe start stretch| antialiased subpixel-antialiased| italic not-italic|normal-nums |ordinal |slashed-zero | lining-nums oldstyle-nums| proportional-nums tabular-nums| diagonal-fractions stacked-fractions| no-underline overline| capitalize lowercase normal-case uppercase|truncate |whitespace- break-spaces normal nowrap pre pre-line pre-wrap|break- all keep normal words|wrap- anywhere break-word normal|hyphens- auto manual none|mix-blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay plus-darker plus-lighter saturation screen soft-light|table- auto fixed|caption- bottom top|backface- hidden visible|appearance- auto none|scheme- dark light light-dark normal only-dark only-light|field-sizing- content fixed|pointer-events- auto none|resize -none -x -y|snap- align-none center end start|snap- always normal|snap- both none x y|snap- mandatory proximity|touch- auto manipulation none|touch-pan- left right x|touch-pan- down up y|touch-pinch-zoom |select- all auto none text|forced-color-adjust- auto none| normal size| baseline bottom middle sub super text-bottom text-top top| bounce none ping pulse spin| auto square video| auto fr max min px|none | auto full px| fixed local scroll|clip- border content padding text|origin- border content padding| bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| no-repeat repeat repeat-round repeat-space repeat-x repeat-y| auto contain cover| gradient-to-b gradient-to-bl gradient-to-br gradient-to-l gradient-to-r gradient-to-t gradient-to-tl gradient-to-tr none|blend- color color-burn color-dodge darken difference exclusion hard-light hue lighten luminosity multiply normal overlay saturation screen soft-light|to- b bl br l r t tl tr| auto dvh fit full lh lvh max min px screen svh| dashed dotted double hidden none solid| collapse separate|px |auto |full | content none strict| inline-size size|layout |paint |style | around baseline between center center-safe end end-safe evenly normal start stretch| alias all-scroll auto cell col-resize context-menu copy crosshair default e-resize ew-resize grab grabbing help move n-resize ne-resize nesw-resize no-drop none not-allowed ns-resize nw-resize nwse-resize pointer progress row-resize s-resize se-resize sw-resize text vertical-text w-resize wait zoom-in zoom-out| dashed dotted double solid wavy| auto from-font|reverse |initial | in in-out initial linear out| col col-reverse row row-reverse| nowrap wrap wrap-reverse| auto initial none| black bold extrabold extralight light medium normal semibold thin| condensed expanded extra-condensed extra-expanded normal semi-condensed semi-expanded ultra-condensed ultra-expanded|flow- col col-dense dense row row-dense| none subgrid| auto dvh dvw fit full lh lvh lvw max min px screen svh svw| block flex grid table| auto dvw fit full lvw max min px screen svw| loose none normal px relaxed snug tight|through |item | inside outside| decimal disc none| auto px| clip-border clip-content clip-fill clip-padding clip-stroke clip-view no-clip| add exclude intersect subtract| alpha luminance match|origin- border content fill padding stroke view|type- alpha luminance| circle ellipse| closest-corner closest-side farthest-corner farthest-side|at- bottom bottom-left bottom-right center left left-bottom left-top right right-bottom right-top top top-left top-right| dvh fit full lh lvh max min none px screen svh| auto dvh dvw fit full lh lvh lvw max min none px screen svh svw| dvw fit full lvw max min none px screen svw| auto dvh dvw fit full lvh lvw max min none prose px svh svw| auto dvh dvw fit full lvh lvw max min none px screen svh svw| contain cover fill none scale-down| first last none| distant dramatic midrange near none normal|inset | full none|3d | auto smooth|gutter- auto both stable| auto none thin| inner none| auto dvh dvw fit full lvh lvw max min px svh svw|base | center end justify left right start| clip ellipsis| balance nowrap pretty wrap| normal tight tighter wide wider widest| cpu gpu none| 3d flat| all colors none opacity shadow transform| discrete normal| full px| auto dvh dvw fit full lvh lvw max min px screen svh svw| auto contents scroll transform`.split(`|`).map(e=>{let t=e.split(` `),n=t.shift();for(let e=0;e<t.length;e++)t[e]=n+t[e];return t}),Dt=pt(`0000000000000000000000000000000000000000000000000000000000000262242:6@200000006:240B428:4422400002046044222426220026642642462026224222824220022400000000\\00N222422242222222224062242222222422226264222422222222222222442804222422222222222222222222220<4<0204260002444020204224422`),Ot=pt(`ɠ222222222222222222222222222222222222222222222222222222222222˕4222226>ʶ22ʷʺʷ2ʸʷ42ʴ2ʓ22>621422ɶ222ɹɼɷɺɷɺ22ɱ42222ɨ2ɧ26622ɘɓ244ƸƵ222]d24242ǖǓƚÄȫ2263ȨȥȨ2222222ǣ222222222222222222ǂƽ2ƾƵ2222222422222ƜƑ22222222222222222222144Ŧţ22Ţş222222222222222222222ĸ2ı68ĦģĦɡŰ4Ġ«®ĝ822ĔđĔ2ē2222622`),kt=pt(`02222222222222222222222222222222222222222222222222222222222222222202022222222222EH2200IL021042222Y\\222IL0cf2e10j2222U00X202[^2y0000120|{~‚22…ˆ‡:22|22222222222G000q†OVI00000}š2›>40000ŒB00000I¨©000¬00000000000000021M®­00°“000000000000000000000–222›HGHa1º222¿2À2222ÉÌ000­°2±`),At=new Int32Array(995),jt=new Int32Array(995),Mt=new Int32Array(995),Nt=``,Pt=new Int32Array(1038);{let e=new Map,t=0,n=0;for(let r=0;r<Dt.length;r++)for(let i of Et[kt[r]]){let a=e.get(i);a===void 0&&(a=t++,e.set(i,a),Pt[a*2]=Nt.length,Pt[a*2+1]=i.length,Nt+=i),At[n]=Dt[r],jt[n]=Ot[r],Mt[n]=a,n++}}var Ft=pt(`0b2N:222@R>F@286¦2@H2D266226FB22B2>BD\\6N22222Z222D222p`),It=ft(dt(`1::24444432:442:44:44>222222:44:4421322511111311111114`)),Lt=pt(`2Š4A;33N=C@H4A;33N=C@<27;83:;8393NQ:3NQʰ222ˉºŴŽ2R2=18cƴÅҜ=cĞÛC1ƈǝȈ:ħ25=11D3A@4=<1;1DEr25;11B3?<6;:371BCn9@7=<8192>2E121@9@EHE@9>2T25511<398454131<=V25511<398454131<=„ƧNž2Đå242L222290000f22500ɛ000ǘ222`),Rt=dt(`ij`),zt=dt(`—`),Bt=dt(`1`),Vt={GROUP_COUNT:mt,customValidatorNames:ht,edgeStart:gt,labelStart:_t,labelText:vt,edgeTarget:yt,nodeGroup:bt,nodeVlist:Tt,vlistPat:xt,vlistOps:St,vlistRef:Ct,vlistGroup:wt,litAnchor:At,litGroup:jt,litPool:Mt,poolOffsets:Pt,poolText:Nt,adjGid:Ft,adjStart:It,adjTgt:Lt,patGid:Rt,patTgt:zt,postfixLookupGroups:Bt,orderSensitiveModifiers:`* ** after backdrop before details-content file first-letter first-line marker placeholder selection`},Ht=`line`in Error(),Ut=-1,Wt=-1,Gt=(e,t,n)=>{let r=2166136261;for(let i=t;i<n;i++)r=Math.imul(r^e.charCodeAt(i),16777619);return r},Kt=(e,t,n)=>{let r=n-t,i=Math.imul(r,2654435761)^e.charCodeAt(t);if(r>3){let a=r>>2,o=r>>1;i=Math.imul(i^e.charCodeAt(t+1)<<8^e.charCodeAt(t+2)<<16^e.charCodeAt(t+a),2246822507),i=Math.imul(i^e.charCodeAt(t+o)<<8^e.charCodeAt(t+o+a)<<16^e.charCodeAt(n-3),3266489909),i^=e.charCodeAt(n-2)<<8^e.charCodeAt(n-1)<<16;for(let r=t+3,a=n-4;r<t+8&&r<a;r++,a--)i=Math.imul(i^e.charCodeAt(r)^e.charCodeAt(a)<<8,16777619)}return i^i>>>15},qt=(e,t,n={})=>{let{GROUP_COUNT:r,edgeStart:i,labelStart:a,labelText:o,edgeTarget:s,nodeGroup:c,nodeVlist:l,vlistPat:u,vlistOps:d,vlistRef:f,vlistGroup:p,litAnchor:m,litGroup:h,litPool:g,poolOffsets:_,poolText:v,adjGid:y,adjStart:b,adjTgt:x,patGid:S,patTgt:C,postfixLookupGroups:w,customValidatorNames:T,orderSensitiveModifiers:E}=e,D=new Int32Array(r).fill(-1);for(let e=0;e<y.length;e++)D[y[e]]=e;let O=0;for(let e=0;e+1<b.length;e++){let t=b[e+1]-b[e];t>O&&(O=t)}let k=32;for(;k<2*(1+O+S.length);)k<<=1;let A=new Int32Array(f.length+1);for(let e=0;e<f.length;e++)A[e+1]=A[e]+u[f[e]+1]-u[f[e]];let j=new Uint8Array(r);for(let e=0;e<w.length;e++)j[w[e]]=1;let M=i.length-1,N=new Uint8Array(M),P=0,F=!0;for(let e=0;e<m.length;e++){N[m[e]]=1;let t=_[g[e]*2+1];t>P&&(P=t);let n=v.charCodeAt(_[g[e]*2]);(n===91||n===40)&&(F=!1)}let I=1;for(;I<m.length*2;)I<<=1;let L=new Int32Array(I).fill(-1);for(let e=0;e<m.length;e++){let t=_[g[e]*2],n=(Gt(v,t,t+_[g[e]*2+1])^Math.imul(m[e],2654435761)|0)&I-1;for(;L[n]!==-1;)n=n+1&I-1;L[n]=e}let R=(e,t,n,r)=>{let i=(Gt(t,n,r)^Math.imul(e,2654435761)|0)&I-1,a=r-n;for(;;){let r=L[i];if(r===-1)return-1;if(m[r]===e&&_[g[r]*2+1]===a){let e=_[g[r]*2],i=!0;for(let r=0;r<a;r++)if(v.charCodeAt(e+r)!==t.charCodeAt(n+r)){i=!1;break}if(i)return h[r]}i=i+1&I-1}},z=n.cacheSize??8192,B=n.prefix??e.prefix??``,V=B===``?``:B+`:`,ee=V.length,H=(T??[]).map(e=>{let n=t&&t[e];if(!n)throw Error(`cn: missing validator `+e);return n}),U=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,te=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ne=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,re=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,W=0,G=-1,ie=-1,ae=-1,oe=-1,se=e=>e>=97&&e<=122||e>=65&&e<=90||e>=48&&e<=57||e===95,ce=e=>/\s/.test(String.fromCharCode(e)),le=(e,t,n)=>{if(W=0,G=-1,n-t<3)return;let r=e.charCodeAt(t),i=e.charCodeAt(n-1);if(r===91&&i===93)W=1;else if(r===40&&i===41)W=2;else return;ae=t+1,oe=n-1;let a=t+1;if(se(e.charCodeAt(a))){for(a++;a<n-1;){let t=e.charCodeAt(a);if(!se(t)&&t!==45)break;a++}a<n-2&&e.charCodeAt(a)===58&&(G=t+1,ie=a,ae=a+1)}},ue=(e,t,n,r)=>{if(n-t!==r.length)return!1;for(let n=0;n<r.length;n++)if(e.charCodeAt(t+n)!==r.charCodeAt(n))return!1;return!0},K=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,de=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,fe=e=>!!e&&!Number.isNaN(Number(e)),q=(e,t,n)=>{if(n-t<11||!ue(e,t,t+10,`@container`))return!1;if(e.charCodeAt(t+10)===47)return n-t>=12;let r=e.charCodeAt(t+11);return r===115&&n-t>=17&&ue(e,t+10,t+16,`-size/`)||r===110&&n-t>=19&&ue(e,t+10,t+18,`-normal/`)},J=[1,1,1,1,1,1,1,1,2,2,2,2,2,2,2],pe=`length|number|number weight|family-name|position percentage|length size bg-size|image url|shadow|length|family-name|position percentage|length size bg-size|image url|shadow|number weight`.split(`|`).map(e=>e.split(` `)),me=[2,3,1,0,0,0,4,5,0,0,0,0,0,1,1],he=(e,t,n,r)=>{if(e>=10){if(e>=25)return H[e-25](t.slice(n,r));let i=e-10;if(W!==J[i])return!1;if(G>=0){for(let e of pe[i])if(ue(t,G,ie,e))return!0;return!1}switch(me[i]){case 0:return!1;case 1:return!0;case 2:{let e=t.slice(ae,oe);return U.test(e)&&!te.test(e)}case 3:return fe(t.slice(ae,oe));case 4:return re.test(t.slice(ae,oe));default:return ne.test(t.slice(ae,oe))}}switch(e){case 0:return!0;case 1:return W===0;case 2:return W===1;case 3:return W===2;case 4:return K.test(t.slice(n,r));case 5:return fe(t.slice(n,r));case 6:{let e=t.slice(n,r);return!!e&&Number.isInteger(Number(e))}case 7:return r>n&&t.charCodeAt(r-1)===37&&fe(t.slice(n,r-1));case 8:return de.test(t.slice(n,r));default:return q(t,n,r)}},ge=new Set(typeof E==`string`?E.split(` `):E),_e=(e,t,n,r,i,a)=>{let o=Gt(t,n,r)^(i?2654435769:0),s=e.get(o);if(s!==void 0)outer:for(let e=0;e<s.length;e++){let a=s[e];if(a.imp===i&&a.k.length===r-n){for(let e=0;e<a.k.length;e++)if(a.k.charCodeAt(e)!==t.charCodeAt(n+e))continue outer;return a.id}}else e.set(o,s=[]);let c=t.slice(n,r),l=a(c);return s.push({k:c,imp:i,id:l}),l},ve=new Map,ye=new Map,be=2,xe=4096,Se=(e,t)=>{let n=[],r=0,i=0,a=0;for(let t=0;t<e.length;t++){let o=e.charCodeAt(t);r===0&&i===0&&o===58?(n.push(e.slice(a,t)),a=t+1):o===91?r++:o===93?r--:o===40?i++:o===41&&i--}n.push(e.slice(a));let o=n[0];if(n.length>1){let e=[],t=[];for(let r of n)r.charCodeAt(0)===91||ge.has(r)?(t.length&&(e.push(...t.sort()),t=[]),e.push(r)):t.push(r);t.length&&e.push(...t.sort()),o=e.join(`:`)}let s=t?o+` !`:o,c=ye.get(s);return c===void 0&&ye.set(s,c=be++),c},Ce=new Map,we=r,Te=r+4096,Ee=()=>we++,De=2097152,Oe=8192,ke=new Int32Array(Oe),Ae=Array(Oe).fill(null),je=new Int32Array(Oe),Y=new Int32Array(Oe),Me=new Uint8Array(Oe),Ne=0,Pe=(e,t,n,r,i,a,o,s)=>{let c=e;if(Ae[e]!==null){if(Ae[e|1]===null)c=e|1;else if(!(Ne++&3))c=e|Ne>>2&1;else return}Ae[c]=t.slice(n,r),ke[c]=i,je[c]=a,Y[c]=o,Me[c]=s},Fe=()=>Ae.fill(null),Ie=256,Le=[new Int32Array(Ie),new Int32Array(Ie),new Int32Array(Ie),new Int32Array(Ie)],[Re,ze,Be,Ve]=Le,He=new Uint8Array(Ie),Ue=new Uint8Array(Ie),We=()=>{Ie*=2,Le=Le.map(e=>{let t=new Int32Array(Ie);return t.set(e),t}),[Re,ze,Be,Ve]=Le;let e=new Uint8Array(Ie);e.set(He),He=e,Ue=new Uint8Array(Ie)},X=64,Ge=new Int32Array(X),Ke=new Int32Array(X),qe=new Int32Array(r),Je=2048,Ye=21,Xe=new Float64Array(Je),Ze=new Int32Array(Je),Qe=0,$e=(e,t)=>{if(e===0&&t<r)return qe[t]===Qe?1:(qe[t]=Qe,0);let n=e*2097152+t+1,i=Math.imul(n,2654435761)>>>Ye;for(;Ze[i]===Qe;){if(Xe[i]===n)return 1;i=i+1&Je-1}return Xe[i]=n,Ze[i]=Qe,0},et=(e,t,n,r,i)=>{if(n-t>=2&&e.charCodeAt(t)===91&&e.charCodeAt(n-1)===93){let r=-1;for(let i=t+1;i<n-1;i++)if(e.charCodeAt(i)===58){r=i;break}return r===-1||r===t+1?Ut:_e(Ce,e,t+1,r,0,Ee)}if(r>=0&&c[r]>=0)return c[r];for(let t=i-1;t>=0;t--){let r=Ke[t];if(r>n)continue;let i=Ge[t],a=n-r;if(N[i]===1&&a>0&&a<=P){let t=e.charCodeAt(r);if(F===!1||t!==91&&t!==40){let t=R(i,e,r,n);if(t>=0)return t}}let o=l[i];if(o<0)continue;let s=f[o],c=u[s],m=u[s+1];if(c===m)continue;le(e,r,n);let h=A[o]-c;for(let t=c;t<m;t++)if(he(d[t],e,r,n))return p[h+t]}return Ut},tt=e=>{let t=e.length,n=0,c=0,u=!1;(be>xe||ve.size>xe)&&(ve=new Map,ye=new Map,be=2,Fe()),we>Te&&(Ce=new Map,we=r,Fe());let d=0;for(;d<t;){let f=e.charCodeAt(d);if(f===32||f>=9&&f<=13||f>=160&&ce(f)){f!==32&&(u=!0),d++;continue}let p=d,m=0;for(;d<t;){if(f=e.charCodeAt(d),f<=32){if(f===32)break;if(f>=9&&f<=13){u=!0;break}}else if(f>=160&&ce(f)){u=!0;break}m=Math.imul(m^f,16777619),d++}let h=d,g=h-p;n===Ie&&We();let _=n++;Re[_]=p,ze[_]=h,c+=g,m^=Math.imul(g,2654435761);let v=m^m>>>15,y=v&8190;{let t=-1;if(ke[y]===v&&Ae[y]!==null&&Ae[y].length===g?t=y:ke[y|1]===v&&Ae[y|1]!==null&&Ae[y|1].length===g&&(t=y|1),t>=0){let n=Ae[t],r=!0;for(let t=0;t<g;t++)if(n.charCodeAt(t)!==e.charCodeAt(p+t)){r=!1;break}if(r){Be[_]=je[t],Ve[_]=Y[t],He[_]=Me[t];continue}}}let b=p;if(ee!==0){if(h-p<=ee||!e.startsWith(V,p)){Be[_]=Ut,Pe(y,e,p,h,v,Ut,0,0);continue}b=p+ee}let x=0,S=0,C=-1,w=-1;for(let t=b;t<h;t++){let n=e.charCodeAt(t);if(x===0&&S===0){if(n===58){C=t;continue}if(n===47){w=t;continue}}n===91?x++:n===93?x--:n===40?S++:n===41&&S--}let T=C>=b?C+1:b,E=T,D=h,O=!1,k=0;D>E&&e.charCodeAt(D-1)===33?(O=!0,D--):D>E&&e.charCodeAt(E)===33&&(O=!0,E++,k=1);let A=-1;w>T&&(A=w+k,A>=D&&(A=-1));let M=E;D-E>1&&e.charCodeAt(E)===45&&(M=E+1);let P=0,F=0,I=0,L=-1,R=0;(l[0]>=0||N[0]===1)&&(Ge[0]=0,Ke[0]=M,R=1);let z=Wt,B=0;for(let t=M;t<D;t++)if(t===A&&(z=F<I?Wt:P,B=R),P!==Wt){let n=e.charCodeAt(t),r=-1;if(F<I)o.charCodeAt(F)===n?(F++,F===I&&(r=P=L)):P=Wt;else{let e=i[P],t=i[P+1],c=Wt;for(let i=e;i<t;i++){let e=a[i];if(o.charCodeAt(e)===n){a[i+1]-e===1?r=c=s[i]:(F=e+1,I=a[i+1],L=s[i],c=P);break}}P=c}if(r>=0&&(l[r]>=0||N[r]===1)&&t+1<D&&e.charCodeAt(t+1)===45){if(R===X){X*=2;let e=new Int32Array(X);e.set(Ge),Ge=e;let t=new Int32Array(X);t.set(Ke),Ke=t}Ge[R]=r,Ke[R]=t+2,R++}}A===D&&(z=F<I?Wt:P,B=R);let H=F<I?Wt:P,U,te=!1;if(A>=0){if(te=!0,U=et(e,E,A,z,B),U!==Ut&&U<r&&j[U]){let t=et(e,E,D,H,R);t!==Ut&&t!==U&&(U=t,te=!1)}else U===Ut&&(U=et(e,E,D,H,R),te=!1)}else U=et(e,E,D,H,R);let ne=0,re=0;U===Ut?Be[_]=Ut:(re=+!!te,ne=b>=C?+!!O:_e(ve,e,b,C,+!!O,e=>Se(e,O)),Be[_]=U,He[_]=re,Ve[_]=ne),Pe(y,e,p,h,v,U,ne,re)}if(n===0)return``;if(n===1)return Re[0]===0&&ze[0]===t?e:e.slice(Re[0],ze[0]);if(n*k>Je){for(;n*k>Je;)Je<<=1,Ye--;Xe=new Float64Array(Je),Ze=new Int32Array(Je)}if(be>=De||we>=De)throw Error(`cn: too many distinct classes in one merge`);Qe=Qe+1|0,Qe===0&&(qe.fill(0),Ze.fill(0),Qe=1);let f=!1;for(let e=n-1;e>=0;e--){let t=Be[e];if(t===Ut){Ue[e]=1;continue}let n=Ve[e];if($e(n,t)===1)Ue[e]=0,f=!0;else if(Ue[e]=1,t<r){let r=D[t];if(r>=0)for(let e=b[r];e<b[r+1];e++)$e(n,x[e]);if(He[e]&1)for(let e=0;e<S.length;e++)S[e]===t&&$e(n,C[e])}}if(!f&&!u&&t===c+n-1)return e;let p=``,m=0;for(;m<n;){if(!Ue[m]){m++;continue}let t=Re[m],r=ze[m],i=m+1;for(;i<n&&Ue[i]&&Re[i]===r+1&&e.charCodeAt(r)===32;)r=ze[i],i++;p.length>0&&(p+=` `),p+=e.slice(t,r),m=i}return p},nt=16384,rt=new Int32Array(nt*2),it=0,at=1,ot=Object.create(null),st=Object.create(null),ct=new Map,lt=new Map,ut=0,dt=0,ft=()=>{it^=nt,at=at+1|0,dt=0},pt=e=>{let t=ot[e];if(t!==void 0)return t;let n=Kt(e,0,e.length),r=(n&16383)+it,i=rt[r]===(n^at)||rt[r^nt]===(n^at-1);return i&&(t=st[e],t!==void 0)?(ot[e]=t,t):(t=tt(e),i?(ot[e]=t,++ut>z&&(ut=0,st=ot,ot=Object.create(null),ft())):(rt[r]=n^at,++dt>nt&&ft()),t)},mt=e=>{let t=ct.get(e);if(t!==void 0)return t;let n=Kt(e,0,e.length),r=(n&16383)+it,i=rt[r]===(n^at)||rt[r^nt]===(n^at-1);return i&&(t=lt.get(e),t!==void 0)?(ct.set(e,t),t):(t=tt(e),i?(ct.set(e,t),++ut>z&&(ut=0,lt=ct,ct=new Map,ft())):(rt[r]=n^at,++dt>nt&&ft()),t)},ht=e=>{let t=Kt(e,0,e.length),n=(t&16383)+it;return rt[n]===(t^at)||rt[n^nt]===(t^at-1)||(rt[n]=t^at,++dt>nt&&ft(),!1)},gt=z===0?tt:Ht?e=>{let t=ct.get(e);return t===void 0?mt(e):t}:pt;return{merge:function(){return arguments.length===1&&typeof arguments[0]==`string`?gt(arguments[0]):gt(Xt.apply(null,arguments))},mergeString:gt,seenBefore:z===0?()=>!1:ht,mergeUncached:tt}},Jt=(e,t)=>{if(!e)return``;if(typeof e==`string`)return e;let n=``;if(typeof e.length==`number`&&(!t||Array.isArray(e))){let r=e;for(let e=0;e<r.length;e++){let i=r[e];if(!i)continue;let a=typeof i==`string`?i:Jt(i,t);a&&(n&&(n+=` `),n+=a)}return n}if(t){if(typeof e==`number`)return``+e;if(typeof e==`object`)for(let t in e)e[t]&&(n&&(n+=` `),n+=t)}return n},Yt=(e,t)=>{let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(!i)continue;let a=typeof i==`string`?i:Jt(i,t);a&&(n&&(n+=` `),n+=a)}return n},Xt=function(){return Yt(arguments,!1)},Zt=256,Qt=16,$t=1024,en=4096,tn=(e,t)=>{let n=t===void 0?()=>!0:t.seenBefore,r=t===void 0?e:t.mergeUncached,i=new Map,a=new Map,o=0,s=null,c=null,l=[],u=[],d=0,f=(t,n,r)=>{c===null&&(c=Array(en).fill(``),l=Array(en).fill(``),u=Array(en).fill(``));let i=Kt(t,0,t.length)&4094;if(c[i]===t&&l[i]===n)return u[i];if(c[i|1]===t&&l[i|1]===n)return u[i|1];let a=e(r?n+` `+t:t),o=c[i]===``?i:i|(c[i|1]===``?1:d++&1);return c[o]=t,l[o]=n,u[o]=a,a},p=(e,t,n,r)=>{let i=0;if(t){if(t!==e.a0)return!1;i=1}if(n){if(n!==(i===0?e.a0:e.a1))return!1;i++}if(r){if(r!==(i===0?e.a0:i===1?e.a1:e.a2))return!1;i++}return i===e.t},m=(e,t)=>{let n=e.a,r=0;for(let e=0;e<t.length;e++){let i=t[e];if(i){if(i!==n[r])return!1;r++}}return r===e.t},h=(t,c)=>{let l=t.length,u=s===null?null:s.n;if(!c){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let d=``,p=-1,h=0,g=!1;for(let e=0;e<l;e++){let n=t[e];if(n){if(typeof n!=`string`){if(n=t[e]=Jt(n,!0),!n)continue;g=!0}p<0&&(d=n,p=e),h++}}if(h===0)return``;if(h===1)return e(d);if(g){if(u!==null&&m(u,t))return s=u,u.r;if(s!==null&&s!==u&&m(s,t))return s.r}let _=i.get(d);_===void 0&&(_=a.get(d),_!==void 0&&i.set(d,_));let v=null;if(_!==void 0){if(_.skip>0){_.skip--,s=null;let e=d;for(let n=p+1;n<l;n++){let r=t[n];r&&(e+=` `+r)}return f(e,``,!1)}let e=_.e;outer:for(let n=0;n<e.length;n++){let r=e[n];if(r.t!==h)continue;let i=r.a,a=1;for(let e=p+1;e<l;e++){let n=t[e];if(n&&n!==i[a++])continue outer}v=r;break}v!==null&&(_.miss=0)}if(v===null){let s=d,c=[d];for(let e=p+1;e<l;e++){let n=t[e];n&&(s+=` `+n,c.push(n))}if(!n(s))return r(s);v={r:e(s),t:c.length,a0:c[0],a1:c[1],a2:c[2]??``,a:c,n:null},_===void 0?i.set(d,_={e:[],miss:0,skip:0,at:0}):++_.miss>Qt&&(_.miss=Qt,_.skip=$t,_.e.length=0,_.at=0);let u=_.e;u.length<Zt?u.push(v):(u[_.at]=v,_.at=_.at+1&255),++o>1e3&&(o=0,a=i,i=new Map)}return s!==null&&s!==v&&(s.n=v),s=v,v.r},g=t=>Array.isArray(t)?h(t.slice(),!1):e(Jt(t,!0));return function(t,n,r){let a=arguments.length;if((a|1)==3){let e=s;if(e!==null){let i=e.n;if(i!==null&&p(i,t,n,r))return s=i,i.r;if(e!==i&&p(e,t,n,r))return e.r}if(a===2&&typeof n==`string`&&n!==``){let e=i.get(t);if(e!==void 0&&e.skip>0)return e.skip--,s=null,f(n,t,!0)}return h([t,n,r],!0)}if(a===1)return typeof t==`string`?e(t):g(t);let o=s;if(o!==null){let e=o.n;if(e!==null){let t=e.a,n=0,r=!0;for(let e=0;e<a;e++){let i=arguments[e];if(i){if(i!==t[n]){r=!1;break}n++}}if(r&&n===e.t)return s=e,e.r}if(o!==e){let e=o.a,t=0,n=!0;for(let r=0;r<a;r++){let i=arguments[r];if(i){if(i!==e[t]){n=!1;break}t++}}if(n&&t===o.t)return o.r}}let c=[];for(let e=0;e<a;e++)c.push(arguments[e]);return h(c,!0)}},nn=qt(Vt),Z=tn(nn.mergeString,nn);nn.merge;var rn=t((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),an=t(((e,t)=>{t.exports=rn()})),Q=an(),on=lt(`group/button inline-flex shrink-0 items-center justify-center rounded-none border border-transparent bg-clip-padding text-xs font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-primary text-primary-foreground hover:bg-primary/80`,outline:`border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50`,secondary:`bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground`,ghost:`hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50`,destructive:`bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,xs:`h-6 gap-1 rounded-none px-2 text-xs has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3`,sm:`h-7 gap-1 rounded-none px-2.5 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5`,lg:`h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2`,icon:`size-8`,"icon-xs":`size-6 rounded-none [&_svg:not([class*='size-'])]:size-3`,"icon-sm":`size-7 rounded-none`,"icon-lg":`size-9`}},defaultVariants:{variant:`default`,size:`default`}});function sn({className:e,variant:t=`default`,size:n=`default`,...r}){return(0,Q.jsx)(rt,{"data-slot":`button`,className:Z(on({variant:t,size:n,className:e})),...r})}var cn=`data-valid`,ln=`data-invalid`,un={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},dn={disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},fn={valid(e){return e===null?null:e?{[cn]:``}:{[ln]:``}}},pn={invalid:void 0,name:void 0,validityData:{state:un,errors:[],error:``,value:``,initialValue:null},setValidityData:X,disabled:void 0,setTouched:X,setDirty:X,setFilled:X,setFocused:X,focusOwnerRef:{current:void 0},validationMode:`onSubmit`,shouldValidateOnChange:()=>!1,state:dn,registerFieldControl:X,validation:{getValidationProps:(e,t=Ke)=>t,inputRef:{current:null},registeredInputs:new Map,registerInput:X,getInputControl:()=>null,commit:async()=>{},change:X}},mn=i.createContext(pn);function hn(e=!0){let t=i.useContext(mn);if(t.setValidityData===X&&!e)throw Error(Oe(28));return t}var gn=i.createContext({elementRef:{current:null},formRef:{current:{fields:new Map}},errors:{},clearErrors:X,validationMode:`onSubmit`,submitCountRef:{current:0}});function _n(){return i.useContext(gn)}function vn(){let[,e]=i.useState({});return i.useCallback(()=>{e({})},[])}var yn=0;function bn(e,t=`mui`){let n=i.useRef(void 0),r=vn(),a=e??n.current;return i.useEffect(()=>{n.current??(yn+=1,n.current=`${t}-${yn}`,e??r())},[e,t,r]),a}var xn=oe.useId;function Sn(e,t){if(xn!==void 0){let n=xn();return e??(t?`${t}-${n}`:n)}return bn(e,t)}function Cn(e){return Sn(e,`base-ui`)}var wn=i.createContext({controlId:void 0,registerControlId:X,resetControlId:X,labelId:void 0,setLabelId:X,messageIds:[],setMessageIds:X,getDescriptionProps:e=>e});function Tn(){return i.useContext(wn)}function En(e={}){let{id:t,enabled:n=!0}=e,{controlId:r,registerControlId:a,resetControlId:o}=Tn(),s=Cn(),c=ce(()=>Symbol()),l=i.useRef(!1),u=i.useRef(!1),d=K(()=>{l.current&&a!==X&&(l.current=!1,a(c.current,void 0))});return q(()=>{if(!n||a===X){d();return}let e;if(t!==void 0)u.current=!0,e=t;else if(u.current)e=s;else{o();return}e===void 0?d():(l.current=!0,a(c.current,e))},[t,n,a,o,s,c,d]),q(()=>d,[d]),(n?r:void 0)??t??s}function Dn(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:On,platform:kn,maxTouchPoints:An}=Dn(),jn=On.toLowerCase(),Mn=kn.toLowerCase(),Nn=/^i(os$|p)/.test(Mn)||Mn===`macintel`&&An>1,Pn=`android`,Fn=Mn===Pn||jn.includes(Pn),In=!Nn&&Mn.startsWith(`mac`);Mn.startsWith(`win`),!Fn&&/^(linux|chrome os)/.test(Mn);var Ln=In||Nn,Rn=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!Rn&&jn.includes(`firefox`),!Rn&&jn.includes(`chrom`);var zn=Ln,Bn=/jsdom|happydom/.test(jn);function Vn(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function $(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&P(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Hn(e,t){let n=e;for(;n;){if(M(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(P(n)?n.host:null)}return null}function Un(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var Wn=`data-base-ui-focusable`,Gn=`ArrowLeft`,Kn=`ArrowRight`,qn=`ArrowUp`,Jn=`ArrowDown`,Yn=`data-starting-style`,Xn=`data-ending-style`,Zn={[Yn]:``},Qn={[Xn]:``},$n={transitionStatus(e){return e===`starting`?Zn:e===`ending`?Qn:null}},er=`data-open`,tr=`data-closed`,nr=`data-anchor-hidden`,rr=`data-popup-open`,ir=`data-pressed`,ar={[rr]:``},or={[rr]:``,[ir]:``},sr={[er]:``},cr={[tr]:``},lr={[nr]:``},ur={open(e){return e?ar:null}},dr={open(e){return e?or:null}},fr={open(e){return e?sr:cr},anchorHidden(e){return e?lr:null}},pr={...fr,...$n};function mr(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 hr(e){return e.matches(`html,body`)}function gr(e){return N(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function _r(e){return e?e.getAttribute(`role`)===`combobox`&&gr(e):!1}function vr(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function yr(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...yr(e,t.id,n)])}function br(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 xr(e){e.preventDefault(),e.stopPropagation()}function Sr(e){return`nativeEvent`in e}function Cr(e){return e.pointerType===``&&e.isTrusted?!0:Fn&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function wr(e){return Bn?!1:!Fn&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(Fn||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function Tr(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function Er(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}var Dr=Math.min,Or=Math.max,kr=Math.round,Ar=Math.floor,jr=e=>({x:e,y:e}),Mr={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Nr(e,t,n){return Or(e,Dr(t,n))}function Pr(e,t){return typeof e==`function`?e(t):e}function Fr(e){return e.split(`-`)[0]}function Ir(e){return e.split(`-`)[1]}function Lr(e){return e===`x`?`y`:`x`}function Rr(e){return e===`y`?`height`:`width`}function zr(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Br(e){return Lr(zr(e))}function Vr(e,t,n){n===void 0&&(n=!1);let r=Ir(e),i=Br(e),a=Rr(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Xr(o)),[o,Xr(o)]}function Hr(e){let t=Xr(e);return[Ur(e),t,Ur(t)]}function Ur(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var Wr=[`left`,`right`],Gr=[`right`,`left`],Kr=[`top`,`bottom`],qr=[`bottom`,`top`];function Jr(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Gr:Wr:t?Wr:Gr;case`left`:case`right`:return t?Kr:qr;default:return[]}}function Yr(e,t,n,r){let i=Ir(e),a=Jr(Fr(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Ur)))),a}function Xr(e){let t=Fr(e);return Mr[t]+e.slice(t.length)}function Zr(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Qr(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Zr(e)}function $r(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 ei(e,t){return t<0||t>=e.length}function ti(e,t){return ii(e.current,{disabledIndices:t})}function ni(e,t){return ii(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function ri(e,t,n){let{decrement:r,loopFocus:i,allowEscape:a,disabledIndices:o,minIndex:s,maxIndex:c}=n,l=()=>ii(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:ei(e,u)?-1:u,wrapped:d}}function ii(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&&ai(e,a,r));return a}function ai(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!si(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function oi(e){return e.visibility===`hidden`||e.visibility===`collapse`}function si(e,t=e?ne(e):null){return!e||!e.isConnected||!t||oi(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var ci=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function li(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return P(n)?n.host:null}function ui(e){for(let t of Array.from(e.children))if(O(t)===`summary`)return t;return null}function di(e,t){let n=ui(t);return!!n&&(e===n||$(n,e))}function fi(e){let t=e?O(e):``;return e!=null&&e.matches(ci)&&(t!==`summary`||e.parentElement!=null&&O(e.parentElement)===`details`&&ui(e.parentElement)===e)&&(t!==`details`||ui(e)==null)&&(t!==`input`||e.type!==`hidden`)}function pi(e){if(!fi(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=li(t)){let n=t!==e,r=O(t)===`slot`;if(t.hasAttribute(`inert`)||n&&O(t)===`details`&&!t.open&&!di(e,t)||t.hasAttribute(`hidden`)||!r&&!mi(t,n))return!1}return!0}function mi(e,t){let n=ne(e);return t?n.display!==`none`:si(e,n)}function hi(e){let t=e.tabIndex;if(t<0){let t=O(e);if(t===`details`||t===`audio`||t===`video`||N(e)&&e.isContentEditable)return 0}return t}function gi(e){if(O(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function _i(e,t){let n=gi(e);if(!n)return!0;let r=t.find(e=>{let t=gi(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=gi(e);return t?.name===n.name&&t.form===n.form})===n}function vi(e){if(N(e)&&O(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return N(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function yi(e,t){vi(e).forEach(e=>{fi(e)&&t.push(e),yi(e,t)})}function bi(e,t,n){vi(e).forEach(e=>{N(e)&&e.matches(t)&&n.push(e),bi(e,t,n)})}function xi(e){return pi(e)&&hi(e)>=0}function Si(e){let t=[];return yi(e,t),t.filter(pi)}function Ci(e){let t=Si(e);return t.filter(e=>hi(e)>=0&&_i(e,t))}function wi(e,t){let n=Ci(e),r=n.length;if(r===0)return;let i=Vn(Y(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function Ti(e){return wi(Y(e).body,1)||e}function Ei(e){return wi(Y(e).body,-1)||e}function Di(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!$(n,r)}function Oi(e){Ci(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function ki(e){let t=[];bi(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 Ai(e){i.useEffect(e,Ge)}var ji=0,Mi=class e{static create(){return new e}currentId=ji;start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=ji,t()},e)}isStarted(){return this.currentId!==ji}clear=()=>{this.currentId!==ji&&(clearTimeout(this.currentId),this.currentId=ji)};disposeEffect=()=>this.clear};function Ni(){let e=ce(Mi.create).current;return Ai(e.disposeEffect),e}var Pi=null;globalThis.requestAnimationFrame;var Fi=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)}},Ii=class e{static create(){return new e}static request(e){return Fi.request(e)}static cancel(e){return Fi.cancel(e)}currentId=Pi;request(e){this.cancel(),this.currentId=Fi.request(()=>{this.currentId=Pi,e()})}cancel=()=>{this.currentId!==Pi&&(Fi.cancel(this.currentId),this.currentId=Pi)};disposeEffect=()=>this.cancel};function Li(){let e=ce(Ii.create).current;return Ai(e.disposeEffect),e}function Ri(e){return e==null?e:`current`in e?e.current:e}function zi(e,t){return e.getAnimations(t).filter(e=>{let t=e.effect?.getTiming();return t?.duration!==1/0&&t?.iterations!==1/0})}var Bi=null;function Vi(e){if(!Bi){let e=[];Bi=e,queueMicrotask(()=>{Bi=null,it.flushSync(()=>{for(let t of e)t()})})}Bi.push(e)}function Hi(e,t=!1,n=!1){let r=Li();return K((i,a=null)=>{r.cancel();let o=Ri(e);if(o==null)return;let s=o,c=()=>{n?Vi(()=>{a?.aborted||i()}):it.flushSync(i)};if(typeof s.getAnimations!=`function`||globalThis.BASE_UI_ANIMATIONS_DISABLED){i();return}function l(){Promise.all(zi(s).map(e=>e.finished.then(X))).then(()=>{a?.aborted||c()},()=>{a?.aborted||(zi(s).some(e=>e.pending||e.playState!==`finished`)?l():c())})}if(t){let e=Yn;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 Ui(e){let{enabled:t=!0,open:n,ref:r,batch:a=!1,onComplete:o}=e,s=K(o),c=Hi(r,n,a);i.useEffect(()=>{if(!t)return;let e=new AbortController;return c(s,e.signal),()=>{e.abort()}},[t,n,s,c])}function Wi(e,t=!1,n=!1,r=!1){let[a,o]=i.useState(e&&t?`idle`:void 0),[s,c]=i.useState(e&&!r);return e&&!s&&(c(!0),o(`starting`)),!e&&s&&a!==`ending`&&!n&&o(`ending`),!e&&!s&&a===`ending`&&o(void 0),q(()=>{if(!e&&s&&a!==`ending`&&n){let e=Ii.request(()=>{o(`ending`)});return()=>{Ii.cancel(e)}}},[e,s,a,n]),q(()=>{if(!e||t||a===void 0)return;let n=Ii.request(()=>{o(void 0)});return()=>{Ii.cancel(n)}},[t,e,a]),q(()=>{if(!e||!t)return;e&&s&&a!==`idle`&&o(`starting`);let n=Ii.request(()=>{o(`idle`)});return()=>{Ii.cancel(n)}},[t,e,s,a]),{mounted:s,setMounted:c,transitionStatus:a}}function Gi(e,t,n){let{setFocused:r,focusOwnerRef:i}=hn(),a=K(t=>{(t?!e:i.current===a)&&(i.current=t&&a,n?.(t),r(t))});return q(()=>{let e=t.current;return e?.getRootNode()?.activeElement===e&&a(!0),()=>a(!1)},[e,t,a]),a}function Ki(e,t,n,r,i=!0,a){let{registerFieldControl:o}=hn(),s=ce(()=>Symbol());q(()=>{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]),q(()=>{let e=s.current;return()=>{o(e,void 0)}},[o,s])}function qi(e,t){let n=i.useRef(e),r=K(t);q(()=>{n.current!==e&&r(n.current),n.current=e},[e,r])}function Ji(e,t,n,r){let i=!1,a=!1,o=r??Ke;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}}var Yi=`none`,Xi=`trigger-press`,Zi=`outside-press`,Qi=`item-press`,$i=`close-press`,ea=`focus-out`,ta=`escape-key`,na=`list-navigation`,ra=`cancel-open`,ia=`disabled`,aa=`missing`,oa=`initial`,sa=`imperative-action`,ca=`window-resize`,la=i.forwardRef(function(e,t){let{render:n,className:r,id:a,name:o,value:s,disabled:c=!1,onValueChange:l,defaultValue:u,autoFocus:d=!1,style:f,...p}=e,{state:m,name:h,disabled:g,setTouched:_,setDirty:v,validityData:y,setFilled:b,validationMode:x,validation:S}=hn(),{clearErrors:C,elementRef:w,submitCountRef:T}=_n(),E=g||c,D=h??o,O={...m,disabled:E},{labelId:k}=Tn(),A=En({id:a}),j=s!==void 0,M=s==null?void 0:String(s),N=K(()=>S.inputRef.current?.value);Ki(S.inputRef,A,M,N,!E,o),q(()=>{let e=M??S.inputRef.current?.value;e!==void 0&&b(e!==``)},[M,u,S.inputRef,b]),qi(M,()=>{M!==void 0&&(C(D),v(M!==(y.initialValue??``)),S.change(M))});let P=i.useRef(null),F=Gi(E,P),I=Ni();return Xe(`input`,e,{ref:[t,P],state:O,props:[{id:A,disabled:E,name:D,ref:S.inputRef,"aria-labelledby":k,autoFocus:d,...j?{value:s}:{defaultValue:u},onChange(e){let t=e.currentTarget.value,n=Ji(Yi,e.nativeEvent);l?.(t,n),!j&&(v(t!==(y.initialValue??``)),b(t!==``),!e.nativeEvent.defaultPrevented&&!n.isCanceled&&(C(D),S.change(t)))},onFocus(){F(!0)},onBlur(e){if(_(!0),F(!1),x===`onBlur`){let t=e.currentTarget.value;S.commit(t),j&&queueMicrotask(()=>{let e=S.inputRef.current?.value;e!==void 0&&e!==t&&e!==(y.initialValue??``)&&S.commit(e)})}},onKeyDown(e){if(e.currentTarget.tagName===`INPUT`&&e.key===`Enter`){_(!0);let t=e.currentTarget.value,n=e.currentTarget.form;if(n&&n===w.current&&!e.defaultPrevented){let t=e.currentTarget,n=T.current;I.start(0,()=>{T.current===n&&S.commit(t.value)})}else S.commit(t)}}},p,e=>S.getValidationProps(E,e)],stateAttributesMapping:fn})}),ua=i.forwardRef(function(e,t){return(0,Q.jsx)(la,{ref:t,...e})});function da({className:e,type:t,...n}){return(0,Q.jsx)(ua,{type:t,"data-slot":`input`,className:Z(`h-8 w-full min-w-0 rounded-none border border-input bg-transparent px-2.5 py-1 text-xs transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-xs file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 md:text-xs dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...n})}function fa({controlled:e,default:t,name:n,state:r=`value`}){let{current:a}=i.useRef(e!==void 0),[o,s]=i.useState(()=>t);return[a&&e!==void 0?e:o,i.useCallback(e=>{a||s(e)},[])]}var pa=i.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},nextIndexRef:{current:0}});function ma(){return i.useContext(pa)}function ha(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:a}=e,o=K(a),[,s]=i.useState(0),c=ce(_a).current,l=ce(ga).current,u=i.useRef(0),d=i.useRef(!0),f=i.useRef(null),p=i.useRef(null),m=K(()=>{d.current||(d.current=!0,s(e=>e+1))}),h=K((e,t)=>{l.set(e,t),m()}),g=K(e=>{l.delete(e),m()}),_=K(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)}),u.current=n.current.length,t});function v(e){if(p.current?.disconnect(),p.current=null,typeof MutationObserver!=`function`||e.length<2)return;let t=new MutationObserver(n=>{if(!ba(n))return;let r=null;for(let n of e)if(n.isConnected){if(r&&xa(r,n)>0){t.disconnect(),m();return}r=n}});p.current=t;let n=new Set;for(let t=1;t<e.length;t+=1){let r=ya(e[t-1],e[t]);r&&n.add(r)}n.forEach(e=>t.observe(e,{childList:!0}))}let y=K(()=>{let[e,t]=va(l),n=_(e),r=f.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});v(t),f.current=e,d.current=!1,i&&(c.forEach(e=>e(n)),o(n))});q(()=>(!d.current&&f.current&&_(f.current),()=>{n.current=[],r&&(r.current=[])}),[n,r,_]),q(()=>{d.current&&y()}),q(()=>()=>{p.current?.disconnect(),d.current=!0},[]);let b=K(e=>(c.add(e),()=>{c.delete(e)})),x=i.useMemo(()=>({register:h,unregister:g,subscribeMapChange:b,nextIndexRef:u}),[h,g,b,u]);return(0,Q.jsx)(pa.Provider,{value:x,children:t})}function ga(){return new Map}function _a(){return new Set}function va(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)=>xa(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 ya(e,t){let n=e.parentElement;for(;n&&!n.contains(t);)n=n.parentElement;return n}function ba(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 xa(e,t){return e.nextElementSibling===t?-1:t.nextElementSibling===e?1:e.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1}function Sa(e={}){let{guess:t,label:n,metadata:r,textRef:a,index:o}=e,{register:s,unregister:c,subscribeMapChange:l,nextIndexRef:u}=ma(),d=i.useRef(-1),[f,p]=i.useState(o==null&&t?()=>{if(d.current===-1){let e=u.current;u.current+=1,d.current=e}return d.current}:-1),m=o??f,h=i.useRef(null),g=i.useCallback(e=>{let t=h.current;t&&c(t),h.current=e,e&&s(e,{metadata:r??null,index:o??null,label:n,textRef:a})},[o,s,c,r,n,a]);return q(()=>{if(o==null)return l(e=>{let t=h.current?e.get(h.current)?.index:null;t!=null&&p(t)})},[o,l]),{ref:g,index:m}}var Ca=t((e=>{var t=r();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:n,a=t.useState,o=t.useEffect,s=t.useLayoutEffect,c=t.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),wa=t(((e,t)=>{t.exports=Ca()})),Ta=wa(),Ea=i.createContext(void 0),Da={disableStyleElements:!1};function Oa(){return i.useContext(Ea)??Da}function ka(e){return Ue(19)?e:e?`true`:void 0}function Aa(e){return e==null||e.hasAttribute(`disabled`)||e.getAttribute(`aria-disabled`)===`true`}var ja=`ArrowUp`,Ma=`ArrowDown`,Na=`ArrowLeft`,Pa=`ArrowRight`,Fa=`Home`,Ia=new Set([ja,Ma,Na,Pa,Fa,`End`]),La=[`Shift`,`Control`,`Alt`,`Meta`];function Ra(e){return N(e)&&e.tagName===`INPUT`}function za(e){return!!(Ra(e)&&e.selectionStart!=null||N(e)&&e.tagName===`TEXTAREA`)}function Ba(e,t,n,r){if(!e||!t||!t.scrollTo)return;let i=e.scrollLeft,a=e.scrollTop,o=e.clientWidth<e.scrollWidth,s=e.clientHeight<e.scrollHeight;if(o&&r!==`vertical`){let r=Va(e,t,`left`),a=Ha(e),o=Ha(t);n===`ltr`&&(r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight?i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight:r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft&&(i=r-o.scrollMarginLeft-a.scrollPaddingLeft)),n===`rtl`&&(r-o.scrollMarginLeft<e.scrollLeft+a.scrollPaddingLeft?i=r-o.scrollMarginLeft-a.scrollPaddingLeft:r+t.offsetWidth+o.scrollMarginRight>e.scrollLeft+e.clientWidth-a.scrollPaddingRight&&(i=r+t.offsetWidth+o.scrollMarginRight-e.clientWidth+a.scrollPaddingRight))}if(s&&r!==`horizontal`){let n=Va(e,t,`top`),r=Ha(e),i=Ha(t);n-i.scrollMarginTop<e.scrollTop+r.scrollPaddingTop?a=n-i.scrollMarginTop-r.scrollPaddingTop:n+t.offsetHeight+i.scrollMarginBottom>e.scrollTop+e.clientHeight-r.scrollPaddingBottom&&(a=n+t.offsetHeight+i.scrollMarginBottom-e.clientHeight+r.scrollPaddingBottom)}e.scrollTo({left:i,top:a,behavior:`auto`})}function Va(e,t,n){let r=n===`left`?`offsetLeft`:`offsetTop`,i=0;for(;t.offsetParent&&(i+=t[r],t.offsetParent!==e);)t=t.offsetParent;return i}function Ha(e){let t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}var Ua=i.createContext(void 0);function Wa(){return i.useContext(Ua)?.direction??`ltr`}function Ga({className:e,...t}){return(0,Q.jsx)(`textarea`,{"data-slot":`textarea`,className:Z(`flex field-sizing-content min-h-16 w-full rounded-none border border-input bg-transparent px-2.5 py-2 text-xs transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 md:text-xs dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40`,e),...t})}function Ka({className:e,...t}){return(0,Q.jsx)(`label`,{"data-slot":`label`,className:Z(`flex items-center gap-2 text-xs leading-none select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}function qa({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`field-group`,className:Z(`group/field-group @container/field-group flex w-full flex-col gap-5 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4`,e),...t})}var Ja=lt(`group/field flex w-full gap-2 data-[invalid=true]:text-destructive`,{variants:{orientation:{vertical:`flex-col *:w-full [&>.sr-only]:w-auto`,horizontal:`flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`,responsive:`flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`}},defaultVariants:{orientation:`vertical`}});function Ya({className:e,orientation:t=`vertical`,...n}){return(0,Q.jsx)(`div`,{role:`group`,"data-slot":`field`,"data-orientation":t,className:Z(Ja({orientation:t}),e),...n})}function Xa({className:e,...t}){return(0,Q.jsx)(Ka,{"data-slot":`field-label`,className:Z(`group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-none has-[>[data-slot=field]]:border has-[>[data-slot=field]]:not-has-[:disabled,[data-disabled]]:hover:bg-muted/50 has-[>[data-slot=field]]:has-[:focus-visible]:border-ring has-[>[data-slot=field]]:has-[:focus-visible]:ring-1 has-[>[data-slot=field]]:has-[:focus-visible]:ring-ring/50 *:data-[slot=field]:p-2 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10`,`has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col`,e),...t})}function Za({className:e,...t}){return(0,Q.jsx)(`p`,{"data-slot":`field-description`,className:Z(`text-left text-xs/relaxed leading-normal font-normal text-muted-foreground group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5`,`last:mt-0 nth-last-2:-mt-1`,`[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,e),...t})}var Qa={clipPath:`inset(50%)`,overflow:`hidden`,whiteSpace:`nowrap`,border:0,padding:0,width:1,height:1,margin:-1},$a={...Qa,position:`fixed`,margin:0,top:0,left:0},eo={...Qa,position:`absolute`};function to(e){let t=i.useRef(!0);t.current&&(t.current=!1,e())}function no(e){let[t,n]=i.useState({current:e,previous:null});return Object.is(e,t.current)||n({current:e,previous:t.current}),t.previous}function ro(e){let t=ce(io,e).current;return t.next=e,q(t.effect),t}function io(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var ao=t((e=>{var t=r(),n=wa();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=n.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),oo=t(((e,t)=>{t.exports=ao()}))(),so=[],co=void 0;function lo(){return co}function uo(e){so.push(e)}function fo(e){let t=(t,n)=>{let r=ce(po).current,i;try{co=r;for(let e of so)e.before(r);i=e(t,n);for(let e of so)e.after(r);r.didInitialize=!0}finally{co=void 0}return i};return t.displayName=e.displayName||e.name,t}function po(){return{didInitialize:!1}}var mo=Ue(19)?_o:vo;function ho(e,t,n,r,i){return mo(e,t,n,r,i)}function go(e,t,n,r,a){let o=i.useCallback(()=>t(e.getSnapshot(),n,r,a),[e,t,n,r,a]);return(0,Ta.useSyncExternalStore)(e.subscribe,o,o)}uo({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,Ta.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function _o(e,t,n,r,i){let a=lo();if(!a)return go(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 vo(e,t,n,r,i){return(0,oo.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var yo=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 ho(this,e,t,n,r)}},bo=class extends yo{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){i.useDebugValue(e);let n=this;q(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;q(()=>(n.state[e]!==t&&n.set(e,t),()=>{n.set(e,void 0)}),[n,e,t])}useSyncedValues(e){let t=this;q(()=>{t.update(e)},[t,...Object.values(e)])}useControlledProp(e,t){i.useDebugValue(e);let n=this,r=t!==void 0;q(()=>{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 i.useDebugValue(e),ho(this,this.selectors[e],t,n,r)}useContextCallback(e,t){i.useDebugValue(e);let n=K(t??X);this.context[e]=n}useStateSetter(e){let t=i.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 xo(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function So(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}var Co=i.forwardRef(function(e,t){let[n,r]=i.useState();q(()=>{zn&&Rn&&r(`button`)},[]);let a={tabIndex:0,role:n};return(0,Q.jsx)(`span`,{...e,ref:t,style:$a,"aria-hidden":!n||void 0,...a,"data-base-ui-focus-guard":``})});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(),X;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?P(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=>{O(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=Y(e[0]).body;return Io(e,i,n,{mark:r})}var Ro={style:{transition:`none`}},zo={fallbackAxisSide:`none`},Bo={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},Vo=i.createContext(null),Ho=()=>i.useContext(Vo),Uo=wo(`portal`);function Wo(e={}){let{ref:t,container:n,componentProps:r=Ke,elementProps:a}=e,o=Sn(),s=Ho()?.portalNode,[c,l]=i.useState(null),[u,d]=i.useState(null),f=K(e=>{e!==null&&d(e)}),p=i.useRef(null);q(()=>{if(n===null){p.current&&(p.current=null,d(null),l(null));return}let e=(n&&(j(n)?n:n.current))??s??document.body;e==null?p.current&&(p.current=null,d(null),l(null)):p.current!==e&&(p.current=e,d(null),l(e))},[n,s]);let m=Xe(`div`,r,{ref:[t,f],props:[{id:o,[Uo]:``},a]}),h=c&&m?it.createPortal(m,c):null;return{node:u,nodeId:i.isValidElement(m)?m.props.id:void 0,subtree:h}}var Go=i.forwardRef(function(e,t){let{render:n,className:r,style:a,children:o,container:s,portalOwnerRole:c,...l}=e,{node:u,nodeId:d,subtree:f}=Wo({container:s,ref:t,componentProps:e,elementProps:l}),p=i.useRef(null),m=i.useRef(null),h=i.useRef(null),g=i.useRef(null),[_,v]=i.useState(null),y=i.useRef(!1),b=_?.modal,x=_?.open,S=!!_&&!_.modal&&_.open&&!!u;i.useEffect(()=>{if(!u||b)return;function e(e){u&&e.relatedTarget&&Di(e)&&(e.type===`focusin`?y.current&&=(ki(u),!1):(Oi(u),y.current=!0))}return xo(So(u,`focusin`,e,!0),So(u,`focusout`,e,!0))},[u,b]),q(()=>{u&&x===!0&&y.current&&(ki(u),y.current=!1)},[x,u]);let C=i.useMemo(()=>({beforeOutsideRef:p,afterOutsideRef:m,beforeInsideRef:h,afterInsideRef:g,portalNode:u,setFocusManagerState:v}),[u]);return(0,Q.jsxs)(i.Fragment,{children:[f,(0,Q.jsxs)(Vo.Provider,{value:C,children:[S&&u&&(0,Q.jsx)(Co,{"data-type":`outside`,ref:p,onFocus:e=>{Di(e,u)?h.current?.focus():Ei(_?_.domReference:null)?.focus()}}),S&&u&&(0,Q.jsx)(`span`,{role:c,"aria-owns":d,style:Bo}),u&&it.createPortal(o,u),S&&u&&(0,Q.jsx)(Co,{"data-type":`outside`,ref:m,onFocus:e=>{Di(e,u)?g.current?.focus():(Ti(_?_.domReference:null)?.focus(),_?.closeOnFocusOut&&_?.onOpenChange(!1,Ji(`focus-out`,e.nativeEvent)))}})]})]})});function Ko(){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 qo=i.createContext(null),Jo=i.createContext(null),Yo=()=>i.useContext(qo)?.id||null,Xo=e=>{let t=i.useContext(Jo);return e??t};function Zo(e,t){let n=k(Un(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(Cr(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var Qo=20,$o=[];function es(){$o=$o.filter(e=>e.deref()?.isConnected)}function ts(e){es(),e&&O(e)!==`body`&&($o.push(new WeakRef(e)),$o.length>Qo&&($o=$o.slice(-20)))}function ns(){return es(),$o[$o.length-1]?.deref()}function rs(e){return e?xi(e)?e:Ci(e)[0]||e:null}function is(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=Si(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return xi(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 as(e){let{context:t,children:n,disabled:r=!1,initialFocus:a=!0,returnFocus:o=!0,explicitReturnFocus:s,restoreFocus:c=!1,modal:l=!0,closeOnFocusOut:u=!0,openInteractionType:d=``,nextFocusableElement:f,previousFocusableElement:p,beforeContentFocusGuardRef:m,externalTree:h,getInsideElements:g}=e,_=t.useState(`open`),v=t.useState(`domReferenceElement`),y=t.useState(`floatingElement`),{events:b,dataRef:x}=t.context,S=K(()=>x.current.floatingContext?.nodeId),C=a===!1,w=_r(v)&&C,T=ro(a),E=ro(o),D=ro(s),k=ro(d),A=ro(_),j=Xo(h),M=Ho(),P=i.useRef(!1),F=i.useRef(!1),I=i.useRef(!1),L=i.useRef(null),R=i.useRef(``),z=i.useRef(``),B=i.useRef(null),V=i.useRef(null),ee=Ie(B,m,M?.beforeInsideRef),H=Ie(V,M?.afterInsideRef),U=Ni(),te=Ni(),ne=Li(),re=M!=null,W=vr(y),G=K((e=W)=>e?Ci(e):[]),ie=K(()=>g?.().filter(e=>e!=null)??[]);i.useEffect(()=>{if(r||!l)return;function e(e){e.key===`Tab`&&$(W,Vn(Y(W)))&&G().length===0&&!w&&xr(e)}return So(Y(W),`keydown`,e)},[r,W,l,w,G]),i.useEffect(()=>{if(r||!_)return;let e=Y(W);function t(){I.current=!1}function n(e){let t=Un(e),n=ie(),r=$(y,t)||$(v,t)||$(M?.portalNode,t)||n.some(e=>e===t||$(e,t));I.current=!r,z.current=e.pointerType||`keyboard`,Hn(t,`[data-base-ui-click-trigger]`)&&(F.current=!0,te.start(0,()=>{F.current=!1}))}function i(){z.current=`keyboard`}return xo(So(e,`pointerdown`,n,!0),So(e,`pointerup`,t,!0),So(e,`pointercancel`,t,!0),So(e,`keydown`,i,!0),t)},[r,y,v,W,_,M,te,ie]),i.useEffect(()=>{if(r||!u)return;let e=Y(W);function n(){F.current=!0,te.start(0,()=>{F.current=!1})}function i(e){let t=Un(e);xi(t)&&(L.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=Un(n);l&&r==null&&a!=null&&$(y,a)&&ts(a),queueMicrotask(()=>{let o=S(),s=t.context.triggerElements,u=ie(),d=r?.hasAttribute(wo(`focus-guard`))&&[B.current,V.current,M?.beforeInsideRef.current,M?.afterInsideRef.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,Ri(p),Ri(f)].includes(r),m=!($(v,r)||$(y,r)||$(r,y)||$(M?.portalNode,r)||u.some(e=>e===r||$(e,r))||s.hasMatchingElement(e=>$(e,r))||d||j&&(yr(j.nodesRef.current,o).find(e=>$(e.context?.elements.floating,r)||$(e.context?.elements.domReference,r))||br(j.nodesRef.current,o).find(e=>[e.context?.elements.floating,vr(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===v&&W&&is(W),c&&i!==v&&!si(a)&&Vn(e)===e.body){if(N(W)&&(W.focus(),c===`popup`)){ne.request(()=>{W.focus()});return}let e=G(),t=L.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||W;N(n)&&n.focus()}x.current.insideReactTree?x.current.insideReactTree=!1:(w||!l)&&r&&m&&!F.current&&(w||r!==ns())&&(P.current=!0,t.setOpen(!1,Ji(ea,n)))})}function o(){I.current||(x.current.insideReactTree=!0,U.start(0,()=>{x.current.insideReactTree=!1}))}let s=N(v)?v:null;if(y||s)return xo(s&&So(s,`focusout`,a),s&&So(s,`pointerdown`,n),y&&So(y,`focusin`,i),y&&So(y,`focusout`,a),y&&M&&So(y,`focusout`,o,!0))},[r,v,y,W,l,j,M,t,u,c,G,w,S,x,U,te,ne,f,p,ie]),i.useEffect(()=>{if(r||!y||!_)return;let e=Array.from(M?.portalNode?.querySelectorAll(`[${wo(`portal`)}]`)||[]),t=(j?br(j.nodesRef.current,S()):[]).find(e=>_r(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Lo([y,...e,B.current,V.current,M?.beforeOutsideRef.current,M?.afterOutsideRef.current,...ie(),t,Ri(p),Ri(f),w?v:null].filter(e=>e!=null),{ariaHidden:l||w,mark:!1}),i=Lo([y,...e].filter(e=>e!=null));return()=>{i(),n()}},[_,r,v,y,l,M,w,j,S,f,p,ie]),q(()=>{if(!_||r||!N(W))return;R.current=``,z.current=``;let e=Y(W),t=Vn(e);queueMicrotask(()=>{let n=T.current,r=typeof n==`function`?n(k.current||``):n;if(r===void 0||r===!1||$(W,t))return;let i=null,a=()=>(i??=G(W),i[0]||W),o;o=r===!0||r===null?a():Ri(r),o||=a();let s=$(W,Vn(e)),c=x.current.openEvent,l=c?.type===`mousedown`&&Cr(c);Eo(o,{sync:l,preventScroll:o===W,shouldFocus(){if(!A.current)return!1;if(s)return!0;let t=Vn(e);return!(t!==o&&$(W,t))}})})},[r,_,W,G,T,k,A,x]);let ae=i.useRef(null);q(()=>{if(r||!W){ae.current=null;return}ae.current&&=(ae.current.cancelled=!0,null);let e=Y(W),t=Vn(e),n=k.current==null;ts(t);function i(e){if(e.open||(R.current=Zo(e.nativeEvent,z.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(wo(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(P.current=!0),e.reason===`outside-press`){if(e.nested)P.current=!1;else if(Cr(e.nativeEvent)||wr(e.nativeEvent))P.current=!1;else{let e=!1;Y(W).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?P.current=!1:P.current=!0}}}b.on(`openchange`,i);function a(e){let r=E.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=v?.isConnected?v:null,o=t?.isConnected&&O(t)!==`body`?t:null,s=n?o||a:a||o;return s||=ns()||null,typeof i==`boolean`?s:Ri(i)||s||null}return()=>{b.off(`openchange`,i);let t=Vn(e),n=ie(),r=$(y,t)||n.some(e=>e===t||$(e,t))||j&&yr(j.nodesRef.current,S(),!1).some(e=>$(e.context?.elements.floating,t)),o=E.current,s=R.current,c=a(s),l={cancelled:!1};ae.current=l,queueMicrotask(()=>{ae.current===l&&(ae.current=null);let n=rs(c),i=D.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!P.current&&N(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}P.current=!1})}},[r,y,W,E,D,k,b,j,v,S,ie]),q(()=>{if(!Rn||_||!y)return;let e=Vn(Y(y));N(e)&&gr(e)&&$(y,e)&&e.blur()},[_,y]),q(()=>{if(!r&&M)return M.setFocusManagerState({modal:l,closeOnFocusOut:u,open:_,onOpenChange:t.setOpen,domReference:v}),()=>{M.setFocusManagerState(null)}},[r,M,l,_,t,u,v]),q(()=>{if(!r&&W)return is(W),()=>{queueMicrotask(es)}},[r,W]);let oe=!r&&(!l||!w)&&(re||l);return(0,Q.jsxs)(i.Fragment,{children:[oe&&(0,Q.jsx)(Co,{"data-type":`inside`,ref:ee,onFocus:e=>{if(l){let e=G();Eo(e[e.length-1])}else M?.portalNode&&(P.current=!1,Di(e,M.portalNode)?Ti(v)?.focus():Ri(p??M.beforeOutsideRef)?.focus())}}),n,oe&&(0,Q.jsx)(Co,{"data-type":`inside`,ref:H,onFocus:e=>{l?Eo(G()[0]):M?.portalNode&&(u&&(P.current=!0),Di(e,M.portalNode)?Ei(v)?.focus():Ri(f??M.afterOutsideRef)?.focus())}})]})}function os(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:a=!0,ignoreMouse:o=!1,stickIfOpen:s=!0,touchOpenDelay:c=0,reason:l=Xi}=t,u=e.context.dataRef,d=i.useRef(void 0),f=Li(),p=Ni(),m=i.useMemo(()=>{function t(t,n,r,i){let a=Ji(l,n,r);t&&i===`touch`&&c>0?p.start(c,()=>{e.setOpen(!0,a)}):e.setOpen(t,a)}function n(t,n,r){let i=u.current.openEvent,o=e.select(`domReferenceElement`)!==n;return t&&o||!t||!a?!0:i&&(typeof s==`function`?s():s)?!r(i.type):!1}return{onPointerDown(e){d.current=Tr(e.pointerType,!0)&&wr(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(i){let a=d.current,s=i.nativeEvent,c=e.select(`open`);if(i.button!==0||r===`click`||Tr(a,!0)&&o)return;let l=n(c,i.currentTarget,e=>e===`click`||e===`mousedown`),u=Un(s),p=gr(u);if(p||a===`virtual`){t(l,s,p?u:i.currentTarget,a);return}let m=i.currentTarget;f.request(()=>{t(l,s,m,a)})},onClick(i){if(r===`mousedown-only`)return;let a=d.current;r===`mousedown`&&a?d.current=void 0:Tr(a,!0)&&o||t(n(e.select(`open`),i.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),i.nativeEvent,i.currentTarget,a)},onKeyDown(){d.current=void 0}}},[u,r,o,l,e,s,a,f,p,c]);return i.useMemo(()=>n?{reference:m}:Ke,[n,m])}function ss(){return!1}function cs(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function ls(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:a=!0,outsidePressEvent:o=`sloppy`,referencePress:s=ss,bubbles:c,externalTree:l}=t,u=e.useState(`open`),d=e.useState(`floatingElement`),{dataRef:f,events:p}=e.context,m=Xo(l),h=K(typeof a==`function`?a:()=>!1),g=typeof a==`function`?h:a,_=g!==!1,v=K(()=>o),{escapeKey:y,outsidePress:b}=cs(c),x=i.useRef(!1),S=i.useRef(!1),C=i.useRef(!1),w=i.useRef(!1),T=i.useRef(!1),E=i.useRef(``),D=i.useRef(null),O=Ni(),k=Ni(),A=Ni(),j=K(()=>{k.clear(),f.current.insideReactTree=!1}),F=K(e=>{let t=f.current.floatingContext?.nodeId;return(m?yr(m.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),I=K(t=>mr(t,e.select(`floatingElement`))||mr(t,e.select(`domReferenceElement`))),L=K(t=>{s()&&e.setOpen(!1,Ji(Xi,t.nativeEvent))}),R=K(t=>{if(!u||!n||!r||t.key!==`Escape`)return;let i=Sr(t)?t.nativeEvent:t;if(T.current||i.isComposing||!y&&F(`__escapeKeyBubbles`))return;let a=Ji(ta,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!y&&!a.isPropagationAllowed&&t.stopPropagation()}),z=K(()=>{f.current.insideReactTree=!0,k.start(0,j)}),B=K(t=>{if(!u||!n||t.button!==0)return;let r=Un(t.nativeEvent);$(e.select(`floatingElement`),r)&&(x.current||(x.current=!0,S.current=!1))}),V=K(e=>{u&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&x.current&&(S.current=!0)});i.useEffect(()=>{function e(e){e.open||(w.current=!1)}return p.on(`openchange`,e),()=>{p.off(`openchange`,e)}},[p]),i.useEffect(()=>j,[j]),i.useEffect(()=>{if(!u||!n)return u||(w.current=!1,T.current=!1,E.current=``,D.current=null),j;f.current.__escapeKeyBubbles=y,f.current.__outsidePressBubbles=b;let t=new Mi,i=Y(d);function a(){A.clear(),T.current=!0}function o(){T.current=!0,A.start(Rn?5:0,()=>{T.current=!1})}function s(){C.current=!0,t.start(0,()=>{C.current=!1})}function c(){x.current=!1,S.current=!1}function l(){let e=E.current,t=e===`pen`||!e?`mouse`:e,n=v(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function p(e){let t=l();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function h(e){let t=f.current.floatingContext?.nodeId,n=m&&yr(m.nodesRef.current,t).some(t=>mr(e,t.context?.elements.floating));return I(e)||n}function k(n){if(p(n)){n.type!==`click`&&!I(n)&&(t.clear(),C.current=!1),j();return}if(f.current.insideReactTree){j();return}let r=Un(n),i=`[${wo(`inert`)}]`,a=M(r)?r.getRootNode():null,o=Array.from((P(a)?a:Y(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>$(e,r))))return;let c=M(r)?r:null;for(;c&&!te(c);){let e=W(c);if(te(e)||!M(e))break;c=e}if(!(o.length&&M(r)&&!hr(r)&&!$(r,e.select(`floatingElement`))&&o.every(e=>!$(c,e)))){if(N(r)&&!(`touches`in n)){let e=te(r),t=ne(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(!h(n)){if(l()===`intentional`){if(n.detail!==0&&!Cr(n)&&!w.current)return;if(C.current){t.clear(),C.current=!1;return}}(typeof g!=`function`||g(n))&&(F(`__outsidePressBubbles`)||(e.setOpen(!1,Ji(Zi,n)),j()))}}}function L(t){l()===`sloppy`&&t.pointerType!==`touch`&&e.select(`open`)&&n&&!I(t)&&k(t)}function z(t){if(l()!==`sloppy`||!e.select(`open`)||!n||I(t))return;let r=t.touches[0];r&&(D.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},O.start(1e3,()=>{D.current&&(D.current.dismissOnTouchEnd=!1,D.current.dismissOnMouseDown=!1)}))}function B(e,t){let n=Un(e);if(!n)return;let r=So(n,e.type,()=>{t(e),r()})}function V(e){E.current=`touch`,B(e,z)}function ee(e){O.clear(),e.type===`pointerdown`&&(e.button===0&&(w.current=!0),E.current=e.pointerType),(e.type!==`mousedown`||!D.current||D.current.dismissOnMouseDown)&&B(e,e=>{e.type===`pointerdown`?L(e):k(e)})}function H(e){if(e.type===`pointercancel`&&(w.current=!1),!x.current)return;let n=S.current;c(),l()===`intentional`&&(e.type===`pointercancel`?n&&s():h(e)||(n?s():(typeof g!=`function`||g(e))&&(t.clear(),C.current=!0,j())))}function U(e){if(l()!==`sloppy`||!D.current||I(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-D.current.startX),r=Math.abs(t.clientY-D.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(D.current.dismissOnTouchEnd=!0),i>10&&(k(e),O.clear(),D.current=null)}function re(e){B(e,U)}function G(e){l()===`sloppy`&&D.current&&!I(e)&&(D.current.dismissOnTouchEnd&&k(e),O.clear(),D.current=null)}function ie(e){B(e,G)}let ae=xo(r&&xo(So(i,`keydown`,R),So(i,`compositionstart`,a),So(i,`compositionend`,o)),_&&xo(So(i,`click`,ee,!0),So(i,`pointerdown`,ee,!0),So(i,`pointerup`,H,!0),So(i,`pointercancel`,H,!0),So(i,`mousedown`,ee,!0),So(i,`mouseup`,H,!0),So(i,`touchstart`,V,{capture:!0,passive:!0}),So(i,`touchmove`,re,{capture:!0,passive:!0}),So(i,`touchend`,ie,{capture:!0,passive:!0})));return()=>{ae(),t.clear(),c(),C.current=!1}},[f,d,r,_,g,u,n,y,b,R,j,v,F,I,m,e,O,A]);let ee=i.useMemo(()=>({onKeyDown:R,onPointerDown:L,onClick:L}),[R,L]),H=i.useMemo(()=>({onKeyDown:R,onPointerDown:V,onMouseDown:V,onClickCapture:z,onMouseDownCapture(e){z(),B(e)},onPointerDownCapture(e){z(),B(e)},onMouseUpCapture:z,onTouchEndCapture:z,onTouchMoveCapture:z}),[R,z,B,V]);return i.useMemo(()=>n?{reference:ee,floating:H,trigger:ee}:{},[n,ee,H])}function us(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),q(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};M(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 ds(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:a,onUnmount:o,animateInitialOpen:s}=e,c=K(a),{mounted:l,setMounted:u,transitionStatus:d}=Wi(t,!1,!1,s),f=!t&&r;q(()=>{t&&c(!1)},[t,c]);let p=i.useRef(l),m=i.useRef(!1),h=vn(),g=()=>{p.current=!1,u(!1),o()};q(()=>{p.current=l,m.current&&(m.current=!1,!t&&l&&g())});let _=K(()=>{p.current&&(t?(m.current=!0,h()):g())});return Ui({enabled:l&&!t&&!f,open:t,ref:n,onComplete(){t||_()}}),{mounted:l,transitionStatus:d,preventUnmountingOnClose:f,forceUnmount:_}}var fs={tabIndex:-1,[Wn]:``};function ps(e){return t=>t!==`touch`||e.current}function ms(e,t=!1){let n=Sn(),r=Yo()!=null,i=ce(()=>e(n,r)).current;return us({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function hs({handle:e,store:t}){return q(()=>e.attachStore(t),[e,t]),null}function gs(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 _s(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function vs(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=i.useRef(null),a=e.useState(`open`);q(()=>{if(!a){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,i={};e.state.triggerCount!==t&&(i.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&&(i.activeTriggerElement=t);else{for(let[t,n]of e.context.triggerElements.entries())if(n===e.state.activeTriggerElement){i.activeTriggerId=t,i.activeTriggerElement=n,r.current=t;break}i.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;i.activeTriggerId=e,i.activeTriggerElement=n,r.current=e}}(i.triggerCount!==void 0||i.activeTriggerId!==void 0||i.activeTriggerElement!==void 0)&&e.update(i),s&&n&&queueMicrotask(()=>{if(e.select(`open`)&&e.select(`activeTriggerId`)===s&&!e.context.triggerElements.getById(s)){let t=Ji(Yi);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[a,e,e.useState(`triggerCount`),e.useState(`activeTriggerId`),e.useState(`activeTriggerElement`),n])}function ys(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=ds({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 ce(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function bs(e,t){e.useSyncedValues(t),q(()=>()=>{e.update({activeTriggerProps:Ke,inactiveTriggerProps:Ke,popupProps:Ke})},[e])}function xs(e,t){q(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),q(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var Ss=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}},Cs={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},ws=class extends bo{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:Ko(),nested:n,triggerElements:i},Cs),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&Er(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 Ts(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new ws({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:Ke,inactiveTriggerProps:Ke,popupProps:Ke}}var Es=e=>e.triggerIdProp??e.activeTriggerId,Ds=e=>e.openProp??e.open,Os=e=>(e.popupElement?.id??e.floatingId)||void 0;function ks(e,t){return t!==void 0&&Ds(e)&&Es(e)===t}function As(e,t){return ks(e,t)?!0:t!==void 0&&Ds(e)&&Es(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var js={open:Ds,mounted:e=>e.mounted,transitionStatus:e=>Ds(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:Es,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:Os,isTriggerActive:(e,t)=>t!==void 0&&Es(e)===t,isOpenedByTrigger:(e,t)=>ks(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&Es(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>As(e,t)?Os(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement};function Ms(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=Sn(),a=Yo()!=null,o=ce(()=>new ws({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new Ss,floatingId:i,syncOnly:!1,nested:a})).current;return q(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=M(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}function Ns(e){return Rn&&e.movementX===0&&e.movementY===0}function Ps(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function Fs(e,t){return Ps(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function Is(e,t,n){return Ps(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function Ls(e,t,n){return Ps(t,n?e===Gn:e===Kn,e===Jn)}function Rs(e,t,n,r){return t===`both`||t===`horizontal`&&r?e===`Escape`:Ps(t,n?e===Kn:e===Gn,e===qn)}function zs(e,t){let{listRef:n,activeIndex:r,onNavigate:a=()=>{},enabled:o=!0,selectedIndex:s=null,allowEscape:c=!1,loopFocus:l=!1,nested:u=!1,rtl:d=!1,virtual:f=!1,focusItemOnOpen:p=`auto`,focusItemOnHover:m=!0,openOnArrowKeyDown:h=!0,disabledIndices:g=void 0,orientation:_=`vertical`,triggerOrientation:v=_,parentOrientation:y,id:b,resetOnPointerLeave:x=!0,externalTree:S,nestedReturnFocusRef:C,grid:w}=t,T=w!=null,E=e.useState(`open`),D=e.useState(`floatingElement`),O=e.useState(`domReferenceElement`),k=e.context.dataRef,A=vr(D),j=_r(O),M=ro(A),P=Yo(),F=Xo(S),I=i.useRef(p),L=i.useRef(s??-1),R=i.useRef(null),z=i.useRef(!0),B=K(e=>{a(L.current===-1?null:L.current,e)}),V=i.useRef(!!D),ee=i.useRef(E),H=i.useRef(!1),U=i.useRef(!1),te=i.useRef(null),ne=ro(g),re=ro(E),W=ro(s),G=ro(x),ie=Li(),ae=Li(),oe=K(()=>{ie.cancel();function e(e){f||(te.current=Eo(e,{sync:H.current,preventScroll:!0}))}let t=n.current[L.current],r=U.current;t&&e(t),(H.current?e=>e():e=>ie.request(e))(()=>{let i=n.current[L.current]||t;i&&(t||e(i),fe&&(r||!z.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});q(()=>{k.current.orientation=_},[k,_]),q(()=>{E||(R.current=null),(!E||p!==`auto`)&&(I.current=p)},[E,p]),q(()=>{o&&(E&&D?(L.current=s??-1,I.current&&s!=null&&(U.current=!0,B())):V.current&&(L.current=-1,B()))},[o,E,D,s,B]),q(()=>{if(o){if(!E)H.current=!1;else if(D){if(r==null){if(H.current=!1,W.current!=null)return;if(V.current&&(L.current=-1,oe()),(!ee.current||!V.current)&&I.current&&(R.current!=null||I.current===!0&&R.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>ae.request(e):queueMicrotask)(t),e+=1):(L.current=R.current==null||Is(R.current,v,d)||u?ti(n):ni(n),R.current=null,B())};t()}}else ei(n.current,r)||(L.current=r,oe(),U.current=!1)}}},[o,E,D,r,W,u,n,v,d,B,oe,ae]),q(()=>{if(!o||D||!F||f||!V.current)return;let e=F.nodesRef.current,t=e.find(e=>e.id===P)?.context?.elements.floating,n=Vn(Y(O??t??null)),r=e.some(e=>e.context&&$(e.context.elements.floating,n));t&&!r&&z.current&&t.focus({preventScroll:!0})},[o,D,O,F,P,f]),q(()=>{ee.current=E,V.current=!!D});let se=r!=null,ce=K(e=>{if(!re.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(L.current!==t||r!==t)&&(L.current=t,B(e))}),le=K(()=>y??F?.nodesRef.current.find(e=>e.id===P)?.context?.dataRef?.current.orientation),ue=K(()=>ti(n,ne.current)),de=K(t=>{if(z.current=!1,H.current=!0,t.which===229||!re.current&&t.currentTarget===M.current)return;if(u&&Rs(t.key,_,d,T)){Fs(t.key,le())||xr(t),e.setOpen(!1,Ji(na,t.nativeEvent));let n=C?.current??O;N(n)&&n.focus();return}r!=null&&r!==L.current&&!ei(n.current,r)&&(L.current=r);let i=L.current,a=ti(n,g),o=ni(n,g);if(j||(t.key===`Home`&&(xr(t),L.current=a,B(t)),t.key===`End`&&(xr(t),L.current=o,B(t))),w!=null){let e=w(t,L.current,n,_,l,d,g,a,o);if(e!=null&&e!==L.current&&(L.current=e,B(t)),_===`both`)return}if(Fs(t.key,_)){xr(t);let e=Vn(t.currentTarget.ownerDocument);if(E&&!f&&$(t.currentTarget,e)&&!n.current.some(t=>t!=null&&$(t,e))){L.current=Is(t.key,_,d)?a:o,B(t),r===L.current&&oe();return}let{index:s,wrapped:u}=ri(n.current,i,{decrement:!Is(t.key,_,d),loopFocus:l,allowEscape:c,disabledIndices:g,minIndex:a,maxIndex:o});u&&(H.current=!1),L.current=s,B(t)}}),fe=i.useMemo(()=>({onFocus(e){H.current=!0,ce(e)},onClick({currentTarget:e}){f||e.focus({preventScroll:!0})},onMouseMove(e){Ns(e)||(H.current=!0,U.current=!1,m&&ce(e))},onPointerLeave(e){if(!re.current||!z.current||e.pointerType===`touch`)return;H.current=!0;let t=e.relatedTarget;if(m&&!n.current.includes(t)&&G.current&&(te.current?.(),te.current=null,L.current=-1,B(e),!f)){let e=M.current,t=Vn(Y(e));e&&$(e,t)&&e.focus({preventScroll:!0})}}}),[ce,re,M,m,n,B,G,f]),J=i.useMemo(()=>f&&E&&se&&{"aria-activedescendant":`${b}-${r}`},[f,E,se,b,r]),pe=i.useMemo(()=>({...j?{}:J,onKeyDown(t){if(t.key===`Tab`&&t.shiftKey&&E&&!f){let n=Un(t.nativeEvent);if(n&&!$(M.current,n))return;xr(t);let r=Ji(ea,t.nativeEvent);e.setOpen(!1,r);let i=C?.current??O;!r.isCanceled&&N(i)&&i.focus()}else de(t)},onPointerMove(e){Ns(e)||(z.current=!0)}}),[J,de,M,j,e,E,f,O,C]),me=i.useMemo(()=>{function t(t){e.setOpen(!0,Ji(na,t.nativeEvent,t.currentTarget))}function n(e){p===`auto`&&Cr(e.nativeEvent)&&(I.current=!f)}function r(e){I.current=p,p===`auto`&&wr(e.nativeEvent)&&(I.current=!0)}return{onKeyDown(n){let r=e.select(`open`);z.current=!1;let i=n.key.startsWith(`Arrow`),a=Ls(n.key,le(),d),o=Fs(n.key,r?_:v),s=(u?a:o)||n.key===`Enter`||n.key.trim()===``;if(f&&r&&(!u||gr(n.currentTarget)))return de(n);if(r||h||!i){if(s){let e=Fs(n.key,le());R.current=u&&e?null:n.key}u?a&&(xr(n),r?(L.current=ue(),B(n),f&&M.current?.focus()):t(n)):o&&(W.current!=null&&(L.current=W.current),xr(n),!r&&h?t(n):de(n),r&&B(n))}},onFocus(t){t.target===t.currentTarget&&e.select(`open`)&&!f&&(L.current=-1,B(t))},onPointerDown:r,onPointerEnter:r,onMouseDown:n,onClick:n}},[de,p,ue,u,B,e,h,_,v,le,d,W,f,M]),he=i.useMemo(()=>({...J,...me}),[J,me]);return i.useMemo(()=>o?{reference:he,floating:pe,item:fe,trigger:me}:{},[o,he,pe,me,fe])}function Bs(e,t){let{listRef:n,elementsRef:r,activeIndex:a,onMatch:o,disabledIndices:s,onTyping:c,enabled:l=!0,resetMs:u=750,selectedIndex:d=null}=t,f=K(c),p=e.useState(`open`),m=Ni(),h=i.useRef(``),g=i.useRef(d??a??-1),_=i.useRef(null),v=K(e=>{function t(e){return r?.current[e]}function i(e){let n=t(e);return n&&!si(n)||n?.matches(`:disabled`)?!1:s==null||!ai(Ge,e,s)}function c(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,a=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(e[n]?.toLowerCase().startsWith(a)&&i(n))return n}return-1}let l=n.current;if(h.current.length>0&&e.key===` `&&(xr(e),f?.(!0)),h.current.length>0&&h.current[0]!==` `&&c(l,h.current)===-1&&e.key!==` `&&f?.(!1),l==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;p&&e.key!==` `&&(xr(e),f?.(!0));let v=h.current===``;v&&(g.current=d??a??-1),l.every((e,t)=>e&&i(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&h.current===e.key&&(h.current=``,g.current=_.current),h.current+=e.key,m.start(u,()=>{h.current=``,g.current=_.current,f?.(!1)});let y=((v?d??a??-1:g.current)??0)+1,b=c(l,h.current,y);b===-1?e.key!==` `&&(h.current=``,f?.(!1)):(o?.(b,e),_.current=b)}),y=K(t=>{let n=t.relatedTarget,r=e.select(`domReferenceElement`),i=e.select(`floatingElement`);$(r,n)||$(i,n)||(m.clear(),h.current=``,g.current=_.current,f?.(!1))});q(()=>{(p||d===null)&&(m.clear(),_.current=null,h.current!==``&&(h.current=``,f?.(!1)))},[p,d,m,f]);let b=i.useMemo(()=>({onKeyDown:v,onBlur:y}),[v,y]);return i.useMemo(()=>l?{reference:b,floating:b}:{},[l,b])}function Vs(e,t,n){let{reference:r,floating:i}=e,a=zr(t),o=Br(t),s=Rr(o),c=Fr(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=Ir(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Hs(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}=Pr(t,e),p=Qr(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=$r(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=$r(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 Us=50,Ws=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Hs},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Vs(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<Us&&(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}=Vs(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Gs=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}=Pr(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=Fr(r),_=zr(o),v=Fr(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Xr(o)]:Hr(o)),x=p!==`none`;!d&&x&&b.push(...Yr(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=Vr(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`||_===zr(t)||T.every(e=>zr(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=zr(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{}}}},Ks=new Set([`left`,`top`]);async function qs(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Fr(n),s=Ir(n),c=zr(n)===`y`,l=Ks.has(o)?-1:1,u=a&&c?-1:1,d=Pr(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 Js=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 qs(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}}}}},Ys=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}=Pr(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=zr(i),p=Lr(f),m=u[p],h=u[f],g=(e,t)=>Nr(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}}}}}},Xs=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}=Pr(e,t),u={x:n,y:r},d=zr(i),f=Lr(d),p=u[f],m=u[d],h=Pr(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=Ks.has(Fr(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}}}},Zs=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}=Pr(e,t),c=await i.detectOverflow(t,s),l=Fr(n),u=Ir(n),d=zr(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=Dr(p-c[m],g),y=Dr(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*Or(c.left,c.right):S=p-2*Or(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 Qs(e){let t=ne(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=N(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=kr(n)!==a||kr(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function $s(e){return M(e)?e:e.contextElement}function ec(e){let t=$s(e);if(!N(t))return jr(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Qs(t),o=(a?kr(n.width):n.width)/r,s=(a?kr(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var tc=jr(0);function nc(e){let t=k(e);return!U()||!t.visualViewport?tc:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function rc(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===k(e)}function ic(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=$s(e),o=jr(1);t&&(r?M(r)&&(o=ec(r)):o=ec(e));let s=rc(a,n,r)?nc(a):jr(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=k(a),t=M(r)?k(r):r,n=e,i=ae(n);for(;i&&t!==n;){let e=ec(i),t=i.getBoundingClientRect(),r=ne(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=k(i),i=ae(n)}}return $r({width:u,height:d,x:c,y:l})}function ac(e,t){let n=re(e).scrollLeft;return t?t.left+n:ic(A(e)).left+n}function oc(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-ac(e,n),y:n.top+t.scrollTop}}function sc(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=A(r),s=t?L(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=jr(1),u=jr(0),d=N(r);if((d||!a)&&((O(r)!==`body`||F(o))&&(c=re(r)),d)){let e=ic(r);l=ec(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?oc(o,c):jr(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 cc(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function lc(e){let t=re(e),n=e.ownerDocument.body,r=Or(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Or(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+ac(e),o=-t.scrollTop;return ne(n).direction===`rtl`&&(a+=Or(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var uc=25;function dc(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=k(e),a=A(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!U()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(ac(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<=uc&&(s-=o)}return{width:s,height:c,x:l,y:u}}function fc(e,t){let n=ic(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=ec(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function pc(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=dc(e,n,t);else if(t===`document`)r=lc(A(e));else if(M(t))r=fc(t,n);else{let n=nc(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return $r(r)}function mc(e,t){let n=t.get(e);if(n)return n;let r=ie(e,[],!1).filter(e=>M(e)&&O(e)!==`body`),i=null,a=ne(e).position===`fixed`,o=a?W(e):e;for(;M(o)&&!te(o);){let e=ne(o),t=ee(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=W(o)}return t.set(e,r),r}function hc(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?L(t)?[]:mc(t,this._c):[].concat(n),r],o=pc(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=pc(t,a[e],i);s=Or(n.top,s),c=Dr(n.right,c),l=Dr(n.bottom,l),u=Or(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function gc(e){let{width:t,height:n}=Qs(e);return{width:t,height:n}}function _c(e,t,n){let r=N(t),i=A(t),a=n===`fixed`,o=ic(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=jr(0);if((r||!a)&&((O(t)!==`body`||F(i))&&(s=re(t)),r)){let e=ic(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=ac(i));let l=i&&!r&&!a?oc(i,s):jr(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 vc(e){return ne(e).position===`static`}function yc(e,t){if(!N(e)||ne(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return A(e)===n&&(n=n.ownerDocument.body),n}function bc(e,t){let n=k(e);if(L(e))return n;if(!N(e)){let t=W(e);for(;t&&!te(t);){if(M(t)&&!vc(t))return t;t=W(t)}return n}let r=yc(e,t);for(;r&&I(r)&&vc(r);)r=yc(r,t);return r&&te(r)&&vc(r)&&!ee(r)?n:r||H(e)||n}var xc=async function(e){let t=this.getOffsetParent||bc,n=this.getDimensions,r=await n(e.floating);return{reference:_c(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Sc(e){return ne(e).direction===`rtl`}var Cc={convertOffsetParentRelativeRectToViewportRelativeRect:sc,getDocumentElement:A,getClippingRect:hc,getOffsetParent:bc,getElementRects:xc,getClientRects:cc,getDimensions:gc,getScale:ec,isElement:M,isRTL:Sc};function wc(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Tc(e,t,n){let r=null,i,a=A(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=Ar(d),h=Ar(a.clientWidth-(u+f)),g=Ar(a.clientHeight-(d+p)),_=Ar(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Or(0,Dr(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!wc(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=k(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Ec(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=$s(e),u=i||a?[...l?ie(l):[],...t?ie(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Tc(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?ic(e):null;c&&g();function g(){let t=ic(e);h&&!wc(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 Dc=Js,Oc=Ys,kc=Gs,Ac=Zs,jc=Xs,Mc=(e,t,n)=>{let r=new Map,i=n??{},a={...Cc,...i.platform,_c:r};return Ws(e,t,{...i,platform:a})},Nc=typeof document<`u`?i.useLayoutEffect:function(){};function Pc(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(!Pc(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)&&!Pc(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Fc(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ic(e,t){let n=Fc(e);return Math.round(t*n)/n}function Lc(e){let t=i.useRef(e);return Nc(()=>{t.current=e}),t}function Rc(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:a,elements:{reference:o,floating:s}={},transform:c=!0,whileElementsMounted:l,open:u}=e,[d,f]=i.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=i.useState(r);Pc(p,r)||m(r);let[h,g]=i.useState(null),[_,v]=i.useState(null),y=i.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),b=i.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=o||h,S=s||_,C=i.useRef(null),w=i.useRef(null),T=i.useRef(d),E=l!=null,D=Lc(l),O=Lc(a),k=Lc(u),A=i.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:p};O.current&&(e.platform=O.current),Mc(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!Pc(T.current,t)&&(T.current=t,it.flushSync(()=>{f(t)}))})},[p,t,n,O,k]);Nc(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);let j=i.useRef(!1);Nc(()=>(j.current=!0,()=>{j.current=!1}),[]),Nc(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=i.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=i.useMemo(()=>({reference:x,floating:S}),[x,S]),P=i.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=Ic(N.floating,d.x),r=Ic(N.floating,d.y);return c?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Fc(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,c,N.floating,d.x,d.y]);return i.useMemo(()=>({...d,update:A,refs:M,elements:N,floatingStyles:P}),[d,A,M,N,P])}var zc=(e,t)=>{let n=Dc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Bc=(e,t)=>{let n=Oc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vc=(e,t)=>({fn:jc(e).fn,options:[e,t]}),Hc=(e,t)=>{let n=kc(e);return{name:n.name,fn:n.fn,options:[e,t]}},Uc=(e,t)=>{let n=Ac(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wc=i.createContext(void 0),Gc=i.createContext(void 0);function Kc(){let e=i.useContext(Wc);if(e===void 0)throw Error(Oe(60));return e}function qc(){let e=i.useContext(Gc);if(e===void 0)throw Error(Oe(61));return e}function Jc(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 Yc=(e,t)=>Object.is(e,t);function Xc(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function Zc(e,t,n){return Array.isArray(e)&&Array.isArray(t)?!Jc(e,t,(e,t)=>Xc(e,t,n)):e!==t}function Qc(e,t,n){return e?e.some(e=>e!==void 0&&Xc(t,e,n)):!1}function $c(e,t,n){return e?e.findIndex(e=>e!==void 0&&Xc(e,t,n)):-1}function el(e,t){if(t!==Yc)return n=>Qc(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 tl(e,t,n,r){let i=r&&Array.isArray(t)?e.findIndex(el(t,n)):$c(e,t,n);return i===-1?null:i}function nl(e,t,n,r,i,a){return Qc(r,t,i)?a!=null&&e>a&&Qc(r,n[a],i)?a:e:e===a?tl(n,r,i,!0):a}function rl(e,t,n){return e.filter(e=>!Xc(t,e,n))}function il(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}function al(e){return typeof e==`object`&&!!e&&Array.isArray(e.items)}function ol(e){return al(e?.[0])}function sl(e){return ol(e)?e.flatMap(e=>e.items):e}function cl(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(ol(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 ll(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 il(e)}function ul(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?il(e.value):il(e)}function dl(e,t,n){function r(){return ll(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e==`object`&&`label`in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return(Object.hasOwn(t,e)?t[e]:void 0)??r();if(Array.isArray(t)){let n=sl(t);if(typeof e!=`object`||!e){let t=n.find(t=>t.value===e);return t&&t.label!=null?t.label:r()}if(`value`in e){let t=n.find(t=>t&&t.value===e.value);if(t&&t.label!=null)return t.label}}return r()}function fl(e,t,n){return e.reduce((e,r,a)=>(a>0&&e.push(`, `),e.push((0,Q.jsx)(i.Fragment,{children:dl(r,t,n)},a)),e),[])}var pl={id:e=>e.id,labelId:e=>e.labelId,modal:e=>e.modal,multiple:e=>e.multiple,disabled:e=>e.disabled,readOnly:e=>e.readOnly,required:e=>e.required,highlightItemOnHover:e=>e.highlightItemOnHover,items:e=>e.items,itemToStringLabel:e=>e.itemToStringLabel,isItemEqualToValue:e=>e.isItemEqualToValue,value:e=>e.value,hasSelectedValue:e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:ul(t,r)!==``},hasNullItemLabel:(e,t)=>t?cl(e.items):!1,open:e=>e.open,mounted:e=>e.mounted,forceMount:e=>e.forceMount,transitionStatus:e=>e.transitionStatus,openMethod:e=>e.openMethod,activeIndex:e=>e.activeIndex,selectedIndex:e=>e.selectedIndex,isActive:(e,t)=>e.activeIndex===t,isSelected:(e,t)=>{let n=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(e=>Xc(t,e,n)):Xc(t,r,n)},isSelectedByFocus:(e,t)=>e.selectedIndex===t,popupProps:e=>e.popupProps,triggerProps:e=>e.triggerProps,itemRoot:e=>e.itemRoot,triggerElement:e=>e.triggerElement,positionerElement:e=>e.positionerElement,listElement:e=>e.listElement,popupSide:e=>e.popupSide,scrollUpArrowVisible:e=>e.scrollUpArrowVisible,scrollDownArrowVisible:e=>e.scrollDownArrowVisible,hasScrollArrows:e=>e.hasScrollArrows};function ml(e){let t=i.useRef(``),n=i.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:i.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 hl(e,t){let{onClick:n,onPointerDown:r}=ml(K((n,r)=>{(typeof e==`function`?e():e)||t(r||(Nn?`touch`:``))}));return i.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function gl(e){let[t,n]=i.useState(null),r=hl(e,n);return qi(e,t=>{t&&!e&&n(null)}),i.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function _l(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function vl(e,t){return Math.max(0,e-t)}function yl(e,t){if(t<=0)return 0;let n=_l(e,0,t),r=n,i=t-n,a=r<=1,o=i<=1;return a&&o?r<=i?0:t:a?0:o?t:n}function bl(e){let{id:t,value:n,defaultValue:r=null,onValueChange:a,open:o,defaultOpen:s=!1,onOpenChange:c,name:l,form:u,autoComplete:d,disabled:f=!1,readOnly:p=!1,required:m=!1,modal:h=!0,actionsRef:g,inputRef:_,onOpenChangeComplete:v,items:y,multiple:b=!1,itemToStringLabel:x,itemToStringValue:S,isItemEqualToValue:C=Yc,highlightItemOnHover:w=!0,children:T}=e,{clearErrors:E}=_n(),{setDirty:D,setTouched:O,setFocused:k,validityData:A,setFilled:j,name:M,disabled:N,validation:P,validationMode:F}=hn(),I=En({id:t}),L=N||f,R=M??l,[z,B]=fa({controlled:n,default:b?r??Ge:r,name:`Select`,state:`value`}),[V,ee]=fa({controlled:o,default:s,name:`Select`,state:`open`}),H=i.useRef([]),U=i.useRef([]),te=i.useRef(null),ne=i.useRef(null),re=i.useRef(0),W=i.useRef(null),G=i.useRef([]),ie=i.useRef(!1),ae=i.useRef(null),oe=i.useRef(null),se=i.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),le=i.useRef(!1),ue=i.useRef(z),{openMethod:de,triggerProps:fe}=gl(V),J=ce(()=>new bo({id:I,labelId:void 0,modal:h,multiple:b,disabled:L,readOnly:p,required:m,highlightItemOnHover:w,itemToStringLabel:x,itemToStringValue:S,isItemEqualToValue:C,value:z,open:V,mounted:V,transitionStatus:void 0,items:y,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:Ke,triggerProps:Ke,itemRoot:{props:Ke,multiple:b,disabled:L,readOnly:p,isItemEqualToValue:C},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1},{setValue:X,setOpen:X,handleScrollArrowVisibility:X,onOpenChangeComplete:X,listRef:H,popupRef:te,scrollHandlerRef:ne,scrollArrowsMountedCountRef:re,valueRef:W,valuesRef:G,labelsRef:U,typingRef:ie,selectionRef:se,firstItemTextRef:ae,selectedItemTextRef:oe,alignItemWithTriggerActiveRef:le,initialValueRef:ue},pl)).current,[pe,he]=i.useState(!1),{mounted:ge,transitionStatus:_e,forceUnmount:ve}=ds({open:V,ref:te,preventUnmountOnClose:pe,setPreventUnmountOnClose:he,onUnmount(){J.update({activeIndex:null,openMethod:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1}),v?.(!1)}}),ye=J.useState(`activeIndex`),be=J.useState(`selectedIndex`),xe=J.useState(`triggerElement`),Se=J.useState(`positionerElement`),Ce=no(de),we=de??Ce,Te=i.useMemo(()=>b?``:ul(z,S),[b,z,S]),Ee=i.useMemo(()=>b&&Array.isArray(z)?z.map(e=>ul(e,S)):ul(z,S),[b,z,S]);Ki(ro(xe),I,z,K(()=>Ee),!L,l);let De=b?Array.isArray(z)&&z.length>0:z!=null&&Te!==``;q(()=>{j(De)},[De,j]),q(function(){let e=tl(G.current,z,C,b);e===null&&(oe.current=null),!V&&J.set(`selectedIndex`,e)},[b,V,z,C,J]),qi(z,()=>{E(R),D(Zc(z,A.initialValue,C)),P.change(z)});let Oe=K((e,t)=>{let n=t,r=_s(n);c?.(e,n),!t.isCanceled&&(e||he(r()),ee(e),!e&&(t.reason===`focus-out`||t.reason===`outside-press`)&&(O(!0),k(!1),F===`onBlur`&&P.commit(z)))});i.useImperativeHandle(g,()=>({unmount:ve,close:()=>{J.state.open&&Oe(!1,Ji(sa))}}),[ve,Oe,J]);let ke=K((e,t)=>{a?.(e,t),!t.isCanceled&&B(e)}),Ae=K(e=>{let t=vl(e.scrollHeight,e.clientHeight),n=yl(e.scrollTop,t),r=n>0,i=n<t;J.set(`scrollUpArrowVisible`,r),J.set(`scrollDownArrowVisible`,i)}),je=Ms({open:V,onOpenChange:Oe,elements:{reference:xe,floating:Se}}),Y=os(je,{enabled:!L,event:`mousedown`}),Me=ls(je),Ne=zs(je,{enabled:!L,listRef:H,activeIndex:ye,selectedIndex:be,disabledIndices:Ge,onNavigate(e){(e!==null||V)&&J.set(`activeIndex`,e)},focusItemOnHover:w}),Pe=Bs(je,{enabled:!L&&(V||!p&&!b),listRef:U,activeIndex:ye,selectedIndex:be,disabledIndices:e=>Aa(H.current[e]),onMatch(e){V?J.set(`activeIndex`,e):ke(G.current[e],Ji(Yi))},onTyping(e){ie.current=e}}),Fe=i.useMemo(()=>me(Pe.reference,Ne.reference,Me.reference,Y.reference,fe),[Y.reference,Pe.reference,Ne.reference,Me.reference,fe]),Le=i.useMemo(()=>me(fs,Pe.floating,Ne.floating,Me.floating),[Pe.floating,Ne.floating,Me.floating]),Re=Ne.item??Ke,ze=i.useMemo(()=>({props:Re,multiple:b,disabled:L,readOnly:p,isItemEqualToValue:C}),[Re,b,L,p,C]);J.useContextCallback(`setValue`,ke),J.useContextCallback(`setOpen`,Oe),J.useContextCallback(`handleScrollArrowVisibility`,Ae),J.useContextCallback(`onOpenChangeComplete`,v),to(()=>{J.update({popupProps:Le,triggerProps:Fe,itemRoot:ze})}),J.useSyncedValues({id:I,modal:h,multiple:b,disabled:L,readOnly:p,required:m,highlightItemOnHover:w,value:z,open:V,mounted:ge,transitionStatus:_e,popupProps:Le,triggerProps:Fe,itemRoot:ze,items:y,itemToStringLabel:x,itemToStringValue:S,isItemEqualToValue:C,openMethod:we});let Be=Ie(_,P.inputRef),Ve=b?void 0:R,He=i.useMemo(()=>!b||!Array.isArray(z)||!R?null:z.map(e=>{let t=ul(e,S);return(0,Q.jsx)(`input`,{type:`hidden`,form:u,name:R,value:t,disabled:L},t)}),[b,z,u,R,S,L]);return(0,Q.jsxs)(Wc.Provider,{value:J,children:[(0,Q.jsx)(Gc.Provider,{value:je,children:T}),(0,Q.jsx)(`input`,{...P.getValidationProps(L,{onFocus(){J.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||L||p)return;let t=e.currentTarget.value,n=Ji(Yi,e.nativeEvent);function r(){if(b)return;let e=t.toLowerCase(),r=G.current.findIndex(t=>ul(t,S).toLowerCase()===e||ll(t,x).toLowerCase()===e);r===-1&&(r=G.current.findIndex((t,n)=>{let r=U.current[n];return r!=null&&r.toLowerCase()===e}));let i=G.current[r];i!=null&&ke(i,n)}J.set(`forceMount`,!0),queueMicrotask(r)}}),id:I&&Ve==null?`${I}-hidden-input`:void 0,form:u,name:Ve,autoComplete:d,value:Te,disabled:L,required:m&&!(b&&De),readOnly:p,ref:Be,style:R?eo:$a,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),He]})}function xl(e,t){return e??t}var Sl=5;function Cl(e,t){let n=wl(t);return e.clientX>=n.left-Sl&&e.clientX<=n.right+Sl&&e.clientY>=n.top-Sl&&e.clientY<=n.bottom+Sl}function wl(e){let t=e.getBoundingClientRect(),n=k(e);if(Bn)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}}var Tl=`data-popup-side`,El=400,Dl={...dr,...fn,popupSide:e=>e?{[Tl]:e}:null,value:()=>null},Ol=i.forwardRef(function(e,t){let{render:n,className:r,id:a,disabled:o=!1,nativeButton:s=!0,style:c,...l}=e,{setTouched:u,validationMode:d,validation:f,state:p,disabled:m}=hn(),{labelId:h}=Tn(),g=Kc(),_=g.useState(`readOnly`),v=g.useState(`required`),y=g.useState(`disabled`),b=m||y||o,x=g.useState(`open`),S=g.useState(`mounted`),C=g.useState(`value`),w=g.useState(`triggerProps`),T=g.useState(`positionerElement`),E=g.useState(`listElement`),D=g.useState(`popupSide`),O=g.useState(`id`),k=g.useState(`labelId`),A=g.useState(`hasSelectedValue`),j=S&&T?D:null,M=a??O,N=xl(h,k);En({id:a});let P=ro(T),F=i.useRef(null),I=Gi(b,F),{getButtonProps:L,buttonRef:R}=Ne({disabled:b,native:s}),z=g.useStateSetter(`triggerElement`),B=Ni(),V=Ni(),ee=Ni();i.useEffect(()=>{if(x)return ee.start(El,()=>{g.context.selectionRef.current.allowUnselectedMouseUp=!0,g.context.selectionRef.current.allowSelectedMouseUp=!0}),()=>{ee.clear()};g.context.selectionRef.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},V.clear()},[x,g,V,ee]);let H=me(w,{id:M,role:`combobox`,"aria-expanded":x,"aria-haspopup":`listbox`,"aria-controls":x?E?.id??vr(T)?.id:void 0,"aria-labelledby":N,"aria-readonly":_||void 0,"aria-required":v||void 0,tabIndex:b?-1:0,onFocus(e){I(!0),x&&g.context.alignItemWithTriggerActiveRef.current&&g.context.setOpen(!1,Ji(Yi,e.nativeEvent)),B.start(0,()=>{g.set(`forceMount`,!0)})},onBlur(e){$(T,e.relatedTarget)||(u(!0),I(!1),d===`onBlur`&&f.commit(C))},onMouseDown(e){if(x)return;let t=Y(e.currentTarget);function n(e){if(!F.current)return;let t=e.target;$(F.current,t)||$(P.current,t)||Cl(e,F.current)||g.context.setOpen(!1,Ji(ra,e))}V.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},l,L),U=f.getValidationProps(b,H);U.role=`combobox`;let te={...p,open:x,disabled:b,value:C,readOnly:_,popupSide:j,placeholder:!A};return Xe(`button`,e,{ref:[t,F,R,z],state:te,stateAttributesMapping:Dl,props:U})}),kl={value:()=>null},Al=i.forwardRef(function(e,t){let{className:n,render:r,children:i,placeholder:a,style:o,...s}=e,c=Kc(),l=c.useState(`value`),u=c.useState(`items`),d=c.useState(`itemToStringLabel`),f=c.useState(`hasSelectedValue`),p=!f&&a!=null&&i==null,m=c.useState(`hasNullItemLabel`,p),h={value:l,placeholder:!f},g=null;return g=typeof i==`function`?i(l):i??(p&&!m?a:Array.isArray(l)?fl(l,u,d):dl(l,u,d)),Xe(`span`,e,{state:h,ref:[t,c.context.valueRef],props:[{children:g},s],stateAttributesMapping:kl})}),jl=i.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e;return Xe(`span`,e,{state:{open:Kc().useState(`open`)},ref:t,props:[{"aria-hidden":!0,children:`▼`},a],stateAttributesMapping:ur})}),Ml=i.forwardRef(function(e,t){let n=Kc(),r=n.useState(`mounted`),i=n.useState(`forceMount`);return r||i?(0,Q.jsx)(Go,{ref:t,...e}):null});function Nl(e){let{nodeId:t,externalTree:n,rootContext:r}=e,a=r.useState(`referenceElement`),o=r.useState(`floatingElement`),s=r.useState(`domReferenceElement`),c=r.useState(`open`),l=r.useState(`floatingId`),[u,d]=i.useState(null),f=i.useRef(null),p=Xo(n),m=i.useMemo(()=>({reference:a,floating:o,domReference:s}),[a,o,s]),h=Rc({...e,elements:{...m,...u&&{reference:u}}}),g=i.useCallback(e=>{let t=M(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;d(t),h.refs.setReference(t)},[h.refs]),_=i.useMemo(()=>({...h.refs,setPositionReference:g,domReference:f}),[h.refs,g]),v=i.useMemo(()=>({...h.elements,domReference:s}),[h.elements,s]),y=i.useMemo(()=>({...h,dataRef:r.context.dataRef,open:c,onOpenChange:r.setOpen,events:r.context.events,floatingId:l,refs:_,elements:v,nodeId:t,rootStore:r}),[h,_,v,t,r,c,l]);return q(()=>{s&&(f.current=s)},[s]),q(()=>{r.context.dataRef.current.floatingContext=y;let e=p?.nodesRef.current.find(e=>e.id===t);e&&(e.context=y)}),i.useMemo(()=>({...h,context:y,refs:_,elements:v,rootStore:r}),[h,_,v,y,r])}var Pl=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}=Pr(e,t)||{};if(l==null)return{};let d=Qr(u),f={x:n,y:r},p=Br(i),m=Rr(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=Nr(D,k,O),j=!c.arrow&&Ir(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}}}),Fl=(e,t)=>{let{name:n,fn:r}=Pl(e);return{name:n,fn:r,options:[e,t]}},Il={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}}}},Ll={sideX:`left`,sideY:`top`},Rl=`--available-width`,zl=`--available-height`,Bl=`--anchor-width`,Vl=`--anchor-height`,Hl=`--transform-origin`,Ul=Rl,Wl=zl;function Gl(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 Kl(e,t,n){let{rects:r,placement:i}=e;return{side:Gl(t,Fr(i),n),align:Ir(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function ql(e){return Jl(e,Nl)}function Jl(e,t){let{anchor:n,positionMethod:r=`absolute`,side:a=`bottom`,sideOffset:o=0,align:s=`center`,alignOffset:c=0,collisionBoundary:l,collisionPadding:u=5,sticky:d=!1,arrowPadding:f=5,disableAnchorTracking:p=!1,inline:m,keepMounted:h=!1,floatingRootContext:g,mounted:_,collisionAvoidance:v,shift:y,nodeId:b,adaptiveOrigin:x,lazyFlip:S=!1,externalTree:C}=e,w=v.side||`flip`,T=v.align||`flip`,E=v.fallbackAxisSide||`end`,D=y?.crossAxis??!1,O=y?.rootBoundary,A=typeof n==`function`?n:void 0,j=K(A),M=A?j:n,N=ro(n),P=ro(_),F=Wa()===`rtl`,[I,L]=i.useState(null);!_&&I!==null&&L(null);let R=S===`placement`,z=I?Fr(I):null,B=I&&R?Ir(I)||`center`:null,V=z||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":F?`left`:`right`,"inline-start":F?`right`:`left`}[a],ee=B||s,H=ee===`center`?V:`${V}-${ee}`,U=u;typeof U==`number`?U={top:U,right:U,bottom:U,left:U}:U&&={top:U.top||0,right:U.right||0,bottom:U.bottom||0,left:U.left||0};let te=+(a===`bottom`),ne=+(a===`top`),re=+(a===`right`),W=+(a===`left`),G={boundary:l===`clipping-ancestors`?`clippingAncestors`:l,padding:U},ie=i.useRef(null),ae=ro(o),oe=ro(c),se=typeof o==`function`?0:o,ce=typeof c==`function`?0:c,le=[];m&&le.push(m),le.push(zc(e=>{let t=Kl(e,a,F),n=typeof ae.current==`function`?ae.current(t):ae.current,r=typeof oe.current==`function`?oe.current(t):oe.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[se,ce,F,a]));let ue=T===`none`&&w!==`shift`,de=!ue&&(d||D||w===`shift`),fe=w===`none`?null:Hc({...G,padding:{top:U.top+1+te,right:U.right+1+W,bottom:U.bottom+1+ne,left:U.left+1+re},mainAxis:!D&&w===`flip`,crossAxis:T===`flip`&&`alignment`,fallbackAxisSideDirection:E}),J=ue?null:Bc({...G,rootBoundary:O,mainAxis:T!==`none`,crossAxis:de,limiter:d||D?void 0:Vc(e=>{if(!ie.current)return{};let{width:t,height:n}=ie.current.getBoundingClientRect(),r=zr(Fr(e.placement)),i=r===`y`?t:n,a=r===`y`?U.left+U.right:U.top+U.bottom;return{offset:i/2+a/2}})},[G,d,D,O,U,T]);w===`shift`||T===`shift`||ee===`center`?le.push(J,fe):le.push(fe,J),le.push(Uc({...G,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!P.current)return;let i=e.style;i.setProperty(Ul,`${t}px`),i.setProperty(Wl,`${n}px`);let a=k(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(Bl,`${u}px`),i.setProperty(Vl,`${d}px`)}}),Fl(e=>({element:ie.current||Y(e.elements.floating).createElement(`div`),padding:ie.current?f:0}),[f]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:i,rects:s,y:c}=e,l=Fr(r),u=Ir(r),d=zr(l)===`y`,f=ie.current,p=typeof o==`function`?o(Kl(e,a,F)):o,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&i.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 de&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(Hl,d?`${m} ${h}`:`${h} ${m}`),{}}},Il,x),q(()=>{!_&&g&&g.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[_,g]);let pe=i.useMemo(()=>({ancestorScroll:!p,elementResize:!p&&typeof ResizeObserver<`u`,layoutShift:!p&&typeof IntersectionObserver<`u`}),[p]),{refs:me,elements:he,x:ge,y:_e,middlewareData:ve,update:ye,placement:be,context:xe,isPositioned:Se,floatingStyles:Ce}=t({rootContext:g,open:h?_:void 0,placement:H,middleware:le,strategy:r,whileElementsMounted:h?void 0:(...e)=>Ec(...e,pe),nodeId:b,externalTree:C}),{sideX:we,sideY:Te}=ve.adaptiveOrigin||Ll,Ee=Se?r:`fixed`,De=i.useMemo(()=>{let e;return e=Se?x?{position:Ee,[we]:ge,[Te]:_e}:{...Ce,position:Ee}:{position:Ee,top:0,left:0},e[Ul]=`100vw`,e[Wl]=`100vh`,Se||(e.opacity=0),e},[x,Ee,we,ge,Te,_e,Ce,Se]),Oe=i.useRef(null);q(()=>{if(!_)return;let e=N.current,t=typeof e==`function`?e():e,n=(Yl(t)?t.current:t)||null;n!==Oe.current&&(me.setPositionReference(n),Oe.current=n)},[_,me,M,N]),i.useEffect(()=>{if(!_)return;let e=N.current;typeof e!=`function`&&Yl(e)&&e.current!==Oe.current&&(me.setPositionReference(e.current),Oe.current=e.current)},[_,me,M,N]),i.useEffect(()=>{if(h&&_&&he.reference&&he.floating)return Ec(he.reference,he.floating,ye,pe)},[h,_,he,ye,pe]);let ke=Fr(be),Ae=Gl(a,ke,F),je=Ir(be)||`center`,Me=!!ve.hide?.referenceHidden;q(()=>{S&&_&&Se&&(ke!==V||R&&je!==ee)&&L(be)},[S,R,_,Se,be,ke,je,V,ee]);let Ne=i.useMemo(()=>({position:`absolute`,top:ve.arrow?.y,left:ve.arrow?.x}),[ve.arrow]),Pe=ve.arrow?.centerOffset!==0;return i.useMemo(()=>({positionerStyles:De,arrowStyles:Ne,arrowRef:ie,arrowUncentered:Pe,side:Ae,align:je,physicalSide:ke,anchorHidden:Me,refs:me,context:xe,isPositioned:Se,update:ye}),[De,Ne,ie,Pe,Ae,je,ke,Me,me,xe,Se,ye])}function Yl(e){return e!=null&&`current`in e}var Xl=i.createContext(void 0);function Zl(){let e=i.useContext(Xl);if(!e)throw Error(Oe(59));return e}var Ql=i.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,Q.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})});function $l(e,t){e&&Object.assign(e.style,t)}var eu={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`};function tu(e){return e===`starting`?Ro:Ke}function nu(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),Xe(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},tu(r),i],stateAttributesMapping:fr})}var ru={},iu={},au=``;function ou(e,t){return F(e)?e:t}function su(e,t,n){return/hidden|clip/.test(e.getComputedStyle(ou(t,n)).overflowY)}function cu(e){if(typeof document>`u`)return!1;let t=Y(e);return k(t).innerWidth-t.documentElement.clientWidth>0}function lu(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=Y(e),n=t.documentElement,r=t.body,i=ou(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 uu(e){let t=Y(e),n=t.documentElement,r=t.body,i=ou(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 du(e){let t=Y(e),n=t.documentElement,r=t.body,i=k(n),a=0,o=0,s=!1,c=Ii.create();if(Rn&&(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,ru={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},au=n.style.scrollBehavior,iu={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=ou(n,r);s=lu(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,ru),Object.assign(r.style,iu),s||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=au)}function d(){u(),c.request(l)}l();let f=So(i,`resize`,d);return()=>{c.cancel(),u(),typeof i.removeEventListener==`function`&&f()}}var fu=new class{lockCount=0;restore=null;timeoutLock=Mi.create();timeoutUnlock=Mi.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=Y(e),n=t.documentElement,r=t.body,i=k(n);if(su(i,n,r)){let t=new i.MutationObserver(()=>{su(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=Nn||!cu(e);this.restore=a?uu(e):du(e)}};function pu(e=!0,t=null){q(()=>{if(e)return fu.acquire(t)},[e,t])}var mu=20;function hu(e,t,n,r){let[a,o]=i.useState(!1);q(()=>{if(!e||!t||n==null){o(!1);return}let r=Y(n).documentElement.clientWidth,i=n.offsetWidth;o(r>0&&i>0&&i>=r-mu)},[e,t,n]),pu(e&&(!t||a),r)}var gu={position:`fixed`},_u=i.forwardRef(function(e,t){let{anchor:n,className:r,render:a,positionMethod:o,side:s,align:c,sideOffset:l,alignOffset:u,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f,arrowPadding:p,sticky:m,disableAnchorTracking:h,alignItemWithTrigger:g=!0,collisionAvoidance:_=zo,style:v,...y}=e,b=Kc(),x=qc(),S=b.useState(`open`),C=b.useState(`mounted`),w=b.useState(`modal`),T=b.useState(`value`),E=b.useState(`openMethod`),D=b.useState(`positionerElement`),O=b.useState(`triggerElement`),k=b.useState(`isItemEqualToValue`),A=b.useState(`transitionStatus`),j=i.useRef(null),M=i.useRef(null),[N,P]=i.useState(g),F=C&&N&&E!==`touch`;!C&&N!==g&&P(g),i.useImperativeHandle(b.context.alignItemWithTriggerActiveRef,()=>F),hu((F||w)&&S,E===`touch`,D,O);let I=ql({anchor:n,floatingRootContext:x,positionMethod:o,mounted:C,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:h??F,collisionAvoidance:_,keepMounted:!0}),L=F?`none`:I.side,R=F?gu:I.positionerStyles,z={open:S,side:L,align:I.align,anchorHidden:I.anchorHidden};q(()=>{b.set(`popupSide`,I.side)},[b,I.side]);let B=nu(e,z,{styles:R,transitionStatus:A,props:y,refs:[t,b.useStateSetter(`positionerElement`)],hidden:!C,inert:!S}),V=i.useRef(0),ee=K(e=>{if(b.context.valuesRef.current.length===0)return;let t=V.current;V.current=e.size;let n=Ji(Yi);if(t!==0&&!b.state.multiple&&T!==null&&$c(b.context.valuesRef.current,T,k)===-1){let e=b.context.initialValueRef.current,t=e!=null&&$c(b.context.valuesRef.current,e,k)!==-1?e:null;b.context.setValue(t,n),t===null&&(b.set(`selectedIndex`,null),b.context.selectedItemTextRef.current=null)}if(t!==0&&b.state.multiple&&Array.isArray(T)){let e=T.filter(e=>$c(b.context.valuesRef.current,e,k)!==-1);e.length!==T.length&&(b.context.setValue(e,n),e.length===0&&(b.set(`selectedIndex`,null),b.context.selectedItemTextRef.current=null))}if(S&&F){b.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};$l(D,e),$l(b.context.popupRef.current,e)}}),H=i.useMemo(()=>({...I,side:L,alignItemWithTriggerActive:F,setControlledAlignItemWithTrigger:P,scrollUpArrowRef:j,scrollDownArrowRef:M}),[I,L,F,P]);return(0,Q.jsx)(ha,{elementsRef:b.context.listRef,labelsRef:b.context.labelsRef,onMapChange:ee,children:(0,Q.jsxs)(Xl.Provider,{value:H,children:[C&&w&&(0,Q.jsx)(Ql,{inert:ka(!S),cutout:O}),B]})})}),vu=`base-ui-disable-scrollbar`,yu={className:vu,getElement(e){return(0,Q.jsx)(`style`,{nonce:e,href:vu,precedence:`base-ui:low`,children:`.${vu}{scrollbar-width:none}.${vu}::-webkit-scrollbar{display:none}`})}},bu=i.createContext(void 0);function xu(e){let t=i.useContext(bu);if(t===void 0&&!e)throw Error(Oe(69));return t}var Su=`--transform-origin`,Cu={...fr,...$n},wu=i.forwardRef(function(e,t){let{render:n,className:r,style:a,finalFocus:o,...s}=e,c=Kc(),l=c.useState(`multiple`),u=c.useState(`readOnly`),d=c.useState(`highlightItemOnHover`),f=qc(),{side:p,align:m,alignItemWithTriggerActive:h,isPositioned:g,setControlledAlignItemWithTrigger:_}=Zl(),v=xu(!0)!=null,y=Wa(),{nonce:b,disableStyleElements:x}=Oa(),S=c.useState(`id`),C=c.useState(`open`),w=c.useState(`openMethod`),T=c.useState(`mounted`),E=c.useState(`popupProps`),D=c.useState(`transitionStatus`),O=c.useState(`triggerElement`),A=c.useState(`positionerElement`),j=c.useState(`listElement`),M=i.useRef(!1),N=i.useRef(!1),P=i.useRef({}),F=Li(),I=K(e=>{if(!A||!c.context.popupRef.current||!N.current)return;let t=A.style.top===`0px`,n=A.style.bottom===`0px`;if(M.current||!h||!t&&!n){c.context.handleScrollArrowVisibility(e);return}let r=Du(A),i=Ou(A.getBoundingClientRect().height,`y`,r),a=Y(A),o=k(A),s=o.getComputedStyle(A),l=parseFloat(s.marginTop),u=parseFloat(s.marginBottom),d=Tu(o.getComputedStyle(c.context.popupRef.current)),f=Math.min(a.documentElement.clientHeight-l-u,d),p=e.scrollTop,m=Eu(e),g=null,_=e=>{A.style.height=`${e}px`},v=t?m-p:p,y=Math.min(i+v,f);if(v<=1){let n=_l(v,0,f-i);n>0&&_(i+n),e.scrollTop=t?m:0,f-(i+n)<=1&&(M.current=!0),c.context.handleScrollArrowVisibility(e);return}f-y>1?g=t?1/0:0:n&&p<m&&(g=p-(v-(i+v-f)));let b=Math.ceil(y);if(b!==0&&_(b),g!=null){let t=_l(g,0,Eu(e));Math.abs(e.scrollTop-t)>1&&(e.scrollTop=t)}b>=f-1&&(M.current=!0),c.context.handleScrollArrowVisibility(e)});i.useImperativeHandle(c.context.scrollHandlerRef,()=>I,[I]),Ui({open:C,ref:c.context.popupRef,onComplete(){C&&c.context.onOpenChangeComplete(!0)}});let L={open:C,transitionStatus:D,side:p,align:m};q(()=>{A&&c.context.popupRef.current&&!Object.keys(P.current).length&&(P.current={top:A.style.top||`0`,left:A.style.left||`0`,right:A.style.right,height:A.style.height,bottom:A.style.bottom,minHeight:A.style.minHeight,maxHeight:A.style.maxHeight,marginTop:A.style.marginTop,marginBottom:A.style.marginBottom})},[c,A]),q(()=>{C||h||(N.current=!1,M.current=!1,$l(A,P.current))},[C,h,A]),q(()=>{let e=c.context.popupRef.current;if(!C||!O||!A||!e||h&&!g||c.state.transitionStatus===`ending`)return;if(N.current=!0,e.style.removeProperty(Su),!h){F.request(()=>c.context.handleScrollArrowVisibility(j||e));return}let t=ju(e);try{let t=c.context.selectedItemTextRef.current;t?.isConnected||(t=!c.select(`hasSelectedValue`)&&c.context.firstItemTextRef.current?.isConnected?c.context.firstItemTextRef.current:null);let n=c.context.valueRef.current,r=k(A),i=r.getComputedStyle(A),a=r.getComputedStyle(e),o=Y(O),s=Du(O),l=ku(O.getBoundingClientRect(),s),u=ku(A.getBoundingClientRect(),s),f=l.height,p=j||e,m=p.scrollHeight,h=parseFloat(a.borderBottomWidth),g=parseFloat(i.marginTop)||10,v=parseFloat(i.marginBottom)||10,b=parseFloat(i.minHeight)||100,x=Tu(a),S=o.documentElement.clientHeight-g-v,C=o.documentElement.clientWidth,w=S-l.bottom+f,T,E=y===`rtl`?l.right-u.width:l.left,D=0;if(t&&n){let e=ku(n.getBoundingClientRect(),s);T=ku(t.getBoundingClientRect(),s),E=u.left+(y===`rtl`?e.right-T.right:e.left-T.left);let r=e.top-l.top+e.height/2;D=T.top-u.top+T.height/2-r}let N=w+D+v+h,F=Math.min(S,N),I=S-g-v,L=N-F,R=C-5;A.style.left=`${_l(E,5,R-u.width)}px`,A.style.height=`${F}px`,A.style.maxHeight=`none`,A.style.marginTop=`${g}px`,A.style.marginBottom=`${v}px`,e.style.height=`100%`;let z=Eu(p),B=L>=z-1;B&&(F=Math.min(S,u.height)-(L-z));let V=l.top<20||l.bottom>S-20||Math.ceil(F)+1<Math.min(m,b),ee=(r.visualViewport?.scale??1)!==1&&Rn;if(V||ee){$l(A,P.current),_(!1);return}let H=Math.max(b,F);if(B){let e=Math.max(0,S-N);A.style.top=u.height>=I?`0`:`${e}px`,A.style.height=`${F}px`,p.scrollTop=Eu(p)}else A.style.bottom=`0`,p.scrollTop=L;if(T){let t=u.top,n=u.height,r=T.top+T.height/2,i=_l(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(Su,`50% ${i}%`)}(H===S||F>=x)&&(M.current=!0),c.context.handleScrollArrowVisibility(p),d&&c.state.selectedIndex===null&&c.state.activeIndex===null&&c.context.listRef.current[0]!=null&&c.set(`activeIndex`,0)}finally{t()}},[c,C,A,O,h,_,F,j,d,y,g]),i.useEffect(()=>{if(!h||!A||!C)return;let e=k(A);function t(e){c.context.setOpen(!1,Ji(ca,e))}return So(e,`resize`,t)},[c,h,A,C]);let R={...j?{role:`presentation`}:{role:`listbox`,"aria-multiselectable":l||void 0,"aria-readonly":u||void 0,id:`${S}-list`},onKeyDown(e){v&&Ia.has(e.key)&&e.stopPropagation()},onScroll(e){j||I(e.currentTarget)},...h&&{style:j?{height:`100%`}:eu},className:!j&&h?yu.className:void 0},z=Xe(`div`,e,{ref:[t,c.context.popupRef],state:L,stateAttributesMapping:Cu,props:[E,R,tu(D),s]});return(0,Q.jsxs)(i.Fragment,{children:[!x&&yu.getElement(b),(0,Q.jsx)(as,{context:f,modal:!1,disabled:!T,openInteractionType:w,returnFocus:o,restoreFocus:!0,children:z})]})});function Tu(e){let t=e.maxHeight;return t.endsWith(`px`)&&parseFloat(t)||1/0}function Eu(e){return vl(e.scrollHeight,e.clientHeight)}function Du(e){return Cc.getScale(e)}function Ou(e,t,n){return e/n[t]}function ku(e,t){return $r({x:Ou(e.x,`x`,t),y:Ou(e.y,`y`,t),width:Ou(e.width,`x`,t),height:Ou(e.height,`y`,t)})}var Au=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function ju(e){let{style:t}=e,n={};for(let[e,r]of Au)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of Au){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var Mu=i.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,o=Kc(),s=o.useState(`multiple`),c=o.useState(`readOnly`),{alignItemWithTriggerActive:l}=Zl(),u=o.useState(`hasScrollArrows`),d=o.useState(`openMethod`),f={id:`${o.useState(`id`)}-list`,role:`listbox`,"aria-multiselectable":s||void 0,"aria-readonly":c||void 0,onScroll(e){o.context.scrollHandlerRef.current?.(e.currentTarget)},...l&&{style:eu},className:u&&d!==`touch`?yu.className:void 0};return Xe(`div`,e,{ref:[t,o.useStateSetter(`listElement`)],props:[f,a]})}),Nu=i.createContext(void 0);function Pu(){let e=i.useContext(Nu);if(!e)throw Error(Oe(57));return e}var Fu=i.memo(i.forwardRef(function(e,t){let{render:n,className:r,style:a,value:o=null,label:s,disabled:c=!1,nativeButton:l=!1,...u}=e,d=i.useRef(null),f=Sa({guess:!0,label:s,textRef:d}),p=Kc(),{props:m,multiple:h,disabled:g,readOnly:_,isItemEqualToValue:v}=p.useState(`itemRoot`),y=g||c,b=p.useState(`isActive`,f.index),x=p.useState(`open`),S=p.useState(`isSelected`,o),C=p.useState(`isSelectedByFocus`,f.index),w=f.index,T=i.useRef(null);q(()=>{let e=p.context.valuesRef.current;return e[w]=o,()=>{delete e[w]}},[w,o,p]),q(()=>{let e=p.state.value,t=p.state.selectedIndex,n=t,r;h&&Array.isArray(e)?(n=nl(w,o,p.context.valuesRef.current,e,v,t),r=n===w,w===t&&!r&&(p.context.selectedItemTextRef.current=null)):(r=e!==void 0&&Xc(o,e,v),r&&(n=w)),p.set(`selectedIndex`,n),r&&d.current&&(p.context.selectedItemTextRef.current=d.current)},[w,h,v,p,o]);let E=i.useRef(`mouse`),D=i.useRef(!1),{getButtonProps:O,buttonRef:k}=Ne({disabled:y,focusableWhenDisabled:!0,native:l,composite:!0}),A={disabled:y,selected:S,highlighted:b};function j(e){if(g||_)return;let t=p.state.value;if(h){let n=Array.isArray(t)?t:[],r=S?rl(n,o,v):[...n,o];p.context.setValue(r,Ji(Qi,e))}else p.context.setValue(o,Ji(Qi,e)),p.context.setOpen(!1,Ji(Qi,e))}function M(){p.context.selectionRef.current.dragY=0}let N={role:`option`,"aria-selected":S,tabIndex:x&&b?0:-1,onKeyDown(e){p.set(`activeIndex`,w),e.key===` `&&p.context.typingRef.current&&e.preventDefault()},onClick(e){let t=E.current!==`touch`,n=e.nativeEvent.pointerType,r=t&&Cr(e.nativeEvent)&&(n!==void 0||b),i=t&&!r&&!D.current;D.current=!1,!(y||i)&&j(e.nativeEvent)},onPointerEnter(e){E.current=e.pointerType},onPointerMove(e){if(e.pointerType===`mouse`&&e.buttons===1){let t=p.context.selectionRef.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){E.current=e.pointerType,D.current=!0,M()},onMouseUp(){if(M(),y||E.current===`touch`||D.current)return;let e=!p.context.selectionRef.current.allowSelectedMouseUp&&S,t=!p.context.selectionRef.current.allowUnselectedMouseUp&&!S;e||t||(D.current=!0,T.current?.click(),D.current=!1)}},P=Xe(`div`,e,{ref:[k,t,f.ref,T],state:A,props:[m,N,u,O]}),F=i.useMemo(()=>({selected:S,index:w,textRef:d,selectedByFocus:C}),[S,w,d,C]);return(0,Q.jsx)(Nu.Provider,{value:F,children:P})})),Iu=i.memo(i.forwardRef(function(e,t){let{render:n,className:r,style:a,keepMounted:o,selected:s,...c}=e,l=i.useRef(null),{transitionStatus:u,setMounted:d}=Wi(s),f=Xe(`span`,e,{ref:[t,l],state:{selected:s,transitionStatus:u},props:[{"aria-hidden":!0,children:`✔️`},c],stateAttributesMapping:$n});return Ui({batch:!0,enabled:!s,open:s,ref:l,onComplete(){s||d(!1)}}),f})),Lu=i.forwardRef(function(e,t){let{selected:n}=Pu();return e.keepMounted||n?(0,Q.jsx)(Iu,{...e,selected:n,ref:t}):null}),Ru=i.memo(i.forwardRef(function(e,t){let{index:n,textRef:r,selectedByFocus:a}=Pu(),o=Kc(),{render:s,className:c,style:l,...u}=e;return Xe(`div`,e,{ref:[i.useCallback(e=>{e&&(n===0&&(o.context.firstItemTextRef.current=e),a&&(o.context.selectedItemTextRef.current=e))},[o,n,a]),t,r],props:u})})),zu=i.forwardRef(function(e,t){let{render:n,className:r,style:i,direction:a,keepMounted:o,...s}=e,c=a===`up`,l=Kc(),{side:u,scrollDownArrowRef:d,scrollUpArrowRef:f}=Zl(),p=c?`scrollUpArrowVisible`:`scrollDownArrowVisible`,m=l.useState(p),h=l.useState(`openMethod`),g=m&&h!==`touch`,_=Ni(),v=c?f:d,{mounted:y,transitionStatus:b,setMounted:x}=Wi(g);q(()=>(l.context.scrollArrowsMountedCountRef.current+=1,l.set(`hasScrollArrows`,!0),()=>{l.context.scrollArrowsMountedCountRef.current=Math.max(0,l.context.scrollArrowsMountedCountRef.current-1),l.context.scrollArrowsMountedCountRef.current===0&&l.set(`hasScrollArrows`,!1)}),[l]),Ui({open:g,ref:v,onComplete(){g||x(!1)}});let S=Xe(`div`,e,{ref:[t,v],state:{direction:a,visible:g,side:u,transitionStatus:b},props:[{"aria-hidden":!0,children:c?`▲`:`▼`,style:{position:`absolute`},onMouseMove(e){if(e.movementX===0&&e.movementY===0||_.isStarted())return;l.set(`activeIndex`,null);function t(){let e=l.state.listElement??l.context.popupRef.current;if(!e)return;l.set(`activeIndex`,null),l.context.handleScrollArrowVisibility(e);let n=vl(e.scrollHeight,e.clientHeight),r=yl(e.scrollTop,n),i=r===(c?0:n),a=l.context.listRef.current;if(r!==e.scrollTop&&(e.scrollTop=r),i)_.clear();else{if(a.length>0){let t=v.current?.offsetHeight||0;e.scrollTop=Bu(a,c,r,e.clientHeight,t,n)}_.start(40,t)}}_.start(40,t)},onMouseLeave(){_.clear()}},s],stateAttributesMapping:$n});return y||o?S:null});function Bu(e,t,n,r,i,a){if(t){let t=0,r=n+i-1;for(let n=0;n<e.length;n+=1){let i=e[n];if(i&&i.offsetTop>=r){t=n;break}}let o=Math.max(0,t-1),s=e[o];return o<t&&s?yl(s.offsetTop-i,a):0}let o=e.length-1,s=n+r-i+1;for(let t=0;t<e.length;t+=1){let n=e[t];if(n&&n.offsetTop+n.offsetHeight>s){o=Math.max(0,t-1);break}}let c=Math.min(e.length-1,o+1),l=e[c];return c>o&&l?yl(l.offsetTop+l.offsetHeight-r+i,a):a}var Vu=i.forwardRef(function(e,t){return(0,Q.jsx)(zu,{...e,ref:t,direction:`down`})}),Hu=i.forwardRef(function(e,t){return(0,Q.jsx)(zu,{...e,ref:t,direction:`up`})}),Uu=bl;function Wu({className:e,...t}){return(0,Q.jsx)(Al,{"data-slot":`select-value`,className:Z(`flex flex-1 text-left`,e),...t})}function Gu({className:e,size:t=`default`,children:n,...r}){return(0,Q.jsxs)(Ol,{"data-slot":`select-trigger`,"data-size":t,className:Z(`flex w-fit items-center justify-between gap-1.5 rounded-none border border-input bg-transparent py-2 pr-2 pl-2.5 text-xs whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-none *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[n,(0,Q.jsx)(jl,{render:(0,Q.jsx)(S,{className:`pointer-events-none size-4 text-muted-foreground`})})]})}function Ku({className:e,children:t,side:n=`bottom`,sideOffset:r=4,align:i=`center`,alignOffset:a=0,alignItemWithTrigger:o=!0,...s}){return(0,Q.jsx)(Ml,{children:(0,Q.jsx)(_u,{side:n,sideOffset:r,align:i,alignOffset:a,alignItemWithTrigger:o,className:`isolate z-50`,children:(0,Q.jsxs)(wu,{"data-slot":`select-content`,"data-align-trigger":o,className:Z(`relative isolate z-50 max-h-(--available-height) w-(--anchor-width) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-none bg-popover text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 data-[align-trigger=true]:animate-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:fade-out-0 data-closed:zoom-out-95`,e),...s,children:[(0,Q.jsx)(Ju,{}),(0,Q.jsx)(Mu,{children:t}),(0,Q.jsx)(Yu,{})]})})})}function qu({className:e,children:t,...n}){return(0,Q.jsxs)(Fu,{"data-slot":`select-item`,className:Z(`relative flex w-full cursor-default items-center gap-2 rounded-none py-2 pr-8 pl-2 text-xs outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,Q.jsx)(Ru,{className:`flex flex-1 shrink-0 gap-2 whitespace-nowrap`,children:t}),(0,Q.jsx)(Lu,{render:(0,Q.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`}),children:(0,Q.jsx)(b,{className:`pointer-events-none`})})]})}function Ju({className:e,...t}){return(0,Q.jsx)(Hu,{"data-slot":`select-scroll-up-button`,className:Z(`top-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,Q.jsx)(w,{})})}function Yu({className:e,...t}){return(0,Q.jsx)(Vu,{"data-slot":`select-scroll-down-button`,className:Z(`bottom-0 z-10 flex w-full cursor-default items-center justify-center bg-popover py-1 [&_svg:not([class*='size-'])]:size-4`,e),...t,children:(0,Q.jsx)(S,{})})}var Xu=i.createContext(void 0);function Zu(e){let t=i.useContext(Xu);if(!e&&t===void 0)throw Error(Oe(27));return t}var Qu=i.forwardRef(function(e,t){let{render:n,className:r,style:i,forceRender:a=!1,...o}=e,s=Zu(),c=s.useState(`open`),l=s.useState(`nested`),u=s.useState(`mounted`);return Xe(`div`,e,{state:{open:c,transitionStatus:s.useState(`transitionStatus`)},ref:[s.context.backdropRef,t],stateAttributesMapping:pr,props:[{role:`presentation`,hidden:!u,style:{userSelect:`none`,WebkitUserSelect:`none`}},o],enabled:a||!l})}),$u=i.forwardRef(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,...s}=e,c=Zu(),l=c.useState(`open`),{getButtonProps:u,buttonRef:d}=Ne({disabled:a,native:o}),f={disabled:a};function p(e){l&&c.setOpen(!1,Ji($i,e.nativeEvent))}return Xe(`button`,e,{state:f,ref:[t,d],props:[{onClick:p},s,u]})}),ed=i.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=Zu(),c=Cn(a);return s.useSyncedValueWithCleanup(`descriptionElementId`,c),Xe(`p`,e,{ref:t,props:[{id:c},o]})}),td=i.createContext(void 0);function nd(){let e=i.useContext(td);if(e===void 0)throw Error(Oe(26));return e}var rd=`--nested-dialogs`,id=`data-nested-dialog-open`,ad={...fr,...$n,nestedDialogOpen(e){return e?{[id]:``}:null}},od=i.forwardRef(function(e,t){let{render:n,className:r,style:i,finalFocus:a,initialFocus:o,...s}=e,c=Zu(),l=c.useState(`descriptionElementId`),u=c.useState(`disablePointerDismissal`),d=c.useState(`floatingRootContext`),f=c.useState(`popupProps`),p=c.useState(`modal`),m=c.useState(`mounted`),h=c.useState(`nested`),g=c.useState(`nestedOpenDialogCount`),_=c.useState(`open`),v=c.useState(`openMethod`),y=c.useState(`titleElementId`),b=c.useState(`transitionStatus`),x=c.useState(`role`),S=d.useState(`floatingId`);nd(),Ui({open:_,ref:c.context.popupRef,onComplete(){_&&c.context.onOpenChangeComplete?.(!0)}});let C=o===void 0?ps(c.context.popupRef):o,w=g>0,T=c.useStateSetter(`popupElement`),E=Xe(`div`,e,{state:{open:_,nested:h,transitionStatus:b,nestedDialogOpen:w},props:[f,{id:S,"aria-labelledby":y,"aria-describedby":l,role:x,...fs,hidden:!m,onKeyDown(e){Ia.has(e.key)&&e.stopPropagation()},style:{[rd]:g}},s],ref:[t,c.context.popupRef,T],stateAttributesMapping:ad});return(0,Q.jsx)(as,{context:d,openInteractionType:v,disabled:!m,closeOnFocusOut:!u,initialFocus:C,returnFocus:a,modal:p!==!1,restoreFocus:`popup`,children:E})}),sd=i.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e,i=Zu(),a=i.useState(`mounted`),o=i.useState(`modal`),s=i.useState(`open`);return a||n?(0,Q.jsx)(td.Provider,{value:n,children:(0,Q.jsxs)(Go,{ref:t,...r,children:[a&&o===!0&&(0,Q.jsx)(Ql,{ref:i.context.internalBackdropRef,inert:ka(!s)}),e.children]})}):null});function cd({store:e,parentContext:t,isDrawer:n}){let r=e.useState(`open`),a=e.useState(`mounted`),o=e.useState(`disablePointerDismissal`),s=e.useState(`modal`),c=e.useState(`popupElement`),l=e.useState(`floatingRootContext`),[u,d]=i.useState(0),[f,p]=i.useState(0),m=u===0,h=ls(l,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?`intentional`:{mouse:s===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}},outsidePress(t){if(!e.context.outsidePressEnabledRef.current||`button`in t&&t.button!==0)return!1;if(`touches`in t){if(t.type===`touchend`){if(t.changedTouches.length!==1||t.touches.length!==0)return!1}else if(t.touches.length!==1)return!1}let n=Un(t);if(m&&!o){if(s){let t=e.context.internalBackdropRef.current,r=e.context.backdropRef.current;return t||r?t===n||r===n||$(n,c)&&!n?.hasAttribute(`data-base-ui-portal`):!0}return!0}return!1},escapeKey:m});return pu(r&&s===!0,c),e.useContextCallback(`onNestedDialogOpen`,(t,n)=>{(e.select(`open`)||e.select(`mounted`))&&(d(t),p(n))}),q(()=>{!r&&!a&&(d(0),p(0))},[r,a]),q(()=>(t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(u+1,f+ +!!n),()=>{t?.onNestedDialogOpen&&r&&t.onNestedDialogOpen(0,0)}),[n,r,u,f,t]),bs(e,{activeTriggerProps:h.reference,inactiveTriggerProps:h.trigger,popupProps:h.floating,nestedOpenDialogCount:u,nestedOpenDrawerCount:f}),null}var ld={...js,modal:e=>e.modal,nested:e=>e.nested,nestedOpenDialogCount:e=>e.nestedOpenDialogCount,nestedOpenDrawerCount:e=>e.nestedOpenDrawerCount,disablePointerDismissal:e=>e.disablePointerDismissal,openMethod:e=>e.openMethod,descriptionElementId:e=>e.descriptionElementId,titleElementId:e=>e.titleElementId,viewportElement:e=>e.viewportElement,role:e=>e.role},ud=class extends bo{constructor(e,t,n){let r=new Ss,i=dd(e,r,t,n);super(i,fd(r),ld)}setOpen=(e,t)=>{t.preventUnmountOnClose=()=>{this.set(`preventUnmountingOnClose`,!0)},!e&&t.trigger==null&&this.state.activeTriggerId!=null&&(t.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(e,t),!t.isCanceled&&(this.state.floatingRootContext.dispatchOpenChange(e,t),this.update(gs(this.state,e,t.trigger)))}};function dd(e,t,n,r=!1){return{...Ts(t,n,r),modal:!0,disablePointerDismissal:!1,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,nestedOpenDrawerCount:0,role:`dialog`,...e}}function fd(e){return{popupRef:i.createRef(),backdropRef:i.createRef(),internalBackdropRef:i.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:e,onOpenChange:void 0,onOpenChangeComplete:void 0}}function pd(e,t){let{children:n,open:r,defaultOpen:a=!1,onOpenChange:o,onOpenChangeComplete:s,disablePointerDismissal:c=!1,modal:l=!0,actionsRef:u,handle:d,triggerId:f,defaultTriggerId:p=null}=t,m=e===`drawer`,h=e===`alert-dialog`,g=h?!0:l,_=h||c,v=h?`alertdialog`:`dialog`,y=Zu(!0),b={modal:g,disablePointerDismissal:_,nested:y!=null,role:v},x=ms((e,t)=>new ud({open:a,openProp:r,activeTriggerId:p,triggerIdProp:f,...b},e,t),!0);x.useControlledProp(`openProp`,r),x.useControlledProp(`triggerIdProp`,f),x.useSyncedValues(b),x.useContextCallback(`onOpenChange`,o),x.useContextCallback(`onOpenChangeComplete`,s);let S=x.useState(`open`),C=x.useState(`mounted`),w=x.useState(`payload`);xs(x,S),vs(x);let{forceUnmount:T}=ys(S,x);i.useImperativeHandle(u,()=>({unmount:T,close:()=>x.setOpen(!1,Ji(sa))}),[T,x]);let E=S||C||d!=null;return(0,Q.jsxs)(Xu.Provider,{value:x,children:[d&&(0,Q.jsx)(hs,{handle:d,store:x}),E&&(0,Q.jsx)(cd,{store:x,parentContext:y?.context,isDrawer:m}),typeof n==`function`?n({payload:w}):n]})}var md=fo(function(e){return pd(`dialog`,e)}),hd=i.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=Zu(),c=Cn(a);return s.useSyncedValueWithCleanup(`titleElementId`,c),Xe(`h2`,e,{ref:t,props:[{id:c},o]})});function gd({...e}){return(0,Q.jsx)(md,{"data-slot":`dialog`,...e})}function _d({...e}){return(0,Q.jsx)(sd,{"data-slot":`dialog-portal`,...e})}function vd({className:e,...t}){return(0,Q.jsx)(Qu,{"data-slot":`dialog-overlay`,className:Z(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function yd({className:e,children:t,showCloseButton:n=!0,...r}){return(0,Q.jsxs)(_d,{children:[(0,Q.jsx)(vd,{}),(0,Q.jsxs)(od,{"data-slot":`dialog-content`,className:Z(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-none bg-popover p-4 text-xs/relaxed text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[t,n&&(0,Q.jsxs)($u,{"data-slot":`dialog-close`,render:(0,Q.jsx)(sn,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[(0,Q.jsx)(E,{}),(0,Q.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]})}function bd({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`dialog-header`,className:Z(`flex flex-col gap-1 text-left`,e),...t})}function xd({className:e,showCloseButton:t=!1,children:n,...r}){return(0,Q.jsxs)(`div`,{"data-slot":`dialog-footer`,className:Z(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&(0,Q.jsx)($u,{render:(0,Q.jsx)(sn,{variant:`outline`}),children:`Close`})]})}function Sd({className:e,...t}){return(0,Q.jsx)(hd,{"data-slot":`dialog-title`,className:Z(`font-heading text-sm font-medium`,e),...t})}function Cd({className:e,...t}){return(0,Q.jsx)(ed,{"data-slot":`dialog-description`,className:Z(`text-xs/relaxed text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function wd({className:e,containerClassName:t,...n}){return(0,Q.jsx)(`div`,{"data-slot":`table-container`,className:Z(`relative w-full overflow-x-auto`,t),children:(0,Q.jsx)(`table`,{"data-slot":`table`,className:Z(`w-full caption-bottom text-xs`,e),...n})})}function Td({className:e,...t}){return(0,Q.jsx)(`thead`,{"data-slot":`table-header`,className:Z(`[&_tr]:border-b`,e),...t})}function Ed({className:e,...t}){return(0,Q.jsx)(`tbody`,{"data-slot":`table-body`,className:Z(`[&_tr:last-child]:border-0`,e),...t})}function Dd({className:e,...t}){return(0,Q.jsx)(`tr`,{"data-slot":`table-row`,className:Z(`border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted`,e),...t})}function Od({className:e,...t}){return(0,Q.jsx)(`th`,{"data-slot":`table-head`,className:Z(`h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0`,e),...t})}function kd({className:e,...t}){return(0,Q.jsx)(`td`,{"data-slot":`table-cell`,className:Z(`p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0`,e),...t})}var Ad=lt(`group/alert relative grid w-full gap-0.5 rounded-none border px-2.5 py-2 text-left text-xs has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4`,{variants:{variant:{default:`bg-card text-card-foreground`,destructive:`bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current`}},defaultVariants:{variant:`default`}});function jd({className:e,variant:t,...n}){return(0,Q.jsx)(`div`,{"data-slot":`alert`,role:`alert`,className:Z(Ad({variant:t}),e),...n})}function Md({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`alert-description`,className:Z(`text-xs/relaxed text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-2`,e),...t})}function Nd({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`empty`,className:Z(`flex w-full min-w-0 flex-1 flex-col items-center justify-center gap-4 rounded-none border-dashed p-6 text-center text-balance`,e),...t})}function Pd({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`empty-header`,className:Z(`flex max-w-sm flex-col items-center gap-2`,e),...t})}function Fd({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`empty-title`,className:Z(`font-heading text-sm font-medium`,e),...t})}function Id({className:e,...t}){return(0,Q.jsx)(`div`,{"data-slot":`empty-description`,className:Z(`text-xs/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,e),...t})}async function Ld(e,t,n){let r=await fetch(`/api/`+e,{method:t===void 0?`GET`:`POST`,headers:t===void 0?{}:{"content-type":`application/json`},body:t===void 0?void 0:JSON.stringify(t),signal:n,redirect:`error`});if(!r.headers.get(`content-type`)?.includes(`application/json`))throw Error(`Session expired. Sign in again through Cloudflare Access.`);let i=await r.json();if(!r.ok)throw Error(i&&typeof i==`object`&&`error`in i&&typeof i.error==`string`?i.error:`HTTP ${r.status}`);return i}var Rd=(e,t)=>`projects/${e.id}/${t}`;function zd(e){return e instanceof Error?e.message:`Request failed`}function Bd(e){return e==null?`null`:Array.isArray(e)?`List · ${e.length}`:typeof e==`object`?`Object`:String(e).slice(0,2e3)}function Vd(e,t){let n={};return e.forEach((e,r)=>{let i=t(`m${r}`);if(![`value`,`omit`,`null`].includes(String(i)))throw Error(`Invalid value mode: ${e.name}`);if(i===`omit`){if(e.required&&!e.defaultMode)throw Error(`${e.name} is required`);return}if(i===`null`){if(!e.nullable)throw Error(`${e.name} cannot be null`);Object.defineProperty(n,e.name,{value:null,enumerable:!0,writable:!0,configurable:!0});return}let a=String(t(`v${r}`)??``),o=a;if(e.choices){let t=Number(a);if(!Number.isInteger(t)||t<0||t>=e.choices.length)throw Error(`Invalid ${e.name}`);o=e.choices[t]}else if(e.type===`number`||e.type===`integer`){let t=Number(a);if(!a.trim()||!Number.isFinite(t)||e.type===`integer`&&!Number.isSafeInteger(t)||e.minimum!==void 0&&t<e.minimum||e.maximum!==void 0&&t>e.maximum)throw Error(`Invalid number: ${e.name}`);o=t}else if(e.type===`boolean`){if(a!==`true`&&a!==`false`)throw Error(`Invalid boolean: ${e.name}`);o=a===`true`}else if([`object`,`array`,`json`].includes(e.type)&&(o=JSON.parse(a),e.type!==`json`&&(e.type===`array`?!Array.isArray(o):!o||typeof o!=`object`||Array.isArray(o))))throw Error(`Invalid ${e.type}: ${e.name}`);Object.defineProperty(n,e.name,{value:o,enumerable:!0,writable:!0,configurable:!0})}),n}function Hd(e){return Object.entries(e?.properties??{}).map(([t,n])=>{let r=n.anyOf??(Array.isArray(n.type)?n.type.map(e=>({type:e})):[n]),i={...n,...r.find(e=>e.type!==`null`)},a=r.some(e=>e.type===`null`||e.const===null),o=new Set(r.filter(e=>e.type!==`null`).map(e=>e.type)),s=n.enum??(r.every(e=>Object.hasOwn(e,`const`))?r.map(e=>e.const):i.enum);return{name:t,type:o.size===1&&typeof i.type==`string`?i.type:`json`,...a?{nullable:!0}:{},...typeof i.description==`string`?{description:i.description}:{},required:e.required?.includes(t),value:i.default,choices:s,minimum:i.minimum,maximum:i.maximum}})}function Ud(e){let[t,n]=(0,i.useState)({path:e,loading:!0}),[r,a]=(0,i.useState)(0);return(0,i.useEffect)(()=>{let t=new AbortController;return n(t=>t.path===e&&t.data!==void 0?{...t,error:void 0,loading:!0}:{path:e,loading:!0}),Ld(e,void 0,t.signal).then(r=>{t.signal.aborted||n({path:e,data:r,loading:!1})}).catch(r=>{t.signal.aborted||n({path:e,error:zd(r),loading:!1})}),()=>t.abort()},[e,r]),(0,i.useEffect)(()=>{let e=0,t=()=>{let t=Date.now();document.visibilityState===`visible`&&t-e>500&&(e=t,a(e=>e+1))};return document.addEventListener(`visibilitychange`,t),window.addEventListener(`focus`,t),()=>{document.removeEventListener(`visibilitychange`,t),window.removeEventListener(`focus`,t)}},[]),{...t.path===e?t:{path:e,loading:!0},refresh:()=>a(e=>e+1)}}function Wd({children:e}){return(0,Q.jsx)(jd,{variant:`destructive`,children:(0,Q.jsx)(Md,{children:e})})}function Gd({loading:e,error:t}){return t?(0,Q.jsx)(Wd,{children:t}):e?(0,Q.jsx)(`p`,{role:`status`,className:`p-4 text-xs text-muted-foreground`,children:`Loading…`}):null}function Kd({title:e,children:t}){return(0,Q.jsx)(Nd,{children:(0,Q.jsxs)(Pd,{children:[(0,Q.jsx)(Fd,{children:e}),t&&(0,Q.jsx)(Id,{children:t})]})})}function qd({value:e,onChange:t,items:n,label:r,className:i,name:a,disabled:o,id:s}){return(0,Q.jsxs)(Uu,{name:a,disabled:o,value:e,onValueChange:e=>{e!==null&&t(e)},items:n,children:[(0,Q.jsx)(Gu,{id:s,"aria-label":r,className:i,children:(0,Q.jsx)(Wu,{})}),(0,Q.jsx)(Ku,{align:`start`,alignItemWithTrigger:!1,children:n.map(e=>(0,Q.jsx)(qu,{value:e.value,children:e.label},e.value))})]})}function Jd({rows:e,columns:t,labels:n={},renderCell:r}){return(0,Q.jsxs)(wd,{children:[(0,Q.jsx)(Td,{children:(0,Q.jsx)(Dd,{children:t.map(e=>(0,Q.jsx)(Od,{children:n[e]??e},e))})}),(0,Q.jsx)(Ed,{children:e.slice(0,100).map((e,n)=>(0,Q.jsx)(Dd,{children:t.map(t=>(0,Q.jsx)(kd,{className:`max-w-sm truncate`,children:r?r(t,e[t]):[`at`,`dueAt`].includes(t)&&typeof e[t]==`number`?new Date(e[t]).toLocaleString():Bd(e[t])},t))},n))})]})}function Yd({value:e,depth:t=0}){if(t>4)return(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:`Nested value`});if(Array.isArray(e)){let n=e.slice(0,100);return n.length&&n.every(e=>e&&typeof e==`object`&&!Array.isArray(e))?(0,Q.jsx)(Jd,{rows:n,columns:[...new Set(n.flatMap(e=>Object.keys(e)))].slice(0,40)}):e.length?(0,Q.jsx)(`ol`,{className:`list-inside list-decimal space-y-2`,children:n.map((e,n)=>(0,Q.jsx)(`li`,{children:(0,Q.jsx)(Yd,{value:e,depth:t+1})},n))}):(0,Q.jsx)(`span`,{className:`text-muted-foreground`,children:`Empty list`})}return e&&typeof e==`object`?(0,Q.jsx)(`dl`,{className:`grid grid-cols-[minmax(80px,auto)_1fr] gap-4`,children:Object.entries(e).slice(0,40).map(([e,n])=>(0,Q.jsxs)(`div`,{className:`contents`,children:[(0,Q.jsx)(`dt`,{className:`text-muted-foreground`,children:e}),(0,Q.jsx)(`dd`,{className:`min-w-0 overflow-auto`,children:(0,Q.jsx)(Yd,{value:n,depth:t+1})})]},e))}):(0,Q.jsx)(`span`,{className:`break-all`,children:Bd(e)})}function Xd({items:e}){return(0,Q.jsxs)(qa,{children:[!e.length&&(0,Q.jsx)(`p`,{className:`text-muted-foreground`,children:`No arguments required.`}),e.map((e,t)=>(0,Q.jsx)(Zd,{field:e,index:t},e.name))]})}function Zd({field:e,index:t}){let n=e.value===null&&e.nullable?`null`:e.value===void 0&&(!e.required||e.defaultMode)?`omit`:`value`,[r,a]=(0,i.useState)(n),[o,s]=(0,i.useState)(e.choices?String(Math.max(0,e.choices.indexOf(e.value))):String(e.value===!0)),c=(0,i.useId)();return(0,Q.jsxs)(Ya,{children:[(0,Q.jsxs)(Xa,{htmlFor:c,children:[(0,Q.jsxs)(`span`,{children:[e.name,e.required?` *`:``]}),(0,Q.jsx)(`span`,{className:`font-normal text-muted-foreground`,children:e.type})]}),(0,Q.jsxs)(`div`,{className:`flex items-start gap-2`,children:[(0,Q.jsx)(`div`,{className:`min-w-0 flex-1`,children:e.choices||e.type===`boolean`?(0,Q.jsx)(qd,{id:c,name:`v${t}`,label:e.name,className:`w-full`,disabled:r!==`value`,value:o,onChange:s,items:e.choices?e.choices.map((e,t)=>({value:String(t),label:String(e)})):[{value:`false`,label:`false`},{value:`true`,label:`true`}]}):[`object`,`array`,`json`].includes(e.type)?(0,Q.jsx)(Ga,{id:c,name:`v${t}`,disabled:r!==`value`,defaultValue:e.value===void 0?``:JSON.stringify(e.value,null,2),placeholder:e.type===`json`?`JSON value`:e.type===`array`?`[]`:`{}`}):(0,Q.jsx)(da,{id:c,name:`v${t}`,type:e.type===`password`?`password`:[`number`,`integer`].includes(e.type)?`number`:`text`,autoComplete:e.type===`password`?`new-password`:void 0,minLength:e.type===`password`?6:void 0,maxLength:e.type===`password`?128:void 0,required:e.required&&r===`value`,step:e.type===`integer`?1:`any`,min:e.minimum,max:e.maximum,disabled:r!==`value`,defaultValue:e.value===null||e.value===void 0?``:String(e.value)})}),!e.required||e.defaultMode||e.nullable?(0,Q.jsx)(qd,{name:`m${t}`,className:`w-32 shrink-0`,label:`Value mode for ${e.name}`,value:r,onChange:a,items:[{value:`value`,label:`Value`},...!e.required||e.defaultMode?[{value:`omit`,label:e.defaultMode?`Default`:`Omit`}]:[],...e.nullable?[{value:`null`,label:`NULL`}]:[]]}):(0,Q.jsx)(`input`,{type:`hidden`,name:`m${t}`,value:`value`})]}),e.description&&(0,Q.jsx)(Za,{children:e.description})]})}function Qd(e,t){let n=new FormData(e);return Vd(t,e=>n.get(e))}function $d({modal:e,onClose:t}){let[n,r]=(0,i.useState)(!1),[a,o]=(0,i.useState)(``);return(0,Q.jsx)(gd,{open:!0,onOpenChange:e=>{!e&&!n&&t()},children:(0,Q.jsxs)(yd,{className:`max-h-[85vh] overflow-auto`,showCloseButton:!n,children:[(0,Q.jsxs)(bd,{children:[(0,Q.jsx)(Sd,{children:e.title}),(0,Q.jsx)(Cd,{children:e.description})]}),(0,Q.jsxs)(`form`,{className:`space-y-4`,onSubmit:async i=>{if(i.preventDefault(),!n){r(!0),o(``);try{let n=i.currentTarget;if(e.productionId&&new FormData(n).get(`confirm`)!==e.productionId)throw Error(`Project ID does not match`);await e.submit(n),t()}catch(e){o(zd(e))}finally{r(!1)}}},children:[e.fields&&(0,Q.jsx)(Xd,{items:e.fields}),` `,e.content,e.productionId&&(0,Q.jsxs)(Ya,{children:[(0,Q.jsx)(Xa,{htmlFor:`production-confirm`,children:`Production change: type project ID`}),(0,Q.jsx)(`code`,{className:`block select-all`,children:e.productionId}),(0,Q.jsx)(da,{id:`production-confirm`,name:`confirm`,required:!0,autoComplete:`off`})]}),a&&(0,Q.jsx)(Wd,{children:a}),(0,Q.jsxs)(xd,{children:[(0,Q.jsx)(sn,{type:`button`,variant:`outline`,disabled:n,onClick:t,children:`Cancel`}),(0,Q.jsx)(sn,{type:`submit`,variant:e.destructive?`destructive`:`default`,disabled:n,children:n?`Working…`:e.submitLabel??`Confirm`})]})]})]})})}export{Wi as $,Xa as A,za as B,gd as C,ke as Ct,Sd as D,q as Dt,bd as E,me as Et,Pa as F,ha as G,Aa as H,ja as I,ia as J,fa as K,Ia as L,Wa as M,Ma as N,Ya as O,K as Ot,Na as P,Ji as Q,Fa as R,Dd as S,Y as St,Cd as T,Oe as Tt,ka as U,Ba as V,Sa as W,aa as X,oa as Y,Yi as Z,wd as _,Xe as _t,$d as a,ai as at,Od as b,Ie as bt,Yd as c,Yn as ct,Hd as d,Un as dt,Ui as et,Vd as f,Cn as ft,Rd as g,lt as gt,Bd as h,Z as ht,Xd as i,ei as it,Ga as j,qa as k,v as kt,Qd as l,Vn as lt,zd as m,an as mt,Kd as n,ni as nt,Jd as o,$n as ot,Ld as p,sn as pt,da as q,Wd as r,ti as rt,Gd as s,Xn as st,qd as t,ii as tt,Ud as u,$ as ut,Ed as v,Ge as vt,yd as w,Ae as wt,Td as x,Ne as xt,kd as y,Ke as yt,La as z};
@@ -0,0 +1 @@
1
+ import{a as e,r as t}from"./client.BeKNsjPN.js";import{S as n,_ as r,a as i,b as a,d as o,g as s,h as c,kt as l,l as u,mt as d,n as f,p,pt as m,s as h,u as g,v as _,x as v,y}from"./common.D6YHScsr.js";import{i as b,n as x,r as S,t as C}from"./input-group.BziAwKdZ.js";import{f as w,m as T,p as E,s as D}from"./index.astro_astro_type_script_index_0_lang.BQ7pqT75.js";var O={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};O.node;var k=l(O),A=e(t(),1),j=d();function M(e,t){return e.filter(e=>e.name!==`_id`&&e.name!==`_creationTime`).map(e=>{let n=o({properties:{[e.name]:e.schema??{type:/INT|REAL/i.test(e.type)?`number`:`string`}},required:e.notnull?[e.name]:[]})[0];return{...n,defaultMode:!t&&e.dflt_value!==null,value:t?t[e.name]:n.value}})}function N(e){let t=s(e.project,e.env),n=g(t+`/schema`),[r,i]=(0,A.useState)(``),[a,o]=(0,A.useState)(``),c=n.data?.tables??[],l=c.find(e=>e.name===r)?.name??c[0]?.name;return(0,j.jsxs)(`div`,{className:`flex h-full min-h-0`,children:[(0,j.jsxs)(`section`,{className:`explorer-sidebar overflow-y-auto`,"aria-label":`Application tables`,children:[(0,j.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,j.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,j.jsx)(`h1`,{className:`page-title`,children:`Data`}),(0,j.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[c.length,` tables`]})]}),(0,j.jsxs)(C,{children:[(0,j.jsx)(x,{children:(0,j.jsx)(b,{})}),(0,j.jsx)(S,{"aria-label":`Search tables`,placeholder:`Search tables…`,value:a,onChange:e=>o(e.target.value)})]})]}),(0,j.jsx)(`div`,{className:`space-y-1 px-2`,children:c.filter(e=>e.name.toLowerCase().includes(a.toLowerCase())).map(e=>(0,j.jsxs)(m,{variant:`ghost`,className:`w-full justify-start gap-2 ${l===e.name?`bg-accent`:``}`,onClick:()=>i(e.name),children:[(0,j.jsx)(T,{}),e.name]},e.name))}),(0,j.jsx)(`p`,{className:`p-4 text-xs text-muted-foreground`,children:`Tables are defined in code.`})]}),(0,j.jsxs)(`section`,{className:`flex min-h-0 min-w-0 flex-1 flex-col`,children:[(0,j.jsx)(h,{...n}),l?(0,j.jsx)(P,{...e,table:l},l):n.data?(0,j.jsx)(f,{title:`No application tables in this release`}):null]})]})}function P({project:e,env:t,session:o,table:l}){let[d,b]=(0,A.useState)(void 0),[x,S]=(0,A.useState)(),C=s(e,t),T=g(C+`/data?table=`+encodeURIComponent(l)+(d===void 0?``:`&cursor=`+encodeURIComponent(d))),O=T.data,N=O?.columns.find(e=>e.pk===1)?.name,P=o.role!==`viewer`,F=(n,r)=>{if(!O)return;let i=n===`delete`?void 0:M(O.columns,r);S({title:n===`insert`?`Add row`:n===`update`?`Edit row`:`Delete row`,description:n===`delete`?`This deletes the selected row. The change is audited.`:`Primary keys are immutable. NULL and defaults are explicit. Changes are revision-checked and audited.`,fields:i,productionId:t===`prod`?e.id:void 0,submit:async e=>{await p(C+`/edit`,{operation:n,table:l,key:r&&N?r[N]:void 0,values:i?u(e,i):void 0,expectedRevision:O.revision,confirm:t===`prod`?new FormData(e).get(`confirm`):void 0}),T.refresh()}})};return(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`detail-header`,children:[(0,j.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,j.jsx)(`h2`,{className:`font-mono text-sm font-semibold`,children:l}),O&&(0,j.jsxs)(D,{variant:`secondary`,children:[O.rows.length,` rows`]})]}),(0,j.jsxs)(`div`,{className:`flex gap-2`,children:[(0,j.jsx)(m,{variant:`ghost`,size:`icon-sm`,"aria-label":`Reload snapshot`,title:`Reload snapshot`,disabled:T.loading,onClick:T.refresh,children:(0,j.jsx)(w,{})}),P&&(0,j.jsxs)(m,{disabled:!O||T.loading,onClick:()=>F(`insert`),children:[(0,j.jsx)(E,{}),`Add row`]})]})]}),(0,j.jsxs)(`div`,{className:`flex justify-between border-b px-4 py-2 text-xs text-muted-foreground`,children:[(0,j.jsx)(`span`,{children:O?`${O.columns.length} columns · revision ${O.revision}`:`Loading table`}),(0,j.jsx)(`span`,{children:`Snapshot · updates after edits and when returning to this tab`})]}),(0,j.jsx)(h,{...T}),O&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto`,"aria-label":`Table rows`,role:`region`,tabIndex:0,children:[(0,j.jsxs)(r,{containerClassName:`overflow-visible`,children:[(0,j.jsx)(v,{className:`sticky top-0 z-10 bg-background`,children:(0,j.jsxs)(n,{children:[O.columns.map(e=>(0,j.jsxs)(a,{children:[(0,j.jsx)(`span`,{children:e.name}),(0,j.jsxs)(`small`,{className:`block font-normal text-muted-foreground`,children:[e.type.toLowerCase(),e.pk?` · primary`:``]})]},e.name)),P&&(0,j.jsx)(a,{children:`Actions`})]})}),(0,j.jsx)(_,{children:O.rows.map((e,t)=>(0,j.jsxs)(n,{children:[O.columns.map(t=>(0,j.jsx)(y,{className:`max-w-sm truncate font-mono`,title:c(e[t.name]),children:c(e[t.name])},t.name)),P&&(0,j.jsx)(y,{children:N?(0,j.jsxs)(`div`,{className:`flex gap-1`,children:[(0,j.jsx)(m,{size:`xs`,variant:`ghost`,onClick:()=>F(`update`,e),disabled:T.loading,children:`Edit`}),(0,j.jsx)(m,{size:`xs`,variant:`destructive`,onClick:()=>F(`delete`,e),disabled:T.loading,children:`Delete`})]}):`Read only`})]},N?String(e[N]):t))})]}),!O.rows.length&&(0,j.jsx)(f,{title:`No rows yet`,children:`Add a row or call a mutation from your app.`})]}),(0,j.jsxs)(`footer`,{className:`flex shrink-0 flex-wrap items-center justify-between gap-4 border-t p-4`,children:[(0,j.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:`Up to 50 rows per page · changes are audited`}),(0,j.jsxs)(`div`,{className:`flex gap-2`,children:[(0,j.jsx)(m,{variant:`outline`,disabled:d===void 0||T.loading,onClick:()=>b(void 0),children:`First page`}),(0,j.jsxs)(m,{variant:`outline`,disabled:O.next===null||T.loading,onClick:()=>b(O.next??void 0),children:[`Next page`,(0,j.jsx)(k,{})]})]})]})]}),x&&(0,j.jsx)(i,{modal:x,onClose:()=>S(void 0)})]})}export{M as columnFields,N as default};
@@ -0,0 +1 @@
1
+ import{a as e,r as t}from"./client.BeKNsjPN.js";import{c as n,d as r,g as i,i as a,kt as o,l as s,m as c,mt as l,n as u,p as d,pt as f,r as p,s as m,u as h}from"./common.D6YHScsr.js";import{i as g,n as _,r as v,t as y}from"./input-group.BziAwKdZ.js";import{a as b,c as x,d as S,h as C,l as w,o as T,u as E}from"./index.astro_astro_type_script_index_0_lang.BQ7pqT75.js";import{i as D,t as O}from"./client.BUUZgEFj.js";var k={name:`folder`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};k.node;var A=o(k),j={name:`play`,size:24,node:[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]};j.node;var M=o(j),N=e(t(),1),P=l();function F(e){let t=h(i(e.project,e.env)+`/functions`),[n,r]=(0,N.useState)(``),[a,o]=(0,N.useState)(``),s=Object.entries(t.data?.functions??{}),c=s.find(([e])=>e===a)??s[0],l=new Map;return s.filter(([e])=>e.toLowerCase().includes(n.toLowerCase())).forEach(e=>{let t=e[0].includes(`/`)?e[0].slice(0,e[0].lastIndexOf(`/`)):`Functions`,n=l.get(t)??[];n.push(e),l.set(t,n)}),(0,P.jsxs)(`div`,{className:`flex min-h-full`,children:[(0,P.jsxs)(`section`,{className:`explorer-sidebar`,"aria-label":`Deployed functions`,children:[(0,P.jsxs)(`div`,{className:`space-y-4 p-4`,children:[(0,P.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,P.jsx)(`h1`,{className:`page-title`,children:`Functions`}),(0,P.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:s.length})]}),(0,P.jsxs)(y,{children:[(0,P.jsx)(_,{children:(0,P.jsx)(g,{})}),(0,P.jsx)(v,{"aria-label":`Search functions`,placeholder:`Search functions…`,value:n,onChange:e=>r(e.target.value)})]})]}),(0,P.jsx)(`div`,{className:`space-y-2 px-2`,children:[...l].map(([e,t])=>(0,P.jsxs)(`details`,{open:!0,children:[(0,P.jsxs)(`summary`,{className:`flex cursor-pointer items-center gap-2 px-2 py-2 text-xs text-muted-foreground`,children:[(0,P.jsx)(A,{className:`size-4`}),e]}),(0,P.jsx)(`div`,{className:`space-y-1`,children:t.map(([e,t])=>(0,P.jsxs)(f,{variant:`ghost`,onClick:()=>o(e),className:`w-full justify-between ${c?.[0]===e?`bg-accent`:``}`,children:[(0,P.jsx)(`span`,{className:`truncate`,children:e.split(`/`).pop()}),(0,P.jsx)(b,{kind:t.kind})]},e))})]},e))}),(0,P.jsxs)(`p`,{className:`p-4 text-xs text-muted-foreground`,children:[`Active release · `,e.env]})]}),(0,P.jsxs)(`section`,{className:`min-w-0 flex-1`,children:[(0,P.jsx)(m,{...t}),c?(0,P.jsx)(L,{...e,path:c[0],fn:c[1]},c[0]+`:`+JSON.stringify(c[1])):t.data?(0,P.jsx)(u,{title:`No deployed functions`}):null]})]})}function I(e,t,n){return e===`dev`&&t!==`viewer`&&[`query`,`mutation`,`action`].includes(n)}function L({project:e,env:t,session:o,path:l,fn:m}){let h=r(m.input),g=I(t,o.role,m.kind)&&m.auth!==`internal`,[_,v]=(0,N.useState)(!1),[y,k]=(0,N.useState)(``),[A,j]=(0,N.useState)(),[F,L]=(0,N.useState)(!1),[R,z]=(0,N.useState)(),B=(0,N.useRef)(!0),V=(0,N.useRef)(void 0),H=(0,N.useRef)(void 0);return(0,N.useEffect)(()=>(B.current=!0,()=>{B.current=!1,H.current?.abort(),V.current?.dispose()}),[]),(0,P.jsxs)(P.Fragment,{children:[(0,P.jsxs)(`div`,{className:`detail-header`,children:[(0,P.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[(0,P.jsx)(`h2`,{className:`font-mono text-sm font-semibold`,children:l}),(0,P.jsx)(b,{kind:m.kind}),(0,P.jsx)(T,{status:m.auth,children:m.auth===`required`?`Authentication required`:m.auth})]}),(0,P.jsxs)(f,{type:`submit`,form:`function-run`,disabled:!g||_,children:[(0,P.jsx)(M,{}),_?`Running…`:`Run Function`]})]}),(0,P.jsxs)(x,{defaultValue:`runner`,children:[(0,P.jsxs)(E,{variant:`line`,className:`mx-4 mt-4`,children:[(0,P.jsx)(S,{value:`runner`,children:`Function runner`}),(0,P.jsx)(S,{value:`contract`,children:`Contract`})]}),(0,P.jsx)(w,{value:`runner`,className:`mt-4`,children:(0,P.jsxs)(`div`,{className:`grid lg:grid-cols-2`,children:[(0,P.jsxs)(`section`,{className:`space-y-4 border-b p-4 lg:border-r lg:border-b-0`,children:[(0,P.jsxs)(`div`,{className:`flex justify-between`,children:[(0,P.jsx)(`h3`,{className:`text-sm font-medium`,children:`Arguments`}),(0,P.jsxs)(`span`,{className:`text-xs text-muted-foreground`,children:[h.length,` fields`]})]}),(0,P.jsx)(`form`,{id:`function-run`,onSubmit:async n=>{if(n.preventDefault(),!g||_||H.current)return;let r=new AbortController;H.current=r,v(!0),k(``),z(void 0),j(void 0),L(!1);try{let a=s(n.currentTarget,h),o=await d(i(e,t)+`/dev-token`,{},r.signal);if(!B.current||r.signal.aborted)return;V.current=O({url:o.url,getToken:()=>o.token});let c=performance.now(),u=await V.current[m.kind](D(l,m.kind),a);B.current&&!r.signal.aborted&&(j(u),L(!0),z(Math.round(performance.now()-c)))}catch(e){B.current&&!r.signal.aborted&&k(c(e))}finally{V.current?.dispose(),H.current===r&&(H.current=void 0),B.current&&v(!1)}},children:(0,P.jsx)(a,{items:h})}),(0,P.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:`Development execution only. Mutations and actions can change data. Live subscriptions use the SDK. Writes are not automatically retried. Internal functions are called only by server capabilities or scheduled jobs, not this HTTP runner.`})]}),(0,P.jsxs)(`section`,{className:`space-y-4 p-4`,children:[(0,P.jsxs)(`div`,{className:`flex justify-between`,children:[(0,P.jsx)(`h3`,{className:`text-sm font-medium`,children:`Result`}),(0,P.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:_?`Running…`:y?`Failed`:R===void 0?`Not executed`:`Completed · ${R} ms round trip`})]}),y?(0,P.jsx)(p,{children:y}):F?(0,P.jsx)(n,{value:A}):(0,P.jsx)(u,{title:`Run this function to see its result`,children:(0,P.jsx)(C,{className:`mx-auto mt-3 size-7`})})]})]})}),(0,P.jsxs)(w,{value:`contract`,className:`space-y-4 p-4`,children:[(0,P.jsxs)(`section`,{className:`space-y-3`,children:[(0,P.jsx)(`h3`,{className:`text-sm font-medium`,children:`Input contract`}),(0,P.jsx)(n,{value:m.input})]}),(0,P.jsxs)(`section`,{className:`space-y-3`,children:[(0,P.jsx)(`h3`,{className:`text-sm font-medium`,children:`Output contract`}),(0,P.jsx)(n,{value:m.output})]})]})]})]})}export{I as canRun,F as default};