import{A as e,B as t,F as n,I as r,L as i,N as a,P as o,R as s,U as c,W as l,_ as u,b as d,o as f,v as p,z as m}from"./runtime-core.esm-bundler-DTXUv7Wx.js";var h=typeof window<`u`,g,_=e=>g=e,v=Symbol();function y(e){return e&&typeof e==`object`&&Object.prototype.toString.call(e)===`[object Object]`&&typeof e.toJSON!=`function`}var b;(function(e){e.direct=`direct`,e.patchObject=`patch object`,e.patchFunction=`patch function`})(b||={});var x=typeof window==`object`&&window.window===window?window:typeof self==`object`&&self.self===self?self:typeof global==`object`&&global.global===global?global:typeof globalThis==`object`?globalThis:{HTMLElement:null};function S(e,{autoBom:t=!1}={}){return t&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob([``,e],{type:e.type}):e}function C(e,t,n){let r=new XMLHttpRequest;r.open(`GET`,e),r.responseType=`blob`,r.onload=function(){O(r.response,t,n)},r.onerror=function(){console.error(`could not download file`)},r.send()}function w(e){let t=new XMLHttpRequest;t.open(`HEAD`,e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function T(e){try{e.dispatchEvent(new MouseEvent(`click`))}catch{let t=new MouseEvent(`click`,{bubbles:!0,cancelable:!0,view:window,detail:0,screenX:80,screenY:20,clientX:80,clientY:20,ctrlKey:!1,altKey:!1,shiftKey:!1,metaKey:!1,button:0,relatedTarget:null});e.dispatchEvent(t)}}var E=typeof navigator==`object`?navigator:{userAgent:``},D=/Macintosh/.test(E.userAgent)&&/AppleWebKit/.test(E.userAgent)&&!/Safari/.test(E.userAgent),O=h?typeof HTMLAnchorElement<`u`&&`download`in HTMLAnchorElement.prototype&&!D?k:`msSaveOrOpenBlob`in E?A:j:()=>{};function k(e,t=`download`,n){let r=document.createElement(`a`);r.download=t,r.rel=`noopener`,typeof e==`string`?(r.href=e,r.origin===location.origin?T(r):w(r.href)?C(e,t,n):(r.target=`_blank`,T(r))):(r.href=URL.createObjectURL(e),setTimeout(function(){URL.revokeObjectURL(r.href)},4e4),setTimeout(function(){T(r)},0))}function A(e,t=`download`,n){if(typeof e==`string`)if(w(e))C(e,t,n);else{let t=document.createElement(`a`);t.href=e,t.target=`_blank`,setTimeout(function(){T(t)})}else navigator.msSaveOrOpenBlob(S(e,n),t)}function j(e,t,n,r){if(r||=open(``,`_blank`),r&&(r.document.title=r.document.body.innerText=`downloading...`),typeof e==`string`)return C(e,t,n);let i=e.type===`application/octet-stream`,a=/constructor/i.test(String(x.HTMLElement))||`safari`in x,o=/CriOS\/[\d]+/.test(navigator.userAgent);if((o||i&&a||D)&&typeof FileReader<`u`){let t=new FileReader;t.onloadend=function(){let e=t.result;if(typeof e!=`string`)throw r=null,Error(`Wrong reader.result type`);e=o?e:e.replace(/^data:[^;]*;/,`data:attachment/file;`),r?r.location.href=e:location.assign(e),r=null},t.readAsDataURL(e)}else{let t=URL.createObjectURL(e);r?r.location.assign(t):location.href=t,r=null,setTimeout(function(){URL.revokeObjectURL(t)},4e4)}}var{assign:M}=Object;function N(){let e=a(!0),n=e.run(()=>t({})),r=[],o=[],s=i({install(e){_(s),s._a=e,e.provide(v,s),e.config.globalProperties.$pinia=s,o.forEach(e=>r.push(e)),o=[]},use(e){return this._a?r.push(e):o.push(e),this},_p:r,_a:null,_e:e,_s:new Map,state:n});return s}var P=()=>{};function F(e,t,n,r=P){e.add(t);let i=()=>{e.delete(t)&&r()};return!n&&o()&&s(i),i}function I(e,...t){e.forEach(e=>{e(...t)})}var L=e=>e(),R=Symbol(),z=Symbol();function B(e,t){e instanceof Map&&t instanceof Map?t.forEach((t,n)=>e.set(n,t)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(let i in t){if(!t.hasOwnProperty(i))continue;let a=t[i],o=e[i];y(o)&&y(a)&&e.hasOwnProperty(i)&&!r(a)&&!n(a)?e[i]=B(o,a):e[i]=a}return e}var V=Symbol();function H(e){return!y(e)||!Object.prototype.hasOwnProperty.call(e,V)}var{assign:U}=Object;function W(e){return!!(r(e)&&e.effect)}function G(e,t,n,r){let{state:a,actions:o,getters:s}=t,c=n.state.value[e],u;function d(){return c||(n.state.value[e]=a?a():{}),U(l(n.state.value[e]),o,Object.keys(s||{}).reduce((t,r)=>(t[r]=i(f(()=>{_(n);let t=n._s.get(e);return s[r].call(t,t)})),t),{}))}return u=K(e,d,t,n,r,!0),u}function K(i,o,s={},l,u,f){let p,h=U({actions:{}},s),g={deep:!0},v,y,x=new Set,S=new Set,C=l.state.value[i];!f&&!C&&(l.state.value[i]={}),t({});let w;function T(e){let t;v=y=!1,typeof e==`function`?(e(l.state.value[i]),t={type:b.patchFunction,storeId:i,events:void 0}):(B(l.state.value[i],e),t={type:b.patchObject,payload:e,storeId:i,events:void 0});let n=w=Symbol();d().then(()=>{w===n&&(v=!0)}),y=!0,I(x,t,l.state.value[i])}let E=f?function(){let{state:e}=s,t=e?e():{};this.$patch(e=>{U(e,t)})}:P;function D(){p.stop(),x.clear(),S.clear(),l._s.delete(i)}let O=(e,t=``)=>{if(R in e)return e[z]=t,e;let n=function(){_(l);let t=Array.from(arguments),r=new Set,a=new Set;function o(e){r.add(e)}function s(e){a.add(e)}I(S,{args:t,name:n[z],store:k,after:o,onError:s});let c;try{c=e.apply(this&&this.$id===i?this:k,t)}catch(e){throw I(a,e),e}return c instanceof Promise?c.then(e=>(I(r,e),e)).catch(e=>(I(a,e),Promise.reject(e))):(I(r,c),c)};return n[R]=!0,n[z]=t,n},k=m({_p:l,$id:i,$onAction:F.bind(null,S),$patch:T,$reset:E,$subscribe(t,n={}){let r=F(x,t,n.detached,()=>a()),a=p.run(()=>e(()=>l.state.value[i],e=>{(n.flush===`sync`?y:v)&&t({storeId:i,type:b.direct,events:void 0},e)},U({},g,n)));return r},$dispose:D});l._s.set(i,k);let A=(l._a&&l._a.runWithContext||L)(()=>l._e.run(()=>(p=a()).run(()=>o({action:O}))));for(let e in A){let t=A[e];r(t)&&!W(t)||n(t)?f||(C&&H(t)&&(r(t)?t.value=C[e]:B(t,C[e])),l.state.value[i][e]=t):typeof t==`function`&&(A[e]=O(t,e),h.actions[e]=t)}return U(k,A),U(c(k),A),Object.defineProperty(k,`$state`,{get:()=>l.state.value[i],set:e=>{T(t=>{U(t,e)})}}),l._p.forEach(e=>{U(k,p.run(()=>e({store:k,app:l._a,pinia:l,options:h})))}),C&&f&&s.hydrate&&s.hydrate(k.$state,C),v=!0,y=!0,k}function q(e,t,n){let r,i=typeof t==`function`;r=i?n:t;function a(n,a){let o=u();return n||=o?p(v,null):null,n&&_(n),n=g,n._s.has(e)||(i?K(e,t,r,n):G(e,r,n)),n._s.get(e)}return a.$id=e,a}export{q as n,N as t};