import{ar as L,as as B,A as N,r as S,at as X,d as I,au as H,aj as K,z as R,al as G,am as _,an as z,av as J,aq as U,s as Q,ao as Z,aw as ee,y as te,ax as ne,x as re}from"./CGQLQ9ei.js";function he(e={}){const{inheritAttrs:t=!0}=e,n=L(),r=I({setup(o,{slots:l}){return()=>{n.value=l.default}}}),u=I({inheritAttrs:t,setup(o,{attrs:l,slots:a}){return()=>{var v;n.value;const c=(v=n.value)==null?void 0:v.call(n,{...oe(l),$slots:a});return t&&(c==null?void 0:c.length)===1?c[0]:c}}});return B({define:r,reuse:u},[r,u])}function oe(e){const t={};for(const n in e)t[H(n)]=e[n];return t}function M(e){var t;const n=_(e);return(t=n==null?void 0:n.$el)!=null?t:n}const E=U?window:void 0,j=U?window.navigator:void 0;function T(...e){let t,n,r,u;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,r,u]=e,t=E):[t,n,r,u]=e,!t)return K;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const o=[],l=()=>{o.forEach(p=>p()),o.length=0},a=(p,i,d,w)=>(p.addEventListener(i,d,w),()=>p.removeEventListener(i,d,w)),v=R(()=>[M(t),_(u)],([p,i])=>{if(l(),!p)return;const d=G(i)?{...i}:i;o.push(...n.flatMap(w=>r.map(g=>a(p,w,g,d))))},{immediate:!0,flush:"post"}),c=()=>{v(),l()};return z(c),c}function ae(){const e=S(!1),t=te();return t&&Q(()=>{e.value=!0},t),e}function $(e){const t=ae();return N(()=>(t.value,!!e()))}function se(e,t,n={}){const{window:r=E,...u}=n;let o;const l=$(()=>r&&"MutationObserver"in r),a=()=>{o&&(o.disconnect(),o=void 0)},v=N(()=>{const d=_(e),w=(Array.isArray(d)?d:[d]).map(M).filter(Z);return new Set(w)}),c=R(()=>v.value,d=>{a(),l.value&&d.size&&(o=new MutationObserver(t),d.forEach(w=>o.observe(w,u)))},{immediate:!0,flush:"post"}),p=()=>o==null?void 0:o.takeRecords(),i=()=>{a(),c()};return z(i),{isSupported:l,stop:i,takeRecords:p}}function V(e,t={}){const{controls:n=!1,navigator:r=j}=t,u=$(()=>r&&"permissions"in r);let o;const l=typeof e=="string"?{name:e}:e,a=S(),v=()=>{o&&(a.value=o.state)},c=ee(async()=>{if(u.value){if(!o)try{o=await r.permissions.query(l),T(o,"change",v),v()}catch{a.value="prompt"}return o}});return c(),n?{state:a,isSupported:u,query:c}:a}function ge(e={}){const{navigator:t=j,read:n=!1,source:r,copiedDuring:u=1500,legacy:o=!1}=e,l=$(()=>t&&"clipboard"in t),a=V("clipboard-read"),v=V("clipboard-write"),c=N(()=>l.value||o),p=S(""),i=S(!1),d=X(()=>i.value=!1,u);function w(){l.value&&y(a.value)?t.clipboard.readText().then(m=>{p.value=m}):p.value=s()}c.value&&n&&T(["copy","cut"],w);async function g(m=_(r)){c.value&&m!=null&&(l.value&&y(v.value)?await t.clipboard.writeText(m):b(m),p.value=m,i.value=!0,d.start())}function b(m){const h=document.createElement("textarea");h.value=m??"",h.style.position="absolute",h.style.opacity="0",document.body.appendChild(h),h.select(),document.execCommand("copy"),h.remove()}function s(){var m,h,O;return(O=(h=(m=document==null?void 0:document.getSelection)==null?void 0:m.call(document))==null?void 0:h.toString())!=null?O:""}function y(m){return m==="granted"||m==="prompt"}return{isSupported:c,text:p,copied:i,copy:g}}const F=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},D="__vueuse_ssr_handlers__",ie=ue();function ue(){return D in F||(F[D]=F[D]||{}),F[D]}function le(e,t){return ie[e]||t}function ce(e){return e==null?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":typeof e=="boolean"?"boolean":typeof e=="string"?"string":typeof e=="object"?"object":Number.isNaN(e)?"any":"number"}const fe={boolean:{read:e=>e==="true",write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},k="vueuse-storage";function de(e,t,n,r={}){var u;const{flush:o="pre",deep:l=!0,listenToStorageChanges:a=!0,writeDefaults:v=!0,mergeDefaults:c=!1,shallow:p,window:i=E,eventFilter:d,onError:w=f=>{console.error(f)},initOnMounted:g}=r,b=(p?L:S)(typeof t=="function"?t():t);if(!n)try{n=le("getDefaultStorage",()=>{var f;return(f=E)==null?void 0:f.localStorage})()}catch(f){w(f)}if(!n)return b;const s=_(t),y=ce(s),m=(u=r.serializer)!=null?u:fe[y],{pause:h,resume:O}=ne(b,()=>P(b.value),{flush:o,deep:l,eventFilter:d});i&&a&&J(()=>{T(i,"storage",C),T(i,k,q),g&&C()}),g||C();function W(f,x){i&&i.dispatchEvent(new CustomEvent(k,{detail:{key:e,oldValue:f,newValue:x,storageArea:n}}))}function P(f){try{const x=n.getItem(e);if(f==null)W(x,null),n.removeItem(e);else{const A=m.write(f);x!==A&&(n.setItem(e,A),W(x,A))}}catch(x){w(x)}}function Y(f){const x=f?f.newValue:n.getItem(e);if(x==null)return v&&s!=null&&n.setItem(e,m.write(s)),s;if(!f&&c){const A=m.read(x);return typeof c=="function"?c(A,s):y==="object"&&!Array.isArray(A)?{...s,...A}:A}else return typeof x!="string"?x:m.read(x)}function C(f){if(!(f&&f.storageArea!==n)){if(f&&f.key==null){b.value=s;return}if(!(f&&f.key!==e)){h();try{(f==null?void 0:f.newValue)!==m.write(b.value)&&(b.value=Y(f))}catch(x){w(x)}finally{f?re(O):O()}}}}function q(f){C(f.detail)}return b}function pe(e,t,n={}){const{window:r=E,...u}=n;let o;const l=$(()=>r&&"ResizeObserver"in r),a=()=>{o&&(o.disconnect(),o=void 0)},v=N(()=>Array.isArray(e)?e.map(i=>M(i)):[M(e)]),c=R(v,i=>{if(a(),l.value&&r){o=new ResizeObserver(t);for(const d of i)d&&o.observe(d,u)}},{immediate:!0,flush:"post"}),p=()=>{a(),c()};return z(p),{isSupported:l,stop:p}}function be(e,t={}){const{reset:n=!0,windowResize:r=!0,windowScroll:u=!0,immediate:o=!0}=t,l=S(0),a=S(0),v=S(0),c=S(0),p=S(0),i=S(0),d=S(0),w=S(0);function g(){const b=M(e);if(!b){n&&(l.value=0,a.value=0,v.value=0,c.value=0,p.value=0,i.value=0,d.value=0,w.value=0);return}const s=b.getBoundingClientRect();l.value=s.height,a.value=s.bottom,v.value=s.left,c.value=s.right,p.value=s.top,i.value=s.width,d.value=s.x,w.value=s.y}return pe(e,g),R(()=>M(e),b=>!b&&g()),se(e,g,{attributeFilter:["style","class"]}),u&&T("scroll",g,{capture:!0,passive:!0}),r&&T("resize",g,{passive:!0}),J(()=>{o&&g()}),{height:l,bottom:a,left:v,right:c,top:p,width:i,x:d,y:w,update:g}}function Se(e,t,n={}){const{window:r=E}=n;return de(e,t,r==null?void 0:r.localStorage,n)}function xe(e={},t={}){const{navigator:n=j}=t,r=n,u=$(()=>r&&"canShare"in r);return{isSupported:u,share:async(l={})=>{if(u.value){const a={..._(e),..._(l)};let v=!0;if(a.files&&r.canShare&&(v=r.canShare({files:a.files})),v)return r.share(a)}}}}const me=[{max:6e4,value:1e3,name:"second"},{max:276e4,value:6e4,name:"minute"},{max:72e6,value:36e5,name:"hour"},{max:5184e5,value:864e5,name:"day"},{max:24192e5,value:6048e5,name:"week"},{max:28512e6,value:2592e6,name:"month"},{max:Number.POSITIVE_INFINITY,value:31536e6,name:"year"}],ve={justNow:"just now",past:e=>e.match(/\d/)?`${e} ago`:e,future:e=>e.match(/\d/)?`in ${e}`:e,month:(e,t)=>e===1?t?"last month":"next month":`${e} month${e>1?"s":""}`,year:(e,t)=>e===1?t?"last year":"next year":`${e} year${e>1?"s":""}`,day:(e,t)=>e===1?t?"yesterday":"tomorrow":`${e} day${e>1?"s":""}`,week:(e,t)=>e===1?t?"last week":"next week":`${e} week${e>1?"s":""}`,hour:e=>`${e} hour${e>1?"s":""}`,minute:e=>`${e} minute${e>1?"s":""}`,second:e=>`${e} second${e>1?"s":""}`,invalid:""};function we(e){return e.toISOString().slice(0,10)}function Ae(e,t={},n=Date.now()){var r;const{max:u,messages:o=ve,fullDateFormatter:l=we,units:a=me,showSecond:v=!1,rounding:c="round"}=t,p=typeof c=="number"?s=>+s.toFixed(c):Math[c],i=+n-+e,d=Math.abs(i);function w(s,y){return p(Math.abs(s)/y.value)}function g(s,y){const m=w(s,y),h=s>0,O=b(y.name,m,h);return b(h?"past":"future",O,h)}function b(s,y,m){const h=o[s];return typeof h=="function"?h(y,m):h.replace("{0}",y.toString())}if(d<6e4&&!v)return o.justNow;if(typeof u=="number"&&d>u)return l(new Date(e));if(typeof u=="string"){const s=(r=a.find(y=>y.name===u))==null?void 0:r.max;if(s&&d>s)return l(new Date(e))}for(const[s,y]of a.entries()){if(w(i,y)<=0&&a[s-1])return g(i,a[s-1]);if(d<y.max)return g(i,y)}return o.invalid}function Oe(e={}){const{window:t=E,behavior:n="auto"}=e;if(!t)return{x:S(0),y:S(0)};const r=S(t.scrollX),u=S(t.scrollY),o=N({get(){return r.value},set(a){scrollTo({left:a,behavior:n})}}),l=N({get(){return u.value},set(a){scrollTo({top:a,behavior:n})}});return T(t,"scroll",()=>{r.value=t.scrollX,u.value=t.scrollY},{capture:!1,passive:!0}),{x:o,y:l}}export{fe as S,xe as a,be as b,he as c,Se as d,Oe as e,Ae as f,ge as u};