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