@aidotnet/server-win32-x64 0.14.3109 → 0.14.3112

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 (65) hide show
  1. package/bin/astra-server.exe +2 -2
  2. package/bin/wwwroot/assets/ClientsPage-CE9QdKbh.js +11 -0
  3. package/bin/wwwroot/assets/KeyPage-Db9tYWgA.js +1 -0
  4. package/bin/wwwroot/assets/LibraryPage-Djro5zZa.js +2 -0
  5. package/bin/wwwroot/assets/McpPage-BJ7D5vt6.js +9 -0
  6. package/bin/wwwroot/assets/ModelDetailPage-DuyD1_Ei.js +1 -0
  7. package/bin/wwwroot/assets/ModelsPage-Dc1KK7-3.js +1 -0
  8. package/bin/wwwroot/assets/PluginsPage-Dn1IYmlm.js +2 -0
  9. package/bin/wwwroot/assets/PrivacyPage-Dsaaw5Ko.js +1 -0
  10. package/bin/wwwroot/assets/ProviderDetailPage-C5YbB46r.js +3 -0
  11. package/bin/wwwroot/assets/ProvidersPage-BzICHtxh.js +3 -0
  12. package/bin/wwwroot/assets/RoutingGroupsPage-B-7FNn_B.js +3 -0
  13. package/bin/wwwroot/assets/SettingsPage-CCOHxf9s.js +2 -0
  14. package/bin/wwwroot/assets/SkillsPage-BdZSd_hw.js +1 -0
  15. package/bin/wwwroot/assets/SmartRoutingPage-DIkU4HND.js +2 -0
  16. package/bin/wwwroot/assets/TokenDetailPage-DA6q9gbd.js +1 -0
  17. package/bin/wwwroot/assets/TokenPoolEditor-CISTyNzC.js +1 -0
  18. package/bin/wwwroot/assets/TokensPage-CUJXAz7I.js +1 -0
  19. package/bin/wwwroot/assets/ToolsPage-DOHJoH86.js +1 -0
  20. package/bin/wwwroot/assets/TracesPage-f3hY7JcZ.js +8 -0
  21. package/bin/wwwroot/assets/{TrayPanelPage-vhIjA_VX.js → TrayPanelPage-HGV5ST-e.js} +1 -1
  22. package/bin/wwwroot/assets/{TrayPanelView-8u8wEm0F.js → TrayPanelView-BhyK24F_.js} +1 -1
  23. package/bin/wwwroot/assets/TrayTitleSource-DN10ruw2.js +41 -0
  24. package/bin/wwwroot/assets/{checkbox-BtN2W5CV.js → checkbox-CZ-rG7I2.js} +1 -1
  25. package/bin/wwwroot/assets/clientNames-Bskc9G1M.js +1 -0
  26. package/bin/wwwroot/assets/{confirm-morph-9JqeyRgH.js → confirm-morph-Cakq9Lho.js} +1 -1
  27. package/bin/wwwroot/assets/file-up-BZh1Gcck.js +1 -0
  28. package/bin/wwwroot/assets/flame-BPbKoD7V.js +1 -0
  29. package/bin/wwwroot/assets/format-CmXxTS5M.js +15 -0
  30. package/bin/wwwroot/assets/index-BW8keTkg.js +124 -0
  31. package/bin/wwwroot/assets/index-WJKZ_ywJ.css +1 -0
  32. package/bin/wwwroot/assets/layers-lBgMUT4n.js +1 -0
  33. package/bin/wwwroot/assets/library-BUD1zsIb.js +1 -0
  34. package/bin/wwwroot/assets/{radio-cards-DUGIwV2h.js → radio-cards-BTn8kpAx.js} +1 -1
  35. package/bin/wwwroot/assets/{sortable.esm-CwZPJvsk.js → sortable.esm-Cj5-STJU.js} +1 -1
  36. package/bin/wwwroot/assets/use-transform-BcmlojQJ.js +1 -0
  37. package/bin/wwwroot/assets/wrench-gp64nTHm.js +1 -0
  38. package/bin/wwwroot/index.html +8 -5
  39. package/package.json +1 -1
  40. package/bin/wwwroot/assets/ClientsPage-BIJgR0EH.js +0 -9
  41. package/bin/wwwroot/assets/KeyPage-Bt4EjaIj.js +0 -1
  42. package/bin/wwwroot/assets/McpPage-ClcBS0j8.js +0 -9
  43. package/bin/wwwroot/assets/ModelDetailPage-BYiJAIst.js +0 -1
  44. package/bin/wwwroot/assets/ModelsPage-B_SBV2LV.js +0 -1
  45. package/bin/wwwroot/assets/PluginsPage-kVl1yHBW.js +0 -2
  46. package/bin/wwwroot/assets/PrivacyPage-C0B1QFzf.js +0 -1
  47. package/bin/wwwroot/assets/ProviderDetailPage-Diy8W-Bv.js +0 -3
  48. package/bin/wwwroot/assets/ProvidersPage-Do6OV2z0.js +0 -3
  49. package/bin/wwwroot/assets/SettingsPage-bMMSJWp6.js +0 -2
  50. package/bin/wwwroot/assets/SkillsPage-CIx4qJiY.js +0 -1
  51. package/bin/wwwroot/assets/SmartRoutingPage-Df7__xtZ.js +0 -2
  52. package/bin/wwwroot/assets/TokenDetailPage-BU1bs31x.js +0 -1
  53. package/bin/wwwroot/assets/TokenPoolEditor-D1VNvmig.js +0 -1
  54. package/bin/wwwroot/assets/TokensPage-D_9hRnnV.js +0 -1
  55. package/bin/wwwroot/assets/TracesPage-Dptv_tRy.js +0 -8
  56. package/bin/wwwroot/assets/TrayTitleSource-BIYfE2Pd.js +0 -41
  57. package/bin/wwwroot/assets/file-up-mqWdjdlX.js +0 -1
  58. package/bin/wwwroot/assets/flame-DLlSOIlR.js +0 -1
  59. package/bin/wwwroot/assets/format-BRC2u0fq.js +0 -15
  60. package/bin/wwwroot/assets/index-D74BlcEH.css +0 -1
  61. package/bin/wwwroot/assets/index-DiYRVBgW.js +0 -122
  62. package/bin/wwwroot/assets/layers-Dzm_l0k4.js +0 -1
  63. package/bin/wwwroot/assets/library-CQ0z7xCA.js +0 -1
  64. package/bin/wwwroot/assets/use-transform-wNszCSn-.js +0 -1
  65. package/bin/wwwroot/assets/wrench-DVonHu-a.js +0 -1
@@ -1,41 +0,0 @@
1
- import{o as e,r as t}from"./createLucideIcon-7fjTeqBK.js";import{$ as n,$a as r,C as i,D as a,En as o,Fa as s,K as c,La as l,Ma as u,Na as d,Pa as f,Q as p,Qa as m,Ra as h,Sa as g,Ta as _,To as v,X as y,Xa as b,Ya as x,Z as S,Za as C,_o as w,at as T,ct as E,do as D,eo as O,et as k,ht as A,io as j,it as M,ja as N,lo as P,lt as F,no as I,nt as L,oo as R,ot as z,p as ee,q as te,ro as B,rt as V,to as ne,tt as re,u as ie,ut as ae,va as oe,w as se,wo as ce,x as le,xa as ue,xo as de,yo as fe}from"./format-BRC2u0fq.js";import{t as pe}from"./check-DKfsh0bQ.js";import{t as me}from"./chevron-down-CQQqnJvT.js";import{t as he}from"./chevron-up-BNvDpRa-.js";import{t as ge}from"./search-NI5nOaOz.js";import{t as _e}from"./x-AFrW8zH7.js";function ve(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}var ye=class extends D{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,P.batch(()=>{let e=this.#i,t=this.#p(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!de(e,n)});(o||s)&&(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(ve(e,n).forEach(e=>{e.destroy()}),ve(n,e).forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#p(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){let n=new Set;return t.map((r,i)=>{let a=e[i];return r.defaultedQueryOptions.notifyOnChangeProps?a:r.observer.trackResult(a,e=>{n.has(e)||(n.add(e),t.forEach(t=>{t.observer.trackProp(e)}))})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=fe(this.#a,t(e))),this.#a}return e}#f(){return!this.#r?.combine||this.#i.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#p(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new R(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#m(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=this.#t.slice(),this.#t[n]=t,this.#h())}#h(){if(this.hasListeners()){let e=this.#f(),t=this.#a,n=e?t:this.#d(this.#u(this.#t,this.#l),this.#r?.combine);(e||t!==n)&&P.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},H=e(t(),1);function be({queries:e,...t},n){let i=ce(n),a=j(),o=B(),s=t.subscribed!==!1,c=H.useMemo(()=>e.map(e=>{let t=i.defaultQueryOptions(e);return t._optimisticResults=a?`isRestoring`:s?`optimistic`:void 0,t}),[e,i,a,s]);c.forEach(e=>{C(e);let t=i.getQueryCache().get(e.queryHash);O(e,o,t)}),I(o);let[l]=H.useState(()=>new ye(i,c,t)),[u,d,f]=l.getOptimisticResult(c,t.combine),p=!a&&s;H.useSyncExternalStore(H.useCallback(e=>p?l.subscribe(P.batchCalls(e)):w,[l,p]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),H.useEffect(()=>{l.setQueries(c,t)},[c,t,l]);let h=u.some((e,t)=>r(c[t],e))?u.flatMap((e,t)=>{let n=c[t];if(n&&r(n,e)){let e=new R(i,n);return m(n,e,o)}return[]}):[];if(h.length>0)throw Promise.all(h);let g=u.find((e,t)=>{let n=c[t];return n&&ne({result:e,errorResetBoundary:o,throwOnError:n.throwOnError,query:i.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(g)throw g.error;return d(f())}var U={field:`_field_qrf34_1`,control:`_control_qrf34_5`,disabled:`_disabled_qrf34_7`,open:`_open_qrf34_11`,searchIcon:`_searchIcon_qrf34_15`,chevron:`_chevron_qrf34_23`,clear:`_clear_qrf34_27`,hint:`_hint_qrf34_33`,popover:`_popover_qrf34_35`,autoHeight:`_autoHeight_qrf34_37`,listbox:`_listbox_qrf34_39`,option:`_option_qrf34_43`,check:`_check_qrf34_51`,empty:`_empty_qrf34_53`},W=v();function xe({children:e,reduceMotion:t}){let n=(0,H.useRef)(null),[r,i]=(0,H.useState)(`auto`);return(0,H.useEffect)(()=>{let e=n.current;if(!e)return;let t=new ResizeObserver(()=>i(e.offsetHeight));return t.observe(e),()=>t.disconnect()},[]),(0,W.jsx)(u.div,{className:U.autoHeight,initial:!1,animate:{height:r},transition:t?{duration:0}:y.spring.smooth,children:(0,W.jsx)(`div`,{ref:n,children:e})})}var Se=(0,H.forwardRef)(function({label:e,options:t,value:n,defaultValue:r=``,onValueChange:i,description:a,placeholder:o=`Search or select…`,emptyMessage:s=`No matches found`,id:c,className:p,disabled:m,onFocus:h,...g},_){let v=(0,H.useId)(),b=c??v,x=`${b}-listbox`,S=a?`${b}-description`:void 0,C=(0,H.useRef)(null),w=(0,H.useRef)(null),T=(0,H.useRef)({}),E=f(),[D,O]=(0,H.useState)(r),[k,A]=(0,H.useState)(!1),[j,M]=(0,H.useState)(``),[N,P]=(0,H.useState)(-1),F=n??D,I=t.find(e=>e.value===F);(0,H.useImperativeHandle)(_,()=>w.current);let L=(0,H.useRef)(F);(0,H.useEffect)(()=>{if(L.current===F)return;L.current=F;let e=w.current;if(!e||E||F&&k)return;let t=F?d(e,{opacity:[0,1],y:[`0.35em`,`0em`],filter:[`blur(${y.blur.soft}px)`,`blur(0px)`]},{duration:y.duration.standard,ease:[...y.ease.enter]}):d(e,{opacity:[0,1]},{duration:y.duration.fast,ease:[...y.ease.enter]});return()=>t.complete()},[F,E,k]);let R=(0,H.useMemo)(()=>{let e=j.trim().toLocaleLowerCase();return e?t.filter(t=>[t.label,...t.keywords??[]].some(t=>t.toLocaleLowerCase().includes(e))):t},[t,j]),z=R.reduce((e,t,n)=>(t.disabled||e.push(n),e),[]);(0,H.useEffect)(()=>{if(!k)return;let e=N>=0?R[N]:void 0,t=e?T.current[e.value]:null,n=t?.parentElement;if(t&&n){let e=t.offsetTop,r=e+t.offsetHeight;e<n.scrollTop?n.scrollTop=e:r>n.scrollTop+n.clientHeight&&(n.scrollTop=r-n.clientHeight)}},[N,R,k]),(0,H.useEffect)(()=>{let e=e=>{C.current&&!C.current.contains(e.target)&&(A(!1),M(``))};return document.addEventListener(`pointerdown`,e),()=>document.removeEventListener(`pointerdown`,e)},[]);let ee=e=>{e.disabled||(O(e.value),i?.(e.value),M(``),A(!1),w.current?.focus())},te=e=>{e.preventDefault(),O(``),i?.(``),M(``),A(!0),w.current?.focus()},B=()=>{m||(A(!0),M(``),P(-1))},V=e=>{if(!m){if(e.key===`ArrowDown`||e.key===`ArrowUp`){if(e.preventDefault(),!k){B();return}if(!z.length)return;let t=z.indexOf(N),n=e.key===`ArrowDown`?(t+1)%z.length:(t-1+z.length)%z.length;P(z[n]);return}if(e.key===`Enter`&&k&&N>=0){e.preventDefault();let t=R[N];t&&ee(t);return}if(e.key===`Escape`&&k){e.preventDefault(),A(!1),M(``);return}}},ne=k?j:I?.label??``,re=N>=0?R[N]:void 0;return(0,W.jsxs)(`div`,{ref:C,className:U.field,children:[(0,W.jsx)(`label`,{htmlFor:b,children:e}),(0,W.jsxs)(`div`,{className:[U.control,k?U.open:``,m?U.disabled:``,p??``].filter(Boolean).join(` `),children:[(0,W.jsx)(ge,{className:U.searchIcon,size:16,strokeWidth:1.75,"aria-hidden":`true`}),(0,W.jsx)(`input`,{...g,ref:w,id:b,type:`text`,role:`combobox`,value:ne,placeholder:I?.label??o,disabled:m,"aria-describedby":S,"aria-expanded":k,"aria-controls":k?x:void 0,"aria-autocomplete":`list`,"aria-activedescendant":k&&re?`${b}-option-${re.value}`:void 0,onFocus:e=>{h?.(e),B()},onClick:B,onChange:e=>{M(e.target.value),A(!0),P(-1)},onKeyDown:V}),(0,W.jsx)(l,{initial:!1,children:I&&!m&&(0,W.jsx)(u.button,{type:`button`,className:U.clear,"aria-label":`Clear selection`,onMouseDown:e=>e.preventDefault(),onClick:te,initial:E?{opacity:0}:{opacity:0,scale:.6,filter:`blur(${y.blur.subtle}px)`},animate:{opacity:1,scale:1,filter:`blur(0px)`,transition:E?{duration:y.duration.instant}:{...y.spring.snappy,opacity:{duration:y.duration.fast}}},exit:{opacity:0,...E?{}:{scale:.6,filter:`blur(${y.blur.subtle}px)`},transition:{duration:y.duration.instant,ease:[...y.ease.standard]}},whileTap:{scale:E?1:.96,transition:{duration:y.duration.instant,ease:[...y.ease.standard]}},children:(0,W.jsx)(_e,{size:16,strokeWidth:1.75,"aria-hidden":`true`})})}),(0,W.jsx)(me,{className:U.chevron,size:16,strokeWidth:1.75,"aria-hidden":`true`})]}),a&&(0,W.jsx)(`span`,{id:S,className:U.hint,children:a}),(0,W.jsx)(l,{initial:!1,children:k&&(0,W.jsx)(u.div,{className:U.popover,initial:E?{opacity:0}:{opacity:0,y:-6,scale:.97},animate:{opacity:1,y:0,scale:1,transition:E?{duration:y.duration.instant}:{...y.spring.snappy,opacity:{duration:y.duration.fast,ease:[...y.ease.enter]}}},exit:{opacity:0,...E?{}:{y:-4,scale:.98},transition:{duration:y.duration.instant,ease:[...y.ease.standard]}},role:`presentation`,children:(0,W.jsx)(xe,{reduceMotion:E,children:(0,W.jsx)(`div`,{id:x,className:U.listbox,role:`listbox`,"aria-label":`${e} options`,children:R.length?R.map((e,t)=>(0,W.jsxs)(`div`,{ref:t=>{T.current[e.value]=t},id:`${b}-option-${e.value}`,className:U.option,"data-active":t===N?`true`:void 0,"data-disabled":e.disabled?`true`:void 0,role:`option`,"aria-selected":e.value===F,"aria-disabled":e.disabled||void 0,onMouseDown:e=>e.preventDefault(),onMouseEnter:()=>!e.disabled&&P(t),onClick:()=>ee(e),children:[(0,W.jsx)(`span`,{children:e.label}),e.value===F&&(0,W.jsx)(pe,{className:U.check,size:16,strokeWidth:1.75,"aria-hidden":`true`})]},e.value)):(0,W.jsx)(u.div,{className:U.empty,role:`status`,initial:!E&&{opacity:0,y:4,filter:`blur(${y.blur.soft}px)`},animate:{opacity:1,y:0,filter:`blur(0px)`},transition:{duration:y.duration.standard,ease:[...y.ease.enter]},children:s})})})})})]})});Se.displayName=`Combobox`;var Ce=Object.defineProperty,we=(e,t)=>Ce(e,`name`,{value:t,configurable:!0});function G(e){let t=H.useRef(e);return H.useEffect(()=>{t.current=e}),H.useMemo(()=>((...e)=>t.current?.(...e)),[])}we(G,`useCallbackRef`);var Te=Object.defineProperty,K=(e,t)=>Te(e,`name`,{value:t,configurable:!0}),Ee=`dismissableLayer.update`,De=`dismissableLayer.pointerDownOutside`,Oe=`dismissableLayer.focusOutside`,ke,Ae=H.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),je=H.forwardRef(K(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=H.useContext(Ae),[d,f]=H.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=H.useState({}),h=E(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=_?g.indexOf(_):-1,y=d?g.indexOf(d):-1,b=u.layersWithOutsidePointerEventsDisabled.size>0,x=y>=v,S=H.useRef(!1),C=Pe(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:S,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:H.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return x&&!t},[u.branches,x])}),w=Fe(e=>{if(r&&S.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),T=d?y===g.length-1:!1,D=G(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return H.useEffect(()=>{if(T)return p.addEventListener(`keydown`,D,{capture:!0}),()=>p.removeEventListener(`keydown`,D,{capture:!0})},[p,T,D]),H.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(ke=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Ie(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=ke))}},[d,p,n,u]),H.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Ie())},[d,u]),H.useEffect(()=>{let e=K(()=>m({}),`handleUpdate`);return document.addEventListener(Ee,e),()=>document.removeEventListener(Ee,e)},[]),(0,W.jsx)(k.div,{...l,ref:h,style:{pointerEvents:b?x?`auto`:`none`:void 0,...e.style},onFocusCapture:M(e.onFocusCapture,w.onFocusCapture),onBlurCapture:M(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:M(e.onPointerDownCapture,C.onPointerDownCapture)})},`DismissableLayer`));function Me(){let e=H.useContext(Ae),[t,n]=H.useState(null);return H.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}K(Me,`useDismissableLayerSurface`);var Ne=K(()=>!0,`IS_TRUE`);function Pe(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=Ne}=t,s=G(e),c=H.useRef(!1),l=H.useRef(!1),u=H.useRef(new Map),d=H.useRef(()=>{});return H.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}K(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}K(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}K(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}K(p,`handleInteractionBubble`);let m=K(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||Le(De,s,p,{discrete:!0})};if(K(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:K(()=>c.current=!0,`onPointerDownCapture`)}}K(Pe,`usePointerDownOutside`);function Fe(e,t=globalThis?.document){let n=G(e),r=H.useRef(!1);return H.useEffect(()=>{let e=K(e=>{e.target&&!r.current&&Le(Oe,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:K(()=>r.current=!0,`onFocusCapture`),onBlurCapture:K(()=>r.current=!1,`onBlurCapture`)}}K(Fe,`useFocusOutside`);function Ie(){let e=new CustomEvent(Ee);document.dispatchEvent(e)}K(Ie,`dispatchUpdate`);function Le(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?re(i,a):i.dispatchEvent(a)}K(Le,`handleAndDispatchCustomEvent`);var Re=Object.defineProperty,q=(e,t)=>Re(e,`name`,{value:t,configurable:!0}),ze=`focusScope.autoFocusOnMount`,Be=`focusScope.autoFocusOnUnmount`,Ve={bubbles:!1,cancelable:!0},He=H.forwardRef(q(function(e,t){let{loop:n=!1,trapped:r=!1,branches:i,onMountAutoFocus:a,onUnmountAutoFocus:o,...s}=e,[c,l]=H.useState(null),u=G(a),d=G(o),f=H.useRef(null),p=E(t,l),m=H.useRef(i);H.useEffect(()=>{m.current=i});let h=H.useCallback(e=>e?c?.contains(e)?!0:!!m.current?.some(t=>t.contains(e)):!1,[c]),g=H.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;H.useEffect(()=>{if(r){let e=function(e){if(g.paused||!c)return;let t=e.target;h(t)?f.current=t:$e(f.current,{select:!0})},t=function(e){if(g.paused||!c)return;let t=e.relatedTarget;t!==null&&(h(t)||$e(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&$e(c)};q(e,`handleFocusIn`),q(t,`handleFocusOut`),q(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,c,g.paused,h]),H.useEffect(()=>{if(c){et.add(g);let e=document.activeElement;if(!c.contains(e)){let t=new CustomEvent(ze,Ve);c.addEventListener(ze,u),c.dispatchEvent(t),t.defaultPrevented||(qe(rt(Ye(c)),{select:!0}),document.activeElement===e&&$e(c))}return()=>{c.removeEventListener(ze,u),setTimeout(()=>{let t=new CustomEvent(Be,Ve);c.addEventListener(Be,d),c.dispatchEvent(t),t.defaultPrevented||$e(e??document.body,{select:!0}),c.removeEventListener(Be,d),et.remove(g)},0)}}},[c,u,d,g]);let _=H.useCallback(e=>{if(!n&&!r||g.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=Je(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&$e(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&$e(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,g.paused]);return(0,W.jsx)(k.div,{tabIndex:-1,...s,ref:p,onKeyDown:_})},`FocusScope`)),Ue=H.createContext(null);function We({registry:e,children:t}){return e?(0,W.jsx)(Ue.Provider,{value:e,children:t}):t}q(We,`FocusScopeBranchProvider`);function Ge(){let[e,t]=H.useState([]);return{nodes:e,registry:H.useMemo(()=>({add:q(e=>t(t=>t.includes(e)?t:[...t,e]),`add`),remove:q(e=>t(t=>t.filter(t=>t!==e)),`remove`)}),[])}}q(Ge,`useFocusScopeBranchRegistry`);function Ke(e){let t=H.useContext(Ue);H.useEffect(()=>{if(e&&t)return t.add(e),()=>t.remove(e)},[e,t])}q(Ke,`useFocusScopeBranch`);function qe(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if($e(r,{select:t}),document.activeElement!==n)return}q(qe,`focusFirst`);function Je(e){let t=Ye(e);return[Xe(t,e),Xe(t.reverse(),e)]}q(Je,`getTabbableEdges`);function Ye(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:q(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}q(Ye,`getTabbableCandidates`);function Xe(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Ze(r,{upTo:t})))return r}q(Xe,`findVisible`);function Ze(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}q(Ze,`isHidden`);function Qe(e){return e instanceof HTMLInputElement&&`select`in e}q(Qe,`isSelectableInput`);function $e(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Qe(e)&&t&&e.select()}}q($e,`focus`);var et=tt();function tt(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=nt(e,t),e.unshift(t)},remove(t){e=nt(e,t),e[0]?.resume()}}}q(tt,`createFocusScopesStack`);function nt(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}q(nt,`arrayRemove`);function rt(e){return e.filter(e=>e.tagName!==`A`)}q(rt,`removeLinks`);var it=e(N(),1),at=Object.defineProperty,ot=H.forwardRef(((e,t)=>at(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=H.useState(!1);V(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?it.createPortal((0,W.jsx)(k.div,{...r,ref:t}),o):null},`Portal`)),st=Object.defineProperty,ct=(e,t)=>st(e,`name`,{value:t,configurable:!0}),lt=0,ut=null;function dt(e){return ft(),e.children}ct(dt,`FocusGuards`);function ft(){H.useEffect(()=>{ut||={start:pt(),end:pt()};let{start:e,end:t}=ut;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),lt++,()=>{lt===1&&(ut?.start.remove(),ut?.end.remove(),ut=null),lt=Math.max(0,lt-1)}},[])}ct(ft,`useFocusGuards`);function pt(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}ct(pt,`createFocusGuard`);var mt=function(){return mt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},mt.apply(this,arguments)};function ht(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function gt(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var _t=`right-scroll-bar-position`,vt=`width-before-scroll-bar`,yt=`with-scroll-bars-hidden`,bt=`--removed-body-scroll-bar-size`;function xt(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function St(e,t){var n=(0,H.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var Ct=typeof window<`u`?H.useLayoutEffect:H.useEffect,wt=new WeakMap;function Tt(e,t){var n=St(t||null,function(t){return e.forEach(function(e){return xt(e,t)})});return Ct(function(){var t=wt.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||xt(e,null)}),i.forEach(function(e){r.has(e)||xt(e,a)})}wt.set(n,e)},[e]),n}function Et(e){return e}function Dt(e,t){t===void 0&&(t=Et);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Ot(e){e===void 0&&(e={});var t=Dt(null);return t.options=mt({async:!0,ssr:!1},e),t}var kt=function(e){var t=e.sideCar,n=ht(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return H.createElement(r,mt({},n))};kt.isSideCarExport=!0;function At(e,t){return e.useMedium(t),kt}var jt=Ot(),Mt=function(){},Nt=H.forwardRef(function(e,t){var n=H.useRef(null),r=H.useState({onScrollCapture:Mt,onWheelCapture:Mt,onTouchMoveCapture:Mt}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=ht(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Tt([n,t]),C=mt(mt({},b),i);return H.createElement(H.Fragment,null,u&&H.createElement(x,{sideCar:jt,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?H.cloneElement(H.Children.only(s),mt(mt({},C),{ref:S})):H.createElement(v,mt({},C,{className:c,ref:S}),s))});Nt.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Nt.classNames={fullWidth:vt,zeroRight:_t};var Pt=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Ft(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Pt();return t&&e.setAttribute(`nonce`,t),e}function It(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Lt(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var Rt=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Ft())&&(It(t,n),Lt(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},zt=function(){var e=Rt();return function(t,n){H.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Bt=function(){var e=zt();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},Vt={left:0,top:0,right:0,gap:0},Ht=function(e){return parseInt(e||``,10)||0},Ut=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Ht(n),Ht(r),Ht(i)]},Wt=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return Vt;var t=Ut(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Gt=Bt(),Kt=`data-scroll-locked`,qt=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
2
- .${yt} {
3
- overflow: hidden ${r};
4
- padding-right: ${s}px ${r};
5
- }
6
- body[${Kt}] {
7
- overflow: hidden ${r};
8
- overscroll-behavior: contain;
9
- ${[t&&`position: relative ${r};`,n===`margin`&&`
10
- padding-left: ${i}px;
11
- padding-top: ${a}px;
12
- padding-right: ${o}px;
13
- margin-left:0;
14
- margin-top:0;
15
- margin-right: ${s}px ${r};
16
- `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
17
- }
18
-
19
- .${_t} {
20
- right: ${s}px ${r};
21
- }
22
-
23
- .${vt} {
24
- margin-right: ${s}px ${r};
25
- }
26
-
27
- .${_t} .${_t} {
28
- right: 0 ${r};
29
- }
30
-
31
- .${vt} .${vt} {
32
- margin-right: 0 ${r};
33
- }
34
-
35
- body[${Kt}] {
36
- ${bt}: ${s}px;
37
- }
38
- `},Jt=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},Yt=function(){H.useEffect(function(){return document.body.setAttribute(Kt,(Jt()+1).toString()),function(){var e=Jt()-1;e<=0?document.body.removeAttribute(Kt):document.body.setAttribute(Kt,e.toString())}},[])},Xt=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;Yt();var a=H.useMemo(function(){return Wt(i)},[i]);return H.createElement(Gt,{styles:qt(a,!t,i,n?``:`!important`)})},Zt=!1;if(typeof window<`u`)try{var Qt=Object.defineProperty({},"passive",{get:function(){return Zt=!0,!0}});window.addEventListener(`test`,Qt,Qt),window.removeEventListener(`test`,Qt,Qt)}catch{Zt=!1}var $t=Zt?{passive:!1}:!1,en=function(e){return e.tagName===`TEXTAREA`},tn=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!en(e)&&n[t]===`visible`)},nn=function(e){return tn(e,`overflowY`)},rn=function(e){return tn(e,`overflowX`)},an=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),cn(e,r)){var i=ln(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},on=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},sn=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},cn=function(e,t){return e===`v`?nn(t):rn(t)},ln=function(e,t){return e===`v`?on(t):sn(t)},un=function(e,t){return e===`h`&&t===`rtl`?-1:1},dn=function(e,t,n,r,i){var a=un(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=ln(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&cn(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},fn=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},pn=function(e){return[e.deltaX,e.deltaY]},mn=function(e){return e&&`current`in e?e.current:e},hn=function(e,t){return e[0]===t[0]&&e[1]===t[1]},gn=function(e){return`
39
- .block-interactivity-${e} {pointer-events: none;}
40
- .allow-interactivity-${e} {pointer-events: all;}
41
- `},_n=0,vn=[];function yn(e){var t=H.useRef([]),n=H.useRef([0,0]),r=H.useRef(),i=H.useState(_n++)[0],a=H.useState(Bt)[0],o=H.useRef(e);H.useEffect(function(){o.current=e},[e]),H.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=gt([e.lockRef.current],(e.shards||[]).map(mn),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=H.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=fn(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=an(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=an(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return dn(h,t,e,h===`h`?s:c,!0)},[]),c=H.useCallback(function(e){var n=e;if(vn.length&&vn[vn.length-1]===a){var r=`deltaY`in n?pn(n):fn(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&hn(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(mn).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=H.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:bn(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=H.useCallback(function(e){n.current=fn(e),r.current=void 0},[]),d=H.useCallback(function(t){l(t.type,pn(t),t.target,s(t,e.lockRef.current))},[]),f=H.useCallback(function(t){l(t.type,fn(t),t.target,s(t,e.lockRef.current))},[]);H.useEffect(function(){return vn.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,$t),document.addEventListener(`touchmove`,c,$t),document.addEventListener(`touchstart`,u,$t),function(){vn=vn.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,$t),document.removeEventListener(`touchmove`,c,$t),document.removeEventListener(`touchstart`,u,$t)}},[]);var p=e.removeScrollBar,m=e.inert;return H.createElement(H.Fragment,null,m?H.createElement(a,{styles:gn(i)}):null,p?H.createElement(Xt,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function bn(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var xn=At(jt,yn),Sn=H.forwardRef(function(e,t){return H.createElement(Nt,mt({},e,{ref:t,sideCar:xn}))});Sn.classNames=Nt.classNames;var Cn=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},wn=new WeakMap,Tn=new WeakMap,En={},Dn=0,On=function(e){return e&&(e.host||On(e.parentNode))},kn=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=On(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},An=function(e,t,n,r){var i=kn(t,Array.isArray(e)?e:[e]);En[n]||(En[n]=new WeakMap);var a=En[n],o=[],s=new Set,c=new Set(i),l=function(e){e&&!s.has(e)&&(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){e&&!c.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(wn.get(e)||0)+1,l=(a.get(e)||0)+1;wn.set(e,c),a.set(e,l),o.push(e),c===1&&i&&Tn.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),Dn++,function(){o.forEach(function(e){var t=wn.get(e)-1,i=a.get(e)-1;wn.set(e,t),a.set(e,i),t||(Tn.has(e)||e.removeAttribute(r),Tn.delete(e)),i||e.removeAttribute(n)}),Dn--,Dn||(wn=new WeakMap,wn=new WeakMap,Tn=new WeakMap,En={})}},jn=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Cn(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),An(r,i,n,`aria-hidden`)):function(){return null}},Mn=Object.defineProperty,J=(e,t)=>Mn(e,`name`,{value:t,configurable:!0}),Nn=`Dialog`,[Pn,Fn]=F(Nn),[In,Ln]=Pn(Nn),Rn=J(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=H.useRef(null),c=H.useRef(null),{nodes:l,registry:u}=Ge(),[d,f]=L({prop:r,defaultProp:i??!1,onChange:a,caller:Nn}),[m,h]=H.useState(0),[g,_]=H.useState(0);return(0,W.jsx)(In,{scope:t,triggerRef:s,contentRef:c,contentId:p(),titleId:p(),descriptionId:p(),titlePresent:m>0,descriptionPresent:g>0,setTitleCount:h,setDescriptionCount:_,open:d,onOpenChange:f,onOpenToggle:H.useCallback(()=>f(e=>!e),[f]),modal:o,branchNodes:l,branchRegistry:u,children:n})},`Dialog`),zn=`DialogPortal`,[Bn,Vn]=Pn(zn,{forceMount:void 0}),Hn=J(e=>{let{__scopeDialog:t,forceMount:r,children:i,container:a}=e,o=Ln(zn,t);return(0,W.jsx)(Bn,{scope:t,forceMount:r,children:H.Children.map(i,e=>(0,W.jsx)(n,{present:r||o.open,children:(0,W.jsx)(ot,{asChild:!0,container:a,children:e})}))})},`DialogPortal`),Un=`DialogOverlay`,Wn=H.forwardRef(J(function(e,t){let r=Vn(Un,e.__scopeDialog),{forceMount:i=r.forceMount,...a}=e,o=Ln(Un,e.__scopeDialog);return o.modal?(0,W.jsx)(n,{present:i||o.open,children:(0,W.jsx)(Kn,{...a,ref:t})}):null},`DialogOverlay`)),Gn=z(`DialogOverlay.RemoveScroll`),Kn=H.forwardRef(J(function(e,t){let{__scopeDialog:n,...r}=e,i=Ln(Un,n),a=Me(),o=E(t,a);return(0,W.jsx)(Sn,{as:Gn,allowPinchZoom:!0,shards:H.useMemo(()=>[i.contentRef,...i.branchNodes.map(e=>({current:e}))],[i.contentRef,i.branchNodes]),children:(0,W.jsx)(k.div,{"data-state":rr(i.open),...r,ref:o,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),qn=`DialogContent`,Jn=H.forwardRef(J(function(e,t){let r=Vn(qn,e.__scopeDialog),{forceMount:i=r.forceMount,...a}=e,o=Ln(qn,e.__scopeDialog);return(0,W.jsx)(n,{present:i||o.open,children:o.modal?(0,W.jsx)(Yn,{...a,ref:t}):(0,W.jsx)(Xn,{...a,ref:t})})},`DialogContent`)),Yn=H.forwardRef(J(function(e,t){let n=Ln(qn,e.__scopeDialog),r=H.useRef(null),i=E(t,n.contentRef,r);return H.useEffect(()=>{let e=r.current;if(e)return jn(e)},[]),(0,W.jsx)(Zn,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:M(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:M(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:M(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Xn=H.forwardRef(J(function(e,t){let n=Ln(qn,e.__scopeDialog),r=H.useRef(!1),i=H.useRef(!1);return(0,W.jsx)(Zn,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),Zn=H.forwardRef(J(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":o,children:s,...c}=e,l=Ln(qn,n);return ft(),(0,W.jsx)(We,{registry:l.branchRegistry,children:(0,W.jsx)(He,{asChild:!0,loop:!0,trapped:r,branches:l.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,W.jsx)(je,{role:`dialog`,id:l.contentId,"aria-labelledby":l.titlePresent?l.titleId:void 0,"aria-describedby":l.descriptionPresent?nr(o,l.descriptionId):o,"data-state":rr(l.open),...c,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1),children:s})})})},`DialogContentImpl`)),Qn=H.forwardRef(J(function(e,t){let{__scopeDialog:n,...r}=e,i=Ln(`DialogTitle`,n),{setTitleCount:a}=i;return V(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,W.jsx)(k.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),$n=H.forwardRef(J(function(e,t){let{__scopeDialog:n,...r}=e,i=Ln(`DialogDescription`,n),{setDescriptionCount:a}=i;return V(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,W.jsx)(k.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),er=`DialogClose`,tr=H.forwardRef(J(function(e,t){let{__scopeDialog:n,...r}=e,i=Ln(er,n);return(0,W.jsx)(k.button,{type:`button`,...r,ref:t,onClick:M(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function nr(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}J(nr,`concatAriaDescribedby`);function rr(e){return e?`open`:`closed`}J(rr,`getState`);var ir={overlay:`_overlay_1yxsw_1`,content:`_content_1yxsw_9`,keyframes:`_keyframes_1yxsw_17`,"overlay-in":`_overlay-in_1yxsw_1`,"overlay-out":`_overlay-out_1yxsw_1`,"content-fade-in":`_content-fade-in_1yxsw_1`,"content-rise-in":`_content-rise-in_1yxsw_1`,"content-out":`_content-out_1yxsw_1`,header:`_header_1yxsw_31`,title:`_title_1yxsw_33`,description:`_description_1yxsw_35`,swap:`_swap_1yxsw_39`,close:`_close_1yxsw_47`,body:`_body_1yxsw_53`,"content-fade-out":`_content-fade-out_1yxsw_1`},ar=(0,H.createContext)(null);function or({open:e,defaultOpen:t=!1,onOpenChange:n,...r}){let[i,a]=(0,H.useState)(t),o=e??i,s=(0,H.useCallback)(t=>{e===void 0&&a(t),n?.(t)},[e,n]);return(0,W.jsx)(ar.Provider,{value:o,children:(0,W.jsx)(Rn,{...r,open:o,onOpenChange:s})})}var sr={duration:y.duration.instant},cr={duration:y.duration.fast,ease:[...y.ease.standard]};function lr({text:e}){let t=f();return(0,W.jsx)(l,{mode:`popLayout`,initial:!1,children:(0,W.jsx)(u.span,{className:ir.swap,initial:!t&&{opacity:0,y:`0.3em`,filter:`blur(${y.blur.soft}px)`},animate:{opacity:1,y:0,filter:`blur(0px)`},exit:t?{opacity:0,transition:{duration:0}}:{opacity:0,y:`-0.3em`,filter:`blur(${y.blur.subtle}px)`,transition:{duration:y.duration.fast,ease:[...y.ease.standard]}},transition:{duration:y.duration.standard,ease:[...y.ease.enter]},children:e},e)})}function ur({title:e,description:t,children:n,className:r,onPointerDownOutside:i,...a}){let o=(0,H.useContext)(ar),s=f(),c=(0,H.useRef)({open:o,at:0});(0,H.useLayoutEffect)(()=>{c.current={open:o,at:performance.now()}},[o]);let d=e=>{i?.(e),o!==null&&(!c.current.open||e.detail.originalEvent.timeStamp<c.current.at)&&e.preventDefault()},p=[ir.content,r].filter(Boolean).join(` `),m=(0,W.jsxs)(W.Fragment,{children:[(0,W.jsxs)(`div`,{className:ir.header,children:[(0,W.jsxs)(`div`,{children:[(0,W.jsx)(Qn,{className:ir.title,children:(0,W.jsx)(lr,{text:e})}),t?(0,W.jsx)($n,{className:ir.description,children:(0,W.jsx)(lr,{text:t})}):null]}),(0,W.jsx)(tr,{className:ir.close,"aria-label":`Close dialog`,children:(0,W.jsx)(_e,{size:16,strokeWidth:1.75,"aria-hidden":`true`})})]}),(0,W.jsx)(`div`,{className:ir.body,children:n})]});return o===null?(0,W.jsxs)(Hn,{children:[(0,W.jsx)(Wn,{className:`${ir.overlay} ${ir.keyframes}`}),(0,W.jsx)(Jn,{...a,onPointerDownOutside:d,className:`${p} ${ir.keyframes}`,children:m})]}):(0,W.jsx)(l,{children:o&&(0,W.jsxs)(Hn,{forceMount:!0,children:[(0,W.jsx)(Wn,{asChild:!0,forceMount:!0,children:(0,W.jsx)(u.div,{className:ir.overlay,initial:{opacity:0},animate:{opacity:1},exit:{opacity:0,transition:s?sr:cr},transition:s?sr:{duration:y.duration.standard,ease:[...y.ease.enter]}})}),(0,W.jsx)(Jn,{...a,onPointerDownOutside:d,asChild:!0,forceMount:!0,children:(0,W.jsx)(u.div,{className:p,initial:s?{opacity:0}:{opacity:0,y:8,scale:.96},animate:{opacity:1,y:0,scale:1},exit:s?{opacity:0,transition:sr}:{opacity:0,y:4,scale:.98,transition:cr},transition:s?sr:{default:y.spring.smooth,opacity:{duration:y.duration.fast,ease:[...y.ease.enter]}},children:m})})]},`dialog`)})}var dr=[`top`,`right`,`bottom`,`left`],fr=Math.min,pr=Math.max,mr=Math.round,hr=Math.floor,gr=e=>({x:e,y:e}),_r={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function vr(e,t,n){return pr(e,fr(t,n))}function yr(e,t){return typeof e==`function`?e(t):e}function br(e){return e.split(`-`)[0]}function xr(e){return e.split(`-`)[1]}function Sr(e){return e===`x`?`y`:`x`}function Cr(e){return e===`y`?`height`:`width`}function wr(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Tr(e){return Sr(wr(e))}function Er(e,t,n){n===void 0&&(n=!1);let r=xr(e),i=Tr(e),a=Cr(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Fr(o)),[o,Fr(o)]}function Dr(e){let t=Fr(e);return[Or(e),t,Or(t)]}function Or(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var kr=[`left`,`right`],Ar=[`right`,`left`],jr=[`top`,`bottom`],Mr=[`bottom`,`top`];function Nr(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Ar:kr:t?kr:Ar;case`left`:case`right`:return t?jr:Mr;default:return[]}}function Pr(e,t,n,r){let i=xr(e),a=Nr(br(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Or)))),a}function Fr(e){let t=br(e);return _r[t]+e.slice(t.length)}function Ir(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function Lr(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Ir(e)}function Rr(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 zr(e,t,n){let{reference:r,floating:i}=e,a=wr(t),o=Tr(t),s=Cr(o),c=br(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=xr(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Br(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}=yr(t,e),p=Lr(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Rr(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=Rr(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 Vr=50,Hr=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Br},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=zr(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<Vr&&(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}=zr(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Ur=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}=yr(e,t)||{};if(l==null)return{};let d=Lr(u),f={x:n,y:r},p=Tr(i),m=Cr(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=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=fr(d[_],T),D=fr(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=vr(E,k,O),j=!c.arrow&&xr(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,M=j?k<E?k-E:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),Wr=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}=yr(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=br(r),_=wr(o),v=br(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Fr(o)]:Dr(o)),x=p!==`none`;!d&&x&&b.push(...Pr(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=Er(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`||_===wr(t)||T.every(e=>wr(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=wr(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{}}}};function Gr(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Kr(e){return dr.some(t=>e[t]>=0)}var qr=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=yr(e,t);switch(i){case`referenceHidden`:{let e=Gr(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Kr(e)}}}case`escaped`:{let e=Gr(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Kr(e)}}}default:return{}}}}},Jr=new Set([`left`,`top`]);async function Yr(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=br(n),s=xr(n),c=wr(n)===`y`,l=Jr.has(o)?-1:1,u=a&&c?-1:1,d=yr(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 Xr=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 Yr(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}}}}},Zr=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}=yr(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=wr(i),p=Sr(f),m=u[p],h=u[f],g=(e,t)=>vr(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}}}}}},Qr=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}=yr(e,t),u={x:n,y:r},d=wr(i),f=Sr(d),p=u[f],m=u[d],h=yr(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=Jr.has(br(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}}}},$r=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}=yr(e,t),c=await i.detectOverflow(t,s),l=br(n),u=xr(n),d=wr(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=fr(p-c[m],g),y=fr(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*pr(c.left,c.right):S=p-2*pr(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 ei(){return typeof window<`u`}function ti(e){return ri(e)?(e.nodeName||``).toLowerCase():`#document`}function Y(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ni(e){return((ri(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function ri(e){return ei()?e instanceof Node||e instanceof Y(e).Node:!1}function ii(e){return ei()?e instanceof Element||e instanceof Y(e).Element:!1}function ai(e){return ei()?e instanceof HTMLElement||e instanceof Y(e).HTMLElement:!1}function oi(e){return!ei()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Y(e).ShadowRoot}function si(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=vi(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ci(e){return/^(table|td|th)$/.test(ti(e))}function li(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ui=/transform|translate|scale|rotate|perspective|filter/,di=/paint|layout|strict|content/,fi=e=>!!e&&e!==`none`,pi;function mi(e){let t=ii(e)?vi(e):e;return fi(t.transform)||fi(t.translate)||fi(t.scale)||fi(t.rotate)||fi(t.perspective)||!gi()&&(fi(t.backdropFilter)||fi(t.filter))||ui.test(t.willChange||``)||di.test(t.contain||``)}function hi(e){let t=bi(e);for(;ai(t)&&!_i(t);){if(mi(t))return t;if(li(t))return null;t=bi(t)}return null}function gi(){return pi??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),pi}function _i(e){return/^(html|body|#document)$/.test(ti(e))}function vi(e){return Y(e).getComputedStyle(e)}function yi(e){return ii(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function bi(e){if(ti(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||oi(e)&&e.host||ni(e);return oi(t)?t.host:t}function xi(e){let t=bi(e);return _i(t)?(e.ownerDocument||e).body:ai(t)&&si(t)?t:xi(t)}function Si(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=xi(e),i=r===e.ownerDocument?.body,a=Y(r);if(i){let e=Ci(a);return t.concat(a,a.visualViewport||[],si(r)?r:[],e&&n?Si(e):[])}return t.concat(r,Si(r,[],n))}function Ci(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function wi(e){let t=vi(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=ai(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=mr(n)!==a||mr(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Ti(e){return ii(e)?e:e.contextElement}function Ei(e){let t=Ti(e);if(!ai(t))return gr(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=wi(t),o=(a?mr(n.width):n.width)/r,s=(a?mr(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Di=gr(0);function Oi(e){let t=Y(e);return!gi()||!t.visualViewport?Di:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ki(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Y(e)}function Ai(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Ti(e),o=gr(1);t&&(r?ii(r)&&(o=Ei(r)):o=Ei(e));let s=ki(a,n,r)?Oi(a):gr(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=Y(a),t=ii(r)?Y(r):r,n=e,i=Ci(n);for(;i&&t!==n;){let e=Ei(i),t=i.getBoundingClientRect(),r=vi(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=Y(i),i=Ci(n)}}return Rr({width:u,height:d,x:c,y:l})}function ji(e,t){let n=yi(e).scrollLeft;return t?t.left+n:Ai(ni(e)).left+n}function Mi(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-ji(e,n),y:n.top+t.scrollTop}}function Ni(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=ni(r),s=t?li(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=gr(1),u=gr(0),d=ai(r);if((d||!a)&&((ti(r)!==`body`||si(o))&&(c=yi(r)),d)){let e=Ai(r);l=Ei(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Mi(o,c):gr(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 Pi(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Fi(e){let t=yi(e),n=e.ownerDocument.body,r=pr(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=pr(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+ji(e),o=-t.scrollTop;return vi(n).direction===`rtl`&&(a+=pr(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var Ii=25;function Li(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Y(e),a=ni(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!gi()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(ji(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<=Ii&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Ri(e,t){let n=Ai(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Ei(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function zi(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Li(e,n,t);else if(t===`document`)r=Fi(ni(e));else if(ii(t))r=Ri(t,n);else{let n=Oi(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Rr(r)}function Bi(e,t){let n=t.get(e);if(n)return n;let r=Si(e,[],!1).filter(e=>ii(e)&&ti(e)!==`body`),i=null,a=vi(e).position===`fixed`,o=a?bi(e):e;for(;ii(o)&&!_i(o);){let e=vi(o),t=mi(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=bi(o)}return t.set(e,r),r}function Vi(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?li(t)?[]:Bi(t,this._c):[].concat(n),r],o=zi(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=zi(t,a[e],i);s=pr(n.top,s),c=fr(n.right,c),l=fr(n.bottom,l),u=pr(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Hi(e){let{width:t,height:n}=wi(e);return{width:t,height:n}}function Ui(e,t,n){let r=ai(t),i=ni(t),a=n===`fixed`,o=Ai(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=gr(0);if((r||!a)&&((ti(t)!==`body`||si(i))&&(s=yi(t)),r)){let e=Ai(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=ji(i));let l=i&&!r&&!a?Mi(i,s):gr(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 Wi(e){return vi(e).position===`static`}function Gi(e,t){if(!ai(e)||vi(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return ni(e)===n&&(n=n.ownerDocument.body),n}function Ki(e,t){let n=Y(e);if(li(e))return n;if(!ai(e)){let t=bi(e);for(;t&&!_i(t);){if(ii(t)&&!Wi(t))return t;t=bi(t)}return n}let r=Gi(e,t);for(;r&&ci(r)&&Wi(r);)r=Gi(r,t);return r&&_i(r)&&Wi(r)&&!mi(r)?n:r||hi(e)||n}var qi=async function(e){let t=this.getOffsetParent||Ki,n=this.getDimensions,r=await n(e.floating);return{reference:Ui(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ji(e){return vi(e).direction===`rtl`}var Yi={convertOffsetParentRelativeRectToViewportRelativeRect:Ni,getDocumentElement:ni,getClippingRect:Vi,getOffsetParent:Ki,getElementRects:qi,getClientRects:Pi,getDimensions:Hi,getScale:Ei,isElement:ii,isRTL:Ji};function Xi(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Zi(e,t,n){let r=null,i,a=ni(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=hr(d),h=hr(a.clientWidth-(u+f)),g=hr(a.clientHeight-(d+p)),_=hr(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:pr(0,fr(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Xi(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=Y(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Qi(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=Ti(e),u=i||a?[...l?Si(l):[],...t?Si(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Zi(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?Ai(e):null;c&&g();function g(){let t=Ai(e);h&&!Xi(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 $i=Xr,ea=Zr,ta=Wr,na=$r,ra=qr,ia=Ur,aa=Qr,oa=(e,t,n)=>{let r=new Map,i=n??{},a={...Yi,...i.platform,_c:r};return Hr(e,t,{...i,platform:a})},sa=typeof document<`u`?H.useLayoutEffect:function(){};function ca(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(!ca(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)&&!ca(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function la(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ua(e,t){let n=la(e);return Math.round(t*n)/n}function da(e){let t=H.useRef(e);return sa(()=>{t.current=e}),t}function fa(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]=H.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=H.useState(r);ca(f,r)||p(r);let[m,h]=H.useState(null),[g,_]=H.useState(null),v=H.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=H.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=H.useRef(null),C=H.useRef(null),w=H.useRef(u),T=c!=null,E=da(c),D=da(i),O=da(l),k=H.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),oa(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!ca(w.current,t)&&(w.current=t,it.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);sa(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=H.useRef(!1);sa(()=>(A.current=!0,()=>{A.current=!1}),[]),sa(()=>{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=H.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=H.useMemo(()=>({reference:b,floating:x}),[b,x]),N=H.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=ua(M.floating,u.x),r=ua(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...la(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return H.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var pa=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:ia({element:r.current,padding:i}).fn(n):r?ia({element:r,padding:i}).fn(n):{}}}},ma=(e,t)=>{let n=$i(e);return{name:n.name,fn:n.fn,options:[e,t]}},ha=(e,t)=>{let n=ea(e);return{name:n.name,fn:n.fn,options:[e,t]}},ga=(e,t)=>({fn:aa(e).fn,options:[e,t]}),_a=(e,t)=>{let n=ta(e);return{name:n.name,fn:n.fn,options:[e,t]}},va=(e,t)=>{let n=na(e);return{name:n.name,fn:n.fn,options:[e,t]}},ya=(e,t)=>{let n=ra(e);return{name:n.name,fn:n.fn,options:[e,t]}},ba=(e,t)=>{let n=pa(e);return{name:n.name,fn:n.fn,options:[e,t]}},xa=Object.defineProperty,Sa=(e,t)=>xa(e,`name`,{value:t,configurable:!0}),Ca={Partial:`partial`,Always:`always`},wa={Optimized:`optimized`,Always:`always`},Ta=`Popper`,[Ea,Da]=F(Ta),[Oa,ka]=Ea(Ta),Aa=Sa(e=>{let{__scopePopper:t,children:n}=e,[r,i]=H.useState(null),[a,o]=H.useState(void 0);return(0,W.jsx)(Oa,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),ja=`PopperAnchor`,Ma=H.forwardRef(Sa(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=ka(ja,n),o=H.useRef(null),s=a.onAnchorChange,c=H.useCallback(e=>{o.current=e,e&&s(e)},[s]),l=E(t,c),u=H.useRef(null);H.useEffect(()=>{if(!r)return;let e=u.current;u.current=r.current,e!==u.current&&s(u.current)});let d=a.placementState&&za(a.placementState),f=d?.[0],p=d?.[1];return r?null:(0,W.jsx)(k.div,{"data-radix-popper-side":f,"data-radix-popper-align":p,...i,ref:l})},`PopperAnchor`)),Na=`PopperContent`,[Pa,Fa]=Ea(Na),Ia=H.forwardRef(Sa(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=Ca.Partial,hideWhenDetached:f=!1,updatePositionStrategy:p=wa.Optimized,onPlaced:m,...h}=e,g=ka(Na,n),[_,v]=H.useState(null),y=E(t,v),[b,x]=H.useState(null),S=te(b),C=S?.width??0,w=S?.height??0,T=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],A=O.length>0,j={padding:D,boundary:O.filter(La),altBoundary:A},{refs:M,floatingStyles:N,placement:P,isPositioned:F,middlewareData:I}=fa({strategy:`fixed`,placement:T,whileElementsMounted:Sa((...e)=>Qi(...e,{animationFrame:p===wa.Always}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[ma({mainAxis:i+w,alignmentAxis:o}),c&&ha({mainAxis:!0,crossAxis:!1,limiter:d===Ca.Partial?ga():void 0,...j}),c&&_a({...j}),va({...j,apply:Sa(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),b&&ba({element:b,padding:s}),Ra({arrowWidth:C,arrowHeight:w}),f&&ya({strategy:`referenceHidden`,...j,boundary:A?j.boundary:void 0})]}),L=g.setPlacementState;V(()=>(L(P),()=>{L(void 0)}),[P,L]);let[R,z]=za(P),ee=G(m);V(()=>{F&&ee?.()},[F,ee]);let B=I.arrow?.x,ne=I.arrow?.y,re=I.arrow?.centerOffset!==0,[ie,ae]=H.useState();return V(()=>{_&&ae(window.getComputedStyle(_).zIndex)},[_]),(0,W.jsx)(`div`,{ref:M.setFloating,"data-radix-popper-content-wrapper":``,style:{...N,transform:F?N.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:ie,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(` `),...I.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,W.jsx)(Pa,{scope:n,placedSide:R,placedAlign:z,onArrowChange:x,arrowX:B,arrowY:ne,shouldHideArrow:re,children:(0,W.jsx)(k.div,{"data-side":R,"data-align":z,...h,ref:y,style:{...h.style,animation:F?h.style?.animation:`none`}})})})},`PopperContent`));function La(e){return e!==null}Sa(La,`isNotNull`);var Ra=Sa(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=za(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function za(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Sa(za,`getSideAndAlignFromPlacement`);var Ba=Object.defineProperty,Va=(e,t)=>Ba(e,`name`,{value:t,configurable:!0}),Ha=!1;function Ua(){let[e,t]=H.useState(Ha);return H.useEffect(()=>{Ha||(Ha=!0,t(!0))},[]),e}Va(Ua,`useIsHydrated`);var Wa=H.useSyncExternalStore;function Ga(){return()=>{}}Va(Ga,`subscribe`);function Ka(){return Wa(Ga,()=>!0,()=>!1)}Va(Ka,`useIsHydratedModern`);var qa=typeof Wa==`function`?Ka:Ua,Ja=Object.defineProperty,Ya=(e,t)=>Ja(e,`name`,{value:t,configurable:!0}),Xa=`rovingFocusGroup.onEntryFocus`,Za={bubbles:!1,cancelable:!0},Qa=`RovingFocusGroup`,[$a,eo,to]=T(Qa),[no,ro]=F(Qa,[to]),io={Vertical:`vertical`,Horizontal:`horizontal`},ao={LTR:`ltr`,RTL:`rtl`},[oo,so]=no(Qa),co=H.forwardRef(Ya(function(e,t){return(0,W.jsx)($a.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,W.jsx)($a.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,W.jsx)(lo,{...e,ref:t})})})},`RovingFocusGroup`)),lo=H.forwardRef(Ya(function(e,t){let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:l,preventScrollOnEntryFocus:u=!1,...d}=e,f=H.useRef(null),p=E(t,f),m=S(a),[h,g]=L({prop:o,defaultProp:s??null,onChange:c,caller:Qa}),[_,v]=H.useState(!1),y=G(l),b=eo(n),x=H.useRef(!1),[C,w]=H.useState(0);return H.useEffect(()=>{let e=f.current;if(e)return e.addEventListener(Xa,y),()=>e.removeEventListener(Xa,y)},[y]),(0,W.jsx)(oo,{scope:n,orientation:r,dir:m,loop:i,currentTabStopId:h,onItemFocus:H.useCallback(e=>g(e),[g]),onItemShiftTab:H.useCallback(()=>v(!0),[]),onFocusableItemAdd:H.useCallback(()=>w(e=>e+1),[]),onFocusableItemRemove:H.useCallback(()=>w(e=>e-1),[]),children:(0,W.jsx)(k.div,{tabIndex:_||C===0?-1:0,"data-orientation":r,...d,ref:p,style:{outline:`none`,...e.style},onMouseDown:M(e.onMouseDown,()=>{x.current=!0}),onFocus:M(e.onFocus,e=>{let t=!x.current;if(e.target===e.currentTarget&&t&&!_){let t=new CustomEvent(Xa,Za);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=b().filter(e=>e.focusable);go([e.find(e=>e.active),e.find(e=>e.id===h),...e].filter(Boolean).map(e=>e.ref.current),u)}}x.current=!1}),onBlur:M(e.onBlur,()=>v(!1))})})},`RovingFocusGroupImpl`)),uo=`RovingFocusGroupItem`,fo=H.forwardRef(Ya(function(e,t){let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=p(),l=a||c,u=so(uo,n),d=u.currentTabStopId===l,f=eo(n),{onFocusableItemAdd:m,onFocusableItemRemove:h,currentTabStopId:g}=u,_=qa();return V(()=>{if(_&&r)return m(),()=>h()},[_,r,m,h]),H.useEffect(()=>{if(!_&&r)return m(),()=>h()},[_,r,m,h]),(0,W.jsx)($a.ItemSlot,{scope:n,id:l,focusable:r,active:i,children:(0,W.jsx)(k.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:M(e.onMouseDown,e=>{r?u.onItemFocus(l):e.preventDefault()}),onFocus:M(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:M(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){u.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=ho(e,u.orientation,u.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=f().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=u.loop?_o(n,r+1):n.slice(r+1)}setTimeout(()=>go(n))}}),children:typeof o==`function`?o({isCurrentTabStop:d,hasTabStop:g!=null}):o})})},`RovingFocusGroupItem`)),po={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function mo(e,t){return t===ao.RTL?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}Ya(mo,`getDirectionAwareKey`);function ho(e,t,n){let r=mo(e.key,n);if(!(t===io.Vertical&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===io.Horizontal&&[`ArrowUp`,`ArrowDown`].includes(r)))return po[r]}Ya(ho,`getFocusIntent`);function go(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}Ya(go,`focusFirst`);function _o(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Ya(_o,`wrapArray`);var vo=Object.defineProperty,X=(e,t)=>vo(e,`name`,{value:t,configurable:!0}),yo=[`Enter`,` `],bo=[`ArrowDown`,`PageUp`,`Home`],xo=[`ArrowUp`,`PageDown`,`End`],So=[...bo,...xo];[...yo],[...yo];var Co=`Menu`,[wo,To,Eo]=T(Co),[Do,Oo]=F(Co,[Eo,Da,ro]),ko=Da(),Ao=ro(),[jo,Mo]=Do(Co),[No,Po]=Do(Co),Fo=X(e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=ko(t),[c,l]=H.useState(null),u=H.useRef(!1),d=G(a),f=S(i);return H.useEffect(()=>{let e=X(()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},`handleKeyDown`),t=X(()=>u.current=!1,`handlePointer`);return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),H.useEffect(()=>{if(!n)return;let e=X(()=>d(!1),`handleBlur`);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,d]),(0,W.jsx)(Aa,{...s,children:(0,W.jsx)(jo,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,W.jsx)(No,{scope:t,onClose:H.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})},`Menu`),Io=H.forwardRef(X(function(e,t){let{__scopeMenu:n,...r}=e,i=ko(n);return(0,W.jsx)(Ma,{...i,...r,ref:t})},`MenuAnchor`)),Lo=`MenuPortal`,[Ro,zo]=Do(Lo,{forceMount:void 0}),Bo=X(e=>{let{__scopeMenu:t,forceMount:r,children:i,container:a}=e,o=Mo(Lo,t);return(0,W.jsx)(Ro,{scope:t,forceMount:r,children:(0,W.jsx)(n,{present:r||o.open,children:(0,W.jsx)(ot,{asChild:!0,container:a,children:i})})})},`MenuPortal`),Vo=`MenuContent`,[Ho,Uo]=Do(Vo),Wo=H.forwardRef(X(function(e,t){let r=zo(Vo,e.__scopeMenu),{forceMount:i=r.forceMount,...a}=e,o=Mo(Vo,e.__scopeMenu),s=Po(Vo,e.__scopeMenu);return(0,W.jsx)(wo.Provider,{scope:e.__scopeMenu,children:(0,W.jsx)(n,{present:i||o.open,children:(0,W.jsx)(wo.Slot,{scope:e.__scopeMenu,children:s.modal?(0,W.jsx)(Go,{...a,ref:t}):(0,W.jsx)(Ko,{...a,ref:t})})})})},`MenuContent`)),Go=H.forwardRef(X(function(e,t){let n=Mo(Vo,e.__scopeMenu),r=H.useRef(null),i=E(t,r);return H.useEffect(()=>{let e=r.current;if(e)return jn(e)},[]),(0,W.jsx)(Jo,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:M(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentModal`)),Ko=H.forwardRef(X(function(e,t){let n=Mo(Vo,e.__scopeMenu);return(0,W.jsx)(Jo,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})},`MenuRootContentNonModal`)),qo=z(`MenuContent.ScrollLock`),Jo=H.forwardRef(X(function(e,t){let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=Mo(Vo,n),_=Po(Vo,n),v=ko(n),y=Ao(n),b=To(n),[x,S]=H.useState(null),C=H.useRef(null),[w,T]=H.useState(null);Ke(w);let{nodes:D,registry:O}=Ge(),k=!!(i||m),A=E(t,C,g.onContentChange,T),j=H.useRef(0),N=H.useRef(``),P=H.useRef(0),F=H.useRef(null),I=H.useRef(`right`),L=H.useRef(0),R=H.useMemo(()=>m?[C,...D.map(e=>({current:e}))]:[],[C,D,m]),z=m?Sn:H.Fragment,ee=m?{as:qo,allowPinchZoom:!0,shards:R}:void 0,te=X(e=>{let t=N.current+e,n=b().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=ms(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;X((function e(t){N.current=t,window.clearTimeout(j.current),t!==``&&(j.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(t),o&&setTimeout(()=>o.focus())},`handleTypeaheadSearch`);H.useEffect(()=>()=>window.clearTimeout(j.current),[]),ft();let B=H.useCallback(e=>I.current===F.current?.side&&gs(e,F.current?.area),[]);return(0,W.jsx)(Ho,{scope:n,searchRef:N,onItemEnter:H.useCallback(e=>{B(e)&&e.preventDefault()},[B]),onItemLeave:H.useCallback(e=>{B(e)||(C.current?.focus(),S(null))},[B]),onTriggerLeave:H.useCallback(e=>{B(e)&&e.preventDefault()},[B]),pointerGraceTimerRef:P,onPointerGraceIntentChange:H.useCallback(e=>{F.current=e},[]),children:(0,W.jsx)(We,{registry:k?O:null,children:(0,W.jsx)(z,{...ee,children:(0,W.jsx)(He,{asChild:!0,trapped:i,branches:D,onMountAutoFocus:M(a,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,W.jsx)(je,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,W.jsx)(co,{asChild:!0,...y,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:x,onCurrentTabStopIdChange:S,onEntryFocus:M(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,W.jsx)(Ia,{role:`menu`,"aria-orientation":`vertical`,"data-state":ls(g.open),"data-radix-menu-content":``,dir:_.dir,...v,...h,ref:A,style:{outline:`none`,...h.style},onKeyDown:M(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&te(e.key));let i=C.current;if(e.target!==i||!So.includes(e.key))return;e.preventDefault();let a=b().filter(e=>!e.disabled).map(e=>e.ref.current);xo.includes(e.key)&&a.reverse(),fs(a)}),onBlur:M(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(j.current),N.current=``)}),onPointerMove:M(e.onPointerMove,_s(e=>{let t=e.target,n=L.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>L.current?`right`:`left`;I.current=t,L.current=e.clientX}}))})})})})})})})},`MenuContentImpl`)),Yo=`MenuItem`,Xo=`menu.itemSelect`,Zo=H.forwardRef(X(function(e,t){let{disabled:n=!1,onSelect:r,...i}=e,a=H.useRef(null),o=Po(Yo,e.__scopeMenu),s=Uo(Yo,e.__scopeMenu),c=E(t,a),l=H.useRef(!1),u=X(()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(Xo,{bubbles:!0,cancelable:!0});e.addEventListener(Xo,e=>r?.(e),{once:!0}),re(e,t),t.defaultPrevented?l.current=!1:o.onClose()}},`handleSelect`);return(0,W.jsx)(Qo,{...i,ref:c,disabled:n,onClick:M(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:M(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:M(e.onKeyDown,e=>{n||e.target!==e.currentTarget||(s.searchRef.current===``||e.key!==` `)&&yo.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})},`MenuItem`)),Qo=H.forwardRef(X(function(e,t){let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=Uo(Yo,n),s=Ao(n),c=H.useRef(null),l=E(t,c),[u,d]=H.useState(!1),[f,p]=H.useState(``);return H.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,W.jsx)(wo.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,W.jsx)(fo,{asChild:!0,...s,focusable:!r,children:(0,W.jsx)(k.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:M(e.onPointerMove,_s(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:M(e.onPointerLeave,_s(e=>o.onItemLeave(e))),onFocus:M(e.onFocus,()=>d(!0)),onBlur:M(e.onBlur,()=>d(!1))})})})},`MenuItemImpl`)),$o=H.forwardRef(X(function(e,t){let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,W.jsx)(rs,{scope:e.__scopeMenu,checked:n,children:(0,W.jsx)(Zo,{role:`menuitemcheckbox`,"aria-checked":us(n)?`mixed`:n,...i,ref:t,"data-state":ds(n),onSelect:M(i.onSelect,()=>r?.(us(n)?!0:!n),{checkForDefaultPrevented:!1})})})},`MenuCheckboxItem`)),[es,ts]=Do(`MenuRadioGroup`,{value:void 0,onValueChange:X(()=>{},`onValueChange`)}),ns=`MenuItemIndicator`,[rs,is]=Do(ns,{checked:!1}),as=H.forwardRef(X(function(e,t){let{__scopeMenu:r,forceMount:i,...a}=e,o=is(ns,r);return(0,W.jsx)(n,{present:i||us(o.checked)||o.checked===!0,children:(0,W.jsx)(k.span,{...a,ref:t,"data-state":ds(o.checked)})})},`MenuItemIndicator`)),os=H.forwardRef(X(function(e,t){let{__scopeMenu:n,...r}=e;return(0,W.jsx)(k.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})},`MenuSeparator`)),[ss,cs]=Do(`MenuSub`);function ls(e){return e?`open`:`closed`}X(ls,`getOpenState`);function us(e){return e===`indeterminate`}X(us,`isIndeterminate`);function ds(e){return us(e)?`indeterminate`:e?`checked`:`unchecked`}X(ds,`getCheckedState`);function fs(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}X(fs,`focusFirst`);function ps(e,t){return e.map((n,r)=>e[(t+r)%e.length])}X(ps,`wrapArray`);function ms(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=ps(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}X(ms,`getNextMatch`);function hs(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}X(hs,`isPointInPolygon`);function gs(e,t){return t?hs({x:e.clientX,y:e.clientY},t):!1}X(gs,`isPointerInGraceArea`);function _s(e){return t=>t.pointerType===`mouse`?e(t):void 0}X(_s,`whenMouse`);var vs=Object.defineProperty,ys=(e,t)=>vs(e,`name`,{value:t,configurable:!0}),bs=`DropdownMenu`,[xs,Ss]=F(bs,[Oo]),Cs=Oo(),[ws,Ts]=xs(bs),Es=ys(e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=Cs(t),l=H.useRef(null),[u,d]=L({prop:i,defaultProp:a??!1,onChange:o,caller:bs});return(0,W.jsx)(ws,{scope:t,triggerId:p(),triggerRef:l,contentId:p(),open:u,onOpenChange:d,onOpenToggle:H.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,W.jsx)(Fo,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})},`DropdownMenu`),Ds=`DropdownMenuTrigger`,Os=H.forwardRef(ys(function(e,t){let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=Ts(Ds,n),o=Cs(n),s=E(t,a.triggerRef);return(0,W.jsx)(Io,{asChild:!0,...o,children:(0,W.jsx)(k.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:M(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:M(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})},`DropdownMenuTrigger`)),ks=ys(e=>{let{__scopeDropdownMenu:t,...n}=e,r=Cs(t);return(0,W.jsx)(Bo,{...r,...n})},`DropdownMenuPortal`),As=`DropdownMenuContent`,js=H.forwardRef(ys(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Ts(As,n),a=Cs(n),o=H.useRef(!1);return(0,W.jsx)(Wo,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:M(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:M(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})},`DropdownMenuContent`)),Ms=H.forwardRef(ys(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Cs(n);return(0,W.jsx)(Zo,{...i,...r,ref:t})},`DropdownMenuItem`)),Ns=H.forwardRef(ys(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Cs(n);return(0,W.jsx)($o,{...i,...r,ref:t})},`DropdownMenuCheckboxItem`)),Ps=H.forwardRef(ys(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Cs(n);return(0,W.jsx)(as,{...i,...r,ref:t})},`DropdownMenuItemIndicator`)),Fs=H.forwardRef(ys(function(e,t){let{__scopeDropdownMenu:n,...r}=e,i=Cs(n);return(0,W.jsx)(os,{...i,...r,ref:t})},`DropdownMenuSeparator`)),Z={trigger:`_trigger_1alav_1`,item:`_item_1alav_13`,triggerIcon:`_triggerIcon_1alav_15`,triggerIconOnly:`_triggerIconOnly_1alav_19`,label:`_label_1alav_21`,labelMeasure:`_labelMeasure_1alav_23`,labelText:`_labelText_1alav_25`,chevron:`_chevron_1alav_27`,menu:`_menu_1alav_35`,"menu-exit":`_menu-exit_1alav_1`,highlight:`_highlight_1alav_55`,icon:`_icon_1alav_61`,separator:`_separator_1alav_63`,destructive:`_destructive_1alav_65`};function Is({text:e}){let t=f(),n=(0,H.useRef)(null),r=(0,H.useRef)(null),[i,a]=(0,H.useState)({width:`auto`,animate:!1});return(0,H.useLayoutEffect)(()=>{let e=n.current;if(!e)return;let t=new ResizeObserver(([t])=>{let n=e.textContent,i=r.current!==null&&r.current!==n;r.current=n,a({width:Math.ceil(t.borderBoxSize?.[0]?.inlineSize??e.offsetWidth),animate:i})});return t.observe(e),()=>t.disconnect()},[]),(0,W.jsxs)(u.span,{className:Z.label,initial:!1,animate:{width:i.width},transition:i.animate&&!t?y.spring.morph:{duration:0},children:[(0,W.jsx)(`span`,{ref:n,className:Z.labelMeasure,"aria-hidden":`true`,children:e}),(0,W.jsx)(l,{mode:`popLayout`,initial:!1,children:(0,W.jsx)(u.span,{className:Z.labelText,initial:!t&&{opacity:0,y:`0.3em`,filter:`blur(${y.blur.soft}px)`},animate:{opacity:1,y:0,filter:`blur(0px)`},exit:t?{opacity:0,transition:{duration:0}}:{opacity:0,y:`-0.3em`,filter:`blur(${y.blur.subtle}px)`,transition:{duration:y.duration.fast,ease:[...y.ease.standard]}},transition:{duration:y.duration.standard,ease:[...y.ease.enter]},children:e},e)})]})}function Ls({label:e,items:t,icon:n,iconOnly:r}){let i=f(),[a,o]=(0,H.useState)(null),s=(0,H.useRef)(!1),c=(0,H.useRef)(0);(0,H.useEffect)(()=>()=>window.clearTimeout(c.current),[]);function l(e){let t=e.target instanceof HTMLElement?e.target.closest(`[role="menuitem"]`):null;if(window.clearTimeout(c.current),!t){c.current=window.setTimeout(()=>o(null),s.current?70:0);return}let n={top:t.offsetTop,height:t.offsetHeight,danger:t.dataset.tone===`danger`},r=s.current;o(e=>({...n,glide:r&&e!==null}))}return(0,W.jsxs)(Es,{onOpenChange:e=>{e&&(window.clearTimeout(c.current),o(null))},children:[(0,W.jsxs)(Os,{className:[Z.trigger,r?Z.triggerIconOnly:``].filter(Boolean).join(` `),type:`button`,"aria-label":r?e:void 0,children:[n&&(0,W.jsx)(`span`,{className:Z.triggerIcon,"aria-hidden":`true`,children:n}),!r&&(0,W.jsx)(Is,{text:e}),!r&&(0,W.jsx)(me,{className:Z.chevron,size:15,strokeWidth:1.8,"aria-hidden":`true`})]}),(0,W.jsx)(ks,{children:(0,W.jsxs)(js,{className:Z.menu,sideOffset:6,align:`end`,collisionPadding:12,loop:!0,onFocus:l,onPointerMoveCapture:()=>{s.current=!0},onKeyDownCapture:()=>{s.current=!1},children:[(0,W.jsx)(u.span,{className:Z.highlight,"data-tone":a?.danger?`danger`:void 0,"aria-hidden":`true`,initial:!1,animate:a?{y:a.top,height:a.height,opacity:1}:{opacity:0},transition:{default:a?.glide&&!i?y.spring.snappy:{duration:0},opacity:{duration:i?0:.08}}}),t.map((e,t)=>(0,W.jsxs)(H.Fragment,{children:[e.separatorBefore&&(0,W.jsx)(Fs,{className:Z.separator}),(0,W.jsxs)(Ms,{className:[Z.item,e.destructive?Z.destructive:``].filter(Boolean).join(` `),"data-tone":e.destructive?`danger`:void 0,style:{"--i":t},disabled:e.disabled,onSelect:e.onSelect,children:[e.icon&&(0,W.jsx)(`span`,{className:Z.icon,"aria-hidden":`true`,children:e.icon}),e.label]})]},e.label))]})})]})}var Rs=Object.defineProperty,zs=(e,t)=>Rs(e,`name`,{value:t,configurable:!0});function Bs(e,[t,n]){return Math.min(n,Math.max(t,e))}zs(Bs,`clamp`);var Vs=Object.defineProperty,Hs=(e,t)=>Vs(e,`name`,{value:t,configurable:!0});function Us(e){let t=H.useRef({value:e,previous:e});return H.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}Hs(Us,`usePrevious`);var Ws=Object.defineProperty,Gs=(e,t)=>Ws(e,`name`,{value:t,configurable:!0}),Ks=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),qs=H.forwardRef(Gs(function(e,t){return(0,W.jsx)(k.span,{...e,ref:t,style:{...Ks,...e.style}})},`VisuallyHidden`)),Js=Object.defineProperty,Q=(e,t)=>Js(e,`name`,{value:t,configurable:!0}),Ys={ItemAligned:`item-aligned`,Popper:`popper`},Xs={LTR:`ltr`,RTL:`rtl`},Zs=[` `,`Enter`,`ArrowUp`,`ArrowDown`],Qs=[` `,`Enter`],$s=`Select`,[ec,tc,nc]=T($s),[rc,ic]=F($s,[nc,Da]),ac=Da(),[oc,sc]=rc($s),[cc,lc]=rc($s);function uc(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:m,form:h,internal_do_not_use_render:g}=e,_=ac(t),[v,y]=H.useState(null),[b,x]=H.useState(null),[C,w]=H.useState(!1),T=S(l),[E,D]=L({prop:r,defaultProp:i??!1,onChange:a,caller:$s}),[O,k]=L({prop:o,defaultProp:s,onChange:c,caller:$s}),A=H.useRef(null),j=H.useRef(O);H.useEffect(()=>{let e=h?v?.ownerDocument.getElementById(h):v?.form;if(e instanceof HTMLFormElement){let t=Q(()=>k(j.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[h,v,k]);let M=!v||!!h||!!v.closest(`form`),[N,P]=H.useState(new Set),F=p(),I=Array.from(N).map(e=>e.props.value).join(`;`),R=H.useCallback(e=>{P(t=>new Set(t).add(e))},[]),z=H.useCallback(e=>{P(t=>{let n=new Set(t);return n.delete(e),n})},[]),ee={required:m,trigger:v,onTriggerChange:y,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:C,onValueNodeHasChildrenChange:w,contentId:F,value:O,onValueChange:k,open:E,onOpenChange:D,dir:T,triggerPointerDownPosRef:A,disabled:f,name:u,autoComplete:d,form:h,nativeOptions:N,nativeSelectKey:I,isFormControl:M};return(0,W.jsx)(Aa,{..._,children:(0,W.jsx)(oc,{scope:t,...ee,children:(0,W.jsx)(ec.Provider,{scope:t,children:(0,W.jsx)(cc,{scope:t,onNativeOptionAdd:R,onNativeOptionRemove:z,children:Zc(g)?g(ee):n})})})})}Q(uc,`SelectProvider`);var dc=Q(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,W.jsx)(uc,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,W.jsxs)(W.Fragment,{children:[n,e?(0,W.jsx)(Xc,{__scopeSelect:t}):null]})})},`Select`),fc=`SelectTrigger`,pc=H.forwardRef(Q(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=ac(n),o=sc(fc,n),s=o.disabled||r,c=E(t,o.onTriggerChange),l=tc(n),u=H.useRef(`touch`),[d,f,p]=$c(e=>{let t=l().filter(e=>!e.disabled),n=el(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=Q(e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return(0,W.jsx)(Ma,{asChild:!0,...a,children:(0,W.jsx)(k.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":Qc(o.value)?``:void 0,...i,ref:c,onClick:M(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:M(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:M(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&Zs.includes(e.key)&&(m(),e.preventDefault())})})})},`SelectTrigger`)),mc=`SelectValue`,hc=H.forwardRef(Q(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=sc(mc,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=E(t,c.onValueNodeChange);V(()=>{l(u)},[l,u]);let f=Qc(c.value);return(0,W.jsx)(k.span,{...s,asChild:!f&&s.asChild,ref:d,style:{pointerEvents:`none`},children:(0,W.jsx)(H.Fragment,{children:f?o:a},f?`placeholder`:`value`)})},`SelectValue`)),gc=H.forwardRef(Q(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return(0,W.jsx)(k.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[_c,vc]=rc(`SelectPortal`,{forceMount:void 0}),yc=Q(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,W.jsx)(_c,{scope:e.__scopeSelect,forceMount:n,children:(0,W.jsx)(ot,{asChild:!0,...r})})},`SelectPortal`),bc=`SelectContent`,xc=H.forwardRef(Q(function(e,t){let r=vc(bc,e.__scopeSelect),{forceMount:i=r.forceMount,...a}=e,o=sc(bc,e.__scopeSelect),[s,c]=H.useState();return V(()=>{c(new DocumentFragment)},[]),(0,W.jsx)(n,{present:i||o.open,children:({present:e})=>e?(0,W.jsx)(Dc,{...a,ref:t}):(0,W.jsx)(Sc,{...a,fragment:s})})},`SelectContent`)),Sc=H.forwardRef(Q(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?it.createPortal((0,W.jsx)(wc,{scope:n,children:(0,W.jsx)(ec.Slot,{scope:n,children:(0,W.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),Cc=10,[wc,Tc]=rc(bc),Ec=z(`SelectContent.RemoveScroll`),Dc=H.forwardRef(Q(function(e,t){let{__scopeSelect:n}=e,{position:r=Ys.ItemAligned,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,v=sc(bc,n),[y,b]=H.useState(null),[x,S]=H.useState(null),C=E(t,b),[w,T]=H.useState(null),[D,O]=H.useState(null),k=tc(n),[A,j]=H.useState(!1),N=H.useRef(!1);H.useEffect(()=>{if(y)return jn(y)},[y]),ft();let P=H.useCallback(e=>{let[t,...n]=k().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&x&&(x.scrollTop=0),n===r&&x&&(x.scrollTop=x.scrollHeight),n?.focus(),document.activeElement!==i))return},[k,x]),F=H.useCallback(()=>P([w,y]),[P,w,y]);H.useEffect(()=>{A&&F()},[A,F]);let{onOpenChange:I,triggerPointerDownPosRef:L}=v;H.useEffect(()=>{if(y){let e={x:0,y:0},t=Q(t=>{e={x:Math.abs(Math.round(t.pageX)-(L.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(L.current?.y??0))}},`handlePointerMove`),n=Q(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(y)||I(!1),document.removeEventListener(`pointermove`,t),L.current=null},`handlePointerUp`);return L.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[y,I,L]),H.useEffect(()=>{let e=Q(()=>I(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[I]);let[R,z]=$c(e=>{let t=k().filter(e=>!e.disabled),n=el(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),ee=H.useCallback((e,t,n)=>{let r=!N.current&&!n;(v.value!==void 0&&v.value===t||r)&&(T(e),r&&(N.current=!0))},[v.value]),te=H.useCallback(()=>y?.focus(),[y]),B=H.useCallback((e,t,n)=>{let r=!N.current&&!n;(v.value!==void 0&&v.value===t||r)&&O(e)},[v.value]),V=r===Ys.Popper?kc:Oc,ne=V===kc?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,W.jsx)(wc,{scope:n,content:y,viewport:x,onViewportChange:S,itemRefCallback:ee,selectedItem:w,onItemLeave:te,itemTextRefCallback:B,focusSelectedItem:F,selectedItemText:D,position:r,isPositioned:A,searchRef:R,children:(0,W.jsx)(Sn,{as:Ec,allowPinchZoom:!0,children:(0,W.jsx)(He,{asChild:!0,trapped:v.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:M(i,e=>{v.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,W.jsx)(je,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:(0,W.jsx)(V,{role:`listbox`,id:v.contentId,"data-state":v.open?`open`:`closed`,dir:v.dir,onContextMenu:e=>e.preventDefault(),..._,...ne,onPlaced:()=>j(!0),ref:C,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:M(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&z(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=k().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>P(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),Oc=H.forwardRef(Q(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=sc(bc,n),o=Tc(bc,n),[s,c]=H.useState(null),[l,u]=H.useState(null),d=E(t,u),f=tc(n),p=H.useRef(!1),m=H.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:v}=o,y=H.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&_){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=_.getBoundingClientRect();if(a.dir!==Xs.RTL){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-Cc,d=Bs(a,[Cc,Math.max(Cc,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-Cc,d=Bs(a,[Cc,Math.max(Cc,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-Cc*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),v=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+v+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-Cc,D=c-E,O=g.offsetHeight/2,k=g.offsetTop+O,A=m+v+k,j=x-A;if(A<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,h.scrollTop=A-E+h.offsetTop}s.style.margin=`${Cc}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,_,a.dir,r]);V(()=>y(),[y]);let[b,x]=H.useState();V(()=>{l&&x(window.getComputedStyle(l).zIndex)},[l]);let S=H.useCallback(e=>{e&&m.current===!0&&(y(),v?.(),m.current=!1)},[y,v]);return(0,W.jsx)(Ac,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:S,children:(0,W.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:b},children:(0,W.jsx)(k.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),kc=H.forwardRef(Q(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=Cc,...a}=e,o=ac(n);return(0,W.jsx)(Ia,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})},`SelectPopperPosition`)),[Ac,jc]=rc(bc,{}),Mc=`SelectViewport`,Nc=H.forwardRef(Q(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=Tc(Mc,n),o=jc(Mc,n),s=E(t,a.onViewportChange),c=H.useRef(0);return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,W.jsx)(ec.Slot,{scope:n,children:(0,W.jsx)(k.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:M(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-Cc*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})},`SelectViewport`)),[Pc,Fc]=rc(`SelectGroup`),Ic=`SelectItem`,[Lc,Rc]=rc(Ic),zc=H.forwardRef(Q(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=sc(Ic,n),c=Tc(Ic,n),l=s.value===r,[u,d]=H.useState(a??``),[f,m]=H.useState(!1),h=G(e=>c.itemRefCallback?.(e,r,i)),g=E(t,h),_=p(),v=H.useRef(`touch`),y=Q(()=>{s.onValueChange(r),s.onOpenChange(!1)},`handleSelect`);return(0,W.jsx)(Lc,{scope:n,value:r,disabled:i,textId:_,isSelected:l,onItemTextChange:H.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,W.jsx)(ec.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,W.jsx)(k.div,{role:`option`,"aria-labelledby":_,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:g,onFocus:M(o.onFocus,()=>m(!0)),onBlur:M(o.onBlur,()=>m(!1)),onClick:M(o.onClick,()=>{i||v.current!==`mouse`&&y()}),onPointerUp:M(o.onPointerUp,()=>{i||v.current===`mouse`&&y()}),onPointerDown:M(o.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:M(o.onPointerMove,e=>{v.current=e.pointerType,i?c.onItemLeave?.():v.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:M(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:M(o.onKeyDown,e=>{i||e.target!==e.currentTarget||(c.searchRef?.current===``||e.key!==` `)&&(Qs.includes(e.key)&&y(),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),Bc=`SelectItemText`,Vc=H.forwardRef(Q(function(e,t){let{__scopeSelect:n,className:r,style:i,...a}=e,o=sc(Bc,n),s=Tc(Bc,n),c=Rc(Bc,n),l=lc(Bc,n),[u,d]=H.useState(null),f=G(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=E(t,d,c.onItemTextChange,f),m=u?.textContent,h=H.useMemo(()=>(0,W.jsx)(`option`,{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:_}=l;return V(()=>(g(h),()=>_(h)),[g,_,h]),(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(k.span,{id:c.textId,...a,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!Qc(o.value)?it.createPortal(a.children,o.valueNode):null]})},`SelectItemText`)),Hc=`SelectItemIndicator`,Uc=H.forwardRef(Q(function(e,t){let{__scopeSelect:n,...r}=e;return Rc(Hc,n).isSelected?(0,W.jsx)(k.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),Wc=`SelectScrollUpButton`,Gc=H.forwardRef(Q(function(e,t){let n=Tc(Wc,e.__scopeSelect),r=jc(Wc,e.__scopeSelect),[i,a]=H.useState(!1),o=E(t,r.onScrollButtonChange);return V(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;a(e)};Q(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,W.jsx)(Jc,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null},`SelectScrollUpButton`)),Kc=`SelectScrollDownButton`,qc=H.forwardRef(Q(function(e,t){let n=Tc(Kc,e.__scopeSelect),r=jc(Kc,e.__scopeSelect),[i,a]=H.useState(!1),o=E(t,r.onScrollButtonChange);return V(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)};Q(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,W.jsx)(Jc,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null},`SelectScrollDownButton`)),Jc=H.forwardRef(Q(function(e,t){let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=Tc(`SelectScrollButton`,n),o=H.useRef(null),s=tc(n),c=H.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return H.useEffect(()=>()=>c(),[c]),V(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,W.jsx)(k.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:M(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:M(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:M(i.onPointerLeave,()=>{c()})})},`SelectScrollButtonImpl`)),Yc=`SelectBubbleInput`,Xc=H.forwardRef(Q(function({__scopeSelect:e,...t},n){let r=sc(Yc,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u}=r,{nativeOptions:d,nativeSelectKey:f}=r,p=H.useRef(null),m=E(n,p),h=i??``,g=Us(h),_=Array.from(d).some(e=>(e.props.value??``)===``);return H.useEffect(()=>{let e=p.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(g!==h&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,h),e.dispatchEvent(t)}},[g,h]),(0,W.jsxs)(k.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>a(e.target.value),...t,style:{...Ks,...t.style},ref:m,defaultValue:h,children:[Qc(i)&&!_?(0,W.jsx)(`option`,{value:``}):null,Array.from(d)]},f)},`SelectBubbleInput`));function Zc(e){return typeof e==`function`}Q(Zc,`isFunction`);function Qc(e){return e===``||e===void 0}Q(Qc,`shouldShowPlaceholder`);function $c(e){let t=G(e),n=H.useRef(``),r=H.useRef(0),i=H.useCallback(e=>{let i=n.current+e;t(i),Q((function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(i)},[t]),a=H.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return H.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}Q($c,`useTypeaheadSearch`);function el(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=tl(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}Q(el,`findNextItem`);function tl(e,t){return e.map((n,r)=>e[(t+r)%e.length])}Q(tl,`wrapArray`);var $={field:`_field_gd579_1`,trigger:`_trigger_gd579_7`,valueText:`_valueText_gd579_17`,srOnly:`_srOnly_gd579_23`,chevron:`_chevron_gd579_25`,hint:`_hint_gd579_29`,content:`_content_gd579_35`,"select-in":`_select-in_gd579_1`,"select-out":`_select-out_gd579_1`,viewport:`_viewport_gd579_45`,item:`_item_gd579_47`,indicator:`_indicator_gd579_53`,"indicator-in":`_indicator-in_gd579_1`,scrollButton:`_scrollButton_gd579_55`,"select-fade":`_select-fade_gd579_1`,"select-fade-out":`_select-fade-out_gd579_1`},nl={enter:e=>({opacity:0,y:`${e*.35}em`,filter:`blur(${y.blur.soft}px)`}),center:{opacity:1,y:0,filter:`blur(0px)`,transition:{duration:y.duration.standard,ease:[...y.ease.enter]}},exit:e=>({opacity:0,y:`${e*-.3}em`,filter:`blur(${y.blur.subtle}px)`,transition:{duration:y.duration.fast,ease:[...y.ease.standard]}})},rl={enter:{opacity:0},center:{opacity:1,y:0,filter:`blur(0px)`,transition:{duration:y.duration.instant}},exit:{opacity:0,transition:{duration:y.duration.instant}}},il=(0,H.forwardRef)(function({label:e,description:t,placeholder:n=`Select an option`,options:r,id:i,className:a,disabled:o,onValueChange:s,...c},d){let p=(0,H.useId)(),m=i??p,h=t?`${m}-description`:void 0,g=f(),[_,v]=(0,H.useState)(c.defaultValue??``),y=c.value??_,b=r.findIndex(e=>e.value===y),x=y?r[b]?.label??``:n,[S,C]=(0,H.useState)(b),[w,T]=(0,H.useState)(1);return S!==b&&(C(b),T(b>S?1:-1)),(0,W.jsxs)(`div`,{className:$.field,children:[(0,W.jsx)(`label`,{htmlFor:m,children:e}),(0,W.jsxs)(dc,{...c,disabled:o,onValueChange:e=>{v(e),s?.(e)},children:[(0,W.jsxs)(pc,{ref:d,id:m,"aria-describedby":h,className:[$.trigger,a].filter(Boolean).join(` `),children:[(0,W.jsx)(`span`,{className:$.srOnly,children:(0,W.jsx)(hc,{placeholder:n})}),(0,W.jsx)(`span`,{className:$.valueText,"aria-hidden":`true`,children:(0,W.jsx)(l,{initial:!1,custom:w,children:(0,W.jsx)(u.span,{"data-placeholder":y?void 0:``,custom:w,variants:g?rl:nl,initial:`enter`,animate:`center`,exit:`exit`,children:x},y?`value-${y}`:`placeholder`)})}),(0,W.jsx)(gc,{className:$.chevron,children:(0,W.jsx)(me,{size:16,strokeWidth:1.75,"aria-hidden":`true`})})]}),(0,W.jsx)(yc,{children:(0,W.jsxs)(xc,{className:$.content,position:`popper`,sideOffset:4,collisionPadding:12,children:[(0,W.jsx)(Gc,{className:$.scrollButton,children:(0,W.jsx)(he,{size:16,strokeWidth:1.75,"aria-hidden":`true`})}),(0,W.jsx)(Nc,{className:$.viewport,children:r.map(e=>(0,W.jsxs)(zc,{value:e.value,disabled:e.disabled,className:$.item,children:[(0,W.jsx)(Vc,{children:e.label}),(0,W.jsx)(Uc,{className:$.indicator,children:(0,W.jsx)(pe,{size:16,strokeWidth:1.75,"aria-hidden":`true`})})]},e.value))}),(0,W.jsx)(qc,{className:$.scrollButton,children:(0,W.jsx)(me,{size:16,strokeWidth:1.75,"aria-hidden":`true`})})]})})]}),t&&(0,W.jsx)(`span`,{id:h,className:$.hint,children:t})]})}),al={toast:`_toast_y83pf_1`,icon:`_icon_y83pf_31`,frame:`_frame_y83pf_55`,copy:`_copy_y83pf_67`,title:`_title_y83pf_85`,line:`_line_y83pf_103`,description:`_description_y83pf_117`,close:`_close_y83pf_131`},ol=()=>()=>{},sl={duration:y.duration.fast,ease:[...y.ease.standard]},cl={duration:y.duration.standard,ease:[...y.ease.enter]},ll={opacity:0,y:`0.3em`,filter:`blur(${y.blur.soft}px)`},ul={opacity:0,y:`-0.3em`,filter:`blur(${y.blur.subtle}px)`,transition:sl},dl={opacity:1,y:`0em`,filter:`blur(0px)`},fl={opacity:0,transition:{duration:y.duration.instant}},pl={distance:80,velocity:480};function ml(e){let t=h();return(0,W.jsx)(u.span,{...e,"aria-hidden":!t||e[`aria-hidden`]})}function hl({reduce:e,morphKey:t,children:n}){let r=(0,H.useRef)(null),i=(0,H.useRef)(null),a=s(`auto`),o=(0,H.useRef)(0);return(0,H.useLayoutEffect)(()=>{o.current=performance.now()},[t]),(0,H.useEffect)(()=>{let t=i.current;if(!t||typeof ResizeObserver>`u`)return;let n,s,c=()=>{a.jump(`auto`),r.current&&Object.assign(r.current.style,{overflow:``,height:`auto`})},l=new ResizeObserver(([i])=>{let l=i.borderBoxSize?.[0]?.blockSize??t.offsetHeight,u=a.get(),f=typeof u==`number`?u:n;if(n=l,s?.stop(),e||f===void 0||f===l||performance.now()-o.current>120)return c();r.current&&Object.assign(r.current.style,{overflow:`hidden`,height:`${f}px`}),s=d(a,[f,l],{...y.spring.smooth,onComplete:c})});return l.observe(t),()=>{l.disconnect(),s?.stop()}},[a,e]),(0,W.jsx)(u.div,{ref:r,className:al.frame,style:{height:a},children:(0,W.jsx)(`div`,{ref:i,className:al.copy,children:n})})}function gl({title:e,description:t,open:n=!0,onOpenChange:r,duration:i=4500}){let a=f(),o=(0,H.useSyncExternalStore)(ol,()=>!0,()=>!1),[c]=(0,H.useState)(o),[p,m]=(0,H.useState)(!1),[h,g]=(0,H.useState)(0),[_,v]=(0,H.useState)(n);n!==_&&(v(n),n&&(m(!1),g(0)));let b=n&&!p,x=(0,H.useRef)(null),S=s(0),C=(0,H.useRef)(0);function w(e){g(e),m(!0),r?.(!1)}(0,H.useEffect)(()=>{if(!b||!r||i<=0)return;let e=window.setTimeout(()=>{g(0),m(!0),r(!1)},i);return()=>window.clearTimeout(e)},[b,r,i]);function T(e,t){let n=Math.sign(t.offset.x||t.velocity.x);if(Math.abs(t.offset.x)<pl.distance&&Math.abs(t.velocity.x)<pl.velocity){d(S,0,{...y.spring.snappy,velocity:t.velocity.x});return}C.current=t.velocity.x,w(n*((x.current?.offsetWidth??320)+48))}let E=a?{hidden:{opacity:0},shown:{opacity:1,transition:{duration:y.duration.instant}},exit:fl}:{hidden:{opacity:0,x:0,y:16,scale:.96},shown:{opacity:1,x:0,y:0,scale:1,transition:{...y.spring.morph,opacity:cl}},exit:e=>e?{x:e,opacity:0,transition:{x:{type:`spring`,visualDuration:.3,bounce:0,velocity:C.current,restDelta:2,restSpeed:40},opacity:{duration:y.duration.exit}}}:{opacity:0,y:8,scale:.97,transition:{duration:y.duration.exit,ease:[...y.ease.standard]}}},D={initial:a?{opacity:0}:ll,animate:dl,exit:a?fl:ul,transition:a?{duration:y.duration.instant}:cl};return(0,W.jsx)(l,{initial:c,custom:h,children:b&&(0,W.jsxs)(u.div,{ref:x,className:al.toast,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,custom:h,variants:E,initial:`hidden`,animate:`shown`,exit:`exit`,style:{x:S},drag:a&&o?!1:`x`,dragMomentum:!1,onDragEnd:T,children:[(0,W.jsx)(`span`,{className:al.icon,"aria-hidden":`true`,children:(0,W.jsx)(`svg`,{width:16,height:16,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2.25,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,W.jsx)(u.path,{d:`M4 12.5l5 5L20 6.5`,initial:!a&&{pathLength:0},animate:{pathLength:1},transition:{duration:y.duration.standard,ease:[...y.ease.enter],delay:.12}})})}),(0,W.jsxs)(hl,{reduce:a,morphKey:`${e}\n${t??``}`,children:[(0,W.jsx)(`strong`,{className:al.title,children:(0,W.jsx)(l,{mode:`popLayout`,initial:!1,children:(0,W.jsx)(ml,{className:al.line,...D,children:e},e)})}),(0,W.jsx)(l,{mode:`popLayout`,initial:!1,children:t?(0,W.jsx)(ml,{className:al.description,...D,children:t},t):null})]}),(0,W.jsx)(`button`,{className:al.close,type:`button`,"aria-label":`Dismiss notification`,onClick:()=>w(0),children:(0,W.jsx)(_e,{width:16,height:16,strokeWidth:2,"aria-hidden":`true`})})]},`toast`)})}function _l({open:e,onOpenChange:t,title:n,description:r,children:i,footer:a,width:o=460}){return(0,W.jsx)(or,{open:e,onOpenChange:t,children:(0,W.jsxs)(ur,{title:n,description:r,style:{width:`min(calc(100vw - 2rem), ${o}px)`},children:[i,a&&(0,W.jsx)(`div`,{className:ae(`flex flex-wrap items-center justify-end gap-2`,i!==void 0&&`mt-6`),children:a})]})})}function vl({label:e,icon:t,items:n,iconOnly:r}){return(0,W.jsx)(Ls,{label:e,icon:t,iconOnly:r,items:n.map(e=>({label:e.label,icon:e.icon,destructive:e.destructive,disabled:e.disabled,separatorBefore:e.separatorBefore,onSelect:e.onSelect}))})}var yl=`__astra_empty__`,bl=e=>e===``?yl:e,xl=e=>e===yl?``:e,Sl=12;function Cl({value:e,onChange:t,options:n,placeholder:r,className:i,disabled:a,label:o,ariaLabel:s}){let l=se(),u=n.find(t=>t.value===e),d=c(o,s??r??u?.label),f=ae(`min-w-0`,d.hidden&&`astra-label-hidden`,i);return n.length>Sl?(0,W.jsx)(`div`,{className:f,children:(0,W.jsx)(Se,{label:d.label,description:d.field?.description,placeholder:r??l(`common.search`),emptyMessage:l(`common.noResults`),value:e==null?``:bl(e),onValueChange:e=>t(xl(e)),options:n.map(e=>({value:bl(e.value),label:e.detail&&e.detail!==e.label?`${e.label} · ${e.detail}`:e.label,disabled:e.disabled,keywords:e.detail?[e.detail]:void 0}))})}):(0,W.jsx)(`div`,{className:f,children:(0,W.jsx)(il,{label:d.label,description:d.field?.description,placeholder:r??l(`common.select`),disabled:a,value:e==null||e===``&&!u?``:bl(e),onValueChange:e=>t(xl(e)),options:n.map(e=>({value:bl(e.value),label:e.label,disabled:e.disabled}))})})}var wl=(0,H.createContext)(null);function Tl({children:e}){let t=se(),[n,r]=(0,H.useState)([]),[i,o]=(0,H.useState)(null),s=(0,H.useRef)(0),c=(0,H.useCallback)(e=>r(t=>t.filter(t=>t.id!==e)),[]),l=(0,H.useCallback)((e,t=`info`)=>{let n=++s.current;r(r=>[...r.slice(-2),{id:n,tone:t,text:e}]),t===`error`&&setTimeout(()=>c(n),8e3)},[c]),u=(0,H.useCallback)(e=>new Promise(t=>o({...e,resolve:t})),[]),d=e=>{i?.resolve(e),o(null)};return(0,W.jsxs)(wl.Provider,{value:{toast:l,confirm:u},children:[e,(0,W.jsx)(`div`,{className:`pointer-events-none fixed inset-x-0 bottom-5 z-[95] flex flex-col items-center gap-2 px-4`,children:n.map(e=>e.tone===`error`?(0,W.jsx)(`div`,{className:`pointer-events-auto w-[min(100%,26rem)] selectable`,children:(0,W.jsx)(le,{tone:`danger`,title:t(`common.error`),onDismiss:()=>c(e.id),children:e.text})},e.id):(0,W.jsx)(`div`,{className:`pointer-events-auto flex w-full justify-center`,children:(0,W.jsx)(gl,{title:e.text,open:!0,onOpenChange:t=>!t&&c(e.id)})},e.id))}),(0,W.jsx)(_l,{open:i!==null,onOpenChange:e=>!e&&d(!1),title:i?.title??``,description:i?.detail,width:420,footer:(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(a,{onClick:()=>d(!1),children:t(`common.cancel`)}),(0,W.jsx)(a,{variant:i?.destructive?`destructive`:`primary`,onClick:()=>d(!0),autoFocus:!0,children:i?.confirmLabel??t(`common.confirm`)})]})})]})}function El(){let e=(0,H.useContext)(wl);if(!e)throw Error(`useFeedback outside FeedbackProvider`);return e}function Dl(e){return e instanceof Error?e.message:String(e)}var Ol={canOpenPaths:!!_(),async openPath(e){let t=_();return t?t.openPath(e):!1},async revealLogs(){return await _()?.revealLogs()??!1},async copy(e){if(window.isSecureContext&&navigator.clipboard)try{return await navigator.clipboard.writeText(e),!0}catch{}return Al(e)},async contextMenu(e){let t=_();if(t)return t.showContextMenu(e)},async startService(){let e=_();return e?e.startService():null},async restartService(){let e=_();return e?e.restartService():null}};function kl(e){let t=Math.max(e.lastIndexOf(`/`),e.lastIndexOf(`\\`));return t>0?e.slice(0,t):e}function Al(e){let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.cssText=`position:fixed;top:0;left:0;opacity:0;pointer-events:none`;let n=document.activeElement;document.body.appendChild(t);try{return t.focus(),t.select(),t.setSelectionRange(0,e.length),document.execCommand(`copy`)}catch{return!1}finally{document.body.removeChild(t),n?.focus?.()}}var jl={config:`providers.quota.error.config`,no_key:`providers.quota.error.no_key`,unauthorized:`providers.quota.error.unauthorized`,no_endpoint:`providers.quota.error.no_endpoint`,rate_limited:`providers.quota.error.rate_limited`,upstream:`providers.quota.error.upstream`,timeout:`providers.quota.error.timeout`,network:`providers.quota.error.network`,not_json:`providers.quota.error.not_json`,too_large:`providers.quota.error.too_large`,empty:`providers.quota.error.empty`},Ml=/^[A-Z]{3}$/;function Nl(e,t,n){let r=n===`zh`?`zh-CN`:`en-US`;if(t&&Ml.test(t))try{let n=e!==0&&Math.abs(e)<1;return new Intl.NumberFormat(r,{style:`currency`,currency:t,minimumFractionDigits:2,maximumFractionDigits:n?4:2}).format(e)}catch{}let i=new Intl.NumberFormat(r,{maximumFractionDigits:2}).format(e);return t?`${i} ${t}`:i}var Pl=e=>e.windowMinutes!=null&&e.usedPercent!=null;function Fl(e){return e.usedPercent!=null&&Number.isFinite(e.usedPercent)?Math.min(100,Math.max(0,e.usedPercent)):e.used!=null&&e.total!=null&&e.total>0?Math.min(100,Math.max(0,e.used/e.total*100)):null}function Il(e){return!e?.error||e.fetchedAtUtc&&e.errorAtUtc&&new Date(e.errorAtUtc).getTime()<new Date(e.fetchedAtUtc).getTime()?null:{code:e.errorCode??null,message:e.error}}function Ll(e,t){return e.code?t(jl[e.code]):e.message}function Rl(e,t,n){let r=Fl(e);if(Pl(e))return t(`providers.quota.window`,{window:gu(e.windowMinutes,n),percent:Math.round(r??0)});if(e.remaining!=null){let i=t(`providers.quota.balance`,{amount:Nl(e.remaining,e.unit,n)});return r==null?i:`${i} · ${t(`providers.quota.usedPercent`,{percent:Math.round(r)})}`}return r==null?e.used!=null&&e.total!=null?t(`providers.quota.totalUsed`,{used:Nl(e.used,e.unit,n),total:Nl(e.total,e.unit,n)}):null:t(`providers.quota.usedPercent`,{percent:Math.round(r)})}function zl(e,t,n){let r=_u(e.resetsAtUtc??null,n);return r?t(`providers.quota.resets`,{time:r}):null}function Bl(e,t,n){let r=(e?.plans??[]).map(e=>Rl(e,t,n)).filter(e=>!!e);return e?.isValid===!1&&r.unshift(t(`providers.quota.invalid`)),r.length?r.join(` · `):null}var Vl=e=>e.authScheme!==`oauth-subscription`&&!!e.quotaConfig?.enabled;function Hl(e,t){let n=new Map;for(let r of e)n.set(r.bucket,(n.get(r.bucket)??0)+r[t]);return[...n.entries()].sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>({bucket:e,value:t}))}var Ul=e=>String(e).padStart(2,`0`),Wl=e=>`${e.getFullYear()}-${Ul(e.getMonth()+1)}-${Ul(e.getDate())}`,Gl={"7d":7,"30d":30,"90d":90};function Kl(e,t=new Date){if(e===`today`)return new Date(t.getFullYear(),t.getMonth(),t.getDate());let n=Gl[e];return n?new Date(t.getFullYear(),t.getMonth(),t.getDate()-(n-1)):null}function ql(e=365,t=new Date){let n=new Date(t.getFullYear(),t.getMonth(),t.getDate()),r=new Date(n.getFullYear(),n.getMonth(),n.getDate()-(e-1)),i=new Date(r.getFullYear(),r.getMonth(),r.getDate()-(r.getDay()+6)%7),a=new Date(n.getFullYear(),n.getMonth(),n.getDate()+(6-(n.getDay()+6)%7)),o=[];for(let e=i;e<=a;e=new Date(e.getFullYear(),e.getMonth(),e.getDate()+1))o.push(Wl(e));let s=[],c=[];for(let e=0;e<o.length;e+=7)s.push(Array.from({length:7},(t,n)=>e+n)),c.push({index:s.length-1,month:Number(o[e].slice(5,7)),year:Number(o[e].slice(0,4))});return{days:o,weeks:s,months:s.flatMap((e,t)=>{let n=e.find(e=>o[e].slice(8)===`01`);return n===void 0?[]:[{index:t,label:Number(o[n].slice(5,7))}]}),monthLabels:c}}function Jl(e,t){return e<=0?0:t<=0?1:Math.min(4,Math.max(1,Math.ceil(e/t*4)))}function Yl(e,t=new Date){if(e===`today`){let e=Wl(t);return Array.from({length:24},(t,n)=>`${e}T${Ul(n)}:00`)}let n=Kl(e,t),r=Gl[e]??0;return n?Array.from({length:r},(e,t)=>Wl(new Date(n.getFullYear(),n.getMonth(),n.getDate()+t))):[]}function Xl(e,t){if(t.length===0)return e;let n=new Map(e.map(e=>[e.bucket,e.value]));return t.map(e=>({bucket:e,value:n.get(e)??0}))}var Zl=e=>`${e.slice(5,7)}/${e.slice(8,10)}`,Ql=e=>e.includes(`T`)?e.slice(11,16):Zl(e),$l=e=>e.includes(`T`)?`${Zl(e)} ${e.slice(11,16)}`:Zl(e);function eu(e){let t=new Map;for(let n of e){let e=t.get(n.key)??{key:n.key,requests:0,tokens:0,costUsd:0};e.requests+=n.requests,e.tokens+=n.tokens,e.costUsd+=n.costUsd,t.set(n.key,e)}let n=[...t.values()],r=n.reduce((e,t)=>e+t.costUsd,0),i=n.reduce((e,t)=>e+t.requests,0);return n.map(e=>({...e,share:r>0?e.costUsd/r:i>0?e.requests/i:0}))}function tu(e){return Math.max(0,Math.round(e.requests*(1-e.successRate)))}function nu(e){return!Number.isFinite(e)||e<=0?`$0`:e<.01?`$<0.01`:e<1e3?`$${e.toFixed(2)}`:ee(e,{compact:!0})}function ru(e,t=new Date){return Xl(Hl(e,`requests`),Yl(`today`,t))}var iu=e=>String(e).padStart(2,`0`);function au(e,t=new Date){let n=new Date(t.getFullYear(),t.getMonth(),t.getDate()-1),r=`${n.getFullYear()}-${iu(n.getMonth()+1)}-${iu(n.getDate())}`;return e.filter(e=>e.bucket===r).reduce((e,t)=>e+t.tokens,0)}function ou(e,t){return t<=0?null:(e-t)/t}function su(e,t){let n=[...e].sort((e,t)=>t.tokens-e.tokens)[0];return!n||n.tokens<=0?null:{model:n.model,share:t>0?Math.min(1,n.tokens/t):1}}var cu={session:300,weekly:10080};function lu(e){return e==null||!Number.isFinite(e)?null:Math.min(100,Math.max(0,100-e))}function uu(e,t){let n=lu(t?.usedPercent);return n===null?null:{kind:e,windowMinutes:t?.windowMinutes??cu[e],remaining:n,resetsAt:t?.resetsAtUtc??null}}function du(e){let t=[];for(let{provider:n,account:r}of e){if(r.status!==`active`||!r.quota)continue;let e=r.quota,i=[uu(`session`,e.session),uu(`weekly`,e.weekly)].filter(e=>e!==null),a=lu(e.credits?.usedPercent);a!==null&&i.push({kind:`credits`,windowMinutes:null,remaining:a,resetsAt:null}),i.length!==0&&t.push({accountId:r.id,providerId:n.id,providerName:e.planLabel||n.name,providerIcon:n.icon??null,accountName:r.displayName||r.accountEmail||r.id,rows:i})}return t}function fu(e){let t=[];for(let n of e){if(!n.enabled||!Vl(n)||n.quota?.isValid===!1)continue;let e=[];for(let t of n.quota?.plans??[]){let n=Fl(t);Pl(t)?e.push({kind:`window`,windowMinutes:t.windowMinutes??null,remaining:100-(n??0),resetsAt:t.resetsAtUtc??null}):(t.remaining!=null||n!=null)&&e.push({kind:`balance`,windowMinutes:null,remaining:n==null?null:100-n,resetsAt:t.resetsAtUtc??null,amount:t.remaining==null?null:{value:t.remaining,unit:t.unit??null},label:t.name??null})}e.length!==0&&t.push({accountId:`provider:${n.id}`,providerId:n.id,providerName:n.name,providerIcon:n.icon??null,accountName:``,rows:e})}return t}function pu(e){let t=null;for(let n of e)for(let e of n.rows)e.remaining!==null&&(!t||e.remaining<t.row.remaining)&&(t={plan:n,row:{...e,remaining:e.remaining}});return t}function mu(e,t){let n=[];for(let t of e)for(let e of t.rows)e.remaining!==null&&n.push({plan:t,row:{...e,remaining:e.remaining}});return n.sort((e,t)=>e.row.remaining-t.row.remaining).slice(0,t)}function hu(e){return e<10?`red`:e<30?`orange`:`green`}function gu(e,t){let n=(e,n)=>new Intl.NumberFormat(t===`zh`?`zh-CN`:`en-US`,{style:`unit`,unit:n,unitDisplay:t===`zh`?`long`:`narrow`}).format(e);return e>=1440&&e%1440==0?n(e/1440,`day`):e>=60?n(Math.round(e/60),`hour`):n(e,`minute`)}function _u(e,t,n=Date.now()){if(!e)return null;let r=new Date(e).getTime()-n;if(!Number.isFinite(r)||r<=0)return null;let i=new Intl.RelativeTimeFormat(t===`zh`?`zh-CN`:`en-US`,{numeric:`auto`}),a=r/36e5;return a>=48?i.format(Math.round(a/24),`day`):a>=1?i.format(Math.round(a),`hour`):i.format(Math.max(1,Math.round(r/6e4)),`minute`)}function vu(e,t,n,r=Date.now()){if(!e)return null;let i=Math.max(0,(r-e)/1e3),a=new Intl.RelativeTimeFormat(t===`zh`?`zh-CN`:`en-US`,{numeric:`auto`});return i<60?n:i<3600?a.format(-Math.round(i/60),`minute`):a.format(-Math.round(i/3600),`hour`)}function yu(e,t,n){let r={title:``,detail:``};if(e===`none`)return r;if(e===`alerts`){if(!t.running)return{title:`!`,detail:n.stopped};let e=t.summary?tu(t.summary):0;if(e>0)return{title:`⚠ ${e}`,detail:n.failures(e)};let i=pu(t.plans);if(i&&i.row.remaining<10){let e=`${Math.round(i.row.remaining)}%`;return{title:`⚠ ${e}`,detail:n.quota(i.plan.providerName,n.windowName(i.row),e)}}return r}if(e===`quota`){let e=pu(t.plans);if(!e)return r;let i=`${Math.round(e.row.remaining)}%`;return{title:i,detail:n.quota(e.plan.providerName,n.windowName(e.row),i)}}let i=t.summary;if(!i||!t.running)return r;switch(e){case`requests`:{let e=ie(i.requests,!0);return{title:e,detail:n.requests(e)}}case`tokens`:{let e=ie(i.inputTokens+i.outputTokens,!0);return{title:e,detail:n.tokens(e)}}case`cost`:{let e=nu(i.costUsd);return{title:e,detail:n.cost(e)}}}}var bu={title:`requests`,sections:{overview:!0,cost:!0,chart:!0,topModel:!0,compareYesterday:!1,cacheHitRate:!1,quota:!0,clients:!1}},xu=()=>!!_()?.tray;function Su(){let[e,t]=(0,H.useState)(bu),[n,r]=(0,H.useState)(!_()?.tray);return(0,H.useEffect)(()=>{let e=_()?.tray;if(!e)return;let n=!0;e.getPrefs().then(e=>{n&&(t(e),r(!0))});let i=e.onPrefsChanged(t);return()=>{n=!1,i()}},[]),[e,(0,H.useCallback)(e=>{t(e);let n=_()?.tray;n&&n.setPrefs(e).then(t)},[]),n]}function Cu(){let e=o(),[t,n]=(0,H.useState)(null);return(0,H.useEffect)(()=>{let e=_()?.tray;if(!e)return;let t=!0;e.getState().then(e=>{t&&n(e)});let r=e.onStateChanged(n);return()=>{t=!1,r()}},[]),t??{running:e.isSuccess,port:null,activity:null,apiVersionMismatch:!1,updateAvailable:null}}function wu(e,t,n){return{...e,sections:{...e.sections,[t]:n}}}var Tu=3e5,Eu=new Map,Du=()=>-new Date().getTimezoneOffset(),Ou=Object.fromEntries(g.map(e=>[e,!1]));function ku(e,t){let n=ce(),{enabled:r,background:i}=t,a=t.titleOnly?Ou:e.sections,o=e.title!==`none`&&e.title!==`quota`,s=e.title===`quota`||e.title===`alerts`,c={refetchInterval:15e3,refetchIntervalInBackground:!1},l=a.quota||s,u=b({queryKey:A.settings,queryFn:()=>oe(`GET`,`/api/settings`),enabled:r}),d=b({queryKey:A.stats(`summary`,`today`,``,``),queryFn:()=>oe(`GET`,`/api/stats/summary?range=today`),enabled:r,...c,refetchIntervalInBackground:i&&o}),f=b({queryKey:A.stats(`timeseries`,`today`,`hour`,`provider`,``,``,Du()),queryFn:()=>oe(`GET`,`/api/stats/timeseries?range=today&groupBy=hour&by=provider&tzOffset=${Du()}`),enabled:r&&a.chart,...c,refetchInterval:3e4}),p=b({queryKey:A.stats(`timeseries`,`7d`,`day`,`provider`,``,``,Du()),queryFn:()=>oe(`GET`,`/api/stats/timeseries?range=7d&groupBy=day&by=provider&tzOffset=${Du()}`),enabled:r&&a.compareYesterday,...c,refetchInterval:6e4}),m=b({queryKey:A.stats(`top`,`today`,``,3,``),queryFn:()=>oe(`GET`,`/api/stats/top-models?range=today&limit=3`),enabled:r&&a.topModel,...c,refetchInterval:3e4}),h=b({queryKey:A.providers,queryFn:()=>oe(`GET`,`/api/providers`),enabled:r&&(l||a.clients),...c,refetchInterval:6e4,refetchIntervalInBackground:i&&s}),g=b({queryKey:A.clients,queryFn:()=>oe(`GET`,`/api/clients`),enabled:r&&a.clients,...c,refetchInterval:3e4}),_=(0,H.useMemo)(()=>(h.data??[]).filter(e=>e.enabled&&e.authScheme===`oauth-subscription`),[h.data]),v=be({queries:_.map(e=>({queryKey:A.providerAccounts(e.id),queryFn:()=>oe(`GET`,`/api/providers/${ue(e.id)}/accounts`),enabled:r&&l,...c,refetchInterval:6e4,refetchIntervalInBackground:i&&s}))}),y=_.flatMap((e,t)=>(v[t]?.data??[]).map(t=>({provider:e,account:t}))),S=y.map(e=>`${e.account.id}:${e.account.status}:${e.account.quota?.fetchedAtUtc??``}`).join(`|`),C=x({mutationFn:e=>oe(`POST`,`/api/provider-accounts/${ue(e)}/quota`),onSettled:e=>{e&&n.invalidateQueries({queryKey:A.providerAccounts(e.providerId)})}}),w=r&&l&&(t.live||e.title===`quota`||e.title===`alerts`);(0,H.useEffect)(()=>{if(!w)return;let e=Date.now();for(let{account:t}of y){if(t.status!==`active`)continue;let n=t.quota?.fetchedAtUtc?new Date(t.quota.fetchedAtUtc).getTime():0;Number.isFinite(n)&&e-n<Tu||e-(Eu.get(t.id)??0)<Tu||(Eu.set(t.id,e),C.mutate(t.id,{onError:()=>{}}))}},[w,S]);let T=[...du(y),...fu(h.data??[])];return{settings:u.data,summary:d.data,hourly:f.data??[],daily:p.data??[],top:m.data??[],plans:T,hasSubscriptions:y.some(e=>e.account.status===`active`),clients:g.data??[],providers:h.data??[],updatedAt:d.dataUpdatedAt,loading:d.isLoading,error:d.isError}}function Au(e,t,n,r){let{t:a,locale:o}=i(),s=_(),c=(0,H.useMemo)(()=>({requests:e=>a(`tray.title.requests`,{count:e}),tokens:e=>a(`tray.title.tokens`,{count:e}),cost:e=>a(`tray.title.cost`,{amount:e}),quota:(e,t,n)=>a(`tray.title.quota`,{plan:e,window:t,remaining:n}),failures:e=>a(`tray.title.failures`,{count:e}),stopped:a(`tray.status.stopped`),windowName:e=>e.kind===`balance`?e.label??a(`tray.quotaBalance`):e.kind===`credits`||e.windowMinutes==null?a(`tray.quotaCredits`):gu(e.windowMinutes,o)}),[a,o]),l=yu(e.title,{running:t.running,summary:n,plans:r},c);(0,H.useEffect)(()=>{s?.tray.setTitle(l.title,l.detail)},[s,l.title,l.detail])}function ju(){let[e]=Su(),t=Cu(),n=ku(e,{enabled:t.running,background:!0,live:!1,titleOnly:!0});return Au(e,t,n.summary,n.plans),null}export{Os as $,Ll as A,vl as B,eu as C,Xl as D,Hl as E,Il as F,qs as G,_l as H,Bl as I,js as J,Es as K,kl as L,Rl as M,zl as N,Yl as O,Vl as P,Fs as Q,Ol as R,Jl as S,$l as T,Dl as U,Cl as V,El as W,Ps as X,Ms as Y,ks as Z,su as _,xu as a,Ia as at,au as b,wu as c,ur as ct,nu as d,be as dt,co as et,ru as f,mu as g,pu as h,bu as i,Ma as it,Nl as j,Kl as k,ou as l,ot as lt,_u as m,Au as n,ro as nt,Su as o,Da as ot,hu as p,Ns as q,ku as r,Aa as rt,Cu as s,or as st,ju as t,fo as tt,tu as u,je as ut,vu as v,Ql as w,ql as x,gu as y,Tl as z};
@@ -1 +0,0 @@
1
- import{t as e}from"./createLucideIcon-7fjTeqBK.js";var t={name:`file-up`,size:24,node:[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M12 12v6`,key:`3ahymv`}],[`path`,{d:`m15 15-3-3-3 3`,key:`15xj92`}]]};t.node;var n=e(t);export{t as __iconData,n as default};
@@ -1 +0,0 @@
1
- import{t as e}from"./createLucideIcon-7fjTeqBK.js";var t={name:`flame`,size:24,node:[[`path`,{d:`M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4`,key:`1slcih`}]]};t.node;var n=e(t);export{t as __iconData,n as default};