import{n as e}from"./chunk-Bh1tDfsg.js";import{n as t,t as n}from"./jsx-runtime-BKZ-v_4m.js";import{r}from"./link-7TH0lj3S.js";typeof window<`u`&&window.document&&window.document.createElement;function i(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var a=e(t(),1),o=n();function s(e,t){let n=a.createContext(t),r=e=>{let{children:t,...r}=e,i=a.useMemo(()=>r,Object.values(r));return(0,o.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=a.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function c(e,t=[]){let n=[];function r(t,r){let i=a.createContext(r),s=n.length;n=[...n,r];let c=t=>{let{scope:n,children:r,...c}=t,l=n?.[e]?.[s]||i,u=a.useMemo(()=>c,Object.values(c));return(0,o.jsx)(l.Provider,{value:u,children:r})};c.displayName=t+`Provider`;function l(n,o){let c=o?.[e]?.[s]||i,l=a.useContext(c);if(l)return l;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[c,l]}let i=()=>{let t=n.map(e=>a.createContext(e));return function(n){let r=n?.[e]||t;return a.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,l(i,...t)]}function l(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var u=e(r(),1);function d(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function f(...e){return t=>{let n=!1,r=e.map(e=>{let r=d(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():d(e[t],null)}}}}function p(...e){return a.useCallback(f(...e),e)}function m(e){let t=h(e),n=a.forwardRef((e,n)=>{let{children:r,...i}=e,s=a.Children.toArray(r),c=s.find(_);if(c){let e=c.props.children,r=s.map(t=>t===c?a.Children.count(e)>1?a.Children.only(null):a.isValidElement(e)?e.props.children:null:t);return(0,o.jsx)(t,{...i,ref:n,children:a.isValidElement(e)?a.cloneElement(e,void 0,r):null})}return(0,o.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function h(e){let t=a.forwardRef((e,t)=>{let{children:n,...r}=e;if(a.isValidElement(n)){let e=y(n),i=v(r,n.props);return n.type!==a.Fragment&&(i.ref=t?f(t,e):e),a.cloneElement(n,i)}return a.Children.count(n)>1?a.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var g=Symbol(`radix.slottable`);function _(e){return a.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===g}function v(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function y(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var b=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=m(`Primitive.${t}`),r=a.forwardRef((e,r)=>{let{asChild:i,...a}=e,s=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,o.jsx)(s,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function x(e,t){e&&u.flushSync(()=>e.dispatchEvent(t))}var S=globalThis?.document?a.useLayoutEffect:()=>{},C=a.useId||(()=>void 0),w=0;function T(e){let[t,n]=a.useState(C());return S(()=>{e||n(e=>e??String(w++))},[e]),e||(t?`radix-${t}`:``)}export{m as a,s as c,x as i,c as l,S as n,f as o,b as r,p as s,T as t,i as u};
//# sourceMappingURL=dist-CHdfReBu.js.map