UNPKG

@rdsaude/pulso-react-components

Version:

Biblioteca de componentes React do Pulso Design System da RD Saúde oferece componentes consistentes e de alto desempenho, alinhados com os padrões da RDSaúde. Ideal para desenvolver aplicações modernas e acessíveis.

18 lines 172 kB
"use strict";var qd=Object.create;var Yt=Object.defineProperty,Yd=Object.defineProperties,Ud=Object.getOwnPropertyDescriptor,Gd=Object.getOwnPropertyDescriptors,Kd=Object.getOwnPropertyNames,mr=Object.getOwnPropertySymbols,jd=Object.getPrototypeOf,co=Object.prototype.hasOwnProperty,Hn=Object.prototype.propertyIsEnumerable;var Fn=(e,t,r)=>t in e?Yt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,x=(e,t)=>{for(var r in t||(t={}))co.call(t,r)&&Fn(e,r,t[r]);if(mr)for(var r of mr(t))Hn.call(t,r)&&Fn(e,r,t[r]);return e},y=(e,t)=>Yd(e,Gd(t));var C=(e,t)=>{var r={};for(var o in e)co.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&mr)for(var o of mr(e))t.indexOf(o)<0&&Hn.call(e,o)&&(r[o]=e[o]);return r};var Xd=(e,t)=>{for(var r in t)Yt(e,r,{get:t[r],enumerable:!0})},Wn=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Kd(t))!co.call(e,n)&&n!==r&&Yt(e,n,{get:()=>t[n],enumerable:!(o=Ud(t,n))||o.enumerable});return e};var K=(e,t,r)=>(r=e!=null?qd(jd(e)):{},Wn(t||!e||!e.__esModule?Yt(r,"default",{value:e,enumerable:!0}):r,e)),Qd=e=>Wn(Yt({},"__esModule",{value:!0}),e);var ye=(e,t,r)=>new Promise((o,n)=>{var a=l=>{try{i(r.next(l))}catch(c){n(c)}},s=l=>{try{i(r.throw(l))}catch(c){n(c)}},i=l=>l.done?o(l.value):Promise.resolve(l.value).then(a,s);i((r=r.apply(e,t)).next())});var sb={};Xd(sb,{Select:()=>lo});module.exports=Qd(sb);var Bd=require("@radix-ui/react-context");var Yn=require("react/jsx-runtime"),qn=({children:e})=>(0,Yn.jsx)("div",{className:"input-select-actions","data-testid":"input-name-actions",children:e});var Ye=require("react");var na=require("react"),aa=require("@radix-ui/react-context");var Un=require("tailwind-variants"),f=(0,Un.createTV)({twMergeConfig:{extend:{classGroups:{"font-size":[{text:["threepulse","threeandhalfpulse"]}],"border-width":[{border:["quarterpulse","halfpulse"]}],"--tw-ring-inset":[{ring:["none","quarterpulse","halfpulse"]}]}}}});var Gn=f({base:` tracking inline-flex items-center justify-center gap-twopulse rounded-pill border-quarterpulse border-[transparent] font-bold font-rdmodern text-threeandhalfpulse truncate`,variants:{variant:{"brand-primary":`bg-action-fill-brand-primary-enabled text-text-neutral-inverse enabled:active:bg-action-fill-brand-primary-pressed enabled:hover:bg-action-fill-brand-primary-hovered`,"neutral-secondary":`border-action-border-neutral-secondary-enabled bg-action-fill-neutral-secondary-enabled text-text-neutral enabled:active:border-action-border-neutral-secondary-pressed enabled:active:bg-action-fill-neutral-secondary-pressed enabled:hover:bg-action-fill-neutral-secondary-hovered`,"neutral-tertiary":`border-action-border-neutral-tertiary-enabled bg-action-fill-neutral-tertiary-enabled text-text-neutral enabled:active:bg-action-fill-neutral-tertiary-pressed enabled:hover:bg-action-fill-neutral-tertiary-hovered`},size:{md:"h-medium min-w-medium px-fourpulse text-threepulse leading-medium",ml:"h-mediumlarge min-w-mediumlarge px-fourpulse leading-small",lg:"h-large min-w-large px-fivepulse leading-small",xl:"h-extralarge min-w-extralarge px-sixpulse leading-small"},disabled:{true:"cursor-not-allowed text-text-neutral-disabled outline-none",false:"outline-action-border-focused outline-offset-4 focus-visible:outline-1"},full:{true:"w-full"},asIconOnly:{true:"aspect-square px-none"}},compoundVariants:[{variant:"brand-primary",disabled:!0,class:"border-action-border-brand-primary-disabled bg-action-fill-brand-primary-disabled"},{variant:"neutral-secondary",disabled:!0,class:"border-action-border-neutral-secondary-disabled bg-action-fill-neutral-secondary-disabled"},{variant:"neutral-tertiary",disabled:!0,class:"border-action-fill-neutral-tertiary-disabled bg-action-fill-neutral-tertiary-enabled"}],defaultVariants:{variant:"brand-primary",size:"ml"}});var Se=require("@raiadrogasil/pulso-design-tokens"),jn=require("react");var uo=require("react"),Zd=require("react/jsx-runtime"),Kn=(0,uo.createContext)({});function Ze(){let{currentTheme:e}=(0,jn.useContext)(Kn);return x(x({},{rdsaudesistemas:Se.RDSAUDESISTEMAS_TOKENS,drogasil:Se.DROGASIL_TOKENS,raia:Se.RAIA_TOKENS,subscription:Se.SUBSCRIPTION_TOKENS,prime:Se.PRIME_TOKENS}[e]),Se.GLOBALS_TOKENS)}function Xn(e){let t=Ze();return Object.keys(t).reduce((n,a)=>{if(a.includes("color")){let s=a;n[s]=t[s]}return n},{})[e]}var Qn={tiny:"var(--sizing-tiny)","extra-small":"var(--sizing-extrasmall)",small:"var(--sizing-small)",medium:"var(--sizing-medium)"};var Zn=require("react/jsx-runtime");function N(n){var a=n,{symbol:e="rdicon-default",size:t="small",color:r="colorActionFillBrandPrimaryEnabled"}=a,o=C(a,["symbol","size","color"]);let s=e.replace("rdicon","").trim();return(0,Zn.jsx)("i",y(x({},o),{title:s,className:e,style:{fontSize:Qn[t],color:Xn(r)}}))}var Jn=require("react/jsx-runtime");function br(e){let l=e,{__scopeButton:t}=l,r=C(l,["__scopeButton"]),{variant:o,size:n,disabled:a}=hr("ButtonIcon",t),s={"brand-primary":"colorTextNeutralInverse","neutral-secondary":"colorTextNeutralDefault","neutral-tertiary":"colorTextNeutralDefault"},i={md:"extra-small",ml:"small",lg:"small",xl:"small"};return(0,Jn.jsx)(N,y(x({},r),{color:a?"colorTextNeutralDisabled":s[o],size:i[n]}))}function ea(e){let t=Ze();return{brand:t.colorActionFillBrandPrimaryEnabled,neutral:t.colorTextNeutralReadonly,black:t.colorTextNeutralDefault,white:t.colorTextNeutralInverse}[e]}var ht=require("react/jsx-runtime");function xr({color:e="brand",srText:t}){return(0,ht.jsx)("div",{role:"status",className:"grid size-eightpulse place-items-center","aria-label":t,children:(0,ht.jsxs)("svg",{className:"size-sixpulse animate-spin fill-none",viewBox:"0 0 24 24",children:[(0,ht.jsx)("path",{fillRule:"evenodd",d:"M0 12c0 6.627 5.373 12 12 12s12-5.373 12-12S18.627 0 12 0v2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12H0z",clipRule:"evenodd",fill:ea(e)}),(0,ht.jsx)("title",{children:t})]})})}var ra=require("react/jsx-runtime");function ta(e){let a=e,{__scopeButton:t}=a,r=C(a,["__scopeButton"]),{variant:o}=hr("ButtonRefresh",t),n={"brand-primary":"white","neutral-secondary":"neutral","neutral-tertiary":"black"};return(0,ra.jsx)(xr,y(x({},r),{color:n[o]}))}var po=K(require("react"),1);function oa(e){return po.default.Children.count(e)===1&&po.default.isValidElement(e)?e.type===br:!1}var vr=require("react/jsx-runtime"),fo="Button",sa=(0,na.forwardRef)((e,t)=>{let{children:r,variant:o="brand-primary",size:n="ml",loading:a=!1,disabled:s=!1,full:i,className:l,__scopeButton:c}=e,u=a||s;return(0,vr.jsx)(eu,{scope:c,variant:o,size:n,disabled:s,children:(0,vr.jsx)("button",y(x({},e),{ref:t,className:Gn({variant:o,size:n,disabled:s,full:i,className:l,asIconOnly:oa(r)}),disabled:u,"aria-disabled":s,children:a?(0,vr.jsx)(ta,{}):r}))})});sa.displayName=fo;var[Jd]=(0,aa.createContextScope)(fo),[eu,hr]=Jd(fo),j={Root:sa,Icon:br};var ae=require("react");var ia=f({base:"flex flex-col items-start justify-center gap-none rounded-pill font-rdmodern",variants:{size:{md:"",ml:"",lg:"",xl:""},hasError:{true:"h-full",false:""},hasReadonly:{true:"border-action-border-neutral-tertiary-readonly border-none bg-action-fill-neutral-tertiary-readonly",false:""},hasDisabled:{true:"border-none bg-action-fill-neutral-tertiary-disabled",false:""}},defaultVariants:{size:"md"}}),la=f({base:"flex items-center justify-center",variants:{size:{md:"pr-onepulse",ml:"pr-twopulse",lg:"pr-twopulse",xl:"pr-twopulse"}},defaultVariants:{size:"md",hasLabelText:!0}}),ca=f({base:"flex items-center justify-center",variants:{size:{md:"h-tiny w-tiny pr-none",ml:"h-small w-small pr-none",lg:"h-medium w-medium pr-none",xl:"h-medium w-medium pr-none"}},defaultVariants:{size:"md"}}),da=f({base:`mb-twopulse flex cursor-pointer items-center justify-center rounded-pill p-halfpulse text-text-neutral focus:border-halfpulse focus:bg-action-fill-neutral-tertiary-enabled`,variants:{size:{md:"",ml:"",lg:"",xl:""},hasError:{true:"border-forms-border-error border-halfpulse focus:border-forms-border-error",false:`hover:border-action-border-neutral-tertiary-hovered focus:border-action-border-focused active:bg-action-fill-neutral-tertiary-pressed active:border-action-border-neutral-tertiary-pressed`}},defaultVariants:{size:"md"}}),ua=f({base:`flex bg-action-fill-neutral-tertiary-enabled rounded-pill min-w-[128px] border-action-border-neutral-tertiary-enabled hover:bg-action-fill-neutral-tertiary-hovered hover:border-action-fill-neutral-tertiary-hovered active:outline-none active:border-action-border-neutral-tertiary-pressed `,variants:{size:{md:"min-h-medium px-fourpulse py-onepulse",ml:"min-h-mediumlarge px-fourpulse py-twopulse",lg:"min-h-large px-fivepulse py-twopulse",xl:"min-h-extralarge px-sixpulse py-threepulse"},hasReadonly:{true:`border-action-border-neutral-tertiary-readonly border-none bg-action-fill-neutral-tertiary-readonly text-text-neutral-readonly hover:bg-action-fill-neutral-tertiary-readonly active:bg-action-fill-neutral-tertiary-readonly`},hasDisabled:{true:`border-action-border-neutral-tertiary-disabled border-none bg-action-fill-neutral-tertiary-disabled text-text-neutral-disabled hover:bg-action-fill-neutral-tertiary-disabled active:bg-action-fill-neutral-tertiary-disabled`},hasError:{true:"h-full",false:""}},defaultVariants:{size:"md"}}),pa=f({base:`w-full flex bg-action-fill-neutral-tertiary-enabled rounded-pill focus:border-action-border-neutral-focused focus:border-halfpulse hover:bg-action-fill-neutral-tertiary-hovered active:bg-action-fill-neutral-tertiary-pressed active:border-action-border-neutral-tertiary-pressed`,variants:{size:{md:"p-twopulse",ml:"p-twopulse",lg:"p-twopulse",xl:"p-threepulse"},hasReadonly:{true:`border-action-border-neutral-tertiary-readonly border-none bg-action-fill-neutral-tertiary-readonly text-text-neutral-readonly hover:bg-action-fill-neutral-tertiary-readonly active:bg-action-fill-neutral-tertiary-readonly`},hasDisabled:{true:`border-action-border-neutral-tertiary-disabled border-none bg-action-fill-neutral-tertiary-disabled text-text-neutral-disabled hover:bg-action-fill-neutral-tertiary-disabled active:bg-action-fill-neutral-tertiary-disabled`},hasError:{true:"h-full",false:""}},defaultVariants:{size:"md"}}),fa=f({base:"ml-halfpulse flex items-center bg-transparent",variants:{size:{md:"px-fourpulse",ml:"px-fourpulse",lg:"px-fivepulse",xl:"px-sixpulse"},hasError:{true:"font-semibold text-threepulse leading-medium tracking-tiny",false:"font-semibold text-threepulse leading-medium tracking-tiny"}},defaultVariants:{size:"md"}}),ma=f({base:"flex items-center bg-transparent",variants:{size:{md:"px-threepulse",ml:"px-fourpulse",lg:"px-fivepulse",xl:"px-sixpulse"},hasError:{true:"font-semibold text-text-danger-alternative text-threepulse leading-medium tracking-tiny"}},defaultVariants:{size:"md"}}),ba=f({base:"flex flex-col pl-eightpulse",variants:{size:{md:"",ml:"",lg:"",xl:""}},defaultVariants:{size:"md"}});var ha=f({base:"line-clamp-4 min-h-small overflow-hidden text-left font-family-modern font-regular text-neutral-default",variants:{size:{md:"pt-halfpulse text-threepulse leading-medium",ml:"pt-halfpulse text-threeandhalfpulse leading-small",lg:"pt-onepulse text-fourpulse leading-small",xl:"pt-onepulse text-fourpulse leading-small"},hasError:{true:"font-semibold"},hasDisabled:{true:"text-neutral-disabled"},hasReadonly:{true:"text-neutral-readonly"}},defaultVariants:{size:"md"}});var xa=require("react/jsx-runtime");function mo({children:e,size:t="md",error:r=!1,disabled:o=!1,readonly:n=!1}){return(0,xa.jsx)("span",{className:ha({size:t,hasError:r,hasDisabled:o,hasReadonly:n}),children:e})}var va=f({base:"flex flex-row items-center justify-start gap-half-pulse text-ellipsis"}),ga=f({base:"line-clamp-2 pl-onepulse text-left font-family-modern font-semibold text-text-neutral"}),ya=f({base:"line-clamp-2 pl-onepulse text-left font-family-modern font-semibold text-text-danger-alternative"});var Ut=require("react/jsx-runtime");function bo({icon:e,children:t,isError:r=!1}){return(0,Ut.jsxs)("div",{className:va(),children:[e&&(0,Ut.jsx)(N,{size:"tiny",symbol:e,color:r?"colorTextDangerAlternative":"colorTextNeutralDefault"}),(0,Ut.jsx)("span",{className:r?ya():ga(),children:t})]})}var we=require("react/jsx-runtime"),tu="Checkbox",ru=e=>({md:"tiny",ml:"small",lg:"medium",xl:"medium"})[e]||"medium",ou=({symbol:e,size:t="md",disabled:r,readonly:o,hasLabelText:n})=>{let a=ru(t),s=n?la({size:t}):ca({size:t});return(0,we.jsx)("div",{className:s,children:(0,we.jsx)(N,{symbol:e,size:a,color:r?"colorTextNeutralDisabled":o?"colorTextNeutralReadonly":"colorTextNeutralDefault"})})},nu=({children:e,size:t,disabled:r,readonly:o,error:n})=>{let s=!!ae.Children.toArray(e).find(i=>(0,ae.isValidElement)(i)&&i.type===mo&&i.props.children)?ua({size:t,hasDisabled:r,hasReadonly:o,hasError:!!n}):pa({size:t,hasDisabled:r,hasReadonly:o,hasError:!!n});return(0,we.jsx)("div",{className:da({size:t,hasError:!!n}),children:(0,we.jsx)("div",{className:s,children:e})})},au=(0,ae.forwardRef)((e,t)=>{let E=e,{size:r="md",checked:o=!1,indeterminate:n=!1,onClick:a,error:s,disabled:i,readonly:l,children:c,feedbackMessage:u,hasFeedbackMessage:d=!0,icon:h}=E,b=C(E,["size","checked","indeterminate","onClick","error","disabled","readonly","children","feedbackMessage","hasFeedbackMessage","icon"]),v=n?"rdicon-checkbox-indeterminate":o?"rdicon-checkbox-checked":"rdicon-checkbox-unchecked",m=$=>{$.stopPropagation(),!(i||l)&&typeof a=="function"&&a(!o)},p=ae.Children.toArray(c).find($=>(0,ae.isValidElement)($)&&$.type===mo),w=ae.Children.toArray(c).find($=>(0,ae.isValidElement)($)&&$.type===bo),g=ae.Children.toArray(c).find($=>(0,ae.isValidElement)($)&&$.type===su),R=b,{feedbackMessage:T}=R,I=C(R,["feedbackMessage"]),O=s||d&&u;return(0,we.jsxs)("div",y(x({ref:t},I),{role:"checkbox","aria-checked":o||n,"aria-disabled":i||l,onClick:m,className:ia({size:r,hasError:!!s,hasDisabled:!!i,hasReadonly:!!l}),children:[(0,we.jsxs)(nu,{size:r,disabled:i,readonly:l,error:s,children:[(0,we.jsx)(ou,{symbol:v,size:r,disabled:i,readonly:l,hasLabelText:!!(p!=null&&p.props.children)}),p&&(0,ae.cloneElement)(p,{size:r,disabled:i,readonly:l,error:s})]}),(w||O)&&(0,we.jsx)("div",{className:w!=null&&w.props.children||O?fa({size:r,hasError:!!s}):ma({size:r,hasError:!!s}),children:(0,ae.cloneElement)(w||(0,we.jsx)(bo,{icon:s?"rdicon-warning-circle":h,isError:s,children:u}),{size:r})}),g&&(0,ae.cloneElement)(g,{size:r,disabled:i||l,error:s})]}))}),su=({children:e,size:t="md"})=>(0,we.jsx)("div",{className:ba({size:t}),children:e});au.displayName=tu;function H(){return H=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)({}).hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},H.apply(null,arguments)}var P=require("react"),jo=require("react-dom");function ho(e,[t,r]){return Math.min(r,Math.max(t,e))}function ve(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e==null||e(n),r===!1||!n.defaultPrevented)return t==null?void 0:t(n)}}var Ie=K(require("react"),1),wa=require("@radix-ui/react-context");var Sa=require("react");function iu(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function lu(...e){return t=>e.forEach(r=>iu(r,t))}function re(...e){return(0,Sa.useCallback)(lu(...e),e)}var xo=require("@radix-ui/react-slot");function Ca(e){let t=e+"CollectionProvider",[r,o]=(0,wa.createContextScope)(t),[n,a]=r(t,{collectionRef:{current:null},itemMap:new Map}),s=b=>{let{scope:v,children:m}=b,p=Ie.default.useRef(null),w=Ie.default.useRef(new Map).current;return Ie.default.createElement(n,{scope:v,itemMap:w,collectionRef:p},m)},i=e+"CollectionSlot",l=Ie.default.forwardRef((b,v)=>{let{scope:m,children:p}=b,w=a(i,m),g=re(v,w.collectionRef);return Ie.default.createElement(xo.Slot,{ref:g},p)}),c=e+"CollectionItemSlot",u="data-radix-collection-item",d=Ie.default.forwardRef((b,v)=>{let I=b,{scope:m,children:p}=I,w=C(I,["scope","children"]),g=Ie.default.useRef(null),S=re(v,g),T=a(c,m);return Ie.default.useEffect(()=>(T.itemMap.set(g,x({ref:g},w)),()=>void T.itemMap.delete(g))),Ie.default.createElement(xo.Slot,{[u]:"",ref:S},p)});function h(b){let v=a(e+"CollectionConsumer",b);return Ie.default.useCallback(()=>{let p=v.collectionRef.current;if(!p)return[];let w=Array.from(p.querySelectorAll(`[${u}]`));return Array.from(v.itemMap.values()).sort((T,I)=>w.indexOf(T.ref.current)-w.indexOf(I.ref.current))},[v.collectionRef,v.itemMap])}return[{Provider:s,Slot:l,ItemSlot:d},h,o]}var gi=require("@radix-ui/react-context");var Gt=require("react"),cu=(0,Gt.createContext)(void 0);function Pa(e){let t=(0,Gt.useContext)(cu);return e||t||"ltr"}var Z=require("react");function gr(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e==null||e(n),r===!1||!n.defaultPrevented)return t==null?void 0:t(n)}}var xt=require("react"),Ta=require("react-dom"),Ia=require("@radix-ui/react-slot");var du=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],oe=du.reduce((e,t)=>{let r=(0,xt.forwardRef)((o,n)=>{let l=o,{asChild:a}=l,s=C(l,["asChild"]),i=a?Ia.Slot:t;return(0,xt.useEffect)(()=>{window[Symbol.for("radix-ui")]=!0},[]),(0,xt.createElement)(i,H({},s,{ref:n}))});return r.displayName=`Primitive.${t}`,y(x({},e),{[t]:r})},{});function $a(e,t){e&&(0,Ta.flushSync)(()=>e.dispatchEvent(t))}var vt=require("react");function de(e){let t=(0,vt.useRef)(e);return(0,vt.useEffect)(()=>{t.current=e}),(0,vt.useMemo)(()=>(...r)=>{var o;return(o=t.current)===null||o===void 0?void 0:o.call(t,...r)},[])}var Ra=require("react");function Ea(e,t=globalThis==null?void 0:globalThis.document){let r=de(e);(0,Ra.useEffect)(()=>{let o=n=>{n.key==="Escape"&&r(n)};return t.addEventListener("keydown",o),()=>t.removeEventListener("keydown",o)},[r,t])}var vo="dismissableLayer.update",uu="dismissableLayer.pointerDownOutside",pu="dismissableLayer.focusOutside",Na,fu=(0,Z.createContext)({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),ka=(0,Z.forwardRef)((e,t)=>{var r;let R=e,{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:n,onPointerDownOutside:a,onFocusOutside:s,onInteractOutside:i,onDismiss:l}=R,c=C(R,["disableOutsidePointerEvents","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss"]),u=(0,Z.useContext)(fu),[d,h]=(0,Z.useState)(null),b=(r=d==null?void 0:d.ownerDocument)!==null&&r!==void 0?r:globalThis==null?void 0:globalThis.document,[,v]=(0,Z.useState)({}),m=re(t,$=>h($)),p=Array.from(u.layers),[w]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),g=p.indexOf(w),S=d?p.indexOf(d):-1,T=u.layersWithOutsidePointerEventsDisabled.size>0,I=S>=g,O=mu($=>{let V=$.target,D=[...u.branches].some(z=>z.contains(V));!I||D||(a==null||a($),i==null||i($),$.defaultPrevented||l==null||l())},b),E=bu($=>{let V=$.target;[...u.branches].some(z=>z.contains(V))||(s==null||s($),i==null||i($),$.defaultPrevented||l==null||l())},b);return Ea($=>{S===u.layers.size-1&&(n==null||n($),!$.defaultPrevented&&l&&($.preventDefault(),l()))},b),(0,Z.useEffect)(()=>{if(d)return o&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Na=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Oa(),()=>{o&&u.layersWithOutsidePointerEventsDisabled.size===1&&(b.body.style.pointerEvents=Na)}},[d,b,o,u]),(0,Z.useEffect)(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Oa())},[d,u]),(0,Z.useEffect)(()=>{let $=()=>v({});return document.addEventListener(vo,$),()=>document.removeEventListener(vo,$)},[]),(0,Z.createElement)(oe.div,H({},c,{ref:m,style:x({pointerEvents:T?I?"auto":"none":void 0},e.style),onFocusCapture:gr(e.onFocusCapture,E.onFocusCapture),onBlurCapture:gr(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:gr(e.onPointerDownCapture,O.onPointerDownCapture)}))});function mu(e,t=globalThis==null?void 0:globalThis.document){let r=de(e),o=(0,Z.useRef)(!1),n=(0,Z.useRef)(()=>{});return(0,Z.useEffect)(()=>{let a=i=>{if(i.target&&!o.current){let u=function(){Aa(uu,r,c,{discrete:!0})};var l=u;let c={originalEvent:i};i.pointerType==="touch"?(t.removeEventListener("click",n.current),n.current=u,t.addEventListener("click",n.current,{once:!0})):u()}o.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",a),t.removeEventListener("click",n.current)}},[t,r]),{onPointerDownCapture:()=>o.current=!0}}function bu(e,t=globalThis==null?void 0:globalThis.document){let r=de(e),o=(0,Z.useRef)(!1);return(0,Z.useEffect)(()=>{let n=a=>{a.target&&!o.current&&Aa(pu,r,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",n),()=>t.removeEventListener("focusin",n)},[t,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Oa(){let e=new CustomEvent(vo);document.dispatchEvent(e)}function Aa(e,t,r,{discrete:o}){let n=r.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&n.addEventListener(e,t,{once:!0}),o?$a(n,a):n.dispatchEvent(a)}var _a=require("react"),go=0;function La(){(0,_a.useEffect)(()=>{var e,t;let r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",(e=r[0])!==null&&e!==void 0?e:Ma()),document.body.insertAdjacentElement("beforeend",(t=r[1])!==null&&t!==void 0?t:Ma()),go++,()=>{go===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(o=>o.remove()),go--}},[])}function Ma(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var be=require("react");var yo="focusScope.autoFocusOnMount",So="focusScope.autoFocusOnUnmount",Va={bubbles:!1,cancelable:!0};var Fa=(0,be.forwardRef)((e,t)=>{let m=e,{loop:r=!1,trapped:o=!1,onMountAutoFocus:n,onUnmountAutoFocus:a}=m,s=C(m,["loop","trapped","onMountAutoFocus","onUnmountAutoFocus"]),[i,l]=(0,be.useState)(null),c=de(n),u=de(a),d=(0,be.useRef)(null),h=re(t,p=>l(p)),b=(0,be.useRef)({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;(0,be.useEffect)(()=>{if(o){let S=function(E){if(b.paused||!i)return;let R=E.target;i.contains(R)?d.current=R:Ke(d.current,{select:!0})},T=function(E){if(b.paused||!i)return;let R=E.relatedTarget;R!==null&&(i.contains(R)||Ke(d.current,{select:!0}))},I=function(E){let R=document.activeElement;for(let $ of E)$.removedNodes.length>0&&(i!=null&&i.contains(R)||Ke(i))};var p=S,w=T,g=I;document.addEventListener("focusin",S),document.addEventListener("focusout",T);let O=new MutationObserver(I);return i&&O.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",S),document.removeEventListener("focusout",T),O.disconnect()}}},[o,i,b.paused]),(0,be.useEffect)(()=>{if(i){za.add(b);let p=document.activeElement;if(!i.contains(p)){let g=new CustomEvent(yo,Va);i.addEventListener(yo,c),i.dispatchEvent(g),g.defaultPrevented||(hu(Su(Ha(i)),{select:!0}),document.activeElement===p&&Ke(i))}return()=>{i.removeEventListener(yo,c),setTimeout(()=>{let g=new CustomEvent(So,Va);i.addEventListener(So,u),i.dispatchEvent(g),g.defaultPrevented||Ke(p!=null?p:document.body,{select:!0}),i.removeEventListener(So,u),za.remove(b)},0)}}},[i,c,u,b]);let v=(0,be.useCallback)(p=>{if(!r&&!o||b.paused)return;let w=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,g=document.activeElement;if(w&&g){let S=p.currentTarget,[T,I]=xu(S);T&&I?!p.shiftKey&&g===I?(p.preventDefault(),r&&Ke(T,{select:!0})):p.shiftKey&&g===T&&(p.preventDefault(),r&&Ke(I,{select:!0})):g===S&&p.preventDefault()}},[r,o,b.paused]);return(0,be.createElement)(oe.div,H({tabIndex:-1},s,{ref:h,onKeyDown:v}))});function hu(e,{select:t=!1}={}){let r=document.activeElement;for(let o of e)if(Ke(o,{select:t}),document.activeElement!==r)return}function xu(e){let t=Ha(e),r=Da(t,e),o=Da(t.reverse(),e);return[r,o]}function Ha(e){let t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{let n=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||n?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Da(e,t){for(let r of e)if(!vu(r,{upTo:t}))return r}function vu(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function gu(e){return e instanceof HTMLInputElement&&"select"in e}function Ke(e,{select:t=!1}={}){if(e&&e.focus){let r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&gu(e)&&t&&e.select()}}var za=yu();function yu(){let e=[];return{add(t){let r=e[0];t!==r&&(r==null||r.pause()),e=Ba(e,t),e.unshift(t)},remove(t){var r;e=Ba(e,t),(r=e[0])===null||r===void 0||r.resume()}}}function Ba(e,t){let r=[...e],o=r.indexOf(t);return o!==-1&&r.splice(o,1),r}function Su(e){return e.filter(t=>t.tagName!=="A")}var yr=K(require("react"),1);var Wa=require("react"),ge=globalThis!=null&&globalThis.document?Wa.useLayoutEffect:()=>{};var wu=yr.useId||(()=>{}),Cu=0;function wo(e){let[t,r]=yr.useState(wu());return ge(()=>{e||r(o=>o!=null?o:String(Cu++))},[e]),e||(t?`radix-${t}`:"")}var ne=require("react");var qa=["top","right","bottom","left"];var ke=Math.min,ue=Math.max,jt=Math.round,Xt=Math.floor,$e=e=>({x:e,y:e}),Pu={left:"right",right:"left",bottom:"top",top:"bottom"},Tu={start:"end",end:"start"};function wr(e,t,r){return ue(e,ke(t,r))}function Ae(e,t){return typeof e=="function"?e(t):e}function Me(e){return e.split("-")[0]}function Je(e){return e.split("-")[1]}function Cr(e){return e==="x"?"y":"x"}function Pr(e){return e==="y"?"height":"width"}function Be(e){return["top","bottom"].includes(Me(e))?"y":"x"}function Tr(e){return Cr(Be(e))}function Ya(e,t,r){r===void 0&&(r=!1);let o=Je(e),n=Tr(e),a=Pr(n),s=n==="x"?o===(r?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(s=Kt(s)),[s,Kt(s)]}function Ua(e){let t=Kt(e);return[Sr(e),t,Sr(t)]}function Sr(e){return e.replace(/start|end/g,t=>Tu[t])}function Iu(e,t,r){let o=["left","right"],n=["right","left"],a=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return r?t?n:o:t?o:n;case"left":case"right":return t?a:s;default:return[]}}function Ga(e,t,r,o){let n=Je(e),a=Iu(Me(e),r==="start",o);return n&&(a=a.map(s=>s+"-"+n),t&&(a=a.concat(a.map(Sr)))),a}function Kt(e){return e.replace(/left|right|bottom|top/g,t=>Pu[t])}function $u(e){return x({top:0,right:0,bottom:0,left:0},e)}function Co(e){return typeof e!="number"?$u(e):{top:e,right:e,bottom:e,left:e}}function et(e){let{x:t,y:r,width:o,height:n}=e;return{width:o,height:n,top:r,left:t,right:t+o,bottom:r+n,x:t,y:r}}function Ka(e,t,r){let{reference:o,floating:n}=e,a=Be(t),s=Tr(t),i=Pr(s),l=Me(t),c=a==="y",u=o.x+o.width/2-n.width/2,d=o.y+o.height/2-n.height/2,h=o[i]/2-n[i]/2,b;switch(l){case"top":b={x:u,y:o.y-n.height};break;case"bottom":b={x:u,y:o.y+o.height};break;case"right":b={x:o.x+o.width,y:d};break;case"left":b={x:o.x-n.width,y:d};break;default:b={x:o.x,y:o.y}}switch(Je(t)){case"start":b[s]-=h*(r&&c?-1:1);break;case"end":b[s]+=h*(r&&c?-1:1);break}return b}var Qa=(e,t,r)=>ye(void 0,null,function*(){let{placement:o="bottom",strategy:n="absolute",middleware:a=[],platform:s}=r,i=a.filter(Boolean),l=yield s.isRTL==null?void 0:s.isRTL(t),c=yield s.getElementRects({reference:e,floating:t,strategy:n}),{x:u,y:d}=Ka(c,o,l),h=o,b={},v=0;for(let m=0;m<i.length;m++){let{name:p,fn:w}=i[m],{x:g,y:S,data:T,reset:I}=yield w({x:u,y:d,initialPlacement:o,placement:h,strategy:n,middlewareData:b,rects:c,platform:s,elements:{reference:e,floating:t}});u=g!=null?g:u,d=S!=null?S:d,b=y(x({},b),{[p]:x(x({},b[p]),T)}),I&&v<=50&&(v++,typeof I=="object"&&(I.placement&&(h=I.placement),I.rects&&(c=I.rects===!0?yield s.getElementRects({reference:e,floating:t,strategy:n}):I.rects),{x:u,y:d}=Ka(c,h,l)),m=-1)}return{x:u,y:d,placement:h,strategy:n,middlewareData:b}});function gt(e,t){return ye(this,null,function*(){var r;t===void 0&&(t={});let{x:o,y:n,platform:a,rects:s,elements:i,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:b=0}=Ae(t,e),v=Co(b),p=i[h?d==="floating"?"reference":"floating":d],w=et(yield a.getClippingRect({element:(r=yield a.isElement==null?void 0:a.isElement(p))==null||r?p:p.contextElement||(yield a.getDocumentElement==null?void 0:a.getDocumentElement(i.floating)),boundary:c,rootBoundary:u,strategy:l})),g=d==="floating"?{x:o,y:n,width:s.floating.width,height:s.floating.height}:s.reference,S=yield a.getOffsetParent==null?void 0:a.getOffsetParent(i.floating),T=(yield a.isElement==null?void 0:a.isElement(S))?(yield a.getScale==null?void 0:a.getScale(S))||{x:1,y:1}:{x:1,y:1},I=et(a.convertOffsetParentRelativeRectToViewportRelativeRect?yield a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:i,rect:g,offsetParent:S,strategy:l}):g);return{top:(w.top-I.top+v.top)/T.y,bottom:(I.bottom-w.bottom+v.bottom)/T.y,left:(w.left-I.left+v.left)/T.x,right:(I.right-w.right+v.right)/T.x}})}var Za=e=>({name:"arrow",options:e,fn(r){return ye(this,null,function*(){let{x:o,y:n,placement:a,rects:s,platform:i,elements:l,middlewareData:c}=r,{element:u,padding:d=0}=Ae(e,r)||{};if(u==null)return{};let h=Co(d),b={x:o,y:n},v=Tr(a),m=Pr(v),p=yield i.getDimensions(u),w=v==="y",g=w?"top":"left",S=w?"bottom":"right",T=w?"clientHeight":"clientWidth",I=s.reference[m]+s.reference[v]-b[v]-s.floating[m],O=b[v]-s.reference[v],E=yield i.getOffsetParent==null?void 0:i.getOffsetParent(u),R=E?E[T]:0;(!R||!(yield i.isElement==null?void 0:i.isElement(E)))&&(R=l.floating[T]||s.floating[m]);let $=I/2-O/2,V=R/2-p[m]/2-1,D=ke(h[g],V),z=ke(h[S],V),_=D,ee=R-p[m]-z,A=R/2-p[m]/2+$,L=wr(_,A,ee),X=!c.arrow&&Je(a)!=null&&A!==L&&s.reference[m]/2-(A<_?D:z)-p[m]/2<0,M=X?A<_?A-_:A-ee:0;return{[v]:b[v]+M,data:x({[v]:L,centerOffset:A-L-M},X&&{alignmentOffset:M}),reset:X}})}});var Ja=function(e){return e===void 0&&(e={}),{name:"flip",options:e,fn(r){return ye(this,null,function*(){var o,n;let{placement:a,middlewareData:s,rects:i,initialPlacement:l,platform:c,elements:u}=r,A=Ae(e,r),{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:b,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:p=!0}=A,w=C(A,["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"]);if((o=s.arrow)!=null&&o.alignmentOffset)return{};let g=Me(a),S=Be(l),T=Me(l)===l,I=yield c.isRTL==null?void 0:c.isRTL(u.floating),O=b||(T||!p?[Kt(l)]:Ua(l)),E=m!=="none";!b&&E&&O.push(...Ga(l,p,m,I));let R=[l,...O],$=yield gt(r,w),V=[],D=((n=s.flip)==null?void 0:n.overflows)||[];if(d&&V.push($[g]),h){let L=Ya(a,i,I);V.push($[L[0]],$[L[1]])}if(D=[...D,{placement:a,overflows:V}],!V.every(L=>L<=0)){var z,_;let L=(((z=s.flip)==null?void 0:z.index)||0)+1,X=R[L];if(X)return{data:{index:L,overflows:D},reset:{placement:X}};let M=(_=D.filter(Q=>Q.overflows[0]<=0).sort((Q,G)=>Q.overflows[1]-G.overflows[1])[0])==null?void 0:_.placement;if(!M)switch(v){case"bestFit":{var ee;let Q=(ee=D.filter(G=>{if(E){let pe=Be(G.placement);return pe===S||pe==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(pe=>pe>0).reduce((pe,ze)=>pe+ze,0)]).sort((G,pe)=>G[1]-pe[1])[0])==null?void 0:ee[0];Q&&(M=Q);break}case"initialPlacement":M=l;break}if(a!==M)return{reset:{placement:M}}}return{}})}}};function ja(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Xa(e){return qa.some(t=>e[t]>=0)}var es=function(e){return e===void 0&&(e={}),{name:"hide",options:e,fn(r){return ye(this,null,function*(){let{rects:o}=r,s=Ae(e,r),{strategy:n="referenceHidden"}=s,a=C(s,["strategy"]);switch(n){case"referenceHidden":{let i=yield gt(r,y(x({},a),{elementContext:"reference"})),l=ja(i,o.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:Xa(l)}}}case"escaped":{let i=yield gt(r,y(x({},a),{altBoundary:!0})),l=ja(i,o.floating);return{data:{escapedOffsets:l,escaped:Xa(l)}}}default:return{}}})}}};function Ru(e,t){return ye(this,null,function*(){let{placement:r,platform:o,elements:n}=e,a=yield o.isRTL==null?void 0:o.isRTL(n.floating),s=Me(r),i=Je(r),l=Be(r)==="y",c=["left","top"].includes(s)?-1:1,u=a&&l?-1:1,d=Ae(t,e),{mainAxis:h,crossAxis:b,alignmentAxis:v}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return i&&typeof v=="number"&&(b=i==="end"?v*-1:v),l?{x:b*u,y:h*c}:{x:h*c,y:b*u}})}var ts=function(e){return e===void 0&&(e=0),{name:"offset",options:e,fn(r){return ye(this,null,function*(){var o,n;let{x:a,y:s,placement:i,middlewareData:l}=r,c=yield Ru(r,e);return i===((o=l.offset)==null?void 0:o.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:a+c.x,y:s+c.y,data:y(x({},c),{placement:i})}})}}},rs=function(e){return e===void 0&&(e={}),{name:"shift",options:e,fn(r){return ye(this,null,function*(){let{x:o,y:n,placement:a}=r,w=Ae(e,r),{mainAxis:s=!0,crossAxis:i=!1,limiter:l={fn:g=>{let{x:S,y:T}=g;return{x:S,y:T}}}}=w,c=C(w,["mainAxis","crossAxis","limiter"]),u={x:o,y:n},d=yield gt(r,c),h=Be(Me(a)),b=Cr(h),v=u[b],m=u[h];if(s){let g=b==="y"?"top":"left",S=b==="y"?"bottom":"right",T=v+d[g],I=v-d[S];v=wr(T,v,I)}if(i){let g=h==="y"?"top":"left",S=h==="y"?"bottom":"right",T=m+d[g],I=m-d[S];m=wr(T,m,I)}let p=l.fn(y(x({},r),{[b]:v,[h]:m}));return y(x({},p),{data:{x:p.x-o,y:p.y-n,enabled:{[b]:s,[h]:i}}})})}}},os=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:r,y:o,placement:n,rects:a,middlewareData:s}=t,{offset:i=0,mainAxis:l=!0,crossAxis:c=!0}=Ae(e,t),u={x:r,y:o},d=Be(n),h=Cr(d),b=u[h],v=u[d],m=Ae(i,t),p=typeof m=="number"?{mainAxis:m,crossAxis:0}:x({mainAxis:0,crossAxis:0},m);if(l){let S=h==="y"?"height":"width",T=a.reference[h]-a.floating[S]+p.mainAxis,I=a.reference[h]+a.reference[S]-p.mainAxis;b<T?b=T:b>I&&(b=I)}if(c){var w,g;let S=h==="y"?"width":"height",T=["top","left"].includes(Me(n)),I=a.reference[d]-a.floating[S]+(T&&((w=s.offset)==null?void 0:w[d])||0)+(T?0:p.crossAxis),O=a.reference[d]+a.reference[S]+(T?0:((g=s.offset)==null?void 0:g[d])||0)-(T?p.crossAxis:0);v<I?v=I:v>O&&(v=O)}return{[h]:b,[d]:v}}}},ns=function(e){return e===void 0&&(e={}),{name:"size",options:e,fn(r){return ye(this,null,function*(){var o,n;let{placement:a,rects:s,platform:i,elements:l}=r,D=Ae(e,r),{apply:c=()=>{}}=D,u=C(D,["apply"]),d=yield gt(r,u),h=Me(a),b=Je(a),v=Be(a)==="y",{width:m,height:p}=s.floating,w,g;h==="top"||h==="bottom"?(w=h,g=b===((yield i.isRTL==null?void 0:i.isRTL(l.floating))?"start":"end")?"left":"right"):(g=h,w=b==="end"?"top":"bottom");let S=p-d.top-d.bottom,T=m-d.left-d.right,I=ke(p-d[w],S),O=ke(m-d[g],T),E=!r.middlewareData.shift,R=I,$=O;if((o=r.middlewareData.shift)!=null&&o.enabled.x&&($=T),(n=r.middlewareData.shift)!=null&&n.enabled.y&&(R=S),E&&!b){let z=ue(d.left,0),_=ue(d.right,0),ee=ue(d.top,0),A=ue(d.bottom,0);v?$=m-2*(z!==0||_!==0?z+_:ue(d.left,d.right)):R=p-2*(ee!==0||A!==0?ee+A:ue(d.top,d.bottom))}yield c(y(x({},r),{availableWidth:$,availableHeight:R}));let V=yield i.getDimensions(l.floating);return m!==V.width||p!==V.height?{reset:{rects:!0}}:{}})}}};function Ir(){return typeof window!="undefined"}function rt(e){return ss(e)?(e.nodeName||"").toLowerCase():"#document"}function he(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Re(e){var t;return(t=(ss(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function ss(e){return Ir()?e instanceof Node||e instanceof he(e).Node:!1}function Ce(e){return Ir()?e instanceof Element||e instanceof he(e).Element:!1}function Ee(e){return Ir()?e instanceof HTMLElement||e instanceof he(e).HTMLElement:!1}function as(e){return!Ir()||typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof he(e).ShadowRoot}function yt(e){let{overflow:t,overflowX:r,overflowY:o,display:n}=Pe(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+r)&&!["inline","contents"].includes(n)}function is(e){return["table","td","th"].includes(rt(e))}function Qt(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch(r){return!1}})}function $r(e){let t=Rr(),r=Ce(e)?Pe(e):e;return r.transform!=="none"||r.perspective!=="none"||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||["transform","perspective","filter"].some(o=>(r.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(r.contain||"").includes(o))}function ls(e){let t=Fe(e);for(;Ee(t)&&!ot(t);){if($r(t))return t;if(Qt(t))return null;t=Fe(t)}return null}function Rr(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ot(e){return["html","body","#document"].includes(rt(e))}function Pe(e){return he(e).getComputedStyle(e)}function Zt(e){return Ce(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Fe(e){if(rt(e)==="html")return e;let t=e.assignedSlot||e.parentNode||as(e)&&e.host||Re(e);return as(t)?t.host:t}function cs(e){let t=Fe(e);return ot(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ee(t)&&yt(t)?t:cs(t)}function tt(e,t,r){var o;t===void 0&&(t=[]),r===void 0&&(r=!0);let n=cs(e),a=n===((o=e.ownerDocument)==null?void 0:o.body),s=he(n);if(a){let i=Er(s);return t.concat(s,s.visualViewport||[],yt(n)?n:[],i&&r?tt(i):[])}return t.concat(n,tt(n,[],r))}function Er(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ps(e){let t=Pe(e),r=parseFloat(t.width)||0,o=parseFloat(t.height)||0,n=Ee(e),a=n?e.offsetWidth:r,s=n?e.offsetHeight:o,i=jt(r)!==a||jt(o)!==s;return i&&(r=a,o=s),{width:r,height:o,$:i}}function To(e){return Ce(e)?e:e.contextElement}function St(e){let t=To(e);if(!Ee(t))return $e(1);let r=t.getBoundingClientRect(),{width:o,height:n,$:a}=ps(t),s=(a?jt(r.width):r.width)/o,i=(a?jt(r.height):r.height)/n;return(!s||!Number.isFinite(s))&&(s=1),(!i||!Number.isFinite(i))&&(i=1),{x:s,y:i}}var Eu=$e(0);function fs(e){let t=he(e);return!Rr()||!t.visualViewport?Eu:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Nu(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==he(e)?!1:t}function nt(e,t,r,o){t===void 0&&(t=!1),r===void 0&&(r=!1);let n=e.getBoundingClientRect(),a=To(e),s=$e(1);t&&(o?Ce(o)&&(s=St(o)):s=St(e));let i=Nu(a,r,o)?fs(a):$e(0),l=(n.left+i.x)/s.x,c=(n.top+i.y)/s.y,u=n.width/s.x,d=n.height/s.y;if(a){let h=he(a),b=o&&Ce(o)?he(o):o,v=h,m=Er(v);for(;m&&o&&b!==v;){let p=St(m),w=m.getBoundingClientRect(),g=Pe(m),S=w.left+(m.clientLeft+parseFloat(g.paddingLeft))*p.x,T=w.top+(m.clientTop+parseFloat(g.paddingTop))*p.y;l*=p.x,c*=p.y,u*=p.x,d*=p.y,l+=S,c+=T,v=he(m),m=Er(v)}}return et({width:u,height:d,x:l,y:c})}function Io(e,t){let r=Zt(e).scrollLeft;return t?t.left+r:nt(Re(e)).left+r}function ms(e,t,r){r===void 0&&(r=!1);let o=e.getBoundingClientRect(),n=o.left+t.scrollLeft-(r?0:Io(e,o)),a=o.top+t.scrollTop;return{x:n,y:a}}function Ou(e){let{elements:t,rect:r,offsetParent:o,strategy:n}=e,a=n==="fixed",s=Re(o),i=t?Qt(t.floating):!1;if(o===s||i&&a)return r;let l={scrollLeft:0,scrollTop:0},c=$e(1),u=$e(0),d=Ee(o);if((d||!d&&!a)&&((rt(o)!=="body"||yt(s))&&(l=Zt(o)),Ee(o))){let b=nt(o);c=St(o),u.x=b.x+o.clientLeft,u.y=b.y+o.clientTop}let h=s&&!d&&!a?ms(s,l,!0):$e(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+u.x+h.x,y:r.y*c.y-l.scrollTop*c.y+u.y+h.y}}function ku(e){return Array.from(e.getClientRects())}function Au(e){let t=Re(e),r=Zt(e),o=e.ownerDocument.body,n=ue(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),a=ue(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight),s=-r.scrollLeft+Io(e),i=-r.scrollTop;return Pe(o).direction==="rtl"&&(s+=ue(t.clientWidth,o.clientWidth)-n),{width:n,height:a,x:s,y:i}}function Mu(e,t){let r=he(e),o=Re(e),n=r.visualViewport,a=o.clientWidth,s=o.clientHeight,i=0,l=0;if(n){a=n.width,s=n.height;let c=Rr();(!c||c&&t==="fixed")&&(i=n.offsetLeft,l=n.offsetTop)}return{width:a,height:s,x:i,y:l}}function _u(e,t){let r=nt(e,!0,t==="fixed"),o=r.top+e.clientTop,n=r.left+e.clientLeft,a=Ee(e)?St(e):$e(1),s=e.clientWidth*a.x,i=e.clientHeight*a.y,l=n*a.x,c=o*a.y;return{width:s,height:i,x:l,y:c}}function ds(e,t,r){let o;if(t==="viewport")o=Mu(e,r);else if(t==="document")o=Au(Re(e));else if(Ce(t))o=_u(t,r);else{let n=fs(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return et(o)}function bs(e,t){let r=Fe(e);return r===t||!Ce(r)||ot(r)?!1:Pe(r).position==="fixed"||bs(r,t)}function Lu(e,t){let r=t.get(e);if(r)return r;let o=tt(e,[],!1).filter(i=>Ce(i)&&rt(i)!=="body"),n=null,a=Pe(e).position==="fixed",s=a?Fe(e):e;for(;Ce(s)&&!ot(s);){let i=Pe(s),l=$r(s);!l&&i.position==="fixed"&&(n=null),(a?!l&&!n:!l&&i.position==="static"&&!!n&&["absolute","fixed"].includes(n.position)||yt(s)&&!l&&bs(e,s))?o=o.filter(u=>u!==s):n=i,s=Fe(s)}return t.set(e,o),o}function Vu(e){let{element:t,boundary:r,rootBoundary:o,strategy:n}=e,s=[...r==="clippingAncestors"?Qt(t)?[]:Lu(t,this._c):[].concat(r),o],i=s[0],l=s.reduce((c,u)=>{let d=ds(t,u,n);return c.top=ue(d.top,c.top),c.right=ke(d.right,c.right),c.bottom=ke(d.bottom,c.bottom),c.left=ue(d.left,c.left),c},ds(t,i,n));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Du(e){let{width:t,height:r}=ps(e);return{width:t,height:r}}function zu(e,t,r){let o=Ee(t),n=Re(t),a=r==="fixed",s=nt(e,!0,a,t),i={scrollLeft:0,scrollTop:0},l=$e(0);if(o||!o&&!a)if((rt(t)!=="body"||yt(n))&&(i=Zt(t)),o){let h=nt(t,!0,a,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else n&&(l.x=Io(n));let c=n&&!o&&!a?ms(n,i):$e(0),u=s.left+i.scrollLeft-l.x-c.x,d=s.top+i.scrollTop-l.y-c.y;return{x:u,y:d,width:s.width,height:s.height}}function Po(e){return Pe(e).position==="static"}function us(e,t){if(!Ee(e)||Pe(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Re(e)===r&&(r=r.ownerDocument.body),r}function hs(e,t){let r=he(e);if(Qt(e))return r;if(!Ee(e)){let n=Fe(e);for(;n&&!ot(n);){if(Ce(n)&&!Po(n))return n;n=Fe(n)}return r}let o=us(e,t);for(;o&&is(o)&&Po(o);)o=us(o,t);return o&&ot(o)&&Po(o)&&!$r(o)?r:o||ls(e)||r}var Bu=function(e){return ye(this,null,function*(){let t=this.getOffsetParent||hs,r=this.getDimensions,o=yield r(e.floating);return{reference:zu(e.reference,yield t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}})};function Fu(e){return Pe(e).direction==="rtl"}var xs={convertOffsetParentRelativeRectToViewportRelativeRect:Ou,getDocumentElement:Re,getClippingRect:Vu,getOffsetParent:hs,getElementRects:Bu,getClientRects:ku,getDimensions:Du,getScale:St,isElement:Ce,isRTL:Fu};function Hu(e,t){let r=null,o,n=Re(e);function a(){var i;clearTimeout(o),(i=r)==null||i.disconnect(),r=null}function s(i,l){i===void 0&&(i=!1),l===void 0&&(l=1),a();let{left:c,top:u,width:d,height:h}=e.getBoundingClientRect();if(i||t(),!d||!h)return;let b=Xt(u),v=Xt(n.clientWidth-(c+d)),m=Xt(n.clientHeight-(u+h)),p=Xt(c),g={rootMargin:-b+"px "+-v+"px "+-m+"px "+-p+"px",threshold:ue(0,ke(1,l))||1},S=!0;function T(I){let O=I[0].intersectionRatio;if(O!==l){if(!S)return s();O?s(!1,O):o=setTimeout(()=>{s(!1,1e-7)},1e3)}S=!1}try{r=new IntersectionObserver(T,y(x({},g),{root:n.ownerDocument}))}catch(I){r=new IntersectionObserver(T,g)}r.observe(e)}return s(!0),a}function $o(e,t,r,o){o===void 0&&(o={});let{ancestorScroll:n=!0,ancestorResize:a=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:i=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,c=To(e),u=n||a?[...c?tt(c):[],...tt(t)]:[];u.forEach(w=>{n&&w.addEventListener("scroll",r,{passive:!0}),a&&w.addEventListener("resize",r)});let d=c&&i?Hu(c,r):null,h=-1,b=null;s&&(b=new ResizeObserver(w=>{let[g]=w;g&&g.target===c&&b&&(b.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var S;(S=b)==null||S.observe(t)})),r()}),c&&!l&&b.observe(c),b.observe(t));let v,m=l?nt(e):null;l&&p();function p(){let w=nt(e);m&&(w.x!==m.x||w.y!==m.y||w.width!==m.width||w.height!==m.height)&&r(),m=w,v=requestAnimationFrame(p)}return r(),()=>{var w;u.forEach(g=>{n&&g.removeEventListener("scroll",r),a&&g.removeEventListener("resize",r)}),d==null||d(),(w=b)==null||w.disconnect(),b=null,l&&cancelAnimationFrame(v)}}var vs=ts;var gs=rs,ys=Ja,Ss=ns,ws=es,Ro=Za;var Cs=os,Eo=(e,t,r)=>{let o=new Map,n=x({platform:xs},r),a=y(x({},n.platform),{_c:o});return Qa(e,t,y(x({},n),{platform:a}))};var te=K(require("react"),1),kr=require("react"),Ts=K(require("react-dom"),1);var Nr=typeof document!="undefined"?kr.useLayoutEffect:kr.useEffect;function Or(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 r,o,n;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(o=r;o--!==0;)if(!Or(e[o],t[o]))return!1;return!0}if(n=Object.keys(e),r=n.length,r!==Object.keys(t).length)return!1;for(o=r;o--!==0;)if(!{}.hasOwnProperty.call(t,n[o]))return!1;for(o=r;o--!==0;){let a=n[o];if(!(a==="_owner"&&e.$$typeof)&&!Or(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function Is(e){return typeof window=="undefined"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ps(e,t){let r=Is(e);return Math.round(t*r)/r}function No(e){let t=te.useRef(e);return Nr(()=>{t.current=e}),t}function $s(e){e===void 0&&(e={});let{placement:t="bottom",strategy:r="absolute",middleware:o=[],platform:n,elements:{reference:a,floating:s}={},transform:i=!0,whileElementsMounted:l,open:c}=e,[u,d]=te.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[h,b]=te.useState(o);Or(h,o)||b(o);let[v,m]=te.useState(null),[p,w]=te.useState(null),g=te.useCallback(M=>{M!==O.current&&(O.current=M,m(M))},[]),S=te.useCallback(M=>{M!==E.current&&(E.current=M,w(M))},[]),T=a||v,I=s||p,O=te.useRef(null),E=te.useRef(null),R=te.useRef(u),$=l!=null,V=No(l),D=No(n),z=No(c),_=te.useCallback(()=>{if(!O.current||!E.current)return;let M={placement:t,strategy:r,middleware:h};D.current&&(M.platform=D.current),Eo(O.current,E.current,M).then(Q=>{let G=y(x({},Q),{isPositioned:z.current!==!1});ee.current&&!Or(R.current,G)&&(R.current=G,Ts.flushSync(()=>{d(G)}))})},[h,t,r,D,z]);Nr(()=>{c===!1&&R.current.isPositioned&&(R.current.isPositioned=!1,d(M=>y(x({},M),{isPositioned:!1})))},[c]);let ee=te.useRef(!1);Nr(()=>(ee.current=!0,()=>{ee.current=!1}),[]),Nr(()=>{if(T&&(O.current=T),I&&(E.current=I),T&&I){if(V.current)return V.current(T,I,_);_()}},[T,I,_,V,$]);let A=te.useMemo(()=>({reference:O,floating:E,setReference:g,setFloating:S}),[g,S]),L=te.useMemo(()=>({reference:T,floating:I}),[T,I]),X=te.useMemo(()=>{let M={position:r,left:0,top:0};if(!L.floating)return M;let Q=Ps(L.floating,u.x),G=Ps(L.floating,u.y);return i?x(y(x({},M),{transform:"translate("+Q+"px, "+G+"px)"}),Is(L.floating)>=1.5&&{willChange:"transform"}):{position:r,left:Q,top:G}},[r,i,L.floating,u.x,u.y]);return te.useMemo(()=>y(x({},u),{update:_,refs:A,elements:L,floatingStyles:X}),[u,_,A,L,X])}var Wu=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){let{element:o,padding:n}=typeof e=="function"?e(r):e;return o&&t(o)?o.current!=null?Ro({element:o.current,padding:n}).fn(r):{}:o?Ro({element:o,padding:n}).fn(r):{}}}},Rs=(e,t)=>y(x({},vs(e)),{options:[e,t]}),Es=(e,t)=>y(x({},gs(e)),{options:[e,t]}),Ns=(e,t)=>y(x({},Cs(e)),{options:[e,t]}),Os=(e,t)=>y(x({},ys(e)),{options:[e,t]}),ks=(e,t)=>y(x({},Ss(e)),{options:[e,t]});var As=(e,t)=>y(x({},ws(e)),{options:[e,t]});var Ms=(e,t)=>y(x({},Wu(e)),{options:[e,t]});var Vs=require("@radix-ui/react-context");var _s=require("react");function Ls(e){let[t,r]=(0,_s.useState)(void 0);return ge(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let o=new ResizeObserver(n=>{if(!Array.isArray(n)||!n.length)return;let a=n[0],s,i;if("borderBoxSize"in a){let l=a.borderBoxSize,c=Array.isArray(l)?l[0]:l;s=c.inlineSize,i=c.blockSize}else s=e.offsetWidth,i=e.offsetHeight;r({width:s,height:i})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else r(void 0)},[e]),t}var Ds="Popper",[zs,Oo]=(0,Vs.createContextScope)(Ds),[qu,Bs]=zs(Ds),Yu=e=>{let{__scopePopper:t,children:r}=e,[o,n]=(0,ne.useState)(null);return(0,ne.createElement)(qu,{scope:t,anchor:o,onAnchorChange:n},r)},Uu="PopperAnchor",Gu=(0,ne.forwardRef)((e,t)=>{let l=e,{__scopePopper:r,virtualRef:o}=l,n=C(l,["__scopePopper","virtualRef"]),a=Bs(Uu,r),s=(0,ne.useRef)(null),i=re(t,s);return(0,ne.useEffect)(()=>{a.onAnchorChange((o==null?void 0:o.current)||s.current)}),o?null:(0,ne.createElement)(oe.div,H({},n,{ref:i}))}),Fs="PopperContent",[Ku,Tx]=zs(Fs),ju=(0,ne.forwardRef)((e,t)=>{var r,o,n,a,s,i,l,c;let me=e,{__scopePopper:u,side:d="bottom",sideOffset:h=0,align:b="center",alignOffset:v=0,arrowPadding:m=0,collisionBoundary:p=[],collisionPadding:w=0,sticky:g="partial",hideWhenDetached:S=!1,avoidCollisions:T=!0,onPlaced:I}=me,O=C(me,["__scopePopper","side","sideOffset","align","alignOffset","arrowPadding","collisionBoundary","collisionPadding","sticky","hideWhenDetached","avoidCollisions","onPlaced"]),E=Bs(Fs,u),[R,$]=(0,ne.useState)(null),V=re(t,ce=>$(ce)),[D,z]=(0,ne.useState)(null),_=Ls(D),ee=(r=_==null?void 0:_.width)!==null&&r!==void 0?r:0,A=(o=_==null?void 0:_.height)!==null&&o!==void 0?o:0,L=d+(b!=="center"?"-"+b:""),X=typeof w=="number"?w:x({top:0,right:0,bottom:0,left:0},w),M=Array.isArray(p)?p:[p],Q=M.length>0,G={padding:X,boundary:M.filter(Xu),altBoundary:Q},{refs:pe,floatingStyles:ze,placement:Ft,isPositioned:Ue,middlewareData:fe}=$s({strategy:"fixed",placement:L,whileElementsMounted:$o,elements:{reference:E.anchor},middleware:[Rs({mainAxis:h+A,alignmentAxis:v}),T&&Es(x({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?Ns():void 0},G)),T&&Os(x({},G)),ks(y(x({},G),{apply:({elements:ce,rects:Ht,availableWidth:Wt,availableH