vite-plugin-asset-manager 1.0.2 → 1.0.4

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.
@@ -0,0 +1,12 @@
1
+ import{r as d,R as xi,a as At,j as ce,b as wi,c as te,d as jl}from"./vendor-react-CZ2o2ZY4.js";function Po(){return typeof window<"u"}function Kt(e){return Or(e)?(e.nodeName||"").toLowerCase():"#document"}function Je(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function It(e){var t;return(t=(Or(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Or(e){return Po()?e instanceof Node||e instanceof Je(e).Node:!1}function Le(e){return Po()?e instanceof Element||e instanceof Je(e).Element:!1}function Ue(e){return Po()?e instanceof HTMLElement||e instanceof Je(e).HTMLElement:!1}function ur(e){return!Po()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Je(e).ShadowRoot}const Ul=new Set(["inline","contents"]);function Gt(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=mt(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!Ul.has(r)}const Wl=new Set(["table","td","th"]);function $l(e){return Wl.has(Kt(e))}const Yl=[":popover-open",":modal"];function Oo(e){return Yl.some(t=>{try{return e.matches(t)}catch{return!1}})}const Kl=["transform","translate","scale","rotate","perspective"],Gl=["transform","translate","scale","rotate","perspective","filter"],ql=["paint","layout","strict","content"];function Ar(e){const t=Ao(),n=Le(e)?mt(e):e;return Kl.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Gl.some(o=>(n.willChange||"").includes(o))||ql.some(o=>(n.contain||"").includes(o))}function Xl(e){let t=Tt(e);for(;Ue(t)&&!Et(t);){if(Ar(t))return t;if(Oo(t))return null;t=Tt(t)}return null}function Ao(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Zl=new Set(["html","body","#document"]);function Et(e){return Zl.has(Kt(e))}function mt(e){return Je(e).getComputedStyle(e)}function Lo(e){return Le(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Tt(e){if(Kt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ur(e)&&e.host||It(e);return ur(t)?t.host:t}function Ri(e){const t=Tt(e);return Et(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ue(t)&&Gt(t)?t:Ri(t)}function zt(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=Ri(e),s=r===((o=e.ownerDocument)==null?void 0:o.body),i=Je(r);if(s){const a=dr(i);return t.concat(i,i.visualViewport||[],Gt(r)?r:[],a&&n?zt(a):[])}return t.concat(r,zt(r,[],n))}function dr(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const vs={};function tt(e,t){const n=d.useRef(vs);return n.current===vs&&(n.current=e(t)),n}const Go=xi[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],Jl=Go&&Go!==d.useLayoutEffect?Go:e=>e();function ie(e){const t=tt(Ql).current;return t.next=e,Jl(t.effect),t.trampoline}function Ql(){const e={next:void 0,callback:ec,trampoline:(...t)=>e.callback?.(...t),effect:()=>{e.callback=e.next}};return e}function ec(){}const tc={...xi},nc=()=>{},le=typeof document<"u"?d.useLayoutEffect:nc;function fr(e,t){if(e&&!t)return e;if(!e&&t)return t;if(e||t)return{...e,...t}}const Dn={};function $t(e,t,n,o,r){let s={...pr(e,Dn)};return t&&(s=Ln(s,t)),n&&(s=Ln(s,n)),o&&(s=Ln(s,o)),r&&(s=Ln(s,r)),s}function oc(e){if(e.length===0)return Dn;if(e.length===1)return pr(e[0],Dn);let t={...pr(e[0],Dn)};for(let n=1;n<e.length;n+=1)t=Ln(t,e[n]);return t}function Ln(e,t){return Ei(t)?t(e):rc(e,t)}function rc(e,t){if(!t)return e;for(const n in t){const o=t[n];switch(n){case"style":{e[n]=fr(e.style,o);break}case"className":{e[n]=Si(e.className,o);break}default:sc(n,o)?e[n]=ic(e[n],o):e[n]=o}}return e}function sc(e,t){const n=e.charCodeAt(0),o=e.charCodeAt(1),r=e.charCodeAt(2);return n===111&&o===110&&r>=65&&r<=90&&(typeof t=="function"||typeof t>"u")}function Ei(e){return typeof e=="function"}function pr(e,t){return Ei(e)?e(t):e??Dn}function ic(e,t){return t?e?n=>{if(ac(n)){const r=n;gr(r);const s=t(r);return r.baseUIHandlerPrevented||e?.(r),s}const o=t(n);return e?.(n),o}:t:e}function gr(e){return e.preventBaseUIHandler=()=>{e.baseUIHandlerPrevented=!0},e}function Si(e,t){return t?e?t+" "+e:t:e}function ac(e){return e!=null&&typeof e=="object"&&"nativeEvent"in e}function qe(e,...t){const n=new URL("https://base-ui.com/production-error");return n.searchParams.set("code",e.toString()),t.forEach(o=>n.searchParams.append("args[]",o)),`Base UI error #${e}; visit ${n} for the full message.`}const Ti=d.createContext(void 0);function Lr(e=!1){const t=d.useContext(Ti);if(t===void 0&&!e)throw new Error(qe(16));return t}function lc(e){const{focusableWhenDisabled:t,disabled:n,composite:o=!1,tabIndex:r=0,isNativeButton:s}=e,i=o&&t!==!1,a=o&&t===!1;return{props:d.useMemo(()=>{const c={onKeyDown(f){n&&t&&f.key!=="Tab"&&f.preventDefault()}};return o||(c.tabIndex=r,!s&&n&&(c.tabIndex=t?r:-1)),(s&&(t||i)||!s&&n)&&(c["aria-disabled"]=n),s&&(!t||a)&&(c.disabled=n),c},[o,n,t,i,a,s,r])}}function Nt(e={}){const{disabled:t=!1,focusableWhenDisabled:n,tabIndex:o=0,native:r=!0}=e,s=d.useRef(null),i=Lr(!0)!==void 0,a=ie(()=>{const p=s.current;return!!(p?.tagName==="A"&&p?.href)}),{props:u}=lc({focusableWhenDisabled:n,disabled:t,composite:i,tabIndex:o,isNativeButton:r}),c=d.useCallback(()=>{const p=s.current;cc(p)&&i&&t&&u.disabled===void 0&&p.disabled&&(p.disabled=!1)},[t,u.disabled,i]);le(c,[c]);const f=d.useCallback((p={})=>{const{onClick:m,onMouseDown:h,onKeyUp:g,onKeyDown:y,onPointerDown:b,...v}=p;return $t({type:r?"button":void 0,onClick(x){if(t){x.preventDefault();return}m?.(x)},onMouseDown(x){t||h?.(x)},onKeyDown(x){if(t||(gr(x),y?.(x)),x.baseUIHandlerPrevented)return;const w=x.target===x.currentTarget&&!r&&!a()&&!t,E=x.key==="Enter",C=x.key===" ";w&&((C||E)&&x.preventDefault(),E&&m?.(x))},onKeyUp(x){t||(gr(x),g?.(x)),!x.baseUIHandlerPrevented&&x.target===x.currentTarget&&!r&&!t&&x.key===" "&&m?.(x)},onPointerDown(x){if(t){x.preventDefault();return}b?.(x)}},r?void 0:{role:"button"},u,v)},[t,u,r,a]),l=ie(p=>{s.current=p,c()});return{getButtonProps:f,buttonRef:l}}function cc(e){return Ue(e)&&e.tagName==="BUTTON"}function Ct(e,t,n,o){const r=tt(Ci).current;return dc(r,e,t,n,o)&&Ii(r,[e,t,n,o]),r.callback}function uc(e){const t=tt(Ci).current;return fc(t,e)&&Ii(t,e),t.callback}function Ci(){return{callback:null,cleanup:null,refs:[]}}function dc(e,t,n,o,r){return e.refs[0]!==t||e.refs[1]!==n||e.refs[2]!==o||e.refs[3]!==r}function fc(e,t){return e.refs.length!==t.length||e.refs.some((n,o)=>n!==t[o])}function Ii(e,t){if(e.refs=t,t.every(n=>n==null)){e.callback=null;return}e.callback=n=>{if(e.cleanup&&(e.cleanup(),e.cleanup=null),n!=null){const o=Array(t.length).fill(null);for(let r=0;r<t.length;r+=1){const s=t[r];if(s!=null)switch(typeof s){case"function":{const i=s(n);typeof i=="function"&&(o[r]=i);break}case"object":{s.current=n;break}}}e.cleanup=()=>{for(let r=0;r<t.length;r+=1){const s=t[r];if(s!=null)switch(typeof s){case"function":{const i=o[r];typeof i=="function"?i():s(null);break}case"object":{s.current=null;break}}}}}}}const pc=parseInt(d.version,10);function Dr(e){return pc>=e}function xs(e){if(!d.isValidElement(e))return null;const t=e,n=t.props;return(Dr(19)?n?.ref:t.ref)??null}function gc(e,t){const n={};for(const o in e){const r=e[o];if(t?.hasOwnProperty(o)){const s=t[o](r);s!=null&&Object.assign(n,s);continue}r===!0?n[`data-${o.toLowerCase()}`]="":r&&(n[`data-${o.toLowerCase()}`]=r.toString())}return n}function mc(e,t){return typeof e=="function"?e(t):e}function hc(e,t){return typeof e=="function"?e(t):e}function lt(){}const Yt=Object.freeze([]),Ye=Object.freeze({}),bc=500,yc=500,vc={style:{transition:"none"}},Mi="data-base-ui-click-trigger",ki={fallbackAxisSide:"none"},xc={fallbackAxisSide:"end"},wc={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function Ae(e,t,n={}){const o=t.render,r=Rc(t,n);if(n.enabled===!1)return null;const s=n.state??Ye;return Sc(e,o,r,s)}function Rc(e,t={}){const{className:n,style:o,render:r}=e,{state:s=Ye,ref:i,props:a,stateAttributesMapping:u,enabled:c=!0}=t,f=c?mc(n,s):void 0,l=c?hc(o,s):void 0,p=c?gc(s,u):Ye,m=c?fr(p,Array.isArray(a)?oc(a):a)??Ye:Ye;return typeof document<"u"&&(c?Array.isArray(i)?m.ref=uc([m.ref,xs(r),...i]):m.ref=Ct(m.ref,xs(r),i):Ct(null,null)),c?(f!==void 0&&(m.className=Si(m.className,f)),l!==void 0&&(m.style=fr(m.style,l)),m):Ye}const Ec=Symbol.for("react.lazy");function Sc(e,t,n,o){if(t){if(typeof t=="function")return t(n,o);const r=$t(n,t.props);r.ref=n.ref;let s=t;return s?.$$typeof===Ec&&(s=d.Children.toArray(t)[0]),d.cloneElement(s,r)}if(e&&typeof e=="string")return Tc(e,n);throw new Error(qe(8))}function Tc(e,t){return e==="button"?d.createElement("button",{type:"button",...t,key:t.key}):e==="img"?d.createElement("img",{alt:"",...t,key:t.key}):d.createElement(e,t)}const sm=d.forwardRef(function(t,n){const{render:o,className:r,disabled:s=!1,focusableWhenDisabled:i=!1,nativeButton:a=!0,...u}=t,{getButtonProps:c,buttonRef:f}=Nt({disabled:s,focusableWhenDisabled:i,native:a});return Ae("button",t,{state:{disabled:s},ref:[n,f],props:[u,c]})});function Pi(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=Pi(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function Cc(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=Pi(e))&&(o&&(o+=" "),o+=t);return o}const ws=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Rs=Cc,im=(e,t)=>n=>{var o;if(t?.variants==null)return Rs(e,n?.class,n?.className);const{variants:r,defaultVariants:s}=t,i=Object.keys(r).map(c=>{const f=n?.[c],l=s?.[c];if(f===null)return null;const p=ws(f)||ws(l);return r[c][p]}),a=n&&Object.entries(n).reduce((c,f)=>{let[l,p]=f;return p===void 0||(c[l]=p),c},{}),u=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((c,f)=>{let{class:l,className:p,...m}=f;return Object.entries(m).every(h=>{let[g,y]=h;return Array.isArray(y)?y.includes({...s,...a}[g]):{...s,...a}[g]===y})?[...c,l,p]:c},[]);return Rs(e,i,u,n?.class,n?.className)},Ic=(e,t)=>{const n=new Array(e.length+t.length);for(let o=0;o<e.length;o++)n[o]=e[o];for(let o=0;o<t.length;o++)n[e.length+o]=t[o];return n},Mc=(e,t)=>({classGroupId:e,validator:t}),Oi=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),ho="-",Es=[],kc="arbitrary..",Pc=e=>{const t=Ac(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return Oc(i);const a=i.split(ho),u=a[0]===""&&a.length>1?1:0;return Ai(a,u,t)},getConflictingClassGroupIds:(i,a)=>{if(a){const u=o[i],c=n[i];return u?c?Ic(c,u):u:c||Es}return n[i]||Es}}},Ai=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const r=e[t],s=n.nextPart.get(r);if(s){const c=Ai(e,t+1,s);if(c)return c}const i=n.validators;if(i===null)return;const a=t===0?e.join(ho):e.slice(t).join(ho),u=i.length;for(let c=0;c<u;c++){const f=i[c];if(f.validator(a))return f.classGroupId}},Oc=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),o=t.slice(0,n);return o?kc+o:void 0})(),Ac=e=>{const{theme:t,classGroups:n}=e;return Lc(n,t)},Lc=(e,t)=>{const n=Oi();for(const o in e){const r=e[o];Nr(r,n,o,t)}return n},Nr=(e,t,n,o)=>{const r=e.length;for(let s=0;s<r;s++){const i=e[s];Dc(i,t,n,o)}},Dc=(e,t,n,o)=>{if(typeof e=="string"){Nc(e,t,n);return}if(typeof e=="function"){Fc(e,t,n,o);return}Vc(e,t,n,o)},Nc=(e,t,n)=>{const o=e===""?t:Li(t,e);o.classGroupId=n},Fc=(e,t,n,o)=>{if(Bc(e)){Nr(e(o),t,n,o);return}t.validators===null&&(t.validators=[]),t.validators.push(Mc(n,e))},Vc=(e,t,n,o)=>{const r=Object.entries(e),s=r.length;for(let i=0;i<s;i++){const[a,u]=r[i];Nr(u,Li(t,a),n,o)}},Li=(e,t)=>{let n=e;const o=t.split(ho),r=o.length;for(let s=0;s<r;s++){const i=o[s];let a=n.nextPart.get(i);a||(a=Oi(),n.nextPart.set(i,a)),n=a}return n},Bc=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Hc=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),o=Object.create(null);const r=(s,i)=>{n[s]=i,t++,t>e&&(t=0,o=n,n=Object.create(null))};return{get(s){let i=n[s];if(i!==void 0)return i;if((i=o[s])!==void 0)return r(s,i),i},set(s,i){s in n?n[s]=i:r(s,i)}}},mr="!",Ss=":",_c=[],Ts=(e,t,n,o,r)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:o,isExternal:r}),zc=e=>{const{prefix:t,experimentalParseClassName:n}=e;let o=r=>{const s=[];let i=0,a=0,u=0,c;const f=r.length;for(let g=0;g<f;g++){const y=r[g];if(i===0&&a===0){if(y===Ss){s.push(r.slice(u,g)),u=g+1;continue}if(y==="/"){c=g;continue}}y==="["?i++:y==="]"?i--:y==="("?a++:y===")"&&a--}const l=s.length===0?r:r.slice(u);let p=l,m=!1;l.endsWith(mr)?(p=l.slice(0,-1),m=!0):l.startsWith(mr)&&(p=l.slice(1),m=!0);const h=c&&c>u?c-u:void 0;return Ts(s,m,p,h)};if(t){const r=t+Ss,s=o;o=i=>i.startsWith(r)?s(i.slice(r.length)):Ts(_c,!1,i,void 0,!0)}if(n){const r=o;o=s=>n({className:s,parseClassName:r})}return o},jc=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,o)=>{t.set(n,1e6+o)}),n=>{const o=[];let r=[];for(let s=0;s<n.length;s++){const i=n[s],a=i[0]==="[",u=t.has(i);a||u?(r.length>0&&(r.sort(),o.push(...r),r=[]),o.push(i)):r.push(i)}return r.length>0&&(r.sort(),o.push(...r)),o}},Uc=e=>({cache:Hc(e.cacheSize),parseClassName:zc(e),sortModifiers:jc(e),...Pc(e)}),Wc=/\s+/,$c=(e,t)=>{const{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:r,sortModifiers:s}=t,i=[],a=e.trim().split(Wc);let u="";for(let c=a.length-1;c>=0;c-=1){const f=a[c],{isExternal:l,modifiers:p,hasImportantModifier:m,baseClassName:h,maybePostfixModifierPosition:g}=n(f);if(l){u=f+(u.length>0?" "+u:u);continue}let y=!!g,b=o(y?h.substring(0,g):h);if(!b){if(!y){u=f+(u.length>0?" "+u:u);continue}if(b=o(h),!b){u=f+(u.length>0?" "+u:u);continue}y=!1}const v=p.length===0?"":p.length===1?p[0]:s(p).join(":"),R=m?v+mr:v,x=R+b;if(i.indexOf(x)>-1)continue;i.push(x);const w=r(b,y);for(let E=0;E<w.length;++E){const C=w[E];i.push(R+C)}u=f+(u.length>0?" "+u:u)}return u},Yc=(...e)=>{let t=0,n,o,r="";for(;t<e.length;)(n=e[t++])&&(o=Di(n))&&(r&&(r+=" "),r+=o);return r},Di=e=>{if(typeof e=="string")return e;let t,n="";for(let o=0;o<e.length;o++)e[o]&&(t=Di(e[o]))&&(n&&(n+=" "),n+=t);return n},Kc=(e,...t)=>{let n,o,r,s;const i=u=>{const c=t.reduce((f,l)=>l(f),e());return n=Uc(c),o=n.cache.get,r=n.cache.set,s=a,a(u)},a=u=>{const c=o(u);if(c)return c;const f=$c(u,n);return r(u,f),f};return s=i,(...u)=>s(Yc(...u))},Gc=[],et=e=>{const t=n=>n[e]||Gc;return t.isThemeGetter=!0,t},Ni=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Fi=/^\((?:(\w[\w-]*):)?(.+)\)$/i,qc=/^\d+\/\d+$/,Xc=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Zc=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Jc=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Qc=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,eu=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,un=e=>qc.test(e),Ie=e=>!!e&&!Number.isNaN(Number(e)),Ht=e=>!!e&&Number.isInteger(Number(e)),qo=e=>e.endsWith("%")&&Ie(e.slice(0,-1)),Pt=e=>Xc.test(e),Vi=()=>!0,tu=e=>Zc.test(e)&&!Jc.test(e),Fr=()=>!1,nu=e=>Qc.test(e),ou=e=>eu.test(e),ru=e=>!de(e)&&!fe(e),su=e=>qt(e,_i,Fr),de=e=>Ni.test(e),Qt=e=>qt(e,zi,tu),Cs=e=>qt(e,pu,Ie),iu=e=>qt(e,Ui,Vi),au=e=>qt(e,ji,Fr),Is=e=>qt(e,Bi,Fr),lu=e=>qt(e,Hi,ou),qn=e=>qt(e,Wi,nu),fe=e=>Fi.test(e),On=e=>ln(e,zi),cu=e=>ln(e,ji),Ms=e=>ln(e,Bi),uu=e=>ln(e,_i),du=e=>ln(e,Hi),Xn=e=>ln(e,Wi,!0),fu=e=>ln(e,Ui,!0),qt=(e,t,n)=>{const o=Ni.exec(e);return o?o[1]?t(o[1]):n(o[2]):!1},ln=(e,t,n=!1)=>{const o=Fi.exec(e);return o?o[1]?t(o[1]):n:!1},Bi=e=>e==="position"||e==="percentage",Hi=e=>e==="image"||e==="url",_i=e=>e==="length"||e==="size"||e==="bg-size",zi=e=>e==="length",pu=e=>e==="number",ji=e=>e==="family-name",Ui=e=>e==="number"||e==="weight",Wi=e=>e==="shadow",gu=()=>{const e=et("color"),t=et("font"),n=et("text"),o=et("font-weight"),r=et("tracking"),s=et("leading"),i=et("breakpoint"),a=et("container"),u=et("spacing"),c=et("radius"),f=et("shadow"),l=et("inset-shadow"),p=et("text-shadow"),m=et("drop-shadow"),h=et("blur"),g=et("perspective"),y=et("aspect"),b=et("ease"),v=et("animate"),R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],x=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],w=()=>[...x(),fe,de],E=()=>["auto","hidden","clip","visible","scroll"],C=()=>["auto","contain","none"],T=()=>[fe,de,u],A=()=>[un,"full","auto",...T()],N=()=>[Ht,"none","subgrid",fe,de],F=()=>["auto",{span:["full",Ht,fe,de]},Ht,fe,de],L=()=>[Ht,"auto",fe,de],k=()=>["auto","min","max","fr",fe,de],P=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],B=()=>["start","end","center","stretch","center-safe","end-safe"],D=()=>["auto",...T()],I=()=>[un,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...T()],S=()=>[e,fe,de],M=()=>[...x(),Ms,Is,{position:[fe,de]}],H=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Z=()=>["auto","cover","contain",uu,su,{size:[fe,de]}],$=()=>[qo,On,Qt],_=()=>["","none","full",c,fe,de],V=()=>["",Ie,On,Qt],J=()=>["solid","dashed","dotted","double"],z=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Y=()=>[Ie,qo,Ms,Is],ee=()=>["","none",h,fe,de],Q=()=>["none",Ie,fe,de],pe=()=>["none",Ie,fe,de],re=()=>[Ie,fe,de],O=()=>[un,"full",...T()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Pt],breakpoint:[Pt],color:[Vi],container:[Pt],"drop-shadow":[Pt],ease:["in","out","in-out"],font:[ru],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Pt],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Pt],shadow:[Pt],spacing:["px",Ie],text:[Pt],"text-shadow":[Pt],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",un,de,fe,y]}],container:["container"],columns:[{columns:[Ie,de,fe,a]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:w()}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:A()}],"inset-x":[{"inset-x":A()}],"inset-y":[{"inset-y":A()}],start:[{start:A()}],end:[{end:A()}],top:[{top:A()}],right:[{right:A()}],bottom:[{bottom:A()}],left:[{left:A()}],visibility:["visible","invisible","collapse"],z:[{z:[Ht,"auto",fe,de]}],basis:[{basis:[un,"full","auto",a,...T()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ie,un,"auto","initial","none",de]}],grow:[{grow:["",Ie,fe,de]}],shrink:[{shrink:["",Ie,fe,de]}],order:[{order:[Ht,"first","last","none",fe,de]}],"grid-cols":[{"grid-cols":N()}],"col-start-end":[{col:F()}],"col-start":[{"col-start":L()}],"col-end":[{"col-end":L()}],"grid-rows":[{"grid-rows":N()}],"row-start-end":[{row:F()}],"row-start":[{"row-start":L()}],"row-end":[{"row-end":L()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:T()}],"gap-x":[{"gap-x":T()}],"gap-y":[{"gap-y":T()}],"justify-content":[{justify:[...P(),"normal"]}],"justify-items":[{"justify-items":[...B(),"normal"]}],"justify-self":[{"justify-self":["auto",...B()]}],"align-content":[{content:["normal",...P()]}],"align-items":[{items:[...B(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...B(),{baseline:["","last"]}]}],"place-content":[{"place-content":P()}],"place-items":[{"place-items":[...B(),"baseline"]}],"place-self":[{"place-self":["auto",...B()]}],p:[{p:T()}],px:[{px:T()}],py:[{py:T()}],ps:[{ps:T()}],pe:[{pe:T()}],pt:[{pt:T()}],pr:[{pr:T()}],pb:[{pb:T()}],pl:[{pl:T()}],m:[{m:D()}],mx:[{mx:D()}],my:[{my:D()}],ms:[{ms:D()}],me:[{me:D()}],mt:[{mt:D()}],mr:[{mr:D()}],mb:[{mb:D()}],ml:[{ml:D()}],"space-x":[{"space-x":T()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":T()}],"space-y-reverse":["space-y-reverse"],size:[{size:I()}],w:[{w:[a,"screen",...I()]}],"min-w":[{"min-w":[a,"screen","none",...I()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[i]},...I()]}],h:[{h:["screen","lh",...I()]}],"min-h":[{"min-h":["screen","lh","none",...I()]}],"max-h":[{"max-h":["screen","lh",...I()]}],"font-size":[{text:["base",n,On,Qt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,fu,iu]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",qo,de]}],"font-family":[{font:[cu,au,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,fe,de]}],"line-clamp":[{"line-clamp":[Ie,"none",fe,Cs]}],leading:[{leading:[s,...T()]}],"list-image":[{"list-image":["none",fe,de]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",fe,de]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:S()}],"text-color":[{text:S()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...J(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ie,"from-font","auto",fe,Qt]}],"text-decoration-color":[{decoration:S()}],"underline-offset":[{"underline-offset":[Ie,"auto",fe,de]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:T()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",fe,de]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",fe,de]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:M()}],"bg-repeat":[{bg:H()}],"bg-size":[{bg:Z()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Ht,fe,de],radial:["",fe,de],conic:[Ht,fe,de]},du,lu]}],"bg-color":[{bg:S()}],"gradient-from-pos":[{from:$()}],"gradient-via-pos":[{via:$()}],"gradient-to-pos":[{to:$()}],"gradient-from":[{from:S()}],"gradient-via":[{via:S()}],"gradient-to":[{to:S()}],rounded:[{rounded:_()}],"rounded-s":[{"rounded-s":_()}],"rounded-e":[{"rounded-e":_()}],"rounded-t":[{"rounded-t":_()}],"rounded-r":[{"rounded-r":_()}],"rounded-b":[{"rounded-b":_()}],"rounded-l":[{"rounded-l":_()}],"rounded-ss":[{"rounded-ss":_()}],"rounded-se":[{"rounded-se":_()}],"rounded-ee":[{"rounded-ee":_()}],"rounded-es":[{"rounded-es":_()}],"rounded-tl":[{"rounded-tl":_()}],"rounded-tr":[{"rounded-tr":_()}],"rounded-br":[{"rounded-br":_()}],"rounded-bl":[{"rounded-bl":_()}],"border-w":[{border:V()}],"border-w-x":[{"border-x":V()}],"border-w-y":[{"border-y":V()}],"border-w-s":[{"border-s":V()}],"border-w-e":[{"border-e":V()}],"border-w-t":[{"border-t":V()}],"border-w-r":[{"border-r":V()}],"border-w-b":[{"border-b":V()}],"border-w-l":[{"border-l":V()}],"divide-x":[{"divide-x":V()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":V()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...J(),"hidden","none"]}],"divide-style":[{divide:[...J(),"hidden","none"]}],"border-color":[{border:S()}],"border-color-x":[{"border-x":S()}],"border-color-y":[{"border-y":S()}],"border-color-s":[{"border-s":S()}],"border-color-e":[{"border-e":S()}],"border-color-t":[{"border-t":S()}],"border-color-r":[{"border-r":S()}],"border-color-b":[{"border-b":S()}],"border-color-l":[{"border-l":S()}],"divide-color":[{divide:S()}],"outline-style":[{outline:[...J(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ie,fe,de]}],"outline-w":[{outline:["",Ie,On,Qt]}],"outline-color":[{outline:S()}],shadow:[{shadow:["","none",f,Xn,qn]}],"shadow-color":[{shadow:S()}],"inset-shadow":[{"inset-shadow":["none",l,Xn,qn]}],"inset-shadow-color":[{"inset-shadow":S()}],"ring-w":[{ring:V()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:S()}],"ring-offset-w":[{"ring-offset":[Ie,Qt]}],"ring-offset-color":[{"ring-offset":S()}],"inset-ring-w":[{"inset-ring":V()}],"inset-ring-color":[{"inset-ring":S()}],"text-shadow":[{"text-shadow":["none",p,Xn,qn]}],"text-shadow-color":[{"text-shadow":S()}],opacity:[{opacity:[Ie,fe,de]}],"mix-blend":[{"mix-blend":[...z(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":z()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ie]}],"mask-image-linear-from-pos":[{"mask-linear-from":Y()}],"mask-image-linear-to-pos":[{"mask-linear-to":Y()}],"mask-image-linear-from-color":[{"mask-linear-from":S()}],"mask-image-linear-to-color":[{"mask-linear-to":S()}],"mask-image-t-from-pos":[{"mask-t-from":Y()}],"mask-image-t-to-pos":[{"mask-t-to":Y()}],"mask-image-t-from-color":[{"mask-t-from":S()}],"mask-image-t-to-color":[{"mask-t-to":S()}],"mask-image-r-from-pos":[{"mask-r-from":Y()}],"mask-image-r-to-pos":[{"mask-r-to":Y()}],"mask-image-r-from-color":[{"mask-r-from":S()}],"mask-image-r-to-color":[{"mask-r-to":S()}],"mask-image-b-from-pos":[{"mask-b-from":Y()}],"mask-image-b-to-pos":[{"mask-b-to":Y()}],"mask-image-b-from-color":[{"mask-b-from":S()}],"mask-image-b-to-color":[{"mask-b-to":S()}],"mask-image-l-from-pos":[{"mask-l-from":Y()}],"mask-image-l-to-pos":[{"mask-l-to":Y()}],"mask-image-l-from-color":[{"mask-l-from":S()}],"mask-image-l-to-color":[{"mask-l-to":S()}],"mask-image-x-from-pos":[{"mask-x-from":Y()}],"mask-image-x-to-pos":[{"mask-x-to":Y()}],"mask-image-x-from-color":[{"mask-x-from":S()}],"mask-image-x-to-color":[{"mask-x-to":S()}],"mask-image-y-from-pos":[{"mask-y-from":Y()}],"mask-image-y-to-pos":[{"mask-y-to":Y()}],"mask-image-y-from-color":[{"mask-y-from":S()}],"mask-image-y-to-color":[{"mask-y-to":S()}],"mask-image-radial":[{"mask-radial":[fe,de]}],"mask-image-radial-from-pos":[{"mask-radial-from":Y()}],"mask-image-radial-to-pos":[{"mask-radial-to":Y()}],"mask-image-radial-from-color":[{"mask-radial-from":S()}],"mask-image-radial-to-color":[{"mask-radial-to":S()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":x()}],"mask-image-conic-pos":[{"mask-conic":[Ie]}],"mask-image-conic-from-pos":[{"mask-conic-from":Y()}],"mask-image-conic-to-pos":[{"mask-conic-to":Y()}],"mask-image-conic-from-color":[{"mask-conic-from":S()}],"mask-image-conic-to-color":[{"mask-conic-to":S()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:M()}],"mask-repeat":[{mask:H()}],"mask-size":[{mask:Z()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",fe,de]}],filter:[{filter:["","none",fe,de]}],blur:[{blur:ee()}],brightness:[{brightness:[Ie,fe,de]}],contrast:[{contrast:[Ie,fe,de]}],"drop-shadow":[{"drop-shadow":["","none",m,Xn,qn]}],"drop-shadow-color":[{"drop-shadow":S()}],grayscale:[{grayscale:["",Ie,fe,de]}],"hue-rotate":[{"hue-rotate":[Ie,fe,de]}],invert:[{invert:["",Ie,fe,de]}],saturate:[{saturate:[Ie,fe,de]}],sepia:[{sepia:["",Ie,fe,de]}],"backdrop-filter":[{"backdrop-filter":["","none",fe,de]}],"backdrop-blur":[{"backdrop-blur":ee()}],"backdrop-brightness":[{"backdrop-brightness":[Ie,fe,de]}],"backdrop-contrast":[{"backdrop-contrast":[Ie,fe,de]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ie,fe,de]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ie,fe,de]}],"backdrop-invert":[{"backdrop-invert":["",Ie,fe,de]}],"backdrop-opacity":[{"backdrop-opacity":[Ie,fe,de]}],"backdrop-saturate":[{"backdrop-saturate":[Ie,fe,de]}],"backdrop-sepia":[{"backdrop-sepia":["",Ie,fe,de]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":T()}],"border-spacing-x":[{"border-spacing-x":T()}],"border-spacing-y":[{"border-spacing-y":T()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",fe,de]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ie,"initial",fe,de]}],ease:[{ease:["linear","initial",b,fe,de]}],delay:[{delay:[Ie,fe,de]}],animate:[{animate:["none",v,fe,de]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,fe,de]}],"perspective-origin":[{"perspective-origin":w()}],rotate:[{rotate:Q()}],"rotate-x":[{"rotate-x":Q()}],"rotate-y":[{"rotate-y":Q()}],"rotate-z":[{"rotate-z":Q()}],scale:[{scale:pe()}],"scale-x":[{"scale-x":pe()}],"scale-y":[{"scale-y":pe()}],"scale-z":[{"scale-z":pe()}],"scale-3d":["scale-3d"],skew:[{skew:re()}],"skew-x":[{"skew-x":re()}],"skew-y":[{"skew-y":re()}],transform:[{transform:[fe,de,"","none","gpu","cpu"]}],"transform-origin":[{origin:w()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:O()}],"translate-x":[{"translate-x":O()}],"translate-y":[{"translate-y":O()}],"translate-z":[{"translate-z":O()}],"translate-none":["translate-none"],accent:[{accent:S()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:S()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",fe,de]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":T()}],"scroll-mx":[{"scroll-mx":T()}],"scroll-my":[{"scroll-my":T()}],"scroll-ms":[{"scroll-ms":T()}],"scroll-me":[{"scroll-me":T()}],"scroll-mt":[{"scroll-mt":T()}],"scroll-mr":[{"scroll-mr":T()}],"scroll-mb":[{"scroll-mb":T()}],"scroll-ml":[{"scroll-ml":T()}],"scroll-p":[{"scroll-p":T()}],"scroll-px":[{"scroll-px":T()}],"scroll-py":[{"scroll-py":T()}],"scroll-ps":[{"scroll-ps":T()}],"scroll-pe":[{"scroll-pe":T()}],"scroll-pt":[{"scroll-pt":T()}],"scroll-pr":[{"scroll-pr":T()}],"scroll-pb":[{"scroll-pb":T()}],"scroll-pl":[{"scroll-pl":T()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",fe,de]}],fill:[{fill:["none",...S()]}],"stroke-w":[{stroke:[Ie,On,Qt,Cs]}],stroke:[{stroke:["none",...S()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},am=Kc(gu),$i=d.createContext(void 0);function Vr(e){const t=d.useContext($i);if(t===void 0&&!e)throw new Error(qe(33));return t}const Br=d.createContext(void 0);function Mt(e){const t=d.useContext(Br);if(t===void 0&&!e)throw new Error(qe(36));return t}let Hn=(function(e){return e.startingStyle="data-starting-style",e.endingStyle="data-ending-style",e})({});const mu={[Hn.startingStyle]:""},hu={[Hn.endingStyle]:""},cn={transitionStatus(e){return e==="starting"?mu:e==="ending"?hu:null}};let tn=(function(e){return e.open="data-open",e.closed="data-closed",e[e.startingStyle=Hn.startingStyle]="startingStyle",e[e.endingStyle=Hn.endingStyle]="endingStyle",e.anchorHidden="data-anchor-hidden",e.side="data-side",e.align="data-align",e})({}),hr=(function(e){return e.popupOpen="data-popup-open",e.pressed="data-pressed",e})({});const bu={[hr.popupOpen]:""},yu={[hr.popupOpen]:"",[hr.pressed]:""},vu={[tn.open]:""},xu={[tn.closed]:""},wu={[tn.anchorHidden]:""},Hr={open(e){return e?bu:null}},bo={open(e){return e?yu:null}},Cn={open(e){return e?vu:xu},anchorHidden(e){return e?wu:null}},Yi=d.createContext(void 0);function Un(e=!0){const t=d.useContext(Yi);if(t===void 0&&!e)throw new Error(qe(25));return t}const rn="none",vn="trigger-press",ft="trigger-hover",Nn="trigger-focus",Do="outside-press",Fn="item-press",Ru="close-press",sn="focus-out",_r="escape-key",fo="list-navigation",zr="cancel-open",po="sibling-open",Ki="imperative-action",Eu="window-resize";function yo({controlled:e,default:t,name:n,state:o="value"}){const{current:r}=d.useRef(e!==void 0),[s,i]=d.useState(t),a=r?e:s,u=d.useCallback(c=>{r||i(c)},[]);return[a,u]}function Su(e){const{closeOnClick:t,highlighted:n,id:o,nodeId:r,store:s,itemRef:i,itemMetadata:a}=e,{events:u}=s.useState("floatingTreeRoot"),c=Un(!0),f=c!==void 0;return d.useMemo(()=>({id:o,role:"menuitem",tabIndex:n?0:-1,onMouseMove(l){r&&u.emit("itemhover",{nodeId:r,target:l.currentTarget})},onClick(l){t&&u.emit("close",{domEvent:l,reason:Fn})},onMouseUp(l){if(c){const p=c.initialCursorPointRef.current;if(c.initialCursorPointRef.current=null,f&&p&&Math.abs(l.clientX-p.x)<=1&&Math.abs(l.clientY-p.y)<=1)return}i.current&&s.context.allowMouseUpTriggerRef.current&&(!f||l.button===2)&&(!a||a.type==="regular-item")&&i.current.click()}}),[t,n,o,u,r,s,i,c,f,a])}const Tu={type:"regular-item"};function Gi(e){const{closeOnClick:t,disabled:n=!1,highlighted:o,id:r,store:s,nativeButton:i,itemMetadata:a,nodeId:u}=e,c=d.useRef(null),{getButtonProps:f,buttonRef:l}=Nt({disabled:n,focusableWhenDisabled:!0,native:i}),p=Su({closeOnClick:t,highlighted:o,id:r,nodeId:u,store:s,itemRef:c,itemMetadata:a}),m=d.useCallback(g=>$t(p,{onMouseEnter(){a.type==="submenu-trigger"&&a.setActive()},onKeyUp(y){y.key===" "&&s.context.typingRef.current&&y.preventBaseUIHandler()}},g,f),[p,f,s,a]),h=Ct(c,l);return d.useMemo(()=>({getItemProps:m,itemRef:h}),[m,h])}const qi=d.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function Cu(){return d.useContext(qi)}let Xi=(function(e){return e[e.None=0]="None",e[e.GuessFromOrder=1]="GuessFromOrder",e})({});function Wn(e={}){const{label:t,metadata:n,textRef:o,indexGuessBehavior:r,index:s}=e,{register:i,unregister:a,subscribeMapChange:u,elementsRef:c,labelsRef:f,nextIndexRef:l}=Cu(),p=d.useRef(-1),[m,h]=d.useState(s??(r===Xi.GuessFromOrder?()=>{if(p.current===-1){const b=l.current;l.current+=1,p.current=b}return p.current}:-1)),g=d.useRef(null),y=d.useCallback(b=>{if(g.current=b,m!==-1&&b!==null&&(c.current[m]=b,f)){const v=t!==void 0;f.current[m]=v?t:o?.current?.textContent??b.textContent}},[m,c,f,t,o]);return le(()=>{if(s!=null)return;const b=g.current;if(b)return i(b,n),()=>{a(b)}},[s,i,a,n]),le(()=>{if(s==null)return u(b=>{const v=g.current?b.get(g.current)?.index:null;v!=null&&h(v)})},[s,u,h]),d.useMemo(()=>({ref:y,index:m}),[m,y])}let ks=0;function Iu(e,t="mui"){const[n,o]=d.useState(e),r=e||n;return d.useEffect(()=>{n==null&&(ks+=1,o(`${t}-${ks}`))},[n,t]),r}const Ps=tc.useId;function Xt(e,t){if(Ps!==void 0){const n=Ps();return e??(t?`${t}-${n}`:n)}return Iu(e,t)}function yt(e){return Xt(e,"base-ui")}function xe(e,t,n,o){let r=!1,s=!1;const i=o??Ye;return{reason:e,event:t??new Event("base-ui"),cancel(){r=!0},allowPropagation(){s=!0},get isCanceled(){return r},get isPropagationAllowed(){return s},trigger:n,...i}}const Mu=[];function jr(e){d.useEffect(e,Mu)}const Zn=null;class ku{callbacks=[];callbacksCount=0;nextId=1;startId=1;isScheduled=!1;tick=t=>{this.isScheduled=!1;const n=this.callbacks,o=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,o>0)for(let r=0;r<n.length;r+=1)n[r]?.(t)};request(t){const n=this.nextId;return this.nextId+=1,this.callbacks.push(t),this.callbacksCount+=1,!this.isScheduled&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(t){const n=t-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const Jn=new ku;class Rt{static create(){return new Rt}static request(t){return Jn.request(t)}static cancel(t){return Jn.cancel(t)}currentId=Zn;request(t){this.cancel(),this.currentId=Jn.request(()=>{this.currentId=Zn,t()})}cancel=()=>{this.currentId!==Zn&&(Jn.cancel(this.currentId),this.currentId=Zn)};disposeEffect=()=>this.cancel}function No(){const e=tt(Rt.create).current;return jr(e.disposeEffect),e}function In(e,t=!1,n=!1){const[o,r]=d.useState(e&&t?"idle":void 0),[s,i]=d.useState(e);return e&&!s&&(i(!0),r("starting")),!e&&s&&o!=="ending"&&!n&&r("ending"),!e&&!s&&o==="ending"&&r(void 0),le(()=>{if(!e&&s&&o!=="ending"&&n){const a=Rt.request(()=>{r("ending")});return()=>{Rt.cancel(a)}}},[e,s,o,n]),le(()=>{if(!e||t)return;const a=Rt.request(()=>{r(void 0)});return()=>{Rt.cancel(a)}},[t,e]),le(()=>{if(!e||!t)return;e&&s&&o!=="idle"&&r("starting");const a=Rt.request(()=>{r("idle")});return()=>{Rt.cancel(a)}},[t,e,s,r,o]),d.useMemo(()=>({mounted:s,setMounted:i,transitionStatus:o}),[s,o])}function Ot(e){return e==null?e:"current"in e?e.current:e}function Pu(e,t=!1,n=!0){const o=No();return ie((r,s=null)=>{o.cancel();function i(){At.flushSync(r)}const a=Ot(e);if(a==null)return;const u=a;if(typeof u.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)r();else{let c=function(){const l=Hn.startingStyle;if(!u.hasAttribute(l)){o.request(f);return}const p=new MutationObserver(()=>{u.hasAttribute(l)||(p.disconnect(),f())});p.observe(u,{attributes:!0,attributeFilter:[l]}),s?.addEventListener("abort",()=>p.disconnect(),{once:!0})},f=function(){Promise.all(u.getAnimations().map(l=>l.finished)).then(()=>{s?.aborted||i()}).catch(()=>{const l=u.getAnimations();if(n){if(s?.aborted)return;i()}else l.length>0&&l.some(p=>p.pending||p.playState!=="finished")&&f()})};if(t){c();return}o.request(f)}})}function Ft(e){const{enabled:t=!0,open:n,ref:o,onComplete:r}=e,s=ie(r),i=Pu(o,n,!1);d.useEffect(()=>{if(!t)return;const a=new AbortController;return i(s,a.signal),()=>{a.abort()}},[t,n,s,i])}const Zi=d.createContext(void 0);function Ou(){const e=d.useContext(Zi);if(e===void 0)throw new Error(qe(31));return e}const lm=d.forwardRef(function(t,n){const{render:o,className:r,...s}=t,[i,a]=d.useState(void 0),u=d.useMemo(()=>({setLabelId:a}),[a]),c=Ae("div",t,{ref:n,props:{role:"group","aria-labelledby":i,...s}});return ce.jsx(Zi.Provider,{value:u,children:c})}),cm=d.forwardRef(function(t,n){const{className:o,render:r,id:s,...i}=t,a=yt(s),{setLabelId:u}=Ou();return le(()=>(u(a),()=>{u(void 0)}),[u,a]),Ae("div",t,{ref:n,props:{id:a,role:"presentation",...i}})}),um=d.forwardRef(function(t,n){const{render:o,className:r,id:s,label:i,nativeButton:a=!1,disabled:u=!1,closeOnClick:c=!0,...f}=t,l=Wn({label:i}),p=Vr(!0),m=yt(s),{store:h}=Mt(),g=h.useState("isActive",l.index),y=h.useState("itemProps"),{getItemProps:b,itemRef:v}=Gi({closeOnClick:c,disabled:u,highlighted:g,id:m,store:h,nativeButton:a,nodeId:p?.nodeId,itemMetadata:Tu});return Ae("div",t,{state:{disabled:u,highlighted:g},props:[y,f,b],ref:[v,n,l.ref]})}),An=0;class Lt{static create(){return new Lt}currentId=An;start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=An,n()},t)}isStarted(){return this.currentId!==An}clear=()=>{this.currentId!==An&&(clearTimeout(this.currentId),this.currentId=An)};disposeEffect=()=>this.clear}function Ze(){const e=tt(Lt.create).current;return jr(e.disposeEffect),e}function nt(e){const t=tt(Au,e).current;return t.next=e,le(t.effect),t}function Au(e){const t={current:e,next:e,effect:()=>{t.current=t.next}};return t}function Pe(e){return e?.ownerDocument||document}const Mn=typeof navigator<"u",Xo=Du(),Ji=Fu(),Qi=Nu(),Ur=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),ea=Xo.platform==="MacIntel"&&Xo.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Xo.platform),ta=Mn&&/apple/i.test(navigator.vendor),br=Mn&&/android/i.test(Ji)||/android/i.test(Qi),Lu=Mn&&Ji.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,na=Qi.includes("jsdom/");function Du(){if(!Mn)return{platform:"",maxTouchPoints:-1};const e=navigator.userAgentData;return e?.platform?{platform:e.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function Nu(){if(!Mn)return"";const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}function Fu(){if(!Mn)return"";const e=navigator.userAgentData;return e?.platform?e.platform:navigator.platform??""}const yr="data-base-ui-focusable",oa="active",ra="selected",sa="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",jt="ArrowLeft",Ut="ArrowRight",Wr="ArrowUp",$n="ArrowDown";function ht(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Re(e,t){if(!e||!t)return!1;const n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&ur(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function vo(e,t){if(!Le(e))return!1;const n=e;if(t.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,o]of t.entries())if(Re(o,n))return!o.hasAttribute("data-trigger-disabled");return!1}function at(e){return"composedPath"in e?e.composedPath()[0]:e.target}function vt(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Vu(e){return e.matches("html,body")}function Fo(e){return Ue(e)&&e.matches(sa)}function vr(e){return e?e.getAttribute("role")==="combobox"&&Fo(e):!1}function Bu(e){if(!e||na)return!0;try{return e.matches(":focus-visible")}catch{return!0}}function _n(e){return e?e.hasAttribute(yr)?e:e.querySelector(`[${yr}]`)||e:null}function on(e,t,n=!0){return e.filter(r=>r.parentId===t&&(!n||r.context?.open)).flatMap(r=>[r,...on(e,r.id,n)])}function Os(e,t){let n=[],o=e.find(r=>r.id===t)?.parentId;for(;o;){const r=e.find(s=>s.id===o);o=r?.parentId,r&&(n=n.concat(r))}return n}function st(e){e.preventDefault(),e.stopPropagation()}function Hu(e){return"nativeEvent"in e}function ia(e){return e.pointerType===""&&e.isTrusted?!0:br&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function aa(e){return na?!1:!br&&e.width===0&&e.height===0||br&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function xn(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function la(e){const t=e.type;return t==="click"||t==="mousedown"||t==="keydown"||t==="keyup"}const _u=["top","right","bottom","left"],wn=Math.min,pt=Math.max,xo=Math.round,fn=Math.floor,St=e=>({x:e,y:e}),zu={left:"right",right:"left",bottom:"top",top:"bottom"},ju={start:"end",end:"start"};function xr(e,t,n){return pt(e,wn(t,n))}function Dt(e,t){return typeof e=="function"?e(t):e}function gt(e){return e.split("-")[0]}function Zt(e){return e.split("-")[1]}function $r(e){return e==="x"?"y":"x"}function Yr(e){return e==="y"?"height":"width"}const Uu=new Set(["top","bottom"]);function bt(e){return Uu.has(gt(e))?"y":"x"}function Kr(e){return $r(bt(e))}function Wu(e,t,n){n===void 0&&(n=!1);const o=Zt(e),r=Kr(e),s=Yr(r);let i=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=wo(i)),[i,wo(i)]}function $u(e){const t=wo(e);return[wr(e),t,wr(t)]}function wr(e){return e.replace(/start|end/g,t=>ju[t])}const As=["left","right"],Ls=["right","left"],Yu=["top","bottom"],Ku=["bottom","top"];function Gu(e,t,n){switch(e){case"top":case"bottom":return n?t?Ls:As:t?As:Ls;case"left":case"right":return t?Yu:Ku;default:return[]}}function qu(e,t,n,o){const r=Zt(e);let s=Gu(gt(e),n==="start",o);return r&&(s=s.map(i=>i+"-"+r),t&&(s=s.concat(s.map(wr)))),s}function wo(e){return e.replace(/left|right|bottom|top/g,t=>zu[t])}function Xu(e){return{top:0,right:0,bottom:0,left:0,...e}}function ca(e){return typeof e!="number"?Xu(e):{top:e,right:e,bottom:e,left:e}}function Ro(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function Qn(e,t,n){return Math.floor(e/t)!==n}function pn(e,t){return t<0||t>=e.current.length}function go(e,t){return rt(e,{disabledIndices:t})}function Rr(e,t){return rt(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function rt(e,{startingIndex:t=-1,decrement:n=!1,disabledIndices:o,amount:r=1}={}){let s=t;do s+=n?-r:r;while(s>=0&&s<=e.current.length-1&&Wt(e,s,o));return s}function ua(e,{event:t,orientation:n,loopFocus:o,rtl:r,cols:s,disabledIndices:i,minIndex:a,maxIndex:u,prevIndex:c,stopEvent:f=!1}){let l=c;const p=[],m={};let h=!1;{let b=null,v=-1;e.current.forEach((R,x)=>{if(R==null)return;const w=R.closest('[role="row"]');w&&(h=!0),(w!==b||v===-1)&&(b=w,v+=1,p[v]=[]),p[v].push(x),m[x]=v})}const g=h&&p.length>0&&p.some(b=>b.length!==s);function y(b){if(!g||c===-1)return;const v=m[c];if(v==null)return;const R=p[v].indexOf(c);let x=b==="up"?v-1:v+1;o&&(x<0?x=p.length-1:x>=p.length&&(x=0));const w=new Set;for(;x>=0&&x<p.length&&!w.has(x);){w.add(x);const E=p[x];if(E.length===0){x=b==="up"?x-1:x+1;continue}const C=Math.min(R,E.length-1);for(let T=C;T>=0;T-=1){const A=E[T];if(!Wt(e,A,i))return A}x=b==="up"?x-1:x+1,o&&(x<0?x=p.length-1:x>=p.length&&(x=0))}}if(t.key===Wr){const b=y("up");if(b!==void 0)f&&st(t),l=b;else{if(f&&st(t),c===-1)l=u;else if(l=rt(e,{startingIndex:l,amount:s,decrement:!0,disabledIndices:i}),o&&(c-s<a||l<0)){const v=c%s,R=u%s,x=u-(R-v);R===v?l=u:l=R>v?x:x-s}pn(e,l)&&(l=c)}}if(t.key===$n){const b=y("down");b!==void 0?(f&&st(t),l=b):(f&&st(t),c===-1?l=a:(l=rt(e,{startingIndex:c,amount:s,disabledIndices:i}),o&&c+s>u&&(l=rt(e,{startingIndex:c%s-s,amount:s,disabledIndices:i}))),pn(e,l)&&(l=c))}if(n==="both"){const b=fn(c/s);t.key===(r?jt:Ut)&&(f&&st(t),c%s!==s-1?(l=rt(e,{startingIndex:c,disabledIndices:i}),o&&Qn(l,s,b)&&(l=rt(e,{startingIndex:c-c%s-1,disabledIndices:i}))):o&&(l=rt(e,{startingIndex:c-c%s-1,disabledIndices:i})),Qn(l,s,b)&&(l=c)),t.key===(r?Ut:jt)&&(f&&st(t),c%s!==0?(l=rt(e,{startingIndex:c,decrement:!0,disabledIndices:i}),o&&Qn(l,s,b)&&(l=rt(e,{startingIndex:c+(s-c%s),decrement:!0,disabledIndices:i}))):o&&(l=rt(e,{startingIndex:c+(s-c%s),decrement:!0,disabledIndices:i})),Qn(l,s,b)&&(l=c));const v=fn(u/s)===b;pn(e,l)&&(o&&v?l=t.key===(r?Ut:jt)?u:rt(e,{startingIndex:c-c%s-1,disabledIndices:i}):l=c)}return l}function da(e,t,n){const o=[];let r=0;return e.forEach(({width:s,height:i},a)=>{let u=!1;for(n&&(r=0);!u;){const c=[];for(let f=0;f<s;f+=1)for(let l=0;l<i;l+=1)c.push(r+f+l*t);r%t+s<=t&&c.every(f=>o[f]==null)?(c.forEach(f=>{o[f]=a}),u=!0):r+=1}}),[...o]}function fa(e,t,n,o,r){if(e===-1)return-1;const s=n.indexOf(e),i=t[e];switch(r){case"tl":return s;case"tr":return i?s+i.width-1:s;case"bl":return i?s+(i.height-1)*o:s;case"br":return n.lastIndexOf(e);default:return-1}}function pa(e,t){return t.flatMap((n,o)=>e.includes(n)?[o]:[])}function Wt(e,t,n){if(typeof n=="function")return n(t);if(n)return n.includes(t);const o=e.current[t];return o?o.hasAttribute("disabled")||o.getAttribute("aria-disabled")==="true":!1}var Zu=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],Eo=Zu.join(","),ga=typeof Element>"u",Rn=ga?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,So=!ga&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e?.ownerDocument},To=function(t,n){var o;n===void 0&&(n=!0);var r=t==null||(o=t.getAttribute)===null||o===void 0?void 0:o.call(t,"inert"),s=r===""||r==="true",i=s||n&&t&&(typeof t.closest=="function"?t.closest("[inert]"):To(t.parentNode));return i},Ju=function(t){var n,o=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return o===""||o==="true"},ma=function(t,n,o){if(To(t))return[];var r=Array.prototype.slice.apply(t.querySelectorAll(Eo));return n&&Rn.call(t,Eo)&&r.unshift(t),r=r.filter(o),r},Co=function(t,n,o){for(var r=[],s=Array.from(t);s.length;){var i=s.shift();if(!To(i,!1))if(i.tagName==="SLOT"){var a=i.assignedElements(),u=a.length?a:i.children,c=Co(u,!0,o);o.flatten?r.push.apply(r,c):r.push({scopeParent:i,candidates:c})}else{var f=Rn.call(i,Eo);f&&o.filter(i)&&(n||!t.includes(i))&&r.push(i);var l=i.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(i),p=!To(l,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(i));if(l&&p){var m=Co(l===!0?i.children:l.children,!0,o);o.flatten?r.push.apply(r,m):r.push({scopeParent:i,candidates:m})}else s.unshift.apply(s,i.children)}}return r},ha=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},ba=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Ju(t))&&!ha(t)?0:t.tabIndex},Qu=function(t,n){var o=ba(t);return o<0&&n&&!ha(t)?0:o},ed=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},ya=function(t){return t.tagName==="INPUT"},td=function(t){return ya(t)&&t.type==="hidden"},nd=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(o){return o.tagName==="SUMMARY"});return n},od=function(t,n){for(var o=0;o<t.length;o++)if(t[o].checked&&t[o].form===n)return t[o]},rd=function(t){if(!t.name)return!0;var n=t.form||So(t),o=function(a){return n.querySelectorAll('input[type="radio"][name="'+a+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=o(window.CSS.escape(t.name));else try{r=o(t.name)}catch(i){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",i.message),!1}var s=od(r,t.form);return!s||s===t},sd=function(t){return ya(t)&&t.type==="radio"},id=function(t){return sd(t)&&!rd(t)},ad=function(t){var n,o=t&&So(t),r=(n=o)===null||n===void 0?void 0:n.host,s=!1;if(o&&o!==t){var i,a,u;for(s=!!((i=r)!==null&&i!==void 0&&(a=i.ownerDocument)!==null&&a!==void 0&&a.contains(r)||t!=null&&(u=t.ownerDocument)!==null&&u!==void 0&&u.contains(t));!s&&r;){var c,f,l;o=So(r),r=(c=o)===null||c===void 0?void 0:c.host,s=!!((f=r)!==null&&f!==void 0&&(l=f.ownerDocument)!==null&&l!==void 0&&l.contains(r))}}return s},Ds=function(t){var n=t.getBoundingClientRect(),o=n.width,r=n.height;return o===0&&r===0},ld=function(t,n){var o=n.displayCheck,r=n.getShadowRoot;if(o==="full-native"&&"checkVisibility"in t){var s=t.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!s}if(getComputedStyle(t).visibility==="hidden")return!0;var i=Rn.call(t,"details>summary:first-of-type"),a=i?t.parentElement:t;if(Rn.call(a,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="full-native"||o==="legacy-full"){if(typeof r=="function"){for(var u=t;t;){var c=t.parentElement,f=So(t);if(c&&!c.shadowRoot&&r(c)===!0)return Ds(t);t.assignedSlot?t=t.assignedSlot:!c&&f!==t.ownerDocument?t=f.host:t=c}t=u}if(ad(t))return!t.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return Ds(t);return!1},cd=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var o=0;o<n.children.length;o++){var r=n.children.item(o);if(r.tagName==="LEGEND")return Rn.call(n,"fieldset[disabled] *")?!0:!r.contains(t)}return!0}n=n.parentElement}return!1},Er=function(t,n){return!(n.disabled||td(n)||ld(n,t)||nd(n)||cd(n))},Sr=function(t,n){return!(id(n)||ba(n)<0||!Er(t,n))},ud=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},va=function(t){var n=[],o=[];return t.forEach(function(r,s){var i=!!r.scopeParent,a=i?r.scopeParent:r,u=Qu(a,i),c=i?va(r.candidates):a;u===0?i?n.push.apply(n,c):n.push(a):o.push({documentOrder:s,tabIndex:u,item:r,isScope:i,content:c})}),o.sort(ed).reduce(function(r,s){return s.isScope?r.push.apply(r,s.content):r.push(s.content),r},[]).concat(n)},Yn=function(t,n){n=n||{};var o;return n.getShadowRoot?o=Co([t],n.includeContainer,{filter:Sr.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:ud}):o=ma(t,n.includeContainer,Sr.bind(null,n)),va(o)},dd=function(t,n){n=n||{};var o;return n.getShadowRoot?o=Co([t],n.includeContainer,{filter:Er.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):o=ma(t,n.includeContainer,Er.bind(null,n)),o},xa=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return Rn.call(t,Eo)===!1?!1:Sr(n,t)};const kn=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function wa(e,t){const n=Yn(e,kn()),o=n.length;if(o===0)return;const r=ht(Pe(e)),s=n.indexOf(r),i=s===-1?t===1?0:o-1:s+t;return n[i]}function Gr(e){return wa(Pe(e).body,1)||e}function Ra(e){return wa(Pe(e).body,-1)||e}function Ea(e,t){if(!e)return null;const n=Yn(Pe(e).body,kn()),o=n.length;if(o===0)return null;const r=n.indexOf(e);if(r===-1)return null;const s=(r+t+o)%o;return n[s]}function fd(e){return Ea(e,1)}function pd(e){return Ea(e,-1)}function gn(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!Re(n,o)}function gd(e){Yn(e,kn()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Ns(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const o=n.dataset.tabindex;delete n.dataset.tabindex,o?n.setAttribute("tabindex",o):n.removeAttribute("tabindex")})}function Sa(){const e=new Map;return{emit(t,n){e.get(t)?.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){e.get(t)?.delete(n)}}}class qr{nodesRef={current:[]};events=Sa();addNode(t){this.nodesRef.current.push(t)}removeNode(t){const n=this.nodesRef.current.findIndex(o=>o===t);n!==-1&&this.nodesRef.current.splice(n,1)}}const Ta=d.createContext(null),Ca=d.createContext(null),Vt=()=>d.useContext(Ta)?.id||null,Jt=e=>{const t=d.useContext(Ca);return e??t};function Ia(e){const t=Xt(),n=Jt(e),o=Vt();return le(()=>{if(!t)return;const r={id:t,parentId:o};return n?.addNode(r),()=>{n?.removeNode(r)}},[n,t,o]),t}function md(e){const{children:t,id:n}=e,o=Vt();return ce.jsx(Ta.Provider,{value:d.useMemo(()=>({id:n,parentId:o}),[n,o]),children:t})}function hd(e){const{children:t,externalTree:n}=e,o=tt(()=>n??new qr).current;return ce.jsx(Ca.Provider,{value:o,children:t})}function En(e){return`data-base-ui-${e}`}function Zo(e,t,n){if(n&&!xn(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const o=e();return typeof o=="number"?o:o?.[t]}return e?.[t]}const Ma={clipPath:"inset(50%)",overflow:"hidden",whiteSpace:"nowrap",border:0,padding:0,width:1,height:1,margin:-1},Vo={...Ma,position:"fixed",top:0,left:0},ka={...Ma,position:"absolute"},Sn=d.forwardRef(function(t,n){const[o,r]=d.useState();le(()=>{ta&&r("button")},[]);const s={tabIndex:0,role:o};return ce.jsx("span",{...t,ref:n,style:Vo,"aria-hidden":o?void 0:!0,...s,"data-base-ui-focus-guard":""})});let Fs=0;function Vn(e,t={}){const{preventScroll:n=!1,cancelPrevious:o=!0,sync:r=!1}=t;o&&cancelAnimationFrame(Fs);const s=()=>e?.focus({preventScroll:n});r?s():Fs=requestAnimationFrame(s)}const mn={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Vs(e){return e==="inert"?mn.inert:e==="aria-hidden"?mn["aria-hidden"]:mn.none}let eo=new WeakSet,to={},Jo=0;const Pa=e=>e&&(e.host||Pa(e.parentNode)),bd=(e,t)=>t.map(n=>{if(e.contains(n))return n;const o=Pa(n);return e.contains(o)?o:null}).filter(n=>n!=null);function yd(e,t,n,o){const r="data-base-ui-inert",s=o?"inert":n?"aria-hidden":null,i=bd(t,e),a=new Set,u=new Set(i),c=[];to[r]||(to[r]=new WeakMap);const f=to[r];i.forEach(l),p(t),a.clear();function l(m){!m||a.has(m)||(a.add(m),m.parentNode&&l(m.parentNode))}function p(m){!m||u.has(m)||[].forEach.call(m.children,h=>{if(Kt(h)!=="script")if(a.has(h))p(h);else{const g=s?h.getAttribute(s):null,y=g!==null&&g!=="false",b=Vs(s),v=(b.get(h)||0)+1,R=(f.get(h)||0)+1;b.set(h,v),f.set(h,R),c.push(h),v===1&&y&&eo.add(h),R===1&&h.setAttribute(r,""),!y&&s&&h.setAttribute(s,s==="inert"?"":"true")}})}return Jo+=1,()=>{c.forEach(m=>{const h=Vs(s),y=(h.get(m)||0)-1,b=(f.get(m)||0)-1;h.set(m,y),f.set(m,b),y||(!eo.has(m)&&s&&m.removeAttribute(s),eo.delete(m)),b||m.removeAttribute(r)}),Jo-=1,Jo||(mn.inert=new WeakMap,mn["aria-hidden"]=new WeakMap,mn.none=new WeakMap,eo=new WeakSet,to={})}}function vd(e,t=!1,n=!1){const o=Pe(e[0]).body;return yd(e.concat(Array.from(o.querySelectorAll("[aria-live]"))),o,t,n)}const Oa=d.createContext(null),Aa=()=>d.useContext(Oa),xd=En("portal");function wd(e={}){const{ref:t,container:n,componentProps:o=Ye,elementProps:r}=e,s=Xt(),a=Aa()?.portalNode,[u,c]=d.useState(null),[f,l]=d.useState(null),p=ie(y=>{y!==null&&l(y)}),m=d.useRef(null);le(()=>{if(n===null){m.current&&(m.current=null,l(null),c(null));return}if(s==null)return;const y=(n&&(Or(n)?n:n.current))??a??document.body;if(y==null){m.current&&(m.current=null,l(null),c(null));return}m.current!==y&&(m.current=y,l(null),c(y))},[n,a,s]);const h=Ae("div",o,{ref:[t,p],props:[{id:s,[xd]:""},r]});return{portalNode:f,portalSubtree:u&&h?At.createPortal(h,u):null}}const Xr=d.forwardRef(function(t,n){const{children:o,container:r,className:s,render:i,renderGuards:a,...u}=t,{portalNode:c,portalSubtree:f}=wd({container:r,ref:n,componentProps:t,elementProps:u}),l=d.useRef(null),p=d.useRef(null),m=d.useRef(null),h=d.useRef(null),[g,y]=d.useState(null),b=g?.modal,v=g?.open,R=typeof a=="boolean"?a:!!g&&!g.modal&&g.open&&!!c;d.useEffect(()=>{if(!c||b)return;function w(E){c&&E.relatedTarget&&gn(E)&&(E.type==="focusin"?Ns:gd)(c)}return c.addEventListener("focusin",w,!0),c.addEventListener("focusout",w,!0),()=>{c.removeEventListener("focusin",w,!0),c.removeEventListener("focusout",w,!0)}},[c,b]),d.useEffect(()=>{!c||v||Ns(c)},[v,c]);const x=d.useMemo(()=>({beforeOutsideRef:l,afterOutsideRef:p,beforeInsideRef:m,afterInsideRef:h,portalNode:c,setFocusManagerState:y}),[c]);return ce.jsxs(d.Fragment,{children:[f,ce.jsxs(Oa.Provider,{value:x,children:[R&&c&&ce.jsx(Sn,{"data-type":"outside",ref:l,onFocus:w=>{if(gn(w,c))m.current?.focus();else{const E=g?g.domReference:null;Ra(E)?.focus()}}}),R&&c&&ce.jsx("span",{"aria-owns":c.id,style:wc}),c&&At.createPortal(o,c),R&&c&&ce.jsx(Sn,{"data-type":"outside",ref:p,onFocus:w=>{if(gn(w,c))h.current?.focus();else{const E=g?g.domReference:null;Gr(E)?.focus(),g?.closeOnFocusOut&&g?.onOpenChange(!1,xe(sn,w.nativeEvent))}}})]})]})});function Rd(e,t){const n=Je(e.target);return e instanceof n.KeyboardEvent?"keyboard":e instanceof n.FocusEvent?t||"keyboard":"pointerType"in e?e.pointerType||"keyboard":"touches"in e?"touch":e instanceof n.MouseEvent?t||(e.detail===0?"keyboard":"mouse"):""}const Bs=20;let _t=[];function Zr(){_t=_t.filter(e=>e.deref()?.isConnected)}function Ed(e){Zr(),e&&Kt(e)!=="body"&&(_t.push(new WeakRef(e)),_t.length>Bs&&(_t=_t.slice(-Bs)))}function Qo(){return Zr(),_t[_t.length-1]?.deref()}function Sd(e){if(!e)return null;const t=kn();return xa(e,t)?e:Yn(e,t)[0]||e}function Td(e){return!e||!e.isConnected?!1:typeof e.checkVisibility=="function"?e.checkVisibility():mt(e).display!=="none"}function Hs(e,t){if(!t.current.includes("floating")&&!e.getAttribute("role")?.includes("dialog"))return;const n=kn(),r=dd(e,n).filter(i=>{const a=i.getAttribute("data-tabindex")||"";return xa(i,n)||i.hasAttribute("data-tabindex")&&!a.startsWith("-")}),s=e.getAttribute("tabindex");t.current.includes("floating")||r.length===0?s!=="0"&&e.setAttribute("tabindex","0"):(s!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}function Jr(e){const{context:t,children:n,disabled:o=!1,initialFocus:r=!0,returnFocus:s=!0,restoreFocus:i=!1,modal:a=!0,closeOnFocusOut:u=!0,openInteractionType:c="",nextFocusableElement:f,previousFocusableElement:l,beforeContentFocusGuardRef:p,externalTree:m}=e,h="rootStore"in t?t.rootStore:t,g=h.useState("open"),y=h.useState("domReferenceElement"),b=h.useState("floatingElement"),{events:v,dataRef:R}=h.context,x=ie(()=>R.current.floatingContext?.nodeId),w=r===!1,E=vr(y)&&w,C=d.useRef(["content"]),T=nt(r),A=nt(s),N=nt(c),F=Jt(m),L=Aa(),k=d.useRef(null),P=d.useRef(null),B=d.useRef(!1),D=d.useRef(!1),I=d.useRef(!1),S=d.useRef(-1),M=d.useRef(""),H=d.useRef(""),Z=d.useRef(null),$=d.useRef(null),_=Ct(Z,p,L?.beforeInsideRef),V=Ct($,L?.afterInsideRef),J=Ze(),z=Ze(),Y=No(),ee=L!=null,Q=_n(b),pe=ie((W=Q)=>W?Yn(W,kn()):[]),re=ie(W=>{const K=pe(W);return C.current.map(()=>K).filter(Boolean).flat()});d.useEffect(()=>{if(o||!a)return;function W(ue){ue.key==="Tab"&&Re(Q,ht(Pe(Q)))&&pe().length===0&&!E&&st(ue)}const K=Pe(Q);return K.addEventListener("keydown",W),()=>{K.removeEventListener("keydown",W)}},[o,y,Q,a,C,E,pe,re]),d.useEffect(()=>{if(o||!g)return;const W=Pe(Q);function K(){I.current=!1}function ue(G){const q=at(G),U=Re(b,q)||Re(y,q)||Re(L?.portalNode,q);I.current=!U,H.current=G.pointerType||"keyboard",q?.closest(`[${Mi}]`)&&(D.current=!0)}function X(){H.current="keyboard"}return W.addEventListener("pointerdown",ue,!0),W.addEventListener("pointerup",K,!0),W.addEventListener("pointercancel",K,!0),W.addEventListener("keydown",X,!0),()=>{W.removeEventListener("pointerdown",ue,!0),W.removeEventListener("pointerup",K,!0),W.removeEventListener("pointercancel",K,!0),W.removeEventListener("keydown",X,!0)}},[o,b,y,Q,g,L]),d.useEffect(()=>{if(o||!u)return;const W=Pe(Q);function K(){D.current=!0,z.start(0,()=>{D.current=!1})}function ue(ne){const j=at(ne),ge=pe().indexOf(j);ge!==-1&&(S.current=ge)}function X(ne){const j=ne.relatedTarget,oe=ne.currentTarget,ge=at(ne);queueMicrotask(()=>{const se=x(),Ee=h.context.triggerElements,De=j?.hasAttribute(En("focus-guard"))&&[Z.current,$.current,L?.beforeInsideRef.current,L?.afterInsideRef.current,L?.beforeOutsideRef.current,L?.afterOutsideRef.current,Ot(l),Ot(f)].includes(j),Be=!(Re(y,j)||Re(b,j)||Re(j,b)||Re(L?.portalNode,j)||j!=null&&Ee.hasElement(j)||Ee.hasMatchingElement(Ce=>Re(Ce,j))||De||F&&(on(F.nodesRef.current,se).find(Ce=>Re(Ce.context?.elements.floating,j)||Re(Ce.context?.elements.domReference,j))||Os(F.nodesRef.current,se).find(Ce=>[Ce.context?.elements.floating,_n(Ce.context?.elements.floating)].includes(j)||Ce.context?.elements.domReference===j)));if(oe===y&&Q&&Hs(Q,C),i&&oe!==y&&!Td(ge)&&ht(W)===W.body){if(Ue(Q)&&(Q.focus(),i==="popup")){Y.request(()=>{Q.focus()});return}const Ce=S.current,Te=pe(),Me=Te[Ce]||Te[Te.length-1]||Q;Ue(Me)&&Me.focus()}if(R.current.insideReactTree){R.current.insideReactTree=!1;return}(E||!a)&&j&&Be&&!D.current&&(E||j!==Qo())&&(B.current=!0,h.setOpen(!1,xe(sn,ne)))})}function G(){I.current||(R.current.insideReactTree=!0,J.start(0,()=>{R.current.insideReactTree=!1}))}const q=Ue(y)?y:null,U=[];if(!(!b&&!q))return q&&(q.addEventListener("focusout",X),q.addEventListener("pointerdown",K),U.push(()=>{q.removeEventListener("focusout",X),q.removeEventListener("pointerdown",K)})),b&&(b.addEventListener("focusin",ue),b.addEventListener("focusout",X),L&&(b.addEventListener("focusout",G,!0),U.push(()=>{b.removeEventListener("focusout",G,!0)})),U.push(()=>{b.removeEventListener("focusin",ue),b.removeEventListener("focusout",X)})),()=>{U.forEach(ne=>{ne()})}},[o,y,b,Q,a,F,L,h,u,i,pe,E,x,C,R,J,z,Y,f,l]),d.useEffect(()=>{if(o||!b||!g)return;const W=Array.from(L?.portalNode?.querySelectorAll(`[${En("portal")}]`)||[]),ue=(F?Os(F.nodesRef.current,x()):[]).find(G=>vr(G.context?.elements.domReference||null))?.context?.elements.domReference,X=[b,ue,...W,k.current,P.current,Z.current,$.current,L?.beforeOutsideRef.current,L?.afterOutsideRef.current,Ot(l),Ot(f),E?y:null].filter(G=>G!=null);return vd(X,a||E)},[g,o,y,b,a,C,L,E,F,x,f,l]),le(()=>{if(!g||o||!Ue(Q))return;const W=Pe(Q),K=ht(W);queueMicrotask(()=>{const ue=re(Q),X=T.current,G=typeof X=="function"?X(N.current||""):X;if(G===void 0||G===!1)return;let q;G===!0||G===null?q=ue[0]||Q:q=Ot(G),q=q||ue[0]||Q,!Re(Q,K)&&Vn(q,{preventScroll:q===Q})})},[o,g,Q,w,re,T,N]),le(()=>{if(o||!Q)return;const W=Pe(Q),K=ht(W);Ed(K);function ue(q){if(q.open||(M.current=Rd(q.nativeEvent,H.current)),q.reason===ft&&q.nativeEvent.type==="mouseleave"&&(B.current=!0),q.reason===Do)if(q.nested)B.current=!1;else if(ia(q.nativeEvent)||aa(q.nativeEvent))B.current=!1;else{let U=!1;document.createElement("div").focus({get preventScroll(){return U=!0,!1}}),U?B.current=!1:B.current=!0}}v.on("openchange",ue);const X=W.createElement("span");X.setAttribute("tabindex","-1"),X.setAttribute("aria-hidden","true"),Object.assign(X.style,Vo),ee&&y&&y.insertAdjacentElement("afterend",X);function G(){const q=A.current;let U=typeof q=="function"?q(M.current):q;if(U===void 0||U===!1)return null;if(U===null&&(U=!0),typeof U=="boolean"){const j=y||Qo();return j&&j.isConnected?j:X}const ne=y||Qo()||X;return Ot(U)||ne}return()=>{v.off("openchange",ue);const q=ht(W),U=Re(b,q)||F&&on(F.nodesRef.current,x(),!1).some(j=>Re(j.context?.elements.floating,q)),ne=G();queueMicrotask(()=>{const j=Sd(ne),oe=typeof A.current!="boolean";A.current&&!B.current&&Ue(j)&&(!(!oe&&j!==q&&q!==W.body)||U)&&j.focus({preventScroll:!0}),X.remove(),B.current=!1})}},[o,b,Q,A,R,v,F,ee,y,x]),le(()=>{if(!Ur||g||!b)return;const W=ht(Pe(b));!Ue(W)||!Fo(W)||Re(b,W)&&W.blur()},[g,b]),le(()=>{if(!(o||!L))return L.setFocusManagerState({modal:a,closeOnFocusOut:u,open:g,onOpenChange:h.setOpen,domReference:y}),()=>{L.setFocusManagerState(null)}},[o,L,a,g,h,u,y]),le(()=>{if(!(o||!Q))return Hs(Q,C),()=>{queueMicrotask(Zr)}},[o,Q,C]);const O=!o&&(a?!E:!0)&&(ee||a);return ce.jsxs(d.Fragment,{children:[O&&ce.jsx(Sn,{"data-type":"inside",ref:_,onFocus:W=>{if(a){const K=re();Vn(K[K.length-1])}else L?.portalNode&&(B.current=!1,gn(W,L.portalNode)?Gr(y)?.focus():Ot(l??L.beforeOutsideRef)?.focus())}}),n,O&&ce.jsx(Sn,{"data-type":"inside",ref:V,onFocus:W=>{a?Vn(re()[0]):L?.portalNode&&(u&&(B.current=!0),gn(W,L.portalNode)?Ra(y)?.focus():Ot(f??L.afterOutsideRef)?.focus())}})]})}function Bo(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.context.dataRef,{enabled:r=!0,event:s="click",toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:u=!0,touchOpenDelay:c=0,reason:f=vn}=t,l=d.useRef(void 0),p=No(),m=Ze(),h=d.useMemo(()=>({onPointerDown(g){l.current=g.pointerType},onMouseDown(g){const y=l.current,b=g.nativeEvent,v=n.select("open");if(g.button!==0||s==="click"||xn(y,!0)&&a)return;const R=o.current.openEvent,x=R?.type,w=n.select("domReferenceElement")!==g.currentTarget,E=v&&w||!(v&&i&&(!(R&&u)||x==="click"||x==="mousedown"));if(Fo(b.target)){const T=xe(f,b,b.target);E&&y==="touch"&&c>0?m.start(c,()=>{n.setOpen(!0,T)}):n.setOpen(E,T);return}const C=g.currentTarget;p.request(()=>{const T=xe(f,b,C);E&&y==="touch"&&c>0?m.start(c,()=>{n.setOpen(!0,T)}):n.setOpen(E,T)})},onClick(g){if(s==="mousedown-only")return;const y=l.current;if(s==="mousedown"&&y){l.current=void 0;return}if(xn(y,!0)&&a)return;const b=n.select("open"),v=o.current.openEvent,R=n.select("domReferenceElement")!==g.currentTarget,x=b&&R||!(b&&i&&(!(v&&u)||la(v))),w=xe(f,g.nativeEvent,g.currentTarget);x&&y==="touch"&&c>0?m.start(c,()=>{n.setOpen(!0,w)}):n.setOpen(x,w)},onKeyDown(){l.current=void 0}}),[o,s,a,n,u,i,p,m,c,f]);return d.useMemo(()=>r?{reference:h}:Ye,[r,h])}function _s(e,t,n){let{reference:o,floating:r}=e;const s=bt(t),i=Kr(t),a=Yr(i),u=gt(t),c=s==="y",f=o.x+o.width/2-r.width/2,l=o.y+o.height/2-r.height/2,p=o[a]/2-r[a]/2;let m;switch(u){case"top":m={x:f,y:o.y-r.height};break;case"bottom":m={x:f,y:o.y+o.height};break;case"right":m={x:o.x+o.width,y:l};break;case"left":m={x:o.x-r.width,y:l};break;default:m={x:o.x,y:o.y}}switch(Zt(t)){case"start":m[i]-=p*(n&&c?-1:1);break;case"end":m[i]+=p*(n&&c?-1:1);break}return m}const Cd=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:s=[],platform:i}=n,a=s.filter(Boolean),u=await(i.isRTL==null?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:r}),{x:f,y:l}=_s(c,o,u),p=o,m={},h=0;for(let g=0;g<a.length;g++){const{name:y,fn:b}=a[g],{x:v,y:R,data:x,reset:w}=await b({x:f,y:l,initialPlacement:o,placement:p,strategy:r,middlewareData:m,rects:c,platform:i,elements:{reference:e,floating:t}});f=v??f,l=R??l,m={...m,[y]:{...m[y],...x}},w&&h<=50&&(h++,typeof w=="object"&&(w.placement&&(p=w.placement),w.rects&&(c=w.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:r}):w.rects),{x:f,y:l}=_s(c,p,u)),g=-1)}return{x:f,y:l,placement:p,strategy:r,middlewareData:m}};async function zn(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:s,rects:i,elements:a,strategy:u}=e,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:l="floating",altBoundary:p=!1,padding:m=0}=Dt(t,e),h=ca(m),y=a[p?l==="floating"?"reference":"floating":l],b=Ro(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(y)))==null||n?y:y.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(a.floating)),boundary:c,rootBoundary:f,strategy:u})),v=l==="floating"?{x:o,y:r,width:i.floating.width,height:i.floating.height}:i.reference,R=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a.floating)),x=await(s.isElement==null?void 0:s.isElement(R))?await(s.getScale==null?void 0:s.getScale(R))||{x:1,y:1}:{x:1,y:1},w=Ro(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:R,strategy:u}):v);return{top:(b.top-w.top+h.top)/x.y,bottom:(w.bottom-b.bottom+h.bottom)/x.y,left:(b.left-w.left+h.left)/x.x,right:(w.right-b.right+h.right)/x.x}}const Id=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:s,rects:i,initialPlacement:a,platform:u,elements:c}=t,{mainAxis:f=!0,crossAxis:l=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:g=!0,...y}=Dt(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const b=gt(r),v=bt(a),R=gt(a)===a,x=await(u.isRTL==null?void 0:u.isRTL(c.floating)),w=p||(R||!g?[wo(a)]:$u(a)),E=h!=="none";!p&&E&&w.push(...qu(a,g,h,x));const C=[a,...w],T=await zn(t,y),A=[];let N=((o=s.flip)==null?void 0:o.overflows)||[];if(f&&A.push(T[b]),l){const P=Wu(r,i,x);A.push(T[P[0]],T[P[1]])}if(N=[...N,{placement:r,overflows:A}],!A.every(P=>P<=0)){var F,L;const P=(((F=s.flip)==null?void 0:F.index)||0)+1,B=C[P];if(B&&(!(l==="alignment"?v!==bt(B):!1)||N.every(S=>bt(S.placement)===v?S.overflows[0]>0:!0)))return{data:{index:P,overflows:N},reset:{placement:B}};let D=(L=N.filter(I=>I.overflows[0]<=0).sort((I,S)=>I.overflows[1]-S.overflows[1])[0])==null?void 0:L.placement;if(!D)switch(m){case"bestFit":{var k;const I=(k=N.filter(S=>{if(E){const M=bt(S.placement);return M===v||M==="y"}return!0}).map(S=>[S.placement,S.overflows.filter(M=>M>0).reduce((M,H)=>M+H,0)]).sort((S,M)=>S[1]-M[1])[0])==null?void 0:k[0];I&&(D=I);break}case"initialPlacement":D=a;break}if(r!==D)return{reset:{placement:D}}}return{}}}};function zs(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function js(e){return _u.some(t=>e[t]>=0)}const Md=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...r}=Dt(e,t);switch(o){case"referenceHidden":{const s=await zn(t,{...r,elementContext:"reference"}),i=zs(s,n.reference);return{data:{referenceHiddenOffsets:i,referenceHidden:js(i)}}}case"escaped":{const s=await zn(t,{...r,altBoundary:!0}),i=zs(s,n.floating);return{data:{escapedOffsets:i,escaped:js(i)}}}default:return{}}}}},La=new Set(["left","top"]);async function kd(e,t){const{placement:n,platform:o,elements:r}=e,s=await(o.isRTL==null?void 0:o.isRTL(r.floating)),i=gt(n),a=Zt(n),u=bt(n)==="y",c=La.has(i)?-1:1,f=s&&u?-1:1,l=Dt(t,e);let{mainAxis:p,crossAxis:m,alignmentAxis:h}=typeof l=="number"?{mainAxis:l,crossAxis:0,alignmentAxis:null}:{mainAxis:l.mainAxis||0,crossAxis:l.crossAxis||0,alignmentAxis:l.alignmentAxis};return a&&typeof h=="number"&&(m=a==="end"?h*-1:h),u?{x:m*f,y:p*c}:{x:p*c,y:m*f}}const Pd=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:s,placement:i,middlewareData:a}=t,u=await kd(t,e);return i===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:r+u.x,y:s+u.y,data:{...u,placement:i}}}}},Od=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:a={fn:y=>{let{x:b,y:v}=y;return{x:b,y:v}}},...u}=Dt(e,t),c={x:n,y:o},f=await zn(t,u),l=bt(gt(r)),p=$r(l);let m=c[p],h=c[l];if(s){const y=p==="y"?"top":"left",b=p==="y"?"bottom":"right",v=m+f[y],R=m-f[b];m=xr(v,m,R)}if(i){const y=l==="y"?"top":"left",b=l==="y"?"bottom":"right",v=h+f[y],R=h-f[b];h=xr(v,h,R)}const g=a.fn({...t,[p]:m,[l]:h});return{...g,data:{x:g.x-n,y:g.y-o,enabled:{[p]:s,[l]:i}}}}}},Ad=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:s,middlewareData:i}=t,{offset:a=0,mainAxis:u=!0,crossAxis:c=!0}=Dt(e,t),f={x:n,y:o},l=bt(r),p=$r(l);let m=f[p],h=f[l];const g=Dt(a,t),y=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(u){const R=p==="y"?"height":"width",x=s.reference[p]-s.floating[R]+y.mainAxis,w=s.reference[p]+s.reference[R]-y.mainAxis;m<x?m=x:m>w&&(m=w)}if(c){var b,v;const R=p==="y"?"width":"height",x=La.has(gt(r)),w=s.reference[l]-s.floating[R]+(x&&((b=i.offset)==null?void 0:b[l])||0)+(x?0:y.crossAxis),E=s.reference[l]+s.reference[R]+(x?0:((v=i.offset)==null?void 0:v[l])||0)-(x?y.crossAxis:0);h<w?h=w:h>E&&(h=E)}return{[p]:m,[l]:h}}}},Ld=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:s,platform:i,elements:a}=t,{apply:u=()=>{},...c}=Dt(e,t),f=await zn(t,c),l=gt(r),p=Zt(r),m=bt(r)==="y",{width:h,height:g}=s.floating;let y,b;l==="top"||l==="bottom"?(y=l,b=p===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(b=l,y=p==="end"?"top":"bottom");const v=g-f.top-f.bottom,R=h-f.left-f.right,x=wn(g-f[y],v),w=wn(h-f[b],R),E=!t.middlewareData.shift;let C=x,T=w;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=R),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(C=v),E&&!p){const N=pt(f.left,0),F=pt(f.right,0),L=pt(f.top,0),k=pt(f.bottom,0);m?T=h-2*(N!==0||F!==0?N+F:pt(f.left,f.right)):C=g-2*(L!==0||k!==0?L+k:pt(f.top,f.bottom))}await u({...t,availableWidth:T,availableHeight:C});const A=await i.getDimensions(a.floating);return h!==A.width||g!==A.height?{reset:{rects:!0}}:{}}}};function Da(e){const t=mt(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=Ue(e),s=r?e.offsetWidth:n,i=r?e.offsetHeight:o,a=xo(n)!==s||xo(o)!==i;return a&&(n=s,o=i),{width:n,height:o,$:a}}function Qr(e){return Le(e)?e:e.contextElement}function hn(e){const t=Qr(e);if(!Ue(t))return St(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:s}=Da(t);let i=(s?xo(n.width):n.width)/o,a=(s?xo(n.height):n.height)/r;return(!i||!Number.isFinite(i))&&(i=1),(!a||!Number.isFinite(a))&&(a=1),{x:i,y:a}}const Dd=St(0);function Na(e){const t=Je(e);return!Ao()||!t.visualViewport?Dd:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Nd(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Je(e)?!1:t}function an(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=Qr(e);let i=St(1);t&&(o?Le(o)&&(i=hn(o)):i=hn(e));const a=Nd(s,n,o)?Na(s):St(0);let u=(r.left+a.x)/i.x,c=(r.top+a.y)/i.y,f=r.width/i.x,l=r.height/i.y;if(s){const p=Je(s),m=o&&Le(o)?Je(o):o;let h=p,g=dr(h);for(;g&&o&&m!==h;){const y=hn(g),b=g.getBoundingClientRect(),v=mt(g),R=b.left+(g.clientLeft+parseFloat(v.paddingLeft))*y.x,x=b.top+(g.clientTop+parseFloat(v.paddingTop))*y.y;u*=y.x,c*=y.y,f*=y.x,l*=y.y,u+=R,c+=x,h=Je(g),g=dr(h)}}return Ro({width:f,height:l,x:u,y:c})}function Ho(e,t){const n=Lo(e).scrollLeft;return t?t.left+n:an(It(e)).left+n}function Fa(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Ho(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function Fd(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const s=r==="fixed",i=It(o),a=t?Oo(t.floating):!1;if(o===i||a&&s)return n;let u={scrollLeft:0,scrollTop:0},c=St(1);const f=St(0),l=Ue(o);if((l||!l&&!s)&&((Kt(o)!=="body"||Gt(i))&&(u=Lo(o)),Ue(o))){const m=an(o);c=hn(o),f.x=m.x+o.clientLeft,f.y=m.y+o.clientTop}const p=i&&!l&&!s?Fa(i,u):St(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-u.scrollLeft*c.x+f.x+p.x,y:n.y*c.y-u.scrollTop*c.y+f.y+p.y}}function Vd(e){return Array.from(e.getClientRects())}function Bd(e){const t=It(e),n=Lo(e),o=e.ownerDocument.body,r=pt(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=pt(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let i=-n.scrollLeft+Ho(e);const a=-n.scrollTop;return mt(o).direction==="rtl"&&(i+=pt(t.clientWidth,o.clientWidth)-r),{width:r,height:s,x:i,y:a}}const Us=25;function Hd(e,t){const n=Je(e),o=It(e),r=n.visualViewport;let s=o.clientWidth,i=o.clientHeight,a=0,u=0;if(r){s=r.width,i=r.height;const f=Ao();(!f||f&&t==="fixed")&&(a=r.offsetLeft,u=r.offsetTop)}const c=Ho(o);if(c<=0){const f=o.ownerDocument,l=f.body,p=getComputedStyle(l),m=f.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,h=Math.abs(o.clientWidth-l.clientWidth-m);h<=Us&&(s-=h)}else c<=Us&&(s+=c);return{width:s,height:i,x:a,y:u}}const _d=new Set(["absolute","fixed"]);function zd(e,t){const n=an(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,s=Ue(e)?hn(e):St(1),i=e.clientWidth*s.x,a=e.clientHeight*s.y,u=r*s.x,c=o*s.y;return{width:i,height:a,x:u,y:c}}function Ws(e,t,n){let o;if(t==="viewport")o=Hd(e,n);else if(t==="document")o=Bd(It(e));else if(Le(t))o=zd(t,n);else{const r=Na(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Ro(o)}function Va(e,t){const n=Tt(e);return n===t||!Le(n)||Et(n)?!1:mt(n).position==="fixed"||Va(n,t)}function jd(e,t){const n=t.get(e);if(n)return n;let o=zt(e,[],!1).filter(a=>Le(a)&&Kt(a)!=="body"),r=null;const s=mt(e).position==="fixed";let i=s?Tt(e):e;for(;Le(i)&&!Et(i);){const a=mt(i),u=Ar(i);!u&&a.position==="fixed"&&(r=null),(s?!u&&!r:!u&&a.position==="static"&&!!r&&_d.has(r.position)||Gt(i)&&!u&&Va(e,i))?o=o.filter(f=>f!==i):r=a,i=Tt(i)}return t.set(e,o),o}function Ud(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[...n==="clippingAncestors"?Oo(t)?[]:jd(t,this._c):[].concat(n),o],a=i[0],u=i.reduce((c,f)=>{const l=Ws(t,f,r);return c.top=pt(l.top,c.top),c.right=wn(l.right,c.right),c.bottom=wn(l.bottom,c.bottom),c.left=pt(l.left,c.left),c},Ws(t,a,r));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Wd(e){const{width:t,height:n}=Da(e);return{width:t,height:n}}function $d(e,t,n){const o=Ue(t),r=It(t),s=n==="fixed",i=an(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const u=St(0);function c(){u.x=Ho(r)}if(o||!o&&!s)if((Kt(t)!=="body"||Gt(r))&&(a=Lo(t)),o){const m=an(t,!0,s,t);u.x=m.x+t.clientLeft,u.y=m.y+t.clientTop}else r&&c();s&&!o&&r&&c();const f=r&&!o&&!s?Fa(r,a):St(0),l=i.left+a.scrollLeft-u.x-f.x,p=i.top+a.scrollTop-u.y-f.y;return{x:l,y:p,width:i.width,height:i.height}}function er(e){return mt(e).position==="static"}function $s(e,t){if(!Ue(e)||mt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return It(e)===n&&(n=n.ownerDocument.body),n}function Ba(e,t){const n=Je(e);if(Oo(e))return n;if(!Ue(e)){let r=Tt(e);for(;r&&!Et(r);){if(Le(r)&&!er(r))return r;r=Tt(r)}return n}let o=$s(e,t);for(;o&&$l(o)&&er(o);)o=$s(o,t);return o&&Et(o)&&er(o)&&!Ar(o)?n:o||Xl(e)||n}const Yd=async function(e){const t=this.getOffsetParent||Ba,n=this.getDimensions,o=await n(e.floating);return{reference:$d(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Kd(e){return mt(e).direction==="rtl"}const Gd={convertOffsetParentRelativeRectToViewportRelativeRect:Fd,getDocumentElement:It,getClippingRect:Ud,getOffsetParent:Ba,getElementRects:Yd,getClientRects:Vd,getDimensions:Wd,getScale:hn,isElement:Le,isRTL:Kd};function Ha(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function qd(e,t){let n=null,o;const r=It(e);function s(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function i(a,u){a===void 0&&(a=!1),u===void 0&&(u=1),s();const c=e.getBoundingClientRect(),{left:f,top:l,width:p,height:m}=c;if(a||t(),!p||!m)return;const h=fn(l),g=fn(r.clientWidth-(f+p)),y=fn(r.clientHeight-(l+m)),b=fn(f),R={rootMargin:-h+"px "+-g+"px "+-y+"px "+-b+"px",threshold:pt(0,wn(1,u))||1};let x=!0;function w(E){const C=E[0].intersectionRatio;if(C!==u){if(!x)return i();C?i(!1,C):o=setTimeout(()=>{i(!1,1e-7)},1e3)}C===1&&!Ha(c,e.getBoundingClientRect())&&i(),x=!1}try{n=new IntersectionObserver(w,{...R,root:r.ownerDocument})}catch{n=new IntersectionObserver(w,R)}n.observe(e)}return i(!0),s}function Ys(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:u=!1}=o,c=Qr(e),f=r||s?[...c?zt(c):[],...zt(t)]:[];f.forEach(b=>{r&&b.addEventListener("scroll",n,{passive:!0}),s&&b.addEventListener("resize",n)});const l=c&&a?qd(c,n):null;let p=-1,m=null;i&&(m=new ResizeObserver(b=>{let[v]=b;v&&v.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var R;(R=m)==null||R.observe(t)})),n()}),c&&!u&&m.observe(c),m.observe(t));let h,g=u?an(e):null;u&&y();function y(){const b=an(e);g&&!Ha(g,b)&&n(),g=b,h=requestAnimationFrame(y)}return n(),()=>{var b;f.forEach(v=>{r&&v.removeEventListener("scroll",n),s&&v.removeEventListener("resize",n)}),l?.(),(b=m)==null||b.disconnect(),m=null,u&&cancelAnimationFrame(h)}}const Xd=Pd,Zd=Od,Jd=Id,Qd=Ld,ef=Md,tf=Ad,nf=(e,t,n)=>{const o=new Map,r={platform:Gd,...n},s={...r.platform,_c:o};return Cd(e,t,{...r,platform:s})};var of=typeof document<"u",rf=function(){},mo=of?d.useLayoutEffect:rf;function Io(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,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!Io(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const s=r[o];if(!(s==="_owner"&&e.$$typeof)&&!Io(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function _a(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ks(e,t){const n=_a(e);return Math.round(t*n)/n}function tr(e){const t=d.useRef(e);return mo(()=>{t.current=e}),t}function sf(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:s,floating:i}={},transform:a=!0,whileElementsMounted:u,open:c}=e,[f,l]=d.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=d.useState(o);Io(p,o)||m(o);const[h,g]=d.useState(null),[y,b]=d.useState(null),v=d.useCallback(S=>{S!==E.current&&(E.current=S,g(S))},[]),R=d.useCallback(S=>{S!==C.current&&(C.current=S,b(S))},[]),x=s||h,w=i||y,E=d.useRef(null),C=d.useRef(null),T=d.useRef(f),A=u!=null,N=tr(u),F=tr(r),L=tr(c),k=d.useCallback(()=>{if(!E.current||!C.current)return;const S={placement:t,strategy:n,middleware:p};F.current&&(S.platform=F.current),nf(E.current,C.current,S).then(M=>{const H={...M,isPositioned:L.current!==!1};P.current&&!Io(T.current,H)&&(T.current=H,At.flushSync(()=>{l(H)}))})},[p,t,n,F,L]);mo(()=>{c===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,l(S=>({...S,isPositioned:!1})))},[c]);const P=d.useRef(!1);mo(()=>(P.current=!0,()=>{P.current=!1}),[]),mo(()=>{if(x&&(E.current=x),w&&(C.current=w),x&&w){if(N.current)return N.current(x,w,k);k()}},[x,w,k,N,A]);const B=d.useMemo(()=>({reference:E,floating:C,setReference:v,setFloating:R}),[v,R]),D=d.useMemo(()=>({reference:x,floating:w}),[x,w]),I=d.useMemo(()=>{const S={position:n,left:0,top:0};if(!D.floating)return S;const M=Ks(D.floating,f.x),H=Ks(D.floating,f.y);return a?{...S,transform:"translate("+M+"px, "+H+"px)",..._a(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:M,top:H}},[n,a,D.floating,f.x,f.y]);return d.useMemo(()=>({...f,update:k,refs:B,elements:D,floatingStyles:I}),[f,k,B,D,I])}const af=(e,t)=>({...Xd(e),options:[e,t]}),lf=(e,t)=>({...Zd(e),options:[e,t]}),cf=(e,t)=>({...tf(e),options:[e,t]}),uf=(e,t)=>({...Jd(e),options:[e,t]}),df=(e,t)=>({...Qd(e),options:[e,t]}),ff=(e,t)=>({...ef(e),options:[e,t]}),pf={intentional:"onClick",sloppy:"onPointerDown"};function gf(e){return{escapeKey:typeof e=="boolean"?e:e?.escapeKey??!1,outsidePress:typeof e=="boolean"?e:e?.outsidePress??!0}}function es(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),r=n.useState("floatingElement"),s=n.useState("referenceElement"),i=n.useState("domReferenceElement"),{onOpenChange:a,dataRef:u}=n.context,{enabled:c=!0,escapeKey:f=!0,outsidePress:l=!0,outsidePressEvent:p="sloppy",referencePress:m=!1,referencePressEvent:h="sloppy",ancestorScroll:g=!1,bubbles:y,externalTree:b}=t,v=Jt(b),R=ie(typeof l=="function"?l:()=>!1),x=typeof l=="function"?R:l,w=d.useRef(!1),{escapeKey:E,outsidePress:C}=gf(y),T=d.useRef(null),A=Ze(),N=Ze(),F=ie(()=>{N.clear(),u.current.insideReactTree=!1}),L=d.useRef(!1),k=d.useRef(""),P=ie(O=>{k.current=O.pointerType}),B=ie(()=>{const O=k.current,W=O==="pen"||!O?"mouse":O,K=typeof p=="function"?p():p;return typeof K=="string"?K:K[W]}),D=ie(O=>{if(!o||!c||!f||O.key!=="Escape"||L.current)return;const W=u.current.floatingContext?.nodeId,K=v?on(v.nodesRef.current,W):[];if(!E&&K.length>0){let G=!0;if(K.forEach(q=>{q.context?.open&&!q.context.dataRef.current.__escapeKeyBubbles&&(G=!1)}),!G)return}const ue=Hu(O)?O.nativeEvent:O,X=xe(_r,ue);n.setOpen(!1,X),!E&&!X.isPropagationAllowed&&O.stopPropagation()}),I=ie(O=>{const W=B();return W==="intentional"&&O.type!=="click"||W==="sloppy"&&O.type==="click"}),S=ie(()=>{u.current.insideReactTree=!0,N.start(0,F)}),M=ie((O,W=!1)=>{if(I(O)){F();return}if(u.current.insideReactTree){F();return}if(B()==="intentional"&&W||typeof x=="function"&&!x(O))return;const K=at(O),ue=`[${En("inert")}]`,X=Pe(n.select("floatingElement")).querySelectorAll(ue),G=n.context.triggerElements;if(K&&(G.hasElement(K)||G.hasMatchingElement(oe=>Re(oe,K))))return;let q=Le(K)?K:null;for(;q&&!Et(q);){const oe=Tt(q);if(Et(oe)||!Le(oe))break;q=oe}if(X.length&&Le(K)&&!Vu(K)&&!Re(K,n.select("floatingElement"))&&Array.from(X).every(oe=>!Re(q,oe)))return;if(Ue(K)&&!("touches"in O)){const oe=Et(K),ge=mt(K),se=/auto|scroll/,Ee=oe||se.test(ge.overflowX),De=oe||se.test(ge.overflowY),Be=Ee&&K.clientWidth>0&&K.scrollWidth>K.clientWidth,Ce=De&&K.clientHeight>0&&K.scrollHeight>K.clientHeight,Te=ge.direction==="rtl",Me=Ce&&(Te?O.offsetX<=K.offsetWidth-K.clientWidth:O.offsetX>K.clientWidth),Oe=Be&&O.offsetY>K.clientHeight;if(Me||Oe)return}const U=u.current.floatingContext?.nodeId,ne=v&&on(v.nodesRef.current,U).some(oe=>vt(O,oe.context?.elements.floating));if(vt(O,n.select("floatingElement"))||vt(O,n.select("domReferenceElement"))||ne)return;const j=v?on(v.nodesRef.current,U):[];if(j.length>0){let oe=!0;if(j.forEach(ge=>{ge.context?.open&&!ge.context.dataRef.current.__outsidePressBubbles&&(oe=!1)}),!oe)return}n.setOpen(!1,xe(Do,O)),F()}),H=ie(O=>{B()!=="sloppy"||O.pointerType==="touch"||!n.select("open")||!c||vt(O,n.select("floatingElement"))||vt(O,n.select("domReferenceElement"))||M(O)}),Z=ie(O=>{if(B()!=="sloppy"||!n.select("open")||!c||vt(O,n.select("floatingElement"))||vt(O,n.select("domReferenceElement")))return;const W=O.touches[0];W&&(T.current={startTime:Date.now(),startX:W.clientX,startY:W.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},A.start(1e3,()=>{T.current&&(T.current.dismissOnTouchEnd=!1,T.current.dismissOnMouseDown=!1)}))}),$=ie(O=>{const W=at(O);function K(){Z(O),W?.removeEventListener(O.type,K)}W?.addEventListener(O.type,K)}),_=ie(O=>{const W=w.current;if(w.current=!1,A.clear(),O.type==="mousedown"&&T.current&&!T.current.dismissOnMouseDown)return;const K=at(O);function ue(){O.type==="pointerdown"?H(O):M(O,W),K?.removeEventListener(O.type,ue)}K?.addEventListener(O.type,ue)}),V=ie(O=>{if(B()!=="sloppy"||!T.current||vt(O,n.select("floatingElement"))||vt(O,n.select("domReferenceElement")))return;const W=O.touches[0];if(!W)return;const K=Math.abs(W.clientX-T.current.startX),ue=Math.abs(W.clientY-T.current.startY),X=Math.sqrt(K*K+ue*ue);X>5&&(T.current.dismissOnTouchEnd=!0),X>10&&(M(O),A.clear(),T.current=null)}),J=ie(O=>{const W=at(O);function K(){V(O),W?.removeEventListener(O.type,K)}W?.addEventListener(O.type,K)}),z=ie(O=>{B()!=="sloppy"||!T.current||vt(O,n.select("floatingElement"))||vt(O,n.select("domReferenceElement"))||(T.current.dismissOnTouchEnd&&M(O),A.clear(),T.current=null)}),Y=ie(O=>{const W=at(O);function K(){z(O),W?.removeEventListener(O.type,K)}W?.addEventListener(O.type,K)});d.useEffect(()=>{if(!o||!c)return;u.current.__escapeKeyBubbles=E,u.current.__outsidePressBubbles=C;const O=new Lt;function W(q){n.setOpen(!1,xe(rn,q))}function K(){O.clear(),L.current=!0}function ue(){O.start(Ao()?5:0,()=>{L.current=!1})}const X=Pe(r);X.addEventListener("pointerdown",P,!0),f&&(X.addEventListener("keydown",D),X.addEventListener("compositionstart",K),X.addEventListener("compositionend",ue)),x&&(X.addEventListener("click",_,!0),X.addEventListener("pointerdown",_,!0),X.addEventListener("touchstart",$,!0),X.addEventListener("touchmove",J,!0),X.addEventListener("touchend",Y,!0),X.addEventListener("mousedown",_,!0));let G=[];return g&&(Le(i)&&(G=zt(i)),Le(r)&&(G=G.concat(zt(r))),!Le(s)&&s&&s.contextElement&&(G=G.concat(zt(s.contextElement)))),G=G.filter(q=>q!==X.defaultView?.visualViewport),G.forEach(q=>{q.addEventListener("scroll",W,{passive:!0})}),()=>{X.removeEventListener("pointerdown",P,!0),f&&(X.removeEventListener("keydown",D),X.removeEventListener("compositionstart",K),X.removeEventListener("compositionend",ue)),x&&(X.removeEventListener("click",_,!0),X.removeEventListener("pointerdown",_,!0),X.removeEventListener("touchstart",$,!0),X.removeEventListener("touchmove",J,!0),X.removeEventListener("touchend",Y,!0),X.removeEventListener("mousedown",_,!0)),G.forEach(q=>{q.removeEventListener("scroll",W)}),O.clear(),w.current=!1}},[u,r,s,i,f,x,o,a,g,c,E,C,D,M,_,H,$,J,Y,P,n]),d.useEffect(F,[x,F]);const ee=d.useMemo(()=>({onKeyDown:D,...m&&{[pf[h]]:O=>{n.setOpen(!1,xe(vn,O.nativeEvent))},...h!=="intentional"&&{onClick(O){n.setOpen(!1,xe(vn,O.nativeEvent))}}}}),[D,n,m,h]),Q=ie(O=>{const W=at(O.nativeEvent);!Re(n.select("floatingElement"),W)||O.button!==0||(w.current=!0)}),pe=ie(O=>{!o||!c||O.button!==0||(w.current=!0)}),re=d.useMemo(()=>({onKeyDown:D,onPointerDown:Q,onMouseDown:Q,onMouseUp:Q,onClickCapture:S,onMouseDownCapture(O){S(),pe(O)},onPointerDownCapture(O){S(),pe(O)},onMouseUpCapture:S,onTouchEndCapture:S,onTouchMoveCapture:S}),[D,Q,S,pe]);return d.useMemo(()=>c?{reference:ee,floating:re,trigger:ee}:{},[c,ee,re])}var Mo=Symbol("NOT_FOUND");function mf(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function hf(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function bf(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(n=>typeof n=="function")){const n=e.map(o=>typeof o=="function"?`function ${o.name||"unnamed"}()`:typeof o).join(", ");throw new TypeError(`${t}[${n}]`)}}var Gs=e=>Array.isArray(e)?e:[e];function yf(e){const t=Array.isArray(e[0])?e[0]:e;return bf(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function vf(e,t){const n=[],{length:o}=e;for(let r=0;r<o;r++)n.push(e[r].apply(null,t));return n}function xf(e){let t;return{get(n){return t&&e(t.key,n)?t.value:Mo},put(n,o){t={key:n,value:o}},getEntries(){return t?[t]:[]},clear(){t=void 0}}}function wf(e,t){let n=[];function o(a){const u=n.findIndex(c=>t(a,c.key));if(u>-1){const c=n[u];return u>0&&(n.splice(u,1),n.unshift(c)),c.value}return Mo}function r(a,u){o(a)===Mo&&(n.unshift({key:a,value:u}),n.length>e&&n.pop())}function s(){return n}function i(){n=[]}return{get:o,put:r,getEntries:s,clear:i}}var Rf=(e,t)=>e===t;function Ef(e){return function(n,o){if(n===null||o===null||n.length!==o.length)return!1;const{length:r}=n;for(let s=0;s<r;s++)if(!e(n[s],o[s]))return!1;return!0}}function Sf(e,t){const n=typeof t=="object"?t:{equalityCheck:t},{equalityCheck:o=Rf,maxSize:r=1,resultEqualityCheck:s}=n,i=Ef(o);let a=0;const u=r<=1?xf(i):wf(r,i);function c(){let f=u.get(arguments);if(f===Mo){if(f=e.apply(null,arguments),a++,s){const p=u.getEntries().find(m=>s(m.value,f));p&&(f=p.value,a!==0&&a--)}u.put(arguments,f)}return f}return c.clearCache=()=>{u.clear(),c.resetResultsCount()},c.resultsCount=()=>a,c.resetResultsCount=()=>{a=0},c}var Tf=class{constructor(e){this.value=e}deref(){return this.value}},Cf=typeof WeakRef<"u"?WeakRef:Tf,If=0,qs=1;function no(){return{s:If,v:void 0,o:null,p:null}}function za(e,t={}){let n=no();const{resultEqualityCheck:o}=t;let r,s=0;function i(){let a=n;const{length:u}=arguments;for(let l=0,p=u;l<p;l++){const m=arguments[l];if(typeof m=="function"||typeof m=="object"&&m!==null){let h=a.o;h===null&&(a.o=h=new WeakMap);const g=h.get(m);g===void 0?(a=no(),h.set(m,a)):a=g}else{let h=a.p;h===null&&(a.p=h=new Map);const g=h.get(m);g===void 0?(a=no(),h.set(m,a)):a=g}}const c=a;let f;if(a.s===qs)f=a.v;else if(f=e.apply(null,arguments),s++,o){const l=r?.deref?.()??r;l!=null&&o(l,f)&&(f=l,s!==0&&s--),r=typeof f=="object"&&f!==null||typeof f=="function"?new Cf(f):f}return c.s=qs,c.v=f,f}return i.clearCache=()=>{n=no(),i.resetResultsCount()},i.resultsCount=()=>s,i.resetResultsCount=()=>{s=0},i}function ja(e,...t){const n=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,o=(...r)=>{let s=0,i=0,a,u={},c=r.pop();typeof c=="object"&&(u=c,c=r.pop()),mf(c,`createSelector expects an output function after the inputs, but received: [${typeof c}]`);const f={...n,...u},{memoize:l,memoizeOptions:p=[],argsMemoize:m=za,argsMemoizeOptions:h=[]}=f,g=Gs(p),y=Gs(h),b=yf(r),v=l(function(){return s++,c.apply(null,arguments)},...g),R=m(function(){i++;const w=vf(b,arguments);return a=v.apply(null,w),a},...y);return Object.assign(R,{resultFunc:c,memoizedResultFunc:v,dependencies:b,dependencyRecomputations:()=>i,resetDependencyRecomputations:()=>{i=0},lastResult:()=>a,recomputations:()=>s,resetRecomputations:()=>{s=0},memoize:l,argsMemoize:m})};return Object.assign(o,{withTypes:()=>o}),o}var Mf=ja(za),kf=Object.assign((e,t=Mf)=>{hf(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const n=Object.keys(e),o=n.map(s=>e[s]);return t(o,(...s)=>s.reduce((i,a,u)=>(i[n[u]]=a,i),{}))},{withTypes:()=>kf});ja({memoize:Sf,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const ae=(e,t,n,o,r,s,...i)=>{if(i.length>0)throw new Error(qe(1));let a;if(e)a=e;else throw new Error("Missing arguments");return a};var nr={exports:{}},or={};var Xs;function Pf(){if(Xs)return or;Xs=1;var e=wi();function t(l,p){return l===p&&(l!==0||1/l===1/p)||l!==l&&p!==p}var n=typeof Object.is=="function"?Object.is:t,o=e.useState,r=e.useEffect,s=e.useLayoutEffect,i=e.useDebugValue;function a(l,p){var m=p(),h=o({inst:{value:m,getSnapshot:p}}),g=h[0].inst,y=h[1];return s(function(){g.value=m,g.getSnapshot=p,u(g)&&y({inst:g})},[l,m,p]),r(function(){return u(g)&&y({inst:g}),l(function(){u(g)&&y({inst:g})})},[l]),i(m),m}function u(l){var p=l.getSnapshot;l=l.value;try{var m=p();return!n(l,m)}catch{return!0}}function c(l,p){return p()}var f=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?c:a;return or.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:f,or}var Zs;function Ua(){return Zs||(Zs=1,nr.exports=Pf()),nr.exports}var Wa=Ua(),rr={exports:{}},sr={};var Js;function Of(){if(Js)return sr;Js=1;var e=wi(),t=Ua();function n(c,f){return c===f&&(c!==0||1/c===1/f)||c!==c&&f!==f}var o=typeof Object.is=="function"?Object.is:n,r=t.useSyncExternalStore,s=e.useRef,i=e.useEffect,a=e.useMemo,u=e.useDebugValue;return sr.useSyncExternalStoreWithSelector=function(c,f,l,p,m){var h=s(null);if(h.current===null){var g={hasValue:!1,value:null};h.current=g}else g=h.current;h=a(function(){function b(E){if(!v){if(v=!0,R=E,E=p(E),m!==void 0&&g.hasValue){var C=g.value;if(m(C,E))return x=C}return x=E}if(C=x,o(R,E))return C;var T=p(E);return m!==void 0&&m(C,T)?(R=E,C):(R=E,x=T)}var v=!1,R,x,w=l===void 0?null:l;return[function(){return b(f())},w===null?void 0:function(){return b(w())}]},[f,l,p,m]);var y=r(c,h[0],h[1]);return i(function(){g.hasValue=!0,g.value=y},[y]),u(y),y},sr}var Qs;function Af(){return Qs||(Qs=1,rr.exports=Of()),rr.exports}var Lf=Af();const Tr=[];let Cr;function Df(){return Cr}function Nf(e){Tr.push(e)}function $a(e){const t=(n,o)=>{const r=tt(Vf).current;let s;try{Cr=r;for(const i of Tr)i.before(r);s=e(n,o);for(const i of Tr)i.after(r);r.didInitialize=!0}finally{Cr=void 0}return s};return t.displayName=e.displayName||e.name,t}function Ff(e){return d.forwardRef($a(e))}function Vf(){return{didInitialize:!1}}const Bf=Dr(19),Hf=Bf?zf:jf;function ve(e,t,n,o,r){return Hf(e,t,n,o,r)}function _f(e,t,n,o,r){const s=d.useCallback(()=>t(e.getSnapshot(),n,o,r),[e,t,n,o,r]);return Wa.useSyncExternalStore(e.subscribe,s,s)}Nf({before(e){e.syncIndex=0,e.didInitialize||(e.syncTick=1,e.syncHooks=[],e.didChangeStore=!0,e.getSnapshot=()=>{let t=!1;for(let n=0;n<e.syncHooks.length;n+=1){const o=e.syncHooks[n],r=o.selector(o.store.state,o.a1,o.a2,o.a3);(o.didChange||!Object.is(o.value,r))&&(t=!0,o.value=r,o.didChange=!1)}return t&&(e.syncTick+=1),e.syncTick})},after(e){e.syncHooks.length>0&&(e.didChangeStore&&(e.didChangeStore=!1,e.subscribe=t=>{const n=new Set;for(const r of e.syncHooks)n.add(r.store);const o=[];for(const r of n)o.push(r.subscribe(t));return()=>{for(const r of o)r()}}),Wa.useSyncExternalStore(e.subscribe,e.getSnapshot,e.getSnapshot))}});function zf(e,t,n,o,r){const s=Df();if(!s)return _f(e,t,n,o,r);const i=s.syncIndex;s.syncIndex+=1;let a;return s.didInitialize?(a=s.syncHooks[i],(a.store!==e||a.selector!==t||!Object.is(a.a1,n)||!Object.is(a.a2,o)||!Object.is(a.a3,r))&&(a.store!==e&&(s.didChangeStore=!0),a.store=e,a.selector=t,a.a1=n,a.a2=o,a.a3=r,a.didChange=!0)):(a={store:e,selector:t,a1:n,a2:o,a3:r,value:t(e.getSnapshot(),n,o,r),didChange:!1},s.syncHooks.push(a)),a.value}function jf(e,t,n,o,r){return Lf.useSyncExternalStoreWithSelector(e.subscribe,e.getSnapshot,e.getSnapshot,s=>t(s,n,o,r))}class Ya{constructor(t){this.state=t,this.listeners=new Set,this.updateTick=0}subscribe=t=>(this.listeners.add(t),()=>{this.listeners.delete(t)});getSnapshot=()=>this.state;setState(t){if(this.state===t)return;this.state=t,this.updateTick+=1;const n=this.updateTick;for(const o of this.listeners){if(n!==this.updateTick)return;o(t)}}update(t){for(const n in t)if(!Object.is(this.state[n],t[n])){this.setState({...this.state,...t});return}}set(t,n){Object.is(this.state[t],n)||this.setState({...this.state,[t]:n})}notifyAll(){const t={...this.state};this.setState(t)}use(t,n,o,r){return ve(this,t,n,o,r)}}class ts extends Ya{constructor(t,n={},o){super(t),this.context=n,this.selectors=o}useSyncedValue(t,n){d.useDebugValue(t),le(()=>{this.state[t]!==n&&this.set(t,n)},[t,n])}useSyncedValueWithCleanup(t,n){const o=this;le(()=>(o.state[t]!==n&&o.set(t,n),()=>{o.set(t,void 0)}),[o,t,n])}useSyncedValues(t){const n=this,o=Object.values(t);le(()=>{n.update(t)},[n,...o])}useControlledProp(t,n){d.useDebugValue(t);const o=n!==void 0;le(()=>{o&&!Object.is(this.state[t],n)&&super.setState({...this.state,[t]:n})},[t,n,o])}select(t,n,o,r){const s=this.selectors[t];return s(this.state,n,o,r)}useState(t,n,o,r){return d.useDebugValue(t),ve(this,this.selectors[t],n,o,r)}useContextCallback(t,n){d.useDebugValue(t);const o=ie(n??lt);this.context[t]=o}useStateSetter(t){const n=d.useRef(void 0);return n.current===void 0&&(n.current=o=>{this.set(t,o)}),n.current}observe(t,n){let o;typeof t=="function"?o=t:o=this.selectors[t];let r=o(this.state);return n(r,r,this),this.subscribe(s=>{const i=o(s);if(!Object.is(r,i)){const a=r;r=i,n(i,a,this)}})}}const Uf={open:ae(e=>e.open),domReferenceElement:ae(e=>e.domReferenceElement),referenceElement:ae(e=>e.positionReference??e.referenceElement),floatingElement:ae(e=>e.floatingElement),floatingId:ae(e=>e.floatingId)};class ns extends ts{constructor(t){const{nested:n,noEmit:o,onOpenChange:r,triggerElements:s,...i}=t;super({...i,positionReference:i.referenceElement,domReferenceElement:i.referenceElement},{onOpenChange:r,dataRef:{current:{}},events:Sa(),nested:n,noEmit:o,triggerElements:s},Uf)}setOpen=(t,n)=>{if((!t||!this.state.open||la(n.event))&&(this.context.dataRef.current.openEvent=t?n.event:void 0),!this.context.noEmit){const o={open:t,reason:n.reason,nativeEvent:n.event,nested:this.context.nested,triggerElement:n.trigger};this.context.events.emit("openchange",o)}this.context.onOpenChange?.(t,n)}}function Ka(e,t){const n=d.useRef(null),o=d.useRef(null);return d.useCallback(r=>{if(e!==void 0){if(n.current!==null){const s=n.current,i=o.current,a=t.context.triggerElements.getById(s);i&&a===i&&t.context.triggerElements.delete(s),n.current=null,o.current=null}r!==null&&(n.current=e,o.current=r,t.context.triggerElements.add(e,r))}},[t,e])}function Ga(e,t,n,o){const r=n.useState("isMountedByTrigger",e),s=Ka(e,n),i=ie(a=>{if(s(a),!a||!n.select("open"))return;const u=n.select("activeTriggerId");if(u===e){n.update({activeTriggerElement:a,...o});return}u==null&&n.update({activeTriggerId:e,activeTriggerElement:a,...o})});return le(()=>{r&&n.update({activeTriggerElement:t.current,...o})},[r,n,t,...Object.values(o)]),{registerTrigger:i,isMountedByThisTrigger:r}}function qa(e){const t=e.useState("open");le(()=>{if(t&&!e.select("activeTriggerId")&&e.context.triggerElements.size===1){const n=e.context.triggerElements.entries().next();if(!n.done){const[o,r]=n.value;e.update({activeTriggerId:o,activeTriggerElement:r})}}},[t,e])}function Xa(e,t,n){const{mounted:o,setMounted:r,transitionStatus:s}=In(e);t.useSyncedValues({mounted:o,transitionStatus:s});const i=ie(()=>{r(!1),t.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),n?.(),t.context.onOpenChangeComplete?.(!1)}),a=t.useState("preventUnmountingOnClose");return Ft({enabled:!a,open:e,ref:t.context.popupRef,onComplete(){e||i()}}),{forceUnmount:i,transitionStatus:s}}class _o{constructor(){this.elementsSet=new Set,this.idMap=new Map}add(t,n){const o=this.idMap.get(t);o!==n&&(o!==void 0&&this.elementsSet.delete(o),this.elementsSet.add(n),this.idMap.set(t,n))}delete(t){const n=this.idMap.get(t);n&&(this.elementsSet.delete(n),this.idMap.delete(t))}hasElement(t){return this.elementsSet.has(t)}hasMatchingElement(t){for(const n of this.elementsSet)if(t(n))return!0;return!1}getById(t){return this.idMap.get(t)}entries(){return this.idMap.entries()}elements(){return this.elementsSet.values()}get size(){return this.idMap.size}}function Wf(){return new ns({open:!1,floatingElement:null,referenceElement:null,triggerElements:new _o,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function Za(){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:"idle",floatingRootContext:Wf(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,triggerIdProp:void 0,popupElement:null,positionerElement:null,activeTriggerProps:Ye,inactiveTriggerProps:Ye,popupProps:Ye}}const oo=ae(e=>e.triggerIdProp??e.activeTriggerId),Ja={open:ae(e=>e.openProp??e.open),mounted:ae(e=>e.mounted),transitionStatus:ae(e=>e.transitionStatus),floatingRootContext:ae(e=>e.floatingRootContext),preventUnmountingOnClose:ae(e=>e.preventUnmountingOnClose),payload:ae(e=>e.payload),activeTriggerId:oo,activeTriggerElement:ae(e=>e.mounted?e.activeTriggerElement:null),isTriggerActive:ae((e,t)=>t!==void 0&&oo(e)===t),isOpenedByTrigger:ae((e,t)=>t!==void 0&&oo(e)===t&&e.open),isMountedByTrigger:ae((e,t)=>t!==void 0&&oo(e)===t&&e.mounted),triggerProps:ae((e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps),popupProps:ae(e=>e.popupProps),popupElement:ae(e=>e.popupElement),positionerElement:ae(e=>e.positionerElement)};function Qa(e){const{open:t=!1,onOpenChange:n,elements:o={}}=e,r=Xt(),s=Vt()!=null,i=tt(()=>new ns({open:t,onOpenChange:n,referenceElement:o.reference??null,floatingElement:o.floating??null,triggerElements:new _o,floatingId:r,nested:s,noEmit:!1})).current;return le(()=>{const a={open:t,floatingId:r};o.reference!==void 0&&(a.referenceElement=o.reference,a.domReferenceElement=Le(o.reference)?o.reference:null),o.floating!==void 0&&(a.floatingElement=o.floating),i.update(a)},[t,r,o.reference,o.floating,i]),i.context.onOpenChange=n,i.context.nested=s,i.context.noEmit=!1,i}function $f(e={}){const{nodeId:t,externalTree:n}=e,o=Qa(e),r=e.rootContext||o,s={reference:r.useState("referenceElement"),floating:r.useState("floatingElement"),domReference:r.useState("domReferenceElement")},[i,a]=d.useState(null),u=d.useRef(null),c=Jt(n);le(()=>{s.domReference&&(u.current=s.domReference)},[s.domReference]);const f=sf({...e,elements:{...s,...i&&{reference:i}}}),l=d.useCallback(C=>{const T=Le(C)?{getBoundingClientRect:()=>C.getBoundingClientRect(),getClientRects:()=>C.getClientRects(),contextElement:C}:C;a(T),f.refs.setReference(T)},[f.refs]),[p,m]=d.useState(null),[h,g]=d.useState(null);r.useSyncedValue("referenceElement",p),r.useSyncedValue("domReferenceElement",Le(p)?p:null),r.useSyncedValue("floatingElement",h);const y=d.useCallback(C=>{(Le(C)||C===null)&&(u.current=C,m(C)),(Le(f.refs.reference.current)||f.refs.reference.current===null||C!==null&&!Le(C))&&f.refs.setReference(C)},[f.refs,m]),b=d.useCallback(C=>{g(C),f.refs.setFloating(C)},[f.refs]),v=d.useMemo(()=>({...f.refs,setReference:y,setFloating:b,setPositionReference:l,domReference:u}),[f.refs,y,b,l]),R=d.useMemo(()=>({...f.elements,domReference:s.domReference}),[f.elements,s.domReference]),x=r.useState("open"),w=r.useState("floatingId"),E=d.useMemo(()=>({...f,dataRef:r.context.dataRef,open:x,onOpenChange:r.setOpen,events:r.context.events,floatingId:w,refs:v,elements:R,nodeId:t,rootStore:r}),[f,v,R,t,r,x,w]);return le(()=>{r.context.dataRef.current.floatingContext=E;const C=c?.nodesRef.current.find(T=>T.id===t);C&&(C.context=E)}),d.useMemo(()=>({...f,context:E,refs:v,elements:R,rootStore:r}),[f,v,R,E,r])}function el(e){const{popupStore:t,noEmit:n=!1,treatPopupAsFloatingElement:o=!1,onOpenChange:r}=e,s=Xt(),i=Vt()!=null,a=t.useState("open"),u=t.useState("activeTriggerElement"),c=t.useState(o?"popupElement":"positionerElement"),f=t.context.triggerElements,l=tt(()=>new ns({open:a,referenceElement:u,floatingElement:c,triggerElements:f,onOpenChange:r,floatingId:s,nested:i,noEmit:n})).current;return le(()=>{const p={open:a,floatingId:s,referenceElement:u,floatingElement:c};Le(u)&&(p.domReferenceElement=u),l.state.positionReference===l.state.referenceElement&&(p.positionReference=u),l.update(p)},[a,s,u,c,l]),l.context.onOpenChange=r,l.context.nested=i,l.context.noEmit=n,l}const ir=Lu&&ta;function Yf(e,t={}){const n="rootStore"in e?e.rootStore:e,{events:o,dataRef:r}=n.context,{enabled:s=!0,delay:i}=t,a=d.useRef(!1),u=d.useRef(null),c=Ze(),f=d.useRef(!0);d.useEffect(()=>{const p=n.select("domReferenceElement");if(!s)return;const m=Je(p);function h(){const b=n.select("domReferenceElement");!n.select("open")&&Ue(b)&&b===ht(Pe(b))&&(a.current=!0)}function g(){f.current=!0}function y(){f.current=!1}return m.addEventListener("blur",h),ir&&(m.addEventListener("keydown",g,!0),m.addEventListener("pointerdown",y,!0)),()=>{m.removeEventListener("blur",h),ir&&(m.removeEventListener("keydown",g,!0),m.removeEventListener("pointerdown",y,!0))}},[n,s]),d.useEffect(()=>{if(!s)return;function p(m){if(m.reason===vn||m.reason===_r){const h=n.select("domReferenceElement");Le(h)&&(u.current=h,a.current=!0)}}return o.on("openchange",p),()=>{o.off("openchange",p)}},[o,s,n]);const l=d.useMemo(()=>({onMouseLeave(){a.current=!1,u.current=null},onFocus(p){const m=p.currentTarget;if(a.current){if(u.current===m)return;a.current=!1,u.current=null}const h=at(p.nativeEvent);if(Le(h)){if(ir&&!p.relatedTarget){if(!f.current&&!Fo(h))return}else if(!Bu(h))return}const g=vo(p.relatedTarget,n.context.triggerElements),{nativeEvent:y,currentTarget:b}=p,v=typeof i=="function"?i():i;if(n.select("open")&&g||v===0||v===void 0){n.setOpen(!0,xe(Nn,y,b));return}c.start(v,()=>{a.current||n.setOpen(!0,xe(Nn,y,b))})},onBlur(p){a.current=!1,u.current=null;const m=p.relatedTarget,h=p.nativeEvent,g=Le(m)&&m.hasAttribute(En("focus-guard"))&&m.getAttribute("data-type")==="outside";c.start(0,()=>{const y=n.select("domReferenceElement"),b=ht(y?y.ownerDocument:document);!m&&b===y||Re(r.current.floatingContext?.refs.floating.current,b)||Re(y,b)||g||vo(m??b,n.context.triggerElements)||n.setOpen(!1,xe(Nn,h))})}}),[r,n,c,i]);return d.useMemo(()=>s?{reference:l,trigger:l}:{},[s,l])}const Ir=En("safe-polygon"),Kf=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${sa}`;function Gf(e){return e?!!e.closest(Kf):!1}class os{constructor(){this.pointerType=void 0,this.interactedInside=!1,this.handler=void 0,this.blockMouseMove=!0,this.performedPointerEventsMutation=!1,this.unbindMouseMove=()=>{},this.restTimeoutPending=!1,this.openChangeTimeout=new Lt,this.restTimeout=new Lt,this.handleCloseOptions=void 0}static create(){return new os}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose}function tl(e){const t=tt(os.create).current,n=e.context.dataRef.current;return n.hoverInteractionState||(n.hoverInteractionState=t),jr(n.hoverInteractionState.disposeEffect),n.hoverInteractionState}const qf=new Set(["click","mousedown"]);function Xf(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),r=n.useState("floatingElement"),s=n.useState("domReferenceElement"),{dataRef:i}=n.context,{enabled:a=!0,closeDelay:u=0}=t,c=tl(n),f=Jt(),l=Vt(),p=ie(()=>c.interactedInside?!0:i.current.openEvent?qf.has(i.current.openEvent.type):!1),m=ie(()=>{const R=i.current.openEvent?.type;return R?.includes("mouse")&&R!=="mousedown"}),h=ie(R=>vo(R,n.context.triggerElements)),g=d.useCallback((R,x=!0)=>{const w=Zf(u,c.pointerType);w&&!c.handler?c.openChangeTimeout.start(w,()=>n.setOpen(!1,xe(ft,R))):x&&(c.openChangeTimeout.clear(),n.setOpen(!1,xe(ft,R)))},[u,n,c]),y=ie(()=>{c.unbindMouseMove(),c.handler=void 0}),b=ie(()=>{if(c.performedPointerEventsMutation){const R=Pe(r).body;R.style.pointerEvents="",R.removeAttribute(Ir),c.performedPointerEventsMutation=!1}}),v=ie(R=>{const x=at(R);if(!Gf(x)){c.interactedInside=!1;return}c.interactedInside=!0});le(()=>{o||(c.pointerType=void 0,c.restTimeoutPending=!1,c.interactedInside=!1,y(),b())},[o,c,y,b]),d.useEffect(()=>()=>{y()},[y]),d.useEffect(()=>b,[b]),le(()=>{if(a&&o&&c.handleCloseOptions?.blockPointerEvents&&m()&&Le(s)&&r){c.performedPointerEventsMutation=!0;const R=Pe(r).body;R.setAttribute(Ir,"");const x=s,w=r,E=f?.nodesRef.current.find(C=>C.id===l)?.context?.elements.floating;return E&&(E.style.pointerEvents=""),R.style.pointerEvents="none",x.style.pointerEvents="auto",w.style.pointerEvents="auto",()=>{R.style.pointerEvents="",x.style.pointerEvents="",w.style.pointerEvents=""}}},[a,o,s,r,c,m,f,l]),d.useEffect(()=>{if(!a)return;function R(C){p()||!i.current.floatingContext||!n.select("open")||h(C.relatedTarget)||(b(),y(),p()||g(C))}function x(C){c.openChangeTimeout.clear(),b(),c.handler?.(C),y()}function w(C){p()||g(C,!1)}const E=r;return E&&(E.addEventListener("mouseleave",R),E.addEventListener("mouseenter",x),E.addEventListener("mouseleave",w),E.addEventListener("pointerdown",v,!0)),()=>{E&&(E.removeEventListener("mouseleave",R),E.removeEventListener("mouseenter",x),E.removeEventListener("mouseleave",w),E.removeEventListener("pointerdown",v,!0))}},[a,r,n,i,p,h,g,b,y,v,c])}function Zf(e,t){return t&&!xn(t)?0:typeof e=="function"?e():e}function ar(e){return typeof e=="function"?e():e}const Jf={current:null};function nl(e,t={}){const n="rootStore"in e?e.rootStore:e,{dataRef:o,events:r}=n.context,{enabled:s=!0,delay:i=0,handleClose:a=null,mouseOnly:u=!1,restMs:c=0,move:f=!0,triggerElementRef:l=Jf,externalTree:p,isActiveTrigger:m=!0}=t,h=Jt(p),g=tl(n),y=nt(a),b=nt(i),v=nt(c),R=nt(s);m&&(g.handleCloseOptions=y.current?.__options);const x=ie(()=>g.interactedInside?!0:o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1),w=ie(N=>vo(N,n.context.triggerElements)),E=d.useCallback((N,F=!0)=>{const L=Zo(b.current,"close",g.pointerType);L&&!g.handler?g.openChangeTimeout.start(L,()=>n.setOpen(!1,xe(ft,N))):F&&(g.openChangeTimeout.clear(),n.setOpen(!1,xe(ft,N)))},[b,n,g]),C=ie(()=>{g.unbindMouseMove(),g.handler=void 0}),T=ie(()=>{if(g.performedPointerEventsMutation){const N=Pe(n.select("domReferenceElement")).body;N.style.pointerEvents="",N.removeAttribute(Ir),g.performedPointerEventsMutation=!1}});d.useEffect(()=>{if(!s)return;function N(F){F.open||(g.openChangeTimeout.clear(),g.restTimeout.clear(),g.blockMouseMove=!0,g.restTimeoutPending=!1)}return r.on("openchange",N),()=>{r.off("openchange",N)}},[s,r,g]);const A=ie(N=>{if(x()||!o.current.floatingContext||w(N.relatedTarget))return;const F=l.current;y.current?.({...o.current.floatingContext,tree:h,x:N.clientX,y:N.clientY,onClose(){T(),C(),!x()&&F===n.select("domReferenceElement")&&E(N)}})(N)});return d.useEffect(()=>{if(!s)return;const N=l.current??(m?n.select("domReferenceElement"):null);if(!Le(N))return;function F(P){if(g.openChangeTimeout.clear(),g.blockMouseMove=!1,u&&!xn(g.pointerType)||ar(v.current)>0&&!Zo(b.current,"open"))return;const B=Zo(b.current,"open",g.pointerType),D=n.select("domReferenceElement"),I=n.context.triggerElements,S=(I.hasElement(P.target)||I.hasMatchingElement($=>Re($,P.target)))&&(!D||!Re(D,P.target)),M=P.currentTarget??null,H=n.select("open"),Z=!H||S;S&&H?n.setOpen(!0,xe(ft,P,M)):B?g.openChangeTimeout.start(B,()=>{Z&&n.setOpen(!0,xe(ft,P,M))}):Z&&n.setOpen(!0,xe(ft,P,M))}function L(P){if(x()){T();return}g.unbindMouseMove();const B=n.select("domReferenceElement"),D=Pe(B);if(g.restTimeout.clear(),g.restTimeoutPending=!1,w(P.relatedTarget))return;if(y.current&&o.current.floatingContext){n.select("open")||g.openChangeTimeout.clear();const S=l.current;g.handler=y.current({...o.current.floatingContext,tree:h,x:P.clientX,y:P.clientY,onClose(){T(),C(),R.current&&!x()&&S===n.select("domReferenceElement")&&E(P,!0)}});const M=g.handler;M(P),D.addEventListener("mousemove",M),g.unbindMouseMove=()=>{D.removeEventListener("mousemove",M)};return}(g.pointerType!=="touch"||!Re(n.select("floatingElement"),P.relatedTarget))&&E(P)}function k(P){A(P)}return n.select("open")&&N.addEventListener("mouseleave",k),f&&N.addEventListener("mousemove",F,{once:!0}),N.addEventListener("mouseenter",F),N.addEventListener("mouseleave",L),()=>{N.removeEventListener("mouseleave",k),f&&N.removeEventListener("mousemove",F),N.removeEventListener("mouseenter",F),N.removeEventListener("mouseleave",L)}},[C,T,o,b,E,n,s,y,A,g,m,x,w,u,f,v,l,h,R]),d.useMemo(()=>{if(!s)return;function N(F){g.pointerType=F.pointerType}return{onPointerDown:N,onPointerEnter:N,onMouseMove(F){const{nativeEvent:L}=F,k=F.currentTarget,P=n.select("domReferenceElement"),B=n.context.triggerElements,D=n.select("open"),I=(B.hasElement(F.target)||B.hasMatchingElement(M=>Re(M,F.target)))&&(!P||!Re(P,F.target));if(u&&!xn(g.pointerType)||D&&!I||ar(v.current)===0||!I&&g.restTimeoutPending&&F.movementX**2+F.movementY**2<2)return;g.restTimeout.clear();function S(){if(g.restTimeoutPending=!1,x())return;const M=n.select("open");!g.blockMouseMove&&(!M||I)&&n.setOpen(!0,xe(ft,L,k))}g.pointerType==="touch"?At.flushSync(()=>{S()}):I&&D?S():(g.restTimeoutPending=!0,g.restTimeout.start(ar(v.current),S))}}},[s,g,x,u,n,v])}function Pn(e=[]){const t=e.map(c=>c?.reference),n=e.map(c=>c?.floating),o=e.map(c=>c?.item),r=e.map(c=>c?.trigger),s=d.useCallback(c=>ro(c,e,"reference"),t),i=d.useCallback(c=>ro(c,e,"floating"),n),a=d.useCallback(c=>ro(c,e,"item"),o),u=d.useCallback(c=>ro(c,e,"trigger"),r);return d.useMemo(()=>({getReferenceProps:s,getFloatingProps:i,getItemProps:a,getTriggerProps:u}),[s,i,a,u])}function ro(e,t,n){const o=new Map,r=n==="item",s={};n==="floating"&&(s.tabIndex=-1,s[yr]="");for(const i in e)r&&e&&(i===oa||i===ra)||(s[i]=e[i]);for(let i=0;i<t.length;i+=1){let a;const u=t[i]?.[n];typeof u=="function"?a=e?u(e):null:a=u,a&&ei(s,a,r,o)}return ei(s,e,r,o),s}function ei(e,t,n,o){for(const r in t){const s=t[r];n&&(r===oa||r===ra)||(r.startsWith("on")?(o.has(r)||o.set(r,[]),typeof s=="function"&&(o.get(r)?.push(s),e[r]=(...i)=>o.get(r)?.map(a=>a(...i)).find(a=>a!==void 0))):e[r]=s)}}const Qf="Escape";function zo(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function so(e,t){return zo(t,e===Wr||e===$n,e===jt||e===Ut)}function lr(e,t,n){return zo(t,e===$n,n?e===jt:e===Ut)||e==="Enter"||e===" "||e===""}function ep(e,t,n){return zo(t,n?e===jt:e===Ut,e===$n)}function tp(e,t,n,o){const r=n?e===Ut:e===jt,s=e===Wr;return t==="both"||t==="horizontal"&&o&&o>1?e===Qf:zo(t,r,s)}function ol(e,t){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),r=n.useState("floatingElement"),s=n.useState("domReferenceElement"),i=n.context.dataRef,{listRef:a,activeIndex:u,onNavigate:c=()=>{},enabled:f=!0,selectedIndex:l=null,allowEscape:p=!1,loopFocus:m=!1,nested:h=!1,rtl:g=!1,virtual:y=!1,focusItemOnOpen:b="auto",focusItemOnHover:v=!0,openOnArrowKeyDown:R=!0,disabledIndices:x=void 0,orientation:w="vertical",parentOrientation:E,cols:C=1,id:T,resetOnPointerLeave:A=!0,externalTree:N}=t,F=_n(r),L=nt(F),k=Vt(),P=Jt(N);le(()=>{i.current.orientation=w},[i,w]);const B=vr(s),D=d.useRef(b),I=d.useRef(l??-1),S=d.useRef(null),M=d.useRef(!0),H=ie(U=>{c(I.current===-1?null:I.current,U)}),Z=d.useRef(H),$=d.useRef(!!r),_=d.useRef(o),V=d.useRef(!1),J=d.useRef(!1),z=nt(x),Y=nt(o),ee=nt(l),Q=nt(A),pe=ie(()=>{function U(ge){y?P?.events.emit("virtualfocus",ge):Vn(ge,{sync:V.current,preventScroll:!0})}const ne=a.current[I.current],j=J.current;ne&&U(ne),(V.current?ge=>ge():requestAnimationFrame)(()=>{const ge=a.current[I.current]||ne;if(!ge)return;ne||U(ge),O&&(j||!M.current)&&ge.scrollIntoView?.({block:"nearest",inline:"nearest"})})});le(()=>{f&&(o&&r?(I.current=l??-1,D.current&&l!=null&&(J.current=!0,H())):$.current&&(I.current=-1,Z.current()))},[f,o,r,l,H]),le(()=>{if(f){if(!o){V.current=!1;return}if(r)if(u==null){if(V.current=!1,ee.current!=null)return;if($.current&&(I.current=-1,pe()),(!_.current||!$.current)&&D.current&&(S.current!=null||D.current===!0&&S.current==null)){let U=0;const ne=()=>{a.current[0]==null?(U<2&&(U?requestAnimationFrame:queueMicrotask)(ne),U+=1):(I.current=S.current==null||lr(S.current,w,g)||h?go(a):Rr(a),S.current=null,H())};ne()}}else pn(a,u)||(I.current=u,pe(),J.current=!1)}},[f,o,r,u,ee,h,a,w,g,H,pe,z]),le(()=>{if(!f||r||!P||y||!$.current)return;const U=P.nodesRef.current,ne=U.find(ge=>ge.id===k)?.context?.elements.floating,j=ht(Pe(r)),oe=U.some(ge=>ge.context&&Re(ge.context.elements.floating,j));ne&&!oe&&M.current&&ne.focus({preventScroll:!0})},[f,r,P,k,y]),le(()=>{Z.current=H,_.current=o,$.current=!!r}),le(()=>{o||(S.current=null,D.current=b)},[o,b]);const re=u!=null,O=d.useMemo(()=>{function U(j){if(!Y.current)return;const oe=a.current.indexOf(j.currentTarget);oe!==-1&&I.current!==oe&&(I.current=oe,H(j))}return{onFocus(j){V.current=!0,U(j)},onClick:({currentTarget:j})=>j.focus({preventScroll:!0}),onMouseMove(j){V.current=!0,J.current=!1,v&&U(j)},onPointerLeave(j){if(!Y.current||!M.current||j.pointerType==="touch")return;V.current=!0;const oe=j.relatedTarget;!v||a.current.includes(oe)||Q.current&&(Vn(null,{sync:!0}),I.current=-1,H(j),y||L.current?.focus({preventScroll:!0}))}}},[Y,L,v,a,H,Q,y]),W=d.useCallback(()=>E??P?.nodesRef.current.find(U=>U.id===k)?.context?.dataRef?.current.orientation,[k,P,E]),K=ie(U=>{if(M.current=!1,V.current=!0,U.which===229||!Y.current&&U.currentTarget===L.current)return;if(h&&tp(U.key,w,g,C)){so(U.key,W())||st(U),n.setOpen(!1,xe(fo,U.nativeEvent)),Ue(s)&&(y?P?.events.emit("virtualfocus",s):s.focus());return}const ne=I.current,j=go(a,x),oe=Rr(a,x);if(B||(U.key==="Home"&&(st(U),I.current=j,H(U)),U.key==="End"&&(st(U),I.current=oe,H(U))),C>1){const ge=Array.from({length:a.current.length},()=>({width:1,height:1})),se=da(ge,C,!1),Ee=se.findIndex(Ce=>Ce!=null&&!Wt(a,Ce,x)),De=se.reduce((Ce,Te,Me)=>Te!=null&&!Wt(a,Te,x)?Me:Ce,-1),Be=se[ua({current:se.map(Ce=>Ce!=null?a.current[Ce]:null)},{event:U,orientation:w,loopFocus:m,rtl:g,cols:C,disabledIndices:pa([...(typeof x!="function"?x:null)||a.current.map((Ce,Te)=>Wt(a,Te,x)?Te:void 0),void 0],se),minIndex:Ee,maxIndex:De,prevIndex:fa(I.current>oe?j:I.current,ge,se,C,U.key===$n?"bl":U.key===(g?jt:Ut)?"tr":"tl"),stopEvent:!0})];if(Be!=null&&(I.current=Be,H(U)),w==="both")return}if(so(U.key,w)){if(st(U),o&&!y&&ht(U.currentTarget.ownerDocument)===U.currentTarget){I.current=lr(U.key,w,g)?j:oe,H(U);return}lr(U.key,w,g)?m?ne>=oe?p&&ne!==a.current.length?I.current=-1:(V.current=!1,I.current=j):I.current=rt(a,{startingIndex:ne,disabledIndices:x}):I.current=Math.min(oe,rt(a,{startingIndex:ne,disabledIndices:x})):m?ne<=j?p&&ne!==-1?I.current=a.current.length:(V.current=!1,I.current=oe):I.current=rt(a,{startingIndex:ne,decrement:!0,disabledIndices:x}):I.current=Math.max(j,rt(a,{startingIndex:ne,decrement:!0,disabledIndices:x})),pn(a,I.current)&&(I.current=-1),H(U)}}),ue=d.useMemo(()=>y&&o&&re&&{"aria-activedescendant":`${T}-${u}`},[y,o,re,T,u]),X=d.useMemo(()=>({"aria-orientation":w==="both"?void 0:w,...B?{}:ue,onKeyDown(U){if(U.key==="Tab"&&U.shiftKey&&o&&!y){const ne=at(U.nativeEvent);if(ne&&!Re(L.current,ne))return;st(U),n.setOpen(!1,xe(sn,U.nativeEvent)),Ue(s)&&s.focus();return}K(U)},onPointerMove(){M.current=!0}}),[ue,K,L,w,B,n,o,y,s]),G=d.useMemo(()=>{function U(j){b==="auto"&&ia(j.nativeEvent)&&(D.current=!y)}function ne(j){D.current=b,b==="auto"&&aa(j.nativeEvent)&&(D.current=!0)}return{onKeyDown(j){const oe=n.select("open");M.current=!1;const ge=j.key.startsWith("Arrow"),se=ep(j.key,W(),g),Ee=so(j.key,w),De=(h?se:Ee)||j.key==="Enter"||j.key.trim()==="";if(y&&oe)return K(j);if(!(!oe&&!R&&ge)){if(De){const Be=so(j.key,W());S.current=h&&Be?null:j.key}if(h){se&&(st(j),oe?(I.current=go(a,z.current),H(j)):n.setOpen(!0,xe(fo,j.nativeEvent,j.currentTarget)));return}Ee&&(ee.current!=null&&(I.current=ee.current),st(j),!oe&&R?n.setOpen(!0,xe(fo,j.nativeEvent,j.currentTarget)):K(j),oe&&H(j))}},onFocus(j){n.select("open")&&!y&&(I.current=-1,H(j))},onPointerDown:ne,onPointerEnter:ne,onMouseDown:U,onClick:U}},[K,z,b,a,h,H,n,R,w,W,g,ee,y]),q=d.useMemo(()=>({...ue,...G}),[ue,G]);return d.useMemo(()=>f?{reference:q,floating:X,item:O,trigger:G}:{},[f,q,X,G,O])}const np=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function rl(e,t={}){const n="rootStore"in e?e.rootStore:e,o=n.useState("open"),r=n.useState("floatingId"),s=n.useState("domReferenceElement"),i=n.useState("floatingElement"),{role:a="dialog"}=t,u=Xt(),c=s?.id||u,f=d.useMemo(()=>_n(i)?.id||r,[i,r]),l=np.get(a)??a,m=Vt()!=null,h=d.useMemo(()=>l==="tooltip"||a==="label"?Ye:{"aria-haspopup":l==="alertdialog"?"dialog":l,"aria-expanded":"false",...l==="listbox"&&{role:"combobox"},...l==="menu"&&m&&{role:"menuitem"},...a==="select"&&{"aria-autocomplete":"none"},...a==="combobox"&&{"aria-autocomplete":"list"}},[l,m,a]),g=d.useMemo(()=>l==="tooltip"||a==="label"?{[`aria-${a==="label"?"labelledby":"describedby"}`]:o?f:void 0}:{...h,"aria-expanded":o?"true":"false","aria-controls":o?f:void 0,...l==="menu"&&{id:c}},[l,f,o,c,a,h]),y=d.useMemo(()=>{const v={id:f,...l&&{role:l}};return l==="tooltip"||a==="label"?v:{...v,...l==="menu"&&{"aria-labelledby":c}}},[l,f,c,a]),b=d.useCallback(({active:v,selected:R})=>{const x={role:"option",...v&&{id:`${f}-fui-option`}};switch(a){case"select":case"combobox":return{...x,"aria-selected":R}}return{}},[f,a]);return d.useMemo(()=>({reference:g,floating:y,item:b,trigger:h}),[g,y,h,b])}function sl(e,t){const n="rootStore"in e?e.rootStore:e,o=n.context.dataRef,r=n.useState("open"),{listRef:s,activeIndex:i,onMatch:a,onTypingChange:u,enabled:c=!0,resetMs:f=750,selectedIndex:l=null}=t,p=Ze(),m=d.useRef(""),h=d.useRef(l??i??-1),g=d.useRef(null);le(()=>{!r&&l!==null||(p.clear(),g.current=null,m.current!==""&&(m.current=""))},[r,l,p]),le(()=>{r&&m.current===""&&(h.current=l??i??-1)},[r,l,i]);const y=ie(w=>{w?o.current.typing||(o.current.typing=w,u?.(w)):o.current.typing&&(o.current.typing=w,u?.(w))}),b=ie(w=>{function E(L,k,P){const B=k.find(D=>D?.toLocaleLowerCase().indexOf(P.toLocaleLowerCase())===0);return B?L.indexOf(B):-1}const C=s.current;if(m.current.length>0&&m.current[0]!==" "&&(E(C,C,m.current)===-1?y(!1):w.key===" "&&st(w)),C==null||w.key.length!==1||w.ctrlKey||w.metaKey||w.altKey)return;r&&w.key!==" "&&(st(w),y(!0));const T=m.current==="";T&&(h.current=l??i??-1),C.every(L=>L?L[0]?.toLocaleLowerCase()!==L[1]?.toLocaleLowerCase():!0)&&m.current===w.key&&(m.current="",h.current=g.current),m.current+=w.key,p.start(f,()=>{m.current="",h.current=g.current,y(!1)});const N=T?l??i??-1:h.current,F=E(C,[...C.slice((N||0)+1),...C.slice(0,(N||0)+1)],m.current);F!==-1?(a?.(F),g.current=F):w.key!==" "&&(m.current="",y(!1))}),v=ie(w=>{const E=w.relatedTarget,C=n.select("domReferenceElement"),T=n.select("floatingElement"),A=Re(C,E),N=Re(T,E);A||N||(p.clear(),m.current="",h.current=g.current,y(!1))}),R=d.useMemo(()=>({onKeyDown:b,onBlur:v}),[b,v]),x=d.useMemo(()=>({onKeyDown:b,onKeyUp(w){w.key===" "&&y(!1)},onBlur:v}),[b,v,y]);return d.useMemo(()=>c?{reference:R,floating:x}:{},[c,R,x])}function ti(e,t){const[n,o]=e;let r=!1;const s=t.length;for(let i=0,a=s-1;i<s;a=i++){const[u,c]=t[i]||[0,0],[f,l]=t[a]||[0,0];c>=o!=l>=o&&n<=(f-u)*(o-c)/(l-c)+u&&(r=!r)}return r}function op(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function il(e={}){const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:o=!0}=e,r=new Lt;let s=!1,i=null,a=null,u=typeof performance<"u"?performance.now():0;function c(l,p){const m=performance.now(),h=m-u;if(i===null||a===null||h===0)return i=l,a=p,u=m,null;const g=l-i,y=p-a,v=Math.sqrt(g*g+y*y)/h;return i=l,a=p,u=m,v}const f=({x:l,y:p,placement:m,elements:h,onClose:g,nodeId:y,tree:b})=>function(R){function x(){r.clear(),g()}if(r.clear(),!h.domReference||!h.floating||m==null||l==null||p==null)return;const{clientX:w,clientY:E}=R,C=[w,E],T=at(R),A=R.type==="mouseleave",N=Re(h.floating,T),F=Re(h.domReference,T),L=h.domReference.getBoundingClientRect(),k=h.floating.getBoundingClientRect(),P=m.split("-")[0],B=l>k.right-k.width/2,D=p>k.bottom-k.height/2,I=op(C,L),S=k.width>L.width,M=k.height>L.height,H=(S?L:k).left,Z=(S?L:k).right,$=(M?L:k).top,_=(M?L:k).bottom;if(N&&(s=!0,!A))return;if(F&&(s=!1),F&&!A){s=!0;return}if(A&&Le(R.relatedTarget)&&Re(h.floating,R.relatedTarget)||b&&on(b.nodesRef.current,y).some(({context:z})=>z?.open))return;if(P==="top"&&p>=L.bottom-1||P==="bottom"&&p<=L.top+1||P==="left"&&l>=L.right-1||P==="right"&&l<=L.left+1)return x();let V=[];switch(P){case"top":V=[[H,L.top+1],[H,k.bottom-1],[Z,k.bottom-1],[Z,L.top+1]];break;case"bottom":V=[[H,k.top+1],[H,L.bottom-1],[Z,L.bottom-1],[Z,k.top+1]];break;case"left":V=[[k.right-1,_],[k.right-1,$],[L.left+1,$],[L.left+1,_]];break;case"right":V=[[L.right-1,_],[L.right-1,$],[k.left+1,$],[k.left+1,_]];break}function J([z,Y]){switch(P){case"top":{const ee=[S?z+t/2:B?z+t*4:z-t*4,Y+t+1],Q=[S?z-t/2:B?z+t*4:z-t*4,Y+t+1],pe=[[k.left,B||S?k.bottom-t:k.top],[k.right,B?S?k.bottom-t:k.top:k.bottom-t]];return[ee,Q,...pe]}case"bottom":{const ee=[S?z+t/2:B?z+t*4:z-t*4,Y-t],Q=[S?z-t/2:B?z+t*4:z-t*4,Y-t],pe=[[k.left,B||S?k.top+t:k.bottom],[k.right,B?S?k.top+t:k.bottom:k.top+t]];return[ee,Q,...pe]}case"left":{const ee=[z+t+1,M?Y+t/2:D?Y+t*4:Y-t*4],Q=[z+t+1,M?Y-t/2:D?Y+t*4:Y-t*4];return[...[[D||M?k.right-t:k.left,k.top],[D?M?k.right-t:k.left:k.right-t,k.bottom]],ee,Q]}case"right":{const ee=[z-t,M?Y+t/2:D?Y+t*4:Y-t*4],Q=[z-t,M?Y-t/2:D?Y+t*4:Y-t*4],pe=[[D||M?k.left+t:k.right,k.top],[D?M?k.left+t:k.right:k.left+t,k.bottom]];return[ee,Q,...pe]}default:return[]}}if(!ti([w,E],V)){if(s&&!I)return x();if(!A&&o){const z=c(R.clientX,R.clientY);if(z!==null&&z<.1)return x()}ti([w,E],J([l,p]))?!s&&o&&r.start(40,x):x()}};return f.__options={blockPointerEvents:n},f}const rp=d.createContext(void 0);function al(e){return d.useContext(rp)}const bn="ArrowUp",nn="ArrowDown",jn="ArrowLeft",yn="ArrowRight",Kn="Home",Gn="End",ll=new Set([jn,yn]),sp=new Set([jn,yn,Kn,Gn]),cl=new Set([bn,nn]),ip=new Set([bn,nn,Kn,Gn]),ul=new Set([...ll,...cl]),ap=new Set([...ul,Kn,Gn]),rs=new Set([bn,nn,jn,yn,Kn,Gn]),lp="Shift",cp="Control",up="Alt",dp="Meta",fp=new Set([lp,cp,up,dp]);function pp(e){return Ue(e)&&e.tagName==="INPUT"}function ni(e){return!!(pp(e)&&e.selectionStart!=null||Ue(e)&&e.tagName==="TEXTAREA")}function oi(e,t,n,o){if(!e||!t||!t.scrollTo)return;let r=e.scrollLeft,s=e.scrollTop;const i=e.clientWidth<e.scrollWidth,a=e.clientHeight<e.scrollHeight;if(i&&o!=="vertical"){const u=ri(e,t,"left"),c=io(e),f=io(t);n==="ltr"&&(u+t.offsetWidth+f.scrollMarginRight>e.scrollLeft+e.clientWidth-c.scrollPaddingRight?r=u+t.offsetWidth+f.scrollMarginRight-e.clientWidth+c.scrollPaddingRight:u-f.scrollMarginLeft<e.scrollLeft+c.scrollPaddingLeft&&(r=u-f.scrollMarginLeft-c.scrollPaddingLeft)),n==="rtl"&&(u-f.scrollMarginRight<e.scrollLeft+c.scrollPaddingLeft?r=u-f.scrollMarginLeft-c.scrollPaddingLeft:u+t.offsetWidth+f.scrollMarginRight>e.scrollLeft+e.clientWidth-c.scrollPaddingRight&&(r=u+t.offsetWidth+f.scrollMarginRight-e.clientWidth+c.scrollPaddingRight))}if(a&&o!=="horizontal"){const u=ri(e,t,"top"),c=io(e),f=io(t);u-f.scrollMarginTop<e.scrollTop+c.scrollPaddingTop?s=u-f.scrollMarginTop-c.scrollPaddingTop:u+t.offsetHeight+f.scrollMarginBottom>e.scrollTop+e.clientHeight-c.scrollPaddingBottom&&(s=u+t.offsetHeight+f.scrollMarginBottom-e.clientHeight+c.scrollPaddingBottom)}e.scrollTo({left:r,top:s,behavior:"auto"})}function ri(e,t,n){const o=n==="left"?"offsetLeft":"offsetTop";let r=0;for(;t.offsetParent&&(r+=t[o],t.offsetParent!==e);)t=t.offsetParent;return r}function io(e){const t=getComputedStyle(e);return{scrollMarginTop:parseFloat(t.scrollMarginTop)||0,scrollMarginRight:parseFloat(t.scrollMarginRight)||0,scrollMarginBottom:parseFloat(t.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(t.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(t.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(t.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(t.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(t.scrollPaddingLeft)||0}}function jo(e){return e==="starting"?vc:Ye}const gp={...Cn,...cn},dm=d.forwardRef(function(t,n){const{render:o,className:r,finalFocus:s,...i}=t,{store:a}=Mt(),{side:u,align:c}=Vr(),f=al()!=null,l=a.useState("open"),p=a.useState("transitionStatus"),m=a.useState("popupProps"),h=a.useState("mounted"),g=a.useState("instantType"),y=a.useState("activeTriggerElement"),b=a.useState("parent"),v=a.useState("lastOpenChangeReason"),R=a.useState("rootId"),x=a.useState("floatingRootContext"),w=a.useState("floatingTreeRoot"),E=a.useState("closeDelay"),C=a.useState("activeTriggerElement"),T=b.type==="context-menu";Ft({open:l,ref:a.context.popupRef,onComplete(){l&&a.context.onOpenChangeComplete?.(!0)}}),d.useEffect(()=>{function P(B){a.setOpen(!1,xe(B.reason,B.domEvent))}return w.events.on("close",P),()=>{w.events.off("close",P)}},[w.events,a]);const A=a.useState("hoverEnabled"),N=a.useState("disabled");Xf(x,{enabled:A&&!N&&!T&&b.type!=="menubar",closeDelay:E});const F={transitionStatus:p,side:u,align:c,open:l,nested:b.type==="menu",instant:g},L=Ae("div",t,{state:F,ref:[n,a.context.popupRef],stateAttributesMapping:gp,props:[m,{onKeyDown(P){f&&rs.has(P.key)&&P.stopPropagation()}},jo(p),i,{"data-rootownerid":R}]});let k=b.type===void 0||T;return(y||b.type==="menubar"&&v!==Do)&&(k=!0),ce.jsx(Jr,{context:x,modal:T,disabled:!h,returnFocus:s===void 0?k:s,initialFocus:b.type!=="menu",restoreFocus:!0,externalTree:b.type!=="menubar"?w:void 0,previousFocusableElement:C,nextFocusableElement:b.type===void 0?a.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:b.type===void 0?a.context.beforeContentFocusGuardRef:void 0,children:L})}),dl=d.createContext(void 0);function mp(){const e=d.useContext(dl);if(e===void 0)throw new Error(qe(32));return e}const fm=d.forwardRef(function(t,n){const{keepMounted:o=!1,...r}=t,{store:s}=Mt();return s.useState("mounted")||o?ce.jsx(dl.Provider,{value:o,children:ce.jsx(Xr,{ref:n,...r})}):null});function Uo(e){return Dr(19)?e:e?"true":void 0}const hp=d.createContext(void 0);function Wo(){return d.useContext(hp)?.direction??"ltr"}const bp=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:s,platform:i,elements:a,middlewareData:u}=t,{element:c,padding:f=0,offsetParent:l="real"}=Dt(e,t)||{};if(c==null)return{};const p=ca(f),m={x:n,y:o},h=Kr(r),g=Yr(h),y=await i.getDimensions(c),b=h==="y",v=b?"top":"left",R=b?"bottom":"right",x=b?"clientHeight":"clientWidth",w=s.reference[g]+s.reference[h]-m[h]-s.floating[g],E=m[h]-s.reference[h],C=l==="real"?await i.getOffsetParent?.(c):a.floating;let T=a.floating[x]||s.floating[g];(!T||!await i.isElement?.(C))&&(T=a.floating[x]||s.floating[g]);const A=w/2-E/2,N=T/2-y[g]/2-1,F=Math.min(p[v],N),L=Math.min(p[R],N),k=F,P=T-y[g]-L,B=T/2-y[g]/2+A,D=xr(k,B,P),I=!u.arrow&&Zt(r)!=null&&B!==D&&s.reference[g]/2-(B<k?F:L)-y[g]/2<0,S=I?B<k?B-k:B-P:0;return{[h]:m[h]+S,data:{[h]:D,centerOffset:B-D-S,...I&&{alignmentOffset:S}},reset:I}}}),yp=(e,t)=>({...bp(e),options:[e,t]}),vp={name:"hide",async fn(e){const{width:t,height:n,x:o,y:r}=e.rects.reference,s=t===0&&n===0&&o===0&&r===0;return{data:{referenceHidden:(await ff().fn(e)).data?.referenceHidden||s}}}},xp={sideX:"left",sideY:"top"};function fl(e,t,n){const o=e==="inline-start"||e==="inline-end";return{top:"top",right:o?n?"inline-start":"inline-end":"right",bottom:"bottom",left:o?n?"inline-end":"inline-start":"left"}[t]}function si(e,t,n){const{rects:o,placement:r}=e;return{side:fl(t,gt(r),n),align:Zt(r)||"center",anchor:{width:o.reference.width,height:o.reference.height},positioner:{width:o.floating.width,height:o.floating.height}}}function pl(e){const{anchor:t,positionMethod:n="absolute",side:o="bottom",sideOffset:r=0,align:s="center",alignOffset:i=0,collisionBoundary:a,collisionPadding:u=5,sticky:c=!1,arrowPadding:f=5,disableAnchorTracking:l=!1,keepMounted:p=!1,floatingRootContext:m,mounted:h,collisionAvoidance:g,shiftCrossAxis:y=!1,nodeId:b,adaptiveOrigin:v,lazyFlip:R=!1,externalTree:x}=e,[w,E]=d.useState(null);!h&&w!==null&&E(null);const C=g.side||"flip",T=g.align||"flip",A=g.fallbackAxisSide||"end",N=typeof t=="function"?t:void 0,F=ie(N),L=N?F:t,k=nt(t),B=Wo()==="rtl",D=w||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":B?"left":"right","inline-start":B?"right":"left"}[o],I=s==="center"?D:`${D}-${s}`;let S=u;const M=1,H=o==="bottom"?M:0,Z=o==="top"?M:0,$=o==="right"?M:0,_=o==="left"?M:0;typeof S=="number"?S={top:S+H,right:S+_,bottom:S+Z,left:S+$}:S&&(S={top:(S.top||0)+H,right:(S.right||0)+_,bottom:(S.bottom||0)+Z,left:(S.left||0)+$});const V={boundary:a==="clipping-ancestors"?"clippingAncestors":a,padding:S},J=d.useRef(null),z=nt(r),Y=nt(i),pe=[af(Se=>{const Ne=si(Se,o,B),Fe=typeof z.current=="function"?z.current(Ne):z.current,He=typeof Y.current=="function"?Y.current(Ne):Y.current;return{mainAxis:Fe,crossAxis:He,alignmentAxis:He}},[typeof r!="function"?r:0,typeof i!="function"?i:0,B,o])],re=T==="none"&&C!=="shift",O=!re&&(c||y||C==="shift"),W=C==="none"?null:uf({...V,padding:{top:S.top+M,right:S.right+M,bottom:S.bottom+M,left:S.left+M},mainAxis:!y&&C==="flip",crossAxis:T==="flip"?"alignment":!1,fallbackAxisSideDirection:A}),K=re?null:lf(Se=>{const Ne=Pe(Se.elements.floating).documentElement;return{...V,rootBoundary:y?{x:0,y:0,width:Ne.clientWidth,height:Ne.clientHeight}:void 0,mainAxis:T!=="none",crossAxis:O,limiter:c||y?void 0:cf(Fe=>{if(!J.current)return{};const{width:He,height:Qe}=J.current.getBoundingClientRect(),ot=bt(gt(Fe.placement)),it=ot==="y"?He:Qe,be=ot==="y"?S.left+S.right:S.top+S.bottom;return{offset:it/2+be/2}})}},[V,c,y,S,T]);C==="shift"||T==="shift"||s==="center"?pe.push(K,W):pe.push(W,K),pe.push(df({...V,apply({elements:{floating:Se},rects:{reference:Ne},availableWidth:Fe,availableHeight:He}){const Qe=Se.style;Qe.setProperty("--available-width",`${Fe}px`),Qe.setProperty("--available-height",`${He}px`),Qe.setProperty("--anchor-width",`${Ne.width}px`),Qe.setProperty("--anchor-height",`${Ne.height}px`)}}),yp(()=>({element:J.current||document.createElement("div"),padding:f,offsetParent:"floating"}),[f]),{name:"transformOrigin",fn(Se){const{elements:Ne,middlewareData:Fe,placement:He,rects:Qe,y:ot}=Se,it=gt(He),be=bt(it),_e=J.current,We=Fe.arrow?.x||0,Xe=Fe.arrow?.y||0,xt=_e?.clientWidth||0,$e=_e?.clientHeight||0,he=We+xt/2,Ve=Xe+$e/2,ze=Math.abs(Fe.shift?.y||0),je=Qe.reference.height/2,Ge=typeof r=="function"?r(si(Se,o,B)):r,ut=ze>Ge,Ko={top:`${he}px calc(100% + ${Ge}px)`,bottom:`${he}px ${-Ge}px`,left:`calc(100% + ${Ge}px) ${Ve}px`,right:`${-Ge}px ${Ve}px`}[it],zl=`${he}px ${Qe.reference.y+je-ot}px`;return Ne.floating.style.setProperty("--transform-origin",O&&be==="y"&&ut?zl:Ko),{}}},vp,v),le(()=>{!h&&m&&m.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[h,m]);const ue=d.useMemo(()=>({elementResize:!l&&typeof ResizeObserver<"u",layoutShift:!l&&typeof IntersectionObserver<"u"}),[l]),{refs:X,elements:G,x:q,y:U,middlewareData:ne,update:j,placement:oe,context:ge,isPositioned:se,floatingStyles:Ee}=$f({rootContext:m,placement:I,middleware:pe,strategy:n,whileElementsMounted:p?void 0:(...Se)=>Ys(...Se,ue),nodeId:b,externalTree:x}),{sideX:De,sideY:Be}=ne.adaptiveOrigin||xp,Ce=se?n:"fixed",Te=d.useMemo(()=>{const Se=v?{position:Ce,[De]:q,[Be]:U}:{position:Ce,...Ee};return se||(Se.opacity=0),Se},[v,Ce,De,q,Be,U,Ee,se]),Me=d.useRef(null);le(()=>{if(!h)return;const Se=k.current,Ne=typeof Se=="function"?Se():Se,He=(ii(Ne)?Ne.current:Ne)||null||null;He!==Me.current&&(X.setPositionReference(He),Me.current=He)},[h,X,L,k]),d.useEffect(()=>{if(!h)return;const Se=k.current;typeof Se!="function"&&ii(Se)&&Se.current!==Me.current&&(X.setPositionReference(Se.current),Me.current=Se.current)},[h,X,L,k]),d.useEffect(()=>{if(p&&h&&G.domReference&&G.floating)return Ys(G.domReference,G.floating,j,ue)},[p,h,G,j,ue]);const Oe=gt(oe),Ke=fl(o,Oe,B),ct=Zt(oe)||"center",we=!!ne.hide?.referenceHidden;le(()=>{R&&h&&se&&E(Oe)},[R,h,se,Oe]);const me=d.useMemo(()=>({position:"absolute",top:ne.arrow?.y,left:ne.arrow?.x}),[ne.arrow]),ke=ne.arrow?.centerOffset!==0;return d.useMemo(()=>({positionerStyles:Te,arrowStyles:me,arrowRef:J,arrowUncentered:ke,side:Ke,align:ct,physicalSide:Oe,anchorHidden:we,refs:X,context:ge,isPositioned:se,update:j}),[Te,me,J,ke,Ke,ct,Oe,we,X,ge,se,j])}function ii(e){return e!=null&&"current"in e}function $o(e){const{children:t,elementsRef:n,labelsRef:o,onMapChange:r}=e,s=ie(r),i=d.useRef(0),a=tt(Rp).current,u=tt(wp).current,[c,f]=d.useState(0),l=d.useRef(c),p=ie((b,v)=>{u.set(b,v??null),l.current+=1,f(l.current)}),m=ie(b=>{u.delete(b),l.current+=1,f(l.current)}),h=d.useMemo(()=>{const b=new Map;return Array.from(u.keys()).filter(R=>R.isConnected).sort(Ep).forEach((R,x)=>{const w=u.get(R)??{};b.set(R,{...w,index:x})}),b},[u,c]);le(()=>{if(typeof MutationObserver!="function"||h.size===0)return;const b=new MutationObserver(v=>{const R=new Set,x=w=>R.has(w)?R.delete(w):R.add(w);v.forEach(w=>{w.removedNodes.forEach(x),w.addedNodes.forEach(x)}),R.size===0&&(l.current+=1,f(l.current))});return h.forEach((v,R)=>{R.parentElement&&b.observe(R.parentElement,{childList:!0})}),()=>{b.disconnect()}},[h]),le(()=>{l.current===c&&(n.current.length!==h.size&&(n.current.length=h.size),o&&o.current.length!==h.size&&(o.current.length=h.size),i.current=h.size),s(h)},[s,h,n,o,c]),le(()=>()=>{n.current=[]},[n]),le(()=>()=>{o&&(o.current=[])},[o]);const g=ie(b=>(a.add(b),()=>{a.delete(b)}));le(()=>{a.forEach(b=>b(h))},[a,h]);const y=d.useMemo(()=>({register:p,unregister:m,subscribeMapChange:g,elementsRef:n,labelsRef:o,nextIndexRef:i}),[p,m,g,n,o,i]);return ce.jsx(qi.Provider,{value:y,children:t})}function wp(){return new Map}function Rp(){return new Set}function Ep(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const ss=d.forwardRef(function(t,n){const{cutout:o,...r}=t;let s;if(o){const i=o?.getBoundingClientRect();s=`polygon(
2
+ 0% 0%,
3
+ 100% 0%,
4
+ 100% 100%,
5
+ 0% 100%,
6
+ 0% 0%,
7
+ ${i.left}px ${i.top}px,
8
+ ${i.left}px ${i.bottom}px,
9
+ ${i.right}px ${i.bottom}px,
10
+ ${i.right}px ${i.top}px,
11
+ ${i.left}px ${i.top}px
12
+ )`}return ce.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...r,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:s}})}),pm=d.forwardRef(function(t,n){const{anchor:o,positionMethod:r="absolute",className:s,render:i,side:a,align:u,sideOffset:c=0,alignOffset:f=0,collisionBoundary:l="clipping-ancestors",collisionPadding:p=5,arrowPadding:m=5,sticky:h=!1,disableAnchorTracking:g=!1,collisionAvoidance:y=ki,...b}=t,{store:v}=Mt(),R=mp(),x=Un(!0),w=v.useState("parent"),E=v.useState("floatingRootContext"),C=v.useState("floatingTreeRoot"),T=v.useState("mounted"),A=v.useState("open"),N=v.useState("modal"),F=v.useState("activeTriggerElement"),L=v.useState("transitionStatus"),k=v.useState("lastOpenChangeReason"),P=v.useState("floatingNodeId"),B=v.useState("floatingParentNodeId");let D=o,I=c,S=f,M=u,H=y;w.type==="context-menu"&&(D=o??w.context?.anchor,M=M??"start",!a&&M!=="center"&&(S=t.alignOffset??2,I=t.sideOffset??-5));let Z=a,$=M;w.type==="menu"?(Z=Z??"inline-end",$=$??"start",H=t.collisionAvoidance??xc):w.type==="menubar"&&(Z=Z??"bottom",$=$??"start");const _=w.type==="context-menu",V=pl({anchor:D,floatingRootContext:E,positionMethod:x?"fixed":r,mounted:T,side:Z,sideOffset:I,align:$,alignOffset:S,arrowPadding:_?0:m,collisionBoundary:l,collisionPadding:p,sticky:h,nodeId:P,keepMounted:R,disableAnchorTracking:g,collisionAvoidance:H,shiftCrossAxis:_&&!("side"in H&&H.side==="flip"),externalTree:C}),J=d.useMemo(()=>{const re={};return A||(re.pointerEvents="none"),{role:"presentation",hidden:!T,style:{...V.positionerStyles,...re}}},[A,T,V.positionerStyles]);d.useEffect(()=>{function re(O){O.open&&(O.parentNodeId===P&&v.set("hoverEnabled",!1),O.nodeId!==P&&O.parentNodeId===v.select("floatingParentNodeId")&&v.setOpen(!1,xe(po)))}return C.events.on("menuopenchange",re),()=>{C.events.off("menuopenchange",re)}},[v,C.events,P]),d.useEffect(()=>{if(v.select("floatingParentNodeId")==null)return;function re(O){if(O.open||O.nodeId!==v.select("floatingParentNodeId"))return;const W=O.reason??po;v.setOpen(!1,xe(W))}return C.events.on("menuopenchange",re),()=>{C.events.off("menuopenchange",re)}},[C.events,v]),d.useEffect(()=>{function re(O){!A||O.nodeId!==v.select("floatingParentNodeId")||O.target&&F&&F!==O.target&&v.setOpen(!1,xe(po))}return C.events.on("itemhover",re),()=>{C.events.off("itemhover",re)}},[C.events,A,F,v]),d.useEffect(()=>{const re={open:A,nodeId:P,parentNodeId:B,reason:v.select("lastOpenChangeReason")};C.events.emit("menuopenchange",re)},[C.events,A,v,P,B]);const z={open:A,side:V.side,align:V.align,anchorHidden:V.anchorHidden,nested:w.type==="menu"},Y=d.useMemo(()=>({side:V.side,align:V.align,arrowRef:V.arrowRef,arrowUncentered:V.arrowUncentered,arrowStyles:V.arrowStyles,nodeId:V.context.nodeId}),[V.side,V.align,V.arrowRef,V.arrowUncentered,V.arrowStyles,V.context.nodeId]),ee=Ae("div",t,{state:z,stateAttributesMapping:Cn,ref:[n,v.useStateSetter("positionerElement")],props:[J,jo(L),b]}),Q=T&&w.type!=="menu"&&(w.type!=="menubar"&&N&&k!==ft||w.type==="menubar"&&w.context.modal);let pe=null;return w.type==="menubar"?pe=w.context.contentElement:w.type===void 0&&(pe=F),ce.jsxs($i.Provider,{value:Y,children:[Q&&ce.jsx(ss,{ref:w.type==="context-menu"||w.type==="nested-context-menu"?w.context.internalBackdropRef:null,inert:Uo(!A),cutout:pe}),ce.jsx(md,{id:P,children:ce.jsx($o,{elementsRef:v.context.itemDomElements,labelsRef:v.context.itemLabels,children:ee})})]})});function is(e){const t=d.useRef(!0);t.current&&(t.current=!1,e())}let ai={},li={},ci="";function Sp(e){if(typeof document>"u")return!1;const t=Pe(e);return Je(t).innerWidth-t.documentElement.clientWidth>0}function Tp(e){if(!(typeof CSS<"u"&&CSS.supports&&CSS.supports("scrollbar-gutter","stable"))||typeof document>"u")return!1;const n=Pe(e),o=n.documentElement,r=n.body,s=Gt(o)?o:r,i=s.style.overflowY,a=o.style.scrollbarGutter;o.style.scrollbarGutter="stable",s.style.overflowY="scroll";const u=s.offsetWidth;s.style.overflowY="hidden";const c=s.offsetWidth;return s.style.overflowY=i,o.style.scrollbarGutter=a,u===c}function Cp(e){const t=Pe(e),n=t.documentElement,o=t.body,r=Gt(n)?n:o,s={overflowY:r.style.overflowY,overflowX:r.style.overflowX};return Object.assign(r.style,{overflowY:"hidden",overflowX:"hidden"}),()=>{Object.assign(r.style,s)}}function Ip(e){const t=Pe(e),n=t.documentElement,o=t.body,r=Je(n);let s=0,i=0,a=!1;const u=Rt.create();if(Ur&&(r.visualViewport?.scale??1)!==1)return()=>{};function c(){const p=r.getComputedStyle(n),m=r.getComputedStyle(o),y=(p.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";s=n.scrollTop,i=n.scrollLeft,ai={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},ci=n.style.scrollBehavior,li={position:o.style.position,height:o.style.height,width:o.style.width,boxSizing:o.style.boxSizing,overflowY:o.style.overflowY,overflowX:o.style.overflowX,scrollBehavior:o.style.scrollBehavior};const b=n.scrollHeight>n.clientHeight,v=n.scrollWidth>n.clientWidth,R=p.overflowY==="scroll"||m.overflowY==="scroll",x=p.overflowX==="scroll"||m.overflowX==="scroll",w=Math.max(0,r.innerWidth-o.clientWidth),E=Math.max(0,r.innerHeight-o.clientHeight),C=parseFloat(m.marginTop)+parseFloat(m.marginBottom),T=parseFloat(m.marginLeft)+parseFloat(m.marginRight),A=Gt(n)?n:o;if(a=Tp(e),a){n.style.scrollbarGutter=y,A.style.overflowY="hidden",A.style.overflowX="hidden";return}Object.assign(n.style,{scrollbarGutter:y,overflowY:"hidden",overflowX:"hidden"}),(b||R)&&(n.style.overflowY="scroll"),(v||x)&&(n.style.overflowX="scroll"),Object.assign(o.style,{position:"relative",height:C||E?`calc(100dvh - ${C+E}px)`:"100dvh",width:T||w?`calc(100vw - ${T+w}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),o.scrollTop=s,o.scrollLeft=i,n.setAttribute("data-base-ui-scroll-locked",""),n.style.scrollBehavior="unset"}function f(){Object.assign(n.style,ai),Object.assign(o.style,li),a||(n.scrollTop=s,n.scrollLeft=i,n.removeAttribute("data-base-ui-scroll-locked"),n.style.scrollBehavior=ci)}function l(){f(),u.request(c)}return c(),r.addEventListener("resize",l),()=>{u.cancel(),f(),typeof r.removeEventListener=="function"&&r.removeEventListener("resize",l)}}class Mp{lockCount=0;restore=null;timeoutLock=Lt.create();timeoutUnlock=Lt.create();acquire(t){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(t)),this.release}release=()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)};unlock=()=>{this.lockCount===0&&this.restore&&(this.restore?.(),this.restore=null)};lock(t){if(this.lockCount===0||this.restore!==null)return;const o=Pe(t).documentElement,r=Je(o).getComputedStyle(o).overflowY;if(r==="hidden"||r==="clip"){this.restore=lt;return}const s=ea||!Sp(t);this.restore=s?Cp(t):Ip(t)}}const kp=new Mp;function as(e=!0,t=null){le(()=>{if(e)return kp.acquire(t)},[e,t])}const Pp=d.createContext(null);function gl(e){return d.useContext(Pp)}function Op(e){const t=d.useRef(""),n=d.useCallback(r=>{r.defaultPrevented||(t.current=r.pointerType,e(r,r.pointerType))},[e]);return{onClick:d.useCallback(r=>{if(r.detail===0){e(r,"keyboard");return}"pointerType"in r?e(r,r.pointerType):e(r,t.current),t.current=""},[e]),onPointerDown:n}}function ls(e){const[t,n]=d.useState(null),o=ie((a,u)=>{e||n(u||(ea?"touch":""))}),r=d.useCallback(()=>{n(null)},[]),{onClick:s,onPointerDown:i}=Op(o);return d.useMemo(()=>({openMethod:t,reset:r,triggerProps:{onClick:s,onPointerDown:i}}),[t,r,s,i])}const Ap={...Ja,disabled:ae(e=>e.parent.type==="menubar"&&e.parent.context.disabled||e.disabled),modal:ae(e=>(e.parent.type===void 0||e.parent.type==="context-menu")&&(e.modal??!0)),allowMouseEnter:ae(e=>e.allowMouseEnter),stickIfOpen:ae(e=>e.stickIfOpen),parent:ae(e=>e.parent),rootId:ae(e=>e.parent.type==="menu"?e.parent.store.select("rootId"):e.parent.type!==void 0?e.parent.context.rootId:e.rootId),activeIndex:ae(e=>e.activeIndex),isActive:ae((e,t)=>e.activeIndex===t),hoverEnabled:ae(e=>e.hoverEnabled),instantType:ae(e=>e.instantType),lastOpenChangeReason:ae(e=>e.openChangeReason),floatingTreeRoot:ae(e=>e.parent.type==="menu"?e.parent.store.select("floatingTreeRoot"):e.floatingTreeRoot),floatingNodeId:ae(e=>e.floatingNodeId),floatingParentNodeId:ae(e=>e.floatingParentNodeId),itemProps:ae(e=>e.itemProps),closeDelay:ae(e=>e.closeDelay),keyboardEventRelay:ae(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type==="menu")return e.parent.store.select("keyboardEventRelay")})};class cs extends ts{constructor(t){super({...Lp(),...t},{positionerRef:d.createRef(),popupRef:d.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:d.createRef(),beforeContentFocusGuardRef:d.createRef(),onOpenChangeComplete:void 0,triggerElements:new _o},Ap),this.unsubscribeParentListener=this.observe("parent",n=>{if(this.unsubscribeParentListener?.(),n.type==="menu"){this.unsubscribeParentListener=n.store.subscribe(()=>{this.notifyAll()}),this.context.allowMouseUpTriggerRef=n.store.context.allowMouseUpTriggerRef;return}n.type!==void 0&&(this.context.allowMouseUpTriggerRef=n.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(t,n){this.state.floatingRootContext.context.events.emit("setOpen",{open:t,eventDetails:n})}static useStore(t,n){const o=tt(()=>new cs(n)).current;return t??o}unsubscribeParentListener=null}function Lp(){return{...Za(),disabled:!1,modal:!0,allowMouseEnter:!1,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new qr,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:Ye,keyboardEventRelay:void 0,closeDelay:0}}const ml=d.createContext(void 0);function hl(){return d.useContext(ml)}const bl=$a(function(t){const{children:n,open:o,onOpenChange:r,onOpenChangeComplete:s,defaultOpen:i=!1,disabled:a=!1,modal:u,loopFocus:c=!0,orientation:f="vertical",actionsRef:l,closeParentOnEsc:p=!1,handle:m,triggerId:h,defaultTriggerId:g=null,highlightItemOnHover:y=!0}=t,b=Un(!0),v=Mt(!0),R=gl(!0),x=hl(),w=d.useMemo(()=>x&&v?{type:"menu",store:v.store}:R?{type:"menubar",context:R}:b&&!v?{type:"context-menu",context:b}:{type:void 0},[b,v,R,x]),E=cs.useStore(m?.store,{open:i,openProp:o,activeTriggerId:g,triggerIdProp:h,parent:w});is(()=>{o===void 0&&E.state.open===!1&&i===!0&&E.update({open:!0,activeTriggerId:g})}),E.useControlledProp("openProp",o),E.useControlledProp("triggerIdProp",h),E.useContextCallback("onOpenChangeComplete",s);const C=E.useState("floatingTreeRoot"),T=Ia(C),A=Vt();le(()=>{b&&!v?E.update({parent:{type:"context-menu",context:b},floatingNodeId:T,floatingParentNodeId:A}):v&&E.update({floatingNodeId:T,floatingParentNodeId:A})},[b,v,T,A,E]);const N=E.useState("open"),F=E.useState("activeTriggerElement"),L=E.useState("positionerElement"),k=E.useState("hoverEnabled"),P=E.useState("modal"),B=E.useState("disabled"),D=E.useState("lastOpenChangeReason"),I=E.useState("parent"),S=E.useState("activeIndex"),M=E.useState("payload"),H=E.useState("floatingParentNodeId"),Z=d.useRef(null),$=H!=null;let _;E.useSyncedValues({disabled:a,modal:I.type===void 0?u:void 0,rootId:Xt()});const{openMethod:V,triggerProps:J,reset:z}=ls(N);qa(E);const{forceUnmount:Y}=Xa(N,E,()=>{E.update({allowMouseEnter:!1,stickIfOpen:!0}),z()}),ee=d.useRef(I.type!=="context-menu"),Q=Ze();d.useEffect(()=>{if(N||(Z.current=null),I.type==="context-menu"){if(!N){Q.clear(),ee.current=!1;return}Q.start(500,()=>{ee.current=!0})}},[Q,N,I.type]),as(N&&P&&D!==ft&&V!=="touch",L),le(()=>{!N&&!k&&E.set("hoverEnabled",!0)},[N,k,E]);const pe=d.useRef(!0),re=Ze(),O=ie((we,me)=>{const ke=me.reason;if(N===we&&me.trigger===F&&D===ke||(me.preventUnmountOnClose=()=>{E.set("preventUnmountingOnClose",!0)},!we&&me.trigger==null&&(me.trigger=F??void 0),r?.(we,me),me.isCanceled))return;const Se={open:we,nativeEvent:me.event,reason:me.reason,nested:$};_?.emit("openchange",Se);const Ne=me.event;if(we===!1&&Ne?.type==="click"&&Ne.pointerType==="touch"&&!pe.current)return;if(!we&&S!==null){const it=E.context.itemDomElements.current[S];queueMicrotask(()=>{it?.setAttribute("tabindex","-1")})}we&&ke===Nn?(pe.current=!1,re.start(300,()=>{pe.current=!0})):(pe.current=!0,re.clear());const Fe=(ke===vn||ke===Fn)&&Ne.detail===0&&Ne?.isTrusted,He=!we&&(ke===_r||ke==null),Qe={open:we,openChangeReason:ke};Z.current=me.event??null;const ot=me.trigger?.id??null;(ot||we)&&(Qe.activeTriggerId=ot,Qe.activeTriggerElement=me.trigger??null),E.update(Qe),I.type==="menubar"&&(ke===Nn||ke===sn||ke===ft||ke===fo||ke===po)?E.set("instantType","group"):Fe||He?E.set("instantType",Fe?"click":"dismiss"):E.set("instantType",void 0)}),W=d.useCallback(we=>{const me=xe(we);return me.preventUnmountOnClose=()=>{E.set("preventUnmountingOnClose",!0)},me},[E]),K=d.useCallback(()=>{E.setOpen(!1,W(Ki))},[E,W]);d.useImperativeHandle(l,()=>({unmount:Y,close:K}),[Y,K]);let ue;I.type==="context-menu"&&(ue=I.context),d.useImperativeHandle(ue?.positionerRef,()=>L,[L]),d.useImperativeHandle(ue?.actionsRef,()=>({setOpen:O}),[O]);const X=el({popupStore:E,onOpenChange:O});_=X.context.events,d.useEffect(()=>{const we=({open:me,eventDetails:ke})=>O(me,ke);return _.on("setOpen",we),()=>{_?.off("setOpen",we)}},[_,O]);const G=es(X,{enabled:!B,bubbles:{escapeKey:p&&I.type==="menu"},outsidePress(){return I.type!=="context-menu"||Z.current?.type==="contextmenu"?!0:ee.current},externalTree:$?C:void 0}),q=rl(X,{role:"menu"}),U=Wo(),ne=d.useCallback(we=>{E.select("activeIndex")!==we&&E.set("activeIndex",we)},[E]),j=ol(X,{enabled:!B,listRef:E.context.itemDomElements,activeIndex:S,nested:I.type!==void 0,loopFocus:c,orientation:f,parentOrientation:I.type==="menubar"?I.context.orientation:void 0,rtl:U==="rtl",disabledIndices:Yt,onNavigate:ne,openOnArrowKeyDown:I.type!=="context-menu",externalTree:$?C:void 0,focusItemOnHover:y}),oe=d.useCallback(we=>{E.context.typingRef.current=we},[E]),ge=sl(X,{listRef:E.context.itemLabels,activeIndex:S,resetMs:bc,onMatch:we=>{N&&we!==S&&E.set("activeIndex",we)},onTypingChange:oe}),{getReferenceProps:se,getFloatingProps:Ee,getItemProps:De,getTriggerProps:Be}=Pn([G,q,j,ge]),Ce=d.useMemo(()=>{const we=$t(se(),{onMouseMove(){E.set("allowMouseEnter",!0)}},J);return delete we.role,we},[se,E,J]),Te=d.useMemo(()=>{const we=Be();if(!we)return we;const me=$t(we,J);return delete me.role,delete me["aria-controls"],me},[Be,J]),Me=d.useMemo(()=>Ee({onMouseMove(){E.set("allowMouseEnter",!0),I.type==="menu"&&E.set("hoverEnabled",!1)},onClick(){E.select("hoverEnabled")&&E.set("hoverEnabled",!1)},onKeyDown(we){const me=E.select("keyboardEventRelay");me&&!we.isPropagationStopped()&&me(we)}}),[Ee,I.type,E]),Oe=d.useMemo(()=>De(),[De]);E.useSyncedValues({floatingRootContext:X,activeTriggerProps:Ce,inactiveTriggerProps:Te,popupProps:Me,itemProps:Oe});const Ke=d.useMemo(()=>({store:E,parent:w}),[E,w]),ct=ce.jsx(Br.Provider,{value:Ke,children:typeof n=="function"?n({payload:M}):n});return I.type===void 0||I.type==="context-menu"?ce.jsx(hd,{externalTree:C,children:ct}):ct});function gm(e){const t=Mt().store,n=d.useMemo(()=>({parentMenu:t}),[t]);return ce.jsx(ml.Provider,{value:n,children:ce.jsx(bl,{...e})})}function yl(e){const t=e.getBoundingClientRect(),n=window.getComputedStyle(e,"::before"),o=window.getComputedStyle(e,"::after");if(!(n.content!=="none"||o.content!=="none"))return t;const s=parseFloat(n.width)||0,i=parseFloat(n.height)||0,a=parseFloat(o.width)||0,u=parseFloat(o.height)||0,c=Math.max(t.width,s,a),f=Math.max(t.height,i,u),l=c-t.width,p=f-t.height;return{left:t.left-l/2,right:t.right+l/2,top:t.top-p/2,bottom:t.bottom+p/2}}function vl(e={}){const{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:o}=Lr(),{ref:r,index:s}=Wn(e),i=n===s,a=d.useRef(null),u=Ct(r,a);return{compositeProps:d.useMemo(()=>({tabIndex:i?0:-1,onFocus(){o(s)},onMouseMove(){const f=a.current;if(!t||!f)return;const l=f.hasAttribute("disabled")||f.ariaDisabled==="true";!i&&!l&&f.focus()}}),[i,o,s,t]),compositeRef:u,index:s}}function Dp(e){const{render:t,className:n,state:o=Ye,props:r=Yt,refs:s=Yt,metadata:i,stateAttributesMapping:a,tag:u="div",...c}=e,{compositeProps:f,compositeRef:l}=vl({metadata:i});return Ae(u,e,{state:o,ref:[...s,l],props:[f,...r,c],stateAttributesMapping:a})}function us(e){if(Ue(e)&&e.hasAttribute("data-rootownerid"))return e.getAttribute("data-rootownerid")??void 0;if(!Et(e))return us(Tt(e))}function Np(e){const{enabled:t=!0,mouseDownAction:n,open:o}=e,r=d.useRef(!1);return d.useMemo(()=>t?{onMouseDown:s=>{(n==="open"&&!o||n==="close"&&o)&&(r.current=!0,Pe(s.currentTarget).addEventListener("click",()=>{r.current=!1},{once:!0}))},onClick:s=>{r.current&&(r.current=!1,s.preventBaseUIHandler())}}:Ye,[t,n,o])}const ao=2,mm=Ff(function(t,n){const{render:o,className:r,disabled:s=!1,nativeButton:i=!0,id:a,openOnHover:u,delay:c=100,closeDelay:f=0,handle:l,payload:p,...m}=t,h=Mt(!0),g=l?.store??h?.store;if(!g)throw new Error(qe(85));const y=yt(a),b=g.useState("isTriggerActive",y),v=g.useState("floatingRootContext"),R=g.useState("isOpenedByTrigger",y),x=d.useRef(null),w=Vp(),E=Lr(!0),C=Jt(),T=d.useMemo(()=>C??new qr,[C]),A=Ia(T),N=Vt(),{registerTrigger:F,isMountedByThisTrigger:L}=Ga(y,x,g,{payload:p,closeDelay:f,parent:w,floatingTreeRoot:T,floatingNodeId:A,floatingParentNodeId:N,keyboardEventRelay:E?.relayKeyboardEvent}),k=w.type==="menubar",P=g.useState("disabled"),B=s||P||k&&w.context.disabled,{getButtonProps:D,buttonRef:I}=Nt({disabled:B,native:i});d.useEffect(()=>{!R&&w.type===void 0&&(g.context.allowMouseUpTriggerRef.current=!1)},[g,R,w.type]);const S=d.useRef(null),M=Ze(),H=ie(G=>{if(!S.current)return;M.clear(),g.context.allowMouseUpTriggerRef.current=!1;const q=G.target;if(Re(S.current,q)||Re(g.select("positionerElement"),q)||q===S.current||q!=null&&us(q)===g.select("rootId"))return;const U=yl(S.current);G.clientX>=U.left-ao&&G.clientX<=U.right+ao&&G.clientY>=U.top-ao&&G.clientY<=U.bottom+ao||T.events.emit("close",{domEvent:G,reason:zr})});d.useEffect(()=>{R&&g.select("lastOpenChangeReason")===ft&&Pe(S.current).addEventListener("mouseup",H,{once:!0})},[R,H,g]);const Z=k&&w.context.hasSubmenuOpen,_=nl(v,{enabled:(u??Z)&&!B&&w.type!=="context-menu"&&(!k||Z&&!L),handleClose:il({blockPointerEvents:!k}),mouseOnly:!0,move:!1,restMs:w.type===void 0?c:void 0,delay:{close:f},triggerElementRef:x,externalTree:T,isActiveTrigger:b}),V=Fp(R,g.select("lastOpenChangeReason")),J=Bo(v,{enabled:!B&&w.type!=="context-menu",event:R&&k?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:w.type===void 0?V:!1}),z=Yf(v,{enabled:!B&&Z}),Y=Np({open:R,enabled:k,mouseDownAction:"open"}),ee=Pn([J,z]),Q={disabled:B,open:R},pe=g.useState("triggerProps",L),re=[S,n,I,F,x],O=[ee.getReferenceProps(),_??Ye,pe,{"aria-haspopup":"menu",id:y,onMouseDown:G=>{if(g.select("open"))return;M.start(200,()=>{g.context.allowMouseUpTriggerRef.current=!0}),Pe(G.currentTarget).addEventListener("mouseup",H,{once:!0})}},k?{role:"menuitem"}:{},Y,m,D],W=d.useRef(null),K=ie(G=>{At.flushSync(()=>{g.setOpen(!1,xe(sn,G.nativeEvent,G.currentTarget))}),pd(W.current)?.focus()}),ue=ie(G=>{const q=g.select("positionerElement");if(q&&gn(G,q))g.context.beforeContentFocusGuardRef.current?.focus();else{At.flushSync(()=>{g.setOpen(!1,xe(sn,G.nativeEvent,G.currentTarget))});let U=fd(g.context.triggerFocusTargetRef.current||x.current);for(;U!==null&&Re(q,U);){const ne=U;if(U=Gr(U),U===ne)break}U?.focus()}}),X=Ae("button",t,{enabled:!k,stateAttributesMapping:bo,state:Q,ref:re,props:O});return k?ce.jsx(Dp,{tag:"button",render:o,className:r,state:Q,refs:re,props:O,stateAttributesMapping:bo}):R?ce.jsxs(d.Fragment,{children:[ce.jsx(Sn,{ref:W,onFocus:K},`${y}-pre-focus-guard`),ce.jsx(d.Fragment,{children:X},y),ce.jsx(Sn,{ref:g.context.triggerFocusTargetRef,onFocus:ue},`${y}-post-focus-guard`)]}):ce.jsx(d.Fragment,{children:X},y)});function Fp(e,t){const n=Ze(),[o,r]=d.useState(!1);return le(()=>{e&&t==="trigger-hover"?(r(!0),n.start(yc,()=>{r(!1)})):e||(n.clear(),r(!1))},[e,t,n]),o}function Vp(){const e=Un(!0),t=Mt(!0),n=gl();return d.useMemo(()=>n?{type:"menubar",context:n}:e&&!t?{type:"context-menu",context:e}:{type:void 0},[e,t,n])}const hm=d.forwardRef(function(t,n){const{className:o,render:r,orientation:s="horizontal",...i}=t;return Ae("div",t,{state:{orientation:s},ref:n,props:[{role:"separator","aria-orientation":s},i]})}),bm=d.forwardRef(function(t,n){const{render:o,className:r,label:s,id:i,nativeButton:a=!1,openOnHover:u=!0,delay:c=100,closeDelay:f=0,disabled:l=!1,...p}=t,m=Wn(),h=Vr(),{store:g}=Mt(),y=yt(i),b=g.useState("open"),v=g.useState("floatingRootContext"),R=g.useState("floatingTreeRoot"),x=Ka(y,g),w=d.useCallback(J=>{const z=x(J);return J!==null&&g.select("open")&&g.select("activeTriggerId")==null&&g.update({activeTriggerId:y,activeTriggerElement:J,closeDelay:f}),z},[x,f,g,y]),E=d.useRef(null),C=d.useCallback(J=>{E.current=J,g.set("activeTriggerElement",J)},[g]),T=hl();if(!T?.parentMenu)throw new Error(qe(37));g.useSyncedValue("closeDelay",f);const A=T.parentMenu,N=A.useState("itemProps"),F=A.useState("isActive",m.index),L=d.useMemo(()=>({type:"submenu-trigger",setActive(){A.set("activeIndex",m.index)}}),[A,m.index]),k=g.useState("disabled"),P=l||k,{getItemProps:B,itemRef:D}=Gi({closeOnClick:!1,disabled:P,highlighted:F,id:y,store:g,nativeButton:a,itemMetadata:L,nodeId:h?.nodeId}),I=g.useState("hoverEnabled"),S=A.useState("allowMouseEnter"),M=nl(v,{enabled:I&&u&&!P,handleClose:il({blockPointerEvents:!0}),mouseOnly:!0,move:!0,restMs:c,delay:S?{open:c,close:f}:0,triggerElementRef:E,externalTree:R}),H=Bo(v,{enabled:!P,event:"mousedown",toggle:!u,ignoreMouse:u,stickIfOpen:!1}),Z=Pn([H]),$=g.useState("triggerProps",!0);return delete $.id,Ae("div",t,{state:{disabled:P,highlighted:F,open:b},stateAttributesMapping:Hr,props:[Z.getReferenceProps(),M,$,N,{tabIndex:b||F?0:-1,onBlur(){F&&A.set("activeIndex",null)}},p,B],ref:[n,m.ref,D,w,C]})});function ym(e){const[t,n]=d.useState({getBoundingClientRect(){return DOMRect.fromRect({width:0,height:0,x:0,y:0})}}),o=d.useRef(null),r=d.useRef(null),s=d.useRef(null),i=d.useRef(null),a=d.useRef(!0),u=d.useRef(null),c=Xt(),f=d.useMemo(()=>({anchor:t,setAnchor:n,actionsRef:s,backdropRef:o,internalBackdropRef:r,positionerRef:i,allowMouseUpTriggerRef:a,initialCursorPointRef:u,rootId:c}),[t,c]);return ce.jsx(Yi.Provider,{value:f,children:ce.jsx(Br.Provider,{value:void 0,children:ce.jsx(bl,{...e})})})}const ui=500,vm=d.forwardRef(function(t,n){const{render:o,className:r,...s}=t,{setAnchor:i,actionsRef:a,internalBackdropRef:u,backdropRef:c,positionerRef:f,allowMouseUpTriggerRef:l,initialCursorPointRef:p,rootId:m}=Un(!1),{store:h}=Mt(!1),g=h.useState("open"),y=h.useState("disabled"),b=d.useRef(null),v=d.useRef(null),R=Ze(),x=Ze(),w=d.useRef(!1);function E(k,P,B){const D=B.type.startsWith("touch");p.current={x:k,y:P},i({getBoundingClientRect(){return DOMRect.fromRect({width:D?10:0,height:D?10:0,x:k,y:P})}}),w.current=!1,a.current?.setOpen(!0,xe(vn,B)),x.start(ui,()=>{w.current=!0})}function C(k){if(y)return;l.current=!0,st(k),E(k.clientX,k.clientY,k.nativeEvent),Pe(b.current).addEventListener("mouseup",B=>{if(l.current=!1,!w.current)return;x.clear(),w.current=!1;const D=at(B);Re(f.current,D)||m&&D&&us(D)===m||a.current?.setOpen(!1,xe(zr,B))},{once:!0})}function T(k){if(!y&&(l.current=!1,k.touches.length===1)){k.stopPropagation();const P=k.touches[0];v.current={x:P.clientX,y:P.clientY},R.start(ui,()=>{v.current&&E(v.current.x,v.current.y,k.nativeEvent)})}}function A(k){if(R.isStarted()&&v.current&&k.touches.length===1){const P=k.touches[0],B=10,D=Math.abs(P.clientX-v.current.x),I=Math.abs(P.clientY-v.current.y);(D>B||I>B)&&R.clear()}}function N(){R.clear(),v.current=null}return d.useEffect(()=>{function k(B){if(y)return;const I=at(B);(Re(b.current,I)||Re(u.current,I)||Re(c.current,I))&&B.preventDefault()}const P=Pe(b.current);return P.addEventListener("contextmenu",k),()=>{P.removeEventListener("contextmenu",k)}},[c,y,u]),Ae("div",t,{state:{open:g},ref:[b,n],props:[{onContextMenu:C,onTouchStart:T,onTouchMove:A,onTouchEnd:N,onTouchCancel:N,style:{WebkitTouchCallout:"none"}},s],stateAttributesMapping:bo})});function xl(e){const{store:t,parentContext:n,actionsRef:o}=e,r=t.useState("open"),s=t.useState("disablePointerDismissal"),i=t.useState("modal"),a=t.useState("popupElement"),{openMethod:u,triggerProps:c,reset:f}=ls(r);qa(t);const{forceUnmount:l}=Xa(r,t,()=>{f()}),p=ie(N=>{const F=xe(N);return F.preventUnmountOnClose=()=>{t.set("preventUnmountingOnClose",!0)},F}),m=d.useCallback(()=>{t.setOpen(!1,p(Ki))},[t,p]);d.useImperativeHandle(o,()=>({unmount:l,close:m}),[l,m]);const h=el({popupStore:t,onOpenChange:t.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[g,y]=d.useState(0),b=g===0,v=rl(h),R=es(h,{outsidePressEvent(){return t.context.internalBackdropRef.current||t.context.backdropRef.current?"intentional":{mouse:i==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(N){if(!t.context.outsidePressEnabledRef.current||"button"in N&&N.button!==0||"touches"in N&&N.touches.length!==1)return!1;const F=at(N);if(b&&!s){const L=F;return i&&(t.context.internalBackdropRef.current||t.context.backdropRef.current)?t.context.internalBackdropRef.current===L||t.context.backdropRef.current===L||Re(L,a)&&!L?.hasAttribute("data-base-ui-portal"):!0}return!1},escapeKey:b});as(r&&i===!0,a);const{getReferenceProps:x,getFloatingProps:w,getTriggerProps:E}=Pn([v,R]);t.useContextCallback("onNestedDialogOpen",N=>{y(N+1)}),t.useContextCallback("onNestedDialogClose",()=>{y(0)}),d.useEffect(()=>(n?.onNestedDialogOpen&&r&&n.onNestedDialogOpen(g),n?.onNestedDialogClose&&!r&&n.onNestedDialogClose(),()=>{n?.onNestedDialogClose&&r&&n.onNestedDialogClose()}),[r,n,g]);const C=d.useMemo(()=>x(c),[x,c]),T=d.useMemo(()=>E(c),[E,c]),A=d.useMemo(()=>w(),[w]);t.useSyncedValues({openMethod:u,activeTriggerProps:C,inactiveTriggerProps:T,popupProps:A,floatingRootContext:h,nestedOpenDialogCount:g})}const ds=d.createContext(void 0);function Bt(e){const t=d.useContext(ds);if(e===!1&&t===void 0)throw new Error(qe(27));return t}const Bp={...Ja,modal:ae(e=>e.modal),nested:ae(e=>e.nested),nestedOpenDialogCount:ae(e=>e.nestedOpenDialogCount),disablePointerDismissal:ae(e=>e.disablePointerDismissal),openMethod:ae(e=>e.openMethod),descriptionElementId:ae(e=>e.descriptionElementId),titleElementId:ae(e=>e.titleElementId),viewportElement:ae(e=>e.viewportElement),role:ae(e=>e.role)};class wl extends ts{constructor(t){super(Hp(t),{popupRef:d.createRef(),backdropRef:d.createRef(),internalBackdropRef:d.createRef(),outsidePressEnabledRef:{current:!0},triggerElements:new _o,onOpenChange:void 0,onOpenChangeComplete:void 0},Bp)}setOpen=(t,n)=>{if(n.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&n.trigger==null&&this.state.activeTriggerId!=null&&(n.trigger=this.state.activeTriggerElement??void 0),this.context.onOpenChange?.(t,n),n.isCanceled)return;const o={open:t,nativeEvent:n.event,reason:n.reason,nested:this.state.nested};this.state.floatingRootContext.context.events?.emit("openchange",o);const r={open:t},s=n.trigger?.id??null;(s||t)&&(r.activeTriggerId=s,r.activeTriggerElement=n.trigger??null),this.update(r)}}function Hp(e={}){return{...Za(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...e}}function xm(e){const{children:t,open:n,defaultOpen:o=!1,onOpenChange:r,onOpenChangeComplete:s,actionsRef:i,handle:a,triggerId:u,defaultTriggerId:c=null}=e,f=Bt(),l=!!f,p=tt(()=>a?.store??new wl({open:o,openProp:n,activeTriggerId:c,triggerIdProp:u,modal:!0,disablePointerDismissal:!0,nested:l,role:"alertdialog"})).current;p.useControlledProp("openProp",n),p.useControlledProp("triggerIdProp",u),p.useSyncedValue("nested",l),p.useContextCallback("onOpenChange",r),p.useContextCallback("onOpenChangeComplete",s);const m=p.useState("payload");xl({store:p,actionsRef:i,parentContext:f?.store.context});const h=d.useMemo(()=>({store:p}),[p]);return ce.jsx(ds.Provider,{value:h,children:typeof t=="function"?t({payload:m}):t})}const _p={...Cn,...cn},wm=d.forwardRef(function(t,n){const{render:o,className:r,forceRender:s=!1,...i}=t,{store:a}=Bt(),u=a.useState("open"),c=a.useState("nested"),f=a.useState("mounted"),l=a.useState("transitionStatus");return Ae("div",t,{state:{open:u,transitionStatus:l},ref:[a.context.backdropRef,n],stateAttributesMapping:_p,props:[{role:"presentation",hidden:!f,style:{userSelect:"none",WebkitUserSelect:"none"}},i],enabled:s||!c})}),Rm=d.forwardRef(function(t,n){const{render:o,className:r,disabled:s=!1,nativeButton:i=!0,...a}=t,{store:u}=Bt(),c=u.useState("open");function f(h){c&&u.setOpen(!1,xe(Ru,h.nativeEvent))}const{getButtonProps:l,buttonRef:p}=Nt({disabled:s,native:i});return Ae("button",t,{state:{disabled:s},ref:[n,p],props:[{onClick:f},a,l]})}),Em=d.forwardRef(function(t,n){const{render:o,className:r,id:s,...i}=t,{store:a}=Bt(),u=yt(s);return a.useSyncedValueWithCleanup("descriptionElementId",u),Ae("p",t,{ref:n,props:[{id:u},i]})});let zp=(function(e){return e.nestedDialogs="--nested-dialogs",e})({}),jp=(function(e){return e[e.open=tn.open]="open",e[e.closed=tn.closed]="closed",e[e.startingStyle=tn.startingStyle]="startingStyle",e[e.endingStyle=tn.endingStyle]="endingStyle",e.nested="data-nested",e.nestedDialogOpen="data-nested-dialog-open",e})({});const Rl=d.createContext(void 0);function Up(){const e=d.useContext(Rl);if(e===void 0)throw new Error(qe(26));return e}const Wp={...Cn,...cn,nestedDialogOpen(e){return e?{[jp.nestedDialogOpen]:""}:null}},Sm=d.forwardRef(function(t,n){const{className:o,finalFocus:r,initialFocus:s,render:i,...a}=t,{store:u}=Bt(),c=u.useState("descriptionElementId"),f=u.useState("disablePointerDismissal"),l=u.useState("floatingRootContext"),p=u.useState("popupProps"),m=u.useState("modal"),h=u.useState("mounted"),g=u.useState("nested"),y=u.useState("nestedOpenDialogCount"),b=u.useState("open"),v=u.useState("openMethod"),R=u.useState("titleElementId"),x=u.useState("transitionStatus"),w=u.useState("role");Up(),Ft({open:b,ref:u.context.popupRef,onComplete(){b&&u.context.onOpenChangeComplete?.(!0)}});function E(F){return F==="touch"?u.context.popupRef.current:!0}const C=s===void 0?E:s,T=y>0,N=Ae("div",t,{state:{open:b,nested:g,transitionStatus:x,nestedDialogOpen:T},props:[p,{"aria-labelledby":R??void 0,"aria-describedby":c??void 0,role:w,tabIndex:-1,hidden:!h,onKeyDown(F){rs.has(F.key)&&F.stopPropagation()},style:{[zp.nestedDialogs]:y}},a],ref:[n,u.context.popupRef,u.useStateSetter("popupElement")],stateAttributesMapping:Wp});return ce.jsx(Jr,{context:l,openInteractionType:v,disabled:!h,closeOnFocusOut:!f,initialFocus:C,returnFocus:r,modal:m!==!1,restoreFocus:"popup",children:N})}),Tm=d.forwardRef(function(t,n){const{keepMounted:o=!1,...r}=t,{store:s}=Bt(),i=s.useState("mounted"),a=s.useState("modal"),u=s.useState("open");return i||o?ce.jsx(Rl.Provider,{value:o,children:ce.jsxs(Xr,{ref:n,...r,children:[i&&a===!0&&ce.jsx(ss,{ref:s.context.internalBackdropRef,inert:Uo(!u)}),t.children]})}):null}),Cm=d.forwardRef(function(t,n){const{render:o,className:r,id:s,...i}=t,{store:a}=Bt(),u=yt(s);return a.useSyncedValueWithCleanup("titleElementId",u),Ae("h2",t,{ref:n,props:[{id:u},i]})}),Im=d.forwardRef(function(t,n){const{render:o,className:r,disabled:s=!1,nativeButton:i=!0,id:a,payload:u,handle:c,...f}=t,l=Bt(!0),p=c?.store??l?.store;if(!p)throw new Error(qe(79));const m=yt(a),h=p.useState("floatingRootContext"),g=p.useState("isOpenedByTrigger",m),y=d.useRef(null),{registerTrigger:b,isMountedByThisTrigger:v}=Ga(m,y,p,{payload:u}),{getButtonProps:R,buttonRef:x}=Nt({disabled:s,native:i}),w=Bo(h,{enabled:h!=null}),E=Pn([w]),C={disabled:s,open:g},T=p.useState("triggerProps",v);return Ae("button",t,{state:C,ref:[x,n,b,y],props:[E.getReferenceProps(),T,{[Mi]:"",id:m},f,R],stateAttributesMapping:Hr})});function $p(e){if(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))}const Yp=e=>{switch(e){case"success":return qp;case"info":return Zp;case"warning":return Xp;case"error":return Jp;default:return null}},Kp=Array(12).fill(0),Gp=({visible:e,className:t})=>te.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},te.createElement("div",{className:"sonner-spinner"},Kp.map((n,o)=>te.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${o}`})))),qp=te.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},te.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"})),Xp=te.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},te.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"})),Zp=te.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},te.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"})),Jp=te.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},te.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"})),Qp=te.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"},te.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),te.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),eg=()=>{const[e,t]=te.useState(document.hidden);return te.useEffect(()=>{const n=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),e};let Mr=1;class tg{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{const n=this.subscribers.indexOf(t);this.subscribers.splice(n,1)}),this.publish=t=>{this.subscribers.forEach(n=>n(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var n;const{message:o,...r}=t,s=typeof t?.id=="number"||((n=t.id)==null?void 0:n.length)>0?t.id:Mr++,i=this.toasts.find(u=>u.id===s),a=t.dismissible===void 0?!0:t.dismissible;return this.dismissedToasts.has(s)&&this.dismissedToasts.delete(s),i?this.toasts=this.toasts.map(u=>u.id===s?(this.publish({...u,...t,id:s,title:o}),{...u,...t,id:s,dismissible:a,title:o}):u):this.addToast({title:o,...r,dismissible:a,id:s}),s},this.dismiss=t=>(t?(this.dismissedToasts.add(t),requestAnimationFrame(()=>this.subscribers.forEach(n=>n({id:t,dismiss:!0})))):this.toasts.forEach(n=>{this.subscribers.forEach(o=>o({id:n.id,dismiss:!0}))}),t),this.message=(t,n)=>this.create({...n,message:t}),this.error=(t,n)=>this.create({...n,message:t,type:"error"}),this.success=(t,n)=>this.create({...n,type:"success",message:t}),this.info=(t,n)=>this.create({...n,type:"info",message:t}),this.warning=(t,n)=>this.create({...n,type:"warning",message:t}),this.loading=(t,n)=>this.create({...n,type:"loading",message:t}),this.promise=(t,n)=>{if(!n)return;let o;n.loading!==void 0&&(o=this.create({...n,promise:t,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));const r=Promise.resolve(t instanceof Function?t():t);let s=o!==void 0,i;const a=r.then(async c=>{if(i=["resolve",c],te.isValidElement(c))s=!1,this.create({id:o,type:"default",message:c});else if(og(c)&&!c.ok){s=!1;const l=typeof n.error=="function"?await n.error(`HTTP error! status: ${c.status}`):n.error,p=typeof n.description=="function"?await n.description(`HTTP error! status: ${c.status}`):n.description,h=typeof l=="object"&&!te.isValidElement(l)?l:{message:l};this.create({id:o,type:"error",description:p,...h})}else if(c instanceof Error){s=!1;const l=typeof n.error=="function"?await n.error(c):n.error,p=typeof n.description=="function"?await n.description(c):n.description,h=typeof l=="object"&&!te.isValidElement(l)?l:{message:l};this.create({id:o,type:"error",description:p,...h})}else if(n.success!==void 0){s=!1;const l=typeof n.success=="function"?await n.success(c):n.success,p=typeof n.description=="function"?await n.description(c):n.description,h=typeof l=="object"&&!te.isValidElement(l)?l:{message:l};this.create({id:o,type:"success",description:p,...h})}}).catch(async c=>{if(i=["reject",c],n.error!==void 0){s=!1;const f=typeof n.error=="function"?await n.error(c):n.error,l=typeof n.description=="function"?await n.description(c):n.description,m=typeof f=="object"&&!te.isValidElement(f)?f:{message:f};this.create({id:o,type:"error",description:l,...m})}}).finally(()=>{s&&(this.dismiss(o),o=void 0),n.finally==null||n.finally.call(n)}),u=()=>new Promise((c,f)=>a.then(()=>i[0]==="reject"?f(i[1]):c(i[1])).catch(f));return typeof o!="string"&&typeof o!="number"?{unwrap:u}:Object.assign(o,{unwrap:u})},this.custom=(t,n)=>{const o=n?.id||Mr++;return this.create({jsx:t(o),id:o,...n}),o},this.getActiveToasts=()=>this.toasts.filter(t=>!this.dismissedToasts.has(t.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}}const dt=new tg,ng=(e,t)=>{const n=t?.id||Mr++;return dt.addToast({title:e,...t,id:n}),n},og=e=>e&&typeof e=="object"&&"ok"in e&&typeof e.ok=="boolean"&&"status"in e&&typeof e.status=="number",rg=ng,sg=()=>dt.toasts,ig=()=>dt.getActiveToasts(),Mm=Object.assign(rg,{success:dt.success,info:dt.info,warning:dt.warning,error:dt.error,custom:dt.custom,message:dt.message,promise:dt.promise,dismiss:dt.dismiss,loading:dt.loading},{getHistory:sg,getToasts:ig});$p("[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 lo(e){return e.label!==void 0}const ag=3,lg="24px",cg="16px",di=4e3,ug=356,dg=14,fg=45,pg=200;function wt(...e){return e.filter(Boolean).join(" ")}function gg(e){const[t,n]=e.split("-"),o=[];return t&&o.push(t),n&&o.push(n),o}const mg=e=>{var t,n,o,r,s,i,a,u,c;const{invert:f,toast:l,unstyled:p,interacting:m,setHeights:h,visibleToasts:g,heights:y,index:b,toasts:v,expanded:R,removeToast:x,defaultRichColors:w,closeButton:E,style:C,cancelButtonStyle:T,actionButtonStyle:A,className:N="",descriptionClassName:F="",duration:L,position:k,gap:P,expandByDefault:B,classNames:D,icons:I,closeButtonAriaLabel:S="Close toast"}=e,[M,H]=te.useState(null),[Z,$]=te.useState(null),[_,V]=te.useState(!1),[J,z]=te.useState(!1),[Y,ee]=te.useState(!1),[Q,pe]=te.useState(!1),[re,O]=te.useState(!1),[W,K]=te.useState(0),[ue,X]=te.useState(0),G=te.useRef(l.duration||L||di),q=te.useRef(null),U=te.useRef(null),ne=b===0,j=b+1<=g,oe=l.type,ge=l.dismissible!==!1,se=l.className||"",Ee=l.descriptionClassName||"",De=te.useMemo(()=>y.findIndex(be=>be.toastId===l.id)||0,[y,l.id]),Be=te.useMemo(()=>{var be;return(be=l.closeButton)!=null?be:E},[l.closeButton,E]),Ce=te.useMemo(()=>l.duration||L||di,[l.duration,L]),Te=te.useRef(0),Me=te.useRef(0),Oe=te.useRef(0),Ke=te.useRef(null),[ct,we]=k.split("-"),me=te.useMemo(()=>y.reduce((be,_e,We)=>We>=De?be:be+_e.height,0),[y,De]),ke=eg(),Se=l.invert||f,Ne=oe==="loading";Me.current=te.useMemo(()=>De*P+me,[De,me]),te.useEffect(()=>{G.current=Ce},[Ce]),te.useEffect(()=>{V(!0)},[]),te.useEffect(()=>{const be=U.current;if(be){const _e=be.getBoundingClientRect().height;return X(_e),h(We=>[{toastId:l.id,height:_e,position:l.position},...We]),()=>h(We=>We.filter(Xe=>Xe.toastId!==l.id))}},[h,l.id]),te.useLayoutEffect(()=>{if(!_)return;const be=U.current,_e=be.style.height;be.style.height="auto";const We=be.getBoundingClientRect().height;be.style.height=_e,X(We),h(Xe=>Xe.find($e=>$e.toastId===l.id)?Xe.map($e=>$e.toastId===l.id?{...$e,height:We}:$e):[{toastId:l.id,height:We,position:l.position},...Xe])},[_,l.title,l.description,h,l.id,l.jsx,l.action,l.cancel]);const Fe=te.useCallback(()=>{z(!0),K(Me.current),h(be=>be.filter(_e=>_e.toastId!==l.id)),setTimeout(()=>{x(l)},pg)},[l,x,h,Me]);te.useEffect(()=>{if(l.promise&&oe==="loading"||l.duration===1/0||l.type==="loading")return;let be;return R||m||ke?(()=>{if(Oe.current<Te.current){const Xe=new Date().getTime()-Te.current;G.current=G.current-Xe}Oe.current=new Date().getTime()})():G.current!==1/0&&(Te.current=new Date().getTime(),be=setTimeout(()=>{l.onAutoClose==null||l.onAutoClose.call(l,l),Fe()},G.current)),()=>clearTimeout(be)},[R,m,l,oe,ke,Fe]),te.useEffect(()=>{l.delete&&(Fe(),l.onDismiss==null||l.onDismiss.call(l,l))},[Fe,l.delete]);function He(){var be;if(I?.loading){var _e;return te.createElement("div",{className:wt(D?.loader,l==null||(_e=l.classNames)==null?void 0:_e.loader,"sonner-loader"),"data-visible":oe==="loading"},I.loading)}return te.createElement(Gp,{className:wt(D?.loader,l==null||(be=l.classNames)==null?void 0:be.loader),visible:oe==="loading"})}const Qe=l.icon||I?.[oe]||Yp(oe);var ot,it;return te.createElement("li",{tabIndex:0,ref:U,className:wt(N,se,D?.toast,l==null||(t=l.classNames)==null?void 0:t.toast,D?.default,D?.[oe],l==null||(n=l.classNames)==null?void 0:n[oe]),"data-sonner-toast":"","data-rich-colors":(ot=l.richColors)!=null?ot:w,"data-styled":!(l.jsx||l.unstyled||p),"data-mounted":_,"data-promise":!!l.promise,"data-swiped":re,"data-removed":J,"data-visible":j,"data-y-position":ct,"data-x-position":we,"data-index":b,"data-front":ne,"data-swiping":Y,"data-dismissible":ge,"data-type":oe,"data-invert":Se,"data-swipe-out":Q,"data-swipe-direction":Z,"data-expanded":!!(R||B&&_),"data-testid":l.testId,style:{"--index":b,"--toasts-before":b,"--z-index":v.length-b,"--offset":`${J?W:Me.current}px`,"--initial-height":B?"auto":`${ue}px`,...C,...l.style},onDragEnd:()=>{ee(!1),H(null),Ke.current=null},onPointerDown:be=>{be.button!==2&&(Ne||!ge||(q.current=new Date,K(Me.current),be.target.setPointerCapture(be.pointerId),be.target.tagName!=="BUTTON"&&(ee(!0),Ke.current={x:be.clientX,y:be.clientY})))},onPointerUp:()=>{var be,_e,We;if(Q||!ge)return;Ke.current=null;const Xe=Number(((be=U.current)==null?void 0:be.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),xt=Number(((_e=U.current)==null?void 0:_e.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),$e=new Date().getTime()-((We=q.current)==null?void 0:We.getTime()),he=M==="x"?Xe:xt,Ve=Math.abs(he)/$e;if(Math.abs(he)>=fg||Ve>.11){K(Me.current),l.onDismiss==null||l.onDismiss.call(l,l),$(M==="x"?Xe>0?"right":"left":xt>0?"down":"up"),Fe(),pe(!0);return}else{var ze,je;(ze=U.current)==null||ze.style.setProperty("--swipe-amount-x","0px"),(je=U.current)==null||je.style.setProperty("--swipe-amount-y","0px")}O(!1),ee(!1),H(null)},onPointerMove:be=>{var _e,We,Xe;if(!Ke.current||!ge||((_e=window.getSelection())==null?void 0:_e.toString().length)>0)return;const $e=be.clientY-Ke.current.y,he=be.clientX-Ke.current.x;var Ve;const ze=(Ve=e.swipeDirections)!=null?Ve:gg(k);!M&&(Math.abs(he)>1||Math.abs($e)>1)&&H(Math.abs(he)>Math.abs($e)?"x":"y");let je={x:0,y:0};const Ge=ut=>1/(1.5+Math.abs(ut)/20);if(M==="y"){if(ze.includes("top")||ze.includes("bottom"))if(ze.includes("top")&&$e<0||ze.includes("bottom")&&$e>0)je.y=$e;else{const ut=$e*Ge($e);je.y=Math.abs(ut)<Math.abs($e)?ut:$e}}else if(M==="x"&&(ze.includes("left")||ze.includes("right")))if(ze.includes("left")&&he<0||ze.includes("right")&&he>0)je.x=he;else{const ut=he*Ge(he);je.x=Math.abs(ut)<Math.abs(he)?ut:he}(Math.abs(je.x)>0||Math.abs(je.y)>0)&&O(!0),(We=U.current)==null||We.style.setProperty("--swipe-amount-x",`${je.x}px`),(Xe=U.current)==null||Xe.style.setProperty("--swipe-amount-y",`${je.y}px`)}},Be&&!l.jsx&&oe!=="loading"?te.createElement("button",{"aria-label":S,"data-disabled":Ne,"data-close-button":!0,onClick:Ne||!ge?()=>{}:()=>{Fe(),l.onDismiss==null||l.onDismiss.call(l,l)},className:wt(D?.closeButton,l==null||(o=l.classNames)==null?void 0:o.closeButton)},(it=I?.close)!=null?it:Qp):null,(oe||l.icon||l.promise)&&l.icon!==null&&(I?.[oe]!==null||l.icon)?te.createElement("div",{"data-icon":"",className:wt(D?.icon,l==null||(r=l.classNames)==null?void 0:r.icon)},l.promise||l.type==="loading"&&!l.icon?l.icon||He():null,l.type!=="loading"?Qe:null):null,te.createElement("div",{"data-content":"",className:wt(D?.content,l==null||(s=l.classNames)==null?void 0:s.content)},te.createElement("div",{"data-title":"",className:wt(D?.title,l==null||(i=l.classNames)==null?void 0:i.title)},l.jsx?l.jsx:typeof l.title=="function"?l.title():l.title),l.description?te.createElement("div",{"data-description":"",className:wt(F,Ee,D?.description,l==null||(a=l.classNames)==null?void 0:a.description)},typeof l.description=="function"?l.description():l.description):null),te.isValidElement(l.cancel)?l.cancel:l.cancel&&lo(l.cancel)?te.createElement("button",{"data-button":!0,"data-cancel":!0,style:l.cancelButtonStyle||T,onClick:be=>{lo(l.cancel)&&ge&&(l.cancel.onClick==null||l.cancel.onClick.call(l.cancel,be),Fe())},className:wt(D?.cancelButton,l==null||(u=l.classNames)==null?void 0:u.cancelButton)},l.cancel.label):null,te.isValidElement(l.action)?l.action:l.action&&lo(l.action)?te.createElement("button",{"data-button":!0,"data-action":!0,style:l.actionButtonStyle||A,onClick:be=>{lo(l.action)&&(l.action.onClick==null||l.action.onClick.call(l.action,be),!be.defaultPrevented&&Fe())},className:wt(D?.actionButton,l==null||(c=l.classNames)==null?void 0:c.actionButton)},l.action.label):null)};function fi(){if(typeof window>"u"||typeof document>"u")return"ltr";const e=document.documentElement.getAttribute("dir");return e==="auto"||!e?window.getComputedStyle(document.documentElement).direction:e}function hg(e,t){const n={};return[e,t].forEach((o,r)=>{const s=r===1,i=s?"--mobile-offset":"--offset",a=s?cg:lg;function u(c){["top","right","bottom","left"].forEach(f=>{n[`${i}-${f}`]=typeof c=="number"?`${c}px`:c})}typeof o=="number"||typeof o=="string"?u(o):typeof o=="object"?["top","right","bottom","left"].forEach(c=>{o[c]===void 0?n[`${i}-${c}`]=a:n[`${i}-${c}`]=typeof o[c]=="number"?`${o[c]}px`:o[c]}):u(a)}),n}const km=te.forwardRef(function(t,n){const{id:o,invert:r,position:s="bottom-right",hotkey:i=["altKey","KeyT"],expand:a,closeButton:u,className:c,offset:f,mobileOffset:l,theme:p="light",richColors:m,duration:h,style:g,visibleToasts:y=ag,toastOptions:b,dir:v=fi(),gap:R=dg,icons:x,containerAriaLabel:w="Notifications"}=t,[E,C]=te.useState([]),T=te.useMemo(()=>o?E.filter(_=>_.toasterId===o):E.filter(_=>!_.toasterId),[E,o]),A=te.useMemo(()=>Array.from(new Set([s].concat(T.filter(_=>_.position).map(_=>_.position)))),[T,s]),[N,F]=te.useState([]),[L,k]=te.useState(!1),[P,B]=te.useState(!1),[D,I]=te.useState(p!=="system"?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),S=te.useRef(null),M=i.join("+").replace(/Key/g,"").replace(/Digit/g,""),H=te.useRef(null),Z=te.useRef(!1),$=te.useCallback(_=>{C(V=>{var J;return(J=V.find(z=>z.id===_.id))!=null&&J.delete||dt.dismiss(_.id),V.filter(({id:z})=>z!==_.id)})},[]);return te.useEffect(()=>dt.subscribe(_=>{if(_.dismiss){requestAnimationFrame(()=>{C(V=>V.map(J=>J.id===_.id?{...J,delete:!0}:J))});return}setTimeout(()=>{jl.flushSync(()=>{C(V=>{const J=V.findIndex(z=>z.id===_.id);return J!==-1?[...V.slice(0,J),{...V[J],..._},...V.slice(J+1)]:[_,...V]})})})}),[E]),te.useEffect(()=>{if(p!=="system"){I(p);return}if(p==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?I("dark"):I("light")),typeof window>"u")return;const _=window.matchMedia("(prefers-color-scheme: dark)");try{_.addEventListener("change",({matches:V})=>{I(V?"dark":"light")})}catch{_.addListener(({matches:J})=>{try{I(J?"dark":"light")}catch(z){console.error(z)}})}},[p]),te.useEffect(()=>{E.length<=1&&k(!1)},[E]),te.useEffect(()=>{const _=V=>{var J;if(i.every(ee=>V[ee]||V.code===ee)){var Y;k(!0),(Y=S.current)==null||Y.focus()}V.code==="Escape"&&(document.activeElement===S.current||(J=S.current)!=null&&J.contains(document.activeElement))&&k(!1)};return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[i]),te.useEffect(()=>{if(S.current)return()=>{H.current&&(H.current.focus({preventScroll:!0}),H.current=null,Z.current=!1)}},[S.current]),te.createElement("section",{ref:n,"aria-label":`${w} ${M}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},A.map((_,V)=>{var J;const[z,Y]=_.split("-");return T.length?te.createElement("ol",{key:_,dir:v==="auto"?fi():v,tabIndex:-1,ref:S,className:c,"data-sonner-toaster":!0,"data-sonner-theme":D,"data-y-position":z,"data-x-position":Y,style:{"--front-toast-height":`${((J=N[0])==null?void 0:J.height)||0}px`,"--width":`${ug}px`,"--gap":`${R}px`,...g,...hg(f,l)},onBlur:ee=>{Z.current&&!ee.currentTarget.contains(ee.relatedTarget)&&(Z.current=!1,H.current&&(H.current.focus({preventScroll:!0}),H.current=null))},onFocus:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||Z.current||(Z.current=!0,H.current=ee.relatedTarget)},onMouseEnter:()=>k(!0),onMouseMove:()=>k(!0),onMouseLeave:()=>{P||k(!1)},onDragEnd:()=>k(!1),onPointerDown:ee=>{ee.target instanceof HTMLElement&&ee.target.dataset.dismissible==="false"||B(!0)},onPointerUp:()=>B(!1)},T.filter(ee=>!ee.position&&V===0||ee.position===_).map((ee,Q)=>{var pe,re;return te.createElement(mg,{key:ee.id,icons:x,index:Q,toast:ee,defaultRichColors:m,duration:(pe=b?.duration)!=null?pe:h,className:b?.className,descriptionClassName:b?.descriptionClassName,invert:r,visibleToasts:y,closeButton:(re=b?.closeButton)!=null?re:u,interacting:P,position:_,style:b?.style,unstyled:b?.unstyled,classNames:b?.classNames,cancelButtonStyle:b?.cancelButtonStyle,actionButtonStyle:b?.actionButtonStyle,closeButtonAriaLabel:b?.closeButtonAriaLabel,removeToast:$,toasts:T.filter(O=>O.position==ee.position),heights:N.filter(O=>O.position==ee.position),setHeights:F,expandByDefault:a,gap:R,expanded:L,swipeDirections:t.swipeDirections})})):null}))});let pi=(function(e){return e.checked="data-checked",e.unchecked="data-unchecked",e.indeterminate="data-indeterminate",e.disabled="data-disabled",e.readonly="data-readonly",e.required="data-required",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({}),gi=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const bg={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},fs={valid(e){return e===null?null:e?{[gi.valid]:""}:{[gi.invalid]:""}}};function El(e){return d.useMemo(()=>({checked(t){return e.indeterminate?{}:t?{[pi.checked]:""}:{[pi.unchecked]:""}},...fs}),[e.indeterminate])}const yg=d.createContext({invalid:void 0,name:void 0,validityData:{state:bg,errors:[],error:"",value:"",initialValue:null},setValidityData:lt,disabled:void 0,touched:!1,setTouched:lt,dirty:!1,setDirty:lt,filled:!1,setFilled:lt,focused:!1,setFocused:lt,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=Ye)=>e,getInputValidationProps:(e=Ye)=>e,inputRef:{current:null},commit:async()=>{}}});function Yo(e=!0){const t=d.useContext(yg);if(t.setValidityData===lt&&!e)throw new Error(qe(28));return t}const vg=d.createContext({disabled:!1});function xg(){return d.useContext(vg)}function wg(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const Rg=d.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:lt,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function ps(){return d.useContext(Rg)}function Sl(e){const{enabled:t=!0,value:n,id:o,name:r,controlRef:s,commit:i}=e,{formRef:a}=ps(),{invalid:u,markedDirtyRef:c,validityData:f,setValidityData:l}=Yo(),p=ie(e.getValue);le(()=>{if(!t)return;let m=n;m===void 0&&(m=p()),f.initialValue===null&&m!==null&&l(h=>({...h,initialValue:m}))},[t,l,n,f.initialValue,p]),le(()=>{!t||!o||a.current.fields.set(o,{getValue:p,name:r,controlRef:s,validityData:wg(f,u),validate(m=!0){let h=n;h===void 0&&(h=p()),c.current=!0,m?At.flushSync(()=>i(h)):i(h)}})},[i,s,t,a,p,o,u,c,r,f,n]),le(()=>{const m=a.current.fields;return()=>{o&&m.delete(o)}},[a,o])}const Eg=d.createContext({controlId:void 0,registerControlId:lt,labelId:void 0,setLabelId:lt,messageIds:[],setMessageIds:lt,getDescriptionProps:e=>e});function gs(){return d.useContext(Eg)}const Sg=d.createContext(void 0);function Tg(e=!0){const t=d.useContext(Sg);if(t===void 0&&!e)throw new Error(qe(3));return t}const Tl=d.createContext(void 0);function Cg(){const e=d.useContext(Tl);if(e===void 0)throw new Error(qe(14));return e}function Cl(e,t){const n=d.useRef(e),o=ie(t);le(()=>{n.current!==e&&o(n.current)},[e,o]),le(()=>{n.current=e},[e])}const Ig="data-parent",Pm=d.forwardRef(function(t,n){const{checked:o,className:r,defaultChecked:s=!1,disabled:i=!1,id:a,indeterminate:u=!1,inputRef:c,name:f,onCheckedChange:l,parent:p=!1,readOnly:m=!1,render:h,required:g=!1,uncheckedValue:y,value:b,nativeButton:v=!1,...R}=t,{clearErrors:x}=ps(),{disabled:w,name:E,setDirty:C,setFilled:T,setFocused:A,setTouched:N,state:F,validationMode:L,validityData:k,shouldValidateOnChange:P,validation:B}=Yo(),D=xg(),{labelId:I,controlId:S,registerControlId:M,getDescriptionProps:H}=gs(),Z=Tg(),$=Z?.parent,_=$&&Z.allValues,V=w||D.disabled||Z?.disabled||i,J=E??f,z=b??J,Y=yt(),ee=yt();let Q=S;_?Q=p?ee:`${$.id}-${z}`:a&&(Q=a);let pe={};_&&(p?pe=Z.parent.getParentProps():z&&(pe=Z.parent.getChildProps(z)));const re=ie(l),{checked:O=o,indeterminate:W=u,onCheckedChange:K,...ue}=pe,X=Z?.value,G=Z?.setValue,q=Z?.defaultValue,U=d.useRef(null),ne=tt(()=>Symbol("checkbox-control")),j=d.useRef(!1),{getButtonProps:oe,buttonRef:ge}=Nt({disabled:V,native:v}),se=Z?.validation??B,[Ee,De]=yo({controlled:z&&X&&!p?X.includes(z):O,default:z&&q&&!p?q.includes(z):s,name:"Checkbox",state:"checked"});le(()=>{M!==lt&&(j.current=!0,M(ne.current,Q))},[Q,Z,M,p,ne]),d.useEffect(()=>{const me=ne.current;return()=>{!j.current||M===lt||(j.current=!1,M(me,void 0))}},[M,ne]),Sl({enabled:!Z,id:Y,commit:se.commit,value:Ee,controlRef:U,name:J,getValue:()=>Ee});const Be=d.useRef(null),Ce=Ct(c,Be,se.inputRef);le(()=>{Be.current&&(Be.current.indeterminate=W,Ee&&T(!0))},[Ee,W,T]),Cl(Ee,()=>{Z&&!p||(x(J),T(Ee),C(Ee!==k.initialValue),P()?se.commit(Ee):se.commit(Ee,!0))});const Te=$t({checked:Ee,disabled:V,name:p?void 0:J,id:v?void 0:Q??void 0,required:g,ref:Ce,style:J?ka:Vo,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(me){if(me.nativeEvent.defaultPrevented)return;const ke=me.target.checked,Se=xe(rn,me.nativeEvent);if(K?.(ke,Se),re(ke,Se),!Se.isCanceled&&(De(ke),z&&X&&G&&!p)){const Ne=ke?[...X,z]:X.filter(Fe=>Fe!==z);G(Ne,Se)}},onFocus(){U.current?.focus()}},b!==void 0?{value:(Z?Ee&&b:b)||""}:Ye,H,Z?se.getValidationProps:se.getInputValidationProps),Me=_?!!O:Ee,Oe=_&&W||u;d.useEffect(()=>{if(!$||!z)return;const me=$.disabledStatesRef.current;return me.set(z,V),()=>{me.delete(z)}},[$,V,z]);const Ke=d.useMemo(()=>({...F,checked:Me,disabled:V,readOnly:m,required:g,indeterminate:Oe}),[F,Me,V,m,g,Oe]),ct=El(Ke),we=Ae("span",t,{state:Ke,ref:[ge,U,n,Z?.registerControlRef],props:[{id:v?Q??void 0:Y,role:"checkbox","aria-checked":W?"mixed":Ee,"aria-readonly":m||void 0,"aria-required":g||void 0,"aria-labelledby":I,[Ig]:p?"":void 0,onFocus(){A(!0)},onBlur(){const me=Be.current;me&&(N(!0),A(!1),L==="onBlur"&&se.commit(Z?X:me.checked))},onClick(me){m||V||(me.preventDefault(),Be.current?.dispatchEvent(new PointerEvent("click",{bubbles:!0,shiftKey:me.shiftKey,ctrlKey:me.ctrlKey,altKey:me.altKey,metaKey:me.metaKey})))}},H,se.getValidationProps,R,ue,oe],stateAttributesMapping:ct});return ce.jsxs(Tl.Provider,{value:Ke,children:[we,!Ee&&!Z&&J&&!p&&y!==void 0&&ce.jsx("input",{type:"hidden",name:J,value:y}),ce.jsx("input",{...Te})]})}),Om=d.forwardRef(function(t,n){const{render:o,className:r,keepMounted:s=!1,...i}=t,a=Cg(),u=a.checked||a.indeterminate,{mounted:c,transitionStatus:f,setMounted:l}=In(u),p=d.useRef(null),m={...a,transitionStatus:f};Ft({open:u,ref:p,onComplete(){u||l(!1)}});const h=El(a),g=d.useMemo(()=>({...h,...cn,...fs}),[h]),y=s||c,b=Ae("span",t,{ref:[n,p],state:m,stateAttributesMapping:g,props:i});return y?b:null}),Il=d.createContext(null),Ml=d.createContext(null);function kt(){const e=d.useContext(Il);if(e===null)throw new Error(qe(60));return e}function kl(){const e=d.useContext(Ml);if(e===null)throw new Error(qe(61));return e}function Pl(e={}){const{id:t,implicit:n=!1,controlRef:o}=e,{controlId:r,registerControlId:s}=gs(),i=yt(t),a=n?r:void 0,u=tt(()=>Symbol("labelable-control")),c=d.useRef(!1),f=d.useRef(t!=null),l=ie(()=>{!c.current||s===lt||(c.current=!1,s(u.current,void 0))});return le(()=>{if(s===lt)return;let p;if(n){const m=o?.current;Le(m)&&m.closest("label")!=null?p=t??null:p=a??i}else if(t!=null)f.current=!0,p=t;else if(f.current)p=i;else{l();return}if(p===void 0){l();return}c.current=!0,s(u.current,p)},[t,o,a,s,n,i,u,l]),d.useEffect(()=>l,[l]),r??i}const Mg=(e,t)=>Object.is(e,t);function Tn(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function kg(e,t,n){return!e||e.length===0?!1:e.some(o=>o===void 0?!1:Tn(t,o,n))}function Bn(e,t,n){return!e||e.length===0?-1:e.findIndex(o=>o===void 0?!1:Tn(o,t,n))}function Pg(e,t,n){return e.filter(o=>!Tn(t,o,n))}function kr(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function Ol(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function Og(e){if(!Array.isArray(e))return e!=null&&!("null"in e);if(Ol(e)){for(const t of e)for(const n of t.items)if(n&&n.value==null&&n.label!=null)return!0;return!1}for(const t of e)if(t&&t.value==null&&t.label!=null)return!0;return!1}function Ag(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return kr(e)}function dn(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?kr(e.value):kr(e)}function Al(e,t,n){function o(){return Ag(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??o();if(Array.isArray(t)){const r=Ol(t)?t.flatMap(s=>s.items):t;if(e==null||typeof e!="object"){const s=r.find(i=>i.value===e);return s&&s.label!=null?s.label:o()}if("value"in e){const s=r.find(i=>i&&i.value===e.value);if(s&&s.label!=null)return s.label}}return o()}function Lg(e,t,n){return e.reduce((o,r,s)=>(s>0&&o.push(", "),o.push(ce.jsx(d.Fragment,{children:Al(r,t,n)},s)),o),[])}const ye={id:ae(e=>e.id),modal:ae(e=>e.modal),multiple:ae(e=>e.multiple),items:ae(e=>e.items),itemToStringLabel:ae(e=>e.itemToStringLabel),itemToStringValue:ae(e=>e.itemToStringValue),isItemEqualToValue:ae(e=>e.isItemEqualToValue),value:ae(e=>e.value),hasSelectedValue:ae(e=>{const{value:t,multiple:n,itemToStringValue:o}=e;return t==null?!1:n&&Array.isArray(t)?t.length>0:dn(t,o)!==""}),hasNullItemLabel:ae((e,t)=>t?Og(e.items):!1),open:ae(e=>e.open),mounted:ae(e=>e.mounted),forceMount:ae(e=>e.forceMount),transitionStatus:ae(e=>e.transitionStatus),openMethod:ae(e=>e.openMethod),activeIndex:ae(e=>e.activeIndex),selectedIndex:ae(e=>e.selectedIndex),isActive:ae((e,t)=>e.activeIndex===t),isSelected:ae((e,t,n)=>{const o=e.isItemEqualToValue,r=e.value;return e.multiple?Array.isArray(r)&&r.some(s=>Tn(n,s,o)):e.selectedIndex===t&&e.selectedIndex!==null?!0:Tn(n,r,o)}),isSelectedByFocus:ae((e,t)=>e.selectedIndex===t),popupProps:ae(e=>e.popupProps),triggerProps:ae(e=>e.triggerProps),triggerElement:ae(e=>e.triggerElement),positionerElement:ae(e=>e.positionerElement),listElement:ae(e=>e.listElement),scrollUpArrowVisible:ae(e=>e.scrollUpArrowVisible),scrollDownArrowVisible:ae(e=>e.scrollDownArrowVisible),hasScrollArrows:ae(e=>e.hasScrollArrows)};function Am(e){const{id:t,value:n,defaultValue:o=null,onValueChange:r,open:s,defaultOpen:i=!1,onOpenChange:a,name:u,autoComplete:c,disabled:f=!1,readOnly:l=!1,required:p=!1,modal:m=!0,actionsRef:h,inputRef:g,onOpenChangeComplete:y,items:b,multiple:v=!1,itemToStringLabel:R,itemToStringValue:x,isItemEqualToValue:w=Mg,highlightItemOnHover:E=!0,children:C}=e,{clearErrors:T}=ps(),{setDirty:A,setTouched:N,setFocused:F,shouldValidateOnChange:L,validityData:k,setFilled:P,name:B,disabled:D,validation:I,validationMode:S}=Yo(),M=Pl({id:t}),H=D||f,Z=B??u,[$,_]=yo({controlled:n,default:v?o??Yt:o,name:"Select",state:"value"}),[V,J]=yo({controlled:s,default:i,name:"Select",state:"open"}),z=d.useRef([]),Y=d.useRef([]),ee=d.useRef(null),Q=d.useRef(null),pe=d.useRef(0),re=d.useRef(null),O=d.useRef([]),W=d.useRef(!1),K=d.useRef(!1),ue=d.useRef(null),X=d.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),G=d.useRef(!1),{mounted:q,setMounted:U,transitionStatus:ne}=In(V),{openMethod:j,triggerProps:oe,reset:ge}=ls(V),se=tt(()=>new Ya({id:M,modal:m,multiple:v,itemToStringLabel:R,itemToStringValue:x,isItemEqualToValue:w,value:$,open:V,mounted:q,transitionStatus:ne,items:b,forceMount:!1,openMethod:null,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,Ee=ve(se,ye.activeIndex),De=ve(se,ye.selectedIndex),Be=ve(se,ye.triggerElement),Ce=ve(se,ye.positionerElement),Te=d.useMemo(()=>v&&Array.isArray($)&&$.length===0?"":dn($,x),[v,$,x]),Me=d.useMemo(()=>v&&Array.isArray($)?$.map(he=>dn(he,x)):dn($,x),[v,$,x]),Oe=nt(se.state.triggerElement);Sl({id:M,commit:I.commit,value:$,controlRef:Oe,name:Z,getValue:()=>Me});const Ke=d.useRef($);le(()=>{$!==Ke.current&&se.set("forceMount",!0)},[se,$]),le(()=>{P(v?Array.isArray($)&&$.length>0:$!=null)},[v,$,P]),le(function(){if(V)return;const Ve=O.current;if(v){const je=Array.isArray($)?$:[];if(je.length===0){se.set("selectedIndex",null);return}const Ge=je[je.length-1],ut=Bn(Ve,Ge,w);se.set("selectedIndex",ut===-1?null:ut);return}const ze=Bn(Ve,$,w);se.set("selectedIndex",ze===-1?null:ze)},[v,V,$,O,w,se]),Cl($,()=>{T(Z),A($!==k.initialValue),L()?I.commit($):I.commit($,!0)});const ct=ie((he,Ve)=>{if(a?.(he,Ve),!Ve.isCanceled&&(J(he),!he&&(Ve.reason===sn||Ve.reason===Do)&&(N(!0),F(!1),S==="onBlur"&&I.commit($)),!he&&se.state.activeIndex!==null)){const ze=z.current[se.state.activeIndex];queueMicrotask(()=>{ze?.setAttribute("tabindex","-1")})}}),we=ie(()=>{U(!1),se.set("activeIndex",null),ge(),y?.(!1)});Ft({enabled:!h,open:V,ref:ee,onComplete(){V||we()}}),d.useImperativeHandle(h,()=>({unmount:we}),[we]);const me=ie((he,Ve)=>{r?.(he,Ve),!Ve.isCanceled&&_(he)}),ke=ie(()=>{const he=se.state.listElement||ee.current;if(!he)return;const Ve=he.scrollTop,ze=he.scrollTop+he.clientHeight,je=Ve>1,Ge=ze<he.scrollHeight-1;se.state.scrollUpArrowVisible!==je&&se.set("scrollUpArrowVisible",je),se.state.scrollDownArrowVisible!==Ge&&se.set("scrollDownArrowVisible",Ge)}),Se=Qa({open:V,onOpenChange:ct,elements:{reference:Be,floating:Ce}}),Ne=Bo(Se,{enabled:!l&&!H,event:"mousedown"}),Fe=es(Se,{bubbles:!1}),He=ol(Se,{enabled:!l&&!H,listRef:z,activeIndex:Ee,selectedIndex:De,disabledIndices:Yt,onNavigate(he){he===null&&!V||se.set("activeIndex",he)},focusItemOnHover:!1}),Qe=sl(Se,{enabled:!l&&!H&&(V||!v),listRef:Y,activeIndex:Ee,selectedIndex:De,onMatch(he){V?se.set("activeIndex",he):me(O.current[he],xe("none"))},onTypingChange(he){W.current=he}}),{getReferenceProps:ot,getFloatingProps:it,getItemProps:be}=Pn([Ne,Fe,He,Qe]),_e=d.useMemo(()=>$t(ot(),oe,M?{id:M}:Ye),[ot,oe,M]);is(()=>{se.update({popupProps:it(),triggerProps:_e})}),le(()=>{se.update({id:M,modal:m,multiple:v,value:$,open:V,mounted:q,transitionStatus:ne,popupProps:it(),triggerProps:_e,items:b,itemToStringLabel:R,itemToStringValue:x,isItemEqualToValue:w,openMethod:j})},[se,M,m,v,$,V,q,ne,it,_e,b,R,x,w,j]);const We=d.useMemo(()=>({store:se,name:Z,required:p,disabled:H,readOnly:l,multiple:v,itemToStringLabel:R,itemToStringValue:x,highlightItemOnHover:E,setValue:me,setOpen:ct,listRef:z,popupRef:ee,scrollHandlerRef:Q,handleScrollArrowVisibility:ke,scrollArrowsMountedCountRef:pe,getItemProps:be,events:Se.context.events,valueRef:re,valuesRef:O,labelsRef:Y,typingRef:W,selectionRef:X,selectedItemTextRef:ue,validation:I,onOpenChangeComplete:y,keyboardActiveRef:K,alignItemWithTriggerActiveRef:G,initialValueRef:Ke}),[se,Z,p,H,l,v,R,x,E,me,ct,be,Se.context.events,I,y,ke]),Xe=Ct(g,I.inputRef),xt=v&&Array.isArray($)&&$.length>0,$e=d.useMemo(()=>!v||!Array.isArray($)||!Z?null:$.map(he=>{const Ve=dn(he,x);return ce.jsx("input",{type:"hidden",name:Z,value:Ve},Ve)}),[v,$,Z,x]);return ce.jsx(Il.Provider,{value:We,children:ce.jsxs(Ml.Provider,{value:Se,children:[C,ce.jsx("input",{...I.getInputValidationProps({onFocus(){se.state.triggerElement?.focus({focusVisible:!0})},onChange(he){if(he.nativeEvent.defaultPrevented)return;const Ve=he.target.value,ze=xe(rn,he.nativeEvent);function je(){if(v)return;const Ge=O.current.find(ut=>dn(ut,x).toLowerCase()===Ve.toLowerCase());Ge!=null&&(A(Ge!==k.initialValue),me(Ge,ze),L()&&I.commit(Ge))}se.set("forceMount",!0),queueMicrotask(je)}}),name:v?void 0:Z,autoComplete:c,value:Te,disabled:H,required:p&&!xt,readOnly:l,ref:Xe,style:Z?ka:Vo,tabIndex:-1,"aria-hidden":!0}),$e]})})}const co=2,Dg=400,mi=200,Ng={...bo,...fs,value:()=>null},Lm=d.forwardRef(function(t,n){const{render:o,className:r,id:s,disabled:i=!1,nativeButton:a=!0,...u}=t,{setTouched:c,setFocused:f,validationMode:l,state:p,disabled:m}=Yo(),{labelId:h}=gs(),{store:g,setOpen:y,selectionRef:b,validation:v,readOnly:R,required:x,alignItemWithTriggerActiveRef:w,disabled:E,keyboardActiveRef:C}=kt(),T=m||E||i,A=ve(g,ye.open),N=ve(g,ye.value),F=ve(g,ye.triggerProps),L=ve(g,ye.positionerElement),k=ve(g,ye.listElement),P=ve(g,ye.id),B=ve(g,ye.hasSelectedValue),D=!B&&A,I=ve(g,ye.hasNullItemLabel,D),S=s??P;Pl({id:S});const M=nt(L),H=d.useRef(null),{getButtonProps:Z,buttonRef:$}=Nt({disabled:T,native:a}),_=ie(O=>{g.set("triggerElement",O)}),V=Ct(n,H,$,_),J=Ze(),z=Ze(),Y=Ze(),ee=Ze();d.useEffect(()=>{if(A)return!(B||I)?Y.start(Dg,()=>{b.current.allowUnselectedMouseUp=!0,b.current.allowSelectedMouseUp=!0}):ee.start(mi,()=>{b.current.allowUnselectedMouseUp=!0,Y.start(mi,()=>{b.current.allowSelectedMouseUp=!0})}),()=>{Y.clear(),ee.clear()};b.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},z.clear()},[A,B,I,b,z,Y,ee]);const Q=d.useMemo(()=>k?.id??_n(L)?.id,[k,L]),pe=$t(F,{id:S,role:"combobox","aria-expanded":A?"true":"false","aria-haspopup":"listbox","aria-controls":A?Q:void 0,"aria-labelledby":h,"aria-readonly":R||void 0,"aria-required":x||void 0,tabIndex:T?-1:0,ref:V,onFocus(O){f(!0),A&&w.current&&y(!1,xe(rn,O.nativeEvent)),J.start(0,()=>{g.set("forceMount",!0)})},onBlur(O){Re(L,O.relatedTarget)||(c(!0),f(!1),l==="onBlur"&&v.commit(N))},onPointerMove(){C.current=!1},onKeyDown(){C.current=!0},onMouseDown(O){if(A)return;const W=Pe(O.currentTarget);function K(ue){if(!H.current)return;const X=ue.target;if(Re(H.current,X)||Re(M.current,X)||X===H.current)return;const G=yl(H.current);ue.clientX>=G.left-co&&ue.clientX<=G.right+co&&ue.clientY>=G.top-co&&ue.clientY<=G.bottom+co||y(!1,xe(zr,ue))}z.start(0,()=>{W.addEventListener("mouseup",K,{once:!0})})}},v.getValidationProps,u,Z);pe.role="combobox";const re={...p,open:A,disabled:T,value:N,readOnly:R,placeholder:!B};return Ae("button",t,{ref:[n,H],state:re,stateAttributesMapping:Ng,props:pe})}),Fg={value:()=>null},Dm=d.forwardRef(function(t,n){const{className:o,render:r,children:s,placeholder:i,...a}=t,{store:u,valueRef:c}=kt(),f=ve(u,ye.value),l=ve(u,ye.items),p=ve(u,ye.itemToStringLabel),m=ve(u,ye.hasSelectedValue),h=!m&&i!=null&&s==null,g=ve(u,ye.hasNullItemLabel,h),y={value:f,placeholder:!m};let b=null;return typeof s=="function"?b=s(f):s!=null?b=s:!m&&i!=null&&!g?b=i:Array.isArray(f)?b=Lg(f,l,p):b=Al(f,l,p),Ae("span",t,{state:y,ref:[n,c],props:[{children:b},a],stateAttributesMapping:Fg})}),Nm=d.forwardRef(function(t,n){const{className:o,render:r,...s}=t,{store:i}=kt(),u={open:ve(i,ye.open)};return Ae("span",t,{state:u,ref:n,props:[{"aria-hidden":!0,children:"▼"},s],stateAttributesMapping:Hr})}),Vg=d.createContext(void 0),Fm=d.forwardRef(function(t,n){const{store:o}=kt(),r=ve(o,ye.mounted),s=ve(o,ye.forceMount);return r||s?ce.jsx(Vg.Provider,{value:!0,children:ce.jsx(Xr,{ref:n,...t})}):null}),Ll=d.createContext(void 0);function ms(){const e=d.useContext(Ll);if(!e)throw new Error(qe(59));return e}function ko(e,t){e&&Object.assign(e.style,t)}const Dl={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},Bg={position:"fixed"},Vm=d.forwardRef(function(t,n){const{anchor:o,positionMethod:r="absolute",className:s,render:i,side:a="bottom",align:u="center",sideOffset:c=0,alignOffset:f=0,collisionBoundary:l="clipping-ancestors",collisionPadding:p,arrowPadding:m=5,sticky:h=!1,disableAnchorTracking:g,alignItemWithTrigger:y=!0,collisionAvoidance:b=ki,...v}=t,{store:R,listRef:x,labelsRef:w,alignItemWithTriggerActiveRef:E,selectedItemTextRef:C,valuesRef:T,initialValueRef:A,popupRef:N,setValue:F}=kt(),L=kl(),k=ve(R,ye.open),P=ve(R,ye.mounted),B=ve(R,ye.modal),D=ve(R,ye.value),I=ve(R,ye.openMethod),S=ve(R,ye.positionerElement),M=ve(R,ye.triggerElement),H=ve(R,ye.isItemEqualToValue),Z=ve(R,ye.transitionStatus),$=d.useRef(null),_=d.useRef(null),[V,J]=d.useState(y),z=P&&V&&I!=="touch";!P&&V!==y&&J(y),le(()=>{P||(ye.scrollUpArrowVisible(R.state)&&R.set("scrollUpArrowVisible",!1),ye.scrollDownArrowVisible(R.state)&&R.set("scrollDownArrowVisible",!1))},[R,P]),d.useImperativeHandle(E,()=>z),as((z||B)&&k&&I!=="touch",M);const Y=pl({anchor:o,floatingRootContext:L,positionMethod:r,mounted:P,side:a,sideOffset:c,align:u,alignOffset:f,arrowPadding:m,collisionBoundary:l,collisionPadding:p,sticky:h,disableAnchorTracking:g??z,collisionAvoidance:b,keepMounted:!0}),ee=z?"none":Y.side,Q=z?Bg:Y.positionerStyles,pe=d.useMemo(()=>{const G={};return k||(G.pointerEvents="none"),{role:"presentation",hidden:!P,style:{...Q,...G}}},[k,P,Q]),re={open:k,side:ee,align:Y.align,anchorHidden:Y.anchorHidden},O=ie(G=>{R.set("positionerElement",G)}),W=Ae("div",t,{ref:[n,O],state:re,stateAttributesMapping:Cn,props:[pe,jo(Z),v]}),K=d.useRef(0),ue=ie(G=>{if(G.size===0&&K.current===0||T.current.length===0)return;const q=K.current;if(K.current=G.size,G.size===q)return;const U=xe(rn);if(q!==0&&!R.state.multiple&&D!==null&&Bn(T.current,D,H)===-1){const j=A.current,ge=j!=null&&Bn(T.current,j,H)!==-1?j:null;F(ge,U),ge===null&&(R.set("selectedIndex",null),C.current=null)}if(q!==0&&R.state.multiple&&Array.isArray(D)){const ne=oe=>Bn(T.current,oe,H)!==-1,j=D.filter(oe=>ne(oe));(j.length!==D.length||j.some(oe=>!kg(D,oe,H)))&&(F(j,U),j.length===0&&(R.set("selectedIndex",null),C.current=null))}if(k&&z){R.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const ne={height:""};ko(S,ne),ko(N.current,ne)}}),X=d.useMemo(()=>({...Y,side:ee,alignItemWithTriggerActive:z,setControlledAlignItemWithTrigger:J,scrollUpArrowRef:$,scrollDownArrowRef:_}),[Y,ee,z,J]);return ce.jsx($o,{elementsRef:x,labelsRef:w,onMapChange:ue,children:ce.jsxs(Ll.Provider,{value:X,children:[P&&B&&ce.jsx(ss,{inert:Uo(!k),cutout:M}),W]})})});function Nl(e){const t=e.currentTarget.getBoundingClientRect();return t.top+1<=e.clientY&&e.clientY<=t.bottom-1&&t.left+1<=e.clientX&&e.clientX<=t.right-1}const uo="base-ui-disable-scrollbar",Pr={className:uo,getElement(e){return ce.jsx("style",{nonce:e,href:uo,precedence:"base-ui:low",children:`.${uo}{scrollbar-width:none}.${uo}::-webkit-scrollbar{display:none}`})}};function cr(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}const Hg=d.createContext(void 0),_g={disableStyleElements:!1};function zg(){return d.useContext(Hg)??_g}const en=1,jg={...Cn,...cn},Bm=d.forwardRef(function(t,n){const{render:o,className:r,finalFocus:s,...i}=t,{store:a,popupRef:u,onOpenChangeComplete:c,setOpen:f,valueRef:l,selectedItemTextRef:p,keyboardActiveRef:m,multiple:h,handleScrollArrowVisibility:g,scrollHandlerRef:y,highlightItemOnHover:b}=kt(),{side:v,align:R,alignItemWithTriggerActive:x,setControlledAlignItemWithTrigger:w,scrollDownArrowRef:E,scrollUpArrowRef:C}=ms(),T=al()!=null,A=kl(),{nonce:N,disableStyleElements:F}=zg(),L=Ze(),k=ve(a,ye.id),P=ve(a,ye.open),B=ve(a,ye.mounted),D=ve(a,ye.popupProps),I=ve(a,ye.transitionStatus),S=ve(a,ye.triggerElement),M=ve(a,ye.positionerElement),H=ve(a,ye.listElement),Z=d.useRef(0),$=d.useRef(!1),_=d.useRef(0),V=d.useRef(!1),J=d.useRef({}),z=No(),Y=ie(re=>{if(!M||!u.current||!V.current)return;if($.current||!x){g();return}const O=M.style.top==="0px",W=M.style.bottom==="0px",K=M.getBoundingClientRect().height,ue=Pe(M),X=getComputedStyle(M),G=parseFloat(X.marginTop),q=parseFloat(X.marginBottom),U=hi(getComputedStyle(u.current)),ne=Math.min(ue.documentElement.clientHeight-G-q,U),j=re.scrollTop,oe=bi(re);let ge=0,se=null,Ee=!1,De=!1;const Be=Te=>{M.style.height=`${Te}px`},Ce=(Te,Me)=>{const Oe=cr(Te,0,ne-K);Oe>0&&Be(K+Oe),re.scrollTop=Me,ne-(K+Oe)<=en&&($.current=!0),g()};if(O){const Te=oe-j,Me=K+Te,Oe=Math.min(Me,ne);if(ge=Oe,Te<=en){Ce(Te,oe);return}ne-Oe>en?De=!0:Ee=!0}else if(W){const Te=j,Me=K+Te,Oe=Math.min(Me,ne),Ke=Me-ne;if(ge=Oe,Te<=en){Ce(Te,0);return}ne-Oe>en?se=0:(Ee=!0,j<oe&&(se=j-(Te-Ke)))}if(ge=Math.ceil(ge),ge!==0&&Be(ge),De||se!=null){const Te=bi(re),Me=De?Te:cr(se,0,Te);Math.abs(re.scrollTop-Me)>en&&(re.scrollTop=Me)}(Ee||ge>=ne-en)&&($.current=!0),g()});d.useImperativeHandle(y,()=>Y,[Y]),Ft({open:P,ref:u,onComplete(){P&&c?.(!0)}});const ee={open:P,transitionStatus:I,side:v,align:R};le(()=>{!M||!u.current||Object.keys(J.current).length||(J.current={top:M.style.top||"0",left:M.style.left||"0",right:M.style.right,height:M.style.height,bottom:M.style.bottom,minHeight:M.style.minHeight,maxHeight:M.style.maxHeight,marginTop:M.style.marginTop,marginBottom:M.style.marginBottom})},[u,M]),le(()=>{P||x||(V.current=!1,$.current=!1,Z.current=0,_.current=0,ko(M,J.current))},[P,x,M,u]),le(()=>{const re=u.current;if(!(!P||!S||!M||!re||a.state.transitionStatus==="ending")){if(!x){V.current=!0,z.request(g),re.style.removeProperty("--transform-origin");return}queueMicrotask(()=>{const O=Ug(re);re.style.removeProperty("--transform-origin");try{const W=getComputedStyle(M),K=getComputedStyle(re),ue=Pe(S),X=Je(M),G=S.getBoundingClientRect(),q=M.getBoundingClientRect(),U=G.left,ne=G.height,j=H||re,oe=j.scrollHeight,ge=parseFloat(K.borderBottomWidth),se=parseFloat(W.marginTop)||10,Ee=parseFloat(W.marginBottom)||10,De=parseFloat(W.minHeight)||100,Be=hi(K),Ce=5,Te=5,Me=20,Oe=ue.documentElement.clientHeight-se-Ee,Ke=ue.documentElement.clientWidth,ct=Oe-G.bottom+ne,we=p.current,me=l.current;let ke,Se=0,Ne=0;if(we&&me){const he=me.getBoundingClientRect();ke=we.getBoundingClientRect();const Ve=he.left-U,ze=ke.left-q.left,je=he.top-G.top+he.height/2,Ge=ke.top-q.top+ke.height/2;Se=Ve-ze,Ne=Ge-je}const Fe=ct+Ne+Ee+ge;let He=Math.min(Oe,Fe);const Qe=Oe-se-Ee,ot=Fe-He,it=Math.max(Ce,U+Se),be=Ke-Te,_e=Math.max(0,it+q.width-be);M.style.left=`${it-_e}px`,M.style.height=`${He}px`,M.style.maxHeight="auto",M.style.marginTop=`${se}px`,M.style.marginBottom=`${Ee}px`,re.style.height="100%";const We=j.scrollHeight-j.clientHeight,Xe=ot>=We;Xe&&(He=Math.min(Oe,q.height)-(ot-We));const xt=G.top<Me||G.bottom>Oe-Me||He<Math.min(oe,De),$e=(X.visualViewport?.scale??1)!==1&&Ur;if(xt||$e){V.current=!0,ko(M,J.current),At.flushSync(()=>w(!1));return}if(Xe){const he=Math.max(0,Oe-Fe);M.style.top=q.height>=Qe?"0":`${he}px`,M.style.height=`${He}px`,j.scrollTop=j.scrollHeight-j.clientHeight,Z.current=Math.max(De,He)}else M.style.bottom="0",Z.current=Math.max(De,He),j.scrollTop=ot;if(ke){const he=q.top,Ve=q.height,ze=ke.top+ke.height/2,je=Ve>0?(ze-he)/Ve*100:50,Ge=cr(je,0,100);re.style.setProperty("--transform-origin",`50% ${Ge}%`)}(Z.current===Oe||He>=Be)&&($.current=!0),g(),setTimeout(()=>{V.current=!0})}finally{O()}})}},[a,P,M,S,l,p,u,g,x,w,z,E,C,H]),d.useEffect(()=>{if(!x||!M||!P)return;const re=Je(M);function O(W){f(!1,xe(Eu,W))}return re.addEventListener("resize",O),()=>{re.removeEventListener("resize",O)}},[f,x,M,P]);const Q={...H?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":h||void 0,id:`${k}-list`},onKeyDown(re){m.current=!0,T&&rs.has(re.key)&&re.stopPropagation()},onMouseMove(){m.current=!1},onPointerLeave(re){if(!b||Nl(re)||re.pointerType==="touch")return;const O=re.currentTarget;L.start(0,()=>{a.set("activeIndex",null),O.focus({preventScroll:!0})})},onScroll(re){H||Y(re.currentTarget)},...x&&{style:H?{height:"100%"}:Dl}},pe=Ae("div",t,{ref:[n,u],state:ee,stateAttributesMapping:jg,props:[D,Q,jo(I),{className:!H&&x?Pr.className:void 0},i]});return ce.jsxs(d.Fragment,{children:[!F&&Pr.getElement(N),ce.jsx(Jr,{context:A,modal:!1,disabled:!B,returnFocus:s,restoreFocus:!0,children:pe})]})});function hi(e){const t=e.maxHeight||"";return t.endsWith("px")&&parseFloat(t)||1/0}function bi(e){return Math.max(0,e.scrollHeight-e.clientHeight)}const yi=[["transform","none"],["scale","1"],["translate","0 0"]];function Ug(e){const{style:t}=e,n={};for(const[o,r]of yi)n[o]=t.getPropertyValue(o),t.setProperty(o,r,"important");return()=>{for(const[o]of yi){const r=n[o];r?t.setProperty(o,r):t.removeProperty(o)}}}const Hm=d.forwardRef(function(t,n){const{className:o,render:r,...s}=t,{store:i,scrollHandlerRef:a}=kt(),{alignItemWithTriggerActive:u}=ms(),c=ve(i,ye.hasScrollArrows),f=ve(i,ye.openMethod),l=ve(i,ye.multiple),m={id:`${ve(i,ye.id)}-list`,role:"listbox","aria-multiselectable":l||void 0,onScroll(g){a.current?.(g.currentTarget)},...u&&{style:Dl},className:c&&f!=="touch"?Pr.className:void 0},h=ie(g=>{i.set("listElement",g)});return Ae("div",t,{ref:[n,h],props:[m,s]})}),Fl=d.createContext(void 0);function hs(){const e=d.useContext(Fl);if(!e)throw new Error(qe(57));return e}const _m=d.memo(d.forwardRef(function(t,n){const{render:o,className:r,value:s=null,label:i,disabled:a=!1,nativeButton:u=!1,...c}=t,f=d.useRef(null),l=Wn({label:i,textRef:f,indexGuessBehavior:Xi.GuessFromOrder}),{store:p,getItemProps:m,setOpen:h,setValue:g,selectionRef:y,typingRef:b,valuesRef:v,keyboardActiveRef:R,multiple:x,highlightItemOnHover:w}=kt(),E=Ze(),C=ve(p,ye.isActive,l.index),T=ve(p,ye.isSelected,l.index,s),A=ve(p,ye.isSelectedByFocus,l.index),N=ve(p,ye.isItemEqualToValue),F=l.index,L=F!==-1,k=d.useRef(null),P=nt(F);le(()=>{if(!L)return;const z=v.current;return z[F]=s,()=>{delete z[F]}},[L,F,s,v]),le(()=>{if(!L)return;const z=p.state.value;let Y=z;x&&Array.isArray(z)&&z.length>0&&(Y=z[z.length-1]),Y!==void 0&&Tn(s,Y,N)&&p.set("selectedIndex",F)},[L,F,x,N,p,s]);const B={disabled:a,selected:T,highlighted:C},D=m({active:C,selected:T});D.onFocus=void 0,D.id=void 0;const I=d.useRef(null),S=d.useRef("mouse"),M=d.useRef(!1),{getButtonProps:H,buttonRef:Z}=Nt({disabled:a,focusableWhenDisabled:!0,native:u});function $(z){const Y=p.state.value;if(x){const ee=Array.isArray(Y)?Y:[],Q=T?Pg(ee,s,N):[...ee,s];g(Q,xe(Fn,z))}else g(s,xe(Fn,z)),h(!1,xe(Fn,z))}const _={role:"option","aria-selected":T,tabIndex:C?0:-1,onFocus(){p.set("activeIndex",F)},onMouseEnter(){!R.current&&p.state.selectedIndex===null&&w&&p.set("activeIndex",F)},onMouseMove(){w&&p.set("activeIndex",F)},onMouseLeave(z){!w||R.current||Nl(z)||E.start(0,()=>{p.state.activeIndex===F&&p.set("activeIndex",null)})},onTouchStart(){y.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(z){I.current=z.key,p.set("activeIndex",F)},onClick(z){M.current=!1,!(z.type==="keydown"&&I.current===null)&&(a||I.current===" "&&b.current||S.current!=="touch"&&!C||(I.current=null,$(z.nativeEvent)))},onPointerEnter(z){S.current=z.pointerType},onPointerDown(z){S.current=z.pointerType,M.current=!0},onMouseUp(z){if(a)return;if(M.current){M.current=!1;return}const Y=!y.current.allowSelectedMouseUp&&T,ee=!y.current.allowUnselectedMouseUp&&!T;Y||ee||S.current!=="touch"&&!C||$(z.nativeEvent)}},V=Ae("div",t,{ref:[Z,n,l.ref,k],state:B,props:[D,_,c,H]}),J=d.useMemo(()=>({selected:T,indexRef:P,textRef:f,selectedByFocus:A,hasRegistered:L}),[T,P,f,A,L]);return ce.jsx(Fl.Provider,{value:J,children:V})})),zm=d.forwardRef(function(t,n){const o=t.keepMounted??!1,{selected:r}=hs();return o||r?ce.jsx(Wg,{...t,ref:n}):null}),Wg=d.memo(d.forwardRef((e,t)=>{const{render:n,className:o,keepMounted:r,...s}=e,{selected:i}=hs(),a=d.useRef(null),{transitionStatus:u,setMounted:c}=In(i),l=Ae("span",e,{ref:[t,a],state:{selected:i,transitionStatus:u},props:[{"aria-hidden":!0,children:"✔️"},s],stateAttributesMapping:cn});return Ft({open:i,ref:a,onComplete(){i||c(!1)}}),l})),jm=d.memo(d.forwardRef(function(t,n){const{indexRef:o,textRef:r,selectedByFocus:s,hasRegistered:i}=hs(),{selectedItemTextRef:a}=kt(),{className:u,render:c,...f}=t,l=d.useCallback(m=>{if(!m||!i)return;const h=a.current===null||!a.current.isConnected;(s||h&&o.current===0)&&(a.current=m)},[a,o,s,i]);return Ae("div",t,{ref:[l,n,r],props:f})})),Vl=d.forwardRef(function(t,n){const{render:o,className:r,direction:s,keepMounted:i=!1,...a}=t,{store:u,popupRef:c,listRef:f,handleScrollArrowVisibility:l,scrollArrowsMountedCountRef:p}=kt(),{side:m,scrollDownArrowRef:h,scrollUpArrowRef:g}=ms(),y=s==="up"?ye.scrollUpArrowVisible:ye.scrollDownArrowVisible,b=ve(u,y),v=ve(u,ye.openMethod),R=b&&v!=="touch",x=Ze(),w=s==="up"?g:h,{transitionStatus:E,setMounted:C}=In(R);le(()=>(p.current+=1,u.state.hasScrollArrows||u.set("hasScrollArrows",!0),()=>{p.current=Math.max(0,p.current-1),p.current===0&&u.state.hasScrollArrows&&u.set("hasScrollArrows",!1)}),[u,p]),Ft({open:R,ref:w,onComplete(){R||C(!1)}});const N=Ae("div",t,{ref:[n,w],state:{direction:s,visible:R,side:m,transitionStatus:E},props:[{"aria-hidden":!0,children:s==="up"?"▲":"▼",style:{position:"absolute"},onMouseMove(L){if(L.movementX===0&&L.movementY===0||x.isStarted())return;u.set("activeIndex",null);function k(){const P=u.state.listElement??c.current;if(!P)return;u.set("activeIndex",null),l();const B=P.scrollTop===0,D=Math.round(P.scrollTop+P.clientHeight)>=P.scrollHeight;if(f.current.length===0&&(s==="up"?u.set("scrollUpArrowVisible",!B):u.set("scrollDownArrowVisible",!D)),s==="up"&&B||s==="down"&&D){x.clear();return}if((u.state.listElement||c.current)&&f.current&&f.current.length>0){const S=f.current,M=w.current?.offsetHeight||0;if(s==="up"){let H=0;const Z=P.scrollTop+M;for(let _=0;_<S.length;_+=1){const V=S[_];if(V&&V.offsetTop>=Z){H=_;break}}const $=Math.max(0,H-1);if($<H){const _=S[$];_&&(P.scrollTop=Math.max(0,_.offsetTop-M))}else P.scrollTop=0}else{let H=S.length-1;const Z=P.scrollTop+P.clientHeight-M;for(let _=0;_<S.length;_+=1){const V=S[_];if(V&&V.offsetTop+V.offsetHeight>Z){H=Math.max(0,_-1);break}}const $=Math.min(S.length-1,H+1);if($>H){const _=S[$];_&&(P.scrollTop=_.offsetTop+_.offsetHeight-P.clientHeight+M)}else P.scrollTop=P.scrollHeight-P.clientHeight}}x.start(40,k)}x.start(40,k)},onMouseLeave(){x.clear()}},a]});return R||i?N:null}),Um=d.forwardRef(function(t,n){return ce.jsx(Vl,{...t,ref:n,direction:"down"})}),Wm=d.forwardRef(function(t,n){return ce.jsx(Vl,{...t,ref:n,direction:"up"})});function $m(e){const{children:t,open:n,defaultOpen:o=!1,onOpenChange:r,onOpenChangeComplete:s,disablePointerDismissal:i=!1,modal:a=!0,actionsRef:u,handle:c,triggerId:f,defaultTriggerId:l=null}=e,p=Bt(!0),m=!!p,h=tt(()=>c?.store??new wl({open:o,openProp:n,activeTriggerId:l,triggerIdProp:f,modal:a,disablePointerDismissal:i,nested:m})).current;is(()=>{n===void 0&&h.state.open===!1&&o===!0&&h.update({open:!0,activeTriggerId:l})}),h.useControlledProp("openProp",n),h.useControlledProp("triggerIdProp",f),h.useSyncedValues({disablePointerDismissal:i,nested:m,modal:a}),h.useContextCallback("onOpenChange",r),h.useContextCallback("onOpenChangeComplete",s);const g=h.useState("payload");xl({store:h,actionsRef:u,parentContext:p?.store.context});const y=d.useMemo(()=>({store:h}),[h]);return ce.jsx(ds.Provider,{value:y,children:typeof t=="function"?t({payload:g}):t})}var $g=(e,t,n,o,r,s,i,a)=>{let u=document.documentElement,c=["light","dark"];function f(m){(Array.isArray(e)?e:[e]).forEach(h=>{let g=h==="class",y=g&&s?r.map(b=>s[b]||b):r;g?(u.classList.remove(...y),u.classList.add(s&&s[m]?s[m]:m)):u.setAttribute(h,m)}),l(m)}function l(m){a&&c.includes(m)&&(u.style.colorScheme=m)}function p(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(o)f(o);else try{let m=localStorage.getItem(t)||n,h=i&&m==="system"?p():m;f(h)}catch{}},Yg=d.createContext(void 0),Kg={setTheme:e=>{},themes:[]},Ym=()=>{var e;return(e=d.useContext(Yg))!=null?e:Kg};d.memo(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:o,enableColorScheme:r,defaultTheme:s,value:i,themes:a,nonce:u,scriptProps:c})=>{let f=JSON.stringify([n,t,s,e,a,i,o,r]).slice(1,-1);return d.createElement("script",{...c,suppressHydrationWarning:!0,nonce:typeof window>"u"?u:"",dangerouslySetInnerHTML:{__html:`(${$g.toString()})(${f})`}})});const Bl=d.createContext(void 0);function bs(){const e=d.useContext(Bl);if(e===void 0)throw new Error(qe(64));return e}let Gg=(function(e){return e.activationDirection="data-activation-direction",e.orientation="data-orientation",e})({});const ys={tabActivationDirection:e=>({[Gg.activationDirection]:e})},Km=d.forwardRef(function(t,n){const{className:o,defaultValue:r=0,onValueChange:s,orientation:i="horizontal",render:a,value:u,...c}=t,f=Wo(),l=Object.hasOwn(t,"defaultValue"),p=d.useRef([]),[m,h]=d.useState(()=>new Map),[g,y]=yo({controlled:u,default:r,name:"Tabs",state:"value"}),b=u!==void 0,[v,R]=d.useState(()=>new Map),[x,w]=d.useState("none"),E=ie((I,S)=>{s?.(I,S),!S.isCanceled&&(y(I),w(S.activationDirection))}),C=ie((I,S)=>{h(M=>{if(M.get(I)===S)return M;const H=new Map(M);return H.set(I,S),H})}),T=ie((I,S)=>{h(M=>{if(!M.has(I)||M.get(I)!==S)return M;const H=new Map(M);return H.delete(I),H})}),A=d.useCallback(I=>m.get(I),[m]),N=d.useCallback(I=>{for(const S of v.values())if(I===S?.value)return S?.id},[v]),F=d.useCallback(I=>{if(I===void 0)return null;for(const[S,M]of v.entries())if(M!=null&&I===(M.value??M.index))return S;return null},[v]),L=d.useMemo(()=>({direction:f,getTabElementBySelectedValue:F,getTabIdByPanelValue:N,getTabPanelIdByValue:A,onValueChange:E,orientation:i,registerMountedTabPanel:C,setTabMap:R,unregisterMountedTabPanel:T,tabActivationDirection:x,value:g}),[f,F,N,A,E,i,C,R,T,x,g]),k=d.useMemo(()=>{for(const I of v.values())if(I!=null&&I.value===g)return I},[v,g]),P=d.useMemo(()=>{for(const I of v.values())if(I!=null&&!I.disabled)return I.value},[v]);le(()=>{if(b||v.size===0)return;const I=k?.disabled,S=k==null&&g!==null;if(l&&I&&g===r||!I&&!S)return;const H=P??null;g!==H&&(y(H),w("none"))},[r,P,l,b,k,w,y,v,g]);const D=Ae("div",t,{state:{orientation:i,tabActivationDirection:x},ref:n,props:c,stateAttributesMapping:ys});return ce.jsx(Bl.Provider,{value:L,children:ce.jsx($o,{elementsRef:p,children:D})})}),Hl="data-composite-item-active",_l=d.createContext(void 0);function qg(){const e=d.useContext(_l);if(e===void 0)throw new Error(qe(65));return e}const Gm=d.forwardRef(function(t,n){const{className:o,disabled:r=!1,render:s,value:i,id:a,nativeButton:u=!0,...c}=t,{value:f,getTabPanelIdByValue:l,orientation:p}=bs(),{activateOnFocus:m,highlightedTabIndex:h,onTabActivation:g,setHighlightedTabIndex:y,tabsListElement:b}=qg(),v=yt(a),R=d.useMemo(()=>({disabled:r,id:v,value:i}),[r,v,i]),{compositeProps:x,compositeRef:w,index:E}=vl({metadata:R}),C=i===f,T=d.useRef(!1);le(()=>{if(T.current){T.current=!1;return}if(!(C&&E>-1&&h!==E))return;const M=b;if(M!=null){const H=ht(Pe(M));if(H&&Re(M,H))return}r||y(E)},[C,E,h,y,r,b]);const{getButtonProps:A,buttonRef:N}=Nt({disabled:r,native:u,focusableWhenDisabled:!0}),F=l(i),L=d.useRef(!1),k=d.useRef(!1);function P(M){C||r||g(i,xe(rn,M.nativeEvent,void 0,{activationDirection:"none"}))}function B(M){C||(E>-1&&!r&&y(E),!r&&m&&(!L.current||L.current&&k.current)&&g(i,xe(rn,M.nativeEvent,void 0,{activationDirection:"none"})))}function D(M){if(C||r)return;L.current=!0;function H(){L.current=!1,k.current=!1}(!M.button||M.button===0)&&(k.current=!0,Pe(M.currentTarget).addEventListener("pointerup",H,{once:!0}))}return Ae("button",t,{state:{disabled:r,active:C,orientation:p},ref:[n,N,w],props:[x,{role:"tab","aria-controls":F,"aria-selected":C,id:v,onClick:P,onFocus:B,onPointerDown:D,[Hl]:C?"":void 0,onKeyDownCapture(){T.current=!0}},c,A]})});let Xg=(function(e){return e.index="data-index",e.activationDirection="data-activation-direction",e.orientation="data-orientation",e.hidden="data-hidden",e})({});const Zg={...ys,...cn},qm=d.forwardRef(function(t,n){const{className:o,value:r,render:s,keepMounted:i=!1,...a}=t,{value:u,getTabIdByPanelValue:c,orientation:f,tabActivationDirection:l,registerMountedTabPanel:p,unregisterMountedTabPanel:m}=bs(),h=yt(),g=d.useMemo(()=>({id:h,value:r}),[h,r]),{ref:y,index:b}=Wn({metadata:g}),v=r===u,{mounted:R,transitionStatus:x,setMounted:w}=In(v),E=!R,C=c(r),T={hidden:E,orientation:f,tabActivationDirection:l,transitionStatus:x},A=d.useRef(null),N=Ae("div",t,{state:T,ref:[n,y,A],props:[{"aria-labelledby":C,hidden:E,id:h,role:"tabpanel",tabIndex:v?0:-1,inert:Uo(!v),[Xg.index]:b},a],stateAttributesMapping:Zg});return Ft({open:v,ref:A,onComplete(){v||w(!1)}}),le(()=>{if(!(E&&!i)&&h!=null)return p(r,h),()=>{m(r,h)}},[E,i,r,h,p,m]),i||R?N:null});function Jg(e){return e==null||e.hasAttribute("disabled")||e.getAttribute("aria-disabled")==="true"}const Qg=[];function em(e){const{itemSizes:t,cols:n=1,loopFocus:o=!0,dense:r=!1,orientation:s="both",direction:i,highlightedIndex:a,onHighlightedIndexChange:u,rootRef:c,enableHomeAndEndKeys:f=!1,stopEventPropagation:l=!1,disabledIndices:p,modifierKeys:m=Qg}=e,[h,g]=d.useState(0),y=n>1,b=d.useRef(null),v=Ct(b,c),R=d.useRef([]),x=d.useRef(!1),w=a??h,E=ie((A,N=!1)=>{if((u??g)(A),N){const F=R.current[A];oi(b.current,F,i,s)}}),C=ie(A=>{if(A.size===0||x.current)return;x.current=!0;const N=Array.from(A.keys()),F=N.find(k=>k?.hasAttribute(Hl))??null,L=F?N.indexOf(F):-1;L!==-1&&E(L),oi(b.current,F,i,s)}),T=d.useMemo(()=>({"aria-orientation":s==="both"?void 0:s,ref:v,onFocus(A){!b.current||!ni(A.target)||A.target.setSelectionRange(0,A.target.value.length??0)},onKeyDown(A){const N=f?ap:ul;if(!N.has(A.key)||tm(A,m)||!b.current)return;const L=i==="rtl",k=L?jn:yn,P={horizontal:k,vertical:nn,both:k}[s],B=L?yn:jn,D={horizontal:B,vertical:bn,both:B}[s];if(ni(A.target)&&!Jg(A.target)){const _=A.target.selectionStart,V=A.target.selectionEnd,J=A.target.value??"";if(_==null||A.shiftKey||_!==V||A.key!==D&&_<J.length||A.key!==P&&_>0)return}let I=w;const S=go(R,p),M=Rr(R,p);if(y){const _=t||Array.from({length:R.current.length},()=>({width:1,height:1})),V=da(_,n,r),J=V.findIndex(Y=>Y!=null&&!Wt(R,Y,p)),z=V.reduce((Y,ee,Q)=>ee!=null&&!Wt(R,ee,p)?Q:Y,-1);I=V[ua({current:V.map(Y=>Y?R.current[Y]:null)},{event:A,orientation:s,loopFocus:o,cols:n,disabledIndices:pa([...p||R.current.map((Y,ee)=>Wt(R,ee)?ee:void 0),void 0],V),minIndex:J,maxIndex:z,prevIndex:fa(w>M?S:w,_,V,n,A.key===nn?"bl":A.key===yn?"tr":"tl"),rtl:L})]}const H={horizontal:[k],vertical:[nn],both:[k,nn]}[s],Z={horizontal:[B],vertical:[bn],both:[B,bn]}[s],$=y?N:{horizontal:f?sp:ll,vertical:f?ip:cl,both:N}[s];f&&(A.key===Kn?I=S:A.key===Gn&&(I=M)),I===w&&(H.includes(A.key)||Z.includes(A.key))&&(o&&I===M&&H.includes(A.key)?I=S:o&&I===S&&Z.includes(A.key)?I=M:I=rt(R,{startingIndex:I,decrement:Z.includes(A.key),disabledIndices:p})),I!==w&&!pn(R,I)&&(l&&A.stopPropagation(),$.has(A.key)&&A.preventDefault(),E(I,!0),queueMicrotask(()=>{R.current[I]?.focus()}))}}),[n,r,i,p,R,f,w,y,t,o,v,m,E,s,l]);return d.useMemo(()=>({props:T,highlightedIndex:w,onHighlightedIndexChange:E,elementsRef:R,disabledIndices:p,onMapChange:C,relayKeyboardEvent:T.onKeyDown}),[T,w,E,R,p,C])}function tm(e,t){for(const n of fp.values())if(!t.includes(n)&&e.getModifierState(n))return!0;return!1}function nm(e){const{render:t,className:n,refs:o=Yt,props:r=Yt,state:s=Ye,stateAttributesMapping:i,highlightedIndex:a,onHighlightedIndexChange:u,orientation:c,dense:f,itemSizes:l,loopFocus:p,cols:m,enableHomeAndEndKeys:h,onMapChange:g,stopEventPropagation:y=!0,rootRef:b,disabledIndices:v,modifierKeys:R,highlightItemOnHover:x=!1,tag:w="div",...E}=e,C=Wo(),{props:T,highlightedIndex:A,onHighlightedIndexChange:N,elementsRef:F,onMapChange:L,relayKeyboardEvent:k}=em({itemSizes:l,cols:m,loopFocus:p,dense:f,orientation:c,highlightedIndex:a,onHighlightedIndexChange:u,rootRef:b,stopEventPropagation:y,enableHomeAndEndKeys:h,direction:C,disabledIndices:v,modifierKeys:R}),P=Ae(w,e,{state:s,ref:o,props:[T,...r,E],stateAttributesMapping:i}),B=d.useMemo(()=>({highlightedIndex:A,onHighlightedIndexChange:N,highlightItemOnHover:x,relayKeyboardEvent:k}),[A,N,x,k]);return ce.jsx(Ti.Provider,{value:B,children:ce.jsx($o,{elementsRef:F,onMapChange:D=>{g?.(D),L(D)},children:P})})}const Xm=d.forwardRef(function(t,n){const{activateOnFocus:o=!1,className:r,loopFocus:s=!0,render:i,...a}=t,{getTabElementBySelectedValue:u,onValueChange:c,orientation:f,value:l,setTabMap:p,tabActivationDirection:m}=bs(),[h,g]=d.useState(0),[y,b]=d.useState(null),v=om(l,f,y,u),R=ie((C,T)=>{if(C!==l){const A=v(C);T.activationDirection=A,c(C,T)}}),x={orientation:f,tabActivationDirection:m},w={"aria-orientation":f==="vertical"?"vertical":void 0,role:"tablist"},E=d.useMemo(()=>({activateOnFocus:o,highlightedTabIndex:h,onTabActivation:R,setHighlightedTabIndex:g,tabsListElement:y,value:l}),[o,h,R,g,y,l]);return ce.jsx(_l.Provider,{value:E,children:ce.jsx(nm,{render:i,className:r,state:x,refs:[n,b],props:[w,a],stateAttributesMapping:ys,highlightedIndex:h,enableHomeAndEndKeys:!0,loopFocus:s,orientation:f,onHighlightedIndexChange:g,onMapChange:p,disabledIndices:Yt})})});function vi(e,t){const{left:n,top:o}=e.getBoundingClientRect(),{left:r,top:s}=t.getBoundingClientRect(),i=n-r,a=o-s;return{left:i,top:a}}function om(e,t,n,o){const[r,s]=d.useState(null);return le(()=>{if(e==null||n==null){s(null);return}const i=o(e);if(i==null){s(null);return}const{left:a,top:u}=vi(i,n);s(t==="horizontal"?a:u)},[t,o,n,e]),d.useCallback(i=>{if(i===e)return"none";if(i==null)return s(null),"none";if(i!=null&&n!=null){const a=o(i);if(a!=null){const{left:u,top:c}=vi(a,n);if(r==null)return s(t==="horizontal"?u:c),"none";if(t==="horizontal"){if(u<r)return s(u),"left";if(u>r)return s(u),"right"}else{if(c<r)return s(c),"up";if(c>r)return s(c),"down"}}}return"none"},[o,t,r,n,e])}export{xm as A,sm as B,ym as C,Sm as D,Fm as E,Vm as F,Bm as G,Hm as H,_m as I,jm as J,zm as K,Wm as L,bl as M,Um as N,$m as O,Ym as P,Km as Q,Xm as R,hm as S,km as T,Gm as U,qm as V,im as a,mm as b,Cc as c,fm as d,pm as e,dm as f,um as g,vm as h,gm as i,bm as j,lm as k,cm as l,Cm as m,Em as n,Rm as o,Tm as p,wm as q,Im as r,Mm as s,am as t,Pm as u,Om as v,Am as w,Lm as x,Nm as y,Dm as z};