v-float 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +20 -20
- package/dist/composables/index.d.ts +3 -3
- package/dist/composables/index.d.ts.map +1 -1
- package/dist/composables/interactions/index.d.ts +2 -2
- package/dist/composables/interactions/index.d.ts.map +1 -1
- package/dist/composables/interactions/polygon.d.ts.map +1 -1
- package/dist/composables/interactions/use-click.d.ts +1 -1
- package/dist/composables/interactions/use-click.d.ts.map +1 -1
- package/dist/composables/interactions/use-client-point.d.ts +1 -1
- package/dist/composables/interactions/use-client-point.d.ts.map +1 -1
- package/dist/composables/interactions/use-focus.d.ts +1 -1
- package/dist/composables/interactions/use-focus.d.ts.map +1 -1
- package/dist/composables/interactions/use-hover.d.ts +1 -1
- package/dist/composables/interactions/use-hover.d.ts.map +1 -1
- package/dist/composables/interactions/utils/index.d.ts +3 -3
- package/dist/composables/interactions/utils/index.d.ts.map +1 -1
- package/dist/composables/interactions/utils/tree-context.d.ts +1 -1
- package/dist/composables/interactions/utils/tree-context.d.ts.map +1 -1
- package/dist/composables/middlewares/index.d.ts +1 -1
- package/dist/composables/middlewares/index.d.ts.map +1 -1
- package/dist/composables/use-arrow.d.ts +0 -5
- package/dist/composables/use-arrow.d.ts.map +1 -1
- package/dist/composables/use-floating.d.ts.map +1 -1
- package/dist/composables/use-tree.d.ts.map +1 -1
- package/dist/v-float.es.js +1983 -1983
- package/dist/v-float.umd.js +1 -1
- package/package.json +1 -1
package/dist/v-float.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(T,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],c):(T=typeof globalThis<"u"?globalThis:T||self,c(T.VFloat={},T.Vue))})(this,(function(T,c){"use strict";var xo=Object.defineProperty;var Qt=T=>{throw TypeError(T)};var To=(T,c,$)=>c in T?xo(T,c,{enumerable:!0,configurable:!0,writable:!0,value:$}):T[c]=$;var he=(T,c,$)=>To(T,typeof c!="symbol"?c+"":c,$),lt=(T,c,$)=>c.has(T)||Qt("Cannot "+$);var at=(T,c,$)=>(lt(T,c,"read from private field"),$?$.call(T):c.get(T)),We=(T,c,$)=>c.has(T)?Qt("Cannot add the same private member more than once"):c instanceof WeakSet?c.add(T):c.set(T,$),ct=(T,c,$,Z)=>(lt(T,c,"write to private field"),Z?Z.call(T,$):c.set(T,$),$),ut=(T,c,$)=>(lt(T,c,"access private method"),$);var xe,Te,Ce,ft;const $=["top","right","bottom","left"],Z=Math.min,re=Math.max,Le=Math.round,Oe=Math.floor,K=e=>({x:e,y:e}),Zt={left:"right",right:"left",bottom:"top",top:"bottom"},en={start:"end",end:"start"};function $e(e,t,n){return re(e,Z(t,n))}function me(e,t){return typeof e=="function"?e(t):e}function se(e){return e.split("-")[0]}function ye(e){return e.split("-")[1]}function dt(e){return e==="x"?"y":"x"}function Xe(e){return e==="y"?"height":"width"}const tn=new Set(["top","bottom"]);function ne(e){return tn.has(se(e))?"y":"x"}function Ye(e){return dt(ne(e))}function nn(e,t,n){n===void 0&&(n=!1);const o=ye(e),i=Ye(e),r=Xe(i);let l=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(l=Se(l)),[l,Se(l)]}function on(e){const t=Se(e);return[je(e),t,je(t)]}function je(e){return e.replace(/start|end/g,t=>en[t])}const ht=["left","right"],mt=["right","left"],rn=["top","bottom"],sn=["bottom","top"];function ln(e,t,n){switch(e){case"top":case"bottom":return n?t?mt:ht:t?ht:mt;case"left":case"right":return t?rn:sn;default:return[]}}function an(e,t,n,o){const i=ye(e);let r=ln(se(e),n==="start",o);return i&&(r=r.map(l=>l+"-"+i),t&&(r=r.concat(r.map(je)))),r}function Se(e){return e.replace(/left|right|bottom|top/g,t=>Zt[t])}function cn(e){return{top:0,right:0,bottom:0,left:0,...e}}function pt(e){return typeof e!="number"?cn(e):{top:e,right:e,bottom:e,left:e}}function Me(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 gt(e,t,n){let{reference:o,floating:i}=e;const r=ne(t),l=Ye(t),a=Xe(l),f=se(t),u=r==="y",m=o.x+o.width/2-i.width/2,d=o.y+o.height/2-i.height/2,g=o[a]/2-i[a]/2;let h;switch(f){case"top":h={x:m,y:o.y-i.height};break;case"bottom":h={x:m,y:o.y+o.height};break;case"right":h={x:o.x+o.width,y:d};break;case"left":h={x:o.x-i.width,y:d};break;default:h={x:o.x,y:o.y}}switch(ye(t)){case"start":h[l]-=g*(n&&u?-1:1);break;case"end":h[l]+=g*(n&&u?-1:1);break}return h}const un=async(e,t,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:l}=n,a=r.filter(Boolean),f=await(l.isRTL==null?void 0:l.isRTL(t));let u=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:m,y:d}=gt(u,o,f),g=o,h={},w=0;for(let p=0;p<a.length;p++){const{name:E,fn:y}=a[p],{x:b,y:L,data:S,reset:C}=await y({x:m,y:d,initialPlacement:o,placement:g,strategy:i,middlewareData:h,rects:u,platform:l,elements:{reference:e,floating:t}});m=b??m,d=L??d,h={...h,[E]:{...h[E],...S}},C&&w<=50&&(w++,typeof C=="object"&&(C.placement&&(g=C.placement),C.rects&&(u=C.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:i}):C.rects),{x:m,y:d}=gt(u,g,f)),p=-1)}return{x:m,y:d,placement:g,strategy:i,middlewareData:h}};async function Ae(e,t){var n;t===void 0&&(t={});const{x:o,y:i,platform:r,rects:l,elements:a,strategy:f}=e,{boundary:u="clippingAncestors",rootBoundary:m="viewport",elementContext:d="floating",altBoundary:g=!1,padding:h=0}=me(t,e),w=pt(h),E=a[g?d==="floating"?"reference":"floating":d],y=Me(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(E)))==null||n?E:E.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(a.floating)),boundary:u,rootBoundary:m,strategy:f})),b=d==="floating"?{x:o,y:i,width:l.floating.width,height:l.floating.height}:l.reference,L=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a.floating)),S=await(r.isElement==null?void 0:r.isElement(L))?await(r.getScale==null?void 0:r.getScale(L))||{x:1,y:1}:{x:1,y:1},C=Me(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:b,offsetParent:L,strategy:f}):b);return{top:(y.top-C.top+w.top)/S.y,bottom:(C.bottom-y.bottom+w.bottom)/S.y,left:(y.left-C.left+w.left)/S.x,right:(C.right-y.right+w.right)/S.x}}const fn=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:i,rects:r,platform:l,elements:a,middlewareData:f}=t,{element:u,padding:m=0}=me(e,t)||{};if(u==null)return{};const d=pt(m),g={x:n,y:o},h=Ye(i),w=Xe(h),p=await l.getDimensions(u),E=h==="y",y=E?"top":"left",b=E?"bottom":"right",L=E?"clientHeight":"clientWidth",S=r.reference[w]+r.reference[h]-g[h]-r.floating[w],C=g[h]-r.reference[h],P=await(l.getOffsetParent==null?void 0:l.getOffsetParent(u));let N=P?P[L]:0;(!N||!await(l.isElement==null?void 0:l.isElement(P)))&&(N=a.floating[L]||r.floating[w]);const V=S/2-C/2,R=N/2-p[w]/2-1,D=Z(d[y],R),A=Z(d[b],R),k=D,W=N-p[w]-A,F=N/2-p[w]/2+V,j=$e(k,F,W),x=!f.arrow&&ye(i)!=null&&F!==j&&r.reference[w]/2-(F<k?D:A)-p[w]/2<0,s=x?F<k?F-k:F-W:0;return{[h]:g[h]+s,data:{[h]:j,centerOffset:F-j-s,...x&&{alignmentOffset:s}},reset:x}}}),dn=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:i,middlewareData:r,rects:l,initialPlacement:a,platform:f,elements:u}=t,{mainAxis:m=!0,crossAxis:d=!0,fallbackPlacements:g,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:p=!0,...E}=me(e,t);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const y=se(i),b=ne(a),L=se(a)===a,S=await(f.isRTL==null?void 0:f.isRTL(u.floating)),C=g||(L||!p?[Se(a)]:on(a)),P=w!=="none";!g&&P&&C.push(...an(a,p,w,S));const N=[a,...C],V=await Ae(t,E),R=[];let D=((o=r.flip)==null?void 0:o.overflows)||[];if(m&&R.push(V[y]),d){const F=nn(i,l,S);R.push(V[F[0]],V[F[1]])}if(D=[...D,{placement:i,overflows:R}],!R.every(F=>F<=0)){var A,k;const F=(((A=r.flip)==null?void 0:A.index)||0)+1,j=N[F];if(j&&(!(d==="alignment"?b!==ne(j):!1)||D.every(v=>ne(v.placement)===b?v.overflows[0]>0:!0)))return{data:{index:F,overflows:D},reset:{placement:j}};let x=(k=D.filter(s=>s.overflows[0]<=0).sort((s,v)=>s.overflows[1]-v.overflows[1])[0])==null?void 0:k.placement;if(!x)switch(h){case"bestFit":{var W;const s=(W=D.filter(v=>{if(P){const H=ne(v.placement);return H===b||H==="y"}return!0}).map(v=>[v.placement,v.overflows.filter(H=>H>0).reduce((H,Y)=>H+Y,0)]).sort((v,H)=>v[1]-H[1])[0])==null?void 0:W[0];s&&(x=s);break}case"initialPlacement":x=a;break}if(i!==x)return{reset:{placement:x}}}return{}}}};function vt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function wt(e){return $.some(t=>e[t]>=0)}const hn=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...i}=me(e,t);switch(o){case"referenceHidden":{const r=await Ae(t,{...i,elementContext:"reference"}),l=vt(r,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:wt(l)}}}case"escaped":{const r=await Ae(t,{...i,altBoundary:!0}),l=vt(r,n.floating);return{data:{escapedOffsets:l,escaped:wt(l)}}}default:return{}}}}},mn=new Set(["left","top"]);async function pn(e,t){const{placement:n,platform:o,elements:i}=e,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),l=se(n),a=ye(n),f=ne(n)==="y",u=mn.has(l)?-1:1,m=r&&f?-1:1,d=me(t,e);let{mainAxis:g,crossAxis:h,alignmentAxis:w}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof w=="number"&&(h=a==="end"?w*-1:w),f?{x:h*m,y:g*u}:{x:g*u,y:h*m}}const gn=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:i,y:r,placement:l,middlewareData:a}=t,f=await pn(t,e);return l===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:i+f.x,y:r+f.y,data:{...f,placement:l}}}}},vn=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:i}=t,{mainAxis:r=!0,crossAxis:l=!1,limiter:a={fn:E=>{let{x:y,y:b}=E;return{x:y,y:b}}},...f}=me(e,t),u={x:n,y:o},m=await Ae(t,f),d=ne(se(i)),g=dt(d);let h=u[g],w=u[d];if(r){const E=g==="y"?"top":"left",y=g==="y"?"bottom":"right",b=h+m[E],L=h-m[y];h=$e(b,h,L)}if(l){const E=d==="y"?"top":"left",y=d==="y"?"bottom":"right",b=w+m[E],L=w-m[y];w=$e(b,w,L)}const p=a.fn({...t,[g]:h,[d]:w});return{...p,data:{x:p.x-n,y:p.y-o,enabled:{[g]:r,[d]:l}}}}}};function Ne(){return typeof window<"u"}function pe(e){return yt(e)?(e.nodeName||"").toLowerCase():"#document"}function _(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function G(e){var t;return(t=(yt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function yt(e){return Ne()?e instanceof Node||e instanceof _(e).Node:!1}function z(e){return Ne()?e instanceof Element||e instanceof _(e).Element:!1}function J(e){return Ne()?e instanceof HTMLElement||e instanceof _(e).HTMLElement:!1}function bt(e){return!Ne()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof _(e).ShadowRoot}const wn=new Set(["inline","contents"]);function be(e){const{overflow:t,overflowX:n,overflowY:o,display:i}=U(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!wn.has(i)}const yn=new Set(["table","td","th"]);function bn(e){return yn.has(pe(e))}const En=[":popover-open",":modal"];function De(e){return En.some(t=>{try{return e.matches(t)}catch{return!1}})}const xn=["transform","translate","scale","rotate","perspective"],Tn=["transform","translate","scale","rotate","perspective","filter"],Cn=["paint","layout","strict","content"];function _e(e){const t=ze(),n=z(e)?U(e):e;return xn.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)||Tn.some(o=>(n.willChange||"").includes(o))||Cn.some(o=>(n.contain||"").includes(o))}function Pn(e){let t=oe(e);for(;J(t)&&!ge(t);){if(_e(t))return t;if(De(t))return null;t=oe(t)}return null}function ze(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Ln=new Set(["html","body","#document"]);function ge(e){return Ln.has(pe(e))}function U(e){return _(e).getComputedStyle(e)}function Ve(e){return z(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function oe(e){if(pe(e)==="html")return e;const t=e.assignedSlot||e.parentNode||bt(e)&&e.host||G(e);return bt(t)?t.host:t}function Et(e){const t=oe(e);return ge(t)?e.ownerDocument?e.ownerDocument.body:e.body:J(t)&&be(t)?t:Et(t)}function Ee(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Et(e),r=i===((o=e.ownerDocument)==null?void 0:o.body),l=_(i);if(r){const a=Ue(l);return t.concat(l,l.visualViewport||[],be(i)?i:[],a&&n?Ee(a):[])}return t.concat(i,Ee(i,[],n))}function Ue(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function xt(e){const t=U(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=J(e),r=i?e.offsetWidth:n,l=i?e.offsetHeight:o,a=Le(n)!==r||Le(o)!==l;return a&&(n=r,o=l),{width:n,height:o,$:a}}function qe(e){return z(e)?e:e.contextElement}function ve(e){const t=qe(e);if(!J(t))return K(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:r}=xt(t);let l=(r?Le(n.width):n.width)/o,a=(r?Le(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!a||!Number.isFinite(a))&&(a=1),{x:l,y:a}}const On=K(0);function Tt(e){const t=_(e);return!ze()||!t.visualViewport?On:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Sn(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==_(e)?!1:t}function le(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),r=qe(e);let l=K(1);t&&(o?z(o)&&(l=ve(o)):l=ve(e));const a=Sn(r,n,o)?Tt(r):K(0);let f=(i.left+a.x)/l.x,u=(i.top+a.y)/l.y,m=i.width/l.x,d=i.height/l.y;if(r){const g=_(r),h=o&&z(o)?_(o):o;let w=g,p=Ue(w);for(;p&&o&&h!==w;){const E=ve(p),y=p.getBoundingClientRect(),b=U(p),L=y.left+(p.clientLeft+parseFloat(b.paddingLeft))*E.x,S=y.top+(p.clientTop+parseFloat(b.paddingTop))*E.y;f*=E.x,u*=E.y,m*=E.x,d*=E.y,f+=L,u+=S,w=_(p),p=Ue(w)}}return Me({width:m,height:d,x:f,y:u})}function Re(e,t){const n=Ve(e).scrollLeft;return t?t.left+n:le(G(e)).left+n}function Ct(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Re(e,n),i=n.top+t.scrollTop;return{x:o,y:i}}function Mn(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const r=i==="fixed",l=G(o),a=t?De(t.floating):!1;if(o===l||a&&r)return n;let f={scrollLeft:0,scrollTop:0},u=K(1);const m=K(0),d=J(o);if((d||!d&&!r)&&((pe(o)!=="body"||be(l))&&(f=Ve(o)),J(o))){const h=le(o);u=ve(o),m.x=h.x+o.clientLeft,m.y=h.y+o.clientTop}const g=l&&!d&&!r?Ct(l,f):K(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-f.scrollLeft*u.x+m.x+g.x,y:n.y*u.y-f.scrollTop*u.y+m.y+g.y}}function An(e){return Array.from(e.getClientRects())}function Nn(e){const t=G(e),n=Ve(e),o=e.ownerDocument.body,i=re(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),r=re(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let l=-n.scrollLeft+Re(e);const a=-n.scrollTop;return U(o).direction==="rtl"&&(l+=re(t.clientWidth,o.clientWidth)-i),{width:i,height:r,x:l,y:a}}const Pt=25;function Dn(e,t){const n=_(e),o=G(e),i=n.visualViewport;let r=o.clientWidth,l=o.clientHeight,a=0,f=0;if(i){r=i.width,l=i.height;const m=ze();(!m||m&&t==="fixed")&&(a=i.offsetLeft,f=i.offsetTop)}const u=Re(o);if(u<=0){const m=o.ownerDocument,d=m.body,g=getComputedStyle(d),h=m.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,w=Math.abs(o.clientWidth-d.clientWidth-h);w<=Pt&&(r-=w)}else u<=Pt&&(r+=u);return{width:r,height:l,x:a,y:f}}const Vn=new Set(["absolute","fixed"]);function Rn(e,t){const n=le(e,!0,t==="fixed"),o=n.top+e.clientTop,i=n.left+e.clientLeft,r=J(e)?ve(e):K(1),l=e.clientWidth*r.x,a=e.clientHeight*r.y,f=i*r.x,u=o*r.y;return{width:l,height:a,x:f,y:u}}function Lt(e,t,n){let o;if(t==="viewport")o=Dn(e,n);else if(t==="document")o=Nn(G(e));else if(z(t))o=Rn(t,n);else{const i=Tt(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Me(o)}function Ot(e,t){const n=oe(e);return n===t||!z(n)||ge(n)?!1:U(n).position==="fixed"||Ot(n,t)}function kn(e,t){const n=t.get(e);if(n)return n;let o=Ee(e,[],!1).filter(a=>z(a)&&pe(a)!=="body"),i=null;const r=U(e).position==="fixed";let l=r?oe(e):e;for(;z(l)&&!ge(l);){const a=U(l),f=_e(l);!f&&a.position==="fixed"&&(i=null),(r?!f&&!i:!f&&a.position==="static"&&!!i&&Vn.has(i.position)||be(l)&&!f&&Ot(e,l))?o=o.filter(m=>m!==l):i=a,l=oe(l)}return t.set(e,o),o}function Fn(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const l=[...n==="clippingAncestors"?De(t)?[]:kn(t,this._c):[].concat(n),o],a=l[0],f=l.reduce((u,m)=>{const d=Lt(t,m,i);return u.top=re(d.top,u.top),u.right=Z(d.right,u.right),u.bottom=Z(d.bottom,u.bottom),u.left=re(d.left,u.left),u},Lt(t,a,i));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function Hn(e){const{width:t,height:n}=xt(e);return{width:t,height:n}}function Bn(e,t,n){const o=J(t),i=G(t),r=n==="fixed",l=le(e,!0,r,t);let a={scrollLeft:0,scrollTop:0};const f=K(0);function u(){f.x=Re(i)}if(o||!o&&!r)if((pe(t)!=="body"||be(i))&&(a=Ve(t)),o){const h=le(t,!0,r,t);f.x=h.x+t.clientLeft,f.y=h.y+t.clientTop}else i&&u();r&&!o&&i&&u();const m=i&&!o&&!r?Ct(i,a):K(0),d=l.left+a.scrollLeft-f.x-m.x,g=l.top+a.scrollTop-f.y-m.y;return{x:d,y:g,width:l.width,height:l.height}}function Ke(e){return U(e).position==="static"}function St(e,t){if(!J(e)||U(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return G(e)===n&&(n=n.ownerDocument.body),n}function Mt(e,t){const n=_(e);if(De(e))return n;if(!J(e)){let i=oe(e);for(;i&&!ge(i);){if(z(i)&&!Ke(i))return i;i=oe(i)}return n}let o=St(e,t);for(;o&&bn(o)&&Ke(o);)o=St(o,t);return o&&ge(o)&&Ke(o)&&!_e(o)?n:o||Pn(e)||n}const In=async function(e){const t=this.getOffsetParent||Mt,n=this.getDimensions,o=await n(e.floating);return{reference:Bn(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function Wn(e){return U(e).direction==="rtl"}const $n={convertOffsetParentRelativeRectToViewportRelativeRect:Mn,getDocumentElement:G,getClippingRect:Fn,getOffsetParent:Mt,getElementRects:In,getClientRects:An,getDimensions:Hn,getScale:ve,isElement:z,isRTL:Wn};function At(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Xn(e,t){let n=null,o;const i=G(e);function r(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function l(a,f){a===void 0&&(a=!1),f===void 0&&(f=1),r();const u=e.getBoundingClientRect(),{left:m,top:d,width:g,height:h}=u;if(a||t(),!g||!h)return;const w=Oe(d),p=Oe(i.clientWidth-(m+g)),E=Oe(i.clientHeight-(d+h)),y=Oe(m),L={rootMargin:-w+"px "+-p+"px "+-E+"px "+-y+"px",threshold:re(0,Z(1,f))||1};let S=!0;function C(P){const N=P[0].intersectionRatio;if(N!==f){if(!S)return l();N?l(!1,N):o=setTimeout(()=>{l(!1,1e-7)},1e3)}N===1&&!At(u,e.getBoundingClientRect())&&l(),S=!1}try{n=new IntersectionObserver(C,{...L,root:i.ownerDocument})}catch{n=new IntersectionObserver(C,L)}n.observe(e)}return l(!0),r}function Yn(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:f=!1}=o,u=qe(e),m=i||r?[...u?Ee(u):[],...Ee(t)]:[];m.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),r&&y.addEventListener("resize",n)});const d=u&&a?Xn(u,n):null;let g=-1,h=null;l&&(h=new ResizeObserver(y=>{let[b]=y;b&&b.target===u&&h&&(h.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var L;(L=h)==null||L.observe(t)})),n()}),u&&!f&&h.observe(u),h.observe(t));let w,p=f?le(e):null;f&&E();function E(){const y=le(e);p&&!At(p,y)&&n(),p=y,w=requestAnimationFrame(E)}return n(),()=>{var y;m.forEach(b=>{i&&b.removeEventListener("scroll",n),r&&b.removeEventListener("resize",n)}),d==null||d(),(y=h)==null||y.disconnect(),h=null,f&&cancelAnimationFrame(w)}}const jn=gn,_n=vn,zn=dn,Un=hn,qn=fn,Kn=(e,t,n)=>{const o=new Map,i={platform:$n,...n},r={...i.platform,_c:o};return un(e,t,{...i,platform:r})};function Gn(e){return{name:"arrow",options:e,fn(t){const n=c.toValue(e.element);return n==null?{}:qn({element:n,padding:e.padding}).fn(t)}}}function Ge(e,t,n={}){const{transform:o=!0,middlewares:i,autoUpdate:r=!0,open:l=c.ref(!1)}=n,a=C=>{l.value=C},f=c.computed(()=>c.toValue(n.placement)??"bottom"),u=c.computed(()=>c.toValue(n.strategy)??"absolute"),m=c.ref(0),d=c.ref(0),g=c.ref(f.value),h=c.ref(u.value),w=c.shallowRef({}),p=c.ref(!1),E=c.ref(null),y=c.computed(()=>{const C=i||[];return E.value&&!C.some(N=>N.name==="arrow")?[...C,Gn({element:E})]:C}),b=async()=>{if(!e.value||!t.value)return;const C=await Kn(e.value,t.value,{placement:f.value,strategy:u.value,middleware:y.value});m.value=C.x,d.value=C.y,g.value=C.placement,h.value=C.strategy,w.value=C.middlewareData,p.value=l.value};c.watch([f,u],()=>{l.value&&b()});let L;c.watch([e,t,l],([C,P,N])=>{!N||!C||!P||(r&&(L=Yn(C,P,b,typeof r=="object"?r:void 0)),c.onWatcherCleanup(()=>{L==null||L(),L=void 0}))},{immediate:!0}),c.onScopeDispose(()=>L==null?void 0:L()),c.watch(l,C=>{C||(p.value=!1)});const S=c.ref({position:u.value,left:"0",top:"0"});return c.watch([m,d,()=>c.toValue(o)],([C,P,N])=>{const V=t.value;if(!V)return;const R={position:h.value,left:"0",top:"0"},D=Nt(V,C),A=Nt(V,P);N?S.value={...R,transform:`translate(${D}px, ${A}px)`,...Dt(V)>=1.5&&{"will-change":"transform"}}:S.value={...R,left:`${D}px`,top:`${A}px`}},{immediate:!0}),{x:m,y:d,strategy:h,placement:g,middlewareData:w,isPositioned:p,floatingStyles:S,update:b,refs:{anchorEl:e,floatingEl:t,arrowEl:E},open:l,setOpen:a}}function Nt(e,t){const n=Dt(e);return Math.round(t*n)/n}function Dt(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Jn(e,t,n={}){const{offset:o="-4px",padding:i}=n,{middlewareData:r,placement:l,refs:a}=t;c.watch(e,d=>{a.arrowEl.value=d});const f=c.computed(()=>{var d;return((d=r.value.arrow)==null?void 0:d.x)??0}),u=c.computed(()=>{var d;return((d=r.value.arrow)==null?void 0:d.y)??0}),m=c.computed(()=>{if(!(e.value||a.arrowEl.value)||!r.value.arrow)return{};const g=c.toValue(l).split("-")[0],h=f.value,w=u.value;return g==="bottom"?{"inset-inline-start":`${h}px`,"inset-block-start":o}:g==="top"?{"inset-inline-start":`${h}px`,"inset-block-end":o}:g==="right"?{"inset-block-start":`${w}px`,"inset-inline-start":o}:g==="left"?{"inset-block-start":`${w}px`,"inset-inline-end":o}:{}});return{arrowX:f,arrowY:u,arrowStyles:m}}let Qn=0;function Zn(){return`vfloat-id-${Qn++}`}function Vt(e){return typeof e=="object"&&e instanceof HTMLElement}function Rt(e){return e!==null&&typeof e=="object"&&"data"in e&&"id"in e&&"children"in e&&"parent"in e}function ke(e){return Rt(e)?{floatingContext:e.data,treeContext:e}:{floatingContext:e,treeContext:null}}function q(e,t){if(!t)return!1;if(typeof t=="object"&&t!==null&&"contextElement"in t){const n=t.contextElement;return n instanceof Element?n.contains(e):!1}return t instanceof Element?t.contains(e):!1}function Fe(e,t){for(const n of e.children.value)if(n.data.open.value){if(q(t,n.data.refs.anchorEl.value)||q(t,n.data.refs.floatingEl.value))return n;const o=Fe(n,t);if(o)return o}return null}function He(e,t){if(e===void 0)return!1;const n=e==="mouse";return t?n:n||e==="pen"}function Je(e){return!e||!(e instanceof HTMLElement)?!1:e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e.isContentEditable&&e.contentEditable!=="false"}function Qe(e){const t=e.target;return t instanceof HTMLElement?t.tagName==="BUTTON"||t.tagName==="INPUT"&&t.getAttribute("type")==="button"||t.getAttribute("role")==="button":!1}function Ze(e){return Je(e)}function kt(e){return e instanceof Element&&e instanceof HTMLElement}function Ft(e){return typeof e=="object"&&e!==null&&"contextElement"in e}function et(e,t){return t?"composedPath"in e&&typeof e.composedPath=="function"?e.composedPath().includes(t):t.contains(e.target):!1}function Ht(e,t){const n=t.getBoundingClientRect(),o=t.offsetWidth-t.clientWidth,i=t.offsetHeight-t.clientHeight,r=e.clientX-n.left,l=e.clientY-n.top;if(o>0){const a=t.clientWidth;if(r>=a&&r<=t.offsetWidth)return!0}if(i>0){const a=t.clientHeight;if(l>=a&&l<=t.offsetHeight)return!0}return!1}function tt(){return typeof navigator>"u"?!1:navigator.platform.toUpperCase().indexOf("MAC")>=0}function nt(){return typeof navigator>"u"?!1:/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Bt(e){return typeof(e==null?void 0:e.matches)!="function"?!1:e.matches(":focus-visible")}function Be(e,t){return e.contains(t)}function It(e){return e.target}function ot(){return typeof performance<"u"?performance.now():Date.now()}function it(e){e!==-1&&clearTimeout(e)}function Wt(e){return e.children.value.some(t=>t.data.open.value||Wt(t))}function eo(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function $t(e,t){const[n,o]=e;let i=!1;const r=t.length;for(let l=0,a=r-1;l<r;a=l++){const[f,u]=t[l]||[0,0],[m,d]=t[a]||[0,0];u>=o!=d>=o&&n<=(m-f)*(o-u)/(d-u)+f&&(i=!i)}return i}function to(e={}){const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:o=!0}=e;let i=-1,r=!1;function l(f,u,m,d,g){const h=ot(),w=h-g;if(m===null||d===null||w===0)return{speed:null,lastX:f,lastY:u,lastCursorTime:h};const p=f-m,E=u-d;return{speed:Math.sqrt(p*p+E*E)/w,lastX:f,lastY:u,lastCursorTime:h}}const a=function(u){const{x:m,y:d,placement:g,elements:h,buffer:w,onClose:p,nodeId:E,tree:y}=u,b=c.computed(()=>{const P=h.domReference;return Vt(P)?P:(P==null?void 0:P.contextElement)??null});let L=null,S=null,C=ot();return function(N){var _t,zt,Ut,qt,Kt,Gt,Jt;function V(){it(i),i=-1,p()}if(it(i),i=-1,!h.domReference||!h.floating||g==null||m==null||d==null)return;const{clientX:R,clientY:D}=N,A=[R,D],k=It(N),W=N.type==="mouseleave",F=h.floating&&Be(h.floating,k),j=b.value&&Be(b.value,k),x=(_t=b.value)==null?void 0:_t.getBoundingClientRect(),s=(zt=h.floating)==null?void 0:zt.getBoundingClientRect(),v=g.split("-")[0],H=m>((s==null?void 0:s.right)??0)-((s==null?void 0:s.width)??0)/2,Y=d>((s==null?void 0:s.bottom)??0)-((s==null?void 0:s.height)??0)/2,ee=x?eo(A,x):!1,O=((s==null?void 0:s.width)??0)>((x==null?void 0:x.width)??0),I=((s==null?void 0:s.height)??0)>((x==null?void 0:x.height)??0),ae=((Ut=O?x:s)==null?void 0:Ut.left)??0,te=((qt=O?x:s)==null?void 0:qt.right)??0,ce=((Kt=I?x:s)==null?void 0:Kt.top)??0,ue=((Gt=I?x:s)==null?void 0:Gt.bottom)??0;if(F&&(r=!0,!W))return;if(j&&(r=!1),j&&!W){r=!0;return}if(W&&Vt(N.relatedTarget)&&h.floating&&Be(h.floating,N.relatedTarget))return;if(y&&E){const B=y.nodes.get(E);if(B&&Wt(B))return}if(v==="top"&&d>=((x==null?void 0:x.bottom)??0)-1||v==="bottom"&&d<=((x==null?void 0:x.top)??0)+1||v==="left"&&m>=((x==null?void 0:x.right)??0)-1||v==="right"&&m<=((x==null?void 0:x.left)??0)+1)return V();let ie=[];switch(v){case"top":ie=[[ae,((x==null?void 0:x.top)??0)+1],[ae,((s==null?void 0:s.bottom)??0)-1],[te,((s==null?void 0:s.bottom)??0)-1],[te,((x==null?void 0:x.top)??0)+1]];break;case"bottom":ie=[[ae,((s==null?void 0:s.top)??0)+1],[ae,((x==null?void 0:x.bottom)??0)-1],[te,((x==null?void 0:x.bottom)??0)-1],[te,((s==null?void 0:s.top)??0)+1]];break;case"left":ie=[[((s==null?void 0:s.right)??0)-1,ue],[((s==null?void 0:s.right)??0)-1,ce],[((x==null?void 0:x.left)??0)+1,ce],[((x==null?void 0:x.left)??0)+1,ue]];break;case"right":ie=[[((x==null?void 0:x.right)??0)-1,ue],[((x==null?void 0:x.right)??0)-1,ce],[((s==null?void 0:s.left)??0)+1,ce],[((s==null?void 0:s.left)??0)+1,ue]];break}function Pe([B,X]){const M=w;switch(v){case"top":{const fe=[O?B+M/2:H?B+M*4:B-M*4,X+M+1],de=[O?B-M/2:H?B+M*4:B-M*4,X+M+1],we=[[(s==null?void 0:s.left)??0,H||O?((s==null?void 0:s.bottom)??0)-M:(s==null?void 0:s.top)??0],[(s==null?void 0:s.right)??0,H?O?((s==null?void 0:s.bottom)??0)-M:(s==null?void 0:s.top)??0:((s==null?void 0:s.bottom)??0)-M]];return[fe,de,...we]}case"bottom":{const fe=[O?B+M/2:H?B+M*4:B-M*4,X-M],de=[O?B-M/2:H?B+M*4:B-M*4,X-M],we=[[(s==null?void 0:s.left)??0,H||O?((s==null?void 0:s.top)??0)+M:(s==null?void 0:s.bottom)??0],[(s==null?void 0:s.right)??0,H?O?((s==null?void 0:s.top)??0)+M:(s==null?void 0:s.bottom)??0:((s==null?void 0:s.top)??0)+M]];return[fe,de,...we]}case"left":{const fe=[B+M+1,I?X+M/2:Y?X+M*4:X-M*4],de=[B+M+1,I?X-M/2:Y?X+M*4:X-M*4];return[...[[Y||I?((s==null?void 0:s.right)??0)-M:(s==null?void 0:s.left)??0,(s==null?void 0:s.top)??0],[Y?I?((s==null?void 0:s.right)??0)-M:(s==null?void 0:s.left)??0:((s==null?void 0:s.right)??0)-M,(s==null?void 0:s.bottom)??0]],fe,de]}case"right":{const fe=[B-M,I?X+M/2:Y?X+M*4:X-M*4],de=[B-M,I?X-M/2:Y?X+M*4:X-M*4],we=[[Y||I?((s==null?void 0:s.left)??0)+M:(s==null?void 0:s.right)??0,(s==null?void 0:s.top)??0],[Y?I?((s==null?void 0:s.left)??0)+M:(s==null?void 0:s.right)??0:((s==null?void 0:s.left)??0)+M,(s==null?void 0:s.bottom)??0]];return[fe,de,...we]}}}const Ie=Pe([m,d]);if((Jt=e.onPolygonChange)==null||Jt.call(e,Ie),!$t(A,ie)){if($t(A,Ie)){if(!r&&o){const B=l(N.clientX,N.clientY,L,S,C);L=B.lastX,S=B.lastY,C=B.lastCursorTime,B.speed!==null&&B.speed<.1&&(i=window.setTimeout(V,40))}return}if(r&&!ee)return V();V()}}};return a.__options={blockPointerEvents:n},a}const Xt=10;function no(e,t,n){const{delay:o}=n,i=c.computed(()=>{const u=c.toValue(o);return(typeof u=="number"?u:u.open)??0}),r=c.computed(()=>{const u=c.toValue(o);return(typeof u=="number"?u:u.close)??0});let l,a;const f=()=>{clearTimeout(l),clearTimeout(a)};return c.onScopeDispose(f),{show:u=>{f();const m=u??i.value;m===0?e():l=setTimeout(e,m)},hide:u=>{f();const m=u??r.value;m===0?t():a=setTimeout(t,m)},showDelay:i,hideDelay:r,clearTimeouts:f}}function oo(e,t={}){const{floatingContext:n,treeContext:o}=ke(e),{open:i,setOpen:r,refs:{anchorEl:l,floatingEl:a}}=n,{enabled:f=!0,delay:u=0,restMs:m=0,mouseOnly:d=!1,safePolygon:g=!1}=t,h=c.computed(()=>c.toValue(f)),w=c.computed(()=>c.toValue(m)),p=c.computed(()=>{const v=l.value;return!v||v instanceof HTMLElement?v:v.contextElement??null}),{hide:E,show:y,showDelay:b,clearTimeouts:L}=no(()=>{i.value||r(!0)},()=>{i.value&&r(!1)},{delay:u});let S=null,C;const P=c.computed(()=>b.value===0&&w.value>0);function N(v){if(!h.value||!D(v)||!P.value||!S)return;const H={x:v.clientX,y:v.clientY},Y=Math.abs(H.x-S.x),ee=Math.abs(H.y-S.y);(Y>Xt||ee>Xt)&&(S=H,clearTimeout(C),C=setTimeout(()=>{y(0)},w.value))}function V(v){!h.value||!D(v)||!P.value||(S={x:v.clientX,y:v.clientY},C=setTimeout(()=>{y(0)},w.value))}function R(){clearTimeout(C),S=null}c.watchPostEffect(()=>{const v=p.value;!v||!h.value||!P.value||(v.addEventListener("pointerenter",V),v.addEventListener("pointermove",N),v.addEventListener("pointerleave",R),c.onWatcherCleanup(()=>{v.removeEventListener("pointerenter",V),v.removeEventListener("pointermove",N),v.removeEventListener("pointerleave",R)}))}),c.onScopeDispose(()=>{clearTimeout(C)});function D(v){return c.toValue(d)?v.pointerType==="mouse":!0}function A(v){!h.value||!D(v)||P.value||(F(),y())}function k(v){!h.value||!D(v)||(L(),F())}let W=null;function F(){W&&(document.removeEventListener("pointermove",W),W=null);const v=x.value;v!=null&&v.onPolygonChange&&v.onPolygonChange([])}const j=c.computed(()=>!!c.toValue(g)),x=c.computed(()=>{const v=c.toValue(g);if(typeof v=="object"&&v)return v;if(v===!0)return{}});function s(v){var O;if(!h.value||!D(v))return;const{clientX:H,clientY:Y}=v,ee=v.relatedTarget;if(j.value)setTimeout(()=>{var ue;F();const I=p.value,ae=a.value;if(!I||!ae){E();return}let te,ce;if(o){te=new Map;const ie=Pe=>{te.set(Pe.id,Pe);for(const Ie of Pe.children.value)ie(Ie)};ie(o),ce=o.id}W=to(x.value)({x:H,y:Y,placement:n.placement.value,elements:{domReference:I,floating:ae},buffer:((ue=x.value)==null?void 0:ue.buffer)??1,onClose:()=>{F(),E()},nodeId:ce,tree:te?{nodes:te}:void 0}),W&&document.addEventListener("pointermove",W)},0);else{if(o){if(!io(o,ee))return}else if((O=a.value)!=null&&O.contains(ee))return;E()}}c.watchPostEffect(()=>{const v=p.value;!v||!h.value||(v.addEventListener("pointerenter",A),v.addEventListener("pointerleave",s),c.onWatcherCleanup(()=>{v.removeEventListener("pointerenter",A),v.removeEventListener("pointerleave",s)}))}),c.watchPostEffect(()=>{const v=a.value;!v||!h.value||(v.addEventListener("pointerenter",k),v.addEventListener("pointerleave",s),c.onWatcherCleanup(()=>{v.removeEventListener("pointerenter",k),v.removeEventListener("pointerleave",s)}))}),c.onScopeDispose(()=>{F()})}function io(e,t){return t?!(q(t,e.data.refs.anchorEl.value)||q(t,e.data.refs.floatingEl.value)||Fe(e,t)):!0}function ro(e){return c.getCurrentScope()?(c.onScopeDispose(e),!0):!1}const so=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const lo=Object.prototype.toString,ao=e=>lo.call(e)==="[object Object]";function rt(e){return Array.isArray(e)?e:[e]}function co(e,t,n){return c.watch(e,t,{...n,immediate:!0})}const uo=so?window:void 0;function fo(e){var t;const n=c.toValue(e);return(t=n==null?void 0:n.$el)!=null?t:n}function Q(...e){const t=[],n=()=>{t.forEach(a=>a()),t.length=0},o=(a,f,u,m)=>(a.addEventListener(f,u,m),()=>a.removeEventListener(f,u,m)),i=c.computed(()=>{const a=rt(c.toValue(e[0])).filter(f=>f!=null);return a.every(f=>typeof f!="string")?a:void 0}),r=co(()=>{var a,f;return[(f=(a=i.value)==null?void 0:a.map(u=>fo(u)))!=null?f:[uo].filter(u=>u!=null),rt(c.toValue(i.value?e[1]:e[0])),rt(c.unref(i.value?e[2]:e[1])),c.toValue(i.value?e[3]:e[2])]},([a,f,u,m])=>{if(n(),!(a!=null&&a.length)||!(f!=null&&f.length)||!(u!=null&&u.length))return;const d=ao(m)?{...m}:m;t.push(...a.flatMap(g=>f.flatMap(h=>u.map(w=>o(g,h,w,d)))))},{flush:"post"}),l=()=>{r(),n()};return ro(n),l}function ho(e,t={}){const{floatingContext:n,treeContext:o}=ke(e),{open:i,setOpen:r,refs:{floatingEl:l,anchorEl:a}}=n,{enabled:f=!0,requireFocusVisible:u=!0}=t,m=c.computed(()=>a.value?a.value instanceof HTMLElement?a.value:a.value.contextElement:null);let d=!1,g=!0,h;Q(window,"blur",()=>{!i.value&&m.value&&m.value===document.activeElement&&(d=!0)}),Q(window,"focus",()=>{d=!1}),c.onMounted(()=>{tt()&&nt()&&(Q(window,"keydown",()=>{g=!0},{capture:!0}),Q(window,"pointerdown",()=>{g=!1},{capture:!0}))});function w(E){if(d){d=!1;return}const y=E.target;if(c.toValue(u)&&y){if(tt()&&nt()&&!E.relatedTarget){if(!g&&!Je(y))return}else if(!Bt(y))return}r(!0)}function p(E){clearTimeout(h),h=window.setTimeout(()=>{var L;const b=(((L=m.value)==null?void 0:L.ownerDocument)??document).activeElement;if(!(!E.relatedTarget&&b===m.value)){if(o){if(b&&mo(o,b))return}else if(l.value&&b&&l.value.contains(b))return;r(!1)}},0)}c.watchPostEffect(()=>{if(!c.toValue(f))return;const E=m.value;!E||!(E instanceof HTMLElement)||(E.addEventListener("focus",w),E.addEventListener("blur",p),c.onWatcherCleanup(()=>{E.removeEventListener("focus",w),E.removeEventListener("blur",p)}))}),c.onScopeDispose(()=>{clearTimeout(h)})}function mo(e,t){return q(t,e.data.refs.anchorEl.value)||q(t,e.data.refs.floatingEl.value)?!0:Yt(e,t)!==null}function Yt(e,t){for(const n of e.children.value)if(n.data.open.value){if(q(t,n.data.refs.anchorEl.value)||q(t,n.data.refs.floatingEl.value))return n;const o=Yt(n,t);if(o)return o}return null}function po(e,t={}){const{floatingContext:n,treeContext:o}=ke(e),{open:i,setOpen:r,refs:l}=n,{enabled:a=!0,event:f="click",toggle:u=!0,ignoreMouse:m=!1,ignoreKeyboard:d=!1,ignoreTouch:g=!1,outsideClick:h=!1,outsideEvent:w="pointerdown",outsideCapture:p=!0,onOutsideClick:E,preventScrollbarClick:y=!0,handleDragEvents:b=!0}=t;let L,S=!1,C=!1,P=!1;const N=c.computed(()=>c.toValue(a)),V=c.computed(()=>c.toValue(h)),R=c.computed(()=>{const O=l.anchorEl.value;return O?O instanceof HTMLElement?O:Ft(O)&&O.contextElement instanceof HTMLElement?O.contextElement:null:null}),D=c.computed(()=>l.floatingEl.value);function A(){P=!0;try{i.value?c.toValue(u)&&r(!1):r(!0)}finally{Promise.resolve().then(()=>{P=!1})}}function k(){L=void 0,S=!1,C=!1}function W(O){L=O.pointerType}function F(O){O.button===0&&c.toValue(f)!=="click"&&(ee(L)||A())}function j(){if(c.toValue(f)==="mousedown"&&L){k();return}if(ee(L)){k();return}A(),k()}function x(O){if(L=void 0,O.defaultPrevented||c.toValue(d)||Qe(O))return;const I=R.value;I&&(O.key===" "&&!Ze(I)&&(O.preventDefault(),S=!0),O.key==="Enter"&&A())}function s(O){const I=R.value;I&&(O.defaultPrevented||c.toValue(d)||Qe(O)||Ze(I)||O.key===" "&&S&&(S=!1,A()))}function v(O){if(!N.value||!V.value||!i.value)return;if(c.toValue(w)==="click"&&c.toValue(b)&&C){C=!1;return}if(P)return;const I=O.target;if(I&&!(c.toValue(y)&&kt(I)&&D.value&&Ht(O,I))){if(o){if(!go(o,I))return}else if(et(O,R.value)||et(O,D.value))return;E?E(O,n):r(!1)}}function H(){C=!0}function Y(){setTimeout(()=>{C=!1},0)}function ee(O){return!!(He(O,!0)&&c.toValue(m)||O==="touch"&&c.toValue(g))}c.watchPostEffect(()=>{const O=R.value;!N.value||!O||(O.addEventListener("pointerdown",W),O.addEventListener("mousedown",F),O.addEventListener("click",j),O.addEventListener("keydown",x),O.addEventListener("keyup",s),c.onWatcherCleanup(()=>{O.removeEventListener("pointerdown",W),O.removeEventListener("mousedown",F),O.removeEventListener("click",j),O.removeEventListener("keydown",x),O.removeEventListener("keyup",s),k()}))}),Q(()=>N.value&&V.value?document:null,()=>c.toValue(w),v,{capture:c.toValue(p)}),Q(()=>N.value&&V.value&&c.toValue(b)?D.value:null,"mousedown",H,{capture:!0}),Q(()=>N.value&&V.value&&c.toValue(b)?D.value:null,"mouseup",Y,{capture:!0})}function go(e,t){return!(q(t,e.data.refs.anchorEl.value)||q(t,e.data.refs.floatingEl.value)||Fe(e,t))}function vo(e,t,n={}){const{open:o,refs:i}=t;let r;const l=c.ref({x:null,y:null}),a=c.computed(()=>c.toValue(n.axis??"both")),f=c.computed(()=>c.toValue(n.enabled??!0)),u=c.computed(()=>c.toValue(n.x??null)),m=c.computed(()=>c.toValue(n.y??null)),d=(p,E)=>{l.value={x:p,y:E},o.value&&(i.anchorEl.value=wo(e.value,a.value,l.value))};c.watchEffect(()=>{const p=u.value,E=m.value;f.value&&p!=null&&E!=null&&d(p,E)});const g=p=>{r=p.pointerType,d(p.clientX,p.clientY)},h=p=>{r=p.pointerType,!o.value&&He(r,!0)&&d(p.clientX,p.clientY)},w=p=>{o.value&&He(r,!0)&&d(p.clientX,p.clientY)};return c.watchEffect(()=>{if(u.value!=null||m.value!=null)return;const p=e.value;!p||!f.value||(p.addEventListener("pointerenter",h),p.addEventListener("pointerdown",g),p.addEventListener("pointermove",w),c.onWatcherCleanup(()=>{p==null||p.removeEventListener("pointerenter",h),p==null||p.removeEventListener("pointerdown",g),p==null||p.removeEventListener("pointermove",w)}))}),{coordinates:c.readonly(l),updatePosition:d}}function wo(e,t,n){let o=null,i=null;const r=e;return{contextElement:r||void 0,getBoundingClientRect:()=>{const l=(r==null?void 0:r.getBoundingClientRect())??{width:0,height:0,x:0,y:0},a=t==="x"||t==="both",f=t==="y"||t==="both";let u=0,m=0,d=l.x,g=l.y;return r&&(o==null&&n.x!=null&&a&&(o=l.x-n.x),i==null&&n.y!=null&&f&&(i=l.y-n.y),d-=o||0,g-=i||0),a&&n.x!=null?d=n.x:(o=null,u=l.width),f&&n.y!=null?g=n.y:(i=null,m=l.height),t==="both"&&(u=0,m=0),{width:u,height:m,x:d,y:g,top:g,right:d+u,bottom:g+m,left:d}}}}function yo(e){const{enabled:t=!0,onEscape:n,capture:o}=e,{isComposing:i}=bo();Q(document,"keydown",r=>{r.key!=="Escape"||!c.toValue(t)||i()||n(r)},o)}function bo(){const e=c.ref(!1);return Q(document,"compositionstart",()=>{e.value=!0}),Q(document,"compositionend",()=>{e.value=!1}),{isComposing:()=>e.value}}class st{constructor(t,n=null,o={},i=!1){he(this,"id");he(this,"data");he(this,"parent");he(this,"children");We(this,xe);this.id=o.id??Zn(),this.data=t,this.parent=c.shallowRef(n),this.children=c.shallowRef([]),ct(this,xe,i)}addChild(t){this.children.value=[...this.children.value,t]}_removeChildInstance(t){return this.children.value.includes(t)?(this.children.value=this.children.value.filter(n=>n.id!==t.id),t.parent.value=null,!0):!1}findChild(t){return this.children.value.find(t)??null}findDescendant(t){const n=[this];for(;n.length>0;){const o=n.pop();if(t(o))return o;for(let i=o.children.value.length-1;i>=0;i--)n.push(o.children.value[i])}return null}isDescendantOf(t){let n=this.parent.value;for(;n;){if(n.id===t.id)return!0;n=n.parent.value}return!1}getPath(){const t=[];let n=this;for(;n;)t.push(n),n=n.parent.value;return t.reverse()}get isRoot(){return at(this,xe)}get isLeaf(){return this.children.value.length===0}}xe=new WeakMap;class jt{constructor(t,n){We(this,Ce);he(this,"root");he(this,"nodeMap");We(this,Te);ct(this,Te,(n==null?void 0:n.deleteStrategy)??"recursive"),this.nodeMap=c.shallowReactive(new Map),this.root=new st(t,null,{},!0),this.nodeMap.set(this.root.id,this.root)}findNodeById(t){return this.nodeMap.get(t)??null}addNode(t,n=null,o={}){const i=n?this.findNodeById(n):this.root;if(!i)return console.error(`Tree addNode: Parent node with ID ${n} not found.`),null;o.id&&this.nodeMap.has(o.id)&&(o.id=void 0);const r=new st(t,i,o);return this.nodeMap.set(r.id,r),i.addChild(r),r}removeNode(t,n){const o=n??at(this,Te),i=this.findNodeById(t);if(!i)return!1;if(i.isRoot)return console.error("Tree removeNode: Cannot remove the root node."),!1;const r=i.parent.value;if(o==="recursive")ut(this,Ce,ft).call(this,i);else{for(const l of i.children.value)l.parent.value=null;i.children.value=[],this.nodeMap.delete(i.id)}return r._removeChildInstance(i)}moveNode(t,n){const o=this.findNodeById(t);if(!o)return console.error(`Tree moveNode: Node with ID ${t} not found.`),!1;if(o.isRoot)return console.error("Tree moveNode: Cannot move the root node."),!1;if(t===n)return console.error("Tree moveNode: Cannot move a node to be a child of itself."),!1;const i=n?this.findNodeById(n):this.root;if(!i)return console.error(`Tree moveNode: New parent node with ID ${n} not found.`),!1;if(i.isDescendantOf(o))return console.error("Tree moveNode: Cannot move a node to become its own descendant."),!1;const r=o.parent.value;if(r){if(!r._removeChildInstance(o))return console.error("Tree moveNode: Failed to remove node from its original parent."),!1}else if(o.isRoot){if(o.isRoot)return console.error("Tree moveNode: Attempting to move the root node, which is not allowed."),!1}return i.addChild(o),o.parent.value=i,!0}traverse(t="dfs",n=this.root){const o=[];if(!n)return console.warn("Tree traverse: Start node is null, returning empty array."),o;if(t==="dfs"){const i=[n];for(;i.length>0;){const r=i.pop();o.push(r);for(let l=r.children.value.length-1;l>=0;l--)i.push(r.children.value[l])}}else{const i=[n];for(;i.length>0;){const r=i.shift();o.push(r);for(const l of r.children.value)i.push(l)}}return o}dispose(){this.nodeMap.clear()}}Te=new WeakMap,Ce=new WeakSet,ft=function(t){const n=[...t.children.value];for(const o of n)ut(this,Ce,ft).call(this,o);this.nodeMap.delete(t.id),t.children.value=[]};function Eo(e,t,n={},o={}){const{parentId:i,...r}=n,l=Ge(e,t,r),a=new jt(l,o);return{get nodeMap(){return a.nodeMap},get root(){return a.root},findNodeById:y=>a.findNodeById(y),moveNode:(y,b)=>a.moveNode(y,b),dispose:()=>{a.dispose()},addNode:(y,b,L={})=>{const{parentId:S,...C}=L,P=Ge(y,b,C);return a.addNode(P,S)},removeNode:(y,b)=>a.removeNode(y,b),traverse:(y,b)=>a.traverse(y,b),getAllOpenNodes:()=>{const y=[];for(const b of a.nodeMap.values())b.data.open.value&&y.push(b);return y},getTopmostOpenNode:()=>{let y=null,b=-1;for(const L of a.nodeMap.values())if(L.data.open.value){const S=L.getPath().length;S>b&&(b=S,y=L)}return y},forEach:(y,b,L={})=>{const{relationship:S="self-and-children",applyToMatching:C=!0}=L,P=a.findNodeById(y);if(!P)return;const N=[],V=new Set,R=A=>{A&&!V.has(A.id)&&(N.push(A),V.add(A.id))},D=A=>{for(const k of A)R(k)};if(S==="ancestors-only")for(const A of P.getPath())A.id!==P.id&&R(A);else if(S==="siblings-only"){if(P.parent.value)for(const A of P.parent.value.children.value)A.id!==P.id&&R(A)}else if(S==="descendants-only")for(const A of a.traverse("dfs",P))A.id!==P.id&&R(A);else if(S==="children-only")D(P.children.value);else if(S==="self-and-ancestors")D(P.getPath());else if(S==="self-and-children")R(P),D(P.children.value);else if(S==="self-and-descendants")D(a.traverse("dfs",P));else if(S==="self-and-siblings")R(P),P.parent.value&&D(P.parent.value.children.value);else if(S==="self-ancestors-and-children")D(P.getPath()),D(P.children.value);else if(S==="full-branch")D(P.getPath()),D(a.traverse("dfs",P));else if(S==="all-except-branch"){const A=new Set;for(const k of P.getPath())A.add(k.id);for(const k of a.traverse("dfs",P))A.add(k.id);for(const k of a.nodeMap.values())!A.has(k.id)===C&&b(k);return}else{console.warn(`forEach: Unknown relationship "${S}".`);return}if(C)for(const A of N)b(A);else for(const A of a.nodeMap.values())V.has(A.id)||b(A)}}}T.Tree=jt,T.TreeNode=st,T.clearTimeoutIfSet=it,T.contains=Be,T.findDescendantContainingTarget=Fe,T.flip=zn,T.getContextFromParameter=ke,T.getCurrentTime=ot,T.getTarget=It,T.hide=Un,T.isButtonTarget=Qe,T.isClickOnScrollbar=Ht,T.isEventTargetWithin=et,T.isHTMLElement=kt,T.isMac=tt,T.isMouseLikePointerType=He,T.isSafari=nt,T.isSpaceIgnored=Ze,T.isTargetWithinElement=q,T.isTreeNode=Rt,T.isTypeableElement=Je,T.isVirtualElement=Ft,T.matchesFocusVisible=Bt,T.offset=jn,T.shift=_n,T.useArrow=Jn,T.useClick=po,T.useClientPoint=vo,T.useEscapeKey=yo,T.useFloating=Ge,T.useFloatingTree=Eo,T.useFocus=ho,T.useHover=oo,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})}));
|
|
1
|
+
(function(T,a){typeof exports=="object"&&typeof module<"u"?a(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],a):(T=typeof globalThis<"u"?globalThis:T||self,a(T.VFloat={},T.Vue))})(this,(function(T,a){"use strict";var Eo=Object.defineProperty;var Qt=T=>{throw TypeError(T)};var xo=(T,a,I)=>a in T?Eo(T,a,{enumerable:!0,configurable:!0,writable:!0,value:I}):T[a]=I;var fe=(T,a,I)=>xo(T,typeof a!="symbol"?a+"":a,I),at=(T,a,I)=>a.has(T)||Qt("Cannot "+I);var ct=(T,a,I)=>(at(T,a,"read from private field"),I?I.call(T):a.get(T)),$e=(T,a,I)=>a.has(T)?Qt("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(T):a.set(T,I),ut=(T,a,I,Pe)=>(at(T,a,"write to private field"),Pe?Pe.call(T,I):a.set(T,I),I),ft=(T,a,I)=>(at(T,a,"access private method"),I);var xe,Te,Ce,dt;function I(e){return a.getCurrentScope()?(a.onScopeDispose(e),!0):!1}const Pe=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Zt=Object.prototype.toString,en=e=>Zt.call(e)==="[object Object]";function Xe(e){return Array.isArray(e)?e:[e]}function tn(e,t,n){return a.watch(e,t,{...n,immediate:!0})}const nn=Pe?window:void 0;function on(e){var t;const n=a.toValue(e);return(t=n==null?void 0:n.$el)!=null?t:n}function G(...e){const t=[],n=()=>{t.forEach(c=>c()),t.length=0},o=(c,f,u,d)=>(c.addEventListener(f,u,d),()=>c.removeEventListener(f,u,d)),i=a.computed(()=>{const c=Xe(a.toValue(e[0])).filter(f=>f!=null);return c.every(f=>typeof f!="string")?c:void 0}),s=tn(()=>{var c,f;return[(f=(c=i.value)==null?void 0:c.map(u=>on(u)))!=null?f:[nn].filter(u=>u!=null),Xe(a.toValue(i.value?e[1]:e[0])),Xe(a.unref(i.value?e[2]:e[1])),a.toValue(i.value?e[3]:e[2])]},([c,f,u,d])=>{if(n(),!(c!=null&&c.length)||!(f!=null&&f.length)||!(u!=null&&u.length))return;const h=en(d)?{...d}:d;t.push(...c.flatMap(g=>f.flatMap(m=>u.map(E=>o(g,m,E,h)))))},{flush:"post"}),r=()=>{s(),n()};return I(n),r}function Ye(){return typeof navigator>"u"?!1:navigator.platform.toUpperCase().indexOf("MAC")>=0}function je(){return typeof navigator>"u"?!1:/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function ht(e){return typeof(e==null?void 0:e.matches)!="function"?!1:e.matches(":focus-visible")}function Le(e,t){if(e===void 0)return!1;const n=e==="mouse";return t?n:n||e==="pen"}function _e(e){return!e||!(e instanceof HTMLElement)?!1:e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e.isContentEditable&&e.contentEditable!=="false"}function ze(e){const t=e.target;return t instanceof HTMLElement?t.tagName==="BUTTON"||t.tagName==="INPUT"&&t.getAttribute("type")==="button"||t.getAttribute("role")==="button":!1}function Ue(e){return _e(e)}function mt(e){return e instanceof Element&&e instanceof HTMLElement}function pt(e){return typeof e=="object"&&e!==null&&"contextElement"in e}function qe(e,t){return t?"composedPath"in e&&typeof e.composedPath=="function"?e.composedPath().includes(t):t.contains(e.target):!1}function gt(e,t){const n=t.getBoundingClientRect(),o=t.offsetWidth-t.clientWidth,i=t.offsetHeight-t.clientHeight,s=e.clientX-n.left,r=e.clientY-n.top;if(o>0){const c=t.clientWidth;if(s>=c&&s<=t.offsetWidth)return!0}if(i>0){const c=t.clientHeight;if(r>=c&&r<=t.offsetHeight)return!0}return!1}function Oe(e,t){return e.contains(t)}function vt(e){return e.target}function Ke(){return typeof performance<"u"?performance.now():Date.now()}function Ge(e){e!==-1&&clearTimeout(e)}function wt(e){return e!==null&&typeof e=="object"&&"data"in e&&"id"in e&&"children"in e&&"parent"in e}function Se(e){return wt(e)?{floatingContext:e.data,treeContext:e}:{floatingContext:e,treeContext:null}}function z(e,t){if(!t)return!1;if(typeof t=="object"&&t!==null&&"contextElement"in t){const n=t.contextElement;return n instanceof Element?n.contains(e):!1}return t instanceof Element?t.contains(e):!1}function Me(e,t){for(const n of e.children.value)if(n.data.open.value){if(z(t,n.data.refs.anchorEl.value)||z(t,n.data.refs.floatingEl.value))return n;const o=Me(n,t);if(o)return o}return null}function rn(e,t={}){const{floatingContext:n,treeContext:o}=Se(e),{open:i,setOpen:s,refs:r}=n,{enabled:c=!0,event:f="click",toggle:u=!0,ignoreMouse:d=!1,ignoreKeyboard:h=!1,ignoreTouch:g=!1,outsideClick:m=!1,outsideEvent:E="pointerdown",outsideCapture:v=!0,onOutsideClick:w,preventScrollbarClick:b=!0,handleDragEvents:L=!0}=t;let x,M=!1,p=!1,N=!1;const A=a.computed(()=>a.toValue(c)),R=a.computed(()=>a.toValue(m)),D=a.computed(()=>{const P=r.anchorEl.value;return P?P instanceof HTMLElement?P:pt(P)&&P.contextElement instanceof HTMLElement?P.contextElement:null:null}),O=a.computed(()=>r.floatingEl.value);function V(){N=!0;try{i.value?a.toValue(u)&&s(!1):s(!0)}finally{Promise.resolve().then(()=>{N=!1})}}function W(){x=void 0,M=!1,p=!1}function Y(P){x=P.pointerType}function k(P){P.button===0&&a.toValue(f)!=="click"&&($(x)||V())}function C(){if(a.toValue(f)==="mousedown"&&x){W();return}if($(x)){W();return}V(),W()}function l(P){if(x=void 0,P.defaultPrevented||a.toValue(h)||ze(P))return;const X=D.value;X&&(P.key===" "&&!Ue(X)&&(P.preventDefault(),M=!0),P.key==="Enter"&&V())}function F(P){const X=D.value;X&&(P.defaultPrevented||a.toValue(h)||ze(P)||Ue(X)||P.key===" "&&M&&(M=!1,V()))}function y(P){if(!A.value||!R.value||!i.value)return;if(a.toValue(E)==="click"&&a.toValue(L)&&p){p=!1;return}if(N)return;const X=P.target;if(X&&!(a.toValue(b)&&mt(X)&&O.value&>(P,X))){if(o){if(!sn(o,X))return}else if(qe(P,D.value)||qe(P,O.value))return;w?w(P,n):s(!1)}}function H(){p=!0}function ee(){setTimeout(()=>{p=!1},0)}function $(P){return!!(Le(P,!0)&&a.toValue(d)||P==="touch"&&a.toValue(g))}a.watchPostEffect(()=>{const P=D.value;!A.value||!P||(P.addEventListener("pointerdown",Y),P.addEventListener("mousedown",k),P.addEventListener("click",C),P.addEventListener("keydown",l),P.addEventListener("keyup",F),a.onWatcherCleanup(()=>{P.removeEventListener("pointerdown",Y),P.removeEventListener("mousedown",k),P.removeEventListener("click",C),P.removeEventListener("keydown",l),P.removeEventListener("keyup",F),W()}))}),G(()=>A.value&&R.value?document:null,()=>a.toValue(E),y,{capture:a.toValue(v)}),G(()=>A.value&&R.value&&a.toValue(L)?O.value:null,"mousedown",H,{capture:!0}),G(()=>A.value&&R.value&&a.toValue(L)?O.value:null,"mouseup",ee,{capture:!0})}function sn(e,t){return!(z(t,e.data.refs.anchorEl.value)||z(t,e.data.refs.floatingEl.value)||Me(e,t))}function ln(e,t,n={}){const{open:o,refs:i}=t;let s;const r=a.ref({x:null,y:null}),c=a.computed(()=>a.toValue(n.axis??"both")),f=a.computed(()=>a.toValue(n.enabled??!0)),u=a.computed(()=>a.toValue(n.x??null)),d=a.computed(()=>a.toValue(n.y??null)),h=(v,w)=>{r.value={x:v,y:w},o.value&&(i.anchorEl.value=an(e.value,c.value,r.value))};a.watchEffect(()=>{const v=u.value,w=d.value;f.value&&v!=null&&w!=null&&h(v,w)});const g=v=>{s=v.pointerType,h(v.clientX,v.clientY)},m=v=>{s=v.pointerType,!o.value&&Le(s,!0)&&h(v.clientX,v.clientY)},E=v=>{o.value&&Le(s,!0)&&h(v.clientX,v.clientY)};return a.watchEffect(()=>{if(u.value!=null||d.value!=null)return;const v=e.value;!v||!f.value||(v.addEventListener("pointerenter",m),v.addEventListener("pointerdown",g),v.addEventListener("pointermove",E),a.onWatcherCleanup(()=>{v==null||v.removeEventListener("pointerenter",m),v==null||v.removeEventListener("pointerdown",g),v==null||v.removeEventListener("pointermove",E)}))}),{coordinates:a.readonly(r),updatePosition:h}}function an(e,t,n){let o=null,i=null;const s=e;return{contextElement:s||void 0,getBoundingClientRect:()=>{const r=(s==null?void 0:s.getBoundingClientRect())??{width:0,height:0,x:0,y:0},c=t==="x"||t==="both",f=t==="y"||t==="both";let u=0,d=0,h=r.x,g=r.y;return s&&(o==null&&n.x!=null&&c&&(o=r.x-n.x),i==null&&n.y!=null&&f&&(i=r.y-n.y),h-=o||0,g-=i||0),c&&n.x!=null?h=n.x:(o=null,u=r.width),f&&n.y!=null?g=n.y:(i=null,d=r.height),t==="both"&&(u=0,d=0),{width:u,height:d,x:h,y:g,top:g,right:h+u,bottom:g+d,left:h}}}}function cn(e){const{enabled:t=!0,onEscape:n,capture:o}=e,{isComposing:i}=un();G(document,"keydown",s=>{s.key!=="Escape"||!a.toValue(t)||i()||n(s)},o)}function un(){const e=a.ref(!1);return G(document,"compositionstart",()=>{e.value=!0}),G(document,"compositionend",()=>{e.value=!1}),{isComposing:()=>e.value}}function fn(e,t={}){const{floatingContext:n,treeContext:o}=Se(e),{open:i,setOpen:s,refs:{floatingEl:r,anchorEl:c}}=n,{enabled:f=!0,requireFocusVisible:u=!0}=t,d=a.computed(()=>c.value?c.value instanceof HTMLElement?c.value:c.value.contextElement:null);let h=!1,g=!0,m;G(window,"blur",()=>{!i.value&&d.value&&d.value===document.activeElement&&(h=!0)}),G(window,"focus",()=>{h=!1}),a.onMounted(()=>{Ye()&&je()&&(G(window,"keydown",()=>{g=!0},{capture:!0}),G(window,"pointerdown",()=>{g=!1},{capture:!0}))});function E(w){if(h){h=!1;return}const b=w.target;if(a.toValue(u)&&b){if(Ye()&&je()&&!w.relatedTarget){if(!g&&!_e(b))return}else if(!ht(b))return}s(!0)}function v(w){clearTimeout(m),m=window.setTimeout(()=>{var x;const L=(((x=d.value)==null?void 0:x.ownerDocument)??document).activeElement;if(!(!w.relatedTarget&&L===d.value)){if(o){if(L&&dn(o,L))return}else if(r.value&&L&&r.value.contains(L))return;s(!1)}},0)}a.watchPostEffect(()=>{if(!a.toValue(f))return;const w=d.value;!w||!(w instanceof HTMLElement)||(w.addEventListener("focus",E),w.addEventListener("blur",v),a.onWatcherCleanup(()=>{w.removeEventListener("focus",E),w.removeEventListener("blur",v)}))}),a.onScopeDispose(()=>{clearTimeout(m)})}function dn(e,t){return z(t,e.data.refs.anchorEl.value)||z(t,e.data.refs.floatingEl.value)?!0:yt(e,t)!==null}function yt(e,t){for(const n of e.children.value)if(n.data.open.value){if(z(t,n.data.refs.anchorEl.value)||z(t,n.data.refs.floatingEl.value))return n;const o=yt(n,t);if(o)return o}return null}let hn=0;function mn(){return`vfloat-id-${hn++}`}function bt(e){return typeof e=="object"&&e instanceof HTMLElement}function Et(e){return e.children.value.some(t=>t.data.open.value||Et(t))}function pn(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function xt(e,t){const[n,o]=e;let i=!1;const s=t.length;for(let r=0,c=s-1;r<s;c=r++){const[f,u]=t[r]||[0,0],[d,h]=t[c]||[0,0];u>=o!=h>=o&&n<=(d-f)*(o-u)/(h-u)+f&&(i=!i)}return i}function gn(e={}){const{blockPointerEvents:t=!1,requireIntent:n=!0}=e;let o=-1,i=!1;function s(c,f,u,d,h){const g=Ke(),m=g-h;if(u===null||d===null||m===0)return{speed:null,lastX:c,lastY:f,lastCursorTime:g};const E=c-u,v=f-d;return{speed:Math.sqrt(E*E+v*v)/m,lastX:c,lastY:f,lastCursorTime:g}}const r=function(f){const{x:u,y:d,placement:h,elements:g,buffer:m,onClose:E,nodeId:v,tree:w}=f,b=a.computed(()=>{const p=g.domReference;return bt(p)?p:(p==null?void 0:p.contextElement)??null});let L=null,x=null,M=Ke();return function(N){var Ie,zt,Ut,qt,Kt,Gt,Jt;function A(){Ge(o),o=-1,E()}if(Ge(o),o=-1,!g.domReference||!g.floating||h==null||u==null||d==null)return;const{clientX:R,clientY:D}=N,O=[R,D],V=vt(N),W=N.type==="mouseleave",Y=g.floating&&Oe(g.floating,V),k=b.value&&Oe(b.value,V),C=(Ie=b.value)==null?void 0:Ie.getBoundingClientRect(),l=(zt=g.floating)==null?void 0:zt.getBoundingClientRect(),F=h.split("-")[0],y=u>((l==null?void 0:l.right)??0)-((l==null?void 0:l.width)??0)/2,H=d>((l==null?void 0:l.bottom)??0)-((l==null?void 0:l.height)??0)/2,ee=C?pn(O,C):!1,$=((l==null?void 0:l.width)??0)>((C==null?void 0:C.width)??0),P=((l==null?void 0:l.height)??0)>((C==null?void 0:C.height)??0),X=((Ut=$?C:l)==null?void 0:Ut.left)??0,le=((qt=$?C:l)==null?void 0:qt.right)??0,K=((Kt=P?C:l)==null?void 0:Kt.top)??0,ae=((Gt=P?C:l)==null?void 0:Gt.bottom)??0;if(Y&&(i=!0,!W))return;if(k&&(i=!1),k&&!W){i=!0;return}if(W&&bt(N.relatedTarget)&&g.floating&&Oe(g.floating,N.relatedTarget))return;if(w&&v){const B=w.nodes.get(v);if(B&&Et(B))return}if(F==="top"&&d>=((C==null?void 0:C.bottom)??0)-1||F==="bottom"&&d<=((C==null?void 0:C.top)??0)+1||F==="left"&&u>=((C==null?void 0:C.right)??0)-1||F==="right"&&u<=((C==null?void 0:C.left)??0)+1)return A();let oe=[];switch(F){case"top":oe=[[X,((C==null?void 0:C.top)??0)+1],[X,((l==null?void 0:l.bottom)??0)-1],[le,((l==null?void 0:l.bottom)??0)-1],[le,((C==null?void 0:C.top)??0)+1]];break;case"bottom":oe=[[X,((l==null?void 0:l.top)??0)+1],[X,((C==null?void 0:C.bottom)??0)-1],[le,((C==null?void 0:C.bottom)??0)-1],[le,((l==null?void 0:l.top)??0)+1]];break;case"left":oe=[[((l==null?void 0:l.right)??0)-1,ae],[((l==null?void 0:l.right)??0)-1,K],[((C==null?void 0:C.left)??0)+1,K],[((C==null?void 0:C.left)??0)+1,ae]];break;case"right":oe=[[((C==null?void 0:C.right)??0)-1,ae],[((C==null?void 0:C.right)??0)-1,K],[((l==null?void 0:l.left)??0)+1,K],[((l==null?void 0:l.left)??0)+1,ae]];break}function We([B,j]){const S=m;switch(F){case"top":{const ce=[$?B+S/2:y?B+S*4:B-S*4,j+S+1],ue=[$?B-S/2:y?B+S*4:B-S*4,j+S+1],we=[[(l==null?void 0:l.left)??0,y||$?((l==null?void 0:l.bottom)??0)-S:(l==null?void 0:l.top)??0],[(l==null?void 0:l.right)??0,y?$?((l==null?void 0:l.bottom)??0)-S:(l==null?void 0:l.top)??0:((l==null?void 0:l.bottom)??0)-S]];return[ce,ue,...we]}case"bottom":{const ce=[$?B+S/2:y?B+S*4:B-S*4,j-S],ue=[$?B-S/2:y?B+S*4:B-S*4,j-S],we=[[(l==null?void 0:l.left)??0,y||$?((l==null?void 0:l.top)??0)+S:(l==null?void 0:l.bottom)??0],[(l==null?void 0:l.right)??0,y?$?((l==null?void 0:l.top)??0)+S:(l==null?void 0:l.bottom)??0:((l==null?void 0:l.top)??0)+S]];return[ce,ue,...we]}case"left":{const ce=[B+S+1,P?j+S/2:H?j+S*4:j-S*4],ue=[B+S+1,P?j-S/2:H?j+S*4:j-S*4];return[...[[H||P?((l==null?void 0:l.right)??0)-S:(l==null?void 0:l.left)??0,(l==null?void 0:l.top)??0],[H?P?((l==null?void 0:l.right)??0)-S:(l==null?void 0:l.left)??0:((l==null?void 0:l.right)??0)-S,(l==null?void 0:l.bottom)??0]],ce,ue]}case"right":{const ce=[B-S,P?j+S/2:H?j+S*4:j-S*4],ue=[B-S,P?j-S/2:H?j+S*4:j-S*4],we=[[H||P?((l==null?void 0:l.left)??0)+S:(l==null?void 0:l.right)??0,(l==null?void 0:l.top)??0],[H?P?((l==null?void 0:l.left)??0)+S:(l==null?void 0:l.right)??0:((l==null?void 0:l.left)??0)+S,(l==null?void 0:l.bottom)??0]];return[ce,ue,...we]}}}const ve=We([u,d]);if((Jt=e.onPolygonChange)==null||Jt.call(e,ve),!xt(O,oe)){if(xt(O,ve)){if(!i&&n){const B=s(N.clientX,N.clientY,L,x,M);L=B.lastX,x=B.lastY,M=B.lastCursorTime,B.speed!==null&&B.speed<.1&&(o=window.setTimeout(A,40))}return}if(i&&!ee)return A();A()}}};return r.__options={blockPointerEvents:t},r}const Tt=10;function vn(e,t,n){const{delay:o}=n,i=a.computed(()=>{const u=a.toValue(o);return(typeof u=="number"?u:u.open)??0}),s=a.computed(()=>{const u=a.toValue(o);return(typeof u=="number"?u:u.close)??0});let r,c;const f=()=>{clearTimeout(r),clearTimeout(c)};return a.onScopeDispose(f),{show:u=>{f();const d=u??i.value;d===0?e():r=setTimeout(e,d)},hide:u=>{f();const d=u??s.value;d===0?t():c=setTimeout(t,d)},showDelay:i,hideDelay:s,clearTimeouts:f}}function wn(e,t={}){const{floatingContext:n,treeContext:o}=Se(e),{open:i,setOpen:s,refs:{anchorEl:r,floatingEl:c}}=n,{enabled:f=!0,delay:u=0,restMs:d=0,mouseOnly:h=!1,safePolygon:g=!1}=t,m=a.computed(()=>a.toValue(f)),E=a.computed(()=>a.toValue(d)),v=a.computed(()=>{const y=r.value;return!y||y instanceof HTMLElement?y:y.contextElement??null}),{hide:w,show:b,showDelay:L,clearTimeouts:x}=vn(()=>{i.value||s(!0)},()=>{i.value&&s(!1)},{delay:u});let M=null,p;const N=a.computed(()=>L.value===0&&E.value>0);function A(y){if(!m.value||!O(y)||!N.value||!M)return;const H={x:y.clientX,y:y.clientY},ee=Math.abs(H.x-M.x),$=Math.abs(H.y-M.y);(ee>Tt||$>Tt)&&(M=H,clearTimeout(p),p=setTimeout(()=>{b(0)},E.value))}function R(y){!m.value||!O(y)||!N.value||(M={x:y.clientX,y:y.clientY},p=setTimeout(()=>{b(0)},E.value))}function D(){clearTimeout(p),M=null}a.watchPostEffect(()=>{const y=v.value;!y||!m.value||!N.value||(y.addEventListener("pointerenter",R),y.addEventListener("pointermove",A),y.addEventListener("pointerleave",D),a.onWatcherCleanup(()=>{y.removeEventListener("pointerenter",R),y.removeEventListener("pointermove",A),y.removeEventListener("pointerleave",D)}))}),a.onScopeDispose(()=>{clearTimeout(p)});function O(y){return a.toValue(h)?y.pointerType==="mouse":!0}function V(y){!m.value||!O(y)||N.value||(k(),b())}function W(y){!m.value||!O(y)||(x(),k())}let Y=null;function k(){Y&&(document.removeEventListener("pointermove",Y),Y=null);const y=l.value;y!=null&&y.onPolygonChange&&y.onPolygonChange([])}const C=a.computed(()=>!!a.toValue(g)),l=a.computed(()=>{const y=a.toValue(g);if(typeof y=="object"&&y)return y;if(y===!0)return{}});function F(y){var P;if(!m.value||!O(y))return;const{clientX:H,clientY:ee}=y,$=y.relatedTarget;if(C.value)setTimeout(()=>{var oe;k();const X=v.value,le=c.value;if(!X||!le){w();return}let K,ae;if(o){K=new Map;const We=ve=>{K==null||K.set(ve.id,ve);for(const Ie of ve.children.value)We(Ie)};We(o),ae=o.id}Y=gn(l.value)({x:H,y:ee,placement:n.placement.value,elements:{domReference:X,floating:le},buffer:((oe=l.value)==null?void 0:oe.buffer)??1,onClose:()=>{k(),w()},nodeId:ae,tree:K?{nodes:K}:void 0}),Y&&document.addEventListener("pointermove",Y)},0);else{if(o){if(!yn(o,$))return}else if((P=c.value)!=null&&P.contains($))return;w()}}a.watchPostEffect(()=>{const y=v.value;!y||!m.value||(y.addEventListener("pointerenter",V),y.addEventListener("pointerleave",F),a.onWatcherCleanup(()=>{y.removeEventListener("pointerenter",V),y.removeEventListener("pointerleave",F)}))}),a.watchPostEffect(()=>{const y=c.value;!y||!m.value||(y.addEventListener("pointerenter",W),y.addEventListener("pointerleave",F),a.onWatcherCleanup(()=>{y.removeEventListener("pointerenter",W),y.removeEventListener("pointerleave",F)}))}),a.onScopeDispose(()=>{k()})}function yn(e,t){return t?!(z(t,e.data.refs.anchorEl.value)||z(t,e.data.refs.floatingEl.value)||Me(e,t)):!0}const bn=["top","right","bottom","left"],de=Math.min,ie=Math.max,Ae=Math.round,Ne=Math.floor,J=e=>({x:e,y:e}),En={left:"right",right:"left",bottom:"top",top:"bottom"},xn={start:"end",end:"start"};function Je(e,t,n){return ie(e,de(t,n))}function he(e,t){return typeof e=="function"?e(t):e}function re(e){return e.split("-")[0]}function ye(e){return e.split("-")[1]}function Ct(e){return e==="x"?"y":"x"}function Qe(e){return e==="y"?"height":"width"}const Tn=new Set(["top","bottom"]);function te(e){return Tn.has(re(e))?"y":"x"}function Ze(e){return Ct(te(e))}function Cn(e,t,n){n===void 0&&(n=!1);const o=ye(e),i=Ze(e),s=Qe(i);let r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(r=De(r)),[r,De(r)]}function Pn(e){const t=De(e);return[et(e),t,et(t)]}function et(e){return e.replace(/start|end/g,t=>xn[t])}const Pt=["left","right"],Lt=["right","left"],Ln=["top","bottom"],On=["bottom","top"];function Sn(e,t,n){switch(e){case"top":case"bottom":return n?t?Lt:Pt:t?Pt:Lt;case"left":case"right":return t?Ln:On;default:return[]}}function Mn(e,t,n,o){const i=ye(e);let s=Sn(re(e),n==="start",o);return i&&(s=s.map(r=>r+"-"+i),t&&(s=s.concat(s.map(et)))),s}function De(e){return e.replace(/left|right|bottom|top/g,t=>En[t])}function An(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ot(e){return typeof e!="number"?An(e):{top:e,right:e,bottom:e,left:e}}function Ve(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 St(e,t,n){let{reference:o,floating:i}=e;const s=te(t),r=Ze(t),c=Qe(r),f=re(t),u=s==="y",d=o.x+o.width/2-i.width/2,h=o.y+o.height/2-i.height/2,g=o[c]/2-i[c]/2;let m;switch(f){case"top":m={x:d,y:o.y-i.height};break;case"bottom":m={x:d,y:o.y+o.height};break;case"right":m={x:o.x+o.width,y:h};break;case"left":m={x:o.x-i.width,y:h};break;default:m={x:o.x,y:o.y}}switch(ye(t)){case"start":m[r]-=g*(n&&u?-1:1);break;case"end":m[r]+=g*(n&&u?-1:1);break}return m}const Nn=async(e,t,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:s=[],platform:r}=n,c=s.filter(Boolean),f=await(r.isRTL==null?void 0:r.isRTL(t));let u=await r.getElementRects({reference:e,floating:t,strategy:i}),{x:d,y:h}=St(u,o,f),g=o,m={},E=0;for(let v=0;v<c.length;v++){const{name:w,fn:b}=c[v],{x:L,y:x,data:M,reset:p}=await b({x:d,y:h,initialPlacement:o,placement:g,strategy:i,middlewareData:m,rects:u,platform:r,elements:{reference:e,floating:t}});d=L??d,h=x??h,m={...m,[w]:{...m[w],...M}},p&&E<=50&&(E++,typeof p=="object"&&(p.placement&&(g=p.placement),p.rects&&(u=p.rects===!0?await r.getElementRects({reference:e,floating:t,strategy:i}):p.rects),{x:d,y:h}=St(u,g,f)),v=-1)}return{x:d,y:h,placement:g,strategy:i,middlewareData:m}};async function Re(e,t){var n;t===void 0&&(t={});const{x:o,y:i,platform:s,rects:r,elements:c,strategy:f}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:g=!1,padding:m=0}=he(t,e),E=Ot(m),w=c[g?h==="floating"?"reference":"floating":h],b=Ve(await s.getClippingRect({element:(n=await(s.isElement==null?void 0:s.isElement(w)))==null||n?w:w.contextElement||await(s.getDocumentElement==null?void 0:s.getDocumentElement(c.floating)),boundary:u,rootBoundary:d,strategy:f})),L=h==="floating"?{x:o,y:i,width:r.floating.width,height:r.floating.height}:r.reference,x=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c.floating)),M=await(s.isElement==null?void 0:s.isElement(x))?await(s.getScale==null?void 0:s.getScale(x))||{x:1,y:1}:{x:1,y:1},p=Ve(s.convertOffsetParentRelativeRectToViewportRelativeRect?await s.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:L,offsetParent:x,strategy:f}):L);return{top:(b.top-p.top+E.top)/M.y,bottom:(p.bottom-b.bottom+E.bottom)/M.y,left:(b.left-p.left+E.left)/M.x,right:(p.right-b.right+E.right)/M.x}}const Dn=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:i,rects:s,platform:r,elements:c,middlewareData:f}=t,{element:u,padding:d=0}=he(e,t)||{};if(u==null)return{};const h=Ot(d),g={x:n,y:o},m=Ze(i),E=Qe(m),v=await r.getDimensions(u),w=m==="y",b=w?"top":"left",L=w?"bottom":"right",x=w?"clientHeight":"clientWidth",M=s.reference[E]+s.reference[m]-g[m]-s.floating[E],p=g[m]-s.reference[m],N=await(r.getOffsetParent==null?void 0:r.getOffsetParent(u));let A=N?N[x]:0;(!A||!await(r.isElement==null?void 0:r.isElement(N)))&&(A=c.floating[x]||s.floating[E]);const R=M/2-p/2,D=A/2-v[E]/2-1,O=de(h[b],D),V=de(h[L],D),W=O,Y=A-v[E]-V,k=A/2-v[E]/2+R,C=Je(W,k,Y),l=!f.arrow&&ye(i)!=null&&k!==C&&s.reference[E]/2-(k<W?O:V)-v[E]/2<0,F=l?k<W?k-W:k-Y:0;return{[m]:g[m]+F,data:{[m]:C,centerOffset:k-C-F,...l&&{alignmentOffset:F}},reset:l}}}),Vn=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:c,platform:f,elements:u}=t,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:g,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:v=!0,...w}=he(e,t);if((n=s.arrow)!=null&&n.alignmentOffset)return{};const b=re(i),L=te(c),x=re(c)===c,M=await(f.isRTL==null?void 0:f.isRTL(u.floating)),p=g||(x||!v?[De(c)]:Pn(c)),N=E!=="none";!g&&N&&p.push(...Mn(c,v,E,M));const A=[c,...p],R=await Re(t,w),D=[];let O=((o=s.flip)==null?void 0:o.overflows)||[];if(d&&D.push(R[b]),h){const k=Cn(i,r,M);D.push(R[k[0]],R[k[1]])}if(O=[...O,{placement:i,overflows:D}],!D.every(k=>k<=0)){var V,W;const k=(((V=s.flip)==null?void 0:V.index)||0)+1,C=A[k];if(C&&(!(h==="alignment"?L!==te(C):!1)||O.every(y=>te(y.placement)===L?y.overflows[0]>0:!0)))return{data:{index:k,overflows:O},reset:{placement:C}};let l=(W=O.filter(F=>F.overflows[0]<=0).sort((F,y)=>F.overflows[1]-y.overflows[1])[0])==null?void 0:W.placement;if(!l)switch(m){case"bestFit":{var Y;const F=(Y=O.filter(y=>{if(N){const H=te(y.placement);return H===L||H==="y"}return!0}).map(y=>[y.placement,y.overflows.filter(H=>H>0).reduce((H,ee)=>H+ee,0)]).sort((y,H)=>y[1]-H[1])[0])==null?void 0:Y[0];F&&(l=F);break}case"initialPlacement":l=c;break}if(i!==l)return{reset:{placement:l}}}return{}}}};function Mt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function At(e){return bn.some(t=>e[t]>=0)}const Rn=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...i}=he(e,t);switch(o){case"referenceHidden":{const s=await Re(t,{...i,elementContext:"reference"}),r=Mt(s,n.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:At(r)}}}case"escaped":{const s=await Re(t,{...i,altBoundary:!0}),r=Mt(s,n.floating);return{data:{escapedOffsets:r,escaped:At(r)}}}default:return{}}}}},kn=new Set(["left","top"]);async function Fn(e,t){const{placement:n,platform:o,elements:i}=e,s=await(o.isRTL==null?void 0:o.isRTL(i.floating)),r=re(n),c=ye(n),f=te(n)==="y",u=kn.has(r)?-1:1,d=s&&f?-1:1,h=he(t,e);let{mainAxis:g,crossAxis:m,alignmentAxis:E}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&typeof E=="number"&&(m=c==="end"?E*-1:E),f?{x:m*d,y:g*u}:{x:g*u,y:m*d}}const Hn=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:c}=t,f=await Fn(t,e);return r===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:i+f.x,y:s+f.y,data:{...f,placement:r}}}}},Bn=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:c={fn:w=>{let{x:b,y:L}=w;return{x:b,y:L}}},...f}=he(e,t),u={x:n,y:o},d=await Re(t,f),h=te(re(i)),g=Ct(h);let m=u[g],E=u[h];if(s){const w=g==="y"?"top":"left",b=g==="y"?"bottom":"right",L=m+d[w],x=m-d[b];m=Je(L,m,x)}if(r){const w=h==="y"?"top":"left",b=h==="y"?"bottom":"right",L=E+d[w],x=E-d[b];E=Je(L,E,x)}const v=c.fn({...t,[g]:m,[h]:E});return{...v,data:{x:v.x-n,y:v.y-o,enabled:{[g]:s,[h]:r}}}}}};function ke(){return typeof window<"u"}function me(e){return Nt(e)?(e.nodeName||"").toLowerCase():"#document"}function _(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Q(e){var t;return(t=(Nt(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Nt(e){return ke()?e instanceof Node||e instanceof _(e).Node:!1}function U(e){return ke()?e instanceof Element||e instanceof _(e).Element:!1}function Z(e){return ke()?e instanceof HTMLElement||e instanceof _(e).HTMLElement:!1}function Dt(e){return!ke()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof _(e).ShadowRoot}const Wn=new Set(["inline","contents"]);function be(e){const{overflow:t,overflowX:n,overflowY:o,display:i}=q(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!Wn.has(i)}const In=new Set(["table","td","th"]);function $n(e){return In.has(me(e))}const Xn=[":popover-open",":modal"];function Fe(e){return Xn.some(t=>{try{return e.matches(t)}catch{return!1}})}const Yn=["transform","translate","scale","rotate","perspective"],jn=["transform","translate","scale","rotate","perspective","filter"],_n=["paint","layout","strict","content"];function tt(e){const t=nt(),n=U(e)?q(e):e;return Yn.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)||jn.some(o=>(n.willChange||"").includes(o))||_n.some(o=>(n.contain||"").includes(o))}function zn(e){let t=ne(e);for(;Z(t)&&!pe(t);){if(tt(t))return t;if(Fe(t))return null;t=ne(t)}return null}function nt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Un=new Set(["html","body","#document"]);function pe(e){return Un.has(me(e))}function q(e){return _(e).getComputedStyle(e)}function He(e){return U(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ne(e){if(me(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Dt(e)&&e.host||Q(e);return Dt(t)?t.host:t}function Vt(e){const t=ne(e);return pe(t)?e.ownerDocument?e.ownerDocument.body:e.body:Z(t)&&be(t)?t:Vt(t)}function Ee(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Vt(e),s=i===((o=e.ownerDocument)==null?void 0:o.body),r=_(i);if(s){const c=ot(r);return t.concat(r,r.visualViewport||[],be(i)?i:[],c&&n?Ee(c):[])}return t.concat(i,Ee(i,[],n))}function ot(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Rt(e){const t=q(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=Z(e),s=i?e.offsetWidth:n,r=i?e.offsetHeight:o,c=Ae(n)!==s||Ae(o)!==r;return c&&(n=s,o=r),{width:n,height:o,$:c}}function it(e){return U(e)?e:e.contextElement}function ge(e){const t=it(e);if(!Z(t))return J(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:s}=Rt(t);let r=(s?Ae(n.width):n.width)/o,c=(s?Ae(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!c||!Number.isFinite(c))&&(c=1),{x:r,y:c}}const qn=J(0);function kt(e){const t=_(e);return!nt()||!t.visualViewport?qn:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Kn(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==_(e)?!1:t}function se(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),s=it(e);let r=J(1);t&&(o?U(o)&&(r=ge(o)):r=ge(e));const c=Kn(s,n,o)?kt(s):J(0);let f=(i.left+c.x)/r.x,u=(i.top+c.y)/r.y,d=i.width/r.x,h=i.height/r.y;if(s){const g=_(s),m=o&&U(o)?_(o):o;let E=g,v=ot(E);for(;v&&o&&m!==E;){const w=ge(v),b=v.getBoundingClientRect(),L=q(v),x=b.left+(v.clientLeft+parseFloat(L.paddingLeft))*w.x,M=b.top+(v.clientTop+parseFloat(L.paddingTop))*w.y;f*=w.x,u*=w.y,d*=w.x,h*=w.y,f+=x,u+=M,E=_(v),v=ot(E)}}return Ve({width:d,height:h,x:f,y:u})}function Be(e,t){const n=He(e).scrollLeft;return t?t.left+n:se(Q(e)).left+n}function Ft(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Be(e,n),i=n.top+t.scrollTop;return{x:o,y:i}}function Gn(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const s=i==="fixed",r=Q(o),c=t?Fe(t.floating):!1;if(o===r||c&&s)return n;let f={scrollLeft:0,scrollTop:0},u=J(1);const d=J(0),h=Z(o);if((h||!h&&!s)&&((me(o)!=="body"||be(r))&&(f=He(o)),Z(o))){const m=se(o);u=ge(o),d.x=m.x+o.clientLeft,d.y=m.y+o.clientTop}const g=r&&!h&&!s?Ft(r,f):J(0);return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-f.scrollLeft*u.x+d.x+g.x,y:n.y*u.y-f.scrollTop*u.y+d.y+g.y}}function Jn(e){return Array.from(e.getClientRects())}function Qn(e){const t=Q(e),n=He(e),o=e.ownerDocument.body,i=ie(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),s=ie(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+Be(e);const c=-n.scrollTop;return q(o).direction==="rtl"&&(r+=ie(t.clientWidth,o.clientWidth)-i),{width:i,height:s,x:r,y:c}}const Ht=25;function Zn(e,t){const n=_(e),o=Q(e),i=n.visualViewport;let s=o.clientWidth,r=o.clientHeight,c=0,f=0;if(i){s=i.width,r=i.height;const d=nt();(!d||d&&t==="fixed")&&(c=i.offsetLeft,f=i.offsetTop)}const u=Be(o);if(u<=0){const d=o.ownerDocument,h=d.body,g=getComputedStyle(h),m=d.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,E=Math.abs(o.clientWidth-h.clientWidth-m);E<=Ht&&(s-=E)}else u<=Ht&&(s+=u);return{width:s,height:r,x:c,y:f}}const eo=new Set(["absolute","fixed"]);function to(e,t){const n=se(e,!0,t==="fixed"),o=n.top+e.clientTop,i=n.left+e.clientLeft,s=Z(e)?ge(e):J(1),r=e.clientWidth*s.x,c=e.clientHeight*s.y,f=i*s.x,u=o*s.y;return{width:r,height:c,x:f,y:u}}function Bt(e,t,n){let o;if(t==="viewport")o=Zn(e,n);else if(t==="document")o=Qn(Q(e));else if(U(t))o=to(t,n);else{const i=kt(e);o={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Ve(o)}function Wt(e,t){const n=ne(e);return n===t||!U(n)||pe(n)?!1:q(n).position==="fixed"||Wt(n,t)}function no(e,t){const n=t.get(e);if(n)return n;let o=Ee(e,[],!1).filter(c=>U(c)&&me(c)!=="body"),i=null;const s=q(e).position==="fixed";let r=s?ne(e):e;for(;U(r)&&!pe(r);){const c=q(r),f=tt(r);!f&&c.position==="fixed"&&(i=null),(s?!f&&!i:!f&&c.position==="static"&&!!i&&eo.has(i.position)||be(r)&&!f&&Wt(e,r))?o=o.filter(d=>d!==r):i=c,r=ne(r)}return t.set(e,o),o}function oo(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const r=[...n==="clippingAncestors"?Fe(t)?[]:no(t,this._c):[].concat(n),o],c=r[0],f=r.reduce((u,d)=>{const h=Bt(t,d,i);return u.top=ie(h.top,u.top),u.right=de(h.right,u.right),u.bottom=de(h.bottom,u.bottom),u.left=ie(h.left,u.left),u},Bt(t,c,i));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function io(e){const{width:t,height:n}=Rt(e);return{width:t,height:n}}function ro(e,t,n){const o=Z(t),i=Q(t),s=n==="fixed",r=se(e,!0,s,t);let c={scrollLeft:0,scrollTop:0};const f=J(0);function u(){f.x=Be(i)}if(o||!o&&!s)if((me(t)!=="body"||be(i))&&(c=He(t)),o){const m=se(t,!0,s,t);f.x=m.x+t.clientLeft,f.y=m.y+t.clientTop}else i&&u();s&&!o&&i&&u();const d=i&&!o&&!s?Ft(i,c):J(0),h=r.left+c.scrollLeft-f.x-d.x,g=r.top+c.scrollTop-f.y-d.y;return{x:h,y:g,width:r.width,height:r.height}}function rt(e){return q(e).position==="static"}function It(e,t){if(!Z(e)||q(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Q(e)===n&&(n=n.ownerDocument.body),n}function $t(e,t){const n=_(e);if(Fe(e))return n;if(!Z(e)){let i=ne(e);for(;i&&!pe(i);){if(U(i)&&!rt(i))return i;i=ne(i)}return n}let o=It(e,t);for(;o&&$n(o)&&rt(o);)o=It(o,t);return o&&pe(o)&&rt(o)&&!tt(o)?n:o||zn(e)||n}const so=async function(e){const t=this.getOffsetParent||$t,n=this.getDimensions,o=await n(e.floating);return{reference:ro(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function lo(e){return q(e).direction==="rtl"}const ao={convertOffsetParentRelativeRectToViewportRelativeRect:Gn,getDocumentElement:Q,getClippingRect:oo,getOffsetParent:$t,getElementRects:so,getClientRects:Jn,getDimensions:io,getScale:ge,isElement:U,isRTL:lo};function Xt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function co(e,t){let n=null,o;const i=Q(e);function s(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function r(c,f){c===void 0&&(c=!1),f===void 0&&(f=1),s();const u=e.getBoundingClientRect(),{left:d,top:h,width:g,height:m}=u;if(c||t(),!g||!m)return;const E=Ne(h),v=Ne(i.clientWidth-(d+g)),w=Ne(i.clientHeight-(h+m)),b=Ne(d),x={rootMargin:-E+"px "+-v+"px "+-w+"px "+-b+"px",threshold:ie(0,de(1,f))||1};let M=!0;function p(N){const A=N[0].intersectionRatio;if(A!==f){if(!M)return r();A?r(!1,A):o=setTimeout(()=>{r(!1,1e-7)},1e3)}A===1&&!Xt(u,e.getBoundingClientRect())&&r(),M=!1}try{n=new IntersectionObserver(p,{...x,root:i.ownerDocument})}catch{n=new IntersectionObserver(p,x)}n.observe(e)}return r(!0),s}function uo(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:f=!1}=o,u=it(e),d=i||s?[...u?Ee(u):[],...Ee(t)]:[];d.forEach(b=>{i&&b.addEventListener("scroll",n,{passive:!0}),s&&b.addEventListener("resize",n)});const h=u&&c?co(u,n):null;let g=-1,m=null;r&&(m=new ResizeObserver(b=>{let[L]=b;L&&L.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var x;(x=m)==null||x.observe(t)})),n()}),u&&!f&&m.observe(u),m.observe(t));let E,v=f?se(e):null;f&&w();function w(){const b=se(e);v&&!Xt(v,b)&&n(),v=b,E=requestAnimationFrame(w)}return n(),()=>{var b;d.forEach(L=>{i&&L.removeEventListener("scroll",n),s&&L.removeEventListener("resize",n)}),h==null||h(),(b=m)==null||b.disconnect(),m=null,f&&cancelAnimationFrame(E)}}const fo=Hn,ho=Bn,mo=Vn,po=Rn,go=Dn,vo=(e,t,n)=>{const o=new Map,i={platform:ao,...n},s={...i.platform,_c:o};return Nn(e,t,{...i,platform:s})};function wo(e,t,n={}){const{offset:o="-4px"}=n,{middlewareData:i,placement:s,refs:r}=t;a.watch(e,d=>{r.arrowEl.value=d});const c=a.computed(()=>{var d;return((d=i.value.arrow)==null?void 0:d.x)??0}),f=a.computed(()=>{var d;return((d=i.value.arrow)==null?void 0:d.y)??0}),u=a.computed(()=>{if(!(e.value||r.arrowEl.value)||!i.value.arrow)return{};const h=a.toValue(s).split("-")[0],g=c.value,m=f.value;return h==="bottom"?{"inset-inline-start":`${g}px`,"inset-block-start":o}:h==="top"?{"inset-inline-start":`${g}px`,"inset-block-end":o}:h==="right"?{"inset-block-start":`${m}px`,"inset-inline-start":o}:h==="left"?{"inset-block-start":`${m}px`,"inset-inline-end":o}:{}});return{arrowX:c,arrowY:f,arrowStyles:u}}function yo(e){return{name:"arrow",options:e,fn(t){const n=a.toValue(e.element);return n==null?{}:go({element:n,padding:e.padding}).fn(t)}}}function st(e,t,n={}){const{transform:o=!0,middlewares:i,autoUpdate:s=!0,open:r=a.ref(!1)}=n,c=p=>{r.value=p},f=a.computed(()=>a.toValue(n.placement)??"bottom"),u=a.computed(()=>a.toValue(n.strategy)??"absolute"),d=a.ref(0),h=a.ref(0),g=a.ref(f.value),m=a.ref(u.value),E=a.shallowRef({}),v=a.ref(!1),w=a.ref(null),b=a.computed(()=>{const p=i||[];return w.value&&!p.some(A=>A.name==="arrow")?[...p,yo({element:w})]:p}),L=async()=>{if(!e.value||!t.value)return;const p=await vo(e.value,t.value,{placement:f.value,strategy:u.value,middleware:b.value});d.value=p.x,h.value=p.y,g.value=p.placement,m.value=p.strategy,E.value=p.middlewareData,v.value=r.value};a.watch([f,u],()=>{r.value&&L()});let x;a.watch([e,t,r],([p,N,A])=>{!A||!p||!N||(s&&(x=uo(p,N,L,typeof s=="object"?s:void 0)),a.onWatcherCleanup(()=>{x==null||x(),x=void 0}))},{immediate:!0}),a.onScopeDispose(()=>x==null?void 0:x()),a.watch(r,p=>{p||(v.value=!1)});const M=a.ref({position:u.value,left:"0",top:"0"});return a.watch([d,h,()=>a.toValue(o)],([p,N,A])=>{const R=t.value;if(!R)return;const D={position:m.value,left:"0",top:"0"},O=Yt(R,p),V=Yt(R,N);A?M.value={...D,transform:`translate(${O}px, ${V}px)`,...jt(R)>=1.5&&{"will-change":"transform"}}:M.value={...D,left:`${O}px`,top:`${V}px`}},{immediate:!0}),{x:d,y:h,strategy:m,placement:g,middlewareData:E,isPositioned:v,floatingStyles:M,update:L,refs:{anchorEl:e,floatingEl:t,arrowEl:w},open:r,setOpen:c}}function Yt(e,t){const n=jt(e);return Math.round(t*n)/n}function jt(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}class lt{constructor(t,n=null,o={},i=!1){fe(this,"id");fe(this,"data");fe(this,"parent");fe(this,"children");$e(this,xe);this.id=o.id??mn(),this.data=t,this.parent=a.shallowRef(n),this.children=a.shallowRef([]),ut(this,xe,i)}addChild(t){this.children.value=[...this.children.value,t]}_removeChildInstance(t){return this.children.value.includes(t)?(this.children.value=this.children.value.filter(n=>n.id!==t.id),t.parent.value=null,!0):!1}findChild(t){return this.children.value.find(t)??null}findDescendant(t){const n=[this];for(;n.length>0;){const o=n.pop();if(t(o))return o;for(let i=o.children.value.length-1;i>=0;i--)n.push(o.children.value[i])}return null}isDescendantOf(t){let n=this.parent.value;for(;n;){if(n.id===t.id)return!0;n=n.parent.value}return!1}getPath(){const t=[];let n=this;for(;n;)t.push(n),n=n.parent.value;return t.reverse()}get isRoot(){return ct(this,xe)}get isLeaf(){return this.children.value.length===0}}xe=new WeakMap;class _t{constructor(t,n){$e(this,Ce);fe(this,"root");fe(this,"nodeMap");$e(this,Te);ut(this,Te,(n==null?void 0:n.deleteStrategy)??"recursive"),this.nodeMap=a.shallowReactive(new Map),this.root=new lt(t,null,{},!0),this.nodeMap.set(this.root.id,this.root)}findNodeById(t){return this.nodeMap.get(t)??null}addNode(t,n=null,o={}){const i=n?this.findNodeById(n):this.root;if(!i)return console.error(`Tree addNode: Parent node with ID ${n} not found.`),null;o.id&&this.nodeMap.has(o.id)&&(o.id=void 0);const s=new lt(t,i,o);return this.nodeMap.set(s.id,s),i.addChild(s),s}removeNode(t,n){const o=n??ct(this,Te),i=this.findNodeById(t);if(!i)return!1;if(i.isRoot)return console.error("Tree removeNode: Cannot remove the root node."),!1;const s=i.parent.value;if(o==="recursive")ft(this,Ce,dt).call(this,i);else{for(const r of i.children.value)r.parent.value=null;i.children.value=[],this.nodeMap.delete(i.id)}return s._removeChildInstance(i)}moveNode(t,n){const o=this.findNodeById(t);if(!o)return console.error(`Tree moveNode: Node with ID ${t} not found.`),!1;if(o.isRoot)return console.error("Tree moveNode: Cannot move the root node."),!1;if(t===n)return console.error("Tree moveNode: Cannot move a node to be a child of itself."),!1;const i=n?this.findNodeById(n):this.root;if(!i)return console.error(`Tree moveNode: New parent node with ID ${n} not found.`),!1;if(i.isDescendantOf(o))return console.error("Tree moveNode: Cannot move a node to become its own descendant."),!1;const s=o.parent.value;if(s){if(!s._removeChildInstance(o))return console.error("Tree moveNode: Failed to remove node from its original parent."),!1}else if(o.isRoot){if(o.isRoot)return console.error("Tree moveNode: Attempting to move the root node, which is not allowed."),!1}return i.addChild(o),o.parent.value=i,!0}traverse(t="dfs",n=this.root){const o=[];if(!n)return console.warn("Tree traverse: Start node is null, returning empty array."),o;if(t==="dfs"){const i=[n];for(;i.length>0;){const s=i.pop();o.push(s);for(let r=s.children.value.length-1;r>=0;r--)i.push(s.children.value[r])}}else{const i=[n];for(;i.length>0;){const s=i.shift();o.push(s);for(const r of s.children.value)i.push(r)}}return o}dispose(){this.nodeMap.clear()}}Te=new WeakMap,Ce=new WeakSet,dt=function(t){const n=[...t.children.value];for(const o of n)ft(this,Ce,dt).call(this,o);this.nodeMap.delete(t.id),t.children.value=[]};function bo(e,t,n={},o={}){const{...i}=n,s=st(e,t,i),r=new _t(s,o);return{get nodeMap(){return r.nodeMap},get root(){return r.root},findNodeById:w=>r.findNodeById(w),moveNode:(w,b)=>r.moveNode(w,b),dispose:()=>{r.dispose()},addNode:(w,b,L={})=>{const{parentId:x,...M}=L,p=st(w,b,M);return r.addNode(p,x)},removeNode:(w,b)=>r.removeNode(w,b),traverse:(w,b)=>r.traverse(w,b),getAllOpenNodes:()=>{const w=[];for(const b of r.nodeMap.values())b.data.open.value&&w.push(b);return w},getTopmostOpenNode:()=>{let w=null,b=-1;for(const L of r.nodeMap.values())if(L.data.open.value){const x=L.getPath().length;x>b&&(b=x,w=L)}return w},forEach:(w,b,L={})=>{const{relationship:x="self-and-children",applyToMatching:M=!0}=L,p=r.findNodeById(w);if(!p)return;const N=[],A=new Set,R=O=>{O&&!A.has(O.id)&&(N.push(O),A.add(O.id))},D=O=>{for(const V of O)R(V)};if(x==="ancestors-only")for(const O of p.getPath())O.id!==p.id&&R(O);else if(x==="siblings-only"){if(p.parent.value)for(const O of p.parent.value.children.value)O.id!==p.id&&R(O)}else if(x==="descendants-only")for(const O of r.traverse("dfs",p))O.id!==p.id&&R(O);else if(x==="children-only")D(p.children.value);else if(x==="self-and-ancestors")D(p.getPath());else if(x==="self-and-children")R(p),D(p.children.value);else if(x==="self-and-descendants")D(r.traverse("dfs",p));else if(x==="self-and-siblings")R(p),p.parent.value&&D(p.parent.value.children.value);else if(x==="self-ancestors-and-children")D(p.getPath()),D(p.children.value);else if(x==="full-branch")D(p.getPath()),D(r.traverse("dfs",p));else if(x==="all-except-branch"){const O=new Set;for(const V of p.getPath())O.add(V.id);for(const V of r.traverse("dfs",p))O.add(V.id);for(const V of r.nodeMap.values())!O.has(V.id)===M&&b(V);return}else{console.warn(`forEach: Unknown relationship "${x}".`);return}if(M)for(const O of N)b(O);else for(const O of r.nodeMap.values())A.has(O.id)||b(O)}}}T.Tree=_t,T.TreeNode=lt,T.clearTimeoutIfSet=Ge,T.contains=Oe,T.findDescendantContainingTarget=Me,T.flip=mo,T.getContextFromParameter=Se,T.getCurrentTime=Ke,T.getTarget=vt,T.hide=po,T.isButtonTarget=ze,T.isClickOnScrollbar=gt,T.isEventTargetWithin=qe,T.isHTMLElement=mt,T.isMac=Ye,T.isMouseLikePointerType=Le,T.isSafari=je,T.isSpaceIgnored=Ue,T.isTargetWithinElement=z,T.isTreeNode=wt,T.isTypeableElement=_e,T.isVirtualElement=pt,T.matchesFocusVisible=ht,T.offset=fo,T.shift=ho,T.useArrow=wo,T.useClick=rn,T.useClientPoint=ln,T.useEscapeKey=cn,T.useFloating=st,T.useFloatingTree=bo,T.useFocus=fn,T.useHover=wn,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})}));
|