import{S as y,R as g,z as M,T as P,x as v}from"./request-14d7fed5.js";import{aI as I,c8 as m,bs as A,bY as L,bt as x,bj as _,aO as D,am as F,aQ as T}from"./index-25eb6331.js";var w=1,H=2;function G(n,e,t,r){var s=t.length,o=s,u=!r;if(n==null)return!o;for(n=Object(n);s--;){var i=t[s];if(u&&i[2]?i[1]!==n[i[0]]:!(i[0]in n))return!1}for(;++s<o;){i=t[s];var f=i[0],c=n[f],d=i[1];if(u&&i[2]){if(c===void 0&&!(f in n))return!1}else{var l=new y;if(r)var p=r(c,d,f,n,e,l);if(!(p===void 0?g(d,c,w|H,r,l):p))return!1}}return!0}function C(n){return n===n&&!I(n)}function S(n){for(var e=M(n),t=e.length;t--;){var r=e[t],s=n[r];e[t]=[r,s,C(s)]}return e}function R(n,e){return function(t){return t==null?!1:t[n]===e&&(e!==void 0||n in Object(t))}}function B(n){var e=S(n);return e.length==1&&e[0][2]?R(e[0][0],e[0][1]):function(t){return t===n||G(t,n,e)}}var U=1,$=2;function K(n,e){return m(n)&&C(e)?R(A(n),e):function(t){var r=L(t,n);return r===void 0&&r===e?P(t,n):g(e,r,U|$)}}function N(n){return function(e){return e==null?void 0:e[n]}}function q(n){return function(e){return x(e,n)}}function Q(n){return m(n)?N(A(n)):q(n)}function W(n){return typeof n=="function"?n:n==null?v:typeof n=="object"?_(n)?K(n[0],n[1]):B(n):Q(n)}const a=new Map;if(D){let n;document.addEventListener("mousedown",e=>n=e),document.addEventListener("mouseup",e=>{if(n){for(const t of a.values())for(const{documentHandler:r}of t)r(e,n);n=void 0}})}function E(n,e){let t=[];return F(e.arg)?t=e.arg:T(e.arg)&&t.push(e.arg),function(r,s){const o=e.instance.popperRef,u=r.target,i=s==null?void 0:s.target,f=!e||!e.instance,c=!u||!i,d=n.contains(u)||n.contains(i),l=n===u,p=t.length&&t.some(h=>h==null?void 0:h.contains(u))||t.length&&t.includes(i),O=o&&(o.contains(u)||o.contains(i));f||c||d||l||p||O||e.value(r,s)}}const X={beforeMount(n,e){a.has(n)||a.set(n,[]),a.get(n).push({documentHandler:E(n,e),bindingFn:e.value})},updated(n,e){a.has(n)||a.set(n,[]);const t=a.get(n),r=t.findIndex(o=>o.bindingFn===e.oldValue),s={documentHandler:E(n,e),bindingFn:e.value};r>=0?t.splice(r,1,s):t.push(s)},unmounted(n){a.delete(n)}};export{X as C,W as b};
