2 lines
27 KiB
JavaScript
2 lines
27 KiB
JavaScript
import{i as ct,e as ft,u as Ie,h as ut}from"./useForwardExpose-CRFbVhil.js";import{e as je,v as H,c as C,o as dt,d as Ce,k as Oe,a2 as Xe,h as pt,g as Ye,z as Ue,u as F,s as mt,w as he,a3 as Q,a4 as ht,a5 as gt,a6 as wt,f as yt,I as vt,l as xt,p as bt}from"./index-BhaIiTEj.js";import{P as Ge}from"./Sonner.vue_vue_type_script_setup_true_lang-BwfWndxy.js";import{c as Ke}from"./Teleport-DV_BGdH0.js";let ge=0;function Wn(){je(e=>{if(!ct)return;const t=document.querySelectorAll("[data-reka-focus-guard]");document.body.insertAdjacentElement("afterbegin",t[0]??Te()),document.body.insertAdjacentElement("beforeend",t[1]??Te()),ge++,e(()=>{ge===1&&document.querySelectorAll("[data-reka-focus-guard]").forEach(n=>n.remove()),ge--})})}function Te(){const e=document.createElement("span");return e.setAttribute("data-reka-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}function At(e){const t=H(),n=C(()=>t.value?.width??0),o=C(()=>t.value?.height??0);return dt(()=>{const i=ft(e);if(i){t.value={width:i.offsetWidth,height:i.offsetHeight};const s=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const l=r[0];let f,c;if("borderBoxSize"in l){const a=l.borderBoxSize,u=Array.isArray(a)?a[0]:a;f=u.inlineSize,c=u.blockSize}else f=i.offsetWidth,c=i.offsetHeight;t.value={width:f,height:c}});return s.observe(i,{box:"border-box"}),()=>s.unobserve(i)}else t.value=void 0}),{width:n,height:o}}const[Ze,Ct]=Ke("PopperRoot");var Ot=Ce({inheritAttrs:!1,__name:"PopperRoot",setup(e){const t=H();return Ct({anchor:t,onAnchorChange:n=>t.value=n}),(n,o)=>Oe(n.$slots,"default")}}),zn=Ot,St=Ce({__name:"PopperAnchor",props:{reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},setup(e){const t=e,{forwardRef:n,currentElement:o}=Ie(),i=Ze();return Xe(()=>{i.onAnchorChange(t.reference??o.value)}),(s,r)=>(Ye(),pt(F(Ge),{ref:F(n),as:s.as,"as-child":s.asChild},{default:Ue(()=>[Oe(s.$slots,"default")]),_:3},8,["as","as-child"]))}}),Hn=St;function Pt(e){return e!==null}function Rt(e){return{name:"transformOrigin",options:e,fn(t){const{placement:n,rects:o,middlewareData:i}=t,r=i.arrow?.centerOffset!==0,l=r?0:e.arrowWidth,f=r?0:e.arrowHeight,[c,a]=ye(n),u={start:"0%",center:"50%",end:"100%"}[a],m=(i.arrow?.x??0)+l/2,d=(i.arrow?.y??0)+f/2;let p="",h="";return c==="bottom"?(p=r?u:`${m}px`,h=`${-f}px`):c==="top"?(p=r?u:`${m}px`,h=`${o.floating.height+f}px`):c==="right"?(p=`${-f}px`,h=r?u:`${d}px`):c==="left"&&(p=`${o.floating.width+f}px`,h=r?u:`${d}px`),{data:{x:p,y:h}}}}}function ye(e){const[t,n="center"]=e.split("-");return[t,n]}const Et=["top","right","bottom","left"],G=Math.min,T=Math.max,ae=Math.round,le=Math.floor,N=e=>({x:e,y:e}),Dt={left:"right",right:"left",bottom:"top",top:"bottom"},_t={start:"end",end:"start"};function ve(e,t,n){return T(e,G(t,n))}function X(e,t){return typeof e=="function"?e(t):e}function Y(e){return e.split("-")[0]}function oe(e){return e.split("-")[1]}function Se(e){return e==="x"?"y":"x"}function Pe(e){return e==="y"?"height":"width"}const Lt=new Set(["top","bottom"]);function V(e){return Lt.has(Y(e))?"y":"x"}function Re(e){return Se(V(e))}function Tt(e,t,n){n===void 0&&(n=!1);const o=oe(e),i=Re(e),s=Pe(i);let r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(r=ce(r)),[r,ce(r)]}function kt(e){const t=ce(e);return[xe(e),t,xe(t)]}function xe(e){return e.replace(/start|end/g,t=>_t[t])}const ke=["left","right"],Be=["right","left"],Bt=["top","bottom"],Ft=["bottom","top"];function $t(e,t,n){switch(e){case"top":case"bottom":return n?t?Be:ke:t?ke:Be;case"left":case"right":return t?Bt:Ft;default:return[]}}function Mt(e,t,n,o){const i=oe(e);let s=$t(Y(e),n==="start",o);return i&&(s=s.map(r=>r+"-"+i),t&&(s=s.concat(s.map(xe)))),s}function ce(e){return e.replace(/left|right|bottom|top/g,t=>Dt[t])}function Wt(e){return{top:0,right:0,bottom:0,left:0,...e}}function Je(e){return typeof e!="number"?Wt(e):{top:e,right:e,bottom:e,left:e}}function fe(e){const{x:t,y:n,width:o,height:i}=e;return{width:o,height:i,top:n,left:t,right:t+o,bottom:n+i,x:t,y:n}}function Fe(e,t,n){let{reference:o,floating:i}=e;const s=V(t),r=Re(t),l=Pe(r),f=Y(t),c=s==="y",a=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,m=o[l]/2-i[l]/2;let d;switch(f){case"top":d={x:a,y:o.y-i.height};break;case"bottom":d={x:a,y:o.y+o.height};break;case"right":d={x:o.x+o.width,y:u};break;case"left":d={x:o.x-i.width,y:u};break;default:d={x:o.x,y:o.y}}switch(oe(t)){case"start":d[r]-=m*(n&&c?-1:1);break;case"end":d[r]+=m*(n&&c?-1:1);break}return d}const zt=async(e,t,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:s=[],platform:r}=n,l=s.filter(Boolean),f=await(r.isRTL==null?void 0:r.isRTL(t));let c=await r.getElementRects({reference:e,floating:t,strategy:i}),{x:a,y:u}=Fe(c,o,f),m=o,d={},p=0;for(let h=0;h<l.length;h++){const{name:g,fn:w}=l[h],{x:y,y:v,data:A,reset:x}=await w({x:a,y:u,initialPlacement:o,placement:m,strategy:i,middlewareData:d,rects:c,platform:r,elements:{reference:e,floating:t}});a=y??a,u=v??u,d={...d,[g]:{...d[g],...A}},x&&p<=50&&(p++,typeof x=="object"&&(x.placement&&(m=x.placement),x.rects&&(c=x.rects===!0?await r.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:a,y:u}=Fe(c,m,f)),h=-1)}return{x:a,y:u,placement:m,strategy:i,middlewareData:d}};async function ie(e,t){var n;t===void 0&&(t={});const{x:o,y:i,platform:s,rects:r,elements:l,strategy:f}=e,{boundary:c="clippingAncestors",rootBoundary:a="viewport",elementContext:u="floating",altBoundary:m=!1,padding:d=0}=X(t,e),p=Je(d),g=l[m?u==="floating"?"reference":"floating":u],w=fe(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(g)))==null||n?g:g.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(l.floating)),boundary:c,rootBoundary:a,strategy:f})),y=u==="floating"?{x:o,y:i,width:r.floating.width,height:r.floating.height}:r.reference,v=await(s.getOffsetParent==null?void 0:s.getOffsetParent(l.floating)),A=await(s.isElement==null?void 0:s.isElement(v))?await(s.getScale==null?void 0:s.getScale(v))||{x:1,y:1}:{x:1,y:1},x=fe(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:v,strategy:f}):y);return{top:(w.top-x.top+p.top)/A.y,bottom:(x.bottom-w.bottom+p.bottom)/A.y,left:(w.left-x.left+p.left)/A.x,right:(x.right-w.right+p.right)/A.x}}const Ht=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:i,rects:s,platform:r,elements:l,middlewareData:f}=t,{element:c,padding:a=0}=X(e,t)||{};if(c==null)return{};const u=Je(a),m={x:n,y:o},d=Re(i),p=Pe(d),h=await r.getDimensions(c),g=d==="y",w=g?"top":"left",y=g?"bottom":"right",v=g?"clientHeight":"clientWidth",A=s.reference[p]+s.reference[d]-m[d]-s.floating[p],x=m[d]-s.reference[d],P=await(r.getOffsetParent==null?void 0:r.getOffsetParent(c));let b=P?P[v]:0;(!b||!await(r.isElement==null?void 0:r.isElement(P)))&&(b=l.floating[v]||s.floating[p]);const O=A/2-x/2,E=b/2-h[p]/2-1,_=G(u[w],E),z=G(u[y],E),S=_,B=b-h[p]-z,R=b/2-h[p]/2+O,j=ve(S,R,B),$=!f.arrow&&oe(i)!=null&&R!==j&&s.reference[p]/2-(R<S?_:z)-h[p]/2<0,L=$?R<S?R-S:R-B:0;return{[d]:m[d]+L,data:{[d]:j,centerOffset:R-j-L,...$&&{alignmentOffset:L}},reset:$}}}),Vt=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:i,middlewareData:s,rects:r,initialPlacement:l,platform:f,elements:c}=t,{mainAxis:a=!0,crossAxis:u=!0,fallbackPlacements:m,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:h=!0,...g}=X(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const w=Y(i),y=V(l),v=Y(l)===l,A=await(f.isRTL==null?void 0:f.isRTL(c.floating)),x=m||(v||!h?[ce(l)]:kt(l)),P=p!=="none";!m&&P&&x.push(...Mt(l,h,p,A));const b=[l,...x],O=await ie(t,g),E=[];let _=((o=s.flip)==null?void 0:o.overflows)||[];if(a&&E.push(O[w]),u){const R=Tt(i,r,A);E.push(O[R[0]],O[R[1]])}if(_=[..._,{placement:i,overflows:E}],!E.every(R=>R<=0)){var z,S;const R=(((z=s.flip)==null?void 0:z.index)||0)+1,j=b[R];if(j&&(!(u==="alignment"?y!==V(j):!1)||_.every(D=>V(D.placement)===y?D.overflows[0]>0:!0)))return{data:{index:R,overflows:_},reset:{placement:j}};let $=(S=_.filter(L=>L.overflows[0]<=0).sort((L,D)=>L.overflows[1]-D.overflows[1])[0])==null?void 0:S.placement;if(!$)switch(d){case"bestFit":{var B;const L=(B=_.filter(D=>{if(P){const U=V(D.placement);return U===y||U==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(U=>U>0).reduce((U,at)=>U+at,0)]).sort((D,U)=>D[1]-U[1])[0])==null?void 0:B[0];L&&($=L);break}case"initialPlacement":$=l;break}if(i!==$)return{reset:{placement:$}}}return{}}}};function $e(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Me(e){return Et.some(t=>e[t]>=0)}const Nt=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...i}=X(e,t);switch(o){case"referenceHidden":{const s=await ie(t,{...i,elementContext:"reference"}),r=$e(s,n.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:Me(r)}}}case"escaped":{const s=await ie(t,{...i,altBoundary:!0}),r=$e(s,n.floating);return{data:{escapedOffsets:r,escaped:Me(r)}}}default:return{}}}}},Qe=new Set(["left","top"]);async function qt(e,t){const{placement:n,platform:o,elements:i}=e,s=await(o.isRTL==null?void 0:o.isRTL(i.floating)),r=Y(n),l=oe(n),f=V(n)==="y",c=Qe.has(r)?-1:1,a=s&&f?-1:1,u=X(t,e);let{mainAxis:m,crossAxis:d,alignmentAxis:p}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return l&&typeof p=="number"&&(d=l==="end"?p*-1:p),f?{x:d*a,y:m*c}:{x:m*c,y:d*a}}const It=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:i,y:s,placement:r,middlewareData:l}=t,f=await qt(t,e);return r===((n=l.offset)==null?void 0:n.placement)&&(o=l.arrow)!=null&&o.alignmentOffset?{}:{x:i+f.x,y:s+f.y,data:{...f,placement:r}}}}},jt=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:i}=t,{mainAxis:s=!0,crossAxis:r=!1,limiter:l={fn:g=>{let{x:w,y}=g;return{x:w,y}}},...f}=X(e,t),c={x:n,y:o},a=await ie(t,f),u=V(Y(i)),m=Se(u);let d=c[m],p=c[u];if(s){const g=m==="y"?"top":"left",w=m==="y"?"bottom":"right",y=d+a[g],v=d-a[w];d=ve(y,d,v)}if(r){const g=u==="y"?"top":"left",w=u==="y"?"bottom":"right",y=p+a[g],v=p-a[w];p=ve(y,p,v)}const h=l.fn({...t,[m]:d,[u]:p});return{...h,data:{x:h.x-n,y:h.y-o,enabled:{[m]:s,[u]:r}}}}}},Xt=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:i,rects:s,middlewareData:r}=t,{offset:l=0,mainAxis:f=!0,crossAxis:c=!0}=X(e,t),a={x:n,y:o},u=V(i),m=Se(u);let d=a[m],p=a[u];const h=X(l,t),g=typeof h=="number"?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(f){const v=m==="y"?"height":"width",A=s.reference[m]-s.floating[v]+g.mainAxis,x=s.reference[m]+s.reference[v]-g.mainAxis;d<A?d=A:d>x&&(d=x)}if(c){var w,y;const v=m==="y"?"width":"height",A=Qe.has(Y(i)),x=s.reference[u]-s.floating[v]+(A&&((w=r.offset)==null?void 0:w[u])||0)+(A?0:g.crossAxis),P=s.reference[u]+s.reference[v]+(A?0:((y=r.offset)==null?void 0:y[u])||0)-(A?g.crossAxis:0);p<x?p=x:p>P&&(p=P)}return{[m]:d,[u]:p}}}},Yt=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:i,rects:s,platform:r,elements:l}=t,{apply:f=()=>{},...c}=X(e,t),a=await ie(t,c),u=Y(i),m=oe(i),d=V(i)==="y",{width:p,height:h}=s.floating;let g,w;u==="top"||u==="bottom"?(g=u,w=m===(await(r.isRTL==null?void 0:r.isRTL(l.floating))?"start":"end")?"left":"right"):(w=u,g=m==="end"?"top":"bottom");const y=h-a.top-a.bottom,v=p-a.left-a.right,A=G(h-a[g],y),x=G(p-a[w],v),P=!t.middlewareData.shift;let b=A,O=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(O=v),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(b=y),P&&!m){const _=T(a.left,0),z=T(a.right,0),S=T(a.top,0),B=T(a.bottom,0);d?O=p-2*(_!==0||z!==0?_+z:T(a.left,a.right)):b=h-2*(S!==0||B!==0?S+B:T(a.top,a.bottom))}await f({...t,availableWidth:O,availableHeight:b});const E=await r.getDimensions(l.floating);return p!==E.width||h!==E.height?{reset:{rects:!0}}:{}}}};function ue(){return typeof window<"u"}function J(e){return Ee(e)?(e.nodeName||"").toLowerCase():"#document"}function k(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function I(e){var t;return(t=(Ee(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ee(e){return ue()?e instanceof Node||e instanceof k(e).Node:!1}function M(e){return ue()?e instanceof Element||e instanceof k(e).Element:!1}function q(e){return ue()?e instanceof HTMLElement||e instanceof k(e).HTMLElement:!1}function We(e){return!ue()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof k(e).ShadowRoot}const Ut=new Set(["inline","contents"]);function se(e){const{overflow:t,overflowX:n,overflowY:o,display:i}=W(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!Ut.has(i)}const Gt=new Set(["table","td","th"]);function Kt(e){return Gt.has(J(e))}const Zt=[":popover-open",":modal"];function de(e){return Zt.some(t=>{try{return e.matches(t)}catch{return!1}})}const Jt=["transform","translate","scale","rotate","perspective"],Qt=["transform","translate","scale","rotate","perspective","filter"],en=["paint","layout","strict","content"];function De(e){const t=_e(),n=M(e)?W(e):e;return Jt.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||Qt.some(o=>(n.willChange||"").includes(o))||en.some(o=>(n.contain||"").includes(o))}function tn(e){let t=K(e);for(;q(t)&&!ne(t);){if(De(t))return t;if(de(t))return null;t=K(t)}return null}function _e(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const nn=new Set(["html","body","#document"]);function ne(e){return nn.has(J(e))}function W(e){return k(e).getComputedStyle(e)}function pe(e){return M(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function K(e){if(J(e)==="html")return e;const t=e.assignedSlot||e.parentNode||We(e)&&e.host||I(e);return We(t)?t.host:t}function et(e){const t=K(e);return ne(t)?e.ownerDocument?e.ownerDocument.body:e.body:q(t)&&se(t)?t:et(t)}function re(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=et(e),s=i===((o=e.ownerDocument)==null?void 0:o.body),r=k(i);if(s){const l=be(r);return t.concat(r,r.visualViewport||[],se(i)?i:[],l&&n?re(l):[])}return t.concat(i,re(i,[],n))}function be(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function tt(e){const t=W(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=q(e),s=i?e.offsetWidth:n,r=i?e.offsetHeight:o,l=ae(n)!==s||ae(o)!==r;return l&&(n=s,o=r),{width:n,height:o,$:l}}function Le(e){return M(e)?e:e.contextElement}function te(e){const t=Le(e);if(!q(t))return N(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:s}=tt(t);let r=(s?ae(n.width):n.width)/o,l=(s?ae(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!l||!Number.isFinite(l))&&(l=1),{x:r,y:l}}const on=N(0);function nt(e){const t=k(e);return!_e()||!t.visualViewport?on:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function rn(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==k(e)?!1:t}function Z(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=Le(e);let r=N(1);t&&(o?M(o)&&(r=te(o)):r=te(e));const l=rn(s,n,o)?nt(s):N(0);let f=(i.left+l.x)/r.x,c=(i.top+l.y)/r.y,a=i.width/r.x,u=i.height/r.y;if(s){const m=k(s),d=o&&M(o)?k(o):o;let p=m,h=be(p);for(;h&&o&&d!==p;){const g=te(h),w=h.getBoundingClientRect(),y=W(h),v=w.left+(h.clientLeft+parseFloat(y.paddingLeft))*g.x,A=w.top+(h.clientTop+parseFloat(y.paddingTop))*g.y;f*=g.x,c*=g.y,a*=g.x,u*=g.y,f+=v,c+=A,p=k(h),h=be(p)}}return fe({width:a,height:u,x:f,y:c})}function me(e,t){const n=pe(e).scrollLeft;return t?t.left+n:Z(I(e)).left+n}function ot(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-me(e,n),i=n.top+t.scrollTop;return{x:o,y:i}}function sn(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const s=i==="fixed",r=I(o),l=t?de(t.floating):!1;if(o===r||l&&s)return n;let f={scrollLeft:0,scrollTop:0},c=N(1);const a=N(0),u=q(o);if((u||!u&&!s)&&((J(o)!=="body"||se(r))&&(f=pe(o)),q(o))){const d=Z(o);c=te(o),a.x=d.x+o.clientLeft,a.y=d.y+o.clientTop}const m=r&&!u&&!s?ot(r,f):N(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-f.scrollLeft*c.x+a.x+m.x,y:n.y*c.y-f.scrollTop*c.y+a.y+m.y}}function ln(e){return Array.from(e.getClientRects())}function an(e){const t=I(e),n=pe(e),o=e.ownerDocument.body,i=T(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=T(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+me(e);const l=-n.scrollTop;return W(o).direction==="rtl"&&(r+=T(t.clientWidth,o.clientWidth)-i),{width:i,height:s,x:r,y:l}}const ze=25;function cn(e,t){const n=k(e),o=I(e),i=n.visualViewport;let s=o.clientWidth,r=o.clientHeight,l=0,f=0;if(i){s=i.width,r=i.height;const a=_e();(!a||a&&t==="fixed")&&(l=i.offsetLeft,f=i.offsetTop)}const c=me(o);if(c<=0){const a=o.ownerDocument,u=a.body,m=getComputedStyle(u),d=a.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,p=Math.abs(o.clientWidth-u.clientWidth-d);p<=ze&&(s-=p)}else c<=ze&&(s+=c);return{width:s,height:r,x:l,y:f}}const fn=new Set(["absolute","fixed"]);function un(e,t){const n=Z(e,!0,t==="fixed"),o=n.top+e.clientTop,i=n.left+e.clientLeft,s=q(e)?te(e):N(1),r=e.clientWidth*s.x,l=e.clientHeight*s.y,f=i*s.x,c=o*s.y;return{width:r,height:l,x:f,y:c}}function He(e,t,n){let o;if(t==="viewport")o=cn(e,n);else if(t==="document")o=an(I(e));else if(M(t))o=un(t,n);else{const i=nt(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return fe(o)}function it(e,t){const n=K(e);return n===t||!M(n)||ne(n)?!1:W(n).position==="fixed"||it(n,t)}function dn(e,t){const n=t.get(e);if(n)return n;let o=re(e,[],!1).filter(l=>M(l)&&J(l)!=="body"),i=null;const s=W(e).position==="fixed";let r=s?K(e):e;for(;M(r)&&!ne(r);){const l=W(r),f=De(r);!f&&l.position==="fixed"&&(i=null),(s?!f&&!i:!f&&l.position==="static"&&!!i&&fn.has(i.position)||se(r)&&!f&&it(e,r))?o=o.filter(a=>a!==r):i=l,r=K(r)}return t.set(e,o),o}function pn(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const r=[...n==="clippingAncestors"?de(t)?[]:dn(t,this._c):[].concat(n),o],l=r[0],f=r.reduce((c,a)=>{const u=He(t,a,i);return c.top=T(u.top,c.top),c.right=G(u.right,c.right),c.bottom=G(u.bottom,c.bottom),c.left=T(u.left,c.left),c},He(t,l,i));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function mn(e){const{width:t,height:n}=tt(e);return{width:t,height:n}}function hn(e,t,n){const o=q(t),i=I(t),s=n==="fixed",r=Z(e,!0,s,t);let l={scrollLeft:0,scrollTop:0};const f=N(0);function c(){f.x=me(i)}if(o||!o&&!s)if((J(t)!=="body"||se(i))&&(l=pe(t)),o){const d=Z(t,!0,s,t);f.x=d.x+t.clientLeft,f.y=d.y+t.clientTop}else i&&c();s&&!o&&i&&c();const a=i&&!o&&!s?ot(i,l):N(0),u=r.left+l.scrollLeft-f.x-a.x,m=r.top+l.scrollTop-f.y-a.y;return{x:u,y:m,width:r.width,height:r.height}}function we(e){return W(e).position==="static"}function Ve(e,t){if(!q(e)||W(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return I(e)===n&&(n=n.ownerDocument.body),n}function rt(e,t){const n=k(e);if(de(e))return n;if(!q(e)){let i=K(e);for(;i&&!ne(i);){if(M(i)&&!we(i))return i;i=K(i)}return n}let o=Ve(e,t);for(;o&&Kt(o)&&we(o);)o=Ve(o,t);return o&&ne(o)&&we(o)&&!De(o)?n:o||tn(e)||n}const gn=async function(e){const t=this.getOffsetParent||rt,n=this.getDimensions,o=await n(e.floating);return{reference:hn(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function wn(e){return W(e).direction==="rtl"}const yn={convertOffsetParentRelativeRectToViewportRelativeRect:sn,getDocumentElement:I,getClippingRect:pn,getOffsetParent:rt,getElementRects:gn,getClientRects:ln,getDimensions:mn,getScale:te,isElement:M,isRTL:wn};function st(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function vn(e,t){let n=null,o;const i=I(e);function s(){var l;clearTimeout(o),(l=n)==null||l.disconnect(),n=null}function r(l,f){l===void 0&&(l=!1),f===void 0&&(f=1),s();const c=e.getBoundingClientRect(),{left:a,top:u,width:m,height:d}=c;if(l||t(),!m||!d)return;const p=le(u),h=le(i.clientWidth-(a+m)),g=le(i.clientHeight-(u+d)),w=le(a),v={rootMargin:-p+"px "+-h+"px "+-g+"px "+-w+"px",threshold:T(0,G(1,f))||1};let A=!0;function x(P){const b=P[0].intersectionRatio;if(b!==f){if(!A)return r();b?r(!1,b):o=setTimeout(()=>{r(!1,1e-7)},1e3)}b===1&&!st(c,e.getBoundingClientRect())&&r(),A=!1}try{n=new IntersectionObserver(x,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(x,v)}n.observe(e)}return r(!0),s}function xn(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:f=!1}=o,c=Le(e),a=i||s?[...c?re(c):[],...re(t)]:[];a.forEach(w=>{i&&w.addEventListener("scroll",n,{passive:!0}),s&&w.addEventListener("resize",n)});const u=c&&l?vn(c,n):null;let m=-1,d=null;r&&(d=new ResizeObserver(w=>{let[y]=w;y&&y.target===c&&d&&(d.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var v;(v=d)==null||v.observe(t)})),n()}),c&&!f&&d.observe(c),d.observe(t));let p,h=f?Z(e):null;f&&g();function g(){const w=Z(e);h&&!st(h,w)&&n(),h=w,p=requestAnimationFrame(g)}return n(),()=>{var w;a.forEach(y=>{i&&y.removeEventListener("scroll",n),s&&y.removeEventListener("resize",n)}),u?.(),(w=d)==null||w.disconnect(),d=null,f&&cancelAnimationFrame(p)}}const bn=It,An=jt,Ne=Vt,Cn=Yt,On=Nt,Sn=Ht,Pn=Xt,Rn=(e,t,n)=>{const o=new Map,i={platform:yn,...n},s={...i.platform,_c:o};return zt(e,t,{...i,platform:s})};function En(e){return e!=null&&typeof e=="object"&&"$el"in e}function Ae(e){if(En(e)){const t=e.$el;return Ee(t)&&J(t)==="#comment"?null:t}return e}function ee(e){return typeof e=="function"?e():F(e)}function Dn(e){return{name:"arrow",options:e,fn(t){const n=Ae(ee(e.element));return n==null?{}:Sn({element:n,padding:e.padding}).fn(t)}}}function lt(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function qe(e,t){const n=lt(e);return Math.round(t*n)/n}function _n(e,t,n){n===void 0&&(n={});const o=n.whileElementsMounted,i=C(()=>{var b;return(b=ee(n.open))!=null?b:!0}),s=C(()=>ee(n.middleware)),r=C(()=>{var b;return(b=ee(n.placement))!=null?b:"bottom"}),l=C(()=>{var b;return(b=ee(n.strategy))!=null?b:"absolute"}),f=C(()=>{var b;return(b=ee(n.transform))!=null?b:!0}),c=C(()=>Ae(e.value)),a=C(()=>Ae(t.value)),u=H(0),m=H(0),d=H(l.value),p=H(r.value),h=mt({}),g=H(!1),w=C(()=>{const b={position:d.value,left:"0",top:"0"};if(!a.value)return b;const O=qe(a.value,u.value),E=qe(a.value,m.value);return f.value?{...b,transform:"translate("+O+"px, "+E+"px)",...lt(a.value)>=1.5&&{willChange:"transform"}}:{position:d.value,left:O+"px",top:E+"px"}});let y;function v(){if(c.value==null||a.value==null)return;const b=i.value;Rn(c.value,a.value,{middleware:s.value,placement:r.value,strategy:l.value}).then(O=>{u.value=O.x,m.value=O.y,d.value=O.strategy,p.value=O.placement,h.value=O.middlewareData,g.value=b!==!1})}function A(){typeof y=="function"&&(y(),y=void 0)}function x(){if(A(),o===void 0){v();return}if(c.value!=null&&a.value!=null){y=o(c.value,a.value,v);return}}function P(){i.value||(g.value=!1)}return he([s,r,l,i],v,{flush:"sync"}),he([c,a],x,{flush:"sync"}),he(i,P,{flush:"sync"}),ht()&>(A),{x:Q(u),y:Q(m),strategy:Q(d),placement:Q(p),middlewareData:Q(h),isPositioned:Q(g),floatingStyles:w,update:v}}const Ln={side:"bottom",sideOffset:0,sideFlip:!0,align:"center",alignOffset:0,alignFlip:!0,arrowPadding:0,avoidCollisions:!0,collisionBoundary:()=>[],collisionPadding:0,sticky:"partial",hideWhenDetached:!1,positionStrategy:"fixed",updatePositionStrategy:"optimized",prioritizePosition:!1},[Vn,Tn]=Ke("PopperContent");var kn=Ce({inheritAttrs:!1,__name:"PopperContent",props:wt({side:{type:null,required:!1},sideOffset:{type:Number,required:!1},sideFlip:{type:Boolean,required:!1},align:{type:null,required:!1},alignOffset:{type:Number,required:!1},alignFlip:{type:Boolean,required:!1},avoidCollisions:{type:Boolean,required:!1},collisionBoundary:{type:null,required:!1},collisionPadding:{type:[Number,Object],required:!1},arrowPadding:{type:Number,required:!1},sticky:{type:String,required:!1},hideWhenDetached:{type:Boolean,required:!1},positionStrategy:{type:String,required:!1},updatePositionStrategy:{type:String,required:!1},disableUpdateOnLayoutShift:{type:Boolean,required:!1},prioritizePosition:{type:Boolean,required:!1},reference:{type:null,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},{...Ln}),emits:["placed"],setup(e,{emit:t}){const n=e,o=t,i=Ze(),{forwardRef:s,currentElement:r}=Ie(),l=H(),f=H(),{width:c,height:a}=At(f),u=C(()=>n.side+(n.align!=="center"?`-${n.align}`:"")),m=C(()=>typeof n.collisionPadding=="number"?n.collisionPadding:{top:0,right:0,bottom:0,left:0,...n.collisionPadding}),d=C(()=>Array.isArray(n.collisionBoundary)?n.collisionBoundary:[n.collisionBoundary]),p=C(()=>({padding:m.value,boundary:d.value.filter(Pt),altBoundary:d.value.length>0})),h=C(()=>({mainAxis:n.sideFlip,crossAxis:n.alignFlip})),g=ut(()=>[bn({mainAxis:n.sideOffset+a.value,alignmentAxis:n.alignOffset}),n.prioritizePosition&&n.avoidCollisions&&Ne({...p.value,...h.value}),n.avoidCollisions&&An({mainAxis:!0,crossAxis:!!n.prioritizePosition,limiter:n.sticky==="partial"?Pn():void 0,...p.value}),!n.prioritizePosition&&n.avoidCollisions&&Ne({...p.value,...h.value}),Cn({...p.value,apply:({elements:S,rects:B,availableWidth:R,availableHeight:j})=>{const{width:$,height:L}=B.reference,D=S.floating.style;D.setProperty("--reka-popper-available-width",`${R}px`),D.setProperty("--reka-popper-available-height",`${j}px`),D.setProperty("--reka-popper-anchor-width",`${$}px`),D.setProperty("--reka-popper-anchor-height",`${L}px`)}}),f.value&&Dn({element:f.value,padding:n.arrowPadding}),Rt({arrowWidth:c.value,arrowHeight:a.value}),n.hideWhenDetached&&On({strategy:"referenceHidden",...p.value})]),w=C(()=>n.reference??i.anchor.value),{floatingStyles:y,placement:v,isPositioned:A,middlewareData:x}=_n(w,l,{strategy:n.positionStrategy,placement:u,whileElementsMounted:(...S)=>xn(...S,{layoutShift:!n.disableUpdateOnLayoutShift,animationFrame:n.updatePositionStrategy==="always"}),middleware:g}),P=C(()=>ye(v.value)[0]),b=C(()=>ye(v.value)[1]);Xe(()=>{A.value&&o("placed")});const O=C(()=>x.value.arrow?.centerOffset!==0),E=H("");je(()=>{r.value&&(E.value=window.getComputedStyle(r.value).zIndex)});const _=C(()=>x.value.arrow?.x??0),z=C(()=>x.value.arrow?.y??0);return Tn({placedSide:P,onArrowChange:S=>f.value=S,arrowX:_,arrowY:z,shouldHideArrow:O}),(S,B)=>(Ye(),yt("div",{ref_key:"floatingRef",ref:l,"data-reka-popper-content-wrapper":"",style:bt({...F(y),transform:F(A)?F(y).transform:"translate(0, -200%)",minWidth:"max-content",zIndex:E.value,"--reka-popper-transform-origin":[F(x).transformOrigin?.x,F(x).transformOrigin?.y].join(" "),...F(x).hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}})},[vt(F(Ge),xt({ref:F(s)},S.$attrs,{"as-child":n.asChild,as:S.as,"data-side":P.value,"data-align":b.value,style:{animation:F(A)?void 0:"none"}}),{default:Ue(()=>[Oe(S.$slots,"default")]),_:3},16,["as-child","as","data-side","data-align","style"])],4))}}),Nn=kn;export{zn as P,Nn as a,Hn as b,Wn as u};
|