import{i as v,u as y,a as _,n as c,t as h}from"./index-c5cfdf94.mjs";import{k as p,u as w,m as T}from"./entry-d195bacb.mjs";function x(n){var e;const t=w(n);return(e=t==null?void 0:t.$el)!=null?e:t}const E=v?window:void 0,L=v?window.navigator:void 0;function S(...n){let e,t,s,a;if(_(n[0])?([t,s,a]=n,e=E):[e,t,s,a]=n,!e)return c;let l=c;const u=T(()=>x(e),o=>{l(),o&&(o.addEventListener(t,s,a),l=()=>{o.removeEventListener(t,s,a),l=c})},{immediate:!0,flush:"post"}),r=()=>{u(),l()};return h(r),r}function W(n={}){const{navigator:e=L,read:t=!1,source:s,copiedDuring:a=1500}=n,l=["copy","cut"],u=Boolean(e&&"clipboard"in e),r=p(""),o=p(!1),m=y(()=>o.value=!1,a);function b(){e.clipboard.readText().then(i=>{r.value=i})}if(u&&t)for(const i of l)S(i,b);async function g(i=w(s)){u&&i!=null&&(await e.clipboard.writeText(i),r.value=i,o.value=!0,m.start())}return{isSupported:u,text:r,copied:o,copy:g}}const f=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},d="__vueuse_ssr_handlers__";f[d]=f[d]||{};f[d];export{W as u};
