v-float 0.2.1 → 0.3.1
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/README.md +248 -83
- package/dist/composables/interactions/index.d.ts +2 -1
- package/dist/composables/interactions/index.d.ts.map +1 -1
- package/dist/composables/interactions/polygon.d.ts +12 -2
- package/dist/composables/interactions/polygon.d.ts.map +1 -1
- package/dist/composables/interactions/use-click.d.ts +78 -10
- 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-escape-key.d.ts +24 -0
- package/dist/composables/interactions/use-escape-key.d.ts.map +1 -0
- package/dist/composables/interactions/use-focus.d.ts +28 -3
- package/dist/composables/interactions/use-focus.d.ts.map +1 -1
- package/dist/composables/interactions/use-hover.d.ts +21 -3
- package/dist/composables/interactions/use-hover.d.ts.map +1 -1
- package/dist/composables/interactions/utils/browser-detection.d.ts +23 -0
- package/dist/composables/interactions/utils/browser-detection.d.ts.map +1 -0
- package/dist/composables/interactions/utils/element-detection.d.ts +53 -0
- package/dist/composables/interactions/utils/element-detection.d.ts.map +1 -0
- package/dist/composables/interactions/utils/event-utils.d.ts +30 -0
- package/dist/composables/interactions/utils/event-utils.d.ts.map +1 -0
- package/dist/composables/interactions/utils/index.d.ts +11 -0
- package/dist/composables/interactions/utils/index.d.ts.map +1 -0
- package/dist/composables/interactions/utils/tree-context.d.ts +32 -0
- package/dist/composables/interactions/utils/tree-context.d.ts.map +1 -0
- package/dist/composables/middlewares/index.d.ts +0 -1
- package/dist/composables/middlewares/index.d.ts.map +1 -1
- package/dist/composables/use-arrow.d.ts +10 -3
- package/dist/composables/use-arrow.d.ts.map +1 -1
- package/dist/composables/use-floating-tree.d.ts +13 -13
- package/dist/composables/use-floating-tree.d.ts.map +1 -1
- package/dist/composables/use-floating.d.ts +7 -0
- 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 +1343 -1176
- package/dist/v-float.umd.js +1 -1
- package/package.json +29 -22
- package/dist/composables/interactions/use-dismiss.d.ts +0 -68
- package/dist/composables/interactions/use-dismiss.d.ts.map +0 -1
package/dist/v-float.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(x,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],f):(x=typeof globalThis<"u"?globalThis:x||self,f(x.VFloat={},x.Vue))})(this,function(x,f){"use strict";var jn=Object.defineProperty;var Ct=x=>{throw TypeError(x)};var _n=(x,f,V)=>f in x?jn(x,f,{enumerable:!0,configurable:!0,writable:!0,value:V}):x[f]=V;var oe=(x,f,V)=>_n(x,typeof f!="symbol"?f+"":f,V),Ye=(x,f,V)=>f.has(x)||Ct("Cannot "+V);var Xe=(x,f,V)=>(Ye(x,f,"read from private field"),V?V.call(x):f.get(x)),Oe=(x,f,V)=>f.has(x)?Ct("Cannot add the same private member more than once"):f instanceof WeakSet?f.add(x):f.set(x,V),je=(x,f,V,J)=>(Ye(x,f,"write to private field"),J?J.call(x,V):f.set(x,V),V),_e=(x,f,V)=>(Ye(x,f,"access private method"),V);var de,he,pe,Ke;const V=["top","right","bottom","left"],J=Math.min,Z=Math.max,ve=Math.round,we=Math.floor,K=e=>({x:e,y:e}),Mt={left:"right",right:"left",bottom:"top",top:"bottom"},At={start:"end",end:"start"};function Ce(e,t,n){return Z(e,J(t,n))}function ie(e,t){return typeof e=="function"?e(t):e}function z(e){return e.split("-")[0]}function ue(e){return e.split("-")[1]}function qe(e){return e==="x"?"y":"x"}function Me(e){return e==="y"?"height":"width"}function se(e){return["top","bottom"].includes(z(e))?"y":"x"}function Ae(e){return qe(se(e))}function Dt(e,t,n){n===void 0&&(n=!1);const o=ue(e),i=Ae(e),r=Me(i);let s=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(s=ye(s)),[s,ye(s)]}function St(e){const t=ye(e);return[De(e),t,De(t)]}function De(e){return e.replace(/start|end/g,t=>At[t])}function Rt(e,t,n){const o=["left","right"],i=["right","left"],r=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:o:t?o:i;case"left":case"right":return t?r:s;default:return[]}}function Vt(e,t,n,o){const i=ue(e);let r=Rt(z(e),n==="start",o);return i&&(r=r.map(s=>s+"-"+i),t&&(r=r.concat(r.map(De)))),r}function ye(e){return e.replace(/left|right|bottom|top/g,t=>Mt[t])}function Nt(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ue(e){return typeof e!="number"?Nt(e):{top:e,right:e,bottom:e,left:e}}function be(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 Ge(e,t,n){let{reference:o,floating:i}=e;const r=se(t),s=Ae(t),c=Me(s),d=z(t),a=r==="y",p=o.x+o.width/2-i.width/2,h=o.y+o.height/2-i.height/2,v=o[c]/2-i[c]/2;let u;switch(d){case"top":u={x:p,y:o.y-i.height};break;case"bottom":u={x:p,y:o.y+o.height};break;case"right":u={x:o.x+o.width,y:h};break;case"left":u={x:o.x-i.width,y:h};break;default:u={x:o.x,y:o.y}}switch(ue(t)){case"start":u[s]-=v*(n&&a?-1:1);break;case"end":u[s]+=v*(n&&a?-1:1);break}return u}const kt=async(e,t,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,c=r.filter(Boolean),d=await(s.isRTL==null?void 0:s.isRTL(t));let a=await s.getElementRects({reference:e,floating:t,strategy:i}),{x:p,y:h}=Ge(a,o,d),v=o,u={},w=0;for(let m=0;m<c.length;m++){const{name:g,fn:b}=c[m],{x:L,y:P,data:y,reset:O}=await b({x:p,y:h,initialPlacement:o,placement:v,strategy:i,middlewareData:u,rects:a,platform:s,elements:{reference:e,floating:t}});p=L??p,h=P??h,u={...u,[g]:{...u[g],...y}},O&&w<=50&&(w++,typeof O=="object"&&(O.placement&&(v=O.placement),O.rects&&(a=O.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:i}):O.rects),{x:p,y:h}=Ge(a,v,d)),m=-1)}return{x:p,y:h,placement:v,strategy:i,middlewareData:u}};async function Ee(e,t){var n;t===void 0&&(t={});const{x:o,y:i,platform:r,rects:s,elements:c,strategy:d}=e,{boundary:a="clippingAncestors",rootBoundary:p="viewport",elementContext:h="floating",altBoundary:v=!1,padding:u=0}=ie(t,e),w=Ue(u),g=c[v?h==="floating"?"reference":"floating":h],b=be(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(g)))==null||n?g:g.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(c.floating)),boundary:a,rootBoundary:p,strategy:d})),L=h==="floating"?{x:o,y:i,width:s.floating.width,height:s.floating.height}:s.reference,P=await(r.getOffsetParent==null?void 0:r.getOffsetParent(c.floating)),y=await(r.isElement==null?void 0:r.isElement(P))?await(r.getScale==null?void 0:r.getScale(P))||{x:1,y:1}:{x:1,y:1},O=be(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:L,offsetParent:P,strategy:d}):L);return{top:(b.top-O.top+w.top)/y.y,bottom:(O.bottom-b.bottom+w.bottom)/y.y,left:(b.left-O.left+w.left)/y.x,right:(O.right-b.right+w.right)/y.x}}const Ft=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:i,rects:r,platform:s,elements:c,middlewareData:d}=t,{element:a,padding:p=0}=ie(e,t)||{};if(a==null)return{};const h=Ue(p),v={x:n,y:o},u=Ae(i),w=Me(u),m=await s.getDimensions(a),g=u==="y",b=g?"top":"left",L=g?"bottom":"right",P=g?"clientHeight":"clientWidth",y=r.reference[w]+r.reference[u]-v[u]-r.floating[w],O=v[u]-r.reference[u],C=await(s.getOffsetParent==null?void 0:s.getOffsetParent(a));let A=C?C[P]:0;(!A||!await(s.isElement==null?void 0:s.isElement(C)))&&(A=c.floating[P]||r.floating[w]);const F=y/2-O/2,E=A/2-m[w]/2-1,l=J(h[b],E),k=J(h[L],E),S=l,I=A-m[w]-k,M=A/2-m[w]/2+F,D=Ce(S,M,I),T=!d.arrow&&ue(i)!=null&&M!==D&&r.reference[w]/2-(M<S?l:k)-m[w]/2<0,R=T?M<S?M-S:M-I:0;return{[u]:v[u]+R,data:{[u]:D,centerOffset:M-D-R,...T&&{alignmentOffset:R}},reset:T}}}),Ht=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:i,middlewareData:r,rects:s,initialPlacement:c,platform:d,elements:a}=t,{mainAxis:p=!0,crossAxis:h=!0,fallbackPlacements:v,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:m=!0,...g}=ie(e,t);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const b=z(i),L=se(c),P=z(c)===c,y=await(d.isRTL==null?void 0:d.isRTL(a.floating)),O=v||(P||!m?[ye(c)]:St(c)),C=w!=="none";!v&&C&&O.push(...Vt(c,m,w,y));const A=[c,...O],F=await Ee(t,g),E=[];let l=((o=r.flip)==null?void 0:o.overflows)||[];if(p&&E.push(F[b]),h){const M=Dt(i,s,y);E.push(F[M[0]],F[M[1]])}if(l=[...l,{placement:i,overflows:E}],!E.every(M=>M<=0)){var k,S;const M=(((k=r.flip)==null?void 0:k.index)||0)+1,D=A[M];if(D)return{data:{index:M,overflows:l},reset:{placement:D}};let T=(S=l.filter(R=>R.overflows[0]<=0).sort((R,H)=>R.overflows[1]-H.overflows[1])[0])==null?void 0:S.placement;if(!T)switch(u){case"bestFit":{var I;const R=(I=l.filter(H=>{if(C){const W=se(H.placement);return W===L||W==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(W=>W>0).reduce((W,G)=>W+G,0)]).sort((H,W)=>H[1]-W[1])[0])==null?void 0:I[0];R&&(T=R);break}case"initialPlacement":T=c;break}if(i!==T)return{reset:{placement:T}}}return{}}}};function Je(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Qe(e){return V.some(t=>e[t]>=0)}const Wt=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...i}=ie(e,t);switch(o){case"referenceHidden":{const r=await Ee(t,{...i,elementContext:"reference"}),s=Je(r,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Qe(s)}}}case"escaped":{const r=await Ee(t,{...i,altBoundary:!0}),s=Je(r,n.floating);return{data:{escapedOffsets:s,escaped:Qe(s)}}}default:return{}}}}};async function $t(e,t){const{placement:n,platform:o,elements:i}=e,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),s=z(n),c=ue(n),d=se(n)==="y",a=["left","top"].includes(s)?-1:1,p=r&&d?-1:1,h=ie(t,e);let{mainAxis:v,crossAxis:u,alignmentAxis:w}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return c&&typeof w=="number"&&(u=c==="end"?w*-1:w),d?{x:u*p,y:v*a}:{x:v*a,y:u*p}}const It=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:i,y:r,placement:s,middlewareData:c}=t,d=await $t(t,e);return s===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:i+d.x,y:r+d.y,data:{...d,placement:s}}}}},Yt=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:s=!1,limiter:c={fn:g=>{let{x:b,y:L}=g;return{x:b,y:L}}},...d}=ie(e,t),a={x:n,y:o},p=await Ee(t,d),h=se(z(i)),v=qe(h);let u=a[v],w=a[h];if(r){const g=v==="y"?"top":"left",b=v==="y"?"bottom":"right",L=u+p[g],P=u-p[b];u=Ce(L,u,P)}if(s){const g=h==="y"?"top":"left",b=h==="y"?"bottom":"right",L=w+p[g],P=w-p[b];w=Ce(L,w,P)}const m=c.fn({...t,[v]:u,[h]:w});return{...m,data:{x:m.x-n,y:m.y-o,enabled:{[v]:r,[h]:s}}}}}};function Te(){return typeof window<"u"}function re(e){return Ze(e)?(e.nodeName||"").toLowerCase():"#document"}function Y(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function q(e){var t;return(t=(Ze(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ze(e){return Te()?e instanceof Node||e instanceof Y(e).Node:!1}function X(e){return Te()?e instanceof Element||e instanceof Y(e).Element:!1}function U(e){return Te()?e instanceof HTMLElement||e instanceof Y(e).HTMLElement:!1}function ze(e){return!Te()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Y(e).ShadowRoot}function fe(e){const{overflow:t,overflowX:n,overflowY:o,display:i}=j(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(i)}function Xt(e){return["table","td","th"].includes(re(e))}function Pe(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Se(e){const t=Re(),n=X(e)?j(e):e;return["transform","translate","scale","rotate","perspective"].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)||["transform","translate","scale","rotate","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function jt(e){let t=Q(e);for(;U(t)&&!le(t);){if(Se(t))return t;if(Pe(t))return null;t=Q(t)}return null}function Re(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function le(e){return["html","body","#document"].includes(re(e))}function j(e){return Y(e).getComputedStyle(e)}function Le(e){return X(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Q(e){if(re(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ze(e)&&e.host||q(e);return ze(t)?t.host:t}function Be(e){const t=Q(e);return le(t)?e.ownerDocument?e.ownerDocument.body:e.body:U(t)&&fe(t)?t:Be(t)}function B(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Be(e),r=i===((o=e.ownerDocument)==null?void 0:o.body),s=Y(i);if(r){const c=Ve(s);return t.concat(s,s.visualViewport||[],fe(i)?i:[],c&&n?B(c):[])}return t.concat(i,B(i,[],n))}function Ve(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function et(e){const t=j(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=U(e),r=i?e.offsetWidth:n,s=i?e.offsetHeight:o,c=ve(n)!==r||ve(o)!==s;return c&&(n=r,o=s),{width:n,height:o,$:c}}function Ne(e){return X(e)?e:e.contextElement}function ae(e){const t=Ne(e);if(!U(t))return K(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:r}=et(t);let s=(r?ve(n.width):n.width)/o,c=(r?ve(n.height):n.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!c||!Number.isFinite(c))&&(c=1),{x:s,y:c}}const _t=K(0);function tt(e){const t=Y(e);return!Re()||!t.visualViewport?_t:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Kt(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Y(e)?!1:t}function ee(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),r=Ne(e);let s=K(1);t&&(o?X(o)&&(s=ae(o)):s=ae(e));const c=Kt(r,n,o)?tt(r):K(0);let d=(i.left+c.x)/s.x,a=(i.top+c.y)/s.y,p=i.width/s.x,h=i.height/s.y;if(r){const v=Y(r),u=o&&X(o)?Y(o):o;let w=v,m=Ve(w);for(;m&&o&&u!==w;){const g=ae(m),b=m.getBoundingClientRect(),L=j(m),P=b.left+(m.clientLeft+parseFloat(L.paddingLeft))*g.x,y=b.top+(m.clientTop+parseFloat(L.paddingTop))*g.y;d*=g.x,a*=g.y,p*=g.x,h*=g.y,d+=P,a+=y,w=Y(m),m=Ve(w)}}return be({width:p,height:h,x:d,y:a})}function ke(e,t){const n=Le(e).scrollLeft;return t?t.left+n:ee(q(e)).left+n}function nt(e,t,n){n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=o.left+t.scrollLeft-(n?0:ke(e,o)),r=o.top+t.scrollTop;return{x:i,y:r}}function qt(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const r=i==="fixed",s=q(o),c=t?Pe(t.floating):!1;if(o===s||c&&r)return n;let d={scrollLeft:0,scrollTop:0},a=K(1);const p=K(0),h=U(o);if((h||!h&&!r)&&((re(o)!=="body"||fe(s))&&(d=Le(o)),U(o))){const u=ee(o);a=ae(o),p.x=u.x+o.clientLeft,p.y=u.y+o.clientTop}const v=s&&!h&&!r?nt(s,d,!0):K(0);return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-d.scrollLeft*a.x+p.x+v.x,y:n.y*a.y-d.scrollTop*a.y+p.y+v.y}}function Ut(e){return Array.from(e.getClientRects())}function Gt(e){const t=q(e),n=Le(e),o=e.ownerDocument.body,i=Z(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),r=Z(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+ke(e);const c=-n.scrollTop;return j(o).direction==="rtl"&&(s+=Z(t.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:c}}function Jt(e,t){const n=Y(e),o=q(e),i=n.visualViewport;let r=o.clientWidth,s=o.clientHeight,c=0,d=0;if(i){r=i.width,s=i.height;const a=Re();(!a||a&&t==="fixed")&&(c=i.offsetLeft,d=i.offsetTop)}return{width:r,height:s,x:c,y:d}}function Qt(e,t){const n=ee(e,!0,t==="fixed"),o=n.top+e.clientTop,i=n.left+e.clientLeft,r=U(e)?ae(e):K(1),s=e.clientWidth*r.x,c=e.clientHeight*r.y,d=i*r.x,a=o*r.y;return{width:s,height:c,x:d,y:a}}function ot(e,t,n){let o;if(t==="viewport")o=Jt(e,n);else if(t==="document")o=Gt(q(e));else if(X(t))o=Qt(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 be(o)}function it(e,t){const n=Q(e);return n===t||!X(n)||le(n)?!1:j(n).position==="fixed"||it(n,t)}function Zt(e,t){const n=t.get(e);if(n)return n;let o=B(e,[],!1).filter(c=>X(c)&&re(c)!=="body"),i=null;const r=j(e).position==="fixed";let s=r?Q(e):e;for(;X(s)&&!le(s);){const c=j(s),d=Se(s);!d&&c.position==="fixed"&&(i=null),(r?!d&&!i:!d&&c.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||fe(s)&&!d&&it(e,s))?o=o.filter(p=>p!==s):i=c,s=Q(s)}return t.set(e,o),o}function zt(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const s=[...n==="clippingAncestors"?Pe(t)?[]:Zt(t,this._c):[].concat(n),o],c=s[0],d=s.reduce((a,p)=>{const h=ot(t,p,i);return a.top=Z(h.top,a.top),a.right=J(h.right,a.right),a.bottom=J(h.bottom,a.bottom),a.left=Z(h.left,a.left),a},ot(t,c,i));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function Bt(e){const{width:t,height:n}=et(e);return{width:t,height:n}}function en(e,t,n){const o=U(t),i=q(t),r=n==="fixed",s=ee(e,!0,r,t);let c={scrollLeft:0,scrollTop:0};const d=K(0);if(o||!o&&!r)if((re(t)!=="body"||fe(i))&&(c=Le(t)),o){const v=ee(t,!0,r,t);d.x=v.x+t.clientLeft,d.y=v.y+t.clientTop}else i&&(d.x=ke(i));const a=i&&!o&&!r?nt(i,c):K(0),p=s.left+c.scrollLeft-d.x-a.x,h=s.top+c.scrollTop-d.y-a.y;return{x:p,y:h,width:s.width,height:s.height}}function Fe(e){return j(e).position==="static"}function st(e,t){if(!U(e)||j(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return q(e)===n&&(n=n.ownerDocument.body),n}function rt(e,t){const n=Y(e);if(Pe(e))return n;if(!U(e)){let i=Q(e);for(;i&&!le(i);){if(X(i)&&!Fe(i))return i;i=Q(i)}return n}let o=st(e,t);for(;o&&Xt(o)&&Fe(o);)o=st(o,t);return o&&le(o)&&Fe(o)&&!Se(o)?n:o||jt(e)||n}const tn=async function(e){const t=this.getOffsetParent||rt,n=this.getDimensions,o=await n(e.floating);return{reference:en(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function nn(e){return j(e).direction==="rtl"}const on={convertOffsetParentRelativeRectToViewportRelativeRect:qt,getDocumentElement:q,getClippingRect:zt,getOffsetParent:rt,getElementRects:tn,getClientRects:Ut,getDimensions:Bt,getScale:ae,isElement:X,isRTL:nn};function lt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function sn(e,t){let n=null,o;const i=q(e);function r(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function s(c,d){c===void 0&&(c=!1),d===void 0&&(d=1),r();const a=e.getBoundingClientRect(),{left:p,top:h,width:v,height:u}=a;if(c||t(),!v||!u)return;const w=we(h),m=we(i.clientWidth-(p+v)),g=we(i.clientHeight-(h+u)),b=we(p),P={rootMargin:-w+"px "+-m+"px "+-g+"px "+-b+"px",threshold:Z(0,J(1,d))||1};let y=!0;function O(C){const A=C[0].intersectionRatio;if(A!==d){if(!y)return s();A?s(!1,A):o=setTimeout(()=>{s(!1,1e-7)},1e3)}A===1&&!lt(a,e.getBoundingClientRect())&&s(),y=!1}try{n=new IntersectionObserver(O,{...P,root:i.ownerDocument})}catch{n=new IntersectionObserver(O,P)}n.observe(e)}return s(!0),r}function rn(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:d=!1}=o,a=Ne(e),p=i||r?[...a?B(a):[],...B(t)]:[];p.forEach(b=>{i&&b.addEventListener("scroll",n,{passive:!0}),r&&b.addEventListener("resize",n)});const h=a&&c?sn(a,n):null;let v=-1,u=null;s&&(u=new ResizeObserver(b=>{let[L]=b;L&&L.target===a&&u&&(u.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var P;(P=u)==null||P.observe(t)})),n()}),a&&!d&&u.observe(a),u.observe(t));let w,m=d?ee(e):null;d&&g();function g(){const b=ee(e);m&&!lt(m,b)&&n(),m=b,w=requestAnimationFrame(g)}return n(),()=>{var b;p.forEach(L=>{i&&L.removeEventListener("scroll",n),r&&L.removeEventListener("resize",n)}),h==null||h(),(b=u)==null||b.disconnect(),u=null,d&&cancelAnimationFrame(w)}}const ln=It,an=Yt,cn=Ht,un=Wt,fn=Ft,dn=(e,t,n)=>{const o=new Map,i={platform:on,...n},r={...i.platform,_c:o};return kt(e,t,{...i,platform:r})};function hn(e,t,n={}){const{transform:o=!0,middlewares:i,autoUpdate:r=!0,open:s=f.ref(!1)}=n,c=P=>{s.value=P},d=f.computed(()=>f.toValue(n.placement)??"bottom"),a=f.computed(()=>f.toValue(n.strategy)??"absolute"),p=f.ref(0),h=f.ref(0),v=f.ref(d.value),u=f.ref(a.value),w=f.shallowRef({}),m=f.ref(!1),g=async()=>{if(!e.value||!t.value)return;const P=await dn(e.value,t.value,{placement:d.value,strategy:a.value,middleware:i});p.value=P.x,h.value=P.y,v.value=P.placement,u.value=P.strategy,w.value=P.middlewareData,m.value=s.value};f.watch([d,a],()=>{s.value&&g()});let b;f.watch([e,t,s],([P,y,O])=>{!O||!P||!y||(r&&(b=rn(P,y,g,typeof r=="object"?r:void 0)),f.onWatcherCleanup(()=>{b==null||b(),b=void 0}))},{immediate:!0}),f.onScopeDispose(()=>b==null?void 0:b()),f.watch(s,P=>{P||(m.value=!1)});const L=f.ref({position:a.value,left:"0",top:"0"});return f.watch([p,h,()=>f.toValue(o)],([P,y,O])=>{const C=t.value;if(!C)return;const A={position:u.value,left:"0",top:"0"},F=at(C,P),E=at(C,y);O?L.value={...A,transform:`translate(${F}px, ${E}px)`,...ct(C)>=1.5&&{"will-change":"transform"}}:L.value={...A,left:`${F}px`,top:`${E}px`}},{immediate:!0}),{x:p,y:h,strategy:u,placement:v,middlewareData:w,isPositioned:m,floatingStyles:L,update:g,refs:{anchorEl:e,floatingEl:t},open:s,setOpen:c}}function at(e,t){const n=ct(e);return Math.round(t*n)/n}function ct(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function pn(e,t={}){const{middlewareData:n,placement:o}=e,{offset:i="-4px"}=t,r=f.computed(()=>{var d;return((d=n.value.arrow)==null?void 0:d.x)??0}),s=f.computed(()=>{var d;return((d=n.value.arrow)==null?void 0:d.y)??0}),c=f.computed(()=>{const d=f.toValue(o).split("-")[0],a=r.value,p=s.value;return d==="bottom"?{"inset-inline-start":`${a}px`,"inset-block-start":i}:d==="top"?{"inset-inline-start":`${a}px`,"inset-block-end":i}:d==="right"?{"inset-block-start":`${p}px`,"inset-inline-start":i}:d==="left"?{"inset-block-start":`${p}px`,"inset-inline-end":i}:{}});return{arrowX:r,arrowY:s,arrowStyles:c}}let mn=0;function gn(){return`vfloat-id-${mn++}`}function ut(e){return typeof e=="object"&&e instanceof HTMLElement}function He(e,t){return e.contains(t)}function vn(e){return e.target}function ft(e,t){const[n,o]=e;let i=!1;const r=t.length;for(let s=0,c=r-1;s<r;c=s++){const[d,a]=t[s]||[0,0],[p,h]=t[c]||[0,0];a>=o!=h>=o&&n<=(p-d)*(o-a)/(h-a)+d&&(i=!i)}return i}function wn(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function yn(e={}){const{requireIntent:t=!0}=e;let n,o=!1,i=null,r=null,s=performance.now();function c(d,a){const p=performance.now(),h=p-s;if(i===null||r===null||h===0)return i=d,r=a,s=p,null;const v=d-i,u=a-r,m=Math.sqrt(v*v+u*u)/h;return i=d,r=a,s=p,m}return function({x:a,y:p,placement:h,elements:v,buffer:u,onClose:w}){const m=f.computed(()=>{const g=v.domReference;return ut(g)?g:(g==null?void 0:g.contextElement)??null});return function(b){var ge,Et,Tt,Pt,Lt,xt,Ot;function L(){clearTimeout(n),w()}if(clearTimeout(n),!v.domReference||!v.floating||h==null||a==null||p==null)return;const{clientX:P,clientY:y}=b,O=vn(b),C=b.type==="mouseleave",A=v.floating&&He(v.floating,O),F=m.value&&He(m.value,O),E=(ge=m.value)==null?void 0:ge.getBoundingClientRect(),l=(Et=v.floating)==null?void 0:Et.getBoundingClientRect(),k=h.split("-")[0],S=a>((l==null?void 0:l.right)??0)-((l==null?void 0:l.width)??0)/2,I=p>((l==null?void 0:l.bottom)??0)-((l==null?void 0:l.height)??0)/2,M=((l==null?void 0:l.width)??0)>((E==null?void 0:E.width)??0),D=((l==null?void 0:l.height)??0)>((E==null?void 0:E.height)??0),T=((Tt=M?E:l)==null?void 0:Tt.left)??0,R=((Pt=M?E:l)==null?void 0:Pt.right)??0,H=((Lt=D?E:l)==null?void 0:Lt.top)??0,W=((xt=D?E:l)==null?void 0:xt.bottom)??0;if(A&&(o=!0,!C))return;if(F&&(o=!1),F&&!C){o=!0;return}if(C&&ut(b.relatedTarget)&&v.floating&&He(v.floating,b.relatedTarget))return;if(k==="top"&&p>=((E==null?void 0:E.bottom)??0)-1||k==="bottom"&&p<=((E==null?void 0:E.top)??0)+1||k==="left"&&a>=((E==null?void 0:E.right)??0)-1||k==="right"&&a<=((E==null?void 0:E.left)??0)+1)return L();let G=[];switch(k){case"top":G=[[T,((E==null?void 0:E.top)??0)+1],[T,((l==null?void 0:l.bottom)??0)-1],[R,((l==null?void 0:l.bottom)??0)-1],[R,((E==null?void 0:E.top)??0)+1]];break;case"bottom":G=[[T,((l==null?void 0:l.top)??0)+1],[T,((E==null?void 0:E.bottom)??0)-1],[R,((E==null?void 0:E.bottom)??0)-1],[R,((l==null?void 0:l.top)??0)+1]];break;case"left":G=[[((l==null?void 0:l.right)??0)-1,W],[((l==null?void 0:l.right)??0)-1,H],[((E==null?void 0:E.left)??0)+1,H],[((E==null?void 0:E.left)??0)+1,W]];break;case"right":G=[[((E==null?void 0:E.right)??0)-1,W],[((E==null?void 0:E.right)??0)-1,H],[((l==null?void 0:l.left)??0)+1,H],[((l==null?void 0:l.left)??0)+1,W]];break}function xe([N,$]){switch(k){case"top":{const te=[M?N+u/2:S?N+u*4:N-u*4,$+u+1],ne=[M?N-u/2:S?N+u*4:N-u*4,$+u+1],ce=[[(l==null?void 0:l.left)??0,S||M?((l==null?void 0:l.bottom)??0)-u:(l==null?void 0:l.top)??0],[(l==null?void 0:l.right)??0,S?M?((l==null?void 0:l.bottom)??0)-u:(l==null?void 0:l.top)??0:((l==null?void 0:l.bottom)??0)-u]];return[te,ne,...ce]}case"bottom":{const te=[M?N+u/2:S?N+u*4:N-u*4,$-u],ne=[M?N-u/2:S?N+u*4:N-u*4,$-u],ce=[[(l==null?void 0:l.left)??0,S||M?((l==null?void 0:l.top)??0)+u:(l==null?void 0:l.bottom)??0],[(l==null?void 0:l.right)??0,S?M?((l==null?void 0:l.top)??0)+u:(l==null?void 0:l.bottom)??0:((l==null?void 0:l.top)??0)+u]];return[te,ne,...ce]}case"left":{const te=[N+u+1,D?$+u/2:I?$+u*4:$-u*4],ne=[N+u+1,D?$-u/2:I?$+u*4:$-u*4];return[...[[I||D?((l==null?void 0:l.right)??0)-u:(l==null?void 0:l.left)??0,(l==null?void 0:l.top)??0],[I?D?((l==null?void 0:l.right)??0)-u:(l==null?void 0:l.left)??0:((l==null?void 0:l.right)??0)-u,(l==null?void 0:l.bottom)??0]],te,ne]}case"right":{const te=[N-u,D?$+u/2:I?$+u*4:$-u*4],ne=[N-u,D?$-u/2:I?$+u*4:$-u*4],ce=[[I||D?((l==null?void 0:l.left)??0)+u:(l==null?void 0:l.right)??0,(l==null?void 0:l.top)??0],[I?D?((l==null?void 0:l.left)??0)+u:(l==null?void 0:l.right)??0:((l==null?void 0:l.left)??0)+u,(l==null?void 0:l.bottom)??0]];return[te,ne,...ce]}}}if(ft([P,y],G))return;if(o&&E&&!wn([P,y],E))return L();if(!C&&t){const N=c(b.clientX,b.clientY);if(N!==null&&N<.1)return L()}const me=xe([a,p]);(Ot=e.onPolygonChange)==null||Ot.call(e,me),ft([P,y],me)?!o&&t&&(n=window.setTimeout(L,40)):L()}}}const dt=10;function bn(e){return e==="mouse"||e==="pen"}function En(e,t,n){const{delay:o}=n,i=f.computed(()=>{const a=f.toValue(o);return(typeof a=="number"?a:a.open)??0}),r=f.computed(()=>{const a=f.toValue(o);return(typeof a=="number"?a:a.close)??0});let s,c;const d=()=>{clearTimeout(s),clearTimeout(c)};return f.onScopeDispose(d),{show:a=>{d();const p=a??i.value;p===0?e():s=setTimeout(e,p)},hide:a=>{d();const p=a??r.value;p===0?t():c=setTimeout(t,p)},showDelay:i,hideDelay:r,clearTimeouts:d}}function Tn(e,t={}){const{open:n,setOpen:o,refs:{anchorEl:i,floatingEl:r}}=e,{enabled:s=!0,delay:c=0,restMs:d=0,mouseOnly:a=!1,safePolygon:p=!1}=t,h=f.computed(()=>f.toValue(s)),v=f.computed(()=>f.toValue(d)),u=f.computed(()=>{const T=i.value;return!T||T instanceof HTMLElement?T:T.contextElement??null}),{hide:w,show:m,showDelay:g,clearTimeouts:b}=En(()=>{n.value||o(!0)},()=>{n.value&&o(!1)},{delay:c});let L=null,P;const y=f.computed(()=>g.value===0&&v.value>0);function O(T){if(!h.value||!F(T)||!y.value||!L)return;const R={x:T.clientX,y:T.clientY},H=Math.abs(R.x-L.x),W=Math.abs(R.y-L.y);(H>dt||W>dt)&&(L=R,clearTimeout(P),P=setTimeout(()=>{m(0)},v.value))}function C(T){!h.value||!F(T)||!y.value||(L={x:T.clientX,y:T.clientY},P=setTimeout(()=>{m(0)},v.value))}function A(){clearTimeout(P),L=null}f.watchPostEffect(()=>{const T=u.value;!T||!h.value||!y.value||(T.addEventListener("pointerenter",C),T.addEventListener("pointermove",O),T.addEventListener("pointerleave",A),f.onWatcherCleanup(()=>{T.removeEventListener("pointerenter",C),T.removeEventListener("pointermove",O),T.removeEventListener("pointerleave",A)}))}),f.onScopeDispose(()=>{clearTimeout(P)});function F(T){return!(f.toValue(a)&&!bn(T.pointerType))}function E(T){!h.value||!F(T)||y.value||m()}function l(T){!h.value||!F(T)||(b(),S())}let k=null;function S(){k&&(document.removeEventListener("pointermove",k),k=null)}const I=f.computed(()=>!!f.toValue(p)),M=f.computed(()=>{const T=f.toValue(p);if(typeof T=="object"&&T)return T;if(T===!0)return{}});function D(T){var G;if(!h.value||!F(T))return;const{clientX:R,clientY:H}=T,W=T.relatedTarget;I.value?setTimeout(()=>{var ge;S();const xe=u.value,me=r.value;if(!xe||!me){w();return}k=yn(M.value)({x:R,y:H,placement:e.placement.value,elements:{domReference:xe,floating:me},buffer:((ge=M.value)==null?void 0:ge.buffer)??1,onClose:()=>{S(),w()}}),document.addEventListener("pointermove",k)},0):(G=r.value)!=null&&G.contains(W)||w()}f.watchPostEffect(()=>{const T=u.value;!T||!h.value||(T.addEventListener("pointerenter",E),T.addEventListener("pointerleave",D),f.onWatcherCleanup(()=>{T.removeEventListener("pointerenter",E),T.removeEventListener("pointerleave",D)}))}),f.watchPostEffect(()=>{const T=r.value;!T||!h.value||(T.addEventListener("pointerenter",l),T.addEventListener("pointerleave",D),f.onWatcherCleanup(()=>{T.removeEventListener("pointerenter",l),T.removeEventListener("pointerleave",D)}))}),f.onScopeDispose(()=>{S()})}function Pn(e){return f.getCurrentScope()?(f.onScopeDispose(e),!0):!1}const Ln=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const xn=Object.prototype.toString,On=e=>xn.call(e)==="[object Object]";function We(e){return Array.isArray(e)?e:[e]}function Cn(e,t,n){return f.watch(e,t,{...n,immediate:!0})}const Mn=Ln?window:void 0;function An(e){var t;const n=f.toValue(e);return(t=n==null?void 0:n.$el)!=null?t:n}function _(...e){const t=[],n=()=>{t.forEach(c=>c()),t.length=0},o=(c,d,a,p)=>(c.addEventListener(d,a,p),()=>c.removeEventListener(d,a,p)),i=f.computed(()=>{const c=We(f.toValue(e[0])).filter(d=>d!=null);return c.every(d=>typeof d!="string")?c:void 0}),r=Cn(()=>{var c,d;return[(d=(c=i.value)==null?void 0:c.map(a=>An(a)))!=null?d:[Mn].filter(a=>a!=null),We(f.toValue(i.value?e[1]:e[0])),We(f.unref(i.value?e[2]:e[1])),f.toValue(i.value?e[3]:e[2])]},([c,d,a,p])=>{if(n(),!(c!=null&&c.length)||!(d!=null&&d.length)||!(a!=null&&a.length))return;const h=On(p)?{...p}:p;t.push(...c.flatMap(v=>d.flatMap(u=>a.map(w=>o(v,u,w,h)))))},{flush:"post"}),s=()=>{r(),n()};return Pn(n),s}function Dn(e,t={}){const{open:n,setOpen:o,refs:{floatingEl:i,anchorEl:r}}=e,{enabled:s=!0,requireFocusVisible:c=!0}=t,d=f.computed(()=>r.value?r.value instanceof HTMLElement?r.value:r.value.contextElement:null);let a=!1,p=!0,h;_(window,"blur",()=>{!n.value&&d.value&&d.value===document.activeElement&&(a=!0)}),_(window,"focus",()=>{a=!1}),f.onMounted(()=>{ht()&&pt()&&(_(window,"keydown",()=>{p=!0},{capture:!0}),_(window,"pointerdown",()=>{p=!1},{capture:!0}))});function v(w){if(a){a=!1;return}const m=w.target;if(f.toValue(c)&&m){if(ht()&&pt()&&!w.relatedTarget){if(!p&&!Sn(m))return}else if(!Rn(m))return}o(!0)}function u(w){clearTimeout(h),h=window.setTimeout(()=>{var b;const g=(((b=d.value)==null?void 0:b.ownerDocument)??document).activeElement;!w.relatedTarget&&g===d.value||i.value&&g&&i.value.contains(g)||o(!1)},0)}f.watchPostEffect(()=>{if(!f.toValue(s))return;const w=d.value;!w||!(w instanceof HTMLElement)||(w.addEventListener("focus",v),w.addEventListener("blur",u),f.onWatcherCleanup(()=>{w.removeEventListener("focus",v),w.removeEventListener("blur",u)}))}),f.onScopeDispose(()=>{clearTimeout(h)})}function ht(){return navigator.platform.toUpperCase().indexOf("MAC")>=0}function pt(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Sn(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement}function Rn(e){return e.matches(":focus-visible")}function Vn(e,t={}){const{open:n,setOpen:o,refs:i}=e,{enabled:r=!0,event:s="click",toggle:c=!0,ignoreMouse:d=!1,keyboardHandlers:a=!0}=t;let p,h=!1;const v=f.computed(()=>f.toValue(r)),u=f.computed(()=>i.anchorEl.value instanceof HTMLElement?i.anchorEl.value:null);function w(){n.value?f.toValue(c)&&o(!1):o(!0)}function m(y){p=y.pointerType}function g(y){if(y.button!==0||f.toValue(s)==="click"||mt(p)&&f.toValue(d))return;const O=y.target;!n.value&&O===u.value&&y.preventDefault(),w()}function b(){if(f.toValue(s)==="mousedown"&&p){p=void 0;return}if(mt(p)&&f.toValue(d)){p=void 0;return}w(),p=void 0}function L(y){if(p=void 0,y.defaultPrevented||!f.toValue(a)||gt(y))return;const O=u.value;O&&(y.key===" "&&!vt(O)&&(y.preventDefault(),h=!0),y.key==="Enter"&&w())}function P(y){const O=u.value;O&&(y.defaultPrevented||!f.toValue(a)||gt(y)||vt(O)||y.key===" "&&h&&(h=!1,w()))}f.watchPostEffect(()=>{const y=u.value;!v.value||!y||(y.addEventListener("pointerdown",m),y.addEventListener("mousedown",g),y.addEventListener("click",b),y.addEventListener("keydown",L),y.addEventListener("keyup",P),f.onWatcherCleanup(()=>{y.removeEventListener("pointerdown",m),y.removeEventListener("mousedown",g),y.removeEventListener("click",b),y.removeEventListener("keydown",L),y.removeEventListener("keyup",P)}))})}function mt(e,t){return e===void 0?!1:e==="mouse"}function gt(e){return e.target instanceof HTMLElement&&e.target.tagName==="BUTTON"}function Nn(e){return e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function vt(e){return Nn(e)}function kn(e,t={}){const{enabled:n=!0,escapeKey:o=!0,outsidePress:i=!0,outsidePressEvent:r="pointerdown",anchorPress:s=!1,anchorPressEvent:c="pointerdown",ancestorScroll:d=!1,capture:a}=t,p=f.computed(()=>f.toValue(n)),h=e.refs.floatingEl,v=f.computed(()=>{const y=e.refs.anchorEl.value;return y?y instanceof HTMLElement?y:y.contextElement instanceof HTMLElement?y.contextElement:null:null}),{isComposing:u}=Wn(),{escapeKey:w,outsidePress:m}=Fn(a);let g=!1;const b=y=>{!p.value||!e.open.value||!f.toValue(o)||y.key!=="Escape"||u()||e.setOpen(!1)},L=y=>{if(!p.value||!e.open.value)return;if(r==="click"&&g){g=!1;return}const O=f.toValue(i);if(!O||typeof O=="function"&&!O(y))return;const C=y.target;C&&($e(C)&&h.value&&Hn(y,C)||wt(y,v.value)||wt(y,h.value)||e.setOpen(!1))},P=()=>{p.value&&e.open.value&&f.toValue(s)&&e.setOpen(!1)};f.watchEffect(y=>{if(!p.value||!e.open.value||!f.toValue(d))return;const O=()=>{e.open.value&&e.setOpen(!1)},C=[];v.value&&C.push(...B(v.value).filter($e)),h.value&&C.push(...B(h.value).filter($e));for(const A of C)A.addEventListener("scroll",O,{passive:!0});y(()=>{for(const A of C)A.removeEventListener("scroll",O)})}),_(document,"keydown",b,f.toValue(w)),_(document,r,L,f.toValue(m)),_(v,c,P),_(h,"mousedown",()=>{g=!0},{capture:!0}),_(h,"mouseup",()=>{g=!0},{capture:!0})}function Fn(e){return{escapeKey:typeof e=="boolean"?e:(e==null?void 0:e.escapeKey)??!1,outsidePress:typeof e=="boolean"?e:(e==null?void 0:e.outsidePress)??!0}}function $e(e){return e instanceof Element&&e instanceof HTMLElement}function wt(e,t){return t?"composedPath"in e&&typeof e.composedPath=="function"?e.composedPath().includes(t):t.contains(e.target):!1}function Hn(e,t){const n=t.offsetWidth-t.clientWidth,o=t.offsetHeight-t.clientHeight;return n>0&&e.clientX>t.clientWidth||o>0&&e.clientY>t.clientHeight}function Wn(){const e=f.ref(!1);return _(document,"compositionstart",()=>{e.value=!0}),_(document,"compositionend",()=>{e.value=!1}),{isComposing:()=>e.value}}function $n(e,t,n={}){const{open:o,refs:i}=t;let r;const s=f.ref({x:null,y:null}),c=f.computed(()=>f.toValue(n.axis??"both")),d=f.computed(()=>f.toValue(n.enabled??!0)),a=f.computed(()=>f.toValue(n.x??null)),p=f.computed(()=>f.toValue(n.y??null)),h=(m,g)=>{s.value={x:m,y:g},o.value&&(i.anchorEl.value=In(e.value,c.value,s.value))};f.watchEffect(()=>{const m=a.value,g=p.value;d.value&&m!=null&&g!=null&&h(m,g)});const v=m=>{r=m.pointerType,h(m.clientX,m.clientY)},u=m=>{r=m.pointerType,!o.value&&yt(r,!0)&&h(m.clientX,m.clientY)},w=m=>{o.value&&yt(r,!0)&&h(m.clientX,m.clientY)};return f.watchEffect(()=>{if(a.value!=null||p.value!=null)return;const m=e.value;!m||!d.value||(m.addEventListener("pointerenter",u),m.addEventListener("pointerdown",v),m.addEventListener("pointermove",w),f.onWatcherCleanup(()=>{m==null||m.removeEventListener("pointerenter",u),m==null||m.removeEventListener("pointerdown",v),m==null||m.removeEventListener("pointermove",w)}))}),{coordinates:f.readonly(s),updatePosition:h}}function In(e,t,n){let o=null,i=null;const r=e;return{contextElement:r||void 0,getBoundingClientRect:()=>{const s=(r==null?void 0:r.getBoundingClientRect())??{width:0,height:0,x:0,y:0},c=t==="x"||t==="both",d=t==="y"||t==="both";let a=0,p=0,h=s.x,v=s.y;return r&&(o==null&&n.x!=null&&c&&(o=s.x-n.x),i==null&&n.y!=null&&d&&(i=s.y-n.y),h-=o||0,v-=i||0),c&&n.x!=null?h=n.x:(o=null,a=s.width),d&&n.y!=null?v=n.y:(i=null,p=s.height),t==="both"&&(a=0,p=0),{width:a,height:p,x:h,y:v,top:v,right:h+a,bottom:v+p,left:h}}}}function yt(e,t){if(e===void 0)return!1;const n=e==="mouse";return t?n:n||e==="pen"}function Yn(e){return{name:"arrow",options:e,fn(t){const n=f.toValue(e.element);return n==null?{}:fn({element:n,padding:e.padding}).fn(t)}}}class Ie{constructor(t,n=null,o={},i=!1){oe(this,"id");oe(this,"data");oe(this,"parent");oe(this,"children");Oe(this,de);this.id=o.id??gn(),this.data=t,this.parent=f.shallowRef(n),this.children=f.shallowRef([]),je(this,de,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 Xe(this,de)}get isLeaf(){return this.children.value.length===0}}de=new WeakMap;class bt{constructor(t,n){Oe(this,pe);oe(this,"root");oe(this,"nodeMap");Oe(this,he);je(this,he,(n==null?void 0:n.deleteStrategy)??"recursive"),this.nodeMap=f.shallowReactive(new Map),this.root=new Ie(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 Ie(t,i,o);return this.nodeMap.set(r.id,r),i.addChild(r),r}removeNode(t,n){const o=n??Xe(this,he),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")_e(this,pe,Ke).call(this,i);else{for(const s of i.children.value)s.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 s=r.children.value.length-1;s>=0;s--)i.push(r.children.value[s])}}else{const i=[n];for(;i.length>0;){const r=i.shift();o.push(r);for(const s of r.children.value)i.push(s)}}return o}dispose(){this.nodeMap.clear()}}he=new WeakMap,pe=new WeakSet,Ke=function(t){const n=[...t.children.value];for(const o of n)_e(this,pe,Ke).call(this,o);this.nodeMap.delete(t.id),t.children.value=[]};function Xn(e,t={}){const n=new bt(e,t);return{get nodeMap(){return n.nodeMap},get root(){return n.root},findNodeById:s=>n.findNodeById(s),moveNode:(s,c)=>n.moveNode(s,c),dispose:()=>n.dispose(),addNode:(s,c)=>n.addNode(s,c),removeNode:(s,c)=>n.removeNode(s,c),traverse:(s,c)=>n.traverse(s,c),isTopmost:s=>{const c=n.findNodeById(s);if(!c||!c.data.open.value)return!1;let d=c.parent.value;for(;d;){if(d.data.open.value)return!1;d=d.parent.value}return!0},getAllOpenNodes:()=>{const s=[];for(const c of n.nodeMap.values())c.data.open.value&&s.push(c);return s},forEach:(s,c,d={})=>{const{relationship:a="self-and-children",applyToMatching:p=!0}=d,h=n.findNodeById(s);if(!h)return;const v=[],u=new Set,w=g=>{g&&!u.has(g.id)&&(v.push(g),u.add(g.id))},m=g=>{for(const b of g)w(b)};if(a==="ancestors-only")for(const g of h.getPath())g.id!==h.id&&w(g);else if(a==="siblings-only"){if(h.parent.value)for(const g of h.parent.value.children.value)g.id!==h.id&&w(g)}else if(a==="descendants-only")for(const g of n.traverse("dfs",h))g.id!==h.id&&w(g);else if(a==="children-only")m(h.children.value);else if(a==="self-and-ancestors")m(h.getPath());else if(a==="self-and-children")w(h),m(h.children.value);else if(a==="self-and-descendants")m(n.traverse("dfs",h));else if(a==="self-and-siblings")w(h),h.parent.value&&m(h.parent.value.children.value);else if(a==="self-ancestors-and-children")m(h.getPath()),m(h.children.value);else if(a==="full-branch")m(h.getPath()),m(n.traverse("dfs",h));else if(a==="all-except-branch"){const g=new Set;for(const b of h.getPath())g.add(b.id);for(const b of n.traverse("dfs",h))g.add(b.id);for(const b of n.nodeMap.values())!g.has(b.id)===p&&c(b);return}else{console.warn(`forEach: Unknown relationship "${a}".`);return}if(p)for(const g of v)c(g);else for(const g of n.nodeMap.values())u.has(g.id)||c(g)}}}x.Tree=bt,x.TreeNode=Ie,x.arrow=Yn,x.flip=cn,x.hide=un,x.offset=ln,x.shift=an,x.useArrow=pn,x.useClick=Vn,x.useClientPoint=$n,x.useDismiss=kn,x.useFloating=hn,x.useFloatingTree=Xn,x.useFocus=Dn,x.useHover=Tn,Object.defineProperty(x,Symbol.toStringTag,{value:"Module"})});
|
|
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"})}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "v-float",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Vue 3 port of Floating UI - a library for positioning floating elements",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -18,52 +18,59 @@
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@floating-ui/dom": "^1.
|
|
22
|
-
"@vueuse/core": "^13.
|
|
23
|
-
"vitepress-plugin-demo": "^0.8.
|
|
24
|
-
"vue": "^3.5.
|
|
21
|
+
"@floating-ui/dom": "^1.7.4",
|
|
22
|
+
"@vueuse/core": "^13.7.0",
|
|
23
|
+
"vitepress-plugin-demo": "^0.8.1",
|
|
24
|
+
"vue": "^3.5.20"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@21st-extension/toolbar-vue": "^0.5.14",
|
|
28
28
|
"@21st-extension/vue": "^0.5.14",
|
|
29
29
|
"@biomejs/biome": "1.9.4",
|
|
30
|
+
"@release-it/conventional-changelog": "^10.0.1",
|
|
30
31
|
"@testing-library/vue": "^8.1.0",
|
|
31
|
-
"@tsconfig/node22": "^22.0.
|
|
32
|
+
"@tsconfig/node22": "^22.0.2",
|
|
32
33
|
"@types/jsdom": "^21.1.7",
|
|
33
|
-
"@types/node": "^22.
|
|
34
|
+
"@types/node": "^22.18.0",
|
|
34
35
|
"@unocss/reset": "66.1.0-beta.7",
|
|
35
|
-
"@vitejs/plugin-vue": "^5.2.
|
|
36
|
-
"@vitest/browser": "^3.
|
|
37
|
-
"@vitest/coverage-v8": "^3.
|
|
36
|
+
"@vitejs/plugin-vue": "^5.2.4",
|
|
37
|
+
"@vitest/browser": "^3.2.4",
|
|
38
|
+
"@vitest/coverage-v8": "^3.2.4",
|
|
38
39
|
"@vitest/ui": "3.0.8",
|
|
39
40
|
"@vue/test-utils": "^2.4.6",
|
|
40
41
|
"@vue/tsconfig": "^0.7.0",
|
|
41
|
-
"jsdom": "^26.
|
|
42
|
+
"jsdom": "^26.1.0",
|
|
42
43
|
"lucide-vue-next": "^0.513.0",
|
|
43
44
|
"npm-run-all2": "^7.0.2",
|
|
44
|
-
"playwright": "^1.
|
|
45
|
-
"prettier": "^3.
|
|
45
|
+
"playwright": "^1.55.0",
|
|
46
|
+
"prettier": "^3.6.2",
|
|
47
|
+
"release-it": "^19.0.4",
|
|
48
|
+
"release-it-pnpm": "^4.6.6",
|
|
46
49
|
"typescript": "~5.7.3",
|
|
47
50
|
"unocss": "66.1.0-beta.7",
|
|
48
|
-
"vite": "^6.
|
|
49
|
-
"vite-plugin-dts": "^4.5.
|
|
50
|
-
"vite-plugin-vue-devtools": "^7.7.
|
|
51
|
-
"vitepress": "^1.6.
|
|
52
|
-
"vitest": "^3.
|
|
51
|
+
"vite": "^6.3.5",
|
|
52
|
+
"vite-plugin-dts": "^4.5.4",
|
|
53
|
+
"vite-plugin-vue-devtools": "^7.7.7",
|
|
54
|
+
"vitepress": "^1.6.4",
|
|
55
|
+
"vitest": "^3.2.4",
|
|
53
56
|
"vitest-browser-vue": "^0.2.0",
|
|
54
|
-
"vue-tsc": "^2.2.
|
|
57
|
+
"vue-tsc": "^2.2.12"
|
|
55
58
|
},
|
|
56
59
|
"scripts": {
|
|
57
60
|
"dev": "vite",
|
|
58
61
|
"build": "run-p type-check \"build-only {@}\" --",
|
|
59
62
|
"preview": "vite preview",
|
|
60
|
-
"test:unit": "vitest --no-watch",
|
|
61
63
|
"build-only": "vite build",
|
|
62
64
|
"type-check": "vue-tsc --build tsconfig.build.json",
|
|
63
65
|
"lint": "biome check --apply --write",
|
|
64
|
-
"test
|
|
66
|
+
"test": "vitest --workspace=vitest.workspace.ts",
|
|
65
67
|
"docs:dev": "vitepress dev docs",
|
|
66
68
|
"docs:build": "vitepress build docs",
|
|
67
|
-
"docs:preview": "vitepress preview docs"
|
|
69
|
+
"docs:preview": "vitepress preview docs",
|
|
70
|
+
"release": "release-it",
|
|
71
|
+
"release:patch": "release-it patch",
|
|
72
|
+
"release:minor": "release-it minor",
|
|
73
|
+
"release:major": "release-it major",
|
|
74
|
+
"release:dry": "release-it --dry-run"
|
|
68
75
|
}
|
|
69
76
|
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { MaybeRefOrGetter } from 'vue';
|
|
2
|
-
import { FloatingContext } from '../use-floating';
|
|
3
|
-
export type DismissReason = "escape-key" | "outside-press" | "anchor-press" | "ancestor-scroll";
|
|
4
|
-
export interface UseDismissProps {
|
|
5
|
-
/**
|
|
6
|
-
* Whether dismiss event listeners are enabled.
|
|
7
|
-
* @default true
|
|
8
|
-
*/
|
|
9
|
-
enabled?: MaybeRefOrGetter<boolean>;
|
|
10
|
-
/**
|
|
11
|
-
* Whether to dismiss when the escape key is pressed.
|
|
12
|
-
* @default true
|
|
13
|
-
*/
|
|
14
|
-
escapeKey?: MaybeRefOrGetter<boolean>;
|
|
15
|
-
/**
|
|
16
|
-
* Whether to dismiss when the anchor element is pressed.
|
|
17
|
-
* @default false
|
|
18
|
-
*/
|
|
19
|
-
anchorPress?: MaybeRefOrGetter<boolean>;
|
|
20
|
-
/**
|
|
21
|
-
* Whether to dismiss when clicking outside the floating and anchor element.
|
|
22
|
-
* Can be a function to allow custom logic.
|
|
23
|
-
* @default true
|
|
24
|
-
*/
|
|
25
|
-
outsidePress?: MaybeRefOrGetter<boolean | ((event: MouseEvent) => boolean)>;
|
|
26
|
-
/**
|
|
27
|
-
* Whether to dismiss when a scrollable ancestor of the floating element is scrolled.
|
|
28
|
-
* @default false
|
|
29
|
-
*/
|
|
30
|
-
ancestorScroll?: MaybeRefOrGetter<boolean>;
|
|
31
|
-
/**
|
|
32
|
-
* Whether to use capture phase for document event listeners.
|
|
33
|
-
* @default { escapeKey: false, outsidePress: true }
|
|
34
|
-
*/
|
|
35
|
-
capture?: boolean | {
|
|
36
|
-
escapeKey?: boolean;
|
|
37
|
-
outsidePress?: boolean;
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* The event name to use for anchor press.
|
|
41
|
-
* @default 'pointerdown'
|
|
42
|
-
*/
|
|
43
|
-
anchorPressEvent?: "pointerdown" | "mousedown" | "click";
|
|
44
|
-
/**
|
|
45
|
-
* The event name to use for outside press.
|
|
46
|
-
* @default 'pointerdown'
|
|
47
|
-
*/
|
|
48
|
-
outsidePressEvent?: "pointerdown" | "mousedown" | "click";
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Closes the floating element when a dismissal is requested.
|
|
52
|
-
*
|
|
53
|
-
* This composable provides event handlers for dismissal behaviors including
|
|
54
|
-
* outside clicks, escape key press, anchor element press, and ancestor scroll.
|
|
55
|
-
*
|
|
56
|
-
* @param context - The floating context with open state and change handler.
|
|
57
|
-
* @param options - Configuration options for dismissal behavior.
|
|
58
|
-
*
|
|
59
|
-
* @example
|
|
60
|
-
* ```ts
|
|
61
|
-
* useDismiss(context, {
|
|
62
|
-
* escapeKey: true,
|
|
63
|
-
* outsidePress: (event) => !event.target.closest('.toast'),
|
|
64
|
-
* })
|
|
65
|
-
* ```
|
|
66
|
-
*/
|
|
67
|
-
export declare function useDismiss(context: FloatingContext, options?: UseDismissProps): void;
|
|
68
|
-
//# sourceMappingURL=use-dismiss.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-dismiss.d.ts","sourceRoot":"","sources":["../../../src/composables/interactions/use-dismiss.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,gBAAgB,EAAuD,MAAM,KAAK,CAAA;AAChG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAMtD,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,eAAe,GAAG,cAAc,GAAG,iBAAiB,CAAA;AAE/F,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,OAAO,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;IAEnC;;;OAGG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;IAErC;;;OAGG;IACH,WAAW,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;IAEvC;;;;OAIG;IACH,YAAY,CAAC,EAAE,gBAAgB,CAAC,OAAO,GAAG,CAAC,CAAC,KAAK,EAAE,UAAU,KAAK,OAAO,CAAC,CAAC,CAAA;IAE3E;;;OAGG;IACH,cAAc,CAAC,EAAE,gBAAgB,CAAC,OAAO,CAAC,CAAA;IAE1C;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG;QAAE,SAAS,CAAC,EAAE,OAAO,CAAC;QAAC,YAAY,CAAC,EAAE,OAAO,CAAA;KAAE,CAAA;IAEnE;;;OAGG;IACH,gBAAgB,CAAC,EAAE,aAAa,GAAG,WAAW,GAAG,OAAO,CAAA;IAExD;;;OAGG;IACH,iBAAiB,CAAC,EAAE,aAAa,GAAG,WAAW,GAAG,OAAO,CAAA;CAC1D;AAMD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,eAAe,EAAE,OAAO,GAAE,eAAoB,GAAG,IAAI,CAqIxF"}
|