import{f as st,o as rt,s as ct,c as lt}from"./vendor-floating-ui-core-B-QvIi8c.js";import{n as v,o as R,p as z,q as b,s as C,t as m,u as D,v as L,w as _,x as W,y as H,z as ft,A as j,B as ut,C as E,D as V,E as $,F as q,G as I,H as G,r as Q,I as A,J as Y}from"./vendor-floating-ui-utils-CALKnY__.js";function Z(t){const e=b(t);let o=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const i=C(t),r=i?t.offsetWidth:o,s=i?t.offsetHeight:n,c=D(o)!==r||D(n)!==s;return c&&(o=r,n=s),{width:o,height:n,$:c}}function X(t){return v(t)?t:t.contextElement}function F(t){const e=X(t);if(!C(e))return m(1);const o=e.getBoundingClientRect(),{width:n,height:i,$:r}=Z(e);let s=(r?D(o.width):o.width)/n,c=(r?D(o.height):o.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const at=m(0);function tt(t){const e=L(t);return!Y()||!e.visualViewport?at:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function ht(t,e,o){return e===void 0&&(e=!1),!o||e&&o!==L(t)?!1:e}function T(t,e,o,n){e===void 0&&(e=!1),o===void 0&&(o=!1);const i=t.getBoundingClientRect(),r=X(t);let s=m(1);e&&(n?v(n)&&(s=F(n)):s=F(t));const c=ht(r,o,n)?tt(r):m(0);let f=(i.left+c.x)/s.x,l=(i.top+c.y)/s.y,u=i.width/s.x,a=i.height/s.y;if(r){const d=L(r),h=n&&v(n)?L(n):n;let w=d,p=G(w);for(;p&&n&&h!==w;){const y=F(p),g=p.getBoundingClientRect(),x=b(p),O=g.left+(p.clientLeft+parseFloat(x.paddingLeft))*y.x,B=g.top+(p.clientTop+parseFloat(x.paddingTop))*y.y;f*=y.x,l*=y.y,u*=y.x,a*=y.y,f+=O,l+=B,w=L(p),p=G(w)}}return Q({width:u,height:a,x:f,y:l})}function M(t,e){const o=I(t).scrollLeft;return e?e.left+o:T(R(t)).left+o}function et(t,e){const o=t.getBoundingClientRect(),n=o.left+e.scrollLeft-M(t,o),i=o.top+e.scrollTop;return{x:n,y:i}}function dt(t){let{elements:e,rect:o,offsetParent:n,strategy:i}=t;const r=i==="fixed",s=R(n),c=e?_(e.floating):!1;if(n===s||c&&r)return o;let f={scrollLeft:0,scrollTop:0},l=m(1);const u=m(0),a=C(n);if((a||!a&&!r)&&(($(n)!=="body"||q(s))&&(f=I(n)),C(n))){const h=T(n);l=F(n),u.x=h.x+n.clientLeft,u.y=h.y+n.clientTop}const d=s&&!a&&!r?et(s,f):m(0);return{width:o.width*l.x,height:o.height*l.y,x:o.x*l.x-f.scrollLeft*l.x+u.x+d.x,y:o.y*l.y-f.scrollTop*l.y+u.y+d.y}}function gt(t){return Array.from(t.getClientRects())}function pt(t){const e=R(t),o=I(t),n=t.ownerDocument.body,i=E(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=E(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let s=-o.scrollLeft+M(t);const c=-o.scrollTop;return b(n).direction==="rtl"&&(s+=E(e.clientWidth,n.clientWidth)-i),{width:i,height:r,x:s,y:c}}const J=25;function wt(t,e){const o=L(t),n=R(t),i=o.visualViewport;let r=n.clientWidth,s=n.clientHeight,c=0,f=0;if(i){r=i.width,s=i.height;const u=Y();(!u||u&&e==="fixed")&&(c=i.offsetLeft,f=i.offsetTop)}const l=M(n);if(l<=0){const u=n.ownerDocument,a=u.body,d=getComputedStyle(a),h=u.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,w=Math.abs(n.clientWidth-a.clientWidth-h);w<=J&&(r-=w)}else l<=J&&(r+=l);return{width:r,height:s,x:c,y:f}}const yt=new Set(["absolute","fixed"]);function mt(t,e){const o=T(t,!0,e==="fixed"),n=o.top+t.clientTop,i=o.left+t.clientLeft,r=C(t)?F(t):m(1),s=t.clientWidth*r.x,c=t.clientHeight*r.y,f=i*r.x,l=n*r.y;return{width:s,height:c,x:f,y:l}}function K(t,e,o){let n;if(e==="viewport")n=wt(t,o);else if(e==="document")n=pt(R(t));else if(v(e))n=mt(e,o);else{const i=tt(t);n={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return Q(n)}function nt(t,e){const o=W(t);return o===e||!v(o)||H(o)?!1:b(o).position==="fixed"||nt(o,e)}function xt(t,e){const o=e.get(t);if(o)return o;let n=z(t,[],!1).filter(c=>v(c)&&$(c)!=="body"),i=null;const r=b(t).position==="fixed";let s=r?W(t):t;for(;v(s)&&!H(s);){const c=b(s),f=j(s);!f&&c.position==="fixed"&&(i=null),(r?!f&&!i:!f&&c.position==="static"&&!!i&&yt.has(i.position)||q(s)&&!f&&nt(t,s))?n=n.filter(u=>u!==s):i=c,s=W(s)}return e.set(t,n),n}function vt(t){let{element:e,boundary:o,rootBoundary:n,strategy:i}=t;const s=[...o==="clippingAncestors"?_(e)?[]:xt(e,this._c):[].concat(o),n],c=s[0],f=s.reduce((l,u)=>{const a=K(e,u,i);return l.top=E(a.top,l.top),l.right=V(a.right,l.right),l.bottom=V(a.bottom,l.bottom),l.left=E(a.left,l.left),l},K(e,c,i));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function bt(t){const{width:e,height:o}=Z(t);return{width:e,height:o}}function Rt(t,e,o){const n=C(e),i=R(e),r=o==="fixed",s=T(t,!0,r,e);let c={scrollLeft:0,scrollTop:0};const f=m(0);function l(){f.x=M(i)}if(n||!n&&!r)if(($(e)!=="body"||q(i))&&(c=I(e)),n){const h=T(e,!0,r,e);f.x=h.x+e.clientLeft,f.y=h.y+e.clientTop}else i&&l();r&&!n&&i&&l();const u=i&&!n&&!r?et(i,c):m(0),a=s.left+c.scrollLeft-f.x-u.x,d=s.top+c.scrollTop-f.y-u.y;return{x:a,y:d,width:s.width,height:s.height}}function N(t){return b(t).position==="static"}function P(t,e){if(!C(t)||b(t).position==="fixed")return null;if(e)return e(t);let o=t.offsetParent;return R(t)===o&&(o=o.ownerDocument.body),o}function ot(t,e){const o=L(t);if(_(t))return o;if(!C(t)){let i=W(t);for(;i&&!H(i);){if(v(i)&&!N(i))return i;i=W(i)}return o}let n=P(t,e);for(;n&&ft(n)&&N(n);)n=P(n,e);return n&&H(n)&&N(n)&&!j(n)?o:n||ut(t)||o}const Ct=async function(t){const e=this.getOffsetParent||ot,o=this.getDimensions,n=await o(t.floating);return{reference:Rt(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function Ot(t){return b(t).direction==="rtl"}const Lt={convertOffsetParentRelativeRectToViewportRelativeRect:dt,getDocumentElement:R,getClippingRect:vt,getOffsetParent:ot,getElementRects:Ct,getClientRects:gt,getDimensions:bt,getScale:F,isElement:v,isRTL:Ot};function it(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Tt(t,e){let o=null,n;const i=R(t);function r(){var c;clearTimeout(n),(c=o)==null||c.disconnect(),o=null}function s(c,f){c===void 0&&(c=!1),f===void 0&&(f=1),r();const l=t.getBoundingClientRect(),{left:u,top:a,width:d,height:h}=l;if(c||e(),!d||!h)return;const w=A(a),p=A(i.clientWidth-(u+d)),y=A(i.clientHeight-(a+h)),g=A(u),O={rootMargin:-w+"px "+-p+"px "+-y+"px "+-g+"px",threshold:E(0,V(1,f))||1};let B=!0;function k(U){const S=U[0].intersectionRatio;if(S!==f){if(!B)return s();S?s(!1,S):n=setTimeout(()=>{s(!1,1e-7)},1e3)}S===1&&!it(l,t.getBoundingClientRect())&&s(),B=!1}try{o=new IntersectionObserver(k,{...O,root:i.ownerDocument})}catch{o=new IntersectionObserver(k,O)}o.observe(t)}return s(!0),r}function Wt(t,e,o,n){n===void 0&&(n={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:f=!1}=n,l=X(t),u=i||r?[...l?z(l):[],...z(e)]:[];u.forEach(g=>{i&&g.addEventListener("scroll",o,{passive:!0}),r&&g.addEventListener("resize",o)});const a=l&&c?Tt(l,o):null;let d=-1,h=null;s&&(h=new ResizeObserver(g=>{let[x]=g;x&&x.target===l&&h&&(h.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var O;(O=h)==null||O.observe(e)})),o()}),l&&!f&&h.observe(l),h.observe(e));let w,p=f?T(t):null;f&&y();function y(){const g=T(t);p&&!it(p,g)&&o(),p=g,w=requestAnimationFrame(y)}return o(),()=>{var g;u.forEach(x=>{i&&x.removeEventListener("scroll",o),r&&x.removeEventListener("resize",o)}),a?.(),(g=h)==null||g.disconnect(),h=null,f&&cancelAnimationFrame(w)}}const Bt=rt,St=ct,At=st,Dt=(t,e,o)=>{const n=new Map,i={platform:Lt,...o},r={...i.platform,_c:n};return lt(t,e,{...i,platform:r})};export{Wt as a,Dt as c,At as f,Bt as o,St as s};