m?Math.max(m-g,p-h):0}function h(e){if(d[e])return d[e];let[t,a]=e.split(" "),r=l[t]||"right",n=i[r];l[a]||(a="center");let o=s[r],u=s[n];return d[e]={placement:t,crossPlacement:a,axis:r,crossAxis:n,size:o,crossSize:u},d[e]}function g(e,t,a,r,l,i,s,d,c,p){var m,h,g,f,v;let{placement:b,crossPlacement:y,axis:x,crossAxis:D,size:w,crossSize:C}=r,E={};E[D]=null!=(m=e[D])?m:0,"center"===y?E[D]+=((null!=(h=e[C])?h:0)-(null!=(g=a[C])?g:0))/2:y!==D&&(E[D]+=(null!=(f=e[C])?f:0)-(null!=(v=a[C])?v:0)),E[D]+=i;let k=e[D]-a[C]+c+p,B=e[D]+e[C]-c-p;if(E[D]=(0,n.qE)(E[D],k,B),b===x){let a=d?s[w]:t[u[w]];E[o[x]]=Math.floor(a-e[x]+l)}else E[x]=Math.floor(e[x]+e[w]+l);return E}function f(e,t,a,r,n,l){var i,s,u;let{placement:d,axis:c,size:p}=l;return d===c?Math.max(0,a[c]-e[c]-(null!=(i=e.scroll[c])?i:0)+t[c]-(null!=(s=r[c])?s:0)-r[o[c]]-n):Math.max(0,e[p]+e[c]+e.scroll[c]-t[c]-a[c]-a[p]-(null!=(u=r[c])?u:0)-r[o[c]]-n)}function v(e){let{top:t,left:a,width:r,height:n}=e.getBoundingClientRect(),{scrollTop:l,scrollLeft:o,clientTop:i,clientLeft:s}=document.documentElement;return{top:t+l-i,left:a+o-s,width:r,height:n}}function b(e,t){let a,r=window.getComputedStyle(e);if("fixed"===r.position){let{top:t,left:r,width:n,height:l}=e.getBoundingClientRect();a={top:t,left:r,width:n,height:l}}else{a=v(e);let r=v(t),n=window.getComputedStyle(t);r.top+=(parseInt(n.borderTopWidth,10)||0)-t.scrollTop,r.left+=(parseInt(n.borderLeftWidth,10)||0)-t.scrollLeft,a.top-=r.top,a.left-=r.left}return a.top-=parseInt(r.marginTop,10)||0,a.left-=parseInt(r.marginLeft,10)||0,a}function y(e){let t=window.getComputedStyle(e);return"none"!==t.transform||/transform|perspective/.test(t.willChange)||"none"!==t.filter||"paint"===t.contain||"backdropFilter"in t&&"none"!==t.backdropFilter||"WebkitBackdropFilter"in t&&"none"!==t.WebkitBackdropFilter}var x=a(37116),D=a(66601),w=a(20933),C=a(68914),E=a(54206);let k="undefined"!=typeof document?window.visualViewport:null;function B(e){var t,a,r;let{direction:i}=(0,E.Y)(),{arrowSize:s=0,targetRef:d,overlayRef:c,scrollRef:B=c,placement:P="bottom",containerPadding:S=12,shouldFlip:A=!0,boundaryElement:$="undefined"!=typeof document?document.body:null,offset:F=0,crossOffset:M=0,shouldUpdatePosition:N=!0,isOpen:R=!0,onClose:T,maxHeight:I,arrowBoundaryOffset:z=0}=e,[j,K]=(0,D.useState)(null),V=[N,P,c.current,d.current,B.current,S,A,$,F,M,R,i,I,z,s],L=(0,D.useRef)(null==k?void 0:k.scale);(0,D.useEffect)(()=>{R&&(L.current=null==k?void 0:k.scale)},[R]);let O=(0,D.useCallback)(()=>{var e,t,a,r,x,D;if(!1===N||!R||!c.current||!d.current||!$||(null==k?void 0:k.scale)!==L.current)return;let w=null;if(B.current&&B.current.contains(document.activeElement)){let r=null==(e=document.activeElement)?void 0:e.getBoundingClientRect(),n=B.current.getBoundingClientRect();(w={type:"top",offset:(null!=(t=null==r?void 0:r.top)?t:0)-n.top}).offset>n.height/2&&(w.type="bottom",w.offset=(null!=(a=null==r?void 0:r.bottom)?a:0)-n.bottom)}let C=c.current;!I&&c.current&&(C.style.top="0px",C.style.bottom="",C.style.maxHeight=(null!=(x=null==(r=window.visualViewport)?void 0:r.height)?x:window.innerHeight)+"px");let E=function(e){var t,a,r,i;let s,{placement:d,targetNode:c,overlayNode:x,scrollNode:D,padding:w,shouldFlip:C,boundaryElement:E,offset:k,crossOffset:B,maxHeight:P,arrowSize:S=0,arrowBoundaryOffset:A=0}=e,$=x instanceof HTMLElement?function(e){let t=e.offsetParent;if(t&&t===document.body&&"static"===window.getComputedStyle(t).position&&!y(t)&&(t=document.documentElement),null==t)for(t=e.parentElement;t&&!y(t);)t=t.parentElement;return t||document.documentElement}(x):document.documentElement,F=$===document.documentElement,M=window.getComputedStyle($).position,N=F?v(c):b(c,$);if(!F){let{marginTop:e,marginLeft:t}=window.getComputedStyle(c);N.top+=parseInt(e,10)||0,N.left+=parseInt(t,10)||0}let R=v(x),T={top:parseInt((s=window.getComputedStyle(x)).marginTop,10)||0,bottom:parseInt(s.marginBottom,10)||0,left:parseInt(s.marginLeft,10)||0,right:parseInt(s.marginRight,10)||0};R.width+=(null!=(t=T.left)?t:0)+(null!=(a=T.right)?a:0),R.height+=(null!=(r=T.top)?r:0)+(null!=(i=T.bottom)?i:0);let I={top:D.scrollTop,left:D.scrollLeft,width:D.scrollWidth,height:D.scrollHeight},z=p(E),j=p($),K="BODY"===E.tagName?v($):b($,E);return"HTML"===$.tagName&&"BODY"===E.tagName&&(j.scroll.top=0,j.scroll.left=0),function(e,t,a,r,i,s,d,c,p,v,b,y,x,D,w,C){var E,k,B,P;let S=h(e),{size:A,crossAxis:$,crossSize:F,placement:M,crossPlacement:N}=S,R=g(t,c,a,S,b,y,v,x,w,C),T=b,I=f(c,v,t,i,s+b,S);if(d&&r[A]>I){let e=h(`${o[M]} ${N}`),r=g(t,c,a,e,b,y,v,x,w,C);f(c,v,t,i,s+b,e)>I&&(S=e,R=r,T=b)}let z="bottom";"top"===S.axis?"top"===S.placement?z="top":"bottom"===S.placement&&(z="bottom"):"top"===S.crossAxis&&("top"===S.crossPlacement?z="bottom":"bottom"===S.crossPlacement&&(z="top"));let j=m($,R[$],a[F],c,p,s,v);R[$]+=j;let K=function(e,t,a,r,n,l,o,i){var s,d,c,p,m,h,g;let f=r?a.height:t[u.height],v=null!=e.top?a.top+e.top:a.top+(f-(null!=(s=e.bottom)?s:0)-o),b="top"!==i?Math.max(0,t.height+t.top+(null!=(d=t.scroll.top)?d:0)-v-((null!=(c=n.top)?c:0)+(null!=(p=n.bottom)?p:0)+l)):Math.max(0,v+o-(t.top+(null!=(m=t.scroll.top)?m:0))-((null!=(h=n.top)?h:0)+(null!=(g=n.bottom)?g:0)+l));return Math.min(t.height-2*l,b)}(R,c,v,x,i,s,a.height,z);D&&D