M&&(x=M)}return{[g]:y,[m]:x}}}},zB=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...l}=yi(e,t),u=await td(t,l),d=wi(n),h=wc(n),m=xc(n)==="y",{width:g,height:y}=r.floating;let x,_;d==="top"||d==="bottom"?(x=d,_=h===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(_=d,x=h==="end"?"top":"bottom");const C=y-u[x],S=g-u[_],b=!t.middlewareData.shift;let E=C,k=S;if(m){const M=g-u.left-u.right;k=h||b?Cs(S,M):M}else{const M=y-u.top-u.bottom;E=h||b?Cs(C,M):M}if(b&&!h){const M=pr(u.left,0),A=pr(u.right,0),O=pr(u.top,0),F=pr(u.bottom,0);m?k=g-2*(M!==0||A!==0?M+A:pr(u.left,u.right)):E=y-2*(O!==0||F!==0?O+F:pr(u.top,u.bottom))}await s({...t,availableWidth:k,availableHeight:E});const P=await o.getDimensions(i.floating);return g!==P.width||y!==P.height?{reset:{rects:!0}}:{}}}};function ks(e){return OT(e)?(e.nodeName||"").toLowerCase():"#document"}function vr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ci(e){var t;return(t=(OT(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function OT(e){return e instanceof Node||e instanceof vr(e).Node}function xi(e){return e instanceof Element||e instanceof vr(e).Element}function Ho(e){return e instanceof HTMLElement||e instanceof vr(e).HTMLElement}function LC(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof vr(e).ShadowRoot}function Ad(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Xr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function BB(e){return["table","td","th"].includes(ks(e))}function px(e){const t=hx(),n=Xr(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 UB(e){let t=rc(e);for(;Ho(t)&&!Fm(t);){if(px(t))return t;t=rc(t)}return null}function hx(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Fm(e){return["html","body","#document"].includes(ks(e))}function Xr(e){return vr(e).getComputedStyle(e)}function jm(e){return xi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function rc(e){if(ks(e)==="html")return e;const t=e.assignedSlot||e.parentNode||LC(e)&&e.host||Ci(e);return LC(t)?t.host:t}function MT(e){const t=rc(e);return Fm(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ho(t)&&Ad(t)?t:MT(t)}function nd(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=MT(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=vr(o);return i?t.concat(s,s.visualViewport||[],Ad(o)?o:[],s.frameElement&&n?nd(s.frameElement):[]):t.concat(o,nd(o,[],n))}function NT(e){const t=Xr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ho(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,l=Mh(n)!==i||Mh(r)!==s;return l&&(n=i,r=s),{width:n,height:r,$:l}}function mx(e){return xi(e)?e:e.contextElement}function Rl(e){const t=mx(e);if(!Ho(t))return $s(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=NT(t);let s=(i?Mh(n.width):n.width)/r,l=(i?Mh(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const VB=$s(0);function DT(e){const t=vr(e);return!hx()||!t.visualViewport?VB:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function WB(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==vr(e)?!1:t}function Ra(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=mx(e);let s=$s(1);t&&(r?xi(r)&&(s=Rl(r)):s=Rl(e));const l=WB(i,n,r)?DT(i):$s(0);let u=(o.left+l.x)/s.x,d=(o.top+l.y)/s.y,h=o.width/s.x,m=o.height/s.y;if(i){const g=vr(i),y=r&&xi(r)?vr(r):r;let x=g.frameElement;for(;x&&r&&y!==g;){const _=Rl(x),C=x.getBoundingClientRect(),S=Xr(x),b=C.left+(x.clientLeft+parseFloat(S.paddingLeft))*_.x,E=C.top+(x.clientTop+parseFloat(S.paddingTop))*_.y;u*=_.x,d*=_.y,h*=_.x,m*=_.y,u+=b,d+=E,x=vr(x).frameElement}}return Dh({width:h,height:m,x:u,y:d})}function HB(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=Ho(n),i=Ci(n);if(n===i)return t;let s={scrollLeft:0,scrollTop:0},l=$s(1);const u=$s(0);if((o||!o&&r!=="fixed")&&((ks(n)!=="body"||Ad(i))&&(s=jm(n)),Ho(n))){const d=Ra(n);l=Rl(n),u.x=d.x+n.clientLeft,u.y=d.y+n.clientTop}return{width:t.width*l.x,height:t.height*l.y,x:t.x*l.x-s.scrollLeft*l.x+u.x,y:t.y*l.y-s.scrollTop*l.y+u.y}}function KB(e){return Array.from(e.getClientRects())}function IT(e){return Ra(Ci(e)).left+jm(e).scrollLeft}function YB(e){const t=Ci(e),n=jm(e),r=e.ownerDocument.body,o=pr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=pr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+IT(e);const l=-n.scrollTop;return Xr(r).direction==="rtl"&&(s+=pr(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:l}}function GB(e,t){const n=vr(e),r=Ci(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,l=0,u=0;if(o){i=o.width,s=o.height;const d=hx();(!d||d&&t==="fixed")&&(l=o.offsetLeft,u=o.offsetTop)}return{width:i,height:s,x:l,y:u}}function XB(e,t){const n=Ra(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Ho(e)?Rl(e):$s(1),s=e.clientWidth*i.x,l=e.clientHeight*i.y,u=o*i.x,d=r*i.y;return{width:s,height:l,x:u,y:d}}function FC(e,t,n){let r;if(t==="viewport")r=GB(e,n);else if(t==="document")r=YB(Ci(e));else if(xi(t))r=XB(t,n);else{const o=DT(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return Dh(r)}function LT(e,t){const n=rc(e);return n===t||!xi(n)||Fm(n)?!1:Xr(n).position==="fixed"||LT(n,t)}function ZB(e,t){const n=t.get(e);if(n)return n;let r=nd(e,[],!1).filter(l=>xi(l)&&ks(l)!=="body"),o=null;const i=Xr(e).position==="fixed";let s=i?rc(e):e;for(;xi(s)&&!Fm(s);){const l=Xr(s),u=px(s);!u&&l.position==="fixed"&&(o=null),(i?!u&&!o:!u&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Ad(s)&&!u&<(e,s))?r=r.filter(h=>h!==s):o=l,s=rc(s)}return t.set(e,r),r}function qB(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?ZB(t,this._c):[].concat(n),r],l=s[0],u=s.reduce((d,h)=>{const m=FC(t,h,o);return d.top=pr(m.top,d.top),d.right=Cs(m.right,d.right),d.bottom=Cs(m.bottom,d.bottom),d.left=pr(m.left,d.left),d},FC(t,l,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function QB(e){return NT(e)}function JB(e,t,n){const r=Ho(t),o=Ci(t),i=n==="fixed",s=Ra(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const u=$s(0);if(r||!r&&!i)if((ks(t)!=="body"||Ad(o))&&(l=jm(t)),r){const d=Ra(t,!0,i,t);u.x=d.x+t.clientLeft,u.y=d.y+t.clientTop}else o&&(u.x=IT(o));return{x:s.left+l.scrollLeft-u.x,y:s.top+l.scrollTop-u.y,width:s.width,height:s.height}}function jC(e,t){return!Ho(e)||Xr(e).position==="fixed"?null:t?t(e):e.offsetParent}function FT(e,t){const n=vr(e);if(!Ho(e))return n;let r=jC(e,t);for(;r&&BB(r)&&Xr(r).position==="static";)r=jC(r,t);return r&&(ks(r)==="html"||ks(r)==="body"&&Xr(r).position==="static"&&!px(r))?n:r||UB(e)||n}const eU=async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||FT,i=this.getDimensions;return{reference:JB(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}};function tU(e){return Xr(e).direction==="rtl"}const nU={convertOffsetParentRelativeRectToViewportRelativeRect:HB,getDocumentElement:Ci,getClippingRect:qB,getOffsetParent:FT,getElementRects:eU,getClientRects:KB,getDimensions:QB,getScale:Rl,isElement:xi,isRTL:tU};function rU(e,t){let n=null,r;const o=Ci(e);function i(){clearTimeout(r),n&&n.disconnect(),n=null}function s(l,u){l===void 0&&(l=!1),u===void 0&&(u=1),i();const{left:d,top:h,width:m,height:g}=e.getBoundingClientRect();if(l||t(),!m||!g)return;const y=ip(h),x=ip(o.clientWidth-(d+m)),_=ip(o.clientHeight-(h+g)),C=ip(d),b={rootMargin:-y+"px "+-x+"px "+-_+"px "+-C+"px",threshold:pr(0,Cs(1,u))||1};let E=!0;function k(P){const M=P[0].intersectionRatio;if(M!==u){if(!E)return s();M?s(!1,M):r=setTimeout(()=>{s(!1,1e-7)},100)}E=!1}try{n=new IntersectionObserver(k,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(k,b)}n.observe(e)}return s(!0),i}function oU(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,d=mx(e),h=o||i?[...d?nd(d):[],...nd(t)]:[];h.forEach(S=>{o&&S.addEventListener("scroll",n,{passive:!0}),i&&S.addEventListener("resize",n)});const m=d&&l?rU(d,n):null;let g=-1,y=null;s&&(y=new ResizeObserver(S=>{let[b]=S;b&&b.target===d&&y&&(y.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{y&&y.observe(t)})),n()}),d&&!u&&y.observe(d),y.observe(t));let x,_=u?Ra(e):null;u&&C();function C(){const S=Ra(e);_&&(S.x!==_.x||S.y!==_.y||S.width!==_.width||S.height!==_.height)&&n(),_=S,x=requestAnimationFrame(C)}return n(),()=>{h.forEach(S=>{o&&S.removeEventListener("scroll",n),i&&S.removeEventListener("resize",n)}),m&&m(),y&&y.disconnect(),y=null,u&&cancelAnimationFrame(x)}}const iU=(e,t,n)=>{const r=new Map,o={platform:nU,...n},i={...o.platform,_c:r};return MB(e,t,{...o,platform:i})},sU=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?NC({element:r.current,padding:o}).fn(n):{}:r?NC({element:r,padding:o}).fn(n):{}}}};var Vp=typeof document<"u"?f.useLayoutEffect:f.useEffect;function Ih(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(!Ih(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 i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Ih(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function jT(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function zC(e,t){const n=jT(e);return Math.round(t*n)/n}function BC(e){const t=f.useRef(e);return Vp(()=>{t.current=e}),t}function aU(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:u,open:d}=e,[h,m]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,y]=f.useState(r);Ih(g,r)||y(r);const[x,_]=f.useState(null),[C,S]=f.useState(null),b=f.useCallback(L=>{L!=M.current&&(M.current=L,_(L))},[_]),E=f.useCallback(L=>{L!==A.current&&(A.current=L,S(L))},[S]),k=i||x,P=s||C,M=f.useRef(null),A=f.useRef(null),O=f.useRef(h),F=BC(u),V=BC(o),J=f.useCallback(()=>{if(!M.current||!A.current)return;const L={placement:t,strategy:n,middleware:g};V.current&&(L.platform=V.current),iU(M.current,A.current,L).then(ie=>{const K={...ie,isPositioned:!0};G.current&&!Ih(O.current,K)&&(O.current=K,Os.flushSync(()=>{m(K)}))})},[g,t,n,V]);Vp(()=>{d===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,m(L=>({...L,isPositioned:!1})))},[d]);const G=f.useRef(!1);Vp(()=>(G.current=!0,()=>{G.current=!1}),[]),Vp(()=>{if(k&&(M.current=k),P&&(A.current=P),k&&P){if(F.current)return F.current(k,P,J);J()}},[k,P,J,F]);const ae=f.useMemo(()=>({reference:M,floating:A,setReference:b,setFloating:E}),[b,E]),U=f.useMemo(()=>({reference:k,floating:P}),[k,P]),te=f.useMemo(()=>{const L={position:n,left:0,top:0};if(!U.floating)return L;const ie=zC(U.floating,h.x),K=zC(U.floating,h.y);return l?{...L,transform:"translate("+ie+"px, "+K+"px)",...jT(U.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ie,top:K}},[n,l,U.floating,h.x,h.y]);return f.useMemo(()=>({...h,update:J,refs:ae,elements:U,floatingStyles:te}),[h,J,ae,U,te])}function gx(e){const[t,n]=f.useState(void 0);return Pn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,l;if("borderBoxSize"in i){const u=i.borderBoxSize,d=Array.isArray(u)?u[0]:u;s=d.inlineSize,l=d.blockSize}else s=e.offsetWidth,l=e.offsetHeight;n({width:s,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const zT="Popper",[BT,Ns]=An(zT),[lU,UT]=BT(zT),cU=e=>{const{__scopePopper:t,children:n}=e,[r,o]=f.useState(null);return f.createElement(lU,{scope:t,anchor:r,onAnchorChange:o},n)},uU="PopperAnchor",dU=f.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=UT(uU,n),s=f.useRef(null),l=Be(t,s);return f.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:f.createElement(Pe.div,Y({},o,{ref:l}))}),VT="PopperContent",[fU,hte]=BT(VT),pU=f.forwardRef((e,t)=>{var n,r,o,i,s,l,u,d;const{__scopePopper:h,side:m="bottom",sideOffset:g=0,align:y="center",alignOffset:x=0,arrowPadding:_=0,avoidCollisions:C=!0,collisionBoundary:S=[],collisionPadding:b=0,sticky:E="partial",hideWhenDetached:k=!1,updatePositionStrategy:P="optimized",onPlaced:M,...A}=e,O=UT(VT,h),[F,V]=f.useState(null),J=Be(t,Yt=>V(Yt)),[G,ae]=f.useState(null),U=gx(G),te=(n=U==null?void 0:U.width)!==null&&n!==void 0?n:0,L=(r=U==null?void 0:U.height)!==null&&r!==void 0?r:0,ie=m+(y!=="center"?"-"+y:""),K=typeof b=="number"?b:{top:0,right:0,bottom:0,left:0,...b},Q=Array.isArray(S)?S:[S],W=Q.length>0,le={padding:K,boundary:Q.filter(hU),altBoundary:W},{refs:ge,floatingStyles:Ve,placement:Ue,isPositioned:We,middlewareData:Me}=aU({strategy:"fixed",placement:ie,whileElementsMounted:(...Yt)=>oU(...Yt,{animationFrame:P==="always"}),elements:{reference:O.anchor},middleware:[LB({mainAxis:g+L,alignmentAxis:x}),C&&FB({mainAxis:!0,crossAxis:!1,limiter:E==="partial"?jB():void 0,...le}),C&&NB({...le}),zB({...le,apply:({elements:Yt,rects:Er,availableWidth:gt,availableHeight:js})=>{const{width:I,height:X}=Er.reference,Z=Yt.floating.style;Z.setProperty("--radix-popper-available-width",`${gt}px`),Z.setProperty("--radix-popper-available-height",`${js}px`),Z.setProperty("--radix-popper-anchor-width",`${I}px`),Z.setProperty("--radix-popper-anchor-height",`${X}px`)}}),G&&sU({element:G,padding:_}),mU({arrowWidth:te,arrowHeight:L}),k&&DB({strategy:"referenceHidden",...le})]}),[fe,xe]=WT(Ue),$e=Ft(M);Pn(()=>{We&&($e==null||$e())},[We,$e]);const Ae=(o=Me.arrow)===null||o===void 0?void 0:o.x,Oe=(i=Me.arrow)===null||i===void 0?void 0:i.y,je=((s=Me.arrow)===null||s===void 0?void 0:s.centerOffset)!==0,[Ot,ct]=f.useState();return Pn(()=>{F&&ct(window.getComputedStyle(F).zIndex)},[F]),f.createElement("div",{ref:ge.setFloating,"data-radix-popper-content-wrapper":"",style:{...Ve,transform:We?Ve.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ot,"--radix-popper-transform-origin":[(l=Me.transformOrigin)===null||l===void 0?void 0:l.x,(u=Me.transformOrigin)===null||u===void 0?void 0:u.y].join(" ")},dir:e.dir},f.createElement(fU,{scope:h,placedSide:fe,onArrowChange:ae,arrowX:Ae,arrowY:Oe,shouldHideArrow:je},f.createElement(Pe.div,Y({"data-side":fe,"data-align":xe},A,{ref:J,style:{...A.style,animation:We?void 0:"none",opacity:(d=Me.hide)!==null&&d!==void 0&&d.referenceHidden?0:void 0}}))))});function hU(e){return e!==null}const mU=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o,i,s;const{placement:l,rects:u,middlewareData:d}=t,m=((n=d.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,g=m?0:e.arrowWidth,y=m?0:e.arrowHeight,[x,_]=WT(l),C={start:"0%",center:"50%",end:"100%"}[_],S=((r=(o=d.arrow)===null||o===void 0?void 0:o.x)!==null&&r!==void 0?r:0)+g/2,b=((i=(s=d.arrow)===null||s===void 0?void 0:s.y)!==null&&i!==void 0?i:0)+y/2;let E="",k="";return x==="bottom"?(E=m?C:`${S}px`,k=`${-y}px`):x==="top"?(E=m?C:`${S}px`,k=`${u.floating.height+y}px`):x==="right"?(E=`${-y}px`,k=m?C:`${b}px`):x==="left"&&(E=`${u.floating.width+y}px`,k=m?C:`${b}px`),{data:{x:E,y:k}}}});function WT(e){const[t,n="center"]=e.split("-");return[t,n]}const Od=cU,zm=dU,Bm=pU,Md=f.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...o}=e;return r?XI.createPortal(f.createElement(Pe.div,Y({},o,{ref:t})),r):null});function gU(e,t){return f.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const xn=e=>{const{present:t,children:n}=e,r=vU(t),o=typeof n=="function"?n({present:r.isPresent}):f.Children.only(n),i=Be(r.ref,o.ref);return typeof n=="function"||r.isPresent?f.cloneElement(o,{ref:i}):null};xn.displayName="Presence";function vU(e){const[t,n]=f.useState(),r=f.useRef({}),o=f.useRef(e),i=f.useRef("none"),s=e?"mounted":"unmounted",[l,u]=gU(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const d=sp(r.current);i.current=l==="mounted"?d:"none"},[l]),Pn(()=>{const d=r.current,h=o.current;if(h!==e){const g=i.current,y=sp(d);e?u("MOUNT"):y==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(h&&g!==y?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),Pn(()=>{if(t){const d=m=>{const y=sp(r.current).includes(m.animationName);m.target===t&&y&&Os.flushSync(()=>u("ANIMATION_END"))},h=m=>{m.target===t&&(i.current=sp(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:f.useCallback(d=>{d&&(r.current=getComputedStyle(d)),n(d)},[])}}function sp(e){return(e==null?void 0:e.animationName)||"none"}function Zr({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=yU({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,l=Ft(n),u=f.useCallback(d=>{if(i){const m=typeof d=="function"?d(e):d;m!==e&&l(m)}else o(d)},[i,e,o,l]);return[s,u]}function yU({defaultProp:e,onChange:t}){const n=f.useState(e),[r]=n,o=f.useRef(r),i=Ft(t);return f.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const Um=f.forwardRef((e,t)=>f.createElement(Pe.span,Y({},e,{ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}))),wU=Um,[Vm,mte]=An("Tooltip",[Ns]),vx=Ns(),xU="TooltipProvider",bU=700,l1="tooltip.open",[_U,yx]=Vm(xU),SU=e=>{const{__scopeTooltip:t,delayDuration:n=bU,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,[s,l]=f.useState(!0),u=f.useRef(!1),d=f.useRef(0);return f.useEffect(()=>{const h=d.current;return()=>window.clearTimeout(h)},[]),f.createElement(_U,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:f.useCallback(()=>{window.clearTimeout(d.current),l(!1)},[]),onClose:f.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>l(!0),r)},[r]),isPointerInTransitRef:u,onPointerInTransitChange:f.useCallback(h=>{u.current=h},[]),disableHoverableContent:o},i)},wx="Tooltip",[EU,Wm]=Vm(wx),CU=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:s,delayDuration:l}=e,u=yx(wx,e.__scopeTooltip),d=vx(t),[h,m]=f.useState(null),g=nr(),y=f.useRef(0),x=s??u.disableHoverableContent,_=l??u.delayDuration,C=f.useRef(!1),[S=!1,b]=Zr({prop:r,defaultProp:o,onChange:A=>{A?(u.onOpen(),document.dispatchEvent(new CustomEvent(l1))):u.onClose(),i==null||i(A)}}),E=f.useMemo(()=>S?C.current?"delayed-open":"instant-open":"closed",[S]),k=f.useCallback(()=>{window.clearTimeout(y.current),C.current=!1,b(!0)},[b]),P=f.useCallback(()=>{window.clearTimeout(y.current),b(!1)},[b]),M=f.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{C.current=!0,b(!0)},_)},[_,b]);return f.useEffect(()=>()=>window.clearTimeout(y.current),[]),f.createElement(Od,d,f.createElement(EU,{scope:t,contentId:g,open:S,stateAttribute:E,trigger:h,onTriggerChange:m,onTriggerEnter:f.useCallback(()=>{u.isOpenDelayed?M():k()},[u.isOpenDelayed,M,k]),onTriggerLeave:f.useCallback(()=>{x?P():window.clearTimeout(y.current)},[P,x]),onOpen:k,onClose:P,disableHoverableContent:x},n))},UC="TooltipTrigger",$U=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Wm(UC,n),i=yx(UC,n),s=vx(n),l=f.useRef(null),u=Be(t,l,o.onTriggerChange),d=f.useRef(!1),h=f.useRef(!1),m=f.useCallback(()=>d.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),f.createElement(zm,Y({asChild:!0},s),f.createElement(Pe.button,Y({"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute},r,{ref:u,onPointerMove:ue(e.onPointerMove,g=>{g.pointerType!=="touch"&&!h.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),h.current=!0)}),onPointerLeave:ue(e.onPointerLeave,()=>{o.onTriggerLeave(),h.current=!1}),onPointerDown:ue(e.onPointerDown,()=>{d.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:ue(e.onFocus,()=>{d.current||o.onOpen()}),onBlur:ue(e.onBlur,o.onClose),onClick:ue(e.onClick,o.onClose)})))}),kU="TooltipPortal",[gte,RU]=Vm(kU,{forceMount:void 0}),rd="TooltipContent",TU=f.forwardRef((e,t)=>{const n=RU(rd,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=Wm(rd,e.__scopeTooltip);return f.createElement(xn,{present:r||s.open},s.disableHoverableContent?f.createElement(HT,Y({side:o},i,{ref:t})):f.createElement(PU,Y({side:o},i,{ref:t})))}),PU=f.forwardRef((e,t)=>{const n=Wm(rd,e.__scopeTooltip),r=yx(rd,e.__scopeTooltip),o=f.useRef(null),i=Be(t,o),[s,l]=f.useState(null),{trigger:u,onClose:d}=n,h=o.current,{onPointerInTransitChange:m}=r,g=f.useCallback(()=>{l(null),m(!1)},[m]),y=f.useCallback((x,_)=>{const C=x.currentTarget,S={x:x.clientX,y:x.clientY},b=OU(S,C.getBoundingClientRect()),E=MU(S,b),k=NU(_.getBoundingClientRect()),P=IU([...E,...k]);l(P),m(!0)},[m]);return f.useEffect(()=>()=>g(),[g]),f.useEffect(()=>{if(u&&h){const x=C=>y(C,h),_=C=>y(C,u);return u.addEventListener("pointerleave",x),h.addEventListener("pointerleave",_),()=>{u.removeEventListener("pointerleave",x),h.removeEventListener("pointerleave",_)}}},[u,h,y,g]),f.useEffect(()=>{if(s){const x=_=>{const C=_.target,S={x:_.clientX,y:_.clientY},b=(u==null?void 0:u.contains(C))||(h==null?void 0:h.contains(C)),E=!DU(S,s);b?g():E&&(g(),d())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[u,h,s,d,g]),f.createElement(HT,Y({},e,{ref:i}))}),[AU,vte]=Vm(wx,{isInside:!1}),HT=f.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...l}=e,u=Wm(rd,n),d=vx(n),{onClose:h}=u;return f.useEffect(()=>(document.addEventListener(l1,h),()=>document.removeEventListener(l1,h)),[h]),f.useEffect(()=>{if(u.trigger){const m=g=>{const y=g.target;y!=null&&y.contains(u.trigger)&&h()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[u.trigger,h]),f.createElement(yc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:m=>m.preventDefault(),onDismiss:h},f.createElement(Bm,Y({"data-state":u.stateAttribute},d,l,{ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}}),f.createElement(sx,null,r),f.createElement(AU,{scope:n,isInside:!0},f.createElement(wU,{id:u.contentId,role:"tooltip"},o||r))))});function OU(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function MU(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function NU(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function DU(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i =c?a:c)),a}function Pr(a,c,p,w,$,T){var N,D=c&m,B=c&g,ne=c&y;if(p&&(N=$?p(a,w,$,T):p(a)),N!==n)return N;if(!It(a))return a;var re=Ye(a);if(re){if(N=QM(a),!D)return Wn(a,N)}else{var se=Sn(a),me=se==je||se==Ot;if(Fi(a))return R_(a,D);if(se==gt||se==We||me&&!$){if(N=B||me?{}:Y_(a),!D)return B?BM(a,uM(N,a)):zM(a,o_(N,a))}else{if(!Et[se])return $?a:{};N=JM(a,se,D)}}T||(T=new eo);var Re=T.get(a);if(Re)return Re;T.set(a,N),_S(a)?a.forEach(function(Le){N.add(Pr(Le,c,p,Le,a,T))}):xS(a)&&a.forEach(function(Le,nt){N.set(nt,Pr(Le,c,p,nt,a,T))});var Ie=ne?B?dv:uv:B?Kn:ln,Qe=re?n:Ie(a);return kr(Qe||a,function(Le,nt){Qe&&(nt=Le,Le=a[nt]),Fc(N,nt,Pr(Le,c,p,nt,a,T))}),N}function dM(a){var c=ln(a);return function(p){return i_(p,a,c)}}function i_(a,c,p){var w=p.length;if(a==null)return!w;for(a=_t(a);w--;){var $=p[w],T=c[$],N=a[$];if(N===n&&!($ in a)||!T(N))return!1}return!0}function s_(a,c,p){if(typeof a!="function")throw new Rr(s);return Hc(function(){a.apply(n,p)},c)}function jc(a,c,p,w){var $=-1,T=Qd,N=!0,D=a.length,B=[],ne=c.length;if(!D)return B;p&&(c=Mt(c,ir(p))),w?(T=Ag,N=!1):c.length>=o&&(T=Oc,N=!1,c=new Ws(c));e:for(;++$ -1?$[T?c[N]:N]:n}}function L_(a){return Jo(function(c){var p=c.length,w=p,$=Tr.prototype.thru;for(a&&c.reverse();w--;){var T=c[w];if(typeof T!="function")throw new Rr(s);if($&&!N&&kf(T)=="wrapper")var N=new Tr([],!0)}for(w=N?w:p;++w 1&&at.reverse(),re&&B M&&(x=M)}return{[g]:y,[m]:x}}}},BB=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...l}=yi(e,t),u=await td(t,l),d=wi(n),h=wc(n),m=xc(n)==="y",{width:g,height:y}=r.floating;let x,_;d==="top"||d==="bottom"?(x=d,_=h===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(_=d,x=h==="end"?"top":"bottom");const C=y-u[x],S=g-u[_],b=!t.middlewareData.shift;let E=C,k=S;if(m){const M=g-u.left-u.right;k=h||b?Cs(S,M):M}else{const M=y-u.top-u.bottom;E=h||b?Cs(C,M):M}if(b&&!h){const M=pr(u.left,0),A=pr(u.right,0),O=pr(u.top,0),F=pr(u.bottom,0);m?k=g-2*(M!==0||A!==0?M+A:pr(u.left,u.right)):E=y-2*(O!==0||F!==0?O+F:pr(u.top,u.bottom))}await s({...t,availableWidth:k,availableHeight:E});const P=await o.getDimensions(i.floating);return g!==P.width||y!==P.height?{reset:{rects:!0}}:{}}}};function ks(e){return OT(e)?(e.nodeName||"").toLowerCase():"#document"}function vr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ci(e){var t;return(t=(OT(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function OT(e){return e instanceof Node||e instanceof vr(e).Node}function xi(e){return e instanceof Element||e instanceof vr(e).Element}function Ho(e){return e instanceof HTMLElement||e instanceof vr(e).HTMLElement}function LC(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof vr(e).ShadowRoot}function Ad(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Xr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function UB(e){return["table","td","th"].includes(ks(e))}function px(e){const t=hx(),n=Xr(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 VB(e){let t=rc(e);for(;Ho(t)&&!Fm(t);){if(px(t))return t;t=rc(t)}return null}function hx(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Fm(e){return["html","body","#document"].includes(ks(e))}function Xr(e){return vr(e).getComputedStyle(e)}function jm(e){return xi(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function rc(e){if(ks(e)==="html")return e;const t=e.assignedSlot||e.parentNode||LC(e)&&e.host||Ci(e);return LC(t)?t.host:t}function MT(e){const t=rc(e);return Fm(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ho(t)&&Ad(t)?t:MT(t)}function nd(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=MT(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=vr(o);return i?t.concat(s,s.visualViewport||[],Ad(o)?o:[],s.frameElement&&n?nd(s.frameElement):[]):t.concat(o,nd(o,[],n))}function NT(e){const t=Xr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Ho(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,l=Mh(n)!==i||Mh(r)!==s;return l&&(n=i,r=s),{width:n,height:r,$:l}}function mx(e){return xi(e)?e:e.contextElement}function Rl(e){const t=mx(e);if(!Ho(t))return $s(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=NT(t);let s=(i?Mh(n.width):n.width)/r,l=(i?Mh(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}const WB=$s(0);function DT(e){const t=vr(e);return!hx()||!t.visualViewport?WB:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function HB(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==vr(e)?!1:t}function Ra(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=mx(e);let s=$s(1);t&&(r?xi(r)&&(s=Rl(r)):s=Rl(e));const l=HB(i,n,r)?DT(i):$s(0);let u=(o.left+l.x)/s.x,d=(o.top+l.y)/s.y,h=o.width/s.x,m=o.height/s.y;if(i){const g=vr(i),y=r&&xi(r)?vr(r):r;let x=g.frameElement;for(;x&&r&&y!==g;){const _=Rl(x),C=x.getBoundingClientRect(),S=Xr(x),b=C.left+(x.clientLeft+parseFloat(S.paddingLeft))*_.x,E=C.top+(x.clientTop+parseFloat(S.paddingTop))*_.y;u*=_.x,d*=_.y,h*=_.x,m*=_.y,u+=b,d+=E,x=vr(x).frameElement}}return Dh({width:h,height:m,x:u,y:d})}function KB(e){let{rect:t,offsetParent:n,strategy:r}=e;const o=Ho(n),i=Ci(n);if(n===i)return t;let s={scrollLeft:0,scrollTop:0},l=$s(1);const u=$s(0);if((o||!o&&r!=="fixed")&&((ks(n)!=="body"||Ad(i))&&(s=jm(n)),Ho(n))){const d=Ra(n);l=Rl(n),u.x=d.x+n.clientLeft,u.y=d.y+n.clientTop}return{width:t.width*l.x,height:t.height*l.y,x:t.x*l.x-s.scrollLeft*l.x+u.x,y:t.y*l.y-s.scrollTop*l.y+u.y}}function YB(e){return Array.from(e.getClientRects())}function IT(e){return Ra(Ci(e)).left+jm(e).scrollLeft}function GB(e){const t=Ci(e),n=jm(e),r=e.ownerDocument.body,o=pr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=pr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+IT(e);const l=-n.scrollTop;return Xr(r).direction==="rtl"&&(s+=pr(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:l}}function XB(e,t){const n=vr(e),r=Ci(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,l=0,u=0;if(o){i=o.width,s=o.height;const d=hx();(!d||d&&t==="fixed")&&(l=o.offsetLeft,u=o.offsetTop)}return{width:i,height:s,x:l,y:u}}function ZB(e,t){const n=Ra(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Ho(e)?Rl(e):$s(1),s=e.clientWidth*i.x,l=e.clientHeight*i.y,u=o*i.x,d=r*i.y;return{width:s,height:l,x:u,y:d}}function FC(e,t,n){let r;if(t==="viewport")r=XB(e,n);else if(t==="document")r=GB(Ci(e));else if(xi(t))r=ZB(t,n);else{const o=DT(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return Dh(r)}function LT(e,t){const n=rc(e);return n===t||!xi(n)||Fm(n)?!1:Xr(n).position==="fixed"||LT(n,t)}function qB(e,t){const n=t.get(e);if(n)return n;let r=nd(e,[],!1).filter(l=>xi(l)&&ks(l)!=="body"),o=null;const i=Xr(e).position==="fixed";let s=i?rc(e):e;for(;xi(s)&&!Fm(s);){const l=Xr(s),u=px(s);!u&&l.position==="fixed"&&(o=null),(i?!u&&!o:!u&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Ad(s)&&!u&<(e,s))?r=r.filter(h=>h!==s):o=l,s=rc(s)}return t.set(e,r),r}function QB(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?qB(t,this._c):[].concat(n),r],l=s[0],u=s.reduce((d,h)=>{const m=FC(t,h,o);return d.top=pr(m.top,d.top),d.right=Cs(m.right,d.right),d.bottom=Cs(m.bottom,d.bottom),d.left=pr(m.left,d.left),d},FC(t,l,o));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function JB(e){return NT(e)}function eU(e,t,n){const r=Ho(t),o=Ci(t),i=n==="fixed",s=Ra(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const u=$s(0);if(r||!r&&!i)if((ks(t)!=="body"||Ad(o))&&(l=jm(t)),r){const d=Ra(t,!0,i,t);u.x=d.x+t.clientLeft,u.y=d.y+t.clientTop}else o&&(u.x=IT(o));return{x:s.left+l.scrollLeft-u.x,y:s.top+l.scrollTop-u.y,width:s.width,height:s.height}}function jC(e,t){return!Ho(e)||Xr(e).position==="fixed"?null:t?t(e):e.offsetParent}function FT(e,t){const n=vr(e);if(!Ho(e))return n;let r=jC(e,t);for(;r&&UB(r)&&Xr(r).position==="static";)r=jC(r,t);return r&&(ks(r)==="html"||ks(r)==="body"&&Xr(r).position==="static"&&!px(r))?n:r||VB(e)||n}const tU=async function(e){let{reference:t,floating:n,strategy:r}=e;const o=this.getOffsetParent||FT,i=this.getDimensions;return{reference:eU(t,await o(n),r),floating:{x:0,y:0,...await i(n)}}};function nU(e){return Xr(e).direction==="rtl"}const rU={convertOffsetParentRelativeRectToViewportRelativeRect:KB,getDocumentElement:Ci,getClippingRect:QB,getOffsetParent:FT,getElementRects:tU,getClientRects:YB,getDimensions:JB,getScale:Rl,isElement:xi,isRTL:nU};function oU(e,t){let n=null,r;const o=Ci(e);function i(){clearTimeout(r),n&&n.disconnect(),n=null}function s(l,u){l===void 0&&(l=!1),u===void 0&&(u=1),i();const{left:d,top:h,width:m,height:g}=e.getBoundingClientRect();if(l||t(),!m||!g)return;const y=ip(h),x=ip(o.clientWidth-(d+m)),_=ip(o.clientHeight-(h+g)),C=ip(d),b={rootMargin:-y+"px "+-x+"px "+-_+"px "+-C+"px",threshold:pr(0,Cs(1,u))||1};let E=!0;function k(P){const M=P[0].intersectionRatio;if(M!==u){if(!E)return s();M?s(!1,M):r=setTimeout(()=>{s(!1,1e-7)},100)}E=!1}try{n=new IntersectionObserver(k,{...b,root:o.ownerDocument})}catch{n=new IntersectionObserver(k,b)}n.observe(e)}return s(!0),i}function iU(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,d=mx(e),h=o||i?[...d?nd(d):[],...nd(t)]:[];h.forEach(S=>{o&&S.addEventListener("scroll",n,{passive:!0}),i&&S.addEventListener("resize",n)});const m=d&&l?oU(d,n):null;let g=-1,y=null;s&&(y=new ResizeObserver(S=>{let[b]=S;b&&b.target===d&&y&&(y.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{y&&y.observe(t)})),n()}),d&&!u&&y.observe(d),y.observe(t));let x,_=u?Ra(e):null;u&&C();function C(){const S=Ra(e);_&&(S.x!==_.x||S.y!==_.y||S.width!==_.width||S.height!==_.height)&&n(),_=S,x=requestAnimationFrame(C)}return n(),()=>{h.forEach(S=>{o&&S.removeEventListener("scroll",n),i&&S.removeEventListener("resize",n)}),m&&m(),y&&y.disconnect(),y=null,u&&cancelAnimationFrame(x)}}const sU=(e,t,n)=>{const r=new Map,o={platform:rU,...n},i={...o.platform,_c:r};return NB(e,t,{...o,platform:i})},aU=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?NC({element:r.current,padding:o}).fn(n):{}:r?NC({element:r,padding:o}).fn(n):{}}}};var Vp=typeof document<"u"?f.useLayoutEffect:f.useEffect;function Ih(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(!Ih(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 i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Ih(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function jT(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function zC(e,t){const n=jT(e);return Math.round(t*n)/n}function BC(e){const t=f.useRef(e);return Vp(()=>{t.current=e}),t}function lU(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:u,open:d}=e,[h,m]=f.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,y]=f.useState(r);Ih(g,r)||y(r);const[x,_]=f.useState(null),[C,S]=f.useState(null),b=f.useCallback(L=>{L!=M.current&&(M.current=L,_(L))},[_]),E=f.useCallback(L=>{L!==A.current&&(A.current=L,S(L))},[S]),k=i||x,P=s||C,M=f.useRef(null),A=f.useRef(null),O=f.useRef(h),F=BC(u),V=BC(o),J=f.useCallback(()=>{if(!M.current||!A.current)return;const L={placement:t,strategy:n,middleware:g};V.current&&(L.platform=V.current),sU(M.current,A.current,L).then(ie=>{const K={...ie,isPositioned:!0};G.current&&!Ih(O.current,K)&&(O.current=K,Os.flushSync(()=>{m(K)}))})},[g,t,n,V]);Vp(()=>{d===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,m(L=>({...L,isPositioned:!1})))},[d]);const G=f.useRef(!1);Vp(()=>(G.current=!0,()=>{G.current=!1}),[]),Vp(()=>{if(k&&(M.current=k),P&&(A.current=P),k&&P){if(F.current)return F.current(k,P,J);J()}},[k,P,J,F]);const ae=f.useMemo(()=>({reference:M,floating:A,setReference:b,setFloating:E}),[b,E]),U=f.useMemo(()=>({reference:k,floating:P}),[k,P]),te=f.useMemo(()=>{const L={position:n,left:0,top:0};if(!U.floating)return L;const ie=zC(U.floating,h.x),K=zC(U.floating,h.y);return l?{...L,transform:"translate("+ie+"px, "+K+"px)",...jT(U.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ie,top:K}},[n,l,U.floating,h.x,h.y]);return f.useMemo(()=>({...h,update:J,refs:ae,elements:U,floatingStyles:te}),[h,J,ae,U,te])}function gx(e){const[t,n]=f.useState(void 0);return Pn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,l;if("borderBoxSize"in i){const u=i.borderBoxSize,d=Array.isArray(u)?u[0]:u;s=d.inlineSize,l=d.blockSize}else s=e.offsetWidth,l=e.offsetHeight;n({width:s,height:l})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}const zT="Popper",[BT,Ns]=An(zT),[cU,UT]=BT(zT),uU=e=>{const{__scopePopper:t,children:n}=e,[r,o]=f.useState(null);return f.createElement(cU,{scope:t,anchor:r,onAnchorChange:o},n)},dU="PopperAnchor",fU=f.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=UT(dU,n),s=f.useRef(null),l=Be(t,s);return f.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:f.createElement(Pe.div,Y({},o,{ref:l}))}),VT="PopperContent",[pU,mte]=BT(VT),hU=f.forwardRef((e,t)=>{var n,r,o,i,s,l,u,d;const{__scopePopper:h,side:m="bottom",sideOffset:g=0,align:y="center",alignOffset:x=0,arrowPadding:_=0,avoidCollisions:C=!0,collisionBoundary:S=[],collisionPadding:b=0,sticky:E="partial",hideWhenDetached:k=!1,updatePositionStrategy:P="optimized",onPlaced:M,...A}=e,O=UT(VT,h),[F,V]=f.useState(null),J=Be(t,Yt=>V(Yt)),[G,ae]=f.useState(null),U=gx(G),te=(n=U==null?void 0:U.width)!==null&&n!==void 0?n:0,L=(r=U==null?void 0:U.height)!==null&&r!==void 0?r:0,ie=m+(y!=="center"?"-"+y:""),K=typeof b=="number"?b:{top:0,right:0,bottom:0,left:0,...b},Q=Array.isArray(S)?S:[S],W=Q.length>0,le={padding:K,boundary:Q.filter(mU),altBoundary:W},{refs:ge,floatingStyles:Ve,placement:Ue,isPositioned:We,middlewareData:Me}=lU({strategy:"fixed",placement:ie,whileElementsMounted:(...Yt)=>iU(...Yt,{animationFrame:P==="always"}),elements:{reference:O.anchor},middleware:[FB({mainAxis:g+L,alignmentAxis:x}),C&&jB({mainAxis:!0,crossAxis:!1,limiter:E==="partial"?zB():void 0,...le}),C&&DB({...le}),BB({...le,apply:({elements:Yt,rects:Er,availableWidth:gt,availableHeight:js})=>{const{width:I,height:X}=Er.reference,Z=Yt.floating.style;Z.setProperty("--radix-popper-available-width",`${gt}px`),Z.setProperty("--radix-popper-available-height",`${js}px`),Z.setProperty("--radix-popper-anchor-width",`${I}px`),Z.setProperty("--radix-popper-anchor-height",`${X}px`)}}),G&&aU({element:G,padding:_}),gU({arrowWidth:te,arrowHeight:L}),k&&IB({strategy:"referenceHidden",...le})]}),[fe,xe]=WT(Ue),$e=Ft(M);Pn(()=>{We&&($e==null||$e())},[We,$e]);const Ae=(o=Me.arrow)===null||o===void 0?void 0:o.x,Oe=(i=Me.arrow)===null||i===void 0?void 0:i.y,je=((s=Me.arrow)===null||s===void 0?void 0:s.centerOffset)!==0,[Ot,ct]=f.useState();return Pn(()=>{F&&ct(window.getComputedStyle(F).zIndex)},[F]),f.createElement("div",{ref:ge.setFloating,"data-radix-popper-content-wrapper":"",style:{...Ve,transform:We?Ve.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Ot,"--radix-popper-transform-origin":[(l=Me.transformOrigin)===null||l===void 0?void 0:l.x,(u=Me.transformOrigin)===null||u===void 0?void 0:u.y].join(" ")},dir:e.dir},f.createElement(pU,{scope:h,placedSide:fe,onArrowChange:ae,arrowX:Ae,arrowY:Oe,shouldHideArrow:je},f.createElement(Pe.div,Y({"data-side":fe,"data-align":xe},A,{ref:J,style:{...A.style,animation:We?void 0:"none",opacity:(d=Me.hide)!==null&&d!==void 0&&d.referenceHidden?0:void 0}}))))});function mU(e){return e!==null}const gU=e=>({name:"transformOrigin",options:e,fn(t){var n,r,o,i,s;const{placement:l,rects:u,middlewareData:d}=t,m=((n=d.arrow)===null||n===void 0?void 0:n.centerOffset)!==0,g=m?0:e.arrowWidth,y=m?0:e.arrowHeight,[x,_]=WT(l),C={start:"0%",center:"50%",end:"100%"}[_],S=((r=(o=d.arrow)===null||o===void 0?void 0:o.x)!==null&&r!==void 0?r:0)+g/2,b=((i=(s=d.arrow)===null||s===void 0?void 0:s.y)!==null&&i!==void 0?i:0)+y/2;let E="",k="";return x==="bottom"?(E=m?C:`${S}px`,k=`${-y}px`):x==="top"?(E=m?C:`${S}px`,k=`${u.floating.height+y}px`):x==="right"?(E=`${-y}px`,k=m?C:`${b}px`):x==="left"&&(E=`${u.floating.width+y}px`,k=m?C:`${b}px`),{data:{x:E,y:k}}}});function WT(e){const[t,n="center"]=e.split("-");return[t,n]}const Od=uU,zm=fU,Bm=hU,Md=f.forwardRef((e,t)=>{var n;const{container:r=globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body,...o}=e;return r?XI.createPortal(f.createElement(Pe.div,Y({},o,{ref:t})),r):null});function vU(e,t){return f.useReducer((n,r)=>{const o=t[n][r];return o??n},e)}const xn=e=>{const{present:t,children:n}=e,r=yU(t),o=typeof n=="function"?n({present:r.isPresent}):f.Children.only(n),i=Be(r.ref,o.ref);return typeof n=="function"||r.isPresent?f.cloneElement(o,{ref:i}):null};xn.displayName="Presence";function yU(e){const[t,n]=f.useState(),r=f.useRef({}),o=f.useRef(e),i=f.useRef("none"),s=e?"mounted":"unmounted",[l,u]=vU(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const d=sp(r.current);i.current=l==="mounted"?d:"none"},[l]),Pn(()=>{const d=r.current,h=o.current;if(h!==e){const g=i.current,y=sp(d);e?u("MOUNT"):y==="none"||(d==null?void 0:d.display)==="none"?u("UNMOUNT"):u(h&&g!==y?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,u]),Pn(()=>{if(t){const d=m=>{const y=sp(r.current).includes(m.animationName);m.target===t&&y&&Os.flushSync(()=>u("ANIMATION_END"))},h=m=>{m.target===t&&(i.current=sp(r.current))};return t.addEventListener("animationstart",h),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{t.removeEventListener("animationstart",h),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else u("ANIMATION_END")},[t,u]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:f.useCallback(d=>{d&&(r.current=getComputedStyle(d)),n(d)},[])}}function sp(e){return(e==null?void 0:e.animationName)||"none"}function Zr({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=wU({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,l=Ft(n),u=f.useCallback(d=>{if(i){const m=typeof d=="function"?d(e):d;m!==e&&l(m)}else o(d)},[i,e,o,l]);return[s,u]}function wU({defaultProp:e,onChange:t}){const n=f.useState(e),[r]=n,o=f.useRef(r),i=Ft(t);return f.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}const Um=f.forwardRef((e,t)=>f.createElement(Pe.span,Y({},e,{ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}))),xU=Um,[Vm,gte]=An("Tooltip",[Ns]),vx=Ns(),bU="TooltipProvider",_U=700,l1="tooltip.open",[SU,yx]=Vm(bU),EU=e=>{const{__scopeTooltip:t,delayDuration:n=_U,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,[s,l]=f.useState(!0),u=f.useRef(!1),d=f.useRef(0);return f.useEffect(()=>{const h=d.current;return()=>window.clearTimeout(h)},[]),f.createElement(SU,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:f.useCallback(()=>{window.clearTimeout(d.current),l(!1)},[]),onClose:f.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>l(!0),r)},[r]),isPointerInTransitRef:u,onPointerInTransitChange:f.useCallback(h=>{u.current=h},[]),disableHoverableContent:o},i)},wx="Tooltip",[CU,Wm]=Vm(wx),$U=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:s,delayDuration:l}=e,u=yx(wx,e.__scopeTooltip),d=vx(t),[h,m]=f.useState(null),g=nr(),y=f.useRef(0),x=s??u.disableHoverableContent,_=l??u.delayDuration,C=f.useRef(!1),[S=!1,b]=Zr({prop:r,defaultProp:o,onChange:A=>{A?(u.onOpen(),document.dispatchEvent(new CustomEvent(l1))):u.onClose(),i==null||i(A)}}),E=f.useMemo(()=>S?C.current?"delayed-open":"instant-open":"closed",[S]),k=f.useCallback(()=>{window.clearTimeout(y.current),C.current=!1,b(!0)},[b]),P=f.useCallback(()=>{window.clearTimeout(y.current),b(!1)},[b]),M=f.useCallback(()=>{window.clearTimeout(y.current),y.current=window.setTimeout(()=>{C.current=!0,b(!0)},_)},[_,b]);return f.useEffect(()=>()=>window.clearTimeout(y.current),[]),f.createElement(Od,d,f.createElement(CU,{scope:t,contentId:g,open:S,stateAttribute:E,trigger:h,onTriggerChange:m,onTriggerEnter:f.useCallback(()=>{u.isOpenDelayed?M():k()},[u.isOpenDelayed,M,k]),onTriggerLeave:f.useCallback(()=>{x?P():window.clearTimeout(y.current)},[P,x]),onOpen:k,onClose:P,disableHoverableContent:x},n))},UC="TooltipTrigger",kU=f.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Wm(UC,n),i=yx(UC,n),s=vx(n),l=f.useRef(null),u=Be(t,l,o.onTriggerChange),d=f.useRef(!1),h=f.useRef(!1),m=f.useCallback(()=>d.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",m),[m]),f.createElement(zm,Y({asChild:!0},s),f.createElement(Pe.button,Y({"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute},r,{ref:u,onPointerMove:ue(e.onPointerMove,g=>{g.pointerType!=="touch"&&!h.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),h.current=!0)}),onPointerLeave:ue(e.onPointerLeave,()=>{o.onTriggerLeave(),h.current=!1}),onPointerDown:ue(e.onPointerDown,()=>{d.current=!0,document.addEventListener("pointerup",m,{once:!0})}),onFocus:ue(e.onFocus,()=>{d.current||o.onOpen()}),onBlur:ue(e.onBlur,o.onClose),onClick:ue(e.onClick,o.onClose)})))}),RU="TooltipPortal",[vte,TU]=Vm(RU,{forceMount:void 0}),rd="TooltipContent",PU=f.forwardRef((e,t)=>{const n=TU(rd,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=Wm(rd,e.__scopeTooltip);return f.createElement(xn,{present:r||s.open},s.disableHoverableContent?f.createElement(HT,Y({side:o},i,{ref:t})):f.createElement(AU,Y({side:o},i,{ref:t})))}),AU=f.forwardRef((e,t)=>{const n=Wm(rd,e.__scopeTooltip),r=yx(rd,e.__scopeTooltip),o=f.useRef(null),i=Be(t,o),[s,l]=f.useState(null),{trigger:u,onClose:d}=n,h=o.current,{onPointerInTransitChange:m}=r,g=f.useCallback(()=>{l(null),m(!1)},[m]),y=f.useCallback((x,_)=>{const C=x.currentTarget,S={x:x.clientX,y:x.clientY},b=MU(S,C.getBoundingClientRect()),E=NU(S,b),k=DU(_.getBoundingClientRect()),P=LU([...E,...k]);l(P),m(!0)},[m]);return f.useEffect(()=>()=>g(),[g]),f.useEffect(()=>{if(u&&h){const x=C=>y(C,h),_=C=>y(C,u);return u.addEventListener("pointerleave",x),h.addEventListener("pointerleave",_),()=>{u.removeEventListener("pointerleave",x),h.removeEventListener("pointerleave",_)}}},[u,h,y,g]),f.useEffect(()=>{if(s){const x=_=>{const C=_.target,S={x:_.clientX,y:_.clientY},b=(u==null?void 0:u.contains(C))||(h==null?void 0:h.contains(C)),E=!IU(S,s);b?g():E&&(g(),d())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[u,h,s,d,g]),f.createElement(HT,Y({},e,{ref:i}))}),[OU,yte]=Vm(wx,{isInside:!1}),HT=f.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...l}=e,u=Wm(rd,n),d=vx(n),{onClose:h}=u;return f.useEffect(()=>(document.addEventListener(l1,h),()=>document.removeEventListener(l1,h)),[h]),f.useEffect(()=>{if(u.trigger){const m=g=>{const y=g.target;y!=null&&y.contains(u.trigger)&&h()};return window.addEventListener("scroll",m,{capture:!0}),()=>window.removeEventListener("scroll",m,{capture:!0})}},[u.trigger,h]),f.createElement(yc,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:m=>m.preventDefault(),onDismiss:h},f.createElement(Bm,Y({"data-state":u.stateAttribute},d,l,{ref:t,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"}}),f.createElement(sx,null,r),f.createElement(OU,{scope:n,isInside:!0},f.createElement(xU,{id:u.contentId,role:"tooltip"},o||r))))});function MU(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function NU(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function DU(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function IU(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i =c?a:c)),a}function Pr(a,c,p,w,$,T){var N,D=c&m,B=c&g,ne=c&y;if(p&&(N=$?p(a,w,$,T):p(a)),N!==n)return N;if(!It(a))return a;var re=Ye(a);if(re){if(N=QM(a),!D)return Wn(a,N)}else{var se=Sn(a),me=se==je||se==Ot;if(Fi(a))return R_(a,D);if(se==gt||se==We||me&&!$){if(N=B||me?{}:Y_(a),!D)return B?BM(a,uM(N,a)):zM(a,o_(N,a))}else{if(!Et[se])return $?a:{};N=JM(a,se,D)}}T||(T=new eo);var Re=T.get(a);if(Re)return Re;T.set(a,N),_S(a)?a.forEach(function(Le){N.add(Pr(Le,c,p,Le,a,T))}):xS(a)&&a.forEach(function(Le,nt){N.set(nt,Pr(Le,c,p,nt,a,T))});var Ie=ne?B?dv:uv:B?Kn:ln,Qe=re?n:Ie(a);return kr(Qe||a,function(Le,nt){Qe&&(nt=Le,Le=a[nt]),Fc(N,nt,Pr(Le,c,p,nt,a,T))}),N}function dM(a){var c=ln(a);return function(p){return i_(p,a,c)}}function i_(a,c,p){var w=p.length;if(a==null)return!w;for(a=_t(a);w--;){var $=p[w],T=c[$],N=a[$];if(N===n&&!($ in a)||!T(N))return!1}return!0}function s_(a,c,p){if(typeof a!="function")throw new Rr(s);return Hc(function(){a.apply(n,p)},c)}function jc(a,c,p,w){var $=-1,T=Qd,N=!0,D=a.length,B=[],ne=c.length;if(!D)return B;p&&(c=Mt(c,ir(p))),w?(T=Ag,N=!1):c.length>=o&&(T=Oc,N=!1,c=new Ws(c));e:for(;++$ -1?$[T?c[N]:N]:n}}function L_(a){return Jo(function(c){var p=c.length,w=p,$=Tr.prototype.thru;for(a&&c.reverse();w--;){var T=c[w];if(typeof T!="function")throw new Rr(s);if($&&!N&&kf(T)=="wrapper")var N=new Tr([],!0)}for(w=N?w:p;++w 1&&at.reverse(),re&&B=t&&n.push([r,o]),r=-1)}return e[i-1]&&i-r>=t&&n.push([r,i-1]),n}const ea=32;function OK(e,t,n,{location:r=He.location,distance:o=He.distance,threshold:i=He.threshold,findAllMatches:s=He.findAllMatches,minMatchCharLength:l=He.minMatchCharLength,includeMatches:u=He.includeMatches,ignoreLocation:d=He.ignoreLocation}={}){if(t.length>ea)throw new Error(wK(ea));const h=t.length,m=e.length,g=Math.max(0,Math.min(r,m));let y=i,x=g;const _=l>1||u,C=_?Array(m):[];let S;for(;(S=e.indexOf(t,x))>-1;){let A=pp(t,{currentLocation:S,expectedLocation:g,distance:o,ignoreLocation:d});if(y=Math.min(A,y),x=S+h,_){let O=0;for(;O!!(e[jh.AND]||e[jh.OR]),KK=e=>!!e[y1.PATH],YK=e=>!bi(e)&&zP(e)&&!w1(e),d2=e=>({[jh.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function YP(e,t,{auto:n=!0}={}){const r=o=>{let i=Object.keys(o);const s=KK(o);if(!s&&i.length>1&&!w1(o))return r(d2(o));if(YK(o)){const u=s?o[y1.PATH]:i[0],d=s?o[y1.PATTERN]:o[u];if(!Lo(d))throw new Error(yK(u));const h={keyId:h1(u),pattern:d};return n&&(h.searcher=v1(d,t)),h}let l={children:[],operator:i[0]};return i.forEach(u=>{const d=o[u];bi(d)&&d.forEach(h=>{l.children.push(r(h))})}),l};return w1(e)||(e=d2(e)),r(e)}function GK(e,{ignoreFieldNorm:t=He.ignoreFieldNorm}){e.forEach(n=>{let r=1;n.matches.forEach(({key:o,norm:i,score:s})=>{const l=o?o.weight:null;r*=Math.pow(s===0&&l?Number.EPSILON:s,(l||1)*(t?1:i))}),n.score=r})}function XK(e,t){const n=e.matches;t.matches=[],hr(n)&&n.forEach(r=>{if(!hr(r.indices)||!r.indices.length)return;const{indices:o,value:i}=r;let s={indices:o,value:i};r.key&&(s.key=r.key.src),r.idx>-1&&(s.refIndex=r.idx),t.matches.push(s)})}function ZK(e,t){t.score=e.score}function qK(e,t,{includeMatches:n=He.includeMatches,includeScore:r=He.includeScore}={}){const o=[];return n&&o.push(XK),r&&o.push(ZK),e.map(i=>{const{idx:s}=i,l={item:t[s],refIndex:s};return o.length&&o.forEach(u=>{u(i,l)}),l})}class _c{constructor(t,n={},r){this.options={...He,...n},this.options.useExtendedSearch,this._keyStore=new _K(this.options.keys),this.setCollection(t,r)}setCollection(t,n){if(this._docs=t,n&&!(n instanceof Nx))throw new Error(vK);this._myIndex=n||VP(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){hr(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const n=[];for(let r=0,o=this._docs.length;ri?i:h}}return r?t:L1(e,i,s,o)}function TZ(e,t){var n=1;return t?Math.min(n,e.offsetWidth/window.innerWidth):n}function PZ(e,t){var n=$Z(e);if(n){var r=e.lastMousePosition,o=e.velocityTime,i=e.setup,s=e.wrapperComponent,l=i.velocityAnimation.equalToMove,u=Date.now();if(r&&o&&s){var d=TZ(s,l),h=t.x-r.x,m=t.y-r.y,g=h/d,y=m/d,x=u-o,_=h*h+m*m,C=Math.sqrt(_)/x;e.velocity={velocityX:g,velocityY:y,total:C}}e.lastMousePosition=t,e.velocityTime=u}}function AZ(e){var t=e.velocity,n=e.bounds,r=e.setup,o=e.wrapperComponent,i=kZ(e);if(!(!i||!t||!n||!o)){var s=t.velocityX,l=t.velocityY,u=t.total,d=n.maxPositionX,h=n.minPositionX,m=n.maxPositionY,g=n.minPositionY,y=r.limitToBounds,x=r.alignmentAnimation,_=r.zoomAnimation,C=r.panning,S=C.lockAxisY,b=C.lockAxisX,E=_.animationType,k=x.sizeX,P=x.sizeY,M=x.velocityAlignmentTime,A=M,O=RZ(e,u),F=Math.max(O,A),V=rm(e,k),J=rm(e,P),G=V*o.offsetWidth/100,ae=J*o.offsetHeight/100,U=d+G,te=h-G,L=m+ae,ie=g-ae,K=e.transformState,Q=new Date().getTime();S3(e,E,F,function(W){var le=e.transformState,ge=le.scale,Ve=le.positionX,Ue=le.positionY,We=new Date().getTime()-Q,Me=We/A,fe=b3[x.animationType],xe=1-fe(Math.min(1,Me)),$e=1-W,Ae=Ve+s*$e,Oe=Ue+l*$e,je=D2(Ae,K.positionX,Ve,b,y,h,d,te,U,xe),Ot=D2(Oe,K.positionY,Ue,S,y,g,m,ie,L,xe);(Ve!==Ae||Ue!==Oe)&&e.setTransformState(ge,je,Ot)})}}function I2(e,t){var n=e.transformState.scale;Do(e),dc(e,n),window.TouchEvent!==void 0&&t instanceof TouchEvent?_Z(e,t):bZ(e,t)}function E3(e){var t=e.transformState.scale,n=e.setup,r=n.minScale,o=n.alignmentAnimation,i=o.disabled,s=o.sizeX,l=o.sizeY,u=o.animationTime,d=o.animationType,h=i||t