import{a7 as g}from"./vue.esm-bundler.js?ver=1.5.2";import{ay as x,af as C}from"./index.js?ver=1.5.2";const s=new Map;if(C){let e;document.addEventListener("mousedown",t=>e=t),document.addEventListener("mouseup",t=>{if(e){for(const n of s.values())for(const{documentHandler:o}of n)o(t,e);e=void 0}})}function i(e,t){let n=[];return g(t.arg)?n=t.arg:x(t.arg)&&n.push(t.arg),function(o,a){const r=t.instance.popperRef,c=o.target,d=a==null?void 0:a.target,l=!t||!t.instance,f=!c||!d,p=e.contains(c)||e.contains(d),m=e===c,h=n.length&&n.some(u=>u==null?void 0:u.contains(c))||n.length&&n.includes(d),v=r&&(r.contains(c)||r.contains(d));l||f||p||m||h||v||t.value(o,a)}}const y={beforeMount(e,t){s.has(e)||s.set(e,[]),s.get(e).push({documentHandler:i(e,t),bindingFn:t.value})},updated(e,t){s.has(e)||s.set(e,[]);const n=s.get(e),o=n.findIndex(r=>r.bindingFn===t.oldValue),a={documentHandler:i(e,t),bindingFn:t.value};o>=0?n.splice(o,1,a):n.push(a)},unmounted(e){s.delete(e)}};export{y as C};
