import{r as p,a as sn,E as Ot,l as pe,R as B,D as cn,f as $e,b as he,F as ln,s as Dt,O as an,T as un,H as fn,B as Be,q as dn,w as mn,u as Re,p as pn,e as We,v as gn,g as He,i as Mt,I as hn,C as vn,A as wn,h as yn,k as ut}from "./index-y8OWP3zI.js";import{u as xn}from "./Text-RDjPAdg3.js";import{u as bn}from "./Views-WvrQ7LwQ.js";const Rn=()=>{};function En(e, t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||Rn: n=>{var r;n.key==="Escape"&&(e(n),(r=t.onTrigger)==null||r.call(t))}}const ft=["mousedown","touchstart"];function Cn(e, t, n){const r=p.useRef();return p.useEffect(()=>{const o= s=>{const{target:i}=s??{};if(Array.isArray(n)){const c=(i==null?void 0:i.hasAttribute("data-ignore-outside-clicks"))||!document.body.contains(i)&&i.tagName!=="HTML";n.every(a=>!!a&&!s.composedPath().includes(a))&&!c&&e()}else r.current&&!r.current.contains(i)&&e()};return(t||ft).forEach(s=>document.addEventListener(s,o)),()=>{(t||ft).forEach(s=>document.removeEventListener(s,o))}},[r,e,n]),r}const Pn=p.createContext({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function kt(){return p.useContext(Pn)}function Q(e){return St(e)?(e.nodeName||"").toLowerCase():"#document"}function V(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Z(e){var t;return(t=(St(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function St(e){return e instanceof Node||e instanceof V(e).Node}function N(e){return e instanceof Element||e instanceof V(e).Element}function K(e){return e instanceof HTMLElement||e instanceof V(e).HTMLElement}function Fe(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof V(e).ShadowRoot}function ve(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=z(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function An(e){return["table","td","th"].includes(Q(e))}function Ve(e){const t=Ke(),n=z(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function Tn(e){let t=re(e);for(; K(t)&&!ae(t);){if(Ve(t))return t;t=re(t)}return null}function Ke(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ae(e){return["html","body","#document"].includes(Q(e))}function z(e){return V(e).getComputedStyle(e)}function Ae(e){return N(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function re(e){if(Q(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Fe(e)&&e.host||Z(e);return Fe(t)?t.host:t}function Lt(e){const t=re(e);return ae(t)?e.ownerDocument?e.ownerDocument.body:e.body:K(t)&&ve(t)?t:Lt(t)}function J(e, t, n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Lt(e),s=o===((r=e.ownerDocument)==null?void 0:r.body),i=V(o);return s?t.concat(i,i.visualViewport||[],ve(o)?o:[],i.frameElement&&n?J(i.frameElement):[]):t.concat(o,J(o,[],n))}function dt(e){let t=e.activeElement;for(; ((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function ge(e, t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Fe(n)){let r=t;for(; r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function It(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Ft(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function On(e){return kn()?!1:!mt()&&e.width===0&&e.height===0||mt()&&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 Dn(){return/apple/i.test(navigator.vendor)}function mt(){const e=/android/i;return e.test(It())||e.test(Ft())}function Mn(){return It().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function kn(){return Ft().includes("jsdom/")}function _t(e, t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Sn(e){return"nativeEvent"in e}function Ln(e){return e.matches("html,body")}function ne(e){return(e==null?void 0:e.ownerDocument)||document}function ke(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 ie(e){return"composedPath"in e?e.composedPath()[0]:e.target}const In="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Fn(e){return K(e)&&e.matches(In)}const j=Math.min,$=Math.max,Ee=Math.round,ye=Math.floor,ee= e=>({x:e,y:e}),_n={left:"right",right:"left",bottom:"top",top:"bottom"},Nn={start:"end",end:"start"};function _e(e, t, n){return $(e,j(t,n))}function q(e, t){return typeof e=="function"?e(t):e}function Y(e){return e.split("-")[0]}function fe(e){return e.split("-")[1]}function ze(e){return e==="x"?"y":"x"}function je(e){return e==="y"?"height":"width"}function se(e){return["top","bottom"].includes(Y(e))?"y":"x"}function Ye(e){return ze(se(e))}function $n(e, t, n){n===void 0&&(n=!1);const r=fe(e),o=Ye(e),s=je(o);let i=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(i=Ce(i)),[i,Ce(i)]}function Bn(e){const t=Ce(e);return[Ne(e),t,Ne(t)]}function Ne(e){return e.replace(/start|end/g, t=>Nn[t])}function Wn(e, t, n){const r=["left","right"],o=["right","left"],s=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?s:i;default:return[]}}function Hn(e, t, n, r){const o=fe(e);let s=Wn(Y(e),n==="start",r);return o&&(s=s.map(i=>i+"-"+o),t&&(s=s.concat(s.map(Ne)))),s}function Ce(e){return e.replace(/left|right|bottom|top/g, t=>_n[t])}function Vn(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ge(e){return typeof e!="number"?Vn(e):{top:e,right:e,bottom:e,left:e}}function ue(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function pt(e, t, n){let{reference:r,floating:o}=e;const s=se(t),i=Ye(t),c=je(i),l=Y(t),a=s==="y",m=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,u=r[c]/2-o[c]/2;let d;switch(l){case"top":d={x:m,y:r.y-o.height};break;case"bottom":d={x:m,y:r.y+r.height};break;case"right":d={x:r.x+r.width,y:f};break;case"left":d={x:r.x-o.width,y:f};break;default:d={x:r.x,y:r.y}}switch(fe(t)){case"start":d[i]-=u*(n&&a?-1:1);break;case"end":d[i]+=u*(n&&a?-1:1);break}return d}const Kn=async(e, t, n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:s=[],platform:i}=n,c=s.filter(Boolean),l=await(i.isRTL==null?void 0:i.isRTL(t));let a=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:m,y:f}=pt(a,r,l),u=r,d={},g=0;for(let h=0; h<c.length; h++){const{name:R,fn:x}=c[h],{x:E,y:C,data:b,reset:w}=await x({x:m,y:f,initialPlacement:r,placement:u,strategy:o,middlewareData:d,rects:a,platform:i,elements:{reference:e,floating:t}});m=E??m,f=C??f,d={...d,[R]:{...d[R],...b}},w&&g<=50&&(g++,typeof w=="object"&&(w.placement&&(u=w.placement),w.rects&&(a=w.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:o}):w.rects),{x:m,y:f}=pt(a,u,l)),h=-1)}return{x:m,y:f,placement:u,strategy:o,middlewareData:d}};async function Ue(e, t){var n;t===void 0&&(t={});const{x:r,y:o,platform:s,rects:i,elements:c,strategy:l}=e,{boundary:a="clippingAncestors",rootBoundary:m="viewport",elementContext:f="floating",altBoundary:u=!1,padding:d=0}=q(t,e),g=Ge(d),R=c[u?f==="floating"?"reference":"floating":f],x=ue(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(R)))==null||n?R:R.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:a,rootBoundary:m,strategy:l})),E=f==="floating"?{...i.floating,x:r,y:o}:i.reference,C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),b=await(s.isElement==null?void 0:s.isElement(C))?await(s.getScale==null?void 0:s.getScale(C))||{x:1,y:1}:{x:1,y:1},w=ue(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:E,offsetParent:C,strategy:l}):E);return{top:(x.top-w.top+g.top)/b.y,bottom:(w.bottom-x.bottom+g.bottom)/b.y,left:(x.left-w.left+g.left)/b.x,right:(w.right-x.right+g.right)/b.x}}const zn= e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:s,platform:i,elements:c,middlewareData:l}=t,{element:a,padding:m=0}=q(e,t)||{};if(a==null)return{};const f=Ge(m),u={x:n,y:r},d=Ye(o),g=je(d),h=await i.getDimensions(a),R=d==="y",x=R?"top":"left",E=R?"bottom":"right",C=R?"clientHeight":"clientWidth",b=s.reference[g]+s.reference[d]-u[d]-s.floating[g],w=u[d]-s.reference[d],A=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a));let D=A?A[C]:0;(!D||!await(i.isElement==null?void 0:i.isElement(A)))&&(D=c.floating[C]||s.floating[g]);const L=b/2-w/2,F=D/2-h[g]/2-1,k=j(f[x],F),S=j(f[E],F),M=k,I=D-h[g]-S,O=D/2-h[g]/2+L,v=_e(M,O,I),T=!l.arrow&&fe(o)!=null&&O!==v&&s.reference[g]/2-(O<M?k:S)-h[g]/2<0,P=T?O<M?O-M:O-I:0;return{[d]:u[d]+P,data:{[d]:v,centerOffset:O-v-P,...T&&{alignmentOffset:P}},reset:T}}}),jn=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:s,rects:i,initialPlacement:c,platform:l,elements:a}=t,{mainAxis:m=!0,crossAxis:f=!0,fallbackPlacements:u,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:h=!0,...R}=q(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const x=Y(o),E=Y(c)===c,C=await(l.isRTL==null?void 0:l.isRTL(a.floating)),b=u||(E||!h?[Ce(c)]:Bn(c));!u&&g!=="none"&&b.push(...Hn(c,h,g,C));const w=[c,...b],A=await Ue(t,R),D=[];let L=((r=s.flip)==null?void 0:r.overflows)||[];if(m&&D.push(A[x]),f){const M=$n(o,i,C);D.push(A[M[0]],A[M[1]])}if(L=[...L,{placement:o,overflows:D}],!D.every(M=>M<=0)){var F,k;const M=(((F=s.flip)==null?void 0:F.index)||0)+1,I=w[M];if(I)return{data:{index:M,overflows:L},reset:{placement:I}};let O=(k=L.filter(v=>v.overflows[0]<=0).sort((v, T)=>v.overflows[1]-T.overflows[1])[0])==null?void 0:k.placement;if(!O)switch(d){case"bestFit":{var S;const v=(S=L.map(T=>[T.placement,T.overflows.filter(P=>P>0).reduce((P, y)=>P+y,0)]).sort((T, P)=>T[1]-P[1])[0])==null?void 0:S[0];v&&(O=v);break}case"initialPlacement":O=c;break}if(o!==O)return{reset:{placement:O}}}return{}}}};function Nt(e){const t=j(...e.map(s=>s.left)),n=j(...e.map(s=>s.top)),r=$(...e.map(s=>s.right)),o=$(...e.map(s=>s.bottom));return{x:t,y:n,width:r-t,height:o-n}}function Yn(e){const t=e.slice().sort((o, s)=>o.y-s.y),n=[];let r=null;for(let o=0; o<t.length; o++){const s=t[o];!r||s.y-r.y>r.height/2?n.push([s]):n[n.length-1].push(s),r=s}return n.map(o=>ue(Nt(o)))}const Gn=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:s,strategy:i}=t,{padding:c=2,x:l,y:a}=q(e,t),m=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(r.reference))||[]),f=Yn(m),u=ue(Nt(m)),d=Ge(c);function g(){if(f.length===2&&f[0].left>f[1].right&&l!=null&&a!=null)return f.find(R=>l>R.left-d.left&&l<R.right+d.right&&a>R.top-d.top&&a<R.bottom+d.bottom)||u;if(f.length>=2){if(se(n)==="y"){const k=f[0],S=f[f.length-1],M=Y(n)==="top",I=k.top,O=S.bottom,v=M?k.left:S.left,T=M?k.right:S.right,P=T-v,y=O-I;return{top:I,bottom:O,left:v,right:T,width:P,height:y,x:v,y:I}}const R=Y(n)==="left",x=$(...f.map(k=>k.right)),E=j(...f.map(k=>k.left)),C=f.filter(k=>R?k.left===E:k.right===x),b=C[0].top,w=C[C.length-1].bottom,A=E,D=x,L=D-A,F=w-b;return{top:b,bottom:w,left:A,right:D,width:L,height:F,x:A,y:b}}return u}const h=await s.getElementRects({reference:{getBoundingClientRect:g},floating:r.floating,strategy:i});return o.reference.x!==h.reference.x||o.reference.y!==h.reference.y||o.reference.width!==h.reference.width||o.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}};async function Un(e, t){const{placement:n,platform:r,elements:o}=e,s=await(r.isRTL==null?void 0:r.isRTL(o.floating)),i=Y(n),c=fe(n),l=se(n)==="y",a=["left","top"].includes(i)?-1:1,m=s&&l?-1:1,f=q(t,e);let{mainAxis:u,crossAxis:d,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return c&&typeof g=="number"&&(d=c==="end"?g*-1:g),l?{x:d*m,y:u*a}:{x:u*a,y:d*m}}const Xn=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:s,placement:i,middlewareData:c}=t,l=await Un(t,e);return i===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:i}}}}},qn=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:s=!0,crossAxis:i=!1,limiter:c={fn: R=>{let{x,y:E}=R;return{x,y:E}}},...l}=q(e,t),a={x:n,y:r},m=await Ue(t,l),f=se(Y(o)),u=ze(f);let d=a[u],g=a[f];if(s){const R=u==="y"?"top":"left",x=u==="y"?"bottom":"right",E=d+m[R],C=d-m[x];d=_e(E,d,C)}if(i){const R=f==="y"?"top":"left",x=f==="y"?"bottom":"right",E=g+m[R],C=g-m[x];g=_e(E,g,C)}const h=c.fn({...t,[u]:d,[f]:g});return{...h,data:{x:h.x-n,y:h.y-r}}}}},Zn=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:s,middlewareData:i}=t,{offset:c=0,mainAxis:l=!0,crossAxis:a=!0}=q(e,t),m={x:n,y:r},f=se(o),u=ze(f);let d=m[u],g=m[f];const h=q(c,t),R=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(l){const C=u==="y"?"height":"width",b=s.reference[u]-s.floating[C]+R.mainAxis,w=s.reference[u]+s.reference[C]-R.mainAxis;d<b?d=b:d>w&&(d=w)}if(a){var x,E;const C=u==="y"?"width":"height",b=["top","left"].includes(Y(o)),w=s.reference[f]-s.floating[C]+(b&&((x=i.offset)==null?void 0:x[f])||0)+(b?0:R.crossAxis),A=s.reference[f]+s.reference[C]+(b?0:((E=i.offset)==null?void 0:E[f])||0)-(b?R.crossAxis:0);g<w?g=w:g>A&&(g=A)}return{[u]:d,[f]:g}}}},Jn=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:s}=t,{apply:i=()=>{},...c}=q(e,t),l=await Ue(t,c),a=Y(n),m=fe(n),f=se(n)==="y",{width:u,height:d}=r.floating;let g,h;a==="top"||a==="bottom"?(g=a,h=m===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(h=a,g=m==="end"?"top":"bottom");const R=d-l[g],x=u-l[h],E=!t.middlewareData.shift;let C=R,b=x;if(f){const A=u-l.left-l.right;b=m||E?j(x,A):A}else{const A=d-l.top-l.bottom;C=m||E?j(R,A):A}if(E&&!m){const A=$(l.left,0),D=$(l.right,0),L=$(l.top,0),F=$(l.bottom,0);f?b=u-2*(A!==0||D!==0?A+D:$(l.left,l.right)):C=d-2*(L!==0||F!==0?L+F:$(l.top,l.bottom))}await i({...t,availableWidth:b,availableHeight:C});const w=await o.getDimensions(s.floating);return u!==w.width||d!==w.height?{reset:{rects:!0}}:{}}}};function $t(e){const t=z(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=K(e),s=o?e.offsetWidth:n,i=o?e.offsetHeight:r,c=Ee(n)!==s||Ee(r)!==i;return c&&(n=s,r=i),{width:n,height:r,$:c}}function Xe(e){return N(e)?e:e.contextElement}function le(e){const t=Xe(e);if(!K(t))return ee(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:s}=$t(t);let i=(s?Ee(n.width):n.width)/r,c=(s?Ee(n.height):n.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const Qn=ee(0);function Bt(e){const t=V(e);return!Ke()||!t.visualViewport?Qn:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function er(e, t, n){return t===void 0&&(t=!1),!n||t&&n!==V(e)?!1:t}function oe(e, t, n, r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),s=Xe(e);let i=ee(1);t&&(r?N(r)&&(i=le(r)):i=le(e));const c=er(s,n,r)?Bt(s):ee(0);let l=(o.left+c.x)/i.x,a=(o.top+c.y)/i.y,m=o.width/i.x,f=o.height/i.y;if(s){const u=V(s),d=r&&N(r)?V(r):r;let g=u,h=g.frameElement;for(; h&&r&&d!==g;){const R=le(h),x=h.getBoundingClientRect(),E=z(h),C=x.left+(h.clientLeft+parseFloat(E.paddingLeft))*R.x,b=x.top+(h.clientTop+parseFloat(E.paddingTop))*R.y;l*=R.x,a*=R.y,m*=R.x,f*=R.y,l+=C,a+=b,g=V(h),h=g.frameElement}}return ue({width:m,height:f,x:l,y:a})}const tr=[":popover-open",":modal"];function Wt(e){return tr.some(t=>{try{return e.matches(t)}catch{return!1}})}function nr(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const s=o==="fixed",i=Z(r),c=t?Wt(t.floating):!1;if(r===i||c&&s)return n;let l={scrollLeft:0,scrollTop:0},a=ee(1);const m=ee(0),f=K(r);if((f||!f&&!s)&&((Q(r)!=="body"||ve(i))&&(l=Ae(r)),K(r))){const u=oe(r);a=le(r),m.x=u.x+r.clientLeft,m.y=u.y+r.clientTop}return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-l.scrollLeft*a.x+m.x,y:n.y*a.y-l.scrollTop*a.y+m.y}}function rr(e){return Array.from(e.getClientRects())}function Ht(e){return oe(Z(e)).left+Ae(e).scrollLeft}function or(e){const t=Z(e),n=Ae(e),r=e.ownerDocument.body,o=$(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),s=$(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Ht(e);const c=-n.scrollTop;return z(r).direction==="rtl"&&(i+=$(t.clientWidth,r.clientWidth)-o),{width:o,height:s,x:i,y:c}}function sr(e, t){const n=V(e),r=Z(e),o=n.visualViewport;let s=r.clientWidth,i=r.clientHeight,c=0,l=0;if(o){s=o.width,i=o.height;const a=Ke();(!a||a&&t==="fixed")&&(c=o.offsetLeft,l=o.offsetTop)}return{width:s,height:i,x:c,y:l}}function ir(e, t){const n=oe(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,s=K(e)?le(e):ee(1),i=e.clientWidth*s.x,c=e.clientHeight*s.y,l=o*s.x,a=r*s.y;return{width:i,height:c,x:l,y:a}}function gt(e, t, n){let r;if(t==="viewport")r=sr(e,n);else if(t==="document")r=or(Z(e));else if(N(t))r=ir(t,n);else{const o=Bt(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return ue(r)}function Vt(e, t){const n=re(e);return n===t||!N(n)||ae(n)?!1:z(n).position==="fixed"||Vt(n,t)}function cr(e, t){const n=t.get(e);if(n)return n;let r=J(e,[],!1).filter(c=>N(c)&&Q(c)!=="body"),o=null;const s=z(e).position==="fixed";let i=s?re(e):e;for(; N(i)&&!ae(i);){const c=z(i),l=Ve(i);!l&&c.position==="fixed"&&(o=null),(s?!l&&!o:!l&&c.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||ve(i)&&!l&&Vt(e,i))?r=r.filter(m=>m!==i):o=c,i=re(i)}return t.set(e,r),r}function lr(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[...n==="clippingAncestors"?cr(t,this._c):[].concat(n),r],c=i[0],l=i.reduce((a, m)=>{const f=gt(t,m,o);return a.top=$(f.top,a.top),a.right=j(f.right,a.right),a.bottom=j(f.bottom,a.bottom),a.left=$(f.left,a.left),a},gt(t,c,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function ar(e){const{width:t,height:n}=$t(e);return{width:t,height:n}}function ur(e, t, n){const r=K(t),o=Z(t),s=n==="fixed",i=oe(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const l=ee(0);if(r||!r&&!s)if((Q(t)!=="body"||ve(o))&&(c=Ae(t)),r){const f=oe(t,!0,s,t);l.x=f.x+t.clientLeft,l.y=f.y+t.clientTop}else o&&(l.x=Ht(o));const a=i.left+c.scrollLeft-l.x,m=i.top+c.scrollTop-l.y;return{x:a,y:m,width:i.width,height:i.height}}function ht(e, t){return!K(e)||z(e).position==="fixed"?null:t?t(e):e.offsetParent}function Kt(e, t){const n=V(e);if(!K(e)||Wt(e))return n;let r=ht(e,t);for(; r&&An(r)&&z(r).position==="static";)r=ht(r,t);return r&&(Q(r)==="html"||Q(r)==="body"&&z(r).position==="static"&&!Ve(r))?n:r||Tn(e)||n}const fr=async function(e){const t=this.getOffsetParent||Kt,n=this.getDimensions;return{reference:ur(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await n(e.floating)}}};function dr(e){return z(e).direction==="rtl"}const mr={convertOffsetParentRelativeRectToViewportRelativeRect:nr,getDocumentElement:Z,getClippingRect:lr,getOffsetParent:Kt,getElementRects:fr,getClientRects:rr,getDimensions:ar,getScale:le,isElement:N,isRTL:dr};function pr(e, t){let n=null,r;const o=Z(e);function s(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function i(c, l){c===void 0&&(c=!1),l===void 0&&(l=1),s();const{left:a,top:m,width:f,height:u}=e.getBoundingClientRect();if(c||t(),!f||!u)return;const d=ye(m),g=ye(o.clientWidth-(a+f)),h=ye(o.clientHeight-(m+u)),R=ye(a),E={rootMargin:-d+"px "+-g+"px "+-h+"px "+-R+"px",threshold:$(0,j(1,l))||1};let C=!0;function b(w){const A=w[0].intersectionRatio;if(A!==l){if(!C)return i();A?i(!1,A):r=setTimeout(()=>{i(!1,1e-7)},100)}C=!1}try{n=new IntersectionObserver(b,{...E,root:o.ownerDocument})}catch{n=new IntersectionObserver(b,E)}n.observe(e)}return i(!0),s}function gr(e, t, n, r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:s=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,a=Xe(e),m=o||s?[...a?J(a):[],...J(t)]:[];m.forEach(x=>{o&&x.addEventListener("scroll",n,{passive:!0}),s&&x.addEventListener("resize",n)});const f=a&&c?pr(a,n):null;let u=-1,d=null;i&&(d=new ResizeObserver(x=>{let[E]=x;E&&E.target===a&&d&&(d.unobserve(t),cancelAnimationFrame(u),u=requestAnimationFrame(()=>{var C;(C=d)==null||C.observe(t)})),n()}),a&&!l&&d.observe(a),d.observe(t));let g,h=l?oe(e):null;l&&R();function R(){const x=oe(e);h&&(x.x!==h.x||x.y!==h.y||x.width!==h.width||x.height!==h.height)&&n(),h=x,g=requestAnimationFrame(R)}return n(),()=>{var x;m.forEach(E=>{o&&E.removeEventListener("scroll",n),s&&E.removeEventListener("resize",n)}),f==null||f(),(x=d)==null||x.disconnect(),d=null,l&&cancelAnimationFrame(g)}}const hr=qn,vr=jn,wr=Jn,vt=zn,yr=Gn,xr=Zn,br=(e, t, n)=>{const r=new Map,o={platform:mr,...n},s={...o.platform,_c:r};return Kn(e,t,{...o,platform:s})},Rr= e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?vt({element:r.current,padding:o}).fn(n):{}:r?vt({element:r,padding:o}).fn(n):{}}}};var xe=typeof document<"u"?p.useLayoutEffect:p.useEffect;function Pe(e, t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n; r--!==0;)if(!Pe(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n; r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n; r--!==0;){const s=o[r];if(!(s==="_owner"&&e.$$typeof)&&!Pe(e[s],t[s]))return!1}return!0}return e!==e&&t!==t}function zt(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function wt(e, t){const n=zt(e);return Math.round(t*n)/n}function yt(e){const t=p.useRef(e);return xe(()=>{t.current=e}),t}function Er(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:s,floating:i}={},transform:c=!0,whileElementsMounted:l,open:a}=e,[m,f]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[u,d]=p.useState(r);Pe(u,r)||d(r);const[g,h]=p.useState(null),[R,x]=p.useState(null),E=p.useCallback(P=>{P!==A.current&&(A.current=P,h(P))},[]),C=p.useCallback(P=>{P!==D.current&&(D.current=P,x(P))},[]),b=s||g,w=i||R,A=p.useRef(null),D=p.useRef(null),L=p.useRef(m),F=l!=null,k=yt(l),S=yt(o),M=p.useCallback(()=>{if(!A.current||!D.current)return;const P={placement:t,strategy:n,middleware:u};S.current&&(P.platform=S.current),br(A.current,D.current,P).then(y=>{const _={...y,isPositioned:!0};I.current&&!Pe(L.current,_)&&(L.current=_,sn.flushSync(()=>{f(_)}))})},[u,t,n,S]);xe(()=>{a===!1&&L.current.isPositioned&&(L.current.isPositioned=!1,f(P=>({...P,isPositioned:!1})))},[a]);const I=p.useRef(!1);xe(()=>(I.current=!0,()=>{I.current=!1}),[]),xe(()=>{if(b&&(A.current=b),w&&(D.current=w),b&&w){if(k.current)return k.current(b,w,M);M()}},[b,w,M,k,F]);const O=p.useMemo(()=>({reference:A,floating:D,setReference:E,setFloating:C}),[E,C]),v=p.useMemo(()=>({reference:b,floating:w}),[b,w]),T=p.useMemo(()=>{const P={position:n,left:0,top:0};if(!v.floating)return P;const y=wt(v.floating,m.x),_=wt(v.floating,m.y);return c?{...P,transform:"translate("+y+"px, "+_+"px)",...zt(v.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:y,top:_}},[n,c,v.floating,m.x,m.y]);return p.useMemo(()=>({...m,update:M,refs:O,elements:v,floatingStyles:T}),[m,M,O,v,T])}const Cr=Ot["useInsertionEffect".toString()],Pr=Cr||(e=>e());function ce(e){const t=p.useRef(()=>{});return Pr(()=>{t.current=e}),p.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0; o<n; o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}var X=typeof document<"u"?p.useLayoutEffect:p.useEffect;let Se=!1,Ar=0;const xt=()=>"floating-ui-"+Ar++;function Tr(){const[e,t]=p.useState(()=>Se?xt():void 0);return X(()=>{e==null&&t(xt())},[]),p.useEffect(()=>{Se||(Se=!0)},[]),e}const Or=Ot["useId".toString()],jt=Or||Tr;function Dr(){const e=new Map;return{emit(t, n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t, n){e.set(t,[...e.get(t)||[],n])},off(t, n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(o=>o!==n))||[])}}}const Mr=p.createContext(null),kr=p.createContext(null),qe=()=>{var e;return((e=p.useContext(Mr))==null?void 0:e.id)||null},Ze=()=>p.useContext(kr);function Je(e){return"data-floating-ui-"+e}function bt(e){const t=p.useRef(e);return X(()=>{t.current=e}),t}const Rt=Je("safe-polygon");function be(e, t, n){return n&&!_t(n)?0:typeof e=="number"?e:e==null?void 0:e[t]}function co(e, t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:s,elements:{domReference:i,floating:c},refs:l}=e,{enabled:a=!0,delay:m=0,handleClose:f=null,mouseOnly:u=!1,restMs:d=0,move:g=!0}=t,h=Ze(),R=qe(),x=bt(f),E=bt(m),C=p.useRef(),b=p.useRef(),w=p.useRef(),A=p.useRef(),D=p.useRef(!0),L=p.useRef(!1),F=p.useRef(()=>{}),k=p.useCallback(()=>{var O;const v=(O=o.current.openEvent)==null?void 0:O.type;return(v==null?void 0:v.includes("mouse"))&&v!=="mousedown"},[o]);p.useEffect(()=>{if(!a)return;function O(v){let{open:T}=v;T||(clearTimeout(b.current),clearTimeout(A.current),D.current=!0)}return s.on("openchange",O),()=>{s.off("openchange",O)}},[a,s]),p.useEffect(()=>{if(!a||!x.current||!n)return;function O(T){k()&&r(!1,T,"hover")}const v=ne(c).documentElement;return v.addEventListener("mouseleave",O),()=>{v.removeEventListener("mouseleave",O)}},[c,n,r,a,x,k]);const S=p.useCallback(function(O, v, T){v===void 0&&(v=!0),T===void 0&&(T="hover");const P=be(E.current,"close",C.current);P&&!w.current?(clearTimeout(b.current),b.current=setTimeout(()=>r(!1,O,T),P)):v&&(clearTimeout(b.current),r(!1,O,T))},[E,r]),M=p.useCallback(()=>{F.current(),w.current=void 0},[]),I=p.useCallback(()=>{if(L.current){const O=ne(l.floating.current).body;O.style.pointerEvents="",O.removeAttribute(Rt),L.current=!1}},[l]);return p.useEffect(()=>{if(!a)return;function O(){return o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1}function v(y){if(clearTimeout(b.current),D.current=!1,u&&!_t(C.current)||d>0&&be(E.current,"open")===0)return;const _=be(E.current,"open",C.current);_?b.current=setTimeout(()=>{r(!0,y,"hover")},_):r(!0,y,"hover")}function T(y){if(O())return;F.current();const _=ne(c);if(clearTimeout(A.current),x.current){n||clearTimeout(b.current),w.current=x.current({...e,tree:h,x:y.clientX,y:y.clientY,onClose(){I(),M(),S(y,!0,"safe-polygon")}});const G=w.current;_.addEventListener("mousemove",G),F.current=()=>{_.removeEventListener("mousemove",G)};return}(C.current==="touch"?!ge(c,y.relatedTarget):!0)&&S(y)}function P(y){O()||x.current==null||x.current({...e,tree:h,x:y.clientX,y:y.clientY,onClose(){I(),M(),S(y)}})(y)}if(N(i)){const y=i;return n&&y.addEventListener("mouseleave",P),c==null||c.addEventListener("mouseleave",P),g&&y.addEventListener("mousemove",v,{once:!0}),y.addEventListener("mouseenter",v),y.addEventListener("mouseleave",T),()=>{n&&y.removeEventListener("mouseleave",P),c==null||c.removeEventListener("mouseleave",P),g&&y.removeEventListener("mousemove",v),y.removeEventListener("mouseenter",v),y.removeEventListener("mouseleave",T)}}},[i,c,a,e,u,d,g,S,M,I,r,n,h,E,x,o]),X(()=>{var O;if(a&&n&&(O=x.current)!=null&&O.__options.blockPointerEvents&&k()){const T=ne(c).body;if(T.setAttribute(Rt,""),T.style.pointerEvents="none",L.current=!0,N(i)&&c){var v;const P=i,y=h==null||(v=h.nodesRef.current.find(_=>_.id===R))==null||(v=v.context)==null?void 0:v.elements.floating;return y&&(y.style.pointerEvents=""),P.style.pointerEvents="auto",c.style.pointerEvents="auto",()=>{P.style.pointerEvents="",c.style.pointerEvents=""}}}},[a,n,R,c,i,h,x,k]),X(()=>{n||(C.current=void 0,M(),I())},[n,M,I]),p.useEffect(()=>()=>{M(),clearTimeout(b.current),clearTimeout(A.current),I()},[a,i,M,I]),p.useMemo(()=>{if(!a)return{};function O(v){C.current=v.pointerType}return{reference:{onPointerDown:O,onPointerEnter:O,onMouseMove(v){n||d===0||(clearTimeout(A.current),A.current=setTimeout(()=>{D.current||r(!0,v.nativeEvent,"hover")},d))}},floating:{onMouseEnter(){clearTimeout(b.current)},onMouseLeave(v){S(v.nativeEvent,!1)}}}},[a,d,n,r,S])}const Yt=p.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:()=>{},setState:()=>{},isInstantPhase:!1}),Sr=()=>p.useContext(Yt),lo= e=>{let{children:t,delay:n,timeoutMs:r=0}=e;const[o,s]=p.useReducer((l, a)=>({...l,...a}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),i=p.useRef(null),c=p.useCallback(l=>{s({currentId:l})},[]);return X(()=>{o.currentId?i.current===null?i.current=o.currentId:s({isInstantPhase:!0}):(s({isInstantPhase:!1}),i.current=null)},[o.currentId]),p.createElement(Yt.Provider,{value:p.useMemo(()=>({...o,setState:s,setCurrentId:c}),[o,c])},t)},ao=(e, t)=>{let{open:n,onOpenChange:r}=e,{id:o}=t;const{currentId:s,setCurrentId:i,initialDelay:c,setState:l,timeoutMs:a}=Sr();X(()=>{s&&(l({delay:{open:1,close:be(c,"close")}}),s!==o&&r(!1))},[o,r,l,s,c]),X(()=>{function m(){r(!1),l({delay:c,currentId:null})}if(!n&&s===o){if(a){const f=window.setTimeout(m,a);return()=>{clearTimeout(f)}}m()}},[n,l,s,o,r,c,a]),X(()=>{n&&i(o)},[n,i,o])};function Le(e, t){let n=e.filter(o=>{var s;return o.parentId===t&&((s=o.context)==null?void 0:s.open)}),r=n;for(; r.length;)r=e.filter(o=>{var s;return(s=r)==null?void 0:s.some(i=>{var c;return o.parentId===i.id&&((c=o.context)==null?void 0:c.open)})}),n=n.concat(r);return n}const Lr={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Ir={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Et= e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function uo(e, t){t===void 0&&(t={});const{open:n,onOpenChange:r,nodeId:o,elements:{reference:s,domReference:i,floating:c},dataRef:l}=e,{enabled:a=!0,escapeKey:m=!0,outsidePress:f=!0,outsidePressEvent:u="pointerdown",referencePress:d=!1,referencePressEvent:g="pointerdown",ancestorScroll:h=!1,bubbles:R,capture:x}=t,E=Ze(),C=ce(typeof f=="function"?f:()=>!1),b=typeof f=="function"?C:f,w=p.useRef(!1),A=p.useRef(!1),{escapeKey:D,outsidePress:L}=Et(R),{escapeKey:F,outsidePress:k}=Et(x),S=ce(v=>{if(!n||!a||!m||v.key!=="Escape")return;const T=E?Le(E.nodesRef.current,o):[];if(!D&&(v.stopPropagation(),T.length>0)){let P=!0;if(T.forEach(y=>{var _;if((_=y.context)!=null&&_.open&&!y.context.dataRef.current.__escapeKeyBubbles){P=!1;return}}),!P)return}r(!1,Sn(v)?v.nativeEvent:v,"escape-key")}),M=ce(v=>{var T;const P=()=>{var y;S(v),(y=ie(v))==null||y.removeEventListener("keydown",P)};(T=ie(v))==null||T.addEventListener("keydown",P)}),I=ce(v=>{const T=w.current;w.current=!1;const P=A.current;if(A.current=!1,u==="click"&&P||T||typeof b=="function"&&!b(v))return;const y=ie(v),_="["+Je("inert")+"]",de=ne(c).querySelectorAll(_);let G=N(y)?y:null;for(; G&&!ae(G);){const W=re(G);if(ae(W)||!N(W))break;G=W}if(de.length&&N(y)&&!Ln(y)&&!ge(y,c)&&Array.from(de).every(W=>!ge(G,W)))return;if(K(y)&&c){const W=y.clientWidth>0&&y.scrollWidth>y.clientWidth,U=y.clientHeight>0&&y.scrollHeight>y.clientHeight;let te=U&&v.offsetX>y.clientWidth;if(U&&z(y).direction==="rtl"&&(te=v.offsetX<=y.offsetWidth-y.clientWidth),te||W&&v.offsetY>y.clientHeight)return}const De=E&&Le(E.nodesRef.current,o).some(W=>{var U;return ke(v,(U=W.context)==null?void 0:U.elements.floating)});if(ke(v,c)||ke(v,i)||De)return;const we=E?Le(E.nodesRef.current,o):[];if(we.length>0){let W=!0;if(we.forEach(U=>{var te;if((te=U.context)!=null&&te.open&&!U.context.dataRef.current.__outsidePressBubbles){W=!1;return}}),!W)return}r(!1,v,"outside-press")}),O=ce(v=>{var T;const P=()=>{var y;I(v),(y=ie(v))==null||y.removeEventListener(u,P)};(T=ie(v))==null||T.addEventListener(u,P)});return p.useEffect(()=>{if(!n||!a)return;l.current.__escapeKeyBubbles=D,l.current.__outsidePressBubbles=L;function v(y){r(!1,y,"ancestor-scroll")}const T=ne(c);m&&T.addEventListener("keydown",F?M:S,F),b&&T.addEventListener(u,k?O:I,k);let P=[];return h&&(N(i)&&(P=J(i)),N(c)&&(P=P.concat(J(c))),!N(s)&&s&&s.contextElement&&(P=P.concat(J(s.contextElement)))),P=P.filter(y=>{var _;return y!==((_=T.defaultView)==null?void 0:_.visualViewport)}),P.forEach(y=>{y.addEventListener("scroll",v,{passive:!0})}),()=>{m&&T.removeEventListener("keydown",F?M:S,F),b&&T.removeEventListener(u,k?O:I,k),P.forEach(y=>{y.removeEventListener("scroll",v)})}},[l,c,i,s,m,b,u,n,r,h,a,D,L,S,F,M,I,k,O]),p.useEffect(()=>{w.current=!1},[b,u]),p.useMemo(()=>a?{reference:{onKeyDown:S,[Lr[g]]: v=>{d&&r(!1,v.nativeEvent,"reference-press")}},floating:{onKeyDown:S,onMouseDown(){A.current=!0},onMouseUp(){A.current=!0},[Ir[u]]:()=>{w.current=!0}}}:{},[a,d,u,g,r,S])}function Fr(e){var t;e===void 0&&(e={});const{open:n=!1,onOpenChange:r,nodeId:o}=e,[s,i]=p.useState(null),c=((t=e.elements)==null?void 0:t.reference)||s,l=Er(e),a=Ze(),m=qe()!=null,f=ce((w, A, D)=>{w&&(d.current.openEvent=A),g.emit("openchange",{open:w,event:A,reason:D,nested:m}),r==null||r(w,A,D)}),u=p.useRef(null),d=p.useRef({}),g=p.useState(()=>Dr())[0],h=jt(),R=p.useCallback(w=>{const A=N(w)?{getBoundingClientRect:()=>w.getBoundingClientRect(),contextElement:w}:w;l.refs.setReference(A)},[l.refs]),x=p.useCallback(w=>{(N(w)||w===null)&&(u.current=w,i(w)),(N(l.refs.reference.current)||l.refs.reference.current===null||w!==null&&!N(w))&&l.refs.setReference(w)},[l.refs]),E=p.useMemo(()=>({...l.refs,setReference:x,setPositionReference:R,domReference:u}),[l.refs,x,R]),C=p.useMemo(()=>({...l.elements,domReference:c}),[l.elements,c]),b=p.useMemo(()=>({...l,refs:E,elements:C,dataRef:d,nodeId:o,floatingId:h,events:g,open:n,onOpenChange:f}),[l,o,h,g,n,f,E,C]);return X(()=>{const w=a==null?void 0:a.nodesRef.current.find(A=>A.id===o);w&&(w.context=b)}),p.useMemo(()=>({...l,context:b,refs:E,elements:C}),[l,E,C,b])}function fo(e, t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,refs:s,elements:{domReference:i}}=e,{enabled:c=!0,visibleOnly:l=!0}=t,a=p.useRef(!1),m=p.useRef(),f=p.useRef(!0);return p.useEffect(()=>{if(!c)return;const u=V(i);function d(){!n&&K(i)&&i===dt(ne(i))&&(a.current=!0)}function g(){f.current=!0}return u.addEventListener("blur",d),u.addEventListener("keydown",g,!0),()=>{u.removeEventListener("blur",d),u.removeEventListener("keydown",g,!0)}},[i,n,c]),p.useEffect(()=>{if(!c)return;function u(d){let{reason:g}=d;(g==="reference-press"||g==="escape-key")&&(a.current=!0)}return o.on("openchange",u),()=>{o.off("openchange",u)}},[o,c]),p.useEffect(()=>()=>{clearTimeout(m.current)},[]),p.useMemo(()=>c?{reference:{onPointerDown(u){On(u.nativeEvent)||(f.current=!1)},onMouseLeave(){a.current=!1},onFocus(u){if(a.current)return;const d=ie(u.nativeEvent);if(l&&N(d))try{if(Dn()&&Mn())throw Error();if(!d.matches(":focus-visible"))return}catch{if(!f.current&&!Fn(d))return}r(!0,u.nativeEvent,"focus")},onBlur(u){a.current=!1;const d=u.relatedTarget,g=N(d)&&d.hasAttribute(Je("focus-guard"))&&d.getAttribute("data-type")==="outside";m.current=window.setTimeout(()=>{const h=dt(i?i.ownerDocument:document);!d&&h===i||ge(s.floating.current,h)||ge(i,h)||g||r(!1,u.nativeEvent,"focus")})}}}:{},[c,l,i,s,r])}const Ct="active",Pt="selected";function Ie(e, t, n){const r=new Map,o=n==="item";let s=e;if(o&&e){const{[Ct]:i,[Pt]:c,...l}=e;s=l}return{...n==="floating"&&{tabIndex:-1},...s,...t.map(i=>{const c=i?i[n]:null;return typeof c=="function"?e?c(e):null:c}).concat(e).reduce((i, c)=>(c&&Object.entries(c).forEach(l=>{let[a,m]=l;if(!(o&&[Ct,Pt].includes(a)))if(a.indexOf("on")===0){if(r.has(a)||r.set(a,[]),typeof m=="function"){var f;(f=r.get(a))==null||f.push(m),i[a]=function(){for(var u,d=arguments.length,g=new Array(d),h=0; h<d; h++)g[h]=arguments[h];return(u=r.get(a))==null?void 0:u.map(R=>R(...g)).find(R=>R!==void 0)}}}else i[a]=m}),i),{})}}function mo(e){e===void 0&&(e=[]);const t=e,n=p.useCallback(s=>Ie(s,e,"reference"),t),r=p.useCallback(s=>Ie(s,e,"floating"),t),o=p.useCallback(s=>Ie(s,e,"item"),e.map(s=>s==null?void 0:s.item));return p.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:o}),[n,r,o])}const _r=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function po(e, t){var n;t===void 0&&(t={});const{open:r,floatingId:o}=e,{enabled:s=!0,role:i="dialog"}=t,c=(n=_r.get(i))!=null?n:i,l=jt(),m=qe()!=null;return p.useMemo(()=>{if(!s)return{};const f={id:o,...c&&{role:c}};return c==="tooltip"||i==="label"?{reference:{["aria-"+(i==="label"?"labelledby":"describedby")]:r?o:void 0},floating:f}:{reference:{"aria-expanded":r?"true":"false","aria-haspopup":c==="alertdialog"?"dialog":c,"aria-controls":r?o:void 0,...c==="listbox"&&{role:"combobox"},...c==="menu"&&{id:l},...c==="menu"&&m&&{role:"menuitem"},...i==="select"&&{"aria-autocomplete":"none"},...i==="combobox"&&{"aria-autocomplete":"list"}},floating:{...f,...c==="menu"&&{"aria-labelledby":l}},item(u){let{active:d,selected:g}=u;const h={role:"option",...d&&{id:o+"-option"}};switch(i){case"select":return{...h,"aria-selected":d&&g};case"combobox":return{...h,...d&&{"aria-selected":!0}}}return{}}}},[s,i,c,r,o,l,m])}function Nr(e, t){if(e==="rtl"&&(t.includes("right")||t.includes("left"))){const[n,r]=t.split("-"),o=n==="right"?"left":"right";return r===void 0?o:`${o}-${r}`}return t}function At(e, t, n, r){return e==="center"||r==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function Tt(e, t, n, r, o){return e==="center"||r==="center"?{left:t}:e==="end"?{[o==="ltr"?"right":"left"]:n}:e==="start"?{[o==="ltr"?"left":"right"]:n}:{}}const $r={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function Br({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,arrowX:s,arrowY:i,dir:c}){const[l,a="center"]=e.split("-"),m={width:pe(t),height:pe(t),transform:"rotate(45deg)",position:"absolute",[$r[l]]:pe(r)},f=pe(-t/2);return l==="left"?{...m,...At(a,i,n,o),right:f,borderLeftColor:"transparent",borderBottomColor:"transparent"}:l==="right"?{...m,...At(a,i,n,o),left:f,borderRightColor:"transparent",borderTopColor:"transparent"}:l==="top"?{...m,...Tt(a,s,n,o,c),bottom:f,borderTopColor:"transparent",borderLeftColor:"transparent"}:l==="bottom"?{...m,...Tt(a,s,n,o,c),top:f,borderBottomColor:"transparent",borderRightColor:"transparent"}:{}}const Gt=p.forwardRef(({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,visible:s,arrowX:i,arrowY:c,style:l,...a}, m)=>{const{dir:f}=kt();return s?B.createElement("div",{...a,ref:m,style:{...l,...Br({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,dir:f,arrowX:i,arrowY:c})}}):null});Gt.displayName="@mantine/core/FloatingArrow";const[Wr,Ut]=cn("Popover component was not found in the tree");var Xt={dropdown:"m_38a85659",arrow:"m_a31dc6c1"};const Hr={},Qe=$e((e, t)=>{var R,x,E,C;const n=he("PopoverDropdown",Hr,e),{className:r,style:o,vars:s,children:i,onKeyDownCapture:c,variant:l,classNames:a,styles:m,...f}=n,u=Ut(),d=ln({opened:u.opened,shouldReturnFocus:u.returnFocus}),g=u.withRoles?{"aria-labelledby":u.getTargetId(),id:u.getDropdownId(),role:"dialog",tabIndex:-1}:{},h=Dt(t,u.floating);return u.disabled?null:B.createElement(an,{...u.portalProps,withinPortal:u.withinPortal},B.createElement(un,{mounted:u.opened,...u.transitionProps,transition:((R=u.transitionProps)==null?void 0:R.transition)||"fade",duration:((x=u.transitionProps)==null?void 0:x.duration)??150,keepMounted:u.keepMounted,exitDuration:typeof((E=u.transitionProps)==null?void 0:E.exitDuration)=="number"?u.transitionProps.exitDuration:(C=u.transitionProps)==null?void 0:C.duration}, b=>B.createElement(fn,{active:u.trapFocus},B.createElement(Be,{...g,...f,variant:l,ref:h,onKeyDownCapture:En(u.onClose,{active:u.closeOnEscape,onTrigger:d,onKeyDown:c}),"data-position":u.placement,...u.getStyles("dropdown",{className:r,props:n,classNames:a,styles:m,style:[{...b,zIndex:u.zIndex,top:u.y??0,left:u.x??0,width:u.width==="target"?void 0:pe(u.width)},o]})},i,B.createElement(Gt,{ref:u.arrowRef,arrowX:u.arrowX,arrowY:u.arrowY,visible:u.withArrow,position:u.placement,arrowSize:u.arrowSize,arrowRadius:u.arrowRadius,arrowOffset:u.arrowOffset,arrowPosition:u.arrowPosition,...u.getStyles("arrow",{props:n,classNames:a,styles:m})})))))});Qe.classes=Xt;Qe.displayName="@mantine/core/PopoverDropdown";const Vr={refProp:"ref",popupType:"dialog"},qt=$e((e, t)=>{const{children:n,refProp:r,popupType:o,...s}=he("PopoverTarget",Vr,e);if(!dn(n))throw new Error("Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const i=s,c=Ut(),l=Dt(c.reference,n.ref,t),a=c.withRoles?{"aria-haspopup":o,"aria-expanded":c.opened,"aria-controls":c.getDropdownId(),id:c.getTargetId()}:{};return p.cloneElement(n,{...i,...a,...c.targetProps,className:mn(c.targetProps.className,i.className,n.props.className),[r]:l,...c.controlled?null:{onClick:c.onToggle}})});qt.displayName="@mantine/core/PopoverTarget";function Kr({opened:e,floating:t,position:n,positionDependencies:r}){const[o,s]=p.useState(0);p.useEffect(()=>{if(t.refs.reference.current&&t.refs.floating.current)return gr(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,o,n]),Re(()=>{t.update()},r),Re(()=>{s(i=>i+1)},[e])}function zr(e, t){var r,o,s,i;const n=[Xn(e.offset)];return(r=e.middlewares)!=null&&r.shift&&n.push(hr({limiter:xr()})),(o=e.middlewares)!=null&&o.flip&&n.push(vr()),(s=e.middlewares)!=null&&s.inline&&n.push(yr()),n.push(Rr({element:e.arrowRef,padding:e.arrowOffset})),((i=e.middlewares)!=null&&i.size||e.width==="target")&&n.push(wr({apply({rects:c,availableWidth:l,availableHeight:a}){var u,d;const f=((u=t().refs.floating.current)==null?void 0:u.style)??{};(d=e.middlewares)!=null&&d.size&&Object.assign(f,{maxWidth:`${l}px`,maxHeight:`${a}px`}),e.width==="target"&&Object.assign(f,{width:`${c.reference.width}px`})}})),n}function jr(e){const[t,n]=xn({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=()=>{var i;t&&((i=e.onClose)==null||i.call(e),n(!1))},o=()=>{var i,c;t?((i=e.onClose)==null||i.call(e),n(!1)):((c=e.onOpen)==null||c.call(e),n(!0))},s=Fr({strategy:e.strategy,placement:e.position,middleware:zr(e,()=>s)});return Kr({opened:e.opened,position:e.position,positionDependencies:e.positionDependencies||[],floating:s}),Re(()=>{var i;(i=e.onPositionChange)==null||i.call(e,s.placement)},[s.placement]),Re(()=>{var i,c;e.opened?(c=e.onOpen)==null||c.call(e):(i=e.onClose)==null||i.call(e)},[e.opened]),{floating:s,controlled:typeof e.opened=="boolean",opened:t,onClose:r,onToggle:o}}const Yr={position:"bottom",offset:8,positionDependencies:[],transitionProps:{transition:"fade",duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:"side",closeOnClickOutside:!0,withinPortal:!0,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,clickOutsideEvents:["mousedown","touchstart"],zIndex:pn("popover"),__staticSelector:"Popover",width:"max-content"},Gr=He((e, {radius:t,shadow:n})=>({dropdown:{"--popover-radius":t===void 0?void 0:Mt(t),"--popover-shadow":hn(n)}}));function Te(e){var ot,st,it,ct,lt,at;const t=he("Popover",Yr,e),{children:n,position:r,offset:o,onPositionChange:s,positionDependencies:i,opened:c,transitionProps:l,width:a,middlewares:m,withArrow:f,arrowSize:u,arrowOffset:d,arrowRadius:g,arrowPosition:h,unstyled:R,classNames:x,styles:E,closeOnClickOutside:C,withinPortal:b,portalProps:w,closeOnEscape:A,clickOutsideEvents:D,trapFocus:L,onClose:F,onOpen:k,onChange:S,zIndex:M,radius:I,shadow:O,id:v,defaultOpened:T,__staticSelector:P,withRoles:y,disabled:_,returnFocus:de,variant:G,keepMounted:De,vars:we,floatingStrategy:W,...U}=t,te=We({name:P,props:t,classes:Xt,classNames:x,styles:E,unstyled:R,rootSelector:"dropdown",vars:we,varsResolver:Gr}),Me=p.useRef(null),[Jt,Qt]=p.useState(null),[en,tn]=p.useState(null),{dir:nn}=kt(),rt=gn(v),H=jr({middlewares:m,width:a,position:Nr(nn,r),offset:typeof o=="number"?o+(f?u/2:0):o,arrowRef:Me,arrowOffset:d,onPositionChange:s,positionDependencies:i,opened:c,defaultOpened:T,onChange:S,onOpen:k,onClose:F,strategy:W});Cn(()=>C&&H.onClose(),D,[Jt,en]);const rn=p.useCallback(me=>{Qt(me),H.floating.refs.setReference(me)},[H.floating.refs.setReference]),on=p.useCallback(me=>{tn(me),H.floating.refs.setFloating(me)},[H.floating.refs.setFloating]);return B.createElement(Wr,{value:{returnFocus:de,disabled:_,controlled:H.controlled,reference:rn,floating:on,x:H.floating.x,y:H.floating.y,arrowX:(it=(st=(ot=H.floating)==null?void 0:ot.middlewareData)==null?void 0:st.arrow)==null?void 0:it.x,arrowY:(at=(lt=(ct=H.floating)==null?void 0:ct.middlewareData)==null?void 0:lt.arrow)==null?void 0:at.y,opened:H.opened,arrowRef:Me,transitionProps:l,width:a,withArrow:f,arrowSize:u,arrowOffset:d,arrowRadius:g,arrowPosition:h,placement:H.floating.placement,trapFocus:L,withinPortal:b,portalProps:w,zIndex:M,radius:I,shadow:O,closeOnEscape:A,onClose:H.onClose,onToggle:H.onToggle,getTargetId:()=>`${rt}-target`,getDropdownId:()=>`${rt}-dropdown`,withRoles:y,targetProps:U,__staticSelector:P,classNames:x,styles:E,unstyled:R,variant:G,keepMounted:De,getStyles:te}},n)}Te.Target=qt;Te.Dropdown=Qe;Te.displayName="@mantine/core/Popover";Te.extend= e=>e;const Zt=p.createContext(null),Ur=Zt.Provider;function Xr(){return{withinGroup:!!p.useContext(Zt)}}var Oe={group:"m_11def92b",root:"m_f85678b6",image:"m_11f8ac07",placeholder:"m_104cd71f"};const qr={},Zr=He((e, {spacing:t})=>({group:{"--ag-spacing":vn(t)}})),et=$e((e, t)=>{const n=he("AvatarGroup",qr,e),{classNames:r,className:o,style:s,styles:i,unstyled:c,vars:l,spacing:a,...m}=n,f=We({name:"AvatarGroup",classes:Oe,props:n,className:o,style:s,classNames:r,styles:i,unstyled:c,vars:l,varsResolver:Zr,rootSelector:"group"});return B.createElement(Ur,{value:!0},B.createElement(Be,{ref:t,...f("group"),...m}))});et.classes=Oe;et.displayName="@mantine/core/AvatarGroup";function Jr(e){return B.createElement("svg",{...e,"data-avatar-placeholder-icon":!0,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},B.createElement("path",{d:"M0.877014 7.49988C0.877014 3.84219 3.84216 0.877045 7.49985 0.877045C11.1575 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1575 14.1227 7.49985 14.1227C3.84216 14.1227 0.877014 11.1575 0.877014 7.49988ZM7.49985 1.82704C4.36683 1.82704 1.82701 4.36686 1.82701 7.49988C1.82701 8.97196 2.38774 10.3131 3.30727 11.3213C4.19074 9.94119 5.73818 9.02499 7.50023 9.02499C9.26206 9.02499 10.8093 9.94097 11.6929 11.3208C12.6121 10.3127 13.1727 8.97172 13.1727 7.49988C13.1727 4.36686 10.6328 1.82704 7.49985 1.82704ZM10.9818 11.9787C10.2839 10.7795 8.9857 9.97499 7.50023 9.97499C6.01458 9.97499 4.71624 10.7797 4.01845 11.9791C4.97952 12.7272 6.18765 13.1727 7.49985 13.1727C8.81227 13.1727 10.0206 12.727 10.9818 11.9787ZM5.14999 6.50487C5.14999 5.207 6.20212 4.15487 7.49999 4.15487C8.79786 4.15487 9.84999 5.207 9.84999 6.50487C9.84999 7.80274 8.79786 8.85487 7.49999 8.85487C6.20212 8.85487 5.14999 7.80274 5.14999 6.50487ZM7.49999 5.10487C6.72679 5.10487 6.09999 5.73167 6.09999 6.50487C6.09999 7.27807 6.72679 7.90487 7.49999 7.90487C8.27319 7.90487 8.89999 7.27807 8.89999 6.50487C8.89999 5.73167 8.27319 5.10487 7.49999 5.10487Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}const Qr={},eo=He((e, {size:t,radius:n,variant:r,gradient:o,color:s,autoContrast:i})=>{const c=e.variantColorResolver({color:s||"gray",theme:e,gradient:o,variant:r||"light",autoContrast:i});return{root:{"--avatar-size":yn(t,"avatar-size"),"--avatar-radius":n===void 0?void 0:Mt(n),"--avatar-bg":s||r?c.background:void 0,"--avatar-color":s||r?c.color:void 0,"--avatar-bd":s||r?c.border:void 0}}}),tt=wn((e, t)=>{const n=he("Avatar",Qr,e),{classNames:r,className:o,style:s,styles:i,unstyled:c,vars:l,src:a,alt:m,radius:f,color:u,gradient:d,imageProps:g,children:h,autoContrast:R,mod:x,...E}=n,C=Xr(),[b,w]=p.useState(!a),A=We({name:"Avatar",props:n,classes:Oe,className:o,style:s,classNames:r,styles:i,unstyled:c,vars:l,varsResolver:eo});return p.useEffect(()=>w(!a),[a]),B.createElement(Be,{...A("root"),mod:[{"within-group":C.withinGroup},x],ref:t,...E},b?B.createElement("span",{...A("placeholder"),title:m},h||B.createElement(Jr,null)):B.createElement("img",{...g,...A("image"),src:a,alt:m,onError: D=>{var L;w(!0),(L=g==null?void 0:g.onError)==null||L.call(g,D)}}))});tt.classes=Oe;tt.displayName="@mantine/core/Avatar";tt.Group=et;/**
 * @license @tabler/icons-react v3.1.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */var to={outline:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}};/**
 * @license @tabler/icons-react v3.1.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */const nt=(e,t,n,r)=>{const o=p.forwardRef(({color:s="currentColor",size:i=24,stroke:c=2,className:l,children:a,...m},f)=>p.createElement("svg",{ref:f,...to[e],width:i,height:i,className:["tabler-icon",`tabler-icon-${t}`,l].join(" "),...e==="filled"?{fill:s}:{strokeWidth:c,stroke:s},...m},[...r.map(([u,d])=>p.createElement(u,d)),...Array.isArray(a)?a:[a]]));return o.displayName=`${n}`,o};/**
 * @license @tabler/icons-react v3.1.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */var no=nt("outline","dashboard","IconDashboard",[["path",{d:"M12 13m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-0"}],["path",{d:"M13.45 11.55l2.05 -2.05",key:"svg-1"}],["path",{d:"M6.4 20a9 9 0 1 1 11.2 0z",key:"svg-2"}]]);/**
 * @license @tabler/icons-react v3.1.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */var go=nt("outline","logout","IconLogout",[["path",{d:"M14 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M9 12h12l-3 -3",key:"svg-1"}],["path",{d:"M18 15l3 -3",key:"svg-2"}]]);/**
 * @license @tabler/icons-react v3.1.0 - MIT
 *
 * This source code is licensed under the MIT license.
 * See the LICENSE file in the root directory of this source tree.
 */var ro=nt("outline","user","IconUser",[["path",{d:"M8 7a4 4 0 1 0 8 0a4 4 0 0 0 -8 0",key:"svg-0"}],["path",{d:"M6 21v-2a4 4 0 0 1 4 -4h4a4 4 0 0 1 4 4v2",key:"svg-1"}]]);const ho=[{key:"dashboard",path:"/dashboard",title:"Dashboard",translateKey:"",icon:no,authority:[],subMenu:[]},{key:"users",path:"/users",title:"Users",translateKey:"",icon:ro,authority:[],subMenu:[]}],vo=e=>{const{userAuthority:t=[],authority:n=[],children:r}=e,o=bn(t,n);return ut.jsx(ut.Fragment,{children:o?r:null})};export{vo as A,lo as F,go as I,Te as P,Sr as a,Rr as b,nt as c,mo as d,co as e,vr as f,J as g,fo as h,yr as i,po as j,uo as k,ao as l,Kr as m,ho as n,Xn as o,kt as p,Nr as q,Gt as r,hr as s,tt as t,Fr as u};
