1(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`631671fb-2445-4a86-9ef1-476bce8bb7c3`,e._sentryDebugIdIdentifier=`sentry-dbid-631671fb-2445-4a86-9ef1-476bce8bb7c3`)}catch{}})();import{it as e,st as t}from"./components-CLmTExWJ.js";import{a as n}from"./useId-DlmH-COD.js";import{p as r}from"./focusSafely-Dmny9hhe.js";import{_ as i,u as a}from"./Button-DdqK24aK.js";import{t as o}from"./useCloseOnScroll-B1IrlJf_.js";var s=t(e(),1);function c(){return window.ResizeObserver!==void 0}function l(e){let{ref:t,box:n,onResize:r}=e;(0,s.useEffect)(()=>{let e=t?.current;if(e)if(c()){let t=new window.ResizeObserver(e=>{e.length&&r()});return t.observe(e,{box:n}),()=>{e&&t.unobserve(e)}}else return window.addEventListener(`resize`,r,!1),()=>{window.removeEventListener(`resize`,r,!1)}},[r,t,n])}var u={top:`top`,bottom:`top`,left:`left`,right:`left`},d={top:`bottom`,bottom:`top`,left:`right`,right:`left`},f={top:`left`,left:`top`},p={top:`height`,left:`width`},m={width:`totalWidth`,height:`totalHeight`},h={},g=typeof document<`u`?window.visualViewport:null;function _(e){let t=0,n=0,i=0,a=0,o=0,s=0,c={},l=(g?.scale??1)>1;if(e.tagName===`BODY`){let r=document.documentElement;i=r.clientWidth,a=r.clientHeight,t=g?.width??i,n=g?.height??a,c.top=r.scrollTop||e.scrollTop,c.left=r.scrollLeft||e.scrollLeft,g&&(o=g.offsetTop,s=g.offsetLeft)}else ({width:t,height:n,top:o,left:s}=D(e)),c.top=e.scrollTop,c.left=e.scrollLeft,i=t,a=n;return r()&&(e.tagName===`BODY`||e.tagName===`HTML`)&&l&&(c.top=0,c.left=0,o=g?.pageTop??0,s=g?.pageLeft??0),{width:t,height:n,totalWidth:i,totalHeight:a,scroll:c,top:o,left:s}}function v(e){return{top:e.scrollTop,left:e.scrollLeft,width:e.scrollWidth,height:e.scrollHeight}}function y(e,t,n,r,i,a,o){let s=i.scroll[e]??0,c=r[p[e]],l=r.scroll[u[e]]+a,d=c+r.scroll[u[e]]-a,f=t-s+o[e]-r[u[e]],m=t-s+n+o[e]-r[u[e]];return f<l?l-f:m>d?Math.max(d-m,l-f):0}function b(e){let t=window.getComputedStyle(e);return{top:parseInt(t.marginTop,10)||0,bottom:parseInt(t.marginBottom,10)||0,left:parseInt(t.marginLeft,10)||0,right:parseInt(t.marginRight,10)||0}}function x(e){if(h[e])return h[e];let[t,n]=e.split(` `),r=u[t]||`right`,i=f[r];u[n]||(n=`center`);let a=p[r],o=p[i];return h[e]={placement:t,crossPlacement:n,axis:r,crossAxis:i,size:a,crossSize:o},h[e]}function S(e,t,n,r,a,o,s,c,l,u){let{placement:f,crossPlacement:p,axis:h,crossAxis:g,size:_,crossSize:v}=r,y={};y[g]=e[g]??0,p===`center`?y[g]+=((e[v]??0)-(n[v]??0))/2:p!==g&&(y[g]+=(e[v]??0)-(n[v]??0)),y[g]+=o;let b=e[g]-n[v]+l+u,x=e[g]+e[v]-l-u;if(y[g]=i(y[g],b,x),f===h){let n=c?s[_]:t[m[_]];y[d[h]]=Math.floor(n-e[h]+a)}else y[h]=Math.floor(e[h]+e[_]+a);return y}function C(e,t,n,r,i,a,o,s){let c=r?n.height:t[m.height],l=e.top==null?n.top+(c-(e.bottom??0)-o):n.top+e.top,u=s===`top`?Math.max(0,l+o-(t.top+(t.scroll.top??0))-((i.top??0)+(i.bottom??0)+a)):Math.max(0,t.height+t.top+(t.scroll.top??0)-l-((i.top??0)+(i.bottom??0)+a));return Math.min(t.height-a*2,u)}function w(e,t,n,r,i,a){let{placement:o,axis:s,size:c}=a;return o===s?Math.max(0,n[s]-e[s]-(e.scroll[s]??0)+t[s]-(r[s]??0)-r[d[s]]-i):Math.max(0,e[c]+e[s]+e.scroll[s]-t[s]-n[s]-n[c]-(r[s]??0)-r[d[s]]-i)}function T(e,t,n,r,a,o,s,c,l,f,p,m,h,g,_,v){let b=x(e),{size:T,crossAxis:E,crossSize:D,placement:O,crossPlacement:k}=b,A=S(t,c,n,b,p,m,f,h,_,v),j=p,M=w(c,f,t,a,o+p,b);if(s&&r[T]>M){let e=x(`${d[O]} ${k}`),r=S(t,c,n,e,p,m,f,h,_,v);w(c,f,t,a,o+p,e)>M&&(b=e,A=r,j=p)}let N=`bottom`;b.axis===`top`?b.placement===`top`?N=`top`:b.placement===`bottom`&&(N=`bottom`):b.crossAxis===`top`&&(b.crossPlacement===`top`?N=`bottom`:b.crossPlacement===`bottom`&&(N=`top`));let P=y(E,A[E],n[D],c,l,o,f);A[E]+=P;let F=C(A,c,f,h,a,o,n.height,N);g&&g<F&&(F=g),n.height=Math.min(n.height,F),A=S(t,c,n,b,j,m,f,h,_,v),P=y(E,A[E],n[D],c,l,o,f),A[E]+=P;let I={},L=t[E]+.5*t[D]-A[E]-a[u[E]],R=_/2+v,z=u[E]===`left`?(a.left??0)+(a.right??0):(a.top??0)+(a.bottom??0),B=n[D]-z-_/2-v;return I[E]=i(i(L,t[E]+_/2-(A[E]+a[u[E]]),t[E]+t[D]-_/2-(A[E]+a[u[E]])),R,B),{position:A,maxHeight:F,arrowOffsetLeft:I.left,arrowOffsetTop:I.top,placement:b.placement}}function E(e){let{placement:t,targetNode:n,overlayNode:r,scrollNode:i,padding:a,shouldFlip:o,boundaryElement:s,offset:c,crossOffset:l,maxHeight:u,arrowSize:d=0,arrowBoundaryOffset:f=0}=e,p=r instanceof HTMLElement?k(r):document.documentElement,m=p===document.documentElement,h=window.getComputedStyle(p).position,g=!!h&&h!==`static`,y=m?D(n):O(n,p);if(!m){let{marginTop:e,marginLeft:t}=window.getComputedStyle(n);y.top+=parseInt(e,10)||0,y.left+=parseInt(t,10)||0}let x=D(r),S=b(r);x.width+=(S.left??0)+(S.right??0),x.height+=(S.top??0)+(S.bottom??0);let C=v(i),w=_(s),E=_(p),A=s.tagName===`BODY`?D(p):O(p,s);return p.tagName===`HTML`&&s.tagName===`BODY`&&(E.scroll.top=0,E.scroll.left=0),T(t,y,x,C,S,a,o,w,E,A,c,l,g,u,d,f)}function D(e){let{top:t,left:n,width:r,height:i}=e.getBoundingClientRect(),{scrollTop:a,scrollLeft:o,clientTop:s,clientLeft:c}=document.documentElement;return{top:t+a-s,left:n+o-c,width:r,height:i}}function O(e,t){let n=window.getComputedStyle(e),r;if(n.position===`fixed`){let{top:t,left:n,width:i,height:a}=e.getBoundingClientRect();r={top:t,left:n,width:i,height:a}}else{r=D(e);let n=D(t),i=window.getComputedStyle(t);n.top+=(parseInt(i.borderTopWidth,10)||0)-t.scrollTop,n.left+=(parseInt(i.borderLeftWidth,10)||0)-t.scrollLeft,r.top-=n.top,r.left-=n.left}return r.top-=parseInt(n.marginTop,10)||0,r.left-=parseInt(n.marginLeft,10)||0,r}function k(e){let t=e.offsetParent;if(t&&t===document.body&&window.getComputedStyle(t).position===`static`&&!A(t)&&(t=document.documentElement),t==null)for(t=e.parentElement;t&&!A(t);)t=t.parentElement;return t||document.documentElement}function A(e){let t=window.getComputedStyle(e);return t.transform!==`none`||/transform|perspective/.test(t.willChange)||t.filter!==`none`||t.contain===`paint`||`backdropFilter`in t&&t.backdropFilter!==`none`||`WebkitBackdropFilter`in t&&t.WebkitBackdropFilter!==`none`}
1var j=typeof document<`u`?window.visualViewport:null;function M(e){let{direction:t}=a(),{arrowSize:r=0,targetRef:i,overlayRef:c,scrollRef:u=c,placement:d=`bottom`,containerPadding:f=12,shouldFlip:p=!0,boundaryElement:m=typeof document<`u`?document.body:null,offset:h=0,crossOffset:g=0,shouldUpdatePosition:_=!0,isOpen:v=!0,onClose:y,maxHeight:b,arrowBoundaryOffset:x=0}=e,[S,C]=(0,s.useState)(null),w=[_,d,c.current,i.current,u.current,f,p,m,h,g,v,t,b,x,r],T=(0,s.useRef)(j?.scale);(0,s.useEffect)(()=>{v&&(T.current=j?.scale)},[v]);let D=(0,s.useCallback)(()=>{if(_===!1||!v||!c.current||!i.current||!m||j?.scale!==T.current)return;let e=null;if(u.current&&u.current.contains(document.activeElement)){let t=document.activeElement?.getBoundingClientRect(),n=u.current.getBoundingClientRect();e={type:`top`,offset:(t?.top??0)-n.top},e.offset>n.height/2&&(e.type=`bottom`,e.offset=(t?.bottom??0)-n.bottom)}let n=c.current;!b&&c.current&&(n.style.top=`0px`,n.style.bottom=``,n.style.maxHeight=(window.visualViewport?.height??window.innerHeight)+`px`);let a=E({placement:P(d,t),overlayNode:c.current,targetNode:i.current,scrollNode:u.current||c.current,padding:f,shouldFlip:p,boundaryElement:m,offset:h,crossOffset:g,maxHeight:b,arrowSize:r,arrowBoundaryOffset:x});if(a.position){if(n.style.top=``,n.style.bottom=``,n.style.left=``,n.style.right=``,Object.keys(a.position).forEach(e=>n.style[e]=a.position[e]+`px`),n.style.maxHeight=a.maxHeight==null?``:a.maxHeight+`px`,e&&document.activeElement&&u.current){let t=document.activeElement.getBoundingClientRect(),n=u.current.getBoundingClientRect(),r=t[e.type]-n[e.type];u.current.scrollTop+=r-e.offset}C(a)}},w);n(D,w),N(D),l({ref:c,onResize:D}),l({ref:i,onResize:D});let O=(0,s.useRef)(!1);n(()=>{let e,t=()=>{O.current=!0,clearTimeout(e),e=setTimeout(()=>{O.current=!1},500),D()},n=()=>{O.current&&t()};return j?.addEventListener(`resize`,t),j?.addEventListener(`scroll`,n),()=>{j?.removeEventListener(`resize`,t),j?.removeEventListener(`scroll`,n)}},[D]);let k=(0,s.useCallback)(()=>{O.current||y?.()},[y,O]);return o({triggerRef:i,isOpen:v,onClose:y&&k}),{overlayProps:{style:{position:`absolute`,zIndex:1e5,...S?.position,maxHeight:S?.maxHeight??`100vh`}},placement:S?.placement??null,arrowProps:{"aria-hidden":`true`,role:`presentation`,style:{left:S?.arrowOffsetLeft,top:S?.arrowOffsetTop}},updatePosition:D}}function N(e){n(()=>(window.addEventListener(`resize`,e,!1),()=>{window.removeEventListener(`resize`,e,!1)}),[e])}function P(e,t){return t===`rtl`?e.replace(`start`,`right`).replace(`end`,`left`):e.replace(`start`,`left`).replace(`end`,`right`)}export{l as n,M as t}; 2//# sourceMappingURL=useOverlayPosition-CVDwEhLd.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.