blade-code 0.9.0 → 0.10.0

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 (137) hide show
  1. package/README.md +20 -5
  2. package/dist/blade.js +4 -4
  3. package/dist/chunk-0aj7gp37.js +2 -0
  4. package/dist/{chunk-1v2n922p.js → chunk-0h81hxkw.js} +1 -1
  5. package/dist/chunk-2beq0syt.js +2 -0
  6. package/dist/chunk-2fdjn926.js +1 -0
  7. package/dist/chunk-3c5gvxr6.js +1 -0
  8. package/dist/chunk-44wkjs2j.js +114 -0
  9. package/dist/chunk-4vaywb2r.js +2 -0
  10. package/dist/{chunk-x40fkg4z.js → chunk-61087jc8.js} +2 -2
  11. package/dist/chunk-6g21dh3n.js +1 -0
  12. package/dist/chunk-6hj2dk75.js +3 -0
  13. package/dist/chunk-6n5xdf2r.js +2 -0
  14. package/dist/{chunk-d7y2mf7c.js → chunk-6qe5k7dw.js} +2 -2
  15. package/dist/chunk-7dcm1aqd.js +1 -0
  16. package/dist/chunk-7eptyk20.js +1 -0
  17. package/dist/chunk-88vy9hh0.js +4 -0
  18. package/dist/{chunk-gdm1xzvp.js → chunk-8nm1hqr1.js} +2 -2
  19. package/dist/chunk-8rg05w47.js +174 -0
  20. package/dist/chunk-93ptxa5p.js +4 -0
  21. package/dist/chunk-949btxxx.js +1485 -0
  22. package/dist/chunk-9jy87d0y.js +3 -0
  23. package/dist/chunk-9kd14cwq.js +1 -0
  24. package/dist/chunk-a7nbn5kf.js +3 -0
  25. package/dist/chunk-af49jmns.js +5 -0
  26. package/dist/chunk-asbp4cv4.js +1 -0
  27. package/dist/chunk-beqaxytd.js +2 -0
  28. package/dist/chunk-bqdc3m0p.js +6 -0
  29. package/dist/chunk-bx50res5.js +99 -0
  30. package/dist/chunk-cznge1n7.js +1 -0
  31. package/dist/{chunk-ax7bx0j8.js → chunk-d3236505.js} +1 -1
  32. package/dist/chunk-d9ddpapp.js +18 -0
  33. package/dist/chunk-e3tk2jna.js +636 -0
  34. package/dist/chunk-f8db8ftd.js +10 -0
  35. package/dist/chunk-fjp5tvh8.js +1 -0
  36. package/dist/chunk-fjw32ex5.js +2 -0
  37. package/dist/chunk-gafbzeyk.js +1 -0
  38. package/dist/chunk-hh3xw391.js +6 -0
  39. package/dist/chunk-hzvp3bc1.js +44 -0
  40. package/dist/chunk-jv4nkkb5.js +1 -0
  41. package/dist/{chunk-2fbwmdvg.js → chunk-jxv6r0c7.js} +2 -2
  42. package/dist/{chunk-aq7wf2zt.js → chunk-kq5my0yy.js} +2 -2
  43. package/dist/chunk-m3tx1k0s.js +1 -0
  44. package/dist/chunk-m78ceafk.js +1 -0
  45. package/dist/{chunk-ppyg431d.js → chunk-mjp61rqd.js} +1 -1
  46. package/dist/chunk-mvwp3c11.js +45 -0
  47. package/dist/chunk-mwrn7mcr.js +1 -0
  48. package/dist/chunk-mxhg6jt9.js +25 -0
  49. package/dist/chunk-nah0cbnp.js +2 -0
  50. package/dist/chunk-px5ck9pf.js +2 -0
  51. package/dist/chunk-qev36qrb.js +2 -0
  52. package/dist/{chunk-z0qxaky4.js → chunk-sndbq5xt.js} +1 -1
  53. package/dist/chunk-t8q9ks7e.js +3 -0
  54. package/dist/{chunk-mns8e65q.js → chunk-th7sxjtk.js} +2 -2
  55. package/dist/{chunk-rmfk5f9m.js → chunk-ty2kc6kg.js} +2 -2
  56. package/dist/chunk-v4mr98vm.js +1 -0
  57. package/dist/chunk-vb0t2hhd.js +25 -0
  58. package/dist/{chunk-w3me85va.js → chunk-vjpd3nee.js} +2 -2
  59. package/dist/chunk-vvy506b3.js +3 -0
  60. package/dist/chunk-vyq9r31h.js +22 -0
  61. package/dist/chunk-w4qsayn6.js +9 -0
  62. package/dist/chunk-wsqz3x2e.js +161 -0
  63. package/dist/{chunk-bc6wbcrs.js → chunk-wvj9h7mb.js} +1 -1
  64. package/dist/chunk-yvah5h4x.js +13 -0
  65. package/dist/chunk-z5ae4qvf.js +2 -0
  66. package/dist/chunk-zcw7kyf4.js +2 -0
  67. package/dist/{chunk-j8en7x02.js → chunk-zkbf8n6y.js} +1 -1
  68. package/dist/web/assets/ChatView-CnwNosSG.js +7 -0
  69. package/dist/web/assets/CodeBlockHighlighter-CBo_AxjZ.js +8 -0
  70. package/dist/web/assets/FilePreview-hNo6RCNY.js +8 -0
  71. package/dist/web/assets/MarkdownRenderer-BON4fqSr.js +30 -0
  72. package/dist/web/assets/McpModal-Go_8v1Vu.js +5 -0
  73. package/dist/web/assets/SettingsModal-CRu1zGQf.js +1 -0
  74. package/dist/web/assets/TaskSwitcher-Ds8CBVtp.js +1 -0
  75. package/dist/web/assets/TerminalPanel-Dm4bu6ib.js +1 -0
  76. package/dist/web/assets/index-BNsnHxlt.js +32 -0
  77. package/dist/web/assets/index-DI8ZWdWH.js +11 -0
  78. package/dist/web/assets/index-DVTiq-7u.css +1 -0
  79. package/dist/web/assets/vendor-icons-CsBKlDXT.js +381 -0
  80. package/dist/web/assets/vendor-radix-DXRuAJHH.js +45 -0
  81. package/dist/web/assets/vendor-react-DG5dkZ_t.js +49 -0
  82. package/dist/web/index.html +5 -2
  83. package/package.json +36 -34
  84. package/dist/chunk-0abtfzm6.js +0 -1
  85. package/dist/chunk-0zkhjsbv.js +0 -1
  86. package/dist/chunk-119fhp5q.js +0 -9
  87. package/dist/chunk-1rpgvk3r.js +0 -10
  88. package/dist/chunk-3qgj2y5r.js +0 -1
  89. package/dist/chunk-45bme7n9.js +0 -2
  90. package/dist/chunk-5jq01mg6.js +0 -4
  91. package/dist/chunk-5nye3k5w.js +0 -1
  92. package/dist/chunk-7pevqbfd.js +0 -2
  93. package/dist/chunk-8dqvnx7n.js +0 -2
  94. package/dist/chunk-8edsvxf3.js +0 -1
  95. package/dist/chunk-8vemqfe4.js +0 -2
  96. package/dist/chunk-8vtznxpq.js +0 -5
  97. package/dist/chunk-936ft6kq.js +0 -2
  98. package/dist/chunk-9ax02vtg.js +0 -22
  99. package/dist/chunk-9qknesxs.js +0 -6
  100. package/dist/chunk-acegy4td.js +0 -3
  101. package/dist/chunk-aewrn5xp.js +0 -1
  102. package/dist/chunk-b10vr4xj.js +0 -2
  103. package/dist/chunk-bfgm5k3e.js +0 -1566
  104. package/dist/chunk-cf3fhs7j.js +0 -1
  105. package/dist/chunk-e1586s4t.js +0 -1
  106. package/dist/chunk-enk621t7.js +0 -98
  107. package/dist/chunk-fpr6d8zc.js +0 -2
  108. package/dist/chunk-gagt42k2.js +0 -13
  109. package/dist/chunk-gm62cfjw.js +0 -1
  110. package/dist/chunk-h3bjmkvz.js +0 -1
  111. package/dist/chunk-jyr9417h.js +0 -34
  112. package/dist/chunk-mcnfbhpr.js +0 -6
  113. package/dist/chunk-mpkr3s6b.js +0 -3
  114. package/dist/chunk-n9tgxfvw.js +0 -615
  115. package/dist/chunk-qxhrzws6.js +0 -1
  116. package/dist/chunk-r6h7eja3.js +0 -151
  117. package/dist/chunk-r8pjwjt6.js +0 -1
  118. package/dist/chunk-rrg9bw8r.js +0 -25
  119. package/dist/chunk-wtxwny0p.js +0 -41
  120. package/dist/chunk-x548f12z.js +0 -2
  121. package/dist/chunk-xtfzjb72.js +0 -6
  122. package/dist/web/assets/CodeBlockHighlighter-D8_cOYpG.js +0 -1
  123. package/dist/web/assets/FilePreview-DpovIbME.js +0 -7
  124. package/dist/web/assets/MarkdownRenderer-73wC_SGk.js +0 -1
  125. package/dist/web/assets/McpModal-CIpxuyTG.js +0 -5
  126. package/dist/web/assets/SettingsModal-BBa1libe.js +0 -1
  127. package/dist/web/assets/SettingsStore-C8YBWQPS.js +0 -1
  128. package/dist/web/assets/SkillsModal-DArZ-nCX.js +0 -1
  129. package/dist/web/assets/TerminalPanel-BX7C7qiD.js +0 -1
  130. package/dist/web/assets/index-Ch0eqSLM.css +0 -1
  131. package/dist/web/assets/index-DIWzaS2_.js +0 -16
  132. package/dist/web/assets/useRequest-B4kP-cmG.js +0 -1
  133. package/dist/web/assets/vendor-icons-DBM55KTG.js +0 -251
  134. package/dist/web/assets/vendor-markdown-b9iCqZWK.js +0 -36
  135. package/dist/web/assets/vendor-monaco-w6PwaWGP.js +0 -11
  136. package/dist/web/assets/vendor-radix-DyP_DOwV.js +0 -45
  137. package/dist/web/assets/vendor-react-FPIC4Czm.js +0 -49
@@ -0,0 +1,45 @@
1
+ import{r as a,R as Pt,j as m,a as Rn,b as uo}from"./vendor-react-DG5dkZ_t.js";function en(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Re(...e){return t=>{let n=!1;const r=e.map(o=>{const i=en(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():en(e[o],null)}}}}function F(...e){return a.useCallback(Re(...e),e)}var fo=Symbol.for("react.lazy"),He=Pt[" use ".trim().toString()];function po(e){return typeof e=="object"&&e!==null&&"then"in e}function An(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===fo&&"_payload"in e&&po(e._payload)}function ho(e){const t=vo(e),n=a.forwardRef((r,o)=>{let{children:i,...s}=r;An(i)&&typeof He=="function"&&(i=He(i._payload));const c=a.Children.toArray(i),u=c.find(go);if(u){const l=u.props.children,f=c.map(d=>d===u?a.Children.count(l)>1?a.Children.only(null):a.isValidElement(l)?l.props.children:null:d);return m.jsx(t,{...s,ref:o,children:a.isValidElement(l)?a.cloneElement(l,void 0,f):null})}return m.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}var xa=ho("Slot");function vo(e){const t=a.forwardRef((n,r)=>{let{children:o,...i}=n;if(An(o)&&typeof He=="function"&&(o=He(o._payload)),a.isValidElement(o)){const s=wo(o),c=yo(i,o.props);return o.type!==a.Fragment&&(c.ref=r?Re(r,s):s),a.cloneElement(o,c)}return a.Children.count(o)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var mo=Symbol("radix.slottable");function go(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===mo}function yo(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...c)=>{const u=i(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function wo(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function _(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function bo(e,t){const n=a.createContext(t),r=i=>{const{children:s,...c}=i,u=a.useMemo(()=>c,Object.values(c));return m.jsx(n.Provider,{value:u,children:s})};r.displayName=e+"Provider";function o(i){const s=a.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function Ae(e,t=[]){let n=[];function r(i,s){const c=a.createContext(s),u=n.length;n=[...n,s];const l=d=>{var w;const{scope:p,children:h,...g}=d,v=((w=p==null?void 0:p[e])==null?void 0:w[u])||c,y=a.useMemo(()=>g,Object.values(g));return m.jsx(v.Provider,{value:y,children:h})};l.displayName=i+"Provider";function f(d,p){var v;const h=((v=p==null?void 0:p[e])==null?void 0:v[u])||c,g=a.useContext(h);if(g)return g;if(s!==void 0)return s;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[l,f]}const o=()=>{const i=n.map(s=>a.createContext(s));return function(c){const u=(c==null?void 0:c[e])||i;return a.useMemo(()=>({[`__scope${e}`]:{...c,[e]:u}}),[c,u])}};return o.scopeName=e,[r,xo(o,...t)]}function xo(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((c,{useScope:u,scopeName:l})=>{const d=u(i)[`__scope${l}`];return{...c,...d}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var ne=globalThis!=null&&globalThis.document?a.useLayoutEffect:()=>{},Co=Pt[" useId ".trim().toString()]||(()=>{}),So=0;function Se(e){const[t,n]=a.useState(Co());return ne(()=>{n(r=>r??String(So++))},[e]),e||(t?`radix-${t}`:"")}var Eo=Pt[" useInsertionEffect ".trim().toString()]||ne;function Rt({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,s]=Po({defaultProp:t,onChange:n}),c=e!==void 0,u=c?e:o;{const f=a.useRef(e!==void 0);a.useEffect(()=>{const d=f.current;d!==c&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),f.current=c},[c,r])}const l=a.useCallback(f=>{var d;if(c){const p=Ro(f)?f(e):f;p!==e&&((d=s.current)==null||d.call(s,p))}else i(f)},[c,e,i,s]);return[u,l]}function Po({defaultProp:e,onChange:t}){const[n,r]=a.useState(e),o=a.useRef(n),i=a.useRef(t);return Eo(()=>{i.current=t},[t]),a.useEffect(()=>{var s;o.current!==n&&((s=i.current)==null||s.call(i,n),o.current=n)},[n,o]),[n,r,i]}function Ro(e){return typeof e=="function"}function Ao(e){const t=To(e),n=a.forwardRef((r,o)=>{const{children:i,...s}=r,c=a.Children.toArray(i),u=c.find(Do);if(u){const l=u.props.children,f=c.map(d=>d===u?a.Children.count(l)>1?a.Children.only(null):a.isValidElement(l)?l.props.children:null:d);return m.jsx(t,{...s,ref:o,children:a.isValidElement(l)?a.cloneElement(l,void 0,f):null})}return m.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function To(e){const t=a.forwardRef((n,r)=>{const{children:o,...i}=n;if(a.isValidElement(o)){const s=No(o),c=_o(i,o.props);return o.type!==a.Fragment&&(c.ref=r?Re(r,s):s),a.cloneElement(o,c)}return a.Children.count(o)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Oo=Symbol("radix.slottable");function Do(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Oo}function _o(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...c)=>{const u=i(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function No(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Lo=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],L=Lo.reduce((e,t)=>{const n=Ao(`Primitive.${t}`),r=a.forwardRef((o,i)=>{const{asChild:s,...c}=o,u=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(u,{...c,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Mo(e,t){e&&Rn.flushSync(()=>e.dispatchEvent(t))}function B(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Io(e,t=globalThis==null?void 0:globalThis.document){const n=B(e);a.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var jo="DismissableLayer",yt="dismissableLayer.update",ko="dismissableLayer.pointerDownOutside",Fo="dismissableLayer.focusOutside",tn,Tn=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ke=a.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:c,...u}=e,l=a.useContext(Tn),[f,d]=a.useState(null),p=(f==null?void 0:f.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=a.useState({}),g=F(t,E=>d(E)),v=Array.from(l.layers),[y]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),w=v.indexOf(y),b=f?v.indexOf(f):-1,C=l.layersWithOutsidePointerEventsDisabled.size>0,x=b>=w,S=Ho(E=>{const O=E.target,R=[...l.branches].some(A=>A.contains(O));!x||R||(o==null||o(E),s==null||s(E),E.defaultPrevented||c==null||c())},p),P=Bo(E=>{const O=E.target;[...l.branches].some(A=>A.contains(O))||(i==null||i(E),s==null||s(E),E.defaultPrevented||c==null||c())},p);return Io(E=>{b===l.layers.size-1&&(r==null||r(E),!E.defaultPrevented&&c&&(E.preventDefault(),c()))},p),a.useEffect(()=>{if(f)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(tn=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(f)),l.layers.add(f),nn(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=tn)}},[f,p,n,l]),a.useEffect(()=>()=>{f&&(l.layers.delete(f),l.layersWithOutsidePointerEventsDisabled.delete(f),nn())},[f,l]),a.useEffect(()=>{const E=()=>h({});return document.addEventListener(yt,E),()=>document.removeEventListener(yt,E)},[]),m.jsx(L.div,{...u,ref:g,style:{pointerEvents:C?x?"auto":"none":void 0,...e.style},onFocusCapture:_(e.onFocusCapture,P.onFocusCapture),onBlurCapture:_(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:_(e.onPointerDownCapture,S.onPointerDownCapture)})});Ke.displayName=jo;var Wo="DismissableLayerBranch",$o=a.forwardRef((e,t)=>{const n=a.useContext(Tn),r=a.useRef(null),o=F(t,r);return a.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),m.jsx(L.div,{...e,ref:o})});$o.displayName=Wo;function Ho(e,t=globalThis==null?void 0:globalThis.document){const n=B(e),r=a.useRef(!1),o=a.useRef(()=>{});return a.useEffect(()=>{const i=c=>{if(c.target&&!r.current){let u=function(){On(ko,n,l,{discrete:!0})};const l={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=u,t.addEventListener("click",o.current,{once:!0})):u()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Bo(e,t=globalThis==null?void 0:globalThis.document){const n=B(e),r=a.useRef(!1);return a.useEffect(()=>{const o=i=>{i.target&&!r.current&&On(Fo,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function nn(){const e=new CustomEvent(yt);document.dispatchEvent(e)}function On(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Mo(o,i):o.dispatchEvent(i)}var lt="focusScope.autoFocusOnMount",ut="focusScope.autoFocusOnUnmount",rn={bubbles:!1,cancelable:!0},Vo="FocusScope",At=a.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[c,u]=a.useState(null),l=B(o),f=B(i),d=a.useRef(null),p=F(t,v=>u(v)),h=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(r){let v=function(C){if(h.paused||!c)return;const x=C.target;c.contains(x)?d.current=x:ie(d.current,{select:!0})},y=function(C){if(h.paused||!c)return;const x=C.relatedTarget;x!==null&&(c.contains(x)||ie(d.current,{select:!0}))},w=function(C){if(document.activeElement===document.body)for(const S of C)S.removedNodes.length>0&&ie(c)};document.addEventListener("focusin",v),document.addEventListener("focusout",y);const b=new MutationObserver(w);return c&&b.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",y),b.disconnect()}}},[r,c,h.paused]),a.useEffect(()=>{if(c){sn.add(h);const v=document.activeElement;if(!c.contains(v)){const w=new CustomEvent(lt,rn);c.addEventListener(lt,l),c.dispatchEvent(w),w.defaultPrevented||(zo(Ko(Dn(c)),{select:!0}),document.activeElement===v&&ie(c))}return()=>{c.removeEventListener(lt,l),setTimeout(()=>{const w=new CustomEvent(ut,rn);c.addEventListener(ut,f),c.dispatchEvent(w),w.defaultPrevented||ie(v??document.body,{select:!0}),c.removeEventListener(ut,f),sn.remove(h)},0)}}},[c,l,f,h]);const g=a.useCallback(v=>{if(!n&&!r||h.paused)return;const y=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,w=document.activeElement;if(y&&w){const b=v.currentTarget,[C,x]=Uo(b);C&&x?!v.shiftKey&&w===x?(v.preventDefault(),n&&ie(C,{select:!0})):v.shiftKey&&w===C&&(v.preventDefault(),n&&ie(x,{select:!0})):w===b&&v.preventDefault()}},[n,r,h.paused]);return m.jsx(L.div,{tabIndex:-1,...s,ref:p,onKeyDown:g})});At.displayName=Vo;function zo(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(ie(r,{select:t}),document.activeElement!==n)return}function Uo(e){const t=Dn(e),n=on(t,e),r=on(t.reverse(),e);return[n,r]}function Dn(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function on(e,t){for(const n of e)if(!Yo(n,{upTo:t}))return n}function Yo(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}function Xo(e){return e instanceof HTMLInputElement&&"select"in e}function ie(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Xo(e)&&t&&e.select()}}var sn=Go();function Go(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=cn(e,t),e.unshift(t)},remove(t){var n;e=cn(e,t),(n=e[0])==null||n.resume()}}}function cn(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Ko(e){return e.filter(t=>t.tagName!=="A")}var Zo="Portal",Tt=a.forwardRef((e,t)=>{var c;const{container:n,...r}=e,[o,i]=a.useState(!1);ne(()=>i(!0),[]);const s=n||o&&((c=globalThis==null?void 0:globalThis.document)==null?void 0:c.body);return s?uo.createPortal(m.jsx(L.div,{...r,ref:t}),s):null});Tt.displayName=Zo;function qo(e,t){return a.useReducer((n,r)=>t[n][r]??n,e)}var X=e=>{const{present:t,children:n}=e,r=Qo(t),o=typeof n=="function"?n({present:r.isPresent}):a.Children.only(n),i=F(r.ref,Jo(o));return typeof n=="function"||r.isPresent?a.cloneElement(o,{ref:i}):null};X.displayName="Presence";function Qo(e){const[t,n]=a.useState(),r=a.useRef(null),o=a.useRef(e),i=a.useRef("none"),s=e?"mounted":"unmounted",[c,u]=qo(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return a.useEffect(()=>{const l=Ne(r.current);i.current=c==="mounted"?l:"none"},[c]),ne(()=>{const l=r.current,f=o.current;if(f!==e){const p=i.current,h=Ne(l);e?u("MOUNT"):h==="none"||(l==null?void 0:l.display)==="none"?u("UNMOUNT"):u(f&&p!==h?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),ne(()=>{if(t){let l;const f=t.ownerDocument.defaultView??window,d=h=>{const v=Ne(r.current).includes(CSS.escape(h.animationName));if(h.target===t&&v&&(u("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",l=f.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},p=h=>{h.target===t&&(i.current=Ne(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{f.clearTimeout(l),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:a.useCallback(l=>{r.current=l?getComputedStyle(l):null,n(l)},[])}}function Ne(e){return(e==null?void 0:e.animationName)||"none"}function Jo(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var ft=0;function _n(){a.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??an()),document.body.insertAdjacentElement("beforeend",e[1]??an()),ft++,()=>{ft===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),ft--}},[])}function an(){const 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}var Z=function(){return Z=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},Z.apply(this,arguments)};function Nn(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 o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function Ca(e,t,n,r){function o(i){return i instanceof n?i:new n(function(s){s(i)})}return new(n||(n=Promise))(function(i,s){function c(f){try{l(r.next(f))}catch(d){s(d)}}function u(f){try{l(r.throw(f))}catch(d){s(d)}}function l(f){f.done?i(f.value):o(f.value).then(c,u)}l((r=r.apply(e,t||[])).next())})}function Sa(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=c(0),s.throw=c(1),s.return=c(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function c(l){return function(f){return u([l,f])}}function u(l){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,l[0]&&(n=0)),n;)try{if(r=1,o&&(i=l[0]&2?o.return:l[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,l[1])).done)return i;switch(o=0,i&&(l=[l[0]&2,i.value]),l[0]){case 0:case 1:i=l;break;case 4:return n.label++,{value:l[1],done:!1};case 5:n.label++,o=l[1],l=[0];continue;case 7:l=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(l[0]===6||l[0]===2)){n=0;continue}if(l[0]===3&&(!i||l[1]>i[0]&&l[1]<i[3])){n.label=l[1];break}if(l[0]===6&&n.label<i[1]){n.label=i[1],i=l;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(l);break}i[2]&&n.ops.pop(),n.trys.pop();continue}l=t.call(e,n)}catch(f){l=[6,f],o=0}finally{r=i=0}if(l[0]&5)throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}function Ea(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,i=[],s;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(c){s={error:c}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return i}function ei(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var Fe="right-scroll-bar-position",We="width-before-scroll-bar",ti="with-scroll-bars-hidden",ni="--removed-body-scroll-bar-size";function dt(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function ri(e,t){var n=a.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var oi=typeof window<"u"?a.useLayoutEffect:a.useEffect,ln=new WeakMap;function ii(e,t){var n=ri(null,function(r){return e.forEach(function(o){return dt(o,r)})});return oi(function(){var r=ln.get(n);if(r){var o=new Set(r),i=new Set(e),s=n.current;o.forEach(function(c){i.has(c)||dt(c,null)}),i.forEach(function(c){o.has(c)||dt(c,s)})}ln.set(n,e)},[e]),n}function si(e){return e}function ci(e,t){t===void 0&&(t=si);var n=[],r=!1,o={read:function(){if(r)throw new 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(i){var s=t(i,r);return n.push(s),function(){n=n.filter(function(c){return c!==s})}},assignSyncMedium:function(i){for(r=!0;n.length;){var s=n;n=[],s.forEach(i)}n={push:function(c){return i(c)},filter:function(){return n}}},assignMedium:function(i){r=!0;var s=[];if(n.length){var c=n;n=[],c.forEach(i),s=n}var u=function(){var f=s;s=[],f.forEach(i)},l=function(){return Promise.resolve().then(u)};l(),n={push:function(f){s.push(f),l()},filter:function(f){return s=s.filter(f),n}}}};return o}function ai(e){e===void 0&&(e={});var t=ci(null);return t.options=Z({async:!0,ssr:!1},e),t}var Ln=function(e){var t=e.sideCar,n=Nn(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return a.createElement(r,Z({},n))};Ln.isSideCarExport=!0;function li(e,t){return e.useMedium(t),Ln}var Mn=ai(),pt=function(){},Ze=a.forwardRef(function(e,t){var n=a.useRef(null),r=a.useState({onScrollCapture:pt,onWheelCapture:pt,onTouchMoveCapture:pt}),o=r[0],i=r[1],s=e.forwardProps,c=e.children,u=e.className,l=e.removeScrollBar,f=e.enabled,d=e.shards,p=e.sideCar,h=e.noRelative,g=e.noIsolation,v=e.inert,y=e.allowPinchZoom,w=e.as,b=w===void 0?"div":w,C=e.gapMode,x=Nn(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=p,P=ii([n,t]),E=Z(Z({},x),o);return a.createElement(a.Fragment,null,f&&a.createElement(S,{sideCar:Mn,removeScrollBar:l,shards:d,noRelative:h,noIsolation:g,inert:v,setCallbacks:i,allowPinchZoom:!!y,lockRef:n,gapMode:C}),s?a.cloneElement(a.Children.only(c),Z(Z({},E),{ref:P})):a.createElement(b,Z({},E,{className:u,ref:P}),c))});Ze.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ze.classNames={fullWidth:We,zeroRight:Fe};var ui=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function fi(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=ui();return t&&e.setAttribute("nonce",t),e}function di(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function pi(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var hi=function(){var e=0,t=null;return{add:function(n){e==0&&(t=fi())&&(di(t,n),pi(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},vi=function(){var e=hi();return function(t,n){a.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},In=function(){var e=vi(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},mi={left:0,top:0,right:0,gap:0},ht=function(e){return parseInt(e||"",10)||0},gi=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[ht(n),ht(r),ht(o)]},yi=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return mi;var t=gi(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])}},wi=In(),he="data-scroll-locked",bi=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,c=e.gap;return n===void 0&&(n="margin"),`
2
+ .`.concat(ti,` {
3
+ overflow: hidden `).concat(r,`;
4
+ padding-right: `).concat(c,"px ").concat(r,`;
5
+ }
6
+ body[`).concat(he,`] {
7
+ overflow: hidden `).concat(r,`;
8
+ overscroll-behavior: contain;
9
+ `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
10
+ padding-left: `.concat(o,`px;
11
+ padding-top: `).concat(i,`px;
12
+ padding-right: `).concat(s,`px;
13
+ margin-left:0;
14
+ margin-top:0;
15
+ margin-right: `).concat(c,"px ").concat(r,`;
16
+ `),n==="padding"&&"padding-right: ".concat(c,"px ").concat(r,";")].filter(Boolean).join(""),`
17
+ }
18
+
19
+ .`).concat(Fe,` {
20
+ right: `).concat(c,"px ").concat(r,`;
21
+ }
22
+
23
+ .`).concat(We,` {
24
+ margin-right: `).concat(c,"px ").concat(r,`;
25
+ }
26
+
27
+ .`).concat(Fe," .").concat(Fe,` {
28
+ right: 0 `).concat(r,`;
29
+ }
30
+
31
+ .`).concat(We," .").concat(We,` {
32
+ margin-right: 0 `).concat(r,`;
33
+ }
34
+
35
+ body[`).concat(he,`] {
36
+ `).concat(ni,": ").concat(c,`px;
37
+ }
38
+ `)},un=function(){var e=parseInt(document.body.getAttribute(he)||"0",10);return isFinite(e)?e:0},xi=function(){a.useEffect(function(){return document.body.setAttribute(he,(un()+1).toString()),function(){var e=un()-1;e<=0?document.body.removeAttribute(he):document.body.setAttribute(he,e.toString())}},[])},Ci=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;xi();var i=a.useMemo(function(){return yi(o)},[o]);return a.createElement(wi,{styles:bi(i,!t,o,n?"":"!important")})},wt=!1;if(typeof window<"u")try{var Le=Object.defineProperty({},"passive",{get:function(){return wt=!0,!0}});window.addEventListener("test",Le,Le),window.removeEventListener("test",Le,Le)}catch{wt=!1}var fe=wt?{passive:!1}:!1,Si=function(e){return e.tagName==="TEXTAREA"},jn=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!Si(e)&&n[t]==="visible")},Ei=function(e){return jn(e,"overflowY")},Pi=function(e){return jn(e,"overflowX")},fn=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=kn(e,r);if(o){var i=Fn(e,r),s=i[1],c=i[2];if(s>c)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Ri=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Ai=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},kn=function(e,t){return e==="v"?Ei(t):Pi(t)},Fn=function(e,t){return e==="v"?Ri(t):Ai(t)},Ti=function(e,t){return e==="h"&&t==="rtl"?-1:1},Oi=function(e,t,n,r,o){var i=Ti(e,window.getComputedStyle(t).direction),s=i*r,c=n.target,u=t.contains(c),l=!1,f=s>0,d=0,p=0;do{if(!c)break;var h=Fn(e,c),g=h[0],v=h[1],y=h[2],w=v-y-i*g;(g||w)&&kn(e,c)&&(d+=w,p+=g);var b=c.parentNode;c=b&&b.nodeType===Node.DOCUMENT_FRAGMENT_NODE?b.host:b}while(!u&&c!==document.body||u&&(t.contains(c)||t===c));return(f&&Math.abs(d)<1||!f&&Math.abs(p)<1)&&(l=!0),l},Me=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},dn=function(e){return[e.deltaX,e.deltaY]},pn=function(e){return e&&"current"in e?e.current:e},Di=function(e,t){return e[0]===t[0]&&e[1]===t[1]},_i=function(e){return`
39
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
40
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
41
+ `)},Ni=0,de=[];function Li(e){var t=a.useRef([]),n=a.useRef([0,0]),r=a.useRef(),o=a.useState(Ni++)[0],i=a.useState(In)[0],s=a.useRef(e);a.useEffect(function(){s.current=e},[e]),a.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var v=ei([e.lockRef.current],(e.shards||[]).map(pn),!0).filter(Boolean);return v.forEach(function(y){return y.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),v.forEach(function(y){return y.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var c=a.useCallback(function(v,y){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!s.current.allowPinchZoom;var w=Me(v),b=n.current,C="deltaX"in v?v.deltaX:b[0]-w[0],x="deltaY"in v?v.deltaY:b[1]-w[1],S,P=v.target,E=Math.abs(C)>Math.abs(x)?"h":"v";if("touches"in v&&E==="h"&&P.type==="range")return!1;var O=window.getSelection(),R=O&&O.anchorNode,A=R?R===P||R.contains(P):!1;if(A)return!1;var D=fn(E,P);if(!D)return!0;if(D?S=E:(S=E==="v"?"h":"v",D=fn(E,P)),!D)return!1;if(!r.current&&"changedTouches"in v&&(C||x)&&(r.current=S),!S)return!0;var M=r.current||S;return Oi(M,y,v,M==="h"?C:x)},[]),u=a.useCallback(function(v){var y=v;if(!(!de.length||de[de.length-1]!==i)){var w="deltaY"in y?dn(y):Me(y),b=t.current.filter(function(S){return S.name===y.type&&(S.target===y.target||y.target===S.shadowParent)&&Di(S.delta,w)})[0];if(b&&b.should){y.cancelable&&y.preventDefault();return}if(!b){var C=(s.current.shards||[]).map(pn).filter(Boolean).filter(function(S){return S.contains(y.target)}),x=C.length>0?c(y,C[0]):!s.current.noIsolation;x&&y.cancelable&&y.preventDefault()}}},[]),l=a.useCallback(function(v,y,w,b){var C={name:v,delta:y,target:w,should:b,shadowParent:Mi(w)};t.current.push(C),setTimeout(function(){t.current=t.current.filter(function(x){return x!==C})},1)},[]),f=a.useCallback(function(v){n.current=Me(v),r.current=void 0},[]),d=a.useCallback(function(v){l(v.type,dn(v),v.target,c(v,e.lockRef.current))},[]),p=a.useCallback(function(v){l(v.type,Me(v),v.target,c(v,e.lockRef.current))},[]);a.useEffect(function(){return de.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",u,fe),document.addEventListener("touchmove",u,fe),document.addEventListener("touchstart",f,fe),function(){de=de.filter(function(v){return v!==i}),document.removeEventListener("wheel",u,fe),document.removeEventListener("touchmove",u,fe),document.removeEventListener("touchstart",f,fe)}},[]);var h=e.removeScrollBar,g=e.inert;return a.createElement(a.Fragment,null,g?a.createElement(i,{styles:_i(o)}):null,h?a.createElement(Ci,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Mi(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Ii=li(Mn,Li);var Ot=a.forwardRef(function(e,t){return a.createElement(Ze,Z({},e,{ref:t,sideCar:Ii}))});Ot.classNames=Ze.classNames;var ji=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},pe=new WeakMap,Ie=new WeakMap,je={},vt=0,Wn=function(e){return e&&(e.host||Wn(e.parentNode))},ki=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=Wn(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Fi=function(e,t,n,r){var o=ki(t,Array.isArray(e)?e:[e]);je[n]||(je[n]=new WeakMap);var i=je[n],s=[],c=new Set,u=new Set(o),l=function(d){!d||c.has(d)||(c.add(d),l(d.parentNode))};o.forEach(l);var f=function(d){!d||u.has(d)||Array.prototype.forEach.call(d.children,function(p){if(c.has(p))f(p);else try{var h=p.getAttribute(r),g=h!==null&&h!=="false",v=(pe.get(p)||0)+1,y=(i.get(p)||0)+1;pe.set(p,v),i.set(p,y),s.push(p),v===1&&g&&Ie.set(p,!0),y===1&&p.setAttribute(n,"true"),g||p.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",p,w)}})};return f(t),c.clear(),vt++,function(){s.forEach(function(d){var p=pe.get(d)-1,h=i.get(d)-1;pe.set(d,p),i.set(d,h),p||(Ie.has(d)||d.removeAttribute(r),Ie.delete(d)),h||d.removeAttribute(n)}),vt--,vt||(pe=new WeakMap,pe=new WeakMap,Ie=new WeakMap,je={})}},$n=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=ji(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),Fi(r,o,n,"aria-hidden")):function(){return null}};function Wi(e){const t=$i(e),n=a.forwardRef((r,o)=>{const{children:i,...s}=r,c=a.Children.toArray(i),u=c.find(Bi);if(u){const l=u.props.children,f=c.map(d=>d===u?a.Children.count(l)>1?a.Children.only(null):a.isValidElement(l)?l.props.children:null:d);return m.jsx(t,{...s,ref:o,children:a.isValidElement(l)?a.cloneElement(l,void 0,f):null})}return m.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function $i(e){const t=a.forwardRef((n,r)=>{const{children:o,...i}=n;if(a.isValidElement(o)){const s=zi(o),c=Vi(i,o.props);return o.type!==a.Fragment&&(c.ref=r?Re(r,s):s),a.cloneElement(o,c)}return a.Children.count(o)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Hi=Symbol("radix.slottable");function Bi(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Hi}function Vi(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...c)=>{const u=i(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function zi(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var qe="Dialog",[Hn]=Ae(qe),[Ui,G]=Hn(qe),Bn=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,c=a.useRef(null),u=a.useRef(null),[l,f]=Rt({prop:r,defaultProp:o??!1,onChange:i,caller:qe});return m.jsx(Ui,{scope:t,triggerRef:c,contentRef:u,contentId:Se(),titleId:Se(),descriptionId:Se(),open:l,onOpenChange:f,onOpenToggle:a.useCallback(()=>f(d=>!d),[f]),modal:s,children:n})};Bn.displayName=qe;var Vn="DialogTrigger",Yi=a.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=G(Vn,n),i=F(t,o.triggerRef);return m.jsx(L.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Nt(o.open),...r,ref:i,onClick:_(e.onClick,o.onOpenToggle)})});Yi.displayName=Vn;var Dt="DialogPortal",[Xi,zn]=Hn(Dt,{forceMount:void 0}),Un=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=G(Dt,t);return m.jsx(Xi,{scope:t,forceMount:n,children:a.Children.map(r,s=>m.jsx(X,{present:n||i.open,children:m.jsx(Tt,{asChild:!0,container:o,children:s})}))})};Un.displayName=Dt;var Be="DialogOverlay",Yn=a.forwardRef((e,t)=>{const n=zn(Be,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=G(Be,e.__scopeDialog);return i.modal?m.jsx(X,{present:r||i.open,children:m.jsx(Ki,{...o,ref:t})}):null});Yn.displayName=Be;var Gi=Wi("DialogOverlay.RemoveScroll"),Ki=a.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=G(Be,n);return m.jsx(Ot,{as:Gi,allowPinchZoom:!0,shards:[o.contentRef],children:m.jsx(L.div,{"data-state":Nt(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),le="DialogContent",Xn=a.forwardRef((e,t)=>{const n=zn(le,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=G(le,e.__scopeDialog);return m.jsx(X,{present:r||i.open,children:i.modal?m.jsx(Zi,{...o,ref:t}):m.jsx(qi,{...o,ref:t})})});Xn.displayName=le;var Zi=a.forwardRef((e,t)=>{const n=G(le,e.__scopeDialog),r=a.useRef(null),o=F(t,n.contentRef,r);return a.useEffect(()=>{const i=r.current;if(i)return $n(i)},[]),m.jsx(Gn,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:_(e.onCloseAutoFocus,i=>{var s;i.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:_(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,c=s.button===0&&s.ctrlKey===!0;(s.button===2||c)&&i.preventDefault()}),onFocusOutside:_(e.onFocusOutside,i=>i.preventDefault())})}),qi=a.forwardRef((e,t)=>{const n=G(le,e.__scopeDialog),r=a.useRef(!1),o=a.useRef(!1);return m.jsx(Gn,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s,c;(s=e.onCloseAutoFocus)==null||s.call(e,i),i.defaultPrevented||(r.current||(c=n.triggerRef.current)==null||c.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var u,l;(u=e.onInteractOutside)==null||u.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;((l=n.triggerRef.current)==null?void 0:l.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),Gn=a.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,c=G(le,n),u=a.useRef(null),l=F(t,u);return _n(),m.jsxs(m.Fragment,{children:[m.jsx(At,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:m.jsx(Ke,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":Nt(c.open),...s,ref:l,onDismiss:()=>c.onOpenChange(!1)})}),m.jsxs(m.Fragment,{children:[m.jsx(Qi,{titleId:c.titleId}),m.jsx(es,{contentRef:u,descriptionId:c.descriptionId})]})]})}),_t="DialogTitle",Kn=a.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=G(_t,n);return m.jsx(L.h2,{id:o.titleId,...r,ref:t})});Kn.displayName=_t;var Zn="DialogDescription",qn=a.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=G(Zn,n);return m.jsx(L.p,{id:o.descriptionId,...r,ref:t})});qn.displayName=Zn;var Qn="DialogClose",Jn=a.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=G(Qn,n);return m.jsx(L.button,{type:"button",...r,ref:t,onClick:_(e.onClick,()=>o.onOpenChange(!1))})});Jn.displayName=Qn;function Nt(e){return e?"open":"closed"}var er="DialogTitleWarning",[Pa,tr]=bo(er,{contentName:le,titleName:_t,docsSlug:"dialog"}),Qi=({titleId:e})=>{const t=tr(er),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
42
+
43
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
44
+
45
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return a.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Ji="DialogDescriptionWarning",es=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${tr(Ji).contentName}}.`;return a.useEffect(()=>{var i;const o=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Ra=Bn,Aa=Un,Ta=Yn,Oa=Xn,Da=Kn,_a=qn,Na=Jn,ts=a.createContext(void 0);function ns(e){const t=a.useContext(ts);return e||t||"ltr"}function rs(e,[t,n]){return Math.min(n,Math.max(t,e))}function os(e,t){return a.useReducer((n,r)=>t[n][r]??n,e)}var Lt="ScrollArea",[nr]=Ae(Lt),[is,z]=nr(Lt),rr=a.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:i=600,...s}=e,[c,u]=a.useState(null),[l,f]=a.useState(null),[d,p]=a.useState(null),[h,g]=a.useState(null),[v,y]=a.useState(null),[w,b]=a.useState(0),[C,x]=a.useState(0),[S,P]=a.useState(!1),[E,O]=a.useState(!1),R=F(t,D=>u(D)),A=ns(o);return m.jsx(is,{scope:n,type:r,dir:A,scrollHideDelay:i,scrollArea:c,viewport:l,onViewportChange:f,content:d,onContentChange:p,scrollbarX:h,onScrollbarXChange:g,scrollbarXEnabled:S,onScrollbarXEnabledChange:P,scrollbarY:v,onScrollbarYChange:y,scrollbarYEnabled:E,onScrollbarYEnabledChange:O,onCornerWidthChange:b,onCornerHeightChange:x,children:m.jsx(L.div,{dir:A,...s,ref:R,style:{position:"relative","--radix-scroll-area-corner-width":w+"px","--radix-scroll-area-corner-height":C+"px",...e.style}})})});rr.displayName=Lt;var or="ScrollAreaViewport",ir=a.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...i}=e,s=z(or,n),c=a.useRef(null),u=F(t,c,s.onViewportChange);return m.jsxs(m.Fragment,{children:[m.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),m.jsx(L.div,{"data-radix-scroll-area-viewport":"",...i,ref:u,style:{overflowX:s.scrollbarXEnabled?"scroll":"hidden",overflowY:s.scrollbarYEnabled?"scroll":"hidden",...e.style},children:m.jsx("div",{ref:s.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});ir.displayName=or;var ee="ScrollAreaScrollbar",ss=a.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=z(ee,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:s}=o,c=e.orientation==="horizontal";return a.useEffect(()=>(c?i(!0):s(!0),()=>{c?i(!1):s(!1)}),[c,i,s]),o.type==="hover"?m.jsx(cs,{...r,ref:t,forceMount:n}):o.type==="scroll"?m.jsx(as,{...r,ref:t,forceMount:n}):o.type==="auto"?m.jsx(sr,{...r,ref:t,forceMount:n}):o.type==="always"?m.jsx(Mt,{...r,ref:t}):null});ss.displayName=ee;var cs=a.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=z(ee,e.__scopeScrollArea),[i,s]=a.useState(!1);return a.useEffect(()=>{const c=o.scrollArea;let u=0;if(c){const l=()=>{window.clearTimeout(u),s(!0)},f=()=>{u=window.setTimeout(()=>s(!1),o.scrollHideDelay)};return c.addEventListener("pointerenter",l),c.addEventListener("pointerleave",f),()=>{window.clearTimeout(u),c.removeEventListener("pointerenter",l),c.removeEventListener("pointerleave",f)}}},[o.scrollArea,o.scrollHideDelay]),m.jsx(X,{present:n||i,children:m.jsx(sr,{"data-state":i?"visible":"hidden",...r,ref:t})})}),as=a.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=z(ee,e.__scopeScrollArea),i=e.orientation==="horizontal",s=Je(()=>u("SCROLL_END"),100),[c,u]=os("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return a.useEffect(()=>{if(c==="idle"){const l=window.setTimeout(()=>u("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(l)}},[c,o.scrollHideDelay,u]),a.useEffect(()=>{const l=o.viewport,f=i?"scrollLeft":"scrollTop";if(l){let d=l[f];const p=()=>{const h=l[f];d!==h&&(u("SCROLL"),s()),d=h};return l.addEventListener("scroll",p),()=>l.removeEventListener("scroll",p)}},[o.viewport,i,u,s]),m.jsx(X,{present:n||c!=="hidden",children:m.jsx(Mt,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:_(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:_(e.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),sr=a.forwardRef((e,t)=>{const n=z(ee,e.__scopeScrollArea),{forceMount:r,...o}=e,[i,s]=a.useState(!1),c=e.orientation==="horizontal",u=Je(()=>{if(n.viewport){const l=n.viewport.offsetWidth<n.viewport.scrollWidth,f=n.viewport.offsetHeight<n.viewport.scrollHeight;s(c?l:f)}},10);return me(n.viewport,u),me(n.content,u),m.jsx(X,{present:r||i,children:m.jsx(Mt,{"data-state":i?"visible":"hidden",...o,ref:t})})}),Mt=a.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=z(ee,e.__scopeScrollArea),i=a.useRef(null),s=a.useRef(0),[c,u]=a.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=ur(c.viewport,c.content),f={...r,sizes:c,onSizesChange:u,hasThumb:l>0&&l<1,onThumbChange:p=>i.current=p,onThumbPointerUp:()=>s.current=0,onThumbPointerDown:p=>s.current=p};function d(p,h){return vs(p,s.current,c,h)}return n==="horizontal"?m.jsx(ls,{...f,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollLeft,h=hn(p,c,o.dir);i.current.style.transform=`translate3d(${h}px, 0, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollLeft=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollLeft=d(p,o.dir))}}):n==="vertical"?m.jsx(us,{...f,ref:t,onThumbPositionChange:()=>{if(o.viewport&&i.current){const p=o.viewport.scrollTop,h=hn(p,c);i.current.style.transform=`translate3d(0, ${h}px, 0)`}},onWheelScroll:p=>{o.viewport&&(o.viewport.scrollTop=p)},onDragScroll:p=>{o.viewport&&(o.viewport.scrollTop=d(p))}}):null}),ls=a.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=z(ee,e.__scopeScrollArea),[s,c]=a.useState(),u=a.useRef(null),l=F(t,u,i.onScrollbarXChange);return a.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),m.jsx(ar,{"data-orientation":"horizontal",...o,ref:l,sizes:n,style:{bottom:0,left:i.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:i.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Qe(n)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.x),onDragScroll:f=>e.onDragScroll(f.x),onWheelScroll:(f,d)=>{if(i.viewport){const p=i.viewport.scrollLeft+f.deltaX;e.onWheelScroll(p),dr(p,d)&&f.preventDefault()}},onResize:()=>{u.current&&i.viewport&&s&&r({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:ze(s.paddingLeft),paddingEnd:ze(s.paddingRight)}})}})}),us=a.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,i=z(ee,e.__scopeScrollArea),[s,c]=a.useState(),u=a.useRef(null),l=F(t,u,i.onScrollbarYChange);return a.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),m.jsx(ar,{"data-orientation":"vertical",...o,ref:l,sizes:n,style:{top:0,right:i.dir==="ltr"?0:void 0,left:i.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Qe(n)+"px",...e.style},onThumbPointerDown:f=>e.onThumbPointerDown(f.y),onDragScroll:f=>e.onDragScroll(f.y),onWheelScroll:(f,d)=>{if(i.viewport){const p=i.viewport.scrollTop+f.deltaY;e.onWheelScroll(p),dr(p,d)&&f.preventDefault()}},onResize:()=>{u.current&&i.viewport&&s&&r({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:ze(s.paddingTop),paddingEnd:ze(s.paddingBottom)}})}})}),[fs,cr]=nr(ee),ar=a.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:i,onThumbPointerUp:s,onThumbPointerDown:c,onThumbPositionChange:u,onDragScroll:l,onWheelScroll:f,onResize:d,...p}=e,h=z(ee,n),[g,v]=a.useState(null),y=F(t,R=>v(R)),w=a.useRef(null),b=a.useRef(""),C=h.viewport,x=r.content-r.viewport,S=B(f),P=B(u),E=Je(d,10);function O(R){if(w.current){const A=R.clientX-w.current.left,D=R.clientY-w.current.top;l({x:A,y:D})}}return a.useEffect(()=>{const R=A=>{const D=A.target;(g==null?void 0:g.contains(D))&&S(A,x)};return document.addEventListener("wheel",R,{passive:!1}),()=>document.removeEventListener("wheel",R,{passive:!1})},[C,g,x,S]),a.useEffect(P,[r,P]),me(g,E),me(h.content,E),m.jsx(fs,{scope:n,scrollbar:g,hasThumb:o,onThumbChange:B(i),onThumbPointerUp:B(s),onThumbPositionChange:P,onThumbPointerDown:B(c),children:m.jsx(L.div,{...p,ref:y,style:{position:"absolute",...p.style},onPointerDown:_(e.onPointerDown,R=>{R.button===0&&(R.target.setPointerCapture(R.pointerId),w.current=g.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",h.viewport&&(h.viewport.style.scrollBehavior="auto"),O(R))}),onPointerMove:_(e.onPointerMove,O),onPointerUp:_(e.onPointerUp,R=>{const A=R.target;A.hasPointerCapture(R.pointerId)&&A.releasePointerCapture(R.pointerId),document.body.style.webkitUserSelect=b.current,h.viewport&&(h.viewport.style.scrollBehavior=""),w.current=null})})})}),Ve="ScrollAreaThumb",ds=a.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=cr(Ve,e.__scopeScrollArea);return m.jsx(X,{present:n||o.hasThumb,children:m.jsx(ps,{ref:t,...r})})}),ps=a.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,i=z(Ve,n),s=cr(Ve,n),{onThumbPositionChange:c}=s,u=F(t,d=>s.onThumbChange(d)),l=a.useRef(void 0),f=Je(()=>{l.current&&(l.current(),l.current=void 0)},100);return a.useEffect(()=>{const d=i.viewport;if(d){const p=()=>{if(f(),!l.current){const h=ms(d,c);l.current=h,c()}};return c(),d.addEventListener("scroll",p),()=>d.removeEventListener("scroll",p)}},[i.viewport,f,c]),m.jsx(L.div,{"data-state":s.hasThumb?"visible":"hidden",...o,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:_(e.onPointerDownCapture,d=>{const h=d.target.getBoundingClientRect(),g=d.clientX-h.left,v=d.clientY-h.top;s.onThumbPointerDown({x:g,y:v})}),onPointerUp:_(e.onPointerUp,s.onThumbPointerUp)})});ds.displayName=Ve;var It="ScrollAreaCorner",lr=a.forwardRef((e,t)=>{const n=z(It,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?m.jsx(hs,{...e,ref:t}):null});lr.displayName=It;var hs=a.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=z(It,n),[i,s]=a.useState(0),[c,u]=a.useState(0),l=!!(i&&c);return me(o.scrollbarX,()=>{var d;const f=((d=o.scrollbarX)==null?void 0:d.offsetHeight)||0;o.onCornerHeightChange(f),u(f)}),me(o.scrollbarY,()=>{var d;const f=((d=o.scrollbarY)==null?void 0:d.offsetWidth)||0;o.onCornerWidthChange(f),s(f)}),l?m.jsx(L.div,{...r,ref:t,style:{width:i,height:c,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function ze(e){return e?parseInt(e,10):0}function ur(e,t){const n=e/t;return isNaN(n)?0:n}function Qe(e){const t=ur(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function vs(e,t,n,r="ltr"){const o=Qe(n),i=o/2,s=t||i,c=o-s,u=n.scrollbar.paddingStart+s,l=n.scrollbar.size-n.scrollbar.paddingEnd-c,f=n.content-n.viewport,d=r==="ltr"?[0,f]:[f*-1,0];return fr([u,l],d)(e)}function hn(e,t,n="ltr"){const r=Qe(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,s=t.content-t.viewport,c=i-r,u=n==="ltr"?[0,s]:[s*-1,0],l=rs(e,u);return fr([0,s],[0,c])(l)}function fr(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function dr(e,t){return e>0&&e<t}var ms=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const i={left:e.scrollLeft,top:e.scrollTop},s=n.left!==i.left,c=n.top!==i.top;(s||c)&&t(),n=i,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function Je(e,t){const n=B(e),r=a.useRef(0);return a.useEffect(()=>()=>window.clearTimeout(r.current),[]),a.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function me(e,t){const n=B(t);ne(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}var La=rr,Ma=ir,Ia=lr;const gs=["top","right","bottom","left"],se=Math.min,H=Math.max,Ue=Math.round,ke=Math.floor,Q=e=>({x:e,y:e}),ys={left:"right",right:"left",bottom:"top",top:"bottom"},ws={start:"end",end:"start"};function bt(e,t,n){return H(e,se(t,n))}function re(e,t){return typeof e=="function"?e(t):e}function oe(e){return e.split("-")[0]}function be(e){return e.split("-")[1]}function jt(e){return e==="x"?"y":"x"}function kt(e){return e==="y"?"height":"width"}const bs=new Set(["top","bottom"]);function q(e){return bs.has(oe(e))?"y":"x"}function Ft(e){return jt(q(e))}function xs(e,t,n){n===void 0&&(n=!1);const r=be(e),o=Ft(e),i=kt(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Ye(s)),[s,Ye(s)]}function Cs(e){const t=Ye(e);return[xt(e),t,xt(t)]}function xt(e){return e.replace(/start|end/g,t=>ws[t])}const vn=["left","right"],mn=["right","left"],Ss=["top","bottom"],Es=["bottom","top"];function Ps(e,t,n){switch(e){case"top":case"bottom":return n?t?mn:vn:t?vn:mn;case"left":case"right":return t?Ss:Es;default:return[]}}function Rs(e,t,n,r){const o=be(e);let i=Ps(oe(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(xt)))),i}function Ye(e){return e.replace(/left|right|bottom|top/g,t=>ys[t])}function As(e){return{top:0,right:0,bottom:0,left:0,...e}}function pr(e){return typeof e!="number"?As(e):{top:e,right:e,bottom:e,left:e}}function Xe(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function gn(e,t,n){let{reference:r,floating:o}=e;const i=q(t),s=Ft(t),c=kt(s),u=oe(t),l=i==="y",f=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[c]/2-o[c]/2;let h;switch(u){case"top":h={x:f,y:r.y-o.height};break;case"bottom":h={x:f,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}switch(be(t)){case"start":h[s]-=p*(n&&l?-1:1);break;case"end":h[s]+=p*(n&&l?-1:1);break}return h}async function Ts(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:c,strategy:u}=e,{boundary:l="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:p=!1,padding:h=0}=re(t,e),g=pr(h),y=c[p?d==="floating"?"reference":"floating":d],w=Xe(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(y)))==null||n?y:y.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(c.floating)),boundary:l,rootBoundary:f,strategy:u})),b=d==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,C=await(i.getOffsetParent==null?void 0:i.getOffsetParent(c.floating)),x=await(i.isElement==null?void 0:i.isElement(C))?await(i.getScale==null?void 0:i.getScale(C))||{x:1,y:1}:{x:1,y:1},S=Xe(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:b,offsetParent:C,strategy:u}):b);return{top:(w.top-S.top+g.top)/x.y,bottom:(S.bottom-w.bottom+g.bottom)/x.y,left:(w.left-S.left+g.left)/x.x,right:(S.right-w.right+g.right)/x.x}}const Os=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,c=i.filter(Boolean),u=await(s.isRTL==null?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:f,y:d}=gn(l,r,u),p=r,h={},g=0;for(let y=0;y<c.length;y++){var v;const{name:w,fn:b}=c[y],{x:C,y:x,data:S,reset:P}=await b({x:f,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:h,rects:l,platform:{...s,detectOverflow:(v=s.detectOverflow)!=null?v:Ts},elements:{reference:e,floating:t}});f=C??f,d=x??d,h={...h,[w]:{...h[w],...S}},P&&g<=50&&(g++,typeof P=="object"&&(P.placement&&(p=P.placement),P.rects&&(l=P.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):P.rects),{x:f,y:d}=gn(l,p,u)),y=-1)}return{x:f,y:d,placement:p,strategy:o,middlewareData:h}},Ds=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:c,middlewareData:u}=t,{element:l,padding:f=0}=re(e,t)||{};if(l==null)return{};const d=pr(f),p={x:n,y:r},h=Ft(o),g=kt(h),v=await s.getDimensions(l),y=h==="y",w=y?"top":"left",b=y?"bottom":"right",C=y?"clientHeight":"clientWidth",x=i.reference[g]+i.reference[h]-p[h]-i.floating[g],S=p[h]-i.reference[h],P=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l));let E=P?P[C]:0;(!E||!await(s.isElement==null?void 0:s.isElement(P)))&&(E=c.floating[C]||i.floating[g]);const O=x/2-S/2,R=E/2-v[g]/2-1,A=se(d[w],R),D=se(d[b],R),M=A,I=E-v[g]-D,N=E/2-v[g]/2+O,$=bt(M,N,I),j=!u.arrow&&be(o)!=null&&N!==$&&i.reference[g]/2-(N<M?A:D)-v[g]/2<0,k=j?N<M?N-M:N-I:0;return{[h]:p[h]+k,data:{[h]:$,centerOffset:N-$-k,...j&&{alignmentOffset:k}},reset:j}}}),_s=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:c,platform:u,elements:l}=t,{mainAxis:f=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:v=!0,...y}=re(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const w=oe(o),b=q(c),C=oe(c)===c,x=await(u.isRTL==null?void 0:u.isRTL(l.floating)),S=p||(C||!v?[Ye(c)]:Cs(c)),P=g!=="none";!p&&P&&S.push(...Rs(c,v,g,x));const E=[c,...S],O=await u.detectOverflow(t,y),R=[];let A=((r=i.flip)==null?void 0:r.overflows)||[];if(f&&R.push(O[w]),d){const N=xs(o,s,x);R.push(O[N[0]],O[N[1]])}if(A=[...A,{placement:o,overflows:R}],!R.every(N=>N<=0)){var D,M;const N=(((D=i.flip)==null?void 0:D.index)||0)+1,$=E[N];if($&&(!(d==="alignment"?b!==q($):!1)||A.every(T=>q(T.placement)===b?T.overflows[0]>0:!0)))return{data:{index:N,overflows:A},reset:{placement:$}};let j=(M=A.filter(k=>k.overflows[0]<=0).sort((k,T)=>k.overflows[1]-T.overflows[1])[0])==null?void 0:M.placement;if(!j)switch(h){case"bestFit":{var I;const k=(I=A.filter(T=>{if(P){const W=q(T.placement);return W===b||W==="y"}return!0}).map(T=>[T.placement,T.overflows.filter(W=>W>0).reduce((W,K)=>W+K,0)]).sort((T,W)=>T[1]-W[1])[0])==null?void 0:I[0];k&&(j=k);break}case"initialPlacement":j=c;break}if(o!==j)return{reset:{placement:j}}}return{}}}};function yn(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function wn(e){return gs.some(t=>e[t]>=0)}const Ns=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=re(e,t);switch(o){case"referenceHidden":{const s=await r.detectOverflow(t,{...i,elementContext:"reference"}),c=yn(s,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:wn(c)}}}case"escaped":{const s=await r.detectOverflow(t,{...i,altBoundary:!0}),c=yn(s,n.floating);return{data:{escapedOffsets:c,escaped:wn(c)}}}default:return{}}}}},hr=new Set(["left","top"]);async function Ls(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=oe(n),c=be(n),u=q(n)==="y",l=hr.has(s)?-1:1,f=i&&u?-1:1,d=re(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return c&&typeof g=="number"&&(h=c==="end"?g*-1:g),u?{x:h*f,y:p*l}:{x:p*l,y:h*f}}const Ms=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:c}=t,u=await Ls(t,e);return s===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:o+u.x,y:i+u.y,data:{...u,placement:s}}}}},Is=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:s=!0,crossAxis:c=!1,limiter:u={fn:w=>{let{x:b,y:C}=w;return{x:b,y:C}}},...l}=re(e,t),f={x:n,y:r},d=await i.detectOverflow(t,l),p=q(oe(o)),h=jt(p);let g=f[h],v=f[p];if(s){const w=h==="y"?"top":"left",b=h==="y"?"bottom":"right",C=g+d[w],x=g-d[b];g=bt(C,g,x)}if(c){const w=p==="y"?"top":"left",b=p==="y"?"bottom":"right",C=v+d[w],x=v-d[b];v=bt(C,v,x)}const y=u.fn({...t,[h]:g,[p]:v});return{...y,data:{x:y.x-n,y:y.y-r,enabled:{[h]:s,[p]:c}}}}}},js=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:c=0,mainAxis:u=!0,crossAxis:l=!0}=re(e,t),f={x:n,y:r},d=q(o),p=jt(d);let h=f[p],g=f[d];const v=re(c,t),y=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(u){const C=p==="y"?"height":"width",x=i.reference[p]-i.floating[C]+y.mainAxis,S=i.reference[p]+i.reference[C]-y.mainAxis;h<x?h=x:h>S&&(h=S)}if(l){var w,b;const C=p==="y"?"width":"height",x=hr.has(oe(o)),S=i.reference[d]-i.floating[C]+(x&&((w=s.offset)==null?void 0:w[d])||0)+(x?0:y.crossAxis),P=i.reference[d]+i.reference[C]+(x?0:((b=s.offset)==null?void 0:b[d])||0)-(x?y.crossAxis:0);g<S?g=S:g>P&&(g=P)}return{[p]:h,[d]:g}}}},ks=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:c}=t,{apply:u=()=>{},...l}=re(e,t),f=await s.detectOverflow(t,l),d=oe(o),p=be(o),h=q(o)==="y",{width:g,height:v}=i.floating;let y,w;d==="top"||d==="bottom"?(y=d,w=p===(await(s.isRTL==null?void 0:s.isRTL(c.floating))?"start":"end")?"left":"right"):(w=d,y=p==="end"?"top":"bottom");const b=v-f.top-f.bottom,C=g-f.left-f.right,x=se(v-f[y],b),S=se(g-f[w],C),P=!t.middlewareData.shift;let E=x,O=S;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=C),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(E=b),P&&!p){const A=H(f.left,0),D=H(f.right,0),M=H(f.top,0),I=H(f.bottom,0);h?O=g-2*(A!==0||D!==0?A+D:H(f.left,f.right)):E=v-2*(M!==0||I!==0?M+I:H(f.top,f.bottom))}await u({...t,availableWidth:O,availableHeight:E});const R=await s.getDimensions(c.floating);return g!==R.width||v!==R.height?{reset:{rects:!0}}:{}}}};function et(){return typeof window<"u"}function xe(e){return vr(e)?(e.nodeName||"").toLowerCase():"#document"}function V(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function te(e){var t;return(t=(vr(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function vr(e){return et()?e instanceof Node||e instanceof V(e).Node:!1}function U(e){return et()?e instanceof Element||e instanceof V(e).Element:!1}function J(e){return et()?e instanceof HTMLElement||e instanceof V(e).HTMLElement:!1}function bn(e){return!et()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof V(e).ShadowRoot}const Fs=new Set(["inline","contents"]);function Te(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Y(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Fs.has(o)}const Ws=new Set(["table","td","th"]);function $s(e){return Ws.has(xe(e))}const Hs=[":popover-open",":modal"];function tt(e){return Hs.some(t=>{try{return e.matches(t)}catch{return!1}})}const Bs=["transform","translate","scale","rotate","perspective"],Vs=["transform","translate","scale","rotate","perspective","filter"],zs=["paint","layout","strict","content"];function Wt(e){const t=$t(),n=U(e)?Y(e):e;return Bs.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Vs.some(r=>(n.willChange||"").includes(r))||zs.some(r=>(n.contain||"").includes(r))}function Us(e){let t=ce(e);for(;J(t)&&!ge(t);){if(Wt(t))return t;if(tt(t))return null;t=ce(t)}return null}function $t(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Ys=new Set(["html","body","#document"]);function ge(e){return Ys.has(xe(e))}function Y(e){return V(e).getComputedStyle(e)}function nt(e){return U(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ce(e){if(xe(e)==="html")return e;const t=e.assignedSlot||e.parentNode||bn(e)&&e.host||te(e);return bn(t)?t.host:t}function mr(e){const t=ce(e);return ge(t)?e.ownerDocument?e.ownerDocument.body:e.body:J(t)&&Te(t)?t:mr(t)}function Ee(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=mr(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=V(o);if(i){const c=Ct(s);return t.concat(s,s.visualViewport||[],Te(o)?o:[],c&&n?Ee(c):[])}return t.concat(o,Ee(o,[],n))}function Ct(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function gr(e){const t=Y(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=J(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,c=Ue(n)!==i||Ue(r)!==s;return c&&(n=i,r=s),{width:n,height:r,$:c}}function Ht(e){return U(e)?e:e.contextElement}function ve(e){const t=Ht(e);if(!J(t))return Q(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=gr(t);let s=(i?Ue(n.width):n.width)/r,c=(i?Ue(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const Xs=Q(0);function yr(e){const t=V(e);return!$t()||!t.visualViewport?Xs:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Gs(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==V(e)?!1:t}function ue(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Ht(e);let s=Q(1);t&&(r?U(r)&&(s=ve(r)):s=ve(e));const c=Gs(i,n,r)?yr(i):Q(0);let u=(o.left+c.x)/s.x,l=(o.top+c.y)/s.y,f=o.width/s.x,d=o.height/s.y;if(i){const p=V(i),h=r&&U(r)?V(r):r;let g=p,v=Ct(g);for(;v&&r&&h!==g;){const y=ve(v),w=v.getBoundingClientRect(),b=Y(v),C=w.left+(v.clientLeft+parseFloat(b.paddingLeft))*y.x,x=w.top+(v.clientTop+parseFloat(b.paddingTop))*y.y;u*=y.x,l*=y.y,f*=y.x,d*=y.y,u+=C,l+=x,g=V(v),v=Ct(g)}}return Xe({width:f,height:d,x:u,y:l})}function rt(e,t){const n=nt(e).scrollLeft;return t?t.left+n:ue(te(e)).left+n}function wr(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-rt(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function Ks(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=te(r),c=t?tt(t.floating):!1;if(r===s||c&&i)return n;let u={scrollLeft:0,scrollTop:0},l=Q(1);const f=Q(0),d=J(r);if((d||!d&&!i)&&((xe(r)!=="body"||Te(s))&&(u=nt(r)),J(r))){const h=ue(r);l=ve(r),f.x=h.x+r.clientLeft,f.y=h.y+r.clientTop}const p=s&&!d&&!i?wr(s,u):Q(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-u.scrollLeft*l.x+f.x+p.x,y:n.y*l.y-u.scrollTop*l.y+f.y+p.y}}function Zs(e){return Array.from(e.getClientRects())}function qs(e){const t=te(e),n=nt(e),r=e.ownerDocument.body,o=H(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=H(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+rt(e);const c=-n.scrollTop;return Y(r).direction==="rtl"&&(s+=H(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:c}}const xn=25;function Qs(e,t){const n=V(e),r=te(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,c=0,u=0;if(o){i=o.width,s=o.height;const f=$t();(!f||f&&t==="fixed")&&(c=o.offsetLeft,u=o.offsetTop)}const l=rt(r);if(l<=0){const f=r.ownerDocument,d=f.body,p=getComputedStyle(d),h=f.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,g=Math.abs(r.clientWidth-d.clientWidth-h);g<=xn&&(i-=g)}else l<=xn&&(i+=l);return{width:i,height:s,x:c,y:u}}const Js=new Set(["absolute","fixed"]);function ec(e,t){const n=ue(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=J(e)?ve(e):Q(1),s=e.clientWidth*i.x,c=e.clientHeight*i.y,u=o*i.x,l=r*i.y;return{width:s,height:c,x:u,y:l}}function Cn(e,t,n){let r;if(t==="viewport")r=Qs(e,n);else if(t==="document")r=qs(te(e));else if(U(t))r=ec(t,n);else{const o=yr(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Xe(r)}function br(e,t){const n=ce(e);return n===t||!U(n)||ge(n)?!1:Y(n).position==="fixed"||br(n,t)}function tc(e,t){const n=t.get(e);if(n)return n;let r=Ee(e,[],!1).filter(c=>U(c)&&xe(c)!=="body"),o=null;const i=Y(e).position==="fixed";let s=i?ce(e):e;for(;U(s)&&!ge(s);){const c=Y(s),u=Wt(s);!u&&c.position==="fixed"&&(o=null),(i?!u&&!o:!u&&c.position==="static"&&!!o&&Js.has(o.position)||Te(s)&&!u&&br(e,s))?r=r.filter(f=>f!==s):o=c,s=ce(s)}return t.set(e,r),r}function nc(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?tt(t)?[]:tc(t,this._c):[].concat(n),r],c=s[0],u=s.reduce((l,f)=>{const d=Cn(t,f,o);return l.top=H(d.top,l.top),l.right=se(d.right,l.right),l.bottom=se(d.bottom,l.bottom),l.left=H(d.left,l.left),l},Cn(t,c,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function rc(e){const{width:t,height:n}=gr(e);return{width:t,height:n}}function oc(e,t,n){const r=J(t),o=te(t),i=n==="fixed",s=ue(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const u=Q(0);function l(){u.x=rt(o)}if(r||!r&&!i)if((xe(t)!=="body"||Te(o))&&(c=nt(t)),r){const h=ue(t,!0,i,t);u.x=h.x+t.clientLeft,u.y=h.y+t.clientTop}else o&&l();i&&!r&&o&&l();const f=o&&!r&&!i?wr(o,c):Q(0),d=s.left+c.scrollLeft-u.x-f.x,p=s.top+c.scrollTop-u.y-f.y;return{x:d,y:p,width:s.width,height:s.height}}function mt(e){return Y(e).position==="static"}function Sn(e,t){if(!J(e)||Y(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return te(e)===n&&(n=n.ownerDocument.body),n}function xr(e,t){const n=V(e);if(tt(e))return n;if(!J(e)){let o=ce(e);for(;o&&!ge(o);){if(U(o)&&!mt(o))return o;o=ce(o)}return n}let r=Sn(e,t);for(;r&&$s(r)&&mt(r);)r=Sn(r,t);return r&&ge(r)&&mt(r)&&!Wt(r)?n:r||Us(e)||n}const ic=async function(e){const t=this.getOffsetParent||xr,n=this.getDimensions,r=await n(e.floating);return{reference:oc(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function sc(e){return Y(e).direction==="rtl"}const cc={convertOffsetParentRelativeRectToViewportRelativeRect:Ks,getDocumentElement:te,getClippingRect:nc,getOffsetParent:xr,getElementRects:ic,getClientRects:Zs,getDimensions:rc,getScale:ve,isElement:U,isRTL:sc};function Cr(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ac(e,t){let n=null,r;const o=te(e);function i(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function s(c,u){c===void 0&&(c=!1),u===void 0&&(u=1),i();const l=e.getBoundingClientRect(),{left:f,top:d,width:p,height:h}=l;if(c||t(),!p||!h)return;const g=ke(d),v=ke(o.clientWidth-(f+p)),y=ke(o.clientHeight-(d+h)),w=ke(f),C={rootMargin:-g+"px "+-v+"px "+-y+"px "+-w+"px",threshold:H(0,se(1,u))||1};let x=!0;function S(P){const E=P[0].intersectionRatio;if(E!==u){if(!x)return s();E?s(!1,E):r=setTimeout(()=>{s(!1,1e-7)},1e3)}E===1&&!Cr(l,e.getBoundingClientRect())&&s(),x=!1}try{n=new IntersectionObserver(S,{...C,root:o.ownerDocument})}catch{n=new IntersectionObserver(S,C)}n.observe(e)}return s(!0),i}function lc(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,l=Ht(e),f=o||i?[...l?Ee(l):[],...Ee(t)]:[];f.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),i&&w.addEventListener("resize",n)});const d=l&&c?ac(l,n):null;let p=-1,h=null;s&&(h=new ResizeObserver(w=>{let[b]=w;b&&b.target===l&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var C;(C=h)==null||C.observe(t)})),n()}),l&&!u&&h.observe(l),h.observe(t));let g,v=u?ue(e):null;u&&y();function y(){const w=ue(e);v&&!Cr(v,w)&&n(),v=w,g=requestAnimationFrame(y)}return n(),()=>{var w;f.forEach(b=>{o&&b.removeEventListener("scroll",n),i&&b.removeEventListener("resize",n)}),d==null||d(),(w=h)==null||w.disconnect(),h=null,u&&cancelAnimationFrame(g)}}const uc=Ms,fc=Is,dc=_s,pc=ks,hc=Ns,En=Ds,vc=js,mc=(e,t,n)=>{const r=new Map,o={platform:cc,...n},i={...o.platform,_c:r};return Os(e,t,{...o,platform:i})};var gc=typeof document<"u",yc=function(){},$e=gc?a.useLayoutEffect:yc;function Ge(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,o;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(!Ge(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Ge(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Sr(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Pn(e,t){const n=Sr(e);return Math.round(t*n)/n}function gt(e){const t=a.useRef(e);return $e(()=>{t.current=e}),t}function wc(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:c=!0,whileElementsMounted:u,open:l}=e,[f,d]=a.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=a.useState(r);Ge(p,r)||h(r);const[g,v]=a.useState(null),[y,w]=a.useState(null),b=a.useCallback(T=>{T!==P.current&&(P.current=T,v(T))},[]),C=a.useCallback(T=>{T!==E.current&&(E.current=T,w(T))},[]),x=i||g,S=s||y,P=a.useRef(null),E=a.useRef(null),O=a.useRef(f),R=u!=null,A=gt(u),D=gt(o),M=gt(l),I=a.useCallback(()=>{if(!P.current||!E.current)return;const T={placement:t,strategy:n,middleware:p};D.current&&(T.platform=D.current),mc(P.current,E.current,T).then(W=>{const K={...W,isPositioned:M.current!==!1};N.current&&!Ge(O.current,K)&&(O.current=K,Rn.flushSync(()=>{d(K)}))})},[p,t,n,D,M]);$e(()=>{l===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,d(T=>({...T,isPositioned:!1})))},[l]);const N=a.useRef(!1);$e(()=>(N.current=!0,()=>{N.current=!1}),[]),$e(()=>{if(x&&(P.current=x),S&&(E.current=S),x&&S){if(A.current)return A.current(x,S,I);I()}},[x,S,I,A,R]);const $=a.useMemo(()=>({reference:P,floating:E,setReference:b,setFloating:C}),[b,C]),j=a.useMemo(()=>({reference:x,floating:S}),[x,S]),k=a.useMemo(()=>{const T={position:n,left:0,top:0};if(!j.floating)return T;const W=Pn(j.floating,f.x),K=Pn(j.floating,f.y);return c?{...T,transform:"translate("+W+"px, "+K+"px)",...Sr(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:W,top:K}},[n,c,j.floating,f.x,f.y]);return a.useMemo(()=>({...f,update:I,refs:$,elements:j,floatingStyles:k}),[f,I,$,j,k])}const bc=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?En({element:r.current,padding:o}).fn(n):{}:r?En({element:r,padding:o}).fn(n):{}}}},xc=(e,t)=>({...uc(e),options:[e,t]}),Cc=(e,t)=>({...fc(e),options:[e,t]}),Sc=(e,t)=>({...vc(e),options:[e,t]}),Ec=(e,t)=>({...dc(e),options:[e,t]}),Pc=(e,t)=>({...pc(e),options:[e,t]}),Rc=(e,t)=>({...hc(e),options:[e,t]}),Ac=(e,t)=>({...bc(e),options:[e,t]});var Tc="Arrow",Er=a.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return m.jsx(L.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:m.jsx("polygon",{points:"0,0 30,0 15,10"})})});Er.displayName=Tc;var Oc=Er;function Dc(e){const[t,n]=a.useState(void 0);return ne(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,c;if("borderBoxSize"in i){const u=i.borderBoxSize,l=Array.isArray(u)?u[0]:u;s=l.inlineSize,c=l.blockSize}else s=e.offsetWidth,c=e.offsetHeight;n({width:s,height:c})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Bt="Popper",[Pr,ot]=Ae(Bt),[_c,Rr]=Pr(Bt),Ar=e=>{const{__scopePopper:t,children:n}=e,[r,o]=a.useState(null);return m.jsx(_c,{scope:t,anchor:r,onAnchorChange:o,children:n})};Ar.displayName=Bt;var Tr="PopperAnchor",Or=a.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=Rr(Tr,n),s=a.useRef(null),c=F(t,s),u=a.useRef(null);return a.useEffect(()=>{const l=u.current;u.current=(r==null?void 0:r.current)||s.current,l!==u.current&&i.onAnchorChange(u.current)}),r?null:m.jsx(L.div,{...o,ref:c})});Or.displayName=Tr;var Vt="PopperContent",[Nc,Lc]=Pr(Vt),Dr=a.forwardRef((e,t)=>{var Xt,Gt,Kt,Zt,qt,Qt;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:l=[],collisionPadding:f=0,sticky:d="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:g,...v}=e,y=Rr(Vt,n),[w,b]=a.useState(null),C=F(t,Ce=>b(Ce)),[x,S]=a.useState(null),P=Dc(x),E=(P==null?void 0:P.width)??0,O=(P==null?void 0:P.height)??0,R=r+(i!=="center"?"-"+i:""),A=typeof f=="number"?f:{top:0,right:0,bottom:0,left:0,...f},D=Array.isArray(l)?l:[l],M=D.length>0,I={padding:A,boundary:D.filter(Ic),altBoundary:M},{refs:N,floatingStyles:$,placement:j,isPositioned:k,middlewareData:T}=wc({strategy:"fixed",placement:R,whileElementsMounted:(...Ce)=>lc(...Ce,{animationFrame:h==="always"}),elements:{reference:y.anchor},middleware:[xc({mainAxis:o+O,alignmentAxis:s}),u&&Cc({mainAxis:!0,crossAxis:!1,limiter:d==="partial"?Sc():void 0,...I}),u&&Ec({...I}),Pc({...I,apply:({elements:Ce,rects:Jt,availableWidth:so,availableHeight:co})=>{const{width:ao,height:lo}=Jt.reference,_e=Ce.floating.style;_e.setProperty("--radix-popper-available-width",`${so}px`),_e.setProperty("--radix-popper-available-height",`${co}px`),_e.setProperty("--radix-popper-anchor-width",`${ao}px`),_e.setProperty("--radix-popper-anchor-height",`${lo}px`)}}),x&&Ac({element:x,padding:c}),jc({arrowWidth:E,arrowHeight:O}),p&&Rc({strategy:"referenceHidden",...I})]}),[W,K]=Lr(j),De=B(g);ne(()=>{k&&(De==null||De())},[k,De]);const to=(Xt=T.arrow)==null?void 0:Xt.x,no=(Gt=T.arrow)==null?void 0:Gt.y,ro=((Kt=T.arrow)==null?void 0:Kt.centerOffset)!==0,[oo,io]=a.useState();return ne(()=>{w&&io(window.getComputedStyle(w).zIndex)},[w]),m.jsx("div",{ref:N.setFloating,"data-radix-popper-content-wrapper":"",style:{...$,transform:k?$.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:oo,"--radix-popper-transform-origin":[(Zt=T.transformOrigin)==null?void 0:Zt.x,(qt=T.transformOrigin)==null?void 0:qt.y].join(" "),...((Qt=T.hide)==null?void 0:Qt.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:m.jsx(Nc,{scope:n,placedSide:W,onArrowChange:S,arrowX:to,arrowY:no,shouldHideArrow:ro,children:m.jsx(L.div,{"data-side":W,"data-align":K,...v,ref:C,style:{...v.style,animation:k?void 0:"none"}})})})});Dr.displayName=Vt;var _r="PopperArrow",Mc={top:"bottom",right:"left",bottom:"top",left:"right"},Nr=a.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=Lc(_r,r),s=Mc[i.placedSide];return m.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:m.jsx(Oc,{...o,ref:n,style:{...o.style,display:"block"}})})});Nr.displayName=_r;function Ic(e){return e!==null}var jc=e=>({name:"transformOrigin",options:e,fn(t){var y,w,b;const{placement:n,rects:r,middlewareData:o}=t,s=((y=o.arrow)==null?void 0:y.centerOffset)!==0,c=s?0:e.arrowWidth,u=s?0:e.arrowHeight,[l,f]=Lr(n),d={start:"0%",center:"50%",end:"100%"}[f],p=(((w=o.arrow)==null?void 0:w.x)??0)+c/2,h=(((b=o.arrow)==null?void 0:b.y)??0)+u/2;let g="",v="";return l==="bottom"?(g=s?d:`${p}px`,v=`${-u}px`):l==="top"?(g=s?d:`${p}px`,v=`${r.floating.height+u}px`):l==="right"?(g=`${-u}px`,v=s?d:`${h}px`):l==="left"&&(g=`${r.floating.width+u}px`,v=s?d:`${h}px`),{data:{x:g,y:v}}}});function Lr(e){const[t,n="center"]=e.split("-");return[t,n]}var Mr=Ar,zt=Or,Ir=Dr,jr=Nr;function kc(e){const t=Fc(e),n=a.forwardRef((r,o)=>{const{children:i,...s}=r,c=a.Children.toArray(i),u=c.find($c);if(u){const l=u.props.children,f=c.map(d=>d===u?a.Children.count(l)>1?a.Children.only(null):a.isValidElement(l)?l.props.children:null:d);return m.jsx(t,{...s,ref:o,children:a.isValidElement(l)?a.cloneElement(l,void 0,f):null})}return m.jsx(t,{...s,ref:o,children:i})});return n.displayName=`${e}.Slot`,n}function Fc(e){const t=a.forwardRef((n,r)=>{const{children:o,...i}=n;if(a.isValidElement(o)){const s=Bc(o),c=Hc(i,o.props);return o.type!==a.Fragment&&(c.ref=r?Re(r,s):s),a.cloneElement(o,c)}return a.Children.count(o)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Wc=Symbol("radix.slottable");function $c(e){return a.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Wc}function Hc(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...c)=>{const u=i(...c);return o(...c),u}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function Bc(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var it="Popover",[kr]=Ae(it,[ot]),Oe=ot(),[Vc,ae]=kr(it),Fr=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!1}=e,c=Oe(t),u=a.useRef(null),[l,f]=a.useState(!1),[d,p]=Rt({prop:r,defaultProp:o??!1,onChange:i,caller:it});return m.jsx(Mr,{...c,children:m.jsx(Vc,{scope:t,contentId:Se(),triggerRef:u,open:d,onOpenChange:p,onOpenToggle:a.useCallback(()=>p(h=>!h),[p]),hasCustomAnchor:l,onCustomAnchorAdd:a.useCallback(()=>f(!0),[]),onCustomAnchorRemove:a.useCallback(()=>f(!1),[]),modal:s,children:n})})};Fr.displayName=it;var Wr="PopoverAnchor",zc=a.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=ae(Wr,n),i=Oe(n),{onCustomAnchorAdd:s,onCustomAnchorRemove:c}=o;return a.useEffect(()=>(s(),()=>c()),[s,c]),m.jsx(zt,{...i,...r,ref:t})});zc.displayName=Wr;var $r="PopoverTrigger",Hr=a.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=ae($r,n),i=Oe(n),s=F(t,o.triggerRef),c=m.jsx(L.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Yr(o.open),...r,ref:s,onClick:_(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?c:m.jsx(zt,{asChild:!0,...i,children:c})});Hr.displayName=$r;var Ut="PopoverPortal",[Uc,Yc]=kr(Ut,{forceMount:void 0}),Br=e=>{const{__scopePopover:t,forceMount:n,children:r,container:o}=e,i=ae(Ut,t);return m.jsx(Uc,{scope:t,forceMount:n,children:m.jsx(X,{present:n||i.open,children:m.jsx(Tt,{asChild:!0,container:o,children:r})})})};Br.displayName=Ut;var ye="PopoverContent",Vr=a.forwardRef((e,t)=>{const n=Yc(ye,e.__scopePopover),{forceMount:r=n.forceMount,...o}=e,i=ae(ye,e.__scopePopover);return m.jsx(X,{present:r||i.open,children:i.modal?m.jsx(Gc,{...o,ref:t}):m.jsx(Kc,{...o,ref:t})})});Vr.displayName=ye;var Xc=kc("PopoverContent.RemoveScroll"),Gc=a.forwardRef((e,t)=>{const n=ae(ye,e.__scopePopover),r=a.useRef(null),o=F(t,r),i=a.useRef(!1);return a.useEffect(()=>{const s=r.current;if(s)return $n(s)},[]),m.jsx(Ot,{as:Xc,allowPinchZoom:!0,children:m.jsx(zr,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:_(e.onCloseAutoFocus,s=>{var c;s.preventDefault(),i.current||(c=n.triggerRef.current)==null||c.focus()}),onPointerDownOutside:_(e.onPointerDownOutside,s=>{const c=s.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,l=c.button===2||u;i.current=l},{checkForDefaultPrevented:!1}),onFocusOutside:_(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),Kc=a.forwardRef((e,t)=>{const n=ae(ye,e.__scopePopover),r=a.useRef(!1),o=a.useRef(!1);return m.jsx(zr,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s,c;(s=e.onCloseAutoFocus)==null||s.call(e,i),i.defaultPrevented||(r.current||(c=n.triggerRef.current)==null||c.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var u,l;(u=e.onInteractOutside)==null||u.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;((l=n.triggerRef.current)==null?void 0:l.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),zr=a.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:l,onInteractOutside:f,...d}=e,p=ae(ye,n),h=Oe(n);return _n(),m.jsx(At,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:m.jsx(Ke,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:f,onEscapeKeyDown:c,onPointerDownOutside:u,onFocusOutside:l,onDismiss:()=>p.onOpenChange(!1),children:m.jsx(Ir,{"data-state":Yr(p.open),role:"dialog",id:p.contentId,...h,...d,ref:t,style:{...d.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Ur="PopoverClose",Zc=a.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=ae(Ur,n);return m.jsx(L.button,{type:"button",...r,ref:t,onClick:_(e.onClick,()=>o.onOpenChange(!1))})});Zc.displayName=Ur;var qc="PopoverArrow",Qc=a.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,o=Oe(n);return m.jsx(jr,{...o,...r,ref:t})});Qc.displayName=qc;function Yr(e){return e?"open":"closed"}var ja=Fr,ka=Hr,Fa=Br,Wa=Vr,Jc=Symbol("radix.slottable");function ea(e){const t=({children:n})=>m.jsx(m.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=Jc,t}var ta=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"}),na="VisuallyHidden",Xr=a.forwardRef((e,t)=>m.jsx(L.span,{...e,ref:t,style:{...ta,...e.style}}));Xr.displayName=na;var ra=Xr,[st]=Ae("Tooltip",[ot]),ct=ot(),Gr="TooltipProvider",oa=700,St="tooltip.open",[ia,Yt]=st(Gr),Kr=e=>{const{__scopeTooltip:t,delayDuration:n=oa,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,s=a.useRef(!0),c=a.useRef(!1),u=a.useRef(0);return a.useEffect(()=>{const l=u.current;return()=>window.clearTimeout(l)},[]),m.jsx(ia,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:a.useCallback(()=>{window.clearTimeout(u.current),s.current=!1},[]),onClose:a.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>s.current=!0,r)},[r]),isPointerInTransitRef:c,onPointerInTransitChange:a.useCallback(l=>{c.current=l},[]),disableHoverableContent:o,children:i})};Kr.displayName=Gr;var Pe="Tooltip",[sa,at]=st(Pe),Zr=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:i,disableHoverableContent:s,delayDuration:c}=e,u=Yt(Pe,e.__scopeTooltip),l=ct(t),[f,d]=a.useState(null),p=Se(),h=a.useRef(0),g=s??u.disableHoverableContent,v=c??u.delayDuration,y=a.useRef(!1),[w,b]=Rt({prop:r,defaultProp:o??!1,onChange:E=>{E?(u.onOpen(),document.dispatchEvent(new CustomEvent(St))):u.onClose(),i==null||i(E)},caller:Pe}),C=a.useMemo(()=>w?y.current?"delayed-open":"instant-open":"closed",[w]),x=a.useCallback(()=>{window.clearTimeout(h.current),h.current=0,y.current=!1,b(!0)},[b]),S=a.useCallback(()=>{window.clearTimeout(h.current),h.current=0,b(!1)},[b]),P=a.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{y.current=!0,b(!0),h.current=0},v)},[v,b]);return a.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),m.jsx(Mr,{...l,children:m.jsx(sa,{scope:t,contentId:p,open:w,stateAttribute:C,trigger:f,onTriggerChange:d,onTriggerEnter:a.useCallback(()=>{u.isOpenDelayedRef.current?P():x()},[u.isOpenDelayedRef,P,x]),onTriggerLeave:a.useCallback(()=>{g?S():(window.clearTimeout(h.current),h.current=0)},[S,g]),onOpen:x,onClose:S,disableHoverableContent:g,children:n})})};Zr.displayName=Pe;var Et="TooltipTrigger",qr=a.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=at(Et,n),i=Yt(Et,n),s=ct(n),c=a.useRef(null),u=F(t,c,o.onTriggerChange),l=a.useRef(!1),f=a.useRef(!1),d=a.useCallback(()=>l.current=!1,[]);return a.useEffect(()=>()=>document.removeEventListener("pointerup",d),[d]),m.jsx(zt,{asChild:!0,...s,children:m.jsx(L.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:u,onPointerMove:_(e.onPointerMove,p=>{p.pointerType!=="touch"&&!f.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),f.current=!0)}),onPointerLeave:_(e.onPointerLeave,()=>{o.onTriggerLeave(),f.current=!1}),onPointerDown:_(e.onPointerDown,()=>{o.open&&o.onClose(),l.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:_(e.onFocus,()=>{l.current||o.onOpen()}),onBlur:_(e.onBlur,o.onClose),onClick:_(e.onClick,o.onClose)})})});qr.displayName=Et;var ca="TooltipPortal",[$a,aa]=st(ca,{forceMount:void 0}),we="TooltipContent",Qr=a.forwardRef((e,t)=>{const n=aa(we,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=at(we,e.__scopeTooltip);return m.jsx(X,{present:r||s.open,children:s.disableHoverableContent?m.jsx(Jr,{side:o,...i,ref:t}):m.jsx(la,{side:o,...i,ref:t})})}),la=a.forwardRef((e,t)=>{const n=at(we,e.__scopeTooltip),r=Yt(we,e.__scopeTooltip),o=a.useRef(null),i=F(t,o),[s,c]=a.useState(null),{trigger:u,onClose:l}=n,f=o.current,{onPointerInTransitChange:d}=r,p=a.useCallback(()=>{c(null),d(!1)},[d]),h=a.useCallback((g,v)=>{const y=g.currentTarget,w={x:g.clientX,y:g.clientY},b=ha(w,y.getBoundingClientRect()),C=va(w,b),x=ma(v.getBoundingClientRect()),S=ya([...C,...x]);c(S),d(!0)},[d]);return a.useEffect(()=>()=>p(),[p]),a.useEffect(()=>{if(u&&f){const g=y=>h(y,f),v=y=>h(y,u);return u.addEventListener("pointerleave",g),f.addEventListener("pointerleave",v),()=>{u.removeEventListener("pointerleave",g),f.removeEventListener("pointerleave",v)}}},[u,f,h,p]),a.useEffect(()=>{if(s){const g=v=>{const y=v.target,w={x:v.clientX,y:v.clientY},b=(u==null?void 0:u.contains(y))||(f==null?void 0:f.contains(y)),C=!ga(w,s);b?p():C&&(p(),l())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[u,f,s,l,p]),m.jsx(Jr,{...e,ref:i})}),[ua,fa]=st(Pe,{isInside:!1}),da=ea("TooltipContent"),Jr=a.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...c}=e,u=at(we,n),l=ct(n),{onClose:f}=u;return a.useEffect(()=>(document.addEventListener(St,f),()=>document.removeEventListener(St,f)),[f]),a.useEffect(()=>{if(u.trigger){const d=p=>{const h=p.target;h!=null&&h.contains(u.trigger)&&f()};return window.addEventListener("scroll",d,{capture:!0}),()=>window.removeEventListener("scroll",d,{capture:!0})}},[u.trigger,f]),m.jsx(Ke,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:d=>d.preventDefault(),onDismiss:f,children:m.jsxs(Ir,{"data-state":u.stateAttribute,...l,...c,ref:t,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[m.jsx(da,{children:r}),m.jsx(ua,{scope:n,isInside:!0,children:m.jsx(ra,{id:u.contentId,role:"tooltip",children:o||r})})]})})});Qr.displayName=we;var eo="TooltipArrow",pa=a.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=ct(n);return fa(eo,n).isInside?null:m.jsx(jr,{...o,...r,ref:t})});pa.displayName=eo;function ha(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function va(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function ma(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function ga(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const c=t[i],u=t[s],l=c.x,f=c.y,d=u.x,p=u.y;f>r!=p>r&&n<(d-l)*(r-f)/(p-f)+l&&(o=!o)}return o}function ya(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),wa(t)}function wa(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var Ha=Kr,Ba=Zr,Va=qr,za=Qr;export{Oa as C,_a as D,Ta as O,Aa as P,Ra as R,xa as S,Da as T,Ma as V,ei as _,Na as a,La as b,Ia as c,ss as d,ds as e,Fa as f,Wa as g,ja as h,ka as i,Ha as j,Ba as k,Va as l,za as m,Ea as n,Z as o,Ca as p,Sa as q,Nn as r};