@wmoney/ui-kit 1.0.14 → 1.0.16

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.
package/dist/index.cjs CHANGED
@@ -42,7 +42,7 @@ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.
42
42
 
43
43
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
44
44
 
45
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return l.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},ru=`DialogDescriptionWarning`,iu=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${tu(ru).contentName}}.`;return l.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},au=Al,ou=Il,su=Rl,cu=Hl,lu=`[cmdk-group=""]`,uu=`[cmdk-group-items=""]`,du=`[cmdk-group-heading=""]`,fu=`[cmdk-item=""]`,pu=`${fu}:not([aria-disabled="true"])`,mu=`cmdk-item-select`,hu=`data-value`,gu=(e,t,n)=>hs(e,t,n),_u=l.createContext(void 0),vu=()=>l.useContext(_u),yu=l.createContext(void 0),bu=()=>l.useContext(yu),xu=l.createContext(void 0),Su=l.forwardRef((e,t)=>{let n=Iu(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=Iu(()=>new Set),i=Iu(()=>new Map),a=Iu(()=>new Map),o=Iu(()=>new Set),s=Pu(e),{label:c,children:u,value:d,onValueChange:f,filter:p,shouldFilter:m,loop:h,disablePointerSelection:g=!1,vimBindings:_=!0,...v}=e,y=vs(),b=vs(),x=vs(),S=l.useRef(null),C=zu();Fu(()=>{if(d!==void 0){let e=d.trim();n.current.value=e,w.emit()}},[d]),Fu(()=>{C(6,A)},[]);let w=l.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)k(),D(),C(1,O);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(y))==null||i.focus()}if(C(7,()=>{n.current.selectedItemId=j()?.id,w.emit()}),r||C(5,A),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}w.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),T=l.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,E(t,r)),C(2,()=>{D(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),C(3,()=>{k(),D(),n.current.value||O(),w.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=j();C(4,()=>{k(),t?.getAttribute(`id`)===e&&O(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:y,inputId:x,labelId:b,listInnerRef:S}),[]);function E(e,t){let r=s.current?.filter??gu;return e?r(e,n.current.search,t):0}function D(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=S.current;M().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(uu);t?t.appendChild(e.parentElement===t?e:e.closest(`${uu} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${uu} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${lu}[${hu}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=M().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(hu);w.setState(`value`,e||void 0)}function k(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=E(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function A(){var e;let t=j();t&&(t.parentElement?.firstChild===t&&((e=t.closest(lu)?.querySelector(du))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function j(){return S.current?.querySelector(`${fu}[aria-selected="true"]`)}function M(){return Array.from(S.current?.querySelectorAll(pu)||[])}function N(e){let t=M()[e];t&&w.setState(`value`,t.getAttribute(hu))}function P(e){var t;let n=j(),r=M(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState(`value`,a.getAttribute(hu))}function F(e){let t=j()?.closest(lu),n;for(;t&&!n;)t=e>0?Mu(t,lu):Nu(t,lu),n=t?.querySelector(pu);n?w.setState(`value`,n.getAttribute(hu)):P(e)}let I=()=>N(M().length-1),L=e=>{e.preventDefault(),e.metaKey?I():e.altKey?F(1):P(1)},R=e=>{e.preventDefault(),e.metaKey?N(0):e.altKey?F(-1):P(-1)};return l.createElement($.div,{ref:t,tabIndex:-1,...v,"cmdk-root":``,onKeyDown:e=>{var t;(t=v.onKeyDown)==null||t.call(v,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:_&&e.ctrlKey&&L(e);break;case`ArrowDown`:L(e);break;case`p`:case`k`:_&&e.ctrlKey&&R(e);break;case`ArrowUp`:R(e);break;case`Home`:e.preventDefault(),N(0);break;case`End`:e.preventDefault(),I();break;case`Enter`:{e.preventDefault();let t=j();if(t){let e=new Event(mu);t.dispatchEvent(e)}}}}},l.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:Hu},c),Vu(e,e=>l.createElement(yu.Provider,{value:w},l.createElement(_u.Provider,{value:T},e))))}),Cu=l.forwardRef((e,t)=>{let n=vs(),r=l.useRef(null),i=l.useContext(xu),a=vu(),o=Pu(e),s=o.current?.forceMount??i?.forceMount;Fu(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=Ru(n,r,[e.value,e.children,r],e.keywords),u=bu(),d=Lu(e=>e.value&&e.value===c.current),f=Lu(e=>s||a.filter()===!1?!0:e.search?e.filtered.items.get(n)>0:!0);l.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(mu,p),()=>t.removeEventListener(mu,p)},[f,e.onSelect,e.disabled]);function p(){var e,t;m(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function m(){u.setState(`value`,c.current,!0)}if(!f)return null;let{disabled:h,value:g,onSelect:_,forceMount:y,keywords:b,...x}=e;return l.createElement($.div,{ref:v(r,t),...x,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!h,"aria-selected":!!d,"data-disabled":!!h,"data-selected":!!d,onPointerMove:h||a.getDisablePointerSelection()?void 0:m,onClick:h?void 0:p},e.children)}),wu=l.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=vs(),s=l.useRef(null),c=l.useRef(null),u=vs(),d=vu(),f=Lu(e=>i||d.filter()===!1?!0:e.search?e.filtered.groups.has(o):!0);Fu(()=>d.group(o),[]),Ru(o,s,[e.value,e.heading,c]);let p=l.useMemo(()=>({id:o,forceMount:i}),[i]);return l.createElement($.div,{ref:v(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:f?void 0:!0},n&&l.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:u},n),Vu(e,e=>l.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?u:void 0},l.createElement(xu.Provider,{value:p},e))))}),Tu=l.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=l.useRef(null),a=Lu(e=>!e.search);return!n&&!a?null:l.createElement($.div,{ref:v(i,t),...r,"cmdk-separator":``,role:`separator`})}),Eu=l.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=bu(),o=Lu(e=>e.search),s=Lu(e=>e.selectedItemId),c=vu();return l.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),l.createElement($.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),Du=l.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=l.useRef(null),o=l.useRef(null),s=Lu(e=>e.selectedItemId),c=vu();return l.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),l.createElement($.div,{ref:v(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},Vu(e,e=>l.createElement(`div`,{ref:v(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),Ou=l.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return l.createElement(au,{open:n,onOpenChange:r},l.createElement(ou,{container:o},l.createElement(su,{"cmdk-overlay":``,className:i}),l.createElement(cu,{"aria-label":e.label,"cmdk-dialog":``,className:a},l.createElement(Su,{ref:t,...s}))))}),ku=l.forwardRef((e,t)=>Lu(e=>e.filtered.count===0)?l.createElement($.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),Au=l.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return l.createElement($.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Vu(e,e=>l.createElement(`div`,{"aria-hidden":!0},e)))}),ju=Object.assign(Su,{List:Du,Item:Cu,Input:Eu,Group:wu,Separator:Tu,Dialog:Ou,Empty:ku,Loading:Au});function Mu(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Nu(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Pu(e){let t=l.useRef(e);return Fu(()=>{t.current=e}),t}var Fu=typeof window>`u`?l.useEffect:l.useLayoutEffect;function Iu(e){let t=l.useRef();return t.current===void 0&&(t.current=e()),t}function Lu(e){let t=bu(),n=()=>e(t.snapshot());return l.useSyncExternalStore(t.subscribe,n,n)}function Ru(e,t,n,r=[]){let i=l.useRef(),a=vu();return Fu(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(hu,s),i.current=s}),i}var zu=()=>{let[e,t]=l.useState(),n=Iu(()=>new Map);return Fu(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function Bu(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function Vu({asChild:e,children:t},n){return e&&l.isValidElement(t)?l.cloneElement(Bu(t),{ref:t.ref},n(t.props.children)):n(t)}var Hu={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},Uu=au;function Wu({className:e,...t}){return(0,u.jsx)(ju,{"data-slot":`command`,className:q(`bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md`,e),...t})}function Gu({className:e,...t}){return(0,u.jsxs)(`div`,{"data-slot":`command-input-wrapper`,className:`flex h-9 items-center gap-2 border-b px-3`,children:[(0,u.jsx)(It,{className:`size-4 shrink-0 opacity-50`}),(0,u.jsx)(ju.Input,{"data-slot":`command-input`,className:q(`placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,e),...t})]})}function Ku({className:e,...t}){return(0,u.jsx)(ju.List,{"data-slot":`command-list`,className:q(`max-h-75 scroll-py-1 overflow-x-hidden overflow-y-auto`,e),...t})}function qu({...e}){return(0,u.jsx)(ju.Empty,{"data-slot":`command-empty`,className:`py-6 text-center text-sm`,...e})}function Ju({className:e,...t}){return(0,u.jsx)(ju.Group,{"data-slot":`command-group`,className:q(`text-foreground **:[[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium`,e),...t})}function Yu({className:e,...t}){return(0,u.jsx)(ju.Separator,{"data-slot":`command-separator`,className:q(`bg-border -mx-1 h-px`,e),...t})}function Xu({className:e,...t}){return(0,u.jsx)(ju.Item,{"data-slot":`command-item`,className:q(`data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...t})}var Zu=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=w(`Primitive.${t}`),r=l.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,u.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Qu=`Label`,$u=l.forwardRef((e,t)=>(0,u.jsx)(Zu.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));$u.displayName=Qu;var ed=$u;function td({className:e,...t}){return(0,u.jsx)(ed,{"data-slot":`label`,className:q(`body-md font-medium flex items-center gap-xs leading-none select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}var nd=[`top`,`right`,`bottom`,`left`],rd=Math.min,id=Math.max,ad=Math.round,od=Math.floor,sd=e=>({x:e,y:e}),cd={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function ld(e,t,n){return id(e,rd(t,n))}function ud(e,t){return typeof e==`function`?e(t):e}function dd(e){return e.split(`-`)[0]}function fd(e){return e.split(`-`)[1]}function pd(e){return e===`x`?`y`:`x`}function md(e){return e===`y`?`height`:`width`}function hd(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function gd(e){return pd(hd(e))}function _d(e,t,n){n===void 0&&(n=!1);let r=fd(e),i=gd(e),a=md(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Ed(o)),[o,Ed(o)]}function vd(e){let t=Ed(e);return[yd(e),t,yd(t)]}function yd(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var bd=[`left`,`right`],xd=[`right`,`left`],Sd=[`top`,`bottom`],Cd=[`bottom`,`top`];function wd(e,t,n){switch(e){case`top`:case`bottom`:return n?t?xd:bd:t?bd:xd;case`left`:case`right`:return t?Sd:Cd;default:return[]}}function Td(e,t,n,r){let i=fd(e),a=wd(dd(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(yd)))),a}function Ed(e){let t=dd(e);return cd[t]+e.slice(t.length)}function Dd(e){return{top:0,right:0,bottom:0,left:0,...e}}function Od(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Dd(e)}function kd(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Ad(e,t,n){let{reference:r,floating:i}=e,a=hd(t),o=gd(t),s=md(o),c=dd(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(fd(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function jd(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=ud(t,e),p=Od(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=kd(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=kd(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Md=50,Nd=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:jd},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Ad(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Md&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Ad(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Pd=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=ud(e,t)||{};if(l==null)return{};let d=Od(u),f={x:n,y:r},p=gd(i),m=md(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=rd(d[_],T),D=rd(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=ld(O,A,k),M=!c.arrow&&fd(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),Fd=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=ud(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=dd(r),_=hd(o),v=dd(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Ed(o)]:vd(o)),x=p!==`none`;!d&&x&&b.push(...Td(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=_d(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==hd(t))||T.every(e=>hd(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=hd(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Id(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ld(e){return nd.some(t=>e[t]>=0)}var Rd=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=ud(e,t);switch(i){case`referenceHidden`:{let e=Id(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Ld(e)}}}case`escaped`:{let e=Id(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Ld(e)}}}default:return{}}}}},zd=new Set([`left`,`top`]);async function Bd(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=dd(n),s=fd(n),c=hd(n)===`y`,l=zd.has(o)?-1:1,u=a&&c?-1:1,d=ud(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Vd=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Bd(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Hd=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=ud(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=hd(dd(i)),p=pd(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=ld(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=ld(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Ud=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=ud(e,t),u={x:n,y:r},d=hd(i),f=pd(d),p=u[f],m=u[d],h=ud(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=zd.has(dd(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Wd=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=ud(e,t),u=await o.detectOverflow(t,l),d=dd(i),f=fd(i),p=hd(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=rd(h-u[g],v),x=rd(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=id(u.left,0),t=id(u.right,0),n=id(u.top,0),r=id(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:id(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:id(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function Gd(){return typeof window<`u`}function Kd(e){return Yd(e)?(e.nodeName||``).toLowerCase():`#document`}function qd(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Jd(e){return((Yd(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Yd(e){return Gd()?e instanceof Node||e instanceof qd(e).Node:!1}function Xd(e){return Gd()?e instanceof Element||e instanceof qd(e).Element:!1}function Zd(e){return Gd()?e instanceof HTMLElement||e instanceof qd(e).HTMLElement:!1}function Qd(e){return!Gd()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof qd(e).ShadowRoot}function $d(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=df(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ef(e){return/^(table|td|th)$/.test(Kd(e))}function tf(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var nf=/transform|translate|scale|rotate|perspective|filter/,rf=/paint|layout|strict|content/,af=e=>!!e&&e!==`none`,of;function sf(e){let t=Xd(e)?df(e):e;return af(t.transform)||af(t.translate)||af(t.scale)||af(t.rotate)||af(t.perspective)||!lf()&&(af(t.backdropFilter)||af(t.filter))||nf.test(t.willChange||``)||rf.test(t.contain||``)}function cf(e){let t=pf(e);for(;Zd(t)&&!uf(t);){if(sf(t))return t;if(tf(t))return null;t=pf(t)}return null}function lf(){return of??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),of}function uf(e){return/^(html|body|#document)$/.test(Kd(e))}function df(e){return qd(e).getComputedStyle(e)}function ff(e){return Xd(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function pf(e){if(Kd(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Qd(e)&&e.host||Jd(e);return Qd(t)?t.host:t}function mf(e){let t=pf(e);return uf(t)?e.ownerDocument?e.ownerDocument.body:e.body:Zd(t)&&$d(t)?t:mf(t)}function hf(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=mf(e),i=r===e.ownerDocument?.body,a=qd(r);if(i){let e=gf(a);return t.concat(a,a.visualViewport||[],$d(r)?r:[],e&&n?hf(e):[])}else return t.concat(r,hf(r,[],n))}function gf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function _f(e){let t=df(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Zd(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=ad(n)!==a||ad(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function vf(e){return Xd(e)?e:e.contextElement}function yf(e){let t=vf(e);if(!Zd(t))return sd(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=_f(t),o=(a?ad(n.width):n.width)/r,s=(a?ad(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var bf=sd(0);function xf(e){let t=qd(e);return!lf()||!t.visualViewport?bf:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Sf(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==qd(e)?!1:t}function Cf(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=vf(e),o=sd(1);t&&(r?Xd(r)&&(o=yf(r)):o=yf(e));let s=Sf(a,n,r)?xf(a):sd(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=qd(a),t=r&&Xd(r)?qd(r):r,n=e,i=gf(n);for(;i&&r&&t!==n;){let e=yf(i),t=i.getBoundingClientRect(),r=df(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=qd(i),i=gf(n)}}return kd({width:u,height:d,x:c,y:l})}function wf(e,t){let n=ff(e).scrollLeft;return t?t.left+n:Cf(Jd(e)).left+n}function Tf(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-wf(e,n),y:n.top+t.scrollTop}}function Ef(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Jd(r),s=t?tf(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=sd(1),u=sd(0),d=Zd(r);if((d||!d&&!a)&&((Kd(r)!==`body`||$d(o))&&(c=ff(r)),d)){let e=Cf(r);l=yf(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Tf(o,c):sd(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Df(e){return Array.from(e.getClientRects())}function Of(e){let t=Jd(e),n=ff(e),r=e.ownerDocument.body,i=id(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=id(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+wf(e),s=-n.scrollTop;return df(r).direction===`rtl`&&(o+=id(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var kf=25;function Af(e,t){let n=qd(e),r=Jd(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=lf();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=wf(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=kf&&(a-=o)}else l<=kf&&(a+=l);return{width:a,height:o,x:s,y:c}}function jf(e,t){let n=Cf(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Zd(e)?yf(e):sd(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Mf(e,t,n){let r;if(t===`viewport`)r=Af(e,n);else if(t===`document`)r=Of(Jd(e));else if(Xd(t))r=jf(t,n);else{let n=xf(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return kd(r)}function Nf(e,t){let n=pf(e);return n===t||!Xd(n)||uf(n)?!1:df(n).position===`fixed`||Nf(n,t)}function Pf(e,t){let n=t.get(e);if(n)return n;let r=hf(e,[],!1).filter(e=>Xd(e)&&Kd(e)!==`body`),i=null,a=df(e).position===`fixed`,o=a?pf(e):e;for(;Xd(o)&&!uf(o);){let t=df(o),n=sf(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||$d(o)&&!n&&Nf(e,o))?r=r.filter(e=>e!==o):i=t,o=pf(o)}return t.set(e,r),r}function Ff(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?tf(t)?[]:Pf(t,this._c):[].concat(n),r],o=Mf(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Mf(t,a[e],i);s=id(n.top,s),c=rd(n.right,c),l=rd(n.bottom,l),u=id(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function If(e){let{width:t,height:n}=_f(e);return{width:t,height:n}}function Lf(e,t,n){let r=Zd(t),i=Jd(t),a=n===`fixed`,o=Cf(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=sd(0);function l(){c.x=wf(i)}if(r||!r&&!a)if((Kd(t)!==`body`||$d(i))&&(s=ff(t)),r){let e=Cf(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Tf(i,s):sd(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Rf(e){return df(e).position===`static`}function zf(e,t){if(!Zd(e)||df(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Jd(e)===n&&(n=n.ownerDocument.body),n}function Bf(e,t){let n=qd(e);if(tf(e))return n;if(!Zd(e)){let t=pf(e);for(;t&&!uf(t);){if(Xd(t)&&!Rf(t))return t;t=pf(t)}return n}let r=zf(e,t);for(;r&&ef(r)&&Rf(r);)r=zf(r,t);return r&&uf(r)&&Rf(r)&&!sf(r)?n:r||cf(e)||n}var Vf=async function(e){let t=this.getOffsetParent||Bf,n=this.getDimensions,r=await n(e.floating);return{reference:Lf(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Hf(e){return df(e).direction===`rtl`}var Uf={convertOffsetParentRelativeRectToViewportRelativeRect:Ef,getDocumentElement:Jd,getClippingRect:Ff,getOffsetParent:Bf,getElementRects:Vf,getClientRects:Df,getDimensions:If,getScale:yf,isElement:Xd,isRTL:Hf};function Wf(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Gf(e,t){let n=null,r,i=Jd(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=od(d),h=od(i.clientWidth-(u+f)),g=od(i.clientHeight-(d+p)),_=od(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:id(0,rd(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Wf(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Kf(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=vf(e),u=i||a?[...l?hf(l):[],...t?hf(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Gf(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Cf(e):null;c&&g();function g(){let t=Cf(e);h&&!Wf(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var qf=Vd,Jf=Hd,Yf=Fd,Xf=Wd,Zf=Rd,Qf=Pd,$f=Ud,ep=(e,t,n)=>{let r=new Map,i={platform:Uf,...n},a={...i.platform,_c:r};return Nd(e,t,{...i,platform:a})},tp=typeof document<`u`?l.useLayoutEffect:function(){};function np(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!np(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!np(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function rp(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ip(e,t){let n=rp(e);return Math.round(t*n)/n}function ap(e){let t=l.useRef(e);return tp(()=>{t.current=e}),t}function op(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:u}=e,[f,p]=l.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,h]=l.useState(r);np(m,r)||h(r);let[g,_]=l.useState(null),[v,y]=l.useState(null),b=l.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=l.useCallback(e=>{e!==T.current&&(T.current=e,y(e))},[]),S=a||g,C=o||v,w=l.useRef(null),T=l.useRef(null),E=l.useRef(f),D=c!=null,O=ap(c),k=ap(i),A=ap(u),j=l.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:m};k.current&&(e.platform=k.current),ep(w.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!np(E.current,t)&&(E.current=t,d.flushSync(()=>{p(t)}))})},[m,t,n,k,A]);tp(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[u]);let M=l.useRef(!1);tp(()=>(M.current=!0,()=>{M.current=!1}),[]),tp(()=>{if(S&&(w.current=S),C&&(T.current=C),S&&C){if(O.current)return O.current(S,C,j);j()}},[S,C,j,O,D]);let N=l.useMemo(()=>({reference:w,floating:T,setReference:b,setFloating:x}),[b,x]),P=l.useMemo(()=>({reference:S,floating:C}),[S,C]),F=l.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=ip(P.floating,f.x),r=ip(P.floating,f.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...rp(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,P.floating,f.x,f.y]);return l.useMemo(()=>({...f,update:j,refs:N,elements:P,floatingStyles:F}),[f,j,N,P,F])}var sp=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Qf({element:r.current,padding:i}).fn(n):r?Qf({element:r,padding:i}).fn(n):{}}}},cp=(e,t)=>{let n=qf(e);return{name:n.name,fn:n.fn,options:[e,t]}},lp=(e,t)=>{let n=Jf(e);return{name:n.name,fn:n.fn,options:[e,t]}},up=(e,t)=>({fn:$f(e).fn,options:[e,t]}),dp=(e,t)=>{let n=Yf(e);return{name:n.name,fn:n.fn,options:[e,t]}},fp=(e,t)=>{let n=Xf(e);return{name:n.name,fn:n.fn,options:[e,t]}},pp=(e,t)=>{let n=Zf(e);return{name:n.name,fn:n.fn,options:[e,t]}},mp=(e,t)=>{let n=sp(e);return{name:n.name,fn:n.fn,options:[e,t]}},hp=`Arrow`,gp=l.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,u.jsx)($.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,u.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});gp.displayName=hp;var _p=gp,vp=`Popper`,[yp,bp]=_o(vp),[xp,Sp]=yp(vp),Cp=e=>{let{__scopePopper:t,children:n}=e,[r,i]=l.useState(null);return(0,u.jsx)(xp,{scope:t,anchor:r,onAnchorChange:i,children:n})};Cp.displayName=vp;var wp=`PopperAnchor`,Tp=l.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=Sp(wp,n),o=l.useRef(null),s=y(t,o),c=l.useRef(null);return l.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,u.jsx)($.div,{...i,ref:s})});Tp.displayName=wp;var Ep=`PopperContent`,[Dp,Op]=yp(Ep),kp=l.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:p=`partial`,hideWhenDetached:m=!1,updatePositionStrategy:h=`optimized`,onPlaced:g,..._}=e,v=Sp(Ep,n),[b,x]=l.useState(null),S=y(t,e=>x(e)),[C,w]=l.useState(null),T=To(C),E=T?.width??0,D=T?.height??0,O=r+(a===`center`?``:`-`+a),k=typeof f==`number`?f:{top:0,right:0,bottom:0,left:0,...f},A=Array.isArray(d)?d:[d],j=A.length>0,M={padding:k,boundary:A.filter(Np),altBoundary:j},{refs:N,floatingStyles:P,placement:F,isPositioned:I,middlewareData:L}=op({strategy:`fixed`,placement:O,whileElementsMounted:(...e)=>Kf(...e,{animationFrame:h===`always`}),elements:{reference:v.anchor},middleware:[cp({mainAxis:i+D,alignmentAxis:o}),c&&lp({mainAxis:!0,crossAxis:!1,limiter:p===`partial`?up():void 0,...M}),c&&dp({...M}),fp({...M,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),C&&mp({element:C,padding:s}),Pp({arrowWidth:E,arrowHeight:D}),m&&pp({strategy:`referenceHidden`,...M})]}),[R,ee]=Fp(F),te=ys(g);yo(()=>{I&&te?.()},[I,te]);let z=L.arrow?.x,B=L.arrow?.y,ne=L.arrow?.centerOffset!==0,[re,V]=l.useState();return yo(()=>{b&&V(window.getComputedStyle(b).zIndex)},[b]),(0,u.jsx)(`div`,{ref:N.setFloating,"data-radix-popper-content-wrapper":``,style:{...P,transform:I?P.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:re,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(` `),...L.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,u.jsx)(Dp,{scope:n,placedSide:R,onArrowChange:w,arrowX:z,arrowY:B,shouldHideArrow:ne,children:(0,u.jsx)($.div,{"data-side":R,"data-align":ee,..._,ref:S,style:{..._.style,animation:I?void 0:`none`}})})})});kp.displayName=Ep;var Ap=`PopperArrow`,jp={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Mp=l.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Op(Ap,n),a=jp[i.placedSide];return(0,u.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]: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:(0,u.jsx)(_p,{...r,ref:t,style:{...r.style,display:`block`}})})});Mp.displayName=Ap;function Np(e){return e!==null}var Pp=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Fp(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function Fp(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Ip=Cp,Lp=Tp,Rp=kp,zp=Mp;function Bp(e){let t=Vp(e),n=l.forwardRef((e,n)=>{let{children:r,...i}=e,a=l.Children.toArray(r),o=a.find(Up);if(o){let e=o.props.children,r=a.map(t=>t===o?l.Children.count(e)>1?l.Children.only(null):l.isValidElement(e)?e.props.children:null:t);return(0,u.jsx)(t,{...i,ref:n,children:l.isValidElement(e)?l.cloneElement(e,void 0,r):null})}return(0,u.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function Vp(e){let t=l.forwardRef((e,t)=>{let{children:n,...r}=e;if(l.isValidElement(n)){let e=Gp(n),i=Wp(r,n.props);return n.type!==l.Fragment&&(i.ref=t?v(t,e):e),l.cloneElement(n,i)}return l.Children.count(n)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Hp=Symbol(`radix.slottable`);function Up(e){return l.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Hp}function Wp(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 Gp(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 Kp=`Popover`,[qp,Jp]=_o(Kp,[bp]),Yp=bp(),[Xp,Zp]=qp(Kp),Qp=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=Yp(t),c=l.useRef(null),[d,f]=l.useState(!1),[p,m]=xo({prop:r,defaultProp:i??!1,onChange:a,caller:Kp});return(0,u.jsx)(Ip,{...s,children:(0,u.jsx)(Xp,{scope:t,contentId:vs(),triggerRef:c,open:p,onOpenChange:m,onOpenToggle:l.useCallback(()=>m(e=>!e),[m]),hasCustomAnchor:d,onCustomAnchorAdd:l.useCallback(()=>f(!0),[]),onCustomAnchorRemove:l.useCallback(()=>f(!1),[]),modal:o,children:n})})};Qp.displayName=Kp;var $p=`PopoverAnchor`,em=l.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Zp($p,n),a=Yp(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return l.useEffect(()=>(o(),()=>s()),[o,s]),(0,u.jsx)(Lp,{...a,...r,ref:t})});em.displayName=$p;var tm=`PopoverTrigger`,nm=l.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Zp(tm,n),a=Yp(n),o=y(t,i.triggerRef),s=(0,u.jsx)($.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":_m(i.open),...r,ref:o,onClick:Q(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,u.jsx)(Lp,{asChild:!0,...a,children:s})});nm.displayName=tm;var rm=`PopoverPortal`,[im,am]=qp(rm,{forceMount:void 0}),om=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=Zp(rm,t);return(0,u.jsx)(im,{scope:t,forceMount:n,children:(0,u.jsx)(Do,{present:n||a.open,children:(0,u.jsx)(Zs,{asChild:!0,container:i,children:r})})})};om.displayName=rm;var sm=`PopoverContent`,cm=l.forwardRef((e,t)=>{let n=am(sm,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=Zp(sm,e.__scopePopover);return(0,u.jsx)(Do,{present:r||a.open,children:a.modal?(0,u.jsx)(um,{...i,ref:t}):(0,u.jsx)(dm,{...i,ref:t})})});cm.displayName=sm;var lm=Bp(`PopoverContent.RemoveScroll`),um=l.forwardRef((e,t)=>{let n=Zp(sm,e.__scopePopover),r=l.useRef(null),i=y(t,r),a=l.useRef(!1);return l.useEffect(()=>{let e=r.current;if(e)return vl(e)},[]),(0,u.jsx)(ll,{as:lm,allowPinchZoom:!0,children:(0,u.jsx)(fm,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Q(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Q(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:Q(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),dm=l.forwardRef((e,t)=>{let n=Zp(sm,e.__scopePopover),r=l.useRef(!1),i=l.useRef(!1);return(0,u.jsx)(fm,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),fm=l.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:d,...f}=e,p=Zp(sm,n),m=Yp(n);return $s(),(0,u.jsx)(Rs,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,u.jsx)(Ds,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:d,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>p.onOpenChange(!1),children:(0,u.jsx)(Rp,{"data-state":_m(p.open),role:`dialog`,id:p.contentId,...m,...f,ref:t,style:{...f.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)`}})})})}),pm=`PopoverClose`,mm=l.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Zp(pm,n);return(0,u.jsx)($.button,{type:`button`,...r,ref:t,onClick:Q(e.onClick,()=>i.onOpenChange(!1))})});mm.displayName=pm;var hm=`PopoverArrow`,gm=l.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Yp(n);return(0,u.jsx)(zp,{...i,...r,ref:t})});gm.displayName=hm;function _m(e){return e?`open`:`closed`}var vm=Qp,ym=nm,bm=om,xm=cm;function Sm({...e}){return(0,u.jsx)(vm,{"data-slot":`popover`,...e})}function Cm({...e}){return(0,u.jsx)(ym,{"data-slot":`popover-trigger`,...e})}function wm({className:e,align:t=`center`,sideOffset:n=4,...r}){return(0,u.jsx)(bm,{children:(0,u.jsx)(xm,{"data-slot":`popover-content`,align:t,sideOffset:n,className:q(`bg-input text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-lg border p-3 shadow-md outline-hidden`,e),...r})})}function Tm({label:e,required:t,value:n,onChange:r}){let[i,a]=(0,l.useState)(n),o=n===void 0?i:n,s=e=>{r?r(e):a(e)};return(0,u.jsxs)(`div`,{className:`mx-auto w-full sm:w-44 flex flex-col gap-1`,children:[(0,u.jsxs)(td,{htmlFor:`date-picker-simple`,className:`label-md`,children:[e,` `,t&&(0,u.jsx)(`span`,{className:`text-destructive`,children:`*`})]}),(0,u.jsxs)(Sm,{children:[(0,u.jsx)(Cm,{asChild:!0,children:(0,u.jsx)(qt,{variant:`outline`,id:`date-picker-simple`,className:`w-full justify-start px-2.5 font-normal`,children:o?Mr(o,`dd/MM/yyyy`,{locale:Sn}):(0,u.jsx)(`span`,{className:`text-muted`,children:`Selecione a data`})})}),(0,u.jsx)(wm,{className:`w-auto p-0`,align:`start`,children:(0,u.jsx)(so,{mode:`single`,selected:o,defaultMonth:o,captionLayout:`dropdown`,onSelect:e=>{s(e)}})})]})]})}function Em(e){let t=Dm(e),n=l.forwardRef((e,n)=>{let{children:r,...i}=e,a=l.Children.toArray(r),o=a.find(km);if(o){let e=o.props.children,r=a.map(t=>t===o?l.Children.count(e)>1?l.Children.only(null):l.isValidElement(e)?e.props.children:null:t);return(0,u.jsx)(t,{...i,ref:n,children:l.isValidElement(e)?l.cloneElement(e,void 0,r):null})}return(0,u.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function Dm(e){let t=l.forwardRef((e,t)=>{let{children:n,...r}=e;if(l.isValidElement(n)){let e=jm(n),i=Am(r,n.props);return n.type!==l.Fragment&&(i.ref=t?v(t,e):e),l.cloneElement(n,i)}return l.Children.count(n)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Om=Symbol(`radix.slottable`);function km(e){return l.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Om}function Am(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 jm(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)}function Mm(e){let t=e+`CollectionProvider`,[n,r]=_o(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=l.default.useRef(null),a=l.default.useRef(new Map).current;return(0,u.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=Em(s),d=l.default.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,u.jsx)(c,{ref:y(t,a(s,n).collectionRef),children:r})});d.displayName=s;let f=e+`CollectionItemSlot`,p=`data-radix-collection-item`,m=Em(f),h=l.default.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=l.default.useRef(null),s=y(t,o),c=a(f,n);return l.default.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,u.jsx)(m,{[p]:``,ref:s,children:r})});h.displayName=f;function g(t){let n=a(e+`CollectionConsumer`,t);return l.default.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:d,ItemSlot:h},g,r]}var Nm=l.createContext(void 0);function Pm(e){let t=l.useContext(Nm);return e||t||`ltr`}var Fm=`rovingFocusGroup.onEntryFocus`,Im={bubbles:!1,cancelable:!0},Lm=`RovingFocusGroup`,[Rm,zm,Bm]=Mm(Lm),[Vm,Hm]=_o(Lm,[Bm]),[Um,Wm]=Vm(Lm),Gm=l.forwardRef((e,t)=>(0,u.jsx)(Rm.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,u.jsx)(Rm.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,u.jsx)(Km,{...e,ref:t})})}));Gm.displayName=Lm;var Km=l.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...p}=e,m=l.useRef(null),h=y(t,m),g=Pm(a),[_,v]=xo({prop:o,defaultProp:s??null,onChange:c,caller:Lm}),[b,x]=l.useState(!1),S=ys(d),C=zm(n),w=l.useRef(!1),[T,E]=l.useState(0);return l.useEffect(()=>{let e=m.current;if(e)return e.addEventListener(Fm,S),()=>e.removeEventListener(Fm,S)},[S]),(0,u.jsx)(Um,{scope:n,orientation:r,dir:g,loop:i,currentTabStopId:_,onItemFocus:l.useCallback(e=>v(e),[v]),onItemShiftTab:l.useCallback(()=>x(!0),[]),onFocusableItemAdd:l.useCallback(()=>E(e=>e+1),[]),onFocusableItemRemove:l.useCallback(()=>E(e=>e-1),[]),children:(0,u.jsx)($.div,{tabIndex:b||T===0?-1:0,"data-orientation":r,...p,ref:h,style:{outline:`none`,...e.style},onMouseDown:Q(e.onMouseDown,()=>{w.current=!0}),onFocus:Q(e.onFocus,e=>{let t=!w.current;if(e.target===e.currentTarget&&t&&!b){let t=new CustomEvent(Fm,Im);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=C().filter(e=>e.focusable);Qm([e.find(e=>e.active),e.find(e=>e.id===_),...e].filter(Boolean).map(e=>e.ref.current),f)}}w.current=!1}),onBlur:Q(e.onBlur,()=>x(!1))})})}),qm=`RovingFocusGroupItem`,Jm=l.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=vs(),d=a||c,f=Wm(qm,n),p=f.currentTabStopId===d,m=zm(n),{onFocusableItemAdd:h,onFocusableItemRemove:g,currentTabStopId:_}=f;return l.useEffect(()=>{if(r)return h(),()=>g()},[r,h,g]),(0,u.jsx)(Rm.ItemSlot,{scope:n,id:d,focusable:r,active:i,children:(0,u.jsx)($.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...s,ref:t,onMouseDown:Q(e.onMouseDown,e=>{r?f.onItemFocus(d):e.preventDefault()}),onFocus:Q(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:Q(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){f.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Zm(e,f.orientation,f.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=m().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=f.loop?$m(n,r+1):n.slice(r+1)}setTimeout(()=>Qm(n))}}),children:typeof o==`function`?o({isCurrentTabStop:p,hasTabStop:_!=null}):o})})});Jm.displayName=qm;var Ym={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Xm(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function Zm(e,t,n){let r=Xm(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Ym[r]}function Qm(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function $m(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var eh=Gm,th=Jm;function nh(e){let t=rh(e),n=l.forwardRef((e,n)=>{let{children:r,...i}=e,a=l.Children.toArray(r),o=a.find(ah);if(o){let e=o.props.children,r=a.map(t=>t===o?l.Children.count(e)>1?l.Children.only(null):l.isValidElement(e)?e.props.children:null:t);return(0,u.jsx)(t,{...i,ref:n,children:l.isValidElement(e)?l.cloneElement(e,void 0,r):null})}return(0,u.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function rh(e){let t=l.forwardRef((e,t)=>{let{children:n,...r}=e;if(l.isValidElement(n)){let e=sh(n),i=oh(r,n.props);return n.type!==l.Fragment&&(i.ref=t?v(t,e):e),l.cloneElement(n,i)}return l.Children.count(n)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ih=Symbol(`radix.slottable`);function ah(e){return l.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===ih}function oh(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 sh(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 ch=[`Enter`,` `],lh=[`ArrowDown`,`PageUp`,`Home`],uh=[`ArrowUp`,`PageDown`,`End`],dh=[...lh,...uh],fh={ltr:[...ch,`ArrowRight`],rtl:[...ch,`ArrowLeft`]},ph={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},mh=`Menu`,[hh,gh,_h]=Mm(mh),[vh,yh]=_o(mh,[_h,bp,Hm]),bh=bp(),xh=Hm(),[Sh,Ch]=vh(mh),[wh,Th]=vh(mh),Eh=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=bh(t),[c,d]=l.useState(null),f=l.useRef(!1),p=ys(a),m=Pm(i);return l.useEffect(()=>{let e=()=>{f.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>f.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),(0,u.jsx)(Ip,{...s,children:(0,u.jsx)(Sh,{scope:t,open:n,onOpenChange:p,content:c,onContentChange:d,children:(0,u.jsx)(wh,{scope:t,onClose:l.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:f,dir:m,modal:o,children:r})})})};Eh.displayName=mh;var Dh=`MenuAnchor`,Oh=l.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=bh(n);return(0,u.jsx)(Lp,{...i,...r,ref:t})});Oh.displayName=Dh;var kh=`MenuPortal`,[Ah,jh]=vh(kh,{forceMount:void 0}),Mh=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Ch(kh,t);return(0,u.jsx)(Ah,{scope:t,forceMount:n,children:(0,u.jsx)(Do,{present:n||a.open,children:(0,u.jsx)(Zs,{asChild:!0,container:i,children:r})})})};Mh.displayName=kh;var Nh=`MenuContent`,[Ph,Fh]=vh(Nh),Ih=l.forwardRef((e,t)=>{let n=jh(Nh,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Ch(Nh,e.__scopeMenu),o=Th(Nh,e.__scopeMenu);return(0,u.jsx)(hh.Provider,{scope:e.__scopeMenu,children:(0,u.jsx)(Do,{present:r||a.open,children:(0,u.jsx)(hh.Slot,{scope:e.__scopeMenu,children:o.modal?(0,u.jsx)(Lh,{...i,ref:t}):(0,u.jsx)(Rh,{...i,ref:t})})})})}),Lh=l.forwardRef((e,t)=>{let n=Ch(Nh,e.__scopeMenu),r=l.useRef(null),i=y(t,r);return l.useEffect(()=>{let e=r.current;if(e)return vl(e)},[]),(0,u.jsx)(Bh,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Q(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Rh=l.forwardRef((e,t)=>{let n=Ch(Nh,e.__scopeMenu);return(0,u.jsx)(Bh,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),zh=nh(`MenuContent.ScrollLock`),Bh=l.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:h,disableOutsideScroll:g,..._}=e,v=Ch(Nh,n),b=Th(Nh,n),x=bh(n),S=xh(n),C=gh(n),[w,T]=l.useState(null),E=l.useRef(null),D=y(t,E,v.onContentChange),O=l.useRef(0),k=l.useRef(``),A=l.useRef(0),j=l.useRef(null),M=l.useRef(`right`),N=l.useRef(0),P=g?ll:l.Fragment,F=g?{as:zh,allowPinchZoom:!0}:void 0,I=e=>{let t=k.current+e,n=C().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=wg(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){k.current=t,window.clearTimeout(O.current),t!==``&&(O.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};l.useEffect(()=>()=>window.clearTimeout(O.current),[]),$s();let L=l.useCallback(e=>M.current===j.current?.side&&Eg(e,j.current?.area),[]);return(0,u.jsx)(Ph,{scope:n,searchRef:k,onItemEnter:l.useCallback(e=>{L(e)&&e.preventDefault()},[L]),onItemLeave:l.useCallback(e=>{L(e)||(E.current?.focus(),T(null))},[L]),onTriggerLeave:l.useCallback(e=>{L(e)&&e.preventDefault()},[L]),pointerGraceTimerRef:A,onPointerGraceIntentChange:l.useCallback(e=>{j.current=e},[]),children:(0,u.jsx)(P,{...F,children:(0,u.jsx)(Rs,{asChild:!0,trapped:i,onMountAutoFocus:Q(a,e=>{e.preventDefault(),E.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,u.jsx)(Ds,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:h,children:(0,u.jsx)(eh,{asChild:!0,...S,dir:b.dir,orientation:`vertical`,loop:r,currentTabStopId:w,onCurrentTabStopIdChange:T,onEntryFocus:Q(c,e=>{b.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,u.jsx)(Rp,{role:`menu`,"aria-orientation":`vertical`,"data-state":yg(v.open),"data-radix-menu-content":``,dir:b.dir,...x,..._,ref:D,style:{outline:`none`,..._.style},onKeyDown:Q(_.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&I(e.key));let i=E.current;if(e.target!==i||!dh.includes(e.key))return;e.preventDefault();let a=C().filter(e=>!e.disabled).map(e=>e.ref.current);uh.includes(e.key)&&a.reverse(),Sg(a)}),onBlur:Q(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(O.current),k.current=``)}),onPointerMove:Q(e.onPointerMove,Dg(e=>{let t=e.target,n=N.current!==e.clientX;e.currentTarget.contains(t)&&n&&(M.current=e.clientX>N.current?`right`:`left`,N.current=e.clientX)}))})})})})})})});Ih.displayName=Nh;var Vh=`MenuGroup`,Hh=l.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,u.jsx)($.div,{role:`group`,...r,ref:t})});Hh.displayName=Vh;var Uh=`MenuLabel`,Wh=l.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,u.jsx)($.div,{...r,ref:t})});Wh.displayName=Uh;var Gh=`MenuItem`,Kh=`menu.itemSelect`,qh=l.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=l.useRef(null),o=Th(Gh,e.__scopeMenu),s=Fh(Gh,e.__scopeMenu),c=y(t,a),d=l.useRef(!1),f=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(Kh,{bubbles:!0,cancelable:!0});e.addEventListener(Kh,e=>r?.(e),{once:!0}),Lo(e,t),t.defaultPrevented?d.current=!1:o.onClose()}};return(0,u.jsx)(Jh,{...i,ref:c,disabled:n,onClick:Q(e.onClick,f),onPointerDown:t=>{e.onPointerDown?.(t),d.current=!0},onPointerUp:Q(e.onPointerUp,e=>{d.current||e.currentTarget?.click()}),onKeyDown:Q(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||ch.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});qh.displayName=Gh;var Jh=l.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=Fh(Gh,n),s=xh(n),c=l.useRef(null),d=y(t,c),[f,p]=l.useState(!1),[m,h]=l.useState(``);return l.useEffect(()=>{let e=c.current;e&&h((e.textContent??``).trim())},[a.children]),(0,u.jsx)(hh.ItemSlot,{scope:n,disabled:r,textValue:i??m,children:(0,u.jsx)(th,{asChild:!0,...s,focusable:!r,children:(0,u.jsx)($.div,{role:`menuitem`,"data-highlighted":f?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:d,onPointerMove:Q(e.onPointerMove,Dg(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Q(e.onPointerLeave,Dg(e=>o.onItemLeave(e))),onFocus:Q(e.onFocus,()=>p(!0)),onBlur:Q(e.onBlur,()=>p(!1))})})})}),Yh=`MenuCheckboxItem`,Xh=l.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,u.jsx)(ig,{scope:e.__scopeMenu,checked:n,children:(0,u.jsx)(qh,{role:`menuitemcheckbox`,"aria-checked":bg(n)?`mixed`:n,...i,ref:t,"data-state":xg(n),onSelect:Q(i.onSelect,()=>r?.(bg(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Xh.displayName=Yh;var Zh=`MenuRadioGroup`,[Qh,$h]=vh(Zh,{value:void 0,onValueChange:()=>{}}),eg=l.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=ys(r);return(0,u.jsx)(Qh,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,u.jsx)(Hh,{...i,ref:t})})});eg.displayName=Zh;var tg=`MenuRadioItem`,ng=l.forwardRef((e,t)=>{let{value:n,...r}=e,i=$h(tg,e.__scopeMenu),a=n===i.value;return(0,u.jsx)(ig,{scope:e.__scopeMenu,checked:a,children:(0,u.jsx)(qh,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":xg(a),onSelect:Q(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});ng.displayName=tg;var rg=`MenuItemIndicator`,[ig,ag]=vh(rg,{checked:!1}),og=l.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=ag(rg,n);return(0,u.jsx)(Do,{present:r||bg(a.checked)||a.checked===!0,children:(0,u.jsx)($.span,{...i,ref:t,"data-state":xg(a.checked)})})});og.displayName=rg;var sg=`MenuSeparator`,cg=l.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,u.jsx)($.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});cg.displayName=sg;var lg=`MenuArrow`,ug=l.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=bh(n);return(0,u.jsx)(zp,{...i,...r,ref:t})});ug.displayName=lg;var dg=`MenuSub`,[fg,pg]=vh(dg),mg=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=Ch(dg,t),o=bh(t),[s,c]=l.useState(null),[d,f]=l.useState(null),p=ys(i);return l.useEffect(()=>(a.open===!1&&p(!1),()=>p(!1)),[a.open,p]),(0,u.jsx)(Ip,{...o,children:(0,u.jsx)(Sh,{scope:t,open:r,onOpenChange:p,content:d,onContentChange:f,children:(0,u.jsx)(fg,{scope:t,contentId:vs(),triggerId:vs(),trigger:s,onTriggerChange:c,children:n})})})};mg.displayName=dg;var hg=`MenuSubTrigger`,gg=l.forwardRef((e,t)=>{let n=Ch(hg,e.__scopeMenu),r=Th(hg,e.__scopeMenu),i=pg(hg,e.__scopeMenu),a=Fh(hg,e.__scopeMenu),o=l.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,d={__scopeMenu:e.__scopeMenu},f=l.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return l.useEffect(()=>f,[f]),l.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,u.jsx)(Oh,{asChild:!0,...d,children:(0,u.jsx)(Jh,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":i.contentId,"data-state":yg(n.open),...e,ref:v(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Q(e.onPointerMove,Dg(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:Q(e.onPointerLeave,Dg(e=>{f();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:Q(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||fh[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});gg.displayName=hg;var _g=`MenuSubContent`,vg=l.forwardRef((e,t)=>{let n=jh(Nh,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Ch(Nh,e.__scopeMenu),o=Th(Nh,e.__scopeMenu),s=pg(_g,e.__scopeMenu),c=l.useRef(null),d=y(t,c);return(0,u.jsx)(hh.Provider,{scope:e.__scopeMenu,children:(0,u.jsx)(Do,{present:r||a.open,children:(0,u.jsx)(hh.Slot,{scope:e.__scopeMenu,children:(0,u.jsx)(Bh,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:d,align:`start`,side:o.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{o.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:Q(e.onFocusOutside,e=>{e.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:Q(e.onEscapeKeyDown,e=>{o.onClose(),e.preventDefault()}),onKeyDown:Q(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=ph[o.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),s.trigger?.focus(),e.preventDefault())})})})})})});vg.displayName=_g;function yg(e){return e?`open`:`closed`}function bg(e){return e===`indeterminate`}function xg(e){return bg(e)?`indeterminate`:e?`checked`:`unchecked`}function Sg(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Cg(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function wg(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Cg(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Tg(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function Eg(e,t){return t?Tg({x:e.clientX,y:e.clientY},t):!1}function Dg(e){return t=>t.pointerType===`mouse`?e(t):void 0}var Og=Eh,kg=Oh,Ag=Mh,jg=Ih,Mg=Hh,Ng=Wh,Pg=qh,Fg=Xh,Ig=eg,Lg=ng,Rg=og,zg=cg,Bg=ug,Vg=gg,Hg=vg,Ug=`DropdownMenu`,[Wg,Gg]=_o(Ug,[yh]),Kg=yh(),[qg,Jg]=Wg(Ug),Yg=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=Kg(t),d=l.useRef(null),[f,p]=xo({prop:i,defaultProp:a??!1,onChange:o,caller:Ug});return(0,u.jsx)(qg,{scope:t,triggerId:vs(),triggerRef:d,contentId:vs(),open:f,onOpenChange:p,onOpenToggle:l.useCallback(()=>p(e=>!e),[p]),modal:s,children:(0,u.jsx)(Og,{...c,open:f,onOpenChange:p,dir:r,modal:s,children:n})})};Yg.displayName=Ug;var Xg=`DropdownMenuTrigger`,Zg=l.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=Jg(Xg,n),o=Kg(n);return(0,u.jsx)(kg,{asChild:!0,...o,children:(0,u.jsx)($.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:v(t,a.triggerRef),onPointerDown:Q(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:Q(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});Zg.displayName=Xg;var Qg=`DropdownMenuPortal`,$g=e=>{let{__scopeDropdownMenu:t,...n}=e,r=Kg(t);return(0,u.jsx)(Ag,{...r,...n})};$g.displayName=Qg;var e_=`DropdownMenuContent`,t_=l.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Jg(e_,n),a=Kg(n),o=l.useRef(!1);return(0,u.jsx)(jg,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:Q(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:Q(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});t_.displayName=e_;var n_=`DropdownMenuGroup`,r_=l.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Kg(n);return(0,u.jsx)(Mg,{...i,...r,ref:t})});r_.displayName=n_;var i_=`DropdownMenuLabel`,a_=l.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Kg(n);return(0,u.jsx)(Ng,{...i,...r,ref:t})});a_.displayName=i_;var o_=`DropdownMenuItem`,s_=l.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Kg(n);return(0,u.jsx)(Pg,{...i,...r,ref:t})});s_.displayName=o_;var c_=`DropdownMenuCheckboxItem`,l_=l.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Kg(n);return(0,u.jsx)(Fg,{...i,...r,ref:t})});l_.displayName=c_;var u_=`DropdownMenuRadioGroup`,d_=l.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Kg(n);return(0,u.jsx)(Ig,{...i,...r,ref:t})});d_.displayName=u_;var f_=`DropdownMenuRadioItem`,p_=l.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Kg(n);return(0,u.jsx)(Lg,{...i,...r,ref:t})});p_.displayName=f_;var m_=`DropdownMenuItemIndicator`,h_=l.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Kg(n);return(0,u.jsx)(Rg,{...i,...r,ref:t})});h_.displayName=m_;var g_=`DropdownMenuSeparator`,__=l.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Kg(n);return(0,u.jsx)(zg,{...i,...r,ref:t})});__.displayName=g_;var v_=`DropdownMenuArrow`,y_=l.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Kg(n);return(0,u.jsx)(Bg,{...i,...r,ref:t})});y_.displayName=v_;var b_=`DropdownMenuSubTrigger`,x_=l.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Kg(n);return(0,u.jsx)(Vg,{...i,...r,ref:t})});x_.displayName=b_;var S_=`DropdownMenuSubContent`,C_=l.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Kg(n);return(0,u.jsx)(Hg,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});C_.displayName=S_;var w_=Yg;function T_({...e}){return(0,u.jsx)(w_,{"data-slot":`dropdown-menu`,...e})}function E_({label:e=`Arquivo`,accept:t=`.pdf,.xml,.png,.jpg,.jpeg`,multiple:n=!1,disabled:r,className:i,onFilesChange:a}){let o=(0,l.useId)(),[s,c]=(0,l.useState)(null),[d,f]=(0,l.useState)(!1),p=!!s?.length,m=(0,l.useCallback)(e=>{c(e),a?.(e)},[a]),h=(0,l.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),f(!1),!r&&e.dataTransfer.files?.length&&m(e.dataTransfer.files)},[r,m]),g=(0,l.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),r||f(!0)},[r]),_=(0,l.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),f(!1)},[]),v=(0,l.useCallback)(e=>{e.target.files&&m(e.target.files)},[m]),y=()=>{r||document.getElementById(o)?.click()},b=e=>{if(!e)return``;let t={".pdf":`PDF`,".jpg":`JPG`,".jpeg":`JPEG`,".png":`PNG`,".xml":`XML`},n=e.split(`,`).map(e=>e.trim()).map(e=>t[e.toLowerCase()]??e.replace(`.`,``).toUpperCase());return n.length===1?n[0]:n.length===2?n.join(` ou `):n.slice(0,-1).join(`, `)+` ou `+n[n.length-1]};return(0,u.jsxs)(`div`,{className:q(`flex flex-col gap-2`,i),children:[(0,u.jsx)(`input`,{id:o,type:`file`,accept:t,multiple:n,disabled:r,onChange:v,className:`absolute w-px h-px p-0 -m-px overflow-hidden whitespace-nowrap border-0`,"aria-label":e}),(0,u.jsx)(`div`,{role:`button`,tabIndex:0,onClick:y,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),y())},onDrop:h,onDragOver:g,onDragLeave:_,className:q(`h-40 p-4 relative flex flex-col items-center justify-center gap-4 rounded-sm border-2 border-dashed transition-colors`,!r&&`cursor-pointer`,`bg-default hover:bg-default/80`,d&&`border-primary bg-primary/5`,p&&`border-primary bg-primary/5`,r&&`opacity-50 cursor-not-allowed`),children:p?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`div`,{className:`flex items-center justify-center size-8 rounded-sm bg-primary/10`,children:(0,u.jsx)(Mt,{className:`size-4 text-primary`})}),(0,u.jsx)(`div`,{className:`flex flex-col items-center text-center w-full px-2`,children:(0,u.jsx)(`span`,{className:`body-sm font-medium text-foreground break-all line-clamp-2`,children:s.length===1?s[0].name:`${s.length} arquivos selecionados`})})]}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`div`,{className:`flex items-center justify-center min-w-8 min-h-8 rounded-sm bg-primary/10`,children:(0,u.jsx)(Bt,{className:`min-w-4 min-h-4 text-primary`})}),(0,u.jsx)(`div`,{className:`flex flex-col items-center text-center`,children:(0,u.jsxs)(`span`,{className:`body-sm font-medium text-foreground`,children:[`Arraste e solte o arquivo aqui`,(0,u.jsx)(`br`,{}),`ou clique para selecionar`]})}),t&&(0,u.jsxs)(`span`,{className:`body-xs font-medium text-muted`,children:[`Formatos aceitos: `,b(t)]})]})})]})}var D_=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=w(`Primitive.${t}`),r=l.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,u.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),O_=`Separator`,k_=`horizontal`,A_=[`horizontal`,`vertical`],j_=l.forwardRef((e,t)=>{let{decorative:n,orientation:r=k_,...i}=e,a=M_(r)?r:k_,o=a===`vertical`?a:void 0,s=n?{role:`none`}:{"aria-orientation":o,role:`separator`};return(0,u.jsx)(D_.div,{"data-orientation":a,...s,...i,ref:t})});j_.displayName=O_;function M_(e){return A_.includes(e)}var N_=j_;function P_({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return(0,u.jsx)(N_,{"data-slot":`separator`,decorative:n,orientation:t,className:q(`bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px`,e),...r})}function F_({icon:e,title:t,description:n,children:r,className:i}){return(0,u.jsxs)(lo,{className:i,children:[(0,u.jsxs)(uo,{children:[(0,u.jsx)(fo,{className:`bg-primary/10`,children:(0,u.jsx)(e,{className:`size-5 text-primary`})}),(0,u.jsxs)(`div`,{className:`flex flex-col gap-xs`,children:[(0,u.jsx)(po,{children:t}),n&&(0,u.jsx)(mo,{children:n})]})]}),(0,u.jsx)(P_,{}),(0,u.jsx)(ho,{children:r})]})}function I_({className:e,type:t,...n}){return(0,u.jsx)(`input`,{type:t,"data-slot":`input`,className:q(`text-sm h-9 w-full min-w-0 rounded-md border border-border bg-default px-2.5 py-1`,`text-foreground antialiased caret-primary`,`transition-[color,border-color,box-shadow] outline-none`,`focus-visible:border-primary focus-visible:shadow-[inset_0_0_0_1px_var(--color-primary)]`,`aria-invalid:border-destructive aria-invalid:shadow-[inset_0_0_0_1px_var(--color-destructive)]`,`disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,`file:inline-flex file:h-7 file:border-0 file:text-sm file:font-medium file:text-foreground`,e),...n})}function L_({className:e,...t}){return(0,u.jsx)(`textarea`,{"data-slot":`textarea`,className:q(`field-sizing-content text-sm min-h-16 w-full min-w-0 rounded-md border border-border bg-default px-2.5 py-1`,`text-foreground antialiased caret-primary`,`transition-[color,border-color,box-shadow] outline-none`,`focus-visible:border-primary focus-visible:shadow-[inset_0_0_0_1px_var(--color-primary)]`,`aria-invalid:border-destructive aria-invalid:shadow-[inset_0_0_0_1px_var(--color-destructive)]`,`disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,`file:inline-flex file:h-7 file:border-0 file:text-sm file:font-medium file:text-foreground`,e),...t})}function R_({className:e,...t}){return(0,u.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:q(`group/input-group relative flex w-full items-center rounded-md border border-border outline-none transition-[color,border-color,box-shadow]`,`h-9 min-w-0 has-[>textarea]:h-auto dark:bg-input/30`,`has-focus-visible:border-primary has-focus-visible:shadow-[inset_0_0_0_1px_var(--color-primary)]`,`has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:shadow-[inset_0_0_0_1px_var(--color-destructive)]`,`has-[[data-slot][aria-invalid=true]:focus-visible]:border-primary has-[[data-slot][aria-invalid=true]:focus-visible]:shadow-[inset_0_0_0_1px_var(--color-primary)]`,`has-[>[data-align=inline-start]]:[&>input]:pl-2`,`has-[>[data-align=inline-end]]:[&>input]:pr-2`,`has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3`,`has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3`,e),...t})}var z_=Object.defineProperty,B_=Object.defineProperties,V_=Object.getOwnPropertyDescriptors,H_=Object.getOwnPropertySymbols,U_=Object.prototype.hasOwnProperty,W_=Object.prototype.propertyIsEnumerable,G_=(e,t,n)=>t in e?z_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,K_=(e,t)=>{for(var n in t||={})U_.call(t,n)&&G_(e,n,t[n]);if(H_)for(var n of H_(t))W_.call(t,n)&&G_(e,n,t[n]);return e},q_=(e,t)=>B_(e,V_(t)),J_=(e,t)=>{var n={};for(var r in e)U_.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&H_)for(var r of H_(e))t.indexOf(r)<0&&W_.call(e,r)&&(n[r]=e[r]);return n};function Y_(e){return[setTimeout(e,0),setTimeout(e,10),setTimeout(e,50)]}function X_(e){let t=l.useRef();return l.useEffect(()=>{t.current=e}),t.current}var Z_=18,Q_=40,$_=`${Q_}px`,ev=[`[data-lastpass-icon-root]`,`com-1password-button`,`[data-dashlanecreated]`,`[style$="2147483647 !important;"]`].join(`,`);function tv({containerRef:e,inputRef:t,pushPasswordManagerStrategy:n,isFocused:r}){let[i,a]=l.useState(!1),[o,s]=l.useState(!1),[c,u]=l.useState(!1),d=l.useMemo(()=>n===`none`?!1:(n===`increase-width`||n===`experimental-no-flickering`)&&i&&o,[i,o,n]),f=l.useCallback(()=>{let r=e.current,i=t.current;if(!r||!i||c||n===`none`)return;let o=r,s=o.getBoundingClientRect().left+o.offsetWidth,l=o.getBoundingClientRect().top+o.offsetHeight/2,d=s-Z_,f=l;document.querySelectorAll(ev).length===0&&document.elementFromPoint(d,f)===r||(a(!0),u(!0))},[e,t,c,n]);return l.useEffect(()=>{let t=e.current;if(!t||n===`none`)return;function r(){s(window.innerWidth-t.getBoundingClientRect().right>=Q_)}r();let i=setInterval(r,1e3);return()=>{clearInterval(i)}},[e,n]),l.useEffect(()=>{let e=r||document.activeElement===t.current;if(n===`none`||!e)return;let i=setTimeout(f,0),a=setTimeout(f,2e3),o=setTimeout(f,5e3),s=setTimeout(()=>{u(!0)},6e3);return()=>{clearTimeout(i),clearTimeout(a),clearTimeout(o),clearTimeout(s)}},[t,r,n,f]),{hasPWMBadge:i,willPushPWMBadge:d,PWM_BADGE_SPACE_WIDTH:$_}}var nv=l.createContext({}),rv=l.forwardRef((e,t)=>{var n=e,{value:r,onChange:i,maxLength:a,textAlign:o=`left`,pattern:s,placeholder:c,inputMode:u=`numeric`,onComplete:d,pushPasswordManagerStrategy:f=`increase-width`,pasteTransformer:p,containerClassName:m,noScriptCSSFallback:h=av,render:g,children:_}=n,v=J_(n,[`value`,`onChange`,`maxLength`,`textAlign`,`pattern`,`placeholder`,`inputMode`,`onComplete`,`pushPasswordManagerStrategy`,`pasteTransformer`,`containerClassName`,`noScriptCSSFallback`,`render`,`children`]),y;let[b,x]=l.useState(typeof v.defaultValue==`string`?v.defaultValue:``),S=r??b,C=X_(S),w=l.useCallback(e=>{i?.(e),x(e)},[i]),T=l.useMemo(()=>s?typeof s==`string`?new RegExp(s):s:null,[s]),E=l.useRef(null),D=l.useRef(null),O=l.useRef({value:S,onChange:w,isIOS:typeof window<`u`&&((y=window==null?void 0:window.CSS)?.supports)?.call(y,`-webkit-touch-callout`,`none`)}),k=l.useRef({prev:[E.current?.selectionStart,E.current?.selectionEnd,E.current?.selectionDirection]});l.useImperativeHandle(t,()=>E.current,[]),l.useEffect(()=>{let e=E.current,t=D.current;if(!e||!t)return;O.current.value!==e.value&&O.current.onChange(e.value),k.current.prev=[e.selectionStart,e.selectionEnd,e.selectionDirection];function n(){if(document.activeElement!==e){F(null),L(null);return}let t=e.selectionStart,n=e.selectionEnd,r=e.selectionDirection,i=e.maxLength,a=e.value,o=k.current.prev,s=-1,c=-1,l;if(a.length!==0&&t!==null&&n!==null){let e=t===n,r=t===a.length&&a.length<i;if(e&&!r){let e=t;if(e===0)s=0,c=1,l=`forward`;else if(e===i)s=e-1,c=e,l=`backward`;else if(i>1&&a.length>1){let t=0;if(o[0]!==null&&o[1]!==null){l=e<o[1]?`backward`:`forward`;let n=o[0]===o[1]&&o[0]<i;l===`backward`&&!n&&(t=-1)}s=t+e,c=t+e+1}}s!==-1&&c!==-1&&s!==c&&E.current.setSelectionRange(s,c,l)}let u=s===-1?t:s,d=c===-1?n:c,f=l??r;F(u),L(d),k.current.prev=[u,d,f]}if(document.addEventListener(`selectionchange`,n,{capture:!0}),n(),document.activeElement===e&&N(!0),!document.getElementById(`input-otp-style`)){let e=document.createElement(`style`);if(e.id=`input-otp-style`,document.head.appendChild(e),e.sheet){let t=`background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;`;iv(e.sheet,`[data-input-otp]::selection { background: transparent !important; color: transparent !important; }`),iv(e.sheet,`[data-input-otp]:autofill { ${t} }`),iv(e.sheet,`[data-input-otp]:-webkit-autofill { ${t} }`),iv(e.sheet,`@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }`),iv(e.sheet,`[data-input-otp] + * { pointer-events: all !important; }`)}}let r=()=>{t&&t.style.setProperty(`--root-height`,`${e.clientHeight}px`)};r();let i=new ResizeObserver(r);return i.observe(e),()=>{document.removeEventListener(`selectionchange`,n,{capture:!0}),i.disconnect()}},[]);let[A,j]=l.useState(!1),[M,N]=l.useState(!1),[P,F]=l.useState(null),[I,L]=l.useState(null);l.useEffect(()=>{Y_(()=>{var e;(e=E.current)==null||e.dispatchEvent(new Event(`input`));let t=E.current?.selectionStart,n=E.current?.selectionEnd,r=E.current?.selectionDirection;t!==null&&n!==null&&(F(t),L(n),k.current.prev=[t,n,r])})},[S,M]),l.useEffect(()=>{C!==void 0&&S!==C&&C.length<a&&S.length===a&&d?.(S)},[a,d,C,S]);let R=tv({containerRef:D,inputRef:E,pushPasswordManagerStrategy:f,isFocused:M}),ee=l.useCallback(e=>{let t=e.currentTarget.value.slice(0,a);if(t.length>0&&T&&!T.test(t)){e.preventDefault();return}typeof C==`string`&&t.length<C.length&&document.dispatchEvent(new Event(`selectionchange`)),w(t)},[a,w,C,T]),te=l.useCallback(()=>{var e;if(E.current){let t=Math.min(E.current.value.length,a-1),n=E.current.value.length;(e=E.current)==null||e.setSelectionRange(t,n),F(t),L(n)}N(!0)},[a]),z=l.useCallback(e=>{let t=E.current;if(!p&&(!O.current.isIOS||!e.clipboardData||!t))return;let n=e.clipboardData.getData(`text/plain`),r=p?p(n):n;e.preventDefault();let i=E.current?.selectionStart,o=E.current?.selectionEnd,s=(i===o?S.slice(0,i)+r+S.slice(i):S.slice(0,i)+r+S.slice(o)).slice(0,a);if(s.length>0&&T&&!T.test(s))return;t.value=s,w(s);let c=Math.min(s.length,a-1),l=s.length;t.setSelectionRange(c,l),F(c),L(l)},[a,w,T,S]),B=l.useMemo(()=>({position:`relative`,cursor:v.disabled?`default`:`text`,userSelect:`none`,WebkitUserSelect:`none`,pointerEvents:`none`}),[v.disabled]),ne=l.useMemo(()=>({position:`absolute`,inset:0,width:R.willPushPWMBadge?`calc(100% + ${R.PWM_BADGE_SPACE_WIDTH})`:`100%`,clipPath:R.willPushPWMBadge?`inset(0 ${R.PWM_BADGE_SPACE_WIDTH} 0 0)`:void 0,height:`100%`,display:`flex`,textAlign:o,opacity:`1`,color:`transparent`,pointerEvents:`all`,background:`transparent`,caretColor:`transparent`,border:`0 solid transparent`,outline:`0 solid transparent`,boxShadow:`none`,lineHeight:`1`,letterSpacing:`-.5em`,fontSize:`var(--root-height)`,fontFamily:`monospace`,fontVariantNumeric:`tabular-nums`}),[R.PWM_BADGE_SPACE_WIDTH,R.willPushPWMBadge,o]),re=l.useMemo(()=>l.createElement(`input`,q_(K_({autoComplete:v.autoComplete||`one-time-code`},v),{"data-input-otp":!0,"data-input-otp-placeholder-shown":S.length===0||void 0,"data-input-otp-mss":P,"data-input-otp-mse":I,inputMode:u,pattern:T?.source,"aria-placeholder":c,style:ne,maxLength:a,value:S,ref:E,onPaste:e=>{var t;z(e),(t=v.onPaste)==null||t.call(v,e)},onChange:ee,onMouseOver:e=>{var t;j(!0),(t=v.onMouseOver)==null||t.call(v,e)},onMouseLeave:e=>{var t;j(!1),(t=v.onMouseLeave)==null||t.call(v,e)},onFocus:e=>{var t;te(),(t=v.onFocus)==null||t.call(v,e)},onBlur:e=>{var t;N(!1),(t=v.onBlur)==null||t.call(v,e)}})),[ee,te,z,u,ne,a,I,P,v,T?.source,S]),V=l.useMemo(()=>({slots:Array.from({length:a}).map((e,t)=>{let n=M&&P!==null&&I!==null&&(P===I&&t===P||t>=P&&t<I),r=S[t]===void 0?null:S[t];return{char:r,placeholderChar:S[0]===void 0?c?.[t]??null:null,isActive:n,hasFakeCaret:n&&r===null}}),isFocused:M,isHovering:!v.disabled&&A}),[M,A,a,I,P,v.disabled,S]),ie=l.useMemo(()=>g?g(V):l.createElement(nv.Provider,{value:V},_),[_,V,g]);return l.createElement(l.Fragment,null,h!==null&&l.createElement(`noscript`,null,l.createElement(`style`,null,h)),l.createElement(`div`,{ref:D,"data-input-otp-container":!0,style:B,className:m},ie,l.createElement(`div`,{style:{position:`absolute`,inset:0,pointerEvents:`none`}},re)))});rv.displayName=`Input`;function iv(e,t){try{e.insertRule(t)}catch{console.error(`input-otp could not insert CSS rule:`,t)}}var av=`
45
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return l.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},ru=`DialogDescriptionWarning`,iu=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${tu(ru).contentName}}.`;return l.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},au=Al,ou=Il,su=Rl,cu=Hl,lu=`[cmdk-group=""]`,uu=`[cmdk-group-items=""]`,du=`[cmdk-group-heading=""]`,fu=`[cmdk-item=""]`,pu=`${fu}:not([aria-disabled="true"])`,mu=`cmdk-item-select`,hu=`data-value`,gu=(e,t,n)=>hs(e,t,n),_u=l.createContext(void 0),vu=()=>l.useContext(_u),yu=l.createContext(void 0),bu=()=>l.useContext(yu),xu=l.createContext(void 0),Su=l.forwardRef((e,t)=>{let n=Iu(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=Iu(()=>new Set),i=Iu(()=>new Map),a=Iu(()=>new Map),o=Iu(()=>new Set),s=Pu(e),{label:c,children:u,value:d,onValueChange:f,filter:p,shouldFilter:m,loop:h,disablePointerSelection:g=!1,vimBindings:_=!0,...v}=e,y=vs(),b=vs(),x=vs(),S=l.useRef(null),C=zu();Fu(()=>{if(d!==void 0){let e=d.trim();n.current.value=e,w.emit()}},[d]),Fu(()=>{C(6,A)},[]);let w=l.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)k(),D(),C(1,O);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(y))==null||i.focus()}if(C(7,()=>{n.current.selectedItemId=j()?.id,w.emit()}),r||C(5,A),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}w.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),T=l.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,E(t,r)),C(2,()=>{D(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),C(3,()=>{k(),D(),n.current.value||O(),w.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=j();C(4,()=>{k(),t?.getAttribute(`id`)===e&&O(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:y,inputId:x,labelId:b,listInnerRef:S}),[]);function E(e,t){let r=s.current?.filter??gu;return e?r(e,n.current.search,t):0}function D(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=S.current;M().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(uu);t?t.appendChild(e.parentElement===t?e:e.closest(`${uu} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${uu} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${lu}[${hu}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=M().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(hu);w.setState(`value`,e||void 0)}function k(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=E(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function A(){var e;let t=j();t&&(t.parentElement?.firstChild===t&&((e=t.closest(lu)?.querySelector(du))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function j(){return S.current?.querySelector(`${fu}[aria-selected="true"]`)}function M(){return Array.from(S.current?.querySelectorAll(pu)||[])}function N(e){let t=M()[e];t&&w.setState(`value`,t.getAttribute(hu))}function P(e){var t;let n=j(),r=M(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState(`value`,a.getAttribute(hu))}function F(e){let t=j()?.closest(lu),n;for(;t&&!n;)t=e>0?Mu(t,lu):Nu(t,lu),n=t?.querySelector(pu);n?w.setState(`value`,n.getAttribute(hu)):P(e)}let I=()=>N(M().length-1),L=e=>{e.preventDefault(),e.metaKey?I():e.altKey?F(1):P(1)},R=e=>{e.preventDefault(),e.metaKey?N(0):e.altKey?F(-1):P(-1)};return l.createElement($.div,{ref:t,tabIndex:-1,...v,"cmdk-root":``,onKeyDown:e=>{var t;(t=v.onKeyDown)==null||t.call(v,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:_&&e.ctrlKey&&L(e);break;case`ArrowDown`:L(e);break;case`p`:case`k`:_&&e.ctrlKey&&R(e);break;case`ArrowUp`:R(e);break;case`Home`:e.preventDefault(),N(0);break;case`End`:e.preventDefault(),I();break;case`Enter`:{e.preventDefault();let t=j();if(t){let e=new Event(mu);t.dispatchEvent(e)}}}}},l.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:Hu},c),Vu(e,e=>l.createElement(yu.Provider,{value:w},l.createElement(_u.Provider,{value:T},e))))}),Cu=l.forwardRef((e,t)=>{let n=vs(),r=l.useRef(null),i=l.useContext(xu),a=vu(),o=Pu(e),s=o.current?.forceMount??i?.forceMount;Fu(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=Ru(n,r,[e.value,e.children,r],e.keywords),u=bu(),d=Lu(e=>e.value&&e.value===c.current),f=Lu(e=>s||a.filter()===!1?!0:e.search?e.filtered.items.get(n)>0:!0);l.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(mu,p),()=>t.removeEventListener(mu,p)},[f,e.onSelect,e.disabled]);function p(){var e,t;m(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function m(){u.setState(`value`,c.current,!0)}if(!f)return null;let{disabled:h,value:g,onSelect:_,forceMount:y,keywords:b,...x}=e;return l.createElement($.div,{ref:v(r,t),...x,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!h,"aria-selected":!!d,"data-disabled":!!h,"data-selected":!!d,onPointerMove:h||a.getDisablePointerSelection()?void 0:m,onClick:h?void 0:p},e.children)}),wu=l.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=vs(),s=l.useRef(null),c=l.useRef(null),u=vs(),d=vu(),f=Lu(e=>i||d.filter()===!1?!0:e.search?e.filtered.groups.has(o):!0);Fu(()=>d.group(o),[]),Ru(o,s,[e.value,e.heading,c]);let p=l.useMemo(()=>({id:o,forceMount:i}),[i]);return l.createElement($.div,{ref:v(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:f?void 0:!0},n&&l.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:u},n),Vu(e,e=>l.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?u:void 0},l.createElement(xu.Provider,{value:p},e))))}),Tu=l.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=l.useRef(null),a=Lu(e=>!e.search);return!n&&!a?null:l.createElement($.div,{ref:v(i,t),...r,"cmdk-separator":``,role:`separator`})}),Eu=l.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=bu(),o=Lu(e=>e.search),s=Lu(e=>e.selectedItemId),c=vu();return l.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),l.createElement($.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),Du=l.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=l.useRef(null),o=l.useRef(null),s=Lu(e=>e.selectedItemId),c=vu();return l.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),l.createElement($.div,{ref:v(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},Vu(e,e=>l.createElement(`div`,{ref:v(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),Ou=l.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return l.createElement(au,{open:n,onOpenChange:r},l.createElement(ou,{container:o},l.createElement(su,{"cmdk-overlay":``,className:i}),l.createElement(cu,{"aria-label":e.label,"cmdk-dialog":``,className:a},l.createElement(Su,{ref:t,...s}))))}),ku=l.forwardRef((e,t)=>Lu(e=>e.filtered.count===0)?l.createElement($.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),Au=l.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return l.createElement($.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Vu(e,e=>l.createElement(`div`,{"aria-hidden":!0},e)))}),ju=Object.assign(Su,{List:Du,Item:Cu,Input:Eu,Group:wu,Separator:Tu,Dialog:Ou,Empty:ku,Loading:Au});function Mu(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Nu(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function Pu(e){let t=l.useRef(e);return Fu(()=>{t.current=e}),t}var Fu=typeof window>`u`?l.useEffect:l.useLayoutEffect;function Iu(e){let t=l.useRef();return t.current===void 0&&(t.current=e()),t}function Lu(e){let t=bu(),n=()=>e(t.snapshot());return l.useSyncExternalStore(t.subscribe,n,n)}function Ru(e,t,n,r=[]){let i=l.useRef(),a=vu();return Fu(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(hu,s),i.current=s}),i}var zu=()=>{let[e,t]=l.useState(),n=Iu(()=>new Map);return Fu(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function Bu(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function Vu({asChild:e,children:t},n){return e&&l.isValidElement(t)?l.cloneElement(Bu(t),{ref:t.ref},n(t.props.children)):n(t)}var Hu={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},Uu=au;function Wu({className:e,...t}){return(0,u.jsx)(ju,{"data-slot":`command`,className:q(`bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md`,e),...t})}function Gu({className:e,...t}){return(0,u.jsxs)(`div`,{"data-slot":`command-input-wrapper`,className:`flex h-9 items-center gap-2 border-b px-3`,children:[(0,u.jsx)(It,{className:`size-4 shrink-0 opacity-50`}),(0,u.jsx)(ju.Input,{"data-slot":`command-input`,className:q(`placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50`,e),...t})]})}function Ku({className:e,...t}){return(0,u.jsx)(ju.List,{"data-slot":`command-list`,className:q(`max-h-75 scroll-py-1 overflow-x-hidden overflow-y-auto`,e),...t})}function qu({...e}){return(0,u.jsx)(ju.Empty,{"data-slot":`command-empty`,className:`py-6 text-center text-sm`,...e})}function Ju({className:e,...t}){return(0,u.jsx)(ju.Group,{"data-slot":`command-group`,className:q(`text-foreground **:[[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium`,e),...t})}function Yu({className:e,...t}){return(0,u.jsx)(ju.Separator,{"data-slot":`command-separator`,className:q(`bg-border -mx-1 h-px`,e),...t})}function Xu({className:e,...t}){return(0,u.jsx)(ju.Item,{"data-slot":`command-item`,className:q(`data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...t})}var Zu=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=w(`Primitive.${t}`),r=l.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,u.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Qu=`Label`,$u=l.forwardRef((e,t)=>(0,u.jsx)(Zu.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));$u.displayName=Qu;var ed=$u;function td({className:e,...t}){return(0,u.jsx)(ed,{"data-slot":`label`,className:q(`body-md font-medium flex items-center gap-1 leading-none select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50`,e),...t})}var nd=[`top`,`right`,`bottom`,`left`],rd=Math.min,id=Math.max,ad=Math.round,od=Math.floor,sd=e=>({x:e,y:e}),cd={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function ld(e,t,n){return id(e,rd(t,n))}function ud(e,t){return typeof e==`function`?e(t):e}function dd(e){return e.split(`-`)[0]}function fd(e){return e.split(`-`)[1]}function pd(e){return e===`x`?`y`:`x`}function md(e){return e===`y`?`height`:`width`}function hd(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function gd(e){return pd(hd(e))}function _d(e,t,n){n===void 0&&(n=!1);let r=fd(e),i=gd(e),a=md(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Ed(o)),[o,Ed(o)]}function vd(e){let t=Ed(e);return[yd(e),t,yd(t)]}function yd(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var bd=[`left`,`right`],xd=[`right`,`left`],Sd=[`top`,`bottom`],Cd=[`bottom`,`top`];function wd(e,t,n){switch(e){case`top`:case`bottom`:return n?t?xd:bd:t?bd:xd;case`left`:case`right`:return t?Sd:Cd;default:return[]}}function Td(e,t,n,r){let i=fd(e),a=wd(dd(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(yd)))),a}function Ed(e){let t=dd(e);return cd[t]+e.slice(t.length)}function Dd(e){return{top:0,right:0,bottom:0,left:0,...e}}function Od(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Dd(e)}function kd(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Ad(e,t,n){let{reference:r,floating:i}=e,a=hd(t),o=gd(t),s=md(o),c=dd(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(fd(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function jd(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=ud(t,e),p=Od(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=kd(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=kd(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var Md=50,Nd=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:jd},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Ad(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<Md&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=Ad(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Pd=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=ud(e,t)||{};if(l==null)return{};let d=Od(u),f={x:n,y:r},p=gd(i),m=md(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=rd(d[_],T),D=rd(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=ld(O,A,k),M=!c.arrow&&fd(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}}),Fd=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=ud(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=dd(r),_=hd(o),v=dd(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[Ed(o)]:vd(o)),x=p!==`none`;!d&&x&&b.push(...Td(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=_d(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(!(u===`alignment`&&_!==hd(t))||T.every(e=>hd(e.placement)===_?e.overflows[0]>0:!0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=hd(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Id(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ld(e){return nd.some(t=>e[t]>=0)}var Rd=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=ud(e,t);switch(i){case`referenceHidden`:{let e=Id(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Ld(e)}}}case`escaped`:{let e=Id(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Ld(e)}}}default:return{}}}}},zd=new Set([`left`,`top`]);async function Bd(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=dd(n),s=fd(n),c=hd(n)===`y`,l=zd.has(o)?-1:1,u=a&&c?-1:1,d=ud(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Vd=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await Bd(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Hd=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=ud(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=hd(dd(i)),p=pd(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=ld(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=ld(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},Ud=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=ud(e,t),u={x:n,y:r},d=hd(i),f=pd(d),p=u[f],m=u[d],h=ud(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=zd.has(dd(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},Wd=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=ud(e,t),u=await o.detectOverflow(t,l),d=dd(i),f=fd(i),p=hd(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=rd(h-u[g],v),x=rd(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=id(u.left,0),t=id(u.right,0),n=id(u.top,0),r=id(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:id(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:id(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function Gd(){return typeof window<`u`}function Kd(e){return Yd(e)?(e.nodeName||``).toLowerCase():`#document`}function qd(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Jd(e){return((Yd(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Yd(e){return Gd()?e instanceof Node||e instanceof qd(e).Node:!1}function Xd(e){return Gd()?e instanceof Element||e instanceof qd(e).Element:!1}function Zd(e){return Gd()?e instanceof HTMLElement||e instanceof qd(e).HTMLElement:!1}function Qd(e){return!Gd()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof qd(e).ShadowRoot}function $d(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=df(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function ef(e){return/^(table|td|th)$/.test(Kd(e))}function tf(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var nf=/transform|translate|scale|rotate|perspective|filter/,rf=/paint|layout|strict|content/,af=e=>!!e&&e!==`none`,of;function sf(e){let t=Xd(e)?df(e):e;return af(t.transform)||af(t.translate)||af(t.scale)||af(t.rotate)||af(t.perspective)||!lf()&&(af(t.backdropFilter)||af(t.filter))||nf.test(t.willChange||``)||rf.test(t.contain||``)}function cf(e){let t=pf(e);for(;Zd(t)&&!uf(t);){if(sf(t))return t;if(tf(t))return null;t=pf(t)}return null}function lf(){return of??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),of}function uf(e){return/^(html|body|#document)$/.test(Kd(e))}function df(e){return qd(e).getComputedStyle(e)}function ff(e){return Xd(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function pf(e){if(Kd(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Qd(e)&&e.host||Jd(e);return Qd(t)?t.host:t}function mf(e){let t=pf(e);return uf(t)?e.ownerDocument?e.ownerDocument.body:e.body:Zd(t)&&$d(t)?t:mf(t)}function hf(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=mf(e),i=r===e.ownerDocument?.body,a=qd(r);if(i){let e=gf(a);return t.concat(a,a.visualViewport||[],$d(r)?r:[],e&&n?hf(e):[])}else return t.concat(r,hf(r,[],n))}function gf(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function _f(e){let t=df(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Zd(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=ad(n)!==a||ad(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function vf(e){return Xd(e)?e:e.contextElement}function yf(e){let t=vf(e);if(!Zd(t))return sd(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=_f(t),o=(a?ad(n.width):n.width)/r,s=(a?ad(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var bf=sd(0);function xf(e){let t=qd(e);return!lf()||!t.visualViewport?bf:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Sf(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==qd(e)?!1:t}function Cf(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=vf(e),o=sd(1);t&&(r?Xd(r)&&(o=yf(r)):o=yf(e));let s=Sf(a,n,r)?xf(a):sd(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=qd(a),t=r&&Xd(r)?qd(r):r,n=e,i=gf(n);for(;i&&r&&t!==n;){let e=yf(i),t=i.getBoundingClientRect(),r=df(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=qd(i),i=gf(n)}}return kd({width:u,height:d,x:c,y:l})}function wf(e,t){let n=ff(e).scrollLeft;return t?t.left+n:Cf(Jd(e)).left+n}function Tf(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-wf(e,n),y:n.top+t.scrollTop}}function Ef(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Jd(r),s=t?tf(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=sd(1),u=sd(0),d=Zd(r);if((d||!d&&!a)&&((Kd(r)!==`body`||$d(o))&&(c=ff(r)),d)){let e=Cf(r);l=yf(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Tf(o,c):sd(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Df(e){return Array.from(e.getClientRects())}function Of(e){let t=Jd(e),n=ff(e),r=e.ownerDocument.body,i=id(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=id(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+wf(e),s=-n.scrollTop;return df(r).direction===`rtl`&&(o+=id(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var kf=25;function Af(e,t){let n=qd(e),r=Jd(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=lf();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=wf(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=kf&&(a-=o)}else l<=kf&&(a+=l);return{width:a,height:o,x:s,y:c}}function jf(e,t){let n=Cf(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Zd(e)?yf(e):sd(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Mf(e,t,n){let r;if(t===`viewport`)r=Af(e,n);else if(t===`document`)r=Of(Jd(e));else if(Xd(t))r=jf(t,n);else{let n=xf(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return kd(r)}function Nf(e,t){let n=pf(e);return n===t||!Xd(n)||uf(n)?!1:df(n).position===`fixed`||Nf(n,t)}function Pf(e,t){let n=t.get(e);if(n)return n;let r=hf(e,[],!1).filter(e=>Xd(e)&&Kd(e)!==`body`),i=null,a=df(e).position===`fixed`,o=a?pf(e):e;for(;Xd(o)&&!uf(o);){let t=df(o),n=sf(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||$d(o)&&!n&&Nf(e,o))?r=r.filter(e=>e!==o):i=t,o=pf(o)}return t.set(e,r),r}function Ff(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?tf(t)?[]:Pf(t,this._c):[].concat(n),r],o=Mf(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Mf(t,a[e],i);s=id(n.top,s),c=rd(n.right,c),l=rd(n.bottom,l),u=id(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function If(e){let{width:t,height:n}=_f(e);return{width:t,height:n}}function Lf(e,t,n){let r=Zd(t),i=Jd(t),a=n===`fixed`,o=Cf(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=sd(0);function l(){c.x=wf(i)}if(r||!r&&!a)if((Kd(t)!==`body`||$d(i))&&(s=ff(t)),r){let e=Cf(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l();a&&!r&&i&&l();let u=i&&!r&&!a?Tf(i,s):sd(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function Rf(e){return df(e).position===`static`}function zf(e,t){if(!Zd(e)||df(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return Jd(e)===n&&(n=n.ownerDocument.body),n}function Bf(e,t){let n=qd(e);if(tf(e))return n;if(!Zd(e)){let t=pf(e);for(;t&&!uf(t);){if(Xd(t)&&!Rf(t))return t;t=pf(t)}return n}let r=zf(e,t);for(;r&&ef(r)&&Rf(r);)r=zf(r,t);return r&&uf(r)&&Rf(r)&&!sf(r)?n:r||cf(e)||n}var Vf=async function(e){let t=this.getOffsetParent||Bf,n=this.getDimensions,r=await n(e.floating);return{reference:Lf(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Hf(e){return df(e).direction===`rtl`}var Uf={convertOffsetParentRelativeRectToViewportRelativeRect:Ef,getDocumentElement:Jd,getClippingRect:Ff,getOffsetParent:Bf,getElementRects:Vf,getClientRects:Df,getDimensions:If,getScale:yf,isElement:Xd,isRTL:Hf};function Wf(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Gf(e,t){let n=null,r,i=Jd(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=od(d),h=od(i.clientWidth-(u+f)),g=od(i.clientHeight-(d+p)),_=od(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:id(0,rd(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!Wf(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function Kf(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=vf(e),u=i||a?[...l?hf(l):[],...t?hf(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Gf(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Cf(e):null;c&&g();function g(){let t=Cf(e);h&&!Wf(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var qf=Vd,Jf=Hd,Yf=Fd,Xf=Wd,Zf=Rd,Qf=Pd,$f=Ud,ep=(e,t,n)=>{let r=new Map,i={platform:Uf,...n},a={...i.platform,_c:r};return Nd(e,t,{...i,platform:a})},tp=typeof document<`u`?l.useLayoutEffect:function(){};function np(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!np(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!np(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function rp(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ip(e,t){let n=rp(e);return Math.round(t*n)/n}function ap(e){let t=l.useRef(e);return tp(()=>{t.current=e}),t}function op(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:u}=e,[f,p]=l.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[m,h]=l.useState(r);np(m,r)||h(r);let[g,_]=l.useState(null),[v,y]=l.useState(null),b=l.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=l.useCallback(e=>{e!==T.current&&(T.current=e,y(e))},[]),S=a||g,C=o||v,w=l.useRef(null),T=l.useRef(null),E=l.useRef(f),D=c!=null,O=ap(c),k=ap(i),A=ap(u),j=l.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:m};k.current&&(e.platform=k.current),ep(w.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!np(E.current,t)&&(E.current=t,d.flushSync(()=>{p(t)}))})},[m,t,n,k,A]);tp(()=>{u===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,p(e=>({...e,isPositioned:!1})))},[u]);let M=l.useRef(!1);tp(()=>(M.current=!0,()=>{M.current=!1}),[]),tp(()=>{if(S&&(w.current=S),C&&(T.current=C),S&&C){if(O.current)return O.current(S,C,j);j()}},[S,C,j,O,D]);let N=l.useMemo(()=>({reference:w,floating:T,setReference:b,setFloating:x}),[b,x]),P=l.useMemo(()=>({reference:S,floating:C}),[S,C]),F=l.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=ip(P.floating,f.x),r=ip(P.floating,f.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...rp(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,P.floating,f.x,f.y]);return l.useMemo(()=>({...f,update:j,refs:N,elements:P,floatingStyles:F}),[f,j,N,P,F])}var sp=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Qf({element:r.current,padding:i}).fn(n):r?Qf({element:r,padding:i}).fn(n):{}}}},cp=(e,t)=>{let n=qf(e);return{name:n.name,fn:n.fn,options:[e,t]}},lp=(e,t)=>{let n=Jf(e);return{name:n.name,fn:n.fn,options:[e,t]}},up=(e,t)=>({fn:$f(e).fn,options:[e,t]}),dp=(e,t)=>{let n=Yf(e);return{name:n.name,fn:n.fn,options:[e,t]}},fp=(e,t)=>{let n=Xf(e);return{name:n.name,fn:n.fn,options:[e,t]}},pp=(e,t)=>{let n=Zf(e);return{name:n.name,fn:n.fn,options:[e,t]}},mp=(e,t)=>{let n=sp(e);return{name:n.name,fn:n.fn,options:[e,t]}},hp=`Arrow`,gp=l.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,u.jsx)($.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,u.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});gp.displayName=hp;var _p=gp,vp=`Popper`,[yp,bp]=_o(vp),[xp,Sp]=yp(vp),Cp=e=>{let{__scopePopper:t,children:n}=e,[r,i]=l.useState(null);return(0,u.jsx)(xp,{scope:t,anchor:r,onAnchorChange:i,children:n})};Cp.displayName=vp;var wp=`PopperAnchor`,Tp=l.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=Sp(wp,n),o=l.useRef(null),s=y(t,o),c=l.useRef(null);return l.useEffect(()=>{let e=c.current;c.current=r?.current||o.current,e!==c.current&&a.onAnchorChange(c.current)}),r?null:(0,u.jsx)($.div,{...i,ref:s})});Tp.displayName=wp;var Ep=`PopperContent`,[Dp,Op]=yp(Ep),kp=l.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:d=[],collisionPadding:f=0,sticky:p=`partial`,hideWhenDetached:m=!1,updatePositionStrategy:h=`optimized`,onPlaced:g,..._}=e,v=Sp(Ep,n),[b,x]=l.useState(null),S=y(t,e=>x(e)),[C,w]=l.useState(null),T=To(C),E=T?.width??0,D=T?.height??0,O=r+(a===`center`?``:`-`+a),k=typeof f==`number`?f:{top:0,right:0,bottom:0,left:0,...f},A=Array.isArray(d)?d:[d],j=A.length>0,M={padding:k,boundary:A.filter(Np),altBoundary:j},{refs:N,floatingStyles:P,placement:F,isPositioned:I,middlewareData:L}=op({strategy:`fixed`,placement:O,whileElementsMounted:(...e)=>Kf(...e,{animationFrame:h===`always`}),elements:{reference:v.anchor},middleware:[cp({mainAxis:i+D,alignmentAxis:o}),c&&lp({mainAxis:!0,crossAxis:!1,limiter:p===`partial`?up():void 0,...M}),c&&dp({...M}),fp({...M,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)}}),C&&mp({element:C,padding:s}),Pp({arrowWidth:E,arrowHeight:D}),m&&pp({strategy:`referenceHidden`,...M})]}),[R,ee]=Fp(F),te=ys(g);yo(()=>{I&&te?.()},[I,te]);let z=L.arrow?.x,B=L.arrow?.y,ne=L.arrow?.centerOffset!==0,[re,V]=l.useState();return yo(()=>{b&&V(window.getComputedStyle(b).zIndex)},[b]),(0,u.jsx)(`div`,{ref:N.setFloating,"data-radix-popper-content-wrapper":``,style:{...P,transform:I?P.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:re,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(` `),...L.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,u.jsx)(Dp,{scope:n,placedSide:R,onArrowChange:w,arrowX:z,arrowY:B,shouldHideArrow:ne,children:(0,u.jsx)($.div,{"data-side":R,"data-align":ee,..._,ref:S,style:{..._.style,animation:I?void 0:`none`}})})})});kp.displayName=Ep;var Ap=`PopperArrow`,jp={top:`bottom`,right:`left`,bottom:`top`,left:`right`},Mp=l.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=Op(Ap,n),a=jp[i.placedSide];return(0,u.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]: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:(0,u.jsx)(_p,{...r,ref:t,style:{...r.style,display:`block`}})})});Mp.displayName=Ap;function Np(e){return e!==null}var Pp=e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=Fp(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}});function Fp(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var Ip=Cp,Lp=Tp,Rp=kp,zp=Mp;function Bp(e){let t=Vp(e),n=l.forwardRef((e,n)=>{let{children:r,...i}=e,a=l.Children.toArray(r),o=a.find(Up);if(o){let e=o.props.children,r=a.map(t=>t===o?l.Children.count(e)>1?l.Children.only(null):l.isValidElement(e)?e.props.children:null:t);return(0,u.jsx)(t,{...i,ref:n,children:l.isValidElement(e)?l.cloneElement(e,void 0,r):null})}return(0,u.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function Vp(e){let t=l.forwardRef((e,t)=>{let{children:n,...r}=e;if(l.isValidElement(n)){let e=Gp(n),i=Wp(r,n.props);return n.type!==l.Fragment&&(i.ref=t?v(t,e):e),l.cloneElement(n,i)}return l.Children.count(n)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Hp=Symbol(`radix.slottable`);function Up(e){return l.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Hp}function Wp(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 Gp(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 Kp=`Popover`,[qp,Jp]=_o(Kp,[bp]),Yp=bp(),[Xp,Zp]=qp(Kp),Qp=e=>{let{__scopePopover:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!1}=e,s=Yp(t),c=l.useRef(null),[d,f]=l.useState(!1),[p,m]=xo({prop:r,defaultProp:i??!1,onChange:a,caller:Kp});return(0,u.jsx)(Ip,{...s,children:(0,u.jsx)(Xp,{scope:t,contentId:vs(),triggerRef:c,open:p,onOpenChange:m,onOpenToggle:l.useCallback(()=>m(e=>!e),[m]),hasCustomAnchor:d,onCustomAnchorAdd:l.useCallback(()=>f(!0),[]),onCustomAnchorRemove:l.useCallback(()=>f(!1),[]),modal:o,children:n})})};Qp.displayName=Kp;var $p=`PopoverAnchor`,em=l.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Zp($p,n),a=Yp(n),{onCustomAnchorAdd:o,onCustomAnchorRemove:s}=i;return l.useEffect(()=>(o(),()=>s()),[o,s]),(0,u.jsx)(Lp,{...a,...r,ref:t})});em.displayName=$p;var tm=`PopoverTrigger`,nm=l.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Zp(tm,n),a=Yp(n),o=y(t,i.triggerRef),s=(0,u.jsx)($.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":_m(i.open),...r,ref:o,onClick:Q(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?s:(0,u.jsx)(Lp,{asChild:!0,...a,children:s})});nm.displayName=tm;var rm=`PopoverPortal`,[im,am]=qp(rm,{forceMount:void 0}),om=e=>{let{__scopePopover:t,forceMount:n,children:r,container:i}=e,a=Zp(rm,t);return(0,u.jsx)(im,{scope:t,forceMount:n,children:(0,u.jsx)(Do,{present:n||a.open,children:(0,u.jsx)(Zs,{asChild:!0,container:i,children:r})})})};om.displayName=rm;var sm=`PopoverContent`,cm=l.forwardRef((e,t)=>{let n=am(sm,e.__scopePopover),{forceMount:r=n.forceMount,...i}=e,a=Zp(sm,e.__scopePopover);return(0,u.jsx)(Do,{present:r||a.open,children:a.modal?(0,u.jsx)(um,{...i,ref:t}):(0,u.jsx)(dm,{...i,ref:t})})});cm.displayName=sm;var lm=Bp(`PopoverContent.RemoveScroll`),um=l.forwardRef((e,t)=>{let n=Zp(sm,e.__scopePopover),r=l.useRef(null),i=y(t,r),a=l.useRef(!1);return l.useEffect(()=>{let e=r.current;if(e)return vl(e)},[]),(0,u.jsx)(ll,{as:lm,allowPinchZoom:!0,children:(0,u.jsx)(fm,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Q(e.onCloseAutoFocus,e=>{e.preventDefault(),a.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Q(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;a.current=t.button===2||n},{checkForDefaultPrevented:!1}),onFocusOutside:Q(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),dm=l.forwardRef((e,t)=>{let n=Zp(sm,e.__scopePopover),r=l.useRef(!1),i=l.useRef(!1);return(0,u.jsx)(fm,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),fm=l.forwardRef((e,t)=>{let{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:o,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onInteractOutside:d,...f}=e,p=Zp(sm,n),m=Yp(n);return $s(),(0,u.jsx)(Rs,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,u.jsx)(Ds,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:d,onEscapeKeyDown:s,onPointerDownOutside:c,onFocusOutside:l,onDismiss:()=>p.onOpenChange(!1),children:(0,u.jsx)(Rp,{"data-state":_m(p.open),role:`dialog`,id:p.contentId,...m,...f,ref:t,style:{...f.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)`}})})})}),pm=`PopoverClose`,mm=l.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Zp(pm,n);return(0,u.jsx)($.button,{type:`button`,...r,ref:t,onClick:Q(e.onClick,()=>i.onOpenChange(!1))})});mm.displayName=pm;var hm=`PopoverArrow`,gm=l.forwardRef((e,t)=>{let{__scopePopover:n,...r}=e,i=Yp(n);return(0,u.jsx)(zp,{...i,...r,ref:t})});gm.displayName=hm;function _m(e){return e?`open`:`closed`}var vm=Qp,ym=nm,bm=om,xm=cm;function Sm({...e}){return(0,u.jsx)(vm,{"data-slot":`popover`,...e})}function Cm({...e}){return(0,u.jsx)(ym,{"data-slot":`popover-trigger`,...e})}function wm({className:e,align:t=`center`,sideOffset:n=4,...r}){return(0,u.jsx)(bm,{children:(0,u.jsx)(xm,{"data-slot":`popover-content`,align:t,sideOffset:n,className:q(`bg-input text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-lg border p-3 shadow-md outline-hidden`,e),...r})})}function Tm({label:e,required:t,value:n,onChange:r}){let[i,a]=(0,l.useState)(n),o=n===void 0?i:n,s=e=>{r?r(e):a(e)};return(0,u.jsxs)(`div`,{className:`mx-auto w-full sm:w-44 flex flex-col gap-1`,children:[(0,u.jsxs)(td,{htmlFor:`date-picker-simple`,className:`label-md`,children:[e,` `,t&&(0,u.jsx)(`span`,{className:`text-destructive`,children:`*`})]}),(0,u.jsxs)(Sm,{children:[(0,u.jsx)(Cm,{asChild:!0,children:(0,u.jsx)(qt,{variant:`outline`,id:`date-picker-simple`,className:`w-full justify-start px-2.5 font-normal`,children:o?Mr(o,`dd/MM/yyyy`,{locale:Sn}):(0,u.jsx)(`span`,{className:`text-muted`,children:`Selecione a data`})})}),(0,u.jsx)(wm,{className:`w-auto p-0`,align:`start`,children:(0,u.jsx)(so,{mode:`single`,selected:o,defaultMonth:o,captionLayout:`dropdown`,onSelect:e=>{s(e)}})})]})]})}function Em(e){let t=Dm(e),n=l.forwardRef((e,n)=>{let{children:r,...i}=e,a=l.Children.toArray(r),o=a.find(km);if(o){let e=o.props.children,r=a.map(t=>t===o?l.Children.count(e)>1?l.Children.only(null):l.isValidElement(e)?e.props.children:null:t);return(0,u.jsx)(t,{...i,ref:n,children:l.isValidElement(e)?l.cloneElement(e,void 0,r):null})}return(0,u.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function Dm(e){let t=l.forwardRef((e,t)=>{let{children:n,...r}=e;if(l.isValidElement(n)){let e=jm(n),i=Am(r,n.props);return n.type!==l.Fragment&&(i.ref=t?v(t,e):e),l.cloneElement(n,i)}return l.Children.count(n)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Om=Symbol(`radix.slottable`);function km(e){return l.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Om}function Am(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 jm(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)}function Mm(e){let t=e+`CollectionProvider`,[n,r]=_o(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=l.default.useRef(null),a=l.default.useRef(new Map).current;return(0,u.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,c=Em(s),d=l.default.forwardRef((e,t)=>{let{scope:n,children:r}=e;return(0,u.jsx)(c,{ref:y(t,a(s,n).collectionRef),children:r})});d.displayName=s;let f=e+`CollectionItemSlot`,p=`data-radix-collection-item`,m=Em(f),h=l.default.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=l.default.useRef(null),s=y(t,o),c=a(f,n);return l.default.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,u.jsx)(m,{[p]:``,ref:s,children:r})});h.displayName=f;function g(t){let n=a(e+`CollectionConsumer`,t);return l.default.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:d,ItemSlot:h},g,r]}var Nm=l.createContext(void 0);function Pm(e){let t=l.useContext(Nm);return e||t||`ltr`}var Fm=`rovingFocusGroup.onEntryFocus`,Im={bubbles:!1,cancelable:!0},Lm=`RovingFocusGroup`,[Rm,zm,Bm]=Mm(Lm),[Vm,Hm]=_o(Lm,[Bm]),[Um,Wm]=Vm(Lm),Gm=l.forwardRef((e,t)=>(0,u.jsx)(Rm.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,u.jsx)(Rm.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,u.jsx)(Km,{...e,ref:t})})}));Gm.displayName=Lm;var Km=l.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:s,onCurrentTabStopIdChange:c,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...p}=e,m=l.useRef(null),h=y(t,m),g=Pm(a),[_,v]=xo({prop:o,defaultProp:s??null,onChange:c,caller:Lm}),[b,x]=l.useState(!1),S=ys(d),C=zm(n),w=l.useRef(!1),[T,E]=l.useState(0);return l.useEffect(()=>{let e=m.current;if(e)return e.addEventListener(Fm,S),()=>e.removeEventListener(Fm,S)},[S]),(0,u.jsx)(Um,{scope:n,orientation:r,dir:g,loop:i,currentTabStopId:_,onItemFocus:l.useCallback(e=>v(e),[v]),onItemShiftTab:l.useCallback(()=>x(!0),[]),onFocusableItemAdd:l.useCallback(()=>E(e=>e+1),[]),onFocusableItemRemove:l.useCallback(()=>E(e=>e-1),[]),children:(0,u.jsx)($.div,{tabIndex:b||T===0?-1:0,"data-orientation":r,...p,ref:h,style:{outline:`none`,...e.style},onMouseDown:Q(e.onMouseDown,()=>{w.current=!0}),onFocus:Q(e.onFocus,e=>{let t=!w.current;if(e.target===e.currentTarget&&t&&!b){let t=new CustomEvent(Fm,Im);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=C().filter(e=>e.focusable);Qm([e.find(e=>e.active),e.find(e=>e.id===_),...e].filter(Boolean).map(e=>e.ref.current),f)}}w.current=!1}),onBlur:Q(e.onBlur,()=>x(!1))})})}),qm=`RovingFocusGroupItem`,Jm=l.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:i=!1,tabStopId:a,children:o,...s}=e,c=vs(),d=a||c,f=Wm(qm,n),p=f.currentTabStopId===d,m=zm(n),{onFocusableItemAdd:h,onFocusableItemRemove:g,currentTabStopId:_}=f;return l.useEffect(()=>{if(r)return h(),()=>g()},[r,h,g]),(0,u.jsx)(Rm.ItemSlot,{scope:n,id:d,focusable:r,active:i,children:(0,u.jsx)($.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...s,ref:t,onMouseDown:Q(e.onMouseDown,e=>{r?f.onItemFocus(d):e.preventDefault()}),onFocus:Q(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:Q(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){f.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Zm(e,f.orientation,f.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=m().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=f.loop?$m(n,r+1):n.slice(r+1)}setTimeout(()=>Qm(n))}}),children:typeof o==`function`?o({isCurrentTabStop:p,hasTabStop:_!=null}):o})})});Jm.displayName=qm;var Ym={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function Xm(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function Zm(e,t,n){let r=Xm(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Ym[r]}function Qm(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function $m(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var eh=Gm,th=Jm;function nh(e){let t=rh(e),n=l.forwardRef((e,n)=>{let{children:r,...i}=e,a=l.Children.toArray(r),o=a.find(ah);if(o){let e=o.props.children,r=a.map(t=>t===o?l.Children.count(e)>1?l.Children.only(null):l.isValidElement(e)?e.props.children:null:t);return(0,u.jsx)(t,{...i,ref:n,children:l.isValidElement(e)?l.cloneElement(e,void 0,r):null})}return(0,u.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function rh(e){let t=l.forwardRef((e,t)=>{let{children:n,...r}=e;if(l.isValidElement(n)){let e=sh(n),i=oh(r,n.props);return n.type!==l.Fragment&&(i.ref=t?v(t,e):e),l.cloneElement(n,i)}return l.Children.count(n)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ih=Symbol(`radix.slottable`);function ah(e){return l.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===ih}function oh(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 sh(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 ch=[`Enter`,` `],lh=[`ArrowDown`,`PageUp`,`Home`],uh=[`ArrowUp`,`PageDown`,`End`],dh=[...lh,...uh],fh={ltr:[...ch,`ArrowRight`],rtl:[...ch,`ArrowLeft`]},ph={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},mh=`Menu`,[hh,gh,_h]=Mm(mh),[vh,yh]=_o(mh,[_h,bp,Hm]),bh=bp(),xh=Hm(),[Sh,Ch]=vh(mh),[wh,Th]=vh(mh),Eh=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=bh(t),[c,d]=l.useState(null),f=l.useRef(!1),p=ys(a),m=Pm(i);return l.useEffect(()=>{let e=()=>{f.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>f.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),(0,u.jsx)(Ip,{...s,children:(0,u.jsx)(Sh,{scope:t,open:n,onOpenChange:p,content:c,onContentChange:d,children:(0,u.jsx)(wh,{scope:t,onClose:l.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:f,dir:m,modal:o,children:r})})})};Eh.displayName=mh;var Dh=`MenuAnchor`,Oh=l.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=bh(n);return(0,u.jsx)(Lp,{...i,...r,ref:t})});Oh.displayName=Dh;var kh=`MenuPortal`,[Ah,jh]=vh(kh,{forceMount:void 0}),Mh=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=Ch(kh,t);return(0,u.jsx)(Ah,{scope:t,forceMount:n,children:(0,u.jsx)(Do,{present:n||a.open,children:(0,u.jsx)(Zs,{asChild:!0,container:i,children:r})})})};Mh.displayName=kh;var Nh=`MenuContent`,[Ph,Fh]=vh(Nh),Ih=l.forwardRef((e,t)=>{let n=jh(Nh,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Ch(Nh,e.__scopeMenu),o=Th(Nh,e.__scopeMenu);return(0,u.jsx)(hh.Provider,{scope:e.__scopeMenu,children:(0,u.jsx)(Do,{present:r||a.open,children:(0,u.jsx)(hh.Slot,{scope:e.__scopeMenu,children:o.modal?(0,u.jsx)(Lh,{...i,ref:t}):(0,u.jsx)(Rh,{...i,ref:t})})})})}),Lh=l.forwardRef((e,t)=>{let n=Ch(Nh,e.__scopeMenu),r=l.useRef(null),i=y(t,r);return l.useEffect(()=>{let e=r.current;if(e)return vl(e)},[]),(0,u.jsx)(Bh,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:Q(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Rh=l.forwardRef((e,t)=>{let n=Ch(Nh,e.__scopeMenu);return(0,u.jsx)(Bh,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),zh=nh(`MenuContent.ScrollLock`),Bh=l.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:h,disableOutsideScroll:g,..._}=e,v=Ch(Nh,n),b=Th(Nh,n),x=bh(n),S=xh(n),C=gh(n),[w,T]=l.useState(null),E=l.useRef(null),D=y(t,E,v.onContentChange),O=l.useRef(0),k=l.useRef(``),A=l.useRef(0),j=l.useRef(null),M=l.useRef(`right`),N=l.useRef(0),P=g?ll:l.Fragment,F=g?{as:zh,allowPinchZoom:!0}:void 0,I=e=>{let t=k.current+e,n=C().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=wg(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){k.current=t,window.clearTimeout(O.current),t!==``&&(O.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};l.useEffect(()=>()=>window.clearTimeout(O.current),[]),$s();let L=l.useCallback(e=>M.current===j.current?.side&&Eg(e,j.current?.area),[]);return(0,u.jsx)(Ph,{scope:n,searchRef:k,onItemEnter:l.useCallback(e=>{L(e)&&e.preventDefault()},[L]),onItemLeave:l.useCallback(e=>{L(e)||(E.current?.focus(),T(null))},[L]),onTriggerLeave:l.useCallback(e=>{L(e)&&e.preventDefault()},[L]),pointerGraceTimerRef:A,onPointerGraceIntentChange:l.useCallback(e=>{j.current=e},[]),children:(0,u.jsx)(P,{...F,children:(0,u.jsx)(Rs,{asChild:!0,trapped:i,onMountAutoFocus:Q(a,e=>{e.preventDefault(),E.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,u.jsx)(Ds,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:d,onPointerDownOutside:f,onFocusOutside:p,onInteractOutside:m,onDismiss:h,children:(0,u.jsx)(eh,{asChild:!0,...S,dir:b.dir,orientation:`vertical`,loop:r,currentTabStopId:w,onCurrentTabStopIdChange:T,onEntryFocus:Q(c,e=>{b.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,u.jsx)(Rp,{role:`menu`,"aria-orientation":`vertical`,"data-state":yg(v.open),"data-radix-menu-content":``,dir:b.dir,...x,..._,ref:D,style:{outline:`none`,..._.style},onKeyDown:Q(_.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&I(e.key));let i=E.current;if(e.target!==i||!dh.includes(e.key))return;e.preventDefault();let a=C().filter(e=>!e.disabled).map(e=>e.ref.current);uh.includes(e.key)&&a.reverse(),Sg(a)}),onBlur:Q(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(O.current),k.current=``)}),onPointerMove:Q(e.onPointerMove,Dg(e=>{let t=e.target,n=N.current!==e.clientX;e.currentTarget.contains(t)&&n&&(M.current=e.clientX>N.current?`right`:`left`,N.current=e.clientX)}))})})})})})})});Ih.displayName=Nh;var Vh=`MenuGroup`,Hh=l.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,u.jsx)($.div,{role:`group`,...r,ref:t})});Hh.displayName=Vh;var Uh=`MenuLabel`,Wh=l.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,u.jsx)($.div,{...r,ref:t})});Wh.displayName=Uh;var Gh=`MenuItem`,Kh=`menu.itemSelect`,qh=l.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=l.useRef(null),o=Th(Gh,e.__scopeMenu),s=Fh(Gh,e.__scopeMenu),c=y(t,a),d=l.useRef(!1),f=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(Kh,{bubbles:!0,cancelable:!0});e.addEventListener(Kh,e=>r?.(e),{once:!0}),Lo(e,t),t.defaultPrevented?d.current=!1:o.onClose()}};return(0,u.jsx)(Jh,{...i,ref:c,disabled:n,onClick:Q(e.onClick,f),onPointerDown:t=>{e.onPointerDown?.(t),d.current=!0},onPointerUp:Q(e.onPointerUp,e=>{d.current||e.currentTarget?.click()}),onKeyDown:Q(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||ch.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});qh.displayName=Gh;var Jh=l.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=Fh(Gh,n),s=xh(n),c=l.useRef(null),d=y(t,c),[f,p]=l.useState(!1),[m,h]=l.useState(``);return l.useEffect(()=>{let e=c.current;e&&h((e.textContent??``).trim())},[a.children]),(0,u.jsx)(hh.ItemSlot,{scope:n,disabled:r,textValue:i??m,children:(0,u.jsx)(th,{asChild:!0,...s,focusable:!r,children:(0,u.jsx)($.div,{role:`menuitem`,"data-highlighted":f?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:d,onPointerMove:Q(e.onPointerMove,Dg(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:Q(e.onPointerLeave,Dg(e=>o.onItemLeave(e))),onFocus:Q(e.onFocus,()=>p(!0)),onBlur:Q(e.onBlur,()=>p(!1))})})})}),Yh=`MenuCheckboxItem`,Xh=l.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,u.jsx)(ig,{scope:e.__scopeMenu,checked:n,children:(0,u.jsx)(qh,{role:`menuitemcheckbox`,"aria-checked":bg(n)?`mixed`:n,...i,ref:t,"data-state":xg(n),onSelect:Q(i.onSelect,()=>r?.(bg(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Xh.displayName=Yh;var Zh=`MenuRadioGroup`,[Qh,$h]=vh(Zh,{value:void 0,onValueChange:()=>{}}),eg=l.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=ys(r);return(0,u.jsx)(Qh,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,u.jsx)(Hh,{...i,ref:t})})});eg.displayName=Zh;var tg=`MenuRadioItem`,ng=l.forwardRef((e,t)=>{let{value:n,...r}=e,i=$h(tg,e.__scopeMenu),a=n===i.value;return(0,u.jsx)(ig,{scope:e.__scopeMenu,checked:a,children:(0,u.jsx)(qh,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":xg(a),onSelect:Q(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});ng.displayName=tg;var rg=`MenuItemIndicator`,[ig,ag]=vh(rg,{checked:!1}),og=l.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=ag(rg,n);return(0,u.jsx)(Do,{present:r||bg(a.checked)||a.checked===!0,children:(0,u.jsx)($.span,{...i,ref:t,"data-state":xg(a.checked)})})});og.displayName=rg;var sg=`MenuSeparator`,cg=l.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,u.jsx)($.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});cg.displayName=sg;var lg=`MenuArrow`,ug=l.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=bh(n);return(0,u.jsx)(zp,{...i,...r,ref:t})});ug.displayName=lg;var dg=`MenuSub`,[fg,pg]=vh(dg),mg=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=Ch(dg,t),o=bh(t),[s,c]=l.useState(null),[d,f]=l.useState(null),p=ys(i);return l.useEffect(()=>(a.open===!1&&p(!1),()=>p(!1)),[a.open,p]),(0,u.jsx)(Ip,{...o,children:(0,u.jsx)(Sh,{scope:t,open:r,onOpenChange:p,content:d,onContentChange:f,children:(0,u.jsx)(fg,{scope:t,contentId:vs(),triggerId:vs(),trigger:s,onTriggerChange:c,children:n})})})};mg.displayName=dg;var hg=`MenuSubTrigger`,gg=l.forwardRef((e,t)=>{let n=Ch(hg,e.__scopeMenu),r=Th(hg,e.__scopeMenu),i=pg(hg,e.__scopeMenu),a=Fh(hg,e.__scopeMenu),o=l.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,d={__scopeMenu:e.__scopeMenu},f=l.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return l.useEffect(()=>f,[f]),l.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,u.jsx)(Oh,{asChild:!0,...d,children:(0,u.jsx)(Jh,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":i.contentId,"data-state":yg(n.open),...e,ref:v(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:Q(e.onPointerMove,Dg(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),f()},100))})),onPointerLeave:Q(e.onPointerLeave,Dg(e=>{f();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:Q(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||fh[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});gg.displayName=hg;var _g=`MenuSubContent`,vg=l.forwardRef((e,t)=>{let n=jh(Nh,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Ch(Nh,e.__scopeMenu),o=Th(Nh,e.__scopeMenu),s=pg(_g,e.__scopeMenu),c=l.useRef(null),d=y(t,c);return(0,u.jsx)(hh.Provider,{scope:e.__scopeMenu,children:(0,u.jsx)(Do,{present:r||a.open,children:(0,u.jsx)(hh.Slot,{scope:e.__scopeMenu,children:(0,u.jsx)(Bh,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:d,align:`start`,side:o.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{o.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:Q(e.onFocusOutside,e=>{e.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:Q(e.onEscapeKeyDown,e=>{o.onClose(),e.preventDefault()}),onKeyDown:Q(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=ph[o.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),s.trigger?.focus(),e.preventDefault())})})})})})});vg.displayName=_g;function yg(e){return e?`open`:`closed`}function bg(e){return e===`indeterminate`}function xg(e){return bg(e)?`indeterminate`:e?`checked`:`unchecked`}function Sg(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function Cg(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function wg(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=Cg(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function Tg(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function Eg(e,t){return t?Tg({x:e.clientX,y:e.clientY},t):!1}function Dg(e){return t=>t.pointerType===`mouse`?e(t):void 0}var Og=Eh,kg=Oh,Ag=Mh,jg=Ih,Mg=Hh,Ng=Wh,Pg=qh,Fg=Xh,Ig=eg,Lg=ng,Rg=og,zg=cg,Bg=ug,Vg=gg,Hg=vg,Ug=`DropdownMenu`,[Wg,Gg]=_o(Ug,[yh]),Kg=yh(),[qg,Jg]=Wg(Ug),Yg=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=Kg(t),d=l.useRef(null),[f,p]=xo({prop:i,defaultProp:a??!1,onChange:o,caller:Ug});return(0,u.jsx)(qg,{scope:t,triggerId:vs(),triggerRef:d,contentId:vs(),open:f,onOpenChange:p,onOpenToggle:l.useCallback(()=>p(e=>!e),[p]),modal:s,children:(0,u.jsx)(Og,{...c,open:f,onOpenChange:p,dir:r,modal:s,children:n})})};Yg.displayName=Ug;var Xg=`DropdownMenuTrigger`,Zg=l.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=Jg(Xg,n),o=Kg(n);return(0,u.jsx)(kg,{asChild:!0,...o,children:(0,u.jsx)($.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:v(t,a.triggerRef),onPointerDown:Q(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:Q(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});Zg.displayName=Xg;var Qg=`DropdownMenuPortal`,$g=e=>{let{__scopeDropdownMenu:t,...n}=e,r=Kg(t);return(0,u.jsx)(Ag,{...r,...n})};$g.displayName=Qg;var e_=`DropdownMenuContent`,t_=l.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Jg(e_,n),a=Kg(n),o=l.useRef(!1);return(0,u.jsx)(jg,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:Q(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:Q(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});t_.displayName=e_;var n_=`DropdownMenuGroup`,r_=l.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Kg(n);return(0,u.jsx)(Mg,{...i,...r,ref:t})});r_.displayName=n_;var i_=`DropdownMenuLabel`,a_=l.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Kg(n);return(0,u.jsx)(Ng,{...i,...r,ref:t})});a_.displayName=i_;var o_=`DropdownMenuItem`,s_=l.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Kg(n);return(0,u.jsx)(Pg,{...i,...r,ref:t})});s_.displayName=o_;var c_=`DropdownMenuCheckboxItem`,l_=l.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Kg(n);return(0,u.jsx)(Fg,{...i,...r,ref:t})});l_.displayName=c_;var u_=`DropdownMenuRadioGroup`,d_=l.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Kg(n);return(0,u.jsx)(Ig,{...i,...r,ref:t})});d_.displayName=u_;var f_=`DropdownMenuRadioItem`,p_=l.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Kg(n);return(0,u.jsx)(Lg,{...i,...r,ref:t})});p_.displayName=f_;var m_=`DropdownMenuItemIndicator`,h_=l.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Kg(n);return(0,u.jsx)(Rg,{...i,...r,ref:t})});h_.displayName=m_;var g_=`DropdownMenuSeparator`,__=l.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Kg(n);return(0,u.jsx)(zg,{...i,...r,ref:t})});__.displayName=g_;var v_=`DropdownMenuArrow`,y_=l.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Kg(n);return(0,u.jsx)(Bg,{...i,...r,ref:t})});y_.displayName=v_;var b_=`DropdownMenuSubTrigger`,x_=l.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Kg(n);return(0,u.jsx)(Vg,{...i,...r,ref:t})});x_.displayName=b_;var S_=`DropdownMenuSubContent`,C_=l.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Kg(n);return(0,u.jsx)(Hg,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});C_.displayName=S_;var w_=Yg;function T_({...e}){return(0,u.jsx)(w_,{"data-slot":`dropdown-menu`,...e})}function E_({label:e=`Arquivo`,accept:t=`.pdf,.xml,.png,.jpg,.jpeg`,multiple:n=!1,disabled:r,className:i,onFilesChange:a}){let o=(0,l.useId)(),[s,c]=(0,l.useState)(null),[d,f]=(0,l.useState)(!1),p=!!s?.length,m=(0,l.useCallback)(e=>{c(e),a?.(e)},[a]),h=(0,l.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),f(!1),!r&&e.dataTransfer.files?.length&&m(e.dataTransfer.files)},[r,m]),g=(0,l.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),r||f(!0)},[r]),_=(0,l.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),f(!1)},[]),v=(0,l.useCallback)(e=>{e.target.files&&m(e.target.files)},[m]),y=()=>{r||document.getElementById(o)?.click()},b=e=>{if(!e)return``;let t={".pdf":`PDF`,".jpg":`JPG`,".jpeg":`JPEG`,".png":`PNG`,".xml":`XML`},n=e.split(`,`).map(e=>e.trim()).map(e=>t[e.toLowerCase()]??e.replace(`.`,``).toUpperCase());return n.length===1?n[0]:n.length===2?n.join(` ou `):n.slice(0,-1).join(`, `)+` ou `+n[n.length-1]};return(0,u.jsxs)(`div`,{className:q(`flex flex-col gap-2`,i),children:[(0,u.jsx)(`input`,{id:o,type:`file`,accept:t,multiple:n,disabled:r,onChange:v,className:`absolute w-px h-px p-0 -m-px overflow-hidden whitespace-nowrap border-0`,"aria-label":e}),(0,u.jsx)(`div`,{role:`button`,tabIndex:0,onClick:y,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),y())},onDrop:h,onDragOver:g,onDragLeave:_,className:q(`h-40 p-4 relative flex flex-col items-center justify-center gap-4 rounded-sm border-2 border-dashed transition-colors`,!r&&`cursor-pointer`,`bg-default hover:bg-default/80`,d&&`border-primary bg-primary/5`,p&&`border-primary bg-primary/5`,r&&`opacity-50 cursor-not-allowed`),children:p?(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`div`,{className:`flex items-center justify-center size-8 rounded-sm bg-primary/10`,children:(0,u.jsx)(Mt,{className:`size-4 text-primary`})}),(0,u.jsx)(`div`,{className:`flex flex-col items-center text-center w-full px-2`,children:(0,u.jsx)(`span`,{className:`body-sm font-medium text-foreground break-all line-clamp-2`,children:s.length===1?s[0].name:`${s.length} arquivos selecionados`})})]}):(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`div`,{className:`flex items-center justify-center min-w-8 min-h-8 rounded-sm bg-primary/10`,children:(0,u.jsx)(Bt,{className:`min-w-4 min-h-4 text-primary`})}),(0,u.jsx)(`div`,{className:`flex flex-col items-center text-center`,children:(0,u.jsxs)(`span`,{className:`body-sm font-medium text-foreground`,children:[`Arraste e solte o arquivo aqui`,(0,u.jsx)(`br`,{}),`ou clique para selecionar`]})}),t&&(0,u.jsxs)(`span`,{className:`body-xs font-medium text-muted`,children:[`Formatos aceitos: `,b(t)]})]})})]})}var D_=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=w(`Primitive.${t}`),r=l.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,u.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),O_=`Separator`,k_=`horizontal`,A_=[`horizontal`,`vertical`],j_=l.forwardRef((e,t)=>{let{decorative:n,orientation:r=k_,...i}=e,a=M_(r)?r:k_,o=a===`vertical`?a:void 0,s=n?{role:`none`}:{"aria-orientation":o,role:`separator`};return(0,u.jsx)(D_.div,{"data-orientation":a,...s,...i,ref:t})});j_.displayName=O_;function M_(e){return A_.includes(e)}var N_=j_;function P_({className:e,orientation:t=`horizontal`,decorative:n=!0,...r}){return(0,u.jsx)(N_,{"data-slot":`separator`,decorative:n,orientation:t,className:q(`bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px`,e),...r})}function F_({icon:e,title:t,description:n,children:r,className:i}){return(0,u.jsxs)(lo,{className:i,children:[(0,u.jsxs)(uo,{children:[(0,u.jsx)(fo,{className:`bg-primary/10`,children:(0,u.jsx)(e,{className:`size-5 text-primary`})}),(0,u.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,u.jsx)(po,{children:t}),n&&(0,u.jsx)(mo,{children:n})]})]}),(0,u.jsx)(P_,{}),(0,u.jsx)(ho,{children:r})]})}function I_({className:e,type:t,...n}){return(0,u.jsx)(`input`,{type:t,"data-slot":`input`,className:q(`text-sm h-9 w-full min-w-0 rounded-md border border-border bg-default px-2.5 py-1`,`text-foreground antialiased caret-primary`,`transition-[color,border-color,box-shadow] outline-none`,`focus-visible:border-primary focus-visible:shadow-[inset_0_0_0_1px_var(--color-primary)]`,`aria-invalid:border-destructive aria-invalid:shadow-[inset_0_0_0_1px_var(--color-destructive)]`,`disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,`file:inline-flex file:h-7 file:border-0 file:text-sm file:font-medium file:text-foreground`,e),...n})}function L_({className:e,...t}){return(0,u.jsx)(`textarea`,{"data-slot":`textarea`,className:q(`field-sizing-content text-sm min-h-16 w-full min-w-0 rounded-md border border-border bg-default px-2.5 py-1`,`text-foreground antialiased caret-primary`,`transition-[color,border-color,box-shadow] outline-none`,`focus-visible:border-primary focus-visible:shadow-[inset_0_0_0_1px_var(--color-primary)]`,`aria-invalid:border-destructive aria-invalid:shadow-[inset_0_0_0_1px_var(--color-destructive)]`,`disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,`file:inline-flex file:h-7 file:border-0 file:text-sm file:font-medium file:text-foreground`,e),...t})}function R_({className:e,...t}){return(0,u.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:q(`group/input-group relative flex w-full items-center rounded-md border border-border outline-none transition-[color,border-color,box-shadow]`,`h-9 min-w-0 has-[>textarea]:h-auto dark:bg-input/30`,`has-focus-visible:border-primary has-focus-visible:shadow-[inset_0_0_0_1px_var(--color-primary)]`,`has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:shadow-[inset_0_0_0_1px_var(--color-destructive)]`,`has-[[data-slot][aria-invalid=true]:focus-visible]:border-primary has-[[data-slot][aria-invalid=true]:focus-visible]:shadow-[inset_0_0_0_1px_var(--color-primary)]`,`has-[>[data-align=inline-start]]:[&>input]:pl-2`,`has-[>[data-align=inline-end]]:[&>input]:pr-2`,`has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3`,`has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3`,e),...t})}var z_=Object.defineProperty,B_=Object.defineProperties,V_=Object.getOwnPropertyDescriptors,H_=Object.getOwnPropertySymbols,U_=Object.prototype.hasOwnProperty,W_=Object.prototype.propertyIsEnumerable,G_=(e,t,n)=>t in e?z_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,K_=(e,t)=>{for(var n in t||={})U_.call(t,n)&&G_(e,n,t[n]);if(H_)for(var n of H_(t))W_.call(t,n)&&G_(e,n,t[n]);return e},q_=(e,t)=>B_(e,V_(t)),J_=(e,t)=>{var n={};for(var r in e)U_.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&H_)for(var r of H_(e))t.indexOf(r)<0&&W_.call(e,r)&&(n[r]=e[r]);return n};function Y_(e){return[setTimeout(e,0),setTimeout(e,10),setTimeout(e,50)]}function X_(e){let t=l.useRef();return l.useEffect(()=>{t.current=e}),t.current}var Z_=18,Q_=40,$_=`${Q_}px`,ev=[`[data-lastpass-icon-root]`,`com-1password-button`,`[data-dashlanecreated]`,`[style$="2147483647 !important;"]`].join(`,`);function tv({containerRef:e,inputRef:t,pushPasswordManagerStrategy:n,isFocused:r}){let[i,a]=l.useState(!1),[o,s]=l.useState(!1),[c,u]=l.useState(!1),d=l.useMemo(()=>n===`none`?!1:(n===`increase-width`||n===`experimental-no-flickering`)&&i&&o,[i,o,n]),f=l.useCallback(()=>{let r=e.current,i=t.current;if(!r||!i||c||n===`none`)return;let o=r,s=o.getBoundingClientRect().left+o.offsetWidth,l=o.getBoundingClientRect().top+o.offsetHeight/2,d=s-Z_,f=l;document.querySelectorAll(ev).length===0&&document.elementFromPoint(d,f)===r||(a(!0),u(!0))},[e,t,c,n]);return l.useEffect(()=>{let t=e.current;if(!t||n===`none`)return;function r(){s(window.innerWidth-t.getBoundingClientRect().right>=Q_)}r();let i=setInterval(r,1e3);return()=>{clearInterval(i)}},[e,n]),l.useEffect(()=>{let e=r||document.activeElement===t.current;if(n===`none`||!e)return;let i=setTimeout(f,0),a=setTimeout(f,2e3),o=setTimeout(f,5e3),s=setTimeout(()=>{u(!0)},6e3);return()=>{clearTimeout(i),clearTimeout(a),clearTimeout(o),clearTimeout(s)}},[t,r,n,f]),{hasPWMBadge:i,willPushPWMBadge:d,PWM_BADGE_SPACE_WIDTH:$_}}var nv=l.createContext({}),rv=l.forwardRef((e,t)=>{var n=e,{value:r,onChange:i,maxLength:a,textAlign:o=`left`,pattern:s,placeholder:c,inputMode:u=`numeric`,onComplete:d,pushPasswordManagerStrategy:f=`increase-width`,pasteTransformer:p,containerClassName:m,noScriptCSSFallback:h=av,render:g,children:_}=n,v=J_(n,[`value`,`onChange`,`maxLength`,`textAlign`,`pattern`,`placeholder`,`inputMode`,`onComplete`,`pushPasswordManagerStrategy`,`pasteTransformer`,`containerClassName`,`noScriptCSSFallback`,`render`,`children`]),y;let[b,x]=l.useState(typeof v.defaultValue==`string`?v.defaultValue:``),S=r??b,C=X_(S),w=l.useCallback(e=>{i?.(e),x(e)},[i]),T=l.useMemo(()=>s?typeof s==`string`?new RegExp(s):s:null,[s]),E=l.useRef(null),D=l.useRef(null),O=l.useRef({value:S,onChange:w,isIOS:typeof window<`u`&&((y=window==null?void 0:window.CSS)?.supports)?.call(y,`-webkit-touch-callout`,`none`)}),k=l.useRef({prev:[E.current?.selectionStart,E.current?.selectionEnd,E.current?.selectionDirection]});l.useImperativeHandle(t,()=>E.current,[]),l.useEffect(()=>{let e=E.current,t=D.current;if(!e||!t)return;O.current.value!==e.value&&O.current.onChange(e.value),k.current.prev=[e.selectionStart,e.selectionEnd,e.selectionDirection];function n(){if(document.activeElement!==e){F(null),L(null);return}let t=e.selectionStart,n=e.selectionEnd,r=e.selectionDirection,i=e.maxLength,a=e.value,o=k.current.prev,s=-1,c=-1,l;if(a.length!==0&&t!==null&&n!==null){let e=t===n,r=t===a.length&&a.length<i;if(e&&!r){let e=t;if(e===0)s=0,c=1,l=`forward`;else if(e===i)s=e-1,c=e,l=`backward`;else if(i>1&&a.length>1){let t=0;if(o[0]!==null&&o[1]!==null){l=e<o[1]?`backward`:`forward`;let n=o[0]===o[1]&&o[0]<i;l===`backward`&&!n&&(t=-1)}s=t+e,c=t+e+1}}s!==-1&&c!==-1&&s!==c&&E.current.setSelectionRange(s,c,l)}let u=s===-1?t:s,d=c===-1?n:c,f=l??r;F(u),L(d),k.current.prev=[u,d,f]}if(document.addEventListener(`selectionchange`,n,{capture:!0}),n(),document.activeElement===e&&N(!0),!document.getElementById(`input-otp-style`)){let e=document.createElement(`style`);if(e.id=`input-otp-style`,document.head.appendChild(e),e.sheet){let t=`background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;`;iv(e.sheet,`[data-input-otp]::selection { background: transparent !important; color: transparent !important; }`),iv(e.sheet,`[data-input-otp]:autofill { ${t} }`),iv(e.sheet,`[data-input-otp]:-webkit-autofill { ${t} }`),iv(e.sheet,`@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }`),iv(e.sheet,`[data-input-otp] + * { pointer-events: all !important; }`)}}let r=()=>{t&&t.style.setProperty(`--root-height`,`${e.clientHeight}px`)};r();let i=new ResizeObserver(r);return i.observe(e),()=>{document.removeEventListener(`selectionchange`,n,{capture:!0}),i.disconnect()}},[]);let[A,j]=l.useState(!1),[M,N]=l.useState(!1),[P,F]=l.useState(null),[I,L]=l.useState(null);l.useEffect(()=>{Y_(()=>{var e;(e=E.current)==null||e.dispatchEvent(new Event(`input`));let t=E.current?.selectionStart,n=E.current?.selectionEnd,r=E.current?.selectionDirection;t!==null&&n!==null&&(F(t),L(n),k.current.prev=[t,n,r])})},[S,M]),l.useEffect(()=>{C!==void 0&&S!==C&&C.length<a&&S.length===a&&d?.(S)},[a,d,C,S]);let R=tv({containerRef:D,inputRef:E,pushPasswordManagerStrategy:f,isFocused:M}),ee=l.useCallback(e=>{let t=e.currentTarget.value.slice(0,a);if(t.length>0&&T&&!T.test(t)){e.preventDefault();return}typeof C==`string`&&t.length<C.length&&document.dispatchEvent(new Event(`selectionchange`)),w(t)},[a,w,C,T]),te=l.useCallback(()=>{var e;if(E.current){let t=Math.min(E.current.value.length,a-1),n=E.current.value.length;(e=E.current)==null||e.setSelectionRange(t,n),F(t),L(n)}N(!0)},[a]),z=l.useCallback(e=>{let t=E.current;if(!p&&(!O.current.isIOS||!e.clipboardData||!t))return;let n=e.clipboardData.getData(`text/plain`),r=p?p(n):n;e.preventDefault();let i=E.current?.selectionStart,o=E.current?.selectionEnd,s=(i===o?S.slice(0,i)+r+S.slice(i):S.slice(0,i)+r+S.slice(o)).slice(0,a);if(s.length>0&&T&&!T.test(s))return;t.value=s,w(s);let c=Math.min(s.length,a-1),l=s.length;t.setSelectionRange(c,l),F(c),L(l)},[a,w,T,S]),B=l.useMemo(()=>({position:`relative`,cursor:v.disabled?`default`:`text`,userSelect:`none`,WebkitUserSelect:`none`,pointerEvents:`none`}),[v.disabled]),ne=l.useMemo(()=>({position:`absolute`,inset:0,width:R.willPushPWMBadge?`calc(100% + ${R.PWM_BADGE_SPACE_WIDTH})`:`100%`,clipPath:R.willPushPWMBadge?`inset(0 ${R.PWM_BADGE_SPACE_WIDTH} 0 0)`:void 0,height:`100%`,display:`flex`,textAlign:o,opacity:`1`,color:`transparent`,pointerEvents:`all`,background:`transparent`,caretColor:`transparent`,border:`0 solid transparent`,outline:`0 solid transparent`,boxShadow:`none`,lineHeight:`1`,letterSpacing:`-.5em`,fontSize:`var(--root-height)`,fontFamily:`monospace`,fontVariantNumeric:`tabular-nums`}),[R.PWM_BADGE_SPACE_WIDTH,R.willPushPWMBadge,o]),re=l.useMemo(()=>l.createElement(`input`,q_(K_({autoComplete:v.autoComplete||`one-time-code`},v),{"data-input-otp":!0,"data-input-otp-placeholder-shown":S.length===0||void 0,"data-input-otp-mss":P,"data-input-otp-mse":I,inputMode:u,pattern:T?.source,"aria-placeholder":c,style:ne,maxLength:a,value:S,ref:E,onPaste:e=>{var t;z(e),(t=v.onPaste)==null||t.call(v,e)},onChange:ee,onMouseOver:e=>{var t;j(!0),(t=v.onMouseOver)==null||t.call(v,e)},onMouseLeave:e=>{var t;j(!1),(t=v.onMouseLeave)==null||t.call(v,e)},onFocus:e=>{var t;te(),(t=v.onFocus)==null||t.call(v,e)},onBlur:e=>{var t;N(!1),(t=v.onBlur)==null||t.call(v,e)}})),[ee,te,z,u,ne,a,I,P,v,T?.source,S]),V=l.useMemo(()=>({slots:Array.from({length:a}).map((e,t)=>{let n=M&&P!==null&&I!==null&&(P===I&&t===P||t>=P&&t<I),r=S[t]===void 0?null:S[t];return{char:r,placeholderChar:S[0]===void 0?c?.[t]??null:null,isActive:n,hasFakeCaret:n&&r===null}}),isFocused:M,isHovering:!v.disabled&&A}),[M,A,a,I,P,v.disabled,S]),ie=l.useMemo(()=>g?g(V):l.createElement(nv.Provider,{value:V},_),[_,V,g]);return l.createElement(l.Fragment,null,h!==null&&l.createElement(`noscript`,null,l.createElement(`style`,null,h)),l.createElement(`div`,{ref:D,"data-input-otp-container":!0,style:B,className:m},ie,l.createElement(`div`,{style:{position:`absolute`,inset:0,pointerEvents:`none`}},re)))});rv.displayName=`Input`;function iv(e,t){try{e.insertRule(t)}catch{console.error(`input-otp could not insert CSS rule:`,t)}}var av=`
46
46
  [data-input-otp] {
47
47
  --nojs-bg: white !important;
48
48
  --nojs-fg: black !important;
@@ -61,7 +61,7 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
61
61
  --nojs-bg: black !important;
62
62
  --nojs-fg: white !important;
63
63
  }
64
- }`;function ov({className:e,containerClassName:t,...n}){return(0,u.jsx)(rv,{"data-slot":`input-otp`,containerClassName:q(`flex items-center gap-1 md:gap-2 has-disabled:opacity-50`,t),className:q(`disabled:cursor-not-allowed`,e),...n})}var sv=g(`m-1 transition-all duration-300 ease-in-out`,{variants:{variant:{default:`border-foreground/10 text-white bg-primary hover:bg-primary/80`,secondary:`border-foreground/10 bg-secondary text-secondary-foreground hover:bg-secondary/80`,destructive:`border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80`,inverted:`inverted`},badgeAnimation:{bounce:`hover:-translate-y-1 hover:scale-110`,pulse:`hover:animate-pulse`,wiggle:`hover:animate-wiggle`,fade:`hover:opacity-80`,slide:`hover:translate-x-1`,none:``}},defaultVariants:{variant:`default`,badgeAnimation:`bounce`}}),cv=(0,l.forwardRef)(({options:e,onValueChange:t,variant:n,defaultValue:r=[],placeholder:i=`Selecione as opções`,animation:a=0,animationConfig:o,maxCount:s=3,modalPopover:c=!1,className:d,hideSelectAll:f=!1,searchable:p=!0,emptyIndicator:m,autoSize:h=!1,singleLine:g=!1,popoverClassName:_,disabled:v=!1,responsive:y,minWidth:b,maxWidth:x,deduplicateOptions:S=!1,resetOnDefaultValueChange:C=!0,closeOnSelect:w=!1,...T},E)=>{let[D,O]=(0,l.useState)(r),[k,A]=(0,l.useState)(!1),[j,M]=(0,l.useState)(!1),[N,P]=(0,l.useState)(``),[F,I]=(0,l.useState)(``),[L,R]=(0,l.useState)(``),ee=(0,l.useRef)(D.length),te=(0,l.useRef)(k),z=(0,l.useRef)(N),B=(0,l.useCallback)((e,t=`polite`)=>{t===`assertive`?(R(e),setTimeout(()=>R(``),100)):(I(e),setTimeout(()=>I(``),100))},[]),ne=(0,l.useId)(),re=`${ne}-listbox`,V=`${ne}-description`,ie=`${ne}-count`,ae=(0,l.useRef)(r),oe=(0,l.useCallback)(e=>e.length>0&&`heading`in e[0],[]),se=(0,l.useCallback)((e,t)=>{if(e.length!==t.length)return!1;let n=[...e].sort(),r=[...t].sort();return n.every((e,t)=>e===r[t])},[]),H=(0,l.useCallback)(()=>{O(r),A(!1),P(``),t(r)},[r,t]),ce=(0,l.useRef)(null);(0,l.useImperativeHandle)(E,()=>({reset:H,getSelectedValues:()=>D,setSelectedValues:e=>{O(e),t(e)},clear:()=>{O([]),t([])},focus:()=>{if(ce.current){ce.current.focus();let e=ce.current.style.outline,t=ce.current.style.outlineOffset;ce.current.style.outline=`2px solid hsl(var(--ring))`,ce.current.style.outlineOffset=`2px`,setTimeout(()=>{ce.current&&(ce.current.style.outline=e,ce.current.style.outlineOffset=t)},1e3)}}}),[H,D,t]);let[le,ue]=(0,l.useState)(`desktop`);(0,l.useEffect)(()=>{if(typeof window>`u`)return;let e=()=>{let e=window.innerWidth;ue(e<640?`mobile`:e<1024?`tablet`:`desktop`)};return e(),window.addEventListener(`resize`,e),()=>{typeof window<`u`&&window.removeEventListener(`resize`,e)}},[]);let de=(()=>{if(!y)return{maxCount:s,hideIcons:!1,compactMode:!1};if(y===!0){let e={mobile:{maxCount:2,hideIcons:!1,compactMode:!0},tablet:{maxCount:2,hideIcons:!1,compactMode:!1},desktop:{maxCount:3,hideIcons:!1,compactMode:!1}}[le];return{maxCount:e?.maxCount??s,hideIcons:e?.hideIcons??!1,compactMode:e?.compactMode??!1}}let e=y[le];return{maxCount:e?.maxCount??s,hideIcons:e?.hideIcons??!1,compactMode:e?.compactMode??!1}})(),fe=()=>{if(o?.badgeAnimation)switch(o.badgeAnimation){case`bounce`:return j?`animate-bounce`:`hover:-translate-y-1 hover:scale-110`;case`pulse`:return`hover:animate-pulse`;case`wiggle`:return`hover:animate-wiggle`;case`fade`:return`hover:opacity-80`;case`slide`:return`hover:translate-x-1`;case`none`:return``;default:return``}return j?`animate-bounce`:``},pe=()=>{if(o?.popoverAnimation)switch(o.popoverAnimation){case`scale`:return`animate-scaleIn`;case`slide`:return`animate-slideInDown`;case`fade`:return`animate-fadeIn`;case`flip`:return`animate-flipIn`;case`none`:return``;default:return``}return``},me=(0,l.useCallback)(()=>{if(e.length===0)return[];let t;t=oe(e)?e.flatMap(e=>e.options):e;let n=new Set,r=[],i=[];return t.forEach(e=>{n.has(e.value)?(r.push(e.value),S||i.push(e)):(n.add(e.value),i.push(e))}),S?i:t},[e,S,oe]),he=(0,l.useCallback)(e=>me().find(t=>t.value===e),[me]),ge=(0,l.useMemo)(()=>!p||!N?e:e.length===0?[]:oe(e)?e.map(e=>({...e,options:e.options.filter(e=>e.label.toLowerCase().includes(N.toLowerCase())||e.value.toLowerCase().includes(N.toLowerCase()))})).filter(e=>e.options.length>0):e.filter(e=>e.label.toLowerCase().includes(N.toLowerCase())||e.value.toLowerCase().includes(N.toLowerCase())),[e,N,p,oe]),_e=e=>{if(e.key===`Enter`)A(!0);else if(e.key===`Backspace`&&!e.currentTarget.value){let e=[...D];e.pop(),O(e),t(e)}},ve=e=>{if(v||he(e)?.disabled)return;let n=D.includes(e)?D.filter(t=>t!==e):[...D,e];O(n),t(n),w&&A(!1)},ye=()=>{v||(O([]),t([]))},U=()=>{v||A(e=>!e)},be=()=>{if(v)return;let e=D.slice(0,de.maxCount);O(e),t(e)},xe=()=>{if(v)return;let e=me().filter(e=>!e.disabled);if(D.length===e.length)ye();else{let n=e.map(e=>e.value);O(n),t(n)}w&&A(!1)};(0,l.useEffect)(()=>{if(!C)return;let e=ae.current;se(e,r)||(se(D,r)||O(r),ae.current=[...r])},[r,D,se,C]);let Se={minWidth:b||(le===`mobile`?`0px`:`200px`),maxWidth:x||`100%`,width:h?`auto`:`100%`};return(0,l.useEffect)(()=>{k||P(``)},[k]),(0,l.useEffect)(()=>{let e=D.length,t=me(),n=t.filter(e=>!e.disabled).length;if(e!==ee.current){let r=e-ee.current;if(r>0){let i=D.slice(-r).map(e=>t.find(t=>t.value===e)?.label).filter(Boolean);i.length===1?B(`${i[0]} selected. ${e} of ${n} options selected.`):B(`${i.length} options selected. ${e} of ${n} total selected.`)}else r<0&&B(`Option removed. ${e} of ${n} options selected.`);ee.current=e}if(k!==te.current&&(B(k?`Dropdown opened. ${n} options available. Use arrow keys to navigate.`:`Dropdown closed.`),te.current=k),N!==z.current&&N!==void 0){if(N&&k){let e=t.filter(e=>e.label.toLowerCase().includes(N.toLowerCase())||e.value.toLowerCase().includes(N.toLowerCase())).length;B(`${e} option${e===1?``:`s`} found for "${N}"`)}z.current=N}},[D,k,N,B,me]),(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(`div`,{className:`sr-only`,children:[(0,u.jsx)(`div`,{"aria-live":`polite`,"aria-atomic":`true`,role:`status`,children:F}),(0,u.jsx)(`div`,{"aria-live":`assertive`,"aria-atomic":`true`,role:`alert`,children:L})]}),(0,u.jsxs)(Sm,{open:k,onOpenChange:A,modal:c,children:[(0,u.jsx)(`div`,{id:V,className:`sr-only`,children:`Multi-select dropdown. Use arrow keys to navigate, Enter to select, and Escape to close.`}),(0,u.jsx)(`div`,{id:ie,className:`sr-only`,"aria-live":`polite`,children:D.length===0?`Nenhuma opção selecionada`:`${D.length} opção(ões) selecionada(s): ${D.map(e=>he(e)?.label).filter(Boolean).join(`, `)}`}),(0,u.jsx)(Cm,{asChild:!0,children:(0,u.jsx)(qt,{ref:ce,...T,onClick:U,disabled:v,role:`combobox`,"aria-expanded":k,"aria-haspopup":`listbox`,"aria-controls":k?re:void 0,"aria-describedby":`${V} ${ie}`,"aria-label":`Multi-seleção: ${D.length} opção(ões) selecionada(s) de ${me().length} opção(ões) disponíveis. ${i}`,className:q(`flex px-2.5 py-1 rounded-md border border-border min-h-9 h-auto items-center justify-between bg-default [&_svg]:pointer-events-auto`,`transition-[color,border-color,box-shadow] duration-150`,`hover:border-primary/40`,`focus-visible:border-primary focus-visible:shadow-[inset_0_0_0_1px_var(--color-primary)]`,`disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,h?`w-auto`:`w-full`,de.compactMode&&`min-h-8 text-sm`,le===`mobile`&&`min-h-12 text-base`,v&&`opacity-50 cursor-not-allowed`,d),style:{backgroundColor:`var(--color-default)`,...Se,maxWidth:`min(${Se.maxWidth}, 100%)`},children:D.length>0?(0,u.jsxs)(`div`,{className:`flex justify-between items-center w-full`,children:[(0,u.jsxs)(`div`,{className:q(`flex items-center`,g?`overflow-x-auto multiselect-singleline-scroll`:`flex-wrap`),style:g?{paddingBottom:`4px`}:{},children:[D.slice(0,de.maxCount).map(e=>{let t=he(e),r=t?.icon,i=t?.style;if(!t)return null;let s={animationDuration:`${a}s`,...i?.badgeColor&&{backgroundColor:i.badgeColor},...i?.gradient&&{background:i.gradient,color:`white`}};return(0,u.jsxs)(dt,{className:q(fe(),sv({variant:n}),i?.gradient&&`text-white border-transparent`,de.compactMode&&`text-xs px-1.5 py-0.5`,le===`mobile`&&`max-w-30 truncate`,g&&`shrink-0 whitespace-nowrap`,`[&>svg]:pointer-events-auto`,`items-center`),style:{...s,animationDuration:`${o?.duration||a}s`,animationDelay:`${o?.delay||0}s`},children:[r&&!de.hideIcons&&(0,u.jsx)(r,{className:q(`h-4 w-4 mr-2`,de.compactMode&&`h-3 w-3 mr-1`,i?.iconColor&&`text-current`),...i?.iconColor&&{style:{color:i.iconColor}}}),(0,u.jsx)(`span`,{className:q(le===`mobile`&&`truncate`),children:t.label}),(0,u.jsx)(`div`,{role:`button`,tabIndex:0,onClick:t=>{t.stopPropagation(),ve(e)},onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),t.stopPropagation(),ve(e))},"aria-label":`Remover ${t.label} da seleção`,className:`ml-px size-4 cursor-pointer hover:bg-white/20 rounded-full p-0.5 -m-0.5 focus:outline-none focus:ring-1 focus:ring-white/50`,children:(0,u.jsx)(Ot,{className:q(`size-3`,de.compactMode&&`size-2.5`)})})]},e)}).filter(Boolean),D.length>de.maxCount&&(0,u.jsxs)(dt,{className:q(`bg-transparent text-foreground border-foreground/1 hover:bg-transparent`,fe(),sv({variant:n}),de.compactMode&&`text-xs px-1.5 py-0.5`,g&&`shrink-0 whitespace-nowrap`,`[&>svg]:pointer-events-auto`),style:{animationDuration:`${o?.duration||a}s`,animationDelay:`${o?.delay||0}s`},children:[`+ ${D.length-de.maxCount}`,(0,u.jsx)(Ot,{className:q(`ml-px size-4 cursor-pointer`,de.compactMode&&`ml-px size-3`),onClick:e=>{e.stopPropagation(),be()}})]})]}),(0,u.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,u.jsx)(`div`,{role:`button`,tabIndex:0,onClick:e=>{e.stopPropagation(),ye()},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),ye())},"aria-label":`Limpar todas as ${D.length} opção(ões) selecionada(s)`,className:`flex items-center justify-center h-4 w-4 mx-2 cursor-pointer text-muted hover:text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1 rounded-sm`,children:(0,u.jsx)(Ht,{className:`h-4 w-4`})}),(0,u.jsx)(P_,{orientation:`vertical`,className:`flex min-h-6 h-full`}),(0,u.jsx)(Ct,{className:`h-4 ml-1 cursor-pointer text-muted opacity-50`,"aria-hidden":`true`})]})]}):(0,u.jsxs)(`div`,{className:`flex items-center justify-between w-full mx-auto`,children:[(0,u.jsx)(`span`,{className:`text-sm text-muted`,children:i}),(0,u.jsx)(Ct,{className:`h-4 cursor-pointer text-muted`})]})})}),(0,u.jsx)(wm,{id:re,role:`listbox`,"aria-multiselectable":`true`,"aria-label":`Opções disponíveis`,className:q(`w-(--radix-popover-trigger-width) p-0`,pe(),le===`mobile`&&`w-[85vw] max-w-70`,le===`tablet`&&`w-[70vw] max-w-md`,_),style:{animationDuration:`${o?.duration||a}s`,animationDelay:`${o?.delay||0}s`,maxHeight:le===`mobile`?`70vh`:`60vh`,touchAction:`manipulation`},align:`start`,onEscapeKeyDown:()=>A(!1),children:(0,u.jsxs)(Wu,{children:[p&&(0,u.jsx)(Gu,{placeholder:`Pesquisar opções...`,onKeyDown:_e,value:N,onValueChange:P,"aria-label":`Pesquisar através das opções disponíveis`,"aria-describedby":`${ne}-search-help`}),p&&(0,u.jsx)(`div`,{id:`${ne}-search-help`,className:`sr-only`,children:`Digite para filtrar opções. Use as teclas de seta para navegar pelos resultados.`}),(0,u.jsxs)(Ku,{className:q(`max-h-[40vh] overflow-y-auto multiselect-scrollbar`,le===`mobile`&&`max-h-[50vh]`,`overscroll-behavior-y-contain`),children:[(0,u.jsx)(qu,{children:m||`Nenhum resultado encontrado.`}),` `,!f&&!N&&(0,u.jsx)(Ju,{children:(0,u.jsxs)(Xu,{onSelect:xe,role:`option`,"aria-selected":D.length===me().filter(e=>!e.disabled).length,"aria-label":`Selecionar todas as ${me().length} opção(ões)`,className:`cursor-pointer`,children:[(0,u.jsx)(`div`,{className:q(`mr-2 flex size-4 items-center justify-center rounded-sm border border-primary`,D.length===me().filter(e=>!e.disabled).length?`bg-primary text-foreground`:`opacity-50 [&_svg]:invisible`),"aria-hidden":`true`,children:(0,u.jsx)(St,{className:`size-3.5 text-white`})}),(0,u.jsxs)(`span`,{children:[`(Selecionar todas`,me().length>20?` - ${me().length} opção(ões)`:``,`)`]})]},`all`)}),oe(ge)?ge.map(e=>(0,u.jsx)(Ju,{heading:e.heading,children:e.options.map(e=>{let t=D.includes(e.value);return(0,u.jsxs)(Xu,{onSelect:()=>ve(e.value),role:`option`,"aria-selected":t,"aria-disabled":e.disabled,"aria-label":`${e.label}${t?`, selecionada`:`, não selecionada`}${e.disabled?`, disabled`:``}`,className:q(`cursor-pointer`,e.disabled&&`opacity-50 cursor-not-allowed`),disabled:e.disabled,children:[(0,u.jsx)(`div`,{className:q(`mr-2 flex size-4 items-center justify-center rounded-sm border border-primary`,t?`bg-primary text-foreground`:`opacity-50 [&_svg]:invisible`),"aria-hidden":`true`,children:(0,u.jsx)(St,{className:`size-3.5 text-white`})}),e.icon&&(0,u.jsx)(e.icon,{className:`mr-2 h-4 w-4 text-muted`,"aria-hidden":`true`}),(0,u.jsx)(`span`,{children:e.label})]},e.value)})},e.heading)):(0,u.jsx)(Ju,{children:ge.map(e=>{let t=D.includes(e.value);return(0,u.jsxs)(Xu,{onSelect:()=>ve(e.value),role:`option`,"aria-selected":t,"aria-disabled":e.disabled,"aria-label":`${e.label}${t?`, selecionada`:`, não selecionada`}${e.disabled?`, desabilitada`:``}`,className:q(`cursor-pointer`,e.disabled&&`opacity-50 cursor-not-allowed`),disabled:e.disabled,children:[(0,u.jsx)(`div`,{className:q(`mr-2 flex size-4 items-center justify-center rounded-sm border border-primary`,t?`bg-primary text-foreground`:`opacity-50 [&_svg]:invisible`),"aria-hidden":`true`,children:(0,u.jsx)(St,{className:`size-3.5 text-white`})}),e.icon&&(0,u.jsx)(e.icon,{className:`mr-2 h-4 w-4 text-muted`,"aria-hidden":`true`}),(0,u.jsx)(`span`,{children:e.label})]},e.value)})}),(0,u.jsx)(Yu,{}),(0,u.jsx)(Ju,{children:(0,u.jsxs)(`div`,{className:`flex items-center justify-between`,children:[D.length>0&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(Xu,{onSelect:ye,className:`flex-1 justify-center cursor-pointer`,children:`Limpar`}),(0,u.jsx)(P_,{orientation:`vertical`,className:`flex min-h-6 h-full`})]}),(0,u.jsx)(Xu,{onSelect:()=>A(!1),className:`flex-1 justify-center cursor-pointer max-w-full`,children:`Fechar`})]})})]})]})}),a>0&&D.length>0&&(0,u.jsx)(Vt,{className:q(`cursor-pointer my-2 text-foreground bg-background w-3 h-3`,j?``:`text-muted`),onClick:()=>M(!j)})]})]})});cv.displayName=`MultiSelect`;function lv({className:e,...t}){return(0,u.jsx)(`nav`,{role:`navigation`,"aria-label":`pagination`,"data-slot":`pagination`,className:q(`mx-auto flex w-full justify-center`,e),...t})}function uv({className:e,...t}){return(0,u.jsx)(`ul`,{"data-slot":`pagination-content`,className:q(`flex flex-row items-center gap-1`,e),...t})}function dv({...e}){return(0,u.jsx)(`li`,{"data-slot":`pagination-item`,...e})}function fv({className:e,isActive:t,size:n=`icon`,...r}){return(0,u.jsx)(`button`,{"aria-current":t?`page`:void 0,"data-slot":`pagination-link`,"data-active":t,className:q(Wt({variant:t?`outline`:`ghost`,size:n}),e),...r})}function pv({className:e,...t}){return(0,u.jsxs)(fv,{"aria-label":`Ir para a página anterior`,size:`default`,className:q(`gap-1 px-2.5 sm:pl-2.5`,e),...t,children:[(0,u.jsx)(wt,{}),(0,u.jsx)(`span`,{className:`hidden sm:block`,children:`Anterior`})]})}function mv({className:e,...t}){return(0,u.jsxs)(fv,{"aria-label":`Ir para a próxima página`,size:`default`,className:q(`gap-1 px-2.5 sm:pr-2.5`,e),...t,children:[(0,u.jsx)(`span`,{className:`hidden sm:block`,children:`Próxima`}),(0,u.jsx)(Tt,{})]})}function hv({className:e,...t}){return(0,u.jsxs)(`span`,{"aria-hidden":!0,"data-slot":`pagination-ellipsis`,className:q(`flex size-9 items-center justify-center`,e),...t,children:[(0,u.jsx)(kt,{className:`size-4`}),(0,u.jsx)(`span`,{className:`sr-only`,children:`More pages`})]})}function gv(e,[t,n]){return Math.min(n,Math.max(t,e))}function _v(e){let t=vv(e),n=l.forwardRef((e,n)=>{let{children:r,...i}=e,a=l.Children.toArray(r),o=a.find(bv);if(o){let e=o.props.children,r=a.map(t=>t===o?l.Children.count(e)>1?l.Children.only(null):l.isValidElement(e)?e.props.children:null:t);return(0,u.jsx)(t,{...i,ref:n,children:l.isValidElement(e)?l.cloneElement(e,void 0,r):null})}return(0,u.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function vv(e){let t=l.forwardRef((e,t)=>{let{children:n,...r}=e;if(l.isValidElement(n)){let e=Sv(n),i=xv(r,n.props);return n.type!==l.Fragment&&(i.ref=t?v(t,e):e),l.cloneElement(n,i)}return l.Children.count(n)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var yv=Symbol(`radix.slottable`);function bv(e){return l.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===yv}function xv(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 Sv(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 Cv=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`}),wv=`VisuallyHidden`,Tv=l.forwardRef((e,t)=>(0,u.jsx)($.span,{...e,ref:t,style:{...Cv,...e.style}}));Tv.displayName=wv;var Ev=Tv,Dv=[` `,`Enter`,`ArrowUp`,`ArrowDown`],Ov=[` `,`Enter`],kv=`Select`,[Av,jv,Mv]=Mm(kv),[Nv,Pv]=_o(kv,[Mv,bp]),Fv=bp(),[Iv,Lv]=Nv(kv),[Rv,zv]=Nv(kv),Bv=e=>{let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:d,name:f,autoComplete:p,disabled:m,required:h,form:g}=e,_=Fv(t),[v,y]=l.useState(null),[b,x]=l.useState(null),[S,C]=l.useState(!1),w=Pm(d),[T,E]=xo({prop:r,defaultProp:i??!1,onChange:a,caller:kv}),[D,O]=xo({prop:o,defaultProp:s,onChange:c,caller:kv}),k=l.useRef(null),A=v?g||!!v.closest(`form`):!0,[j,M]=l.useState(new Set),N=Array.from(j).map(e=>e.props.value).join(`;`);return(0,u.jsx)(Ip,{..._,children:(0,u.jsxs)(Iv,{required:h,scope:t,trigger:v,onTriggerChange:y,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:vs(),value:D,onValueChange:O,open:T,onOpenChange:E,dir:w,triggerPointerDownPosRef:k,disabled:m,children:[(0,u.jsx)(Av.Provider,{scope:t,children:(0,u.jsx)(Rv,{scope:e.__scopeSelect,onNativeOptionAdd:l.useCallback(e=>{M(t=>new Set(t).add(e))},[]),onNativeOptionRemove:l.useCallback(e=>{M(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),A?(0,u.jsxs)(Fy,{"aria-hidden":!0,required:h,tabIndex:-1,name:f,autoComplete:p,value:D,onChange:e=>O(e.target.value),disabled:m,form:g,children:[D===void 0?(0,u.jsx)(`option`,{value:``}):null,Array.from(j)]},N):null]})})};Bv.displayName=kv;var Vv=`SelectTrigger`,Hv=l.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=Fv(n),o=Lv(Vv,n),s=o.disabled||r,c=y(t,o.onTriggerChange),d=jv(n),f=l.useRef(`touch`),[p,m,h]=Ly(e=>{let t=d().filter(e=>!e.disabled),n=Ry(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),g=e=>{s||(o.onOpenChange(!0),h()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,u.jsx)(Lp,{asChild:!0,...a,children:(0,u.jsx)($.button,{type:`button`,role:`combobox`,"aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":Iy(o.value)?``:void 0,...i,ref:c,onClick:Q(i.onClick,e=>{e.currentTarget.focus(),f.current!==`mouse`&&g(e)}),onPointerDown:Q(i.onPointerDown,e=>{f.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(g(e),e.preventDefault())}),onKeyDown:Q(i.onKeyDown,e=>{let t=p.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&m(e.key),!(t&&e.key===` `)&&Dv.includes(e.key)&&(g(),e.preventDefault())})})})});Hv.displayName=Vv;var Uv=`SelectValue`,Wv=l.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=Lv(Uv,n),{onValueNodeHasChildrenChange:l}=c,d=a!==void 0,f=y(t,c.onValueNodeChange);return yo(()=>{l(d)},[l,d]),(0,u.jsx)($.span,{...s,ref:f,style:{pointerEvents:`none`},children:Iy(c.value)?(0,u.jsx)(u.Fragment,{children:o}):a})});Wv.displayName=Uv;var Gv=`SelectIcon`,Kv=l.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,u.jsx)($.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});Kv.displayName=Gv;var qv=`SelectPortal`,Jv=e=>(0,u.jsx)(Zs,{asChild:!0,...e});Jv.displayName=qv;var Yv=`SelectContent`,Xv=l.forwardRef((e,t)=>{let n=Lv(Yv,e.__scopeSelect),[r,i]=l.useState();if(yo(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?d.createPortal((0,u.jsx)(Qv,{scope:e.__scopeSelect,children:(0,u.jsx)(Av.Slot,{scope:e.__scopeSelect,children:(0,u.jsx)(`div`,{children:e.children})})}),t):null}return(0,u.jsx)(ny,{...e,ref:t})});Xv.displayName=Yv;var Zv=10,[Qv,$v]=Nv(Yv),ey=`SelectContentImpl`,ty=_v(`SelectContent.RemoveScroll`),ny=l.forwardRef((e,t)=>{let{__scopeSelect:n,position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:g,hideWhenDetached:_,avoidCollisions:v,...b}=e,x=Lv(Yv,n),[S,C]=l.useState(null),[w,T]=l.useState(null),E=y(t,e=>C(e)),[D,O]=l.useState(null),[k,A]=l.useState(null),j=jv(n),[M,N]=l.useState(!1),P=l.useRef(!1);l.useEffect(()=>{if(S)return vl(S)},[S]),$s();let F=l.useCallback(e=>{let[t,...n]=j().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&w&&(w.scrollTop=0),n===r&&w&&(w.scrollTop=w.scrollHeight),n?.focus(),document.activeElement!==i))return},[j,w]),I=l.useCallback(()=>F([D,S]),[F,D,S]);l.useEffect(()=>{M&&I()},[M,I]);let{onOpenChange:L,triggerPointerDownPosRef:R}=x;l.useEffect(()=>{if(S){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(R.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(R.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():S.contains(n.target)||L(!1),document.removeEventListener(`pointermove`,t),R.current=null};return R.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[S,L,R]),l.useEffect(()=>{let e=()=>L(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[L]);let[ee,te]=Ly(e=>{let t=j().filter(e=>!e.disabled),n=Ry(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),z=l.useCallback((e,t,n)=>{let r=!P.current&&!n;(x.value!==void 0&&x.value===t||r)&&(O(e),r&&(P.current=!0))},[x.value]),B=l.useCallback(()=>S?.focus(),[S]),ne=l.useCallback((e,t,n)=>{let r=!P.current&&!n;(x.value!==void 0&&x.value===t||r)&&A(e)},[x.value]),re=r===`popper`?oy:iy,V=re===oy?{side:s,sideOffset:c,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:g,hideWhenDetached:_,avoidCollisions:v}:{};return(0,u.jsx)(Qv,{scope:n,content:S,viewport:w,onViewportChange:T,itemRefCallback:z,selectedItem:D,onItemLeave:B,itemTextRefCallback:ne,focusSelectedItem:I,selectedItemText:k,position:r,isPositioned:M,searchRef:ee,children:(0,u.jsx)(ll,{as:ty,allowPinchZoom:!0,children:(0,u.jsx)(Rs,{asChild:!0,trapped:x.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Q(i,e=>{x.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,u.jsx)(Ds,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:(0,u.jsx)(re,{role:`listbox`,id:x.contentId,"data-state":x.open?`open`:`closed`,dir:x.dir,onContextMenu:e=>e.preventDefault(),...b,...V,onPlaced:()=>N(!0),ref:E,style:{display:`flex`,flexDirection:`column`,outline:`none`,...b.style},onKeyDown:Q(b.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&te(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=j().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>F(t)),e.preventDefault()}})})})})})})});ny.displayName=ey;var ry=`SelectItemAlignedPosition`,iy=l.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=Lv(Yv,n),o=$v(Yv,n),[s,c]=l.useState(null),[d,f]=l.useState(null),p=y(t,e=>f(e)),m=jv(n),h=l.useRef(!1),g=l.useRef(!0),{viewport:_,selectedItem:v,selectedItemText:b,focusSelectedItem:x}=o,S=l.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&d&&_&&v&&b){let e=a.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=b.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-Zv,d=gv(a,[Zv,Math.max(Zv,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-Zv,d=gv(a,[Zv,Math.max(Zv,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=m(),c=window.innerHeight-Zv*2,l=_.scrollHeight,u=window.getComputedStyle(d),f=parseInt(u.borderTopWidth,10),p=parseInt(u.paddingTop,10),g=parseInt(u.borderBottomWidth,10),y=parseInt(u.paddingBottom,10),x=f+p+l+y+g,S=Math.min(v.offsetHeight*5,x),C=window.getComputedStyle(_),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-Zv,D=c-E,O=v.offsetHeight/2,k=v.offsetTop+O,A=f+p+k,j=x-A;if(A<=E){let e=o.length>0&&v===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=d.clientHeight-_.offsetTop-_.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+g);s.style.height=n+`px`}else{let e=o.length>0&&v===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,f+_.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,_.scrollTop=A-E+_.offsetTop}s.style.margin=`${Zv}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>h.current=!0)}},[m,a.trigger,a.valueNode,s,d,_,v,b,a.dir,r]);yo(()=>S(),[S]);let[C,w]=l.useState();return yo(()=>{d&&w(window.getComputedStyle(d).zIndex)},[d]),(0,u.jsx)(sy,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:h,onScrollButtonChange:l.useCallback(e=>{e&&g.current===!0&&(S(),x?.(),g.current=!1)},[S,x]),children:(0,u.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:C},children:(0,u.jsx)($.div,{...i,ref:p,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});iy.displayName=ry;var ay=`SelectPopperPosition`,oy=l.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=Zv,...a}=e,o=Fv(n);return(0,u.jsx)(Rp,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});oy.displayName=ay;var[sy,cy]=Nv(Yv,{}),ly=`SelectViewport`,uy=l.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=$v(ly,n),o=cy(ly,n),s=y(t,a.onViewportChange),c=l.useRef(0);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,u.jsx)(Av.Slot,{scope:n,children:(0,u.jsx)($.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:Q(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-Zv*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})});uy.displayName=ly;var dy=`SelectGroup`,[fy,py]=Nv(dy),my=l.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=vs();return(0,u.jsx)(fy,{scope:n,id:i,children:(0,u.jsx)($.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});my.displayName=dy;var hy=`SelectLabel`,gy=l.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=py(hy,n);return(0,u.jsx)($.div,{id:i.id,...r,ref:t})});gy.displayName=hy;var _y=`SelectItem`,[vy,yy]=Nv(_y),by=l.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=Lv(_y,n),c=$v(_y,n),d=s.value===r,[f,p]=l.useState(a??``),[m,h]=l.useState(!1),g=y(t,e=>c.itemRefCallback?.(e,r,i)),_=vs(),v=l.useRef(`touch`),b=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,u.jsx)(vy,{scope:n,value:r,disabled:i,textId:_,isSelected:d,onItemTextChange:l.useCallback(e=>{p(t=>t||(e?.textContent??``).trim())},[]),children:(0,u.jsx)(Av.ItemSlot,{scope:n,value:r,disabled:i,textValue:f,children:(0,u.jsx)($.div,{role:`option`,"aria-labelledby":_,"data-highlighted":m?``:void 0,"aria-selected":d&&m,"data-state":d?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:g,onFocus:Q(o.onFocus,()=>h(!0)),onBlur:Q(o.onBlur,()=>h(!1)),onClick:Q(o.onClick,()=>{v.current!==`mouse`&&b()}),onPointerUp:Q(o.onPointerUp,()=>{v.current===`mouse`&&b()}),onPointerDown:Q(o.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:Q(o.onPointerMove,e=>{v.current=e.pointerType,i?c.onItemLeave?.():v.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Q(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:Q(o.onKeyDown,e=>{c.searchRef?.current!==``&&e.key===` `||(Ov.includes(e.key)&&b(),e.key===` `&&e.preventDefault())})})})})});by.displayName=_y;var xy=`SelectItemText`,Sy=l.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=Lv(xy,n),s=$v(xy,n),c=yy(xy,n),f=zv(xy,n),[p,m]=l.useState(null),h=y(t,e=>m(e),c.onItemTextChange,e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),g=p?.textContent,_=l.useMemo(()=>(0,u.jsx)(`option`,{value:c.value,disabled:c.disabled,children:g},c.value),[c.disabled,c.value,g]),{onNativeOptionAdd:v,onNativeOptionRemove:b}=f;return yo(()=>(v(_),()=>b(_)),[v,b,_]),(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)($.span,{id:c.textId,...a,ref:h}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?d.createPortal(a.children,o.valueNode):null]})});Sy.displayName=xy;var Cy=`SelectItemIndicator`,wy=l.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return yy(Cy,n).isSelected?(0,u.jsx)($.span,{"aria-hidden":!0,...r,ref:t}):null});wy.displayName=Cy;var Ty=`SelectScrollUpButton`,Ey=l.forwardRef((e,t)=>{let n=$v(Ty,e.__scopeSelect),r=cy(Ty,e.__scopeSelect),[i,a]=l.useState(!1),o=y(t,r.onScrollButtonChange);return yo(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,u.jsx)(ky,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});Ey.displayName=Ty;var Dy=`SelectScrollDownButton`,Oy=l.forwardRef((e,t)=>{let n=$v(Dy,e.__scopeSelect),r=cy(Dy,e.__scopeSelect),[i,a]=l.useState(!1),o=y(t,r.onScrollButtonChange);return yo(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,u.jsx)(ky,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});Oy.displayName=Dy;var ky=l.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=$v(`SelectScrollButton`,n),o=l.useRef(null),s=jv(n),c=l.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return l.useEffect(()=>()=>c(),[c]),yo(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,u.jsx)($.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Q(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:Q(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:Q(i.onPointerLeave,()=>{c()})})}),Ay=`SelectSeparator`,jy=l.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,u.jsx)($.div,{"aria-hidden":!0,...r,ref:t})});jy.displayName=Ay;var My=`SelectArrow`,Ny=l.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Fv(n),a=Lv(My,n),o=$v(My,n);return a.open&&o.position===`popper`?(0,u.jsx)(zp,{...i,...r,ref:t}):null});Ny.displayName=My;var Py=`SelectBubbleInput`,Fy=l.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=l.useRef(null),a=y(r,i),o=wo(t);return l.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(o!==t&&r){let n=new Event(`change`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[o,t]),(0,u.jsx)($.select,{...n,style:{...Cv,...n.style},ref:a,defaultValue:t})});Fy.displayName=Py;function Iy(e){return e===``||e===void 0}function Ly(e){let t=ys(e),n=l.useRef(``),r=l.useRef(0),i=l.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=l.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return l.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function Ry(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=zy(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function zy(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var By=Bv,Vy=Hv,Hy=Wv,Uy=Kv,Wy=Jv,Gy=Xv,Ky=uy,qy=my,Jy=by,Yy=Sy,Xy=wy,Zy=Ey,Qy=Oy;function $y({...e}){return(0,u.jsx)(By,{"data-slot":`select`,...e})}function eb({...e}){return(0,u.jsx)(qy,{"data-slot":`select-group`,...e})}function tb({...e}){return(0,u.jsx)(Hy,{"data-slot":`select-value`,...e})}function nb({className:e,size:t=`default`,children:n,loading:r,disabled:i,...a}){let o=i||r;return(0,u.jsxs)(Vy,{"data-slot":`select-trigger`,"data-size":t,disabled:o,style:{backgroundColor:`var(--color-default)`},className:q(`text-sm border border-border bg-default data-placeholder:text-muted [&_svg:not([class*='text-'])]:text-muted h-9 w-full min-w-0 rounded-md px-2.5 py-1 outline-none whitespace-nowrap`,`transition-[color,border-color,box-shadow] duration-150`,`hover:border-primary/40`,`focus-visible:border-primary focus-visible:shadow-[inset_0_0_0_1px_var(--color-primary)]`,`disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,`aria-invalid:border-destructive aria-invalid:shadow-[inset_0_0_0_1px_var(--color-destructive)]`,`flex items-center justify-between gap-2`,`*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...a,children:[n,(0,u.jsx)(Uy,{asChild:!0,children:r?(0,u.jsx)(Ut,{className:`size-4 opacity-50`}):(0,u.jsx)(Ct,{className:`size-4 opacity-50`})})]})}function rb({className:e,...t}){return(0,u.jsx)(Zy,{"data-slot":`select-scroll-up-button`,className:q(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,u.jsx)(Et,{className:`size-4`})})}function ib({className:e,...t}){return(0,u.jsx)(Qy,{"data-slot":`select-scroll-down-button`,className:q(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,u.jsx)(Ct,{className:`size-4`})})}function ab({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,u.jsx)(Wy,{children:(0,u.jsxs)(Gy,{"data-slot":`select-content`,className:q(`bg-input data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-32 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,align:r,onCloseAutoFocus:e=>{e.preventDefault()},...i,children:[(0,u.jsx)(rb,{}),(0,u.jsx)(Ky,{className:q(`p-1`,n===`popper`&&`h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width) scroll-my-1`),children:t}),(0,u.jsx)(ib,{})]})})}function ob({className:e,children:t,...n}){return(0,u.jsxs)(Jy,{"data-slot":`select-item`,className:q(`focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none`,`transition-colors duration-100`,`data-disabled:pointer-events-none data-disabled:opacity-50`,`[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,u.jsx)(`span`,{"data-slot":`select-item-indicator`,className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,u.jsx)(Xy,{children:(0,u.jsx)(St,{className:`size-4`})})}),(0,u.jsx)(Yy,{children:t})]})}function sb(e,t){if(t<=7)return Array.from({length:t},(e,t)=>t+1);let n=[];if(e<=3){for(let e=1;e<=4;e++)n.push(e);n.push(`ellipsis`),n.push(t)}else if(e>=t-2){n.push(1),n.push(`ellipsis`);for(let e=t-3;e<=t;e++)n.push(e)}else n.push(1),n.push(`ellipsis`),n.push(e-1),n.push(e),n.push(e+1),n.push(`ellipsis`),n.push(t);return n}function cb({currentPage:e,totalPages:t,pageSize:n,totalItems:r,onPageChange:i,onPageSizeChange:a}){let o=r===0?0:(e-1)*n+1,s=Math.min(e*n,r),c=(0,l.useMemo)(()=>sb(e,t),[e,t]),d=(n,r)=>{r.preventDefault(),n>=1&&n<=t&&n!==e&&i(n)};return t===0?null:(0,u.jsxs)(`div`,{className:`w-full flex flex-col md:flex-row items-center justify-between gap-4 px-2 py-4 bg-background`,children:[(0,u.jsxs)(`div`,{className:`w-fit flex flex-row items-center gap-2`,children:[(0,u.jsx)(td,{htmlFor:`select-rows-per-page`,children:`Itens por página`}),(0,u.jsxs)($y,{value:n.toString(),onValueChange:e=>{a(parseInt(e,10))},children:[(0,u.jsx)(nb,{className:`w-20`,id:`select-rows-per-page`,children:(0,u.jsx)(tb,{})}),(0,u.jsx)(ab,{align:`start`,children:(0,u.jsxs)(eb,{children:[(0,u.jsx)(ob,{value:`5`,children:`5`}),(0,u.jsx)(ob,{value:`10`,children:`10`}),(0,u.jsx)(ob,{value:`25`,children:`25`}),(0,u.jsx)(ob,{value:`50`,children:`50`})]})})]})]}),(0,u.jsxs)(`span`,{className:`text-nowrap text-neutrals-800 text-sm font-medium`,children:[o,` - `,s,` de `,r]}),(0,u.jsx)(lv,{className:`mx-0 w-auto`,children:(0,u.jsxs)(uv,{children:[(0,u.jsx)(dv,{children:(0,u.jsx)(pv,{onClick:t=>{t.preventDefault(),e>1&&i(e-1)},className:e===1?`pointer-events-none opacity-50`:`cursor-pointer`})}),c.map((t,n)=>t===`ellipsis`?(0,u.jsx)(dv,{children:(0,u.jsx)(hv,{})},`ellipsis-${n}`):(0,u.jsx)(dv,{children:(0,u.jsx)(fv,{isActive:t===e,onClick:e=>d(t,e),className:`cursor-pointer`,children:t})},t)),(0,u.jsx)(dv,{children:(0,u.jsx)(mv,{onClick:n=>{n.preventDefault(),e<t&&i(e+1)},className:e===t?`pointer-events-none opacity-50`:`cursor-pointer`})})]})})]})}function lb({show:e,onToggle:t}){return(0,u.jsx)(qt,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`absolute right-sm top-1/2 -translate-y-1/2 size-6 text-muted hover:text-foreground`,onClick:t,"aria-label":e?`Ocultar senha`:`Exibir senha`,children:e?(0,u.jsx)(At,{className:`size-4`}):(0,u.jsx)(jt,{className:`size-4`})})}var ub=`Radio`,[db,fb]=_o(ub),[pb,mb]=db(ub),hb=l.forwardRef((e,t)=>{let{__scopeRadio:n,name:r,checked:i=!1,required:a,disabled:o,value:s=`on`,onCheck:c,form:d,...f}=e,[p,m]=l.useState(null),h=y(t,e=>m(e)),g=l.useRef(!1),_=p?d||!!p.closest(`form`):!0;return(0,u.jsxs)(pb,{scope:n,checked:i,disabled:o,children:[(0,u.jsx)($.button,{type:`button`,role:`radio`,"aria-checked":i,"data-state":bb(i),"data-disabled":o?``:void 0,disabled:o,value:s,...f,ref:h,onClick:Q(e.onClick,e=>{i||c?.(),_&&(g.current=e.isPropagationStopped(),g.current||e.stopPropagation())})}),_&&(0,u.jsx)(yb,{control:p,bubbles:!g.current,name:r,value:s,checked:i,required:a,disabled:o,form:d,style:{transform:`translateX(-100%)`}})]})});hb.displayName=ub;var gb=`RadioIndicator`,_b=l.forwardRef((e,t)=>{let{__scopeRadio:n,forceMount:r,...i}=e,a=mb(gb,n);return(0,u.jsx)(Do,{present:r||a.checked,children:(0,u.jsx)($.span,{"data-state":bb(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t})})});_b.displayName=gb;var vb=`RadioBubbleInput`,yb=l.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...i},a)=>{let o=l.useRef(null),s=y(o,a),c=wo(n),d=To(t);return l.useEffect(()=>{let e=o.current;if(!e)return;let t=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(t,`checked`).set;if(c!==n&&i){let t=new Event(`click`,{bubbles:r});i.call(e,n),e.dispatchEvent(t)}},[c,n,r]),(0,u.jsx)($.input,{type:`radio`,"aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...i.style,...d,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0}})});yb.displayName=vb;function bb(e){return e?`checked`:`unchecked`}var xb=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],Sb=`RadioGroup`,[Cb,wb]=_o(Sb,[Hm,fb]),Tb=Hm(),Eb=fb(),[Db,Ob]=Cb(Sb),kb=l.forwardRef((e,t)=>{let{__scopeRadioGroup:n,name:r,defaultValue:i,value:a,required:o=!1,disabled:s=!1,orientation:c,dir:l,loop:d=!0,onValueChange:f,...p}=e,m=Tb(n),h=Pm(l),[g,_]=xo({prop:a,defaultProp:i??null,onChange:f,caller:Sb});return(0,u.jsx)(Db,{scope:n,name:r,required:o,disabled:s,value:g,onValueChange:_,children:(0,u.jsx)(eh,{asChild:!0,...m,orientation:c,dir:h,loop:d,children:(0,u.jsx)($.div,{role:`radiogroup`,"aria-required":o,"aria-orientation":c,"data-disabled":s?``:void 0,dir:h,...p,ref:t})})})});kb.displayName=Sb;var Ab=`RadioGroupItem`,jb=l.forwardRef((e,t)=>{let{__scopeRadioGroup:n,disabled:r,...i}=e,a=Ob(Ab,n),o=a.disabled||r,s=Tb(n),c=Eb(n),d=l.useRef(null),f=y(t,d),p=a.value===i.value,m=l.useRef(!1);return l.useEffect(()=>{let e=e=>{xb.includes(e.key)&&(m.current=!0)},t=()=>m.current=!1;return document.addEventListener(`keydown`,e),document.addEventListener(`keyup`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`keyup`,t)}},[]),(0,u.jsx)(th,{asChild:!0,...s,focusable:!o,active:p,children:(0,u.jsx)(hb,{disabled:o,required:a.required,checked:p,...c,...i,name:a.name,ref:f,onCheck:()=>a.onValueChange(i.value),onKeyDown:Q(e=>{e.key===`Enter`&&e.preventDefault()}),onFocus:Q(i.onFocus,()=>{m.current&&d.current?.click()})})})});jb.displayName=Ab;var Mb=`RadioGroupIndicator`,Nb=l.forwardRef((e,t)=>{let{__scopeRadioGroup:n,...r}=e;return(0,u.jsx)(_b,{...Eb(n),...r,ref:t})});Nb.displayName=Mb;var Pb=kb;function Fb({className:e,...t}){return(0,u.jsx)(Pb,{"data-slot":`radio-group`,className:q(`grid gap-3`,e),...t})}function Ib({className:e,...t}){return(0,u.jsx)(`button`,{type:`button`,className:q(`relative size-8 rounded-full bg-default shadow-sm`,`flex items-center justify-center`,`cursor-pointer select-none`,`transition-[opacity,transform,box-shadow] duration-150`,`hover:opacity-90 hover:shadow-md`,`active:scale-[0.96]`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:ring-offset-2`,`disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 disabled:active:scale-100`,e),...t})}function Lb({className:e,...t}){return(0,u.jsx)(`div`,{"data-slot":`skeleton`,className:q(`bg-muted/20 animate-pulse rounded-md`,e),...t})}var Rb=(e,t,n,r,i,a,o,s)=>{let c=document.documentElement,l=[`light`,`dark`];function u(t){(Array.isArray(e)?e:[e]).forEach(e=>{let n=e===`class`,r=n&&a?i.map(e=>a[e]||e):i;n?(c.classList.remove(...r),c.classList.add(a&&a[t]?a[t]:t)):c.setAttribute(e,t)}),d(t)}function d(e){s&&l.includes(e)&&(c.style.colorScheme=e)}function f(){return window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}if(r)u(r);else try{let e=localStorage.getItem(t)||n;u(o&&e===`system`?f():e)}catch{}},zb=l.createContext(void 0),Bb={setTheme:e=>{},themes:[]},Vb=()=>l.useContext(zb)??Bb;l.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:a,value:o,themes:s,nonce:c,scriptProps:u})=>{let d=JSON.stringify([n,t,a,e,s,o,r,i]).slice(1,-1);return l.createElement(`script`,{...u,suppressHydrationWarning:!0,nonce:typeof window>`u`?c:``,dangerouslySetInnerHTML:{__html:`(${Rb.toString()})(${d})`}})});function Hb(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var Ub=e=>{switch(e){case`success`:return Kb;case`info`:return Jb;case`warning`:return qb;case`error`:return Yb;default:return null}},Wb=Array(12).fill(0),Gb=({visible:e,className:t})=>l.default.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},l.default.createElement(`div`,{className:`sonner-spinner`},Wb.map((e,t)=>l.default.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),Kb=l.default.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},l.default.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),qb=l.default.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`},l.default.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),Jb=l.default.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},l.default.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),Yb=l.default.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},l.default.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),Xb=l.default.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},l.default.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),l.default.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),Zb=()=>{let[e,t]=l.default.useState(document.hidden);return l.default.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>window.removeEventListener(`visibilitychange`,e)},[]),e},Qb=1,$b=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id?.length>0?e.id:Qb++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],l.default.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(tx(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!l.default.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!l.default.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!l.default.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!l.default.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=t?.id||Qb++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},ex=(e,t)=>{let n=t?.id||Qb++;return $b.addToast({title:e,...t,id:n}),n},tx=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`;Object.assign(ex,{success:$b.success,info:$b.info,warning:$b.warning,error:$b.error,custom:$b.custom,message:$b.message,promise:$b.promise,dismiss:$b.dismiss,loading:$b.loading},{getHistory:()=>$b.toasts,getToasts:()=>$b.getActiveToasts()}),Hb(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function nx(e){return e.label!==void 0}var rx=3,ix=`24px`,ax=`16px`,ox=4e3,sx=356,cx=14,lx=45,ux=200;function dx(...e){return e.filter(Boolean).join(` `)}function fx(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var px=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:u,expanded:d,removeToast:f,defaultRichColors:p,closeButton:m,style:h,cancelButtonStyle:g,actionButtonStyle:_,className:v=``,descriptionClassName:y=``,duration:b,position:x,gap:S,expandByDefault:C,classNames:w,icons:T,closeButtonAriaLabel:E=`Close toast`}=e,[D,O]=l.default.useState(null),[k,A]=l.default.useState(null),[j,M]=l.default.useState(!1),[N,P]=l.default.useState(!1),[F,I]=l.default.useState(!1),[L,R]=l.default.useState(!1),[ee,te]=l.default.useState(!1),[z,B]=l.default.useState(0),[ne,re]=l.default.useState(0),V=l.default.useRef(n.duration||b||ox),ie=l.default.useRef(null),ae=l.default.useRef(null),oe=c===0,se=c+1<=o,H=n.type,ce=n.dismissible!==!1,le=n.className||``,ue=n.descriptionClassName||``,de=l.default.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),fe=l.default.useMemo(()=>n.closeButton??m,[n.closeButton,m]),pe=l.default.useMemo(()=>n.duration||b||ox,[n.duration,b]),me=l.default.useRef(0),he=l.default.useRef(0),ge=l.default.useRef(0),_e=l.default.useRef(null),[ve,ye]=x.split(`-`),U=l.default.useMemo(()=>s.reduce((e,t,n)=>n>=de?e:e+t.height,0),[s,de]),be=Zb(),xe=n.invert||t,Se=H===`loading`;he.current=l.default.useMemo(()=>de*S+U,[de,U]),l.default.useEffect(()=>{V.current=pe},[pe]),l.default.useEffect(()=>{M(!0)},[]),l.default.useEffect(()=>{let e=ae.current;if(e){let t=e.getBoundingClientRect().height;return re(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),l.default.useLayoutEffect(()=>{if(!j)return;let e=ae.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,re(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[j,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let Ce=l.default.useCallback(()=>{P(!0),B(he.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{f(n)},ux)},[n,f,a,he]);l.default.useEffect(()=>{if(n.promise&&H===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return d||i||be?(()=>{if(ge.current<me.current){let e=new Date().getTime()-me.current;V.current-=e}ge.current=new Date().getTime()})():V.current!==1/0&&(me.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),Ce()},V.current)),()=>clearTimeout(e)},[d,i,n,H,be,Ce]),l.default.useEffect(()=>{n.delete&&(Ce(),n.onDismiss==null||n.onDismiss.call(n,n))},[Ce,n.delete]);function we(){return T?.loading?l.default.createElement(`div`,{className:dx(w?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":H===`loading`},T.loading):l.default.createElement(Gb,{className:dx(w?.loader,n?.classNames?.loader),visible:H===`loading`})}let Te=n.icon||T?.[H]||Ub(H);return l.default.createElement(`li`,{tabIndex:0,ref:ae,className:dx(v,le,w?.toast,n?.classNames?.toast,w?.default,w?.[H],n?.classNames?.[H]),"data-sonner-toast":``,"data-rich-colors":n.richColors??p,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":j,"data-promise":!!n.promise,"data-swiped":ee,"data-removed":N,"data-visible":se,"data-y-position":ve,"data-x-position":ye,"data-index":c,"data-front":oe,"data-swiping":F,"data-dismissible":ce,"data-type":H,"data-invert":xe,"data-swipe-out":L,"data-swipe-direction":k,"data-expanded":!!(d||C&&j),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":u.length-c,"--offset":`${N?z:he.current}px`,"--initial-height":C?`auto`:`${ne}px`,...h,...n.style},onDragEnd:()=>{I(!1),O(null),_e.current=null},onPointerDown:e=>{e.button!==2&&(Se||!ce||(ie.current=new Date,B(he.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(I(!0),_e.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(L||!ce)return;_e.current=null;let e=Number(ae.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(ae.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-ie.current?.getTime(),i=D===`x`?e:t,a=Math.abs(i)/r;if(Math.abs(i)>=lx||a>.11){B(he.current),n.onDismiss==null||n.onDismiss.call(n,n),A(D===`x`?e>0?`right`:`left`:t>0?`down`:`up`),Ce(),R(!0);return}else{var o,s;(o=ae.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=ae.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`)}te(!1),I(!1),O(null)},onPointerMove:t=>{var n,r;if(!_e.current||!ce||window.getSelection()?.toString().length>0)return;let i=t.clientY-_e.current.y,a=t.clientX-_e.current.x,o=e.swipeDirections??fx(x);!D&&(Math.abs(a)>1||Math.abs(i)>1)&&O(Math.abs(a)>Math.abs(i)?`x`:`y`);let s={x:0,y:0},c=e=>1/(1.5+Math.abs(e)/20);if(D===`y`){if(o.includes(`top`)||o.includes(`bottom`))if(o.includes(`top`)&&i<0||o.includes(`bottom`)&&i>0)s.y=i;else{let e=i*c(i);s.y=Math.abs(e)<Math.abs(i)?e:i}}else if(D===`x`&&(o.includes(`left`)||o.includes(`right`)))if(o.includes(`left`)&&a<0||o.includes(`right`)&&a>0)s.x=a;else{let e=a*c(a);s.x=Math.abs(e)<Math.abs(a)?e:a}(Math.abs(s.x)>0||Math.abs(s.y)>0)&&te(!0),(n=ae.current)==null||n.style.setProperty(`--swipe-amount-x`,`${s.x}px`),(r=ae.current)==null||r.style.setProperty(`--swipe-amount-y`,`${s.y}px`)}},fe&&!n.jsx&&H!==`loading`?l.default.createElement(`button`,{"aria-label":E,"data-disabled":Se,"data-close-button":!0,onClick:Se||!ce?()=>{}:()=>{Ce(),n.onDismiss==null||n.onDismiss.call(n,n)},className:dx(w?.closeButton,n?.classNames?.closeButton)},T?.close??Xb):null,(H||n.icon||n.promise)&&n.icon!==null&&(T?.[H]!==null||n.icon)?l.default.createElement(`div`,{"data-icon":``,className:dx(w?.icon,n?.classNames?.icon)},n.promise||n.type===`loading`&&!n.icon?n.icon||we():null,n.type===`loading`?null:Te):null,l.default.createElement(`div`,{"data-content":``,className:dx(w?.content,n?.classNames?.content)},l.default.createElement(`div`,{"data-title":``,className:dx(w?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?l.default.createElement(`div`,{"data-description":``,className:dx(y,ue,w?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),l.default.isValidElement(n.cancel)?n.cancel:n.cancel&&nx(n.cancel)?l.default.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||g,onClick:e=>{nx(n.cancel)&&ce&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),Ce())},className:dx(w?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,l.default.isValidElement(n.action)?n.action:n.action&&nx(n.action)?l.default.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||_,onClick:e=>{nx(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&Ce())},className:dx(w?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function mx(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function hx(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?ax:ix;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var gx=l.default.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:u,mobileOffset:f,theme:p=`light`,richColors:m,duration:h,style:g,visibleToasts:_=rx,toastOptions:v,dir:y=mx(),gap:b=cx,icons:x,containerAriaLabel:S=`Notifications`}=e,[C,w]=l.default.useState([]),T=l.default.useMemo(()=>n?C.filter(e=>e.toasterId===n):C.filter(e=>!e.toasterId),[C,n]),E=l.default.useMemo(()=>Array.from(new Set([i].concat(T.filter(e=>e.position).map(e=>e.position)))),[T,i]),[D,O]=l.default.useState([]),[k,A]=l.default.useState(!1),[j,M]=l.default.useState(!1),[N,P]=l.default.useState(p===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:p),F=l.default.useRef(null),I=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),L=l.default.useRef(null),R=l.default.useRef(!1),ee=l.default.useCallback(e=>{w(t=>(t.find(t=>t.id===e.id)?.delete||$b.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return l.default.useEffect(()=>$b.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{w(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{d.default.flushSync(()=>{w(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[C]),l.default.useEffect(()=>{if(p!==`system`){P(p);return}if(p===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?P(`dark`):P(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{P(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{P(e?`dark`:`light`)}catch(e){console.error(e)}})}},[p]),l.default.useEffect(()=>{C.length<=1&&A(!1)},[C]),l.default.useEffect(()=>{let e=e=>{if(a.every(t=>e[t]||e.code===t)){var t;A(!0),(t=F.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===F.current||F.current?.contains(document.activeElement))&&A(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),l.default.useEffect(()=>{if(F.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,R.current=!1)}},[F.current]),l.default.createElement(`section`,{ref:t,"aria-label":`${S} ${I}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0},E.map((t,n)=>{let[i,a]=t.split(`-`);return T.length?l.default.createElement(`ol`,{key:t,dir:y===`auto`?mx():y,tabIndex:-1,ref:F,className:c,"data-sonner-toaster":!0,"data-sonner-theme":N,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${D[0]?.height||0}px`,"--width":`${sx}px`,"--gap":`${b}px`,...g,...hx(u,f)},onBlur:e=>{R.current&&!e.currentTarget.contains(e.relatedTarget)&&(R.current=!1,L.current&&=(L.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||R.current||(R.current=!0,L.current=e.relatedTarget)},onMouseEnter:()=>A(!0),onMouseMove:()=>A(!0),onMouseLeave:()=>{j||A(!1)},onDragEnd:()=>A(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||M(!0)},onPointerUp:()=>M(!1)},T.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>l.default.createElement(px,{key:n.id,icons:x,index:i,toast:n,defaultRichColors:m,duration:v?.duration??h,className:v?.className,descriptionClassName:v?.descriptionClassName,invert:r,visibleToasts:_,closeButton:v?.closeButton??s,interacting:j,position:t,style:v?.style,unstyled:v?.unstyled,classNames:v?.classNames,cancelButtonStyle:v?.cancelButtonStyle,actionButtonStyle:v?.actionButtonStyle,closeButtonAriaLabel:v?.closeButtonAriaLabel,removeToast:ee,toasts:T.filter(e=>e.position==n.position),heights:D.filter(e=>e.position==n.position),setHeights:O,expandByDefault:o,gap:b,expanded:k,swipeDirections:e.swipeDirections}))):null}))}),_x=({...e})=>{let{theme:t=`system`}=Vb();return(0,u.jsx)(gx,{theme:t,className:`toaster group`,icons:{success:(0,u.jsx)(Dt,{className:`size-4`}),info:(0,u.jsx)(Nt,{className:`size-4`}),warning:(0,u.jsx)(zt,{className:`size-4`}),error:(0,u.jsx)(Ft,{className:`size-4`}),loading:(0,u.jsx)(Pt,{className:`size-4 animate-spin`})},style:{"--normal-bg":`var(--accent)`,"--normal-text":`var(--foreground)`,"--normal-border":`var(--border)`,"--border-radius":`var(--radius)`},...e})},vx=`Switch`,[yx,bx]=_o(vx),[xx,Sx]=yx(vx),Cx=l.forwardRef((e,t)=>{let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c=`on`,onCheckedChange:d,form:f,...p}=e,[m,h]=l.useState(null),g=y(t,e=>h(e)),_=l.useRef(!1),v=m?f||!!m.closest(`form`):!0,[b,x]=xo({prop:i,defaultProp:a??!1,onChange:d,caller:vx});return(0,u.jsxs)(xx,{scope:n,checked:b,disabled:s,children:[(0,u.jsx)($.button,{type:`button`,role:`switch`,"aria-checked":b,"aria-required":o,"data-state":Ox(b),"data-disabled":s?``:void 0,disabled:s,value:c,...p,ref:g,onClick:Q(e.onClick,e=>{x(e=>!e),v&&(_.current=e.isPropagationStopped(),_.current||e.stopPropagation())})}),v&&(0,u.jsx)(Dx,{control:m,bubbles:!_.current,name:r,value:c,checked:b,required:o,disabled:s,form:f,style:{transform:`translateX(-100%)`}})]})});Cx.displayName=vx;var wx=`SwitchThumb`,Tx=l.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,i=Sx(wx,n);return(0,u.jsx)($.span,{"data-state":Ox(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})});Tx.displayName=wx;var Ex=`SwitchBubbleInput`,Dx=l.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...i},a)=>{let o=l.useRef(null),s=y(o,a),c=wo(n),d=To(t);return l.useEffect(()=>{let e=o.current;if(!e)return;let t=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(t,`checked`).set;if(c!==n&&i){let t=new Event(`click`,{bubbles:r});i.call(e,n),e.dispatchEvent(t)}},[c,n,r]),(0,u.jsx)(`input`,{type:`checkbox`,"aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...i.style,...d,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0}})});Dx.displayName=Ex;function Ox(e){return e?`checked`:`unchecked`}var kx=Cx,Ax=Tx;function jx({className:e,...t}){return(0,u.jsx)(kx,{"data-slot":`switch`,className:q(`group`,`peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-xs`,`transition-[background-color] duration-200`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:ring-offset-2 focus-visible:ring-offset-background`,`disabled:cursor-not-allowed disabled:opacity-50`,`data-[state=checked]:bg-primary data-[state=unchecked]:bg-default`,e),...t,children:(0,u.jsx)(Ax,{"data-slot":`switch-thumb`,className:q(`pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0`,`transition-[transform,width] duration-200`,`data-[state=unchecked]:translate-x-0`,`data-[state=checked]:translate-x-4`,`group-active:w-5`,`group-active:data-[state=checked]:translate-x-3`),style:{transitionTimingFunction:`cubic-bezier(0.2, 0, 0, 1)`}})})}function Mx({className:e,...t}){return(0,u.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto sidebar-scrollbar rounded-lg shadow-md bg-background`,children:(0,u.jsx)(`table`,{"data-slot":`table`,className:q(`w-full caption-bottom text-sm`,e),...t})})}var Nx=`Tabs`,[Px,Fx]=_o(Nx,[Hm]),Ix=Hm(),[Lx,Rx]=Px(Nx),zx=l.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,d=Pm(s),[f,p]=xo({prop:r,onChange:i,defaultProp:a??``,caller:Nx});return(0,u.jsx)(Lx,{scope:n,baseId:vs(),value:f,onValueChange:p,orientation:o,dir:d,activationMode:c,children:(0,u.jsx)($.div,{dir:d,"data-orientation":o,...l,ref:t})})});zx.displayName=Nx;var Bx=`TabsList`,Vx=l.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=Rx(Bx,n),o=Ix(n);return(0,u.jsx)(eh,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,u.jsx)($.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});Vx.displayName=Bx;var Hx=`TabsTrigger`,Ux=l.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=Rx(Hx,n),s=Ix(n),c=Kx(o.baseId,r),l=qx(o.baseId,r),d=r===o.value;return(0,u.jsx)(th,{asChild:!0,...s,focusable:!i,active:d,children:(0,u.jsx)($.button,{type:`button`,role:`tab`,"aria-selected":d,"aria-controls":l,"data-state":d?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:Q(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:Q(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:Q(e.onFocus,()=>{let e=o.activationMode!==`manual`;!d&&!i&&e&&o.onValueChange(r)})})})});Ux.displayName=Hx;var Wx=`TabsContent`,Gx=l.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=Rx(Wx,n),c=Kx(s.baseId,r),d=qx(s.baseId,r),f=r===s.value,p=l.useRef(f);return l.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,u.jsx)(Do,{present:i||f,children:({present:n})=>(0,u.jsx)($.div,{"data-state":f?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:d,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:p.current?`0s`:void 0},children:n&&a})})});Gx.displayName=Wx;function Kx(e,t){return`${e}-trigger-${t}`}function qx(e,t){return`${e}-content-${t}`}var Jx=zx;function Yx({className:e,orientation:t=`horizontal`,...n}){return(0,u.jsx)(Jx,{"data-slot":`tabs`,"data-orientation":t,orientation:t,className:q(`group/tabs flex gap-2 data-[orientation=horizontal]:flex-col`,e),...n})}var Xx=Symbol(`radix.slottable`);function Zx(e){let t=({children:e})=>(0,u.jsx)(u.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=Xx,t}var[Qx,$x]=_o(`Tooltip`,[bp]),eS=bp(),tS=`TooltipProvider`,nS=700,rS=`tooltip.open`,[iS,aS]=Qx(tS),oS=e=>{let{__scopeTooltip:t,delayDuration:n=nS,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=l.useRef(!0),s=l.useRef(!1),c=l.useRef(0);return l.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,u.jsx)(iS,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:l.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:l.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:l.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};oS.displayName=tS;var sS=`Tooltip`,[cS,lS]=Qx(sS),uS=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=aS(sS,e.__scopeTooltip),d=eS(t),[f,p]=l.useState(null),m=vs(),h=l.useRef(0),g=o??c.disableHoverableContent,_=s??c.delayDuration,v=l.useRef(!1),[y,b]=xo({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(rS))):c.onClose(),a?.(e)},caller:sS}),x=l.useMemo(()=>y?v.current?`delayed-open`:`instant-open`:`closed`,[y]),S=l.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,b(!0)},[b]),C=l.useCallback(()=>{window.clearTimeout(h.current),h.current=0,b(!1)},[b]),w=l.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,b(!0),h.current=0},_)},[_,b]);return l.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]),(0,u.jsx)(Ip,{...d,children:(0,u.jsx)(cS,{scope:t,contentId:m,open:y,stateAttribute:x,trigger:f,onTriggerChange:p,onTriggerEnter:l.useCallback(()=>{c.isOpenDelayedRef.current?w():S()},[c.isOpenDelayedRef,w,S]),onTriggerLeave:l.useCallback(()=>{g?C():(window.clearTimeout(h.current),h.current=0)},[C,g]),onOpen:S,onClose:C,disableHoverableContent:g,children:n})})};uS.displayName=sS;var dS=`TooltipTrigger`,fS=l.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=lS(dS,n),a=aS(dS,n),o=eS(n),s=y(t,l.useRef(null),i.onTriggerChange),c=l.useRef(!1),d=l.useRef(!1),f=l.useCallback(()=>c.current=!1,[]);return l.useEffect(()=>()=>document.removeEventListener(`pointerup`,f),[f]),(0,u.jsx)(Lp,{asChild:!0,...o,children:(0,u.jsx)($.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:Q(e.onPointerMove,e=>{e.pointerType!==`touch`&&!d.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),d.current=!0)}),onPointerLeave:Q(e.onPointerLeave,()=>{i.onTriggerLeave(),d.current=!1}),onPointerDown:Q(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,f,{once:!0})}),onFocus:Q(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:Q(e.onBlur,i.onClose),onClick:Q(e.onClick,i.onClose)})})});fS.displayName=dS;var pS=`TooltipPortal`,[mS,hS]=Qx(pS,{forceMount:void 0}),gS=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=lS(pS,t);return(0,u.jsx)(mS,{scope:t,forceMount:n,children:(0,u.jsx)(Do,{present:n||a.open,children:(0,u.jsx)(Zs,{asChild:!0,container:i,children:r})})})};gS.displayName=pS;var _S=`TooltipContent`,vS=l.forwardRef((e,t)=>{let n=hS(_S,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=lS(_S,e.__scopeTooltip);return(0,u.jsx)(Do,{present:r||o.open,children:o.disableHoverableContent?(0,u.jsx)(CS,{side:i,...a,ref:t}):(0,u.jsx)(yS,{side:i,...a,ref:t})})}),yS=l.forwardRef((e,t)=>{let n=lS(_S,e.__scopeTooltip),r=aS(_S,e.__scopeTooltip),i=l.useRef(null),a=y(t,i),[o,s]=l.useState(null),{trigger:c,onClose:d}=n,f=i.current,{onPointerInTransitChange:p}=r,m=l.useCallback(()=>{s(null),p(!1)},[p]),h=l.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=DS(r,ES(r,n.getBoundingClientRect())),a=OS(t.getBoundingClientRect());s(AS([...i,...a])),p(!0)},[p]);return l.useEffect(()=>()=>m(),[m]),l.useEffect(()=>{if(c&&f){let e=e=>h(e,f),t=e=>h(e,c);return c.addEventListener(`pointerleave`,e),f.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),f.removeEventListener(`pointerleave`,t)}}},[c,f,h,m]),l.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||f?.contains(t),i=!kS(n,o);r?m():i&&(m(),d())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,f,o,d,m]),(0,u.jsx)(CS,{...e,ref:a})}),[bS,xS]=Qx(sS,{isInside:!1}),SS=Zx(`TooltipContent`),CS=l.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=lS(_S,n),d=eS(n),{onClose:f}=c;return l.useEffect(()=>(document.addEventListener(rS,f),()=>document.removeEventListener(rS,f)),[f]),l.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&f()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,f]),(0,u.jsx)(Ds,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:f,children:(0,u.jsxs)(Rp,{"data-state":c.stateAttribute,...d,...s,ref:t,style:{...s.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:[(0,u.jsx)(SS,{children:r}),(0,u.jsx)(bS,{scope:n,isInside:!0,children:(0,u.jsx)(Ev,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});vS.displayName=_S;var wS=`TooltipArrow`,TS=l.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=eS(n);return xS(wS,n).isInside?null:(0,u.jsx)(zp,{...i,...r,ref:t})});TS.displayName=wS;function ES(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function DS(e,t,n=5){let 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 OS(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function kS(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function AS(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0),jS(t)}function jS(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}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 MS=oS,NS=uS;function PS({delayDuration:e=0,...t}){return(0,u.jsx)(MS,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function FS({...e}){return(0,u.jsx)(PS,{children:(0,u.jsx)(NS,{"data-slot":`tooltip`,...e})})}function IS({password:e}){function t(e){return e.length>=8}function n(e){return/[a-z]/.test(e)}function r(e){return/[A-Z]/.test(e)}function i(e){return/[^A-Za-z0-9]/.test(e)}let a=[{label:`Deve conter no mínimo 8 caracteres`,valid:t(e)},{label:`Pelo menos 1 letra minúscula "abc"`,valid:n(e)},{label:`Pelo menos 1 letra maiúscula "ABC"`,valid:r(e)},{label:`Pelo menos 1 caractere especial (ex: # @...)`,valid:i(e)}];function o(t){return e?t?(0,u.jsx)(Lt,{className:`text-success size-6`}):(0,u.jsx)(Rt,{className:`text-destructive size-6`}):(0,u.jsx)(`div`,{className:`size-6 flex items-center justify-center`,children:(0,u.jsx)(`div`,{className:`size-5 rounded-sm border-2 border-border`})})}return(0,u.jsx)(`div`,{className:`flex flex-col gap-1`,children:a.map((e,t)=>(0,u.jsxs)(`div`,{className:`flex flex-row gap-1 items-center`,children:[o(e.valid),(0,u.jsx)(`span`,{className:`label-md font-medium`,children:e.label})]},t))})}var LS=(0,l.createContext)(void 0),RS=()=>(0,l.useContext)(LS),zS=({children:e,tokens:t})=>(l.default.useEffect(()=>{if(!t)return;let e=`wmoney-theme-tokens`,n=document.getElementById(e);n||(n=document.createElement(`style`),n.id=e,document.head.appendChild(n));let r={light:`:root`,dark:`.dark`},i=Object.entries(t).map(([e,t])=>`${r[e]??`:root`} {\n${Object.entries(t).map(([e,t])=>` --${e}: ${t};`).join(`
64
+ }`;function ov({className:e,containerClassName:t,...n}){return(0,u.jsx)(rv,{"data-slot":`input-otp`,containerClassName:q(`flex items-center gap-1 md:gap-2 has-disabled:opacity-50`,t),className:q(`disabled:cursor-not-allowed`,e),...n})}var sv=g(`m-1 transition-all duration-300 ease-in-out`,{variants:{variant:{default:`border-foreground/10 text-white bg-primary hover:bg-primary/80`,secondary:`border-foreground/10 bg-secondary text-secondary-foreground hover:bg-secondary/80`,destructive:`border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80`,inverted:`inverted`},badgeAnimation:{bounce:`hover:-translate-y-1 hover:scale-110`,pulse:`hover:animate-pulse`,wiggle:`hover:animate-wiggle`,fade:`hover:opacity-80`,slide:`hover:translate-x-1`,none:``}},defaultVariants:{variant:`default`,badgeAnimation:`bounce`}}),cv=(0,l.forwardRef)(({options:e,onValueChange:t,variant:n,defaultValue:r=[],placeholder:i=`Selecione as opções`,animation:a=0,animationConfig:o,maxCount:s=3,modalPopover:c=!1,className:d,hideSelectAll:f=!1,searchable:p=!0,emptyIndicator:m,autoSize:h=!1,singleLine:g=!1,popoverClassName:_,disabled:v=!1,responsive:y,minWidth:b,maxWidth:x,deduplicateOptions:S=!1,resetOnDefaultValueChange:C=!0,closeOnSelect:w=!1,...T},E)=>{let[D,O]=(0,l.useState)(r),[k,A]=(0,l.useState)(!1),[j,M]=(0,l.useState)(!1),[N,P]=(0,l.useState)(``),[F,I]=(0,l.useState)(``),[L,R]=(0,l.useState)(``),ee=(0,l.useRef)(D.length),te=(0,l.useRef)(k),z=(0,l.useRef)(N),B=(0,l.useCallback)((e,t=`polite`)=>{t===`assertive`?(R(e),setTimeout(()=>R(``),100)):(I(e),setTimeout(()=>I(``),100))},[]),ne=(0,l.useId)(),re=`${ne}-listbox`,V=`${ne}-description`,ie=`${ne}-count`,ae=(0,l.useRef)(r),oe=(0,l.useCallback)(e=>e.length>0&&`heading`in e[0],[]),se=(0,l.useCallback)((e,t)=>{if(e.length!==t.length)return!1;let n=[...e].sort(),r=[...t].sort();return n.every((e,t)=>e===r[t])},[]),H=(0,l.useCallback)(()=>{O(r),A(!1),P(``),t(r)},[r,t]),ce=(0,l.useRef)(null);(0,l.useImperativeHandle)(E,()=>({reset:H,getSelectedValues:()=>D,setSelectedValues:e=>{O(e),t(e)},clear:()=>{O([]),t([])},focus:()=>{if(ce.current){ce.current.focus();let e=ce.current.style.outline,t=ce.current.style.outlineOffset;ce.current.style.outline=`2px solid hsl(var(--ring))`,ce.current.style.outlineOffset=`2px`,setTimeout(()=>{ce.current&&(ce.current.style.outline=e,ce.current.style.outlineOffset=t)},1e3)}}}),[H,D,t]);let[le,ue]=(0,l.useState)(`desktop`);(0,l.useEffect)(()=>{if(typeof window>`u`)return;let e=()=>{let e=window.innerWidth;ue(e<640?`mobile`:e<1024?`tablet`:`desktop`)};return e(),window.addEventListener(`resize`,e),()=>{typeof window<`u`&&window.removeEventListener(`resize`,e)}},[]);let de=(()=>{if(!y)return{maxCount:s,hideIcons:!1,compactMode:!1};if(y===!0){let e={mobile:{maxCount:2,hideIcons:!1,compactMode:!0},tablet:{maxCount:2,hideIcons:!1,compactMode:!1},desktop:{maxCount:3,hideIcons:!1,compactMode:!1}}[le];return{maxCount:e?.maxCount??s,hideIcons:e?.hideIcons??!1,compactMode:e?.compactMode??!1}}let e=y[le];return{maxCount:e?.maxCount??s,hideIcons:e?.hideIcons??!1,compactMode:e?.compactMode??!1}})(),fe=()=>{if(o?.badgeAnimation)switch(o.badgeAnimation){case`bounce`:return j?`animate-bounce`:`hover:-translate-y-1 hover:scale-110`;case`pulse`:return`hover:animate-pulse`;case`wiggle`:return`hover:animate-wiggle`;case`fade`:return`hover:opacity-80`;case`slide`:return`hover:translate-x-1`;case`none`:return``;default:return``}return j?`animate-bounce`:``},pe=()=>{if(o?.popoverAnimation)switch(o.popoverAnimation){case`scale`:return`animate-scaleIn`;case`slide`:return`animate-slideInDown`;case`fade`:return`animate-fadeIn`;case`flip`:return`animate-flipIn`;case`none`:return``;default:return``}return``},me=(0,l.useCallback)(()=>{if(e.length===0)return[];let t;t=oe(e)?e.flatMap(e=>e.options):e;let n=new Set,r=[],i=[];return t.forEach(e=>{n.has(e.value)?(r.push(e.value),S||i.push(e)):(n.add(e.value),i.push(e))}),S?i:t},[e,S,oe]),he=(0,l.useCallback)(e=>me().find(t=>t.value===e),[me]),ge=(0,l.useMemo)(()=>!p||!N?e:e.length===0?[]:oe(e)?e.map(e=>({...e,options:e.options.filter(e=>e.label.toLowerCase().includes(N.toLowerCase())||e.value.toLowerCase().includes(N.toLowerCase()))})).filter(e=>e.options.length>0):e.filter(e=>e.label.toLowerCase().includes(N.toLowerCase())||e.value.toLowerCase().includes(N.toLowerCase())),[e,N,p,oe]),_e=e=>{if(e.key===`Enter`)A(!0);else if(e.key===`Backspace`&&!e.currentTarget.value){let e=[...D];e.pop(),O(e),t(e)}},ve=e=>{if(v||he(e)?.disabled)return;let n=D.includes(e)?D.filter(t=>t!==e):[...D,e];O(n),t(n),w&&A(!1)},ye=()=>{v||(O([]),t([]))},U=()=>{v||A(e=>!e)},be=()=>{if(v)return;let e=D.slice(0,de.maxCount);O(e),t(e)},xe=()=>{if(v)return;let e=me().filter(e=>!e.disabled);if(D.length===e.length)ye();else{let n=e.map(e=>e.value);O(n),t(n)}w&&A(!1)};(0,l.useEffect)(()=>{if(!C)return;let e=ae.current;se(e,r)||(se(D,r)||O(r),ae.current=[...r])},[r,D,se,C]);let Se={minWidth:b||(le===`mobile`?`0px`:`200px`),maxWidth:x||`100%`,width:h?`auto`:`100%`};return(0,l.useEffect)(()=>{k||P(``)},[k]),(0,l.useEffect)(()=>{let e=D.length,t=me(),n=t.filter(e=>!e.disabled).length;if(e!==ee.current){let r=e-ee.current;if(r>0){let i=D.slice(-r).map(e=>t.find(t=>t.value===e)?.label).filter(Boolean);i.length===1?B(`${i[0]} selected. ${e} of ${n} options selected.`):B(`${i.length} options selected. ${e} of ${n} total selected.`)}else r<0&&B(`Option removed. ${e} of ${n} options selected.`);ee.current=e}if(k!==te.current&&(B(k?`Dropdown opened. ${n} options available. Use arrow keys to navigate.`:`Dropdown closed.`),te.current=k),N!==z.current&&N!==void 0){if(N&&k){let e=t.filter(e=>e.label.toLowerCase().includes(N.toLowerCase())||e.value.toLowerCase().includes(N.toLowerCase())).length;B(`${e} option${e===1?``:`s`} found for "${N}"`)}z.current=N}},[D,k,N,B,me]),(0,u.jsxs)(u.Fragment,{children:[(0,u.jsxs)(`div`,{className:`sr-only`,children:[(0,u.jsx)(`div`,{"aria-live":`polite`,"aria-atomic":`true`,role:`status`,children:F}),(0,u.jsx)(`div`,{"aria-live":`assertive`,"aria-atomic":`true`,role:`alert`,children:L})]}),(0,u.jsxs)(Sm,{open:k,onOpenChange:A,modal:c,children:[(0,u.jsx)(`div`,{id:V,className:`sr-only`,children:`Multi-select dropdown. Use arrow keys to navigate, Enter to select, and Escape to close.`}),(0,u.jsx)(`div`,{id:ie,className:`sr-only`,"aria-live":`polite`,children:D.length===0?`Nenhuma opção selecionada`:`${D.length} opção(ões) selecionada(s): ${D.map(e=>he(e)?.label).filter(Boolean).join(`, `)}`}),(0,u.jsx)(Cm,{asChild:!0,children:(0,u.jsx)(qt,{ref:ce,...T,onClick:U,disabled:v,role:`combobox`,"aria-expanded":k,"aria-haspopup":`listbox`,"aria-controls":k?re:void 0,"aria-describedby":`${V} ${ie}`,"aria-label":`Multi-seleção: ${D.length} opção(ões) selecionada(s) de ${me().length} opção(ões) disponíveis. ${i}`,className:q(`flex px-2.5 py-1 rounded-md border border-border min-h-9 h-auto items-center justify-between bg-default [&_svg]:pointer-events-auto`,`transition-[color,border-color,box-shadow] duration-150`,`hover:border-primary/40`,`focus-visible:border-primary focus-visible:shadow-[inset_0_0_0_1px_var(--color-primary)]`,`disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,h?`w-auto`:`w-full`,de.compactMode&&`min-h-8 text-sm`,le===`mobile`&&`min-h-12 text-base`,v&&`opacity-50 cursor-not-allowed`,d),style:{backgroundColor:`var(--color-default)`,...Se,maxWidth:`min(${Se.maxWidth}, 100%)`},children:D.length>0?(0,u.jsxs)(`div`,{className:`flex justify-between items-center w-full`,children:[(0,u.jsxs)(`div`,{className:q(`flex items-center`,g?`overflow-x-auto multiselect-singleline-scroll`:`flex-wrap`),style:g?{paddingBottom:`4px`}:{},children:[D.slice(0,de.maxCount).map(e=>{let t=he(e),r=t?.icon,i=t?.style;if(!t)return null;let s={animationDuration:`${a}s`,...i?.badgeColor&&{backgroundColor:i.badgeColor},...i?.gradient&&{background:i.gradient,color:`white`}};return(0,u.jsxs)(dt,{className:q(fe(),sv({variant:n}),i?.gradient&&`text-white border-transparent`,de.compactMode&&`text-xs px-1.5 py-0.5`,le===`mobile`&&`max-w-30 truncate`,g&&`shrink-0 whitespace-nowrap`,`[&>svg]:pointer-events-auto`,`items-center`),style:{...s,animationDuration:`${o?.duration||a}s`,animationDelay:`${o?.delay||0}s`},children:[r&&!de.hideIcons&&(0,u.jsx)(r,{className:q(`h-4 w-4 mr-2`,de.compactMode&&`h-3 w-3 mr-1`,i?.iconColor&&`text-current`),...i?.iconColor&&{style:{color:i.iconColor}}}),(0,u.jsx)(`span`,{className:q(le===`mobile`&&`truncate`),children:t.label}),(0,u.jsx)(`div`,{role:`button`,tabIndex:0,onClick:t=>{t.stopPropagation(),ve(e)},onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),t.stopPropagation(),ve(e))},"aria-label":`Remover ${t.label} da seleção`,className:`ml-px size-4 cursor-pointer hover:bg-white/20 rounded-full p-0.5 -m-0.5 focus:outline-none focus:ring-1 focus:ring-white/50`,children:(0,u.jsx)(Ot,{className:q(`size-3`,de.compactMode&&`size-2.5`)})})]},e)}).filter(Boolean),D.length>de.maxCount&&(0,u.jsxs)(dt,{className:q(`bg-transparent text-foreground border-foreground/1 hover:bg-transparent`,fe(),sv({variant:n}),de.compactMode&&`text-xs px-1.5 py-0.5`,g&&`shrink-0 whitespace-nowrap`,`[&>svg]:pointer-events-auto`),style:{animationDuration:`${o?.duration||a}s`,animationDelay:`${o?.delay||0}s`},children:[`+ ${D.length-de.maxCount}`,(0,u.jsx)(Ot,{className:q(`ml-px size-4 cursor-pointer`,de.compactMode&&`ml-px size-3`),onClick:e=>{e.stopPropagation(),be()}})]})]}),(0,u.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,u.jsx)(`div`,{role:`button`,tabIndex:0,onClick:e=>{e.stopPropagation(),ye()},onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),ye())},"aria-label":`Limpar todas as ${D.length} opção(ões) selecionada(s)`,className:`flex items-center justify-center h-4 w-4 mx-2 cursor-pointer text-muted hover:text-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-1 rounded-sm`,children:(0,u.jsx)(Ht,{className:`h-4 w-4`})}),(0,u.jsx)(P_,{orientation:`vertical`,className:`flex min-h-6 h-full`}),(0,u.jsx)(Ct,{className:`h-4 ml-1 cursor-pointer text-muted opacity-50`,"aria-hidden":`true`})]})]}):(0,u.jsxs)(`div`,{className:`flex items-center justify-between w-full mx-auto`,children:[(0,u.jsx)(`span`,{className:`text-sm text-muted`,children:i}),(0,u.jsx)(Ct,{className:`h-4 cursor-pointer text-muted`})]})})}),(0,u.jsx)(wm,{id:re,role:`listbox`,"aria-multiselectable":`true`,"aria-label":`Opções disponíveis`,className:q(`w-(--radix-popover-trigger-width) p-0`,pe(),le===`mobile`&&`w-[85vw] max-w-70`,le===`tablet`&&`w-[70vw] max-w-md`,_),style:{animationDuration:`${o?.duration||a}s`,animationDelay:`${o?.delay||0}s`,maxHeight:le===`mobile`?`70vh`:`60vh`,touchAction:`manipulation`},align:`start`,onEscapeKeyDown:()=>A(!1),children:(0,u.jsxs)(Wu,{children:[p&&(0,u.jsx)(Gu,{placeholder:`Pesquisar opções...`,onKeyDown:_e,value:N,onValueChange:P,"aria-label":`Pesquisar através das opções disponíveis`,"aria-describedby":`${ne}-search-help`}),p&&(0,u.jsx)(`div`,{id:`${ne}-search-help`,className:`sr-only`,children:`Digite para filtrar opções. Use as teclas de seta para navegar pelos resultados.`}),(0,u.jsxs)(Ku,{className:q(`max-h-[40vh] overflow-y-auto multiselect-scrollbar`,le===`mobile`&&`max-h-[50vh]`,`overscroll-behavior-y-contain`),children:[(0,u.jsx)(qu,{children:m||`Nenhum resultado encontrado.`}),` `,!f&&!N&&(0,u.jsx)(Ju,{children:(0,u.jsxs)(Xu,{onSelect:xe,role:`option`,"aria-selected":D.length===me().filter(e=>!e.disabled).length,"aria-label":`Selecionar todas as ${me().length} opção(ões)`,className:`cursor-pointer`,children:[(0,u.jsx)(`div`,{className:q(`mr-2 flex size-4 items-center justify-center rounded-sm border border-primary`,D.length===me().filter(e=>!e.disabled).length?`bg-primary text-foreground`:`opacity-50 [&_svg]:invisible`),"aria-hidden":`true`,children:(0,u.jsx)(St,{className:`size-3.5 text-white`})}),(0,u.jsxs)(`span`,{children:[`(Selecionar todas`,me().length>20?` - ${me().length} opção(ões)`:``,`)`]})]},`all`)}),oe(ge)?ge.map(e=>(0,u.jsx)(Ju,{heading:e.heading,children:e.options.map(e=>{let t=D.includes(e.value);return(0,u.jsxs)(Xu,{onSelect:()=>ve(e.value),role:`option`,"aria-selected":t,"aria-disabled":e.disabled,"aria-label":`${e.label}${t?`, selecionada`:`, não selecionada`}${e.disabled?`, disabled`:``}`,className:q(`cursor-pointer`,e.disabled&&`opacity-50 cursor-not-allowed`),disabled:e.disabled,children:[(0,u.jsx)(`div`,{className:q(`mr-2 flex size-4 items-center justify-center rounded-sm border border-primary`,t?`bg-primary text-foreground`:`opacity-50 [&_svg]:invisible`),"aria-hidden":`true`,children:(0,u.jsx)(St,{className:`size-3.5 text-white`})}),e.icon&&(0,u.jsx)(e.icon,{className:`mr-2 h-4 w-4 text-muted`,"aria-hidden":`true`}),(0,u.jsx)(`span`,{children:e.label})]},e.value)})},e.heading)):(0,u.jsx)(Ju,{children:ge.map(e=>{let t=D.includes(e.value);return(0,u.jsxs)(Xu,{onSelect:()=>ve(e.value),role:`option`,"aria-selected":t,"aria-disabled":e.disabled,"aria-label":`${e.label}${t?`, selecionada`:`, não selecionada`}${e.disabled?`, desabilitada`:``}`,className:q(`cursor-pointer`,e.disabled&&`opacity-50 cursor-not-allowed`),disabled:e.disabled,children:[(0,u.jsx)(`div`,{className:q(`mr-2 flex size-4 items-center justify-center rounded-sm border border-primary`,t?`bg-primary text-foreground`:`opacity-50 [&_svg]:invisible`),"aria-hidden":`true`,children:(0,u.jsx)(St,{className:`size-3.5 text-white`})}),e.icon&&(0,u.jsx)(e.icon,{className:`mr-2 h-4 w-4 text-muted`,"aria-hidden":`true`}),(0,u.jsx)(`span`,{children:e.label})]},e.value)})}),(0,u.jsx)(Yu,{}),(0,u.jsx)(Ju,{children:(0,u.jsxs)(`div`,{className:`flex items-center justify-between`,children:[D.length>0&&(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(Xu,{onSelect:ye,className:`flex-1 justify-center cursor-pointer`,children:`Limpar`}),(0,u.jsx)(P_,{orientation:`vertical`,className:`flex min-h-6 h-full`})]}),(0,u.jsx)(Xu,{onSelect:()=>A(!1),className:`flex-1 justify-center cursor-pointer max-w-full`,children:`Fechar`})]})})]})]})}),a>0&&D.length>0&&(0,u.jsx)(Vt,{className:q(`cursor-pointer my-2 text-foreground bg-background w-3 h-3`,j?``:`text-muted`),onClick:()=>M(!j)})]})]})});cv.displayName=`MultiSelect`;function lv({className:e,...t}){return(0,u.jsx)(`nav`,{role:`navigation`,"aria-label":`pagination`,"data-slot":`pagination`,className:q(`mx-auto flex w-full justify-center`,e),...t})}function uv({className:e,...t}){return(0,u.jsx)(`ul`,{"data-slot":`pagination-content`,className:q(`flex flex-row items-center gap-1`,e),...t})}function dv({...e}){return(0,u.jsx)(`li`,{"data-slot":`pagination-item`,...e})}function fv({className:e,isActive:t,size:n=`icon`,...r}){return(0,u.jsx)(`button`,{"aria-current":t?`page`:void 0,"data-slot":`pagination-link`,"data-active":t,className:q(Wt({variant:t?`outline`:`ghost`,size:n}),e),...r})}function pv({className:e,...t}){return(0,u.jsxs)(fv,{"aria-label":`Ir para a página anterior`,size:`default`,className:q(`gap-1 px-2.5 sm:pl-2.5`,e),...t,children:[(0,u.jsx)(wt,{}),(0,u.jsx)(`span`,{className:`hidden sm:block`,children:`Anterior`})]})}function mv({className:e,...t}){return(0,u.jsxs)(fv,{"aria-label":`Ir para a próxima página`,size:`default`,className:q(`gap-1 px-2.5 sm:pr-2.5`,e),...t,children:[(0,u.jsx)(`span`,{className:`hidden sm:block`,children:`Próxima`}),(0,u.jsx)(Tt,{})]})}function hv({className:e,...t}){return(0,u.jsxs)(`span`,{"aria-hidden":!0,"data-slot":`pagination-ellipsis`,className:q(`flex size-9 items-center justify-center`,e),...t,children:[(0,u.jsx)(kt,{className:`size-4`}),(0,u.jsx)(`span`,{className:`sr-only`,children:`More pages`})]})}function gv(e,[t,n]){return Math.min(n,Math.max(t,e))}function _v(e){let t=vv(e),n=l.forwardRef((e,n)=>{let{children:r,...i}=e,a=l.Children.toArray(r),o=a.find(bv);if(o){let e=o.props.children,r=a.map(t=>t===o?l.Children.count(e)>1?l.Children.only(null):l.isValidElement(e)?e.props.children:null:t);return(0,u.jsx)(t,{...i,ref:n,children:l.isValidElement(e)?l.cloneElement(e,void 0,r):null})}return(0,u.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function vv(e){let t=l.forwardRef((e,t)=>{let{children:n,...r}=e;if(l.isValidElement(n)){let e=Sv(n),i=xv(r,n.props);return n.type!==l.Fragment&&(i.ref=t?v(t,e):e),l.cloneElement(n,i)}return l.Children.count(n)>1?l.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var yv=Symbol(`radix.slottable`);function bv(e){return l.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===yv}function xv(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 Sv(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 Cv=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`}),wv=`VisuallyHidden`,Tv=l.forwardRef((e,t)=>(0,u.jsx)($.span,{...e,ref:t,style:{...Cv,...e.style}}));Tv.displayName=wv;var Ev=Tv,Dv=[` `,`Enter`,`ArrowUp`,`ArrowDown`],Ov=[` `,`Enter`],kv=`Select`,[Av,jv,Mv]=Mm(kv),[Nv,Pv]=_o(kv,[Mv,bp]),Fv=bp(),[Iv,Lv]=Nv(kv),[Rv,zv]=Nv(kv),Bv=e=>{let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:d,name:f,autoComplete:p,disabled:m,required:h,form:g}=e,_=Fv(t),[v,y]=l.useState(null),[b,x]=l.useState(null),[S,C]=l.useState(!1),w=Pm(d),[T,E]=xo({prop:r,defaultProp:i??!1,onChange:a,caller:kv}),[D,O]=xo({prop:o,defaultProp:s,onChange:c,caller:kv}),k=l.useRef(null),A=v?g||!!v.closest(`form`):!0,[j,M]=l.useState(new Set),N=Array.from(j).map(e=>e.props.value).join(`;`);return(0,u.jsx)(Ip,{..._,children:(0,u.jsxs)(Iv,{required:h,scope:t,trigger:v,onTriggerChange:y,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:vs(),value:D,onValueChange:O,open:T,onOpenChange:E,dir:w,triggerPointerDownPosRef:k,disabled:m,children:[(0,u.jsx)(Av.Provider,{scope:t,children:(0,u.jsx)(Rv,{scope:e.__scopeSelect,onNativeOptionAdd:l.useCallback(e=>{M(t=>new Set(t).add(e))},[]),onNativeOptionRemove:l.useCallback(e=>{M(t=>{let n=new Set(t);return n.delete(e),n})},[]),children:n})}),A?(0,u.jsxs)(Fy,{"aria-hidden":!0,required:h,tabIndex:-1,name:f,autoComplete:p,value:D,onChange:e=>O(e.target.value),disabled:m,form:g,children:[D===void 0?(0,u.jsx)(`option`,{value:``}):null,Array.from(j)]},N):null]})})};Bv.displayName=kv;var Vv=`SelectTrigger`,Hv=l.forwardRef((e,t)=>{let{__scopeSelect:n,disabled:r=!1,...i}=e,a=Fv(n),o=Lv(Vv,n),s=o.disabled||r,c=y(t,o.onTriggerChange),d=jv(n),f=l.useRef(`touch`),[p,m,h]=Ly(e=>{let t=d().filter(e=>!e.disabled),n=Ry(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),g=e=>{s||(o.onOpenChange(!0),h()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return(0,u.jsx)(Lp,{asChild:!0,...a,children:(0,u.jsx)($.button,{type:`button`,role:`combobox`,"aria-controls":o.contentId,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":Iy(o.value)?``:void 0,...i,ref:c,onClick:Q(i.onClick,e=>{e.currentTarget.focus(),f.current!==`mouse`&&g(e)}),onPointerDown:Q(i.onPointerDown,e=>{f.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(g(e),e.preventDefault())}),onKeyDown:Q(i.onKeyDown,e=>{let t=p.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&m(e.key),!(t&&e.key===` `)&&Dv.includes(e.key)&&(g(),e.preventDefault())})})})});Hv.displayName=Vv;var Uv=`SelectValue`,Wv=l.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=Lv(Uv,n),{onValueNodeHasChildrenChange:l}=c,d=a!==void 0,f=y(t,c.onValueNodeChange);return yo(()=>{l(d)},[l,d]),(0,u.jsx)($.span,{...s,ref:f,style:{pointerEvents:`none`},children:Iy(c.value)?(0,u.jsx)(u.Fragment,{children:o}):a})});Wv.displayName=Uv;var Gv=`SelectIcon`,Kv=l.forwardRef((e,t)=>{let{__scopeSelect:n,children:r,...i}=e;return(0,u.jsx)($.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})});Kv.displayName=Gv;var qv=`SelectPortal`,Jv=e=>(0,u.jsx)(Zs,{asChild:!0,...e});Jv.displayName=qv;var Yv=`SelectContent`,Xv=l.forwardRef((e,t)=>{let n=Lv(Yv,e.__scopeSelect),[r,i]=l.useState();if(yo(()=>{i(new DocumentFragment)},[]),!n.open){let t=r;return t?d.createPortal((0,u.jsx)(Qv,{scope:e.__scopeSelect,children:(0,u.jsx)(Av.Slot,{scope:e.__scopeSelect,children:(0,u.jsx)(`div`,{children:e.children})})}),t):null}return(0,u.jsx)(ny,{...e,ref:t})});Xv.displayName=Yv;var Zv=10,[Qv,$v]=Nv(Yv),ey=`SelectContentImpl`,ty=_v(`SelectContent.RemoveScroll`),ny=l.forwardRef((e,t)=>{let{__scopeSelect:n,position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:g,hideWhenDetached:_,avoidCollisions:v,...b}=e,x=Lv(Yv,n),[S,C]=l.useState(null),[w,T]=l.useState(null),E=y(t,e=>C(e)),[D,O]=l.useState(null),[k,A]=l.useState(null),j=jv(n),[M,N]=l.useState(!1),P=l.useRef(!1);l.useEffect(()=>{if(S)return vl(S)},[S]),$s();let F=l.useCallback(e=>{let[t,...n]=j().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&w&&(w.scrollTop=0),n===r&&w&&(w.scrollTop=w.scrollHeight),n?.focus(),document.activeElement!==i))return},[j,w]),I=l.useCallback(()=>F([D,S]),[F,D,S]);l.useEffect(()=>{M&&I()},[M,I]);let{onOpenChange:L,triggerPointerDownPosRef:R}=x;l.useEffect(()=>{if(S){let e={x:0,y:0},t=t=>{e={x:Math.abs(Math.round(t.pageX)-(R.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(R.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():S.contains(n.target)||L(!1),document.removeEventListener(`pointermove`,t),R.current=null};return R.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[S,L,R]),l.useEffect(()=>{let e=()=>L(!1);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[L]);let[ee,te]=Ly(e=>{let t=j().filter(e=>!e.disabled),n=Ry(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current.focus())}),z=l.useCallback((e,t,n)=>{let r=!P.current&&!n;(x.value!==void 0&&x.value===t||r)&&(O(e),r&&(P.current=!0))},[x.value]),B=l.useCallback(()=>S?.focus(),[S]),ne=l.useCallback((e,t,n)=>{let r=!P.current&&!n;(x.value!==void 0&&x.value===t||r)&&A(e)},[x.value]),re=r===`popper`?oy:iy,V=re===oy?{side:s,sideOffset:c,align:d,alignOffset:f,arrowPadding:p,collisionBoundary:m,collisionPadding:h,sticky:g,hideWhenDetached:_,avoidCollisions:v}:{};return(0,u.jsx)(Qv,{scope:n,content:S,viewport:w,onViewportChange:T,itemRefCallback:z,selectedItem:D,onItemLeave:B,itemTextRefCallback:ne,focusSelectedItem:I,selectedItemText:k,position:r,isPositioned:M,searchRef:ee,children:(0,u.jsx)(ll,{as:ty,allowPinchZoom:!0,children:(0,u.jsx)(Rs,{asChild:!0,trapped:x.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Q(i,e=>{x.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,u.jsx)(Ds,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:(0,u.jsx)(re,{role:`listbox`,id:x.contentId,"data-state":x.open?`open`:`closed`,dir:x.dir,onContextMenu:e=>e.preventDefault(),...b,...V,onPlaced:()=>N(!0),ref:E,style:{display:`flex`,flexDirection:`column`,outline:`none`,...b.style},onKeyDown:Q(b.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&te(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=j().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>F(t)),e.preventDefault()}})})})})})})});ny.displayName=ey;var ry=`SelectItemAlignedPosition`,iy=l.forwardRef((e,t)=>{let{__scopeSelect:n,onPlaced:r,...i}=e,a=Lv(Yv,n),o=$v(Yv,n),[s,c]=l.useState(null),[d,f]=l.useState(null),p=y(t,e=>f(e)),m=jv(n),h=l.useRef(!1),g=l.useRef(!0),{viewport:_,selectedItem:v,selectedItemText:b,focusSelectedItem:x}=o,S=l.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&d&&_&&v&&b){let e=a.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=b.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-Zv,d=gv(a,[Zv,Math.max(Zv,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-Zv,d=gv(a,[Zv,Math.max(Zv,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=m(),c=window.innerHeight-Zv*2,l=_.scrollHeight,u=window.getComputedStyle(d),f=parseInt(u.borderTopWidth,10),p=parseInt(u.paddingTop,10),g=parseInt(u.borderBottomWidth,10),y=parseInt(u.paddingBottom,10),x=f+p+l+y+g,S=Math.min(v.offsetHeight*5,x),C=window.getComputedStyle(_),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-Zv,D=c-E,O=v.offsetHeight/2,k=v.offsetTop+O,A=f+p+k,j=x-A;if(A<=E){let e=o.length>0&&v===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=d.clientHeight-_.offsetTop-_.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+g);s.style.height=n+`px`}else{let e=o.length>0&&v===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,f+_.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,_.scrollTop=A-E+_.offsetTop}s.style.margin=`${Zv}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>h.current=!0)}},[m,a.trigger,a.valueNode,s,d,_,v,b,a.dir,r]);yo(()=>S(),[S]);let[C,w]=l.useState();return yo(()=>{d&&w(window.getComputedStyle(d).zIndex)},[d]),(0,u.jsx)(sy,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:h,onScrollButtonChange:l.useCallback(e=>{e&&g.current===!0&&(S(),x?.(),g.current=!1)},[S,x]),children:(0,u.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:C},children:(0,u.jsx)($.div,{...i,ref:p,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})});iy.displayName=ry;var ay=`SelectPopperPosition`,oy=l.forwardRef((e,t)=>{let{__scopeSelect:n,align:r=`start`,collisionPadding:i=Zv,...a}=e,o=Fv(n);return(0,u.jsx)(Rp,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})});oy.displayName=ay;var[sy,cy]=Nv(Yv,{}),ly=`SelectViewport`,uy=l.forwardRef((e,t)=>{let{__scopeSelect:n,nonce:r,...i}=e,a=$v(ly,n),o=cy(ly,n),s=y(t,a.onViewportChange),c=l.useRef(0);return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,u.jsx)(Av.Slot,{scope:n,children:(0,u.jsx)($.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:Q(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-Zv*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})});uy.displayName=ly;var dy=`SelectGroup`,[fy,py]=Nv(dy),my=l.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=vs();return(0,u.jsx)(fy,{scope:n,id:i,children:(0,u.jsx)($.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})});my.displayName=dy;var hy=`SelectLabel`,gy=l.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=py(hy,n);return(0,u.jsx)($.div,{id:i.id,...r,ref:t})});gy.displayName=hy;var _y=`SelectItem`,[vy,yy]=Nv(_y),by=l.forwardRef((e,t)=>{let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=Lv(_y,n),c=$v(_y,n),d=s.value===r,[f,p]=l.useState(a??``),[m,h]=l.useState(!1),g=y(t,e=>c.itemRefCallback?.(e,r,i)),_=vs(),v=l.useRef(`touch`),b=()=>{i||(s.onValueChange(r),s.onOpenChange(!1))};if(r===``)throw Error(`A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.`);return(0,u.jsx)(vy,{scope:n,value:r,disabled:i,textId:_,isSelected:d,onItemTextChange:l.useCallback(e=>{p(t=>t||(e?.textContent??``).trim())},[]),children:(0,u.jsx)(Av.ItemSlot,{scope:n,value:r,disabled:i,textValue:f,children:(0,u.jsx)($.div,{role:`option`,"aria-labelledby":_,"data-highlighted":m?``:void 0,"aria-selected":d&&m,"data-state":d?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:g,onFocus:Q(o.onFocus,()=>h(!0)),onBlur:Q(o.onBlur,()=>h(!1)),onClick:Q(o.onClick,()=>{v.current!==`mouse`&&b()}),onPointerUp:Q(o.onPointerUp,()=>{v.current===`mouse`&&b()}),onPointerDown:Q(o.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:Q(o.onPointerMove,e=>{v.current=e.pointerType,i?c.onItemLeave?.():v.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Q(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:Q(o.onKeyDown,e=>{c.searchRef?.current!==``&&e.key===` `||(Ov.includes(e.key)&&b(),e.key===` `&&e.preventDefault())})})})})});by.displayName=_y;var xy=`SelectItemText`,Sy=l.forwardRef((e,t)=>{let{__scopeSelect:n,className:r,style:i,...a}=e,o=Lv(xy,n),s=$v(xy,n),c=yy(xy,n),f=zv(xy,n),[p,m]=l.useState(null),h=y(t,e=>m(e),c.onItemTextChange,e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),g=p?.textContent,_=l.useMemo(()=>(0,u.jsx)(`option`,{value:c.value,disabled:c.disabled,children:g},c.value),[c.disabled,c.value,g]),{onNativeOptionAdd:v,onNativeOptionRemove:b}=f;return yo(()=>(v(_),()=>b(_)),[v,b,_]),(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)($.span,{id:c.textId,...a,ref:h}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren?d.createPortal(a.children,o.valueNode):null]})});Sy.displayName=xy;var Cy=`SelectItemIndicator`,wy=l.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return yy(Cy,n).isSelected?(0,u.jsx)($.span,{"aria-hidden":!0,...r,ref:t}):null});wy.displayName=Cy;var Ty=`SelectScrollUpButton`,Ey=l.forwardRef((e,t)=>{let n=$v(Ty,e.__scopeSelect),r=cy(Ty,e.__scopeSelect),[i,a]=l.useState(!1),o=y(t,r.onScrollButtonChange);return yo(()=>{if(n.viewport&&n.isPositioned){let e=function(){a(t.scrollTop>0)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,u.jsx)(ky,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null});Ey.displayName=Ty;var Dy=`SelectScrollDownButton`,Oy=l.forwardRef((e,t)=>{let n=$v(Dy,e.__scopeSelect),r=cy(Dy,e.__scopeSelect),[i,a]=l.useState(!1),o=y(t,r.onScrollButtonChange);return yo(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;a(Math.ceil(t.scrollTop)<e)},t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,u.jsx)(ky,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null});Oy.displayName=Dy;var ky=l.forwardRef((e,t)=>{let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=$v(`SelectScrollButton`,n),o=l.useRef(null),s=jv(n),c=l.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return l.useEffect(()=>()=>c(),[c]),yo(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,u.jsx)($.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:Q(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:Q(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:Q(i.onPointerLeave,()=>{c()})})}),Ay=`SelectSeparator`,jy=l.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e;return(0,u.jsx)($.div,{"aria-hidden":!0,...r,ref:t})});jy.displayName=Ay;var My=`SelectArrow`,Ny=l.forwardRef((e,t)=>{let{__scopeSelect:n,...r}=e,i=Fv(n),a=Lv(My,n),o=$v(My,n);return a.open&&o.position===`popper`?(0,u.jsx)(zp,{...i,...r,ref:t}):null});Ny.displayName=My;var Py=`SelectBubbleInput`,Fy=l.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{let i=l.useRef(null),a=y(r,i),o=wo(t);return l.useEffect(()=>{let e=i.current;if(!e)return;let n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,`value`).set;if(o!==t&&r){let n=new Event(`change`,{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[o,t]),(0,u.jsx)($.select,{...n,style:{...Cv,...n.style},ref:a,defaultValue:t})});Fy.displayName=Py;function Iy(e){return e===``||e===void 0}function Ly(e){let t=ys(e),n=l.useRef(``),r=l.useRef(0),i=l.useCallback(e=>{let i=n.current+e;t(i),(function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))})(i)},[t]),a=l.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return l.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}function Ry(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=zy(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function zy(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var By=Bv,Vy=Hv,Hy=Wv,Uy=Kv,Wy=Jv,Gy=Xv,Ky=uy,qy=my,Jy=by,Yy=Sy,Xy=wy,Zy=Ey,Qy=Oy;function $y({...e}){return(0,u.jsx)(By,{"data-slot":`select`,...e})}function eb({...e}){return(0,u.jsx)(qy,{"data-slot":`select-group`,...e})}function tb({...e}){return(0,u.jsx)(Hy,{"data-slot":`select-value`,...e})}function nb({className:e,size:t=`default`,children:n,loading:r,disabled:i,...a}){let o=i||r;return(0,u.jsxs)(Vy,{"data-slot":`select-trigger`,"data-size":t,disabled:o,style:{backgroundColor:`var(--color-default)`},className:q(`text-sm border border-border bg-default data-placeholder:text-muted [&_svg:not([class*='text-'])]:text-muted h-9 w-full min-w-0 rounded-md px-2.5 py-1 outline-none whitespace-nowrap`,`transition-[color,border-color,box-shadow] duration-150`,`hover:border-primary/40`,`focus-visible:border-primary focus-visible:shadow-[inset_0_0_0_1px_var(--color-primary)]`,`disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50`,`aria-invalid:border-destructive aria-invalid:shadow-[inset_0_0_0_1px_var(--color-destructive)]`,`flex items-center justify-between gap-2`,`*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...a,children:[n,(0,u.jsx)(Uy,{asChild:!0,children:r?(0,u.jsx)(Ut,{className:`size-4 opacity-50`}):(0,u.jsx)(Ct,{className:`size-4 opacity-50`})})]})}function rb({className:e,...t}){return(0,u.jsx)(Zy,{"data-slot":`select-scroll-up-button`,className:q(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,u.jsx)(Et,{className:`size-4`})})}function ib({className:e,...t}){return(0,u.jsx)(Qy,{"data-slot":`select-scroll-down-button`,className:q(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,u.jsx)(Ct,{className:`size-4`})})}function ab({className:e,children:t,position:n=`item-aligned`,align:r=`center`,...i}){return(0,u.jsx)(Wy,{children:(0,u.jsxs)(Gy,{"data-slot":`select-content`,className:q(`bg-input data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-32 origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,align:r,onCloseAutoFocus:e=>{e.preventDefault()},...i,children:[(0,u.jsx)(rb,{}),(0,u.jsx)(Ky,{className:q(`p-1`,n===`popper`&&`h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width) scroll-my-1`),children:t}),(0,u.jsx)(ib,{})]})})}function ob({className:e,children:t,...n}){return(0,u.jsxs)(Jy,{"data-slot":`select-item`,className:q(`focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none`,`transition-colors duration-100`,`data-disabled:pointer-events-none data-disabled:opacity-50`,`[&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2`,e),...n,children:[(0,u.jsx)(`span`,{"data-slot":`select-item-indicator`,className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,u.jsx)(Xy,{children:(0,u.jsx)(St,{className:`size-4`})})}),(0,u.jsx)(Yy,{children:t})]})}function sb(e,t){if(t<=7)return Array.from({length:t},(e,t)=>t+1);let n=[];if(e<=3){for(let e=1;e<=4;e++)n.push(e);n.push(`ellipsis`),n.push(t)}else if(e>=t-2){n.push(1),n.push(`ellipsis`);for(let e=t-3;e<=t;e++)n.push(e)}else n.push(1),n.push(`ellipsis`),n.push(e-1),n.push(e),n.push(e+1),n.push(`ellipsis`),n.push(t);return n}function cb({currentPage:e,totalPages:t,pageSize:n,totalItems:r,onPageChange:i,onPageSizeChange:a}){let o=r===0?0:(e-1)*n+1,s=Math.min(e*n,r),c=(0,l.useMemo)(()=>sb(e,t),[e,t]),d=(n,r)=>{r.preventDefault(),n>=1&&n<=t&&n!==e&&i(n)};return t===0?null:(0,u.jsxs)(`div`,{className:`w-full flex flex-col md:flex-row items-center justify-between gap-4 px-2 py-4 bg-background`,children:[(0,u.jsxs)(`div`,{className:`w-fit flex flex-row items-center gap-2`,children:[(0,u.jsx)(td,{htmlFor:`select-rows-per-page`,children:`Itens por página`}),(0,u.jsxs)($y,{value:n.toString(),onValueChange:e=>{a(parseInt(e,10))},children:[(0,u.jsx)(nb,{className:`w-20`,id:`select-rows-per-page`,children:(0,u.jsx)(tb,{})}),(0,u.jsx)(ab,{align:`start`,children:(0,u.jsxs)(eb,{children:[(0,u.jsx)(ob,{value:`5`,children:`5`}),(0,u.jsx)(ob,{value:`10`,children:`10`}),(0,u.jsx)(ob,{value:`25`,children:`25`}),(0,u.jsx)(ob,{value:`50`,children:`50`})]})})]})]}),(0,u.jsxs)(`span`,{className:`text-nowrap text-neutrals-800 text-sm font-medium`,children:[o,` - `,s,` de `,r]}),(0,u.jsx)(lv,{className:`mx-0 w-auto`,children:(0,u.jsxs)(uv,{children:[(0,u.jsx)(dv,{children:(0,u.jsx)(pv,{onClick:t=>{t.preventDefault(),e>1&&i(e-1)},className:e===1?`pointer-events-none opacity-50`:`cursor-pointer`})}),c.map((t,n)=>t===`ellipsis`?(0,u.jsx)(dv,{children:(0,u.jsx)(hv,{})},`ellipsis-${n}`):(0,u.jsx)(dv,{children:(0,u.jsx)(fv,{isActive:t===e,onClick:e=>d(t,e),className:`cursor-pointer`,children:t})},t)),(0,u.jsx)(dv,{children:(0,u.jsx)(mv,{onClick:n=>{n.preventDefault(),e<t&&i(e+1)},className:e===t?`pointer-events-none opacity-50`:`cursor-pointer`})})]})})]})}function lb({show:e,onToggle:t}){return(0,u.jsx)(qt,{type:`button`,variant:`ghost`,size:`icon-sm`,className:`absolute right-2 top-1/2 -translate-y-1/2 size-6 text-muted hover:text-foreground`,onClick:t,"aria-label":e?`Ocultar senha`:`Exibir senha`,children:e?(0,u.jsx)(At,{className:`size-4`}):(0,u.jsx)(jt,{className:`size-4`})})}var ub=`Radio`,[db,fb]=_o(ub),[pb,mb]=db(ub),hb=l.forwardRef((e,t)=>{let{__scopeRadio:n,name:r,checked:i=!1,required:a,disabled:o,value:s=`on`,onCheck:c,form:d,...f}=e,[p,m]=l.useState(null),h=y(t,e=>m(e)),g=l.useRef(!1),_=p?d||!!p.closest(`form`):!0;return(0,u.jsxs)(pb,{scope:n,checked:i,disabled:o,children:[(0,u.jsx)($.button,{type:`button`,role:`radio`,"aria-checked":i,"data-state":bb(i),"data-disabled":o?``:void 0,disabled:o,value:s,...f,ref:h,onClick:Q(e.onClick,e=>{i||c?.(),_&&(g.current=e.isPropagationStopped(),g.current||e.stopPropagation())})}),_&&(0,u.jsx)(yb,{control:p,bubbles:!g.current,name:r,value:s,checked:i,required:a,disabled:o,form:d,style:{transform:`translateX(-100%)`}})]})});hb.displayName=ub;var gb=`RadioIndicator`,_b=l.forwardRef((e,t)=>{let{__scopeRadio:n,forceMount:r,...i}=e,a=mb(gb,n);return(0,u.jsx)(Do,{present:r||a.checked,children:(0,u.jsx)($.span,{"data-state":bb(a.checked),"data-disabled":a.disabled?``:void 0,...i,ref:t})})});_b.displayName=gb;var vb=`RadioBubbleInput`,yb=l.forwardRef(({__scopeRadio:e,control:t,checked:n,bubbles:r=!0,...i},a)=>{let o=l.useRef(null),s=y(o,a),c=wo(n),d=To(t);return l.useEffect(()=>{let e=o.current;if(!e)return;let t=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(t,`checked`).set;if(c!==n&&i){let t=new Event(`click`,{bubbles:r});i.call(e,n),e.dispatchEvent(t)}},[c,n,r]),(0,u.jsx)($.input,{type:`radio`,"aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...i.style,...d,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0}})});yb.displayName=vb;function bb(e){return e?`checked`:`unchecked`}var xb=[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`],Sb=`RadioGroup`,[Cb,wb]=_o(Sb,[Hm,fb]),Tb=Hm(),Eb=fb(),[Db,Ob]=Cb(Sb),kb=l.forwardRef((e,t)=>{let{__scopeRadioGroup:n,name:r,defaultValue:i,value:a,required:o=!1,disabled:s=!1,orientation:c,dir:l,loop:d=!0,onValueChange:f,...p}=e,m=Tb(n),h=Pm(l),[g,_]=xo({prop:a,defaultProp:i??null,onChange:f,caller:Sb});return(0,u.jsx)(Db,{scope:n,name:r,required:o,disabled:s,value:g,onValueChange:_,children:(0,u.jsx)(eh,{asChild:!0,...m,orientation:c,dir:h,loop:d,children:(0,u.jsx)($.div,{role:`radiogroup`,"aria-required":o,"aria-orientation":c,"data-disabled":s?``:void 0,dir:h,...p,ref:t})})})});kb.displayName=Sb;var Ab=`RadioGroupItem`,jb=l.forwardRef((e,t)=>{let{__scopeRadioGroup:n,disabled:r,...i}=e,a=Ob(Ab,n),o=a.disabled||r,s=Tb(n),c=Eb(n),d=l.useRef(null),f=y(t,d),p=a.value===i.value,m=l.useRef(!1);return l.useEffect(()=>{let e=e=>{xb.includes(e.key)&&(m.current=!0)},t=()=>m.current=!1;return document.addEventListener(`keydown`,e),document.addEventListener(`keyup`,t),()=>{document.removeEventListener(`keydown`,e),document.removeEventListener(`keyup`,t)}},[]),(0,u.jsx)(th,{asChild:!0,...s,focusable:!o,active:p,children:(0,u.jsx)(hb,{disabled:o,required:a.required,checked:p,...c,...i,name:a.name,ref:f,onCheck:()=>a.onValueChange(i.value),onKeyDown:Q(e=>{e.key===`Enter`&&e.preventDefault()}),onFocus:Q(i.onFocus,()=>{m.current&&d.current?.click()})})})});jb.displayName=Ab;var Mb=`RadioGroupIndicator`,Nb=l.forwardRef((e,t)=>{let{__scopeRadioGroup:n,...r}=e;return(0,u.jsx)(_b,{...Eb(n),...r,ref:t})});Nb.displayName=Mb;var Pb=kb;function Fb({className:e,...t}){return(0,u.jsx)(Pb,{"data-slot":`radio-group`,className:q(`grid gap-3`,e),...t})}function Ib({className:e,...t}){return(0,u.jsx)(`button`,{type:`button`,className:q(`relative size-8 rounded-full bg-default shadow-sm`,`flex items-center justify-center`,`cursor-pointer select-none`,`transition-[opacity,transform,box-shadow] duration-150`,`hover:opacity-90 hover:shadow-md`,`active:scale-[0.96]`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/50 focus-visible:ring-offset-2`,`disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 disabled:active:scale-100`,e),...t})}function Lb({className:e,...t}){return(0,u.jsx)(`div`,{"data-slot":`skeleton`,className:q(`bg-muted/20 animate-pulse rounded-md`,e),...t})}var Rb=(e,t,n,r,i,a,o,s)=>{let c=document.documentElement,l=[`light`,`dark`];function u(t){(Array.isArray(e)?e:[e]).forEach(e=>{let n=e===`class`,r=n&&a?i.map(e=>a[e]||e):i;n?(c.classList.remove(...r),c.classList.add(a&&a[t]?a[t]:t)):c.setAttribute(e,t)}),d(t)}function d(e){s&&l.includes(e)&&(c.style.colorScheme=e)}function f(){return window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}if(r)u(r);else try{let e=localStorage.getItem(t)||n;u(o&&e===`system`?f():e)}catch{}},zb=l.createContext(void 0),Bb={setTheme:e=>{},themes:[]},Vb=()=>l.useContext(zb)??Bb;l.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:r,enableColorScheme:i,defaultTheme:a,value:o,themes:s,nonce:c,scriptProps:u})=>{let d=JSON.stringify([n,t,a,e,s,o,r,i]).slice(1,-1);return l.createElement(`script`,{...u,suppressHydrationWarning:!0,nonce:typeof window>`u`?c:``,dangerouslySetInnerHTML:{__html:`(${Rb.toString()})(${d})`}})});function Hb(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var Ub=e=>{switch(e){case`success`:return Kb;case`info`:return Jb;case`warning`:return qb;case`error`:return Yb;default:return null}},Wb=Array(12).fill(0),Gb=({visible:e,className:t})=>l.default.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},l.default.createElement(`div`,{className:`sonner-spinner`},Wb.map((e,t)=>l.default.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),Kb=l.default.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},l.default.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),qb=l.default.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`},l.default.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),Jb=l.default.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},l.default.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),Yb=l.default.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},l.default.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),Xb=l.default.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},l.default.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),l.default.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),Zb=()=>{let[e,t]=l.default.useState(document.hidden);return l.default.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>window.removeEventListener(`visibilitychange`,e)},[]),e},Qb=1,$b=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id?.length>0?e.id:Qb++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,a,o=r.then(async e=>{if(a=[`resolve`,e],l.default.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(tx(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,a=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,o=typeof r==`object`&&!l.default.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!l.default.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!l.default.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:a,...o})}}).catch(async e=>{if(a=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,a=typeof t.description==`function`?await t.description(e):t.description,o=typeof r==`object`&&!l.default.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:a,...o})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),s=()=>new Promise((e,t)=>o.then(()=>a[0]===`reject`?t(a[1]):e(a[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:s}:Object.assign(n,{unwrap:s})},this.custom=(e,t)=>{let n=t?.id||Qb++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},ex=(e,t)=>{let n=t?.id||Qb++;return $b.addToast({title:e,...t,id:n}),n},tx=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`;Object.assign(ex,{success:$b.success,info:$b.info,warning:$b.warning,error:$b.error,custom:$b.custom,message:$b.message,promise:$b.promise,dismiss:$b.dismiss,loading:$b.loading},{getHistory:()=>$b.toasts,getToasts:()=>$b.getActiveToasts()}),Hb(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function nx(e){return e.label!==void 0}var rx=3,ix=`24px`,ax=`16px`,ox=4e3,sx=356,cx=14,lx=45,ux=200;function dx(...e){return e.filter(Boolean).join(` `)}function fx(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var px=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:a,visibleToasts:o,heights:s,index:c,toasts:u,expanded:d,removeToast:f,defaultRichColors:p,closeButton:m,style:h,cancelButtonStyle:g,actionButtonStyle:_,className:v=``,descriptionClassName:y=``,duration:b,position:x,gap:S,expandByDefault:C,classNames:w,icons:T,closeButtonAriaLabel:E=`Close toast`}=e,[D,O]=l.default.useState(null),[k,A]=l.default.useState(null),[j,M]=l.default.useState(!1),[N,P]=l.default.useState(!1),[F,I]=l.default.useState(!1),[L,R]=l.default.useState(!1),[ee,te]=l.default.useState(!1),[z,B]=l.default.useState(0),[ne,re]=l.default.useState(0),V=l.default.useRef(n.duration||b||ox),ie=l.default.useRef(null),ae=l.default.useRef(null),oe=c===0,se=c+1<=o,H=n.type,ce=n.dismissible!==!1,le=n.className||``,ue=n.descriptionClassName||``,de=l.default.useMemo(()=>s.findIndex(e=>e.toastId===n.id)||0,[s,n.id]),fe=l.default.useMemo(()=>n.closeButton??m,[n.closeButton,m]),pe=l.default.useMemo(()=>n.duration||b||ox,[n.duration,b]),me=l.default.useRef(0),he=l.default.useRef(0),ge=l.default.useRef(0),_e=l.default.useRef(null),[ve,ye]=x.split(`-`),U=l.default.useMemo(()=>s.reduce((e,t,n)=>n>=de?e:e+t.height,0),[s,de]),be=Zb(),xe=n.invert||t,Se=H===`loading`;he.current=l.default.useMemo(()=>de*S+U,[de,U]),l.default.useEffect(()=>{V.current=pe},[pe]),l.default.useEffect(()=>{M(!0)},[]),l.default.useEffect(()=>{let e=ae.current;if(e){let t=e.getBoundingClientRect().height;return re(t),a(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>a(e=>e.filter(e=>e.toastId!==n.id))}},[a,n.id]),l.default.useLayoutEffect(()=>{if(!j)return;let e=ae.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,re(r),a(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[j,n.title,n.description,a,n.id,n.jsx,n.action,n.cancel]);let Ce=l.default.useCallback(()=>{P(!0),B(he.current),a(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{f(n)},ux)},[n,f,a,he]);l.default.useEffect(()=>{if(n.promise&&H===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return d||i||be?(()=>{if(ge.current<me.current){let e=new Date().getTime()-me.current;V.current-=e}ge.current=new Date().getTime()})():V.current!==1/0&&(me.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),Ce()},V.current)),()=>clearTimeout(e)},[d,i,n,H,be,Ce]),l.default.useEffect(()=>{n.delete&&(Ce(),n.onDismiss==null||n.onDismiss.call(n,n))},[Ce,n.delete]);function we(){return T?.loading?l.default.createElement(`div`,{className:dx(w?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":H===`loading`},T.loading):l.default.createElement(Gb,{className:dx(w?.loader,n?.classNames?.loader),visible:H===`loading`})}let Te=n.icon||T?.[H]||Ub(H);return l.default.createElement(`li`,{tabIndex:0,ref:ae,className:dx(v,le,w?.toast,n?.classNames?.toast,w?.default,w?.[H],n?.classNames?.[H]),"data-sonner-toast":``,"data-rich-colors":n.richColors??p,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":j,"data-promise":!!n.promise,"data-swiped":ee,"data-removed":N,"data-visible":se,"data-y-position":ve,"data-x-position":ye,"data-index":c,"data-front":oe,"data-swiping":F,"data-dismissible":ce,"data-type":H,"data-invert":xe,"data-swipe-out":L,"data-swipe-direction":k,"data-expanded":!!(d||C&&j),"data-testid":n.testId,style:{"--index":c,"--toasts-before":c,"--z-index":u.length-c,"--offset":`${N?z:he.current}px`,"--initial-height":C?`auto`:`${ne}px`,...h,...n.style},onDragEnd:()=>{I(!1),O(null),_e.current=null},onPointerDown:e=>{e.button!==2&&(Se||!ce||(ie.current=new Date,B(he.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(I(!0),_e.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(L||!ce)return;_e.current=null;let e=Number(ae.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(ae.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-ie.current?.getTime(),i=D===`x`?e:t,a=Math.abs(i)/r;if(Math.abs(i)>=lx||a>.11){B(he.current),n.onDismiss==null||n.onDismiss.call(n,n),A(D===`x`?e>0?`right`:`left`:t>0?`down`:`up`),Ce(),R(!0);return}else{var o,s;(o=ae.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=ae.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`)}te(!1),I(!1),O(null)},onPointerMove:t=>{var n,r;if(!_e.current||!ce||window.getSelection()?.toString().length>0)return;let i=t.clientY-_e.current.y,a=t.clientX-_e.current.x,o=e.swipeDirections??fx(x);!D&&(Math.abs(a)>1||Math.abs(i)>1)&&O(Math.abs(a)>Math.abs(i)?`x`:`y`);let s={x:0,y:0},c=e=>1/(1.5+Math.abs(e)/20);if(D===`y`){if(o.includes(`top`)||o.includes(`bottom`))if(o.includes(`top`)&&i<0||o.includes(`bottom`)&&i>0)s.y=i;else{let e=i*c(i);s.y=Math.abs(e)<Math.abs(i)?e:i}}else if(D===`x`&&(o.includes(`left`)||o.includes(`right`)))if(o.includes(`left`)&&a<0||o.includes(`right`)&&a>0)s.x=a;else{let e=a*c(a);s.x=Math.abs(e)<Math.abs(a)?e:a}(Math.abs(s.x)>0||Math.abs(s.y)>0)&&te(!0),(n=ae.current)==null||n.style.setProperty(`--swipe-amount-x`,`${s.x}px`),(r=ae.current)==null||r.style.setProperty(`--swipe-amount-y`,`${s.y}px`)}},fe&&!n.jsx&&H!==`loading`?l.default.createElement(`button`,{"aria-label":E,"data-disabled":Se,"data-close-button":!0,onClick:Se||!ce?()=>{}:()=>{Ce(),n.onDismiss==null||n.onDismiss.call(n,n)},className:dx(w?.closeButton,n?.classNames?.closeButton)},T?.close??Xb):null,(H||n.icon||n.promise)&&n.icon!==null&&(T?.[H]!==null||n.icon)?l.default.createElement(`div`,{"data-icon":``,className:dx(w?.icon,n?.classNames?.icon)},n.promise||n.type===`loading`&&!n.icon?n.icon||we():null,n.type===`loading`?null:Te):null,l.default.createElement(`div`,{"data-content":``,className:dx(w?.content,n?.classNames?.content)},l.default.createElement(`div`,{"data-title":``,className:dx(w?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?l.default.createElement(`div`,{"data-description":``,className:dx(y,ue,w?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),l.default.isValidElement(n.cancel)?n.cancel:n.cancel&&nx(n.cancel)?l.default.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||g,onClick:e=>{nx(n.cancel)&&ce&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),Ce())},className:dx(w?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,l.default.isValidElement(n.action)?n.action:n.action&&nx(n.action)?l.default.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||_,onClick:e=>{nx(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&Ce())},className:dx(w?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function mx(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function hx(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?ax:ix;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var gx=l.default.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:a=[`altKey`,`KeyT`],expand:o,closeButton:s,className:c,offset:u,mobileOffset:f,theme:p=`light`,richColors:m,duration:h,style:g,visibleToasts:_=rx,toastOptions:v,dir:y=mx(),gap:b=cx,icons:x,containerAriaLabel:S=`Notifications`}=e,[C,w]=l.default.useState([]),T=l.default.useMemo(()=>n?C.filter(e=>e.toasterId===n):C.filter(e=>!e.toasterId),[C,n]),E=l.default.useMemo(()=>Array.from(new Set([i].concat(T.filter(e=>e.position).map(e=>e.position)))),[T,i]),[D,O]=l.default.useState([]),[k,A]=l.default.useState(!1),[j,M]=l.default.useState(!1),[N,P]=l.default.useState(p===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:p),F=l.default.useRef(null),I=a.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),L=l.default.useRef(null),R=l.default.useRef(!1),ee=l.default.useCallback(e=>{w(t=>(t.find(t=>t.id===e.id)?.delete||$b.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return l.default.useEffect(()=>$b.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{w(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{d.default.flushSync(()=>{w(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[C]),l.default.useEffect(()=>{if(p!==`system`){P(p);return}if(p===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?P(`dark`):P(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{P(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{P(e?`dark`:`light`)}catch(e){console.error(e)}})}},[p]),l.default.useEffect(()=>{C.length<=1&&A(!1)},[C]),l.default.useEffect(()=>{let e=e=>{if(a.every(t=>e[t]||e.code===t)){var t;A(!0),(t=F.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===F.current||F.current?.contains(document.activeElement))&&A(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),l.default.useEffect(()=>{if(F.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,R.current=!1)}},[F.current]),l.default.createElement(`section`,{ref:t,"aria-label":`${S} ${I}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0},E.map((t,n)=>{let[i,a]=t.split(`-`);return T.length?l.default.createElement(`ol`,{key:t,dir:y===`auto`?mx():y,tabIndex:-1,ref:F,className:c,"data-sonner-toaster":!0,"data-sonner-theme":N,"data-y-position":i,"data-x-position":a,style:{"--front-toast-height":`${D[0]?.height||0}px`,"--width":`${sx}px`,"--gap":`${b}px`,...g,...hx(u,f)},onBlur:e=>{R.current&&!e.currentTarget.contains(e.relatedTarget)&&(R.current=!1,L.current&&=(L.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||R.current||(R.current=!0,L.current=e.relatedTarget)},onMouseEnter:()=>A(!0),onMouseMove:()=>A(!0),onMouseLeave:()=>{j||A(!1)},onDragEnd:()=>A(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||M(!0)},onPointerUp:()=>M(!1)},T.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>l.default.createElement(px,{key:n.id,icons:x,index:i,toast:n,defaultRichColors:m,duration:v?.duration??h,className:v?.className,descriptionClassName:v?.descriptionClassName,invert:r,visibleToasts:_,closeButton:v?.closeButton??s,interacting:j,position:t,style:v?.style,unstyled:v?.unstyled,classNames:v?.classNames,cancelButtonStyle:v?.cancelButtonStyle,actionButtonStyle:v?.actionButtonStyle,closeButtonAriaLabel:v?.closeButtonAriaLabel,removeToast:ee,toasts:T.filter(e=>e.position==n.position),heights:D.filter(e=>e.position==n.position),setHeights:O,expandByDefault:o,gap:b,expanded:k,swipeDirections:e.swipeDirections}))):null}))}),_x=({...e})=>{let{theme:t=`system`}=Vb();return(0,u.jsx)(gx,{theme:t,className:`toaster group`,icons:{success:(0,u.jsx)(Dt,{className:`size-4`}),info:(0,u.jsx)(Nt,{className:`size-4`}),warning:(0,u.jsx)(zt,{className:`size-4`}),error:(0,u.jsx)(Ft,{className:`size-4`}),loading:(0,u.jsx)(Pt,{className:`size-4 animate-spin`})},style:{"--normal-bg":`var(--accent)`,"--normal-text":`var(--foreground)`,"--normal-border":`var(--border)`,"--border-radius":`var(--radius)`},...e})},vx=`Switch`,[yx,bx]=_o(vx),[xx,Sx]=yx(vx),Cx=l.forwardRef((e,t)=>{let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c=`on`,onCheckedChange:d,form:f,...p}=e,[m,h]=l.useState(null),g=y(t,e=>h(e)),_=l.useRef(!1),v=m?f||!!m.closest(`form`):!0,[b,x]=xo({prop:i,defaultProp:a??!1,onChange:d,caller:vx});return(0,u.jsxs)(xx,{scope:n,checked:b,disabled:s,children:[(0,u.jsx)($.button,{type:`button`,role:`switch`,"aria-checked":b,"aria-required":o,"data-state":Ox(b),"data-disabled":s?``:void 0,disabled:s,value:c,...p,ref:g,onClick:Q(e.onClick,e=>{x(e=>!e),v&&(_.current=e.isPropagationStopped(),_.current||e.stopPropagation())})}),v&&(0,u.jsx)(Dx,{control:m,bubbles:!_.current,name:r,value:c,checked:b,required:o,disabled:s,form:f,style:{transform:`translateX(-100%)`}})]})});Cx.displayName=vx;var wx=`SwitchThumb`,Tx=l.forwardRef((e,t)=>{let{__scopeSwitch:n,...r}=e,i=Sx(wx,n);return(0,u.jsx)($.span,{"data-state":Ox(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})});Tx.displayName=wx;var Ex=`SwitchBubbleInput`,Dx=l.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...i},a)=>{let o=l.useRef(null),s=y(o,a),c=wo(n),d=To(t);return l.useEffect(()=>{let e=o.current;if(!e)return;let t=window.HTMLInputElement.prototype,i=Object.getOwnPropertyDescriptor(t,`checked`).set;if(c!==n&&i){let t=new Event(`click`,{bubbles:r});i.call(e,n),e.dispatchEvent(t)}},[c,n,r]),(0,u.jsx)(`input`,{type:`checkbox`,"aria-hidden":!0,defaultChecked:n,...i,tabIndex:-1,ref:s,style:{...i.style,...d,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0}})});Dx.displayName=Ex;function Ox(e){return e?`checked`:`unchecked`}var kx=Cx,Ax=Tx;function jx({className:e,...t}){return(0,u.jsx)(kx,{"data-slot":`switch`,className:q(`group`,`peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-xs`,`transition-[background-color] duration-200`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:ring-offset-2 focus-visible:ring-offset-background`,`disabled:cursor-not-allowed disabled:opacity-50`,`data-[state=checked]:bg-primary data-[state=unchecked]:bg-default`,e),...t,children:(0,u.jsx)(Ax,{"data-slot":`switch-thumb`,className:q(`pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0`,`transition-[transform,width] duration-200`,`data-[state=unchecked]:translate-x-0`,`data-[state=checked]:translate-x-4`,`group-active:w-5`,`group-active:data-[state=checked]:translate-x-3`),style:{transitionTimingFunction:`cubic-bezier(0.2, 0, 0, 1)`}})})}function Mx({className:e,...t}){return(0,u.jsx)(`div`,{"data-slot":`table-container`,className:`relative w-full overflow-x-auto sidebar-scrollbar rounded-lg shadow-md bg-background`,children:(0,u.jsx)(`table`,{"data-slot":`table`,className:q(`w-full caption-bottom text-sm`,e),...t})})}var Nx=`Tabs`,[Px,Fx]=_o(Nx,[Hm]),Ix=Hm(),[Lx,Rx]=Px(Nx),zx=l.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,onValueChange:i,defaultValue:a,orientation:o=`horizontal`,dir:s,activationMode:c=`automatic`,...l}=e,d=Pm(s),[f,p]=xo({prop:r,onChange:i,defaultProp:a??``,caller:Nx});return(0,u.jsx)(Lx,{scope:n,baseId:vs(),value:f,onValueChange:p,orientation:o,dir:d,activationMode:c,children:(0,u.jsx)($.div,{dir:d,"data-orientation":o,...l,ref:t})})});zx.displayName=Nx;var Bx=`TabsList`,Vx=l.forwardRef((e,t)=>{let{__scopeTabs:n,loop:r=!0,...i}=e,a=Rx(Bx,n),o=Ix(n);return(0,u.jsx)(eh,{asChild:!0,...o,orientation:a.orientation,dir:a.dir,loop:r,children:(0,u.jsx)($.div,{role:`tablist`,"aria-orientation":a.orientation,...i,ref:t})})});Vx.displayName=Bx;var Hx=`TabsTrigger`,Ux=l.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,disabled:i=!1,...a}=e,o=Rx(Hx,n),s=Ix(n),c=Kx(o.baseId,r),l=qx(o.baseId,r),d=r===o.value;return(0,u.jsx)(th,{asChild:!0,...s,focusable:!i,active:d,children:(0,u.jsx)($.button,{type:`button`,role:`tab`,"aria-selected":d,"aria-controls":l,"data-state":d?`active`:`inactive`,"data-disabled":i?``:void 0,disabled:i,id:c,...a,ref:t,onMouseDown:Q(e.onMouseDown,e=>{!i&&e.button===0&&e.ctrlKey===!1?o.onValueChange(r):e.preventDefault()}),onKeyDown:Q(e.onKeyDown,e=>{[` `,`Enter`].includes(e.key)&&o.onValueChange(r)}),onFocus:Q(e.onFocus,()=>{let e=o.activationMode!==`manual`;!d&&!i&&e&&o.onValueChange(r)})})})});Ux.displayName=Hx;var Wx=`TabsContent`,Gx=l.forwardRef((e,t)=>{let{__scopeTabs:n,value:r,forceMount:i,children:a,...o}=e,s=Rx(Wx,n),c=Kx(s.baseId,r),d=qx(s.baseId,r),f=r===s.value,p=l.useRef(f);return l.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,u.jsx)(Do,{present:i||f,children:({present:n})=>(0,u.jsx)($.div,{"data-state":f?`active`:`inactive`,"data-orientation":s.orientation,role:`tabpanel`,"aria-labelledby":c,hidden:!n,id:d,tabIndex:0,...o,ref:t,style:{...e.style,animationDuration:p.current?`0s`:void 0},children:n&&a})})});Gx.displayName=Wx;function Kx(e,t){return`${e}-trigger-${t}`}function qx(e,t){return`${e}-content-${t}`}var Jx=zx;function Yx({className:e,orientation:t=`horizontal`,...n}){return(0,u.jsx)(Jx,{"data-slot":`tabs`,"data-orientation":t,orientation:t,className:q(`group/tabs flex gap-2 data-[orientation=horizontal]:flex-col`,e),...n})}var Xx=Symbol(`radix.slottable`);function Zx(e){let t=({children:e})=>(0,u.jsx)(u.Fragment,{children:e});return t.displayName=`${e}.Slottable`,t.__radixId=Xx,t}var[Qx,$x]=_o(`Tooltip`,[bp]),eS=bp(),tS=`TooltipProvider`,nS=700,rS=`tooltip.open`,[iS,aS]=Qx(tS),oS=e=>{let{__scopeTooltip:t,delayDuration:n=nS,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=l.useRef(!0),s=l.useRef(!1),c=l.useRef(0);return l.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,u.jsx)(iS,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:l.useCallback(()=>{window.clearTimeout(c.current),o.current=!1},[]),onClose:l.useCallback(()=>{window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r)},[r]),isPointerInTransitRef:s,onPointerInTransitChange:l.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})};oS.displayName=tS;var sS=`Tooltip`,[cS,lS]=Qx(sS),uS=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=aS(sS,e.__scopeTooltip),d=eS(t),[f,p]=l.useState(null),m=vs(),h=l.useRef(0),g=o??c.disableHoverableContent,_=s??c.delayDuration,v=l.useRef(!1),[y,b]=xo({prop:r,defaultProp:i??!1,onChange:e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(rS))):c.onClose(),a?.(e)},caller:sS}),x=l.useMemo(()=>y?v.current?`delayed-open`:`instant-open`:`closed`,[y]),S=l.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,b(!0)},[b]),C=l.useCallback(()=>{window.clearTimeout(h.current),h.current=0,b(!1)},[b]),w=l.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,b(!0),h.current=0},_)},[_,b]);return l.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]),(0,u.jsx)(Ip,{...d,children:(0,u.jsx)(cS,{scope:t,contentId:m,open:y,stateAttribute:x,trigger:f,onTriggerChange:p,onTriggerEnter:l.useCallback(()=>{c.isOpenDelayedRef.current?w():S()},[c.isOpenDelayedRef,w,S]),onTriggerLeave:l.useCallback(()=>{g?C():(window.clearTimeout(h.current),h.current=0)},[C,g]),onOpen:S,onClose:C,disableHoverableContent:g,children:n})})};uS.displayName=sS;var dS=`TooltipTrigger`,fS=l.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=lS(dS,n),a=aS(dS,n),o=eS(n),s=y(t,l.useRef(null),i.onTriggerChange),c=l.useRef(!1),d=l.useRef(!1),f=l.useCallback(()=>c.current=!1,[]);return l.useEffect(()=>()=>document.removeEventListener(`pointerup`,f),[f]),(0,u.jsx)(Lp,{asChild:!0,...o,children:(0,u.jsx)($.button,{"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute,...r,ref:s,onPointerMove:Q(e.onPointerMove,e=>{e.pointerType!==`touch`&&!d.current&&!a.isPointerInTransitRef.current&&(i.onTriggerEnter(),d.current=!0)}),onPointerLeave:Q(e.onPointerLeave,()=>{i.onTriggerLeave(),d.current=!1}),onPointerDown:Q(e.onPointerDown,()=>{i.open&&i.onClose(),c.current=!0,document.addEventListener(`pointerup`,f,{once:!0})}),onFocus:Q(e.onFocus,()=>{c.current||i.onOpen()}),onBlur:Q(e.onBlur,i.onClose),onClick:Q(e.onClick,i.onClose)})})});fS.displayName=dS;var pS=`TooltipPortal`,[mS,hS]=Qx(pS,{forceMount:void 0}),gS=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=lS(pS,t);return(0,u.jsx)(mS,{scope:t,forceMount:n,children:(0,u.jsx)(Do,{present:n||a.open,children:(0,u.jsx)(Zs,{asChild:!0,container:i,children:r})})})};gS.displayName=pS;var _S=`TooltipContent`,vS=l.forwardRef((e,t)=>{let n=hS(_S,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=lS(_S,e.__scopeTooltip);return(0,u.jsx)(Do,{present:r||o.open,children:o.disableHoverableContent?(0,u.jsx)(CS,{side:i,...a,ref:t}):(0,u.jsx)(yS,{side:i,...a,ref:t})})}),yS=l.forwardRef((e,t)=>{let n=lS(_S,e.__scopeTooltip),r=aS(_S,e.__scopeTooltip),i=l.useRef(null),a=y(t,i),[o,s]=l.useState(null),{trigger:c,onClose:d}=n,f=i.current,{onPointerInTransitChange:p}=r,m=l.useCallback(()=>{s(null),p(!1)},[p]),h=l.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=DS(r,ES(r,n.getBoundingClientRect())),a=OS(t.getBoundingClientRect());s(AS([...i,...a])),p(!0)},[p]);return l.useEffect(()=>()=>m(),[m]),l.useEffect(()=>{if(c&&f){let e=e=>h(e,f),t=e=>h(e,c);return c.addEventListener(`pointerleave`,e),f.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),f.removeEventListener(`pointerleave`,t)}}},[c,f,h,m]),l.useEffect(()=>{if(o){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||f?.contains(t),i=!kS(n,o);r?m():i&&(m(),d())};return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,f,o,d,m]),(0,u.jsx)(CS,{...e,ref:a})}),[bS,xS]=Qx(sS,{isInside:!1}),SS=Zx(`TooltipContent`),CS=l.forwardRef((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:a,onPointerDownOutside:o,...s}=e,c=lS(_S,n),d=eS(n),{onClose:f}=c;return l.useEffect(()=>(document.addEventListener(rS,f),()=>document.removeEventListener(rS,f)),[f]),l.useEffect(()=>{if(c.trigger){let e=e=>{e.target?.contains(c.trigger)&&f()};return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[c.trigger,f]),(0,u.jsx)(Ds,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:f,children:(0,u.jsxs)(Rp,{"data-state":c.stateAttribute,...d,...s,ref:t,style:{...s.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:[(0,u.jsx)(SS,{children:r}),(0,u.jsx)(bS,{scope:n,isInside:!0,children:(0,u.jsx)(Ev,{id:c.contentId,role:`tooltip`,children:i||r})})]})})});vS.displayName=_S;var wS=`TooltipArrow`,TS=l.forwardRef((e,t)=>{let{__scopeTooltip:n,...r}=e,i=eS(n);return xS(wS,n).isInside?null:(0,u.jsx)(zp,{...i,...r,ref:t})});TS.displayName=wS;function ES(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}function DS(e,t,n=5){let 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 OS(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}function kS(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function AS(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0),jS(t)}function jS(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}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 MS=oS,NS=uS;function PS({delayDuration:e=0,...t}){return(0,u.jsx)(MS,{"data-slot":`tooltip-provider`,delayDuration:e,...t})}function FS({...e}){return(0,u.jsx)(PS,{children:(0,u.jsx)(NS,{"data-slot":`tooltip`,...e})})}function IS({password:e}){function t(e){return e.length>=8}function n(e){return/[a-z]/.test(e)}function r(e){return/[A-Z]/.test(e)}function i(e){return/[^A-Za-z0-9]/.test(e)}let a=[{label:`Deve conter no mínimo 8 caracteres`,valid:t(e)},{label:`Pelo menos 1 letra minúscula "abc"`,valid:n(e)},{label:`Pelo menos 1 letra maiúscula "ABC"`,valid:r(e)},{label:`Pelo menos 1 caractere especial (ex: # @...)`,valid:i(e)}];function o(t){return e?t?(0,u.jsx)(Lt,{className:`text-success size-6`}):(0,u.jsx)(Rt,{className:`text-destructive size-6`}):(0,u.jsx)(`div`,{className:`size-6 flex items-center justify-center`,children:(0,u.jsx)(`div`,{className:`size-5 rounded-sm border-2 border-border`})})}return(0,u.jsx)(`div`,{className:`flex flex-col gap-1`,children:a.map((e,t)=>(0,u.jsxs)(`div`,{className:`flex flex-row gap-1 items-center`,children:[o(e.valid),(0,u.jsx)(`span`,{className:`label-md font-medium`,children:e.label})]},t))})}var LS=(0,l.createContext)(void 0),RS=()=>(0,l.useContext)(LS),zS=({children:e,tokens:t})=>(l.default.useEffect(()=>{if(!t)return;let e=`wmoney-theme-tokens`,n=document.getElementById(e);n||(n=document.createElement(`style`),n.id=e,document.head.appendChild(n));let r={light:`:root`,dark:`.dark`},i=Object.entries(t).map(([e,t])=>`${r[e]??`:root`} {\n${Object.entries(t).map(([e,t])=>` --${e}: ${t};`).join(`
65
65
  `)}\n}`).join(`
66
66
  `);return n.textContent=i,()=>{n?.remove()}},[t]),(0,u.jsx)(LS.Provider,{value:t,children:e}));exports.Badge=dt,exports.Button=qt,exports.Calendar=so,exports.Card=lo,exports.Checkbox=es,exports.Command=Wu,exports.DatePicker=Tm,exports.Dialog=Uu,exports.DropdownMenu=T_,exports.FileDropzone=E_,exports.FormSection=F_,exports.Input=I_,exports.InputGroup=R_,exports.InputOtp=ov,exports.Label=td,exports.MultiSelect=cv,exports.Pagination=lv,exports.Paginator=cb,exports.PasswordToggle=lb,exports.Popover=Sm,exports.RadioGroup=Fb,exports.RoundedButton=Ib,exports.Select=$y,exports.Separator=P_,exports.Skeleton=Lb,exports.Spinner=Ut,exports.Switch=jx,exports.Table=Mx,exports.Tabs=Yx,exports.Textarea=L_,exports.ThemeTokensProvider=zS,exports.Toaster=_x,exports.Tooltip=FS,exports.TooltipProvider=PS,exports.ValidatePassword=IS,exports.buttonVariants=Wt,exports.cn=q,exports.useThemeTokens=RS;
67
67
  //# sourceMappingURL=index.cjs.map