2024-08-08 10:16:25 +02:00
|
|
|
import{_ as T}from"./iframe-CU6Zso1W.js";import{s as kt}from"./popup-BXRymj07.js";import{i as Vt,d as Ft,e as It}from"./XPro-DLv5pwJ7.js";import{r as D,i as bt,b as Et}from"./runtime-8AupoRbQ.js";import"../sb-preview/runtime.js";import"./index-C0Lr04gB.js";import"./index-CP70Tq58.js";import"./lifecycle-D_bIUHQK.js";import"./each-C4g42ehH.js";import"./spread-CgU5AtxT.js";import"./globals-D0QH3NT1.js";import"./_commonjsHelpers-Cpj98o6Y.js";function Wt(){Vt(),Ft(),It()}const X=Math.min,z=Math.max,rt=Math.round,it=Math.floor,F=t=>({x:t,y:t}),Nt={left:"right",right:"left",bottom:"top",top:"bottom"},$t={start:"end",end:"start"};function ft(t,e,o){return z(t,X(e,o))}function et(t,e){return typeof t=="function"?t(e):t}function H(t){return t.split("-")[0]}function nt(t){return t.split("-")[1]}function Ot(t){return t==="x"?"y":"x"}function dt(t){return t==="y"?"height":"width"}function G(t){return["top","bottom"].includes(H(t))?"y":"x"}function pt(t){return Ot(G(t))}function zt(t,e,o){o===void 0&&(o=!1);const n=nt(t),i=pt(t),l=dt(i);let r=i==="x"?n===(o?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[l]>e.floating[l]&&(r=lt(r)),[r,lt(r)]}function Ht(t){const e=lt(t);return[mt(t),e,mt(e)]}function mt(t){return t.replace(/start|end/g,e=>$t[e])}function Ut(t,e,o){const n=["left","right"],i=["right","left"],l=["top","bottom"],r=["bottom","top"];switch(t){case"top":case"bottom":return o?e?i:n:e?n:i;case"left":case"right":return e?l:r;default:return[]}}function Yt(t,e,o,n){const i=nt(t);let l=Ut(H(t),o==="start",n);return i&&(l=l.map(r=>r+"-"+i),e&&(l=l.concat(l.map(mt)))),l}function lt(t){return t.replace(/left|right|bottom|top/g,e=>Nt[e])}function jt(t){return{top:0,right:0,bottom:0,left:0,...t}}function _t(t){return typeof t!="number"?jt(t):{top:t,right:t,bottom:t,left:t}}function st(t){const{x:e,y:o,width:n,height:i}=t;return{width:n,height:i,top:o,left:e,right:e+n,bottom:o+i,x:e,y:o}}function wt(t,e,o){let{reference:n,floating:i}=t;const l=G(e),r=pt(e),s=dt(r),c=H(e),a=l==="y",m=n.x+n.width/2-i.width/2,f=n.y+n.height/2-i.height/2,p=n[s]/2-i[s]/2;let u;switch(c){case"top":u={x:m,y:n.y-i.height};break;case"bottom":u={x:m,y:n.y+n.height};break;case"right":u={x:n.x+n.width,y:f};break;case"left":u={x:n.x-i.width,y:f};break;default:u={x:n.x,y:n.y}}switch(nt(e)){case"start":u[r]-=p*(o&&a?-1:1);break;case"end":u[r]+=p*(o&&a?-1:1);break}return u}const Xt=async(t,e,o)=>{const{placement:n="bottom",strategy:i="absolute",middleware:l=[],platform:r}=o,s=l.filter(Boolean),c=await(r.isRTL==null?void 0:r.isRTL(e));let a=await r.getElementRects({reference:t,floating:e,strategy:i}),{x:m,y:f}=wt(a,n,c),p=n,u={},d=0;for(let A=0;A<s.length;A++){const{name:h,fn:g}=s[A],{x:w,y:v,data:b,reset:y}=await g({x:m,y:f,initialPlacement:n,placement:p,strategy:i,middlewareData:u,rects:a,platform:r,elements:{reference:t,floating:e}});m=w??m,f=v??f,u={...u,[h]:{...u[h],...b}},y&&d<=50&&(d++,typeof y=="object"&&(y.placement&&(p=y.placement),y.rects&&(a=y.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:i}):y.rects),{x:m,y:f}=wt(a,p,c)),A=-1)}return{x:m,y:f,placement:p,strategy:i,middlewareData:u}};async function Ct(t,e){var o;e===void 0&&(e={});const{x:n,y:i,platform:l,rects:r,elements:s,strategy:c}=t,{boundary:a="clippingAncestors",rootBoundary:m="viewport",elementContext:f="floating",altBoundary:p=!1,padding:u=0}=et(e,t),d=_t(u),h=s[p?f==="floating"?"reference":"floating":f],g=st(await l.getClippingRect({element:(o=await(l.isElement==null?void 0:l.isElement(h)))==null||o?h:h.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(s.floating)),boundary:a,rootBoundary:m,strategy:c})),w=f==="floating"?{x:n,y:i,width:r.floating.width,height:r.floating.height}:r.reference,v=await(l.getOffsetParent==null?void 0:l.getOffsetParent(s.floating)),b=await(l.isElement==null?void 0:l.isElement(v))?await(l.getScale==null?void 0:l.getScale(v))||{x:1,y:1}:{x:1,y:1},y=st(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:w,offsetPare
|