Anvil/assets/preview-iQHY69Pr.js

2 lines
18 KiB
JavaScript
Raw Normal View History

2024-07-27 14:18:38 +02:00
import{_ as C}from"./iframe-BROlT08N.js";import{s as kt}from"./popup-BXRymj07.js";import{i as Ft,d as It,e as Bt}from"./XPro-_Ll7JVYJ.js";import{r as P,i as bt,b as At}from"./runtime-CZkC8ltm.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";import"./tslib.es6-pJfR_DrR.js";function Mt(){Ft(),It(),Bt()}const Y=Math.min,$=Math.max,it=Math.round,ot=Math.floor,I=t=>({x:t,y:t}),Nt={left:"right",right:"left",bottom:"top",top:"bottom"},Wt={start:"end",end:"start"};function ft(t,e,o){return $(t,Y(e,o))}function tt(t,e){return typeof t=="function"?t(e):t}function z(t){return t.split("-")[0]}function et(t){return t.split("-")[1]}function Et(t){return t==="x"?"y":"x"}function dt(t){return t==="y"?"height":"width"}function q(t){return["top","bottom"].includes(z(t))?"y":"x"}function mt(t){return Et(q(t))}function $t(t,e,o){o===void 0&&(o=!1);const n=et(t),i=mt(t),s=dt(i);let r=i==="x"?n===(o?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(r=rt(r)),[r,rt(r)]}function zt(t){const e=rt(t);return[ut(t),e,ut(e)]}function ut(t){return t.replace(/start|end/g,e=>Wt[e])}function Ht(t,e,o){const n=["left","right"],i=["right","left"],s=["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?s:r;default:return[]}}function jt(t,e,o,n){const i=et(t);let s=Ht(z(t),o==="start",n);return i&&(s=s.map(r=>r+"-"+i),e&&(s=s.concat(s.map(ut)))),s}function rt(t){return t.replace(/left|right|bottom|top/g,e=>Nt[e])}function Xt(t){return{top:0,right:0,bottom:0,left:0,...t}}function Rt(t){return typeof t!="number"?Xt(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 s=q(e),r=mt(e),c=dt(r),l=z(e),a=s==="y",d=n.x+n.width/2-i.width/2,u=n.y+n.height/2-i.height/2,p=n[c]/2-i[c]/2;let f;switch(l){case"top":f={x:d,y:n.y-i.height};break;case"bottom":f={x:d,y:n.y+n.height};break;case"right":f={x:n.x+n.width,y:u};break;case"left":f={x:n.x-i.width,y:u};break;default:f={x:n.x,y:n.y}}switch(et(e)){case"start":f[r]-=p*(o&&a?-1:1);break;case"end":f[r]+=p*(o&&a?-1:1);break}return f}const Yt=async(t,e,o)=>{const{placement:n="bottom",strategy:i="absolute",middleware:s=[],platform:r}=o,c=s.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(e));let a=await r.getElementRects({reference:t,floating:e,strategy:i}),{x:d,y:u}=wt(a,n,l),p=n,f={},m=0;for(let g=0;g<c.length;g++){const{name:w,fn:h}=c[g],{x,y,data:b,reset:v}=await h({x:d,y:u,initialPlacement:n,placement:p,strategy:i,middlewareData:f,rects:a,platform:r,elements:{reference:t,floating:e}});d=x??d,u=y??u,f={...f,[w]:{...f[w],...b}},v&&m<=50&&(m++,typeof v=="object"&&(v.placement&&(p=v.placement),v.rects&&(a=v.rects===!0?await r.getElementRects({reference:t,floating:e,strategy:i}):v.rects),{x:d,y:u}=wt(a,p,l)),g=-1)}return{x:d,y:u,placement:p,strategy:i,middlewareData:f}};async function _t(t,e){var o;e===void 0&&(e={});const{x:n,y:i,platform:s,rects:r,elements:c,strategy:l}=t,{boundary:a="clippingAncestors",rootBoundary:d="viewport",elementContext:u="floating",altBoundary:p=!1,padding:f=0}=tt(e,t),m=Rt(f),w=c[p?u==="floating"?"reference":"floating":u],h=st(await s.getClippingRect({element:(o=await(s.isElement==null?void 0:s.isElement(w)))==null||o?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:a,rootBoundary:d,strategy:l})),x=u==="floating"?{x:n,y:i,width:r.floating.width,height:r.floating.height}:r.reference,y=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),b=await(s.isElement==null?void 0:s.isElement(y))?await(s.getScale==null?void 0:s.getScale(y))||{x:1,y:1}:{x:1,y:1},v=st(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({