import{d as g,_ as A,p as D,q as h,c as C}from"./vue-CSzJdJby.js";import{a as O,b as S,t as d,c as W,d as k,i as y,n as U,e as b,f as M}from"./index-C25aB_MX.js";function T(e){var n;const t=d(e);return(n=t==null?void 0:t.$el)!=null?n:t}const _=M?window:void 0;function I(...e){let n,t,o,l;if(typeof e[0]=="string"||Array.isArray(e[0])?([t,o,l]=e,n=_):[n,t,o,l]=e,!n)return U;Array.isArray(t)||(t=[t]),Array.isArray(o)||(o=[o]);const a=[],f=()=>{a.forEach(u=>u()),a.length=0},r=(u,c,v,p)=>(u.addEventListener(c,v,p),()=>u.removeEventListener(c,v,p)),i=h(()=>[T(n),d(l)],([u,c])=>{if(f(),!u)return;const v=b(c)?{...c}:c;a.push(...t.flatMap(p=>o.map(L=>r(u,p,L,v))))},{immediate:!0,flush:"post"}),s=()=>{i(),f()};return k(s),s}const j=g({name:"UseClipboard",props:["source","read","navigator","copiedDuring","legacy"],setup(e,{slots:n}){const t=A(O(e));return()=>{var o;return(o=n.default)==null?void 0:o.call(n,t)}}});function m(e){return typeof Window<"u"&&e instanceof Window?e.document.documentElement:typeof Document<"u"&&e instanceof Document?e.documentElement:e}function E(e){const n=window.getComputedStyle(e);if(n.overflowX==="scroll"||n.overflowY==="scroll"||n.overflowX==="auto"&&e.clientWidth<e.scrollWidth||n.overflowY==="auto"&&e.clientHeight<e.scrollHeight)return!0;{const t=e.parentNode;return!t||t.tagName==="BODY"?!1:E(t)}}function Y(e){const n=e||window.event,t=n.target;return E(t)?!1:n.touches.length>1?!0:(n.preventDefault&&n.preventDefault(),!1)}const w=new WeakMap;function x(e,n=!1){const t=D(n);let o=null,l="";h(W(e),r=>{const i=m(d(r));if(i){const s=i;if(w.get(s)||w.set(s,s.style.overflow),s.style.overflow!=="hidden"&&(l=s.style.overflow),s.style.overflow==="hidden")return t.value=!0;if(t.value)return s.style.overflow="hidden"}},{immediate:!0});const a=()=>{const r=m(d(e));!r||t.value||(y&&(o=I(r,"touchmove",i=>{Y(i)},{passive:!1})),r.style.overflow="hidden",t.value=!0)},f=()=>{const r=m(d(e));!r||!t.value||(y&&(o==null||o()),r.style.overflow=l,w.delete(r),t.value=!1)};return k(f),C({get(){return t.value},set(r){r?a():f()}})}function H(){let e=!1;const n=D(!1);return(t,o)=>{if(n.value=o.value,e)return;e=!0;const l=x(t,o.value);h(n,a=>l.value=a)}}H();const q=g({name:"UseTimeAgo",props:["time","updateInterval","max","fullDateFormatter","messages","showSecond"],setup(e,{slots:n}){const t=A(S(()=>e.time,{...e,controls:!0}));return()=>{if(n.default)return n.default(t)}}});export{q as U,j as a};
