@deslop/workbench 0.0.291 → 0.0.299

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 (46) hide show
  1. package/dist/client/assets/{(home)-DqYzvhAC.js → (home)-DOBmFAyb.js} +1 -1
  2. package/dist/client/assets/agent-CcHomDRK.js +1 -0
  3. package/dist/client/assets/agent-DhIB78HL.js +2 -0
  4. package/dist/client/assets/browser-B8fkyBtE.js +1 -0
  5. package/dist/client/assets/browser-ClOwyJJZ.js +2 -0
  6. package/dist/client/assets/button-Bqawukg7.js +16 -0
  7. package/dist/client/assets/check-DpJM7J4T.js +1 -0
  8. package/dist/client/assets/composite-DXpCs7eA.js +1 -0
  9. package/dist/client/assets/dialog-PAzkmCTH.js +153 -0
  10. package/dist/client/assets/{diff-CQ3kp_ZY.js → diff-Wdd9xz8g.js} +10 -6
  11. package/dist/client/assets/diff-gY3qhzPv.js +2 -0
  12. package/dist/client/assets/{fallbacks-3StR6PZ5.js → fallbacks-BUiFDlyX.js} +1 -1
  13. package/dist/client/assets/{index-B0KpV0Yl.js → index-B8GNfTc7.js} +4 -4
  14. package/dist/client/assets/index-CB7nvBDM.css +2 -0
  15. package/dist/client/assets/{info-DbWKjMtL.js → info-NaVIP-PS.js} +1 -1
  16. package/dist/client/assets/loader-circle-DCgJgOPt.js +1 -0
  17. package/dist/client/assets/route-DGc1kMxd.js +2 -0
  18. package/dist/client/assets/route-dsd1lleB.js +45 -0
  19. package/dist/client/assets/run-CSGyvcrt.js +2 -0
  20. package/dist/client/assets/run-DNgqimzY.js +1 -0
  21. package/dist/client/assets/state-nIOT1NpG.js +2 -0
  22. package/dist/client/assets/terminal-BDNA0nGZ.js +119 -0
  23. package/dist/client/assets/terminal-D8j15kd-.js +2 -0
  24. package/dist/client/assets/terminal-Dn-2EhdC.js +1 -0
  25. package/dist/client/assets/{triangle-alert-DBIRu_Yl.js → triangle-alert-CvzZ7Dfq.js} +1 -1
  26. package/dist/client/index.html +13 -12
  27. package/dist/server.js +1659 -7059
  28. package/package.json +1 -1
  29. package/dist/client/assets/agent-CGU2xxEX.js +0 -2
  30. package/dist/client/assets/agent-CXAodtk6.js +0 -1
  31. package/dist/client/assets/browser-Big0jxfR.js +0 -2
  32. package/dist/client/assets/browser-DCBM0Y0g.js +0 -1
  33. package/dist/client/assets/button-DfUCUTxI.js +0 -16
  34. package/dist/client/assets/check-SxkDrjH-.js +0 -1
  35. package/dist/client/assets/composite-B4-E2IfK.js +0 -1
  36. package/dist/client/assets/dialog-DgrnySLb.js +0 -153
  37. package/dist/client/assets/diff-Ct5O0lZ0.js +0 -2
  38. package/dist/client/assets/index-DzI5lMF1.css +0 -2
  39. package/dist/client/assets/route-BlxnDll3.js +0 -2
  40. package/dist/client/assets/route-DVPqWkmA.js +0 -46
  41. package/dist/client/assets/run-BKul2xTf.js +0 -1
  42. package/dist/client/assets/run-DzoATG3-.js +0 -2
  43. package/dist/client/assets/state-BHj3zfmM.js +0 -2
  44. package/dist/client/assets/terminal-2Tn71jzR.js +0 -2
  45. package/dist/client/assets/terminal-B4yuHpYU.js +0 -119
  46. package/dist/client/assets/terminal-BB7jdQhY.js +0 -1
@@ -1 +1 @@
1
- import{n as e,t}from"./compiler-runtime-CUwoe8mk.js";var n=t(),r=e();function i(){let e=(0,n.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,r.jsx)(`div`,{className:`text-muted-foreground flex h-full items-center justify-center text-sm`,children:`Select a worktree from the sidebar.`}),e[0]=t):t=e[0],t}export{i as component};
1
+ import{n as e,t}from"./compiler-runtime-CUwoe8mk.js";var n=t(),r=e();function i(){let e=(0,n.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,r.jsx)(`div`,{className:`text-muted-foreground flex h-full items-center justify-center`,children:`Select a worktree from the sidebar.`}),e[0]=t):t=e[0],t}export{i as component};
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./compiler-runtime-CUwoe8mk.js";import{$o as n,Ks as r,Oa as i,oo as a}from"./button-Bqawukg7.js";import{c as o,f as s,n as c,o as l,p as u,t as d}from"./state-nIOT1NpG.js";import{t as f}from"./agent-DhIB78HL.js";import{t as p}from"./terminal-BDNA0nGZ.js";var m=t(),h=e();function g(){let e=(0,m.c)(16),t=f.useParams(),o=f.useSearch(),s;e[0]===t.worktree?s=e[1]:(s=d(t.worktree),e[0]=t.worktree,e[1]=s);let l=u(s),p=l.value.activeWorktree?.root??``,g;e[2]===p?g=e[3]:(g=c(p),e[2]=p,e[3]=g);let v=u(g);if(!l.value.activeWorktree){let t;return e[4]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,h.jsx)(r,{to:`/`,replace:!0}),e[4]=t):t=e[4],t}let y;if(e[5]!==o||e[6]!==v.value){let t;e[8]===o?t=e[9]:(t=e=>e.uuid===o.agentId,e[8]=o,e[9]=t),y=n(v.value,i(t),a),e[5]=o,e[6]=v.value,e[7]=y}else y=e[7];let b=y;if(!b){let t;return e[10]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,h.jsx)(r,{to:`/`,replace:!0}),e[10]=t):t=e[10],t}let x;return e[11]!==l.value.activeWorktree.root||e[12]!==o.agentId||e[13]!==b.args||e[14]!==b.command?(x=(0,h.jsx)(_,{args:b.args,command:b.command,cwd:l.value.activeWorktree.root,sessionId:o.agentId}),e[11]=l.value.activeWorktree.root,e[12]=o.agentId,e[13]=b.args,e[14]=b.command,e[15]=x):x=e[15],x}function _(e){let t=(0,m.c)(24),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=o.mutation(`terminal.resize`),r={mode:`promise`},t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i=s(n,r),a,c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=o.mutation(`terminal.write`),c={mode:`promise`},t[2]=a,t[3]=c):(a=t[2],c=t[3]);let d=s(a,c),f;t[4]===e?f=t[5]:(f=l(e),t[4]=e,t[5]=f);let g=u(f),_;t[6]!==e.args||t[7]!==e.command||t[8]!==e.cwd||t[9]!==e.sessionId||t[10]!==d?(_=t=>void d({payload:{args:e.args,command:e.command,cwd:e.cwd,data:t,sessionId:e.sessionId}}),t[6]=e.args,t[7]=e.command,t[8]=e.cwd,t[9]=e.sessionId,t[10]=d,t[11]=_):_=t[11];let v;t[12]!==e.args||t[13]!==e.command||t[14]!==e.cwd||t[15]!==e.sessionId||t[16]!==i?(v=t=>void i({payload:{args:e.args,cols:t.cols,command:e.command,cwd:e.cwd,rows:t.rows,sessionId:e.sessionId}}),t[12]=e.args,t[13]=e.command,t[14]=e.cwd,t[15]=e.sessionId,t[16]=i,t[17]=v):v=t[17];let y;return t[18]!==e.sessionId||t[19]!==_||t[20]!==v||t[21]!==g.value.events||t[22]!==g.value.state.state?(y=(0,h.jsx)(`div`,{className:`bg-background h-full min-h-0 min-w-0`,children:(0,h.jsx)(p,{className:`h-full min-h-0 w-full min-w-0 overflow-hidden`,events:g.value.events,onData:_,onResize:v,state:g.value.state.state},e.sessionId)}),t[18]=e.sessionId,t[19]=_,t[20]=v,t[21]=g.value.events,t[22]=g.value.state.state,t[23]=y):y=t[23],y}export{g as component};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/agent-CcHomDRK.js","assets/compiler-runtime-CUwoe8mk.js","assets/button-Bqawukg7.js","assets/state-nIOT1NpG.js","assets/terminal-BDNA0nGZ.js","assets/fallbacks-BUiFDlyX.js","assets/info-NaVIP-PS.js"])))=>i.map(i=>d[i]);
2
+ import{Et as e,R as t,at as n,is as r,it as i,rs as a}from"./button-Bqawukg7.js";var o=r(`/(home)/$worktree/agent`)({component:a(()=>t(()=>import(`./agent-CcHomDRK.js`),__vite__mapDeps([0,1,2,3,4,5,6])),`component`),validateSearch:e(n({agentId:i}))});export{o as t};
@@ -0,0 +1 @@
1
+ import{n as e,o as t,r as n,t as r}from"./compiler-runtime-CUwoe8mk.js";import{C as i,D as a,E as o,I as s,It as c,Ks as l,M as u,N as d,P as f,S as p,T as m,_ as h,a as g,b as _,c as v,d as y,f as b,g as x,h as S,i as C,j as w,k as T,l as E,n as D,os as O,p as k,r as A,s as j,t as M,ts as N,u as P,v as F,w as I,wr as L,x as R,y as z}from"./button-Bqawukg7.js";import{n as ee,r as B}from"./fallbacks-BUiFDlyX.js";import{t as V}from"./triangle-alert-CvzZ7Dfq.js";import{t as H}from"./check-DpJM7J4T.js";import{$ as U,$t as W,A as G,At as K,Bt as te,C as q,Ct as J,Dt as ne,E as re,Et as ie,F as ae,Ft as oe,G as se,Gt as ce,H as le,Ht as ue,I as de,It as fe,J as pe,Jt as me,Kt as he,L as ge,Lt as _e,M as ve,Mt as ye,N as be,Nt as xe,O as Se,Ot as Ce,P as we,Pt as Y,Q as Te,Qt as Ee,R as De,Rt as Oe,S as ke,St as Ae,T as je,Tt as Me,U as Ne,Ut as Pe,V as Fe,Vt as Ie,Wt as Le,Xt as Re,Y as ze,Yt as Be,Z as Ve,Zt as He,_ as Ue,_t as We,an as Ge,at as Ke,b as qe,bt as Je,c as Ye,ct as Xe,dt as Ze,en as Qe,et as $e,ft as et,gt as tt,ht as nt,i as rt,in as it,it as at,j as ot,jt as st,k as X,kt as ct,l as lt,lt as ut,mt as dt,n as ft,nn as pt,nt as mt,o as ht,ot as gt,pt as _t,q as vt,qt as yt,r as bt,rn as xt,rt as St,s as Ct,st as wt,t as Tt,tt as Et,u as Dt,ut as Ot,v as kt,vt as At,w as jt,wt as Mt,x as Nt,xt as Pt,y as Ft,yt as It,zt as Lt}from"./composite-DXpCs7eA.js";import{t as Rt}from"./info-NaVIP-PS.js";import{i as zt,p as Bt,t as Vt}from"./state-nIOT1NpG.js";import{t as Ht}from"./browser-ClOwyJJZ.js";var Ut=N(`circle-alert`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`line`,{x1:`12`,x2:`12`,y1:`8`,y2:`12`,key:`1pkeuh`}],[`line`,{x1:`12`,x2:`12.01`,y1:`16`,y2:`16`,key:`4dfq90`}]]),Wt=N(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),Gt=N(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),Kt=N(`bug`,[[`path`,{d:`M12 20v-9`,key:`1qisl0`}],[`path`,{d:`M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z`,key:`uouzyp`}],[`path`,{d:`M14.12 3.88 16 2`,key:`qol33r`}],[`path`,{d:`M21 21a4 4 0 0 0-3.81-4`,key:`1b0z45`}],[`path`,{d:`M21 5a4 4 0 0 1-3.55 3.97`,key:`5cxbf6`}],[`path`,{d:`M22 13h-4`,key:`1jl80f`}],[`path`,{d:`M3 21a4 4 0 0 1 3.81-4`,key:`1fjd4g`}],[`path`,{d:`M3 5a4 4 0 0 0 3.55 3.97`,key:`1d7oge`}],[`path`,{d:`M6 13H2`,key:`82j7cp`}],[`path`,{d:`m8 2 1.88 1.88`,key:`fmnt4t`}],[`path`,{d:`M9 7.13V6a3 3 0 1 1 6 0v1.13`,key:`1vgav8`}]]),qt=N(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),Jt=N(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),Yt=N(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),Xt=N(`file-clock`,[[`path`,{d:`M16 22h2a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v2.85`,key:`ryk6xj`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M8 14v2.2l1.6 1`,key:`6m4bie`}],[`circle`,{cx:`8`,cy:`16`,r:`6`,key:`10v15b`}]]),Zt=N(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),Qt=N(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Z=t(n()),$t=Z.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:g,validationMode:`onSubmit`,submitAttemptedRef:{current:!1}});function en(){return Z.useContext($t)}function tn(e){let[t,n]=Z.useState({current:e,previous:null});return e!==t.current&&n({current:e,previous:t.current}),t.previous}function nn(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:s=0,reason:c=Ve}=t,l=`rootStore`in e?e.rootStore:e,u=l.context.dataRef,d=Z.useRef(void 0),f=Ke(),p=W(),m=Z.useMemo(()=>{function e(e,t,n,r){let i=le(c,t,n);e&&r===`touch`&&s>0?p.start(s,()=>{l.setOpen(!0,i)}):l.setOpen(e,i)}function t(e,t,n){let r=u.current.openEvent,a=l.select(`domReferenceElement`)!==t;return e&&a||!e||!i?!0:r&&o?!n(r.type):!1}return{onPointerDown(e){d.current=e.pointerType},onMouseDown(n){let i=d.current,o=n.nativeEvent,s=l.select(`open`);if(n.button!==0||r===`click`||fe(i,!0)&&a)return;let c=t(s,n.currentTarget,e=>e===`click`||e===`mousedown`),u=ce(o);if(ue(u)){e(c,o,u,i);return}let p=n.currentTarget;f.request(()=>{e(c,o,p,i)})},onClick(n){if(r===`mousedown-only`)return;let i=d.current;if(r===`mousedown`&&i){d.current=void 0;return}fe(i,!0)&&a||e(t(l.select(`open`),n.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),n.nativeEvent,n.currentTarget,i)},onKeyDown(){d.current=void 0}}},[u,r,a,c,l,o,i,f,p,s]);return Z.useMemo(()=>n?{reference:m}:C,[n,m])}function rn(e,t,n){let{reference:r,floating:i}=e,a=K(t),o=Pt(t),s=J(o),c=ct(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}}switch(Je(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function an(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}=At(t,e),p=Ce(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=xe(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=xe(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 on=50,sn=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:an},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=rn(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<on&&(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}=rn(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},cn=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}=At(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=ct(r),_=K(o),v=ct(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[ne(o)]:Mt(o)),x=p!==`none`;!d&&x&&b.push(...ie(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=Ae(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`&&_!==K(t))||T.every(e=>K(e.placement)===_?e.overflows[0]>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=K(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;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function ln(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function un(e){return oe.some(t=>e[t]>=0)}var dn=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=At(e,t);switch(i){case`referenceHidden`:{let e=ln(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:un(e)}}}case`escaped`:{let e=ln(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:un(e)}}}default:return{}}}}},fn=new Set([`left`,`top`]);async function pn(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=ct(n),s=Je(n),c=K(n)===`y`,l=fn.has(o)?-1:1,u=a&&c?-1:1,d=At(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 mn=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 pn(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}}}}},hn=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}=At(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=K(ct(i)),p=Me(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=tt(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=tt(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},gn=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}=At(e,t),u={x:n,y:r},d=K(i),f=Me(d),p=u[f],m=u[d],h=At(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};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=fn.has(ct(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}}}},_n=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=At(e,t),u=await o.detectOverflow(t,l),d=ct(i),f=Je(i),p=K(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=ye(h-u[g],v),x=ye(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=st(u.left,0),t=st(u.right,0),n=st(u.top,0),r=st(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:st(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:st(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function vn(e){let t=S(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=o(e),a=i?e.offsetWidth:n,s=i?e.offsetHeight:r,c=Y(n)!==a||Y(r)!==s;return c&&(n=a,r=s),{width:n,height:r,$:c}}function yn(e){return m(e)?e:e.contextElement}function bn(e){let t=yn(e);if(!o(t))return We(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=vn(t),s=(a?Y(n.width):n.width)/r,c=(a?Y(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}var xn=We(0);function Sn(e){let t=i(e);return!d()||!t.visualViewport?xn:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Cn(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==i(e)?!1:t}function wn(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let a=e.getBoundingClientRect(),o=yn(e),s=We(1);t&&(r?m(r)&&(s=bn(r)):s=bn(e));let c=Cn(o,n,r)?Sn(o):We(0),l=(a.left+c.x)/s.x,u=(a.top+c.y)/s.y,d=a.width/s.x,f=a.height/s.y;if(o){let e=i(o),t=r&&m(r)?i(r):r,n=e,a=F(n);for(;a&&r&&t!==n;){let e=bn(a),t=a.getBoundingClientRect(),r=S(a),o=t.left+(a.clientLeft+parseFloat(r.paddingLeft))*e.x,s=t.top+(a.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,u*=e.y,d*=e.x,f*=e.y,l+=o,u+=s,n=i(a),a=F(n)}}return xe({width:d,height:f,x:l,y:u})}function Tn(e,t){let n=_(e).scrollLeft;return t?t.left+n:wn(h(e)).left+n}function En(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Tn(e,n),y:n.top+t.scrollTop}}function Dn(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,s=h(r),c=t?u(t.floating):!1;if(r===s||c&&a)return n;let l={scrollLeft:0,scrollTop:0},d=We(1),f=We(0),p=o(r);if((p||!p&&!a)&&((z(r)!==`body`||T(s))&&(l=_(r)),p)){let e=wn(r);d=bn(r),f.x=e.x+r.clientLeft,f.y=e.y+r.clientTop}let m=s&&!p&&!a?En(s,l):We(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-l.scrollLeft*d.x+f.x+m.x,y:n.y*d.y-l.scrollTop*d.y+f.y+m.y}}function On(e){return Array.from(e.getClientRects())}function kn(e){let t=h(e),n=_(e),r=e.ownerDocument.body,i=st(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=st(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+Tn(e),s=-n.scrollTop;return S(r).direction===`rtl`&&(o+=st(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var An=25;function jn(e,t){let n=i(e),r=h(e),a=n.visualViewport,o=r.clientWidth,s=r.clientHeight,c=0,l=0;if(a){o=a.width,s=a.height;let e=d();(!e||e&&t===`fixed`)&&(c=a.offsetLeft,l=a.offsetTop)}let u=Tn(r);if(u<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,a=Math.abs(r.clientWidth-t.clientWidth-i);a<=An&&(o-=a)}else u<=An&&(o+=u);return{width:o,height:s,x:c,y:l}}function Mn(e,t){let n=wn(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=o(e)?bn(e):We(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Nn(e,t,n){let r;if(t===`viewport`)r=jn(e,n);else if(t===`document`)r=kn(h(e));else if(m(t))r=Mn(t,n);else{let n=Sn(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return xe(r)}function Pn(e,t){let n=p(e);return n===t||!m(n)||a(n)?!1:S(n).position===`fixed`||Pn(n,t)}function Fn(e,t){let n=t.get(e);if(n)return n;let r=R(e,[],!1).filter(e=>m(e)&&z(e)!==`body`),i=null,o=S(e).position===`fixed`,s=o?p(e):e;for(;m(s)&&!a(s);){let t=S(s),n=I(s);!n&&t.position===`fixed`&&(i=null),(o?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||T(s)&&!n&&Pn(e,s))?r=r.filter(e=>e!==s):i=t,s=p(s)}return t.set(e,r),r}function In(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?u(t)?[]:Fn(t,this._c):[].concat(n),r],o=Nn(t,a[0],i),s=o.top,c=o.right,l=o.bottom,d=o.left;for(let e=1;e<a.length;e++){let n=Nn(t,a[e],i);s=st(n.top,s),c=ye(n.right,c),l=ye(n.bottom,l),d=st(n.left,d)}return{width:c-d,height:l-s,x:d,y:s}}function Ln(e){let{width:t,height:n}=vn(e);return{width:t,height:n}}function Rn(e,t,n){let r=o(t),i=h(t),a=n===`fixed`,s=wn(e,!0,a,t),c={scrollLeft:0,scrollTop:0},l=We(0);function u(){l.x=Tn(i)}if(r||!r&&!a)if((z(t)!==`body`||T(i))&&(c=_(t)),r){let e=wn(t,!0,a,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else i&&u();a&&!r&&i&&u();let d=i&&!r&&!a?En(i,c):We(0);return{x:s.left+c.scrollLeft-l.x-d.x,y:s.top+c.scrollTop-l.y-d.y,width:s.width,height:s.height}}function zn(e){return S(e).position===`static`}function Bn(e,t){if(!o(e)||S(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return h(e)===n&&(n=n.ownerDocument.body),n}function Vn(e,t){let n=i(e);if(u(e))return n;if(!o(e)){let t=p(e);for(;t&&!a(t);){if(m(t)&&!zn(t))return t;t=p(t)}return n}let r=Bn(e,t);for(;r&&w(r)&&zn(r);)r=Bn(r,t);return r&&a(r)&&zn(r)&&!I(r)?n:r||x(e)||n}var Hn=async function(e){let t=this.getOffsetParent||Vn,n=this.getDimensions,r=await n(e.floating);return{reference:Rn(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Un(e){return S(e).direction===`rtl`}var Wn={convertOffsetParentRelativeRectToViewportRelativeRect:Dn,getDocumentElement:h,getClippingRect:In,getOffsetParent:Vn,getElementRects:Hn,getClientRects:On,getDimensions:Ln,getScale:bn,isElement:m,isRTL:Un};function Gn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Kn(e,t){let n=null,r,i=h(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=It(d),h=It(i.clientWidth-(u+f)),g=It(i.clientHeight-(d+p)),_=It(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:st(0,ye(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Gn(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function qn(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=yn(e),u=i||a?[...l?R(l):[],...t?R(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Kn(l,n):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?wn(e):null;c&&g();function g(){let t=wn(e);h&&!Gn(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 Jn=mn,Yn=hn,Xn=cn,Zn=_n,Qn=dn,$n=gn,er=(e,t,n)=>{let r=new Map,i={platform:Wn,...n},a={...i.platform,_c:r};return sn(e,t,{...i,platform:a})},tr=t(O(),1),nr=typeof document<`u`?Z.useLayoutEffect:function(){};function rr(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(!rr(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)&&!rr(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function ir(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ar(e,t){let n=ir(e);return Math.round(t*n)/n}function or(e){let t=Z.useRef(e);return nr(()=>{t.current=e}),t}function sr(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=Z.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=Z.useState(r);rr(f,r)||p(r);let[m,h]=Z.useState(null),[g,_]=Z.useState(null),v=Z.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=Z.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=Z.useRef(null),C=Z.useRef(null),w=Z.useRef(u),T=c!=null,E=or(c),D=or(i),O=or(l),k=Z.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),er(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!rr(w.current,t)&&(w.current=t,tr.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);nr(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=Z.useRef(!1);nr(()=>(A.current=!0,()=>{A.current=!1}),[]),nr(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=Z.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=Z.useMemo(()=>({reference:b,floating:x}),[b,x]),N=Z.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=ar(M.floating,u.x),r=ar(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...ir(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return Z.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var cr=(e,t)=>{let n=Jn(e);return{name:n.name,fn:n.fn,options:[e,t]}},lr=(e,t)=>{let n=Yn(e);return{name:n.name,fn:n.fn,options:[e,t]}},ur=(e,t)=>({fn:$n(e).fn,options:[e,t]}),dr=(e,t)=>{let n=Xn(e);return{name:n.name,fn:n.fn,options:[e,t]}},fr=(e,t)=>{let n=Zn(e);return{name:n.name,fn:n.fn,options:[e,t]}},pr=(e,t)=>{let n=Qn(e);return{name:n.name,fn:n.fn,options:[e,t]}};function mr(e){let{open:t=!1,onOpenChange:n,elements:r={}}=e,i=pt(),a=qe()!=null,o=k(()=>new Ue({open:t,transitionStatus:void 0,onOpenChange:n,referenceElement:r.reference??null,floatingElement:r.floating??null,triggerElements:new lt,floatingId:i,syncOnly:!1,nested:a})).current;return y(()=>{let e={open:t,floatingId:i};r.reference!==void 0&&(e.referenceElement=r.reference,e.domReferenceElement=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 hr(e={}){let{nodeId:t,externalTree:n}=e,r=mr(e),i=e.rootContext||r,a=i.useState(`referenceElement`),o=i.useState(`floatingElement`),s=i.useState(`domReferenceElement`),c=i.useState(`open`),l=i.useState(`floatingId`),[u,d]=Z.useState(null),[f,p]=Z.useState(void 0),[h,g]=Z.useState(void 0),_=Z.useRef(null),v=Nt(n),b=Z.useMemo(()=>({reference:a,floating:o,domReference:s}),[a,o,s]),x=sr({...e,elements:{...b,...u&&{reference:u}}}),S=m(f)?f:null,C=h===void 0?i.state.floatingElement:h;i.useSyncedValue(`referenceElement`,f??null),i.useSyncedValue(`domReferenceElement`,f===void 0?s:S),i.useSyncedValue(`floatingElement`,C);let w=Z.useCallback(e=>{let t=m(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;d(t),x.refs.setReference(t)},[x.refs]),T=Z.useCallback(e=>{(m(e)||e===null)&&(_.current=e,p(e)),(m(x.refs.reference.current)||x.refs.reference.current===null||e!==null&&!m(e))&&x.refs.setReference(e)},[x.refs,p]),E=Z.useCallback(e=>{g(e),x.refs.setFloating(e)},[x.refs]),D=Z.useMemo(()=>({...x.refs,setReference:T,setFloating:E,setPositionReference:w,domReference:_}),[x.refs,T,E,w]),O=Z.useMemo(()=>({...x.elements,domReference:s}),[x.elements,s]),k=Z.useMemo(()=>({...x,dataRef:i.context.dataRef,open:c,onOpenChange:i.setOpen,events:i.context.events,floatingId:l,refs:D,elements:O,nodeId:t,rootStore:i}),[x,D,O,t,i,c,l]);return y(()=>{s&&(_.current=s)},[s]),y(()=>{i.context.dataRef.current.floatingContext=k;let e=v?.nodesRef.current.find(e=>e.id===t);e&&(e.context=k)}),Z.useMemo(()=>({...x,context:k,refs:D,elements:O,rootStore:i}),[x,D,O,k,i])}var gr=`Escape`;function _r(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function vr(e,t){return _r(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function yr(e,t,n){return _r(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function br(e,t,n){return _r(t,n?e===yt:e===me,e===he)}function xr(e,t,n,r){return t===`both`||t===`horizontal`&&r&&r>1?e===gr:_r(t,n?e===me:e===yt,e===Be)}function Sr(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!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`,parentOrientation:v,cols:x=1,id:S,resetOnPointerLeave:C=!0,externalTree:w}=t,T=`rootStore`in e?e.rootStore:e,E=T.useState(`open`),D=T.useState(`floatingElement`),O=T.useState(`domReferenceElement`),k=T.context.dataRef,A=te(D),j=Ie(O),M=ot(A),N=qe(),P=Nt(w),F=Z.useRef(p),I=Z.useRef(s??-1),L=Z.useRef(null),R=Z.useRef(!0),z=b(e=>{i(I.current===-1?null:I.current,e)}),ee=Z.useRef(z),B=Z.useRef(!!D),V=Z.useRef(E),H=Z.useRef(!1),U=Z.useRef(!1),W=Z.useRef(null),G=ot(g),K=ot(E),q=ot(s),J=ot(C),ne=Ke(),re=Ke(),ie=b(()=>{function e(e){f?P?.events.emit(`virtualfocus`,e):W.current=je(e,{sync:H.current,preventScroll:!0})}let t=n.current[I.current],r=U.current;t&&e(t),(H.current?e=>e():e=>ne.request(e))(()=>{let i=n.current[I.current]||t;i&&(t||e(i),me&&(r||!R.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});y(()=>{k.current.orientation=_},[k,_]),y(()=>{a&&(E&&D?(I.current=s??-1,F.current&&s!=null&&(U.current=!0,z())):B.current&&(I.current=-1,ee.current()))},[a,E,D,s,z]),y(()=>{if(a){if(!E){H.current=!1;return}if(D)if(r==null){if(H.current=!1,q.current!=null)return;if(B.current&&(I.current=-1,ie()),(!V.current||!B.current)&&F.current&&(L.current!=null||F.current===!0&&L.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>re.request(e):queueMicrotask)(t),e+=1):(I.current=L.current==null||yr(L.current,_,d)||u?et(n):Ze(n),L.current=null,z())};t()}}else dt(n.current,r)||(I.current=r,ie(),U.current=!1)}},[a,E,D,r,q,u,n,_,d,z,ie,re]),y(()=>{if(!a||D||!P||f||!B.current)return;let e=P.nodesRef.current,t=e.find(e=>e.id===N)?.context?.elements.floating,n=Pe(Ee(D)),r=e.some(e=>e.context&&Le(e.context.elements.floating,n));t&&!r&&R.current&&t.focus({preventScroll:!0})},[a,D,P,N,f]),y(()=>{ee.current=z,V.current=E,B.current=!!D}),y(()=>{E||(L.current=null,F.current=p)},[E,p]);let ae=r!=null,oe=b(e=>{if(!K.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(I.current!==t||r!==t)&&(I.current=t,z(e))}),ue=b(()=>v??P?.nodesRef.current.find(e=>e.id===N)?.context?.dataRef?.current.orientation),de=b(()=>et(n,G.current)),fe=b(e=>{if(R.current=!1,H.current=!0,e.which===229||!K.current&&e.currentTarget===M.current)return;if(u&&xr(e.key,_,d,x)){vr(e.key,ue())||Lt(e),T.setOpen(!1,le(pe,e.nativeEvent)),o(O)&&(f?P?.events.emit(`virtualfocus`,O):O.focus());return}let t=I.current,r=et(n,g),i=Ze(n,g);if(j||(e.key===`Home`&&(Lt(e),I.current=r,z(e)),e.key===`End`&&(Lt(e),I.current=i,z(e))),x>1){let t=Array.from({length:n.current.length},()=>({width:1,height:1})),a=gt(t,x,!1),o=a.findIndex(e=>e!=null&&!nt(n.current,e,g)),s=a.reduce((e,t,r)=>t!=null&&!nt(n.current,t,g)?r:e,-1),c=a[Ot(a.map(e=>e==null?null:n.current[e]),{event:e,orientation:_,loopFocus:l,rtl:d,cols:x,disabledIndices:ut([...(typeof g==`function`?null:g)||n.current.map((e,t)=>nt(n.current,t,g)?t:void 0),void 0],a),minIndex:o,maxIndex:s,prevIndex:Xe(I.current>i?r:I.current,t,a,x,e.key===`ArrowDown`?`bl`:e.key===(d?`ArrowLeft`:`ArrowRight`)?`tr`:`tl`),stopEvent:!0})];if(c!=null&&(I.current=c,z(e)),_===`both`)return}if(vr(e.key,_)){if(Lt(e),E&&!f&&Pe(e.currentTarget.ownerDocument)===e.currentTarget){I.current=yr(e.key,_,d)?r:i,z(e);return}yr(e.key,_,d)?l?t>=i?c&&t!==n.current.length?I.current=-1:(H.current=!1,I.current=r):I.current=wt(n.current,{startingIndex:t,disabledIndices:g}):I.current=Math.min(i,wt(n.current,{startingIndex:t,disabledIndices:g})):l?t<=r?c&&t!==-1?I.current=n.current.length:(H.current=!1,I.current=i):I.current=wt(n.current,{startingIndex:t,decrement:!0,disabledIndices:g}):I.current=Math.max(r,wt(n.current,{startingIndex:t,decrement:!0,disabledIndices:g})),dt(n.current,I.current)&&(I.current=-1),z(e)}}),me=Z.useMemo(()=>({onFocus(e){H.current=!0,oe(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){H.current=!0,U.current=!1,m&&oe(e)},onPointerLeave(e){if(!K.current||!R.current||e.pointerType===`touch`)return;H.current=!0;let t=e.relatedTarget;if(!(!m||n.current.includes(t))&&J.current&&(W.current?.(),W.current=null,I.current=-1,z(e),!f)){let e=M.current,t=Pe(Ee(e));e&&Le(e,t)&&e.focus({preventScroll:!0})}}}),[oe,K,M,m,n,z,J,f]),he=Z.useMemo(()=>f&&E&&ae&&{"aria-activedescendant":`${S}-${r}`},[f,E,ae,S,r]),ge=Z.useMemo(()=>({"aria-orientation":_===`both`?void 0:_,...j?{}:he,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&E&&!f){let t=ce(e.nativeEvent);if(t&&!Le(M.current,t))return;Lt(e),T.setOpen(!1,le(se,e.nativeEvent)),o(O)&&O.focus();return}fe(e)},onPointerMove(){R.current=!0}}),[he,fe,M,_,j,T,E,f,O]),ve=Z.useMemo(()=>{function e(e){T.setOpen(!0,le(pe,e.nativeEvent,e.currentTarget))}function t(e){p===`auto`&&_e(e.nativeEvent)&&(F.current=!f)}function n(e){F.current=p,p===`auto`&&Oe(e.nativeEvent)&&(F.current=!0)}return{onKeyDown(t){let n=T.select(`open`);R.current=!1;let r=t.key.startsWith(`Arrow`),i=br(t.key,ue(),d),a=vr(t.key,_),o=(u?i:a)||t.key===`Enter`||t.key.trim()===``;if(f&&n)return fe(t);if(!(!n&&!h&&r)){if(o){let e=vr(t.key,ue());L.current=u&&e?null:t.key}if(u){i&&(Lt(t),n?(I.current=de(),z(t)):e(t));return}a&&(q.current!=null&&(I.current=q.current),Lt(t),!n&&h?e(t):fe(t),n&&z(t))}},onFocus(e){T.select(`open`)&&!f&&(I.current=-1,z(e))},onPointerDown:n,onPointerEnter:n,onMouseDown:t,onClick:t}},[fe,p,de,u,z,T,h,_,ue,d,q,f]),ye=Z.useMemo(()=>({...he,...ve}),[he,ve]);return Z.useMemo(()=>a?{reference:ye,floating:ge,item:me,trigger:ve}:{},[a,ye,ge,ve,me])}function Cr(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,onTyping:o,enabled:s=!0,resetMs:c=750,selectedIndex:l=null}=t,u=`rootStore`in e?e.rootStore:e,d=u.useState(`open`),f=W(),p=Z.useRef(``),m=Z.useRef(l??i??-1),h=Z.useRef(null),g=b(e=>{function t(e){let t=r?.current[e];return!t||_t(t)}function s(e,n,r=0){if(e.length===0)return-1;let i=(r%e.length+e.length)%e.length,a=n.toLocaleLowerCase();for(let n=0;n<e.length;n+=1){let r=(i+n)%e.length;if(!(!e[r]?.toLocaleLowerCase().startsWith(a)||!t(r)))return r}return-1}let u=n.current;if(p.current.length>0&&e.key===` `&&(Lt(e),o?.(!0)),p.current.length>0&&p.current[0]!==` `&&s(u,p.current)===-1&&e.key!==` `&&o?.(!1),u==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;d&&e.key!==` `&&(Lt(e),o?.(!0));let g=p.current===``;g&&(m.current=l??i??-1),u.every(e=>e?e[0]?.toLocaleLowerCase()!==e[1]?.toLocaleLowerCase():!0)&&p.current===e.key&&(p.current=``,m.current=h.current),p.current+=e.key,f.start(c,()=>{p.current=``,m.current=h.current,o?.(!1)});let _=((g?l??i??-1:m.current)??0)+1,v=s(u,p.current,_);v===-1?e.key!==` `&&(p.current=``,o?.(!1)):(a?.(v),h.current=v)}),_=b(e=>{let t=e.relatedTarget,n=u.select(`domReferenceElement`),r=u.select(`floatingElement`);Le(n,t)||Le(r,t)||(f.clear(),p.current=``,m.current=h.current,o?.(!1))});y(()=>{!d&&l!==null||(f.clear(),h.current=null,p.current!==``&&(p.current=``))},[d,l,f]),y(()=>{d&&p.current===``&&(m.current=l??i??-1)},[d,l,i]);let v=Z.useMemo(()=>({onKeyDown:g,onBlur:_}),[g,_]);return Z.useMemo(()=>s?{reference:v,floating:v}:{},[s,v])}var wr=Z.createContext(null),Tr=Z.createContext(null);function Er(){let e=Z.useContext(wr);if(e===null)throw Error(E(60));return e}function Dr(){let e=Z.useContext(Tr);if(e===null)throw Error(E(61));return e}var Or=(e,t)=>Object.is(e,t);function kr(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function Ar(e,t,n){return!e||e.length===0?!1:e.some(e=>e===void 0?!1:kr(t,e,n))}function jr(e,t,n){return!e||e.length===0?-1:e.findIndex(e=>e===void 0?!1:kr(e,t,n))}function Mr(e,t,n){return e.filter(e=>!kr(t,e,n))}function Nr(e){if(e==null)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}var Q=e();function Pr(e){return e!=null&&e.length>0&&typeof e[0]==`object`&&e[0]!=null&&`items`in e[0]}function Fr(e){if(!Array.isArray(e))return e!=null&&`null`in e;let t=e;if(Pr(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 Ir(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 Nr(e)}function Lr(e,t){return t&&e!=null?t(e)??``:e&&typeof e==`object`&&`value`in e&&`label`in e?Nr(e.value):Nr(e)}var $={id:G(e=>e.id),labelId:G(e=>e.labelId),modal:G(e=>e.modal),multiple:G(e=>e.multiple),items:G(e=>e.items),itemToStringLabel:G(e=>e.itemToStringLabel),itemToStringValue:G(e=>e.itemToStringValue),isItemEqualToValue:G(e=>e.isItemEqualToValue),value:G(e=>e.value),hasSelectedValue:G(e=>{let{value:t,multiple:n,itemToStringValue:r}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:Lr(t,r)!==``}),hasNullItemLabel:G((e,t)=>t?Fr(e.items):!1),open:G(e=>e.open),mounted:G(e=>e.mounted),forceMount:G(e=>e.forceMount),transitionStatus:G(e=>e.transitionStatus),openMethod:G(e=>e.openMethod),activeIndex:G(e=>e.activeIndex),selectedIndex:G(e=>e.selectedIndex),isActive:G((e,t)=>e.activeIndex===t),isSelected:G((e,t,n)=>{let r=e.isItemEqualToValue,i=e.value;return e.multiple?Array.isArray(i)&&i.some(e=>kr(n,e,r)):e.selectedIndex===t&&e.selectedIndex!==null?!0:kr(n,i,r)}),isSelectedByFocus:G((e,t)=>e.selectedIndex===t),popupProps:G(e=>e.popupProps),triggerProps:G(e=>e.triggerProps),triggerElement:G(e=>e.triggerElement),positionerElement:G(e=>e.positionerElement),listElement:G(e=>e.listElement),popupSide:G(e=>e.popupSide),scrollUpArrowVisible:G(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:G(e=>e.scrollDownArrowVisible),hasScrollArrows:G(e=>e.hasScrollArrows)};function Rr(e,t){let n=Z.useRef(e),r=b(t);y(()=>{n.current!==e&&r(n.current)},[e,r]),y(()=>{n.current=e},[e])}function zr(e){let t=Z.useRef(``),n=Z.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:Z.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function Br(e,t){let{onClick:n,onPointerDown:r}=zr(b((n,r)=>{(typeof e==`function`?e():e)||t(r||(Re?`touch`:``))}));return Z.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function Vr(e){let[t,n]=Z.useState(null),r=Br(e,n);return Rr(e,t=>{t&&!e&&n(null)}),Z.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function Hr(e,t=-(2**53-1),n=2**53-1){return Math.max(t,Math.min(e,n))}function Ur(e,t){return Math.max(0,e-t)}function Wr(e,t){if(t<=0)return 0;let n=Hr(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 Gr(e){let{id:t,value:n,defaultValue:r=null,onValueChange:i,open:a,defaultOpen:o=!1,onOpenChange:s,name:c,form:l,autoComplete:u,disabled:d=!1,readOnly:f=!1,required:p=!1,modal:m=!0,actionsRef:h,inputRef:g,onOpenChangeComplete:_,items:v,multiple:x=!1,itemToStringLabel:S,itemToStringValue:w,isItemEqualToValue:T=Or,highlightItemOnHover:E=!0,children:D}=e,{clearErrors:O}=en(),{setDirty:M,setTouched:N,setFocused:F,shouldValidateOnChange:I,validityData:L,setFilled:R,name:z,disabled:ee,validation:B,validationMode:V}=xt(),H=U({id:t}),W=ee||d,G=z??c,[K,te]=Et({controlled:n,default:x?r??A:r,name:`Select`,state:`value`}),[q,J]=Et({controlled:a,default:o,name:`Select`,state:`open`}),ne=Z.useRef([]),re=Z.useRef([]),ie=Z.useRef(null),ae=Z.useRef(null),oe=Z.useRef(0),se=Z.useRef(null),ce=Z.useRef([]),ue=Z.useRef(!1),de=Z.useRef(!1),fe=Z.useRef(null),pe=Z.useRef(null),me=Z.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0}),he=Z.useRef(!1),{mounted:ge,setMounted:_e,transitionStatus:ye}=mt(q),{openMethod:xe,triggerProps:Ce}=Vr(q),Y=k(()=>new Se({id:H,labelId:void 0,modal:m,multiple:x,itemToStringLabel:S,itemToStringValue:w,isItemEqualToValue:T,value:K,open:q,mounted:ge,transitionStatus:ye,items:v,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,popupSide:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,Te=X(Y,$.activeIndex),Ee=X(Y,$.selectedIndex),De=X(Y,$.triggerElement),Oe=X(Y,$.positionerElement),ke=tn(xe),Ae=xe??ke,je=Z.useMemo(()=>x&&Array.isArray(K)&&K.length===0?``:Lr(K,w),[x,K,w]),Me=Z.useMemo(()=>x&&Array.isArray(K)?K.map(e=>Lr(e,w)):Lr(K,w),[x,K,w]);$e(ot(Y.state.triggerElement),H,K,b(()=>Me));let Ne=Z.useRef(K),Pe=x?Array.isArray(K)&&K.length>0:K!=null;y(()=>{K!==Ne.current&&Y.set(`forceMount`,!0)},[Y,K]),y(()=>{R(Pe)},[Pe,R]),y(function(){let e=ce.current,t;if(x){let n=Array.isArray(K)?K:[];if(n.length===0)t=null;else{let r=n[n.length-1],i=jr(e,r,T);t=i===-1?null:i}}else{let n=jr(e,K,T);t=n===-1?null:n}t===null&&(pe.current=null),!q&&Y.set(`selectedIndex`,t)},[Pe,x,q,K,ce,T,Y,pe]),Rr(K,()=>{O(G),M(K!==L.initialValue),I()?B.commit(K):B.commit(K,!0)});let Fe=b((e,t)=>{if(s?.(e,t),!t.isCanceled&&(J(e),!e&&(t.reason===`focus-out`||t.reason===`outside-press`)&&(N(!0),F(!1),V===`onBlur`&&B.commit(K)),!e&&Y.state.activeIndex!==null)){let e=ne.current[Y.state.activeIndex];queueMicrotask(()=>{e?.setAttribute(`tabindex`,`-1`)})}}),Ie=b(()=>{_e(!1),Y.update({activeIndex:null,openMethod:null}),_?.(!1)});St({enabled:!h,open:q,ref:ie,onComplete(){q||Ie()}}),Z.useImperativeHandle(h,()=>({unmount:Ie}),[Ie]);let Le=b((e,t)=>{i?.(e,t),!t.isCanceled&&te(e)}),Re=b(()=>{let e=Y.state.listElement||ie.current;if(!e)return;let t=Ur(e.scrollHeight,e.clientHeight),n=Wr(e.scrollTop,t),r=n>0,i=n<t;Y.state.scrollUpArrowVisible!==r&&Y.set(`scrollUpArrowVisible`,r),Y.state.scrollDownArrowVisible!==i&&Y.set(`scrollDownArrowVisible`,i)}),Be=mr({open:q,onOpenChange:Fe,elements:{reference:De,floating:Oe}}),Ve=nn(Be,{enabled:!f&&!W,event:`mousedown`}),He=kt(Be),Ue=Sr(Be,{enabled:!f&&!W,listRef:ne,activeIndex:Te,selectedIndex:Ee,disabledIndices:A,onNavigate(e){e===null&&!q||Y.set(`activeIndex`,e)},focusItemOnHover:E}),We=Cr(Be,{enabled:!f&&!W&&(q||!x),listRef:re,activeIndex:Te,selectedIndex:Ee,onMatch(e){q?Y.set(`activeIndex`,e):Le(ce.current[e],le(`none`))},onTyping(e){ue.current=e}}),Ge=Z.useMemo(()=>{let e=P(We.reference,Ue.reference,He.reference,Ve.reference,Ce);return H&&(e.id=H),e},[Ve.reference,We.reference,Ue.reference,He.reference,Ce,H]),Ke=Z.useMemo(()=>P(Dt,We.floating,Ue.floating,He.floating),[We.floating,Ue.floating,He.floating]),qe=Ue.item??C;ve(()=>{Y.update({popupProps:Ke,triggerProps:Ge})}),y(()=>{Y.update({id:H,modal:m,multiple:x,value:K,open:q,mounted:ge,transitionStatus:ye,popupProps:Ke,triggerProps:Ge,items:v,itemToStringLabel:S,itemToStringValue:w,isItemEqualToValue:T,openMethod:Ae})},[Y,H,m,x,K,q,ge,ye,Ke,Ge,v,S,w,T,Ae]);let Je=Z.useMemo(()=>({store:Y,name:G,required:p,disabled:W,readOnly:f,multiple:x,highlightItemOnHover:E,setValue:Le,setOpen:Fe,listRef:ne,popupRef:ie,scrollHandlerRef:ae,handleScrollArrowVisibility:Re,scrollArrowsMountedCountRef:oe,itemProps:qe,events:Be.context.events,valueRef:se,valuesRef:ce,labelsRef:re,typingRef:ue,selectionRef:me,firstItemTextRef:fe,selectedItemTextRef:pe,validation:B,onOpenChangeComplete:_,keyboardActiveRef:de,alignItemWithTriggerActiveRef:he,initialValueRef:Ne}),[Y,G,p,W,f,x,E,Le,Fe,qe,Be.context.events,B,_,Re]),Ye=j(g,B.inputRef),Xe=x&&Array.isArray(K)&&K.length>0,Ze=x?void 0:G,Qe=Z.useMemo(()=>!x||!Array.isArray(K)||!G?null:K.map(e=>{let t=Lr(e,w);return(0,Q.jsx)(`input`,{type:`hidden`,form:l,name:G,value:t},t)}),[x,K,l,G,w]);return(0,Q.jsx)(wr.Provider,{value:Je,children:(0,Q.jsxs)(Tr.Provider,{value:Be,children:[D,(0,Q.jsx)(`input`,{...B.getInputValidationProps({onFocus(){Y.state.triggerElement?.focus({focusVisible:!0})},onChange(e){if(e.nativeEvent.defaultPrevented||W||f){e.preventBaseUIHandler?.();return}let t=e.currentTarget.value,n=le(ze,e.nativeEvent);function r(){if(x)return;let e=ce.current.find(e=>Lr(e,w).toLowerCase()===t.toLowerCase()||Ir(e,S).toLowerCase()===t.toLowerCase());e!=null&&(M(e!==L.initialValue),Le(e,n),I()&&B.commit(e))}Y.set(`forceMount`,!0),queueMicrotask(r)}}),id:H&&Ze==null?`${H}-hidden-input`:void 0,form:l,name:Ze,autoComplete:u,value:je,disabled:W,required:p&&!Xe,readOnly:f,ref:Ye,style:G?we:be,tabIndex:-1,"aria-hidden":!0,suppressHydrationWarning:!0}),Qe]})})}function Kr(e,t){return e??t}function qr(e){let t=e.getBoundingClientRect(),n=i(e),r=n.getComputedStyle(e,`::before`),a=n.getComputedStyle(e,`::after`);if(!(r.content!==`none`||a.content!==`none`))return t;let o=parseFloat(r.width)||0,s=parseFloat(r.height)||0,c=parseFloat(a.width)||0,l=parseFloat(a.height)||0,u=Math.max(t.width,o,c),d=Math.max(t.height,s,l),f=u-t.width,p=d-t.height;return{left:t.left-f/2,right:t.right+f/2,top:t.top-p/2,bottom:t.bottom+p/2}}var Jr=2,Yr=400,Xr={...Ct,...it,popupSide:e=>e?{"data-popup-side":e}:null,value:()=>null},Zr=Z.forwardRef(function(e,t){let{render:n,className:r,id:i,disabled:a=!1,nativeButton:o=!0,style:s,...c}=e,{setTouched:l,setFocused:u,validationMode:d,state:f,disabled:p}=xt(),{labelId:m}=Qe(),{store:h,setOpen:g,selectionRef:_,validation:y,readOnly:x,required:S,alignItemWithTriggerActiveRef:C,disabled:w,keyboardActiveRef:T}=Er(),E=p||w||a,O=X(h,$.open),k=X(h,$.mounted),A=X(h,$.value),M=X(h,$.triggerProps),N=X(h,$.positionerElement),F=X(h,$.listElement),I=X(h,$.popupSide),L=X(h,$.id),R=X(h,$.labelId),z=X(h,$.hasSelectedValue),ee=k&&N?I:null,B=i??L,V=Kr(m,R);U({id:B});let H=ot(N),G=Z.useRef(null),{getButtonProps:K,buttonRef:q}=v({disabled:E,native:o}),J=j(t,G,q,b(e=>{h.set(`triggerElement`,e)})),ne=W(),re=W(),ie=W();Z.useEffect(()=>{if(O)return ie.start(Yr,()=>{_.current.allowUnselectedMouseUp=!0,_.current.allowSelectedMouseUp=!0}),()=>{ie.clear()};_.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1,dragY:0},re.clear()},[O,_,re,ie]);let ae=P(M,{id:B,role:`combobox`,"aria-expanded":O?`true`:`false`,"aria-haspopup":`listbox`,"aria-controls":O?F?.id??te(N)?.id:void 0,"aria-labelledby":V,"aria-readonly":x||void 0,"aria-required":S||void 0,tabIndex:E?-1:0,ref:J,onFocus(e){u(!0),O&&C.current&&g(!1,le(ze,e.nativeEvent)),ne.start(0,()=>{h.set(`forceMount`,!0)})},onBlur(e){Le(N,e.relatedTarget)||(l(!0),u(!1),d===`onBlur`&&y.commit(A))},onPointerMove(){T.current=!1},onKeyDown(){T.current=!0},onMouseDown(e){if(O)return;let t=Ee(e.currentTarget);function n(e){if(!G.current)return;let t=e.target;if(Le(G.current,t)||Le(H.current,t)||t===G.current)return;let n=qr(G.current);e.clientX>=n.left-Jr&&e.clientX<=n.right+Jr&&e.clientY>=n.top-Jr&&e.clientY<=n.bottom+Jr||g(!1,le(Ne,e))}re.start(0,()=>{t.addEventListener(`mouseup`,n,{once:!0})})}},y.getValidationProps,c,K);ae.role=`combobox`;let oe={...f,open:O,disabled:E,value:A,readOnly:x,popupSide:ee,placeholder:!z};return D(`button`,e,{ref:[t,G],state:oe,stateAttributesMapping:Xr,props:ae})}),Qr=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{store:o}=Er();return D(`span`,e,{state:{open:X(o,$.open)},ref:t,props:[{"aria-hidden":!0,children:`▼`},a],stateAttributesMapping:Ye})}),$r=Z.createContext(void 0),ei=Z.forwardRef(function(e,t){let{store:n}=Er(),r=X(n,$.mounted),i=X(n,$.forceMount);return r||i?(0,Q.jsx)($r.Provider,{value:!0,children:(0,Q.jsx)(ke,{ref:t,...e})}):null}),ti=Z.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function ni(){return Z.useContext(ti)}function ri(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=b(i),o=Z.useRef(0),s=k(ai).current,c=k(ii).current,[l,u]=Z.useState(0),d=Z.useRef(l),f=b((e,t)=>{c.set(e,t??null),d.current+=1,u(d.current)}),p=b(e=>{c.delete(e),d.current+=1,u(d.current)}),m=Z.useMemo(()=>{let e=new Map;return Array.from(c.keys()).filter(e=>e.isConnected).sort(oi).forEach((t,n)=>{let r=c.get(t)??{};e.set(t,{...r,index:n})}),e},[c,l]);y(()=>{if(typeof MutationObserver!=`function`||m.size===0)return;let e=new MutationObserver(e=>{let t=new Set,n=e=>t.has(e)?t.delete(e):t.add(e);e.forEach(e=>{e.removedNodes.forEach(n),e.addedNodes.forEach(n)}),t.size===0&&(d.current+=1,u(d.current))});return m.forEach((t,n)=>{n.parentElement&&e.observe(n.parentElement,{childList:!0})}),()=>{e.disconnect()}},[m]),y(()=>{d.current===l&&(n.current.length!==m.size&&(n.current.length=m.size),r&&r.current.length!==m.size&&(r.current.length=m.size),o.current=m.size),a(m)},[a,m,n,r,l]),y(()=>()=>{n.current=[]},[n]),y(()=>()=>{r&&(r.current=[])},[r]);let h=b(e=>(s.add(e),()=>{s.delete(e)}));y(()=>{s.forEach(e=>e(m))},[s,m]);let g=Z.useMemo(()=>({register:f,unregister:p,subscribeMapChange:h,elementsRef:n,labelsRef:r,nextIndexRef:o}),[f,p,h,n,r,o]);return(0,Q.jsx)(ti.Provider,{value:g,children:t})}function ii(){return new Map}function ai(){return new Set}function oi(e,t){let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}var si=Z.createContext(void 0);function ci(){return Z.useContext(si)?.direction??`ltr`}var li=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,offsetParent:d=`real`}=At(e,t)||{};if(l==null)return{};let f=Ce(u),p={x:n,y:r},m=Pt(i),h=J(m),g=await o.getDimensions(l),_=m===`y`,v=_?`top`:`left`,y=_?`bottom`:`right`,b=_?`clientHeight`:`clientWidth`,x=a.reference[h]+a.reference[m]-p[m]-a.floating[h],S=p[m]-a.reference[m],C=d===`real`?await o.getOffsetParent?.(l):s.floating,w=s.floating[b]||a.floating[h];(!w||!await o.isElement?.(C))&&(w=s.floating[b]||a.floating[h]);let T=x/2-S/2,E=w/2-g[h]/2-1,D=Math.min(f[v],E),O=Math.min(f[y],E),k=D,A=w-g[h]-O,j=w/2-g[h]/2+T,M=tt(k,j,A),N=!c.arrow&&Je(i)!=null&&j!==M&&a.reference[h]/2-(j<k?D:O)-g[h]/2<0,P=N?j<k?j-k:j-A:0;return{[m]:p[m]+P,data:{[m]:M,centerOffset:j-M-P,...N&&{alignmentOffset:P}},reset:N}}}),ui=(e,t)=>({...li(e),options:[e,t]}),di={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;return{data:{referenceHidden:(await pr().fn(e)).data?.referenceHidden||a}}}},fi={sideX:`left`,sideY:`top`};function pi(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 mi(e,t,n){let{rects:r,placement:i}=e;return{side:pi(t,ct(i),n),align:Je(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function hi(e){let{anchor:t,positionMethod:n=`absolute`,side:r=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:u=!1,arrowPadding:d=5,disableAnchorTracking:f=!1,inline:p,keepMounted:m=!1,floatingRootContext:h,mounted:g,collisionAvoidance:_,shiftCrossAxis:v=!1,nodeId:x,adaptiveOrigin:S,lazyFlip:C=!1,externalTree:w}=e,[T,E]=Z.useState(null);!g&&T!==null&&E(null);let D=_.side||`flip`,O=_.align||`flip`,k=_.fallbackAxisSide||`end`,A=typeof t==`function`?t:void 0,j=b(A),M=A?j:t,N=ot(t),P=ot(g),F=ci()===`rtl`,I=T||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":F?`left`:`right`,"inline-start":F?`right`:`left`}[r],L=o===`center`?I:`${I}-${o}`,R=l,z=+(r===`bottom`),ee=+(r===`top`),B=+(r===`right`),V=+(r===`left`);typeof R==`number`?R={top:R+z,right:R+V,bottom:R+ee,left:R+B}:R&&={top:(R.top||0)+z,right:(R.right||0)+V,bottom:(R.bottom||0)+ee,left:(R.left||0)+B};let H={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:R},U=Z.useRef(null),W=ot(a),G=ot(s),te=typeof a==`function`?0:a,q=typeof s==`function`?0:s,J=[];p&&J.push(p),J.push(cr(e=>{let t=mi(e,r,F),n=typeof W.current==`function`?W.current(t):W.current,i=typeof G.current==`function`?G.current(t):G.current;return{mainAxis:n,crossAxis:i,alignmentAxis:i}},[te,q,F,r]));let ne=O===`none`&&D!==`shift`,re=!ne&&(u||v||D===`shift`),ie=D===`none`?null:dr({...H,padding:{top:R.top+1,right:R.right+1,bottom:R.bottom+1,left:R.left+1},mainAxis:!v&&D===`flip`,crossAxis:O===`flip`?`alignment`:!1,fallbackAxisSideDirection:k}),ae=ne?null:lr(e=>{let t=Ee(e.elements.floating).documentElement;return{...H,rootBoundary:v?{x:0,y:0,width:t.clientWidth,height:t.clientHeight}:void 0,mainAxis:O!==`none`,crossAxis:re,limiter:u||v?void 0:ur(e=>{if(!U.current)return{};let{width:t,height:n}=U.current.getBoundingClientRect(),r=K(ct(e.placement)),i=r===`y`?t:n,a=r===`y`?R.left+R.right:R.top+R.bottom;return{offset:i/2+a/2}})}},[H,u,v,R,O]);D===`shift`||O===`shift`||o===`center`?J.push(ae,ie):J.push(ie,ae),J.push(fr({...H,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!P.current)return;let a=e.style;a.setProperty(`--available-width`,`${t}px`),a.setProperty(`--available-height`,`${n}px`);let o=i(e).devicePixelRatio||1,{x:s,y:c,width:l,height:u}=r.reference,d=(Math.round((s+l)*o)-Math.round(s*o))/o,f=(Math.round((c+u)*o)-Math.round(c*o))/o;a.setProperty(`--anchor-width`,`${d}px`),a.setProperty(`--anchor-height`,`${f}px`)}}),ui(e=>({element:U.current||Ee(e.elements.floating).createElement(`div`),padding:d,offsetParent:`floating`}),[d]),{name:`transformOrigin`,fn(e){let{elements:t,middlewareData:n,placement:i,rects:o,y:s}=e,c=ct(i),l=K(c),u=U.current,d=n.arrow?.x||0,f=n.arrow?.y||0,p=u?.clientWidth||0,m=u?.clientHeight||0,h=d+p/2,g=f+m/2,_=Math.abs(n.shift?.y||0),v=o.reference.height/2,y=typeof a==`function`?a(mi(e,r,F)):a,b=_>y,x={top:`${h}px calc(100% + ${y}px)`,bottom:`${h}px ${-y}px`,left:`calc(100% + ${y}px) ${g}px`,right:`${-y}px ${g}px`}[c],S=`${h}px ${o.reference.y+v-s}px`;return t.floating.style.setProperty(`--transform-origin`,re&&l===`y`&&b?S:x),{}}},di,S),y(()=>{!g&&h&&h.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[g,h]);let oe=Z.useMemo(()=>({elementResize:!f&&typeof ResizeObserver<`u`,layoutShift:!f&&typeof IntersectionObserver<`u`}),[f]),{refs:se,elements:ce,x:le,y:ue,middlewareData:de,update:fe,placement:pe,context:me,isPositioned:he,floatingStyles:ge}=hr({rootContext:h,open:m?g:void 0,placement:L,middleware:J,strategy:n,whileElementsMounted:m?void 0:(...e)=>qn(...e,oe),nodeId:x,externalTree:w}),{sideX:_e,sideY:ve}=de.adaptiveOrigin||fi,ye=he?n:`fixed`,be=Z.useMemo(()=>{let e=S?{position:ye,[_e]:le,[ve]:ue}:{position:ye,...ge};return he||(e.opacity=0),e},[S,ye,_e,le,ve,ue,ge,he]),xe=Z.useRef(null);y(()=>{if(!g)return;let e=N.current,t=typeof e==`function`?e():e,n=(gi(t)?t.current:t)||null;n!==xe.current&&(se.setPositionReference(n),xe.current=n)},[g,se,M,N]),Z.useEffect(()=>{if(!g)return;let e=N.current;typeof e!=`function`&&gi(e)&&e.current!==xe.current&&(se.setPositionReference(e.current),xe.current=e.current)},[g,se,M,N]),Z.useEffect(()=>{if(m&&g&&ce.domReference&&ce.floating)return qn(ce.domReference,ce.floating,fe,oe)},[m,g,ce,fe,oe]);let Se=ct(pe),Ce=pi(r,Se,F),we=Je(pe)||`center`,Y=!!de.hide?.referenceHidden;y(()=>{C&&g&&he&&E(Se)},[C,g,he,Se]);let Te=Z.useMemo(()=>({position:`absolute`,top:de.arrow?.y,left:de.arrow?.x}),[de.arrow]),De=de.arrow?.centerOffset!==0;return Z.useMemo(()=>({positionerStyles:be,arrowStyles:Te,arrowRef:U,arrowUncentered:De,side:Ce,align:we,physicalSide:Se,anchorHidden:Y,refs:se,context:me,isPositioned:he,update:fe}),[be,Te,U,De,Ce,we,Se,Y,se,me,he,fe])}function gi(e){return e!=null&&`current`in e}var _i=Z.createContext(void 0);function vi(){let e=Z.useContext(_i);if(!e)throw Error(E(59));return e}function yi(e,t){e&&Object.assign(e.style,t)}var bi={position:`relative`,maxHeight:`100%`,overflowX:`hidden`,overflowY:`auto`};function xi(e){return e===`starting`?q:C}function Si(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),D(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},xi(r),i],stateAttributesMapping:ht})}var Ci=20;function wi(e,t,n,r){let[i,a]=Z.useState(!1);y(()=>{if(!e||!t||n==null){a(!1);return}let r=Ee(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-Ci)},[e,t,n]),ft(e&&(!t||i),r)}var Ti={position:`fixed`},Ei=Z.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o=`bottom`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m,alignItemWithTrigger:h=!0,collisionAvoidance:g=jt,style:_,...v}=e,{store:x,listRef:S,labelsRef:C,alignItemWithTriggerActiveRef:w,selectedItemTextRef:T,valuesRef:E,initialValueRef:D,popupRef:O,setValue:k}=Er(),A=Dr(),j=X(x,$.open),M=X(x,$.mounted),N=X(x,$.modal),P=X(x,$.value),F=X(x,$.openMethod),I=X(x,$.positionerElement),L=X(x,$.triggerElement),R=X(x,$.isItemEqualToValue),z=X(x,$.transitionStatus),ee=Z.useRef(null),B=Z.useRef(null),[V,H]=Z.useState(h),U=M&&V&&F!==`touch`;!M&&V!==h&&H(h),y(()=>{M||($.scrollUpArrowVisible(x.state)&&x.set(`scrollUpArrowVisible`,!1),$.scrollDownArrowVisible(x.state)&&x.set(`scrollDownArrowVisible`,!1))},[x,M]),Z.useImperativeHandle(w,()=>U),wi((U||N)&&j,F===`touch`,I,L);let W=hi({anchor:n,floatingRootContext:A,positionMethod:r,mounted:M,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m??U,collisionAvoidance:g,keepMounted:!0}),G=U?`none`:W.side,K=U?Ti:W.positionerStyles,te={open:j,side:G,align:W.align,anchorHidden:W.anchorHidden};y(()=>{x.set(`popupSide`,W.side)},[x,W.side]);let q=Si(e,te,{styles:K,transitionStatus:z,props:v,refs:[t,b(e=>{x.set(`positionerElement`,e)})],hidden:!M,inert:!j}),J=Z.useRef(0),ne=b(e=>{if(e.size===0&&J.current===0||E.current.length===0)return;let t=J.current;if(J.current=e.size,e.size===t)return;let n=le(ze);if(t!==0&&!x.state.multiple&&P!==null&&jr(E.current,P,R)===-1){let e=D.current,t=e!=null&&jr(E.current,e,R)!==-1?e:null;k(t,n),t===null&&(x.set(`selectedIndex`,null),T.current=null)}if(t!==0&&x.state.multiple&&Array.isArray(P)){let e=e=>jr(E.current,e,R)!==-1,t=P.filter(t=>e(t));(t.length!==P.length||t.some(e=>!Ar(P,e,R)))&&(k(t,n),t.length===0&&(x.set(`selectedIndex`,null),T.current=null))}if(j&&U){x.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});let e={height:``};yi(I,e),yi(O.current,e)}}),re=Z.useMemo(()=>({...W,side:G,alignItemWithTriggerActive:U,setControlledAlignItemWithTrigger:H,scrollUpArrowRef:ee,scrollDownArrowRef:B}),[W,G,U,H]);return(0,Q.jsx)(ri,{elementsRef:S,labelsRef:C,onMapChange:ne,children:(0,Q.jsxs)(_i.Provider,{value:re,children:[M&&N&&(0,Q.jsx)(bt,{inert:rt(!j),cutout:L}),q]})})}),Di=`base-ui-disable-scrollbar`,Oi={className:Di,getElement(e){return(0,Q.jsx)(`style`,{nonce:e,href:Di,precedence:`base-ui:low`,children:`.${Di}{scrollbar-width:none}.${Di}::-webkit-scrollbar{display:none}`})}},ki=Z.createContext(void 0);function Ai(e){let t=Z.useContext(ki);if(t===void 0&&!e)throw Error(E(69));return t}var ji=Z.createContext(void 0),Mi={disableStyleElements:!1};function Ni(){return Z.useContext(ji)??Mi}var Pi={...ht,...at},Fi=Z.forwardRef(function(e,t){let{render:n,className:r,style:a,finalFocus:o,...s}=e,{store:c,popupRef:l,onOpenChangeComplete:u,setOpen:d,valueRef:f,firstItemTextRef:p,selectedItemTextRef:m,keyboardActiveRef:h,multiple:g,handleScrollArrowVisibility:_,scrollHandlerRef:v,listRef:x,highlightItemOnHover:S}=Er(),{side:C,align:w,alignItemWithTriggerActive:T,isPositioned:E,setControlledAlignItemWithTrigger:O,scrollDownArrowRef:k,scrollUpArrowRef:A}=vi(),j=Ai(!0)!=null,M=Dr(),N=ci(),{nonce:P,disableStyleElements:F}=Ni(),I=X(c,$.id),L=X(c,$.open),R=X(c,$.mounted),z=X(c,$.popupProps),ee=X(c,$.transitionStatus),B=X(c,$.triggerElement),V=X(c,$.positionerElement),H=X(c,$.listElement),U=Z.useRef(!1),W=Z.useRef(!1),G=Z.useRef({}),K=Ke(),te=b(e=>{if(!V||!l.current||!W.current)return;if(U.current||!T){_();return}let t=V.style.top===`0px`,n=V.style.bottom===`0px`;if(!t&&!n){_();return}let r=Ri(V),i=zi(V.getBoundingClientRect().height,`y`,r),a=Ee(V),o=getComputedStyle(V),s=parseFloat(o.marginTop),c=parseFloat(o.marginBottom),u=Ii(getComputedStyle(l.current)),d=Math.min(a.documentElement.clientHeight-s-c,u),f=e.scrollTop,p=Li(e),m=0,h=null,g=!1,v=!1,y=e=>{V.style.height=`${e}px`},b=(t,n)=>{let r=Hr(t,0,d-i);r>0&&y(i+r),e.scrollTop=n,d-(i+r)<=1&&(U.current=!0),_()},x=t?p-f:f,S=Math.min(i+x,d);if(m=S,x<=1){b(x,t?p:0);return}if(d-S>1?t?v=!0:h=0:(g=!0,n&&f<p&&(h=f-(x-(i+x-d)))),m=Math.ceil(m),m!==0&&y(m),v||h!=null){let t=Li(e),n=v?t:Hr(h,0,t);Math.abs(e.scrollTop-n)>1&&(e.scrollTop=n)}(g||m>=d-1)&&(U.current=!0),_()});Z.useImperativeHandle(v,()=>te,[te]),St({open:L,ref:l,onComplete(){L&&u?.(!0)}});let q={open:L,transitionStatus:ee,side:C,align:w};y(()=>{!V||!l.current||Object.keys(G.current).length||(G.current={top:V.style.top||`0`,left:V.style.left||`0`,right:V.style.right,height:V.style.height,bottom:V.style.bottom,minHeight:V.style.minHeight,maxHeight:V.style.maxHeight,marginTop:V.style.marginTop,marginBottom:V.style.marginBottom})},[l,V]),y(()=>{L||T||(W.current=!1,U.current=!1,yi(V,G.current))},[L,T,V,l]),y(()=>{let e=l.current;if(!L||!B||!V||!e||T&&!E||c.state.transitionStatus===`ending`)return;if(!T){W.current=!0,K.request(_),e.style.removeProperty(`--transform-origin`);return}let t=Hi(e);e.style.removeProperty(`--transform-origin`);try{let t=m.current;t?.isConnected||(t=!$.hasSelectedValue(c.state)&&p.current?.isConnected?p.current:null);let n=f.current,r=getComputedStyle(V),a=getComputedStyle(e),o=Ee(B),s=i(V),l=Ri(B),u=Bi(B.getBoundingClientRect(),l),d=Bi(V.getBoundingClientRect(),l),h=u.height,g=H||e,v=g.scrollHeight,y=parseFloat(a.borderBottomWidth),b=parseFloat(r.marginTop)||10,C=parseFloat(r.marginBottom)||10,w=parseFloat(r.minHeight)||100,T=Ii(a),E=o.documentElement.clientHeight-b-C,D=o.documentElement.clientWidth,k=E-u.bottom+h,A,j=N===`rtl`?u.right-d.width:u.left,M=0;if(t&&n){let e=Bi(n.getBoundingClientRect(),l);A=Bi(t.getBoundingClientRect(),l),j=d.left+(N===`rtl`?e.right-A.right:e.left-A.left);let r=e.top-u.top+e.height/2;M=A.top-d.top+A.height/2-r}let P=k+M+C+y,F=Math.min(E,P),I=E-b-C,L=P-F,R=D-5;V.style.left=`${Hr(j,5,R-d.width)}px`,V.style.height=`${F}px`,V.style.maxHeight=`auto`,V.style.marginTop=`${b}px`,V.style.marginBottom=`${C}px`,e.style.height=`100%`;let z=Li(g),ee=L>=z-1;ee&&(F=Math.min(E,d.height)-(L-z));let K=u.top<20||u.bottom>E-20||Math.ceil(F)+1<Math.min(v,w),te=(s.visualViewport?.scale??1)!==1&&He;if(K||te){W.current=!0,yi(V,G.current),O(!1);return}let q=Math.max(w,F);if(ee){let e=Math.max(0,E-P);V.style.top=d.height>=I?`0`:`${e}px`,V.style.height=`${F}px`,g.scrollTop=Li(g)}else V.style.bottom=`0`,g.scrollTop=L;if(A){let t=d.top,n=d.height,r=A.top+A.height/2,i=Hr(n>0?(r-t)/n*100:50,0,100);e.style.setProperty(`--transform-origin`,`50% ${i}%`)}(q===E||F>=T)&&(U.current=!0),_(),S&&c.state.selectedIndex===null&&c.state.activeIndex===null&&x.current[0]!=null&&c.set(`activeIndex`,0),W.current=!0}finally{t()}},[c,L,V,B,f,p,m,l,_,T,O,K,k,A,H,x,S,N,E]),Z.useEffect(()=>{if(!T||!V||!L)return;let e=i(V);function t(e){d(!1,le(Te,e))}return re(e,`resize`,t)},[d,T,V,L]);let J={...H?{role:`presentation`,"aria-orientation":void 0}:{role:`listbox`,"aria-multiselectable":g||void 0,id:`${I}-list`},onKeyDown(e){h.current=!0,j&&Tt.has(e.key)&&e.stopPropagation()},onMouseMove(){h.current=!1},onScroll(e){H||te(e.currentTarget)},...T&&{style:H?{height:`100%`}:bi}},ne=D(`div`,e,{ref:[t,l],state:q,stateAttributesMapping:Pi,props:[z,J,xi(ee),{className:!H&&T?Oi.className:void 0},s]});return(0,Q.jsxs)(Z.Fragment,{children:[!F&&Oi.getElement(P),(0,Q.jsx)(Ft,{context:M,modal:!1,disabled:!R,returnFocus:o,restoreFocus:!0,children:ne})]})});function Ii(e){let t=e.maxHeight||``;return t.endsWith(`px`)&&parseFloat(t)||1/0}function Li(e){return Ur(e.scrollHeight,e.clientHeight)}function Ri(e){return Wn.getScale(e)}function zi(e,t,n){return e/n[t]}function Bi(e,t){return xe({x:zi(e.x,`x`,t),y:zi(e.y,`y`,t),width:zi(e.width,`x`,t),height:zi(e.height,`y`,t)})}var Vi=[[`transform`,`none`],[`scale`,`1`],[`translate`,`0 0`]];function Hi(e){let{style:t}=e,n={};for(let[e,r]of Vi)n[e]=t.getPropertyValue(e),t.setProperty(e,r,`important`);return()=>{for(let[e]of Vi){let r=n[e];r?t.setProperty(e,r):t.removeProperty(e)}}}var Ui=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,{store:o,scrollHandlerRef:s}=Er(),{alignItemWithTriggerActive:c}=vi(),l=X(o,$.hasScrollArrows),u=X(o,$.openMethod),d=X(o,$.multiple),f={id:`${X(o,$.id)}-list`,role:`listbox`,"aria-multiselectable":d||void 0,onScroll(e){s.current?.(e.currentTarget)},...c&&{style:bi},className:l&&u!==`touch`?Oi.className:void 0};return D(`div`,e,{ref:[t,b(e=>{o.set(`listElement`,e)})],props:[f,a]})}),Wi=function(e){return e[e.None=0]=`None`,e[e.GuessFromOrder=1]=`GuessFromOrder`,e}({});function Gi(e={}){let{label:t,metadata:n,textRef:r,indexGuessBehavior:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,elementsRef:l,labelsRef:u,nextIndexRef:d}=ni(),f=Z.useRef(-1),[p,m]=Z.useState(a??(i===Wi.GuessFromOrder?()=>{if(f.current===-1){let e=d.current;d.current+=1,f.current=e}return f.current}:-1)),h=Z.useRef(null),g=Z.useCallback(e=>{if(h.current=e,p!==-1&&e!==null&&(l.current[p]=e,u)){let n=t!==void 0;u.current[p]=n?t:r?.current?.textContent??e.textContent}},[p,l,u,t,r]);return y(()=>{if(a!=null)return;let e=h.current;if(e)return o(e,n),()=>{s(e)}},[a,o,s,n]),y(()=>{if(a==null)return c(e=>{let t=h.current?e.get(h.current)?.index:null;t!=null&&m(t)})},[a,c,m]),Z.useMemo(()=>({ref:g,index:p}),[p,g])}var Ki=Z.createContext(void 0);function qi(){let e=Z.useContext(Ki);if(!e)throw Error(E(57));return e}var Ji=Z.memo(Z.forwardRef(function(e,t){let{render:n,className:r,style:i,value:a=null,label:o,disabled:s=!1,nativeButton:c=!1,...l}=e,u=Z.useRef(null),d=Gi({label:o,textRef:u,indexGuessBehavior:Wi.GuessFromOrder}),{store:f,itemProps:p,setOpen:m,setValue:h,selectionRef:g,typingRef:_,valuesRef:b,multiple:x,selectedItemTextRef:S}=Er(),C=X(f,$.isActive,d.index),w=X(f,$.isSelected,d.index,a),T=X(f,$.isSelectedByFocus,d.index),E=X(f,$.isItemEqualToValue),O=d.index,k=O!==-1,A=Z.useRef(null);y(()=>{if(!k)return;let e=b.current;return e[O]=a,()=>{delete e[O]}},[k,O,a,b]),y(()=>{if(!k)return;let e=f.state.value,t=e;x&&Array.isArray(e)&&e.length>0&&(t=e[e.length-1]),t!==void 0&&kr(a,t,E)&&(f.set(`selectedIndex`,O),u.current&&(S.current=u.current))},[k,O,x,E,f,a,S]);let j=Z.useRef(null),M=Z.useRef(`mouse`),N=Z.useRef(!1),{getButtonProps:P,buttonRef:F}=v({disabled:s,focusableWhenDisabled:!0,native:c,composite:!0}),I={disabled:s,selected:w,highlighted:C};function L(e){let t=f.state.value;if(x){let n=Array.isArray(t)?t:[];h(w?Mr(n,a,E):[...n,a],le(vt,e))}else h(a,le(vt,e)),m(!1,le(vt,e))}function R(){g.current.dragY=0}let z={role:`option`,"aria-selected":w,tabIndex:C?0:-1,onKeyDown(e){j.current=e.key,f.set(`activeIndex`,O),e.key===` `&&_.current&&e.preventDefault()},onClick(e){let t=e.type===`click`&&M.current!==`touch`,n=e.nativeEvent.pointerType,r=t&&_e(e.nativeEvent)&&(n!==void 0||C),i=t&&!r&&!N.current;N.current=!1,!(e.type===`keydown`&&j.current===null)&&(s||e.type===`keydown`&&j.current===` `&&_.current||i||(j.current=null,L(e.nativeEvent)))},onPointerEnter(e){M.current=e.pointerType},onPointerMove(e){if(e.pointerType===`mouse`&&e.buttons===1){let t=g.current;t.dragY+=e.movementY,t.dragY**2>=64&&(t.allowUnselectedMouseUp=!0)}},onPointerDown(e){M.current=e.pointerType,N.current=!0,R()},onMouseUp(){if(R(),s||M.current===`touch`||N.current)return;let e=!g.current.allowSelectedMouseUp&&w,t=!g.current.allowUnselectedMouseUp&&!w;e||t||(N.current=!0,A.current?.click(),N.current=!1)}},ee=D(`div`,e,{ref:[F,t,d.ref,A],state:I,props:[p,z,l,P]}),B=Z.useMemo(()=>({selected:w,index:O,textRef:u,selectedByFocus:T,hasRegistered:k}),[w,O,u,T,k]);return(0,Q.jsx)(Ki.Provider,{value:B,children:ee})})),Yi=Z.forwardRef(function(e,t){let n=e.keepMounted??!1,{selected:r}=qi();return n||r?(0,Q.jsx)(Xi,{...e,ref:t}):null}),Xi=Z.memo(Z.forwardRef((e,t)=>{let{render:n,className:r,style:i,keepMounted:a,...o}=e,{selected:s}=qi(),c=Z.useRef(null),{transitionStatus:l,setMounted:u}=mt(s),d=D(`span`,e,{ref:[t,c],state:{selected:s,transitionStatus:l},props:[{"aria-hidden":!0,children:`✔️`},o],stateAttributesMapping:at});return St({open:s,ref:c,onComplete(){s||u(!1)}}),d})),Zi=Z.memo(Z.forwardRef(function(e,t){let{index:n,textRef:r,selectedByFocus:i,hasRegistered:a}=qi(),{firstItemTextRef:o,selectedItemTextRef:s}=Er(),{render:c,className:l,style:u,...d}=e;return D(`div`,e,{ref:[Z.useCallback(e=>{e&&(a&&n===0&&(o.current=e),a&&i&&(s.current=e))},[o,s,n,i,a]),t,r],props:d})})),Qi=Z.forwardRef(function(e,t){let{render:n,className:r,style:i,direction:a,keepMounted:o=!1,...s}=e,c=a===`up`,{store:l,popupRef:u,listRef:d,handleScrollArrowVisibility:f,scrollArrowsMountedCountRef:p}=Er(),{side:m,scrollDownArrowRef:h,scrollUpArrowRef:g}=vi(),_=X(l,c?$.scrollUpArrowVisible:$.scrollDownArrowVisible),v=X(l,$.openMethod),b=_&&v!==`touch`,x=W(),S=c?g:h,{transitionStatus:C,setMounted:w}=mt(b);y(()=>(p.current+=1,l.state.hasScrollArrows||l.set(`hasScrollArrows`,!0),()=>{p.current=Math.max(0,p.current-1),p.current===0&&l.state.hasScrollArrows&&l.set(`hasScrollArrows`,!1)}),[l,p]),St({open:b,ref:S,onComplete(){b||w(!1)}});let T=D(`div`,e,{ref:[t,S],state:{direction:a,visible:b,side:m,transitionStatus:C},props:[{"aria-hidden":!0,children:c?`▲`:`▼`,style:{position:`absolute`},onMouseMove(e){if(e.movementX===0&&e.movementY===0||x.isStarted())return;l.set(`activeIndex`,null);function t(){let e=l.state.listElement??u.current;if(!e)return;l.set(`activeIndex`,null),f();let n=Ur(e.scrollHeight,e.clientHeight),r=Wr(e.scrollTop,n),i=r===(c?0:n),a=d.current;if(r!==e.scrollTop&&(e.scrollTop=r),a.length===0&&l.set(c?`scrollUpArrowVisible`:`scrollDownArrowVisible`,!i),i){x.clear();return}if(a.length>0){let t=S.current?.offsetHeight||0;e.scrollTop=$i(a,c,r,e.clientHeight,t,n)}x.start(40,t)}x.start(40,t)},onMouseLeave(){x.clear()}},s]});return b||o?T:null});function $i(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?Wr(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?Wr(l.offsetTop+l.offsetHeight-r+i,a):a}var ea=Z.forwardRef(function(e,t){return(0,Q.jsx)(Qi,{...e,ref:t,direction:`down`})}),ta=Z.forwardRef(function(e,t){return(0,Q.jsx)(Qi,{...e,ref:t,direction:`up`})}),na=r(),ra=Gr;function ia(e){let t=(0,na.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,size:a,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`default`:a,s;t[5]===r?s=t[6]:(s=f(`border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-1.5 rounded-none border bg-transparent py-2 pr-2 pl-2.5 text-xs whitespace-nowrap transition-colors outline-none select-none focus-visible:ring-1 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:ring-1 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 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,r),t[5]=r,t[6]=s);let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Q.jsx)(Qr,{render:(0,Q.jsx)(qt,{className:`text-muted-foreground pointer-events-none size-4`})}),t[7]=c):c=t[7];let l;return t[8]!==n||t[9]!==i||t[10]!==o||t[11]!==s?(l=(0,Q.jsxs)(Zr,{"data-slot":`select-trigger`,"data-size":o,className:s,...i,children:[n,c]}),t[8]=n,t[9]=i,t[10]=o,t[11]=s,t[12]=l):l=t[12],l}function aa(e){let t=(0,na.c)(27),n,r,i,a,o,s,c,l;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8]):({className:r,children:n,side:a,sideOffset:o,align:s,alignOffset:c,alignItemWithTrigger:l,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l);let u=a===void 0?`bottom`:a,d=o===void 0?4:o,p=s===void 0?`center`:s,m=c===void 0?0:c,h=l===void 0?!0:l,g;t[9]===r?g=t[10]:(g=f(`data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-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-[side=inline-start]:slide-in-from-right-2 data-[side=inline-end]:slide-in-from-left-2 bg-popover text-popover-foreground ring-foreground/10 data-closed:animate-out data-open:animate-in 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 shadow-md ring-1 duration-100 data-[align-trigger=true]:animate-none`,r),t[9]=r,t[10]=g);let _;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Q.jsx)(sa,{}),t[11]=_):_=t[11];let v;t[12]===n?v=t[13]:(v=(0,Q.jsx)(Ui,{children:n}),t[12]=n,t[13]=v);let y;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Q.jsx)(ca,{}),t[14]=y):y=t[14];let b;t[15]!==h||t[16]!==i||t[17]!==g||t[18]!==v?(b=(0,Q.jsxs)(Fi,{"data-slot":`select-content`,"data-align-trigger":h,className:g,...i,children:[_,v,y]}),t[15]=h,t[16]=i,t[17]=g,t[18]=v,t[19]=b):b=t[19];let x;return t[20]!==p||t[21]!==h||t[22]!==m||t[23]!==u||t[24]!==d||t[25]!==b?(x=(0,Q.jsx)(ei,{children:(0,Q.jsx)(Ei,{side:u,sideOffset:d,align:p,alignOffset:m,alignItemWithTrigger:h,className:`isolate z-50`,children:b})}),t[20]=p,t[21]=h,t[22]=m,t[23]=u,t[24]=d,t[25]=b,t[26]=x):x=t[26],x}function oa(e){let t=(0,na.c)(13),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=f(`focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground relative flex w-full cursor-default items-center gap-2 rounded-none py-2 pr-8 pl-2 text-xs outline-hidden select-none 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`,r),t[4]=r,t[5]=a);let o;t[6]===n?o=t[7]:(o=(0,Q.jsx)(Zi,{className:`flex flex-1 shrink-0 gap-2 whitespace-nowrap`,children:n}),t[6]=n,t[7]=o);let s;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Q.jsx)(Yi,{render:(0,Q.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex size-4 items-center justify-center`}),children:(0,Q.jsx)(H,{className:`pointer-events-none`})}),t[8]=s):s=t[8];let c;return t[9]!==i||t[10]!==a||t[11]!==o?(c=(0,Q.jsxs)(Ji,{"data-slot":`select-item`,className:a,...i,children:[o,s]}),t[9]=i,t[10]=a,t[11]=o,t[12]=c):c=t[12],c}function sa(e){let t=(0,na.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=f(`bg-popover top-0 z-10 flex w-full cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(Jt,{}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,Q.jsx)(ta,{"data-slot":`select-scroll-up-button`,className:i,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}function ca(e){let t=(0,na.c)(9),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=f(`bg-popover bottom-0 z-10 flex w-full cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-4`,n),t[3]=n,t[4]=i);let a;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Q.jsx)(qt,{}),t[5]=a):a=t[5];let o;return t[6]!==r||t[7]!==i?(o=(0,Q.jsx)(ea,{"data-slot":`select-scroll-down-button`,className:i,...r,children:a}),t[6]=r,t[7]=i,t[8]=o):o=t[8],o}function la(e){return`${window.location.protocol}//${e}.localhost:${window.location.port}`}function ua(e,t){return`${la(e)}${t.startsWith(`/`)?t:`/${t}`}`}function da(e){return e===`error`?`text-destructive`:e===`warn`?`text-chart-2`:e===`info`?`text-chart-1`:e===`debug`?`text-chart-4`:`text-muted-foreground`}function fa(e){let t=(0,na.c)(5);if(e.level===`error`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(Ut,{className:`size-3.5`}),t[0]=e):e=t[0],e}if(e.level===`warn`){let e;return t[1]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(V,{className:`size-3.5`}),t[1]=e):e=t[1],e}if(e.level===`info`){let e;return t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(Rt,{className:`size-3.5`}),t[2]=e):e=t[2],e}if(e.level===`debug`){let e;return t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Q.jsx)(Kt,{className:`size-3.5`}),t[3]=e):e=t[3],e}let n;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Q.jsx)(Ge,{className:`size-2`}),t[4]=n):n=t[4],n}function pa(e){let t=e.toLowerCase();return e.startsWith(`[vite]`)||t.includes(`react scan`)||t.includes(`react-scan`)||t.includes(`react grab`)||t.includes(`react-grab`)}function ma(e){let t=(0,Z.useRef)(null),n=(0,Z.useRef)(0),[r,i]=(0,Z.useState)(()=>e.ports[0]?.toString()??``),[a,o]=(0,Z.useState)(()=>e.ports[0]?ua(e.ports[0].toString(),`/`):``),[l,u]=(0,Z.useState)(0),[d,p]=(0,Z.useState)(`/`),[m,h]=(0,Z.useState)(),[g,_]=(0,Z.useState)(!1),[v,y]=(0,Z.useState)(()=>e.ports.length>0),[b,x]=(0,Z.useState)([]),S=e.ports.filter(e=>e.toString()!==r);(0,Z.useEffect)(()=>{let t=e.ports.includes(Number(r))?r:e.ports[0]?.toString()??``;t!==r&&(i(t),o(t?ua(t,d):``),h(void 0),y(t!==``))},[d,r,e.ports]),(0,Z.useLayoutEffect)(()=>{_(!1);function e(e){if(e.origin===la(r)&&!(typeof e.data!=`object`||e.data===null)){if(e.data.__deslopBrowserFavicon===!0){h(typeof e.data.href==`string`?e.data.href:void 0);return}e.data.__deslopBrowserLog===!0&&(typeof e.data.level!=`string`||typeof e.data.message!=`string`||k(e.data.level,e.data.message))}}return window.addEventListener(`message`,e),_(!0),()=>{window.removeEventListener(`message`,e),_(!1)}},[r]);function C(){if(!r)return;let e=ua(r,L(d)||`/`);x([]),o(e),h(void 0),y(!0)}function w(){x([]),y(!0),u(e=>e+1)}function T(){r&&(x([]),t.current?.contentWindow?.postMessage({__deslopBrowserClear:!0},la(r)))}function E(){a&&window.open(a,`_blank`,`noopener,noreferrer`)}function D(){try{t.current?.contentWindow?.history.back()}catch{}}function O(){try{t.current?.contentWindow?.history.forward()}catch{}}function k(e,t){pa(t)||x(r=>[...r.slice(-199),{id:n.current++,level:e,message:t,time:c()}])}return(0,Q.jsxs)(`div`,{className:f(`bg-background flex h-full min-h-0 w-full min-w-0 flex-col overflow-hidden border`,e.className),children:[(0,Q.jsxs)(`form`,{className:`bg-muted/30 flex shrink-0 items-center gap-1 border-b p-2`,onSubmit:e=>{e.preventDefault(),C()},children:[(0,Q.jsx)(M,{type:`button`,variant:`outline`,size:`icon`,"aria-label":`Back`,onClick:D,children:(0,Q.jsx)(Wt,{className:`size-3.5`})}),(0,Q.jsx)(M,{type:`button`,variant:`outline`,size:`icon`,"aria-label":`Forward`,onClick:O,children:(0,Q.jsx)(Gt,{className:`size-3.5`})}),(0,Q.jsx)(M,{type:`button`,variant:`outline`,size:`icon`,"aria-label":`Reload`,onClick:w,children:(0,Q.jsx)(Zt,{className:`size-3.5`})}),(0,Q.jsx)(`div`,{className:`border-border flex h-8 w-8 shrink-0 items-center justify-center border`,children:m&&(0,Q.jsx)(`img`,{src:m,alt:``,className:`size-4`})}),(0,Q.jsxs)(De,{className:`border-foreground/25 flex-1`,children:[(0,Q.jsxs)(ra,{disabled:S.length===0,value:r,onValueChange:e=>{e!==null&&(i(e),x([]),o(ua(e,L(d)||`/`)),h(void 0),y(!0))},children:[(0,Q.jsx)(ia,{className:`text-muted-foreground w-auto min-w-0 border-0 bg-transparent font-mono dark:bg-transparent [&_svg]:hidden`,children:(0,Q.jsxs)(`span`,{children:[`http://localhost:`,r||`0000`,`/`]})}),S.length>0&&(0,Q.jsx)(aa,{className:`font-mono`,alignItemWithTrigger:!0,children:S.map(e=>(0,Q.jsxs)(oa,{value:e.toString(),className:`font-mono [&>span:last-child]:hidden`,children:[`http://localhost:`,e,`/`]},e))})]}),(0,Q.jsx)(Fe,{value:d.startsWith(`/`)?d.slice(1):d,placeholder:`path?query`,className:`font-mono`,onChange:e=>{p(`/${e.currentTarget.value.replace(/^\/+/,``)}`)}})]}),(0,Q.jsx)(M,{type:`button`,variant:`outline`,size:`icon`,"aria-label":`Open top-level preview`,onClick:E,children:(0,Q.jsx)(Yt,{className:`size-3.5`})}),r&&(0,Q.jsx)(M,{type:`button`,variant:`outline`,size:`icon`,"aria-label":`Clear cookies`,onClick:T,children:(0,Q.jsx)(Qt,{className:`size-3.5`})})]}),(0,Q.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col`,children:[e.ports.length===0?(0,Q.jsx)(ee,{message:`Start a dev server in this worktree terminal to open a browser preview.`}):(0,Q.jsxs)(ge,{orientation:`vertical`,className:`min-h-0 flex-1`,children:[(0,Q.jsx)(de,{defaultSize:`100%`,minSize:`40%`,children:(0,Q.jsxs)(`div`,{className:`relative h-full min-h-0 w-full`,children:[(0,Q.jsx)(`iframe`,{ref:t,title:a,src:g?a:void 0,className:`bg-background h-full min-h-0 w-full border-0`,onLoad:()=>{y(!1)}},l),v&&(0,Q.jsx)(`div`,{className:`bg-background absolute inset-0 flex`,children:(0,Q.jsx)(B,{})})]})}),(0,Q.jsx)(ae,{}),(0,Q.jsx)(de,{collapsible:!0,collapsedSize:0,defaultSize:0,minSize:0,maxSize:`50%`,children:(0,Q.jsx)(`div`,{className:`flex h-full min-h-0 flex-col overflow-hidden`,children:(0,Q.jsx)(`div`,{className:f(`min-h-0 flex-1 overflow-auto font-mono text-xs`,b.length===0&&`hidden`),children:b.map(e=>(0,Q.jsxs)(`div`,{className:`grid grid-cols-[8rem_1rem_minmax(0,1fr)] gap-3 px-2 py-1`,children:[(0,Q.jsx)(`span`,{className:`overflow-hidden whitespace-nowrap select-none`,children:s(e.time)}),(0,Q.jsx)(`span`,{className:f(`flex shrink-0 items-center select-none`,da(e.level)),title:e.level,children:(0,Q.jsx)(fa,{level:e.level})}),(0,Q.jsx)(`span`,{className:`min-w-0 break-words whitespace-pre-wrap select-text`,children:e.message})]},e.id))})})})]}),(0,Q.jsxs)(`div`,{className:`flex h-8 shrink-0 items-center justify-between border-b px-2`,children:[(0,Q.jsxs)(`div`,{className:`flex items-center gap-2 font-mono text-xs`,children:[(0,Q.jsx)(Xt,{className:`size-3.5`}),(0,Q.jsx)(`span`,{children:b.length})]}),(0,Q.jsx)(M,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":`Clear browser logs`,onClick:()=>{x([])},children:(0,Q.jsx)(Qt,{className:`size-3.5`})})]})]})]})}function ha(){let e=(0,na.c)(5),t=Ht.useParams(),n;e[0]===t.worktree?n=e[1]:(n=Vt(t.worktree),e[0]=t.worktree,e[1]=n);let r=Bt(n);if(!r.value.activeWorktree){let t;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Q.jsx)(l,{to:`/`,replace:!0}),e[2]=t):t=e[2],t}let i;return e[3]===r.value.activeWorktree.root?i=e[4]:(i=(0,Q.jsx)(ga,{cwd:r.value.activeWorktree.root}),e[3]=r.value.activeWorktree.root,e[4]=i),i}function ga(e){let t=(0,na.c)(4),n;t[0]===e.cwd?n=t[1]:(n=zt(e.cwd),t[0]=e.cwd,t[1]=n);let r=Bt(n),i;return t[2]===r.value?i=t[3]:(i=(0,Q.jsx)(`div`,{className:`bg-background h-full min-h-0 min-w-0 p-2`,children:(0,Q.jsx)(ma,{className:`h-full min-h-0 w-full min-w-0`,ports:r.value})}),t[2]=r.value,t[3]=i),i}export{ha as component};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/browser-B8fkyBtE.js","assets/compiler-runtime-CUwoe8mk.js","assets/button-Bqawukg7.js","assets/state-nIOT1NpG.js","assets/composite-DXpCs7eA.js","assets/check-DpJM7J4T.js","assets/info-NaVIP-PS.js","assets/fallbacks-BUiFDlyX.js","assets/triangle-alert-CvzZ7Dfq.js"])))=>i.map(i=>d[i]);
2
+ import{R as e,is as t,rs as n}from"./button-Bqawukg7.js";var r=t(`/(home)/$worktree/browser`)({component:n(()=>e(()=>import(`./browser-B8fkyBtE.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8])),`component`)});export{r as t};