@vueuse/core
Version:
Collection of essential Vue Composition Utilities
1 lines • 111 kB
JavaScript
(function(E,g,n){"use strict";function Ce(e,t,o){let l;n.isRef(o)?l={evaluating:o}:l=o||{};const{lazy:r=!1,flush:s="pre",evaluating:i=void 0,shallow:a=!0,onError:u=g.noop}=l,f=n.shallowRef(!r),c=a?n.shallowRef(t):n.ref(t);let d=0;return n.watchEffect(async h=>{if(!f.value)return;d++;const m=d;let v=!1;i&&Promise.resolve().then(()=>{i.value=!0});try{const S=await e(p=>{h(()=>{i&&(i.value=!1),v||p()})});m===d&&(c.value=S)}catch(S){u(S)}finally{i&&m===d&&(i.value=!1),v=!0}},{flush:s}),r?n.computed(()=>(f.value=!0,c.value)):c}function kt(e,t,o,l){let r=n.inject(e);return o&&(r=n.inject(e,o)),l&&(r=n.inject(e,o,l)),typeof t=="function"?n.computed(s=>t(r,s)):n.computed({get:s=>t.get(r,s),set:t.set})}function _t(e={}){const{inheritAttrs:t=!0}=e,o=n.shallowRef(),l=n.defineComponent({setup(s,{slots:i}){return()=>{o.value=i.default}}}),r=n.defineComponent({inheritAttrs:t,props:e.props,setup(s,{attrs:i,slots:a}){return()=>{var u;if(!o.value&&process.env.NODE_ENV!=="production")throw new Error("[VueUse] Failed to find the definition of reusable template");const f=(u=o.value)==null?void 0:u.call(o,{...e.props==null?Vt(i):s,$slots:a});return t&&f?.length===1?f[0]:f}}});return g.makeDestructurable({define:l,reuse:r},[l,r])}function Vt(e){const t={};for(const o in e)t[g.camelize(o)]=e[o];return t}function Ft(e={}){let t=0;const o=n.ref([]);function l(...i){const a=n.shallowReactive({key:t++,args:i,promise:void 0,resolve:()=>{},reject:()=>{},isResolving:!1,options:e});return o.value.push(a),a.promise=new Promise((u,f)=>{a.resolve=c=>(a.isResolving=!0,u(c)),a.reject=f}).finally(()=>{a.promise=void 0;const u=o.value.indexOf(a);u!==-1&&o.value.splice(u,1)}),a.promise}function r(...i){return e.singleton&&o.value.length>0?o.value[0].promise:l(...i)}const s=n.defineComponent((i,{slots:a})=>{const u=()=>o.value.map(f=>{var c;return n.h(n.Fragment,{key:f.key},(c=a.default)==null?void 0:c.call(a,f))});return e.transition?()=>n.h(n.TransitionGroup,e.transition,u):u});return s.start=r,s}function Pt(e){return function(...t){return e.apply(this,t.map(o=>n.toValue(o)))}}const M=g.isClient?window:void 0,j=g.isClient?window.document:void 0,z=g.isClient?window.navigator:void 0,Ct=g.isClient?window.location:void 0;function x(e){var t;const o=n.toValue(e);return(t=o?.$el)!=null?t:o}function O(...e){const t=[],o=()=>{t.forEach(a=>a()),t.length=0},l=(a,u,f,c)=>(a.addEventListener(u,f,c),()=>a.removeEventListener(u,f,c)),r=n.computed(()=>{const a=g.toArray(n.toValue(e[0])).filter(u=>u!=null);return a.every(u=>typeof u!="string")?a:void 0}),s=g.watchImmediate(()=>{var a,u;return[(u=(a=r.value)==null?void 0:a.map(f=>x(f)))!=null?u:[M].filter(f=>f!=null),g.toArray(n.toValue(r.value?e[1]:e[0])),g.toArray(n.unref(r.value?e[2]:e[1])),n.toValue(r.value?e[3]:e[2])]},([a,u,f,c])=>{if(o(),!a?.length||!u?.length||!f?.length)return;const d=g.isObject(c)?{...c}:c;t.push(...a.flatMap(h=>u.flatMap(m=>f.map(v=>l(h,m,v,d)))))},{flush:"post"}),i=()=>{s(),o()};return g.tryOnScopeDispose(o),i}let De=!1;function Dt(e,t,o={}){const{window:l=M,ignore:r=[],capture:s=!0,detectIframe:i=!1,controls:a=!1}=o;if(!l)return a?{stop:g.noop,cancel:g.noop,trigger:g.noop}:g.noop;if(g.isIOS&&!De){De=!0;const p={passive:!0};Array.from(l.document.body.children).forEach(w=>w.addEventListener("click",g.noop,p)),l.document.documentElement.addEventListener("click",g.noop,p)}let u=!0;const f=p=>n.toValue(r).some(w=>{if(typeof w=="string")return Array.from(l.document.querySelectorAll(w)).some(y=>y===p.target||p.composedPath().includes(y));{const y=x(w);return y&&(p.target===y||p.composedPath().includes(y))}});function c(p){const w=n.toValue(p);return w&&w.$.subTree.shapeFlag===16}function d(p,w){const y=n.toValue(p),b=y.$.subTree&&y.$.subTree.children;return b==null||!Array.isArray(b)?!1:b.some(T=>T.el===w.target||w.composedPath().includes(T.el))}const h=p=>{const w=x(e);if(p.target!=null&&!(!(w instanceof Element)&&c(e)&&d(e,p))&&!(!w||w===p.target||p.composedPath().includes(w))){if("detail"in p&&p.detail===0&&(u=!f(p)),!u){u=!0;return}t(p)}};let m=!1;const v=[O(l,"click",p=>{m||(m=!0,setTimeout(()=>{m=!1},0),h(p))},{passive:!0,capture:s}),O(l,"pointerdown",p=>{const w=x(e);u=!f(p)&&!!(w&&!p.composedPath().includes(w))},{passive:!0}),i&&O(l,"blur",p=>{setTimeout(()=>{var w;const y=x(e);((w=l.document.activeElement)==null?void 0:w.tagName)==="IFRAME"&&!y?.contains(l.document.activeElement)&&t(p)},0)},{passive:!0})].filter(Boolean),S=()=>v.forEach(p=>p());return a?{stop:S,cancel:()=>{u=!1},trigger:p=>{u=!0,h(p),u=!1}}:S}function Ae(){const e=n.shallowRef(!1),t=n.getCurrentInstance();return t&&n.onMounted(()=>{e.value=!0},t),e}function W(e){const t=Ae();return n.computed(()=>(t.value,!!e()))}function Q(e,t,o={}){const{window:l=M,...r}=o;let s;const i=W(()=>l&&"MutationObserver"in l),a=()=>{s&&(s.disconnect(),s=void 0)},u=n.computed(()=>{const h=n.toValue(e),m=g.toArray(h).map(x).filter(g.notNullish);return new Set(m)}),f=n.watch(()=>u.value,h=>{a(),i.value&&h.size&&(s=new MutationObserver(t),h.forEach(m=>s.observe(m,r)))},{immediate:!0,flush:"post"}),c=()=>s?.takeRecords(),d=()=>{f(),a()};return g.tryOnScopeDispose(d),{isSupported:i,stop:d,takeRecords:c}}function we(e,t,o={}){const{window:l=M,document:r=l?.document,flush:s="sync"}=o;if(!l||!r)return g.noop;let i;const a=c=>{i?.(),i=c},u=n.watchEffect(()=>{const c=x(e);if(c){const{stop:d}=Q(r,h=>{h.map(v=>[...v.removedNodes]).flat().some(v=>v===c||v.contains(c))&&t(h)},{window:l,childList:!0,subtree:!0});a(d)}},{flush:s}),f=()=>{u(),a()};return g.tryOnScopeDispose(f),f}function At(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function ie(...e){let t,o,l={};e.length===3?(t=e[0],o=e[1],l=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,o=e[0],l=e[1]):(t=e[0],o=e[1]):(t=!0,o=e[0]);const{target:r=M,eventName:s="keydown",passive:i=!1,dedupe:a=!1}=l,u=At(t);return O(r,s,c=>{c.repeat&&n.toValue(a)||u(c)&&o(c)},i)}function Mt(e,t,o={}){return ie(e,t,{...o,eventName:"keydown"})}function It(e,t,o={}){return ie(e,t,{...o,eventName:"keypress"})}function Lt(e,t,o={}){return ie(e,t,{...o,eventName:"keyup"})}const Nt=500,xt=10;function Wt(e,t,o){var l,r;const s=n.computed(()=>x(e));let i,a,u,f=!1;function c(){i&&(clearTimeout(i),i=void 0),a=void 0,u=void 0,f=!1}function d(w){var y,b,T;const[k,C,R]=[u,a,f];if(c(),!o?.onMouseUp||!C||!k||(y=o?.modifiers)!=null&&y.self&&w.target!==s.value)return;(b=o?.modifiers)!=null&&b.prevent&&w.preventDefault(),(T=o?.modifiers)!=null&&T.stop&&w.stopPropagation();const V=w.x-C.x,P=w.y-C.y,I=Math.sqrt(V*V+P*P);o.onMouseUp(w.timeStamp-k,I,R)}function h(w){var y,b,T,k;(y=o?.modifiers)!=null&&y.self&&w.target!==s.value||(c(),(b=o?.modifiers)!=null&&b.prevent&&w.preventDefault(),(T=o?.modifiers)!=null&&T.stop&&w.stopPropagation(),a={x:w.x,y:w.y},u=w.timeStamp,i=setTimeout(()=>{f=!0,t(w)},(k=o?.delay)!=null?k:Nt))}function m(w){var y,b,T,k;if((y=o?.modifiers)!=null&&y.self&&w.target!==s.value||!a||o?.distanceThreshold===!1)return;(b=o?.modifiers)!=null&&b.prevent&&w.preventDefault(),(T=o?.modifiers)!=null&&T.stop&&w.stopPropagation();const C=w.x-a.x,R=w.y-a.y;Math.sqrt(C*C+R*R)>=((k=o?.distanceThreshold)!=null?k:xt)&&c()}const v={capture:(l=o?.modifiers)==null?void 0:l.capture,once:(r=o?.modifiers)==null?void 0:r.once},S=[O(s,"pointerdown",h,v),O(s,"pointermove",m,v),O(s,["pointerup","pointerleave"],d,v)];return()=>S.forEach(w=>w())}function Ht(){const{activeElement:e,body:t}=document;if(!e||e===t)return!1;switch(e.tagName){case"INPUT":case"TEXTAREA":return!0}return e.hasAttribute("contenteditable")}function Ut({keyCode:e,metaKey:t,ctrlKey:o,altKey:l}){return t||o||l?!1:e>=48&&e<=57||e>=96&&e<=105||e>=65&&e<=90}function $t(e,t={}){const{document:o=j}=t;o&&O(o,"keydown",r=>{!Ht()&&Ut(r)&&e(r)},{passive:!0})}function Bt(e,t=null){const o=n.getCurrentInstance();let l=()=>{};const r=n.customRef((s,i)=>(l=i,{get(){var a,u;return s(),(u=(a=o?.proxy)==null?void 0:a.$refs[e])!=null?u:t},set(){}}));return g.tryOnMounted(l),n.onUpdated(l),r}function Me(e={}){var t;const{window:o=M,deep:l=!0,triggerOnRemoval:r=!1}=e,s=(t=e.document)!=null?t:o?.document,i=()=>{var f;let c=s?.activeElement;if(l)for(;c?.shadowRoot;)c=(f=c?.shadowRoot)==null?void 0:f.activeElement;return c},a=n.shallowRef(),u=()=>{a.value=i()};if(o){const f={capture:!0,passive:!0};O(o,"blur",c=>{c.relatedTarget===null&&u()},f),O(o,"focus",u,f)}return r&&we(a,u,{document:s}),u(),a}function Y(e,t={}){const{immediate:o=!0,fpsLimit:l=void 0,window:r=M,once:s=!1}=t,i=n.shallowRef(!1),a=n.computed(()=>l?1e3/n.toValue(l):null);let u=0,f=null;function c(m){if(!i.value||!r)return;u||(u=m);const v=m-u;if(a.value&&v<a.value){f=r.requestAnimationFrame(c);return}if(u=m,e({delta:v,timestamp:m}),s){i.value=!1,f=null;return}f=r.requestAnimationFrame(c)}function d(){!i.value&&r&&(i.value=!0,u=0,f=r.requestAnimationFrame(c))}function h(){i.value=!1,f!=null&&r&&(r.cancelAnimationFrame(f),f=null)}return o&&d(),g.tryOnScopeDispose(h),{isActive:n.readonly(i),pause:h,resume:d}}function jt(e,t,o){let l,r;g.isObject(o)?(l=o,r=g.objectOmit(o,["window","immediate","commitStyles","persist","onReady","onError"])):(l={duration:o},r=o);const{window:s=M,immediate:i=!0,commitStyles:a,persist:u,playbackRate:f=1,onReady:c,onError:d=A=>{console.error(A)}}=l,h=W(()=>s&&HTMLElement&&"animate"in HTMLElement.prototype),m=n.shallowRef(void 0),v=n.shallowReactive({startTime:null,currentTime:null,timeline:null,playbackRate:f,pending:!1,playState:i?"idle":"paused",replaceState:"active"}),S=n.computed(()=>v.pending),p=n.computed(()=>v.playState),w=n.computed(()=>v.replaceState),y=n.computed({get(){return v.startTime},set(A){v.startTime=A,m.value&&(m.value.startTime=A)}}),b=n.computed({get(){return v.currentTime},set(A){v.currentTime=A,m.value&&(m.value.currentTime=A,N())}}),T=n.computed({get(){return v.timeline},set(A){v.timeline=A,m.value&&(m.value.timeline=A)}}),k=n.computed({get(){return v.playbackRate},set(A){v.playbackRate=A,m.value&&(m.value.playbackRate=A)}}),C=()=>{if(m.value)try{m.value.play(),N()}catch(A){H(),d(A)}else L()},R=()=>{var A;try{(A=m.value)==null||A.pause(),H()}catch(U){d(U)}},V=()=>{var A;m.value||L();try{(A=m.value)==null||A.reverse(),N()}catch(U){H(),d(U)}},P=()=>{var A;try{(A=m.value)==null||A.finish(),H()}catch(U){d(U)}},I=()=>{var A;try{(A=m.value)==null||A.cancel(),H()}catch(U){d(U)}};n.watch(()=>x(e),A=>{A?L():m.value=void 0}),n.watch(()=>t,A=>{if(m.value){L();const U=x(e);U&&(m.value.effect=new KeyframeEffect(U,n.toValue(A),r))}},{deep:!0}),g.tryOnMounted(()=>L(!0),!1),g.tryOnScopeDispose(I);function L(A){const U=x(e);!h.value||!U||(m.value||(m.value=U.animate(n.toValue(t),r)),u&&m.value.persist(),f!==1&&(m.value.playbackRate=f),A&&!i?m.value.pause():N(),c?.(m.value))}const _={passive:!0};O(m,["cancel","finish","remove"],H,_),O(m,"finish",()=>{var A;a&&((A=m.value)==null||A.commitStyles())},_);const{resume:D,pause:F}=Y(()=>{m.value&&(v.pending=m.value.pending,v.playState=m.value.playState,v.replaceState=m.value.replaceState,v.startTime=m.value.startTime,v.currentTime=m.value.currentTime,v.timeline=m.value.timeline,v.playbackRate=m.value.playbackRate)},{immediate:!1});function N(){h.value&&D()}function H(){h.value&&s&&s.requestAnimationFrame(F)}return{isSupported:h,animate:m,play:C,pause:R,reverse:V,finish:P,cancel:I,pending:S,playState:p,replaceState:w,startTime:y,currentTime:b,timeline:T,playbackRate:k}}function zt(e,t){const{interrupt:o=!0,onError:l=g.noop,onFinished:r=g.noop,signal:s}=t||{},i={aborted:"aborted",fulfilled:"fulfilled",pending:"pending",rejected:"rejected"},a=Array.from(Array.from({length:e.length}),()=>({state:i.pending,data:null})),u=n.reactive(a),f=n.shallowRef(-1);if(!e||e.length===0)return r(),{activeIndex:f,result:u};function c(d,h){f.value++,u[f.value].data=h,u[f.value].state=d}return e.reduce((d,h)=>d.then(m=>{var v;if(s?.aborted){c(i.aborted,new Error("aborted"));return}if(((v=u[f.value])==null?void 0:v.state)===i.rejected&&o){r();return}const S=h(m).then(p=>(c(i.fulfilled,p),f.value===e.length-1&&r(),p));return s?Promise.race([S,qt(s)]):S}).catch(m=>s?.aborted?(c(i.aborted,m),m):(c(i.rejected,m),l(),m)),Promise.resolve()),{activeIndex:f,result:u}}function qt(e){return new Promise((t,o)=>{const l=new Error("aborted");e.aborted?o(l):e.addEventListener("abort",()=>o(l),{once:!0})})}function Ie(e,t,o){const{immediate:l=!0,delay:r=0,onError:s=g.noop,onSuccess:i=g.noop,resetOnExecute:a=!0,shallow:u=!0,throwError:f}=o??{},c=u?n.shallowRef(t):n.ref(t),d=n.shallowRef(!1),h=n.shallowRef(!1),m=n.shallowRef(void 0);async function v(w=0,...y){a&&(c.value=t),m.value=void 0,d.value=!1,h.value=!0,w>0&&await g.promiseTimeout(w);const b=typeof e=="function"?e(...y):e;try{const T=await b;c.value=T,d.value=!0,i(T)}catch(T){if(m.value=T,s(T),f)throw T}finally{h.value=!1}return c.value}l&&v(r);const S={state:c,isReady:d,isLoading:h,error:m,execute:v};function p(){return new Promise((w,y)=>{g.until(h).toBe(!1).then(()=>w(S)).catch(y)})}return{...S,then(w,y){return p().then(w,y)}}}const te={array:e=>JSON.stringify(e),object:e=>JSON.stringify(e),set:e=>JSON.stringify(Array.from(e)),map:e=>JSON.stringify(Object.fromEntries(e)),null:()=>""};function Gt(e){return e?e instanceof Map?te.map:e instanceof Set?te.set:Array.isArray(e)?te.array:te.object:te.null}function Yt(e,t){const o=n.shallowRef(""),l=n.shallowRef();function r(){if(g.isClient)return l.value=new Promise((s,i)=>{try{const a=n.toValue(e);if(a==null)s("");else if(typeof a=="string")s(ge(new Blob([a],{type:"text/plain"})));else if(a instanceof Blob)s(ge(a));else if(a instanceof ArrayBuffer)s(window.btoa(String.fromCharCode(...new Uint8Array(a))));else if(a instanceof HTMLCanvasElement)s(a.toDataURL(t?.type,t?.quality));else if(a instanceof HTMLImageElement){const u=a.cloneNode(!1);u.crossOrigin="Anonymous",Xt(u).then(()=>{const f=document.createElement("canvas"),c=f.getContext("2d");f.width=u.width,f.height=u.height,c.drawImage(u,0,0,f.width,f.height),s(f.toDataURL(t?.type,t?.quality))}).catch(i)}else if(typeof a=="object"){const f=(t?.serializer||Gt(a))(a);return s(ge(new Blob([f],{type:"application/json"})))}else i(new Error("target is unsupported types"))}catch(a){i(a)}}),l.value.then(s=>{o.value=t?.dataUrl===!1?s.replace(/^data:.*?;base64,/,""):s}),l.value}return n.isRef(e)||typeof e=="function"?n.watch(e,r,{immediate:!0}):r(),{base64:o,promise:l,execute:r}}function Xt(e){return new Promise((t,o)=>{e.complete?t():(e.onload=()=>{t()},e.onerror=o)})}function ge(e){return new Promise((t,o)=>{const l=new FileReader;l.onload=r=>{t(r.target.result)},l.onerror=o,l.readAsDataURL(e)})}function Kt(e={}){const{navigator:t=z}=e,o=["chargingchange","chargingtimechange","dischargingtimechange","levelchange"],l=W(()=>t&&"getBattery"in t&&typeof t.getBattery=="function"),r=n.shallowRef(!1),s=n.shallowRef(0),i=n.shallowRef(0),a=n.shallowRef(1);let u;function f(){r.value=this.charging,s.value=this.chargingTime||0,i.value=this.dischargingTime||0,a.value=this.level}return l.value&&t.getBattery().then(c=>{u=c,f.call(u),O(u,o,f,{passive:!0})}),{isSupported:l,charging:r,chargingTime:s,dischargingTime:i,level:a}}function Jt(e){let{acceptAllDevices:t=!1}=e||{};const{filters:o=void 0,optionalServices:l=void 0,navigator:r=z}=e||{},s=W(()=>r&&"bluetooth"in r),i=n.shallowRef(),a=n.shallowRef(null);n.watch(i,()=>{h()});async function u(){if(s.value){a.value=null,o&&o.length>0&&(t=!1);try{i.value=await r?.bluetooth.requestDevice({acceptAllDevices:t,filters:o,optionalServices:l})}catch(m){a.value=m}}}const f=n.shallowRef(),c=n.shallowRef(!1);function d(){c.value=!1,i.value=void 0,f.value=void 0}async function h(){if(a.value=null,i.value&&i.value.gatt){O(i,"gattserverdisconnected",d,{passive:!0});try{f.value=await i.value.gatt.connect(),c.value=f.value.connected}catch(m){a.value=m}}}return g.tryOnMounted(()=>{var m;i.value&&((m=i.value.gatt)==null||m.connect())}),g.tryOnScopeDispose(()=>{var m;i.value&&((m=i.value.gatt)==null||m.disconnect())}),{isSupported:s,isConnected:n.readonly(c),device:i,requestDevice:u,server:f,error:a}}const be=Symbol("vueuse-ssr-width");function Se(){const e=n.hasInjectionContext()?g.injectLocal(be,null):null;return typeof e=="number"?e:void 0}function Qt(e,t){t!==void 0?t.provide(be,e):g.provideLocal(be,e)}function $(e,t={}){const{window:o=M,ssrWidth:l=Se()}=t,r=W(()=>o&&"matchMedia"in o&&typeof o.matchMedia=="function"),s=n.shallowRef(typeof l=="number"),i=n.shallowRef(),a=n.shallowRef(!1),u=f=>{a.value=f.matches};return n.watchEffect(()=>{if(s.value){s.value=!r.value;const f=n.toValue(e).split(",");a.value=f.some(c=>{const d=c.includes("not all"),h=c.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),m=c.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);let v=!!(h||m);return h&&v&&(v=l>=g.pxValue(h[1])),m&&v&&(v=l<=g.pxValue(m[1])),d?!v:v});return}r.value&&(i.value=o.matchMedia(n.toValue(e)),a.value=i.value.matches)}),O(i,"change",u,{passive:!0}),n.computed(()=>a.value)}const Zt={sm:640,md:768,lg:1024,xl:1280,"2xl":1536},en={xs:0,sm:576,md:768,lg:992,xl:1200,xxl:1400},Le={xs:0,sm:600,md:960,lg:1264,xl:1904},tn={xs:0,sm:600,md:960,lg:1280,xl:1920,xxl:2560},nn=Le,on={xs:480,sm:576,md:768,lg:992,xl:1200,xxl:1600},ln={xs:0,sm:600,md:1024,lg:1440,xl:1920},an={mobileS:320,mobileM:375,mobileL:425,tablet:768,laptop:1024,laptopL:1440,desktop4K:2560},rn={"3xs":360,"2xs":480,xs:600,sm:768,md:1024,lg:1280,xl:1440,"2xl":1600,"3xl":1920,"4xl":2560},sn={sm:576,md:768,lg:992,xl:1200},un={xs:0,sm:768,md:992,lg:1200,xl:1920};function cn(e,t={}){function o(m,v){let S=n.toValue(e[n.toValue(m)]);return v!=null&&(S=g.increaseWithUnit(S,v)),typeof S=="number"&&(S=`${S}px`),S}const{window:l=M,strategy:r="min-width",ssrWidth:s=Se()}=t,i=typeof s=="number",a=i?n.shallowRef(!1):{value:!0};i&&g.tryOnMounted(()=>a.value=!!l);function u(m,v){return!a.value&&i?m==="min"?s>=g.pxValue(v):s<=g.pxValue(v):l?l.matchMedia(`(${m}-width: ${v})`).matches:!1}const f=m=>$(()=>`(min-width: ${o(m)})`,t),c=m=>$(()=>`(max-width: ${o(m)})`,t),d=Object.keys(e).reduce((m,v)=>(Object.defineProperty(m,v,{get:()=>r==="min-width"?f(v):c(v),enumerable:!0,configurable:!0}),m),{});function h(){const m=Object.keys(e).map(v=>[v,d[v],g.pxValue(o(v))]).sort((v,S)=>v[2]-S[2]);return n.computed(()=>m.filter(([,v])=>v.value).map(([v])=>v))}return Object.assign(d,{greaterOrEqual:f,smallerOrEqual:c,greater(m){return $(()=>`(min-width: ${o(m,.1)})`,t)},smaller(m){return $(()=>`(max-width: ${o(m,-.1)})`,t)},between(m,v){return $(()=>`(min-width: ${o(m)}) and (max-width: ${o(v,-.1)})`,t)},isGreater(m){return u("min",o(m,.1))},isGreaterOrEqual(m){return u("min",o(m))},isSmaller(m){return u("max",o(m,-.1))},isSmallerOrEqual(m){return u("max",o(m))},isInBetween(m,v){return u("min",o(m))&&u("max",o(v,-.1))},current:h,active(){const m=h();return n.computed(()=>m.value.length===0?"":m.value.at(r==="min-width"?-1:0))}})}function fn(e){const{name:t,window:o=M}=e,l=W(()=>o&&"BroadcastChannel"in o),r=n.shallowRef(!1),s=n.ref(),i=n.ref(),a=n.shallowRef(null),u=c=>{s.value&&s.value.postMessage(c)},f=()=>{s.value&&s.value.close(),r.value=!0};return l.value&&g.tryOnMounted(()=>{a.value=null,s.value=new BroadcastChannel(t);const c={passive:!0};O(s,"message",d=>{i.value=d.data},c),O(s,"messageerror",d=>{a.value=d},c),O(s,"close",()=>{r.value=!0},c)}),g.tryOnScopeDispose(()=>{f()}),{isSupported:l,channel:s,data:i,post:u,close:f,error:a,isClosed:r}}const Ne=["hash","host","hostname","href","pathname","port","protocol","search"];function dn(e={}){const{window:t=M}=e,o=Object.fromEntries(Ne.map(s=>[s,n.ref()]));for(const[s,i]of g.objectEntries(o))n.watch(i,a=>{!t?.location||t.location[s]===a||(t.location[s]=a)});const l=s=>{var i;const{state:a,length:u}=t?.history||{},{origin:f}=t?.location||{};for(const c of Ne)o[c].value=(i=t?.location)==null?void 0:i[c];return n.reactive({trigger:s,state:a,length:u,origin:f,...o})},r=n.ref(l("load"));if(t){const s={passive:!0};O(t,"popstate",()=>r.value=l("popstate"),s),O(t,"hashchange",()=>r.value=l("hashchange"),s)}return r}function mn(e,t=(l,r)=>l===r,o){const{deepRefs:l=!0,...r}=o||{},s=g.createRef(e.value,l);return n.watch(()=>e.value,i=>{t(i,s.value)||(s.value=i)},r),s}function se(e,t={}){const{controls:o=!1,navigator:l=z}=t,r=W(()=>l&&"permissions"in l),s=n.shallowRef(),i=typeof e=="string"?{name:e}:e,a=n.shallowRef(),u=()=>{var c,d;a.value=(d=(c=s.value)==null?void 0:c.state)!=null?d:"prompt"};O(s,"change",u,{passive:!0});const f=g.createSingletonPromise(async()=>{if(r.value){if(!s.value)try{s.value=await l.permissions.query(i)}catch{s.value=void 0}finally{u()}if(o)return n.toRaw(s.value)}});return f(),o?{state:a,isSupported:r,query:f}:a}function vn(e={}){const{navigator:t=z,read:o=!1,source:l,copiedDuring:r=1500,legacy:s=!1}=e,i=W(()=>t&&"clipboard"in t),a=se("clipboard-read"),u=se("clipboard-write"),f=n.computed(()=>i.value||s),c=n.shallowRef(""),d=n.shallowRef(!1),h=g.useTimeoutFn(()=>d.value=!1,r,{immediate:!1});async function m(){let y=!(i.value&&w(a.value));if(!y)try{c.value=await t.clipboard.readText()}catch{y=!0}y&&(c.value=p())}f.value&&o&&O(["copy","cut"],m,{passive:!0});async function v(y=n.toValue(l)){if(f.value&&y!=null){let b=!(i.value&&w(u.value));if(!b)try{await t.clipboard.writeText(y)}catch{b=!0}b&&S(y),c.value=y,d.value=!0,h.start()}}function S(y){const b=document.createElement("textarea");b.value=y??"",b.style.position="absolute",b.style.opacity="0",document.body.appendChild(b),b.select(),document.execCommand("copy"),b.remove()}function p(){var y,b,T;return(T=(b=(y=document?.getSelection)==null?void 0:y.call(document))==null?void 0:b.toString())!=null?T:""}function w(y){return y==="granted"||y==="prompt"}return{isSupported:f,text:c,copied:d,copy:v}}function pn(e={}){const{navigator:t=z,read:o=!1,source:l,copiedDuring:r=1500}=e,s=W(()=>t&&"clipboard"in t),i=n.ref([]),a=n.shallowRef(!1),u=g.useTimeoutFn(()=>a.value=!1,r,{immediate:!1});function f(){s.value&&t.clipboard.read().then(d=>{i.value=d})}s.value&&o&&O(["copy","cut"],f,{passive:!0});async function c(d=n.toValue(l)){s.value&&d!=null&&(await t.clipboard.write(d),i.value=d,a.value=!0,u.start())}return{isSupported:s,content:i,copied:a,copy:c}}function ne(e){return JSON.parse(JSON.stringify(e))}function hn(e,t={}){const o=n.ref({}),l=n.shallowRef(!1);let r=!1;const{manual:s,clone:i=ne,deep:a=!0,immediate:u=!0}=t;n.watch(o,()=>{if(r){r=!1;return}l.value=!0},{deep:!0,flush:"sync"});function f(){r=!0,l.value=!1,o.value=i(n.toValue(e))}return!s&&(n.isRef(e)||typeof e=="function")?n.watch(e,f,{...t,deep:a,immediate:u}):f(),{cloned:o,isModified:l,sync:f}}const ue=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ce="__vueuse_ssr_handlers__",xe=yn();function yn(){return ce in ue||(ue[ce]=ue[ce]||{}),ue[ce]}function fe(e,t){return xe[e]||t}function wn(e,t){xe[e]=t}function We(e){return $("(prefers-color-scheme: dark)",e)}function He(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 Re={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()}},Ee="vueuse-storage";function de(e,t,o,l={}){var r;const{flush:s="pre",deep:i=!0,listenToStorageChanges:a=!0,writeDefaults:u=!0,mergeDefaults:f=!1,shallow:c,window:d=M,eventFilter:h,onError:m=F=>{console.error(F)},initOnMounted:v}=l,S=(c?n.shallowRef:n.ref)(typeof t=="function"?t():t),p=n.computed(()=>n.toValue(e));if(!o)try{o=fe("getDefaultStorage",()=>{var F;return(F=M)==null?void 0:F.localStorage})()}catch(F){m(F)}if(!o)return S;const w=n.toValue(t),y=He(w),b=(r=l.serializer)!=null?r:Re[y],{pause:T,resume:k}=g.pausableWatch(S,()=>I(S.value),{flush:s,deep:i,eventFilter:h});n.watch(p,()=>_(),{flush:s});let C=!1;const R=F=>{v&&!C||_(F)},V=F=>{v&&!C||D(F)};d&&a&&(o instanceof Storage?O(d,"storage",R,{passive:!0}):O(d,Ee,V)),v?g.tryOnMounted(()=>{C=!0,_()}):_();function P(F,N){if(d){const H={key:p.value,oldValue:F,newValue:N,storageArea:o};d.dispatchEvent(o instanceof Storage?new StorageEvent("storage",H):new CustomEvent(Ee,{detail:H}))}}function I(F){try{const N=o.getItem(p.value);if(F==null)P(N,null),o.removeItem(p.value);else{const H=b.write(F);N!==H&&(o.setItem(p.value,H),P(N,H))}}catch(N){m(N)}}function L(F){const N=F?F.newValue:o.getItem(p.value);if(N==null)return u&&w!=null&&o.setItem(p.value,b.write(w)),w;if(!F&&f){const H=b.read(N);return typeof f=="function"?f(H,w):y==="object"&&!Array.isArray(H)?{...w,...H}:H}else return typeof N!="string"?N:b.read(N)}function _(F){if(!(F&&F.storageArea!==o)){if(F&&F.key==null){S.value=w;return}if(!(F&&F.key!==p.value)){T();try{F?.newValue!==b.write(S.value)&&(S.value=L(F))}catch(N){m(N)}finally{F?n.nextTick(k):k()}}}}function D(F){_(F.detail)}return S}const gn="*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function Ue(e={}){const{selector:t="html",attribute:o="class",initialValue:l="auto",window:r=M,storage:s,storageKey:i="vueuse-color-scheme",listenToStorageChanges:a=!0,storageRef:u,emitAuto:f,disableTransition:c=!0}=e,d={auto:"",light:"light",dark:"dark",...e.modes||{}},h=We({window:r}),m=n.computed(()=>h.value?"dark":"light"),v=u||(i==null?g.toRef(l):de(i,l,s,{window:r,listenToStorageChanges:a})),S=n.computed(()=>v.value==="auto"?m.value:v.value),p=fe("updateHTMLAttrs",(T,k,C)=>{const R=typeof T=="string"?r?.document.querySelector(T):x(T);if(!R)return;const V=new Set,P=new Set;let I=null;if(k==="class"){const _=C.split(/\s/g);Object.values(d).flatMap(D=>(D||"").split(/\s/g)).filter(Boolean).forEach(D=>{_.includes(D)?V.add(D):P.add(D)})}else I={key:k,value:C};if(V.size===0&&P.size===0&&I===null)return;let L;c&&(L=r.document.createElement("style"),L.appendChild(document.createTextNode(gn)),r.document.head.appendChild(L));for(const _ of V)R.classList.add(_);for(const _ of P)R.classList.remove(_);I&&R.setAttribute(I.key,I.value),c&&(r.getComputedStyle(L).opacity,document.head.removeChild(L))});function w(T){var k;p(t,o,(k=d[T])!=null?k:T)}function y(T){e.onChanged?e.onChanged(T,w):w(T)}n.watch(S,y,{flush:"post",immediate:!0}),g.tryOnMounted(()=>y(S.value));const b=n.computed({get(){return f?v.value:S.value},set(T){v.value=T}});return Object.assign(b,{store:v,system:m,state:S})}function bn(e=n.shallowRef(!1)){const t=g.createEventHook(),o=g.createEventHook(),l=g.createEventHook();let r=g.noop;const s=u=>(l.trigger(u),e.value=!0,new Promise(f=>{r=f})),i=u=>{e.value=!1,t.trigger(u),r({data:u,isCanceled:!1})},a=u=>{e.value=!1,o.trigger(u),r({data:u,isCanceled:!0})};return{isRevealed:n.computed(()=>e.value),reveal:s,confirm:i,cancel:a,onReveal:l.on,onConfirm:t.on,onCancel:o.on}}function Sn(e,t){var o,l;const r=n.shallowRef(n.toValue(e)),s=g.useIntervalFn(()=>{var c,d;const h=r.value-1;r.value=h<0?0:h,(c=t?.onTick)==null||c.call(t),r.value<=0&&(s.pause(),(d=t?.onComplete)==null||d.call(t))},(o=t?.interval)!=null?o:1e3,{immediate:(l=t?.immediate)!=null?l:!1}),i=c=>{var d;r.value=(d=n.toValue(c))!=null?d:n.toValue(e)},a=()=>{s.pause(),i()},u=()=>{s.isActive.value||r.value>0&&s.resume()};return{remaining:r,reset:i,stop:a,start:c=>{i(c),s.resume()},pause:s.pause,resume:u,isActive:s.isActive}}function oe(e,t,o={}){const{window:l=M,initialValue:r,observe:s=!1}=o,i=n.shallowRef(r),a=n.computed(()=>{var f;return x(t)||((f=l?.document)==null?void 0:f.documentElement)});function u(){var f;const c=n.toValue(e),d=n.toValue(a);if(d&&l&&c){const h=(f=l.getComputedStyle(d).getPropertyValue(c))==null?void 0:f.trim();i.value=h||i.value||r}}return s&&Q(a,u,{attributeFilter:["style","class"],window:l}),n.watch([a,()=>n.toValue(e)],(f,c)=>{c[0]&&c[1]&&c[0].style.removeProperty(c[1]),u()},{immediate:!0}),n.watch([i,a],([f,c])=>{const d=n.toValue(e);c?.style&&d&&(f==null?c.style.removeProperty(d):c.style.setProperty(d,f))},{immediate:!0}),i}function $e(e){const t=n.getCurrentInstance(),o=g.computedWithControl(()=>null,()=>e?x(e):t.proxy.$el);return n.onUpdated(o.trigger),n.onMounted(o.trigger),o}function Rn(e,t){const o=n.shallowRef(f()),l=g.toRef(e),r=n.computed({get(){var c;const d=l.value;let h=t?.getIndexOf?t.getIndexOf(o.value,d):d.indexOf(o.value);return h<0&&(h=(c=t?.fallbackIndex)!=null?c:0),h},set(c){s(c)}});function s(c){const d=l.value,h=d.length,m=(c%h+h)%h,v=d[m];return o.value=v,v}function i(c=1){return s(r.value+c)}function a(c=1){return i(c)}function u(c=1){return i(-c)}function f(){var c,d;return(d=n.toValue((c=t?.initialValue)!=null?c:n.toValue(e)[0]))!=null?d:void 0}return n.watch(l,()=>s(r.value)),{state:o,index:r,next:a,prev:u,go:s}}function En(e={}){const{valueDark:t="dark",valueLight:o=""}=e,l=Ue({...e,onChanged:(i,a)=>{var u;e.onChanged?(u=e.onChanged)==null||u.call(e,i==="dark",a,i):a(i)},modes:{dark:t,light:o}}),r=n.computed(()=>l.system.value);return n.computed({get(){return l.value==="dark"},set(i){const a=i?"dark":"light";r.value===a?l.value="auto":l.value=a}})}function Be(e){return e}function Tn(e,t){return e.value=t}function On(e){return e?typeof e=="function"?e:ne:Be}function kn(e){return e?typeof e=="function"?e:ne:Be}function je(e,t={}){const{clone:o=!1,dump:l=On(o),parse:r=kn(o),setSource:s=Tn}=t;function i(){return n.markRaw({snapshot:l(e.value),timestamp:g.timestamp()})}const a=n.ref(i()),u=n.ref([]),f=n.ref([]),c=b=>{s(e,r(b.snapshot)),a.value=b},d=()=>{u.value.unshift(a.value),a.value=i(),t.capacity&&u.value.length>t.capacity&&u.value.splice(t.capacity,Number.POSITIVE_INFINITY),f.value.length&&f.value.splice(0,f.value.length)},h=()=>{u.value.splice(0,u.value.length),f.value.splice(0,f.value.length)},m=()=>{const b=u.value.shift();b&&(f.value.unshift(a.value),c(b))},v=()=>{const b=f.value.shift();b&&(u.value.unshift(a.value),c(b))},S=()=>{c(a.value)},p=n.computed(()=>[a.value,...u.value]),w=n.computed(()=>u.value.length>0),y=n.computed(()=>f.value.length>0);return{source:e,undoStack:u,redoStack:f,last:a,history:p,canUndo:w,canRedo:y,clear:h,commit:d,reset:S,undo:m,redo:v}}function Te(e,t={}){const{deep:o=!1,flush:l="pre",eventFilter:r}=t,{eventFilter:s,pause:i,resume:a,isActive:u}=g.pausableFilter(r),{ignoreUpdates:f,ignorePrevAsyncUpdates:c,stop:d}=g.watchIgnorable(e,p,{deep:o,flush:l,eventFilter:s});function h(T,k){c(),f(()=>{T.value=k})}const m=je(e,{...t,clone:t.clone||o,setSource:h}),{clear:v,commit:S}=m;function p(){c(),S()}function w(T){a(),T&&p()}function y(T){let k=!1;const C=()=>k=!0;f(()=>{T(C)}),k||p()}function b(){d(),v()}return{...m,isTracking:u,pause:i,resume:w,commit:p,batch:y,dispose:b}}function _n(e,t={}){const o=t.debounce?g.debounceFilter(t.debounce):void 0;return{...Te(e,{...t,eventFilter:o})}}function Vn(e={}){const{window:t=M,requestPermissions:o=!1,eventFilter:l=g.bypassFilter}=e,r=W(()=>typeof DeviceMotionEvent<"u"),s=W(()=>r.value&&"requestPermission"in DeviceMotionEvent&&typeof DeviceMotionEvent.requestPermission=="function"),i=n.shallowRef(!1),a=n.ref({x:null,y:null,z:null}),u=n.ref({alpha:null,beta:null,gamma:null}),f=n.shallowRef(0),c=n.ref({x:null,y:null,z:null});function d(){if(t){const m=g.createFilterWrapper(l,v=>{var S,p,w,y,b,T,k,C,R;a.value={x:((S=v.acceleration)==null?void 0:S.x)||null,y:((p=v.acceleration)==null?void 0:p.y)||null,z:((w=v.acceleration)==null?void 0:w.z)||null},c.value={x:((y=v.accelerationIncludingGravity)==null?void 0:y.x)||null,y:((b=v.accelerationIncludingGravity)==null?void 0:b.y)||null,z:((T=v.accelerationIncludingGravity)==null?void 0:T.z)||null},u.value={alpha:((k=v.rotationRate)==null?void 0:k.alpha)||null,beta:((C=v.rotationRate)==null?void 0:C.beta)||null,gamma:((R=v.rotationRate)==null?void 0:R.gamma)||null},f.value=v.interval});O(t,"devicemotion",m,{passive:!0})}}const h=async()=>{if(s.value||(i.value=!0),!i.value&&s.value){const m=DeviceMotionEvent.requestPermission;try{await m()==="granted"&&(i.value=!0,d())}catch(v){console.error(v)}}};return r.value&&(o&&s.value?h().then(()=>d()):d()),{acceleration:a,accelerationIncludingGravity:c,rotationRate:u,interval:f,isSupported:r,requirePermissions:s,ensurePermissions:h,permissionGranted:i}}function ze(e={}){const{window:t=M}=e,o=W(()=>t&&"DeviceOrientationEvent"in t),l=n.shallowRef(!1),r=n.shallowRef(null),s=n.shallowRef(null),i=n.shallowRef(null);return t&&o.value&&O(t,"deviceorientation",a=>{l.value=a.absolute,r.value=a.alpha,s.value=a.beta,i.value=a.gamma},{passive:!0}),{isSupported:o,isAbsolute:l,alpha:r,beta:s,gamma:i}}function Fn(e={}){const{window:t=M}=e,o=n.shallowRef(1),l=$(()=>`(resolution: ${o.value}dppx)`,e);let r=g.noop;return t&&(r=g.watchImmediate(l,()=>o.value=t.devicePixelRatio)),{pixelRatio:n.readonly(o),stop:r}}function Pn(e={}){const{navigator:t=z,requestPermissions:o=!1,constraints:l={audio:!0,video:!0},onUpdated:r}=e,s=n.ref([]),i=n.computed(()=>s.value.filter(v=>v.kind==="videoinput")),a=n.computed(()=>s.value.filter(v=>v.kind==="audioinput")),u=n.computed(()=>s.value.filter(v=>v.kind==="audiooutput")),f=W(()=>t&&t.mediaDevices&&t.mediaDevices.enumerateDevices),c=n.shallowRef(!1);let d;async function h(){f.value&&(s.value=await t.mediaDevices.enumerateDevices(),r?.(s.value),d&&(d.getTracks().forEach(v=>v.stop()),d=null))}async function m(){const v=l.video?"camera":"microphone";if(!f.value)return!1;if(c.value)return!0;const{state:S,query:p}=se(v,{controls:!0});if(await p(),S.value!=="granted"){let w=!0;try{d=await t.mediaDevices.getUserMedia(l)}catch{d=null,w=!1}h(),c.value=w}else c.value=!0;return c.value}return f.value&&(o&&m(),O(t.mediaDevices,"devicechange",h,{passive:!0}),h()),{devices:s,ensurePermissions:m,permissionGranted:c,videoInputs:i,audioInputs:a,audioOutputs:u,isSupported:f}}function Cn(e={}){var t;const o=n.shallowRef((t=e.enabled)!=null?t:!1),l=e.video,r=e.audio,{navigator:s=z}=e,i=W(()=>{var m;return(m=s?.mediaDevices)==null?void 0:m.getDisplayMedia}),a={audio:r,video:l},u=n.shallowRef();async function f(){var m;if(!(!i.value||u.value))return u.value=await s.mediaDevices.getDisplayMedia(a),(m=u.value)==null||m.getTracks().forEach(v=>O(v,"ended",d,{passive:!0})),u.value}async function c(){var m;(m=u.value)==null||m.getTracks().forEach(v=>v.stop()),u.value=void 0}function d(){c(),o.value=!1}async function h(){return await f(),u.value&&(o.value=!0),u.value}return n.watch(o,m=>{m?f():c()},{immediate:!0}),{isSupported:i,stream:u,start:h,stop:d,enabled:o}}function qe(e={}){const{document:t=j}=e;if(!t)return n.shallowRef("visible");const o=n.shallowRef(t.visibilityState);return O(t,"visibilitychange",()=>{o.value=t.visibilityState},{passive:!0}),o}function Dn(e,t={}){var o;const{pointerTypes:l,preventDefault:r,stopPropagation:s,exact:i,onMove:a,onEnd:u,onStart:f,initialValue:c,axis:d="both",draggingElement:h=M,containerElement:m,handle:v=e,buttons:S=[0]}=t,p=n.ref((o=n.toValue(c))!=null?o:{x:0,y:0}),w=n.ref(),y=R=>l?l.includes(R.pointerType):!0,b=R=>{n.toValue(r)&&R.preventDefault(),n.toValue(s)&&R.stopPropagation()},T=R=>{var V;if(!n.toValue(S).includes(R.button)||n.toValue(t.disabled)||!y(R)||n.toValue(i)&&R.target!==n.toValue(e))return;const P=n.toValue(m),I=(V=P?.getBoundingClientRect)==null?void 0:V.call(P),L=n.toValue(e).getBoundingClientRect(),_={x:R.clientX-(P?L.left-I.left+P.scrollLeft:L.left),y:R.clientY-(P?L.top-I.top+P.scrollTop:L.top)};f?.(_,R)!==!1&&(w.value=_,b(R))},k=R=>{if(n.toValue(t.disabled)||!y(R)||!w.value)return;const V=n.toValue(m),P=n.toValue(e).getBoundingClientRect();let{x:I,y:L}=p.value;(d==="x"||d==="both")&&(I=R.clientX-w.value.x,V&&(I=Math.min(Math.max(0,I),V.scrollWidth-P.width))),(d==="y"||d==="both")&&(L=R.clientY-w.value.y,V&&(L=Math.min(Math.max(0,L),V.scrollHeight-P.height))),p.value={x:I,y:L},a?.(p.value,R),b(R)},C=R=>{n.toValue(t.disabled)||!y(R)||w.value&&(w.value=void 0,u?.(p.value,R),b(R))};if(g.isClient){const R=()=>{var V;return{capture:(V=t.capture)!=null?V:!0,passive:!n.toValue(r)}};O(v,"pointerdown",T,R),O(h,"pointermove",k,R),O(h,"pointerup",C,R)}return{...g.toRefs(p),position:p,isDragging:n.computed(()=>!!w.value),style:n.computed(()=>`left:${p.value.x}px;top:${p.value.y}px;`)}}function An(e,t={}){var o,l;const r=n.shallowRef(!1),s=n.shallowRef(null);let i=0,a=!0;if(g.isClient){const u=typeof t=="function"?{onDrop:t}:t,f=(o=u.multiple)!=null?o:!0,c=(l=u.preventDefaultForUnhandled)!=null?l:!1,d=p=>{var w,y;const b=Array.from((y=(w=p.dataTransfer)==null?void 0:w.files)!=null?y:[]);return b.length===0?null:f?b:[b[0]]},h=p=>{const w=n.unref(u.dataTypes);return typeof w=="function"?w(p):w?.length?p.length===0?!1:p.every(y=>w.some(b=>y.includes(b))):!0},m=p=>{const w=Array.from(p??[]).map(T=>T.type),y=h(w),b=f||p.length<=1;return y&&b},v=()=>/^(?:(?!chrome|android).)*safari/i.test(navigator.userAgent)&&!("chrome"in window),S=(p,w)=>{var y,b,T,k,C,R;const V=(y=p.dataTransfer)==null?void 0:y.items;if(a=(b=V&&m(V))!=null?b:!1,c&&p.preventDefault(),!v()&&!a){p.dataTransfer&&(p.dataTransfer.dropEffect="none");return}p.preventDefault(),p.dataTransfer&&(p.dataTransfer.dropEffect="copy");const P=d(p);switch(w){case"enter":i+=1,r.value=!0,(T=u.onEnter)==null||T.call(u,null,p);break;case"over":(k=u.onOver)==null||k.call(u,null,p);break;case"leave":i-=1,i===0&&(r.value=!1),(C=u.onLeave)==null||C.call(u,null,p);break;case"drop":i=0,r.value=!1,a&&(s.value=P,(R=u.onDrop)==null||R.call(u,P,p));break}};O(e,"dragenter",p=>S(p,"enter")),O(e,"dragover",p=>S(p,"over")),O(e,"dragleave",p=>S(p,"leave")),O(e,"drop",p=>S(p,"drop"))}return{files:s,isOverDropZone:r}}function me(e,t,o={}){const{window:l=M,...r}=o;let s;const i=W(()=>l&&"ResizeObserver"in l),a=()=>{s&&(s.disconnect(),s=void 0)},u=n.computed(()=>{const d=n.toValue(e);return Array.isArray(d)?d.map(h=>x(h)):[x(d)]}),f=n.watch(u,d=>{if(a(),i.value&&l){s=new ResizeObserver(t);for(const h of d)h&&s.observe(h,r)}},{immediate:!0,flush:"post"}),c=()=>{a(),f()};return g.tryOnScopeDispose(c),{isSupported:i,stop:c}}function Mn(e,t={}){const{reset:o=!0,windowResize:l=!0,windowScroll:r=!0,immediate:s=!0,updateTiming:i="sync"}=t,a=n.shallowRef(0),u=n.shallowRef(0),f=n.shallowRef(0),c=n.shallowRef(0),d=n.shallowRef(0),h=n.shallowRef(0),m=n.shallowRef(0),v=n.shallowRef(0);function S(){const w=x(e);if(!w){o&&(a.value=0,u.value=0,f.value=0,c.value=0,d.value=0,h.value=0,m.value=0,v.value=0);return}const y=w.getBoundingClientRect();a.value=y.height,u.value=y.bottom,f.value=y.left,c.value=y.right,d.value=y.top,h.value=y.width,m.value=y.x,v.value=y.y}function p(){i==="sync"?S():i==="next-frame"&&requestAnimationFrame(()=>S())}return me(e,p),n.watch(()=>x(e),w=>!w&&p()),Q(e,p,{attributeFilter:["style","class"]}),r&&O("scroll",p,{capture:!0,passive:!0}),l&&O("resize",p,{passive:!0}),g.tryOnMounted(()=>{s&&p()}),{height:a,bottom:u,left:f,right:c,top:d,width:h,x:m,y:v,update:p}}function In(e){const{x:t,y:o,document:l=j,multiple:r,interval:s="requestAnimationFrame",immediate:i=!0}=e,a=W(()=>n.toValue(r)?l&&"elementsFromPoint"in l:l&&"elementFromPoint"in l),u=n.shallowRef(null),f=()=>{var d,h;u.value=n.toValue(r)?(d=l?.elementsFromPoint(n.toValue(t),n.toValue(o)))!=null?d:[]:(h=l?.elementFromPoint(n.toValue(t),n.toValue(o)))!=null?h:null},c=s==="requestAnimationFrame"?Y(f,{immediate:i}):g.useIntervalFn(f,s,{immediate:i});return{isSupported:a,element:u,...c}}function Ln(e,t={}){const{delayEnter:o=0,delayLeave:l=0,triggerOnRemoval:r=!1,window:s=M}=t,i=n.shallowRef(!1);let a;const u=f=>{const c=f?o:l;a&&(clearTimeout(a),a=void 0),c?a=setTimeout(()=>i.value=f,c):i.value=f};return s&&(O(e,"mouseenter",()=>u(!0),{passive:!0}),O(e,"mouseleave",()=>u(!1),{passive:!0}),r&&we(n.computed(()=>x(e)),()=>u(!1))),i}function Ge(e,t={width:0,height:0},o={}){const{window:l=M,box:r="content-box"}=o,s=n.computed(()=>{var d,h;return(h=(d=x(e))==null?void 0:d.namespaceURI)==null?void 0:h.includes("svg")}),i=n.shallowRef(t.width),a=n.shallowRef(t.height),{stop:u}=me(e,([d])=>{const h=r==="border-box"?d.borderBoxSize:r==="content-box"?d.contentBoxSize:d.devicePixelContentBoxSize;if(l&&s.value){const m=x(e);if(m){const v=m.getBoundingClientRect();i.value=v.width,a.value=v.height}}else if(h){const m=g.toArray(h);i.value=m.reduce((v,{inlineSize:S})=>v+S,0),a.value=m.reduce((v,{blockSize:S})=>v+S,0)}else i.value=d.contentRect.width,a.value=d.contentRect.height},o);g.tryOnMounted(()=>{const d=x(e);d&&(i.value="offsetWidth"in d?d.offsetWidth:t.width,a.value="offsetHeight"in d?d.offsetHeight:t.height)});const f=n.watch(()=>x(e),d=>{i.value=d?t.width:0,a.value=d?t.height:0});function c(){u(),f()}return{width:i,height:a,stop:c}}function Ye(e,t,o={}){const{root:l,rootMargin:r="0px",threshold:s=0,window:i=M,immediate:a=!0}=o,u=W(()=>i&&"IntersectionObserver"in i),f=n.computed(()=>{const v=n.toValue(e);return g.toArray(v).map(x).filter(g.notNullish)});let c=g.noop;const d=n.shallowRef(a),h=u.value?n.watch(()=>[f.value,x(l),d.value],([v,S])=>{if(c(),!d.value||!v.length)return;const p=new IntersectionObserver(t,{root:x(S),rootMargin:r,threshold:s});v.forEach(w=>w&&p.observe(w)),c=()=>{p.disconnect(),c=g.noop}},{immediate:a,flush:"post"}):g.noop,m=()=>{c(),h(),d.value=!1};return g.tryOnScopeDispose(m),{isSupported:u,isActive:d,pause(){c(),d.value=!1},resume(){d.value=!0},stop:m}}function Xe(e,t={}){const{window:o=M,scrollTarget:l,threshold:r=0,rootMargin:s,once:i=!1}=t,a=n.shallowRef(!1),{stop:u}=Ye(e,f=>{let c=a.value,d=0;for(const h of f)h.time>=d&&(d=h.time,c=h.isIntersecting);a.value=c,i&&g.watchOnce(a,()=>{u()})},{root:l,window:o,threshold:r,rootMargin:n.toValue(s)});return a}const le=new Map;function Nn(e){const t=n.getCurrentScope();function o(a){var u;const f=le.get(e)||new Set;f.add(a),le.set(e,f);const c=()=>r(a);return(u=t?.cleanups)==null||u.push(c),c}function l(a){function u(...f){r(u),a(...f)}return o(u)}function r(a){const u=le.get(e);u&&(u.delete(a),u.size||s())}function s(){le.delete(e)}function i(a,u){var f;(f=le.get(e))==null||f.forEach(c=>c(a,u))}return{on:o,once:l,off:r,emit:i,reset:s}}function xn(e){return e===!0?{}:e}function Wn(e,t=[],o={}){const l=n.shallowRef(null),r=n.shallowRef(null),s=n.shallowRef("CONNECTING"),i=n.ref(null),a=n.shallowRef(null),u=g.toRef(e),f=n.shallowRef(null);let c=!1,d=0;const{withCredentials:h=!1,immediate:m=!0,autoConnect:v=!0,autoReconnect:S}=o,p=()=>{g.isClient&&i.value&&(i.value.close(),i.value=null,s.value="CLOSED",c=!0)},w=()=>{if(c||typeof u.value>"u")return;const b=new EventSource(u.value,{withCredentials:h});s.value="CONNECTING",i.value=b,b.onopen=()=>{s.value="OPEN",a.value=null},b.onerror=T=>{if(s.value="CLOSED",a.value=T,b.readyState===2&&!c&&S){b.close();const{retries:k=-1,delay:C=1e3,onFailed:R}=xn(S);d+=1,typeof k=="number"&&(k<0||d<k)||typeof k=="function"&&k()?setTimeout(w,C):R?.()}},b.onmessage=T=>{l.value=null,r.value=T.data,f.value=T.lastEventId};for(const T of t)O(b,T,k=>{l.value=T,r.value=k.data||null},{passive:!0})},y=()=>{g.isClient&&(p(),c=!1,d=0,w())};return m&&y(),v&&n.watch(u,y),g.tryOnScopeDispose(p),{eventSource:i,event:l,data:r,status:s,error:a,open:y,close:p,lastEventId:f}}function Hn(e={}){const{initialValue:t=""}=e,o=W(()=>typeof window<"u"&&"EyeDropper"in window),l=n.shallowRef(t);async function r(s){if(!o.value)return;const a=await new window.EyeDropper().open(s);return l.value=a.sRGBHex,a}return{isSupported:o,sRGBHex:l,open:r}}function Un(e=null,t={}){const{baseUrl:o="",rel:l="icon",document:r=j}=t,s=g.toRef(e),i=a=>{const u=r?.head.querySelectorAll(`link[rel*="${l}"]`);if(!u||u.length===0){const f=r?.createElement("link");f&&(f.rel=l,f.href=`${o}${a}`,f.type=`image/${a.split(".").pop()}`,r?.head.append(f));return}u?.forEach(f=>f.href=`${o}${a}`)};return n.watch(s,(a,u)=>{typeof a=="string"&&a!==u&&i(a)},{immediate:!0}),s}const $n={json:"application/json",text:"text/plain"};function ve(e){return e&&g.containsProp(e,"immediate","refetch","initialData","timeout","beforeFetch","afterFetch","onFetchError","fetch","updateDataOnError")}const Bn=/^(?:[a-z][a-z\d+\-.]*:)?\/\//i;function jn(e){return Bn.test(e)}function ae(e){return typeof Headers<"u"&&e instanceof Headers?Object.fromEntries(e.entries()):e}function Z(e,...t){return e==="overwrite"?async o=>{let l;for(let r=t.length-1;r>=0;r--)if(t[r]!=null){l=t[r];break}return l?{...o,...await l(o)}:o}:async o=>{for(const l of t)l&&(o={...o,...await l(o)});return o}}function zn(e={}){const t=e.combination||"chain",o=e.options||{},l=e.fetchOptions||{};function r(s,...i){const a=n.computed(()=>{const c=n.toValue(e.baseUrl),d=n.toValue(s);return c&&!jn(d)?qn(c,d):d});let u=o,f=l;return i.length>0&&(ve(i[0])?u={...u,...i[0],beforeFetch:Z(t,o.beforeFetch,i[0].beforeFetch),afterFetch:Z(t,o.afterFetch,i[0].afterFetch),onFetchError:Z(t,o.onFetchError,i[0].onFetchError)}:f={...f,...i[0],headers:{...ae(f.headers)||{},...ae(i[0].headers)||{}}}),i.length>1&&ve(i[1])&&(u={...u,...i[1],beforeFetch:Z(t,o.beforeFetch,i[1].beforeFetch),afterFetch:Z(t,o.afterFetch,i[1].afterFetch),onFetchError:Z(t,o.onFetchError,i[1].onFetchError)}),Ke(a,f,u)}return r}function Ke(e,...t){var o,l;const r=typeof AbortController=="function";let s={},i={immediate:!0,refetch:!1,timeout:0,updateDataOnError:!1};const a={method:"GET",type:"text",payload:void 0};t.length>0&&(ve(t[0])?i={...i,...t[0]}:s=t[0]),t.length>1&&ve(t[1])&&(i={...i,...t[1]});const{fetch:u=(l=(o=M)==null?void 0:o.fetch)!=null?l:globalThis?.fetch,initialData:f,timeout:c}=i,d=g.createEventHook(),h=g.createEventHook(),m=g.createEventHook(),v=n.shallowRef(!1),S=n.shallowRef(!1),p=n.shallowRef(!1),w=n.shallowRef(null),y=n.shallowRef(null),b=n.shallowRef(null),T=n.shallowRef(f||null),k=n.computed(()=>r&&S.value);let C,R;const V=()=>{r&&(C?.abort(),C=new AbortController,C.signal.onabort=()=>p.value=!0,s={...s,signal:C.signal})},P=A=>{S.value=A,v.value=!A};c&&(R=g.useTimeoutFn(V,c,{immediate:!1}));let I=0;const L=async(A=!1)=>{var U,G;V(),P(!0),b.value=null,w.value=null,p.value=!1,I+=1;const q=I,X={method:a.method,headers:{}},ee=n.toValue(a.payload);if(ee){const B=ae(X.headers),re=Object.getPrototypeOf(ee);!a.payloadType&&ee&&(re===Object.prototype||Array.isArray(re))&&!(ee instanceof FormData)&&(a.payloadType="json"),a.payloadType&&(B["Content-Type"]=(U=$n[a.payloadType])!=null?U:a.payloadType),X.body=a.payloadType==="json"?JSON.stringify(ee):ee}let Ot=!1;const K={url:n.toValue(e),options:{...X,...s},cancel:()=>{Ot=!0}};if(i.beforeFetch&&Object.assign(K,await i.beforeFetch(K)),Ot||!u)return P(!1),Promise.resolve(null);let J=null;return R&&R.start(),u(K.url,{...X,...K.options,headers:{...ae(X.headers),...ae((G=K.options)==null?void 0:G.headers)}}).then(async B=>{if(y.value=B,w.value=B.status,J=await B.clone()[a.type](),!B.ok)throw T.value=f||null,new Error(B.statusText);return i.afterFetch&&({data:J}=await i.afterFetch({data:J,response:B,context:K,execute:L})),T.value=J,d.trigger(B),B}).catch(async B=>{let re=B.message||B.name;if(i.onFetchError&&({error:re,data:J}=await i.onFetchError({data:J,error:B,response:y.value,context:K,execute:L})),b.value=re,i.updateDataOnError&&(T.value=J),h.trigger(B),A)throw B;return null}).finally(()=>{q===I&&P(!1),R&&R.stop(),m.trigger(null)})},_=g.toRef(i.refetch);n.watch([_,g.toRef(e)],([A])=>A&&L(),{deep:!0});const D={isFinished:n.readonly(v),isFetching:n.readonly(S),statusCode:w,response:y,error:b,data:T,canAbort:k,aborted:p,abort:V,execute:L,onFetchResponse:d.on,onFetchError:h.on,onFetchFinally:m.on,get:F("GET"),put:F("PUT"),post:F("POST"),delete:F("DELETE"),patch:F("PATCH"),head:F("HEAD"),options:F("OPTIONS"),json:H("json"),text:H("text"),blob:H("blob"),arrayBuffer:H("arrayBuffer"),formData:H("formData")};function F(A){return(U,G)=>{if(!S.value)return a.method=A,a.payload=U,a.payloadType=G,n.isRef(a.payload)&&n.watch([_,g.toRef(a.payload)],([q])=>q&&L(),{deep:!0}),{...D,then(q,X){return N().then(q,X)}}}}function N(){return new Promise((A,U)=>{g.until(v).toBe(!0).then(()=>A(D)).catch(U)})}function H(A){return()=>{if(!S.value)return a.type=A,{...D,then(U,G){return N().then(U,G)}}}}return i.immediate&&Promise.resolve().then(()=>L()),{...D,then(A,U){return N().then(A,U)}}}function qn(e,t){return!e.endsWith("/")&&!t.startsWith("/")?`${e}/${t}`:e.endsWith("/")&&t.startsWith("/")?`${e.slice(0,-1)}${t}`:`${e}${t}`}const Gn={multiple:!0,accept:"*",reset:!1,directory:!1};function Yn(e){if(!e)return null;if(e instanceof FileList)return e;const t=new DataTransfer;for(const o of e)t.items.add(o);return t.files}function Xn(e={}){const{document:t=j}=e,o=n.ref(Yn(e.initialFiles)),{on:l,trigger:r}=g.createEventHook(),{on:s,trigger:i}=g.createEventHook();let a;t&&(a=x(e.input)||t.createElement("input"),a.type="file",a.onchange=c=>{const d=c.target;o.value=d.files,r(o.value)},a.oncancel=()=>{i()});const u=()=>{o.value=null,a&&a.value&&(a.value="",r(null))},f=c=>{if(!a)return;const d={...Gn,...e,...c};a.multiple=d.multiple,a.accept=d.accept,a.webkitdirectory=d.directory,g.hasOwn(d,"capture")&&(a.capture=d.capture),d.reset&&u(),a.click()};return{files:n.readonly(o),open:f,reset:u,onCancel:s,onChange:l}}function Kn(e={}){const{window:t=M,dataType:o="Text"}=e,l=t,r=W(()=>l&&"showSaveFilePicker"in l&&"showOpenFilePicker"in l),s=n.shallowRef(),i=n.shallowRef(),a=n.shallowRef(),u=n.computed(()=>{var y,b;return(b=(y=a.value)==null?void 0:y.name)!=null?b:""}),f=n.computed(()=>{var y,b;return(b=(y=a.value)==null?void 0:y.type)!=null?b:""}),c=n.computed(()=>{var y,b;return(b=(y=a.value)==null?void 0:y.size)!=null?b:0}),d=n.computed(()=>{var y,b;return(b=(y=a.value)==null?void 0:y.lastModified)!=null?b:0});async function h(y={}){if(!r.value)return;const[b]=await l.showOpenFilePicker({...n.toValue(e),...y});s.value=b,await w()}async function m(y={}){r.value&&(s.value=await l.showSaveFilePicker({...e,...y}),i.value=void 0,await w(